UNPKG

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