From 501f1ce273ba488f258bee6fa964e70e8f9aa351 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Thu, 11 Aug 2022 17:34:57 +0300 Subject: [PATCH] - build --- docs/index.html | 2 +- docs/js/app.1ba33aff.js | 2 ++ docs/js/app.1ba33aff.js.map | 1 + docs/js/app.faf311ed.js | 2 -- docs/js/app.faf311ed.js.map | 1 - 5 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 docs/js/app.1ba33aff.js create mode 100644 docs/js/app.1ba33aff.js.map delete mode 100644 docs/js/app.faf311ed.js delete mode 100644 docs/js/app.faf311ed.js.map diff --git a/docs/index.html b/docs/index.html index 6cf547d..0a7fab3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,4 +15,4 @@ webvisor: true });

Wavelovers

\ No newline at end of file + }

Wavelovers

\ No newline at end of file diff --git a/docs/js/app.1ba33aff.js b/docs/js/app.1ba33aff.js new file mode 100644 index 0000000..184711b --- /dev/null +++ b/docs/js/app.1ba33aff.js @@ -0,0 +1,2 @@ +(function(){"use strict";var t={4682:function(t,e,n){var a=n(9242),i=n(3396);const r={class:"wavelovers"},o=(0,i.Uk)("Press any gamepad button or connect a new gamepad to vibrate.");function s(t,e,n,a,s,c){const u=(0,i.up)("NavigationList"),d=(0,i.up)("router-view"),m=(0,i.up)("GamepadList"),p=(0,i.up)("MessageItem");return(0,i.wg)(),(0,i.iD)("div",r,[(0,i.Wm)(u),(0,i.Wm)(d),t.gamepads.length>0?((0,i.wg)(),(0,i.j4)(m,{key:0,gamepads:t.gamepads},null,8,["gamepads"])):((0,i.wg)(),(0,i.j4)(p,{key:1},{default:(0,i.w5)((()=>[o])),_:1}))])}var c=n(1746);const u={class:"content-item navigation-list"},d=(0,i.Uk)("Patterns"),m=(0,i.Uk)("Custom"),p=(0,i.Uk)("Manual"),l=(0,i.Uk)("Diagnostic");function f(t,e,n,a,r,o){const s=(0,i.up)("router-link");return(0,i.wg)(),(0,i.iD)("div",u,[(0,i.Wm)(s,{to:"/",class:"navigation-item"},{default:(0,i.w5)((()=>[d])),_:1}),(0,i.Wm)(s,{to:"/custom",class:"navigation-item"},{default:(0,i.w5)((()=>[m])),_:1}),(0,i.Wm)(s,{to:"/manual",class:"navigation-item"},{default:(0,i.w5)((()=>[p])),_:1}),(0,i.Wm)(s,{to:"/diagnostic",class:"navigation-item"},{default:(0,i.w5)((()=>[l])),_:1})])}var v=(0,i.aZ)({name:"NavigationList"}),g=n(89);const h=(0,g.Z)(v,[["render",f]]);var b=h,w=n(7139);const y={class:"content-item device-list"};function A(t,e,n,a,r,o){const s=(0,i.up)("GamepadItem");return(0,i.wg)(),(0,i.iD)("div",y,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(t.gamepads,(t=>((0,i.wg)(),(0,i.j4)(s,{key:t.id,textContent:(0,w.zw)(t.unit.id)},null,8,["textContent"])))),128))])}const k={class:"list-item"};function Z(t,e,n,a,r,o){return(0,i.wg)(),(0,i.iD)("div",k)}var C=(0,i.aZ)({name:"GamepadItem"});const E=(0,g.Z)(C,[["render",Z]]);var _=E,P=(0,i.aZ)({name:"GamepadList",props:{gamepads:{type:Array}},components:{GamepadItem:_}});const j=(0,g.Z)(P,[["render",A]]);var L=j;const I={class:"content-item message"};function x(t,e,n,a,r,o){return(0,i.wg)(),(0,i.iD)("div",I,[(0,i._)("span",null,[(0,i.WI)(t.$slots,"default")])])}var G=(0,i.aZ)({name:"MessageItem"});const O=(0,g.Z)(G,[["render",x]]);var M=O,D=(0,i.aZ)({name:"App",components:{NavigationList:b,GamepadList:L,MessageItem:M},computed:{gamepads:function(){return c.Z.getters.gamepads}},methods:{addEventListeners(){window.addEventListener("gamepadconnected",(t=>c.Z.dispatch("addGamepad",t))),window.addEventListener("gamepaddisconnected",(t=>c.Z.dispatch("deleteGamepad",t)))},removeEventListeners(){window.removeEventListener("gamepadconnected",(t=>c.Z.dispatch("addGamepad",t))),window.removeEventListener("gamepaddisconnected",(t=>c.Z.dispatch("deleteGamepad",t)))}},mounted(){this.addEventListeners()},unmounted(){this.removeEventListeners()}});const N=(0,g.Z)(D,[["render",s]]);var T=N,S=n(2483);function V(t,e,n,a,r,o){const s=(0,i.up)("AppPatterns");return(0,i.wg)(),(0,i.j4)(s)}const U={class:"app-patterns"},W=(0,i.Uk)("Loading...");function B(t,e,n,a,r,o){const s=(0,i.up)("PatternList"),c=(0,i.up)("MessageItem");return(0,i.wg)(),(0,i.iD)("div",U,[t.patterns.length>0?((0,i.wg)(),(0,i.j4)(s,{key:0,patterns:t.patterns,mode:t.mode,isActive:t.isActive,onChange:t.change},null,8,["patterns","mode","isActive","onChange"])):((0,i.wg)(),(0,i.j4)(c,{key:1},{default:(0,i.w5)((()=>[W])),_:1}))])}const z={class:"content-item pattern-list"};function F(t,e,n,a,r,o){const s=(0,i.up)("PatternItem");return(0,i.wg)(),(0,i.iD)("div",z,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(t.patterns,((e,n)=>((0,i.wg)(),(0,i.j4)(s,{key:e.name,pattern:e,index:n,mode:t.mode,isActive:t.isActive,onChange:t.change},null,8,["pattern","index","mode","isActive","onChange"])))),128))])}const q=["textContent"],H={class:"pattern-item__info-container"},K=["textContent"],$=["textContent"];function Y(t,e,n,a,r,o){return(0,i.wg)(),(0,i.iD)("div",{onClick:e[0]||(e[0]=e=>t.change(t.index)),class:(0,w.C_)(["pattern-item",t.index===t.mode&&!0===t.isActive?"pattern-item_selected":""])},[(0,i._)("span",{class:"pattern-item__icon",textContent:(0,w.zw)(t.pattern.icon)},null,8,q),(0,i._)("div",H,[(0,i._)("span",{class:"pattern-item__name",textContent:(0,w.zw)(t.pattern.name)},null,8,K),(0,i._)("span",{class:"pattern-item__type",textContent:(0,w.zw)(t.pattern.type)},null,8,$)])],2)}var J=(0,i.aZ)({name:"PatternItem",props:{pattern:{type:Object},index:{type:Number},mode:{type:Number},isActive:{type:Boolean}},methods:{change:function(t){this.$emit("change",t)}}});const Q=(0,g.Z)(J,[["render",Y]]);var R=Q,X=(0,i.aZ)({name:"PatternList",props:{patterns:{type:Array},mode:{type:Number},isActive:{type:Boolean}},components:{PatternItem:R},methods:{change:function(t){this.$emit("change",t)}}});const tt=(0,g.Z)(X,[["render",F]]);var et=tt,nt=(0,i.aZ)({name:"AppPatterns",components:{PatternList:et,MessageItem:M},computed:{patterns:function(){return c.Z.getters.patterns},mode:function(){return c.Z.getters.mode},isActive:function(){return c.Z.getters.isActive}},methods:{change(t){c.Z.dispatch("change",t)}},mounted(){c.Z.dispatch("loadPatterns")}});const at=(0,g.Z)(nt,[["render",B]]);var it=at,rt=(0,i.aZ)({name:"PatternsView",components:{AppPatterns:it}});const ot=(0,g.Z)(rt,[["render",V]]);var st=ot;function ct(t,e,n){switch(t.fullPath){case"/?custom":ht.push("/custom");break;case"/?manual":ht.push("/manual");break;case"/?diagnostic":ht.push("/diagnostic");break}return n()}const ut={update:ct};var dt=ut;function mt(t,e){t.map((t=>{const n=document.createElement(e);return Object.keys(t).forEach((e=>{n.setAttribute(e,t[e])})),n.setAttribute("data-vue-router-controlled",""),n})).forEach((t=>document.head.appendChild(t)))}function pt(t,e,n){const a=t.matched.slice().reverse().find((t=>t.meta&&t.meta.title)),i=t.matched.slice().reverse().find((t=>t.meta&&t.meta.metaTags&&t.meta.linkTags));if(a&&(document.title=a.meta.title),Array.from(document.querySelectorAll("[data-vue-router-controlled]")).map((t=>{t.parentNode&&t.parentNode.removeChild(t)})),!i)return n();const r=i.meta.linkTags,o=i.meta.metaTags;return mt(r,"link"),mt(o,"meta"),n()}const lt={update:pt};var ft=lt;const vt=[{path:"/",name:"patterns-view",component:st},{path:"/custom",name:"custom-view",component:()=>n.e(441).then(n.bind(n,441))},{path:"/manual",name:"manual-view",component:()=>n.e(941).then(n.bind(n,8941))},{path:"/diagnostic",name:"diagnostic-view",component:()=>n.e(264).then(n.bind(n,2264))},{path:"/404",name:"404",component:()=>n.e(567).then(n.bind(n,7567))},{path:"/:catchAll(.*)*",redirect:"/404"}],gt=(0,S.p7)({history:(0,S.PO)("/"),routes:vt});gt.beforeEach(dt.update),gt.beforeEach(ft.update);var ht=gt;(0,a.ri)(T).use(c.Z).use(ht).mount("#app")},1746:function(t,e,n){n.d(e,{Z:function(){return p}});var a=n(65),i=n(2482);class r{constructor(t){(0,i.Z)(this,"unit",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"canVibrate",void 0),(0,i.Z)(this,"isVibrating",void 0),(0,i.Z)(this,"interval",void 0),this.unit=t,this.id=Date.now(),this.canVibrate=!!this.unit.vibrationActuator,this.isVibrating=!1,this.update=this.update.bind(this),this.interval=setInterval(this.update,1)}update(){const t=navigator.getGamepads();this.unit=t[this.unit.index]}async loop(t){this.isVibrating=!0;const e=10;while(!0===this.isVibrating)for(let n=0;nsetTimeout(e,t)))}}var o=r;const s={state:()=>({gamepads:[]}),getters:{gamepads:function(t){return t.gamepads}},mutations:{addGamepad:function(t,e){t.gamepads.push(e)},deleteGamepad:function(t,e){t.gamepads.splice(e,1)}},actions:{addGamepad:function(t,e){const n=e;t.getters.gamepads.length>=1||t.commit("addGamepad",new o(n.gamepad))},deleteGamepad:function(t,e){t.getters.gamepads.forEach(((n,a)=>{n.unit.id===e.gamepad.id&&t.commit("deleteGamepad",a)}))},loop:function(t,e){t.getters.gamepads.forEach((t=>{t.loop(e)}))},vibrate:function(t,e){t.getters.gamepads.forEach((t=>{t.vibrate(e)}))},reset:function(t){t.getters.gamepads.forEach((t=>{t.reset()}))}}};var c=s;const u={state:()=>({patterns:[]}),getters:{patterns:function(t){return t.patterns}},mutations:{setPatterns:function(t,e){t.patterns=e}},actions:{loadPatterns:async function(t){const e="https://wavelovers.ru/assets/patterns.json";try{const n=await fetch(e);if(n.ok){const e=await n.json();t.commit("setPatterns",e)}else console.log("Connect to the Internet for download more patterns...")}catch(n){console.log(n)}}}};var d=u;const m=(0,a.MT)({state:()=>({mode:0,isActive:!1}),getters:{mode:function(t){return t.mode},isActive:function(t){return t.isActive}},mutations:{setMode:function(t,e){t.mode=e},setIsActive:function(t,e){t.isActive=e}},actions:{setMode:function(t,e){t.commit("setMode",e)},setIsActive:function(t,e){t.commit("setIsActive",e)},change:function(t,e){t.getters.mode===e?t.dispatch("setIsActive",!t.getters.isActive):(t.dispatch("setIsActive",!0),t.dispatch("setMode",e)),!0===t.getters.isActive?(t.dispatch("reset"),t.dispatch("loop",t.getters.patterns[t.getters.mode].pattern)):t.dispatch("reset")},startCustom:function(t,e){t.dispatch("setIsActive",!1),t.dispatch("setMode",0),t.dispatch("reset"),t.dispatch("loop",e)}},modules:{MGamepads:c,MPatterns:d}});var p=m}},e={};function n(a){var i=e[a];if(void 0!==i)return i.exports;var r=e[a]={exports:{}};return t[a](r,r.exports,n),r.exports}n.m=t,function(){var t=[];n.O=function(e,a,i,r){if(!a){var o=1/0;for(d=0;d=r)&&Object.keys(n.O).every((function(t){return n.O[t](a[c])}))?a.splice(c--,1):(s=!1,r0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[a,i,r]}}(),function(){n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,{a:e}),e}}(),function(){n.d=function(t,e){for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}}(),function(){n.f={},n.e=function(t){return Promise.all(Object.keys(n.f).reduce((function(e,a){return n.f[a](t,e),e}),[]))}}(),function(){n.u=function(t){return"js/"+t+"."+{264:"5a60390d",441:"be7aaf75",567:"681eca51",941:"6295b5fd"}[t]+".js"}}(),function(){n.miniCssF=function(t){return"css/"+t+"."+{264:"10b8ac32",441:"19a8cda3",941:"06b3a622"}[t]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){var t={},e="wavelovers:";n.l=function(a,i,r,o){if(t[a])t[a].push(i);else{var s,c;if(void 0!==r)for(var u=document.getElementsByTagName("script"),d=0;d 0)\n ? (_openBlock(), _createBlock(_component_GamepadList, {\n key: 0,\n gamepads: _ctx.gamepads\n }, null, 8, [\"gamepads\"]))\n : (_openBlock(), _createBlock(_component_MessageItem, { key: 1 }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }))\n ]))\n}","import { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"content-item navigation-list\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\"Patterns\")\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"Custom\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"Manual\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"Diagnostic\")\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_router_link = _resolveComponent(\"router-link\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_router_link, {\n to: \"/\",\n class: \"navigation-item\"\n }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }),\n _createVNode(_component_router_link, {\n to: \"/custom\",\n class: \"navigation-item\"\n }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n }),\n _createVNode(_component_router_link, {\n to: \"/manual\",\n class: \"navigation-item\"\n }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_router_link, {\n to: \"/diagnostic\",\n class: \"navigation-item\"\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n })\n ]))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'NavigationList',\r\n });\r\n","import { render } from \"./NavigationList.vue?vue&type=template&id=2bbb40f5&ts=true\"\nimport script from \"./NavigationList.vue?vue&type=script&lang=ts\"\nexport * from \"./NavigationList.vue?vue&type=script&lang=ts\"\n\nimport \"./NavigationList.vue?vue&type=style&index=0&id=2bbb40f5&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, toDisplayString as _toDisplayString, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"content-item device-list\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_GamepadItem = _resolveComponent(\"GamepadItem\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.gamepads, (gamepad) => {\n return (_openBlock(), _createBlock(_component_GamepadItem, {\n key: gamepad.id,\n textContent: _toDisplayString(gamepad.unit.id)\n }, null, 8, [\"textContent\"]))\n }), 128))\n ]))\n}","import { openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"list-item\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'GamepadItem',\r\n });\r\n","import { render } from \"./GamepadItem.vue?vue&type=template&id=e6e6c988&ts=true\"\nimport script from \"./GamepadItem.vue?vue&type=script&lang=ts\"\nexport * from \"./GamepadItem.vue?vue&type=script&lang=ts\"\n\nimport \"./GamepadItem.vue?vue&type=style&index=0&id=e6e6c988&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import GamepadItem from '@/components/GamepadItem.vue';\r\n\r\n export default defineComponent({\r\n name: 'GamepadList',\r\n props: {\r\n gamepads: {\r\n type: Array,\r\n },\r\n },\r\n components: {\r\n GamepadItem: GamepadItem,\r\n },\r\n });\r\n ","import { render } from \"./GamepadList.vue?vue&type=template&id=16065af4&ts=true\"\nimport script from \"./GamepadList.vue?vue&type=script&lang=ts\"\nexport * from \"./GamepadList.vue?vue&type=script&lang=ts\"\n\nimport \"./GamepadList.vue?vue&type=style&index=0&id=16065af4&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { renderSlot as _renderSlot, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"content-item message\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"span\", null, [\n _renderSlot(_ctx.$slots, \"default\")\n ])\n ]))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'MessageItem',\r\n });\r\n","import { render } from \"./MessageItem.vue?vue&type=template&id=31b477d2&ts=true\"\nimport script from \"./MessageItem.vue?vue&type=script&lang=ts\"\nexport * from \"./MessageItem.vue?vue&type=script&lang=ts\"\n\nimport \"./MessageItem.vue?vue&type=style&index=0&id=31b477d2&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import store from '@/store/index';\r\n import NavigationList from '@/components/NavigationList.vue';\r\n import GamepadList from '@/components/GamepadList.vue';\r\n import MessageItem from '@/components/MessageItem.vue';\r\n import Vibrator from '@/models/Vibrator';\r\n\r\n export default defineComponent({\r\n name: 'App',\r\n components: {\r\n NavigationList: NavigationList,\r\n GamepadList: GamepadList,\r\n MessageItem: MessageItem,\r\n },\r\n computed: {\r\n gamepads: function (): Vibrator[] {\r\n return store.getters.gamepads as Vibrator[];\r\n },\r\n },\r\n methods: {\r\n addEventListeners(): void {\r\n window.addEventListener('gamepadconnected', (event: GamepadEvent) => store.dispatch('addGamepad', event));\r\n window.addEventListener('gamepaddisconnected', (event: GamepadEvent) => store.dispatch('deleteGamepad', event));\r\n },\r\n removeEventListeners(): void {\r\n window.removeEventListener('gamepadconnected', (event: GamepadEvent) => store.dispatch('addGamepad', event));\r\n window.removeEventListener('gamepaddisconnected', (event: GamepadEvent) => store.dispatch('deleteGamepad', event));\r\n },\r\n },\r\n mounted() {\r\n this.addEventListeners();\r\n },\r\n unmounted() {\r\n this.removeEventListeners();\r\n },\r\n });\r\n","import { render } from \"./App.vue?vue&type=template&id=7f0977f6&ts=true\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_AppPatterns = _resolveComponent(\"AppPatterns\")!\n\n return (_openBlock(), _createBlock(_component_AppPatterns))\n}","import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"app-patterns\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\"Loading...\")\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_PatternList = _resolveComponent(\"PatternList\")!\n const _component_MessageItem = _resolveComponent(\"MessageItem\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_ctx.patterns.length > 0)\n ? (_openBlock(), _createBlock(_component_PatternList, {\n key: 0,\n patterns: _ctx.patterns,\n mode: _ctx.mode,\n isActive: _ctx.isActive,\n onChange: _ctx.change\n }, null, 8, [\"patterns\", \"mode\", \"isActive\", \"onChange\"]))\n : (_openBlock(), _createBlock(_component_MessageItem, { key: 1 }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }))\n ]))\n}","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"content-item pattern-list\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_PatternItem = _resolveComponent(\"PatternItem\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.patterns, (pattern, index) => {\n return (_openBlock(), _createBlock(_component_PatternItem, {\n key: pattern.name,\n pattern: pattern,\n index: index,\n mode: _ctx.mode,\n isActive: _ctx.isActive,\n onChange: _ctx.change\n }, null, 8, [\"pattern\", \"index\", \"mode\", \"isActive\", \"onChange\"]))\n }), 128))\n ]))\n}","import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"textContent\"]\nconst _hoisted_2 = { class: \"pattern-item__info-container\" }\nconst _hoisted_3 = [\"textContent\"]\nconst _hoisted_4 = [\"textContent\"]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"div\", {\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.change(_ctx.index))),\n class: _normalizeClass(['pattern-item',\r\n _ctx.index === _ctx.mode && _ctx.isActive === true ?\r\n 'pattern-item_selected' : '',\r\n ])\n }, [\n _createElementVNode(\"span\", {\n class: \"pattern-item__icon\",\n textContent: _toDisplayString(_ctx.pattern.icon)\n }, null, 8, _hoisted_1),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"span\", {\n class: \"pattern-item__name\",\n textContent: _toDisplayString(_ctx.pattern.name)\n }, null, 8, _hoisted_3),\n _createElementVNode(\"span\", {\n class: \"pattern-item__type\",\n textContent: _toDisplayString(_ctx.pattern.type)\n }, null, 8, _hoisted_4)\n ])\n ], 2))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'PatternItem',\r\n props: {\r\n pattern: {\r\n type: Object,\r\n },\r\n index: {\r\n type: Number,\r\n },\r\n mode: {\r\n type: Number,\r\n },\r\n isActive: {\r\n type: Boolean,\r\n },\r\n },\r\n methods: {\r\n change: function (index: number): void {\r\n this.$emit('change', index as number);\r\n },\r\n },\r\n });\r\n","import { render } from \"./PatternItem.vue?vue&type=template&id=7dfe2650&ts=true\"\nimport script from \"./PatternItem.vue?vue&type=script&lang=ts\"\nexport * from \"./PatternItem.vue?vue&type=script&lang=ts\"\n\nimport \"./PatternItem.vue?vue&type=style&index=0&id=7dfe2650&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import PatternItem from '@/components/PatternItem.vue';\r\n\r\n export default defineComponent({\r\n name: 'PatternList',\r\n props: {\r\n patterns: {\r\n type: Array,\r\n },\r\n mode: {\r\n type: Number,\r\n },\r\n isActive: {\r\n type: Boolean,\r\n },\r\n },\r\n components: {\r\n PatternItem: PatternItem,\r\n },\r\n methods: {\r\n change: function (index: number): void {\r\n this.$emit('change', index as number);\r\n },\r\n },\r\n });\r\n","import { render } from \"./PatternList.vue?vue&type=template&id=0515b58e&ts=true\"\nimport script from \"./PatternList.vue?vue&type=script&lang=ts\"\nexport * from \"./PatternList.vue?vue&type=script&lang=ts\"\n\nimport \"./PatternList.vue?vue&type=style&index=0&id=0515b58e&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import store from '@/store/index';\r\n import PatternList from '@/components/PatternList.vue';\r\n import MessageItem from '@/components/MessageItem.vue';\r\n import TPattern from '@/models/TPattern';\r\n\r\n export default defineComponent({\r\n name: 'AppPatterns',\r\n components: {\r\n PatternList: PatternList,\r\n MessageItem: MessageItem,\r\n },\r\n computed: {\r\n patterns: function (): TPattern[] {\r\n return store.getters.patterns as TPattern[];\r\n },\r\n mode: function (): number {\r\n return store.getters.mode as number;\r\n },\r\n isActive: function (): boolean {\r\n return store.getters.isActive as boolean;\r\n },\r\n },\r\n methods: {\r\n change(index: number): void {\r\n store.dispatch('change', index as number);\r\n },\r\n },\r\n mounted() {\r\n store.dispatch('loadPatterns');\r\n },\r\n });\r\n","import { render } from \"./AppPatterns.vue?vue&type=template&id=44c5840c&ts=true\"\nimport script from \"./AppPatterns.vue?vue&type=script&lang=ts\"\nexport * from \"./AppPatterns.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import AppPatterns from '@/components/AppPatterns.vue';\r\n\r\n export default defineComponent({\r\n name: 'PatternsView',\r\n components: {\r\n AppPatterns: AppPatterns,\r\n },\r\n });\r\n","import { render } from \"./PatternsView.vue?vue&type=template&id=440c70d9&ts=true\"\nimport script from \"./PatternsView.vue?vue&type=script&lang=ts\"\nexport * from \"./PatternsView.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import router from '@/router';\r\nimport { NavigationGuardNext, RouteLocationNormalized, RouteRecordNormalized } from \"vue-router\";\r\n\r\nfunction updateRoute(\r\n to: RouteLocationNormalized,\r\n from: RouteLocationNormalized,\r\n next: NavigationGuardNext\r\n) {\r\n switch (to.fullPath) {\r\n case '/?custom':\r\n router.push('/custom');\r\n break;\r\n case '/?manual':\r\n router.push('/manual');\r\n break;\r\n case '/?diagnostic':\r\n router.push('/diagnostic');\r\n break;\r\n }\r\n return next();\r\n}\r\n\r\nconst VueRouterQueryRoutes = {\r\n update: updateRoute,\r\n};\r\n\r\nexport default VueRouterQueryRoutes;\r\n\r\n","import { NavigationGuardNext, RouteLocationNormalized, RouteRecordNormalized } from \"vue-router\";\r\n\r\nfunction appendTags(tagsArray: object[], type: string) {\r\n tagsArray.map((meta: object) => {\r\n const tag = document.createElement(type);\r\n (Object.keys(meta) as Array)\r\n .forEach((key) => {\r\n tag.setAttribute(key, meta[key] as string);\r\n });\r\n tag.setAttribute('data-vue-router-controlled', '');\r\n return tag;\r\n }).forEach(tag => document.head.appendChild(tag));\r\n}\r\n\r\nfunction updateMetatag(\r\n to: RouteLocationNormalized,\r\n from: RouteLocationNormalized,\r\n next: NavigationGuardNext\r\n) {\r\n const nearestWithTitle: RouteRecordNormalized =\r\n to.matched.slice().reverse()\r\n .find(r => r.meta && r.meta.title) as RouteRecordNormalized;\r\n const nearestWithMeta: RouteRecordNormalized =\r\n to.matched.slice().reverse()\r\n .find(r => r.meta && r.meta.metaTags && r.meta.linkTags) as RouteRecordNormalized;\r\n if (nearestWithTitle) {\r\n document.title = nearestWithTitle.meta.title as string;\r\n }\r\n Array.from(document.querySelectorAll('[data-vue-router-controlled]'))\r\n .map(el => {\r\n if (el.parentNode) {\r\n el.parentNode.removeChild(el);\r\n }\r\n });\r\n if (!nearestWithMeta) return next();\r\n const linkTags: object[] = nearestWithMeta.meta.linkTags as object[];\r\n const metaTags: object[] = nearestWithMeta.meta.metaTags as object[];\r\n appendTags(linkTags, 'link');\r\n appendTags(metaTags, 'meta');\r\n return next();\r\n}\r\n\r\nconst VueRouterMetaTags = {\r\n update: updateMetatag,\r\n};\r\n\r\nexport default VueRouterMetaTags;\r\n\r\n","import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';\r\nimport PatternsView from '@/views/PatternsView.vue';\r\nimport VueRouterQueryRoutes from '@/router/modules/VueRouterQueryRoute';\r\nimport VueRouterMetaTags from '@/router/modules/VueRouterMetaTags';\r\n\r\nconst routes: Array = [\r\n {\r\n path: '/',\r\n name: 'patterns-view',\r\n component: PatternsView,\r\n },\r\n {\r\n path: '/custom',\r\n name: 'custom-view',\r\n component: () => import('@/views/CustomView.vue'),\r\n },\r\n {\r\n path: '/manual',\r\n name: 'manual-view',\r\n component: () => import('@/views/ManualView.vue'),\r\n },\r\n {\r\n path: '/diagnostic',\r\n name: 'diagnostic-view',\r\n component: () => import('@/views/DiagnosticView.vue'),\r\n },\r\n {\r\n path: '/404',\r\n name: '404',\r\n component: () => import('@/views/NotFoundView.vue'),\r\n },\r\n {\r\n path: '/:catchAll(.*)*',\r\n redirect: '/404',\r\n },\r\n];\r\n\r\nconst router = createRouter({\r\n history: createWebHistory(process.env.BASE_URL),\r\n routes,\r\n});\r\n\r\nrouter.beforeEach(VueRouterQueryRoutes.update);\r\nrouter.beforeEach(VueRouterMetaTags.update);\r\n\r\nexport default router;\r\n\r\n","import { createApp } from 'vue';\r\nimport App from '@/App.vue';\r\nimport router from '@/router';\r\nimport store from '@/store';\r\n\r\ncreateApp(App).use(store).use(router).mount('#app');\r\n\r\n","import TPatternUnit from '@/models/TPatternUnit';\r\nimport IGamepad from '@/models/IGamepad';\r\nimport IVibrator from '@/models/IVibrator';\r\n\r\nclass Vibrator implements IVibrator {\r\n\r\n unit: IGamepad;\r\n readonly id: number;\r\n readonly canVibrate: boolean;\r\n isVibrating: boolean;\r\n interval: number;\r\n\r\n constructor(unit: IGamepad) {\r\n this.unit = unit;\r\n this.id = Date.now();\r\n this.canVibrate = (this.unit.vibrationActuator) ? true : false;\r\n this.isVibrating = false;\r\n this.update = this.update.bind(this);\r\n this.interval = setInterval(this.update, 1);\r\n }\r\n\r\n update(): void {\r\n const gamepads = navigator.getGamepads();\r\n this.unit = gamepads[this.unit.index] as unknown as IGamepad;\r\n }\r\n\r\n async loop(pattern: TPatternUnit[]) {\r\n this.isVibrating = true;\r\n const offsetTime = 10;\r\n while (this.isVibrating === true) {\r\n for (let i = 0; i < pattern.length; i++) {\r\n if (this.isVibrating === true) {\r\n this.vibrate(pattern[i]);\r\n await this.sleep(pattern[i].startDelay + pattern[i].duration - offsetTime);\r\n } else {\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n vibrate(pattern: TPatternUnit): void {\r\n this.unit.vibrationActuator.playEffect('dual-rumble', pattern);\r\n }\r\n\r\n reset(): void {\r\n this.isVibrating = false;\r\n this.unit.vibrationActuator.reset();\r\n }\r\n\r\n sleep(ms: number): Promise {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n }\r\n}\r\n\r\nexport default Vibrator;\r\n\r\n","import { ActionContext, Module } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport IGamepadsState from '@/store/models/IGamepadsState';\r\nimport Vibrator from '@/models/Vibrator';\r\nimport IGamepad from '@/models/IGamepad';\r\nimport IGamepadEvent from '@/models/IGamepadEvent';\r\nimport TPatternUnit from '@/models/TPatternUnit';\r\n\r\nconst MGamepads: Module = {\r\n state: () => ({\r\n gamepads: [] as Vibrator[],\r\n }),\r\n getters: {\r\n gamepads: function (state: IGamepadsState): Vibrator[] {\r\n return state.gamepads as Vibrator[];\r\n },\r\n },\r\n mutations: {\r\n addGamepad: function (state: IGamepadsState, gamepad: Vibrator): void {\r\n state.gamepads.push(gamepad as Vibrator);\r\n },\r\n deleteGamepad: function (state: IGamepadsState, index: number): void {\r\n state.gamepads.splice(index, 1);\r\n },\r\n },\r\n actions: {\r\n addGamepad: function (\r\n context: ActionContext,\r\n event: GamepadEvent\r\n ): void {\r\n const iEvent: IGamepadEvent = event as unknown as IGamepadEvent;\r\n if (context.getters.gamepads.length >= 1) {\r\n return;\r\n } else {\r\n context.commit('addGamepad', new Vibrator(iEvent.gamepad as IGamepad));\r\n }\r\n },\r\n deleteGamepad: function (\r\n context: ActionContext,\r\n event: GamepadEvent\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator, index: number) => {\r\n if (gamepad.unit.id === event.gamepad.id) {\r\n context.commit('deleteGamepad', index as number);\r\n }\r\n });\r\n },\r\n loop: function (\r\n context: ActionContext,\r\n pattern: TPatternUnit[]\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.loop(pattern);\r\n });\r\n },\r\n vibrate: function (\r\n context: ActionContext,\r\n pattern: TPatternUnit\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.vibrate(pattern);\r\n });\r\n },\r\n reset: function (\r\n context: ActionContext\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.reset();\r\n });\r\n },\r\n },\r\n};\r\n\r\nexport default MGamepads;\r\n\r\n","import { ActionContext, Module } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport IPatternState from '@/store/models/IPatternState';\r\nimport TPattern from '@/models/TPattern';\r\n\r\nconst MPatterns: Module = {\r\n state: () => ({\r\n patterns: [] as TPattern[],\r\n }),\r\n getters: {\r\n patterns: function (state: IPatternState): TPattern[] {\r\n return state.patterns as TPattern[];\r\n },\r\n },\r\n mutations: {\r\n setPatterns: function (state: IPatternState, patterns: TPattern[]): void {\r\n state.patterns = patterns as TPattern[];\r\n },\r\n },\r\n actions: {\r\n loadPatterns: async function (\r\n context: ActionContext\r\n ): Promise {\r\n const url = 'https://wavelovers.ru/assets/patterns.json';\r\n try {\r\n const response: Response = await fetch(url);\r\n if (response.ok) {\r\n const json: TPattern[] = await response.json();\r\n context.commit('setPatterns', json as TPattern[]);\r\n } else {\r\n // eslint-disable-next-line\r\n console.log('Connect to the Internet for download more patterns...');\r\n }\r\n } catch (error) {\r\n // eslint-disable-next-line\r\n console.log(error);\r\n }\r\n },\r\n },\r\n};\r\n\r\nexport default MPatterns;\r\n\r\n","import { createStore, Store } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport MGamepads from '@/store/modules/MGamepads';\r\nimport MPatterns from '@/store/modules/MPatterns';\r\nimport TPatternUnit from '@/models/TPatternUnit';\r\n\r\nconst store: Store = createStore({\r\n state: () => ({\r\n mode: 0 as number,\r\n isActive: false as boolean,\r\n }),\r\n getters: {\r\n mode: function (state: IRootState): number {\r\n return state.mode as number;\r\n },\r\n isActive: function (state: IRootState): boolean {\r\n return state.isActive as boolean;\r\n },\r\n },\r\n mutations: {\r\n setMode: function (state: IRootState, mode: number): void {\r\n state.mode = mode as number;\r\n },\r\n setIsActive: function (state: IRootState, isActive: boolean): void {\r\n state.isActive = isActive as boolean;\r\n },\r\n },\r\n actions: {\r\n setMode: function (context, index: number): void {\r\n context.commit('setMode', index as number);\r\n },\r\n setIsActive: function (context, isActive: boolean): void {\r\n context.commit('setIsActive', isActive as boolean);\r\n },\r\n change: function (context, index: number): void {\r\n if (context.getters.mode === index) {\r\n context.dispatch('setIsActive', !context.getters.isActive);\r\n } else {\r\n context.dispatch('setIsActive', true);\r\n context.dispatch('setMode', index);\r\n }\r\n if (context.getters.isActive === true) {\r\n context.dispatch('reset');\r\n context.dispatch('loop', context.getters.patterns[context.getters.mode].pattern);\r\n } else {\r\n context.dispatch('reset');\r\n }\r\n },\r\n startCustom: function (context, pattern: TPatternUnit[]): void {\r\n context.dispatch('setIsActive', false);\r\n context.dispatch('setMode', 0);\r\n context.dispatch('reset');\r\n context.dispatch('loop', pattern);\r\n },\r\n },\r\n modules: {\r\n MGamepads: MGamepads,\r\n MPatterns: MPatterns,\r\n },\r\n});\r\n\r\nexport default store;\r\n\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + chunkId + \".\" + {\"264\":\"5a60390d\",\"441\":\"be7aaf75\",\"567\":\"681eca51\",\"941\":\"6295b5fd\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"css/\" + chunkId + \".\" + {\"264\":\"10b8ac32\",\"441\":\"19a8cda3\",\"941\":\"06b3a622\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"wavelovers:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","var createStylesheet = function(chunkId, fullhref, resolve, reject) {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = function(event) {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tlinkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tdocument.head.appendChild(linkTag);\n\treturn linkTag;\n};\nvar findStylesheet = function(href, fullhref) {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = function(chunkId) {\n\treturn new Promise(function(resolve, reject) {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.miniCss = function(chunkId, promises) {\n\tvar cssChunks = {\"264\":1,\"441\":1,\"941\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(function() {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, function(e) {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwavelovers\"] = self[\"webpackChunkwavelovers\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], function() { return __webpack_require__(4682); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["_hoisted_1","class","_hoisted_2","_createTextVNode","render","_ctx","_cache","$props","$setup","$data","$options","_component_NavigationList","_resolveComponent","_component_router_view","_component_GamepadList","_component_MessageItem","_openBlock","_createElementBlock","_createVNode","gamepads","length","_createBlock","key","default","_withCtx","_","_hoisted_3","_hoisted_4","_hoisted_5","_component_router_link","to","defineComponent","name","__exports__","_component_GamepadItem","_Fragment","_renderList","gamepad","id","textContent","_toDisplayString","unit","props","type","Array","components","GamepadItem","_createElementVNode","_renderSlot","$slots","NavigationList","GamepadList","MessageItem","computed","store","methods","addEventListeners","window","addEventListener","event","removeEventListeners","removeEventListener","mounted","this","unmounted","_component_AppPatterns","_component_PatternList","patterns","mode","isActive","onChange","change","_component_PatternItem","pattern","index","onClick","$event","_normalizeClass","icon","Object","Number","Boolean","$emit","PatternItem","PatternList","AppPatterns","updateRoute","from","next","fullPath","router","VueRouterQueryRoutes","update","appendTags","tagsArray","map","meta","tag","document","createElement","keys","forEach","setAttribute","head","appendChild","updateMetatag","nearestWithTitle","matched","slice","reverse","find","r","title","nearestWithMeta","metaTags","linkTags","querySelectorAll","el","parentNode","removeChild","VueRouterMetaTags","routes","path","component","PatternsView","redirect","createRouter","history","createWebHistory","process","beforeEach","createApp","App","use","mount","Vibrator","constructor","Date","now","canVibrate","vibrationActuator","isVibrating","bind","interval","setInterval","navigator","getGamepads","offsetTime","i","vibrate","sleep","startDelay","duration","playEffect","reset","ms","Promise","resolve","setTimeout","MGamepads","state","getters","mutations","addGamepad","push","deleteGamepad","splice","actions","context","iEvent","commit","loop","MPatterns","setPatterns","loadPatterns","async","url","response","fetch","ok","json","console","log","error","createStore","setMode","setIsActive","dispatch","startCustom","modules","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","every","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","f","e","chunkId","all","reduce","promises","u","miniCssF","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","inProgress","dataWebpackPrefix","l","done","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","timeout","nc","src","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","target","Symbol","toStringTag","value","p","createStylesheet","fullhref","reject","linkTag","rel","onLinkComplete","errorType","realHref","href","err","Error","code","request","findStylesheet","existingLinkTags","dataHref","existingStyleTags","loadStylesheet","installedCssChunks","miniCss","cssChunks","then","installedChunks","installedChunkData","promise","loadingEnded","realSrc","message","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/js/app.faf311ed.js b/docs/js/app.faf311ed.js deleted file mode 100644 index 40d1e80..0000000 --- a/docs/js/app.faf311ed.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){"use strict";var t={4421:function(t,e,n){var a=n(9242),i=n(3396);const o={class:"wavelovers"},r=(0,i.Uk)("Press any gamepad button or connect a new gamepad to vibrate.");function s(t,e,n,a,s,c){const u=(0,i.up)("NavigationList"),d=(0,i.up)("router-view"),p=(0,i.up)("GamepadList"),m=(0,i.up)("MessageItem");return(0,i.wg)(),(0,i.iD)("div",o,[(0,i.Wm)(u),(0,i.Wm)(d),t.gamepads.length>0?((0,i.wg)(),(0,i.j4)(p,{key:0,gamepads:t.gamepads},null,8,["gamepads"])):((0,i.wg)(),(0,i.j4)(m,{key:1},{default:(0,i.w5)((()=>[r])),_:1}))])}var c=n(1746);const u={class:"content-item navigation-list"},d=(0,i.Uk)("Patterns"),p=(0,i.Uk)("Custom"),m=(0,i.Uk)("Manual"),l=(0,i.Uk)("Diagnostic");function f(t,e,n,a,o,r){const s=(0,i.up)("router-link");return(0,i.wg)(),(0,i.iD)("div",u,[(0,i.Wm)(s,{to:"/",class:"navigation-item"},{default:(0,i.w5)((()=>[d])),_:1}),(0,i.Wm)(s,{to:"/custom",class:"navigation-item"},{default:(0,i.w5)((()=>[p])),_:1}),(0,i.Wm)(s,{to:"/manual",class:"navigation-item"},{default:(0,i.w5)((()=>[m])),_:1}),(0,i.Wm)(s,{to:"/diagnostic",class:"navigation-item"},{default:(0,i.w5)((()=>[l])),_:1})])}var v=(0,i.aZ)({name:"NavigationList"}),g=n(89);const h=(0,g.Z)(v,[["render",f]]);var w=h,b=n(7139);const y={class:"content-item device-list"};function A(t,e,n,a,o,r){const s=(0,i.up)("GamepadItem");return(0,i.wg)(),(0,i.iD)("div",y,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(t.gamepads,(t=>((0,i.wg)(),(0,i.j4)(s,{key:t.id,textContent:(0,b.zw)(t.unit.id)},null,8,["textContent"])))),128))])}const Z={class:"list-item"};function k(t,e,n,a,o,r){return(0,i.wg)(),(0,i.iD)("div",Z)}var C=(0,i.aZ)({name:"GamepadItem"});const _=(0,g.Z)(C,[["render",k]]);var P=_,E=(0,i.aZ)({name:"GamepadList",props:{gamepads:{type:Array}},components:{GamepadItem:P}});const L=(0,g.Z)(E,[["render",A]]);var j=L;const I={class:"content-item message"};function x(t,e,n,a,o,r){return(0,i.wg)(),(0,i.iD)("div",I,[(0,i._)("span",null,[(0,i.WI)(t.$slots,"default")])])}var G=(0,i.aZ)({name:"MessageItem"});const M=(0,g.Z)(G,[["render",x]]);var O=M,D=(0,i.aZ)({name:"App",components:{NavigationList:w,GamepadList:j,MessageItem:O},computed:{gamepads:function(){return c.Z.getters.gamepads}},methods:{addEventListeners(){window.addEventListener("gamepadconnected",(t=>c.Z.dispatch("addGamepad",t))),window.addEventListener("gamepaddisconnected",(t=>c.Z.dispatch("deleteGamepad",t)))},removeEventListeners(){window.removeEventListener("gamepadconnected",(t=>c.Z.dispatch("addGamepad",t))),window.removeEventListener("gamepaddisconnected",(t=>c.Z.dispatch("deleteGamepad",t)))}},mounted(){this.addEventListeners()},unmounted(){this.removeEventListeners()}});const N=(0,g.Z)(D,[["render",s]]);var T=N,S=n(2483);function V(t,e,n,a,o,r){const s=(0,i.up)("AppPatterns");return(0,i.wg)(),(0,i.j4)(s)}const U={class:"app-patterns"},W=(0,i.Uk)("Loading...");function B(t,e,n,a,o,r){const s=(0,i.up)("PatternList"),c=(0,i.up)("MessageItem");return(0,i.wg)(),(0,i.iD)("div",U,[t.patterns.length>0?((0,i.wg)(),(0,i.j4)(s,{key:0,patterns:t.patterns,mode:t.mode,isActive:t.isActive,onChange:t.change},null,8,["patterns","mode","isActive","onChange"])):((0,i.wg)(),(0,i.j4)(c,{key:1},{default:(0,i.w5)((()=>[W])),_:1}))])}const z={class:"content-item pattern-list"};function F(t,e,n,a,o,r){const s=(0,i.up)("PatternItem");return(0,i.wg)(),(0,i.iD)("div",z,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(t.patterns,((e,n)=>((0,i.wg)(),(0,i.j4)(s,{key:e.name,pattern:e,index:n,mode:t.mode,isActive:t.isActive,onChange:t.change},null,8,["pattern","index","mode","isActive","onChange"])))),128))])}const H=["textContent"],K={class:"pattern-item__info-container"},$=["textContent"],q=["textContent"];function Y(t,e,n,a,o,r){return(0,i.wg)(),(0,i.iD)("div",{onClick:e[0]||(e[0]=e=>t.change(t.index)),class:(0,b.C_)(["pattern-item",t.index===t.mode&&!0===t.isActive?"pattern-item_selected":""])},[(0,i._)("span",{class:"pattern-item__icon",textContent:(0,b.zw)(t.pattern.icon)},null,8,H),(0,i._)("div",K,[(0,i._)("span",{class:"pattern-item__name",textContent:(0,b.zw)(t.pattern.name)},null,8,$),(0,i._)("span",{class:"pattern-item__type",textContent:(0,b.zw)(t.pattern.type)},null,8,q)])],2)}var J=(0,i.aZ)({name:"PatternItem",props:{pattern:{type:Object},index:{type:Number},mode:{type:Number},isActive:{type:Boolean}},methods:{change:function(t){this.$emit("change",t)}}});const Q=(0,g.Z)(J,[["render",Y]]);var R=Q,X=(0,i.aZ)({name:"PatternList",props:{patterns:{type:Array},mode:{type:Number},isActive:{type:Boolean}},components:{PatternItem:R},methods:{change:function(t){this.$emit("change",t)}}});const tt=(0,g.Z)(X,[["render",F]]);var et=tt,nt=(0,i.aZ)({name:"AppPatterns",components:{PatternList:et,MessageItem:O},computed:{patterns:function(){return c.Z.getters.patterns},mode:function(){return c.Z.getters.mode},isActive:function(){return c.Z.getters.isActive}},methods:{change(t){c.Z.dispatch("change",t)}},mounted(){c.Z.dispatch("loadPatterns")}});const at=(0,g.Z)(nt,[["render",B]]);var it=at,ot=(0,i.aZ)({name:"PatternsView",components:{AppPatterns:it}});const rt=(0,g.Z)(ot,[["render",V]]);var st=rt;const ct=[{path:"/",name:"patterns-view",component:st},{path:"/custom",name:"custom-view",component:()=>n.e(441).then(n.bind(n,441))},{path:"/manual",name:"manual-view",component:()=>n.e(941).then(n.bind(n,8941))},{path:"/diagnostic",name:"diagnostic-view",component:()=>n.e(264).then(n.bind(n,2264))},{path:"/404",name:"404",component:()=>n.e(567).then(n.bind(n,7567))},{path:"/:catchAll(.*)*",redirect:"/404"}],ut=(0,S.p7)({history:(0,S.PO)("/"),routes:ct});var dt=ut;(0,a.ri)(T).use(c.Z).use(dt).mount("#app")},1746:function(t,e,n){n.d(e,{Z:function(){return m}});var a=n(65),i=n(2482);class o{constructor(t){(0,i.Z)(this,"unit",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"canVibrate",void 0),(0,i.Z)(this,"isVibrating",void 0),(0,i.Z)(this,"interval",void 0),this.unit=t,this.id=Date.now(),this.canVibrate=!!this.unit.vibrationActuator,this.isVibrating=!1,this.update=this.update.bind(this),this.interval=setInterval(this.update,1)}update(){const t=navigator.getGamepads();this.unit=t[this.unit.index]}async loop(t){this.isVibrating=!0;const e=10;while(!0===this.isVibrating)for(let n=0;nsetTimeout(e,t)))}}var r=o;const s={state:()=>({gamepads:[]}),getters:{gamepads:function(t){return t.gamepads}},mutations:{addGamepad:function(t,e){t.gamepads.push(e)},deleteGamepad:function(t,e){t.gamepads.splice(e,1)}},actions:{addGamepad:function(t,e){const n=e;t.getters.gamepads.length>=1||t.commit("addGamepad",new r(n.gamepad))},deleteGamepad:function(t,e){t.getters.gamepads.forEach(((n,a)=>{n.unit.id===e.gamepad.id&&t.commit("deleteGamepad",a)}))},loop:function(t,e){t.getters.gamepads.forEach((t=>{t.loop(e)}))},vibrate:function(t,e){t.getters.gamepads.forEach((t=>{t.vibrate(e)}))},reset:function(t){t.getters.gamepads.forEach((t=>{t.reset()}))}}};var c=s;const u={state:()=>({patterns:[]}),getters:{patterns:function(t){return t.patterns}},mutations:{setPatterns:function(t,e){t.patterns=e}},actions:{loadPatterns:async function(t){const e="https://wavelovers.ru/assets/patterns.json";try{const n=await fetch(e);if(n.ok){const e=await n.json();t.commit("setPatterns",e)}else console.log("Connect to the Internet for download more patterns...")}catch(n){console.log(n)}}}};var d=u;const p=(0,a.MT)({state:()=>({mode:0,isActive:!1}),getters:{mode:function(t){return t.mode},isActive:function(t){return t.isActive}},mutations:{setMode:function(t,e){t.mode=e},setIsActive:function(t,e){t.isActive=e}},actions:{setMode:function(t,e){t.commit("setMode",e)},setIsActive:function(t,e){t.commit("setIsActive",e)},change:function(t,e){t.getters.mode===e?t.dispatch("setIsActive",!t.getters.isActive):(t.dispatch("setIsActive",!0),t.dispatch("setMode",e)),!0===t.getters.isActive?(t.dispatch("reset"),t.dispatch("loop",t.getters.patterns[t.getters.mode].pattern)):t.dispatch("reset")},startCustom:function(t,e){t.dispatch("setIsActive",!1),t.dispatch("setMode",0),t.dispatch("reset"),t.dispatch("loop",e)}},modules:{MGamepads:c,MPatterns:d}});var m=p}},e={};function n(a){var i=e[a];if(void 0!==i)return i.exports;var o=e[a]={exports:{}};return t[a](o,o.exports,n),o.exports}n.m=t,function(){var t=[];n.O=function(e,a,i,o){if(!a){var r=1/0;for(d=0;d=o)&&Object.keys(n.O).every((function(t){return n.O[t](a[c])}))?a.splice(c--,1):(s=!1,o0&&t[d-1][2]>o;d--)t[d]=t[d-1];t[d]=[a,i,o]}}(),function(){n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,{a:e}),e}}(),function(){n.d=function(t,e){for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}}(),function(){n.f={},n.e=function(t){return Promise.all(Object.keys(n.f).reduce((function(e,a){return n.f[a](t,e),e}),[]))}}(),function(){n.u=function(t){return"js/"+t+"."+{264:"5a60390d",441:"be7aaf75",567:"681eca51",941:"6295b5fd"}[t]+".js"}}(),function(){n.miniCssF=function(t){return"css/"+t+"."+{264:"10b8ac32",441:"19a8cda3",941:"06b3a622"}[t]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){var t={},e="wavelovers:";n.l=function(a,i,o,r){if(t[a])t[a].push(i);else{var s,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),d=0;d 0)\n ? (_openBlock(), _createBlock(_component_GamepadList, {\n key: 0,\n gamepads: _ctx.gamepads\n }, null, 8, [\"gamepads\"]))\n : (_openBlock(), _createBlock(_component_MessageItem, { key: 1 }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }))\n ]))\n}","import { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"content-item navigation-list\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\"Patterns\")\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"Custom\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"Manual\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"Diagnostic\")\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_router_link = _resolveComponent(\"router-link\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_router_link, {\n to: \"/\",\n class: \"navigation-item\"\n }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }),\n _createVNode(_component_router_link, {\n to: \"/custom\",\n class: \"navigation-item\"\n }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n }),\n _createVNode(_component_router_link, {\n to: \"/manual\",\n class: \"navigation-item\"\n }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_router_link, {\n to: \"/diagnostic\",\n class: \"navigation-item\"\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n })\n ]))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'NavigationList',\r\n });\r\n","import { render } from \"./NavigationList.vue?vue&type=template&id=2bbb40f5&ts=true\"\nimport script from \"./NavigationList.vue?vue&type=script&lang=ts\"\nexport * from \"./NavigationList.vue?vue&type=script&lang=ts\"\n\nimport \"./NavigationList.vue?vue&type=style&index=0&id=2bbb40f5&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, toDisplayString as _toDisplayString, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"content-item device-list\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_GamepadItem = _resolveComponent(\"GamepadItem\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.gamepads, (gamepad) => {\n return (_openBlock(), _createBlock(_component_GamepadItem, {\n key: gamepad.id,\n textContent: _toDisplayString(gamepad.unit.id)\n }, null, 8, [\"textContent\"]))\n }), 128))\n ]))\n}","import { openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"list-item\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'GamepadItem',\r\n });\r\n","import { render } from \"./GamepadItem.vue?vue&type=template&id=e6e6c988&ts=true\"\nimport script from \"./GamepadItem.vue?vue&type=script&lang=ts\"\nexport * from \"./GamepadItem.vue?vue&type=script&lang=ts\"\n\nimport \"./GamepadItem.vue?vue&type=style&index=0&id=e6e6c988&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import GamepadItem from '@/components/GamepadItem.vue';\r\n\r\n export default defineComponent({\r\n name: 'GamepadList',\r\n props: {\r\n gamepads: {\r\n type: Array,\r\n },\r\n },\r\n components: {\r\n GamepadItem: GamepadItem,\r\n },\r\n });\r\n ","import { render } from \"./GamepadList.vue?vue&type=template&id=16065af4&ts=true\"\nimport script from \"./GamepadList.vue?vue&type=script&lang=ts\"\nexport * from \"./GamepadList.vue?vue&type=script&lang=ts\"\n\nimport \"./GamepadList.vue?vue&type=style&index=0&id=16065af4&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { renderSlot as _renderSlot, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"content-item message\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"span\", null, [\n _renderSlot(_ctx.$slots, \"default\")\n ])\n ]))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'MessageItem',\r\n });\r\n","import { render } from \"./MessageItem.vue?vue&type=template&id=31b477d2&ts=true\"\nimport script from \"./MessageItem.vue?vue&type=script&lang=ts\"\nexport * from \"./MessageItem.vue?vue&type=script&lang=ts\"\n\nimport \"./MessageItem.vue?vue&type=style&index=0&id=31b477d2&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import store from '@/store/index';\r\n import NavigationList from '@/components/NavigationList.vue';\r\n import GamepadList from '@/components/GamepadList.vue';\r\n import MessageItem from '@/components/MessageItem.vue';\r\n import Vibrator from '@/models/Vibrator';\r\n\r\n export default defineComponent({\r\n name: 'App',\r\n components: {\r\n NavigationList: NavigationList,\r\n GamepadList: GamepadList,\r\n MessageItem: MessageItem,\r\n },\r\n computed: {\r\n gamepads: function (): Vibrator[] {\r\n return store.getters.gamepads as Vibrator[];\r\n },\r\n },\r\n methods: {\r\n addEventListeners(): void {\r\n window.addEventListener('gamepadconnected', (event: GamepadEvent) => store.dispatch('addGamepad', event));\r\n window.addEventListener('gamepaddisconnected', (event: GamepadEvent) => store.dispatch('deleteGamepad', event));\r\n },\r\n removeEventListeners(): void {\r\n window.removeEventListener('gamepadconnected', (event: GamepadEvent) => store.dispatch('addGamepad', event));\r\n window.removeEventListener('gamepaddisconnected', (event: GamepadEvent) => store.dispatch('deleteGamepad', event));\r\n },\r\n },\r\n mounted() {\r\n this.addEventListeners();\r\n },\r\n unmounted() {\r\n this.removeEventListeners();\r\n },\r\n });\r\n","import { render } from \"./App.vue?vue&type=template&id=7f0977f6&ts=true\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_AppPatterns = _resolveComponent(\"AppPatterns\")!\n\n return (_openBlock(), _createBlock(_component_AppPatterns))\n}","import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"app-patterns\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\"Loading...\")\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_PatternList = _resolveComponent(\"PatternList\")!\n const _component_MessageItem = _resolveComponent(\"MessageItem\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_ctx.patterns.length > 0)\n ? (_openBlock(), _createBlock(_component_PatternList, {\n key: 0,\n patterns: _ctx.patterns,\n mode: _ctx.mode,\n isActive: _ctx.isActive,\n onChange: _ctx.change\n }, null, 8, [\"patterns\", \"mode\", \"isActive\", \"onChange\"]))\n : (_openBlock(), _createBlock(_component_MessageItem, { key: 1 }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }))\n ]))\n}","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"content-item pattern-list\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_PatternItem = _resolveComponent(\"PatternItem\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.patterns, (pattern, index) => {\n return (_openBlock(), _createBlock(_component_PatternItem, {\n key: pattern.name,\n pattern: pattern,\n index: index,\n mode: _ctx.mode,\n isActive: _ctx.isActive,\n onChange: _ctx.change\n }, null, 8, [\"pattern\", \"index\", \"mode\", \"isActive\", \"onChange\"]))\n }), 128))\n ]))\n}","import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"textContent\"]\nconst _hoisted_2 = { class: \"pattern-item__info-container\" }\nconst _hoisted_3 = [\"textContent\"]\nconst _hoisted_4 = [\"textContent\"]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"div\", {\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.change(_ctx.index))),\n class: _normalizeClass(['pattern-item',\r\n _ctx.index === _ctx.mode && _ctx.isActive === true ?\r\n 'pattern-item_selected' : '',\r\n ])\n }, [\n _createElementVNode(\"span\", {\n class: \"pattern-item__icon\",\n textContent: _toDisplayString(_ctx.pattern.icon)\n }, null, 8, _hoisted_1),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"span\", {\n class: \"pattern-item__name\",\n textContent: _toDisplayString(_ctx.pattern.name)\n }, null, 8, _hoisted_3),\n _createElementVNode(\"span\", {\n class: \"pattern-item__type\",\n textContent: _toDisplayString(_ctx.pattern.type)\n }, null, 8, _hoisted_4)\n ])\n ], 2))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'PatternItem',\r\n props: {\r\n pattern: {\r\n type: Object,\r\n },\r\n index: {\r\n type: Number,\r\n },\r\n mode: {\r\n type: Number,\r\n },\r\n isActive: {\r\n type: Boolean,\r\n },\r\n },\r\n methods: {\r\n change: function (index: number): void {\r\n this.$emit('change', index as number);\r\n },\r\n },\r\n });\r\n","import { render } from \"./PatternItem.vue?vue&type=template&id=7dfe2650&ts=true\"\nimport script from \"./PatternItem.vue?vue&type=script&lang=ts\"\nexport * from \"./PatternItem.vue?vue&type=script&lang=ts\"\n\nimport \"./PatternItem.vue?vue&type=style&index=0&id=7dfe2650&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import PatternItem from '@/components/PatternItem.vue';\r\n\r\n export default defineComponent({\r\n name: 'PatternList',\r\n props: {\r\n patterns: {\r\n type: Array,\r\n },\r\n mode: {\r\n type: Number,\r\n },\r\n isActive: {\r\n type: Boolean,\r\n },\r\n },\r\n components: {\r\n PatternItem: PatternItem,\r\n },\r\n methods: {\r\n change: function (index: number): void {\r\n this.$emit('change', index as number);\r\n },\r\n },\r\n });\r\n","import { render } from \"./PatternList.vue?vue&type=template&id=0515b58e&ts=true\"\nimport script from \"./PatternList.vue?vue&type=script&lang=ts\"\nexport * from \"./PatternList.vue?vue&type=script&lang=ts\"\n\nimport \"./PatternList.vue?vue&type=style&index=0&id=0515b58e&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import store from '@/store/index';\r\n import PatternList from '@/components/PatternList.vue';\r\n import MessageItem from '@/components/MessageItem.vue';\r\n import TPattern from '@/models/TPattern';\r\n\r\n export default defineComponent({\r\n name: 'AppPatterns',\r\n components: {\r\n PatternList: PatternList,\r\n MessageItem: MessageItem,\r\n },\r\n computed: {\r\n patterns: function (): TPattern[] {\r\n return store.getters.patterns as TPattern[];\r\n },\r\n mode: function (): number {\r\n return store.getters.mode as number;\r\n },\r\n isActive: function (): boolean {\r\n return store.getters.isActive as boolean;\r\n },\r\n },\r\n methods: {\r\n change(index: number): void {\r\n store.dispatch('change', index as number);\r\n },\r\n },\r\n mounted() {\r\n store.dispatch('loadPatterns');\r\n },\r\n });\r\n","import { render } from \"./AppPatterns.vue?vue&type=template&id=44c5840c&ts=true\"\nimport script from \"./AppPatterns.vue?vue&type=script&lang=ts\"\nexport * from \"./AppPatterns.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import AppPatterns from '@/components/AppPatterns.vue';\r\n\r\n export default defineComponent({\r\n name: 'PatternsView',\r\n components: {\r\n AppPatterns: AppPatterns,\r\n },\r\n });\r\n","import { render } from \"./PatternsView.vue?vue&type=template&id=440c70d9&ts=true\"\nimport script from \"./PatternsView.vue?vue&type=script&lang=ts\"\nexport * from \"./PatternsView.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';\r\nimport PatternsView from '@/views/PatternsView.vue';\r\n\r\nconst routes: Array = [\r\n {\r\n path: '/',\r\n name: 'patterns-view',\r\n component: PatternsView,\r\n },\r\n {\r\n path: '/custom',\r\n name: 'custom-view',\r\n component: () => import('@/views/CustomView.vue'),\r\n },\r\n {\r\n path: '/manual',\r\n name: 'manual-view',\r\n component: () => import('@/views/ManualView.vue'),\r\n },\r\n {\r\n path: '/diagnostic',\r\n name: 'diagnostic-view',\r\n component: () => import('@/views/DiagnosticView.vue'),\r\n },\r\n {\r\n path: '/404',\r\n name: '404',\r\n component: () => import('@/views/NotFoundView.vue'),\r\n },\r\n {\r\n path: '/:catchAll(.*)*',\r\n redirect: '/404',\r\n },\r\n];\r\n\r\nconst router = createRouter({\r\n history: createWebHistory(process.env.BASE_URL),\r\n routes,\r\n});\r\n\r\nexport default router;\r\n\r\n","import { createApp } from 'vue';\r\nimport App from './App.vue';\r\nimport router from './router';\r\nimport store from './store';\r\n\r\ncreateApp(App).use(store).use(router).mount('#app');\r\n\r\n","import TPatternUnit from '@/models/TPatternUnit';\r\nimport IGamepad from '@/models/IGamepad';\r\nimport IVibrator from '@/models/IVibrator';\r\n\r\nclass Vibrator implements IVibrator {\r\n\r\n unit: IGamepad;\r\n readonly id: number;\r\n readonly canVibrate: boolean;\r\n isVibrating: boolean;\r\n interval: number;\r\n\r\n constructor(unit: IGamepad) {\r\n this.unit = unit;\r\n this.id = Date.now();\r\n this.canVibrate = (this.unit.vibrationActuator) ? true : false;\r\n this.isVibrating = false;\r\n this.update = this.update.bind(this);\r\n this.interval = setInterval(this.update, 1);\r\n }\r\n\r\n update(): void {\r\n const gamepads = navigator.getGamepads();\r\n this.unit = gamepads[this.unit.index] as unknown as IGamepad;\r\n }\r\n\r\n async loop(pattern: TPatternUnit[]) {\r\n this.isVibrating = true;\r\n const offsetTime = 10;\r\n while (this.isVibrating === true) {\r\n for (let i = 0; i < pattern.length; i++) {\r\n if (this.isVibrating === true) {\r\n this.vibrate(pattern[i]);\r\n await this.sleep(pattern[i].startDelay + pattern[i].duration - offsetTime);\r\n } else {\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n vibrate(pattern: TPatternUnit): void {\r\n this.unit.vibrationActuator.playEffect('dual-rumble', pattern);\r\n }\r\n\r\n reset(): void {\r\n this.isVibrating = false;\r\n this.unit.vibrationActuator.reset();\r\n }\r\n\r\n sleep(ms: number): Promise {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n }\r\n}\r\n\r\nexport default Vibrator;\r\n\r\n","import { ActionContext, Module } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport IGamepadsState from '@/store/models/IGamepadsState';\r\nimport Vibrator from '@/models/Vibrator';\r\nimport IGamepad from '@/models/IGamepad';\r\nimport IGamepadEvent from '@/models/IGamepadEvent';\r\nimport TPatternUnit from '@/models/TPatternUnit';\r\n\r\nconst MGamepads: Module = {\r\n state: () => ({\r\n gamepads: [] as Vibrator[],\r\n }),\r\n getters: {\r\n gamepads: function (state: IGamepadsState): Vibrator[] {\r\n return state.gamepads as Vibrator[];\r\n },\r\n },\r\n mutations: {\r\n addGamepad: function (state: IGamepadsState, gamepad: Vibrator): void {\r\n state.gamepads.push(gamepad as Vibrator);\r\n },\r\n deleteGamepad: function (state: IGamepadsState, index: number): void {\r\n state.gamepads.splice(index, 1);\r\n },\r\n },\r\n actions: {\r\n addGamepad: function (\r\n context: ActionContext,\r\n event: GamepadEvent\r\n ): void {\r\n const iEvent: IGamepadEvent = event as unknown as IGamepadEvent;\r\n if (context.getters.gamepads.length >= 1) {\r\n return;\r\n } else {\r\n context.commit('addGamepad', new Vibrator(iEvent.gamepad as IGamepad));\r\n }\r\n },\r\n deleteGamepad: function (\r\n context: ActionContext,\r\n event: GamepadEvent\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator, index: number) => {\r\n if (gamepad.unit.id === event.gamepad.id) {\r\n context.commit('deleteGamepad', index as number);\r\n }\r\n });\r\n },\r\n loop: function (\r\n context: ActionContext,\r\n pattern: TPatternUnit[]\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.loop(pattern);\r\n });\r\n },\r\n vibrate: function (\r\n context: ActionContext,\r\n pattern: TPatternUnit\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.vibrate(pattern);\r\n });\r\n },\r\n reset: function (\r\n context: ActionContext\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.reset();\r\n });\r\n },\r\n },\r\n};\r\n\r\nexport default MGamepads;\r\n\r\n","import { ActionContext, Module } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport IPatternState from '@/store/models/IPatternState';\r\nimport TPattern from '@/models/TPattern';\r\n\r\nconst MPatterns: Module = {\r\n state: () => ({\r\n patterns: [] as TPattern[],\r\n }),\r\n getters: {\r\n patterns: function (state: IPatternState): TPattern[] {\r\n return state.patterns as TPattern[];\r\n },\r\n },\r\n mutations: {\r\n setPatterns: function (state: IPatternState, patterns: TPattern[]): void {\r\n state.patterns = patterns as TPattern[];\r\n },\r\n },\r\n actions: {\r\n loadPatterns: async function (\r\n context: ActionContext\r\n ): Promise {\r\n const url = 'https://wavelovers.ru/assets/patterns.json';\r\n try {\r\n const response: Response = await fetch(url);\r\n if (response.ok) {\r\n const json: TPattern[] = await response.json();\r\n context.commit('setPatterns', json as TPattern[]);\r\n } else {\r\n // eslint-disable-next-line\r\n console.log('Connect to the Internet for download more patterns...');\r\n }\r\n } catch (error) {\r\n // eslint-disable-next-line\r\n console.log(error);\r\n }\r\n },\r\n },\r\n};\r\n\r\nexport default MPatterns;\r\n\r\n","import { createStore, Store } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport MGamepads from '@/store/modules/MGamepads';\r\nimport MPatterns from '@/store/modules/MPatterns';\r\nimport TPatternUnit from '@/models/TPatternUnit';\r\n\r\nconst store: Store = createStore({\r\n state: () => ({\r\n mode: 0 as number,\r\n isActive: false as boolean,\r\n }),\r\n getters: {\r\n mode: function (state: IRootState): number {\r\n return state.mode as number;\r\n },\r\n isActive: function (state: IRootState): boolean {\r\n return state.isActive as boolean;\r\n },\r\n },\r\n mutations: {\r\n setMode: function (state: IRootState, mode: number): void {\r\n state.mode = mode as number;\r\n },\r\n setIsActive: function (state: IRootState, isActive: boolean): void {\r\n state.isActive = isActive as boolean;\r\n },\r\n },\r\n actions: {\r\n setMode: function (context, index: number): void {\r\n context.commit('setMode', index as number);\r\n },\r\n setIsActive: function (context, isActive: boolean): void {\r\n context.commit('setIsActive', isActive as boolean);\r\n },\r\n change: function (context, index: number): void {\r\n if (context.getters.mode === index) {\r\n context.dispatch('setIsActive', !context.getters.isActive);\r\n } else {\r\n context.dispatch('setIsActive', true);\r\n context.dispatch('setMode', index);\r\n }\r\n if (context.getters.isActive === true) {\r\n context.dispatch('reset');\r\n context.dispatch('loop', context.getters.patterns[context.getters.mode].pattern);\r\n } else {\r\n context.dispatch('reset');\r\n }\r\n },\r\n startCustom: function (context, pattern: TPatternUnit[]): void {\r\n context.dispatch('setIsActive', false);\r\n context.dispatch('setMode', 0);\r\n context.dispatch('reset');\r\n context.dispatch('loop', pattern);\r\n },\r\n },\r\n modules: {\r\n MGamepads: MGamepads,\r\n MPatterns: MPatterns,\r\n },\r\n});\r\n\r\nexport default store;\r\n\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + chunkId + \".\" + {\"264\":\"5a60390d\",\"441\":\"be7aaf75\",\"567\":\"681eca51\",\"941\":\"6295b5fd\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"css/\" + chunkId + \".\" + {\"264\":\"10b8ac32\",\"441\":\"19a8cda3\",\"941\":\"06b3a622\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"wavelovers:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","var createStylesheet = function(chunkId, fullhref, resolve, reject) {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = function(event) {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tlinkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tdocument.head.appendChild(linkTag);\n\treturn linkTag;\n};\nvar findStylesheet = function(href, fullhref) {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = function(chunkId) {\n\treturn new Promise(function(resolve, reject) {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.miniCss = function(chunkId, promises) {\n\tvar cssChunks = {\"264\":1,\"441\":1,\"941\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(function() {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, function(e) {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwavelovers\"] = self[\"webpackChunkwavelovers\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], function() { return __webpack_require__(4421); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["_hoisted_1","class","_hoisted_2","_createTextVNode","render","_ctx","_cache","$props","$setup","$data","$options","_component_NavigationList","_resolveComponent","_component_router_view","_component_GamepadList","_component_MessageItem","_openBlock","_createElementBlock","_createVNode","gamepads","length","_createBlock","key","default","_withCtx","_","_hoisted_3","_hoisted_4","_hoisted_5","_component_router_link","to","defineComponent","name","__exports__","_component_GamepadItem","_Fragment","_renderList","gamepad","id","textContent","_toDisplayString","unit","props","type","Array","components","GamepadItem","_createElementVNode","_renderSlot","$slots","NavigationList","GamepadList","MessageItem","computed","store","methods","addEventListeners","window","addEventListener","event","removeEventListeners","removeEventListener","mounted","this","unmounted","_component_AppPatterns","_component_PatternList","patterns","mode","isActive","onChange","change","_component_PatternItem","pattern","index","onClick","$event","_normalizeClass","icon","Object","Number","Boolean","$emit","PatternItem","PatternList","AppPatterns","routes","path","component","PatternsView","redirect","router","createRouter","history","createWebHistory","process","createApp","App","use","mount","Vibrator","constructor","Date","now","canVibrate","vibrationActuator","isVibrating","update","bind","interval","setInterval","navigator","getGamepads","offsetTime","i","vibrate","sleep","startDelay","duration","playEffect","reset","ms","Promise","resolve","setTimeout","MGamepads","state","getters","mutations","addGamepad","push","deleteGamepad","splice","actions","context","iEvent","commit","forEach","loop","MPatterns","setPatterns","loadPatterns","async","url","response","fetch","ok","json","console","log","error","createStore","setMode","setIsActive","dispatch","startCustom","modules","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","keys","every","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","f","e","chunkId","all","reduce","promises","u","miniCssF","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","inProgress","dataWebpackPrefix","l","done","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","target","head","appendChild","Symbol","toStringTag","value","p","createStylesheet","fullhref","reject","linkTag","rel","onLinkComplete","errorType","realHref","href","err","Error","code","request","findStylesheet","existingLinkTags","tag","dataHref","existingStyleTags","loadStylesheet","installedCssChunks","miniCss","cssChunks","then","installedChunks","installedChunkData","promise","loadingEnded","realSrc","message","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file