ifastbet-tv-common 0.1.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.
Files changed (3) hide show
  1. package/README.md +49 -0
  2. package/dist/index.js +51 -0
  3. package/package.json +24 -0
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # ifastbet-tv-common
2
+
3
+ Shared backend integration library for ifastbet TV display applications.
4
+
5
+ ## Usage
6
+
7
+ ```imba
8
+ import {TvClient} from 'ifastbet-tv-common'
9
+ import 'ifastbet-tv-common/dist/tv-app-shell.js' # registers <tv-app-shell> tag
10
+
11
+ const tv = new TvClient({
12
+ backendUrl: 'https://api.ifastbet.com'
13
+ gameCode: 'keno'
14
+ historyLimit: 20
15
+ })
16
+ tv.connect!
17
+
18
+ tag App
19
+ <self [w:1280px h:720px]>
20
+ <tv-app-shell tv=tv>
21
+ <game-keno tv=tv> # per-repo game UI
22
+
23
+ imba.mount <App>
24
+ ```
25
+
26
+ ## API
27
+
28
+ `TvClient` reactive class exposes:
29
+
30
+ - `connected`: bool — PB realtime connected.
31
+ - `panic`: bool — own hall in panic mode.
32
+ - `game`: game record (catalog).
33
+ - `broadcast`: broadcasts record (live state).
34
+ - `round`: current round.
35
+ - `history`: array of last N completed rounds.
36
+ - `stage`: int — broadcast.stage (-2..N-1).
37
+ - `stages`: array of {name, duration} from game record.
38
+ - `currentStageMeta`: stages[stage].
39
+ - `timeRemaining`: ms — restage_at - Date.now().
40
+
41
+ Methods: `connect()`, `disconnect()`.
42
+
43
+ ## Build
44
+
45
+ ```bash
46
+ bun install
47
+ bun run build # → dist/index.js
48
+ bun test # ~10-15 tests
49
+ ```
package/dist/index.js ADDED
@@ -0,0 +1,51 @@
1
+ var z=Symbol.for("#__init__"),Dn=Symbol.for("#__initor__"),Il=Symbol.for("#__inited__"),jn=Symbol.for("#__hooks__");var Pl=Symbol.for("#meta"),Ll=Symbol.for("imba");var yt={IsExtension:1,IsTag:2,HasDescriptors:4,HasSuperCalls:8,HasConstructor:16,HasFields:32,HasMixins:64,HasInitor:128,HasDecorators:256,IsObjectExtension:512,IsMixin:1024},Nt=new Map,Cl=globalThis[Ll]||={counter:0,classes:Nt};function Ot(t,e={}){return Nt.has(t)||Nt.set(t,{symbol:Symbol(t.name),parent:Object.getPrototypeOf(t.prototype)?.constructor,for:t,uses:null,inits:null,id:Cl.counter++,...e}),Nt.get(t)}function Ml(t,e){if(!t||!e)return!1;if(t.get)return e.get===t.get;if(t.set)return e.set===t.set;if(t.value)return t.value===e.value}function An(t,e,r,n={}){let s=t.constructor;if(!r&&e){if(r=Object.getOwnPropertyDescriptors(e),delete r.constructor,r[z])console.warn(`Cannot define plain fields when extending class ${s.name}`),delete r[z]}let i=Ot(s);if(i&&i.augments){let o=new Map;for(let l of Object.keys(r)){let h=Object.getOwnPropertyDescriptor(t,l);for(let c of i.augments){let a=o.get(c);a||o.set(c,a={});let p=Object.getOwnPropertyDescriptor(c.prototype,l);if(p&&!Ml(h,p))console.warn("wont extend",l,p,h);else a[l]=r[l]}}for(let[l,h]of o)if(Object.keys(h).length)An(l.prototype,null,h)}return Object.defineProperties(t,r),t}function lr(t,e){let r=Ot(t),n=Ot(e),s=n.parent;while(s&&Ot(s)?.flags&yt.IsMixin){lr(t,s),s=null;break}if(s&&!(t.prototype instanceof s))throw Error(`Mixin ${e.name} has superclass not present in target class`);if(!n.augments){n.augments=new Set;let o=n.ref=Symbol(e.name),l=Object[Symbol.hasInstance];e.prototype[o]=!0,Object.defineProperty(e,Symbol.hasInstance,{value:function(h){return this===e?h&&!!h[o]:l.call(this,h)}})}if(t.prototype[n.ref])return t;if(n.uses)for(let o of n.uses)lr(t,o);n.augments.add(t),r.uses||=[],r.uses.push(e);let i=Object.getOwnPropertyDescriptors(e.prototype);if(delete i.constructor,i[z])r.inits||=[],r.inits.push(e.prototype[z]),delete i[z];if(Object.defineProperties(t.prototype,i),e?.mixed instanceof Function)e.mixed(t);return t}var vt={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(t,e,...r)=>{return vt.target[e].apply(vt.self,r)},get:(t,e)=>{return Reflect.get(vt.target,e,vt.self)},set:(t,e,r,n)=>{return Reflect.set(vt.target,e,r,vt.self)}})};function ge(t,e,r,n,s=null){let i=Object.getPrototypeOf(t.prototype),o=(n&(yt.HasMixins|yt.IsExtension))==yt.HasMixins,l;if(o)Nt.set(t,Nt.get(i.constructor)),i=Object.getPrototypeOf(i);if(s){let c=n&yt.IsObjectExtension?s:s.prototype,a=Ot(t);if(a.uses){if(s===c)console.warn("Cannot extend object with mixins");for(let p of a.uses)lr(s,p)}if(n&yt.HasSuperCalls)vt.cache[e]=Object.create(Object.getPrototypeOf(c),Object.getOwnPropertyDescriptors(c));return An(c,t.prototype),s}let h=i?.constructor;if(l=Ot(t,{symbol:e}),Object.defineProperty(t,Pl,{value:l,enumerable:!1,configurable:!0}),r&&t.name!==r)Object.defineProperty(t,"name",{value:r,configurable:!0});if(l.flags=n,n&yt.HasConstructor)t.prototype[Dn]=e;if(l.uses)for(let c of l.uses)c.mixes?.(t);if(h?.inherited instanceof Function)h.inherited(t);return t}function Vn(t,e){if(t[Dn]===e)t[Il]?.(),t[jn]&&t[jn].inited(t)}var ne=Symbol.for("#__init__"),kl=Symbol.for("#__initor__");var Fl=Symbol.for("#meta"),Rn=Symbol.for("imba");var St={IsExtension:1,IsTag:2,HasDescriptors:4,HasSuperCalls:8,HasConstructor:16,HasFields:32,HasMixins:64,HasInitor:128,HasDecorators:256,IsObjectExtension:512,IsMixin:1024},Kt=new Map,jl=globalThis[Rn]||(globalThis[Rn]={counter:0,classes:Kt});function qt(t,e={}){var r;return Kt.has(t)||Kt.set(t,{symbol:Symbol(t.name),parent:(r=Object.getPrototypeOf(t.prototype))==null?void 0:r.constructor,for:t,uses:null,inits:null,id:jl.counter++,...e}),Kt.get(t)}function Dl(t,e){if(!t||!e)return!1;if(t.get)return e.get===t.get;if(t.set)return e.set===t.set;if(t.value)return t.value===e.value}function ki(t,e,r,n={}){let s=t.constructor;!r&&e&&(r=Object.getOwnPropertyDescriptors(e),delete r.constructor,r[ne]&&(console.warn(`Cannot define plain fields when extending class ${s.name}`),delete r[ne]));let i=qt(s);if(i&&i.augments){let o=new Map;for(let l of Object.keys(r)){let h=Object.getOwnPropertyDescriptor(t,l);for(let c of i.augments){let a=o.get(c);a||o.set(c,a={});let p=Object.getOwnPropertyDescriptor(c.prototype,l);p&&!Dl(h,p)?console.warn("wont extend",l,p,h):a[l]=r[l]}}for(let[l,h]of o)Object.keys(h).length&&ki(l.prototype,null,h)}return Object.defineProperties(t,r),t}function Ur(t,e){var r;let n=qt(t),s=qt(e),i=s.parent;for(;i&&((r=qt(i))==null?void 0:r.flags)&St.IsMixin;){Ur(t,i),i=null;break}if(i&&!(t.prototype instanceof i))throw Error(`Mixin ${e.name} has superclass not present in target class`);if(!s.augments){s.augments=new Set;let l=s.ref=Symbol(e.name),h=Object[Symbol.hasInstance];e.prototype[l]=!0,Object.defineProperty(e,Symbol.hasInstance,{value:function(c){return this===e?c&&!!c[l]:h.call(this,c)}})}if(t.prototype[s.ref])return t;if(s.uses)for(let l of s.uses)Ur(t,l);s.augments.add(t),n.uses||(n.uses=[]),n.uses.push(e);let o=Object.getOwnPropertyDescriptors(e.prototype);return delete o.constructor,o[ne]&&(n.inits||(n.inits=[]),n.inits.push(e.prototype[ne]),delete o[ne]),Object.defineProperties(t.prototype,o),(e==null?void 0:e.mixed)instanceof Function&&e.mixed(t),t}var wt={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(t,e,...r)=>wt.target[e].apply(wt.self,r),get:(t,e)=>Reflect.get(wt.target,e,wt.self),set:(t,e,r,n)=>Reflect.set(wt.target,e,r,wt.self)})};function d(t,e,r,n,s=null){var i;let o=Object.getPrototypeOf(t.prototype),l=(n&(St.HasMixins|St.IsExtension))==St.HasMixins,h;if(l&&(Kt.set(t,Kt.get(o.constructor)),o=Object.getPrototypeOf(o)),s){let a=n&St.IsObjectExtension?s:s.prototype,p=qt(t);if(p.uses){s===a&&console.warn("Cannot extend object with mixins");for(let y of p.uses)Ur(s,y)}return n&St.HasSuperCalls&&(wt.cache[e]=Object.create(Object.getPrototypeOf(a),Object.getOwnPropertyDescriptors(a))),ki(a,t.prototype),s}let c=o==null?void 0:o.constructor;if(h=qt(t,{symbol:e}),Object.defineProperty(t,Fl,{value:h,enumerable:!1,configurable:!0}),r&&t.name!==r&&Object.defineProperty(t,"name",{value:r,configurable:!0}),h.flags=n,n&St.HasConstructor&&(t.prototype[kl]=e),h.uses)for(let a of h.uses)(i=a.mixes)==null||i.call(a,t);return(c==null?void 0:c.inherited)instanceof Function&&c.inherited(t),t}var Ue=Symbol.for("#__listeners__");var Al=Symbol(),Fi=class{static for(t){return new Proxy({},new this(t))}constructor(t){this.getter=t}get target(){return this.getter()}get(t,e){return this.target[e]}set(t,e,r){return this.target[e]=r,!0}},Vl=Fi;(()=>{d(Fi,Al,"LazyProxy",16)})();function Rl(t,e={}){return new Proxy(e,new Vl(t))}function ye(t){let e=typeof t;if(e=="number")return t;if(e=="string"){if(/^\d+fps$/.test(t))return 1000/parseFloat(t);if(/^([-+]?[\d\.]+)s$/.test(t))return parseFloat(t)*1000;if(/^([-+]?[\d\.]+)ms$/.test(t))return parseFloat(t)}return null}function hn(t,e,r){if(!t)return;let n=Object.getOwnPropertyDescriptor(t,e);return n||t==r?n||void 0:hn(Reflect.getPrototypeOf(t),e,r)}var Kn=function(t,e,r){let n,s,i;for(;(n=r)&&(r=r.next);)(s=r.listener)&&(r.path&&s[r.path]?i=e?s[r.path].apply(s,e):s[r.path]():i=e?s.apply(r,e):s.call(r)),r.times&&--r.times<=0&&(n.next=r.next,r.listener=null)};function me(t,e,r,n){let s,i,o;return s=t[Ue]||(t[Ue]={}),i=s[e]||(s[e]={}),o=i.tail||(i.tail=i.next={}),o.listener=r,o.path=n,i.tail=o.next={},o}function H(t,e,r){let n=me(t,e,r);return n.times=1,n}function tr(t,e,r,n){if(!r)return;let s,i,o=t[Ue];if(!!o&&(s=o[e])){for(;(i=s)&&(s=s.next);)if(s==r||s.listener==r){i.next=s.next,s.listener=null;break}}}function _t(t,e,r=null){let n;(n=t[Ue])&&(n[e]&&Kn(e,r,n[e]),n.all&&Kn(e,[e,r],n.all))}var Kl=Symbol(),ji=class{emit(t,...e){return _t(this,t,e)}on(t,...e){return me(this,t,...e)}once(t,...e){return H(this,t,...e)}un(t,...e){return tr(this,t,...e)}},an=ji;(()=>{d(ji,Kl,"Emitter",0)})();function hr(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function ql(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var qn=Symbol.for("#__init__"),Hn=Symbol.for("#schedule"),Gr=Symbol.for("#frames"),ve=Symbol.for("#interval"),It=Symbol.for("#stage"),Pt=Symbol.for("#scheduled"),be=Symbol.for("#version"),Hl=Symbol.for("#fps"),zn=Symbol.for("#ticker"),zl=globalThis.requestAnimationFrame||function(t){return globalThis.setTimeout(t,16.666666666666668)};var Ul=Symbol(),Di=class{constructor(t=null){this[qn](t)}[qn](t=null,e=!0,r=!0){var n;this.owner=t&&(n=t.owner)!==void 0?n:null,this.target=t&&(n=t.target)!==void 0?n:null,this.active=t&&(n=t.active)!==void 0?n:!1,this.value=t&&(n=t.value)!==void 0?n:void 0,this.skip=t&&(n=t.skip)!==void 0?n:0,this.last=t&&(n=t.last)!==void 0?n:0}tick(t,e){return this.last=this.owner[Gr],this.target.tick(this,e),1}update(t,e){let r=this.active,n=t.value;return this.value!=n&&(this.deactivate(),this.value=n),(this.value||r||e)&&this.activate(),this}queue(){this.owner.add(this)}activate(){return this.value===!0?this.owner.on("commit",this):this.value===!1||typeof this.value=="number"&&(this.value/16.666666666666668<=2?this.owner.on("raf",this):this[ve]=globalThis.setInterval(this.queue.bind(this),this.value)),this.active=!0,this}deactivate(){return this.value===!0&&this.owner.un("commit",this),this.owner.un("raf",this),this[ve]&&(globalThis.clearInterval(this[ve]),this[ve]=null),this.active=!1,this}},Gl=Di;(()=>{d(Di,Ul,"Scheduled",16)})();var Wl=Symbol(),Ai=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[It]=-1,this[Gr]=0,this[Pt]=!1,this[be]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[Hl]=0,this.$promise=null,this.$resolve=null,this[zn]=function(e){return t[Pt]=!1,t.tick(e)}}touch(){return this[be]++}get version(){return this[be]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Pt]||this[Hn](),this}get committingΦ(){return this.queue.indexOf("commit")>=0}get syncingΦ(){return this[It]==1}listen(t,e){let r=this.listeners[t],n=!r;return r||(r=this.listeners[t]=new Set),r.add(e),t=="raf"&&n&&this.add("raf"),this}unlisten(t,e){var r;let n=this.listeners[t];return n&&n.delete(e),t=="raf"&&n&&n.size==0&&(r=this.listeners.raf,delete this.listeners.raf),this}on(t,e){return this.listen(t,e)}un(t,e){return this.unlisten(t,e)}get promise(){var t=this;return this.$promise||(this.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,n=this[Gr]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[It]=1,this[be]++,r.length)for(let s=0,i=ql(r),o=i.length;s<o;s++){let l=i[s];typeof l=="string"&&this.listeners[l]?this.listeners[l].forEach(function(h){if(hr(h.tick,Function))return h.tick(e,l);if(hr(h,Function))return h(e,l)}):hr(l,Function)?l(this.dt,this):l.tick&&l.tick(this.dt,this)}return this[It]=this[Pt]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[Hn](){return this[Pt]||(this[Pt]=!0,this[It]==-1&&(this[It]=0),zl(this[zn])),this}schedule(t,e){var r,n;return e||(e=t[r=this.id]||(t[r]={value:!0})),(e[n=this.id]||(e[n]=new Gl({owner:this,target:t}))).update(e,!0)}unschedule(t,e={}){e||(e=t[this.id]);let r=e&&e[this.id];return r&&r.active&&r.deactivate(),this}},Yl=Ai;(()=>{d(Ai,Wl,"Scheduler",16)})();var M=new Yl;function P(){return M.add("commit").promise}function Xl(t,e){return globalThis.setTimeout(function(){t(),P()},e)}function Jl(t,e){return globalThis.setInterval(function(){t(),P()},e)}var{clearInterval:Ql,clearTimeout:Zl}=globalThis,pe=globalThis.imba||(globalThis.imba={});pe.commit=P;pe.setTimeout=Xl;pe.setInterval=Jl;pe.clearInterval=Ql;pe.clearTimeout=Zl;var Bl=Symbol(),ar,Kf=new(ar=class{},(()=>{d(ar,Bl,"Env",0)})(),ar);function $l(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Se=Symbol.for("#idler"),Wt=Symbol.for("#resolve"),th=Symbol(),Vi=class extends Set{constructor(){super(),this[Se]=Promise.resolve(this)}emit(t,...e){return _t(this,t,e)}on(t,...e){return me(this,t,...e)}once(t,...e){return H(this,t,...e)}un(t,...e){return tr(this,t,...e)}add(t){var e=this;if($l(t,Function)&&(t=t()),!this.has(t)){let r=this.size==0;super.add(t),r&&(this[Se]=this[Wt]=null,this.emit("busy",this)),this.emit("add",t,this);let n=function(){return e.delete(t)};t.then(n,n)}return t}delete(t){return super.delete(t)?(this.emit("delete",t,this),this.size==0&&(this[Wt]&&(this[Wt](!0),this[Wt]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[Se]||(this[Se]=new Promise(function(e){return t.size==0?e(!0):t[Wt]=e}))}get idleΦ(){return this.size==0}then(t,e){return this.idle.then(t,e)}},eh=Vi;(()=>{d(Vi,th,"Queue",24)})();var Un=Symbol.for("#toStringDeopt"),Gn=Symbol.for("#symbols"),Wn=Symbol.for("#batches"),Yn=Symbol.for("#extras"),Xn=Symbol.for("#stacks"),rh=Symbol(),Ri=class{constructor(t){this.dom=t,this.string=""}contains(t){return this.dom.classList.contains(t)}has(t){return this.dom.classList.contains(t)}add(t){return this.contains(t)?this:(this.string+=(this.string?" ":"")+t,this.dom.classList.add(t),this)}remove(t){if(!this.contains(t))return this;let e=new RegExp("(^|\\s)"+t+"(?=\\s|$)","g");return this.string=this.string.replace(e,""),this.dom.classList.remove(t),this}toggle(t,e){return e===void 0&&(e=!this.contains(t)),e?this.add(t):this.remove(t)}incr(t,e=0){var r=this;let n=this.stacks,s=n[t]||0;return s<1&&this.add(t),e>0&&setTimeout(function(){return r.decr(t)},e),n[t]=Math.max(s,0)+1}decr(t){let e=this.stacks,r=e[t]||0;return r==1&&this.remove(t),e[t]=Math.max(r,1)-1}reconcile(t,e){let r=this[Gn],n=this[Wn],s=!0;if(!r)r=this[Gn]=[t],n=this[Wn]=[e||""],this.toString=this.valueOf=this[Un];else{let i=r.indexOf(t),o=e||"";i==-1?(r.push(t),n.push(o)):n[i]!=o?n[i]=o:s=!1}s&&(this[Yn]=" "+n.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[Un](){return this.string+(this[Yn]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[Xn]||(this[Xn]={})}},Ki=Ri;(()=>{d(Ri,rh,"Flags",16)})();var Jn=Symbol.for("#__init__"),ur=Symbol.for("#getRenderContext"),nh=Symbol.for("#getDynamicContext"),lt={context:null},sh=Symbol(),qi=class{constructor(t=null){this[Jn](t)}[Jn](t=null,e=!0,r=!0){var n;this.stack=t&&(n=t.stack)!==void 0?n:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},ih=qi;(()=>{d(qi,sh,"Renderer",16)})();var Qn=new ih,oh=Symbol(),un=class extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return lt.context=null}[ur](t){let e=this.get(t);return e||this.set(t,e=new un(this._,t)),lt.context=e}[nh](t,e){return this[ur](t)[ur](e)}run(t){return this.value=t,lt.context==this&&(lt.context=null),this.get(t)}cache(t){return this.set(this.value,t),t}},cn=un;(()=>{d(un,oh,"RenderContext",16)})();function Hi(t,e=Symbol(),r=t){return lt.context=t[e]||(t[e]=new cn(r,e))}function Zn(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var se=Symbol.for("#parent"),Bn=Symbol.for("#closestNode"),lh=Symbol.for("#parentNode"),hh=Symbol.for("#context"),ah=Symbol.for("##inited"),cr=Symbol.for("#getRenderContext"),uh=Symbol.for("#getDynamicContext"),$n=Symbol.for("#insertChild"),Wr=Symbol.for("#appendChild"),dr=Symbol.for("#replaceChild"),ts=Symbol.for("#removeChild"),st=Symbol.for("#insertInto"),es=Symbol.for("#insertIntoDeopt"),Yt=Symbol.for("#removeFrom"),rs=Symbol.for("#removeFromDeopt"),Lt=Symbol.for("#replaceWith"),ns=Symbol.for("#replaceWithDeopt"),fr=Symbol.for("#placeholderNode"),ch=Symbol.for("#attachToParent"),dh=Symbol.for("#detachFromParent"),ss=Symbol.for("#placeChild"),fh=Symbol.for("#beforeReconcile"),mh=Symbol.for("#afterReconcile"),ph=Symbol.for("#afterVisit"),gh=Symbol.for("#visitContext"),yh=Symbol.for("#__init__"),vh=Symbol.for("##parent"),mr=Symbol.for("##up"),is=Symbol.for("##context"),bt=Symbol.for("#domNode"),we=Symbol.for("##placeholderNode"),os=Symbol.for("#forNode"),ls=Symbol.for("#domDeopt"),xe=Symbol.for("##visitContext"),bh=Symbol.for("#isRichElement"),hs=Symbol.for("#src"),pr=Symbol.for("#htmlNodeName");var as=Symbol.for("#cssns"),Sh=Symbol.for("#cssid"),zi=window.Event,qf=window.UIEvent,Hf=window.FocusEvent,wh=window.MouseEvent,xh=window.PointerEvent,Th=window.KeyboardEvent,tt=window.CustomEvent,Ui=window.Node,us=window.Comment,Eh=window.Text,D=window.Element,zf=window.HTMLElement,Uf=window.HTMLHtmlElement,_h=window.HTMLSelectElement,Nh=window.HTMLInputElement,Oh=window.HTMLTextAreaElement,Ih=window.HTMLButtonElement,Ph=window.HTMLOptionElement,Gf=window.HTMLScriptElement,Wf=window.SVGElement,Yf=window.DocumentFragment,Xf=window.ShadowRoot,Lh=window.Document,Jf=window.Window,Qf=window.customElements,cs={};function Gi(t,e,r){if(!t)return r[e]=null;if(r[e]!==void 0)return r[e];let n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0||t==SVGElement?r[e]=n||null:Gi(Reflect.getPrototypeOf(t),e,r)}var Ch={},Mh={},kh={},Fh={};function gr(){return globalThis.document}var jh={get(t,e){let r=t,n;for(;r&&n==null;)(r=r[se])&&(n=r[e]);return n},set(t,e,r){let n=t,s;for(;n&&s==null;){if(hn(n,e,Element))return n[e]=r,!0;n=n[se]}return!0}},Dh=Symbol(),Ah=class{get flags(){return this.documentElement.flags}emit(...t){return this.documentElement.emit(...t)}};(()=>{d(Ah,Dh,"Document",1,Document)})();Node.prototype[yh]=function(){return this};var Vh=Symbol(),Rh=class{get[se](){return this[vh]||this.parentNode||this[mr]}get[Bn](){return this}get[lh](){var t;return(t=this[se])==null?void 0:t[Bn]}get[hh](){return this[is]||(this[is]=new Proxy(this,jh))}[ah](){return this}[cr](t){return Hi(this,t)}[uh](t,e){return this[cr](t)[cr](e)}[$n](t,e){return t[st](this,e)}[Wr](t){return t[st](this,null)}[dr](t,e){let r=this[$n](t,e);return this[ts](e),r}[ts](t){return t[Yt](this)}[st](t,e=null){return e?t.insertBefore(this,e):t.appendChild(this),this}[es](t,e){return e?t.insertBefore(this[bt]||this,e):t.appendChild(this[bt]||this),this}[Yt](t){return t.removeChild(this)}[rs](t){return t.removeChild(this[bt]||this)}[Lt](t,e){return e[dr](t,this)}[ns](t,e){return e[dr](t,this[bt]||this)}get[fr](){let t;return this[we]||(this[we]=(t=globalThis.document.createComment("placeholder"),t[os]=this,t))}set[fr](t){let e=this[we];this[we]=t,t[os]=this,e&&e!=t&&e.parentNode&&e[Lt](t)}[ch](){let t=this[bt],e=t&&t.parentNode;return t&&e&&t!=this&&(this[bt]=null,this[st](e,t),t[Yt](e)),this}[dh](){this[ls]!=!0&&(this[ls]=!0,!0)&&(this[Lt]=this[ns],this[Yt]=this[rs],this[st]=this[es],this[mr]||(this[mr]=this[se]));let t=this[fr];return this.parentNode&&t!=this&&(t[st](this.parentNode,this),this[Yt](this.parentNode)),this[bt]=t,this}[ss](t,e,r){let n=typeof t;if(n==="undefined"||t===null){if(r&&Zn(r,Comment))return r;let s=globalThis.document.createComment("");return r?r[Lt](s,this):s[st](this,null)}if(t===r)return t;if(n!=="object"){let s,i=t;return r?Zn(r,Text)?(r.textContent=i,r):(s=globalThis.document.createTextNode(i),r[Lt](s,this),s):(this.appendChild(s=globalThis.document.createTextNode(i)),s)}else return t[st]?r?r[Lt](t,this):t[st](this,null):this[ss](String(t),e,r)}};(()=>{d(Rh,Vh,"Node",1,Node)})();var Kh=Symbol(),qh=class{log(...t){return console.log(...t)}get hiddenΦ(){var t,e;let r=globalThis.getComputedStyle(this);return r.display=="none"||r.visibility=="hidden"?!0:this.offsetParent||this===globalThis.document.body?!1:(e=(t=this.parentElement)==null?void 0:t.hiddenΦ)!=null?e:!0}get detachedΦ(){return!globalThis.document.documentElement.contains(this)}get unobstructedΦ(){let t=this.getBoundingClientRect(),e=window.visualViewport,r=t.left+t.width*0.5,n=t.top+t.height*0.5;if(e.width>r&&r>0&&e.height>n&&n>0){let s=globalThis.document.elementFromPoint(r,n);return!!(s&&(s.contains(this)||this.contains(s)))}return!1}get focusΦ(){return globalThis.document.activeElement==this}get focinΦ(){return this.contains(globalThis.document.activeElement)}emit(t,e,r={}){var n,s,i;e!=null&&((n=r.detail)!=null||(r.detail=e)),(s=r.bubbles)!=null||(r.bubbles=!0),(i=r.cancelable)!=null||(r.cancelable=!0);let o=new CustomEvent(t,r);r.original&&(o.originalEvent=r.original);let l=this.dispatchEvent(o);return o}text$(t){return this.textContent=t,this}[fh](){return this}[mh](){return this}[ph](){this[xe]&&(this[xe]=null)}get[gh](){return this[xe]||(this[xe]={})}get flags(){return this.$flags||(this.$flags=new Ki(this),this.flag$==Element.prototype.flag$&&(this.flags$ext=this.className),this.flagDeopt$()),this.$flags}flag$(t){let e=this.flags$ns;this.className=e?e+(this.flags$ext=t):this.flags$ext=t}flagDeopt$(){var t=this;this.flag$=this.flagExt$,this.flagSelf$=function(e){return t.flagSync$(t.flags$own=e)}}flagExt$(t){return this.flagSync$(this.flags$ext=t)}flagSelf$(t){return this.flagDeopt$(),this.flagSelf$(t)}flagSync$(){return this.className=(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||"")}set$(t,e){let r=hn(this,t,Element);!r||!r.set?this.setAttribute(t,e):this[t]=e}get richValue(){return this.value}set richValue(t){this.value=t}};(()=>{d(qh,Kh,"Element",1,Element)})();Element.prototype.setns$=Element.prototype.setAttributeNS;Element.prototype[bh]=!0;function dn(t,e,r,n){let s=globalThis.document.createElement(t);return r&&(s.className=r),n!==null&&s.text$(n),e&&e[Wr]&&e[Wr](s),s}var Hh=Symbol(),zh=class{set$(t,e){var r;let n=cs[r=this.nodeName]||(cs[r]={}),s=Gi(this,t,n);!s||!s.set?this.setAttribute(t,e):this[t]=e}flag$(t){let e=this.flags$ns;this.setAttribute("class",e?e+(this.flags$ext=t):this.flags$ext=t)}flagSelf$(t){var e=this;return this.flag$=function(r){return e.flagSync$(e.flags$ext=r)},this.flagSelf$=function(r){return e.flagSync$(e.flags$own=r)},this.flagSelf$(t)}flagSync$(){return this.setAttribute("class",(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||""))}};(()=>{d(zh,Hh,"SVGElement",1,SVGElement)})();var Uh=Symbol(),Gh=class{set src(t){if(this[hs]!=t&&(this[hs]=t,!0)){if(t&&t.adoptNode)t.adoptNode(this);else if(t&&t.type=="svg"){if(t.attributes)for(let e=t.attributes,r=0,n=Object.keys(e),s=n.length,i,o;r<s;r++)i=n[r],o=e[i],this.setAttribute(i,o);this.innerHTML=t.content}}}};(()=>{d(Gh,Uh,"SVGSVGElement",1,SVGSVGElement)})();function Ge(t){return globalThis.document.createComment(t)}function ds(t){return globalThis.document.createTextNode(t)}var We=globalThis.navigator,Wh=We&&We.vendor||"",fs=We&&We.userAgent||"",Yh=Wh.indexOf("Apple")>-1||fs.indexOf("CriOS")>=0||fs.indexOf("FxiOS")>=0,Yr=!Yh;var Xh=Symbol(),Wi=class extends HTMLElement{connectedCallback(){return Yr?this.parentNode.removeChild(this):this.parentNode.connectedCallback()}disconnectedCallback(){if(!Yr)return this.parentNode.disconnectedCallback()}},Jh=Wi;(()=>{d(Wi,Xh,"CustomHook",0)})();window.customElements.define("i-hook",Jh);function Yi(t,e,r={}){kh[t]=Fh[t]=e,e.nodeName=t;let n=t,s=e.prototype;if(t.indexOf("-")==-1&&(n=""+t+"-tag",Mh[t]=n),r.cssns){let i=(s._ns_||s[as]||"")+" "+(r.cssns||"");s._ns_=i.trim()+" ",s[as]=r.cssns}if(r.cssid){let i=(s.flags$ns||"")+" "+r.cssid;s[Sh]=r.cssid,s.flags$ns=i.trim()+" "}return s[pr]&&!r.extends&&(r.extends=s[pr]),r.extends?(s[pr]=r.extends,Ch[t]=e,Yr&&window.customElements.define(n,e,{extends:r.extends})):window.customElements.define(n,e),e}var Qh=globalThis.imba||(globalThis.imba={});Qh.document=globalThis.document;function Xt(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function yr(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Ae=Symbol.for("#parent"),ms=Symbol.for("#closestNode"),Zh=Symbol.for("#isRichElement"),Bh=Symbol.for("#afterVisit"),$h=Symbol.for("#getRenderContext"),ps=Symbol.for("#appendChild"),gs=Symbol.for("#removeChild"),ys=Symbol.for("#replaceChild"),it=Symbol.for("#insertInto"),Te=Symbol.for("#replaceWith"),vs=Symbol.for("#insertChild"),Ee=Symbol.for("#removeFrom"),bs=Symbol.for("#placeChild"),ta=Symbol.for("#registerFunctionalSlot"),ea=Symbol.for("#getFunctionalSlot"),Ss=Symbol.for("#getSlot"),Xr=Symbol.for("##parent"),xt=Symbol.for("##up"),ws=Symbol.for("##flags"),ra=Symbol.for("#domFlags"),R=Symbol.for("#end"),xs=Symbol.for("#textContent"),_e=Symbol.for("#textNode"),vr=Symbol.for("#functionalSlots");var na=Symbol(),Xi=class{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[Ae](t){this[Xr]=t}get[Ae](){return this[Xr]||this[xt]}get[ms](){return this[Ae][ms]}get[Zh](){return!0}get flags(){return this[ws]||(this[ws]=new Ki(this))}flagSync$(){return this}[Bh](){return this}[$h](t){return Hi(this,t)}},Ye=Xi;(()=>{d(Xi,na,"Fragment",16)})();var sa=0,ia=Symbol(),Ji=class extends Ye{constructor(t,e){super(...arguments),this[xt]=e,this.parentNode=null,this[ra]=t,this.childNodes=[],this[R]=Ge("slot"+sa++),e&&e[ps](this)}get[Ae](){return this[Xr]||this.parentNode||this[xt]}set textContent(t){this[xs]=t}get textContent(){return this[xs]}hasChildNodes(){for(let t=0,e=yr(this.childNodes),r=e.length;t<r;t++){let n=e[t];if(Xt(n,Ye)&&n.hasChildNodes())return!0;if(!Xt(n,us)){if(Xt(n,Ui))return!0}}return!1}text$(t){return this[_e]?this[_e].textContent=t:this[_e]=this[bs](t),this[_e]}appendChild(t){return this.parentNode&&t[it](this.parentNode,this[R]),this.childNodes.push(t)}[ps](t){var e;return this.parentNode?t[it](this.parentNode,this[R]):(e=t[xt])!=null||(t[xt]=this[xt]||this),this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[vs](t,e);let r=this.childNodes.indexOf(e);return r>=0&&this.childNodes.splice(r,0,t),t}[gs](t){this.parentNode&&this.parentNode[gs](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[ys](t,e){this.parentNode&&this.parentNode[ys](t,e);let r=this.childNodes.indexOf(e);return this.childNodes[r]=t,t}[it](t,e){let r=this.parentNode;if(this.parentNode!=t&&(this.parentNode=t,!0)){this[R]&&(e=this[R][it](t,e));for(let n=0,s=yr(this.childNodes),i=s.length;n<i;n++)s[n][it](t,e)}return this}[Te](t,e){let r=t[it](e,this[R]);return this[Ee](e),r}[vs](t,e){if(this.parentNode&&this.insertBefore(t,e||this[R]),e){let r=this.childNodes.indexOf(e);r>=0&&this.childNodes.splice(r,0,t)}else this.childNodes.push(t);return t}[Ee](t){for(let e=0,r=yr(this.childNodes),n=r.length;e<n;e++)r[e][Ee](t);return this[R]&&this[R][Ee](t),this.parentNode=null,this}[bs](t,e,r){let n=this.parentNode,s=typeof t;if(s==="undefined"||t===null){if(r&&Xt(r,us))return r;let i=Ge("");if(r){let o=this.childNodes.indexOf(r);return this.childNodes.splice(o,1,i),n&&r[Te](i,n),i}return this.childNodes.push(i),n&&i[it](n,this[R]),i}if(t===r)return t;if(s!=="object"){let i,o=t;if(r){if(Xt(r,Eh))return r.textContent=o,r;{i=ds(o);let l=this.childNodes.indexOf(r);return this.childNodes.splice(l,1,i),n&&r[Te](i,n),i}}else return this.childNodes.push(i=ds(o)),n&&i[it](n,this[R]),i}else if(r){let i=this.childNodes.indexOf(r);return this.childNodes.splice(i,1,t),n&&r[Te](t,n),t}else return this.childNodes.push(t),n&&t[it](n,this[R]),t}},oa=Ji;(()=>{d(Ji,ia,"VirtualFragment",16)})();function Jr(t,e){let r=new oa(t,null);return r[xt]=e,r}var la=Symbol(),ha=class{[ta](t){let e=this[vr]||(this[vr]={});return e[t]||(e[t]=Jr(0,this))}[ea](t,e){let r=this[vr];return r&&r[t]||this[Ss](t,e)}[Ss](t,e){var r;return t=="__"&&!this.render||!this.__slots?this:(r=this.__slots)[t]||(r[t]=Jr(0,this))}};(()=>{d(ha,la,"Node",1,Ui)})();function aa(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var ua=Symbol.for("#afterVisit"),Ne=Symbol.for("#insertInto"),Ts=Symbol.for("#appendChild"),ca=Symbol.for("#replaceWith"),br=Symbol.for("#removeFrom"),da=Symbol.for("#domFlags"),fa=Symbol.for("##parent"),at=Symbol.for("#end"),ma=Symbol.for("#removeChild"),pa=Symbol.for("#insertChild"),ga=Symbol(),ya=class extends Ye{constructor(t,e){super(...arguments),this[da]=t,this[fa]=e,t&256||(this[at]=Ge("list")),this.$=this.childNodes,this.length=0,e&&e[Ts](this)}hasChildNodes(){return this.length!=0}[ua](t){let e=this.length;if(this.length=t,e==t)return;let r=this.parentNode;if(!r)return;let n=this.childNodes,s=this[at];if(e>t)for(;e>t;)r[ma](n[--e]);else if(t>e)for(;t>e;)r[pa](n[e++],s);this.length=t}[Ne](t,e){this.parentNode=t,this[at]&&this[at][Ne](t,e),e=this[at];for(let r=0,n=aa(this.childNodes),s=n.length;r<s;r++){let i=n[r];if(r==this.length)break;i[Ne](t,e)}return this}[Ts](t){}[ca](t,e){let r=t[Ne](e,this[at]);return this[br](e),r}[br](t){let e=this.length;for(;e>0;)this.childNodes[--e][br](t);this[at]&&t.removeChild(this[at]),this.parentNode=null}};(()=>{d(ya,ga,"IndexedTagFragment",16)})();function Es(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Sr=Symbol.for("#appendChild"),Oe=Symbol.for("#insertChild"),va=Symbol.for("#replaceWith"),Ie=Symbol.for("#insertInto"),wr=Symbol.for("#removeFrom"),ba=Symbol.for("#afterVisit"),Pe=Symbol.for("#domFlags"),_s=Symbol.for("##parent"),ut=Symbol.for("#end"),Ns=Symbol.for("#removeChild"),Sa=Symbol(),wa=class extends Ye{constructor(t,e){super(...arguments),this[Pe]=t,this[_s]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new cn(this,Symbol()),t&256||(this[ut]=Ge("map")),e&&e[Sr](this)}[Sr](t){if(this.parentNode)return this.parentNode[Oe](t,this[ut])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[Pe]&1)){this.array.push(t),this[Sr](t);return}let r=this.array[e];if(r!==t){this.dirty=!0;let n=this.array.indexOf(t),s=this.changes.get(t);n===-1?(this.array.splice(e,0,t),this.insertChild(t,e,n)):n===e+1?(r&&this.changes.set(r,-1),this.array.splice(e,1)):(n>=0&&this.array.splice(n,1),this.array.splice(e,0,t),this.moveChild(t,e,n)),s==-1&&this.changes.delete(t)}}insertChild(t,e,r){let n=this.parentNode;if(n)if(e>0){let s=this.array[e-1];n[Oe](t,s.nextSibling)}else n[Oe](t,this.childNodes[e+1]||this[ut])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[wr](t.parentNode)}[Oe](t,e){}[va](t,e){let r=t[Ie](e,this[ut]);return this[wr](e),r}[Ie](t,e){this[_s]=t;let r=this.parentNode;if(t!=r){this.parentNode=t;for(let n=0,s=Es(this.array),i=s.length;n<i;n++)s[n][Ie](t,e);this[ut]&&this[ut][Ie](t,e)}return this}[wr](t){for(let e=0,r=Es(this.array),n=r.length;e<n;e++){let s=r[e];t[Ns](s)}return this[ut]&&t[Ns](this[ut]),this.parentNode=null}[ba](t){var e=this;if(!(this[Pe]&1)){this[Pe]|=1;return}if(this.dirty&&(this.changes.forEach(function(r,n){if(r==-1)return e.removeChild(n)}),this.changes.clear(),this.dirty=!1),this.array.length>t)for(;this.array.length>t;){let r=this.array.pop();this.removeChild(r)}}};(()=>{d(wa,Sa,"KeyedTagFragment",16)})();function Os(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Xe=Symbol.for("#__init__"),xa=Symbol.for("##inited"),Ta=Symbol.for("#afterVisit"),Ea=Symbol.for("#beforeReconcile"),_a=Symbol.for("#afterReconcile"),Is=Symbol.for("#__hooks__"),Ct=Symbol.for("#autorender"),Le=Symbol.for("##visitContext"),Na=Symbol(),xr,Oa=new(xr=class{constructor(t=null){this[Xe](t)}[Xe](t=null,e=!0,r=!0){var n;this.items=t&&(n=t.items)!==void 0?n:[],this.current=t&&(n=t.current)!==void 0?n:null,this.lastQueued=t&&(n=t.lastQueued)!==void 0?n:null,this.tests=t&&(n=t.tests)!==void 0?n:0}flush(){let t=null;for(;t=this.items.shift();){if(!t.parentNode||t.hydratedΦ)continue;let e=this.current;this.current=t,t.__F|=1024,t.connectedCallback(),this.current=e}}queue(t){var e=this;let r=this.items.length,n=0,s=this.lastQueued;this.lastQueued=t;let{DOCUMENT_POSITION_PRECEDING:i,DOCUMENT_POSITION_FOLLOWING:o}=Node;if(r){let l=this.items.indexOf(s),h=l,c=function(p,y){return e.tests++,p.compareDocumentPosition(y)};(l==-1||s.nodeName!=t.nodeName)&&(h=l=0);let a=this.items[h];for(;a&&c(a,t)&o;)a=this.items[++h];if(h!=l)a?this.items.splice(h,0,t):this.items.push(t);else{for(;a&&c(a,t)&i;)a=this.items[--h];h!=l&&(a?this.items.splice(h+1,0,t):this.items.unshift(t))}}else this.items.push(t),this.current||globalThis.queueMicrotask(this.flush.bind(this))}},(()=>{d(xr,Na,null,16)})(),xr);var Ia=Symbol(),Qi=class extends HTMLElement{constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build()}setup$(){return this.__slots={},this.__F=0}[Xe](){return this.__F|=3,this}[xa](){if(this[Is])return this[Is].inited(this)}flag$(t){this.className=this.flags$ext=t}build(){return this}awaken(){return this}mount(){return this}unmount(){return this}rendered(){return this}dehydrate(){return this}hydrate(){return this.autoschedule=!0,this}tick(t,e){return this.commit()}visit(){return this.commit()}commit(){return this.renderΦ?(this.__F|=256,this.render&&this.render(),this.rendered(),this.__F=(this.__F|512)&-257&-8193):(this.__F|=8192,this)}get autoschedule(){return(this.__F&64)!=0}set autoschedule(t){t?this.__F|=64:this.__F&=-65}set autorender(t){let e=this[Ct]||(this[Ct]={});e.value=t,this.mountedΦ&&M.schedule(this,e)}get renderΦ(){return!this.suspendedΦ}get mountingΦ(){return(this.__F&16)!=0}get mountedΦ(){return(this.__F&32)!=0}get awakenedΦ(){return(this.__F&8)!=0}get renderedΦ(){return(this.__F&512)!=0}get suspendedΦ(){return(this.__F&4096)!=0}get renderingΦ(){return(this.__F&256)!=0}get scheduledΦ(){return(this.__F&128)!=0}get hydratedΦ(){return(this.__F&2)!=0}get ssrΦ(){return(this.__F&1024)!=0}get scheduler(){return M}schedule(){return M.on("commit",this),this.__F|=128,this}unschedule(){return M.un("commit",this),this.__F&=-129,this}async suspend(t=null){let e=this.flags.incr("@suspended");return this.__F|=4096,Os(t,Function)&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("@suspended")==0&&(this.__F&=-4097,this.commit()),this}[Ta](){if(this.visit(),this[Le])return this[Le]=null}[Ea](){return this.__F&1024&&(this.__F=this.__F&-1025,this.classList.remove("_ssr_"),this.flags$ext&&this.flags$ext.indexOf("_ssr_")==0&&(this.flags$ext=this.flags$ext.slice(5)),this.__F&512||(this.innerHTML="")),globalThis.DEBUG_IMBA&&Qn.push(this),this[Le]&&(this[Le]=null),this}[_a](){return globalThis.DEBUG_IMBA&&Qn.pop(this),this}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(!e&&!(t&1024)){Oa.queue(this);return}if(t&48)return;this.__F|=16,e||this[Xe](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),r||(this.awaken(),this.__F|=8),_t(this,"mount",[this]);let n=this.mount();return n&&Os(n.then,Function)&&n.then(M.commit),t=this.__F=(this.__F|32)&-17,t&64&&this.schedule(),this[Ct]&&M.schedule(this,this[Ct]),this}disconnectedCallback(){if(this.__F=this.__F&-49,this.__F&128&&this.unschedule(),_t(this,"unmount",[this]),this.unmount(),this[Ct])return M.unschedule(this,this[Ct])}},er=Qi;(()=>{d(Qi,Ia,"Component",16)})();function Pa(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Ps=Symbol.for("#__init__"),La={cm:1,mm:1,Q:1,pc:1,pt:1,px:1,em:1,ex:1,ch:1,rem:1,vw:1,vh:1,vmin:1,vmax:1,s:1,ms:1,fr:1,"%":1,in:1,turn:1,grad:1,rad:1,deg:1,Hz:1,kHz:1},Ls={prefix:1,suffix:1,content:1},fn={rose:[[356,100,97],[356,100,95],[353,96,90],[353,96,82],[351,95,71],[350,89,60],[347,77,50],[345,83,41],[343,80,35],[342,75,30]],pink:[[327,73,97],[326,78,95],[326,85,90],[327,87,82],[329,86,70],[330,81,60],[333,71,51],[335,78,42],[336,74,35],[336,69,30]],fuchsia:[[289,100,98],[287,100,95],[288,96,91],[291,93,83],[292,91,73],[292,84,61],[293,69,49],[295,72,40],[295,70,33],[297,64,28]],purple:[[270,100,98],[269,100,95],[269,100,92],[269,97,85],[270,95,75],[271,91,65],[271,81,56],[272,72,47],[273,67,39],[274,66,32]],violet:[[250,100,98],[251,91,95],[251,95,92],[252,95,85],[255,92,76],[258,90,66],[262,83,58],[263,70,50],[263,69,42],[264,67,35]],indigo:[[226,100,97],[226,100,94],[228,96,89],[230,94,82],[234,89,74],[239,84,67],[243,75,59],[245,58,51],[244,55,41],[242,47,34]],blue:[[214,100,97],[214,95,93],[213,97,87],[212,96,78],[213,94,68],[217,91,60],[221,83,53],[224,76,48],[226,71,40],[224,64,33]],sky:[[204,100,97],[204,94,94],[201,94,86],[199,95,74],[198,93,60],[199,89,48],[200,98,39],[201,96,32],[201,90,27],[202,80,24]],cyan:[[183,100,96],[185,96,90],[186,94,82],[187,92,69],[188,86,53],[189,94,43],[192,91,36],[193,82,31],[194,70,27],[196,64,24]],teal:[[166,76,97],[167,85,89],[168,84,78],[171,77,64],[172,66,50],[173,80,40],[175,84,32],[175,77,26],[176,69,22],[176,61,19]],emerald:[[152,81,96],[149,80,90],[152,76,80],[156,72,67],[158,64,52],[160,84,39],[161,94,30],[163,94,24],[163,88,20],[164,86,16]],green:[[138,76,97],[141,84,93],[141,79,85],[142,77,73],[142,69,58],[142,71,45],[142,76,36],[142,72,29],[143,64,24],[144,61,20]],lime:[[78,92,95],[80,89,89],[81,88,80],[82,85,67],[83,78,55],[84,81,44],[85,85,35],[86,78,27],[86,69,23],[88,61,20]],yellow:[[55,92,95],[55,97,88],[53,98,77],[50,98,64],[48,96,53],[45,93,47],[41,96,40],[35,92,33],[32,81,29],[28,73,26]],amber:[[48,100,96],[48,96,89],[48,97,77],[46,97,65],[43,96,56],[38,92,50],[32,95,44],[26,90,37],[23,83,31],[22,78,26]],orange:[[33,100,96],[34,100,92],[32,98,83],[31,97,72],[27,96,61],[25,95,53],[21,90,48],[17,88,40],[15,79,34],[15,75,28]],red:[[0,86,97],[0,93,94],[0,96,89],[0,94,82],[0,91,71],[0,84,60],[0,72,51],[0,74,42],[0,70,35],[0,63,31]],warmer:[[60,9,98],[60,5,96],[20,6,90],[24,6,83],[24,5,64],[25,5,45],[33,5,32],[30,6,25],[12,6,15],[24,10,10]],warm:[[0,0,98],[0,0,96],[0,0,90],[0,0,83],[0,0,64],[0,0,45],[0,0,32],[0,0,25],[0,0,15],[0,0,9]],gray:[[0,0,98],[240,5,96],[240,6,90],[240,5,84],[240,5,65],[240,4,46],[240,5,34],[240,5,26],[240,4,16],[240,6,10]],cool:[[210,20,98],[220,14,96],[220,13,91],[216,12,84],[218,11,65],[220,9,46],[215,14,34],[217,19,27],[215,28,17],[221,39,11]],cooler:[[210,40,98],[210,40,96],[214,32,91],[213,27,84],[215,20,65],[215,16,47],[215,19,35],[215,25,27],[217,33,17],[222,47,11]]},Ca=new RegExp("^("+Object.keys(fn).join("|")+")(\\d+(?:\\.\\d+)?)$"),Ma=/^([xyz])$/,ka=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,Fa=`*,::before,::after {
2
+ box-sizing: border-box;
3
+ border-width: 0;
4
+ border-style: solid;
5
+ border-color: currentColor;
6
+ }`,ja=Symbol(),Zi=class{constructor(t=null){this[Ps](t)}[Ps](t=null,e=!0,r=!0){var n;this.entries=t&&(n=t.entries)!==void 0?n:{}}register(t,e){let r=this.entries[t];r?r&&(r.css=e,r.node&&(r.node.textContent=e)):(r=this.entries[t]={sourceId:t,css:e},this.entries.resets||this.register("resets",Fa),r.node=globalThis.document.createElement("style"),r.node.setAttribute("data-id",t),r.node.textContent=r.css,globalThis.document.head.appendChild(r.node))}toString(){return Object.values(this.entries).map(function(t){return t.css}).join(`
7
+
8
+ `)}toValue(t,e,r,n=null){let s;Ls[r]&&(t=String(t));let i=typeof t;if(i=="number"){if(e||(Ma.test(r)?e="px":ka.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return La[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(i=="string"){if(r&&Ls[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),s=t.match(Ca)){let o=fn[s[1]][parseInt(s[2])],l="100%";if(typeof n=="number"?l=n+"%":typeof n=="string"&&(l=n),o)return"hsla("+o[0]+","+o[1]+"%,"+o[2]+"%,"+l+")"}}else if(t&&Pa(t.toStyleString,Function))return t.toStyleString();return t}parseDimension(t){if(typeof t=="string"){let[e,r,n]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(r),n]}else if(typeof t=="number")return[t]}},Da=Zi;(()=>{d(Zi,ja,"Styles",16)})();var mn=new Da,Zf=Object.keys(fn);var Aa=Symbol(),Va=class{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,n,s=null){let i=mn.toValue(e,r,n,s);this.style.setProperty(t,i)}};(()=>{d(Va,Aa,"Element",1,D)})();function Ra(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Cs=Symbol.for("#insertInto"),Ms=Symbol.for("#removeFrom");function Ka(t,e,r={}){let n=e||globalThis.document.body,s=t;if(Ra(t,Function)){let i=t,o=r.tick||(r.tick=function(){let l=r.context||(r.context=new cn(n,null)),h=lt.context;lt.context=l;let c=t(l,r);return lt.context==l&&(lt.context=h),r.node!=c&&(r.node&&globalThis.imba.unmount(r.node),c?((r.node=c)[Cs](n),c.tick==er.prototype.tick&&(c.tick=r.tick,c.scheduledΦ),H(c,"unmount",function(){if(r.node==c)return r.node=null,M.unlisten("commit",r.tick)})):(r.node=c,M.unlisten("commit",r.tick))),c});return M.listen("commit",o),o()}else s.__F|=64;return s[Cs](n),s}function qa(t){return t&&t[Ms]&&t.parentNode&&t[Ms](t.parentNode),t}var Bi=globalThis.imba||(globalThis.imba={});Bi.mount=Ka;Bi.unmount=qa;function B(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function Jt(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var ie=Symbol.for("##onchange"),ce=Symbol.for("#afterVisit"),oe=Symbol.for("##oninput"),Ve=Symbol.for("##onclick"),de=Symbol.for("##bound"),mt=Symbol.for("##visitContext");var Ha={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},Qr=function(t){return B(t,Array)||t&&B(t.has,Function)},pn=function(t,e){return t==e?!0:B(t,Array)?t.indexOf(e)>=0:t&&B(t.has,Function)?t.has(e):t&&B(t.contains,Function)?t.contains(e):!1},gn=function(t,e){if(B(t,Array))return t.push(e);if(t&&B(t.add,Function))return t.add(e)},yn=function(t,e){if(B(t,Array)){let r=t.indexOf(e);if(r>=0)return t.splice(r,1)}else if(t&&B(t.delete,Function))return t.delete(e)};function za(t){function e(){return t[0]?t[0][t[1]]:void 0}function r(n){return t[0]?t[0][t[1]]=n:null}return{get:e,set:r}}var Ua=Symbol(),Ga=class{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this[de]&&Ha[this.nodeName]&&(this[de]=!0,this[ie]&&this.addEventListener("change",this[ie]=this[ie].bind(this)),this[oe]&&this.addEventListener("input",this[oe]=this[oe].bind(this),{capture:!0}),this[Ve]&&this.addEventListener("click",this[Ve]=this[Ve].bind(this),{capture:!0})),Object.defineProperty(this,t,B(r,Array)?za(r):r),r}};(()=>{d(Ga,Ua,"Element",1,D)})();Object.defineProperty(D.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(t){return this.setRichValue(t)}});var Wa=Symbol(),Ya=class{[ie](t){let e=this.data,r=this.$$value;this.$$value=void 0;let n=this.getRichValue();if(this.multiple){if(r)for(let s=0,i=Jt(r),o=i.length;s<o;s++){let l=i[s];n.indexOf(l)==-1&&yn(e,l)}for(let s=0,i=Jt(n),o=i.length;s<o;s++){let l=i[s];(!r||r.indexOf(l)==-1)&&gn(e,l)}}else this.data=n[0];return P(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=Jt(this.selectedOptions),n=r.length;e<n;e++){let s=r[e];t.push(s.richValue)}return this.$$value=t}syncValue(){let t=this.data;if(this.multiple){let e=[];for(let r=0,n=Jt(this.options),s=n.length;r<s;r++){let i=n[r],o=i.richValue,l=pn(t,o);i.selected=l,l&&e.push(o)}this.$$value=e}else for(let e=0,r=Jt(this.options),n=r.length;e<n;e++){let s=r[e].richValue;if(s==t){this.$$value=[s],this.selectedIndex=e;break}}}[ce](){if(this.syncValue(),this[mt])return this[mt]=null}};(()=>{d(Ya,Wa,"HTMLSelectElement",1,_h)})();var Xa=Symbol(),Ja=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};(()=>{d(Ja,Xa,"HTMLOptionElement",1,Ph)})();var Qa=Symbol(),Za=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[oe](t){return this.data=this.value,P()}[ce](){let t=this.data;if(t==null&&(t=""),this[de]&&this.value!=t&&(this.value=t),this[mt])return this[mt]=null}};(()=>{d(Za,Qa,"HTMLTextAreaElement",1,Oh)})();var Ba=Symbol(),$a=class{[oe](t){let e=this.type;if(!(e=="checkbox"||e=="radio")&&!(e=="number"&&Number.isNaN(this.valueAsNumber)))return this.$$value=void 0,this.data=this.richValue,P()}[ie](t){let e=this.data,r=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let n=this.checked;Qr(e)?n?gn(e,r):yn(e,r):this.data=n?r:!1}return P()}setRichValue(t){this.$$value!==t&&(this.$$value=t,this.value!==t&&(this.value=t))}getRichValue(){if(this.$$value!==void 0)return this.$$value;let t=this.value,e=this.type;if(e=="range"||e=="number"){let r=this.valueAsNumber;Number.isNaN(r)&&(r=Number(t.replace(/\,/,".")+0)),Number.isNaN(r)&&(r=null),t=r}else e=="checkbox"&&(t==null||t==="on")&&(t=!0);return t}[ce](){if(this[de]){let t=this.type;if(t=="checkbox"||t=="radio"){let e=this.data;e===!0||e===!1||e==null?this.checked=!!e:this.checked=pn(e,this.richValue)}else this.richValue=this.data}this[mt]&&(this[mt]=null)}};(()=>{d($a,Ba,"HTMLInputElement",1,Nh)})();var tu=Symbol(),eu=class{get checked(){return this.$checked}set checked(t){t!=this.$checked&&(this.$checked=t,this.flags.toggle("checked",!!t))}setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[Ve](t){let e=this.data,r=this.checked,n=this.richValue;return Qr(e)?r?yn(e,n):gn(e,n):this.$$value==null?this.data=!r:this.data=r?null:n,this[ce](),P()}[ce](){if(this[de]){let t=this.data,e=this.$$value==null?!0:this.$$value;Qr(t)?this.checked=pn(t,e):this.checked=t==e}this[mt]&&(this[mt]=null)}};(()=>{d(eu,tu,"HTMLButtonElement",1,Ih)})();function ru(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function ks(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var nu=Symbol.for("#getSlot"),su=Symbol.for("#container"),iu=Symbol.for("#afterVisit"),Qt=Symbol.for("#__init__"),Ce=Symbol.for("#listeners"),G=Symbol.for("#slot"),ou=Symbol.for("#parent"),A=Symbol.for("##container"),Tr=Symbol.for("#domTarget"),Fs=Symbol.for("#insertInto"),lu=Symbol.for("#removeFrom"),hu=Symbol.for("#teleport"),au=Symbol.for("#self"),uu=Symbol.for("#target"),cu=Symbol(),$i=class extends er{constructor(){super(...arguments),super[Qt]||this[Qt]()}[Qt](t=null,e=!0,r=!0){e&&super[Qt]&&super[Qt](...arguments),this.to=t?t.to:void 0}build(){return this[Ce]=[],this.win=globalThis,this.doc=globalThis.document}setup(){return this.setAttribute("style","display:none !important;")}[nu](t,e){return this[G]||(this[G]=Jr(0,this[ou])),this[G]}get[su](){if(!this[A]){let t=this.className;this[A]=this.doc.createElement("div"),this[A].className=t,this[A].style.cssText="display:contents !important;"}return this[A]}get domTarget(){return this[Tr]||(this[Tr]=ru(this.to,D)?this.to:this.closest(this.to)||this.doc.querySelector(this.to))}get eventTarget(){return this.domTarget}get style(){return this[A]?this[A].style:super.style}get classList(){return this[A]?this[A].classList:super.classList}get className(){return this[A]?this[A].className:super.className}set className(t){this[A]?this[A].className=t:super.className=t}[iu](){if(this.mountedΦ&&this[G]&&!this[G].parentNode)return this[G][Fs](this.target)}mount(){for(let e=0,r=ks(this[Ce]),n=r.length;e<n;e++){let[s,i,o]=r[e];this.eventTarget.addEventListener(s,i,o)}let t=this.domTarget;return this[G]&&this[G][Fs](t),this}unmount(){for(let t=0,e=ks(this[Ce]),r=e.length;t<r;t++){let[n,s,i]=e[t];this.eventTarget.removeEventListener(n,s,i)}return this[G]&&this[G][lu](this.domTarget),this[Tr]=null,this}addEventListener(t,e,r={}){var n;if(e[hu]=this,e[au]=this,this[Ce].push([t,e,r]),this.mountedΦ&&((n=this.eventTarget)==null?void 0:n.addEventListener))return this.eventTarget.addEventListener(t,e,r)}},to=$i;(()=>{d($i,cu,"TeleportHook",24)})();var du=Symbol(),eo=class extends to{get domTarget(){return this.doc.body}get eventTarget(){return this.win}addEventListener(t,e,r={}){return e[uu]=this.domTarget.parentNode,super.addEventListener(...arguments)}on$resize(t,e,r,n){return this.addEventListener("resize",r,n),r}},fu=eo;(()=>{d(eo,du,"GlobalHook",8)})();globalThis.customElements&&(globalThis.customElements.define("i-teleport",to),globalThis.customElements.define("i-global",fu));function U(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}function mu(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var J=Symbol.for("#__init__"),Re=Symbol.for("#insertInto"),Ke=Symbol.for("#removeFrom"),pu=Symbol.for("#all"),Zt=Symbol.for("#phase"),ot=Symbol.for("#nodes"),gu=Symbol.for("#sizes"),Mt=Symbol.for("#linked"),js=Symbol.for("#mode"),Ds=Symbol.for("#enabled"),yu=Symbol.for("#easer"),kt=Symbol.for("#group"),Er=Symbol.for("#_easer_"),vu=Symbol(),ro=class extends an{constructor(){super(...arguments),super[J]||this[J]()}[J](t=null,e=!0,r=!0){var n;e&&super[J]&&super[J](...arguments),this.selectors=t&&(n=t.selectors)!==void 0?n:{}}addSelectors(t,e){var r;return((r=this.selectors)[e]||(r[e]=[])).push(...t),!0}getSelectors(...t){let e=[];for(let r=0,n=U(t),s=n.length;r<s;r++){let i=n[r];this.selectors[i]&&e.push(...this.selectors[i])}return e&&e.length?e.join(","):null}nodesForBase(t,e="transition"){let r=[t],n=(this.selectors[e]||[]).join(",");if(n=="")return r;let s=t.querySelectorAll(n);for(let i=0,o=U(s),l=o.length;i<l;i++){let h=o[i];h.closest("._ease_")==t&&r.push(h)}return r[pu]=s,r}nodesWithSize(t,e="in"){let r=this.getSelectors("_off_sized","_"+e+"_sized");return r?t.filter(function(n){return n.matches(r)}):[]}},bu=ro;(()=>{d(ro,vu,"Transitions",16)})();var Zr=new bu,Su=globalThis.imba||(globalThis.imba={});Su.transitions=Zr;var wu=Symbol(),xu=class extends an{[J](t=null,e=!0,r=!0){var n;e&&super[J]&&super[J](...arguments),this.flushingΦ=t&&(n=t.flushingΦ)!==void 0?n:!1,this.mutations=t&&(n=t.mutations)!==void 0?n:[]}constructor(t){super(),super[J]||this[J](),this.callback=t}insert(t,e,r){return this.mutations.push({target:t,addedNodes:[e],removedNodes:[],nextSibling:r})}remove(t,e){return this.mutations.push({target:t,addedNodes:[],removedNodes:[e]})}flush(){let t=this.mutations.slice(0);if(!t.length)return this;this.mutations=[],mu(this.callback,Function)&&this.callback(t),this.emit("start",this,t),this.flushingΦ=!0;for(let e of U(t)){for(let r of U(e.addedNodes))r[Re](e.target,e.nextSibling);for(let r of U(e.removedNodes))r[Ke](e.target)}return this.flushingΦ=!1,this.emit("end",this,t)}};(()=>{d(xu,wu,"EaseGroup",16)})();var Tu=Symbol(),no=class extends an{constructor(t){super(),this.dom=t,this[Zt]=null,this[ot]=[],this[gu]=new Map}log(...t){}get flags(){return this.dom.flags}link(t){return this[Mt]||(this[Mt]=new Set),this[Mt].add(t)}unlink(t){return this[Mt].delete(t)}flag(t){for(let e=0,r=U(this[ot]),n=r.length;e<n;e++)r[e].flags.add(t);return this}unflag(t){for(let e=0,r=U(this[ot]),n=r.length;e<n;e++)r[e].flags.remove(t);return this}commit(){return this.dom.offsetWidth}enable(t){return t&&(this[js]=t),this[Ds]!=!0&&(this[Ds]=!0,!0)?(this.dom[Re]=this[Re].bind(this),this.dom[Ke]=this[Ke].bind(this),this.flags.add("_ease_")):this}disable(){return this.flags.remove("_ease_"),!0}set phase(t){var e,r,n,s,i,o,l,h,c,a,p,y,v,u,m,g,f,b,S,w,x,O,C,nt;let V=this[Zt];this[Zt]!=t&&(this[Zt]=t,!0)&&(V&&this.unflag("@"+V),t&&this.flag("@"+t),t?this.flags.add("_easing_"):this.flags.remove("_easing_"),t||(this.unflag("@out"),this.unflag("@in"),this.unflag("@off"),this[ot]=null),t=="enter"&&V=="leave"&&((r=(e=this.dom)==null?void 0:e.emit)==null||r.call(e,"outcancel"),(s=(n=this.dom)==null?void 0:n.transitionΞoutΞcancel)==null||s.call(n,this)),t=="leave"&&V=="enter"&&((o=(i=this.dom)==null?void 0:i.emit)==null||o.call(i,"incancel"),(h=(l=this.dom)==null?void 0:l.transitionΞinΞcancel)==null||h.call(l,this)),t=="enter"&&((a=(c=this.dom)==null?void 0:c.emit)==null||a.call(c,"in"),(y=(p=this.dom)==null?void 0:p.transitionΞin)==null||y.call(p,this)),t=="leave"&&((u=(v=this.dom)==null?void 0:v.emit)==null||u.call(v,"out"),(g=(m=this.dom)==null?void 0:m.transitionΞout)==null||g.call(m,this)),V=="leave"&&!t&&((b=(f=this.dom)==null?void 0:f.emit)==null||b.call(f,"outend"),(w=(S=this.dom)==null?void 0:S.transitionΞoutΞend)==null||w.call(S,this)),V=="enter"&&!t&&((O=(x=this.dom)==null?void 0:x.emit)==null||O.call(x,"inend"),(nt=(C=this.dom)==null?void 0:C.transitionΞinΞend)==null||nt.call(C,this)))}get phase(){return this[Zt]}get leavingΦ(){return this.phase=="leave"}get enteringΦ(){return this.phase=="enter"}get idleΦ(){return this.phase==null}track(t){var e=this;let r={before:gr().getAnimations()};return this.commit(),t(),this.commit(),r.after=gr().getAnimations(),r.fresh=r.after.filter(function(n){return r.before.indexOf(n)==-1}),r.deep=r.fresh.filter(function(n){let s;return!!((s=n.effect.target)&&s.closest("._ease_")!=e.dom)}),r.own=r.fresh.filter(function(n){return r.deep.indexOf(n)==-1}),r.own.length?r.finished=new Promise(function(n){let s=new Set(r.own),i=function(){if(s.delete(this),s.size==0)return n()};for(let o=0,l=U(r.own),h=l.length;o<h;o++){let c=l[o];c[yu]=e,c.addEventListener("finish",i,{once:!0}),c.addEventListener("cancel",i,{once:!0})}}):r.finished=Promise.resolve(!0),r}getAnimatedNodes(){let t=Zr.nodesForBase(this.dom);return this[Mt]&&(t=t.concat(Array.from(this[Mt]))),t}getNodeSizes(t="in",e=this[ot]){let r=Zr.nodesWithSize(e,t),n=new Map;for(let s=0,i=U(r),o=i.length;s<o;s++){let l=i[s],h=window.getComputedStyle(l);n.set(l,{width:h.width,height:h.height})}return n}applyNodeSizes(t){for(let[e,r]of U(t))e.style.width=r.width,e.style.height=r.height;return t}clearNodeSizes(t){if(t){for(let[e,r]of U(t))e.style.removeProperty("width"),e.style.removeProperty("height");return t}}[Re](t,e){var r,n,s=this;if(this[kt]&&!this[kt].flushingΦ)return this[kt].insert(t,this.dom,e),this.dom;let i;if(this.enteringΦ)return this.dom;let o=function(){if(i&&s.clearNodeSizes(i),s.enteringΦ)return s.phase=null};if(this.leavingΦ)return this.track(function(){return s.phase="enter",s.unflag("@off"),s.unflag("@out")}).finished.then(o,function(h){return s.log("error cancel leave",h)}),this.dom;let l=gr().contains(t);return e?this.dom.nextSibling!=e&&t.insertBefore(this.dom,e):this.dom.parentNode!=t&&t.appendChild(this.dom),this[ot]=this.getAnimatedNodes(),this.flag("_instant_"),this.unflag("@out"),this.commit(),i=this[ot].sized=this.getNodeSizes("in"),(n=(r=this.dom)==null?void 0:r.transitionΞinΞinit)==null||n.call(r,this),this.flag("@off"),this.flag("@in"),this.flag("@enter"),this.commit(),this.unflag("_instant_"),this.track(function(){return s.phase="enter",s.applyNodeSizes(i),s.unflag("@off"),s.unflag("@in")}).finished.then(o,function(h){return s.clearNodeSizes(i),s.log("cancelled insert into",h)}),this.dom}[Ke](t){var e=this;if(this[kt]&&!this[kt].flushingΦ){this[kt].remove(t,this.dom);return}if(this.leavingΦ)return;let r,n=function(){if(e.phase=="leave")return e.dom.emit("easeoutend",{}),t.removeChild(e.dom),e.phase=null};if(this.enteringΦ&&this[js]!="forward"){let i=this.track(function(){return e.flag("@off"),e.flag("@in"),e.unflag("@out"),e.phase="leave",e.clearNodeSizes(e[ot].sized)});this.log("cancel enter anims own",i.own,i),i.finished.then(n,function(o){return e.log("error cancel entering",o)});return}this[ot]=this.getAnimatedNodes(),r=this.getNodeSizes("out"),this.applyNodeSizes(r),this.flag("@leave");let s=this.track(function(){return e.phase="leave",e.flag("@off"),e.flag("@out"),e.clearNodeSizes(r)});if(!s.own.length){n();return}s.finished.then(n,function(){return!0})}},Eu=no;(()=>{d(no,Tu,"Easer",16)})();var _u=Symbol(),Nu=class{transitionΞinΞinit(t){return!0}transitionΞin(t){return!0}transitionΞinΞend(t){return!0}transitionΞinΞcancel(t){return!0}transitionΞout(t){return!0}transitionΞoutΞend(t){return!0}transitionΞoutΞcancel(t){return!0}get ease(){return this[Er]||(this[Er]=new Eu(this))}set ease(t){var e,r;if(t==!1){(r=(e=this[Er])==null?void 0:e.disable)==null||r.call(e);return}this.ease.enable(t)}};(()=>{d(Nu,_u,"Element",1,Element)})();function Ou(){return globalThis.imba.uses_events_keyboard=!0,!0}var Iu=Symbol(),Pu=class{αesc(){return this.keyCode==27}αtab(){return this.keyCode==9}αenter(){return this.keyCode==13}αspace(){return this.keyCode==32}αup(){return this.keyCode==38}αdown(){return this.keyCode==40}αleft(){return this.keyCode==37}αright(){return this.keyCode==39}αdel(){return this.keyCode==8||this.keyCode==46}αkey(t){if(typeof t=="string")return this.key==t;if(typeof t=="number")return this.keyCode==t}αshift(){return!!this.shiftKey}αalt(){return!!this.altKey}αctrl(){return!!this.ctrlKey}αmeta(){return!!this.metaKey}αmod(){let t=globalThis.navigator.platform;return/^(Mac|iPhone|iPad|iPod)/.test(t||"")?!!this.metaKey:!!this.ctrlKey}};(()=>{d(Pu,Iu,"KeyboardEvent",1,Th)})();function so(){return globalThis.imba.uses_events_mouse=!0,!0}var Lu=Symbol(),Cu=class{αleft(){return this.button==0}αmiddle(){return this.button==1}αright(){return this.button==2}αshift(){return!!this.shiftKey}αalt(){return!!this.altKey}αctrl(){return!!this.ctrlKey}αmeta(){return!!this.metaKey}αmod(){let t=globalThis.navigator.platform;return/^(Mac|iPhone|iPad|iPod)/.test(t||"")?!!this.metaKey:!!this.ctrlKey}};(()=>{d(Cu,Lu,"MouseEvent",1,wh)})();function Y(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function _r(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Mu=Symbol.for("#extendType"),ku=Symbol.for("#modifierState"),Me=Symbol.for("#sharedModifierState"),As=Symbol.for("#onceHandlerEnd"),Vs=Symbol.for("#extendDescriptors"),L=Symbol.for("#context"),Je=Symbol.for("#defaultPrevented"),Br=Symbol.for("#stopPropagation"),Rs=Symbol.for("#self"),Fu=Symbol.for("#target"),ju=Symbol.for("#teleport");Ou();so();var Du=Symbol(),Au=class{[Mu](t){var e,r;let n=t[Vs]||(t[Vs]=(e=Object.getOwnPropertyDescriptors(t.prototype),r=e.constructor,delete e.constructor,e));return Object.defineProperties(this,n)}};(()=>{d(Au,Du,"CustomEvent",1,CustomEvent)})();var Vu=Symbol(),Ru=class{get original(){return this.originalEvent||this}get[ku](){var t,e;return(t=this[L])[e=this[L].step]||(t[e]={})}get[Me](){var t,e;return(t=this[L].handler)[e=this[L].step]||(t[e]={})}[As](t){return H(this[L],"end",t)}αsel(t){return!!this.target.matches(String(t))}αclosest(t){return!!this.target.closest(String(t))}αprevent(){return this[Je]=!0,this.preventDefault(),!0}αtrap(){return this[Br]=!0,this.stopImmediatePropagation(),this[Je]=!0,this.preventDefault(),!0}αfocin(t){var e;let r=this[L].element;return r=Y(t,Element)?t:t?r.closest(t):r,(e=r==null?void 0:r.contains)==null?void 0:e.call(r,globalThis.document.activeElement)}αlog(...t){return console.info(...t),!0}αtrusted(){return!!this.isTrusted}αuntrusted(){return!this.isTrusted}αif(t){return!!t}αwait(t=250){return new Promise(function(e){return setTimeout(e,ye(t))})}αself(){return this.target==this[L].element}αcooldown(t=250){let e=this[Me];return e.active?!1:(e.active=!0,e.target=this[L].element,e.target.flags.incr("cooldown"),this[As](function(){return setTimeout(function(){return e.target.flags.decr("cooldown"),e.active=!1},ye(t))}),!0)}αthrottle(t=250,e="throttled"){let r=this[Me];return r.active?(r.next&&r.next(!1),new Promise(function(n){return r.next=function(s){return r.next=null,n(s)}})):(r.active=!0,r.el||(r.el=this[L].element),e&&r.el.flags.incr(e),H(this[L],"end",function(){let n=ye(t);return r.interval=setInterval(function(){r.next?r.next(!0):(clearInterval(r.interval),e&&r.el.flags.decr(e),r.active=!1)},n)}),!0)}αdebounce(t=250){let e=this[Me],r=this;return e.queue||(e.queue=[]),e.queue.push(e.last=r),new Promise(function(n){return setTimeout(function(){return e.last==r?(r.debounced=e.queue,e.last=null,e.queue=[],n(!0)):n(!1)},ye(t))})}αflag(t,e){let{element:r,step:n,state:s,id:i,current:o}=this[L],l=Y(e,Element)?e:e?r.closest(e):r;if(!l)return!0;this[L].commit=!0,s[n]=i,l.flags.incr(t);let h=Date.now();return H(o,"end",function(){let c=Date.now()-h,a=Math.max(250-c,0);return setTimeout(function(){return l.flags.decr(t)},a)}),!0}αbusy(t){return this.αflag("busy",t)}αoutside(){let{handler:t}=this[L];if(t&&t[Rs])return!t[Rs].parentNode.contains(this.target)}async αpost(t,e={}){return await globalThis.fetch(t,{method:"POST",...e})}async αfetch(t,e={}){return await globalThis.fetch(t,e)}};(()=>{d(Ru,Vu,"Event",1,Event)})();var Ku=Symbol(),qu=class{αself(){let t=this[L].element;return this.type=="focusout"?this.relatedTarget&&!t.contains(this.relatedTarget):this.type=="focusin"?!this.relatedTarget||!t.contains(this.relatedTarget):this.target==t}};(()=>{d(qu,Ku,"FocusEvent",1,FocusEvent)})();var Hu=Symbol(),io=class{constructor(t,e){this.params=t,this.closure=e}getHandlerForMethod(t,e){return t?t[e]?t:this.getHandlerForMethod(t.parentNode,e):null}abortCurrentHandlers(){var t;if(this.currentEvents)for(let e of _r(this.currentEvents))e.aborted=!0,(t=e==null?void 0:e.resolver)==null||t.call(e,!0);return this}emit(t,...e){return _t(this,t,e)}on(t,...e){return me(this,t,...e)}once(t,...e){return H(this,t,...e)}un(t,...e){return tr(this,t,...e)}get passiveΦ(){return this.params.passive}get captureΦ(){return this.params.capture}get silentΦ(){return this.params.silent}get globalΦ(){return this.params.global}async handleEvent(t){if(this.disabled)return;let e=this[Fu]||t.currentTarget,r=this.params,n=null,s=r.silence||r.silent;this.count||(this.count=0),this.state||(this.state={});let i=this.lastState={element:e,event:t,modifiers:r,handler:this,id:++this.count,step:-1,state:this.state,commit:null,called:!1,current:null,aborted:!1};if(i.current=i,t.handle$mod&&t.handle$mod.apply(i,r.options||[])==!1)return;let o=Event[this.type+"$handle"]||Event[t.type+"$handle"]||this.guard;if(!(o&&o.apply(i,r.options||[])==!1)){this.currentEvents||(this.currentEvents=new Set),this.currentEvents.add(i);for(let l=0,h=Object.keys(r),c=h.length,a,p;l<c&&(a=h[l],p=r[a],!i.aborted);l++){if(i.step++,a[0]=="_")continue;a.indexOf("~")>0&&(a=a.split("~")[0]);let y=null,v=[t,i],u,m=null,g,f=!1,b=typeof a=="string";if(a[0]=="$"&&a[1]=="_"&&Y(p[0],Function))t[L]=i,a=p[0],i.called=!0,a.passive||(i.commit=!0),v=[t,i].concat(p.slice(1)),m=e;else if(Y(p,Array)){v=p.slice(),y=v;for(let S=0,w=_r(v),x=w.length;S<x;S++){let O=w[S];if(typeof O=="string"&&O[0]=="~"&&O[1]=="$"){let C=O.slice(2).split("."),nt=i[C.shift()]||t;for(let V=0,Fn=_r(C),Nl=Fn.length;V<Nl;V++){let Ol=Fn[V];nt=nt?nt[Ol]:void 0}v[S]=nt}}}if(typeof a=="string"&&(g=a.match(/^(emit|flag|mod|moved|pin|fit|refit|map|remap|css)-(.+)$/))&&(y||(y=v=[]),v.unshift(g[2]),a=g[1]),a=="trap")t[Br]=!0,t.stopImmediatePropagation(),t[Je]=!0,t.preventDefault();else if(a=="stop")t[Br]=!0,t.stopImmediatePropagation();else if(a=="prevent")t[Je]=!0,t.preventDefault();else if(a=="commit")i.commit=!0;else if(a=="once")e.removeEventListener(t.type,this);else{if(a=="options"||a=="silence"||a=="silent")continue;if(a=="emit"){let S=v[0],w=v[1];i.called=!0;let x=new CustomEvent(S,{bubbles:!0,detail:w});x.originalEvent=t;let O=(this[ju]||e).dispatchEvent(x)}else if(typeof a=="string"){a[0]=="!"&&(f=!0,a=a.slice(1));let S="α"+a,w=t[S];w||(w=this.type&&Event[this.type+"$"+a+"$mod"]),w||(w=t[a+"$mod"]||Event[t.type+"$"+a]||Event[a+"$mod"]),Y(w,Function)?(a=w,m=i,v=y||[],t[S]&&(m=t,t[L]=i)):a[0]=="_"?(a=a.slice(1),m=this.closure):m=this.getHandlerForMethod(e,a)}}try{Y(a,Function)?u=a.apply(m||e,v):m&&(u=m[a].apply(m,v)),u&&Y(u.then,Function)&&u!=M.$promise&&(i.commit&&!s&&M.commit(),u=await u)}catch(S){n=S;break}if(f&&u===!0||!f&&u===!1)break;i.value=u}if(_t(i,"end",i),i.commit&&!s&&M.commit(),this.currentEvents.delete(i),this.currentEvents.size==0&&this.emit("idle"),n!=null){if(this.type!="error"){let l=Y(n,Error)?n.message:n,h=new CustomEvent("error",{detail:l,bubbles:!0,cancelable:!0});h.error=n,h.originalEvent=t;let c=e.dispatchEvent(h);if(h.defaultPrevented)return}throw n}return i}}},Ks=io;(()=>{d(io,Hu,"EventHandler",16)})();var zu=Symbol(),Uu=class{on$(t,e,r){let n="on$"+t,s=e.capture||!1,i=e.passive,o,l=s;return i&&(l={passive:i,capture:s}),Y(this[n],Function)?(this[n].length>2&&(o=new Ks(e,r)),o=this[n](e,r,o,l)):(o=new Ks(e,r),this.addEventListener(t,o,l)),o}on$error(t,e,r,n){var s;return(s=t.options)!=null&&s.length&&(r.guard=function(...i){let o=this.event.error;return!!i.find(function(l){return Y(o,l)})}),this.addEventListener("error",r,n),r}};(()=>{d(Uu,zu,"Element",1,Element)})();function Gu(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Wu=Symbol(),Nr,vn=new(Nr=class{get iosΦ(){let t=globalThis.navigator.platform||"";return!!(t.match(/iPhone|iPod|iPad/)||t=="MacIntel"&&globalThis.navigator.maxTouchPoints>2)}},(()=>{d(Nr,Wu,null,0)})(),Nr);function bn(t,e){let r=e;return Gu(t,Element)?t:typeof t=="string"?t=="this"||t==""?r:t=="up"?r.parentNode:t=="op"?r.offsetParent:r.closest(t)||r.querySelector(t)||globalThis.document.querySelector(t):null}function Ht(t){if(typeof t=="string"){let[e,r,n]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(r),n]}else if(typeof t=="number")return[t]}function $r(t,e=1){let r=1/e;return Math.round(t*r)/r}function Yu(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.min(r,Math.max(e,t))}function qs(t,e,r,n,s=0.1){let[i,o]=Ht(r),[l,h]=Ht(n),[c,a]=Ht(s);return o=="%"&&(i=(e-t)*(i/100)),h=="%"&&(l=(e-t)*(l/100)),a=="%"&&(c=(l-i)*(c/100)),function(p,y){let v=(p-t)/(e-t),u=i+(l-i)*v;return s&&(u=$r(u,c)),y&&(u=Yu(u,i,l)),u}}so();var Xu=Symbol(),Ju=class{αprimary(){return!!this.isPrimary&&(this.pointerType!="mouse"||this.button==0)}αsecondary(){return!this.isPrimary&&this.button!=0}αmouse(){return this.pointerType=="mouse"}αpen(){return this.pointerType=="pen"}αtouch(){return this.pointerType=="touch"}αpressure(t=0.5){return this.pressure>=t}αlock(){return!0}};(()=>{d(Ju,Xu,"PointerEvent",1,xh)})();function Ft(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Hs=Symbol.for("#capture"),W=Symbol.for("#step"),Qu=Symbol.for("#cancel"),Or=Symbol.for("#reframe"),zs=Symbol.for("#mods"),Ir=Symbol.for("#dx"),Pr=Symbol.for("#dy"),ct=Symbol.for("#context"),Qe=Symbol.for("#locked"),oo=Symbol.for("#teardown"),Us=Symbol.for("#x"),Gs=Symbol.for("#y"),Zu=Symbol.for("#pinTarget");var Ws=null,Bu=Symbol(),lo=class{constructor(t,e,r){this.phase="init",this.events=[],this.originalEvent=t,this.handler=e,this.target=this.currentTarget=r,this[zs]={}}set event(t){this.events.push(t)}get ctrlKey(){return this.originalEvent.ctrlKey}get altKey(){return this.originalEvent.altKey}get shiftKey(){return this.originalEvent.shiftKey}get metaKey(){return this.originalEvent.metaKey}get isPrimary(){return this.originalEvent.isPrimary}get pointerType(){return this.originalEvent.pointerType}get start(){return this.originalEvent}get originalTarget(){return this.originalEvent.target}get event(){return this.events[this.events.length-1]}get elapsed(){return this.event.timeStamp-this.events[0].timeStamp}get type(){return this.event.type}get pointerId(){return this.originalEvent.pointerId}get pressure(){return this.event.pressure}get clientX(){return this.event.clientX}get clientY(){return this.event.clientY}get offsetX(){return this.event.offsetX}get offsetY(){return this.event.offsetY}get activeΦ(){return this.phase!="ended"}get endedΦ(){return this.phase=="ended"}get dx(){return this[Ir]==null?this.event.x-this.start.x:this[Ir]}get dy(){return this[Pr]==null?this.event.y-this.start.y:this[Pr]}get dr(){return Math.sqrt(this.dx*this.dx+this.dy*this.dy)}stopImmediatePropagation(){return this.cancelBubble=!0,this.event.stopImmediatePropagation(),this}stopPropagation(){return this.cancelBubble=!0,this.event.stopPropagation(),this}preventDefault(){return this.defaultPrevented=!0,this.event.preventDefault()}emit(t,...e){return _t(this,t,e)}on(t,...e){return me(this,t,...e)}once(t,...e){return H(this,t,...e)}un(t,...e){return tr(this,t,...e)}αflag(t,e){let{element:r}=this[ct],n=Date.now(),s=Ft(e,D)?e:e?r.closest(e):r;return this[W].setup!=!0&&(this[W].setup=!0,!0)&&(s.flags.incr(t),H(this,"end",function(){return s.flags.decr(t)})),!0}αlock(){return this[Hs](),!0}[Hs](){if(this[Qe]!=!0&&(this[Qe]=!0,!0))return this[ct].element.setPointerCapture(this.pointerId)}get[W](){var t,e;return(t=this[zs])[e=this[ct].step]||(t[e]={})}[Qu](){return this[oo]()}αmoved(t,e){let r=this[W],{element:n,state:s,event:i}=this[ct];if(!r.setup){let a=t||4;typeof t=="string"&&t.match(/^(up|down|left|right|x|y)$/)&&(r.dir=t,a=e||4),typeof e=="string"&&e.match(/^(up|down|left|right|x|y)$/)&&(r.dir=e),r.setup=!0;let[p,y]=Ht(a);r.threshold=p,r.sy=p,r.x0=this.x,r.y0=this.y,r.dir||(r.dir="dist"),r.x=r.left=r.right=r.y=r.up=r.down=r.dist=0,y&&y!="px"&&console.warn("only px threshold allowed in @touch.moved")}if(r.active)return!0;if(r.cancelled)return!1;let o=r.threshold,l=this.x-r.x0,h=this.y-r.y0;r.x=Math.max(r.x,Math.abs(l)),r.y=Math.max(r.y,Math.abs(h)),r.left=Math.max(r.left,-l),r.right=Math.max(r.right,l),r.up=Math.max(r.up,-h),r.down=Math.max(r.down,h),r.dist=Math.max(r.dist,Math.sqrt(l*l+h*h));let c=r[r.dir];if(c>o&&c>=r.x&&c>=r.y){r.active=!0;let a=s.pinTarget;return n.flags.incr("@move"),a&&a.flags.incr("@move"),this.preventDefault(),H(this,"end",function(){return a&&a.flags.decr("@move"),n.flags.decr("@move")}),!0}else if(r.x>o||r.y>o)return r.cancelled=!0,!1;return!1}αhold(t=250){var e=this;let r=this[W],n=this[ct].element;if(r.cancelled)return!1;if(r.setup&&!r.active){let s=this.clientX,i=this.clientY,o=s-r.x,l=i-r.y;Math.sqrt(o*o+l*l)>5&&!r.cancelled&&(clearTimeout(r.timeout),r.cancelled=!0)}if(r.setup!=!0&&(r.setup=!0,!0)){r.active=!1,r.x=this.clientX,r.y=this.clientY;let s;return r.timeout=setTimeout(function(){return r.active=!0,e.preventDefault(),n.flags.incr("@hold"),s&&s(!0),s=null},t),H(this,"end",function(){return r.active&&n.flags.decr("@hold"),clearTimeout(r.timeout),s&&s(!1),s=null}),new Promise(function(i){return s=i})}return r.active}αsync(t,e="x",r="y"){let n=this[W];return n.setup!=!0&&(n.setup=!0,!0)?(n.x=t[e]||0,n.y=t[r]||0,n.tx=this.x,n.ty=this.y):(e&&(t[e]=n.x+(this.x-n.tx)),r&&(t[r]=n.y+(this.y-n.ty))),this[ct].commit=!0,!0}αapply(t,e="x",r="y"){return e&&(t[e]=this.x),r&&(t[r]=this.y),this[ct].commit=!0,!0}αcss(t="x",e="y"){let r=this[W];if(r.setup!=!0&&(r.setup=!0,!0))r.el=this[ct].element,r.x=r.el[Us]||0,r.y=r.el[Gs]||0,r.tx=this.x,r.ty=this.y;else{let n=r.el[Us]=r.x+(this.x-r.tx),s=r.el[Gs]=r.y+(this.y-r.ty);t&&r.el.style.setProperty("--x",n+"px"),e&&r.el.style.setProperty("--y",s+"px")}return!0}αend(){return this.phase=="ended"}αshift(){return!!this.shiftKey}αalt(){return!!this.altKey}αctrl(){return!!this.ctrlKey}αmeta(){return!!this.metaKey}αprimary(){return!!this.isPrimary&&(this.pointerType!="mouse"||this.originalEvent.button==0)}αmouse(){return this.pointerType=="mouse"}αpen(){return this.pointerType=="pen"}αtouch(){return this.pointerType=="touch"}αpressure(t=0.5){return this.pressure>=t}αlog(...t){return console.info(...t),!0}αleft(){return this.originalEvent.button==0}αmiddle(){return this.originalEvent.button==1}αright(){return this.originalEvent.button==2}αround(t=1,e=t){return this.x=$r(this.x,t),this.y=$r(this.y,e),!0}[Or](...t){let e=this[W];if(e.setup!=!0&&(e.setup=!0,!0)){let r=this.target,n=t.length,s=t[0],i=0,o="100%",l=0,h=typeof s;h=="number"||h=="string"&&/^([-+]?\d[\d\.]*)(%|\w+)$/.test(s)||Ft(s,Array)?s=null:h=="string"&&(s=="this"||s==""?s=r:s=="up"?s=r.parentNode:s=="op"?s=r.offsetParent:s=r.closest(s)||r.querySelector(s)),s==null&&(n++,t.unshift(s=r)),n==2?l=t[1]:n>2&&([i,o,l=0]=t.slice(1));let c=s.getBoundingClientRect();Ft(i,Array)||(i=[i,i]),Ft(o,Array)||(o=[o,o]),Ft(l,Array)||(l=[l,l]),e.rect=c,e.x=qs(c.left,c.right,i[0],o[0],l[0]),e.y=qs(c.top,c.bottom,i[1],o[1],l[1]),this.x0=this.x=e.x(this.x,e.clamp),this.y0=this.y=e.y(this.y,e.clamp)}else{let r=this.x=e.x(this.x,e.clamp),n=this.y=e.y(this.y,e.clamp);this[Ir]=r-this.x0,this[Pr]=n-this.y0}return!0}αfit(...t){return this[W].clamp=!0,this[Or](...t)}αreframe(...t){return this[Or](...t)}αpin(...t){var e;let r=this[W];if(r.setup!=!0&&(r.setup=!0,!0)){let n=bn(t[0],this.target);Ft(n,D)||t.unshift(n=this.target);let s=t[1]||0,i=(e=t[2])!=null?e:t[2]=s,o=n.getBoundingClientRect();r.x=this.clientX-(o.left+o.width*s),r.y=this.clientY-(o.top+o.height*i),n&&(this[Zu]=n,n.flags.incr("_touch_"),H(this,"end",function(){return n.flags.decr("_touch_")}))}return this.x-=r.x,this.y-=r.y,!0}},$u=lo;(()=>{d(lo,Bu,"Touch",16)})();var tc=Symbol(),ec=class{on$touch(t,e,r,n){return r.type="touch",this.addEventListener("pointerdown",r,{passive:!1}),vn.iosΦ&&globalThis.parent!=globalThis&&Ws!=!0&&(Ws=!0,!0)&&globalThis.parent.postMessage("setupTouchFix"),r}};(()=>{d(ec,tc,"Element",1,D)})();if(globalThis.parent==globalThis&&vn.iosΦ){let t=function(e){if(e.data=="setupTouchFix")return globalThis.addEventListener("touchmove",function(){return!1},{passive:!1}),globalThis.removeEventListener("message",t)};globalThis.addEventListener("message",t)}zi.touch$handle=function(){let t=this.event,e=this.element,r=this.state.pointerId,n=this.modifiers,s=this.handler,i=vn.iosΦ;if(this.current=this.state,r!=null)return r==t.pointerId;if(n.ctrl&&!t.ctrlKey||n.alt&&!t.altKey||n.meta&&!t.metaKey||n.shift&&!t.shiftKey||n.if&&!n.if[0]||n.self&&t.target!=e||n.primary&&!t.isPrimary||n.pen&&t.pointerType!="pen"||n.mouse&&t.pointerType!="mouse"||n.touch&&t.pointerType!="touch"||n.sel&&!t.target.matches(String(n.sel[0])))return;let o=this.state=s.state=this.current=new $u(t,s,e);r=o.pointerId;let l=function(u){return u.preventDefault(),!1},h=null,c=Symbol(),a=function(u){let{clientX:m,clientY:g}=o,f=u.clientX,b=u.clientY;(o[Qe]||o.defaultPrevented)&&(u.pointerId==o.pointerId||m==f&&g==b)&&(u.preventDefault(),u.stopPropagation()),a&&(globalThis.removeEventListener("click",a,{capture:!0}),a=null)},p=function(u){if(!(o.type=="touchmove"&&u.changedTouches[0].identifier!=r)&&(o.defaultPrevented||o[Qe]))return u.preventDefault()},y=function(u){let m=u.type,g=o.phase;if(u.pointerId&&o.pointerId!=u.pointerId||u[c])return;u[c]=!0;let f=m=="pointerup"||m=="pointercancel";if(u.pressure==0&&u.pointerType=="mouse"&&m=="pointermove"&&o.originalEvent.pressure>0)return h(u);m=="pointercancel"?(o.x=o.clientX,o.y=o.clientY):(o.x=u.clientX,o.y=u.clientY),o.event=u,f&&(o.phase="ended");try{s.handleEvent(o)}catch{}if(g=="init"&&!f&&(o.phase="active"),f&&h)return h(u)},v=!1;return h=function(u){if(!v&&(v=!0,e.flags.decr("_touch_"),o.phase!="ended"&&(o.phase="ended",o.x=o.clientX,o.y=o.clientY,s.handleEvent(o)),o.emit("end"),n.passive||--s.prevents==0&&e.style.removeProperty("touch-action"),s.state={},globalThis.removeEventListener("pointermove",y,{passive:!!n.passive}),globalThis.removeEventListener("pointerup",y),globalThis.removeEventListener("pointercancel",y),setTimeout(function(){if(a&&(globalThis.removeEventListener("click",a,{capture:!0}),a=null),i&&p)return globalThis.removeEventListener("touchend",p),globalThis.removeEventListener("touchmove",p,{passive:!1}),p=null},100),!n.passive))return globalThis.document.removeEventListener("selectstart",l,{capture:!0})},o[oo]=h,n.passive||(s.prevents||(s.prevents=0),s.prevents++,e.style.setProperty("touch-action","none"),e.offsetWidth),e.flags.incr("_touch_"),globalThis.addEventListener("pointermove",y,{passive:!!n.passive}),globalThis.addEventListener("pointerup",y),globalThis.addEventListener("pointercancel",y),globalThis.addEventListener("click",a,{capture:!0}),i&&!n.passive&&(globalThis.addEventListener("touchend",p),globalThis.addEventListener("touchmove",p,{passive:!1})),n.passive||globalThis.document.addEventListener("selectstart",l,{capture:!0}),y(t),!1};function ho(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}function Ys(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var rc=Symbol.for("#context"),nc=Symbol.for("#extendType");var Xs=new(globalThis.WeakMap||Map),Lr={threshold:[0]},sc={};zi.intersect$handle=function(){let t=this.event.detail.observer;return this.modifiers._observer==t};var ic=Symbol(),ao=class extends tt{αin(){return this.delta>=0&&this.entry.isIntersecting}αout(){return this.delta<0}αcss(t="ratio"){return this.target.style.setProperty("--ratio",this.ratio),!0}αflag(t,e){let{state:r,step:n}=this[rc],s=bn(e||"",this.target);return this.isIntersecting&&!r[n]?(s.flags.incr(t),r[n]=!0):r[n]&&!this.isIntersecting&&(s.flags.decr(t),r[n]=!1),!0}},oc=ao;(()=>{d(ao,ic,"IntersectionEvent",0)})();function lc(t,e){return function(r,n){let s=n.prevRatios||(n.prevRatios=new WeakMap);for(let i=0,o=ho(r),l=o.length;i<l;i++){let h=o[i],c=s.get(h.target)||0,a=h.intersectionRatio,p={entry:h,ratio:a,from:c,delta:a-c,observer:n},y=new tt(t,{bubbles:!1,detail:p});y[nc](oc),y.entry=h,y.isIntersecting=h.isIntersecting,y.delta=p.delta,y.ratio=p.ratio,s.set(h.target,a),h.target.dispatchEvent(y)}}}function Js(t=Lr){let e=t.threshold.join("-")+t.rootMargin;!t.root&&Lr.root&&(t.root||(t.root=Lr.root));let r=t.root||sc,n=Xs.get(r);return n||Xs.set(r,n={}),n[e]||(n[e]=new IntersectionObserver(lc("intersect",e),t))}var hc=Symbol(),ac=class{on$intersect(t,e,r,n){let s;if(t.options){let i=[],o={threshold:i};for(let l=0,h=ho(t.options),c=h.length;l<c;l++){let a=h[l];Ys(a,D)||Ys(a,Lh)?o.root=a:typeof a=="number"?i.push(a):typeof a=="string"?o.rootMargin=a:typeof a=="object"&&Object.assign(o,a)}if(i.length==1){let l=i[0];if(l>1)for(i[0]=0;i.length<l;)i.push(i.length/(l-1))}i.length==0&&i.push(0),s=Js(o)}else s=Js();return t._observer=s,s.observe(this),this.addEventListener("intersect",r,n),r}};(()=>{d(ac,hc,"Element",1,D)})();function uc(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Qs=Symbol.for("#width"),Zs=Symbol.for("#height"),cc=Symbol.for("#extendType");var ke=null,dc=Symbol(),uo=class extends tt{αcss(t="1elw",e="1elh",r="",n=""){var s;let i=(s=this.entry)==null?void 0:s.target;if(r=="px"&&(n=r,r=""),i&&i.offsetParent){let o=Ht(t),l=Ht(e),h=bn(r,i),c=o?"--u_"+o[1]:"--"+t,a=l?"--u_"+l[1]:"--"+e,p=o?this.width/o[0]:this.width,y=l?this.height/l[0]:this.height;h.style.setProperty(c,p+n),h.style.setProperty(a,y+n)}return!0}get width(){var t;return(t=this[Qs])!=null?t:this[Qs]=this.entry.target.offsetWidth}get height(){var t;return(t=this[Zs])!=null?t:this[Zs]=this.entry.target.offsetHeight}},fc=uo;(()=>{d(uo,dc,"ResizeEvent",0)})();function mc(){return globalThis.ResizeObserver||ke||(console.warn(":resize not supported in this browser"),ke={observe:function(){return!0}}),globalThis.imbaResizeObserver=ke||(ke=new ResizeObserver(function(t){for(let e=0,r=uc(t),n=r.length;e<n;e++){let s=r[e],i=new tt("resize",{bubbles:!1,detail:s});i.entry=s,i.rect=s.contentRect,i[cc](fc),s.target.dispatchEvent(i);let o=new tt("resized",{bubbles:!0,detail:s});s.target.dispatchEvent(o)}}))}var pc=Symbol(),gc=class{on$resize(t,e,r,n){return mc().observe(this),this.addEventListener("resize",r,n),r}};(()=>{d(gc,pc,"Element",1,D)})();var yc=Symbol.for("#extendType"),vc=Symbol.for("#options");var bc=Symbol(),co=class extends tt{},Sc=co;(()=>{d(co,bc,"MutationEvent",0)})();var wc=Symbol(),xc=class{on$mutate(t,e,r,n){var s=this,i,o,l;r.observer||(r.observer=new MutationObserver(function(c){let a=new tt("mutate",{bubbles:!!t.bubble,detail:c});return a[yc](Sc),s.dispatchEvent(a)}));let h=r[vc]={};return t.subtree&&(i=t.subtree,delete t.subtree,h.subtree=!0),t.childList&&(o=t.childList,delete t.childList,h.childList=!0),t.attributes&&(l=t.attributes,delete t.attributes,h.attributes=!0),!h.attributes&&!h.childList&&(h.childList=!0),r.observer.observe(this,h),this.addEventListener("mutate",r,n),r}};(()=>{d(xc,wc,"Element",1,D)})();var Cr,Bs=Symbol();function Tc(){if(!Cr)return Cr=function(t){if(t[Bs])return;t[Bs]=!0;let e=globalThis.document.activeElement;if(e&&e.matches("input,textarea")){let r=new tt("selection",{detail:{start:e.selectionStart,end:e.selectionEnd}});return e.dispatchEvent(r)}},globalThis.document.addEventListener("selectionchange",Cr)}var Ec=Symbol(),_c=class{on$selection(t,e,r,n){return Tc(),this.addEventListener("selection",r,n),r}};(()=>{d(_c,Ec,"Element",1,D)})();var $s=Symbol.for("#string"),ti=Symbol.for("#html"),et={win:{sep:"+",name:"win",order:["meta","ctrl","mod","alt","option","shift"].reverse(),labels:{option:"alt",mod:"ctrl",meta:"win"}},mac:{sep:"",name:"mac",order:["ctrl","alt","option","shift","mod","command"].reverse(),labels:{left:"→",up:"↑",down:"↓",right:"←",plus:"+",tab:"⇥",meta:"⌘",mod:"⌘",ctrl:"⌃",option:"⌥",alt:"⌥",del:"⌦",shift:"⇧",enter:"↩",esc:"⎋",backspace:"⌫"}}};et.auto=et.win;(globalThis.navigator.platform||"").match(/iPhone|iPod|iPad|Mac/)&&(et.auto=et.mac);var Mr={};function fo(t,e="auto"){let r=""+t+":"+e;if(Mr[r])return Mr[r];let n=et[e]||et.win,s=t.split(" ").map(function(i){return i.split("+").sort(function(o,l){return n.order.indexOf(l)-n.order.indexOf(o)}).map(function(o){let l=n.labels[o]||o;return l=l[0].toUpperCase()+(l.slice(1)||"")})});return Mr[r]=s}function Nc(t,e){let r=fo(t,e),n=et[e]||et.win;return r[$s]||(r[$s]=r.map(function(s){return s.join(n.sep)}).join(" "))}function Oc(t,e){let r=fo(t,e),n=et[e]||et.win;return r[ti]||(r[ti]=r.map(function(s){return"<kbd>"+s.map(function(i){return"<kbd>"+i+"</kbd>"}).join("")+"</kbd>"}).join(" "))}var ft={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},ei={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ri={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},ni={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},re;for(Q=1;Q<20;++Q)ft[111+Q]="f"+Q;var Q;for(Q=0;Q<=9;++Q)ft[Q+96]=Q.toString();function kr(t,e,r){if(t.addEventListener){t.addEventListener(e,r,!1);return}t.attachEvent("on"+e,r)}function Fr(t,e,r){if(t.removeEventListener){t.removeEventListener(e,r,!1);return}t.detachEvent("on"+e,r)}function si(t){if(t.type=="keypress"){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return ft[t.which]?ft[t.which]:ei[t.which]?ei[t.which]:String.fromCharCode(t.which).toLowerCase()}function Ic(t,e){return t.sort().join(",")===e.sort().join(",")}function Pc(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}function Lc(t){if(t.preventDefault){t.preventDefault();return}t.returnValue=!1}function Cc(t){if(t.stopPropagation){t.stopPropagation();return}t.cancelBubble=!0}function tn(t){return t=="shift"||t=="ctrl"||t=="alt"||t=="meta"}function Mc(){if(!re){re={};for(var t in ft)t>95&&t<112||ft.hasOwnProperty(t)&&(re[ft[t]]=t)}return re}function kc(t,e,r){return r||(r=Mc()[t]?"keydown":"keypress"),r=="keypress"&&e.length&&(r="keydown"),r}function Fc(t){return t==="+"?["+"]:(t=t.replace(/\+{2}/g,"+plus"),t.split("+"))}function ii(t,e){var r,n,s,i=[];for(r=Fc(t),s=0;s<r.length;++s)n=r[s],ni[n]&&(n=ni[n]),e&&e!="keypress"&&ri[n]&&(n=ri[n],i.push("shift")),tn(n)&&i.push(n);return e=kc(n,i,e),{key:n,modifiers:i,action:e}}function mo(t,e){return t===null||t===document?!1:t===e?!0:mo(t.parentNode,e)}function j(t){var e=this;if(t=t||document,!(e instanceof j))return new j(t);e.handleKeyEvent=a,e.target=t,e._callbacks={},e._directMap={};var r={},n,s=!1,i=!1,o=!1;function l(u){u=u||{};var m=!1,g;for(g in r){if(u[g]){m=!0;continue}r[g]=0}m||(o=!1)}function h(u,m,g,f,b,S){var w,x,O=[],C=g.type;if(!e._callbacks[u])return[];for(C=="keyup"&&tn(u)&&(m=[u]),w=0;w<e._callbacks[u].length;++w)if(x=e._callbacks[u][w],!(!f&&x.seq&&r[x.seq]!=x.level)&&C==x.action&&(C=="keypress"&&!g.metaKey&&!g.ctrlKey||Ic(m,x.modifiers))){var nt=!f&&x.combo==b,V=f&&x.seq==f&&x.level==S;(nt||V)&&e._callbacks[u].splice(w,1),O.push(x)}return O}function c(u,m,g,f){e.stopCallback(m,m.target||m.srcElement,g,f)||u(m,g)===!1&&(Lc(m),Cc(m))}e._handleKey=function(u,m,g){var f=h(u,m,g),b,S={},w=0,x=!1;for(b=0;b<f.length;++b)f[b].seq&&(w=Math.max(w,f[b].level));for(b=0;b<f.length;++b){if(f[b].seq){if(f[b].level!=w)continue;x=!0,S[f[b].seq]=1,c(f[b].callback,g,f[b].combo,f[b].seq);continue}x||c(f[b].callback,g,f[b].combo)}var O=g.type=="keypress"&&i;g.type==o&&!tn(u)&&!O&&l(S),i=x&&g.type=="keydown"};function a(u){typeof u.which!="number"&&(u.which=u.keyCode);var m=si(u);if(m){if(u.type=="keyup"&&s===m){s=!1;return}e.handleKey(m,Pc(u),u)}}function p(){clearTimeout(n),n=setTimeout(l,1000)}function y(u,m,g,f){r[u]=0;function b(C){return function(){o=C,++r[u],p()}}function S(C){c(g,C,u),f!=="keyup"&&(s=si(C)),setTimeout(l,10)}for(var w=0;w<m.length;++w){var x=w+1===m.length,O=x?S:b(f||ii(m[w+1]).action);v(m[w],O,f,u,w)}}function v(u,m,g,f,b){e._directMap[u+":"+g]=m,u=u.replace(/\s+/g," ");var S=u.split(" "),w;if(S.length>1){y(u,S,m,g);return}w=ii(u,g),e._callbacks[w.key]=e._callbacks[w.key]||[],h(w.key,w.modifiers,{type:w.action},f,u,b),e._callbacks[w.key][f?"unshift":"push"]({callback:m,modifiers:w.modifiers,action:w.action,seq:f,level:b,combo:u})}e._bindMultiple=function(u,m,g){for(var f=0;f<u.length;++f)v(u[f],m,g)},e.enable=function(){kr(t,"keypress",a),kr(t,"keydown",a),kr(t,"keyup",a)},e.disable=function(){Fr(t,"keypress",a),Fr(t,"keydown",a),Fr(t,"keyup",a)},e.enable()}j.prototype.bind=function(t,e,r){var n=this;return t=t instanceof Array?t:[t],n._bindMultiple.call(n,t,e,r),n};j.prototype.unbind=function(t,e){var r=this;return r.bind.call(r,t,function(){},e)};j.prototype.trigger=function(t,e){var r=this;return r._directMap[t+":"+e]&&r._directMap[t+":"+e]({},t),r};j.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t};j.prototype.stopCallback=function(t,e){var r=this;return(" "+e.className+" ").indexOf(" mousetrap ")>-1||mo(e,r.target)?!1:e.tagName=="INPUT"||e.tagName=="SELECT"||e.tagName=="TEXTAREA"||e.isContentEditable};j.prototype.handleKey=function(){var t=this;return t._handleKey.apply(t,arguments)};j.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(ft[e]=t[e]);re=null};j.init=function(){var t=j(document);for(var e in t)e.charAt(0)!=="_"&&(j[e]=function(r){return function(){return t[r].apply(t,arguments)}}(e))};function Vt(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}function jc(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var jr=Symbol.for("#updateHotKeys"),Dc=Symbol.for("#context"),Ac=Symbol.for("#inInput"),en=Symbol.for("#inEditable"),Vc=Symbol.for("#hotkeyTarget"),po=Symbol.for("#hotkeyCombos"),Rt=Symbol.for("#hotkeyHandlers"),Tt=Symbol.for("#combos"),Rc=Symbol.for("#extendType"),rn=Symbol.for("#target"),oi=Symbol.for("#defaultPrevented"),Kc=Symbol.for("#stopPropagation"),qc=Symbol.for("#visit"),li=Symbol.for("#key"),Hc;try{Hc=(globalThis.navigator.platform||"").match(/iPhone|iPod|iPad|Mac/)}catch{}var nn={esc:!0},zc=Symbol(),go=class extends tt{αfocus(t){let e=this[Dc].element,r=e.ownerDocument;return t&&(e=e.querySelector(t)||e.closest(t)||r.querySelector(t)),e==r.body?r.activeElement!=r.body&&r.activeElement.blur():e.focus(),!0}αlocal(){return!0}αrepeat(){return!0}},Uc=go;(()=>{d(go,zc,"HotkeyEvent",0)})();var Gc=function(t,e,r){return e.tagName=="INPUT"&&(r=="down"||r=="up")?!1:e.tagName=="INPUT"||e.tagName=="SELECT"||e.tagName=="TEXTAREA"?nn[r]?(t[Ac]=!0,t[en]=!0,!1):!0:e.contentEditable&&(e.contentEditable=="true"||e.contentEditable=="plaintext-only")?nn[r]?(t[en]=!0,!1):!0:!1},Wc=Symbol(),yo=class{constructor(){this.combos={"*":{}},this.identifiers={},this.labels={},this.handler=this.handle.bind(this),this.mousetrap=null,this.hothandler=this.handle.bind(this)}addKeycodes(t){return j.addKeycodes(t)}trigger(t){var e,r;return(r=(e=this.mousetrap)==null?void 0:e.trigger)==null?void 0:r.call(e,t)}register(t,e={}){return this.mousetrap||(this.mousetrap=j(globalThis.document),this.mousetrap.stopCallback=Gc),this.combos[t]||(this.combos[t]=!0,this.mousetrap.bind(t,this.handler)),(e.capture||e.force)&&(nn[t]=!0),this}comboIdentifier(t){var e;return(e=this.identifiers)[t]||(e[t]=t.replace(/\+/g,"_").replace(/\ /g,"-").replace(/\*/g,"all").replace(/\|/g," "))}humanize(t,e="auto"){return Nc(t,e)}htmlify(t,e="auto"){return Oc(t,e)}matchCombo(t){return!0}handleEvent(t){var e,r;return(r=(e=this.mousetrap)==null?void 0:e.handleKeyEvent)==null?void 0:r.call(e,t)}handle(t,e){var r;let n=t.target&&t.target[Vc]||t.target||globalThis.document.body,s=Array.from(globalThis.document.querySelectorAll("[data-hotkey]")),i=n.ownerDocument,o=n,l=[];for(;o&&o!=i&&o.hotkeys!==!0;)o=o.parentNode;s=s.reverse().filter(function(y){let v=y[po],u=v&&v[e],m=v&&v["*"];if(!(u||m))return!1;let g=y[Rt],f=y;for(;f&&f!=i;){if(f.hotkeys===!1)return!1;if(f.hotkeys===!0&&!f.contains(n)){let b=!0;for(let S=0,w=Vt(g),x=w.length;S<x;S++){let O=w[S];(O[Tt][e]||O[Tt]["*"])&&O.globalΦ&&(b=!1)}if(b)return!1}f=f.parentNode}return!0});let h=globalThis.document.activeElement;if(s.length>1){let y=s.filter(function(u){return h.contains(u)});y.length&&(s=y);let v=s.filter(function(u){try{return!u.hiddenΦ}catch{}});v.length>0&&(s=v)}if(!s.length)return;let c={combo:e,originalEvent:t,targets:s},a=new tt("hotkey",{bubbles:!0,detail:c});a[Rc](Uc),a.originalEvent=t,a.hotkey=e,n.dispatchEvent(a);for(let y=0,v=Vt(s),u=v.length;y<u;y++){let m=v[y];for(let g=0,f=Vt(m[Rt]),b=f.length;g<b;g++){let S=f[g];if(S[Tt][e]||S[Tt]["*"]){if(S.params.local&&!S[rn].contains(n)||S.params.unobstructed&&!m.unobstructedΦ)continue;if(!t[en]||S.captureΦ||S.params.force){let w=S[rn];(o&&(o.contains(w)||w.contains(o))||S.globalΦ)&&l.push(S)}}}}let p=[];for(let y=0,v=Vt(l),u=v.length;y<u;y++){let m=v[y],g;(!t.repeat||m.params.repeat)&&(g=m.handleEvent(a));let f=m.lastState||{};if(p.push(f),(!m.passiveΦ&&f.called||a[oi])&&((r=t==null?void 0:t.preventDefault)==null||r.call(t)),!(m.passiveΦ||f.called==!1&&!a[Kc]&&!a[oi]))break}return p}},Yc=yo;(()=>{d(yo,Wc,"HotKeyManager",16)})();var Xc=new Yc,vo=function(t,e){let r=e.element;jc(r,D)&&(r.matches("input,textarea,select,option")?r.focus():r.click())};vo.passive=!0;var Jc=Symbol(),Qc=class{on$hotkey(t,e,r,n){var s=this;return this[Rt]||(this[Rt]=[]),this[Rt].push(r),r[rn]=this,t.$_||(t.$_=[vo]),t[qc]=function(){return s[jr]()},this[jr](),r}[jr](){let t={};for(let e=0,r=Vt(this[Rt]),n=r.length;e<n;e++){let s=r[e],i=s.params,o=i.options[0];if(s[li]!=o&&(s[li]=o,!0)){s[Tt]={};for(let l=0,h=Vt(o.split("|")),c=h.length;l<c;l++){let a=h[l];Xc.register(a,i),s[Tt][a]=!0}}Object.assign(t,s[Tt])}return this[po]=t,this.dataset.hotkey=Object.keys(t).join(" "),this}};(()=>{d(Qc,Jc,"Element",1,D)})();var zt=typeof Reflect=="object"?Reflect:null,hi=zt&&typeof zt.apply=="function"?zt.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},qe;zt&&typeof zt.ownKeys=="function"?qe=zt.ownKeys:Object.getOwnPropertySymbols?qe=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:qe=function(t){return Object.getOwnPropertyNames(t)};function Zc(t){console&&console.warn&&console.warn(t)}var bo=Number.isNaN||function(t){return t!==t};function E(){E.init.call(this)}E.EventEmitter=E;E.prototype._events=void 0;E.prototype._eventsCount=0;E.prototype._maxListeners=void 0;var ai=10;function rr(t){if(typeof t!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(E,"defaultMaxListeners",{enumerable:!0,get:function(){return ai},set:function(t){if(typeof t!="number"||t<0||bo(t))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ai=t}});E.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};E.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||bo(t))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function So(t){return t._maxListeners===void 0?E.defaultMaxListeners:t._maxListeners}E.prototype.getMaxListeners=function(){return So(this)};E.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n=t==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var i;if(e.length>0&&(i=e[0]),i instanceof Error)throw i;var o=Error("Unhandled error."+(i?" ("+i.message+")":""));throw o.context=i,o}var l=s[t];if(l===void 0)return!1;if(typeof l=="function")hi(l,this,e);else for(var h=l.length,c=_o(l,h),r=0;r<h;++r)hi(c[r],this,e);return!0};function wo(t,e,r,n){var s,i,o;if(rr(r),i=t._events,i===void 0?(i=t._events=Object.create(null),t._eventsCount=0):(i.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),o=i[e]),o===void 0)o=i[e]=r,++t._eventsCount;else if(typeof o=="function"?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),s=So(t),s>0&&o.length>s&&!o.warned){o.warned=!0;var l=Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,Zc(l)}return t}E.prototype.addListener=function(t,e){return wo(this,t,e,!1)};E.prototype.on=E.prototype.addListener;E.prototype.prependListener=function(t,e){return wo(this,t,e,!0)};function Bc(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function xo(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},s=Bc.bind(n);return s.listener=r,n.wrapFn=s,s}E.prototype.once=function(t,e){return rr(e),this.on(t,xo(this,t,e)),this};E.prototype.prependOnceListener=function(t,e){return rr(e),this.prependListener(t,xo(this,t,e)),this};E.prototype.removeListener=function(t,e){var r,n,s,i,o;if(rr(e),n=this._events,n===void 0)return this;if(r=n[t],r===void 0)return this;if(r===e||r.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(s=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,s=i;break}if(s<0)return this;s===0?r.shift():$c(r,s),r.length===1&&(n[t]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",t,o||e)}return this};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){var e,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var s=Object.keys(r),i;for(n=0;n<s.length;++n)i=s[n],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=r[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this};function To(t,e,r){var n=t._events;if(n===void 0)return[];var s=n[e];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?td(s):_o(s,s.length)}E.prototype.listeners=function(t){return To(this,t,!0)};E.prototype.rawListeners=function(t){return To(this,t,!1)};E.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Eo.call(t,e)};E.prototype.listenerCount=Eo;function Eo(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}E.prototype.eventNames=function(){return this._eventsCount>0?qe(this._events):[]};function _o(t,e){for(var r=Array(e),n=0;n<e;++n)r[n]=t[n];return r}function $c(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function td(t){for(var e=Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Dr(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Ar=Symbol.for("#getQueryParam"),ui=Symbol.for("#setQueryParam"),ci=Symbol.for("#query"),ed=Symbol(),le=class{static parse(t,e){return Dr(t,le)?t:new le(t,e)}constructor(t,e){this.router=e,this.parse(t)}parse(t){var e;let r;return Dr(t,URL)||(t=new URL(t,this.router.origin)),(r=(e=this.router)==null?void 0:e.aliases[t.pathname])&&(t.pathname=r),this.url=t,this}get activeΦ(){return this.router.location==this}reparse(){return this.parse(this.url)}get searchParams(){return this.url.searchParams}search(){let t=this.searchParams?this.searchParams.toString():"";return t?"?"+t:""}update(t){if(Dr(t,Object))for(let e=0,r=Object.keys(t),n=r.length,s,i;e<n;e++)s=r[e],i=t[s],this.searchParams.set(s,i);else typeof t=="string"&&this.parse(t);return this}clone(){return new le(this.url.href,this.router)}equals(t){return this.toString()==String(t)}get href(){return this.url.href}get path(){return this.url.href.slice(this.url.origin.length)}get pathname(){return this.url.pathname}get query(){return this[ci]||(this[ci]=new Proxy({},{get:this[Ar].bind(this),set:this[ui].bind(this)}))}toString(){return this.href}[Ar](t,e){return this.searchParams.get(e)}[ui](t,e,r){var n;let s=(n=this[Ar](t,e))!=null?n:"";return r=r!=null?r:"",s!=r&&(r==null||r==""?this.searchParams.delete(e):this.searchParams.set(e,r),this.activeΦ&&(this.router.history.replaceState({},null,this.path),this.router.touch())),!0}},He=le;(()=>{d(le,ed,"Location",16)})();function di(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function rd(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}function Sn(){return function(){return!0}}var nd=Symbol(),he=class{constructor(t,e=""){this.store=t||{},this.cache={raw:{},rich:{}},this.ns=e,this.local=t==globalThis.sessionStorage,this.children=new Map}serialize(t,e){return JSON.stringify(t)}deserialize(t,e){return JSON.parse(t)}getItem(t){let e=String(this.ns)+":"+t;if(di(this.store,he))return this.store.getItem(e);if(this.local&&this.cache.rich[e]!=null)return this.cache.rich[e];let r=this.store.getItem(e);if(r!=null)return this.cache.raw[e]==r?this.cache.rich[e]:(this.cache.raw[e]=r,this.cache.rich[e]=this.deserialize(r,e))}setItem(t,e){var r,n;let s=String(this.ns)+":"+t;if(di(this.store,he))return this.store.setItem(s,e);let i=this.cache.rich[s],o=typeof e;if(this.local&&(this.cache.rich[s]=e),i!==e||o=="object"){let l=this.store.getItem(s);if(e==null)return this.store.removeItem(s),r=this.cache.rich[s],delete this.cache.rich[s],n=this.cache.raw[s],delete this.cache.raw[s],P();{let h=this.serialize(e,s);if(this.cache.rich[s]=e,this.cache.raw[s]=h,l!=h)return this.store.setItem(s,h),P()}}}removeItem(t){var e;let r=String(this.ns)+":"+t;return e=this.cache[r],delete this.cache[r],this.store.removeItem(r)}get(t,e,r){return this.getItem(e)}set(t,e,r,n){return this.setItem(e,r),!0}apply(t,e,[r]){let n=this.children.get(r);return n||this.children.set(r,n=new Proxy(Sn(),new he(this,r))),n}deleteProperty(t,e){return this.removeItem(e),!0}ownKeys(t){let e=["prototype"],r=this.ns+":";for(let n=0,s=rd(Object.keys(this.store)),i=s.length;n<i;n++){let o=s[n];o.indexOf(r)==0&&e.push(o.slice(r.length))}return e}},No=he;(()=>{d(he,nd,"Storage",16)})();var Bf=new Proxy(Sn(),new No(globalThis.localStorage)),sd=new Proxy(Sn(),new No(globalThis.sessionStorage));function id(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Bt=Symbol.for("#states"),fi=new WeakMap,od=Symbol(),Oo=class{static from(t,e){return e?new this(t,e):null}constructor(t,e,r=!1){fi.set(this,t),this.path=e.path,this.data=e.data||{},this.index=e.index,this.type=e.type,this.local=r}get history(){return fi.get(this)}get next(){return this.history.at(this.index+1)}get prev(){return this.history.at(this.index-1)}toJSON(){return{path:this.path,data:this.data,index:this.index,type:this.type}}save(){return this.history.cache[this.index]=this,this}toString(){return""+this.history.id+"|"+this.index}},Vr=Oo;(()=>{d(Oo,od,"State",16)})();var ld=Symbol(),Io=class{constructor(t){this.router=t,this.store=sd("router"),this[Bt]=[],this.cache={},this.index=-1;let e=globalThis.history.state,r;if(typeof e=="string"){let n=e.split("|");this.id=parseInt(n[0]),this.index=parseInt(n[1]),this.cache=this.store(this.id)}else this.id=this.store.id=(this.store.id||0)+1,this.cache=this.store(this.id);this.index==-1&&this.replaceState({initial:!0},null,t.path)}get length(){return this.cache.length}get state(){return this.at(this.index)}get states(){let t=this.length,e=0;for(;e<t;)this.at(e++);return this[Bt]}get currentStates(){return this.states.slice(0,this.length)}get next(){return this.state.next}get prev(){return this.state.prev}slice(t,e=this.length){let r=[];for(;t<e;)r.push(this.at(t++));return r}at(t){var e;if(!(t>=this.length))return(e=this[Bt])[t]||(e[t]=Vr.from(this,this.cache[t]))}buildState(t,e,r=!0){let n={data:t,index:this.index+1,path:e||this.router.path,type:r?"push":"replace"};return new Vr(this,n,!0)}pushState(t,e,r,n=!0){return id(t,Vr)||(t=this.buildState(t,r,n)),this.index=t.index,this.cache[this.index]=t,this[Bt][this.index]=t,this[Bt].length=this.cache.length=Math.max(t.index+1,0),globalThis.history[n?"pushState":"replaceState"](String(t),e||null,t.path),this}replaceState(t,e,r){return this.pushState(t,e,r,!1)}},hd=Io;(()=>{d(Io,ld,"History",16)})();var ad=Symbol(),Po=class{constructor(t,e,r,n){this.params=n,this.router=t,e&&(this.location=He.parse(e),this.original=this.location.clone()),this.referrer=r}get apply(){return this.params.apply||[]}get revert(){return this.params.revert||[]}get state(){return this.params.state}get mode(){return this.params.mode}redirect(t){var e,r;return(r=(e=this.location)==null?void 0:e.update)==null||r.call(e,t),this}get path(){var t;return(t=this.location)==null?void 0:t.path}get url(){var t,e;return(e=(t=this.location)==null?void 0:t.toString)==null?void 0:e.call(t)}set path(t){this.location.path=t}abort(t=!1){return this.aborted=!0,t&&(this.forceAbort=t),this}match(t){return this.location?this.router.route(t).match(this.path):null}},mi=Po;(()=>{d(Po,ad,"Request",16)})();function pi(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Ze=Symbol.for("#routes"),Rr=Symbol.for("#match"),ud=Symbol.for("#symbol"),gi=Symbol.for("#matches"),Kr=new Map,qr={},yi={},cd=/.*/;function dd(t){if(!Kr.has(t)){let e=new Map;return Kr.set(t,e),e}return Kr.get(t)}function fd(t,e){let r=dd(t);if(!r.has(e)){let n=Object.create(t);return Object.assign(n,e),r.set(e,n),n}return r.get(e)}var md=Symbol(),Lo=class{},pd=Lo;(()=>{d(Lo,md,"Match",0)})();function gd(t){if(qr[t])return qr[t];let e=qr[t]={url:t},r=t.indexOf("?"),n=t.indexOf("#");if(n>=0&&(e.hash=t.slice(n+1),t=e.url=t.slice(0,n)),r>=0){let s=e.query=t.slice(r+1);t=t.slice(0,r),e.query=yi[s]||(yi[s]=new URLSearchParams(s))}return e.path=t,e}var yd=Symbol(),Co=class{constructor(t){this.router=t,this.fullPath="",this[Ze]={},this[Rr]=new pd,this[Rr].path=""}route(t){var e;return(e=this[Ze])[t]||(e[t]=new Sd(this.router,t,this))}match(){return this[Rr]}resolve(t){return"/"}},vd=Co;(()=>{d(Co,yd,"RootRoute",16)})();var bd=Symbol(),wn=class{constructor(t,e,r){this.parent=r||t.rootRoute,this.router=t,this.status=200,this.path=e,this[ud]=Symbol(),this[gi]={},this[Ze]={}}route(t){var e;return(e=this[Ze])[t]||(e[t]=new wn(this.router,t,this))}get fullPath(){return""+this.parent.fullPath+"/"+this.$path}load(t){return this.router.queue.add(t)}set path(t){var e=this;if(this.$path==t)return;if(this.raw=t,this.$path=t,this.groups=[],this.cache={},this.dynamic=!1,t.indexOf("?")>=0){let n=t.split("?");t=n.shift(),this.query={};for(let s=0,i=pi(n.join("?").split("&")),o=i.length;s<o;s++){let l=i[s];if(!l)continue;let[h,c]=l.split("=");h[0]=="!"&&(this.dynamic=!0,h=h.slice(1),c=!1),c===""&&(c=!1),c&&c[0]==":"&&(this.dynamic=!0),this.query[h]=c||c!==!1}}if(t=t.replace(/\:(\w+|\*)(\.)?/g,function(n,s,i){e.dynamic=!0,s!="*"&&e.groups.push(s);let o=e.router.matchers[s]||(i?"([^/#.?]+)":"([^/#?]+)");return i?""+o+".":o}),t==""&&this.query)return;if(t=="*")return this.regex=cd,this;t="^"+t;let r=t[t.length-1];(r=="$"||r=="/")&&(t=t.slice(0,-1)+"(?=/?[#?]|/?$)"),r!="/"&&r!="$"&&t!="^/"&&(t=t+"(?=[/#?]|$)"),this.regex=new RegExp(t)}match(t=this.router.path){var e,r,n;let s,i=this.parent.match(t);if(!i)return null;let o=gd(t),l=o.url,h="";if(i.path&&o.path.indexOf(i.path)==0&&(h=i.path+"/",l=l.slice(h.length)),s=this.regex?l.match(this.regex):[""]){let c=h+s[0],a=[this.$path],p={};if(this.groups.length)for(let u=0,m=pi(s),g=m.length,f;u<g;u++){let b=m[u];(f=this.groups[u-1])&&(p[f]=b,a.push(b))}if(this.query)for(let u=this.query,m=0,g=Object.keys(u),f=g.length,b,S;m<f;m++){b=g[m],S=u[b];let w=b,x=(r=(e=o.query)==null?void 0:e.get)==null?void 0:r.call(e,b);if(S===!1){if(x)return null;a.push("1");continue}if(S[0]==":"&&(w=S.slice(1),S=!0),S==!0&&x||S==x)p[w]=x,a.push(x);else return null}let y=a.join("*");p=(n=this[gi])[y]||(n[y]=p);let v=fd(i,p);return v.path=c,v}return null}resolve(t=this.router.path){if(this.raw[0]=="/"&&!this.dynamic)return this.raw.replace(/\$/g,"");let e=this.parent.match(t),r=this.parent.resolve(t),n;if(this.dynamic){let s=this.match(t);return s?s.path:null}return this.raw[0]=="?"?n=(r||"/")+this.raw:n=r+"/"+this.raw,n.replace(/\$/g,"").replace(/\/\/+/g,"/")}},Sd=wn;(()=>{d(wn,bd,"Route",16)})();function Mo(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var sn=Symbol.for("#enter"),on=Symbol.for("#resolved"),Be=Symbol.for("#leave"),vi=Symbol.for("#afterVisitRouted"),bi=Symbol.for("#afterVisitRouteTo"),jt=Symbol.for("#doc"),ht=Symbol.for("#version"),wd=Symbol.for("#routes"),Si=Symbol.for("#origin"),Hr=Symbol.for("#request"),$t=Symbol.for("#hash"),K=Symbol.for("#routeTo"),te=Symbol.for("#path"),X=Symbol.for("#match"),ae=Symbol.for("#options"),xd=Symbol.for("#cache"),wi=Symbol.for("#unmatched"),dt=Symbol.for("#active"),Td=Symbol.for("#resolvedPath"),Ed=Symbol.for("#dataKey"),_d=Symbol.for("#activeKey"),ue=Symbol.for("#urlKey"),Dt=Symbol.for("#dataMap"),At=Symbol.for("#href"),F=Symbol.for("#route"),xi=Symbol.for("#context"),Ti=Symbol.for("#afterVisit"),Ei=Symbol.for("#routeHandler"),Nd=Symbol.for("#parentNode"),Od=Symbol.for("#visitContext"),_i=Symbol.for("##visitContext"),Id=Symbol.for("#attachToParent"),Pd=Symbol.for("#detachFromParent"),Ni=Symbol.for("#router");var $f=Rl(function(){return globalThis.document.router}),Ld=Symbol(),ko=class extends E{constructor(t,e={}){super(),this[jt]=t,this[ht]=0,this[wd]={},this.aliases={},this.redirects={},this.rules={},this.matchers={},this.options=e,this.busy=[],this.queue=new eh,this.root=new vd(this),this.location=new He(e.url||t.location.href,this),this.history=new hd(this),this.mode=e.mode||"history",this.queue.on("busy",function(){return globalThis.document.flags.incr("_routing_")}),this.queue.on("idle",function(){return globalThis.document.flags.decr("_routing_"),P()}),this.setup()}get origin(){return this[Si]||(this[Si]=this[jt].location.origin)}get query(){return this.location.query}init(){return this.refresh({mode:"replace"}),this}alias(t,e){return this.aliases[t]=e,this.location.reparse(),this}touch(){return this[ht]++}option(t,e){return e==null?this.options[t]:(this.options[t]=e,this)}get realpath(){let t=this[jt].location;return t.href.slice(t.origin.length)}get state(){return this.history.state}get states(){return this.history.currentStates}set state(t){this.state.data=t,this.state.save()}get ctx(){return this[Hr]}pushState(t,e,r){return this.history.pushState(t,e||null,String(r))}replaceState(t,e,r){return this.history.replaceState(t,e||null,String(r))}refresh(t={}){var e=this;if(this.refreshing)return;this.refreshing=!0;let r=this.location,n=He.parse(t.location||this.realpath,this),s=t.mode,i=this[Hr];if(!n.equals(r)||!i||t.state){let o=new mi(this,n,r,t);this[Hr]=o,this.emit("beforechange",o),o.aborted&&(!o.forceAbort&&globalThis.window.confirm("Are you sure you want to leave? You might have unsaved changes")?o.aborted=!1:s=="pop"?this.pushState(this.state,null,String(r)):s=="replace"&&this.replaceState(this.state,null,String(r))),o.aborted||(this.location=o.location,s=="push"?this.pushState(o.state,null,String(this.location)):s=="replace"?this.replaceState(o.state,null,String(this.location)):s=="pop"&&(this.history.index=t.index),this.refreshing=!1,this.emit("change",o),this.touch(),P())}return M.add(function(){let o=e[jt].location.hash;if(o!=e[$t])return e.emit("hashchange",e[$t]=o)}),this.refreshing=!1,this}onpopstate(t){let e=this.history.index,r=e,n={pop:!0,index:0,from:e,mode:"pop"};try{if(typeof t.state=="string"){let[s,i]=t.state.split("|");r=n.index=parseInt(i),r<e?n.revert=this.history.slice(r+1,e+1).reverse():r>e&&(n.apply=this.history.slice(e+1,r+1))}}catch{}return this.refresh(n),this}onbeforeunload(t){let e=new mi(this,null,this.location,{mode:"unload"});if(this.emit("beforechange",e),e.aborted)return!0}onhashchange(t){return this.emit("hashchange",this[$t]=this[jt].location.hash),P()}setup(){this.onclick=this.onclick.bind(this),this.onhashchange=this.onhashchange.bind(this);let t=globalThis.window;return this[$t]=this[jt].location.hash,this.location=He.parse(this.realpath,this),t.onpopstate=this.onpopstate.bind(this),t.onbeforeunload=this.onbeforeunload.bind(this),t.addEventListener("hashchange",this.onhashchange),t.addEventListener("click",this.onclick,{capture:!0}),t.document.documentElement.emit("routerinit",this),this.refresh,this}onclick(t){if(t.metaKey||t.altKey)return;let e=null,r=null,n=t.target;for(;n&&(!e||!r);)!e&&n.nodeName=="A"&&(e=n),!r&&n[K]&&(r=n),n=n.parentNode;if(e&&r!=e&&(!r||r.contains(e))){let s=e.getAttribute("href");s&&!s.match(/\:\/\//)&&(!e.getAttribute("target")||e.getAttribute("target")=="_self")&&!e.classList.contains("external")&&e.addEventListener("click",this.onclicklink.bind(this),{once:!0})}return!0}onclicklink(t){let e=t.currentTarget||t.target;e[K]&&e[K].resolve();let r=e.getAttribute("href"),n=new URL(e.href),s=n.href.slice(n.origin.length),i=this.realpath.split("#")[0],o=s.split("#")[0];return i==o?globalThis.document.location.hash=n.hash:e[K]?e[K].go():this.go(s),t.stopPropagation(),t.preventDefault()}get url(){return this.location.url}get path(){let t=this.location.path;return this.aliases[t]||t}get pathname(){return this.location.pathname}serializeParams(t){var e;if(Mo(t,Object)){e=[];for(let r=0,n=Object.keys(t),s=n.length,i,o;r<s;r++)i=n[r],o=t[i],e.push([i,globalThis.encodeURI(o)].join("="));return e.join("&")}return t||""}get hash(){return this[$t]}set hash(t){let e="#"+this.serializeParams(t);globalThis.history.replaceState(this.state,null,e)}match(t){return this.route(t).match(this.path)}route(t){return this.root.route(t)}go(t,e=null){if(typeof t=="object"&&e===null&&(e=t,t=this.path),typeof t=="number")return globalThis.history.go(t),this;let r=this.location.clone().update(t),n=this.history.buildState(e,r.path,!0);return this.refresh({push:!0,mode:"push",location:r,state:n,apply:[n]}),this}replace(t,e=null){typeof t=="object"&&e===null&&(e=t,t=this.path);let r=this.location.clone().update(t),n=this.history.buildState(e,r.path,!1);return this.refresh({replace:!0,mode:"replace",location:r,state:n,apply:[n]})}},Cd=ko;(()=>{d(ko,Ld,"Router",16)})();var Md=Symbol(),Fo=class{constructor(t,e,r,n={}){this.parent=r,this.node=t,this[te]=e,this[X]=null,this[ae]=n,this[xd]={},this[wi]={},this[dt]=null,this[Td]=null,this[Ed]=Symbol(),this[_d]=Symbol(),this[ue]=Symbol()}get router(){return this.node.ownerDocument.router}get route(){return(this.parent?this.parent.route:this.router).route(this[te])}get match(){return this[X]}get params(){return this[X]||this[wi]}get state(){let t=this[Dt]||(this[Dt]=new Map),e=this.params,r=this[Dt].get(e);return r||this[Dt].set(e,r={}),r}set state(t){(this[Dt]||(this[Dt]=new Map)).set(this.params,t)}set path(t){this[te]!=t&&(this[te]=t,!0)&&this.router.touch()}get path(){return this[te]}get isActive(){return!!this[dt]}get activeΦ(){return!!this[dt]}resolve(){let t=this.router[ht];if(!(this[ht]!=t&&(this[ht]=t,!0)))return;let e=this.route,r=this[ae],n=this.router.path,s=e.match(n),i=this[dt],o=this[X],l=s!=o,h=s&&s[this[ue]];return s&&(this[dt]=!0,this[X]=s,s[this[ue]]=n),s&&(l||h!=n||!i)&&this[on](s,o,h),!i&&s&&this[sn](),!s&&(i||i===null)&&(this[dt]=!1,this[Be]()),this[X]}[sn](){var t,e;return this.node.flags.remove("not-routed"),this.node.flags.add("routed"),(e=(t=this.node)==null?void 0:t.routeDidEnter)==null?void 0:e.call(t,this)}[on](t,e,r=""){var n,s;return(s=(n=this.node)==null?void 0:n.routeDidResolve)==null?void 0:s.call(n,this,t,e,r)}[Be](){var t,e;return this.node.flags.add("not-routed"),this.node.flags.remove("routed"),(e=(t=this.node)==null?void 0:t.routeDidLeave)==null?void 0:e.call(t,this)}},jo=Fo;(()=>{d(Fo,Md,"ElementRoute",16)})();var kd=Symbol(),Do=class extends jo{[sn](){return this}[on](){return this}[Be](){return this}resolve(){let t=this.router[ht];if(!(this[ht]!=t&&(this[ht]=t,!0)))return;let e=this[ae],r=this.route,n=this.router.path,s=this.route.resolve(n),i=this.route.match(n);i&&(this[X]=i,this[X][this[ue]]=n),e.sticky&&this[X]&&(s=this[X][this[ue]]),this[At]!=s&&(this[At]=s,!0)&&this.node.nodeName=="A"&&this.node.setAttribute("href",s),this.node.flags.toggle("active",!!i)}get url(){return this.resolve(),globalThis.location.origin+this[At]}go(){return this.resolve(),this[ae]&&this[ae].replace?this.router.replace(this[At]):this.router.path==this[At]?!0:this.router.go(this[At])}},Fd=Do;(()=>{d(Do,kd,"ElementRouteTo",0)})();var jd=Symbol(),Dd=class{get router(){return this.ownerDocument.router}};(()=>{d(Dd,jd,"Node",1,Node)})();var Ad=Symbol(),Vd=class{set route(t){if(t==null)return;if(this[F]){this[F].path=t;return}let e=t[0]!="/"?this[xi].route:null;this[F]=new jo(this,t,e,this.route__),this[Ti]=this[vi]}get route(){return this[F]}set routeΞto(t){var e=this;if(t==null)return;if(this[K]){this[K].path=t;return}let r=t[0]!="/"?this[xi].route:null;this[F]=this[K]=new Fd(this,t,r,this.routeTo__),this[Ti]=this[bi],this.onclick=function(n){if(!n.altKey&&!n.metaKey&&!n[Ei])return n.preventDefault(),n[Ei]=e[K],e[K].go()}}[vi](){if(this[F]){let t=this[Nd],e=t&&t[Od];if(e&&e.matchedRoute&&e.matchedRoute!=this[F]){this[F][dt]!=!1&&(this[F][dt]=!1,!0)&&(this[F][Be](),this[F][ht]=-1);return}if(this[F].resolve(),this[F].activeΦ)e.matchedRoute=this[F];else return}if(this.visit&&this.visit(),this[_i])return this[_i]=null}[bi](){if(this[K]&&this[K].resolve(),this.visit)return this.visit()}routeDidEnter(t){return this[Id]()}routeDidLeave(t){return this[Pd]()}routeDidResolve(t,e,r){var n=this;Mo(this.routed,Function)&&e!=r&&this.router.queue.add(async function(){n.suspend();let s=await n.routed(e,t.state,r);return n.unsuspend()})}};(()=>{d(Vd,Ad,"Element",1,Element)})();var Rd=Symbol(),Kd=class{get router(){return this[Ni]||(this[Ni]=new Cd(this))}};(()=>{d(Kd,Rd,"Document",1,Document)})();function $(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var nr=Symbol.for("##reactive"),Et=Symbol.for("##referenced"),fe=Symbol.for("##dereferenced"),Fe=Symbol.for("#map"),Oi=Symbol.for("#__init__"),je=Symbol.for("#child"),qd=Symbol.for("##spy"),ee=Symbol.for("#reactions"),zr=Symbol.for("#promise"),_={TOUCHING:2,STALE:4,OBJECT:8,RUNNING:16,INVALIDATING:32,POSSIBLY_STALE:64,AUTORUN:128,DEACTIVATED:256},I=0;var ln=null,Hd=0,Ao=1,Vo={META:new Map,VALUE:new Map,REF:new Map},Z,ze={root:null,ctx:null,get context(){return T},get atomics(){return ln},get ownref(){return pt},flush(){if(T==Z)return Z.flush()}},pt=Symbol.for("~");var Ro=function(t,e){return e.has(t)||e.set(t,Symbol()),e.get(t)},Ko=function(t){return typeof t=="symbol"?Ro(t,Vo.VALUE):Symbol.for(t)};var xn=function(t){return typeof t=="symbol"?Ro(t,Vo.REF):Symbol.for("~"+t)},N=function(t,e){return I&&T.add(t[pt]),e},q=function(t,e){return t[pt].$$invalidated(0),e},Ut=function(t,e,r){let n=t[pt];return n||(n=t[pt]=new Wo,Object.defineProperties(t,r)),e&&n.addSubscriber(e),t},Tn=function(t,e){let r=t[pt];return r&&r.removeSubscriber(e),t},zd=Symbol(),qo=class{constructor(t){this.changes=new Map,this.cleanup(),t&&this.reset(t)}reset(t=[]){return this.array=t,this.initialLength=t.length}cleanup(){return this.idx=0,this.array=null,this.changes.clear(),this.dirty=!1}push(t){if(this.initialLength==0){this.array.indexOf(t)<0&&(this.changes.set(t,1),this.array.push(t),this.idx++);return}let e=this.idx,r=this.array[e];if(r===t)++this.idx;else{if(e>0&&this.array[e-1]===t)return;let n=this.array.indexOf(t),s=this.changes.get(t);if(n===-1)this.array.splice(e,0,t),this.changes.set(t,1),this.idx++;else{if(n<e)return;n===e+1?(r&&this.changes.set(r,-1),this.array.splice(e,1),++this.idx):(n>e&&this.array.splice(n,1),this.array.splice(e,0,t))}s==-1&&this.changes.delete(t)}}end(){if(this.array.length>=this.idx)for(;this.array.length>this.idx;)this.changes.set(this.array.pop(),-1);return this.array}patch(){return this.end()}},Ud=qo;(()=>{d(qo,zd,"ArrayPatcher",16)})();function En(t){var e,r;let n=Object.getOwnPropertyDescriptors(t.prototype);return e=n.name,delete n.name,r=n.constructor,delete n.constructor,n}var Gd=Symbol(),_n=class{constructor(t,e=0){this.depth=e,this.parent=t,this.target=null,this.spy=null,this.patcher=new Ud}get activeΦ(){return T==this}get rootΦ(){return this==Z}get snapshot(){let t=[],e=this[je];for(;e&&e.target;)t.push({depth:e.depth,target:e.target,beacon:e.beacon}),e=e[je];return t}reset(t){var e,r;this.target=t,this.beacon=t.beacon;let n=this.spy=t[qd];return this.tracking=n&&(e=n.tracking)!=null?e:!0,this.patcher.reset(t.observing||(t.observing=[])),n&&((r=n==null?void 0:n.enter)==null||r.call(n,this)),this}add(t,e){var r,n;this.tracking&&t&&this.beacon&&this.patcher.push(t),this.spy&&((n=(r=this.spy)==null?void 0:r.observed)==null||n.call(r,this,t,e))}react(t){var e,r;return this.spy&&((r=(e=this.spy)==null?void 0:e.react)==null||r.call(e,this,t)),Z.reactions.add(t)}push(t){return ze.ctx=T=this.child.reset(t)}pop(){var t,e;let r=null;if(this.beacon){r=this.patcher.end();let n=this.patcher.changes;if(n.size)for(let[s,i]of $(n))i===1?s.addSubscriber(this.beacon):s.removeSubscriber(this.beacon)}return this.spy&&((e=(t=this.spy)==null?void 0:t.leave)==null||e.call(t,this)),this.patcher.cleanup(),this.target=this.beacon=null,T=this.parent,T==Z?(Z.flush(),ze.ctx=null):ze.ctx=T,r}get child(){return this[je]||(this[je]=new _n(this,this.depth+1))}get reactions(){return this[ee]||(this[ee]=new Set)}flush(){if(!this[ee])return;let t=this[ee];this[ee]=null;for(let e of $(t))e.call()}},Wd=_n;(()=>{d(_n,Gd,"Context",16)})();var Yd=Symbol(),Ho=class extends Wd{add(){return!0}},Xd=Ho;(()=>{d(Ho,Yd,"Root",0)})();var T=Z=ze.root=new Xd(null,0),Jd=function(){return T.tracking=!1},zo=function(t,e,r,n,s){let i=t[r],o=t[s];return o||(o=t[s]=new Wo(n,e,i)),T.add(o,t),i},Uo=function(t,e,r,n,s,i){let o=t[r];if(n!=o){t[r]=n;let l=t[i];l&&l.changed(0,n,o)}},Qd=Symbol(),Go=class{constructor(t,e,r){return this.id=Ao++,this.observer=null,this.observers=null,this.v=0,this.o=t||null,r&&r[Et]&&r[Et](this),this}get $$v(){return this.v}changed(t,e,r){if(Hd++,this.v++,r&&r[fe]&&r[fe](this,e),e&&e[Et]&&e[Et](this,r),this.observer&&this.observer.$$invalidated(t+1,this,e,r),this.observers)for(let n of $(this.observers))n.$$invalidated(t+1,this,e,r);T==Z&&T.flush()}invalidated(t,e){return console.warn("Ref.invalidated is deprecated - use $$invalidated"),this.$$invalidated(t,e)}$$invalidated(t,e){if(ln)return ln.add(this),!0;if(this.v++,t>30){console.warn("Ref observer chain too deep",this,e);return}if(this.observer&&this.observer.$$invalidated(t+1,this),this.observers)for(let r of $(this.observers))r.$$invalidated(t+1,this);return t==0&&T==Z&&T.flush(),!0}addSubscriber(t){this.observer?(this.observers||(this.observers=new Set),this.observers.add(t)):this.observer=t}removeSubscriber(t){this.observer==t&&(this.observer=null);let e=this.observers;e&&e.delete(t)}reportChanged(){return this.changed(0)}reportObserved(t){return T.add(this,t)}},Wo=Go;(()=>{d(Go,Qd,"Ref",16)})();var Zd=Symbol(),Yo=class extends Array{push(){return q(this,super.push(...arguments))}pop(){return q(this,super.pop(...arguments))}unshift(){return q(this,super.unshift(...arguments))}shift(){return q(this,super.shift(...arguments))}splice(){return q(this,super.splice(...arguments))}at(){return N(this,super.at(...arguments))}map(){return N(this,super.map(...arguments))}flatMap(){return N(this,super.flatMap(...arguments))}flat(){return N(this,super.flat(...arguments))}filter(){return N(this,super.filter(...arguments))}find(){return N(this,super.find(...arguments))}slice(){return N(this,super.slice(...arguments))}sort(){return N(this,super.sort(...arguments))}get len(){return N(this,this.length)}set len(t){this.length=t,q(this)}toIterable(){return I&&T.add(this[pt]),this}[Symbol.iterator](){return N(this,super[Symbol.iterator](...arguments))}},Bd=Yo;(()=>{d(Yo,Zd,"ObservableArray",8)})();var Ii=En(Bd),$d=Symbol(),tf=class{get len(){return this.length}set len(t){this.length=t}get[nr](){return Ut(this,null,Ii)}[Et](t){return Ut(this,t,Ii)}[fe](t){return Tn(this,t)}};(()=>{d(tf,$d,"Array",1,Array)})();var Pi=Set.prototype.has,ef=Symbol(),Xo=class extends Set{has(){return N(this,super.has(...arguments))}keys(){return N(this,super.keys(...arguments))}values(){return N(this,super.values(...arguments))}entries(){return N(this,super.entries(...arguments))}add(t){return Pi.call(this,t)?this:q(this,super.add(...arguments))}delete(t){return Pi.call(this,t)?q(this,super.delete(...arguments)):this}clear(){return this.size?q(this,super.clear(...arguments)):this}},rf=Xo;(()=>{d(Xo,ef,"ObservableSet",8)})();var Li=En(rf),nf=Symbol(),sf=class{get[nr](){return Ut(this,null,Li)}[Et](t){return Ut(this,t,Li)}[fe](t){return Tn(this,t)}};(()=>{d(sf,nf,"Set",1,Set)})();var of=Symbol(),Jo=class extends Map{get(){return N(this,super.get(...arguments))}has(){return N(this,super.has(...arguments))}keys(){return N(this,super.keys(...arguments))}values(){return N(this,super.values(...arguments))}entries(){return N(this,super.entries(...arguments))}set(){return q(this,super.set(...arguments))}clear(){return q(this,super.clear(...arguments))}delete(){return q(this,super.delete(...arguments))}},lf=Jo;(()=>{d(Jo,of,"ObservableMap",8)})();var Ci=En(lf),hf=Symbol(),af=class{get[nr](){return Ut(this,null,Ci)}[Et](t){return Ut(this,t,Ci)}[fe](t){return Tn(this,t)}};(()=>{d(af,hf,"Map",1,Map)})();var uf=Symbol(),cf=class{constructor(t,e={}){var r,n=this;this.name=t,this.options=e;let s=this.key=Ko(t),i=xn(t),o=this.descriptor={enumerable:(r=e.enumerable)!=null?r:!0,configurable:!1,get:function(){return I?zo(this,t,s,n,i):this[s]},set:function(h){return I||!!this[i]?Uo(this,t,s,h,n,i):this[s]=h}},l=this.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){return I?(Object.defineProperty(this,t,o),this[t]):this[s]},set:function(h){return this[s]=h,this[i]=null,Object.defineProperty(this,t,o)}}}};(()=>{d(cf,uf,"PropertyType",16)})();var df=Symbol(),Qo=class{constructor(t=null){this[Oi](t)}[Oi](t=null,e=!0,r=!0){var n;this[Fe]=t&&(n=t[Fe])!==void 0?n:new Map}for(t){let e=this[Fe].get(t);return e||this[Fe].set(t,e=[]),e}get(t){let e=this.for(t);return e[pt]||e[nr],I&&N(e),e}add(t,e){return this.for(t).push(e)}delete(t,e){let r=this.for(t),n=r.indexOf(e);r.splice(n,1)}},ff=Qo;(()=>{d(Qo,df,"RefIndex",16)})();var mf=Symbol(),pf=class{constructor(t,e){var r=this;this.name=t,this.key=e,this.index=new ff;let n=xn(t),s=this.descriptor={enumerable:!0,configurable:!1,get:function(){return I?zo(this,t,e,r,n):this[e]},set:function(o){let l=this[e];if(I||!!this[n]?Uo(this,t,e,o,r,n):this[e]=o,l!=o&&(l&&r.index.delete(l,this),o))return r.index.add(o,this)}},i=this.lazyDescriptor={set:function(o){return this[e]=o,o&&r.index.add(o,this),Object.defineProperty(this,t,s),this[n]=null}}}where(t){return this.index.get(t)}};(()=>{d(pf,mf,"RefType",16)})();var gf=Symbol(),Zo=class{constructor(t,e,r,n){this.observing=null,this.observers=null,this.flags=68,this.target=t,this.func=e,this.vkey=r,this.type=n,this.v=0}get beacon(){return this}addSubscriber(t){if(t==this){console.warn("@computed depends on itself");return}this.observer?(this.observers||(this.observers=[]),this.observers.push(t)):this.observer=t}removeSubscriber(t){if(this.observer==t)return this.observer=null;let e=this.observers,r=e?e.indexOf(t):-1;r>=0&&e.splice(r,1)}$$invalidated(t,e){if(this.flags|=_.STALE|_.POSSIBLY_STALE,t>40){console.warn("Memo invalidated observer chain too deep",this,e);return}if(this.observer&&this.observer.$$invalidated(t+1,this),!!this.observers){for(let r=0,n=$(this.observers),s=n.length;r<s;r++)n[r].$$invalidated(t+1,this);return this}}deactivate(){if(this.observing)for(let t=0,e=$(this.observing),r=e.length;t<r;t++)e[t].removeSubscriber(this);return this.observing=null,this}value(){if(I&&T.add(this),(this.flags&_.POSSIBLY_STALE)==0)return this.target[this.vkey];I++,this.flags|=_.RUNNING,T.push(this);let t=this.func.call(this.target);T.pop(this);let e=this.target[this.vkey],r=!1;if(t&&e&&t.constructor===e.constructor&&t instanceof Array){let n=t.length;if(n!=e.length)r=!0;else{let s=0;for(;s<n;){if(t[s]!=e[s]){r=!0;break}s++}}}else r=t!==e;return this.target[this.vkey]=t,this.flags&=~(_.STALE|_.POSSIBLY_STALE|_.RUNNING),r&&this.v++,I--,t}},$e=Zo;(()=>{d(Zo,gf,"Memo",16)})();var yf=Symbol(),vf=class{constructor(t,e){var r=this;this.name=t;let n=xn(t),s=Ko(t),i=this.descriptor={enumerable:!1,configurable:!1,get:function(){return this[n].value()}},o=this.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){let l=this[n]=new $e(this,e,s,r.type);return Object.defineProperty(this,t,i),l.value()}}}};(()=>{d(vf,yf,"ComputedType",16)})();var bf=Symbol(),Bo=class{get beacon(){return this}constructor(t,e,r={}){this.cb=t,this.context=e,this.options=r,this.flags=0,this.id=Ao++,this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.observing=[],this.timeout=null}get runningΦ(){return this.flags&_.RUNNING}$$invalidated(t,e){var r,n;e instanceof $e?(this.flags|=_.POSSIBLY_STALE,(n=(r=this.checkComputedValues)==null?void 0:r.add)==null||n.call(r,e)):this.flags|=_.STALE,this.observing&&T.react(this)}activate(){return this.observing=[],this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.call(),this}deactivate(){if(this.timeout&&clearTimeout(this.timeout),this.observing)for(let t=0,e=$(this.observing),r=e.length;t<r;t++)e[t].removeSubscriber(this);return this.observing=this.checkComputedValues=this.cachedComputedVersions=null,this}call(){var t=this;if(I&&console.warn("should not call reaction inside an autorunning context?",Z.snapshot,this),this.flags&_.POSSIBLY_STALE&&(this.flags&_.STALE)==0){let e=!1;for(let r of $(this.checkComputedValues)){let n=this.cachedComputedVersions.get(r);r.value();let s=r.v;if(n!=s){e=!0;break}}if(!e){this.flags&=~_.POSSIBLY_STALE,this.checkComputedValues.clear();return}}if(this.options.delay){clearTimeout(this.timeout);let e=this.options.delay;typeof e!="number"&&(e=1000),this.timeout=setTimeout(function(){return t.run()},e);return}return this.run()}run(){I++,this.flags|=_.RUNNING;let t=T.push(this),e=this.cb.call(this.context,Jd),r=T.pop(this);this.observing=r,this.checkComputedValues.clear();for(let n=0,s=$(r),i=s.length;n<i;n++){let o=s[n];o instanceof $e&&this.cachedComputedVersions.set(o,o.v)}return this.flags&=~(_.RUNNING|_.STALE|_.POSSIBLY_STALE),I--,this.options.silent||P(),e}dispose(){return this.deactivate(),this.cb=this.context=this.options=null,this}},Sf=Bo;(()=>{d(Bo,bf,"Reaction",16)})();var wf=Symbol(),xf=class extends Sf{resolve(t){return this.deactivate(),this.resolved=t}then(...t){var e=this;return this.resolved!==void 0?Promise.resolve(this.resolved).then(...t):(this[zr]||(this[zr]=new Promise(function(r){return e.resolve=function(n){return e.deactivate(),e.resolved=n,r(n)}})),this[zr].then(...t))}run(){I++,this.flags|=_.RUNNING;let t=T.push(this),e=this.cb.call(this.context),r=T.pop(this);this.observing=r,this.checkComputedValues.clear();for(let n=0,s=$(r),i=s.length;n<i;n++){let o=s[n];o instanceof $e&&this.cachedComputedVersions.set(o,o.v)}return this.flags&=~(_.RUNNING|_.STALE|_.POSSIBLY_STALE),I--,e!=!1&&e!=null&&e!=null&&(this.resolve(e),this.options.silent||P()),e}};(()=>{d(xf,wf,"Awaits",0)})();var Tf=Symbol(),Ef=class{constructor(t,e){this.scope=e,this.cb=t}get ctx(){return T}run(t=this.scope,e=[],r=!1){T.push(this);try{r&&I++;let n=this.cb.apply(t,e);return r&&I--,T.pop(this),n}catch(n){throw r&&I--,T.pop(this),n}}};(()=>{d(Ef,Tf,"Action",16)})();function _f(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Mi=Symbol.for("#__init__"),De=Symbol.for("#watchers");var Nf=Symbol(),Of=class{constructor(t=null){this[Mi](t)}[Mi](t=null,e=!0,r=!0){var n;this.local=t&&(n=t.local)!==void 0?n:!1,this.session=t&&(n=t.session)!==void 0?n:!1,this.weak=t&&(n=t.weak)!==void 0?n:!1}watch(t){return(this[De]||(this[De]=[])).push(t)}$get(t,e){return t[e]}$set(t,e,r,n){if(this[De]){let s=this.$get(e,r,n);if(s!=t){e[r]=t;for(let i=0,o=_f(this[De]),l=o.length;i<l;i++){let h=o[i].call(e,t,s,this)}}}else e[r]=t}$accessor(t,e,r,n,s){return s[n]=this}};(()=>{d(Of,Nf,"Accessor",16)})();class k extends Error{constructor(t){super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,k.prototype),t!==null&&typeof t=="object"&&(this.originalError=t.originalError,this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort||t.name==="AbortError"||t.message==="Aborted",t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof k||(this.originalError=t),this.name="ClientResponseError "+this.status,this.message=this.response?.message,this.message||(this.isAbort?this.message="The request was aborted (most likely autocancelled; you can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation).":this.originalError?.cause?.message?.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong."),this.cause=this.originalError}get data(){return this.response}toJSON(){return{...this}}}var sr=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function If(t,e){let r={};if(typeof t!="string")return r;let n=Object.assign({},e||{}).decode||Pf,s=0;for(;s<t.length;){let i=t.indexOf("=",s);if(i===-1)break;let o=t.indexOf(";",s);if(o===-1)o=t.length;else if(o<i){s=t.lastIndexOf(";",i-1)+1;continue}let l=t.slice(s,i).trim();if(r[l]===void 0){let h=t.slice(i+1,o).trim();h.charCodeAt(0)===34&&(h=h.slice(1,-1));try{r[l]=n(h)}catch(c){r[l]=h}}s=o+1}return r}function $o(t,e,r){let n=Object.assign({},r||{}),s=n.encode||Lf;if(!sr.test(t))throw TypeError("argument name is invalid");let i=s(e);if(i&&!sr.test(i))throw TypeError("argument val is invalid");let o=t+"="+i;if(n.maxAge!=null){let l=n.maxAge-0;if(isNaN(l)||!isFinite(l))throw TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(l)}if(n.domain){if(!sr.test(n.domain))throw TypeError("option domain is invalid");o+="; Domain="+n.domain}if(n.path){if(!sr.test(n.path))throw TypeError("option path is invalid");o+="; Path="+n.path}if(n.expires){if(!function(h){return Object.prototype.toString.call(h)==="[object Date]"||h instanceof Date}(n.expires)||isNaN(n.expires.valueOf()))throw TypeError("option expires is invalid");o+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(o+="; HttpOnly"),n.secure&&(o+="; Secure"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():n.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return o}function Pf(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function Lf(t){return encodeURIComponent(t)}var Cf=typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal,sl;function Gt(t){if(t)try{let e=decodeURIComponent(sl(t.split(".")[1]).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch(e){}return{}}function il(t,e=0){let r=Gt(t);return!(Object.keys(r).length>0&&(!r.exp||r.exp-e>Date.now()/1000))}sl=typeof atob!="function"||Cf?(t)=>{let e=String(t).replace(/=+$/,"");if(e.length%4==1)throw Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,i=0,o="";n=e.charAt(i++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o}:atob;var tl="pb_auth";class ir{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!il(this.token)}get isSuperuser(){let t=Gt(this.token);return t.type=="auth"&&(this.record?.collectionName=="_superusers"||!this.record?.collectionName&&t.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),Gt(this.token).type=="auth"&&!this.isSuperuser}save(t,e){this.baseToken=t||"",this.baseModel=e||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,e=tl){let r=If(t||"")[e]||"",n={};try{n=JSON.parse(r),(typeof n===null||typeof n!="object"||Array.isArray(n))&&(n={})}catch(s){}this.save(n.token||"",n.record||n.model||null)}exportToCookie(t,e=tl){let r={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},n=Gt(this.token);r.expires=n?.exp?new Date(1000*n.exp):new Date("1970-01-01"),t=Object.assign({},r,t);let s={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null},i=$o(e,JSON.stringify(s),t),o=typeof Blob<"u"?new Blob([i]).size:i.length;if(s.record&&o>4096){s.record={id:s.record?.id,email:s.record?.email};let l=["collectionId","collectionName","verified"];for(let h in this.record)l.includes(h)&&(s.record[h]=this.record[h]);i=$o(e,JSON.stringify(s),t)}return i}onChange(t,e=!1){return this._onChangeCallbacks.push(t),e&&t(this.token,this.record),()=>{for(let r=this._onChangeCallbacks.length-1;r>=0;r--)if(this._onChangeCallbacks[r]==t)return delete this._onChangeCallbacks[r],void this._onChangeCallbacks.splice(r,1)}}triggerChange(){for(let t of this._onChangeCallbacks)t&&t(this.token,this.record)}}class ol extends ir{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){let t=this._storageGet(this.storageKey)||{};return t.record||t.model||null}get model(){return this.record}save(t,e){this._storageSet(this.storageKey,{token:t,record:e}),super.save(t,e)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&window?.localStorage){let e=window.localStorage.getItem(t)||"";try{return JSON.parse(e)}catch(r){return e}}return this.storageFallback[t]}_storageSet(t,e){if(typeof window<"u"&&window?.localStorage){let r=e;typeof e!="string"&&(r=JSON.stringify(e)),window.localStorage.setItem(t,r)}else this.storageFallback[t]=e}_storageRemove(t){typeof window<"u"&&window?.localStorage&&window.localStorage?.removeItem(t),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&window?.localStorage&&window.addEventListener&&window.addEventListener("storage",(t)=>{if(t.key!=this.storageKey)return;let e=this._storageGet(this.storageKey)||{};super.save(e.token||"",e.record||e.model||null)})}}class rt{constructor(t){this.client=t}}class ll extends rt{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,e){return e=Object.assign({method:"PATCH",body:t},e),this.client.send("/api/settings",e)}async testS3(t="storage",e){return e=Object.assign({method:"POST",body:{filesystem:t}},e),this.client.send("/api/settings/test/s3",e).then(()=>!0)}async testEmail(t,e,r,n){return n=Object.assign({method:"POST",body:{email:e,template:r,collection:t}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,e,r,n,s,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:e,keyId:r,privateKey:n,duration:s}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}var Mf=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Pn(t){if(t){t.query=t.query||{};for(let e in t)Mf.includes(e)||(t.query[e]=t[e],delete t[e])}}function Ln(t){let e=[];for(let r in t){let n=encodeURIComponent(r),s=Array.isArray(t[r])?t[r]:[t[r]];for(let i of s)i=kf(i),i!==null&&e.push(n+"="+i)}return e.join("&")}function kf(t){return t==null?null:t instanceof Date?encodeURIComponent(t.toISOString().replace("T"," ")):typeof t=="object"?encodeURIComponent(JSON.stringify(t)):encodeURIComponent(t)}class Cn extends rt{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15000,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1000,1200,1500,2000],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,e,r){if(!t)throw Error("topic must be set.");let n=t;if(r){Pn(r=Object.assign({},r));let i="options="+encodeURIComponent(JSON.stringify({query:r.query,headers:r.headers}));n+=(n.includes("?")?"&":"?")+i}let s=function(i){let o=i,l;try{l=JSON.parse(o?.data)}catch{}e(l||{})};return this.subscriptions[n]||(this.subscriptions[n]=[]),this.subscriptions[n].push(s),this.isConnected?this.subscriptions[n].length===1?await this.submitSubscriptions():this.eventSource?.addEventListener(n,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,s)}async unsubscribe(t){let e=!1;if(t){let r=this.getSubscriptionsByTopic(t);for(let n in r)if(this.hasSubscriptionListeners(n)){for(let s of this.subscriptions[n])this.eventSource?.removeEventListener(n,s);delete this.subscriptions[n],e||(e=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?e&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){let e=!1;for(let r in this.subscriptions)if((r+"?").startsWith(t)){e=!0;for(let n of this.subscriptions[r])this.eventSource?.removeEventListener(r,n);delete this.subscriptions[r]}e&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,e){let r=!1,n=this.getSubscriptionsByTopic(t);for(let s in n){if(!Array.isArray(this.subscriptions[s])||!this.subscriptions[s].length)continue;let i=!1;for(let o=this.subscriptions[s].length-1;o>=0;o--)this.subscriptions[s][o]===e&&(i=!0,delete this.subscriptions[s][o],this.subscriptions[s].splice(o,1),this.eventSource?.removeEventListener(s,e));i&&(this.subscriptions[s].length||delete this.subscriptions[s],r||this.hasSubscriptionListeners(s)||(r=!0))}this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){if(this.subscriptions=this.subscriptions||{},t)return!!this.subscriptions[t]?.length;for(let e in this.subscriptions)if(this.subscriptions[e]?.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch((t)=>{if(!t?.isAbort)throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){let e={};t=t.includes("?")?t:t+"?";for(let r in this.subscriptions)(r+"?").startsWith(t)&&(e[r]=this.subscriptions[r]);return e}getNonEmptySubscriptionKeys(){let t=[];for(let e in this.subscriptions)this.subscriptions[e].length&&t.push(e);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let e of this.subscriptions[t])this.eventSource.addEventListener(t,e)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let e of this.subscriptions[t])this.eventSource.removeEventListener(t,e)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,e)=>{this.pendingConnects.push({resolve:t,reject:e}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=(t)=>{this.connectErrorHandler(Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",(t)=>{let e=t;this.clientId=e?.lastEventId,this.submitSubscriptions().then(async()=>{let r=3;for(;this.hasUnsentSubscriptions()&&r>0;)r--,await this.submitSubscriptions()}).then(()=>{for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);let r=this.getSubscriptionsByTopic("PB_CONNECT");for(let n in r)for(let s of r[n])s(t)}).catch((r)=>{this.clientId="",this.connectErrorHandler(r)})})}hasUnsentSubscriptions(){let t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(let e of t)if(!this.lastSentSubscriptions.includes(e))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let r of this.pendingConnects)r.reject(new k(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);let e=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},e)}disconnect(t=!1){if(this.clientId&&this.onDisconnect&&this.onDisconnect(Object.keys(this.subscriptions)),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),this.eventSource?.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let e of this.pendingConnects)e.resolve();this.pendingConnects=[]}}}class Mn extends rt{decode(t){return t}async getFullList(t,e){if(typeof t=="number")return this._getFullList(t,e);let r=1000;return(e=Object.assign({},t,e)).batch&&(r=e.batch,delete e.batch),this._getFullList(r,e)}async getList(t=1,e=30,r){return(r=Object.assign({method:"GET"},r)).query=Object.assign({page:t,perPage:e},r.query),this.client.send(this.baseCrudPath,r).then((n)=>(n.items=n.items?.map((s)=>this.decode(s))||[],n))}async getFirstListItem(t,e){return(e=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},e)).query=Object.assign({filter:t,skipTotal:1},e.query),this.getList(1,1,e).then((r)=>{if(!r?.items?.length)throw new k({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return r.items[0]})}async getOne(t,e){if(!t)throw new k({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),e).then((r)=>this.decode(r))}async create(t,e){return e=Object.assign({method:"POST",body:t},e),this.client.send(this.baseCrudPath,e).then((r)=>this.decode(r))}async update(t,e,r){return r=Object.assign({method:"PATCH",body:e},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then((n)=>this.decode(n))}async delete(t,e){return e=Object.assign({method:"DELETE"},e),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),e).then(()=>!0)}_getFullList(t=1000,e){(e=e||{}).query=Object.assign({skipTotal:1},e.query);let r=[],n=async(s)=>this.getList(s,t||1000,e).then((i)=>{let o=i.items;return r=r.concat(o),o.length==i.perPage?n(s+1):r});return n(1)}}function gt(t,e,r,n){let s=n!==void 0;return s||r!==void 0?s?(console.warn(t),e.body=Object.assign({},e.body,r),e.query=Object.assign({},e.query,n),e):Object.assign(e,r):e}function Nn(t){t._resetAutoRefresh?.()}class hl extends Mn{constructor(t,e){super(t),this.collectionIdOrName=e}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(t,e,r){if(!t)throw Error("Missing topic.");if(!e)throw Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,e,r)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,e){if(typeof t=="number")return super.getFullList(t,e);let r=Object.assign({},t,e);return super.getFullList(r)}async getList(t=1,e=30,r){return super.getList(t,e,r)}async getFirstListItem(t,e){return super.getFirstListItem(t,e)}async getOne(t,e){return super.getOne(t,e)}async create(t,e){return super.create(t,e)}async update(t,e,r){return super.update(t,e,r).then((n)=>{if(this.client.authStore.record?.id===n?.id&&(this.client.authStore.record?.collectionId===this.collectionIdOrName||this.client.authStore.record?.collectionName===this.collectionIdOrName)){let s=Object.assign({},this.client.authStore.record.expand),i=Object.assign({},this.client.authStore.record,n);s&&(i.expand=Object.assign(s,n.expand)),this.client.authStore.save(this.client.authStore.token,i)}return n})}async delete(t,e){return super.delete(t,e).then((r)=>(!r||this.client.authStore.record?.id!==t||this.client.authStore.record?.collectionId!==this.collectionIdOrName&&this.client.authStore.record?.collectionName!==this.collectionIdOrName||this.client.authStore.clear(),r))}authResponse(t){let e=this.decode(t?.record||{});return this.client.authStore.save(t?.token,e),Object.assign({},t,{token:t?.token||"",record:e})}async listAuthMethods(t){return t=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t)}async authWithPassword(t,e,r){let n;r=Object.assign({method:"POST",body:{identity:t,password:e}},r),this.isSuperusers&&(n=r.autoRefreshThreshold,delete r.autoRefreshThreshold,r.autoRefresh||Nn(this.client));let s=await this.client.send(this.baseCollectionPath+"/auth-with-password",r);return s=this.authResponse(s),n&&this.isSuperusers&&function(o,l,h,c){Nn(o);let a=o.beforeSend,p=o.authStore.record,y=o.authStore.onChange((v,u)=>{(!v||u?.id!=p?.id||(u?.collectionId||p?.collectionId)&&u?.collectionId!=p?.collectionId)&&Nn(o)});o._resetAutoRefresh=function(){y(),o.beforeSend=a,delete o._resetAutoRefresh},o.beforeSend=async(v,u)=>{let m=o.authStore.token;if(u.query?.autoRefresh)return a?a(v,u):{url:v,sendOptions:u};let g=o.authStore.isValid;if(g&&il(o.authStore.token,l))try{await h()}catch(b){g=!1}g||await c();let f=u.headers||{};for(let b in f)if(b.toLowerCase()=="authorization"&&m==f[b]&&o.authStore.token){f[b]=o.authStore.token;break}return u.headers=f,a?a(v,u):{url:v,sendOptions:u}}}(this.client,n,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,e,Object.assign({autoRefresh:!0},r))),s}async authWithOAuth2Code(t,e,r,n,s,i,o){let l={method:"POST",body:{provider:t,code:e,codeVerifier:r,redirectURL:n,createData:s}};return l=gt("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",l,i,o),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then((h)=>this.authResponse(h))}authWithOAuth2(...t){if(t.length>1||typeof t?.[0]=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code(t?.[0]||"",t?.[1]||"",t?.[2]||"",t?.[3]||"",t?.[4]||{},t?.[5]||{},t?.[6]||{});let e=t?.[0]||{},r=null;e.urlCallback||(r=el(void 0));let n=new Cn(this.client);function s(){r?.close(),n.unsubscribe()}let i={},o=e.requestKey;return o&&(i.requestKey=o),this.listAuthMethods(i).then((l)=>{let h=l.oauth2.providers.find((a)=>a.name===e.provider);if(!h)throw new k(Error(`Missing or invalid provider "${e.provider}".`));let c=this.client.buildURL("/api/oauth2-redirect");return new Promise(async(a,p)=>{let y=o?this.client.cancelControllers?.[o]:void 0;y&&(y.signal.onabort=()=>{s(),p(new k({isAbort:!0,message:"manually cancelled"}))}),n.onDisconnect=(v)=>{v.length&&p&&(s(),p(new k(Error("realtime connection interrupted"))))};try{await n.subscribe("@oauth2",async(g)=>{let f=n.clientId;try{if(!g.state||f!==g.state)throw Error("State parameters don't match.");if(g.error||!g.code)throw Error("OAuth2 redirect error or missing code: "+g.error);let b=Object.assign({},e);delete b.provider,delete b.scopes,delete b.createData,delete b.urlCallback,y?.signal?.onabort&&(y.signal.onabort=null);let S=await this.authWithOAuth2Code(h.name,g.code,h.codeVerifier,c,e.createData,b);a(S)}catch(b){p(new k(b))}s()});let v={state:n.clientId};e.scopes?.length&&(v.scope=e.scopes.join(" "));let u=this._replaceQueryParams(h.authURL+c,v);await(e.urlCallback||function(g){r?r.location.href=g:r=el(g)})(u)}catch(v){y?.signal?.onabort&&(y.signal.onabort=null),s(),p(new k(v))}})}).catch((l)=>{throw s(),l})}async authRefresh(t,e){let r={method:"POST"};return r=gt("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",r,t,e),this.client.send(this.baseCollectionPath+"/auth-refresh",r).then((n)=>this.authResponse(n))}async requestPasswordReset(t,e,r){let n={method:"POST",body:{email:t}};return n=gt("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",n,e,r),this.client.send(this.baseCollectionPath+"/request-password-reset",n).then(()=>!0)}async confirmPasswordReset(t,e,r,n,s){let i={method:"POST",body:{token:t,password:e,passwordConfirm:r}};return i=gt("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,n,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,e,r){let n={method:"POST",body:{email:t}};return n=gt("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",n,e,r),this.client.send(this.baseCollectionPath+"/request-verification",n).then(()=>!0)}async confirmVerification(t,e,r){let n={method:"POST",body:{token:t}};return n=gt("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",n,e,r),this.client.send(this.baseCollectionPath+"/confirm-verification",n).then(()=>{let s=Gt(t),i=this.client.authStore.record;return i&&!i.verified&&i.id===s.id&&i.collectionId===s.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,e,r){let n={method:"POST",body:{newEmail:t}};return n=gt("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",n,e,r),this.client.send(this.baseCollectionPath+"/request-email-change",n).then(()=>!0)}async confirmEmailChange(t,e,r,n){let s={method:"POST",body:{token:t,password:e}};return s=gt("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{let i=Gt(t),o=this.client.authStore.record;return o&&o.id===i.id&&o.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,e){return this.client.collection("_externalAuths").getFullList(Object.assign({},e,{filter:this.client.filter("recordRef = {:id}",{id:t})}))}async unlinkExternalAuth(t,e,r){let n=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:t,provider:e}));return this.client.collection("_externalAuths").delete(n.id,r).then(()=>!0)}async requestOTP(t,e){return e=Object.assign({method:"POST",body:{email:t}},e),this.client.send(this.baseCollectionPath+"/request-otp",e)}async authWithOTP(t,e,r){return r=Object.assign({method:"POST",body:{otpId:t,password:e}},r),this.client.send(this.baseCollectionPath+"/auth-with-otp",r).then((n)=>this.authResponse(n))}async impersonate(t,e,r){(r=Object.assign({method:"POST",body:{duration:e}},r)).headers=r.headers||{},r.headers.Authorization||(r.headers.Authorization=this.client.authStore.token);let n=new or(this.client.baseURL,new ir,this.client.lang),s=await n.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(t),r);return n.authStore.save(s?.token,this.decode(s?.record||{})),n}_replaceQueryParams(t,e={}){let r=t,n="";t.indexOf("?")>=0&&(r=t.substring(0,t.indexOf("?")),n=t.substring(t.indexOf("?")+1));let s={},i=n.split("&");for(let o of i){if(o=="")continue;let l=o.split("=");s[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let o in e)e.hasOwnProperty(o)&&(e[o]==null?delete s[o]:s[o]=e[o]);n="";for(let o in s)s.hasOwnProperty(o)&&(n!=""&&(n+="&"),n+=encodeURIComponent(o.replace(/%20/g,"+"))+"="+encodeURIComponent(s[o].replace(/%20/g,"+")));return n!=""?r+"?"+n:r}}function el(t){if(typeof window>"u"||!window?.open)throw new k(Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,r=768,n=window.innerWidth,s=window.innerHeight;e=e>n?n:e,r=r>s?s:r;let i=n/2-e/2,o=s/2-r/2;return window.open(t,"popup_window","width="+e+",height="+r+",top="+o+",left="+i+",resizable,menubar=no")}class al extends Mn{get baseCrudPath(){return"/api/collections"}async import(t,e=!1,r){return r=Object.assign({method:"PUT",body:{collections:t,deleteMissing:e}},r),this.client.send(this.baseCrudPath+"/import",r).then(()=>!0)}async getScaffolds(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/meta/scaffolds",t)}async truncate(t,e){return e=Object.assign({method:"DELETE"},e),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/truncate",e).then(()=>!0)}}class ul extends rt{async getList(t=1,e=30,r){return(r=Object.assign({method:"GET"},r)).query=Object.assign({page:t,perPage:e},r.query),this.client.send("/api/logs",r)}async getOne(t,e){if(!t)throw new k({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/"+encodeURIComponent(t),e)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class cl extends rt{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class dl extends rt{getUrl(t,e,r={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(t,e,r)}getURL(t,e,r={}){if(!e||!t?.id||!t?.collectionId&&!t?.collectionName)return"";let n=[];n.push("api"),n.push("files"),n.push(encodeURIComponent(t.collectionId||t.collectionName)),n.push(encodeURIComponent(t.id)),n.push(encodeURIComponent(e));let s=this.client.buildURL(n.join("/"));r.download===!1&&delete r.download;let i=Ln(r);return i&&(s+=(s.includes("?")?"&":"?")+i),s}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then((e)=>e?.token||"")}}class fl extends rt{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,e){return e=Object.assign({method:"POST",body:{name:t}},e),this.client.send("/api/backups",e).then(()=>!0)}async upload(t,e){return e=Object.assign({method:"POST",body:t},e),this.client.send("/api/backups/upload",e).then(()=>!0)}async delete(t,e){return e=Object.assign({method:"DELETE"},e),this.client.send(`/api/backups/${encodeURIComponent(t)}`,e).then(()=>!0)}async restore(t,e){return e=Object.assign({method:"POST"},e),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,e).then(()=>!0)}getDownloadUrl(t,e){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(t,e)}getDownloadURL(t,e){return this.client.buildURL(`/api/backups/${encodeURIComponent(e)}?token=${encodeURIComponent(t)}`)}}class ml extends rt{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/crons",t)}async run(t,e){return e=Object.assign({method:"POST"},e),this.client.send(`/api/crons/${encodeURIComponent(t)}`,e).then(()=>!0)}}function On(t){return typeof Blob<"u"&&t instanceof Blob||typeof File<"u"&&t instanceof File||t!==null&&typeof t=="object"&&t.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function In(t){return t&&(t.constructor?.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}function rl(t){for(let e in t){let r=Array.isArray(t[e])?t[e]:[t[e]];for(let n of r)if(On(n))return!0}return!1}var Ff=/^[\-\.\d]+$/;function nl(t){if(typeof t!="string")return t;if(t=="true")return!0;if(t=="false")return!1;if((t[0]==="-"||t[0]>="0"&&t[0]<="9")&&Ff.test(t)){let e=+t;if(""+e===t)return e}return t}class pl extends rt{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(t){return this.subs[t]||(this.subs[t]=new gl(this.requests,t)),this.subs[t]}async send(t){let e=new FormData,r=[];for(let n=0;n<this.requests.length;n++){let s=this.requests[n];if(r.push({method:s.method,url:s.url,headers:s.headers,body:s.json}),s.files)for(let i in s.files){let o=s.files[i]||[];for(let l of o)e.append("requests."+n+"."+i,l)}}return e.append("@jsonPayload",JSON.stringify({requests:r})),t=Object.assign({method:"POST",body:e},t),this.client.send("/api/batch",t)}}class gl{constructor(t,e){this.requests=[],this.requests=t,this.collectionIdOrName=e}upsert(t,e){e=Object.assign({body:t||{}},e);let r={method:"PUT",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(r,e),this.requests.push(r)}create(t,e){e=Object.assign({body:t||{}},e);let r={method:"POST",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(r,e),this.requests.push(r)}update(t,e,r){r=Object.assign({body:e||{}},r);let n={method:"PATCH",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(t)};this.prepareRequest(n,r),this.requests.push(n)}delete(t,e){e=Object.assign({},e);let r={method:"DELETE",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(t)};this.prepareRequest(r,e),this.requests.push(r)}prepareRequest(t,e){if(Pn(e),t.headers=e.headers,t.json={},t.files={},e.query!==void 0){let n=Ln(e.query);n&&(t.url+=(t.url.includes("?")?"&":"?")+n)}let r=e.body;In(r)&&(r=function(s){let i={};return s.forEach((o,l)=>{if(l==="@jsonPayload"&&typeof o=="string")try{let h=JSON.parse(o);Object.assign(i,h)}catch(h){console.warn("@jsonPayload error:",h)}else i[l]!==void 0?(Array.isArray(i[l])||(i[l]=[i[l]]),i[l].push(nl(o))):i[l]=nl(o)}),i}(r));for(let n in r){let s=r[n];if(On(s))t.files[n]=t.files[n]||[],t.files[n].push(s);else if(Array.isArray(s)){let i=[],o=[];for(let l of s)On(l)?i.push(l):o.push(l);if(i.length>0&&i.length==s.length){t.files[n]=t.files[n]||[];for(let l of i)t.files[n].push(l)}else if(t.json[n]=o,i.length>0){let l=n;n.startsWith("+")||n.endsWith("+")||(l+="+"),t.files[l]=t.files[l]||[];for(let h of i)t.files[l].push(h)}}else t.json[n]=s}}}class or{get baseUrl(){return this.baseURL}set baseUrl(t){this.baseURL=t}constructor(t="/",e,r="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=t,this.lang=r,e?this.authStore=e:typeof window<"u"&&window.Deno?this.authStore=new ir:this.authStore=new ol,this.collections=new al(this),this.files=new dl(this),this.logs=new ul(this),this.settings=new ll(this),this.realtime=new Cn(this),this.health=new cl(this),this.backups=new fl(this),this.crons=new ml(this)}get admins(){return this.collection("_superusers")}createBatch(){return new pl(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new hl(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,e){if(!e)return t;for(let r in e){let n=e[r];switch(typeof n){case"boolean":case"number":n=""+n;break;case"string":n="'"+n.replace(/'/g,"\\'")+"'";break;default:n=n===null?"null":n instanceof Date?"'"+n.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(n).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+r+"}",n)}return t}getFileUrl(t,e,r={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(t,e,r)}buildUrl(t){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(t)}buildURL(t){let e=this.baseURL;return typeof window>"u"||!window.location||e.startsWith("https://")||e.startsWith("http://")||(e=window.location.origin?.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(e+=window.location.pathname||"/",e+=e.endsWith("/")?"":"/"),e+=this.baseURL),t&&(e+=e.endsWith("/")?"":"/",e+=t.startsWith("/")?t.substring(1):t),e}async send(t,e){e=this.initSendOptions(t,e);let r=this.buildURL(t);if(this.beforeSend){let n=Object.assign({},await this.beforeSend(r,e));n.url!==void 0||n.options!==void 0?(r=n.url||r,e=n.options||e):Object.keys(n).length&&(e=n,console?.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(e.query!==void 0){let n=Ln(e.query);n&&(r+=(r.includes("?")?"&":"?")+n),delete e.query}return this.getHeader(e.headers,"Content-Type")=="application/json"&&e.body&&typeof e.body!="string"&&(e.body=JSON.stringify(e.body)),(e.fetch||fetch)(r,e).then(async(n)=>{let s={};try{s=await n.json()}catch(i){if(e.signal?.aborted||i?.name=="AbortError"||i?.message=="Aborted")throw i}if(this.afterSend&&(s=await this.afterSend(n,s,e)),n.status>=400)throw new k({url:n.url,status:n.status,data:s});return s}).catch((n)=>{throw new k(n)})}initSendOptions(t,e){if((e=Object.assign({method:"GET"},e)).body=function(n){if(typeof FormData>"u"||n===void 0||typeof n!="object"||n===null||In(n)||!rl(n))return n;let s=new FormData;for(let i in n){let o=n[i];if(o!==void 0)if(typeof o!="object"||rl({data:o})){let l=Array.isArray(o)?o:[o];for(let h of l)s.append(i,h)}else{let l={};l[i]=o,s.append("@jsonPayload",JSON.stringify(l))}}return s}(e.body),Pn(e),e.query=Object.assign({},e.params,e.query),e.requestKey===void 0&&(e.$autoCancel===!1||e.query.$autoCancel===!1?e.requestKey=null:(e.$cancelKey||e.query.$cancelKey)&&(e.requestKey=e.$cancelKey||e.query.$cancelKey)),delete e.$autoCancel,delete e.query.$autoCancel,delete e.$cancelKey,delete e.query.$cancelKey,this.getHeader(e.headers,"Content-Type")!==null||In(e.body)||(e.headers=Object.assign({},e.headers,{"Content-Type":"application/json"})),this.getHeader(e.headers,"Accept-Language")===null&&(e.headers=Object.assign({},e.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(e.headers,"Authorization")===null&&(e.headers=Object.assign({},e.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&e.requestKey!==null){let r=e.requestKey||(e.method||"GET")+t;delete e.requestKey,this.cancelRequest(r);let n=new AbortController;this.cancelControllers[r]=n,e.signal=n.signal}return e}getHeader(t,e){t=t||{},e=e.toLowerCase();for(let r in t)if(r.toLowerCase()==e)return t[r];return null}}var yl=Symbol();class vl{[z](t=null,e=!0,r=!0){var n;this.backendUrl=t&&(n=t.backendUrl)!==void 0?n:"",this.gameCode=t&&(n=t.gameCode)!==void 0?n:"",this.historyLimit=t&&(n=t.historyLimit)!==void 0?n:20,this.tvToken=t&&(n=t.tvToken)!==void 0?n:null,this.pb=t&&(n=t.pb)!==void 0?n:null,this.version=t&&(n=t.version)!==void 0?n:0,this.tickInterval=t&&(n=t.tickInterval)!==void 0?n:null,this.connected=t&&(n=t.connected)!==void 0?n:!1,this.panic=t&&(n=t.panic)!==void 0?n:!1,this.game=t&&(n=t.game)!==void 0?n:null,this.broadcast=t&&(n=t.broadcast)!==void 0?n:null,this.round=t&&(n=t.round)!==void 0?n:null,this.history=t&&(n=t.history)!==void 0?n:[],this.timeRemaining=t&&(n=t.timeRemaining)!==void 0?n:0,this.broadcastUnsub=t&&(n=t.broadcastUnsub)!==void 0?n:null,this.roundsUnsub=t&&(n=t.roundsUnsub)!==void 0?n:null,this.nodesUnsub=t&&(n=t.nodesUnsub)!==void 0?n:null,this.hallNodeId=t&&(n=t.hallNodeId)!==void 0?n:null}constructor(t){this[z](),this.backendUrl=t.backendUrl||"https://api.ifastbet.com",this.gameCode=t.gameCode,this.historyLimit=t.historyLimit||20,this.tvToken=t.tvToken||this.extractTokenFromUrl(),this.pb=new or(this.backendUrl),Vn(this,yl)}extractTokenFromUrl(){if(typeof window>"u")return null;return new URLSearchParams(window.location.search).get("token")}get stage(){return this.version,this.broadcast?this.broadcast.stage:-2}get stages(){if(this.version,!this.game||!this.game.stages)return[];if(Array.isArray(this.game.stages))return this.game.stages;try{return JSON.parse(this.game.stages)}catch(t){return[]}}get currentStageMeta(){this.version;let t=this.stage;if(t<0)return null;let e=this.stages;if(!e||t>=e.length)return null;return e[t]}async subscribeAll(){var t=this;if(this.broadcastUnsub=await this.pb.collection("broadcasts").subscribe(this.broadcast.id,function(e){return t.handleBroadcastEvent(e.record,e.action)}),this.roundsUnsub=await this.pb.collection("rounds").subscribe("*",function(e){return t.handleRoundEvent(e.record,e.action)},{filter:'game = "'+this.game.id+'"'}),this.hallNodeId&&this.tvToken)return this.nodesUnsub=await this.pb.collection("nodes").subscribe(this.hallNodeId,function(e){return t.handleNodeEvent(e.record,e.action)},{query:{tv_token:this.tvToken}})}async handleBroadcastEvent(t,e){if(e=="delete")return;let r=this.broadcast&&this.broadcast.current_round;if(this.broadcast=t,t.current_round&&t.current_round!=r)try{this.round=await this.pb.collection("rounds").getOne(t.current_round)}catch(n){this.round=null}return this.bump()}handleRoundEvent(t,e){if(e=="create")this.history=[t,...this.history].slice(0,this.historyLimit);else if(e=="update"){let r=this.history.findIndex(function(n){return n.id==t.id});if(r>=0)this.history=[...this.history],this.history[r]=t;if(this.round&&this.round.id==t.id)this.round=t}else if(e=="delete")this.history=this.history.filter(function(r){return r.id!=t.id});return this.bump()}handleNodeEvent(t,e){if(e=="delete")return;return this.panic=t.panic==!0,this.bump()}startTick(){var t=this;if(this.tickInterval)this.stopTick();return this.tickInterval=setInterval(function(){return t.recomputeTimeRemaining()},1000)}stopTick(){if(this.tickInterval)clearInterval(this.tickInterval);return this.tickInterval=null}recomputeTimeRemaining(){let t=this.broadcast&&this.broadcast.restage_at,e=t?Math.max(0,t-Date.now()):0;if(e!=this.timeRemaining)return this.timeRemaining=e,this.bump()}async connect(){try{this.game=await this.pb.collection("games").getFirstListItem('code = "'+this.gameCode+'"')}catch(t){throw Error("TvClient: game not found for code '"+this.gameCode+"'")}try{this.broadcast=await this.pb.collection("broadcasts").getFirstListItem('game = "'+this.game.id+'"')}catch(t){throw Error("TvClient: broadcast not found for game '"+this.gameCode+"'")}if(this.broadcast.current_round)try{this.round=await this.pb.collection("rounds").getOne(this.broadcast.current_round)}catch(t){this.round=null}try{let t=await this.pb.collection("rounds").getList(1,this.historyLimit,{filter:'game = "'+this.game.id+'"',sort:"-started_at"});this.history=t.items||[]}catch(t){this.history=[]}if(this.tvToken)try{let t=await this.pb.collection("nodes").getFirstListItem('tv_token = "'+this.tvToken+'"',{query:{tv_token:this.tvToken}});this.hallNodeId=t.id,this.panic=t.panic==!0}catch(t){this.hallNodeId=null,this.panic=!1}return await this.subscribeAll(),this.startTick(),this.connected=!0,this.bump()}bump(){if(this.version++,P)return P()}disconnect(){this.stopTick();try{if(this.broadcastUnsub)this.broadcastUnsub();if(this.roundsUnsub)this.roundsUnsub();if(this.nodesUnsub)this.nodesUnsub()}catch(t){}return this.broadcastUnsub=null,this.roundsUnsub=null,this.nodesUnsub=null,this.connected=!1,this.game=null,this.broadcast=null,this.round=null,this.history=[],this.panic=!1,this.hallNodeId=null,this.timeRemaining=0,this.bump()}static{ge(this,yl,"TvClient",16)}}var jf=Symbol.for("#beforeReconcile"),kn=Symbol.for("#placeChild"),bl=Symbol.for("##up"),Df=Symbol.for("#afterReconcile"),Sl=Symbol(),wl=Symbol(),xl=Symbol(),Tl=Symbol(),El=Symbol(),_l=Symbol(),Af=Symbol();class Vf extends er{[z](t=null,e=!0,r=!0){var n;super[z](...arguments),this.tv=t&&(n=t.tv)!==void 0?n:null}render(){var t,e,r,n,s,i=this._ns_||"",o,l,h,c,a;if(r=this,r[jf](),(n=s=1,r[Sl]===1)||(n=s=0,r[Sl]=1),o=r.__slots.__,r[wl]=r[kn](o,128,r[wl]),t=null,!this.tv||!this.tv.connected)(l=h=1,t=r[xl])||(l=h=0,r[xl]=t=dn("div",null,`loader-overlay ${i}`,"Соединение...")),l||(t[bl]=r);if(r[Tl]=r[kn](t,0,r[Tl]),e=null,this.tv&&this.tv.panic)(c=a=1,e=r[El])||(c=a=0,r[El]=e=dn("div",null,`blackout-overlay ${i}`,null)),c||(e[bl]=r);return r[_l]=r[kn](e,0,r[_l]),r[Df](s),r}static{ge(this,Af,"tv-app-shell",2),Yi("tv-app-shell",this,{cssns:"z50w7cf_af",cssid:"z50w7cf-af"})}}mn.register("z50w7cf",`.z50w7cf_af.loader-overlay, .z50w7cf_af.blackout-overlay {
9
+ --t_x:0;--t_y:0;--t_rotate:0;
10
+ --t_scale:1;--t_scale-x:1;--t_scale-y:1;
11
+ transform: translate(var(--t_x),var(--t_y)) rotate(var(--t_rotate))
12
+ scaleX(var(--t_scale-x)) scaleY(var(--t_scale-y)) scale(var(--t_scale));
13
+ }
14
+
15
+ .z50w7cf_af.loader-overlay, .z50w7cf_af.blackout-overlay {
16
+ --t_z:0;--t_skew-x:0;--t_skew-y:0;
17
+ transform: translate3d(var(--t_x),var(--t_y),var(--t_z))
18
+ rotate(var(--t_rotate))
19
+ skewX(var(--t_skew-x)) skewY(var(--t_skew-y))
20
+ scaleX(var(--t_scale-x)) scaleY(var(--t_scale-y)) scale(var(--t_scale)) !important;
21
+ }
22
+
23
+ .z50w7cf-af {display: block;
24
+ position: relative;
25
+ width: 100%;
26
+ height: 100%;}
27
+
28
+ .z50w7cf_af.loader-overlay:not(#_) {position: absolute;
29
+ top: 0rem;
30
+ right: 0rem;
31
+ bottom: 0rem;
32
+ left: 0rem;
33
+ --t_z: 100 !important;
34
+ background: rgba(0, 0, 0, 0.85);
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ color: hsla(0.00,0.00%,100.00%,100%);
39
+ font-size: 24px;
40
+ font-weight: 700;
41
+ font-family: var(--font-sans-serif,sans-serif);}
42
+
43
+ .z50w7cf_af.blackout-overlay:not(#_) {position: absolute;
44
+ top: 0rem;
45
+ right: 0rem;
46
+ bottom: 0rem;
47
+ left: 0rem;
48
+ --t_z: 200 !important;
49
+ background: hsla(0.00,0.00%,0.00%,100%);}
50
+
51
+ tv-app-shell { display:block; }`);export{vl as TvClient};
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "ifastbet-tv-common",
3
+ "version": "0.1.0",
4
+ "description": "Shared backend integration library for ifastbet TV apps.",
5
+ "module": "./src/index.imba",
6
+ "main": "dist/index.js",
7
+ "type": "module",
8
+ "scripts": {
9
+ "build": "bunx bimba src/index.imba --outdir dist --minify",
10
+ "test": "bun test",
11
+ "prepublishOnly": "bun run build && bun test"
12
+ },
13
+ "peerDependencies": {
14
+ "imba": "*",
15
+ "pocketbase": "*"
16
+ },
17
+ "devDependencies": {
18
+ "@types/bun": "latest",
19
+ "bimba-cli": "latest",
20
+ "imba": "latest",
21
+ "pocketbase": "latest"
22
+ },
23
+ "files": ["dist", "README.md"]
24
+ }