UNPKG

123 kBJavaScriptView Raw
1var Te=Symbol.for("#__listeners__"),Vl=/-./g,va=new Set,Sr=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}};function $s(i,t={}){return new Proxy(t,new Sr(i))}function qt(i){let t=typeof i;if(t=="number")return i;if(t=="string"){if(/^\d+fps$/.test(i))return 1e3/parseFloat(i);if(/^([-+]?[\d\.]+)s$/.test(i))return parseFloat(i)*1e3;if(/^([-+]?[\d\.]+)ms$/.test(i))return parseFloat(i)}return null}function xa(i){return i.indexOf("-")>=0?i.replace(Vl,function(t){return t.charAt(1).toUpperCase()}):i}function Ee(i,t,e){if(!i)return;let r=Object.getOwnPropertyDescriptor(i,t);return r||i==e?r||void 0:Ee(Reflect.getPrototypeOf(i),t,e)}var As=function(i,t,e){let r,s,n;for(;(r=e)&&(e=e.next);)(s=e.listener)&&(e.path&&s[e.path]?n=t?s[e.path].apply(s,t):s[e.path]():n=t?s.apply(e,t):s.call(e)),e.times&&--e.times<=0&&(r.next=e.next,e.listener=null)};function $(i,t,e,r){var s;let n,o,l;return n=i[Te]||(i[Te]={}),o=n[t]||(n[t]={}),l=o.tail||(o.tail=o.next={}),l.listener=e,l.path=r,o.tail=l.next={},l}function R(i,t,e){let r=$(i,t,e);return r.times=1,r}function bt(i,t,e,r){if(!e)return;let s,n,o=i[Te];if(!!o&&(s=o[t])){for(;(n=s)&&(s=s.next);)if(s==e||s.listener==e){n.next=s.next,s.listener=null;break}}}function j(i,t,e){let r;(r=i[Te])&&(r[t]&&As(t,e,r[t]),r.all&&As(t,[t,e],r.all))}var zt=class{emit(t,...e){return j(this,t,e)}on(t,...e){return $(this,t,...e)}once(t,...e){return R(this,t,...e)}un(t,...e){return bt(this,t,...e)}};function Sa(i){return i}function Kl(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var js=Symbol.for("#__init__");var zs=Symbol.for("#schedule"),wr=Symbol.for("#frames"),Ne=Symbol.for("#interval"),Tt=Symbol.for("#stage"),Et=Symbol.for("#scheduled"),Oe=Symbol.for("#version"),Ul=Symbol.for("#fps"),qs=Symbol.for("#ticker"),Bl=globalThis.requestAnimationFrame||function(i){return globalThis.setTimeout(i,1e3/60)};var Ta=1/60,Tr=class{constructor(t=null){this[js](t)}[js](t=null){var e;this.owner=t&&(e=t.owner)!==void 0?e:null,this.target=t&&(e=t.target)!==void 0?e:null,this.active=t&&(e=t.active)!==void 0?e:!1,this.value=t&&(e=t.value)!==void 0?e:void 0,this.skip=t&&(e=t.skip)!==void 0?e:0,this.last=t&&(e=t.last)!==void 0?e:0}tick(t,e){return this.last=this.owner[wr],this.target.tick(this,e),1}update(t,e){let r=this.active,s=t.value;return this.value!=s&&(this.deactivate(),this.value=s),(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[Ne]=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[Ne]&&(globalThis.clearInterval(this[Ne]),this[Ne]=null),this.active=!1,this}},Er=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Tt]=-1,this[wr]=0,this[Et]=!1,this[Oe]=0,this.listeners={},this.intervals={},t.commit=function(){return t.add("commit"),t},this[Ul]=0,t.$promise=null,t.$resolve=null,this[qs]=function(e){return t[Et]=!1,t.tick(e)}}touch(){return this[Oe]++}get version(){return this[Oe]}add(t,e){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Et]||this[zs](),this}get committingΦ(){return this.queue.indexOf("commit")>=0}get syncingΦ(){return this[Tt]==1}listen(t,e){let r=this.listeners[t],s=!r;return r||(r=this.listeners[t]=new Set),r.add(e),t=="raf"&&s&&this.add("raf"),this}unlisten(t,e){var r;let s=this.listeners[t];return s&&s.delete(e),t=="raf"&&s&&s.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 t.$promise||(t.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,s=this[wr]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Tt]=1,this[Oe]++,r.length)for(let n=0,o=Kl(r),l=o.length;n<l;n++){let h=o[n];typeof h=="string"&&this.listeners[h]?e.listeners[h].forEach(function(u){if(u.tick instanceof Function)return u.tick(e,h);if(u instanceof Function)return u(e,h)}):h instanceof Function?h(e.dt,e):h.tick&&h.tick(e.dt,e)}return this[Tt]=this[Et]?0:-1,e.$promise&&(e.$resolve(e),e.$promise=e.$resolve=null),e.listeners.raf&&e.add("raf"),e}[zs](){return this[Et]||(this[Et]=!0,this[Tt]==-1&&(this[Tt]=0),Bl(this[qs])),this}schedule(t,e){var r,s;return e||(e=t[r=this.id]||(t[r]={value:!0})),(e[s=this.id]||(e[s]=new Tr({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}},k=new Er;function C(){return k.add("commit").promise}function Hl(i,t){return globalThis.setTimeout(function(){i(),C()},t)}function Wl(i,t){return globalThis.setInterval(function(){i(),C()},t)}var Yl=globalThis.clearInterval,Gl=globalThis.clearTimeout,Vt=globalThis.imba||(globalThis.imba={});Vt.commit=C;Vt.setTimeout=Hl;Vt.setInterval=Wl;Vt.clearInterval=Yl;Vt.clearTimeout=Gl;var Vs={on:function(i,t){return $(this,i,t)},inited:function(i){return j(this,"inited",[i])}};function Oa(){return!0}function Pa(i,t,e){if(e.get){let r=e.get;e.get=function(){let s=r.call(this);return Object.defineProperty(this,t,{enumerable:!1,value:s}),s}}return e}function ka(i,t,e){var r,s;if(e.value instanceof Function){let n=e.value;e.get=function(){if(this==i)return n;let o=n.bind(this);return Object.defineProperty(this,t,{enumerable:!1,value:o}),o},r=e.value,delete e.value,s=e.writable,delete e.writable}return e}var Ks=new WeakMap;function La(i,t,e){var h;let r=e.value,s=Symbol(),n=Symbol(),o=Ks.get(i);if(o||Ks.set(i,o=[]),o.length)throw new Error("@thenable "+((h=i.constructor)==null?void 0:h.name)+"."+t+" not allowed - @thenable "+o[0][0]+" already defined");let l=function(){var u;return console.trace("@thenable "+((u=i.constructor)==null?void 0:u.name)+"."+t+" takes long - make sure method does not return self")};if(o.push([t,s]),r instanceof Function){if(r.length>0)throw new Error("@thenable methods cannot be called with arguments ("+t+")");Object.defineProperty(i,"then",{enumerable:!1,value:function(u,c){let a=this;return(this[n]||(this[n]=new Promise(function(_,f){let d=setTimeout(l,2e3),m=function(g){return clearTimeout(d),f(g)};return a[t]().then(function(){return clearTimeout(d),Object.defineProperty(a,"then",{value:null,writable:!0,configurable:!0}),_(a)},m)}))).then(u,c)}}),e.value=function(u){return this[s]||(this[s]=Promise.resolve(r.call(this)))},e.value.reset=function(u){var c;if(u&&u[s])return u[s]=null,u[n]=null,c=u.then,delete u.then,c}}return e}function Fa(){return console.warn("imba.serve is not available on the client")}var Da=new class{};var Us=Symbol.for("#toStringDeopt");var Bs=Symbol.for("#symbols"),Hs=Symbol.for("#batches"),Ws=Symbol.for("#extras"),Ys=Symbol.for("#stacks"),Nt=class{constructor(t){this.dom=t,this.string=""}contains(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 s=this.stacks,n=s[t]||0;return n<1&&this.add(t),e>0&&setTimeout(function(){return r.decr(t)},e),s[t]=Math.max(n,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[Bs],s=this[Hs],n=!0;if(!r)r=this[Bs]=[t],s=this[Hs]=[e||""],this.toString=this.valueOf=this[Us];else{let o=r.indexOf(t),l=e||"";o==-1?(r.push(t),s.push(l)):s[o]!=l?s[o]=l:n=!1}n&&(this[Ws]=" "+s.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[Us](){return this.string+(this[Ws]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[Ys]||(this[Ys]={})}};var Ce=Symbol.for("#__init__"),Gs=Symbol.for("#__initor__"),Xs=Symbol.for("#__inited__"),Nr=Symbol.for("#getRenderContext"),Xl=Symbol.for("#getDynamicContext"),Qs=Symbol(),L={context:null},Or=class{constructor(t=null){this[Ce](t)}[Ce](t=null){var e;this.stack=t&&(e=t.stack)!==void 0?e:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},Kt=new Or,H=class extends Map{static[Ce](){return this.prototype[Gs]=Qs,this}constructor(t,e=null){super(),this._=t,this.sym=e,this[Gs]===Qs&&this[Xs]&&this[Xs]()}pop(){return L.context=null}[Nr](t){let e=this.get(t);return e||this.set(t,e=new H(this._,t)),L.context=e}[Xl](t,e){return this[Nr](t)[Nr](e)}run(t){return this.value=t,L.context==this&&(L.context=null),this.get(t)}cache(t){return this.set(this.value,t),t}};H[Ce]();function Js(i,t=Symbol(),e=i){return L.context=i[t]||(i[t]=new H(e,t))}function ja(){let i=L.context,t=i||new H(null);return globalThis.DEBUG_IMBA&&!i&&Kt.stack.length>0&&console.warn("detected unmemoized nodes in",Kt.stack.slice(0),"see https://imba.io",t),i&&(L.context=null),t}function Wt(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function Ql(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Bt=Symbol.for("#parent"),Zs=Symbol.for("#closestNode"),Jl=Symbol.for("#parentNode"),Zl=Symbol.for("#context"),Le=Symbol.for("#__init__"),yn=Symbol.for("##inited"),Cr=Symbol.for("#getRenderContext"),th=Symbol.for("#getDynamicContext"),tn=Symbol.for("#insertChild"),Ht=Symbol.for("#appendChild"),Pr=Symbol.for("#replaceChild"),en=Symbol.for("#removeChild"),et=Symbol.for("#insertInto"),rn=Symbol.for("#insertIntoDeopt"),Ut=Symbol.for("#removeFrom"),sn=Symbol.for("#removeFromDeopt"),Ot=Symbol.for("#replaceWith"),nn=Symbol.for("#replaceWithDeopt"),kr=Symbol.for("#placeholderNode"),eh=Symbol.for("#attachToParent"),rh=Symbol.for("#detachFromParent"),ih=Symbol.for("#placeChild"),sh=Symbol.for("#beforeReconcile"),nh=Symbol.for("#afterReconcile"),oh=Symbol.for("#afterVisit"),lh=Symbol.for("#visitContext"),on=Symbol.for("#__initor__"),ln=Symbol.for("#__inited__"),bn=Symbol.for("##parent"),Lr=Symbol.for("##up"),hn=Symbol.for("##context"),_t=Symbol.for("#domNode"),Pe=Symbol.for("##placeholderNode"),un=Symbol.for("#domDeopt"),ke=Symbol.for("##visitContext"),_n=Symbol.for("#isRichElement"),an=Symbol.for("#src"),Ct=Symbol.for("#htmlNodeName"),hh=Symbol.for("#getSlot"),fn=Symbol.for("#ImbaElement"),cn=Symbol.for("#cssns"),uh=Symbol.for("#cssid"),dn=Symbol(),{Event:Y,UIEvent:Ba,MouseEvent:vn,PointerEvent:xn,KeyboardEvent:Sn,CustomEvent:N,Node:W,Comment:Me,Text:qr,Element:v,HTMLElement:Vr,HTMLHtmlElement:Ha,HTMLSelectElement:wn,HTMLInputElement:Tn,HTMLTextAreaElement:En,HTMLButtonElement:Nn,HTMLOptionElement:On,HTMLScriptElement:Wa,SVGElement:Cn,DocumentFragment:Ya,ShadowRoot:Ga,Document:Yt,Window:Xa,customElements:Qa}=globalThis.window,pn={};function Pn(i,t,e){if(!i)return e[t]=null;if(e[t]!==void 0)return e[t];let r=Object.getOwnPropertyDescriptor(i,t);return r!==void 0||i==Cn?e[t]=r||null:Pn(Reflect.getPrototypeOf(i),t,e)}var Ir={},Fr={},Mr={},ah={};function De(){return globalThis.document}function Ja(){return globalThis.imba.uses_window=!0,!0}var fh={get(i,t){let e=i,r;for(;e&&r==null;)(e=e[Bt])&&(r=e[t]);return r},set(i,t,e){let r=i,s;for(;r&&s==null;){if(Ee(r,t,v))return r[t]=e,!0;r=r[Bt]}return!0}},Dr=class{get flags(){return this.documentElement.flags}};Wt(Yt.prototype,Dr.prototype);var Rr=class{get[Bt](){return this[bn]||this.parentNode||this[Lr]}get[Zs](){return this}get[Jl](){return this[Bt][Zs]}get[Zl](){return this[hn]||(this[hn]=new Proxy(this,fh))}[Le](){return this}[yn](){return this}[Cr](t){return Js(this,t)}[th](t,e){return this[Cr](t)[Cr](e)}[tn](t,e){return t[et](this,e)}[Ht](t){return t[et](this,null)}[Pr](t,e){let r=this[tn](t,e);return this[en](e),r}[en](t){return t[Ut](this)}[et](t,e=null){return e?t.insertBefore(this,e):t.appendChild(this),this}[rn](t,e){return e?t.insertBefore(this[_t]||this,e):t.appendChild(this[_t]||this),this}[Ut](t){return t.removeChild(this)}[sn](t){return t.removeChild(this[_t]||this)}[Ot](t,e){return e[Pr](t,this)}[nn](t,e){return e[Pr](t,this[_t]||this)}get[kr](){return this[Pe]||(this[Pe]=globalThis.document.createComment("placeholder"))}set[kr](t){let e=this[Pe];this[Pe]=t,e&&e!=t&&e.parentNode&&e[Ot](t)}[eh](){let t=this[_t],e=t&&t.parentNode;return t&&e&&t!=this&&(this[_t]=null,this[et](e,t),t[Ut](e)),this}[rh](){this[un]!=!0&&(this[un]=!0,!0)&&(this[Ot]=this[nn],this[Ut]=this[sn],this[et]=this[rn],this[Lr]||(this[Lr]=this[Bt]));let t=this[kr];return this.parentNode&&t!=this&&(t[et](this.parentNode,this),this[Ut](this.parentNode)),this[_t]=t,this}[ih](t,e,r){let s=typeof t;if(s==="undefined"||t===null){if(r&&r instanceof Me)return r;let n=globalThis.document.createComment("");return r?r[Ot](n,this):n[et](this,null)}if(t===r)return t;if(s!=="object"){let n,o=t;return e&128&&e&256,r?r instanceof qr?(r.textContent=o,r):(n=globalThis.document.createTextNode(o),r[Ot](n,this),n):(this.appendChild(n=globalThis.document.createTextNode(o)),n)}else{if(globalThis.DEBUG_IMBA&&!t[et])throw console.warn("Tried to insert",t,"into",this),new TypeError("Only DOM Nodes can be inserted into DOM");return r?r[Ot](t,this):t[et](this,null)}}};Wt(W.prototype,Rr.prototype);var Ar=class{log(...t){return console.log(...t)}emit(t,e,r={bubbles:!0,cancelable:!0}){e!=null&&(r.detail=e);let s=new N(t,r),n=this.dispatchEvent(s);return s}text$(t){return this.textContent=t,this}[sh](){return this}[nh](){return this}[oh](){this[ke]&&(this[ke]=null)}get[lh](){return this[ke]||(this[ke]={})}get flags(){return this.$flags||(this.$flags=new Nt(this),this.flag$==v.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$,t.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=Ee(this,t,v);!r||!r.set?this.setAttribute(t,e):this[t]=e}get richValue(){return this.value}set richValue(t){this.value=t}};Wt(v.prototype,Ar.prototype);v.prototype.setns$=v.prototype.setAttributeNS;v.prototype[_n]=!0;function Za(i,t,e,r){let s=globalThis.document.createElement(i);return e&&(s.className=e),r!==null&&s.text$(r),t&&t[Ht]&&t[Ht](s),s}var $r=class{set$(t,e){var r;let s=pn[r=this.nodeName]||(pn[r]={}),n=Pn(this,t,s);!n||!n.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 e.flag$=function(r){return e.flagSync$(e.flags$ext=r)},e.flagSelf$=function(r){return e.flagSync$(e.flags$own=r)},e.flagSelf$(t)}flagSync$(){return this.setAttribute("class",(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||""))}};Wt(Cn.prototype,$r.prototype);var jr=class{set src(t){if(this[an]!=t&&(this[an]=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,s=Object.keys(e),n=s.length,o,l;r<n;r++)o=s[r],l=e[o],this.setAttribute(o,l);this.innerHTML=t.content}}}};Wt(SVGSVGElement.prototype,jr.prototype);function tf(i,t,e,r,s){let n=globalThis.document.createElementNS("http://www.w3.org/2000/svg",i);return e&&(n.className.baseVal=e),t&&t[Ht]&&t[Ht](n),r&&(n.textContent=r),n}function ot(i){return globalThis.document.createComment(i)}function Kr(i){return globalThis.document.createTextNode(i)}function ef(){return globalThis.document.createDocumentFragment()}var Ie=globalThis.navigator,ch=Ie&&Ie.vendor||"",mn=Ie&&Ie.userAgent||"",dh=ch.indexOf("Apple")>-1||mn.indexOf("CriOS")>=0||mn.indexOf("FxiOS")>=0,Fe=!dh,gn=new Map,zr=class extends Vr{connectedCallback(){return Fe?this.parentNode.removeChild(this):this.parentNode.connectedCallback()}disconnectedCallback(){if(!Fe)return this.parentNode.disconnectedCallback()}};window.customElements.define("i-hook",zr);function ph(i,t){let e=gn.get(t);if(!e){e={};let r=t.prototype,s=[r];for(;(r=r&&Object.getPrototypeOf(r))&&r.constructor!=i.constructor;)s.unshift(r);for(let n=0,o=Ql(s),l=o.length;n<l;n++){let h=o[n],u=Object.getOwnPropertyDescriptors(h);Object.assign(e,u)}gn.set(t,e)}return e}function mh(i,t,e,r,s){let n;typeof i!="string"&&i&&i.nodeName&&(i=i.nodeName);let o=Fr[i]||i;if(Ir[i]){let l=Ir[i],h=l.prototype[Ct];if(h&&Fe)n=globalThis.document.createElement(h,{is:o});else if(l.create$&&h){n=globalThis.document.createElement(h),n.setAttribute("is",o);let u=ph(n,l);Object.defineProperties(n,u),n.__slots={},n.appendChild(globalThis.document.createElement("i-hook"))}else l.create$?(n=l.create$(n),n.__slots={}):console.warn("could not create tag "+i)}else n=globalThis.document.createElement(Fr[i]||i);return n[bn]=t,n[Le](),n[yn](),r!==null&&n[hh]("__").text$(r),(e||n.flags$ns)&&n.flag$(e||""),n}function rf(i,t,e,r){if(i==null||i==null)return ot("");if(i instanceof W)return i;if(i[_n])return i;if(typeof i=="string"||i&&i.prototype instanceof W)return mh(i,t,e,r)}function gh(i,t){if(Mr[i])return Mr[i];if(window[t])return window[t];if(window[i])return window[i]}function nf(i,t,e){let r=gh(i,t);if(!(r==e||r.prototype instanceof e||r.prototype[Ct])){let n=r.prototype[fn];if(!n){n=class extends r{static[Le](){return this.prototype[on]=dn,this}constructor(){super(...arguments),this.__slots={},this.__F=0,this[on]===dn&&this[ln]&&this[ln]()}}[Le](),r.prototype[fn]=n;let o=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(n.prototype,o),n.prototype[Ct]=i}return n}return r}function of(i,t,e={}){Mr[i]=ah[i]=t,t.nodeName=i;let r=i,s=t.prototype;if(i.indexOf("-")==-1&&(r=""+i+"-tag",Fr[i]=r),e.cssns){let n=(s._ns_||s[cn]||"")+" "+(e.cssns||"");s._ns_=n.trim()+" ",s[cn]=e.cssns}if(e.cssid){let n=(s.flags$ns||"")+" "+e.cssid;s[uh]=e.cssid,s.flags$ns=n.trim()+" "}return s[Ct]&&!e.extends&&(e.extends=s[Ct]),e.extends?(s[Ct]=e.extends,Ir[i]=t,Fe&&window.customElements.define(r,t,{extends:e.extends})):window.customElements.define(r,t),t}var yh=globalThis.imba||(globalThis.imba={});yh.document=globalThis.document;function Ur(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function bh(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var je=Symbol.for("#parent"),kn=Symbol.for("#closestNode"),_h=Symbol.for("#isRichElement"),vh=Symbol.for("#afterVisit"),Ln=Symbol.for("#__initor__"),In=Symbol.for("#__inited__"),Fn=Symbol.for("#appendChild"),Mn=Symbol.for("#removeChild"),Dn=Symbol.for("#replaceChild"),rt=Symbol.for("#insertInto"),Re=Symbol.for("#replaceWith"),Rn=Symbol.for("#insertChild"),Ae=Symbol.for("#removeFrom"),An=Symbol.for("#placeChild"),Vn=Symbol.for("#__init__"),xh=Symbol.for("#registerFunctionalSlot"),Sh=Symbol.for("#getFunctionalSlot"),$n=Symbol.for("#getSlot"),Hr=Symbol.for("##parent"),lt=Symbol.for("##up"),jn=Symbol.for("##flags"),wh=Symbol.for("#domFlags"),V=Symbol.for("#end"),zn=Symbol.for("#textContent"),$e=Symbol.for("#textNode"),Br=Symbol.for("#functionalSlots"),qn=Symbol();function af(){return globalThis.imba.uses_slots=!0,!0}var ht=class{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[je](t){this[Hr]=t}get[je](){return this[Hr]||this[lt]}get[kn](){return this[je][kn]}get[_h](){return!0}get flags(){return this[jn]||(this[jn]=new Nt(this))}flagSync$(){return this}[vh](){return this}},Th=0,Gt=class extends ht{static[Vn](){return this.prototype[Ln]=qn,this}constructor(t,e){super(...arguments),this[lt]=e,this.parentNode=null,this[wh]=t,this.childNodes=[],this[V]=ot("slot"+Th++),e&&e[Fn](this),this[Ln]===qn&&this[In]&&this[In]()}get[je](){return this[Hr]||this.parentNode||this[lt]}set textContent(t){this[zn]=t}get textContent(){return this[zn]}hasChildNodes(){for(let t=0,e=Ur(this.childNodes),r=e.length;t<r;t++){let s=e[t];if(s instanceof ht&&s.hasChildNodes())return!0;if(!(s instanceof Me)){if(s instanceof W)return!0}}return!1}text$(t){return this[$e]?this[$e].textContent=t:this[$e]=this[An](t),this[$e]}appendChild(t){return this.parentNode&&t[rt](this.parentNode,this[V]),this.childNodes.push(t)}[Fn](t){var e;return this.parentNode?t[rt](this.parentNode,this[V]):t[lt]==null?t[lt]=this[lt]||this:t[lt],this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[Rn](t,e);let r=this.childNodes.indexOf(e);return r>=0&&this.childNodes.splice(r,0,t),t}[Mn](t){this.parentNode&&this.parentNode[Mn](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[Dn](t,e){this.parentNode&&this.parentNode[Dn](t,e);let r=this.childNodes.indexOf(e);return this.childNodes[r]=t,t}[rt](t,e){let r=this.parentNode;if(this.parentNode!=t&&(this.parentNode=t,!0)){this[V]&&(e=this[V][rt](t,e));for(let s=0,n=Ur(this.childNodes),o=n.length;s<o;s++)n[s][rt](t,e)}return this}[Re](t,e){let r=t[rt](e,this[V]);return this[Ae](e),r}[Rn](t,e){if(this.parentNode&&this.insertBefore(t,e||this[V]),e){let r=this.childNodes.indexOf(e);r>=0&&this.childNodes.splice(r,0,t)}else this.childNodes.push(t);return t}[Ae](t){for(let e=0,r=Ur(this.childNodes),s=r.length;e<s;e++)r[e][Ae](t);return this[V]&&this[V][Ae](t),this.parentNode=null,this}[An](t,e,r){let s=this.parentNode,n=typeof t;if(n==="undefined"||t===null){if(r&&r instanceof Me)return r;let o=ot("");if(r){let l=this.childNodes.indexOf(r);return this.childNodes.splice(l,1,o),s&&r[Re](o,s),o}return this.childNodes.push(o),s&&o[rt](s,this[V]),o}if(t===r)return t;if(n!=="object"){let o,l=t;if(r){if(r instanceof qr)return r.textContent=l,r;{o=Kr(l);let h=this.childNodes.indexOf(r);return this.childNodes.splice(h,1,o),s&&r[Re](o,s),o}}else return this.childNodes.push(o=Kr(l)),s&&o[rt](s,this[V]),o}else if(r){let o=this.childNodes.indexOf(r);return this.childNodes.splice(o,1,t),s&&r[Re](t,s),t}else return this.childNodes.push(t),s&&t[rt](s,this[V]),t}};Gt[Vn]();function ff(i,t){return new Gt(i,t)}function ze(i,t){let e=new Gt(i,null);return e[lt]=t,e}var Wr=class{[xh](t){let e=this[Br]||(this[Br]={});return e[t]||(e[t]=ze(0,this))}[Sh](t,e){let r=this[Br];return r&&r[t]||this[$n](t,e)}[$n](t,e){var r;return t=="__"&&!this.render||!this.__slots?this:(r=this.__slots)[t]||(r[t]=ze(0,this))}};bh(W.prototype,Wr.prototype);function Eh(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Nh=Symbol.for("#afterVisit"),qe=Symbol.for("#insertInto"),Kn=Symbol.for("#appendChild"),Oh=Symbol.for("#replaceWith"),Yr=Symbol.for("#removeFrom"),Un=Symbol.for("#__initor__"),Bn=Symbol.for("#__inited__"),Wn=Symbol.for("#__init__"),Ch=Symbol.for("#domFlags"),Ph=Symbol.for("##parent"),ut=Symbol.for("#end"),kh=Symbol.for("#removeChild"),Lh=Symbol.for("#insertChild"),Hn=Symbol(),Ve=class extends ht{static[Wn](){return this.prototype[Un]=Hn,this}constructor(t,e){super(...arguments),this[Ch]=t,this[Ph]=e,t&256||(this[ut]=ot("list")),this.$=this.childNodes,this.length=0,e&&e[Kn](this),this[Un]===Hn&&this[Bn]&&this[Bn]()}hasChildNodes(){return this.length!=0}[Nh](t){let e=this.length;if(this.length=t,e==t)return;let r=this.parentNode;if(!r)return;let s=this.childNodes,n=this[ut];if(e>t)for(;e>t;)r[kh](s[--e]);else if(t>e)for(;t>e;)r[Lh](s[e++],n);this.length=t}[qe](t,e){this.parentNode=t,this[ut]&&this[ut][qe](t,e),e=this[ut];for(let r=0,s=Eh(this.childNodes),n=s.length;r<n;r++){let o=s[r];if(r==this.length)break;o[qe](t,e)}return this}[Kn](t){}[Oh](t,e){let r=t[qe](e,this[ut]);return this[Yr](e),r}[Yr](t){let e=this.length;for(;e>0;)this.childNodes[--e][Yr](t);this[ut]&&t.removeChild(this[ut]),this.parentNode=null}};Ve[Wn]();function mf(i,t){return new Ve(i,t)}function Yn(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Gr=Symbol.for("#appendChild"),Ke=Symbol.for("#insertChild"),Ih=Symbol.for("#replaceWith"),Ue=Symbol.for("#insertInto"),Xr=Symbol.for("#removeFrom"),Fh=Symbol.for("#afterVisit"),Gn=Symbol.for("#__initor__"),Xn=Symbol.for("#__inited__"),to=Symbol.for("#__init__"),Be=Symbol.for("#domFlags"),Qn=Symbol.for("##parent"),at=Symbol.for("#end"),Jn=Symbol.for("#removeChild"),Zn=Symbol(),He=class extends ht{static[to](){return this.prototype[Gn]=Zn,this}constructor(t,e){super(...arguments),this[Be]=t,this[Qn]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new H(this,Symbol()),t&256||(this[at]=ot("map")),e&&e[Gr](this),this[Gn]===Zn&&this[Xn]&&this[Xn]()}[Gr](t){if(this.parentNode)return this.parentNode[Ke](t,this[at])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[Be]&1)){this.array.push(t),this[Gr](t);return}let r=this.array[e];if(r!==t){this.dirty=!0;let s=this.array.indexOf(t),n=this.changes.get(t);s===-1?(this.array.splice(e,0,t),this.insertChild(t,e,s)):s===e+1?(r&&this.changes.set(r,-1),this.array.splice(e,1)):(s>=0&&this.array.splice(s,1),this.array.splice(e,0,t),this.moveChild(t,e,s)),n==-1&&this.changes.delete(t)}}insertChild(t,e,r){let s=this.parentNode;if(!!s)if(e>0){let n=this.array[e-1];s[Ke](t,n.nextSibling)}else s[Ke](t,this.childNodes[e+1]||this[at])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[Xr](t.parentNode)}[Ke](t,e){}[Ih](t,e){let r=t[Ue](e,this[at]);return this[Xr](e),r}[Ue](t,e){this[Qn]=t;let r=this.parentNode;if(t!=r){this.parentNode=t;for(let s=0,n=Yn(this.array),o=n.length;s<o;s++)n[s][Ue](t,e);this[at]&&this[at][Ue](t,e)}return this}[Xr](t){for(let e=0,r=Yn(this.array),s=r.length;e<s;e++){let n=r[e];t[Jn](n)}return this[at]&&t[Jn](this[at]),this.parentNode=null}[Fh](t){var e=this;if(!(this[Be]&1)){this[Be]|=1;return}if(this.dirty&&(e.changes.forEach(function(r,s){if(r==-1)return e.removeChild(s)}),e.changes.clear(),e.dirty=!1),e.array.length>t)for(;e.array.length>t;){let r=e.array.pop();e.removeChild(r)}}};He[to]();function vf(i,t){return new He(i,t)}var kt=Symbol.for("#__init__"),eo=Symbol.for("#__initor__"),ro=Symbol.for("#__inited__"),Mh=Symbol.for("##inited"),Dh=Symbol.for("#afterVisit"),Rh=Symbol.for("#beforeReconcile"),Ah=Symbol.for("#afterReconcile"),io=Symbol.for("#__hooks__"),Pt=Symbol.for("#autorender"),We=Symbol.for("##visitContext"),so=Symbol(),no=new class{constructor(i=null){this[kt](i)}[kt](i=null){var t;this.items=i&&(t=i.items)!==void 0?t:[],this.current=i&&(t=i.current)!==void 0?t:null,this.lastQueued=i&&(t=i.lastQueued)!==void 0?t:null,this.tests=i&&(t=i.tests)!==void 0?t:0}flush(){let i=null;for(;i=this.items.shift();){if(!i.parentNode||i.hydratedΦ)continue;let t=this.current;this.current=i,i.__F|=1024,i.connectedCallback(),this.current=t}}queue(i){var t=this;let e=this.items.length,r=0,s=this.lastQueued;this.lastQueued=i;let n=W.DOCUMENT_POSITION_PRECEDING,o=W.DOCUMENT_POSITION_FOLLOWING;if(e){let l=this.items.indexOf(s),h=l,u=function(a,p){return t.tests++,a.compareDocumentPosition(p)};(l==-1||s.nodeName!=i.nodeName)&&(h=l=0);let c=t.items[h];for(;c&&u(c,i)&o;)c=t.items[++h];if(h!=l)c?t.items.splice(h,0,i):t.items.push(i);else{for(;c&&u(c,i)&n;)c=t.items[--h];h!=l&&(c?t.items.splice(h+1,0,i):t.items.unshift(i))}}else t.items.push(i),t.current||globalThis.queueMicrotask(t.flush.bind(t))}};function Of(){return no.flush()}var Lt=class extends Vr{static[kt](){return this.prototype[eo]=so,this}constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build(),this[eo]===so&&this[ro]&&this[ro]()}setup$(){return this.__slots={},this.__F=0}[kt](){return this.__F|=3,this}[Mh](){if(this[io])return this[io].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(){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[Pt]||(this[Pt]={});e.value=t,this.mountedΦ&&k.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}schedule(){return k.on("commit",this),this.__F|=128,this}unschedule(){return k.un("commit",this),this.__F&=-129,this}async suspend(t=null){let e=this.flags.incr("@suspended");return this.__F|=4096,t instanceof Function&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("@suspended")==0&&(this.__F&=-4097,this.commit()),this}[Dh](){if(this.visit(),this[We])return this[We]=null}[Rh](){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&&Kt.push(this),this[We]&&(this[We]=null),this}[Ah](){return globalThis.DEBUG_IMBA&&Kt.pop(this),this}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(!e&&!(t&1024)){no.queue(this);return}if(t&48)return;this.__F|=16,e||this[kt](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),r||(this.awaken(),this.__F|=8),j(this,"mount");let s=this.mount();return s&&s.then instanceof Function&&s.then(k.commit),t=this.__F=(this.__F|32)&-17,t&64&&this.schedule(),this[Pt]&&k.schedule(this,this[Pt]),this}disconnectedCallback(){if(this.__F=this.__F&-49,this.__F&128&&this.unschedule(),j(this,"unmount"),this.unmount(),this[Pt])return k.unschedule(this,this[Pt])}};Lt[kt]();var Cf=Lt;function $h(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var oo=Symbol.for("#__init__");var jh={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};var lo={prefix:1,suffix:1,content:1},Zr={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]]},zh=new RegExp("^("+Object.keys(Zr).join("|")+")(\\d+(?:\\.\\d+)?)$"),qh=/^([xyz])$/,Vh=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,Kh=`*,::before,::after {
2box-sizing: border-box;
3border-width: 0;
4border-style: solid;
5border-color: currentColor;
6}`,Qr=class{constructor(t=null){this[oo](t)}[oo](t=null){var e;this.entries=t&&(e=t.entries)!==void 0?e:{}}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",Kh),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,s=null){let n;lo[r]&&(t=String(t));let o=typeof t;if(o=="number"){if(e||(qh.test(r)?e="px":Vh.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return jh[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(o=="string"){if(r&&lo[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),n=t.match(zh)){let h=Zr[n[1]][parseInt(n[2])],u="100%";if(typeof s=="number"?u=s+"%":typeof s=="string"&&(u=s),h)return"hsla("+h[0]+","+h[1]+"%,"+h[2]+"%,"+u+")"}}else if(t&&t.toStyleString instanceof Function)return t.toStyleString();return t}parseDimension(t){if(typeof t=="string"){let[e,r,s]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(r),s]}else if(typeof t=="number")return[t]}},Uh=new Qr,If=Object.keys(Zr);function Ff(){return globalThis.imba.uses_styles=!0,!0}var Jr=class{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,s,n=null){let o=Uh.toValue(e,r,s,n);this.style.setProperty(t,o)}};$h(v.prototype,Jr.prototype);var Bh=Symbol.for("#insertInto"),ho=Symbol.for("#removeFrom");function Af(i,t={}){let e=L.context;L.context=t;let r=i(t);return L.context==t&&(L.context=e),r}function Hh(i,t){let e=t||globalThis.document.body,r=i;if(i instanceof Function){let s=new H(e,null),n=function(){let o=L.context;L.context=s;let l=i(s);return L.context==s&&(L.context=o),l};r=n(),k.listen("commit",n)}else r.__F|=64;return r[Bh](e),r}function Wh(i){return i&&i[ho]&&i[ho](i.parentNode),i}var uo=globalThis.imba||(globalThis.imba={});uo.mount=Hh;uo.unmount=Wh;function It(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function Xt(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Qt=Symbol.for("##onchange"),Zt=Symbol.for("#afterVisit"),Jt=Symbol.for("##oninput"),Ye=Symbol.for("##onclick"),te=Symbol.for("##bound"),ft=Symbol.for("##visitContext");function qf(){return globalThis.imba.uses_dom_bind=!0,!0}var Yh={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},ti=function(i){return i instanceof Array||i&&i.has instanceof Function},li=function(i,t){return i==t?!0:i instanceof Array?i.indexOf(t)>=0:i&&i.has instanceof Function?i.has(t):i&&i.contains instanceof Function?i.contains(t):!1},hi=function(i,t){if(i instanceof Array)return i.push(t);if(i&&i.add instanceof Function)return i.add(t)},ui=function(i,t){if(i instanceof Array){let e=i.indexOf(t);if(e>=0)return i.splice(e,1)}else if(i&&i.delete instanceof Function)return i.delete(t)};function Gh(i){function t(){return i[0]?i[0][i[1]]:void 0}function e(r){return i[0]?i[0][i[1]]=r:null}return{get:t,set:e}}var ei=class{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this[te]&&Yh[this.nodeName]&&(this[te]=!0,this[Qt]&&this.addEventListener("change",this[Qt]=this[Qt].bind(this)),this[Jt]&&this.addEventListener("input",this[Jt]=this[Jt].bind(this),{capture:!0}),this[Ye]&&this.addEventListener("click",this[Ye]=this[Ye].bind(this),{capture:!0})),Object.defineProperty(this,t,r instanceof Array?Gh(r):r),r}};It(v.prototype,ei.prototype);Object.defineProperty(v.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(i){return this.setRichValue(i)}});var ri=class{[Qt](t){let e=this.data,r=this.$$value;this.$$value=void 0;let s=this.getRichValue();if(this.multiple){if(r)for(let n=0,o=Xt(r),l=o.length;n<l;n++){let h=o[n];s.indexOf(h)==-1&&ui(e,h)}for(let n=0,o=Xt(s),l=o.length;n<l;n++){let h=o[n];(!r||r.indexOf(h)==-1)&&hi(e,h)}}else this.data=s[0];return C(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=Xt(this.selectedOptions),s=r.length;e<s;e++){let n=r[e];t.push(n.richValue)}return this.$$value=t}syncValue(){let t=this.data;if(this.multiple){let e=[];for(let r=0,s=Xt(this.options),n=s.length;r<n;r++){let o=s[r],l=o.richValue,h=li(t,l);o.selected=h,h&&e.push(l)}this.$$value=e}else for(let e=0,r=Xt(this.options),s=r.length;e<s;e++){let o=r[e].richValue;if(o==t){this.$$value=[o],this.selectedIndex=e;break}}}[Zt](){if(this.syncValue(),this[ft])return this[ft]=null}};It(wn.prototype,ri.prototype);var ii=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};It(On.prototype,ii.prototype);var si=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[Jt](t){return this.data=this.value,C()}[Zt](){let t=this.data;if(t==null&&(t=""),this[te]&&this.value!=t&&(this.value=t),this[ft])return this[ft]=null}};It(En.prototype,si.prototype);var ni=class{[Jt](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,C()}[Qt](t){let e=this.data,r=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let s=this.checked;ti(e)?s?hi(e,r):ui(e,r):this.data=s?r:!1}return C()}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}[Zt](){if(this[te]){let t=this.type;if(t=="checkbox"||t=="radio"){let e=this.data;e===!0||e===!1||e==null?this.checked=!!e:this.checked=li(e,this.richValue)}else this.richValue=this.data}this[ft]&&(this[ft]=null)}};It(Tn.prototype,ni.prototype);var oi=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}[Ye](t){let e=this.data,r=this.checked,s=this.richValue;return ti(e)?r?ui(e,s):hi(e,s):this.$$value==null?this.data=!r:this.data=r?null:s,this[Zt](),C()}[Zt](){if(this[te]){let t=this.data,e=this.$$value==null?!0:this.$$value;ti(t)?this.checked=li(t,e):this.checked=t==e}this[ft]&&(this[ft]=null)}};It(Nn.prototype,oi.prototype);function ao(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Xh=Symbol.for("#getSlot"),Qh=Symbol.for("#container"),Jh=Symbol.for("#afterVisit"),vt=Symbol.for("#__init__"),fo=Symbol.for("#__initor__"),co=Symbol.for("#__inited__"),Ge=Symbol.for("#listeners"),X=Symbol.for("#slot"),Zh=Symbol.for("#parent"),z=Symbol.for("##container"),ai=Symbol.for("#domTarget"),po=Symbol.for("#insertInto"),tu=Symbol.for("#removeFrom"),eu=Symbol.for("#teleport"),ru=Symbol.for("#self"),iu=Symbol.for("#target"),mo=Symbol(),ee=class extends Lt{static[vt](){return this.prototype[fo]=mo,this}constructor(){super(...arguments),super[vt]||this[vt](),this[fo]===mo&&this[co]&&this[co]()}[vt](t=null){super[vt]&&super[vt](...arguments),this.to=t?t.to:void 0}build(){return this[Ge]=[],this.win=globalThis,this.doc=globalThis.document}setup(){return this.setAttribute("style","display:none !important;")}[Xh](t,e){return this[X]||(this[X]=ze(0,this[Zh])),this[X]}get[Qh](){if(!this[z]){let t=this.className;this[z]=this.doc.createElement("div"),this[z].className=t,this[z].style.cssText="display:contents !important;"}return this[z]}get domTarget(){return this[ai]||(this[ai]=this.to instanceof v?this.to:this.closest(this.to)||this.doc.querySelector(this.to))}get eventTarget(){return this.domTarget}get style(){return this[z]?this[z].style:super.style}get classList(){return this[z]?this[z].classList:super.classList}get className(){return this[z]?this[z].className:super.className}set className(t){this[z]?this[z].className=t:super.className=t}[Jh](){if(this.mountedΦ&&this[X]&&!this[X].parentNode)return this[X][po](this.target)}mount(){for(let e=0,r=ao(this[Ge]),s=r.length;e<s;e++){let[n,o,l]=r[e];this.eventTarget.addEventListener(n,o,l)}let t=this.domTarget;return this[X]&&this[X][po](t),this}unmount(){for(let t=0,e=ao(this[Ge]),r=e.length;t<r;t++){let[s,n,o]=e[t];this.eventTarget.removeEventListener(s,n,o)}return this[X]&&this[X][tu](this.domTarget),this[ai]=null,this}addEventListener(t,e,r={}){var s;if(e[eu]=this,e[ru]=this,this[Ge].push([t,e,r]),this.mountedΦ&&((s=this.eventTarget)==null?void 0:s.addEventListener))return this.eventTarget.addEventListener(t,e,r)}};ee[vt]();var fi=class extends ee{get domTarget(){return this.doc.body}get eventTarget(){return this.win}addEventListener(t,e,r={}){return e[iu]=this.domTarget.parentNode,super.addEventListener(...arguments)}on$resize(t,e,r,s){return this.addEventListener("resize",r,s),r}};globalThis.customElements&&(globalThis.customElements.define("i-teleport",ee),globalThis.customElements.define("i-global",fi));function Hf(){return globalThis.imba.uses_dom_teleport=!0,!0}function ct(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function su(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var st=Symbol.for("#__init__"),Xe=Symbol.for("#__initor__"),Qe=Symbol.for("#__inited__"),ci=Symbol.for("#insertInto"),di=Symbol.for("#removeFrom"),nu=Symbol.for("#all"),re=Symbol.for("#phase"),it=Symbol.for("#nodes"),ou=Symbol.for("#sizes"),go=Symbol.for("#mode"),yo=Symbol.for("#enabled"),lu=Symbol.for("#easer"),bo=Symbol.for("#anims"),pi=Symbol.for("#_easer_"),_o=Symbol(),vo=Symbol(),Je=class extends zt{static[st](){return this.prototype[Xe]=_o,this}constructor(){super(...arguments),super[st]||this[st](),this[Xe]===_o&&this[Qe]&&this[Qe]()}[st](t=null){var e;super[st]&&super[st](...arguments),this.selectors=t&&(e=t.selectors)!==void 0?e:{}}addSelectors(t,e){var r;return((r=this.selectors)[e]||(r[e]=[])).push(...t),!0}getSelectors(...t){let e=[];for(let r=0,s=ct(t),n=s.length;r<n;r++){let o=s[r];this.selectors[o]&&e.push(...this.selectors[o])}return e&&e.length?e.join(","):null}nodesForBase(t,e="transition"){let r=[t],s=(this.selectors[e]||[]).join(",");if(s=="")return r;let n=t.querySelectorAll(s);for(let o=0,l=ct(n),h=l.length;o<h;o++){let u=l[o];u.closest("._ease_")==t&&r.push(u)}return r[nu]=n,r}nodesWithSize(t,e="in"){let r=this.getSelectors("_off_sized","_"+e+"_sized");return r?t.filter(function(s){return s.matches(r)}):[]}};Je[st]();var mi=new Je,hu=globalThis.imba||(globalThis.imba={});hu.transitions=mi;var Ze=class extends zt{static[st](){return this.prototype[Xe]=vo,this}constructor(t){super(),this.dom=t,this[re]=null,this[it]=[],this[ou]=new Map,this[Xe]===vo&&this[Qe]&&this[Qe]()}log(...t){}get flags(){return this.dom.flags}flag(t){for(let e=0,r=ct(this[it]),s=r.length;e<s;e++)r[e].flags.add(t);return this}unflag(t){for(let e=0,r=ct(this[it]),s=r.length;e<s;e++)r[e].flags.remove(t);return this}commit(){return this.dom.offsetWidth}enable(t){return t&&(this[go]=t),this[yo]!=!0&&(this[yo]=!0,!0)?(this.dom[ci]=this[ci].bind(this),this.dom[di]=this[di].bind(this),this.flags.add("_ease_")):this}disable(){return this.flags.remove("_ease_"),!0}set phase(t){var r,s,n,o,l,h,u,c,a,p,_,f;let e=this[re];this[re]!=t&&(this[re]=t,!0)&&(e&&this.unflag("@"+e),t&&this.flag("@"+t),t||(this.unflag("@out"),this.unflag("@in"),this.unflag("@off"),this[it]=null),t=="enter"&&e=="leave"&&((s=(r=this.dom)==null?void 0:r.transitionΞoutΞcancel)==null||s.call(r,this)),t=="leave"&&e=="enter"&&((o=(n=this.dom)==null?void 0:n.transitionΞinΞcancel)==null||o.call(n,this)),t=="enter"&&((h=(l=this.dom)==null?void 0:l.transitionΞin)==null||h.call(l,this)),t=="leave"&&((c=(u=this.dom)==null?void 0:u.transitionΞout)==null||c.call(u,this)),e=="leave"&&!t&&((p=(a=this.dom)==null?void 0:a.transitionΞoutΞend)==null||p.call(a,this)),e=="enter"&&!t&&((f=(_=this.dom)==null?void 0:_.transitionΞinΞend)==null||f.call(_,this)))}get phase(){return this[re]}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:De().getAnimations()};return this.commit(),t(),this.commit(),r.after=De().getAnimations(),r.fresh=r.after.filter(function(s){return r.before.indexOf(s)==-1}),r.deep=r.fresh.filter(function(s){let n;return!!((n=s.effect.target)&&n.closest("._ease_")!=e.dom)}),r.own=r.fresh.filter(function(s){return r.deep.indexOf(s)==-1}),r.own.length?r.finished=new Promise(function(s){let n=new Set(r.own),o=function(){if(n.delete(this),n.size==0)return s()};for(let l=0,h=ct(r.own),u=h.length;l<u;l++){let c=h[l];c[lu]=e,c.addEventListener("finish",o,{once:!0}),c.addEventListener("cancel",o,{once:!0})}}):r.finished=Promise.resolve(!0),r}getAnimatedNodes(){return mi.nodesForBase(this.dom)}getNodeSizes(t="in",e=this[it]){let r=mi.nodesWithSize(e,t),s=new Map;for(let n=0,o=ct(r),l=o.length;n<l;n++){let h=o[n],u=window.getComputedStyle(h);s.set(h,{width:u.width,height:u.height})}return s}applyNodeSizes(t){for(let[e,r]of ct(t))e.style.width=r.width,e.style.height=r.height;return t}clearNodeSizes(t){if(!!t){for(let[e,r]of ct(t))e.style.removeProperty("width"),e.style.removeProperty("height");return t}}[ci](t,e){var h,u;var r=this;let s;if(this.enteringΦ)return this.dom;let n=function(){if(s&&r.clearNodeSizes(s),r.enteringΦ)return r.phase=null};if(r.leavingΦ)return r.track(function(){return r.phase="enter",r.unflag("@off"),r.unflag("@out")}).finished.then(n,function(a){return r.log("error cancel leave",a)}),r.dom;let o=De().contains(t);return e?t.insertBefore(r.dom,e):t.appendChild(r.dom),this[it]=r.getAnimatedNodes(),r.flag("_instant_"),r.unflag("@out"),r.commit(),s=this[it].sized=r.getNodeSizes("in"),(u=(h=r.dom)==null?void 0:h.transitionΞinΞinit)==null||u.call(h,r),r.flag("@off"),r.flag("@in"),r.flag("@enter"),r.commit(),r.unflag("_instant_"),(this[bo]=r.track(function(){return r.phase="enter",r.applyNodeSizes(s),r.unflag("@off"),r.unflag("@in")})).finished.then(n,function(c){return r.clearNodeSizes(s),r.log("cancelled insert into",c)}),r.dom}[di](t){var e=this;if(this.leavingΦ)return;let r,s=function(){if(e.phase=="leave")return e.dom.emit("easeoutend",{}),t.removeChild(e.dom),e.phase=null};if(e.enteringΦ&&this[go]!="forward"){let o=e.track(function(){return e.flag("@off"),e.flag("@in"),e.unflag("@out"),e.phase="leave",e.clearNodeSizes(e[it].sized)});e.log("cancel enter anims own",o.own,o),o.finished.then(s,function(l){return e.log("error cancel entering",l)});return}this[it]=e.getAnimatedNodes(),r=e.getNodeSizes("out"),e.applyNodeSizes(r),e.flag("@leave");let n=this[bo]=e.track(function(){return e.phase="leave",e.flag("@off"),e.flag("@out"),e.clearNodeSizes(r)});if(!n.own.length){s();return}n.finished.then(s,function(){return!0})}};Ze[st]();var gi=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[pi]||(this[pi]=new Ze(this))}set ease(t){var e,r;if(t==!1){(r=(e=this[pi])==null?void 0:e.disable)==null||r.call(e);return}this.ease.enable(t)}};su(v.prototype,gi.prototype);function Xf(){return globalThis.imba.uses_dom_transitions=!0,!0}function uu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function xo(){return globalThis.imba.uses_events_keyboard=!0,!0}var yi=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}};uu(Sn.prototype,yi.prototype);function au(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function tr(){return globalThis.imba.uses_events_mouse=!0,!0}var bi=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}};au(vn.prototype,bi.prototype);function Ti(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function _i(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var fu=Symbol.for("#extendType"),cu=Symbol.for("#modifierState"),er=Symbol.for("#sharedModifierState"),So=Symbol.for("#onceHandlerEnd");var wo=Symbol.for("#extendDescriptors"),q=Symbol.for("#context"),To=Symbol.for("#self"),du=Symbol.for("#target"),Eo=Symbol.for("#stopPropagation"),No=Symbol.for("#defaultPrevented"),pu=Symbol.for("#teleport");xo();tr();var vi=class{[fu](t){var e,r,s;let n=t[wo]||(t[wo]=(r=Object.getOwnPropertyDescriptors(t.prototype),s=r.constructor,delete r.constructor,r));return Object.defineProperties(this,n)}};Ti(N.prototype,vi.prototype);var xi=class{get[cu](){var t,e;return(t=this[q])[e=this[q].step]||(t[e]={})}get[er](){var t,e;return(t=this[q].handler)[e=this[q].step]||(t[e]={})}[So](t){return R(this[q],"end",t)}αsel(t){return!!this.target.matches(String(t))}αclosest(t){return!!this.target.closest(String(t))}αlog(...t){return console.info(...t),!0}αtrusted(){return!!this.isTrusted}αif(t){return!!t}αwait(t=250){return new Promise(function(e){return setTimeout(e,qt(t))})}αself(){return this.target==this[q].element}αcooldown(t=250){let e=this[er];return e.active?!1:(e.active=!0,e.target=this[q].element,e.target.flags.incr("cooldown"),this[So](function(){return setTimeout(function(){return e.target.flags.decr("cooldown"),e.active=!1},qt(t))}),!0)}αthrottle(t=250){let e=this[er];return e.active?(e.next&&e.next(!1),new Promise(function(r){return e.next=function(s){return e.next=null,r(s)}})):(e.active=!0,e.el||(e.el=this[q].element),e.el.flags.incr("throttled"),R(this[q],"end",function(){let r=qt(t);return e.interval=setInterval(function(){e.next?e.next(!0):(clearInterval(e.interval),e.el.flags.decr("throttled"),e.active=!1)},r)}),!0)}αdebounce(t=250){let e=this[er],r=this;return e.queue||(e.queue=[]),e.queue.push(e.last=r),new Promise(function(s){return setTimeout(function(){return e.last==r?(r.debounced=e.queue,e.last=null,e.queue=[],s(!0)):s(!1)},qt(t))})}αflag(t,e){let{element:r,step:s,state:n,id:o,current:l}=this[q],h=e instanceof v?e:e?r.closest(e):r;if(!h)return!0;this[q].commit=!0,n[s]=o,h.flags.incr(t);let u=Date.now();return R(l,"end",function(){let c=Date.now()-u,a=Math.max(250-c,0);return setTimeout(function(){return h.flags.decr(t)},a)}),!0}αbusy(t){return this.αflag("busy",t)}αoutside(){let{handler:t}=this[q];if(t&&t[To])return!t[To].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)}};Ti(Y.prototype,xi.prototype);var uc={};function ac(){return globalThis.imba.uses_events=!0,!0}var Si=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 _i(this.currentEvents))e.aborted=!0,(t=e==null?void 0:e.resolver)==null||t.call(e,!0);return this}emit(t,...e){return j(this,t,e)}on(t,...e){return $(this,t,...e)}once(t,...e){return R(this,t,...e)}un(t,...e){return bt(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){let e=this[du]||t.currentTarget,r=this.params,s=null,n=r.silence||r.silent;this.count||(this.count=0),this.state||(this.state={});let o={element:e,event:t,modifiers:r,handler:this,id:++this.count,step:-1,state:this.state,commit:null,current:null,aborted:!1};if(o.current=o,t.handle$mod&&t.handle$mod.apply(o,r.options||[])==!1)return;let l=Y[this.type+"$handle"]||Y[t.type+"$handle"]||t.handle$mod||this.guard;if(!(l&&l.apply(o,r.options||[])==!1)){this.currentEvents||(this.currentEvents=new Set),this.currentEvents.add(o);for(let h=0,u=Object.keys(r),c=u.length,a,p;h<c&&(a=u[h],p=r[a],!o.aborted);h++){if(o.step++,a[0]=="_")continue;a.indexOf("~")>0&&(a=a.split("~")[0]);let _=null,f=[t,o],d,m=null,g,b=!1,E=typeof a=="string";if(a[0]=="$"&&a[1]=="_"&&p[0]instanceof Function)a=p[0],a.passive||(o.commit=!0),f=[t,o].concat(p.slice(1)),m=e;else if(p instanceof Array){f=p.slice(),_=f;for(let y=0,x=_i(f),P=x.length;y<P;y++){let D=x[y];if(typeof D=="string"&&D[0]=="~"&&D[1]=="$"){let Se=D.slice(2).split("."),we=o[Se.shift()]||t;for(let xr=0,Rs=_i(Se),zl=Rs.length;xr<zl;xr++){let ql=Rs[xr];we=we?we[ql]:void 0}f[y]=we}}}if(typeof a=="string"&&(g=a.match(/^(emit|flag|mod|moved|pin|fit|refit|map|remap|css)-(.+)$/))&&(_||(_=f=[]),f.unshift(g[2]),a=g[1]),a=="trap")t[Eo]=!0,t.stopImmediatePropagation(),t[No]=!0,t.preventDefault();else if(a=="stop")t[Eo]=!0,t.stopImmediatePropagation();else if(a=="prevent")t[No]=!0,t.preventDefault();else if(a=="commit")o.commit=!0;else if(a=="once")e.removeEventListener(t.type,this);else{if(a=="options"||a=="silence"||a=="silent")continue;if(a=="emit"){let y=f[0],x=f[1],P=new N(y,{bubbles:!0,detail:x});P.originalEvent=t;let vr=(this[pu]||e).dispatchEvent(P)}else if(typeof a=="string"){a[0]=="!"&&(b=!0,a=a.slice(1));let y="α"+a,x=t[y];x||(x=this.type&&Y[this.type+"$"+a+"$mod"]),x||(x=t[a+"$mod"]||Y[t.type+"$"+a]||Y[a+"$mod"]),x instanceof Function?(a=x,m=o,f=_||[],t[y]&&(m=t,t[q]=o)):a[0]=="_"?(a=a.slice(1),m=this.closure):m=this.getHandlerForMethod(e,a)}}try{a instanceof Function?d=a.apply(m||e,f):m&&(d=m[a].apply(m,f)),d&&d.then instanceof Function&&d!=k.$promise&&(o.commit&&!n&&k.commit(),d=await d)}catch(y){s=y;break}if(b&&d===!0||!b&&d===!1)break;o.value=d}if(j(o,"end",o),o.commit&&!n&&k.commit(),this.currentEvents.delete(o),this.currentEvents.size==0&&this.emit("idle"),s!=null){if(this.type!="error"){let h=s instanceof Error?s.message:s,u=new N("error",{detail:h,bubbles:!0,cancelable:!0});u.error=s,u.originalEvent=t;let c=e.dispatchEvent(u);if(u.defaultPrevented)return}throw s}return o}}},wi=class{on$(t,e,r){let s="on$"+t,n;n=new Si(e,r);let o=e.capture||!1,l=e.passive,h=o;return l&&(h={passive:l,capture:o}),this[s]instanceof Function?n=this[s](e,r,n,h):this.addEventListener(t,n,h),n}on$error(t,e,r,s){var n;return(n=t.options)!=null&&n.length&&(r.guard=function(...o){let l=this.event.error;return!!o.find(function(u){return l instanceof u})}),this.addEventListener("error",r,s),r}};Ti(v.prototype,wi.prototype);var rr=new class{get iosΦ(){let i=globalThis.navigator.platform||"";return!!(i.match(/iPhone|iPod|iPad/)||i=="MacIntel"&&globalThis.navigator.maxTouchPoints>2)}};function Ft(i,t){let e=t;return i instanceof Element?i:typeof i=="string"?i=="this"||i==""?e:i=="up"?e.parentNode:i=="op"?e.offsetParent:e.closest(i)||e.querySelector(i)||globalThis.document.querySelector(i):null}function dt(i){if(typeof i=="string"){let[t,e,r]=i.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(e),r]}else if(typeof i=="number")return[i]}function ir(i,t=1){let e=1/t;return Math.round(i*e)/e}function mu(i,t,e){return t>e?Math.max(e,Math.min(t,i)):Math.min(e,Math.max(t,i))}function Ei(i,t,e,r,s=.1){let[n,o]=dt(e),[l,h]=dt(r),[u,c]=dt(s);return o=="%"&&(n=(t-i)*(n/100)),h=="%"&&(l=(t-i)*(l/100)),c=="%"&&(u=(l-n)*(u/100)),function(a,p){let _=(a-i)/(t-i),f=n+(l-n)*_;return s&&(f=ir(f,u)),p&&(f=mu(f,n,l)),f}}function gu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}tr();function yc(){return globalThis.imba.uses_events_pointer=!0,!0}var Oi=class{αprimary(){return!!this.isPrimary&&(this.pointerType!="mouse"||this.button==0)}αmouse(){return this.pointerType=="mouse"}αpen(){return this.pointerType=="pen"}αtouch(){return this.pointerType=="touch"}αpressure(t=.5){return this.pressure>=t}αlock(){return!0}};gu(xn.prototype,Oi.prototype);function yu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var Oo=Symbol.for("#capture"),Q=Symbol.for("#step"),bu=Symbol.for("#cancel"),Ci=Symbol.for("#reframe");var Co=Symbol.for("#mods"),Pi=Symbol.for("#dx"),ki=Symbol.for("#dy"),pt=Symbol.for("#context"),sr=Symbol.for("#locked"),Io=Symbol.for("#teardown"),Po=Symbol.for("#x"),ko=Symbol.for("#y"),_u=Symbol.for("#pinTarget");function xc(){return globalThis.imba.uses_events_touch=!0,!0}var Lo=null,Li=class{constructor(t,e,r){this.phase="init",this.events=[],this.originalEvent=t,this.handler=e,this.target=this.currentTarget=r,this[Co]={}}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[Pi]==null?this.event.x-this.start.x:this[Pi]}get dy(){return this[ki]==null?this.event.y-this.start.y:this[ki]}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 j(this,t,e)}on(t,...e){return $(this,t,...e)}once(t,...e){return R(this,t,...e)}un(t,...e){return bt(this,t,...e)}αflag(t,e){let{element:r}=this[pt],s=Date.now(),n=e instanceof v?e:e?r.closest(e):r;return this[Q].setup!=!0&&(this[Q].setup=!0,!0)&&(n.flags.incr(t),R(this,"end",function(){return n.flags.decr(t)})),!0}αlock(){return this[Oo](),!0}[Oo](){if(this[sr]!=!0&&(this[sr]=!0,!0))return this[pt].element.setPointerCapture(this.pointerId)}get[Q](){var t,e;return(t=this[Co])[e=this[pt].step]||(t[e]={})}[bu](){return this[Io]()}αmoved(t,e){let r=this[Q],{element:s,state:n,event:o}=this[pt];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,_]=dt(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,_&&_!="px"&&console.warn("only px threshold allowed in @touch.moved")}if(r.active)return!0;if(r.cancelled)return!1;let l=r.threshold,h=this.x-r.x0,u=this.y-r.y0;r.x=Math.max(r.x,Math.abs(h)),r.y=Math.max(r.y,Math.abs(u)),r.left=Math.max(r.left,-h),r.right=Math.max(r.right,h),r.up=Math.max(r.up,-u),r.down=Math.max(r.down,u),r.dist=Math.max(r.dist,Math.sqrt(h*h+u*u));let c=r[r.dir];if(c>l&&c>=r.x&&c>=r.y){r.active=!0;let a=n.pinTarget;return s.flags.incr("@move"),a&&a.flags.incr("@move"),this.preventDefault(),R(this,"end",function(){return a&&a.flags.decr("@move"),s.flags.decr("@move")}),!0}else if(r.x>l||r.y>l)return r.cancelled=!0,!1;return!1}αhold(t=250){var e=this;let r=this[Q],s=this[pt].element;if(r.cancelled)return!1;if(r.setup&&!r.active){let n=this.clientX,o=this.clientY,l=n-r.x,h=o-r.y;Math.sqrt(l*l+h*h)>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 n;return r.timeout=setTimeout(function(){return r.active=!0,e.preventDefault(),s.flags.incr("@hold"),n&&n(!0),n=null},t),R(e,"end",function(){return r.active&&s.flags.decr("@hold"),clearTimeout(r.timeout),n&&n(!1),n=null}),new Promise(function(o){return n=o})}return r.active}αsync(t,e="x",r="y"){let s=this[Q];return s.setup!=!0&&(s.setup=!0,!0)?(s.x=t[e]||0,s.y=t[r]||0,s.tx=this.x,s.ty=this.y):(e&&(t[e]=s.x+(this.x-s.tx)),r&&(t[r]=s.y+(this.y-s.ty))),this[pt].commit=!0,!0}αapply(t,e="x",r="y"){return e&&(t[e]=this.x),r&&(t[r]=this.y),this[pt].commit=!0,!0}αcss(t="x",e="y"){let r=this[Q];if(r.setup!=!0&&(r.setup=!0,!0))r.el=this[pt].element,r.x=r.el[Po]||0,r.y=r.el[ko]||0,r.tx=this.x,r.ty=this.y;else{let s=r.el[Po]=r.x+(this.x-r.tx),n=r.el[ko]=r.y+(this.y-r.ty);t&&r.el.style.setProperty("--x",s+"px"),e&&r.el.style.setProperty("--y",n+"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=.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=ir(this.x,t),this.y=ir(this.y,e),!0}[Ci](...t){let e=this[Q];if(e.setup!=!0&&(e.setup=!0,!0)){let r=this.target,s=t.length,n=t[0],o=0,l="100%",h=0,u=typeof n;u=="number"||u=="string"&&/^([-+]?\d[\d\.]*)(%|\w+)$/.test(n)||n instanceof Array?n=null:u=="string"&&(n=="this"||n==""?n=r:n=="up"?n=r.parentNode:n=="op"?n=r.offsetParent:n=r.closest(n)||r.querySelector(n)),n==null&&(s++,t.unshift(n=r)),s==2?h=t[1]:s>2&&([o,l,h=0]=t.slice(1));let c=n.getBoundingClientRect();o instanceof Array||(o=[o,o]),l instanceof Array||(l=[l,l]),h instanceof Array||(h=[h,h]),e.rect=c,e.x=Ei(c.left,c.right,o[0],l[0],h[0]),e.y=Ei(c.top,c.bottom,o[1],l[1],h[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),s=this.y=e.y(this.y,e.clamp);this[Pi]=r-this.x0,this[ki]=s-this.y0}return!0}αfit(...t){return this[Q].clamp=!0,this[Ci](...t)}αreframe(...t){return this[Ci](...t)}αpin(...t){let e=this[Q];if(e.setup!=!0&&(e.setup=!0,!0)){let r=Ft(t[0],this.target);r instanceof v||t.unshift(r=this.target);let s=t[1]||0,n=t[2]==null?t[2]=s:t[2],o=r.getBoundingClientRect();e.x=this.clientX-(o.left+o.width*s),e.y=this.clientY-(o.top+o.height*n),r&&(this[_u]=r,r.flags.incr("_touch_"),R(this,"end",function(){return r.flags.decr("_touch_")}))}return this.x-=e.x,this.y-=e.y,!0}},Ii=class{on$touch(t,e,r,s){return r.type="touch",this.addEventListener("pointerdown",r,{passive:!1}),rr.iosΦ&&globalThis.parent!=globalThis&&Lo!=!0&&(Lo=!0,!0)&&globalThis.parent.postMessage("setupTouchFix"),r}};yu(v.prototype,Ii.prototype);if(globalThis.parent==globalThis&&rr.iosΦ){let i=function(t){if(t.data=="setupTouchFix")return globalThis.addEventListener("touchmove",function(){return!1},{passive:!1}),globalThis.removeEventListener("message",i)};globalThis.addEventListener("message",i)}Y.touch$handle=function(){let i=this.event,t=this.element,e=this.state.pointerId,r=this.modifiers,s=this.handler,n=rr.iosΦ;if(this.current=this.state,e!=null)return e==i.pointerId;if(r.ctrl&&!i.ctrlKey||r.alt&&!i.altKey||r.meta&&!i.metaKey||r.shift&&!i.shiftKey||r.if&&!r.if[0]||r.self&&i.target!=t||r.primary&&!i.isPrimary||r.pen&&i.pointerType!="pen"||r.mouse&&i.pointerType!="mouse"||r.touch&&i.pointerType!="touch"||r.sel&&!i.target.matches(String(r.sel[0])))return;let o=this.state=s.state=this.current=new Li(i,s,t);e=o.pointerId;let l=function(f){return f.preventDefault(),!1},h=null,u=Symbol(),c=function(f){let d=o.clientX,m=o.clientY,g=f.clientX,b=f.clientY;(o[sr]||o.defaultPrevented)&&(f.pointerId==o.pointerId||d==g&&m==b)&&(f.preventDefault(),f.stopPropagation()),c&&(globalThis.removeEventListener("click",c,{capture:!0}),c=null)},a=function(f){if(!(o.type=="touchmove"&&f.changedTouches[0].identifier!=e)&&(o.defaultPrevented||o[sr]))return f.preventDefault()},p=function(f){let d=f.type,m=o.phase;if(f.pointerId&&o.pointerId!=f.pointerId||f[u])return;f[u]=!0;let g=d=="pointerup"||d=="pointercancel";if(f.pressure==0&&f.pointerType=="mouse"&&d=="pointermove"&&o.originalEvent.pressure>0)return h(f);d=="pointercancel"?(o.x=o.clientX,o.y=o.clientY):(o.x=f.clientX,o.y=f.clientY),o.event=f,g&&(o.phase="ended");try{s.handleEvent(o)}catch{}if(m=="init"&&!g&&(o.phase="active"),g&&h)return h(f)},_=!1;return h=function(f){if(!_&&(_=!0,t.flags.decr("_touch_"),o.phase!="ended"&&(o.phase="ended",o.x=o.clientX,o.y=o.clientY,s.handleEvent(o)),o.emit("end"),r.passive||--s.prevents==0&&t.style.removeProperty("touch-action"),s.state={},globalThis.removeEventListener("pointermove",p,{passive:!!r.passive}),globalThis.removeEventListener("pointerup",p),globalThis.removeEventListener("pointercancel",p),setTimeout(function(){if(c&&(globalThis.removeEventListener("click",c,{capture:!0}),c=null),n&&a)return globalThis.removeEventListener("touchend",a),globalThis.removeEventListener("touchmove",a,{passive:!1}),a=null},100),!r.passive))return globalThis.document.removeEventListener("selectstart",l,{capture:!0})},o[Io]=h,r.passive||(s.prevents||(s.prevents=0),s.prevents++,t.style.setProperty("touch-action","none"),t.offsetWidth),t.flags.incr("_touch_"),globalThis.addEventListener("pointermove",p,{passive:!!r.passive}),globalThis.addEventListener("pointerup",p),globalThis.addEventListener("pointercancel",p),globalThis.addEventListener("click",c,{capture:!0}),n&&!r.passive&&(globalThis.addEventListener("touchend",a),globalThis.addEventListener("touchmove",a,{passive:!1})),r.passive||globalThis.document.addEventListener("selectstart",l,{capture:!0}),p(i),!1};function Do(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function vu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var xu=Symbol.for("#context"),Su=Symbol.for("#extendType");function Tc(){return globalThis.imba.uses_events_intersect=!0,!0}var Fo=new(globalThis.WeakMap||Map),Fi={threshold:[0]},wu={};Y.intersect$handle=function(){let i=this.event.detail.observer;return this.modifiers._observer==i};var Mi=class extends Nin(){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:s}=this[xu],n=Ft(e||"",this.target);return this.isIntersecting&&!r[s]?(n.flags.incr(t),r[s]=!0):r[s]&&!this.isIntersecting&&(n.flags.decr(t),r[s]=!1),!0}};function Tu(i,t){return function(e,r){let s=r.prevRatios||(r.prevRatios=new WeakMap);for(let n=0,o=Do(e),l=o.length;n<l;n++){let h=o[n],u=s.get(h.target)||0,c=h.intersectionRatio,a={entry:h,ratio:c,from:u,delta:c-u,observer:r},p=new N(i,{bubbles:!1,detail:a});p[Su](Mi),p.entry=h,p.isIntersecting=h.isIntersecting,p.delta=a.delta,p.ratio=a.ratio,s.set(h.target,c),h.target.dispatchEvent(p)}}}function Mo(i=Fi){let t=i.threshold.join("-")+i.rootMargin;!i.root&&Fi.root&&(i.root||(i.root=Fi.root));let e=i.root||wu,r=Fo.get(e);return r||Fo.set(e,r={}),r[t]||(r[t]=new IntersectionObserver(Tu("intersect",t),i))}var Di=class{on$intersect(t,e,r,s){let n;if(t.options){let o=[],l={threshold:o};for(let h=0,u=Do(t.options),c=u.length;h<c;h++){let a=u[h];a instanceof v||a instanceof Yt?l.root=a:typeof a=="number"?o.push(a):typeof a=="string"?l.rootMargin=a:typeof a=="object"&&Object.assign(l,a)}if(o.length==1){let h=o[0];if(h>1)for(o[0]=0;o.length<h;)o.push(o.length/(h-1))}o.length==0&&o.push(0),n=Mo(l)}else n=Mo();return t._observer=n,n.observe(this),this.addEventListener("intersect",r,s),r}};vu(v.prototype,Di.prototype);function Eu(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function Nu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var Ri=Symbol.for("#width"),Ai=Symbol.for("#height"),Ou=Symbol.for("#extendType");function Cc(){return globalThis.imba.uses_events_resize=!0,!0}var nr=null,$i=class extends N{αcss(t="1elw",e="1elh",r=""){var n;let s=(n=this.entry)==null?void 0:n.target;if(s&&s.offsetParent){let o=dt(t),l=dt(e),h=Ft(r,s),u=o?"--u_"+o[1]:"--"+t,c=l?"--u_"+l[1]:"--"+e,a=o?this.width/o[0]:this.width,p=l?this.height/l[0]:this.height;h.style.setProperty(u,a),h.style.setProperty(c,p)}return!0}get width(){return this[Ri]==null?this[Ri]=this.entry.target.offsetWidth:this[Ri]}get height(){return this[Ai]==null?this[Ai]=this.entry.target.offsetHeight:this[Ai]}};function Cu(){return globalThis.ResizeObserver||nr||(console.warn(":resize not supported in this browser"),nr={observe:function(){return!0}}),nr||(nr=new ResizeObserver(function(i){for(let t=0,e=Eu(i),r=e.length;t<r;t++){let s=e[t],n=new N("resize",{bubbles:!1,detail:s});n.entry=s,n.rect=s.contentRect,n[Ou]($i),s.target.dispatchEvent(n);let o=new N("resized",{bubbles:!0,detail:s});s.target.dispatchEvent(o)}}))}var ji=class{on$resize(t,e,r,s){return Cu().observe(this),this.addEventListener("resize",r,s),r}};Nu(v.prototype,ji.prototype);function Pu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var ku=Symbol.for("#extendType"),Lu=Symbol.for("#options");function Ic(){return globalThis.imba.uses_events_mutate=!0,!0}var zi=class extends N{},qi=class{on$mutate(t,e,r,s){var n=this;r.observer||(r.observer=new MutationObserver(function(l){let h=new N("mutate",{bubbles:!1,detail:l});return h[ku](zi),n.dispatchEvent(h)}));let o=r[Lu]={};return t.subtree&&(o.subtree=!0),t.childList&&(o.childList=!0),!o.attributes&&!o.childList&&(o.childList=!0),r.observer.observe(n,o),n.addEventListener("mutate",r,s),r}};Pu(v.prototype,qi.prototype);function Iu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function Rc(){return globalThis.imba.uses_events_selection=!0,!0}var Vi,Ro=Symbol();function Fu(){if(!Vi)return Vi=function(i){if(i[Ro])return;i[Ro]=!0;let t=globalThis.document.activeElement;if(t&&t.matches("input,textarea")){let e=new N("selection",{detail:{start:t.selectionStart,end:t.selectionEnd}});return t.dispatchEvent(e)}},globalThis.document.addEventListener("selectionchange",Vi)}var Ki=class{on$selection(t,e,r,s){return Fu(),this.addEventListener("selection",r,s),r}};Iu(v.prototype,Ki.prototype);var Ao=Symbol.for("#string"),$o=Symbol.for("#html"),J={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:"⌫"}}};J.auto=J.win;(globalThis.navigator.platform||"").match(/iPhone|iPod|iPad|Mac/)&&(J.auto=J.mac);var Ui={};function jo(i,t="auto"){let e=""+i+":"+t;if(Ui[e])return Ui[e];let r=J[t]||J.win,s=i.split(" ").map(function(n){return n.split("+").sort(function(u,c){return r.order.indexOf(c)-r.order.indexOf(u)}).map(function(u){let c=r.labels[u]||u;return c=c[0].toUpperCase()+(c.slice(1)||"")})});return Ui[e]=s}function zo(i,t){var e;let r=jo(i,t),s=J[t]||J.win;return r[Ao]||(r[Ao]=r.map(function(n){return n.join(s.sep)}).join(" "))}function qo(i,t){var e;let r=jo(i,t),s=J[t]||J.win;return r[$o]||(r[$o]=r.map(function(n){return"<kbd>"+n.map(function(o){return"<kbd>"+o+"</kbd>"}).join("")+"</kbd>"}).join(" "))}var mt={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"},Vo={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ko={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},Uo={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},ie;for(Z=1;Z<20;++Z)mt[111+Z]="f"+Z;var Z;for(Z=0;Z<=9;++Z)mt[Z+96]=Z.toString();function Bi(i,t,e){if(i.addEventListener){i.addEventListener(t,e,!1);return}i.attachEvent("on"+t,e)}function Hi(i,t,e){if(i.removeEventListener){i.removeEventListener(t,e,!1);return}i.detachEvent("on"+t,e)}function Bo(i){if(i.type=="keypress"){var t=String.fromCharCode(i.which);return i.shiftKey||(t=t.toLowerCase()),t}return mt[i.which]?mt[i.which]:Vo[i.which]?Vo[i.which]:String.fromCharCode(i.which).toLowerCase()}function Mu(i,t){return i.sort().join(",")===t.sort().join(",")}function Du(i){var t=[];return i.shiftKey&&t.push("shift"),i.altKey&&t.push("alt"),i.ctrlKey&&t.push("ctrl"),i.metaKey&&t.push("meta"),t}function Ru(i){if(i.preventDefault){i.preventDefault();return}i.returnValue=!1}function Au(i){if(i.stopPropagation){i.stopPropagation();return}i.cancelBubble=!0}function Wi(i){return i=="shift"||i=="ctrl"||i=="alt"||i=="meta"}function $u(){if(!ie){ie={};for(var i in mt)i>95&&i<112||mt.hasOwnProperty(i)&&(ie[mt[i]]=i)}return ie}function ju(i,t,e){return e||(e=$u()[i]?"keydown":"keypress"),e=="keypress"&&t.length&&(e="keydown"),e}function zu(i){return i==="+"?["+"]:(i=i.replace(/\+{2}/g,"+plus"),i.split("+"))}function Ho(i,t){var e,r,s,n=[];for(e=zu(i),s=0;s<e.length;++s)r=e[s],Uo[r]&&(r=Uo[r]),t&&t!="keypress"&&Ko[r]&&(r=Ko[r],n.push("shift")),Wi(r)&&n.push(r);return t=ju(r,n,t),{key:r,modifiers:n,action:t}}function Wo(i,t){return i===null||i===document?!1:i===t?!0:Wo(i.parentNode,t)}function I(i){var t=this;if(i=i||document,!(t instanceof I))return new I(i);t.target=i,t._callbacks={},t._directMap={};var e={},r,s=!1,n=!1,o=!1;function l(f){f=f||{};var d=!1,m;for(m in e){if(f[m]){d=!0;continue}e[m]=0}d||(o=!1)}function h(f,d,m,g,b,E){var y,x,P=[],D=m.type;if(!t._callbacks[f])return[];for(D=="keyup"&&Wi(f)&&(d=[f]),y=0;y<t._callbacks[f].length;++y)if(x=t._callbacks[f][y],!(!g&&x.seq&&e[x.seq]!=x.level)&&D==x.action&&(D=="keypress"&&!m.metaKey&&!m.ctrlKey||Mu(d,x.modifiers))){var vr=!g&&x.combo==b,Se=g&&x.seq==g&&x.level==E;(vr||Se)&&t._callbacks[f].splice(y,1),P.push(x)}return P}function u(f,d,m,g){t.stopCallback(d,d.target||d.srcElement,m,g)||f(d,m)===!1&&(Ru(d),Au(d))}t._handleKey=function(f,d,m){var g=h(f,d,m),b,E={},y=0,x=!1;for(b=0;b<g.length;++b)g[b].seq&&(y=Math.max(y,g[b].level));for(b=0;b<g.length;++b){if(g[b].seq){if(g[b].level!=y)continue;x=!0,E[g[b].seq]=1,u(g[b].callback,m,g[b].combo,g[b].seq);continue}x||u(g[b].callback,m,g[b].combo)}var P=m.type=="keypress"&&n;m.type==o&&!Wi(f)&&!P&&l(E),n=x&&m.type=="keydown"};function c(f){typeof f.which!="number"&&(f.which=f.keyCode);var d=Bo(f);if(!!d){if(f.type=="keyup"&&s===d){s=!1;return}t.handleKey(d,Du(f),f)}}function a(){clearTimeout(r),r=setTimeout(l,1e3)}function p(f,d,m,g){e[f]=0;function b(D){return function(){o=D,++e[f],a()}}function E(D){u(m,D,f),g!=="keyup"&&(s=Bo(D)),setTimeout(l,10)}for(var y=0;y<d.length;++y){var x=y+1===d.length,P=x?E:b(g||Ho(d[y+1]).action);_(d[y],P,g,f,y)}}function _(f,d,m,g,b){t._directMap[f+":"+m]=d,f=f.replace(/\s+/g," ");var E=f.split(" "),y;if(E.length>1){p(f,E,d,m);return}y=Ho(f,m),t._callbacks[y.key]=t._callbacks[y.key]||[],h(y.key,y.modifiers,{type:y.action},g,f,b),t._callbacks[y.key][g?"unshift":"push"]({callback:d,modifiers:y.modifiers,action:y.action,seq:g,level:b,combo:f})}t._bindMultiple=function(f,d,m){for(var g=0;g<f.length;++g)_(f[g],d,m)},t.enable=function(){Bi(i,"keypress",c),Bi(i,"keydown",c),Bi(i,"keyup",c)},t.disable=function(){Hi(i,"keypress",c),Hi(i,"keydown",c),Hi(i,"keyup",c)},t.enable()}I.prototype.bind=function(i,t,e){var r=this;return i=i instanceof Array?i:[i],r._bindMultiple.call(r,i,t,e),r};I.prototype.unbind=function(i,t){var e=this;return e.bind.call(e,i,function(){},t)};I.prototype.trigger=function(i,t){var e=this;return e._directMap[i+":"+t]&&e._directMap[i+":"+t]({},i),e};I.prototype.reset=function(){var i=this;return i._callbacks={},i._directMap={},i};I.prototype.stopCallback=function(i,t){var e=this;return(" "+t.className+" ").indexOf(" mousetrap ")>-1||Wo(t,e.target)?!1:t.tagName=="INPUT"||t.tagName=="SELECT"||t.tagName=="TEXTAREA"||t.isContentEditable};I.prototype.handleKey=function(){var i=this;return i._handleKey.apply(i,arguments)};I.addKeycodes=function(i){for(var t in i)i.hasOwnProperty(t)&&(mt[t]=i[t]);ie=null};I.init=function(){var i=I(document);for(var t in i)t.charAt(0)!=="_"&&(I[t]=function(e){return function(){return i[e].apply(i,arguments)}}(t))};function ne(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function qu(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var Yi=Symbol.for("#updateHotKeys"),Vu=Symbol.for("#context"),Ku=Symbol.for("#inInput"),Gi=Symbol.for("#inEditable"),Uu=Symbol.for("#hotkeyTarget"),Go=Symbol.for("#hotkeyCombos"),Bu=Symbol.for("#extendType"),oe=Symbol.for("#combos"),Xi=Symbol.for("#target"),se=Symbol.for("#hotkeyHandlers"),Hu=Symbol.for("#defaultPrevented"),Wu=Symbol.for("#visit"),Yo=Symbol.for("#key"),Yu;try{Yu=(globalThis.navigator.platform||"").match(/iPhone|iPod|iPad|Mac/)}catch{}function Vc(){return globalThis.imba.uses_events_hotkey=!0,!0}var Qi={esc:!0},Ji=class extends N{αfocus(t){let e=this[Vu].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}},Gu=function(i,t,e){return t.tagName=="INPUT"&&(e=="down"||e=="up")?!1:t.tagName=="INPUT"||t.tagName=="SELECT"||t.tagName=="TEXTAREA"?Qi[e]?(i[Ku]=!0,i[Gi]=!0,!1):!0:t.contentEditable&&(t.contentEditable=="true"||t.contentEditable=="plaintext-only")?Qi[e]?(i[Gi]=!0,!1):!0:!1},Xu=new 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 I.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=I(globalThis.document),this.mousetrap.stopCallback=Gu),this.combos[t]||(this.combos[t]=!0,this.mousetrap.bind(t,this.handler)),(e.capture||e.force)&&(Qi[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 zo(t,e)}htmlify(t,e="auto"){return qo(t,e)}matchCombo(t){return!0}handle(t,e){var c;let r=t.target&&t.target[Uu]||t.target||globalThis.document.body,s=Array.from(globalThis.document.querySelectorAll("[data-hotkey]")),n=r.ownerDocument,o=r;for(;o&&o!=n&&o.hotkeys!==!0;)o=o.parentNode;if(s=s.reverse().filter(function(a){let p=a[Go];if(!(p&&(p[e]||p["*"])))return!1;let _=a;for(;_&&_!=n;){if(_.hotkeys===!1)return!1;_=_.parentNode}return!0}),s.length>1){let a=s.filter(function(p){let _=p.getBoundingClientRect();return p.offsetParent||_.width>0||_.height>0});a.length>0&&(s=a)}if(!s.length)return;let l={combo:e,originalEvent:t,targets:s},h=new N("hotkey",{bubbles:!0,detail:l});h[Bu](Ji),h.originalEvent=t,h.hotkey=e,r.dispatchEvent(h);let u=[];for(let a=0,p=ne(s),_=p.length;a<_;a++){let f=p[a];for(let d=0,m=ne(f[se]),g=m.length;d<g;d++){let b=m[d];if(b[oe][e]||b[oe]["*"]){if(b.params.local&&!b[Xi].contains(r))continue;if(!t[Gi]||b.captureΦ||b.params.force){let E=b[Xi];(o.contains(E)||E.contains(o)||b.globalΦ)&&u.push(b)}}}}for(let a=0,p=ne(u),_=p.length;a<_;a++){let f=p[a];if((!t.repeat||f.params.repeat)&&f.handleEvent(h),(!f.passiveΦ||h[Hu])&&((c=t==null?void 0:t.preventDefault)==null||c.call(t)),!f.passiveΦ)break}return this}},Xo=function(i,t){let e=t.element;e instanceof v&&(e.matches("input,textarea,select,option")?e.focus():e.click())};Xo.passive=!0;var Zi=class{on$hotkey(t,e,r,s){var n=this;return this[se]||(this[se]=[]),this[se].push(r),r[Xi]=this,t.$_||(t.$_=[Xo]),t[Wu]=function(){return n[Yi]()},this[Yi](),r}[Yi](){let t={};for(let e=0,r=ne(this[se]),s=r.length;e<s;e++){let n=r[e],o=n.params,l=o.options[0];if(n[Yo]!=l&&(n[Yo]=l,!0)){n[oe]={};for(let h=0,u=ne(l.split("|")),c=u.length;h<c;h++){let a=u[h];Xu.register(a,o),n[oe][a]=!0}}Object.assign(t,n[oe])}return this[Go]=t,this.dataset.hotkey=Object.keys(t).join(" "),this}};qu(v.prototype,Zi.prototype);var Mt=typeof Reflect=="object"?Reflect:null,Qo=Mt&&typeof Mt.apply=="function"?Mt.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},or;Mt&&typeof Mt.ownKeys=="function"?or=Mt.ownKeys:Object.getOwnPropertySymbols?or=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:or=function(t){return Object.getOwnPropertyNames(t)};function Qu(i){console&&console.warn&&console.warn(i)}var Zo=Number.isNaN||function(t){return t!==t};function S(){S.init.call(this)}S.EventEmitter=S;S.prototype._events=void 0;S.prototype._eventsCount=0;S.prototype._maxListeners=void 0;var Jo=10;function lr(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(S,"defaultMaxListeners",{enumerable:!0,get:function(){return Jo},set:function(i){if(typeof i!="number"||i<0||Zo(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");Jo=i}});S.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};S.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Zo(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function tl(i){return i._maxListeners===void 0?S.defaultMaxListeners:i._maxListeners}S.prototype.getMaxListeners=function(){return tl(this)};S.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var s=t==="error",n=this._events;if(n!==void 0)s=s&&n.error===void 0;else if(!s)return!1;if(s){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var h=n[t];if(h===void 0)return!1;if(typeof h=="function")Qo(h,this,e);else for(var u=h.length,c=nl(h,u),r=0;r<u;++r)Qo(c[r],this,e);return!0};function el(i,t,e,r){var s,n,o;if(lr(e),n=i._events,n===void 0?(n=i._events=Object.create(null),i._eventsCount=0):(n.newListener!==void 0&&(i.emit("newListener",t,e.listener?e.listener:e),n=i._events),o=n[t]),o===void 0)o=n[t]=e,++i._eventsCount;else if(typeof o=="function"?o=n[t]=r?[e,o]:[o,e]:r?o.unshift(e):o.push(e),s=tl(i),s>0&&o.length>s&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=i,l.type=t,l.count=o.length,Qu(l)}return i}S.prototype.addListener=function(t,e){return el(this,t,e,!1)};S.prototype.on=S.prototype.addListener;S.prototype.prependListener=function(t,e){return el(this,t,e,!0)};function Ju(){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 rl(i,t,e){var r={fired:!1,wrapFn:void 0,target:i,type:t,listener:e},s=Ju.bind(r);return s.listener=e,r.wrapFn=s,s}S.prototype.once=function(t,e){return lr(e),this.on(t,rl(this,t,e)),this};S.prototype.prependOnceListener=function(t,e){return lr(e),this.prependListener(t,rl(this,t,e)),this};S.prototype.removeListener=function(t,e){var r,s,n,o,l;if(lr(e),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===e||r.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){l=r[o].listener,n=o;break}if(n<0)return this;n===0?r.shift():Zu(r,n),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,l||e)}return this};S.prototype.off=S.prototype.removeListener;S.prototype.removeAllListeners=function(t){var e,r,s;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 n=Object.keys(r),o;for(s=0;s<n.length;++s)o=n[s],o!=="removeListener"&&this.removeAllListeners(o);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(s=e.length-1;s>=0;s--)this.removeListener(t,e[s]);return this};function il(i,t,e){var r=i._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?e?[s.listener||s]:[s]:e?ta(s):nl(s,s.length)}S.prototype.listeners=function(t){return il(this,t,!0)};S.prototype.rawListeners=function(t){return il(this,t,!1)};S.listenerCount=function(i,t){return typeof i.listenerCount=="function"?i.listenerCount(t):sl.call(i,t)};S.prototype.listenerCount=sl;function sl(i){var t=this._events;if(t!==void 0){var e=t[i];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}S.prototype.eventNames=function(){return this._eventsCount>0?or(this._events):[]};function nl(i,t){for(var e=new Array(t),r=0;r<t;++r)e[r]=i[r];return e}function Zu(i,t){for(;t+1<i.length;t++)i[t]=i[t+1];i.pop()}function ta(i){for(var t=new Array(i.length),e=0;e<t.length;++e)t[e]=i[e].listener||i[e];return t}var ts=Symbol.for("#getQueryParam"),ol=Symbol.for("#setQueryParam");var ll=Symbol.for("#query");var K=class{static parse(t,e){return t instanceof K?t:new K(t,e)}constructor(t,e){this.router=e,this.parse(t)}parse(t){var r;let e;return t instanceof URL||(t=new URL(t,this.router.origin)),(e=(r=this.router)==null?void 0:r.aliases[t.pathname])&&(t.pathname=e),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(t instanceof Object)for(let e=0,r=Object.keys(t),s=r.length,n,o;e<s;e++)n=r[e],o=t[n],this.searchParams.set(n,o);else typeof t=="string"&&this.parse(t);return this}clone(){return new K(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[ll]||(this[ll]=new Proxy({},{get:this[ts].bind(this),set:this[ol].bind(this)}))}toString(){return this.href}[ts](t,e){return this.searchParams.get(e)}[ol](t,e,r){return this[ts](t,e)!=r&&(r==null||r==""?this.searchParams.delete(e):this.searchParams.set(e,r),this.activeΦ&&(this.router.history.replaceState({},null,this.url.toString()),this.router.touch())),!0}};var es=function(){return!0},gt=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(this.store instanceof gt)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,s;let n=String(this.ns)+":"+t;if(this.store instanceof gt)return this.store.setItem(n,e);let o=this.cache.rich[n],l=typeof e;if(this.local&&(this.cache.rich[n]=e),o!==e||l=="object"){let h=this.store.getItem(n);if(e==null)return this.store.removeItem(n),r=this.cache.rich[n],delete this.cache.rich[n],s=this.cache.raw[n],delete this.cache.raw[n],C();{let u=this.serialize(e,n);if(this.cache.rich[n]=e,this.cache.raw[n]=u,h!=u)return this.store.setItem(n,u),C()}}}get(t,e,r){return this.getItem(e)}set(t,e,r,s){return this.setItem(e,r),!0}apply(t,e,[r]){let s=this.children.get(r);return s||this.children.set(r,s=new Proxy(es,new gt(this,r))),s}deleteProperty(t,e){var r;let s=this.ns+e;return r=this.cache[s],delete this.cache[s],this.store.removeItem(s)}},Xc=new Proxy(es,new gt(globalThis.localStorage)),hl=new Proxy(es,new gt(globalThis.sessionStorage));var le=Symbol.for("#states"),ul=new WeakMap,he=class{static from(t,e){return e?new this(t,e):null}constructor(t,e,r=!1){ul.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 ul.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}},hr=class{constructor(t){this.router=t,this.store=hl("router"),this[le]=[],this.cache={},this.index=-1;let e=globalThis.history.state,r;if(typeof e=="string"){let s=e.split("|");this.id=parseInt(s[0]),this.index=parseInt(s[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[le]}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[le])[t]||(e[t]=he.from(this,this.cache[t]))}buildState(t,e,r=!0){let s={data:t,index:this.index+1,path:e||this.router.path,type:r?"push":"replace"};return new he(this,s,!0)}pushState(t,e,r,s=!0){return t instanceof he||(t=this.buildState(t,r,s)),this.index=t.index,this.cache[this.index]=t,this[le][this.index]=t,this[le].length=this.cache.length=Math.max(t.index+1,0),globalThis.history[s?"pushState":"replaceState"](String(t),e||null,t.path),this}replaceState(t,e,r){return this.pushState(t,e,r,!1)}};var ue=class{constructor(t,e,r,s){this.params=s,this.router=t,e&&(this.location=K.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}};function al(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var ur=Symbol.for("#routes"),rs=Symbol.for("#match"),ea=Symbol.for("#symbol"),fl=Symbol.for("#matches"),is=new Map,ss={},cl={},ra=/.*/;function ia(i){if(!is.has(i)){let t=new Map;return is.set(i,t),t}return is.get(i)}function sa(i,t){let e=ia(i);if(!e.has(t)){let r=Object.create(i);return Object.assign(r,t),e.set(t,r),r}return e.get(t)}var ns=class{};function na(i){if(ss[i])return ss[i];let t=ss[i]={url:i},e=i.indexOf("?"),r=i.indexOf("#");if(r>=0&&(t.hash=i.slice(r+1),i=t.url=i.slice(0,r)),e>=0){let s=t.query=i.slice(e+1);i=i.slice(0,e),t.query=cl[s]||(cl[s]=new URLSearchParams(s))}return t.path=i,t}var ar=class{constructor(t){this.router=t,this.fullPath="",this[ur]={},this[rs]=new ns,this[rs].path=""}route(t){var e;return(e=this[ur])[t]||(e[t]=new ae(this.router,t,this))}match(){return this[rs]}resolve(t){return"/"}},ae=class{constructor(t,e,r){this.parent=r||t.rootRoute,this.router=t,this.status=200,this.path=e,this[ea]=Symbol(),this[fl]={},this[ur]={}}route(t){var e;return(e=this[ur])[t]||(e[t]=new ae(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 s=t.split("?");t=s.shift(),this.query={};for(let n=0,o=al(s.join("?").split("&")),l=o.length;n<l;n++){let h=o[n];if(!h)continue;let[u,c]=h.split("=");u[0]=="!"&&(this.dynamic=!0,u=u.slice(1),c=!1),c===""&&(c=!1),c&&c[0]==":"&&(this.dynamic=!0),this.query[u]=c||c!==!1}}if(t=t.replace(/\:(\w+|\*)(\.)?/g,function(s,n,o){e.dynamic=!0,n!="*"&&e.groups.push(n);let l=e.router.matchers[n]||(o?"([^/#.?]+)":"([^/#?]+)");return o?""+l+".":l}),t==""&&e.query)return;if(t=="*")return e.regex=ra,e;t="^"+t;let r=t[t.length-1];(r=="$"||r=="/")&&(t=t.slice(0,-1)+"(?=/?[#?]|/?$)"),r!="/"&&r!="$"&&t!="^/"&&(t=t+"(?=[/#?]|$)"),e.regex=new RegExp(t)}match(t=this.router.path){var h,u;var e,r;let s=this.parent.match(t);if(!s)return null;let n=na(t),o=n.url,l="";if(s.path&&n.path.indexOf(s.path)==0&&(l=s.path+"/",o=o.slice(l.length)),e=this.regex?o.match(this.regex):[""]){let c=l+e[0],a=[this.$path],p={};if(this.groups.length)for(let d=0,m=al(e),g=m.length,b;d<g;d++){let E=m[d];(b=this.groups[d-1])&&(p[b]=E,a.push(E))}if(this.query)for(let d=this.query,m=0,g=Object.keys(d),b=g.length,E,y;m<b;m++){E=g[m],y=d[E];let x=E,P=(u=(h=n.query)==null?void 0:h.get)==null?void 0:u.call(h,E);if(y===!1){if(P)return null;a.push("1");continue}if(y[0]==":"&&(x=y.slice(1),y=!0),y==!0&&P||y==P)p[x]=P,a.push(P);else return null}let _=a.join("*");p=(r=this[fl])[_]||(r[_]=p);let f=sa(s,p);return f.path=c,f}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),s;if(this.dynamic){let n=this.match(t);return n?n.path:null}return this.raw[0]=="?"?s=(r||"/")+this.raw:s=r+"/"+this.raw,s.replace(/\$/g,"").replace(/\/\/+/g,"/")}};var dl=Symbol.for("#__initor__"),pl=Symbol.for("#__inited__"),gl=Symbol.for("#__init__"),fr=Symbol.for("#idler"),fe=Symbol.for("#resolve"),ml=Symbol(),ce=class extends Set{static[gl](){return this.prototype[dl]=ml,this}constructor(){super(),this[fr]=Promise.resolve(this),this[dl]===ml&&this[pl]&&this[pl]()}emit(t,...e){return j(this,t,e)}on(t,...e){return $(this,t,...e)}once(t,...e){return R(this,t,...e)}un(t,...e){return bt(this,t,...e)}add(t){var e=this;if(t instanceof Function&&(t=t()),!this.has(t)){t.then(function(){return e.delete(t)});let r=e.size==0;super.add(t),r&&(this[fr]=this[fe]=null,e.emit("busy",e))}return t}delete(t){return super.delete(t)?(this.size==0&&(this[fe]&&(this[fe](this),this[fe]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[fr]||(this[fr]=new Promise(function(e){return t[fe]=e}))}};ce[gl]();function ds(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var yl=Symbol.for("#__initor__"),bl=Symbol.for("#__inited__"),Pl=Symbol.for("#__init__"),ls=Symbol.for("#enter"),hs=Symbol.for("#resolved"),cr=Symbol.for("#leave"),_l=Symbol.for("#afterVisitRouted"),vl=Symbol.for("#afterVisitRouteTo"),xl=Symbol.for("#router"),Dt=Symbol.for("#doc"),nt=Symbol.for("#version"),oa=Symbol.for("#routes"),Sl=Symbol.for("#origin"),os=Symbol.for("#request"),de=Symbol.for("#hash"),U=Symbol.for("#routeTo"),pe=Symbol.for("#path"),tt=Symbol.for("#match"),ge=Symbol.for("#options"),la=Symbol.for("#cache"),wl=Symbol.for("#unmatched"),yt=Symbol.for("#active"),ha=Symbol.for("#resolvedPath"),ua=Symbol.for("#dataKey"),aa=Symbol.for("#activeKey"),ye=Symbol.for("#urlKey"),Rt=Symbol.for("#dataMap"),me=Symbol.for("#href"),A=Symbol.for("#route"),Tl=Symbol.for("#context"),El=Symbol.for("#afterVisit"),Nl=Symbol.for("#routeHandler"),fa=Symbol.for("#parentNode"),ca=Symbol.for("#visitContext"),Ol=Symbol.for("##visitContext"),da=Symbol.for("#attachToParent"),pa=Symbol.for("#detachFromParent"),Cl=Symbol();var us=class{get router(){return this[xl]||(this[xl]=new dr(this))}};ds(Yt.prototype,us.prototype);function pd(){return globalThis.imba.use_router=!0,!0}var md=$s(function(){return globalThis.document.router}),dr=class extends S{static[Pl](){return this.prototype[yl]=Cl,this}constructor(t,e={}){super(),this[Dt]=t,this[nt]=0,this[oa]={},this.aliases={},this.redirects={},this.rules={},this.matchers={},this.options=e,this.busy=[],this.queue=new ce,this.root=new ar(this),this.location=new K(e.url||t.location.href,this),this.history=new hr(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_"),C()}),this.setup(),this[yl]===Cl&&this[bl]&&this[bl]()}get origin(){return this[Sl]||(this[Sl]=this[Dt].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[nt]++}option(t,e){return e==null?this.options[t]:(this.options[t]=e,this)}get realpath(){let t=this[Dt].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[os]}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,s=K.parse(t.location||this.realpath,this),n=t.mode,o=this[os];if(!s.equals(r)||!o||t.state){let l=new ue(this,s,r,t);this[os]=l,this.emit("beforechange",l),l.aborted&&(!l.forceAbort&&globalThis.window.confirm("Are you sure you want to leave? You might have unsaved changes")?l.aborted=!1:n=="pop"?this.pushState(this.state,null,String(r)):n=="replace"&&this.replaceState(this.state,null,String(r))),l.aborted||(this.location=l.location,n=="push"?this.pushState(l.state,null,String(this.location)):n=="replace"?this.replaceState(l.state,null,String(this.location)):n=="pop"&&(this.history.index=t.index),this.emit("change",l),this.touch(),C())}return k.add(function(){let l=e[Dt].location.hash;if(l!=e[de])return e.emit("hashchange",e[de]=l)}),e.refreshing=!1,e}onpopstate(t){let e=this.history.index,r=e,s={pop:!0,index:0,from:e,mode:"pop"};try{if(typeof t.state=="string"){let[n,o]=t.state.split("|");r=s.index=parseInt(o),r<e?s.revert=this.history.slice(r+1,e+1).reverse():r>e&&(s.apply=this.history.slice(e+1,r+1))}}catch{}return this.refresh(s),this}onbeforeunload(t){let e=new ue(this,null,this.location,{mode:"unload"});if(this.emit("beforechange",e),e.aborted)return!0}onhashchange(t){return this.emit("hashchange",this[de]=this[Dt].location.hash),C()}setup(){this.onclick=this.onclick.bind(this),this.onhashchange=this.onhashchange.bind(this);let t=globalThis.window;return this[de]=this[Dt].location.hash,this.location=K.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,s=t.target;for(;s&&(!e||!r);)!e&&s.nodeName=="A"&&(e=s),!r&&s[U]&&(r=s),s=s.parentNode;if(e&&r!=e&&(!r||r.contains(e))){let n=e.getAttribute("href");n&&!n.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[U]&&e[U].resolve();let r=e.getAttribute("href"),s=new URL(e.href),n=s.href.slice(s.origin.length),o=this.realpath.split("#")[0],l=n.split("#")[0];return o==l?globalThis.document.location.hash=s.hash:e[U]?e[U].go():this.go(n),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(t instanceof Object){e=[];for(let s=0,n=Object.keys(t),o=n.length,l,h;s<o;s++)l=n[s],h=t[l],e.push([l,globalThis.encodeURI(h)].join("="));return e.join("&")}return t||""}get hash(){return this[de]}set hash(t){this.history.replaceState(this.state,null,"#"+this.serializeParams(t))}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),s=this.history.buildState(e,r.path,!0);return this.refresh({push:!0,mode:"push",location:r,state:s,apply:[s]}),this}replace(t,e=null){typeof t=="object"&&e===null&&(e=t,t=this.path);let r=this.location.clone().update(t),s=this.history.buildState(e,r.path,!1);return this.refresh({replace:!0,mode:"replace",location:r,state:s,apply:[s]})}};dr[Pl]();var pr=class{constructor(t,e,r,s={}){this.parent=r,this.node=t,this[pe]=e,this[tt]=null,this[ge]=s,this[la]={},this[wl]={},this[yt]=null,this[ha]=null,this[ua]=Symbol(),this[aa]=Symbol(),this[ye]=Symbol()}get router(){return this.node.ownerDocument.router}get route(){return(this.parent?this.parent.route:this.router).route(this[pe])}get match(){return this[tt]}get params(){return this[tt]||this[wl]}get state(){let t=this[Rt]||(this[Rt]=new Map),e=this.params,r=this[Rt].get(e);return r||this[Rt].set(e,r={}),r}set state(t){(this[Rt]||(this[Rt]=new Map)).set(this.params,t)}set path(t){this[pe]!=t&&(this[pe]=t,!0)&&this.router.touch()}get path(){return this[pe]}get isActive(){return!!this[yt]}get activeΦ(){return!!this[yt]}resolve(){let t=this.router[nt];if(!(this[nt]!=t&&(this[nt]=t,!0)))return;let e=this.route,r=this[ge],s=this.router.path,n=e.match(s),o=this[yt],l=this[tt],h=n!=l,u=n&&n[this[ye]];return n&&(this[yt]=!0,this[tt]=n,n[this[ye]]=s),n&&(h||u!=s||!o)&&this[hs](n,l,u),!o&&n&&this[ls](),!n&&(o||o===null)&&(this[yt]=!1,this[cr]()),this[tt]}[ls](){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)}[hs](t,e,r=""){var s,n;return(n=(s=this.node)==null?void 0:s.routeDidResolve)==null?void 0:n.call(s,this,t,e,r)}[cr](){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)}},as=class extends pr{[ls](){return this}[hs](){return this}[cr](){return this}resolve(){let t=this.router[nt];if(!(this[nt]!=t&&(this[nt]=t,!0)))return;let e=this[ge],r=this.route,s=this.router.path,n=this.route.resolve(s),o=this.route.match(s);o&&(this[tt]=o,this[tt][this[ye]]=s),e.sticky&&this[tt]&&(n=this[tt][this[ye]]),this[me]!=n&&(this[me]=n,!0)&&this.node.nodeName=="A"&&this.node.setAttribute("href",n),this.node.flags.toggle("active",!!o)}get url(){return this.resolve(),globalThis.location.origin+this[me]}go(){return this.resolve(),this[ge]&&this[ge].replace?this.router.replace(this[me]):this.router.go(this[me])}},fs=class{get router(){return this.ownerDocument.router}};ds(W.prototype,fs.prototype);var cs=class{set route(t){if(this[A]){this[A].path=t;return}let e=t[0]!="/"?this[Tl].route:null;this[A]=new pr(this,t,e,this.route__),this[El]=this[_l]}get route(){return this[A]}set routeΞto(t){var e=this;if(this[U]){this[U].path=t;return}let r=t[0]!="/"?this[Tl].route:null;this[A]=this[U]=new as(this,t,r,this.routeTo__),this[El]=this[vl],e.onclick=function(s){if(!s.altKey&&!s.metaKey&&!s[Nl])return s.preventDefault(),s[Nl]=e[U],e[U].go()}}[_l](){if(this[A]){let t=this[fa],e=t&&t[ca];if(e&&e.matchedRoute&&e.matchedRoute!=this[A]){this[A][yt]!=!1&&(this[A][yt]=!1,!0)&&(this[A][cr](),this[A][nt]=-1);return}if(this[A].resolve(),this[A].activeΦ)e.matchedRoute=this[A];else return}if(this.visit&&this.visit(),this[Ol])return this[Ol]=null}[vl](){if(this[U]&&this[U].resolve(),this.visit)return this.visit()}routeDidEnter(t){return this[da]()}routeDidLeave(t){return this[pa]()}routeDidResolve(t,e,r){var s=this;this.routed instanceof Function&&e!=r&&s.router.queue.add(async function(){s.suspend();let n=await s.routed(e,t.state,r);return s.unsuspend()})}};ds(v.prototype,cs.prototype);function G(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function Cs(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var xe=Symbol.for("##reactive"),xt=Symbol.for("##referenced"),_e=Symbol.for("##dereferenced"),mr=Symbol.for("#map"),kl=Symbol.for("#__init__"),gr=Symbol.for("#child"),be=Symbol.for("#reactions"),ps=Symbol.for("#promise"),w={TOUCHING:1<<1,STALE:1<<2,OBJECT:1<<3,RUNNING:1<<4,INVALIDATING:1<<5,POSSIBLY_STALE:1<<6,AUTORUN:1<<7},F=0,Ll=!1;var ma=0,Dl=1,Ps={META:new Map,VALUE:new Map,REF:new Map},M=Symbol.for("~"),Rl=Symbol.for("~~"),ks=function(i,t){return t.has(i)||t.set(i,Symbol()),t.get(i)},br=function(i){return typeof i=="symbol"?ks(i,Ps.VALUE):Symbol.for(i)},Ls=function(i){return typeof i=="symbol"?ks(i,Ps.META):Symbol.for("#"+i+"__")},Is=function(i){return typeof i=="symbol"?ks(i,Ps.REF):Symbol.for("~"+i)},O=function(i,t){return F&&T.add(i[M]),t},B=function(i,t){return i[M].invalidated(0),t},At=function(i,t,e){let r=i[M];return r||(r=i[M]=new $t(w.OBJECT),Object.defineProperties(i,e)),t&&r.addSubscriber(t),i},Fs=function(i,t){let e=i[M];return e&&e.removeSubscriber(t),i},ms=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.array[this.idx];if(e===t)return++this.idx;{let r=this.array.indexOf(t),s=this.changes.get(t);if(r===-1)this.array.splice(this.idx,0,t),this.changes.set(t,1),this.idx++;else if(r===this.idx+1)e&&this.changes.set(e,-1),this.array.splice(this.idx,1),++this.idx;else{if(r<this.idx)return;r>this.idx&&this.array.splice(r,1),this.array.splice(this.idx,0,t)}if(s==-1)return 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()}};function Ms(i){var t,e;let r=Object.getOwnPropertyDescriptors(i.prototype);return t=r.name,delete r.name,e=r.constructor,delete r.constructor,r}function ga(){if(Ll!=!0&&(Ll=!0,!0))return Vs.on("inited",function(i){let t=i[Rl];if(t){let e=i instanceof globalThis.Node,r=i[M]||(i[M]={});for(let s=0,n=Object.keys(t),o=n.length,l,h;s<o;s++){l=n[s],h=t[l];let u=r[l]=new wt(i[l],i,h);e||u.call()}e&&($(i,"mount",function(){var s;s=[];for(let n=0,o=G(Object.values(r)),l=o.length;n<l;n++){let h=o[n];s.push(h instanceof wt&&h.activate())}return s}),$(i,"unmount",function(){var s;s=[];for(let n=0,o=G(Object.values(r)),l=o.length;n<l;n++){let h=o[n];s.push(h instanceof wt&&h.deactivate())}return s}))}})}function ya(i,t=Rl){return i.hasOwnProperty(t)||(i[t]=Object.assign({},i[t]||{})),i[t]}var ve=class{constructor(t,e=0){this.depth=e,this.parent=t,this.target=null,this.patcher=new ms}get activeΦ(){return T==this}get rootΦ(){return this==St}get snapshot(){let t=[],e=this[gr];for(;e&&e.target;)t.push({depth:e.depth,target:e.target,beacon:e.beacon}),e=e[gr];return t}reset(t){return this.tracking=!0,this.target=t,this.beacon=t.beacon,this.patcher.reset(t.observing||(t.observing=[])),this}add(t){if(this.tracking&&t)return this.patcher.push(t)}react(t){return St.reactions.add(t)}push(t){return T=this.child.reset(t)}pop(){let t=null;if(this.beacon){t=this.patcher.end();let e=this.patcher.changes;if(e.size)for(let[s,n]of G(e))n===1?s.addSubscriber(this.beacon):s.removeSubscriber(this.beacon)}return this.patcher.cleanup(),this.target=this.beacon=null,T=this.parent,T==St&&St.flush(),t}get child(){return this[gr]||(this[gr]=new ve(this,this.depth+1))}get reactions(){return this[be]||(this[be]=new Set)}flush(){if(!this[be])return;let t=this[be];this[be]=null;for(let e of G(t))e.call()}},gs=class extends ve{add(){return!0}},T=new gs(null,0),St=T,ba=function(){return T.tracking=!1},Al=function(i,t,e,r,s){let n=i[e],o=i[s];return o||(o=i[s]=new $t(0,r,n,t)),T.add(o,i),n},$l=function(i,t,e,r,s,n){let o=i[e];if(r!=o){i[e]=r;let l=i[n];l&&l.changed(0,r,o)}},$t=class{constructor(t,e,r,s){return this.id=Dl++,this.observer=null,this.observers=null,r&&r[xt]&&r[xt](this),this}changed(t,e,r){if(ma++,r&&r[_e]&&r[_e](this,e),e&&e[xt]&&e[xt](this,r),this.observer&&this.observer.invalidated(t+1,this,e,r),this.observers)for(let s=0,n=G(this.observers),o=n.length;s<o;s++)n[s].invalidated(t+1,this,e,r);T==St&&T.flush()}invalidated(t,e){if(this.observer&&this.observer.invalidated(t+1,this),this.observers)for(let r=0,s=G(this.observers),n=s.length;r<n;r++)s[r].invalidated(t+1,this);return t==0&&T==St&&T.flush(),!0}addSubscriber(t){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.indexOf(t);r>=0&&e.splice(r,1)}reportChanged(){return this.changed(0)}reportObserved(){return T.add(this)}};function wd(i){return new $t(null,null,null,i)}var ys=class extends Array{push(){return B(this,super.push(...arguments))}pop(){return B(this,super.pop(...arguments))}unshift(){return B(this,super.unshift(...arguments))}shift(){return B(this,super.shift(...arguments))}splice(){return B(this,super.splice(...arguments))}at(){return O(this,super.at(...arguments))}map(){return O(this,super.map(...arguments))}flatMap(){return O(this,super.flatMap(...arguments))}flat(){return O(this,super.flat(...arguments))}filter(){return O(this,super.filter(...arguments))}find(){return O(this,super.find(...arguments))}slice(){return O(this,super.slice(...arguments))}sort(){return O(this,super.sort(...arguments))}get len(){return O(this,this.length)}set len(t){this.length=t,B(this)}toIterable(){return F&&T.add(this[M]),this}[Symbol.iterator](){return O(this,super[Symbol.iterator](...arguments))}},Il=Ms(ys),bs=class{get len(){return this.length}set len(t){this.length=t}get[xe](){return At(this,null,Il)}[xt](t){return At(this,t,Il)}[_e](t){return Fs(this,t)}};Cs(Array.prototype,bs.prototype);var _s=class extends Set{has(){return O(this,super.has(...arguments))}keys(){return O(this,super.keys(...arguments))}values(){return O(this,super.values(...arguments))}entries(){return O(this,super.entries(...arguments))}add(){return B(this,super.add(...arguments))}clear(){return B(this,super.clear(...arguments))}delete(){return B(this,super.delete(...arguments))}},Fl=Ms(_s),vs=class{get[xe](){return At(this,null,Fl)}[xt](t){return At(this,t,Fl)}[_e](t){return Fs(this,t)}};Cs(Set.prototype,vs.prototype);var xs=class extends Map{get(){return O(this,super.get(...arguments))}has(){return O(this,super.has(...arguments))}keys(){return O(this,super.keys(...arguments))}values(){return O(this,super.values(...arguments))}entries(){return O(this,super.entries(...arguments))}set(){return B(this,super.set(...arguments))}clear(){return B(this,super.clear(...arguments))}delete(){return B(this,super.delete(...arguments))}},Ml=Ms(xs),Ss=class{get[xe](){return At(this,null,Ml)}[xt](t){return At(this,t,Ml)}[_e](t){return Fs(this,t)}};Cs(Map.prototype,Ss.prototype);var ws=class{constructor(t,e={}){var r=this,s;this.name=t,this.options=e;let n=this.key=br(t),o=Is(t),l=r.descriptor={enumerable:(s=e.enumerable)!=null?s:!0,configurable:!1,get:function(){return F?Al(this,t,n,r,o):this[n]},set:function(u){return F||!!this[o]?$l(this,t,n,u,r,o):this[n]=u}},h=r.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){return F?(Object.defineProperty(this,t,l),this[t]):this[n]},set:function(u){return this[n]=u,this[o]=null,Object.defineProperty(this,t,l)}}}},Ts=class{constructor(t=null){this[kl](t)}[kl](t=null){var e;this[mr]=t&&(e=t[mr])!==void 0?e:new Map}for(t){let e=this[mr].get(t);return e||this[mr].set(t,e=[]),e}get(t){let e=this.for(t);return e[M]||e[xe],F&&O(e),e}add(t,e){return this.for(t).push(e)}delete(t,e){let r=this.for(t),s=r.indexOf(e);r.splice(s,1)}},Es=class{constructor(t,e){var r=this;this.name=t,this.key=e,this.index=new Ts;let s=Is(t),n=r.descriptor={enumerable:!0,configurable:!1,get:function(){return F?Al(this,t,e,r,s):this[e]},set:function(l){let h=this[e];if(F||!!this[s]?$l(this,t,e,l,r,s):this[e]=l,h!=l&&(h&&r.index.delete(h,this),l))return r.index.add(l,this)}},o=r.lazyDescriptor={set:function(l){return this[e]=l,l&&r.index.add(l,this),Object.defineProperty(this,t,n),this[s]=null}}}where(t){return this.index.get(t)}},jt=class{constructor(t,e,r){this.observing=null,this.observers=null,this.flags=68,this.target=t,this.func=e,this.vkey=r,this.version=0}get beacon(){return this}addSubscriber(t){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.indexOf(this);r>=0&&e.splice(r,1)}invalidated(t,e){if(this.flags|=w.STALE|w.POSSIBLY_STALE,this.observer&&this.observer.invalidated(t,this),!!this.observers){for(let r=0,s=G(this.observers),n=s.length;r<n;r++)s[r].invalidated(t,this);return this}}value(){if(F&&T.add(this),(this.flags&w.POSSIBLY_STALE)==0)return this.target[this.vkey];F++,this.flags|=w.RUNNING,T.push(this);let t=this.func.call(this.target);T.pop(this);let e=this.target[this.vkey];return this.target[this.vkey]=t,this.flags&=~(w.STALE|w.POSSIBLY_STALE|w.RUNNING),t!==e&&this.version++,F--,t}},Ns=class{constructor(t,e){this.name=t;let r=Is(t),s=br(t),n=this.descriptor={enumerable:!1,configurable:!1,get:function(){return this[r].value()}},o=this.lazyDescriptor={enumerable:!1,get:function(){let l=this[r]=new jt(this,e,s);return Object.defineProperty(this,t,n),l.value()}}}},wt=class{get beacon(){return this}constructor(t,e,r={}){this.cb=t,this.context=e,this.options=r,this.flags=0,this.id=Dl++,this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.observing=[],this.timeout=null}get runningΦ(){return this.flags&w.RUNNING}invalidated(t,e){return e instanceof jt?(this.flags|=w.POSSIBLY_STALE,this.checkComputedValues.add(e)):this.flags|=w.STALE,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=G(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(F&&console.warn("should not call reaction inside an autorunning context?",St.snapshot),this.flags&w.POSSIBLY_STALE&&(this.flags&w.STALE)==0){let e=!1;for(let r of G(this.checkComputedValues)){let s=this.cachedComputedVersions.get(r);r.value();let n=r.version;if(s!=n){e=!0;break}}if(!e){this.flags&=~w.POSSIBLY_STALE,this.checkComputedValues.clear();return}}if(this.options.delay){clearTimeout(this.timeout);let e=this.options.delay;typeof e!="number"&&(e=1e3),t.timeout=setTimeout(function(){return t.run()},e);return}return t.run()}run(){F++,this.flags|=w.RUNNING;let t=T.push(this),e=this.cb.call(this.context,ba),r=T.pop(this);this.observing=r,this.checkComputedValues.clear();for(let s=0,n=G(r),o=n.length;s<o;s++){let l=n[s];l instanceof jt&&this.cachedComputedVersions.set(l,l.version)}return this.flags&=~(w.RUNNING|w.STALE|w.POSSIBLY_STALE),F--,this.options.silent||C(),e}dispose(){return this.deactivate(),this.cb=this.context=this.options=null,this}},Os=class extends wt{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[ps]||(this[ps]=new Promise(function(r){return e.resolve=function(s){return e.deactivate(),e.resolved=s,r(s)}})),this[ps].then(...t))}run(){F++,this.flags|=w.RUNNING;let t=T.push(this),e=this.cb.call(this.context),r=T.pop(this);this.observing=r,this.checkComputedValues.clear();for(let s=0,n=G(r),o=n.length;s<o;s++){let l=n[s];l instanceof jt&&this.cachedComputedVersions.set(l,l.version)}return this.flags&=~(w.RUNNING|w.STALE|w.POSSIBLY_STALE),F--,e!=!1&&e!=null&&e!=null&&(this.resolve(e),this.options.silent||C()),e}},yr=class{constructor(t,e){this.context=e,this.cb=t}run(t=this.context,e=[]){T.push(this);try{let r=this.cb.apply(t,e);return T.pop(this),r}catch(r){throw T.pop(this),r}}};function Td(i,t={}){let e=new wt(i,globalThis,t);return e.call(),e}function Ed(i,t={}){let e=new Os(i,globalThis,t);return e.call(),e}function Nd(i){return i[xe]}function Od(i){return new yr(i,globalThis).run()}function Cd(i){return i&&i[M]&&i[M].invalidated(0),i}function Pd(i){return i&&i[M]&&i[M].invalidated(0),i}function kd(i){return i&&i[M]&&i[M].reportObserved(),i}function Ld(i=w.OBJECT){return new $t(w.OBJECT)}function Id(i,t,e){let r=Ls(t);return(i[r]=new Ns(t,e.get)).lazyDescriptor}function Fd(i,t,e){let r=Ls(t),s=br(t),n=this[0]||{},o=i[r]=new ws(t,n);return e?(Object.defineProperty(i,s,Object.assign({},e)),o.lazyDescriptor):(Object.defineProperty(i,t,o.lazyDescriptor),null)}function Md(i,t,e){let r=Ls(t);return i.constructor[t],(i[r]=new Es(t,br(t))).lazyDescriptor}function Dd(i,t,e){let r=ya(i),s=this[0]||{};return s.flags=w.AUTORUN,ga(),r[t]=s,e}function Rd(i,t,e){if(e.value){let r=new yr(e.value,null);e.value=function(){return r.run(this,arguments)}}return e}function _a(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var jl=Symbol.for("#__init__");var _r=Symbol.for("#watchers");function $d(i,t,e,r,s,n){return i&&i.$accessor instanceof Function?i=i.$accessor(t,e,r,s,n):n[s]=i,i&&!i.$init&&(i.$init=i.$set||function(){return!0}),i}function jd(i,t,e=[]){return t.prototype?new t(...e):t.apply(i,e)}var Ds=class{constructor(t=null){this[jl](t)}[jl](t=null){var e;this.local=t&&(e=t.local)!==void 0?e:!1,this.session=t&&(e=t.session)!==void 0?e:!1,this.weak=t&&(e=t.weak)!==void 0?e:!1}watch(t){return(this[_r]||(this[_r]=[])).push(t)}$get(t,e){return t[e]}$set(t,e,r,s){if(this[_r]){let n=this.$get(e,r,s);if(n!=t){e[r]=t;for(let o=0,l=_a(this[_r]),h=l.length;o<h;o++){let c=l[o].call(e,t,n,this)}}}else e[r]=t}$accessor(t,e,r,s,n){return n[s]=this}};function zd(){return new Ds}export{Ds as Accessor,ah as CUSTOM_TYPES,Me as Comment,Lt as Component,N as CustomEvent,Yt as Document,Ya as DocumentFragment,Ze as Easer,v as Element,pr as ElementRoute,as as ElementRouteTo,zt as Emitter,Y as Event,Si as EventHandler,ht as Fragment,Nn as HTMLButtonElement,Vr as HTMLElement,Ha as HTMLHtmlElement,Tn as HTMLInputElement,On as HTMLOptionElement,Wa as HTMLScriptElement,wn as HTMLSelectElement,En as HTMLTextAreaElement,Cf as ImbaElement,Fi as IntersectionEventDefaults,Sn as KeyboardEvent,Sr as LazyProxy,vn as MouseEvent,W as Node,O as OBSERVED,ys as ObservableArray,xn as PointerEvent,H as RenderContext,dr as Router,Cn as SVGElement,Er as Scheduler,Ga as ShadowRoot,Mr as TYPES,qr as Text,Ba as UIEvent,Xa as Window,va as __served__,$d as accessor,Td as autorun,Ed as awaits,Yl as clearInterval,Gl as clearTimeout,If as colors,C as commit,wd as createAtom,ot as createComment,mh as createComponent,rf as createDynamic,Za as createElement,ef as createFragment,mf as createIndexedList,vf as createKeyedList,ff as createLiveFragment,Ld as createRef,Js as createRenderContext,tf as createSVGElement,ze as createSlot,Kr as createTextNode,Qa as customElements,Sa as defineConfig,of as defineTag,jd as descriptor,j as emit,Da as env,uc as events,Ee as getDeepPropertyDescriptor,ja as getRenderContext,nf as getSuperTagType,gh as getTagType,De as get_document,Vs as hooks,Xu as hotkeys,Of as hydrate,$ as listen,Xc as locals,Hh as mount,Nd as observable,R as once,qt as parseTime,$s as proxy,Af as render,L as renderContext,Kt as renderer,Cd as reportChanged,Pd as reportInvalidated,kd as reportObserved,md as router,Od as run,k as scheduler,Fa as serve,hl as session,Wl as setInterval,Hl as setTimeout,Uh as styles,xa as toCamelCase,mi as transitions,bt as unlisten,Wh as unmount,qf as use_dom_bind,Hf as use_dom_teleport,Xf as use_dom_transitions,ac as use_events,Vc as use_events_hotkey,Tc as use_events_intersect,xo as use_events_keyboard,tr as use_events_mouse,Ic as use_events_mutate,yc as use_events_pointer,Cc as use_events_resize,Rc as use_events_selection,xc as use_events_touch,Oa as use_hooks,pd as use_router,af as use_slots,Ff as use_styles,Ja as use_window,Rd as αaction,Dd as αautorun,ka as αbound,Id as αcomputed,Pa as αlazy,Fd as αobservable,zd as αprop,Md as αref,La as αthenable};