@htmlbricks/hb-pad-joystick 0.65.22 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.iife.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(ue){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const pr=2,fe="[",Bt="[!",ce="]",ht={},y=Symbol(),Ut=!1;var mr=Array.isArray,gr=Array.prototype.indexOf,br=Array.from,Pt=Object.keys,Nt=Object.defineProperty,dt=Object.getOwnPropertyDescriptor,wr=Object.prototype,kr=Array.prototype,yr=Object.getPrototypeOf,he=Object.isExtensible;function $r(t){for(var e=0;e<t.length;e++)t[e]()}function xr(){var t,e,r=new Promise((i,s)=>{t=i,e=s});return{promise:r,resolve:t,reject:e}}const w=2,Gt=4,Sr=8,W=16,z=32,Q=64,Dt=128,A=512,$=1024,E=2048,q=4096,j=8192,tt=16384,Mt=32768,vt=65536,de=1<<17,ve=1<<18,_t=1<<19,Er=1<<20,st=32768,Jt=1<<21,_e=1<<22,wt=1<<23,Kt=Symbol("$state"),Cr=Symbol("legacy props"),pe=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},me=3,kt=8;function Tr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Rr(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Lr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Pr(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Nr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Dr(){throw new Error("https://svelte.dev/e/hydration_failed")}function Mr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Yr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ar(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Fr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Yt(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function jr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let g=!1;function pt(t){g=t}let m;function O(t){if(t===null)throw Yt(),ht;return m=t}function Zt(){return O(U(m))}function ge(t){if(g){if(U(m)!==null)throw Yt(),ht;m=t}}function Or(t=1){if(g){for(var e=t,r=m;e--;)r=U(r);m=r}}function be(t=!0){for(var e=0,r=m;;){if(r.nodeType===kt){var i=r.data;if(i===ce){if(e===0)return r;e-=1}else(i===fe||i===Bt)&&(e+=1)}var s=U(r);t&&r.remove(),r=s}}function Xr(t){if(!t||t.nodeType!==kt)throw Yt(),ht;return t.data}function we(t){return t===this.v}function Ir(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Wr(t){return!Ir(t,this.v)}let zr=!1,L=null;function At(t){L=t}function ke(t,e=!1,r){L={p:L,i:!1,c:null,e:null,s:t,x:null,l:null}}function ye(t){var e=L,r=e.e;if(r!==null){e.e=null;for(var i of r)ze(i)}return t!==void 0&&(e.x=t),e.i=!0,L=e.p,t??{}}function $e(){return!0}let at=[];function xe(){var t=at;at=[],$r(t)}function Qt(t){if(at.length===0&&!yt){var e=at;queueMicrotask(()=>{e===at&&xe()})}at.push(t)}function qr(){for(;at.length>0;)xe()}function Se(t){var e=p;if(e===null)return _.f|=wt,t;if((e.f&Mt)===0){if((e.f&Dt)===0)throw t;e.b.error(t)}else Ft(t,e)}function Ft(t,e){for(;e!==null;){if((e.f&Dt)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t}const jt=new Set;let k=null,P=null,N=[],Ot=null,te=!1,yt=!1;class F{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#i=0;#l=null;#s=[];#n=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#i>0}process(e){N=[],this.apply();var r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of e)this.#a(i,r);this.is_fork||this.#f(),this.is_deferred()?(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects)):(k=null,Ce(r.render_effects),Ce(r.effects),this.#l?.resolve()),P=null}#a(e,r){e.f^=$;for(var i=e.first;i!==null;){var s=i.f,n=(s&(z|Q))!==0,a=n&&(s&$)!==0,o=a||(s&j)!==0||this.skipped_effects.has(i);if((i.f&Dt)!==0&&i.b?.is_pending()&&(r={parent:r,effect:i,effects:[],render_effects:[],block_effects:[]}),!o&&i.fn!==null){n?i.f^=$:(s&Gt)!==0?r.effects.push(i):Ct(i)&&((i.f&W)!==0&&r.block_effects.push(i),Tt(i));var l=i.first;if(l!==null){i=l;continue}}var u=i.parent;for(i=i.next;i===null&&u!==null;)u===r.effect&&(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects),r=r.parent),i=u.next,u=u.parent}}#o(e){for(const r of e)((r.f&E)!==0?this.#s:this.#n).push(r),this.#u(r.deps),S(r,$)}#u(e){if(e!==null)for(const r of e)(r.f&w)===0||(r.f&st)===0||(r.f^=st,this.#u(r.deps))}capture(e,r){this.previous.has(e)||this.previous.set(e,r),(e.f&wt)===0&&(this.current.set(e,e.v),P?.set(e,e.v))}activate(){k=this,this.apply()}deactivate(){k===this&&(k=null,P=null)}flush(){if(this.activate(),N.length>0){if(Ee(),k!==null&&k!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const e of this.#t)e(this);this.#t.clear()}#f(){if(this.#i===0){for(const e of this.#e)e();this.#e.clear()}this.#r===0&&this.#c()}#c(){if(jt.size>1){this.previous.clear();var e=P,r=!0,i={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const n of jt){if(n===this){r=!1;continue}const a=[];for(const[l,u]of this.current){if(n.current.has(l))if(r&&u!==n.current.get(l))n.current.set(l,u);else continue;a.push(l)}if(a.length===0)continue;const o=[...n.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var s=N;N=[];const l=new Set,u=new Map;for(const c of a)Te(c,o,l,u);if(N.length>0){k=n,n.apply();for(const c of N)n.#a(c,i);n.deactivate()}N=s}}k=null,P=e}this.committed=!0,jt.delete(this)}increment(e){this.#r+=1,e&&(this.#i+=1)}decrement(e){this.#r-=1,e&&(this.#i-=1),this.revive()}revive(){for(const e of this.#s)S(e,E),ot(e);for(const e of this.#n)S(e,q),ot(e);this.#s=[],this.#n=[],this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#l??=xr()).promise}static ensure(){if(k===null){const e=k=new F;jt.add(k),yt||F.enqueue(()=>{k===e&&e.flush()})}return k}static enqueue(e){Qt(e)}apply(){}}function Xt(t){var e=yt;yt=!0;try{for(var r;;){if(qr(),N.length===0&&(k?.flush(),N.length===0))return Ot=null,r;Ee()}}finally{yt=e}}function Ee(){var t=it;te=!0;var e=null;try{var r=0;for(zt(!0);N.length>0;){var i=F.ensure();if(r++>1e3){var s,n;Vr()}i.process(N),et.clear()}}finally{te=!1,zt(t),Ot=null}}function Vr(){try{Nr()}catch(t){Ft(t,Ot)}}let V=null;function Ce(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var i=t[r++];if((i.f&(tt|j))===0&&Ct(i)&&(V=new Set,Tt(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null&&i.ac===null?Ue(i):i.fn=null),V?.size>0)){et.clear();for(const s of V){if((s.f&(tt|j))!==0)continue;const n=[s];let a=s.parent;for(;a!==null;)V.has(a)&&(V.delete(a),n.push(a)),a=a.parent;for(let o=n.length-1;o>=0;o--){const l=n[o];(l.f&(tt|j))===0&&Tt(l)}}V.clear()}}V=null}}function Te(t,e,r,i){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const s of t.reactions){const n=s.f;(n&w)!==0?Te(s,e,r,i):(n&(_e|W))!==0&&(n&E)===0&&Re(s,e,i)&&(S(s,E),ot(s))}}function Re(t,e,r){const i=r.get(t);if(i!==void 0)return i;if(t.deps!==null)for(const s of t.deps){if(e.includes(s))return!0;if((s.f&w)!==0&&Re(s,e,r))return r.set(s,!0),!0}return r.set(t,!1),!1}function ot(t){for(var e=Ot=t;e.parent!==null;){e=e.parent;var r=e.f;if(te&&e===p&&(r&W)!==0&&(r&ve)===0)return;if((r&(Q|z))!==0){if((r&$)===0)return;e.f^=$}}N.push(e)}function Hr(t){let e=0,r=It(0),i;return()=>{Wt()&&(I(r),qe(()=>(e===0&&(i=ar(()=>t(()=>$t(r)))),e+=1,()=>{Qt(()=>{e-=1,e===0&&(i?.(),i=void 0,$t(r))})})))}}var Br=vt|_t|Dt;function Ur(t,e,r){new Gr(t,e,r)}class Gr{parent;#e=!1;#t;#r=g?m:null;#i;#l;#s;#n=null;#a=null;#o=null;#u=null;#f=null;#c=0;#h=0;#v=!1;#d=null;#b=Hr(()=>(this.#d=It(this.#c),()=>{this.#d=null}));constructor(e,r,i){this.#t=e,this.#i=r,this.#l=i,this.parent=p.b,this.#e=!!this.#i.pending,this.#s=Ve(()=>{if(p.b=this,g){const n=this.#r;Zt(),n.nodeType===kt&&n.data===Bt?this.#k():this.#w()}else{var s=this.#m();try{this.#n=G(()=>i(s))}catch(n){this.error(n)}this.#h>0?this.#p():this.#e=!1}return()=>{this.#f?.remove()}},Br),g&&(this.#t=m)}#w(){try{this.#n=G(()=>this.#l(this.#t))}catch(e){this.error(e)}this.#e=!1}#k(){const e=this.#i.pending;e&&(this.#a=G(()=>e(this.#t)),F.enqueue(()=>{var r=this.#m();this.#n=this.#_(()=>(F.ensure(),G(()=>this.#l(r)))),this.#h>0?this.#p():(St(this.#a,()=>{this.#a=null}),this.#e=!1)}))}#m(){var e=this.#t;return this.#e&&(this.#f=rt(),this.#t.before(this.#f),e=this.#f),e}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#i.pending}#_(e){var r=p,i=_,s=L;nt(this.#s),D(this.#s),At(this.#s.ctx);try{return e()}catch(n){return Se(n),null}finally{nt(r),D(i),At(s)}}#p(){const e=this.#i.pending;this.#n!==null&&(this.#u=document.createDocumentFragment(),this.#u.append(this.#f),Ke(this.#n,this.#u)),this.#a===null&&(this.#a=G(()=>e(this.#t)))}#g(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#g(e);return}this.#h+=e,this.#h===0&&(this.#e=!1,this.#a&&St(this.#a,()=>{this.#a=null}),this.#u&&(this.#t.before(this.#u),this.#u=null))}update_pending_count(e){this.#g(e),this.#c+=e,this.#d&&De(this.#d,this.#c)}get_effect_pending(){return this.#b(),I(this.#d)}error(e){var r=this.#i.onerror;let i=this.#i.failed;if(this.#v||!r&&!i)throw e;this.#n&&(C(this.#n),this.#n=null),this.#a&&(C(this.#a),this.#a=null),this.#o&&(C(this.#o),this.#o=null),g&&(O(this.#r),Or(),O(be()));var s=!1,n=!1;const a=()=>{if(s){jr();return}s=!0,n&&Fr(),F.ensure(),this.#c=0,this.#o!==null&&St(this.#o,()=>{this.#o=null}),this.#e=this.has_pending_snippet(),this.#n=this.#_(()=>(this.#v=!1,G(()=>this.#l(this.#t)))),this.#h>0?this.#p():this.#e=!1};var o=_;try{D(null),n=!0,r?.(e,a),n=!1}catch(l){Ft(l,this.#s&&this.#s.parent)}finally{D(o)}i&&Qt(()=>{this.#o=this.#_(()=>{F.ensure(),this.#v=!0;try{return G(()=>{i(this.#t,()=>e,()=>a)})}catch(l){return Ft(l,this.#s.parent),null}finally{this.#v=!1}})})}}function Jr(t){var e=w|E,r=_!==null&&(_.f&w)!==0?_:null;return p!==null&&(p.f|=_t),{ctx:L,deps:null,effects:null,equals:we,f:e,fn:t,reactions:null,rv:0,v:y,wv:0,parent:r??p,ac:null}}function Le(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)C(e[r])}}function Kr(t){for(var e=t.parent;e!==null;){if((e.f&w)===0)return(e.f&tt)===0?e:null;e=e.parent}return null}function ee(t){var e,r=p;nt(Kr(t));try{t.f&=~st,Le(t),e=ir(t)}finally{nt(r)}return e}function Pe(t){var e=ee(t);if(t.equals(e)||(k?.is_fork||(t.v=e),t.wv=er()),!ut)if(P!==null)Wt()&&P.set(t,e);else{var r=(t.f&A)===0?q:$;S(t,r)}}let re=new Set;const et=new Map;let Ne=!1;function It(t,e){var r={f:0,v:t,reactions:null,equals:we,rv:0,wv:0};return r}function H(t,e){const r=It(t);return ci(r),r}function Zr(t,e=!1,r=!0){const i=It(t);return e||(i.equals=Wr),i}function B(t,e,r=!1){_!==null&&(!X||(_.f&de)!==0)&&$e()&&(_.f&(w|W|_e|de))!==0&&!J?.includes(t)&&Ar();let i=r?mt(e):e;return De(t,i)}function De(t,e){if(!t.equals(e)){var r=t.v;ut?et.set(t,e):et.set(t,r),t.v=e;var i=F.ensure();i.capture(t,r),(t.f&w)!==0&&((t.f&E)!==0&&ee(t),S(t,(t.f&A)!==0?$:q)),t.wv=er(),Me(t,E),p!==null&&(p.f&$)!==0&&(p.f&(z|Q))===0&&(M===null?hi([t]):M.push(t)),!i.is_fork&&re.size>0&&!Ne&&Qr()}return e}function Qr(){Ne=!1;var t=it;zt(!0);const e=Array.from(re);try{for(const r of e)(r.f&$)!==0&&S(r,q),Ct(r)&&Tt(r)}finally{zt(t)}re.clear()}function $t(t){B(t,t.v+1)}function Me(t,e){var r=t.reactions;if(r!==null)for(var i=r.length,s=0;s<i;s++){var n=r[s],a=n.f,o=(a&E)===0;if(o&&S(n,e),(a&w)!==0){var l=n;P?.delete(l),(a&st)===0&&(a&A&&(n.f|=st),Me(l,q))}else o&&((a&W)!==0&&V!==null&&V.add(n),ot(n))}}function mt(t){if(typeof t!="object"||t===null||Kt in t)return t;const e=yr(t);if(e!==wr&&e!==kr)return t;var r=new Map,i=mr(t),s=H(0),n=ft,a=o=>{if(ft===n)return o();var l=_,u=ft;D(null),tr(n);var c=o();return D(l),tr(u),c};return i&&r.set("length",H(t.length)),new Proxy(t,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Mr();var c=r.get(l);return c===void 0?c=a(()=>{var v=H(u.value);return r.set(l,v),v}):B(c,u.value,!0),!0},deleteProperty(o,l){var u=r.get(l);if(u===void 0){if(l in o){const c=a(()=>H(y));r.set(l,c),$t(s)}}else B(u,y),$t(s);return!0},get(o,l,u){if(l===Kt)return t;var c=r.get(l),v=l in o;if(c===void 0&&(!v||dt(o,l)?.writable)&&(c=a(()=>{var h=mt(v?o[l]:y),d=H(h);return d}),r.set(l,c)),c!==void 0){var f=I(c);return f===y?void 0:f}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var c=r.get(l);c&&(u.value=I(c))}else if(u===void 0){var v=r.get(l),f=v?.v;if(v!==void 0&&f!==y)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return u},has(o,l){if(l===Kt)return!0;var u=r.get(l),c=u!==void 0&&u.v!==y||Reflect.has(o,l);if(u!==void 0||p!==null&&(!c||dt(o,l)?.writable)){u===void 0&&(u=a(()=>{var f=c?mt(o[l]):y,h=H(f);return h}),r.set(l,u));var v=I(u);if(v===y)return!1}return c},set(o,l,u,c){var v=r.get(l),f=l in o;if(i&&l==="length")for(var h=u;h<v.v;h+=1){var d=r.get(h+"");d!==void 0?B(d,y):h in o&&(d=a(()=>H(y)),r.set(h+"",d))}if(v===void 0)(!f||dt(o,l)?.writable)&&(v=a(()=>H(void 0)),B(v,mt(u)),r.set(l,v));else{f=v.v!==y;var b=a(()=>mt(u));B(v,b)}var T=Reflect.getOwnPropertyDescriptor(o,l);if(T?.set&&T.set.call(c,u),!f){if(i&&typeof l=="string"){var K=r.get("length"),Y=Number(l);Number.isInteger(Y)&&Y>=K.v&&B(K,Y+1)}$t(s)}return!0},ownKeys(o){I(s);var l=Reflect.ownKeys(o).filter(v=>{var f=r.get(v);return f===void 0||f.v!==y});for(var[u,c]of r)c.v!==y&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Yr()}})}var Ye,Ae,Fe,je;function ie(){if(Ye===void 0){Ye=window,Ae=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Fe=dt(e,"firstChild").get,je=dt(e,"nextSibling").get,he(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),he(r)&&(r.__t=void 0)}}function rt(t=""){return document.createTextNode(t)}function xt(t){return Fe.call(t)}function U(t){return je.call(t)}function Oe(t,e){if(!g)return xt(t);var r=xt(m);return r===null&&(r=m.appendChild(rt())),O(r),r}function Xe(t,e=!1){if(!g){var r=xt(t);return r instanceof Comment&&r.data===""?U(r):r}if(e&&m?.nodeType!==me){var i=rt();return m?.before(i),O(i),i}return m}function ne(t,e=1,r=!1){let i=g?m:t;for(var s;e--;)s=i,i=U(i);if(!g)return i;if(r&&i?.nodeType!==me){var n=rt();return i===null?s?.after(n):i.before(n),O(n),n}return O(i),i}function ti(t){t.textContent=""}function ei(){return!1}function Ie(t){var e=_,r=p;D(null),nt(null);try{return t()}finally{D(e),nt(r)}}function ri(t){p===null&&(_===null&&Pr(),Lr()),ut&&Rr()}function ii(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function lt(t,e,r){var i=p;i!==null&&(i.f&j)!==0&&(t|=j);var s={ctx:L,deps:null,nodes_start:null,nodes_end:null,f:t|E|A,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{Tt(s),s.f|=Mt}catch(o){throw C(s),o}else e!==null&&ot(s);var n=s;if(r&&n.deps===null&&n.teardown===null&&n.nodes_start===null&&n.first===n.last&&(n.f&_t)===0&&(n=n.first,(t&W)!==0&&(t&vt)!==0&&n!==null&&(n.f|=vt)),n!==null&&(n.parent=i,i!==null&&ii(n,i),_!==null&&(_.f&w)!==0&&(t&Q)===0)){var a=_;(a.effects??=[]).push(n)}return s}function Wt(){return _!==null&&!X}function We(t){ri();var e=p.f,r=!_&&(e&z)!==0&&(e&Mt)===0;if(r){var i=L;(i.e??=[]).push(t)}else return ze(t)}function ze(t){return lt(Gt|Er,t,!1)}function ni(t){F.ensure();const e=lt(Q|_t,t,!0);return()=>{C(e)}}function si(t){F.ensure();const e=lt(Q|_t,t,!0);return(r={})=>new Promise(i=>{r.outro?St(e,()=>{C(e),i(void 0)}):(C(e),i(void 0))})}function ai(t){return lt(Gt,t,!1)}function qe(t,e=0){return lt(Sr|e,t,!0)}function Ve(t,e=0){var r=lt(W|e,t,!0);return r}function G(t){return lt(z|_t,t,!0)}function He(t){var e=t.teardown;if(e!==null){const r=ut,i=_;Ze(!0),D(null);try{e.call(null)}finally{Ze(r),D(i)}}}function Be(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const s=r.ac;s!==null&&Ie(()=>{s.abort(pe)});var i=r.next;(r.f&Q)!==0?r.parent=null:C(r,e),r=i}}function oi(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&z)===0&&C(e),e=r}}function C(t,e=!0){var r=!1;(e||(t.f&ve)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(li(t.nodes_start,t.nodes_end),r=!0),Be(t,e&&!r),qt(t,0),S(t,tt);var i=t.transitions;if(i!==null)for(const n of i)n.stop();He(t);var s=t.parent;s!==null&&s.first!==null&&Ue(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function li(t,e){for(;t!==null;){var r=t===e?null:U(t);t.remove(),t=r}}function Ue(t){var e=t.parent,r=t.prev,i=t.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),e!==null&&(e.first===t&&(e.first=i),e.last===t&&(e.last=r))}function St(t,e,r=!0){var i=[];Ge(t,i,!0),ui(i,()=>{r&&C(t),e&&e()})}function ui(t,e){var r=t.length;if(r>0){var i=()=>--r||e();for(var s of t)s.out(i)}else e()}function Ge(t,e,r){if((t.f&j)===0){if(t.f^=j,t.transitions!==null)for(const a of t.transitions)(a.is_global||r)&&e.push(a);for(var i=t.first;i!==null;){var s=i.next,n=(i.f&vt)!==0||(i.f&z)!==0&&(t.f&W)!==0;Ge(i,e,n?r:!1),i=s}}}function fi(t){Je(t,!0)}function Je(t,e){if((t.f&j)!==0){t.f^=j,(t.f&$)===0&&(S(t,E),ot(t));for(var r=t.first;r!==null;){var i=r.next,s=(r.f&vt)!==0||(r.f&z)!==0;Je(r,s?e:!1),r=i}if(t.transitions!==null)for(const n of t.transitions)(n.is_global||e)&&n.in()}}function Ke(t,e){for(var r=t.nodes_start,i=t.nodes_end;r!==null;){var s=r===i?null:U(r);e.append(r),r=s}}let it=!1;function zt(t){it=t}let ut=!1;function Ze(t){ut=t}let _=null,X=!1;function D(t){_=t}let p=null;function nt(t){p=t}let J=null;function ci(t){_!==null&&(J===null?J=[t]:J.push(t))}let x=null,R=0,M=null;function hi(t){M=t}let Qe=1,Et=0,ft=Et;function tr(t){ft=t}function er(){return++Qe}function Ct(t){var e=t.f;if((e&E)!==0)return!0;if(e&w&&(t.f&=~st),(e&q)!==0){var r=t.deps;if(r!==null)for(var i=r.length,s=0;s<i;s++){var n=r[s];if(Ct(n)&&Pe(n),n.wv>t.wv)return!0}(e&A)!==0&&P===null&&S(t,$)}return!1}function rr(t,e,r=!0){var i=t.reactions;if(i!==null&&!J?.includes(t))for(var s=0;s<i.length;s++){var n=i[s];(n.f&w)!==0?rr(n,e,!1):e===n&&(r?S(n,E):(n.f&$)!==0&&S(n,q),ot(n))}}function ir(t){var e=x,r=R,i=M,s=_,n=J,a=L,o=X,l=ft,u=t.f;x=null,R=0,M=null,_=(u&(z|Q))===0?t:null,J=null,At(t.ctx),X=!1,ft=++Et,t.ac!==null&&(Ie(()=>{t.ac.abort(pe)}),t.ac=null);try{t.f|=Jt;var c=t.fn,v=c(),f=t.deps;if(x!==null){var h;if(qt(t,R),f!==null&&R>0)for(f.length=R+x.length,h=0;h<x.length;h++)f[R+h]=x[h];else t.deps=f=x;if(it&&Wt()&&(t.f&A)!==0)for(h=R;h<f.length;h++)(f[h].reactions??=[]).push(t)}else f!==null&&R<f.length&&(qt(t,R),f.length=R);if($e()&&M!==null&&!X&&f!==null&&(t.f&(w|q|E))===0)for(h=0;h<M.length;h++)rr(M[h],t);return s!==null&&s!==t&&(Et++,M!==null&&(i===null?i=M:i.push(...M))),(t.f&wt)!==0&&(t.f^=wt),v}catch(d){return Se(d)}finally{t.f^=Jt,x=e,R=r,M=i,_=s,J=n,At(a),X=o,ft=l}}function di(t,e){let r=e.reactions;if(r!==null){var i=gr.call(r,t);if(i!==-1){var s=r.length-1;s===0?r=e.reactions=null:(r[i]=r[s],r.pop())}}r===null&&(e.f&w)!==0&&(x===null||!x.includes(e))&&(S(e,q),(e.f&A)!==0&&(e.f^=A,e.f&=~st),Le(e),qt(e,0))}function qt(t,e){var r=t.deps;if(r!==null)for(var i=e;i<r.length;i++)di(t,r[i])}function Tt(t){var e=t.f;if((e&tt)===0){S(t,$);var r=p,i=it;p=t,it=!0;try{(e&W)!==0?oi(t):Be(t),He(t);var s=ir(t);t.teardown=typeof s=="function"?s:null,t.wv=Qe;var n;Ut&&zr&&(t.f&E)!==0&&t.deps}finally{it=i,p=r}}}function I(t){var e=t.f,r=(e&w)!==0;if(_!==null&&!X){var i=p!==null&&(p.f&tt)!==0;if(!i&&!J?.includes(t)){var s=_.deps;if((_.f&Jt)!==0)t.rv<Et&&(t.rv=Et,x===null&&s!==null&&s[R]===t?R++:x===null?x=[t]:x.includes(t)||x.push(t));else{(_.deps??=[]).push(t);var n=t.reactions;n===null?t.reactions=[_]:n.includes(_)||n.push(_)}}}if(ut){if(et.has(t))return et.get(t);if(r){var a=t,o=a.v;return((a.f&$)===0&&a.reactions!==null||sr(a))&&(o=ee(a)),et.set(a,o),o}}else r&&!P?.has(t)&&(a=t,Ct(a)&&Pe(a),it&&Wt()&&(a.f&A)===0&&nr(a));if(P?.has(t))return P.get(t);if((t.f&wt)!==0)throw t.v;return t.v}function nr(t){if(t.deps!==null){t.f^=A;for(const e of t.deps)(e.reactions??=[]).push(t),(e.f&w)!==0&&(e.f&A)===0&&nr(e)}}function sr(t){if(t.v===y)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(et.has(e)||(e.f&w)!==0&&sr(e))return!0;return!1}function ar(t){var e=X;try{return X=!0,t()}finally{X=e}}const vi=-7169;function S(t,e){t.f=t.f&vi|e}const or=new Set,se=new Set;function _i(t){for(var e=0;e<t.length;e++)or.add(t[e]);for(var r of se)r(t)}let lr=null;function Vt(t){var e=this,r=e.ownerDocument,i=t.type,s=t.composedPath?.()||[],n=s[0]||t.target;lr=t;var a=0,o=lr===t&&t.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=s.indexOf(e);if(u===-1)return;l<=u&&(a=l)}if(n=s[a]||t.target,n!==e){Nt(t,"currentTarget",{configurable:!0,get(){return n||r}});var c=_,v=p;D(null),nt(null);try{for(var f,h=[];n!==null;){var d=n.assignedSlot||n.parentNode||n.host||null;try{var b=n["__"+i];b!=null&&(!n.disabled||t.target===n)&&b.call(n,t)}catch(T){f?h.push(T):f=T}if(t.cancelBubble||d===e||d===null)break;n=d}if(f){for(let T of h)queueMicrotask(()=>{throw T});throw f}}finally{t.__root=e,delete t.currentTarget,D(c),nt(v)}}}function pi(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Rt(t,e){var r=p;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function ae(t,e){var r=(e&pr)!==0,i,s=!t.startsWith("<!>");return()=>{if(g)return Rt(m,null),m;i===void 0&&(i=pi(s?t:"<!>"+t),i=xt(i));var n=r||Ae?document.importNode(i,!0):i.cloneNode(!0);return Rt(n,n),n}}function ur(){if(g)return Rt(m,null),m;var t=document.createDocumentFragment(),e=document.createComment(""),r=rt();return t.append(e,r),Rt(e,r),t}function gt(t,e){if(g){var r=p;((r.f&Mt)===0||r.nodes_end===null)&&(r.nodes_end=m),Zt();return}t!==null&&t.before(e)}const mi=["touchstart","touchmove"];function gi(t){return mi.includes(t)}function fr(t,e){return cr(t,e)}function bi(t,e){ie(),e.intro=e.intro??!1;const r=e.target,i=g,s=m;try{for(var n=xt(r);n&&(n.nodeType!==kt||n.data!==fe);)n=U(n);if(!n)throw ht;pt(!0),O(n);const a=cr(t,{...e,anchor:n});return pt(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
- `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==ht&&console.warn("Failed to hydrate: ",a),e.recover===!1&&Dr(),ie(),ti(r),pt(!1),fr(t,e)}finally{pt(i),O(s)}}const bt=new Map;function cr(t,{target:e,anchor:r,props:i={},events:s,context:n,intro:a=!0}){ie();var o=new Set,l=v=>{for(var f=0;f<v.length;f++){var h=v[f];if(!o.has(h)){o.add(h);var d=gi(h);e.addEventListener(h,Vt,{passive:d});var b=bt.get(h);b===void 0?(document.addEventListener(h,Vt,{passive:d}),bt.set(h,1)):bt.set(h,b+1)}}};l(br(or)),se.add(l);var u=void 0,c=si(()=>{var v=r??e.appendChild(rt());return Ur(v,{pending:()=>{}},f=>{if(n){ke({});var h=L;h.c=n}if(s&&(i.$$events=s),g&&Rt(f,null),u=t(f,i)||{},g&&(p.nodes_end=m,m===null||m.nodeType!==kt||m.data!==ce))throw Yt(),ht;n&&ye()}),()=>{for(var f of o){e.removeEventListener(f,Vt);var h=bt.get(f);--h===0?(document.removeEventListener(f,Vt),bt.delete(f)):bt.set(f,h)}se.delete(l),v!==r&&v.parentNode?.removeChild(v)}});return oe.set(u,c),u}let oe=new WeakMap;function wi(t,e){const r=oe.get(t);return r?(oe.delete(t),r(e)):Promise.resolve()}class ki{anchor;#e=new Map;#t=new Map;#r=new Map;#i=new Set;#l=!0;constructor(e,r=!0){this.anchor=e,this.#l=r}#s=()=>{var e=k;if(this.#e.has(e)){var r=this.#e.get(e),i=this.#t.get(r);if(i)fi(i),this.#i.delete(r);else{var s=this.#r.get(r);s&&(this.#t.set(r,s.effect),this.#r.delete(r),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),i=s.effect)}for(const[n,a]of this.#e){if(this.#e.delete(n),n===e)break;const o=this.#r.get(a);o&&(C(o.effect),this.#r.delete(a))}for(const[n,a]of this.#t){if(n===r||this.#i.has(n))continue;const o=()=>{if(Array.from(this.#e.values()).includes(n)){var u=document.createDocumentFragment();Ke(a,u),u.append(rt()),this.#r.set(n,{effect:a,fragment:u})}else C(a);this.#i.delete(n),this.#t.delete(n)};this.#l||!i?(this.#i.add(n),St(a,o,!1)):o()}}};#n=e=>{this.#e.delete(e);const r=Array.from(this.#e.values());for(const[i,s]of this.#r)r.includes(i)||(C(s.effect),this.#r.delete(i))};ensure(e,r){var i=k,s=ei();if(r&&!this.#t.has(e)&&!this.#r.has(e))if(s){var n=document.createDocumentFragment(),a=rt();n.append(a),this.#r.set(e,{effect:G(()=>r(a)),fragment:n})}else this.#t.set(e,G(()=>r(this.anchor)));if(this.#e.set(i,e),s){for(const[o,l]of this.#t)o===e?i.skipped_effects.delete(l):i.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?i.skipped_effects.delete(l.effect):i.skipped_effects.add(l.effect);i.oncommit(this.#s),i.ondiscard(this.#n)}else g&&(this.anchor=m),this.#s()}}function yi(t){L===null&&Tr(),We(()=>{const e=ar(t);if(typeof e=="function")return e})}function hr(t,e,r=!1){g&&Zt();var i=new ki(t),s=r?vt:0;function n(a,o){if(g){const u=Xr(t)===Bt;if(a===u){var l=be();O(l),i.anchor=l,pt(!1),i.ensure(a,o),pt(!0);return}}i.ensure(a,o)}Ve(()=>{var a=!1;e((o,l=!0)=>{a=!0,n(l,o)}),a||n(!1,null)},s)}function $i(t,e){ai(()=>{var r=t.getRootNode(),i=r.host?r:r.head??r.ownerDocument.head;if(!i.querySelector("#"+e.hash)){const s=document.createElement("style");s.id=e.hash,s.textContent=e.code,i.appendChild(s)}})}function le(t,e,r,i){var s=i,n=!0,a=()=>(n&&(n=!1,s=i),s),o;o=t[e],o===void 0&&i!==void 0&&(o=a());var l;l=()=>{var f=t[e];return f===void 0?a():(n=!0,f)};var u=!1,c=Jr(()=>(u=!1,l())),v=p;return(function(f,h){if(arguments.length>0){const d=h?I(c):f;return B(c,d),u=!0,s!==void 0&&(s=d),f}return ut&&u||(v.f&tt)!==0?c.v:I(c)})}function xi(t){return new Si(t)}class Si{#e;#t;constructor(e){var r=new Map,i=(n,a)=>{var o=Zr(a,!1,!1);return r.set(n,o),o};const s=new Proxy({...e.props||{},$$events:{}},{get(n,a){return I(r.get(a)??i(a,Reflect.get(n,a)))},has(n,a){return a===Cr?!0:(I(r.get(a)??i(a,Reflect.get(n,a))),Reflect.has(n,a))},set(n,a,o){return B(r.get(a)??i(a,o),o),Reflect.set(n,a,o)}});this.#t=(e.hydrate?bi:fr)(e.component,{target:e.target,anchor:e.anchor,props:s,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&Xt(),this.#e=s.$$events;for(const n of Object.keys(this.#t))n==="$set"||n==="$destroy"||n==="$on"||Nt(this,n,{get(){return this.#t[n]},set(a){this.#t[n]=a},enumerable:!0});this.#t.$set=n=>{Object.assign(s,n)},this.#t.$destroy=()=>{wi(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const i=(...s)=>r.call(this,...s);return this.#e[e].push(i),()=>{this.#e[e]=this.#e[e].filter(s=>s!==i)}}$destroy(){this.#t.$destroy()}}let dr;typeof HTMLElement=="function"&&(dr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const i=this.$$c.$on(t,e);this.$$l_u.set(e,i)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const i=this.$$l_u.get(e);i&&(i(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(i){return s=>{const n=document.createElement("slot");i!=="default"&&(n.name=i),gt(s,n)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Ei(this);for(const i of this.$$s)i in r&&(i==="default"&&!this.$$d.children?(this.$$d.children=t(i),e.default=!0):e[i]=t(i));for(const i of this.attributes){const s=this.$$g_p(i.name);s in this.$$d||(this.$$d[s]=Ht(s,i.value,this.$$p_d,"toProp"))}for(const i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=xi({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=ni(()=>{qe(()=>{this.$$r=!0;for(const i of Pt(this.$$c)){if(!this.$$p_d[i]?.reflect)continue;this.$$d[i]=this.$$c[i];const s=Ht(i,this.$$d[i],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,s)}this.$$r=!1})});for(const i in this.$$l)for(const s of this.$$l[i]){const n=this.$$c.$on(i,s);this.$$l_u.set(s,n)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Ht(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Pt(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Ht(t,e,r,i){const s=r[t]?.type;if(e=s==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(s){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(s){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Ei(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function Ci(t,e,r,i,s,n){let a=class extends dr{constructor(){super(t,r,s),this.$$p_d=e}static get observedAttributes(){return Pt(e).map(o=>(e[o].attribute||o).toLowerCase())}};return Pt(e).forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Ht(o,l,e),this.$$d[o]=l;var u=this.$$c;if(u){var c=dt(u,o)?.get;c?u[o]=l:u.$set({[o]:l})}}})}),i.forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c?.[o]}})}),t.element=a,a}class Ti{constructor(e,r){this.StickStatus={xPosition:0,yPosition:0,x:0,y:0,cardinalDirection:"C"},this.parameters=r?.parameters||{};const i={title:"joystick",width:0,height:0,internalFillColor:"#00AA00",internalLineWidth:2,internalStrokeColor:"#003300",externalLineWidth:2,externalStrokeColor:"#008000",autoReturnToCenter:!0,callback:function(n){}};this.callback=r?.callback||i.callback,this.title=r?.parameters?.title||i.title,this.width=r?.parameters?.width||i.width,this.height=r?.parameters?.height||i.height,this.internalFillColor=r?.parameters?.internalFillColor||i.internalFillColor,this.internalLineWidth=r?.parameters?.internalLineWidth||i.internalLineWidth,this.internalStrokeColor=r?.parameters?.internalStrokeColor||i.internalStrokeColor,this.externalLineWidth=r?.parameters?.externalLineWidth||i.externalLineWidth,this.externalStrokeColor=r?.parameters?.externalStrokeColor||i.externalStrokeColor,this.autoReturnToCenter=r?.parameters?.autoReturnToCenter||i.autoReturnToCenter,console.log("stttt",e.style),e.style.touchAction="none",this.canvas=document.createElement("canvas"),this.canvas.id=this.title,this.width===0&&(this.width=e.clientWidth),this.height===0&&(this.height=e.clientHeight),this.canvas.width=this.width,this.canvas.height=this.height,e.appendChild(this.canvas);const s=this.canvas.getContext("2d");console.log("canvas",s),this.context=s,this.pressed=!1,this.circumference=2*Math.PI,this.internalRadius=(this.canvas.width-(this.canvas.width/2+10))/2,this.maxMoveStick=this.internalRadius*1.1,this.externalRadius=this.internalRadius*1.6,this.centerX=this.canvas.width/2,this.centerY=this.canvas.height/2,this.directionHorizontalLimitPos=this.canvas.width/10,this.directionHorizontalLimitNeg=this.directionHorizontalLimitPos*-1,this.directionVerticalLimitPos=this.canvas.height/10,this.directionVerticalLimitNeg=this.directionVerticalLimitPos*-1,this.movedX=this.centerX,this.movedY=this.centerY,"ontouchstart"in document.documentElement?(this.canvas.addEventListener("touchstart",n=>this._onTouchStart(n),!1),document.addEventListener("touchmove",n=>this._onTouchMove(n),!1),document.addEventListener("touchend",n=>this._onTouchEnd(n),!1)):(this.canvas.addEventListener("mousedown",n=>this._onMouseDown(n),!1),document.addEventListener("mousemove",n=>this._onMouseMove(n),!1),document.addEventListener("mouseup",n=>this._onMouseUp(n),!1)),this._drawExternal(),this._drawInternal()}_drawExternal(){this.context.beginPath(),this.context.arc(this.centerX,this.centerY,this.externalRadius,0,this.circumference,!1),this.context.lineWidth=this.externalLineWidth,this.context.strokeStyle=this.externalStrokeColor,this.context.stroke()}_drawInternal(){this.context.beginPath(),this.movedX<this.internalRadius&&(this.movedX=this.maxMoveStick),this.movedX+this.internalRadius>this.canvas.width&&(this.movedX=this.canvas.width-this.maxMoveStick),this.movedY<this.internalRadius&&(this.movedY=this.maxMoveStick),this.movedY+this.internalRadius>this.canvas.height&&(this.movedY=this.canvas.height-this.maxMoveStick),this.context.arc(this.movedX,this.movedY,this.internalRadius,0,this.circumference,!1);const e=this.context.createRadialGradient(this.centerX,this.centerY,5,this.centerX,this.centerY,200);e.addColorStop(0,this.internalFillColor),e.addColorStop(1,this.internalStrokeColor),this.context.fillStyle=e,this.context.fill(),this.context.lineWidth=this.internalLineWidth,this.context.strokeStyle=this.internalStrokeColor,this.context.stroke()}_onTouchStart(e){this.pressed=!0}_onTouchMove(e){this.pressed&&e.targetTouches[0].target===this.canvas&&(this.movedX=e.targetTouches[0].pageX,this.movedY=e.targetTouches[0].pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onTouchEnd(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_onMouseDown(e){this.pressed=!0}_onMouseMove(e){this.pressed&&(this.movedX=e.pageX,this.movedY=e.pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onMouseUp(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_getCardinalDirection(){let e="",r=this.movedX-this.centerX,i=this.movedY-this.centerY;return i>=this.directionVerticalLimitNeg&&i<=this.directionVerticalLimitPos&&(e="C"),i<this.directionVerticalLimitNeg&&(e="N"),i>this.directionVerticalLimitPos&&(e="S"),r<this.directionHorizontalLimitNeg&&(e==="C"?e="W":e+="W"),r>this.directionHorizontalLimitPos&&(e==="C"?e="E":e+="E"),e}GetWidth(){return this.canvas.width}GetHeight(){return this.canvas.height}GetPosX(){return this.movedX}GetPosY(){return this.movedY}GetX(){return(100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()}GetY(){return(100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()}GetDir(){return this._getCardinalDirection()}}var ct={},vr;function Ri(){if(vr)return ct;vr=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.LanguageTranslator=void 0,ct.getChildStyleToPass=t,ct.addComponent=e;function t(i,s){var n,a,o="";try{if(i&&s?.length&&(!((n=Object.keys(i))===null||n===void 0)&&n.length)&&(!((a=s?.filter(function(f){return Object.keys(i).includes(f.name)}))===null||a===void 0)&&a.length))for(var l=function(f){var h=s?.filter(function(d){return d.name===f&&d.defaultValue!==i[f]});h&&(o+="".concat(f,":").concat(i[f],";"))},u=0,c=Object.keys(i);u<c.length;u++){var v=c[u];l(v)}}catch(f){console.error("error getting child style to pass",f)}finally{return o}}function e(i){var s,n=((s=i?.repoName.split("/"))===null||s===void 0?void 0:s[1])||i?.repoName;if(!n)throw new Error("wrong componentPath "+i?.repoName);if(!i?.version)throw new Error("wrong version "+i?.version);var a=i?.iifePath||"main.iife.js";if(!document.getElementById(n+"-script"))try{var o=document.createElement("script");if(o.id=n+"-script",o.src="https://cdn.jsdelivr.net/npm/".concat(i.repoName,"@").concat(i.version,"/").concat(a),i?.local)o.src="".concat(i.local);else if(location.href.includes("localhost:6006")){var l=n.split("-")[0];o.src="http://localhost:6006/webcomponents/".concat(n.replace(l+"-",""),"/").concat(a)}document.head.appendChild(o)}catch(u){console.warn(u)}}var r=(function(){function i(s){if(this.lang="",!s?.dictionary)throw new Error("no dictionary provided");this.dictionary=s.dictionary,this.setLang(s?.lang)}return i.prototype.setLang=function(s){s||(s=i.getDefaultLang()),this.lang=s},i.prototype.translateWord=function(s,n){return i.getDictionaryWord(s,this.dictionary,n||this.lang)},i.prototype.translateDate=function(s,n,a){return i.formatDate(s,n,a||this.lang)},i.getDefaultLang=function(){var s,n,a,o="en";return navigator?.languages&&(!((a=(n=(s=navigator.languages[0])===null||s===void 0?void 0:s.split("-")[0])===null||n===void 0?void 0:n.toLowerCase())===null||a===void 0)&&a.length)&&(o=navigator.languages[0].split("-")[0].toLowerCase()),o},i.getDictionaryWord=function(s,n,a){var o;if(!s)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(a&&(!((o=n[a])===null||o===void 0)&&o[s]))return n[a][s];var l="",u=i.getDefaultLang();if(!a||u!==a){var c=n?.[u];c?.[s]&&(l=c[s])}return l},i.formatDate=function(s,n,a){if(!s)throw new Error("no date provided");if(typeof s.getMonth!="function")throw new Error("wrong date format");var o=new Intl.DateTimeFormat(a||i.getDefaultLang(),n);return o.format(s)},i})();return ct.LanguageTranslator=r,ct}Ri();var Li=ae('<div class="set svelte-k03ui8"><nav class="d-pad svelte-k03ui8"><button class="up svelte-k03ui8" aria-label="Move up"></button> <button class="right svelte-k03ui8" aria-label="Move right"></button> <button class="down svelte-k03ui8" aria-label="Move down"></button> <button class="left svelte-k03ui8" aria-label="Move left"></button></nav></div>'),Pi=ae('<div id="joystick" class="svelte-k03ui8"></div>'),Ni=ae("<div>Unknown type</div>");const Di={hash:"svelte-k03ui8",code:`@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;--hb-pad-joystick-size: 200px;--dpad-radius: 17%;--dpad-radius-in: 20%;--dpad-fg: #ddd;--dpad-fg-hover: #eee;--dpad-bg: #fff;--arrowcolor: #aaa;--tri-sml-a: calc(var(--hb-pad-joystick-size) / 9);--tri-sml-b: calc(var(--hb-pad-joystick-size) / 6);--tri-lrg-a: calc(var(--hb-pad-joystick-size) / 9);--tri-lrg-b: calc(var(--hb-pad-joystick-size) / 6);--dpad-arrow-shift: 5px;--dpad-arrow-move: 35%;}#joystick.svelte-k03ui8 {width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);margin:auto;}.set.svelte-k03ui8 {overflow:hidden;}.set.svelte-k03ui8 .d-pad:where(.svelte-k03ui8) {display:inline-block;}.d-pad.svelte-k03ui8 {position:relative;width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);border-radius:48%;overflow:hidden;}.d-pad.svelte-k03ui8:before {content:"";position:absolute;top:50%;left:50%;border-radius:5%;transform:translate(-50%, -50%);width:66.6%;height:66.6%;background:var(--dpad-fg);}.d-pad.svelte-k03ui8:after {content:"";position:absolute;display:none;z-index:2;width:20%;height:20%;top:50%;left:50%;background:var(--dpad-fg);border-radius:50%;transform:translate(-50%, -50%);transition:all 0.25s;cursor:pointer;}.d-pad.svelte-k03ui8:hover:after {width:30%;height:30%;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8) {cursor:pointer;border:none;display:block;position:absolute;-webkit-tap-highlight-color:rgba(255, 255, 255, 0);width:33.3%;height:43%;line-height:40%;color:#fff;background:var(--dpad-fg);text-align:center;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):hover {background:var(--dpad-fg-hover);}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):before {content:"";position:absolute;width:0;height:0;border-radius:5px;border-style:solid;transition:all 0.25s;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):after {content:"";position:absolute;width:102%;height:78%;background:var(--dpad-bg);border-radius:var(--dpad-radius-in);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8),
1
+ (function(ue){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const pr=2,fe="[",Bt="[!",ce="]",ht={},y=Symbol(),Ut=!1;var mr=Array.isArray,gr=Array.prototype.indexOf,br=Array.from,Pt=Object.keys,Nt=Object.defineProperty,dt=Object.getOwnPropertyDescriptor,wr=Object.prototype,kr=Array.prototype,yr=Object.getPrototypeOf,he=Object.isExtensible;function $r(t){for(var e=0;e<t.length;e++)t[e]()}function xr(){var t,e,r=new Promise((i,s)=>{t=i,e=s});return{promise:r,resolve:t,reject:e}}const w=2,Gt=4,Sr=8,W=16,z=32,Z=64,Dt=128,A=512,$=1024,E=2048,q=4096,j=8192,Q=16384,Mt=32768,vt=65536,de=1<<17,ve=1<<18,_t=1<<19,Er=1<<20,st=32768,Jt=1<<21,_e=1<<22,bt=1<<23,Kt=Symbol("$state"),Cr=Symbol("legacy props"),pe=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},me=3,wt=8;function Tr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Rr(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Lr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Pr(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Nr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Dr(){throw new Error("https://svelte.dev/e/hydration_failed")}function Mr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Yr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ar(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Fr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Yt(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function jr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let g=!1;function pt(t){g=t}let m;function O(t){if(t===null)throw Yt(),ht;return m=t}function Zt(){return O(B(m))}function ge(t){if(g){if(B(m)!==null)throw Yt(),ht;m=t}}function Or(t=1){if(g){for(var e=t,r=m;e--;)r=B(r);m=r}}function be(t=!0){for(var e=0,r=m;;){if(r.nodeType===wt){var i=r.data;if(i===ce){if(e===0)return r;e-=1}else(i===fe||i===Bt)&&(e+=1)}var s=B(r);t&&r.remove(),r=s}}function Xr(t){if(!t||t.nodeType!==wt)throw Yt(),ht;return t.data}function we(t){return t===this.v}function Ir(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Wr(t){return!Ir(t,this.v)}let zr=!1,L=null;function At(t){L=t}function ke(t,e=!1,r){L={p:L,i:!1,c:null,e:null,s:t,x:null,l:null}}function ye(t){var e=L,r=e.e;if(r!==null){e.e=null;for(var i of r)ze(i)}return t!==void 0&&(e.x=t),e.i=!0,L=e.p,t??{}}function $e(){return!0}let at=[];function xe(){var t=at;at=[],$r(t)}function Qt(t){if(at.length===0&&!kt){var e=at;queueMicrotask(()=>{e===at&&xe()})}at.push(t)}function qr(){for(;at.length>0;)xe()}function Se(t){var e=p;if(e===null)return _.f|=bt,t;if((e.f&Mt)===0){if((e.f&Dt)===0)throw t;e.b.error(t)}else Ft(t,e)}function Ft(t,e){for(;e!==null;){if((e.f&Dt)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t}const jt=new Set;let k=null,P=null,N=[],Ot=null,te=!1,kt=!1;class F{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#i=0;#l=null;#s=[];#n=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#i>0}process(e){N=[],this.apply();var r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of e)this.#a(i,r);this.is_fork||this.#f(),this.is_deferred()?(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects)):(k=null,Ce(r.render_effects),Ce(r.effects),this.#l?.resolve()),P=null}#a(e,r){e.f^=$;for(var i=e.first;i!==null;){var s=i.f,n=(s&(z|Z))!==0,a=n&&(s&$)!==0,o=a||(s&j)!==0||this.skipped_effects.has(i);if((i.f&Dt)!==0&&i.b?.is_pending()&&(r={parent:r,effect:i,effects:[],render_effects:[],block_effects:[]}),!o&&i.fn!==null){n?i.f^=$:(s&Gt)!==0?r.effects.push(i):Ct(i)&&((i.f&W)!==0&&r.block_effects.push(i),Tt(i));var l=i.first;if(l!==null){i=l;continue}}var u=i.parent;for(i=i.next;i===null&&u!==null;)u===r.effect&&(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects),r=r.parent),i=u.next,u=u.parent}}#o(e){for(const r of e)((r.f&E)!==0?this.#s:this.#n).push(r),this.#u(r.deps),S(r,$)}#u(e){if(e!==null)for(const r of e)(r.f&w)===0||(r.f&st)===0||(r.f^=st,this.#u(r.deps))}capture(e,r){this.previous.has(e)||this.previous.set(e,r),(e.f&bt)===0&&(this.current.set(e,e.v),P?.set(e,e.v))}activate(){k=this,this.apply()}deactivate(){k===this&&(k=null,P=null)}flush(){if(this.activate(),N.length>0){if(Ee(),k!==null&&k!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const e of this.#t)e(this);this.#t.clear()}#f(){if(this.#i===0){for(const e of this.#e)e();this.#e.clear()}this.#r===0&&this.#c()}#c(){if(jt.size>1){this.previous.clear();var e=P,r=!0,i={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const n of jt){if(n===this){r=!1;continue}const a=[];for(const[l,u]of this.current){if(n.current.has(l))if(r&&u!==n.current.get(l))n.current.set(l,u);else continue;a.push(l)}if(a.length===0)continue;const o=[...n.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var s=N;N=[];const l=new Set,u=new Map;for(const c of a)Te(c,o,l,u);if(N.length>0){k=n,n.apply();for(const c of N)n.#a(c,i);n.deactivate()}N=s}}k=null,P=e}this.committed=!0,jt.delete(this)}increment(e){this.#r+=1,e&&(this.#i+=1)}decrement(e){this.#r-=1,e&&(this.#i-=1),this.revive()}revive(){for(const e of this.#s)S(e,E),ot(e);for(const e of this.#n)S(e,q),ot(e);this.#s=[],this.#n=[],this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#l??=xr()).promise}static ensure(){if(k===null){const e=k=new F;jt.add(k),kt||F.enqueue(()=>{k===e&&e.flush()})}return k}static enqueue(e){Qt(e)}apply(){}}function Xt(t){var e=kt;kt=!0;try{for(var r;;){if(qr(),N.length===0&&(k?.flush(),N.length===0))return Ot=null,r;Ee()}}finally{kt=e}}function Ee(){var t=it;te=!0;var e=null;try{var r=0;for(zt(!0);N.length>0;){var i=F.ensure();if(r++>1e3){var s,n;Vr()}i.process(N),tt.clear()}}finally{te=!1,zt(t),Ot=null}}function Vr(){try{Nr()}catch(t){Ft(t,Ot)}}let V=null;function Ce(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var i=t[r++];if((i.f&(Q|j))===0&&Ct(i)&&(V=new Set,Tt(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null&&i.ac===null?Ue(i):i.fn=null),V?.size>0)){tt.clear();for(const s of V){if((s.f&(Q|j))!==0)continue;const n=[s];let a=s.parent;for(;a!==null;)V.has(a)&&(V.delete(a),n.push(a)),a=a.parent;for(let o=n.length-1;o>=0;o--){const l=n[o];(l.f&(Q|j))===0&&Tt(l)}}V.clear()}}V=null}}function Te(t,e,r,i){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const s of t.reactions){const n=s.f;(n&w)!==0?Te(s,e,r,i):(n&(_e|W))!==0&&(n&E)===0&&Re(s,e,i)&&(S(s,E),ot(s))}}function Re(t,e,r){const i=r.get(t);if(i!==void 0)return i;if(t.deps!==null)for(const s of t.deps){if(e.includes(s))return!0;if((s.f&w)!==0&&Re(s,e,r))return r.set(s,!0),!0}return r.set(t,!1),!1}function ot(t){for(var e=Ot=t;e.parent!==null;){e=e.parent;var r=e.f;if(te&&e===p&&(r&W)!==0&&(r&ve)===0)return;if((r&(Z|z))!==0){if((r&$)===0)return;e.f^=$}}N.push(e)}function Hr(t){let e=0,r=It(0),i;return()=>{Wt()&&(I(r),qe(()=>(e===0&&(i=ar(()=>t(()=>yt(r)))),e+=1,()=>{Qt(()=>{e-=1,e===0&&(i?.(),i=void 0,yt(r))})})))}}var Br=vt|_t|Dt;function Ur(t,e,r){new Gr(t,e,r)}class Gr{parent;#e=!1;#t;#r=g?m:null;#i;#l;#s;#n=null;#a=null;#o=null;#u=null;#f=null;#c=0;#h=0;#v=!1;#d=null;#b=Hr(()=>(this.#d=It(this.#c),()=>{this.#d=null}));constructor(e,r,i){this.#t=e,this.#i=r,this.#l=i,this.parent=p.b,this.#e=!!this.#i.pending,this.#s=Ve(()=>{if(p.b=this,g){const n=this.#r;Zt(),n.nodeType===wt&&n.data===Bt?this.#k():this.#w()}else{var s=this.#m();try{this.#n=U(()=>i(s))}catch(n){this.error(n)}this.#h>0?this.#p():this.#e=!1}return()=>{this.#f?.remove()}},Br),g&&(this.#t=m)}#w(){try{this.#n=U(()=>this.#l(this.#t))}catch(e){this.error(e)}this.#e=!1}#k(){const e=this.#i.pending;e&&(this.#a=U(()=>e(this.#t)),F.enqueue(()=>{var r=this.#m();this.#n=this.#_(()=>(F.ensure(),U(()=>this.#l(r)))),this.#h>0?this.#p():(St(this.#a,()=>{this.#a=null}),this.#e=!1)}))}#m(){var e=this.#t;return this.#e&&(this.#f=rt(),this.#t.before(this.#f),e=this.#f),e}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#i.pending}#_(e){var r=p,i=_,s=L;nt(this.#s),D(this.#s),At(this.#s.ctx);try{return e()}catch(n){return Se(n),null}finally{nt(r),D(i),At(s)}}#p(){const e=this.#i.pending;this.#n!==null&&(this.#u=document.createDocumentFragment(),this.#u.append(this.#f),Ke(this.#n,this.#u)),this.#a===null&&(this.#a=U(()=>e(this.#t)))}#g(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#g(e);return}this.#h+=e,this.#h===0&&(this.#e=!1,this.#a&&St(this.#a,()=>{this.#a=null}),this.#u&&(this.#t.before(this.#u),this.#u=null))}update_pending_count(e){this.#g(e),this.#c+=e,this.#d&&De(this.#d,this.#c)}get_effect_pending(){return this.#b(),I(this.#d)}error(e){var r=this.#i.onerror;let i=this.#i.failed;if(this.#v||!r&&!i)throw e;this.#n&&(C(this.#n),this.#n=null),this.#a&&(C(this.#a),this.#a=null),this.#o&&(C(this.#o),this.#o=null),g&&(O(this.#r),Or(),O(be()));var s=!1,n=!1;const a=()=>{if(s){jr();return}s=!0,n&&Fr(),F.ensure(),this.#c=0,this.#o!==null&&St(this.#o,()=>{this.#o=null}),this.#e=this.has_pending_snippet(),this.#n=this.#_(()=>(this.#v=!1,U(()=>this.#l(this.#t)))),this.#h>0?this.#p():this.#e=!1};var o=_;try{D(null),n=!0,r?.(e,a),n=!1}catch(l){Ft(l,this.#s&&this.#s.parent)}finally{D(o)}i&&Qt(()=>{this.#o=this.#_(()=>{F.ensure(),this.#v=!0;try{return U(()=>{i(this.#t,()=>e,()=>a)})}catch(l){return Ft(l,this.#s.parent),null}finally{this.#v=!1}})})}}function Jr(t){var e=w|E,r=_!==null&&(_.f&w)!==0?_:null;return p!==null&&(p.f|=_t),{ctx:L,deps:null,effects:null,equals:we,f:e,fn:t,reactions:null,rv:0,v:y,wv:0,parent:r??p,ac:null}}function Le(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)C(e[r])}}function Kr(t){for(var e=t.parent;e!==null;){if((e.f&w)===0)return(e.f&Q)===0?e:null;e=e.parent}return null}function ee(t){var e,r=p;nt(Kr(t));try{t.f&=~st,Le(t),e=ir(t)}finally{nt(r)}return e}function Pe(t){var e=ee(t);if(t.equals(e)||(k?.is_fork||(t.v=e),t.wv=er()),!ut)if(P!==null)Wt()&&P.set(t,e);else{var r=(t.f&A)===0?q:$;S(t,r)}}let re=new Set;const tt=new Map;let Ne=!1;function It(t,e){var r={f:0,v:t,reactions:null,equals:we,rv:0,wv:0};return r}function et(t,e){const r=It(t);return ci(r),r}function Zr(t,e=!1,r=!0){const i=It(t);return e||(i.equals=Wr),i}function H(t,e,r=!1){_!==null&&(!X||(_.f&de)!==0)&&$e()&&(_.f&(w|W|_e|de))!==0&&!G?.includes(t)&&Ar();let i=r?$t(e):e;return De(t,i)}function De(t,e){if(!t.equals(e)){var r=t.v;ut?tt.set(t,e):tt.set(t,r),t.v=e;var i=F.ensure();i.capture(t,r),(t.f&w)!==0&&((t.f&E)!==0&&ee(t),S(t,(t.f&A)!==0?$:q)),t.wv=er(),Me(t,E),p!==null&&(p.f&$)!==0&&(p.f&(z|Z))===0&&(M===null?hi([t]):M.push(t)),!i.is_fork&&re.size>0&&!Ne&&Qr()}return e}function Qr(){Ne=!1;var t=it;zt(!0);const e=Array.from(re);try{for(const r of e)(r.f&$)!==0&&S(r,q),Ct(r)&&Tt(r)}finally{zt(t)}re.clear()}function yt(t){H(t,t.v+1)}function Me(t,e){var r=t.reactions;if(r!==null)for(var i=r.length,s=0;s<i;s++){var n=r[s],a=n.f,o=(a&E)===0;if(o&&S(n,e),(a&w)!==0){var l=n;P?.delete(l),(a&st)===0&&(a&A&&(n.f|=st),Me(l,q))}else o&&((a&W)!==0&&V!==null&&V.add(n),ot(n))}}function $t(t){if(typeof t!="object"||t===null||Kt in t)return t;const e=yr(t);if(e!==wr&&e!==kr)return t;var r=new Map,i=mr(t),s=et(0),n=ft,a=o=>{if(ft===n)return o();var l=_,u=ft;D(null),tr(n);var c=o();return D(l),tr(u),c};return i&&r.set("length",et(t.length)),new Proxy(t,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Mr();var c=r.get(l);return c===void 0?c=a(()=>{var v=et(u.value);return r.set(l,v),v}):H(c,u.value,!0),!0},deleteProperty(o,l){var u=r.get(l);if(u===void 0){if(l in o){const c=a(()=>et(y));r.set(l,c),yt(s)}}else H(u,y),yt(s);return!0},get(o,l,u){if(l===Kt)return t;var c=r.get(l),v=l in o;if(c===void 0&&(!v||dt(o,l)?.writable)&&(c=a(()=>{var h=$t(v?o[l]:y),d=et(h);return d}),r.set(l,c)),c!==void 0){var f=I(c);return f===y?void 0:f}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var c=r.get(l);c&&(u.value=I(c))}else if(u===void 0){var v=r.get(l),f=v?.v;if(v!==void 0&&f!==y)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return u},has(o,l){if(l===Kt)return!0;var u=r.get(l),c=u!==void 0&&u.v!==y||Reflect.has(o,l);if(u!==void 0||p!==null&&(!c||dt(o,l)?.writable)){u===void 0&&(u=a(()=>{var f=c?$t(o[l]):y,h=et(f);return h}),r.set(l,u));var v=I(u);if(v===y)return!1}return c},set(o,l,u,c){var v=r.get(l),f=l in o;if(i&&l==="length")for(var h=u;h<v.v;h+=1){var d=r.get(h+"");d!==void 0?H(d,y):h in o&&(d=a(()=>et(y)),r.set(h+"",d))}if(v===void 0)(!f||dt(o,l)?.writable)&&(v=a(()=>et(void 0)),H(v,$t(u)),r.set(l,v));else{f=v.v!==y;var b=a(()=>$t(u));H(v,b)}var T=Reflect.getOwnPropertyDescriptor(o,l);if(T?.set&&T.set.call(c,u),!f){if(i&&typeof l=="string"){var J=r.get("length"),Y=Number(l);Number.isInteger(Y)&&Y>=J.v&&H(J,Y+1)}yt(s)}return!0},ownKeys(o){I(s);var l=Reflect.ownKeys(o).filter(v=>{var f=r.get(v);return f===void 0||f.v!==y});for(var[u,c]of r)c.v!==y&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Yr()}})}var Ye,Ae,Fe,je;function ie(){if(Ye===void 0){Ye=window,Ae=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Fe=dt(e,"firstChild").get,je=dt(e,"nextSibling").get,he(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),he(r)&&(r.__t=void 0)}}function rt(t=""){return document.createTextNode(t)}function xt(t){return Fe.call(t)}function B(t){return je.call(t)}function Oe(t,e){if(!g)return xt(t);var r=xt(m);return r===null&&(r=m.appendChild(rt())),O(r),r}function Xe(t,e=!1){if(!g){var r=xt(t);return r instanceof Comment&&r.data===""?B(r):r}if(e&&m?.nodeType!==me){var i=rt();return m?.before(i),O(i),i}return m}function ne(t,e=1,r=!1){let i=g?m:t;for(var s;e--;)s=i,i=B(i);if(!g)return i;if(r&&i?.nodeType!==me){var n=rt();return i===null?s?.after(n):i.before(n),O(n),n}return O(i),i}function ti(t){t.textContent=""}function ei(){return!1}function Ie(t){var e=_,r=p;D(null),nt(null);try{return t()}finally{D(e),nt(r)}}function ri(t){p===null&&(_===null&&Pr(),Lr()),ut&&Rr()}function ii(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function lt(t,e,r){var i=p;i!==null&&(i.f&j)!==0&&(t|=j);var s={ctx:L,deps:null,nodes_start:null,nodes_end:null,f:t|E|A,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{Tt(s),s.f|=Mt}catch(o){throw C(s),o}else e!==null&&ot(s);var n=s;if(r&&n.deps===null&&n.teardown===null&&n.nodes_start===null&&n.first===n.last&&(n.f&_t)===0&&(n=n.first,(t&W)!==0&&(t&vt)!==0&&n!==null&&(n.f|=vt)),n!==null&&(n.parent=i,i!==null&&ii(n,i),_!==null&&(_.f&w)!==0&&(t&Z)===0)){var a=_;(a.effects??=[]).push(n)}return s}function Wt(){return _!==null&&!X}function We(t){ri();var e=p.f,r=!_&&(e&z)!==0&&(e&Mt)===0;if(r){var i=L;(i.e??=[]).push(t)}else return ze(t)}function ze(t){return lt(Gt|Er,t,!1)}function ni(t){F.ensure();const e=lt(Z|_t,t,!0);return()=>{C(e)}}function si(t){F.ensure();const e=lt(Z|_t,t,!0);return(r={})=>new Promise(i=>{r.outro?St(e,()=>{C(e),i(void 0)}):(C(e),i(void 0))})}function ai(t){return lt(Gt,t,!1)}function qe(t,e=0){return lt(Sr|e,t,!0)}function Ve(t,e=0){var r=lt(W|e,t,!0);return r}function U(t){return lt(z|_t,t,!0)}function He(t){var e=t.teardown;if(e!==null){const r=ut,i=_;Ze(!0),D(null);try{e.call(null)}finally{Ze(r),D(i)}}}function Be(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const s=r.ac;s!==null&&Ie(()=>{s.abort(pe)});var i=r.next;(r.f&Z)!==0?r.parent=null:C(r,e),r=i}}function oi(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&z)===0&&C(e),e=r}}function C(t,e=!0){var r=!1;(e||(t.f&ve)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(li(t.nodes_start,t.nodes_end),r=!0),Be(t,e&&!r),qt(t,0),S(t,Q);var i=t.transitions;if(i!==null)for(const n of i)n.stop();He(t);var s=t.parent;s!==null&&s.first!==null&&Ue(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function li(t,e){for(;t!==null;){var r=t===e?null:B(t);t.remove(),t=r}}function Ue(t){var e=t.parent,r=t.prev,i=t.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),e!==null&&(e.first===t&&(e.first=i),e.last===t&&(e.last=r))}function St(t,e,r=!0){var i=[];Ge(t,i,!0),ui(i,()=>{r&&C(t),e&&e()})}function ui(t,e){var r=t.length;if(r>0){var i=()=>--r||e();for(var s of t)s.out(i)}else e()}function Ge(t,e,r){if((t.f&j)===0){if(t.f^=j,t.transitions!==null)for(const a of t.transitions)(a.is_global||r)&&e.push(a);for(var i=t.first;i!==null;){var s=i.next,n=(i.f&vt)!==0||(i.f&z)!==0&&(t.f&W)!==0;Ge(i,e,n?r:!1),i=s}}}function fi(t){Je(t,!0)}function Je(t,e){if((t.f&j)!==0){t.f^=j,(t.f&$)===0&&(S(t,E),ot(t));for(var r=t.first;r!==null;){var i=r.next,s=(r.f&vt)!==0||(r.f&z)!==0;Je(r,s?e:!1),r=i}if(t.transitions!==null)for(const n of t.transitions)(n.is_global||e)&&n.in()}}function Ke(t,e){for(var r=t.nodes_start,i=t.nodes_end;r!==null;){var s=r===i?null:B(r);e.append(r),r=s}}let it=!1;function zt(t){it=t}let ut=!1;function Ze(t){ut=t}let _=null,X=!1;function D(t){_=t}let p=null;function nt(t){p=t}let G=null;function ci(t){_!==null&&(G===null?G=[t]:G.push(t))}let x=null,R=0,M=null;function hi(t){M=t}let Qe=1,Et=0,ft=Et;function tr(t){ft=t}function er(){return++Qe}function Ct(t){var e=t.f;if((e&E)!==0)return!0;if(e&w&&(t.f&=~st),(e&q)!==0){var r=t.deps;if(r!==null)for(var i=r.length,s=0;s<i;s++){var n=r[s];if(Ct(n)&&Pe(n),n.wv>t.wv)return!0}(e&A)!==0&&P===null&&S(t,$)}return!1}function rr(t,e,r=!0){var i=t.reactions;if(i!==null&&!G?.includes(t))for(var s=0;s<i.length;s++){var n=i[s];(n.f&w)!==0?rr(n,e,!1):e===n&&(r?S(n,E):(n.f&$)!==0&&S(n,q),ot(n))}}function ir(t){var e=x,r=R,i=M,s=_,n=G,a=L,o=X,l=ft,u=t.f;x=null,R=0,M=null,_=(u&(z|Z))===0?t:null,G=null,At(t.ctx),X=!1,ft=++Et,t.ac!==null&&(Ie(()=>{t.ac.abort(pe)}),t.ac=null);try{t.f|=Jt;var c=t.fn,v=c(),f=t.deps;if(x!==null){var h;if(qt(t,R),f!==null&&R>0)for(f.length=R+x.length,h=0;h<x.length;h++)f[R+h]=x[h];else t.deps=f=x;if(it&&Wt()&&(t.f&A)!==0)for(h=R;h<f.length;h++)(f[h].reactions??=[]).push(t)}else f!==null&&R<f.length&&(qt(t,R),f.length=R);if($e()&&M!==null&&!X&&f!==null&&(t.f&(w|q|E))===0)for(h=0;h<M.length;h++)rr(M[h],t);return s!==null&&s!==t&&(Et++,M!==null&&(i===null?i=M:i.push(...M))),(t.f&bt)!==0&&(t.f^=bt),v}catch(d){return Se(d)}finally{t.f^=Jt,x=e,R=r,M=i,_=s,G=n,At(a),X=o,ft=l}}function di(t,e){let r=e.reactions;if(r!==null){var i=gr.call(r,t);if(i!==-1){var s=r.length-1;s===0?r=e.reactions=null:(r[i]=r[s],r.pop())}}r===null&&(e.f&w)!==0&&(x===null||!x.includes(e))&&(S(e,q),(e.f&A)!==0&&(e.f^=A,e.f&=~st),Le(e),qt(e,0))}function qt(t,e){var r=t.deps;if(r!==null)for(var i=e;i<r.length;i++)di(t,r[i])}function Tt(t){var e=t.f;if((e&Q)===0){S(t,$);var r=p,i=it;p=t,it=!0;try{(e&W)!==0?oi(t):Be(t),He(t);var s=ir(t);t.teardown=typeof s=="function"?s:null,t.wv=Qe;var n;Ut&&zr&&(t.f&E)!==0&&t.deps}finally{it=i,p=r}}}function I(t){var e=t.f,r=(e&w)!==0;if(_!==null&&!X){var i=p!==null&&(p.f&Q)!==0;if(!i&&!G?.includes(t)){var s=_.deps;if((_.f&Jt)!==0)t.rv<Et&&(t.rv=Et,x===null&&s!==null&&s[R]===t?R++:x===null?x=[t]:x.includes(t)||x.push(t));else{(_.deps??=[]).push(t);var n=t.reactions;n===null?t.reactions=[_]:n.includes(_)||n.push(_)}}}if(ut){if(tt.has(t))return tt.get(t);if(r){var a=t,o=a.v;return((a.f&$)===0&&a.reactions!==null||sr(a))&&(o=ee(a)),tt.set(a,o),o}}else r&&!P?.has(t)&&(a=t,Ct(a)&&Pe(a),it&&Wt()&&(a.f&A)===0&&nr(a));if(P?.has(t))return P.get(t);if((t.f&bt)!==0)throw t.v;return t.v}function nr(t){if(t.deps!==null){t.f^=A;for(const e of t.deps)(e.reactions??=[]).push(t),(e.f&w)!==0&&(e.f&A)===0&&nr(e)}}function sr(t){if(t.v===y)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(tt.has(e)||(e.f&w)!==0&&sr(e))return!0;return!1}function ar(t){var e=X;try{return X=!0,t()}finally{X=e}}const vi=-7169;function S(t,e){t.f=t.f&vi|e}const or=new Set,se=new Set;function _i(t){for(var e=0;e<t.length;e++)or.add(t[e]);for(var r of se)r(t)}let lr=null;function Vt(t){var e=this,r=e.ownerDocument,i=t.type,s=t.composedPath?.()||[],n=s[0]||t.target;lr=t;var a=0,o=lr===t&&t.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=s.indexOf(e);if(u===-1)return;l<=u&&(a=l)}if(n=s[a]||t.target,n!==e){Nt(t,"currentTarget",{configurable:!0,get(){return n||r}});var c=_,v=p;D(null),nt(null);try{for(var f,h=[];n!==null;){var d=n.assignedSlot||n.parentNode||n.host||null;try{var b=n["__"+i];b!=null&&(!n.disabled||t.target===n)&&b.call(n,t)}catch(T){f?h.push(T):f=T}if(t.cancelBubble||d===e||d===null)break;n=d}if(f){for(let T of h)queueMicrotask(()=>{throw T});throw f}}finally{t.__root=e,delete t.currentTarget,D(c),nt(v)}}}function pi(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Rt(t,e){var r=p;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function ae(t,e){var r=(e&pr)!==0,i,s=!t.startsWith("<!>");return()=>{if(g)return Rt(m,null),m;i===void 0&&(i=pi(s?t:"<!>"+t),i=xt(i));var n=r||Ae?document.importNode(i,!0):i.cloneNode(!0);return Rt(n,n),n}}function ur(){if(g)return Rt(m,null),m;var t=document.createDocumentFragment(),e=document.createComment(""),r=rt();return t.append(e,r),Rt(e,r),t}function mt(t,e){if(g){var r=p;((r.f&Mt)===0||r.nodes_end===null)&&(r.nodes_end=m),Zt();return}t!==null&&t.before(e)}const mi=["touchstart","touchmove"];function gi(t){return mi.includes(t)}function fr(t,e){return cr(t,e)}function bi(t,e){ie(),e.intro=e.intro??!1;const r=e.target,i=g,s=m;try{for(var n=xt(r);n&&(n.nodeType!==wt||n.data!==fe);)n=B(n);if(!n)throw ht;pt(!0),O(n);const a=cr(t,{...e,anchor:n});return pt(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
+ `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==ht&&console.warn("Failed to hydrate: ",a),e.recover===!1&&Dr(),ie(),ti(r),pt(!1),fr(t,e)}finally{pt(i),O(s)}}const gt=new Map;function cr(t,{target:e,anchor:r,props:i={},events:s,context:n,intro:a=!0}){ie();var o=new Set,l=v=>{for(var f=0;f<v.length;f++){var h=v[f];if(!o.has(h)){o.add(h);var d=gi(h);e.addEventListener(h,Vt,{passive:d});var b=gt.get(h);b===void 0?(document.addEventListener(h,Vt,{passive:d}),gt.set(h,1)):gt.set(h,b+1)}}};l(br(or)),se.add(l);var u=void 0,c=si(()=>{var v=r??e.appendChild(rt());return Ur(v,{pending:()=>{}},f=>{if(n){ke({});var h=L;h.c=n}if(s&&(i.$$events=s),g&&Rt(f,null),u=t(f,i)||{},g&&(p.nodes_end=m,m===null||m.nodeType!==wt||m.data!==ce))throw Yt(),ht;n&&ye()}),()=>{for(var f of o){e.removeEventListener(f,Vt);var h=gt.get(f);--h===0?(document.removeEventListener(f,Vt),gt.delete(f)):gt.set(f,h)}se.delete(l),v!==r&&v.parentNode?.removeChild(v)}});return oe.set(u,c),u}let oe=new WeakMap;function wi(t,e){const r=oe.get(t);return r?(oe.delete(t),r(e)):Promise.resolve()}class ki{anchor;#e=new Map;#t=new Map;#r=new Map;#i=new Set;#l=!0;constructor(e,r=!0){this.anchor=e,this.#l=r}#s=()=>{var e=k;if(this.#e.has(e)){var r=this.#e.get(e),i=this.#t.get(r);if(i)fi(i),this.#i.delete(r);else{var s=this.#r.get(r);s&&(this.#t.set(r,s.effect),this.#r.delete(r),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),i=s.effect)}for(const[n,a]of this.#e){if(this.#e.delete(n),n===e)break;const o=this.#r.get(a);o&&(C(o.effect),this.#r.delete(a))}for(const[n,a]of this.#t){if(n===r||this.#i.has(n))continue;const o=()=>{if(Array.from(this.#e.values()).includes(n)){var u=document.createDocumentFragment();Ke(a,u),u.append(rt()),this.#r.set(n,{effect:a,fragment:u})}else C(a);this.#i.delete(n),this.#t.delete(n)};this.#l||!i?(this.#i.add(n),St(a,o,!1)):o()}}};#n=e=>{this.#e.delete(e);const r=Array.from(this.#e.values());for(const[i,s]of this.#r)r.includes(i)||(C(s.effect),this.#r.delete(i))};ensure(e,r){var i=k,s=ei();if(r&&!this.#t.has(e)&&!this.#r.has(e))if(s){var n=document.createDocumentFragment(),a=rt();n.append(a),this.#r.set(e,{effect:U(()=>r(a)),fragment:n})}else this.#t.set(e,U(()=>r(this.anchor)));if(this.#e.set(i,e),s){for(const[o,l]of this.#t)o===e?i.skipped_effects.delete(l):i.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?i.skipped_effects.delete(l.effect):i.skipped_effects.add(l.effect);i.oncommit(this.#s),i.ondiscard(this.#n)}else g&&(this.anchor=m),this.#s()}}function yi(t){L===null&&Tr(),We(()=>{const e=ar(t);if(typeof e=="function")return e})}function hr(t,e,r=!1){g&&Zt();var i=new ki(t),s=r?vt:0;function n(a,o){if(g){const u=Xr(t)===Bt;if(a===u){var l=be();O(l),i.anchor=l,pt(!1),i.ensure(a,o),pt(!0);return}}i.ensure(a,o)}Ve(()=>{var a=!1;e((o,l=!0)=>{a=!0,n(l,o)}),a||n(!1,null)},s)}function $i(t,e){ai(()=>{var r=t.getRootNode(),i=r.host?r:r.head??r.ownerDocument.head;if(!i.querySelector("#"+e.hash)){const s=document.createElement("style");s.id=e.hash,s.textContent=e.code,i.appendChild(s)}})}function le(t,e,r,i){var s=i,n=!0,a=()=>(n&&(n=!1,s=i),s),o;o=t[e],o===void 0&&i!==void 0&&(o=a());var l;l=()=>{var f=t[e];return f===void 0?a():(n=!0,f)};var u=!1,c=Jr(()=>(u=!1,l())),v=p;return(function(f,h){if(arguments.length>0){const d=h?I(c):f;return H(c,d),u=!0,s!==void 0&&(s=d),f}return ut&&u||(v.f&Q)!==0?c.v:I(c)})}function xi(t){return new Si(t)}class Si{#e;#t;constructor(e){var r=new Map,i=(n,a)=>{var o=Zr(a,!1,!1);return r.set(n,o),o};const s=new Proxy({...e.props||{},$$events:{}},{get(n,a){return I(r.get(a)??i(a,Reflect.get(n,a)))},has(n,a){return a===Cr?!0:(I(r.get(a)??i(a,Reflect.get(n,a))),Reflect.has(n,a))},set(n,a,o){return H(r.get(a)??i(a,o),o),Reflect.set(n,a,o)}});this.#t=(e.hydrate?bi:fr)(e.component,{target:e.target,anchor:e.anchor,props:s,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&Xt(),this.#e=s.$$events;for(const n of Object.keys(this.#t))n==="$set"||n==="$destroy"||n==="$on"||Nt(this,n,{get(){return this.#t[n]},set(a){this.#t[n]=a},enumerable:!0});this.#t.$set=n=>{Object.assign(s,n)},this.#t.$destroy=()=>{wi(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const i=(...s)=>r.call(this,...s);return this.#e[e].push(i),()=>{this.#e[e]=this.#e[e].filter(s=>s!==i)}}$destroy(){this.#t.$destroy()}}let dr;typeof HTMLElement=="function"&&(dr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const i=this.$$c.$on(t,e);this.$$l_u.set(e,i)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const i=this.$$l_u.get(e);i&&(i(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(i){return s=>{const n=document.createElement("slot");i!=="default"&&(n.name=i),mt(s,n)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Ei(this);for(const i of this.$$s)i in r&&(i==="default"&&!this.$$d.children?(this.$$d.children=t(i),e.default=!0):e[i]=t(i));for(const i of this.attributes){const s=this.$$g_p(i.name);s in this.$$d||(this.$$d[s]=Ht(s,i.value,this.$$p_d,"toProp"))}for(const i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=xi({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=ni(()=>{qe(()=>{this.$$r=!0;for(const i of Pt(this.$$c)){if(!this.$$p_d[i]?.reflect)continue;this.$$d[i]=this.$$c[i];const s=Ht(i,this.$$d[i],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,s)}this.$$r=!1})});for(const i in this.$$l)for(const s of this.$$l[i]){const n=this.$$c.$on(i,s);this.$$l_u.set(s,n)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Ht(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Pt(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Ht(t,e,r,i){const s=r[t]?.type;if(e=s==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(s){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(s){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Ei(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function Ci(t,e,r,i,s,n){let a=class extends dr{constructor(){super(t,r,s),this.$$p_d=e}static get observedAttributes(){return Pt(e).map(o=>(e[o].attribute||o).toLowerCase())}};return Pt(e).forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Ht(o,l,e),this.$$d[o]=l;var u=this.$$c;if(u){var c=dt(u,o)?.get;c?u[o]=l:u.$set({[o]:l})}}})}),i.forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c?.[o]}})}),t.element=a,a}class Ti{constructor(e,r){this.StickStatus={xPosition:0,yPosition:0,x:0,y:0,cardinalDirection:"C"},this.parameters=r?.parameters||{};const i={title:"joystick",width:0,height:0,internalFillColor:"#00AA00",internalLineWidth:2,internalStrokeColor:"#003300",externalLineWidth:2,externalStrokeColor:"#008000",autoReturnToCenter:!0,callback:function(n){}};this.callback=r?.callback||i.callback,this.title=r?.parameters?.title||i.title,this.width=r?.parameters?.width||i.width,this.height=r?.parameters?.height||i.height,this.internalFillColor=r?.parameters?.internalFillColor||i.internalFillColor,this.internalLineWidth=r?.parameters?.internalLineWidth||i.internalLineWidth,this.internalStrokeColor=r?.parameters?.internalStrokeColor||i.internalStrokeColor,this.externalLineWidth=r?.parameters?.externalLineWidth||i.externalLineWidth,this.externalStrokeColor=r?.parameters?.externalStrokeColor||i.externalStrokeColor,this.autoReturnToCenter=r?.parameters?.autoReturnToCenter||i.autoReturnToCenter,console.log("stttt",e.style),e.style.touchAction="none",this.canvas=document.createElement("canvas"),this.canvas.id=this.title,this.width===0&&(this.width=e.clientWidth),this.height===0&&(this.height=e.clientHeight),this.canvas.width=this.width,this.canvas.height=this.height,e.appendChild(this.canvas);const s=this.canvas.getContext("2d");console.log("canvas",s),this.context=s,this.pressed=!1,this.circumference=2*Math.PI,this.internalRadius=(this.canvas.width-(this.canvas.width/2+10))/2,this.maxMoveStick=this.internalRadius*1.1,this.externalRadius=this.internalRadius*1.6,this.centerX=this.canvas.width/2,this.centerY=this.canvas.height/2,this.directionHorizontalLimitPos=this.canvas.width/10,this.directionHorizontalLimitNeg=this.directionHorizontalLimitPos*-1,this.directionVerticalLimitPos=this.canvas.height/10,this.directionVerticalLimitNeg=this.directionVerticalLimitPos*-1,this.movedX=this.centerX,this.movedY=this.centerY,"ontouchstart"in document.documentElement?(this.canvas.addEventListener("touchstart",n=>this._onTouchStart(n),!1),document.addEventListener("touchmove",n=>this._onTouchMove(n),!1),document.addEventListener("touchend",n=>this._onTouchEnd(n),!1)):(this.canvas.addEventListener("mousedown",n=>this._onMouseDown(n),!1),document.addEventListener("mousemove",n=>this._onMouseMove(n),!1),document.addEventListener("mouseup",n=>this._onMouseUp(n),!1)),this._drawExternal(),this._drawInternal()}_drawExternal(){this.context.beginPath(),this.context.arc(this.centerX,this.centerY,this.externalRadius,0,this.circumference,!1),this.context.lineWidth=this.externalLineWidth,this.context.strokeStyle=this.externalStrokeColor,this.context.stroke()}_drawInternal(){this.context.beginPath(),this.movedX<this.internalRadius&&(this.movedX=this.maxMoveStick),this.movedX+this.internalRadius>this.canvas.width&&(this.movedX=this.canvas.width-this.maxMoveStick),this.movedY<this.internalRadius&&(this.movedY=this.maxMoveStick),this.movedY+this.internalRadius>this.canvas.height&&(this.movedY=this.canvas.height-this.maxMoveStick),this.context.arc(this.movedX,this.movedY,this.internalRadius,0,this.circumference,!1);const e=this.context.createRadialGradient(this.centerX,this.centerY,5,this.centerX,this.centerY,200);e.addColorStop(0,this.internalFillColor),e.addColorStop(1,this.internalStrokeColor),this.context.fillStyle=e,this.context.fill(),this.context.lineWidth=this.internalLineWidth,this.context.strokeStyle=this.internalStrokeColor,this.context.stroke()}_onTouchStart(e){this.pressed=!0}_onTouchMove(e){this.pressed&&e.targetTouches[0].target===this.canvas&&(this.movedX=e.targetTouches[0].pageX,this.movedY=e.targetTouches[0].pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onTouchEnd(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_onMouseDown(e){this.pressed=!0}_onMouseMove(e){this.pressed&&(this.movedX=e.pageX,this.movedY=e.pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onMouseUp(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_getCardinalDirection(){let e="",r=this.movedX-this.centerX,i=this.movedY-this.centerY;return i>=this.directionVerticalLimitNeg&&i<=this.directionVerticalLimitPos&&(e="C"),i<this.directionVerticalLimitNeg&&(e="N"),i>this.directionVerticalLimitPos&&(e="S"),r<this.directionHorizontalLimitNeg&&(e==="C"?e="W":e+="W"),r>this.directionHorizontalLimitPos&&(e==="C"?e="E":e+="E"),e}GetWidth(){return this.canvas.width}GetHeight(){return this.canvas.height}GetPosX(){return this.movedX}GetPosY(){return this.movedY}GetX(){return(100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()}GetY(){return(100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()}GetDir(){return this._getCardinalDirection()}}var ct={},vr;function Ri(){if(vr)return ct;vr=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.LanguageTranslator=void 0,ct.getChildStyleToPass=t,ct.addComponent=e;function t(i,s){var n,a,o="";try{if(i&&s?.length&&(!((n=Object.keys(i))===null||n===void 0)&&n.length)&&(!((a=s?.filter(function(f){return Object.keys(i).includes(f.name)}))===null||a===void 0)&&a.length))for(var l=function(f){var h=s?.filter(function(d){return d.name===f&&d.defaultValue!==i[f]});h&&(o+="".concat(f,":").concat(i[f],";"))},u=0,c=Object.keys(i);u<c.length;u++){var v=c[u];l(v)}}catch(f){console.error("error getting child style to pass",f)}finally{return o}}function e(i){var s,n=((s=i?.repoName.split("/"))===null||s===void 0?void 0:s[1])||i?.repoName;if(!n)throw new Error("wrong componentPath "+i?.repoName);if(!i?.version)throw new Error("wrong version "+i?.version);var a=i?.iifePath||"main.iife.js";if(!document.getElementById(n+"-script"))try{var o=document.createElement("script");if(o.id=n+"-script",o.src="https://cdn.jsdelivr.net/npm/".concat(i.repoName,"@").concat(i.version,"/").concat(a),i?.local)o.src="".concat(i.local);else if(location.href.includes("localhost:6006")){var l=n.split("-")[0];o.src="http://localhost:6006/webcomponents/".concat(n.replace(l+"-",""),"/").concat(a)}document.head.appendChild(o)}catch(u){console.warn(u)}}var r=(function(){function i(s){if(this.lang="",!s?.dictionary)throw new Error("no dictionary provided");this.dictionary=s.dictionary,this.setLang(s?.lang)}return i.prototype.setLang=function(s){s||(s=i.getDefaultLang()),this.lang=s},i.prototype.translateWord=function(s,n){return i.getDictionaryWord(s,this.dictionary,n||this.lang)},i.prototype.translateDate=function(s,n,a){return i.formatDate(s,n,a||this.lang)},i.getDefaultLang=function(){var s,n,a,o="en";return navigator?.languages&&(!((a=(n=(s=navigator.languages[0])===null||s===void 0?void 0:s.split("-")[0])===null||n===void 0?void 0:n.toLowerCase())===null||a===void 0)&&a.length)&&(o=navigator.languages[0].split("-")[0].toLowerCase()),o},i.getDictionaryWord=function(s,n,a){var o;if(!s)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(a&&(!((o=n[a])===null||o===void 0)&&o[s]))return n[a][s];var l="",u=i.getDefaultLang();if(!a||u!==a){var c=n?.[u];c?.[s]&&(l=c[s])}return l},i.formatDate=function(s,n,a){if(!s)throw new Error("no date provided");if(typeof s.getMonth!="function")throw new Error("wrong date format");var o=new Intl.DateTimeFormat(a||i.getDefaultLang(),n);return o.format(s)},i})();return ct.LanguageTranslator=r,ct}Ri();var Li=ae('<div class="set svelte-k03ui8"><nav class="d-pad svelte-k03ui8"><button class="up svelte-k03ui8" aria-label="Move up"></button> <button class="right svelte-k03ui8" aria-label="Move right"></button> <button class="down svelte-k03ui8" aria-label="Move down"></button> <button class="left svelte-k03ui8" aria-label="Move left"></button></nav></div>'),Pi=ae('<div id="joystick" class="svelte-k03ui8"></div>'),Ni=ae("<div>Unknown type</div>");const Di={hash:"svelte-k03ui8",code:`@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;--hb-pad-joystick-size: 200px;--dpad-radius: 17%;--dpad-radius-in: 20%;--dpad-fg: #ddd;--dpad-fg-hover: #eee;--dpad-bg: #fff;--arrowcolor: #aaa;--tri-sml-a: calc(var(--hb-pad-joystick-size) / 9);--tri-sml-b: calc(var(--hb-pad-joystick-size) / 6);--tri-lrg-a: calc(var(--hb-pad-joystick-size) / 9);--tri-lrg-b: calc(var(--hb-pad-joystick-size) / 6);--dpad-arrow-shift: 5px;--dpad-arrow-move: 35%;}#joystick.svelte-k03ui8 {width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);margin:auto;}.set.svelte-k03ui8 {overflow:hidden;}.set.svelte-k03ui8 .d-pad:where(.svelte-k03ui8) {display:inline-block;}.d-pad.svelte-k03ui8 {position:relative;width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);border-radius:48%;overflow:hidden;}.d-pad.svelte-k03ui8:before {content:"";position:absolute;top:50%;left:50%;border-radius:5%;transform:translate(-50%, -50%);width:66.6%;height:66.6%;background:var(--dpad-fg);}.d-pad.svelte-k03ui8:after {content:"";position:absolute;display:none;z-index:2;width:20%;height:20%;top:50%;left:50%;background:var(--dpad-fg);border-radius:50%;transform:translate(-50%, -50%);transition:all 0.25s;cursor:pointer;}.d-pad.svelte-k03ui8:hover:after {width:30%;height:30%;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8) {cursor:pointer;border:none;display:block;position:absolute;-webkit-tap-highlight-color:rgba(255, 255, 255, 0);width:33.3%;height:43%;line-height:40%;color:#fff;background:var(--dpad-fg);text-align:center;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):hover {background:var(--dpad-fg-hover);}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):before {content:"";position:absolute;width:0;height:0;border-radius:5px;border-style:solid;transition:all 0.25s;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):after {content:"";position:absolute;width:102%;height:78%;background:var(--dpad-bg);border-radius:var(--dpad-radius-in);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8),
3
3
  .d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8) {width:43%;height:33%;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):after,
4
- .d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):after {width:78%;height:102%;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8) {top:0;left:50%;transform:translate(-50%, 0);border-radius:var(--dpad-radius) var(--dpad-radius) 50% 50%;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):hover {background:linear-gradient(0deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):after {left:0;top:0;transform:translate(-100%, 0);border-top-left-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):before {top:40%;left:50%;transform:translate(-50%, -50%);border-width:0 var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a);border-color:transparent transparent var(--arrowcolor) transparent;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):active:before {border-bottom-color:#333;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):hover:before {top:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8) {bottom:0;left:50%;transform:translate(-50%, 0);border-radius:50% 50% var(--dpad-radius) var(--dpad-radius);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):hover {background:linear-gradient(180deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):after {right:0;bottom:0;transform:translate(100%, 0);border-bottom-right-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):before {bottom:40%;left:50%;transform:translate(-50%, 50%);border-width:var(--tri-sml-b) var(--tri-sml-a) 0px var(--tri-sml-a);border-color:var(--arrowcolor) transparent transparent transparent;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):active:before {border-top-color:#333;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):hover:before {bottom:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8) {top:50%;left:0;transform:translate(0, -50%);border-radius:var(--dpad-radius) 50% 50% var(--dpad-radius);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):hover {background:linear-gradient(-90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):after {left:0;bottom:0;transform:translate(0, 100%);border-bottom-left-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):before {left:40%;top:50%;transform:translate(-50%, -50%);border-width:var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a) 0;border-color:transparent var(--arrowcolor) transparent transparent;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):active:before {border-right-color:#333;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):hover:before {left:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8) {top:50%;right:0;transform:translate(0, -50%);border-radius:50% var(--dpad-radius) var(--dpad-radius) 50%;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):hover {background:linear-gradient(90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):after {right:0;top:0;transform:translate(0, -100%);border-top-right-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):before {right:40%;top:50%;transform:translate(50%, -50%);border-width:var(--tri-sml-a) 0 var(--tri-sml-a) var(--tri-sml-b);border-color:transparent transparent transparent var(--arrowcolor);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):active:before {border-left-color:#333;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):hover:before {right:var(--dpad-arrow-move);}`};function _r(t,e){ke(e,!0),$i(t,Di);function r(d,b){e.$$host.dispatchEvent(new CustomEvent(d,{detail:b}))}let i=le(e,"id",7,""),s=le(e,"pad_or_joystick",7,"dpad"),n=le(e,"joystick_parameters",7,void 0),a;mt({}),We(()=>{}),yi(()=>{const d=e.$$host?.shadowRoot?.querySelector("#joystick");if(s()==="joystick"&&!a&&d?.style){const b="#F2eef6",T="#Ece2f7",K="silver";a=new Ti(d,{parameters:{internalFillColor:n()?.internalFillColor||b,internalStrokeColor:n()?.internalStrokeColor||T,externalStrokeColor:n()?.externalStrokeColor||K},callback:Y=>{l({x:Y.x,y:Y.y,cardinalDirection:Y.cardinalDirection})}})}});function o(d){r("sendDirection",{id:i(),direction:d})}function l(d){r("sendJoystickPosition",Object.assign({id:i()},d))}var u={get id(){return i()},set id(d=""){i(d),Xt()},get pad_or_joystick(){return s()},set pad_or_joystick(d="dpad"){s(d),Xt()},get joystick_parameters(){return n()},set joystick_parameters(d=void 0){n(d),Xt()}},c=ur(),v=Xe(c);{var f=d=>{var b=Li(),T=Oe(b),K=Oe(T);K.__click=()=>o("up");var Y=ne(K,2);Y.__click=()=>o("right");var Z=ne(Y,2);Z.__click=()=>o("down");var Lt=ne(Z,2);Lt.__click=()=>o("left"),ge(T),ge(b),gt(d,b)},h=d=>{var b=ur(),T=Xe(b);{var K=Z=>{var Lt=Pi();gt(Z,Lt)},Y=Z=>{var Lt=Ni();gt(Z,Lt)};hr(T,Z=>{s()==="joystick"?Z(K):Z(Y,!1)},!0)}gt(d,b)};hr(v,d=>{s()==="dpad"?d(f):d(h,!1)})}return gt(t,c),ye(u)}_i(["click"]),customElements.define("hb-pad-joystick",Ci(_r,{id:{},pad_or_joystick:{},joystick_parameters:{}},[],[],!0)),ue.Component=_r,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})})(this["pad-joystick"]=this["pad-joystick"]||{});
4
+ .d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):after {width:78%;height:102%;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8) {top:0;left:50%;transform:translate(-50%, 0);border-radius:var(--dpad-radius) var(--dpad-radius) 50% 50%;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):hover {background:linear-gradient(0deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):after {left:0;top:0;transform:translate(-100%, 0);border-top-left-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):before {top:40%;left:50%;transform:translate(-50%, -50%);border-width:0 var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a);border-color:transparent transparent var(--arrowcolor) transparent;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):active:before {border-bottom-color:#333;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):hover:before {top:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8) {bottom:0;left:50%;transform:translate(-50%, 0);border-radius:50% 50% var(--dpad-radius) var(--dpad-radius);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):hover {background:linear-gradient(180deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):after {right:0;bottom:0;transform:translate(100%, 0);border-bottom-right-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):before {bottom:40%;left:50%;transform:translate(-50%, 50%);border-width:var(--tri-sml-b) var(--tri-sml-a) 0px var(--tri-sml-a);border-color:var(--arrowcolor) transparent transparent transparent;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):active:before {border-top-color:#333;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):hover:before {bottom:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8) {top:50%;left:0;transform:translate(0, -50%);border-radius:var(--dpad-radius) 50% 50% var(--dpad-radius);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):hover {background:linear-gradient(-90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):after {left:0;bottom:0;transform:translate(0, 100%);border-bottom-left-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):before {left:40%;top:50%;transform:translate(-50%, -50%);border-width:var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a) 0;border-color:transparent var(--arrowcolor) transparent transparent;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):active:before {border-right-color:#333;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):hover:before {left:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8) {top:50%;right:0;transform:translate(0, -50%);border-radius:50% var(--dpad-radius) var(--dpad-radius) 50%;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):hover {background:linear-gradient(90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):after {right:0;top:0;transform:translate(0, -100%);border-top-right-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):before {right:40%;top:50%;transform:translate(50%, -50%);border-width:var(--tri-sml-a) 0 var(--tri-sml-a) var(--tri-sml-b);border-color:transparent transparent transparent var(--arrowcolor);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):active:before {border-left-color:#333;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):hover:before {right:var(--dpad-arrow-move);}`};function _r(t,e){ke(e,!0),$i(t,Di);function r(d,b){e.$$host.dispatchEvent(new CustomEvent(d,{detail:b}))}let i=le(e,"id",7,""),s=le(e,"pad_or_joystick",7,"dpad"),n=le(e,"joystick_parameters",7,void 0),a;We(()=>{}),yi(()=>{const d=e.$$host?.shadowRoot?.querySelector("#joystick");if(s()==="joystick"&&!a&&d?.style){const b="#F2eef6",T="#Ece2f7",J="silver";a=new Ti(d,{parameters:{internalFillColor:n()?.internalFillColor||b,internalStrokeColor:n()?.internalStrokeColor||T,externalStrokeColor:n()?.externalStrokeColor||J},callback:Y=>{l({x:Y.x,y:Y.y,cardinalDirection:Y.cardinalDirection})}})}});function o(d){r("sendDirection",{id:i(),direction:d})}function l(d){r("sendJoystickPosition",Object.assign({id:i()},d))}var u={get id(){return i()},set id(d=""){i(d),Xt()},get pad_or_joystick(){return s()},set pad_or_joystick(d="dpad"){s(d),Xt()},get joystick_parameters(){return n()},set joystick_parameters(d=void 0){n(d),Xt()}},c=ur(),v=Xe(c);{var f=d=>{var b=Li(),T=Oe(b),J=Oe(T);J.__click=()=>o("up");var Y=ne(J,2);Y.__click=()=>o("right");var K=ne(Y,2);K.__click=()=>o("down");var Lt=ne(K,2);Lt.__click=()=>o("left"),ge(T),ge(b),mt(d,b)},h=d=>{var b=ur(),T=Xe(b);{var J=K=>{var Lt=Pi();mt(K,Lt)},Y=K=>{var Lt=Ni();mt(K,Lt)};hr(T,K=>{s()==="joystick"?K(J):K(Y,!1)},!0)}mt(d,b)};hr(v,d=>{s()==="dpad"?d(f):d(h,!1)})}return mt(t,c),ye(u)}_i(["click"]),customElements.define("hb-pad-joystick",Ci(_r,{id:{},pad_or_joystick:{},joystick_parameters:{}},[],[],!0)),ue.Component=_r,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})})(this["pad-joystick"]=this["pad-joystick"]||{});
5
5
  //# sourceMappingURL=main.iife.js.map