imba
Version:
8 lines (7 loc) • 139 kB
JavaScript
var kr=Object.defineProperty;var fu=Object.getOwnPropertyDescriptor;var mu=Object.getOwnPropertyNames;var pu=Object.prototype.hasOwnProperty;var gu=(t,e)=>{for(var r in e)kr(t,r,{get:e[r],enumerable:!0})},yu=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of mu(e))!pu.call(t,n)&&n!==r&&kr(t,n,{get:()=>e[n],enumerable:!(s=fu(e,n))||s.enumerable});return t};var vu=t=>yu(kr({},"__esModule",{value:!0}),t);var Xm={};gu(Xm,{Accessor:()=>En,Action:()=>$r,CUSTOM_TYPES:()=>un,ClassFlags:()=>zt,Comment:()=>wr,Component:()=>ke,ComputedType:()=>Tn,CustomEvent:()=>B,Document:()=>hn,DocumentFragment:()=>ah,EaseGroup:()=>Ch,Easer:()=>gn,Element:()=>M,ElementRoute:()=>Er,ElementRouteTo:()=>xn,Emitter:()=>_e,Event:()=>br,EventHandler:()=>Tr,FocusEvent:()=>sh,Fragment:()=>Bt,HAS:()=>Ia,HTMLButtonElement:()=>ln,HTMLElement:()=>nh,HTMLHtmlElement:()=>ih,HTMLInputElement:()=>nn,HTMLOptionElement:()=>an,HTMLScriptElement:()=>oh,HTMLSelectElement:()=>sn,HTMLTextAreaElement:()=>on,ImbaElement:()=>Th,IntersectionEventDefaults:()=>Oe,KeyboardEvent:()=>en,LazyProxy:()=>Hs,MouseEvent:()=>Zs,Node:()=>Sr,OBSERVED:()=>N,ObservableArray:()=>_n,PointerEvent:()=>tn,Queue:()=>Qs,Ref:()=>Wt,RenderContext:()=>Ut,Router:()=>wn,SVGElement:()=>lh,Scheduler:()=>Us,ShadowRoot:()=>hh,TYPES:()=>Te,Text:()=>rn,Touch:()=>vn,UIEvent:()=>rh,Window:()=>uh,__has__$:()=>Ds,__hooks__$:()=>pr,__imba__$:()=>gr,__init__$:()=>wt,__inited__$:()=>js,__initor__$:()=>mr,__meta__$:()=>Vs,__mixin__$:()=>ka,__patch__$:()=>$a,__served__:()=>qa,accessor:()=>au,afterReconcile$:()=>Pa,afterVisit$:()=>Oa,appendChild$:()=>Na,atomic:()=>Wh,augment$:()=>we,autorun:()=>Uh,awaits:()=>Bh,beforeReconcile$:()=>Ca,clearInterval:()=>Ws,clearTimeout:()=>Ys,colors:()=>Eh,commit:()=>C,createAtom:()=>qh,createComment:()=>xt,createComponent:()=>cn,createDynamic:()=>gh,createElement:()=>fh,createFragment:()=>ph,createIndexedList:()=>wh,createKeyedList:()=>xh,createLiveFragment:()=>Sh,createRef:()=>tu,createRenderContext:()=>vr,createSVGElement:()=>mh,createSlot:()=>$e,createTextNode:()=>xr,customElements:()=>ch,decorate$:()=>Va,defineConfig:()=>Ba,defineTag:()=>vh,descriptor:()=>hu,devlog$:()=>ja,disposeObservables:()=>eu,emit:()=>nt,env:()=>Ja,events:()=>Lh,extend$:()=>yr,getComputed:()=>ru,getDeepPropertyDescriptor:()=>xe,getRenderContext:()=>eh,getSuperTagType:()=>yh,getTagType:()=>dn,get_document:()=>Ee,has$:()=>Ra,hooks:()=>Xs,hotkeys:()=>bn,hydrate:()=>_h,idx$:()=>Aa,inited$:()=>Ha,is$:()=>Ma,isa$:()=>Fa,iterable$:()=>Ks,listen:()=>st,locals:()=>zh,logFormatter:()=>Js,matcher:()=>zs,memofunc:()=>Za,mount:()=>mn,multi$:()=>za,observable:()=>Gh,once:()=>V,parseTime:()=>Kt,proxy:()=>qs,register$:()=>c,render:()=>kh,renderContext:()=>P,renderer:()=>qt,reportChanged:()=>Qh,reportInvalidated:()=>Jh,reportObserved:()=>Zh,router:()=>Hh,run:()=>Yh,rx:()=>Gt,scheduler:()=>O,serve:()=>Qa,session:()=>Sn,setInterval:()=>Gs,setTimeout:()=>Bs,spy:()=>Xh,statics$:()=>Da,styles:()=>fn,sup$:()=>Ka,toCamelCase:()=>Ua,transitions:()=>Ne,unlisten:()=>Ht,unmount:()=>pn,up$:()=>La,use_devlog:()=>th,use_dom_bind:()=>Nh,use_dom_teleport:()=>Oh,use_dom_transitions:()=>Ph,use_events:()=>Ih,use_events_hotkey:()=>Vh,use_events_intersect:()=>Rh,use_events_keyboard:()=>yn,use_events_mouse:()=>_r,use_events_mutate:()=>jh,use_events_pointer:()=>Mh,use_events_resize:()=>Ah,use_events_selection:()=>Dh,use_events_touch:()=>Fh,use_hooks:()=>Ga,use_router:()=>Kh,use_slots:()=>bh,use_styles:()=>$h,use_window:()=>dh,\u03B1action:()=>lu,\u03B1autorun:()=>ou,\u03B1bound:()=>Ya,\u03B1computed:()=>su,\u03B1lazy:()=>Wa,\u03B1observable:()=>nu,\u03B1prop:()=>uu,\u03B1ref:()=>iu,\u03B1thenable:()=>Xa});module.exports=vu(Xm);var wt=Symbol.for("#__init__"),mr=Symbol.for("#__initor__"),js=Symbol.for("#__inited__"),pr=Symbol.for("#__hooks__"),$a=Symbol.for("#__patch__"),Ds=Symbol.for("#has"),Vs=Symbol.for("#meta"),gr=Symbol.for("imba"),ka=Symbol.for("#__mixin__"),zs=Symbol.for("#matcher"),Ce=Symbol.for("#L"),Na=Symbol.for("#appendChild"),Oa=Symbol.for("#afterVisit"),Ca=Symbol.for("#beforeReconcile"),Pa=Symbol.for("#afterReconcile"),La=Symbol.for("##up"),Ia={SUPERCALLS:1<<3,CONSTRUCTOR:1<<4},zt={IsExtension:1<<0,IsTag:1<<1,HasDescriptors:1<<2,HasSuperCalls:1<<3,HasConstructor:1<<4,HasFields:1<<5,HasMixins:1<<6,HasInitor:1<<7,HasDecorators:1<<8,IsObjectExtension:1<<9},_t=new Map,bu=globalThis[gr]||(globalThis[gr]={counter:0,classes:_t});function Tt(t,e={}){var r;return _t.has(t)||_t.set(t,{symbol:Symbol(t.name),parent:(r=Object.getPrototypeOf(t.prototype))==null?void 0:r.constructor,for:t,uses:null,inits:null,id:bu.counter++,...e}),_t.get(t)}var kn=new WeakMap;function Ma(t,e){var r;return t===e||((r=e?.[zs])==null?void 0:r.call(e,t))}function Fa(t,e){var r;return typeof e=="string"?typeof t===e:(r=e?.[Symbol.hasInstance])==null?void 0:r.call(e,t)}function Ra(t,e){var r,s,n,i,o,l;return(l=(o=(n=(r=e?.[Ds])==null?void 0:r.call(e,t))!=null?n:(s=e?.includes)==null?void 0:s.call(e,t))!=null?o:(i=e?.has)==null?void 0:i.call(e,t))!=null?l:!1}function Aa(t,e){return e!=null&&e.indexOf?e.indexOf(t):Array.prototype.indexOf.call(t,e)}function ja(t,e,...r){return e&&e[Ce]instanceof Function?t=e[Ce](t,e,...r):globalThis[Ce]instanceof Function&&(t=globalThis[Ce](t,e,...r)),t}function Da(t){return kn.get(t)||kn.set(t,{}).get(t)}function Ks(t){var e;return((e=t?.toIterable)==null?void 0:e.call(t))||t}function Va(t,e,r,s){let n,i=arguments.length,o=t.length,l=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,r):s;for(;o>0;)(n=t[--o])&&(l=(i<3?n(l):i>3?n(e,r,l):n(e,r))||l);return i>3&&l&&Object.defineProperty(e,r,l),l}function Su(t,e){if(!t||!e)return!1;if(t.get)return e.get===t.get;if(t.set)return e.set===t.set;if(t.value)return t.value===e.value}function yr(t,e,r,s={}){let n=t.constructor;!r&&e&&(r=Object.getOwnPropertyDescriptors(e),delete r.constructor,r[wt]&&(console.warn(`Cannot define plain fields when extending class ${n.name}`),delete r[wt]));let i=Tt(n);if(i&&i.augments){let o=new Map;for(let l of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t,l);for(let d of i.augments){let h=o.get(d);h||o.set(d,h={});let v=Object.getOwnPropertyDescriptor(d.prototype,l);v&&!Su(a,v)?console.warn("wont extend",l,v,a):h[l]=r[l]}}for(let[l,a]of o)Object.keys(a).length&&yr(l.prototype,null,a)}return Object.defineProperties(t,r),t}function we(t,e){let r=Tt(t),s=Tt(e);if(s.parent&&!(t.prototype instanceof s.parent))throw new Error(`Mixin ${e.name} has superclass not present in target class`);if(!s.augments){s.augments=new Set;let i=s.ref=Symbol(e.name),o=Object[Symbol.hasInstance];e.prototype[i]=!0,Object.defineProperty(e,Symbol.hasInstance,{value:function(l){return this===e?l&&!!l[i]:o.call(this,l)}})}if(t.prototype[s.ref])return t;if(s.uses)for(let i of s.uses)we(t,i);s.augments.add(t),r.uses||(r.uses=[]),r.uses.push(e);let n=Object.getOwnPropertyDescriptors(e.prototype);return delete n.constructor,n[wt]&&(r.inits||(r.inits=[]),r.inits.push(e.prototype[wt]),delete n[wt]),Object.defineProperties(t.prototype,n),e?.mixed instanceof Function&&e.mixed(t),t}function za(t,e,...r){let s=e?class extends e{}:class{},n=Tt(s,{symbol:t});for(let i of r)we(s,i);return s.prototype[t]=function(i,o,l){if(n.inits)for(let a of n.inits)a.call(this,i,!1,l)},s}var G={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(t,e,...r)=>G.target[e].apply(G.self,r),get:(t,e)=>Reflect.get(G.target,e,G.self),set:(t,e,r,s)=>Reflect.set(G.target,e,r,G.self)})};function Ka(t,e){return G.self=t,G.target=G.cache[e],G.proxy}function c(t,e,r,s,n=null){var i;let o=Object.getPrototypeOf(t.prototype),l=s&zt.HasMixins,a;if(l&&(_t.set(t,_t.get(o.constructor)),o=Object.getPrototypeOf(o)),n){let h=s&zt.IsObjectExtension?n:n.prototype,v=Tt(t);if(v.uses){n===h&&console.warn("Cannot extend object with mixins");for(let p of v.uses)we(n,p)}return s&zt.HasSuperCalls&&(G.cache[e]=Object.create(Object.getPrototypeOf(h),Object.getOwnPropertyDescriptors(h))),yr(h,t.prototype),n}let d=o?.constructor;if(a=Tt(t,{symbol:e}),Object.defineProperty(t,Vs,{value:a,enumerable:!1,configurable:!0}),r&&t.name!==r&&Object.defineProperty(t,"name",{value:r,configurable:!0}),a.flags=s,s&zt.HasConstructor&&(t.prototype[mr]=e),a.uses)for(let h of a.uses)(i=h.mixes)==null||i.call(h,t);return d?.inherited instanceof Function&&d.inherited(t),t}function Ha(t,e){var r;t[mr]===e&&((r=t[js])==null||r.call(t),t[pr]&&t[pr].inited(t))}var Pe=Symbol.for("#__listeners__"),wu=/-./g,qa=new Set,xu=Symbol(),Nn=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}},Hs=Nn;c(Nn,xu,"LazyProxy",16);function qs(t,e={}){return new Proxy(e,new Hs(t))}function Kt(t){let e=typeof t;if(e=="number")return t;if(e=="string"){if(/^\d+fps$/.test(t))return 1e3/parseFloat(t);if(/^([-+]?[\d\.]+)s$/.test(t))return parseFloat(t)*1e3;if(/^([-+]?[\d\.]+)ms$/.test(t))return parseFloat(t)}return null}function Ua(t){return t.indexOf("-")>=0?t.replace(wu,function(e){return e.charAt(1).toUpperCase()}):t}function xe(t,e,r){if(!t)return;let s=Object.getOwnPropertyDescriptor(t,e);return s||t==r?s||void 0:xe(Reflect.getPrototypeOf(t),e,r)}var On=function(t,e,r){let s,n,i;for(;(s=r)&&(r=r.next);)(n=r.listener)&&(r.path&&n[r.path]?i=e?n[r.path].apply(n,e):n[r.path]():i=e?n.apply(r,e):n.call(r)),r.times&&--r.times<=0&&(s.next=r.next,r.listener=null)};function st(t,e,r,s){let n,i,o;return n=t[Pe]||(t[Pe]={}),i=n[e]||(n[e]={}),o=i.tail||(i.tail=i.next={}),o.listener=r,o.path=s,i.tail=o.next={},o}function V(t,e,r){let s=st(t,e,r);return s.times=1,s}function Ht(t,e,r,s){if(!r)return;let n,i,o=t[Pe];if(!!o&&(n=o[e])){for(;(i=n)&&(n=n.next);)if(n==r||n.listener==r){i.next=n.next,n.listener=null;break}}}function nt(t,e,r=null){let s;(s=t[Pe])&&(s[e]&&On(e,r,s[e]),s.all&&On(e,[e,r],s.all))}var _u=Symbol(),Cn=class{emit(t,...e){return nt(this,t,e)}on(t,...e){return st(this,t,...e)}once(t,...e){return V(this,t,...e)}un(t,...e){return Ht(this,t,...e)}},_e=Cn;c(Cn,_u,"Emitter",0);function Ba(t){return t}function Nr(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function Tu(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Pn=Symbol.for("#__init__"),Ln=Symbol.for("#schedule"),Or=Symbol.for("#frames"),Le=Symbol.for("#interval"),Et=Symbol.for("#stage"),$t=Symbol.for("#scheduled"),Ie=Symbol.for("#version"),Eu=Symbol.for("#fps"),In=Symbol.for("#ticker"),$u=globalThis.requestAnimationFrame||function(t){return globalThis.setTimeout(t,1e3/60)},Jm=1/60,ku=Symbol(),Mn=class{constructor(t=null){this[Pn](t)}[Pn](t=null,e=!0,r=!0){var s;this.owner=t&&(s=t.owner)!==void 0?s:null,this.target=t&&(s=t.target)!==void 0?s:null,this.active=t&&(s=t.active)!==void 0?s:!1,this.value=t&&(s=t.value)!==void 0?s:void 0,this.skip=t&&(s=t.skip)!==void 0?s:0,this.last=t&&(s=t.last)!==void 0?s:0}tick(t,e){return this.last=this.owner[Or],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[Le]=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[Le]&&(globalThis.clearInterval(this[Le]),this[Le]=null),this.active=!1,this}},Nu=Mn;c(Mn,ku,"Scheduled",16);var Ou=Symbol(),Fn=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Et]=-1,this[Or]=0,this[$t]=!1,this[Ie]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[Eu]=0,this.$promise=null,this.$resolve=null,this[In]=function(e){return t[$t]=!1,t.tick(e)}}touch(){return this[Ie]++}get version(){return this[Ie]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[$t]||this[Ln](),this}get committing\u03A6(){return this.queue.indexOf("commit")>=0}get syncing\u03A6(){return this[Et]==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 this.$promise||(this.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,s=this[Or]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Et]=1,this[Ie]++,r.length)for(let n=0,i=Tu(r),o=i.length;n<o;n++){let l=i[n];typeof l=="string"&&this.listeners[l]?this.listeners[l].forEach(function(a){if(Nr(a.tick,Function))return a.tick(e,l);if(Nr(a,Function))return a(e,l)}):Nr(l,Function)?l(this.dt,this):l.tick&&l.tick(this.dt,this)}return this[Et]=this[$t]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[Ln](){return this[$t]||(this[$t]=!0,this[Et]==-1&&(this[Et]=0),$u(this[In])),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 Nu({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}},Us=Fn;c(Fn,Ou,"Scheduler",16);var O=new Us;function C(){return O.add("commit").promise}function Bs(t,e){return globalThis.setTimeout(function(){t(),C()},e)}function Gs(t,e){return globalThis.setInterval(function(){t(),C()},e)}var Ws=globalThis.clearInterval,Ys=globalThis.clearTimeout,Yt=globalThis.imba||(globalThis.imba={});Yt.commit=C,Yt.setTimeout=Bs,Yt.setInterval=Gs,Yt.clearInterval=Ws,Yt.clearTimeout=Ys;var Xs={on:function(t,e){return st(this,t,e)},inited:function(t){return nt(this,"inited",[t])}};function Ga(){return!0}function Rn(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function Wa(t,e,r){if(r.get){let s=r.get;r.get=function(){let n=s.call(this);return Object.defineProperty(this,e,{enumerable:!1,value:n}),n}}return r}function Ya(t,e,r){var s,n;if(Rn(r.value,Function)){let i=r.value;r.get=function(){if(this==t)return i;let o=i.bind(this);return Object.defineProperty(this,e,{enumerable:!1,value:o}),o},s=r.value,delete r.value,n=r.writable,delete r.writable}return r}var An=new WeakMap;function Xa(t,e,r){var s;let n=this[0]||{},i=r.value,o=Symbol(),l=new WeakMap,a=An.get(t),d=n.timeout||20*1e3,h=""+(((s=t.constructor)==null?void 0:s.name)||"")+"."+String(typeof e=="symbol"?e.description:e);if(a||An.set(t,a={}),a.key)throw new Error("@thenable "+h+" not allowed - @thenable "+a.key+" already defined");if(!Rn(i,Function))throw new Error("@thenable "+h+" only supports functions");if(i.length>0)throw new Error("@thenable "+h+" methods cannot be called with arguments");let v=function(u){return console.trace("@thenable "+h+" took more than "+d+"ms - make sure method does not return self.",u)},p=function(u){let f=l.get(u);return f||l.set(u,f={}),f},w=function(u,f){let g=this,m=p(g);return(m.promise||(m.promise=new Promise(function(S,b){let y=n.timeout!==!1?setTimeout(v,n.timeout||2e4,g):null,x=function(E){return y&&clearTimeout(y),m.met=!0,m.error=E,console.trace("@thenable "+h+" threw error",E),b(E)};return g[e]().then(function(){return y&&clearTimeout(y),m.met=!0,S(g)},x)}))).then(u,f)};return Object.defineProperty(t,"then",{enumerable:!1,configurable:!0,get:function(){return p(this).met?null:w}}),r.value=function(u){var f;let g=p(this);return(f=g.wrapped)!=null||(g.wrapped=Promise.resolve(i.call(this,g))),g.wrapped},r.value.reset=function(u){let f=p(u);l.delete(u)},r.value.check=p,r}function Qa(){return console.warn("imba.serve is not available on the client")}var Cu=Symbol(),Cr,Ja=new(Cr=class{},c(Cr,Cu,"Env",0),Cr),jn={};function Za(t,e,r){if(e!=null){let s=jn[t]||(jn[t]=new WeakMap);return s.get(e)||s.set(e,(r.memoized=t)&&r).get(e)}return r}function Pu(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Me=Symbol.for("#idler"),Xt=Symbol.for("#resolve"),Lu=Symbol(),Dn=class extends Set{constructor(){super(),this[Me]=Promise.resolve(this)}emit(t,...e){return nt(this,t,e)}on(t,...e){return st(this,t,...e)}once(t,...e){return V(this,t,...e)}un(t,...e){return Ht(this,t,...e)}add(t){var e=this;if(Pu(t,Function)&&(t=t()),!this.has(t)){let r=this.size==0;super.add(t),r&&(this[Me]=this[Xt]=null,this.emit("busy",this)),this.emit("add",t,this);let s=function(){return e.delete(t)};t.then(s,s)}return t}delete(t){return super.delete(t)?(this.emit("delete",t,this),this.size==0&&(this[Xt]&&(this[Xt](!0),this[Xt]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[Me]||(this[Me]=new Promise(function(e){return t.size==0?e(!0):t[Xt]=e}))}get idle\u03A6(){return this.size==0}then(t,e){return this.idle.then(t,e)}},Qs=Dn;c(Dn,Lu,"Queue",24);function Js(t,e){if(e?.debug\u03A6==!1)return;let r=[],s=[];for(let n=0,i=Ks(t),o=i.length;n<o;n++){let l=i[n];if(n%2!=0)continue;let a=t[n+1];l==""?(s.push("%o"),r.push(a)):(s.push("%c%s%c %o"),r.push("background-color:#4c73e8;color:white",l,"background-color:none;color:initial"),r.push(a))}return[s.join(" "),...r]}var Pr=Symbol.for("#L");function th(){return globalThis[Pr]||(globalThis[Pr]=globalThis[Pr]||Js),!0}var Vn=Symbol.for("#toStringDeopt"),zn=Symbol.for("#symbols"),Kn=Symbol.for("#batches"),Hn=Symbol.for("#extras"),qn=Symbol.for("#stacks"),Iu=Symbol(),Un=class{constructor(t){this.dom=t,this.string=""}contains(t){return this.dom.classList.contains(t)}has(t){return this.dom.classList.contains(t)}add(t){return this.contains(t)?this:(this.string+=(this.string?" ":"")+t,this.dom.classList.add(t),this)}remove(t){if(!this.contains(t))return this;let e=new RegExp("(^|\\s)"+t+"(?=\\s|$)","g");return this.string=this.string.replace(e,""),this.dom.classList.remove(t),this}toggle(t,e){return e===void 0&&(e=!this.contains(t)),e?this.add(t):this.remove(t)}incr(t,e=0){var r=this;let 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[zn],s=this[Kn],n=!0;if(!r)r=this[zn]=[t],s=this[Kn]=[e||""],this.toString=this.valueOf=this[Vn];else{let i=r.indexOf(t),o=e||"";i==-1?(r.push(t),s.push(o)):s[i]!=o?s[i]=o:n=!1}n&&(this[Hn]=" "+s.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[Vn](){return this.string+(this[Hn]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[qn]||(this[qn]={})}},Bn=Un;c(Un,Iu,"Flags",16);var Gn=Symbol.for("#__init__"),Lr=Symbol.for("#getRenderContext"),Mu=Symbol.for("#getDynamicContext"),P={context:null},Fu=Symbol(),Wn=class{constructor(t=null){this[Gn](t)}[Gn](t=null,e=!0,r=!0){var s;this.stack=t&&(s=t.stack)!==void 0?s:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},Ru=Wn;c(Wn,Fu,"Renderer",16);var qt=new Ru,Au=Symbol(),Ir=class extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return P.context=null}[Lr](t){let e=this.get(t);return e||this.set(t,e=new Ir(this._,t)),P.context=e}[Mu](t,e){return this[Lr](t)[Lr](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}},Ut=Ir;c(Ir,Au,"RenderContext",16);function vr(t,e=Symbol(),r=t){return P.context=t[e]||(t[e]=new Ut(r,e))}function eh(){let t=P.context,e=t||new Ut(null);return globalThis.DEBUG_IMBA&&!t&&qt.stack.length>0&&console.trace("detected unmemoized nodes in",qt.stack.slice(0),"see https://imba.io",e),t&&(P.context=null),e}function Mr(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function ju(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Qt=Symbol.for("#parent"),Yn=Symbol.for("#closestNode"),Du=Symbol.for("#parentNode"),Vu=Symbol.for("#context"),Xn=Symbol.for("##inited"),Fr=Symbol.for("#getRenderContext"),zu=Symbol.for("#getDynamicContext"),Qn=Symbol.for("#insertChild"),Jt=Symbol.for("#appendChild"),Rr=Symbol.for("#replaceChild"),Jn=Symbol.for("#removeChild"),ot=Symbol.for("#insertInto"),Zn=Symbol.for("#insertIntoDeopt"),Zt=Symbol.for("#removeFrom"),ti=Symbol.for("#removeFromDeopt"),kt=Symbol.for("#replaceWith"),ei=Symbol.for("#replaceWithDeopt"),Ar=Symbol.for("#placeholderNode"),Ku=Symbol.for("#attachToParent"),Hu=Symbol.for("#detachFromParent"),ri=Symbol.for("#placeChild"),qu=Symbol.for("#beforeReconcile"),Uu=Symbol.for("#afterReconcile"),Bu=Symbol.for("#afterVisit"),Gu=Symbol.for("#visitContext"),si=Symbol.for("#__init__"),ni=Symbol.for("##parent"),jr=Symbol.for("##up"),ii=Symbol.for("##context"),gt=Symbol.for("#domNode"),Fe=Symbol.for("##placeholderNode"),oi=Symbol.for("#forNode"),li=Symbol.for("#domDeopt"),Re=Symbol.for("##visitContext"),ai=Symbol.for("#isRichElement"),hi=Symbol.for("#src"),Nt=Symbol.for("#htmlNodeName"),Wu=Symbol.for("#getSlot"),ui=Symbol.for("#ImbaElement"),ci=Symbol.for("#cssns"),Yu=Symbol.for("#cssid"),br=window.Event,rh=window.UIEvent,sh=window.FocusEvent,Zs=window.MouseEvent,tn=window.PointerEvent,en=window.KeyboardEvent,B=window.CustomEvent,Sr=window.Node,wr=window.Comment,rn=window.Text,M=window.Element,nh=window.HTMLElement,ih=window.HTMLHtmlElement,sn=window.HTMLSelectElement,nn=window.HTMLInputElement,on=window.HTMLTextAreaElement,ln=window.HTMLButtonElement,an=window.HTMLOptionElement,oh=window.HTMLScriptElement,lh=window.SVGElement,ah=window.DocumentFragment,hh=window.ShadowRoot,hn=window.Document,uh=window.Window,ch=window.customElements,di={};function fi(t,e,r){if(!t)return r[e]=null;if(r[e]!==void 0)return r[e];let s=Object.getOwnPropertyDescriptor(t,e);return s!==void 0||t==SVGElement?r[e]=s||null:fi(Reflect.getPrototypeOf(t),e,r)}var Dr={},Vr={},Te={},un={};function Ee(){return globalThis.document}function dh(){return globalThis.imba.uses_window=!0,!0}var Xu={get(t,e){let r=t,s;for(;r&&s==null;)(r=r[Qt])&&(s=r[e]);return s},set(t,e,r){let s=t,n;for(;s&&n==null;){if(xe(s,e,Element))return s[e]=r,!0;s=s[Qt]}return!0}},Qu=Symbol(),mi=class{get flags(){return this.documentElement.flags}emit(...t){return this.documentElement.emit(...t)}},Zm=mi;c(mi,Qu,"Document",1,Document),Node.prototype[si]=function(){return this};var Ju=Symbol(),pi=class{get[Qt](){return this[ni]||this.parentNode||this[jr]}get[Yn](){return this}get[Du](){var t;return(t=this[Qt])==null?void 0:t[Yn]}get[Vu](){return this[ii]||(this[ii]=new Proxy(this,Xu))}[Xn](){return this}[Fr](t){return vr(this,t)}[zu](t,e){return this[Fr](t)[Fr](e)}[Qn](t,e){return t[ot](this,e)}[Jt](t){return t[ot](this,null)}[Rr](t,e){let r=this[Qn](t,e);return this[Jn](e),r}[Jn](t){return t[Zt](this)}[ot](t,e=null){return e?t.insertBefore(this,e):t.appendChild(this),this}[Zn](t,e){return e?t.insertBefore(this[gt]||this,e):t.appendChild(this[gt]||this),this}[Zt](t){return t.removeChild(this)}[ti](t){return t.removeChild(this[gt]||this)}[kt](t,e){return e[Rr](t,this)}[ei](t,e){return e[Rr](t,this[gt]||this)}get[Ar](){let t;return this[Fe]||(this[Fe]=(t=globalThis.document.createComment("placeholder"),t[oi]=this,t))}set[Ar](t){let e=this[Fe];this[Fe]=t,t[oi]=this,e&&e!=t&&e.parentNode&&e[kt](t)}[Ku](){let t=this[gt],e=t&&t.parentNode;return t&&e&&t!=this&&(this[gt]=null,this[ot](e,t),t[Zt](e)),this}[Hu](){this[li]!=!0&&(this[li]=!0,!0)&&(this[kt]=this[ei],this[Zt]=this[ti],this[ot]=this[Zn],this[jr]||(this[jr]=this[Qt]));let t=this[Ar];return this.parentNode&&t!=this&&(t[ot](this.parentNode,this),this[Zt](this.parentNode)),this[gt]=t,this}[ri](t,e,r){let s=typeof t;if(s==="undefined"||t===null){if(r&&Mr(r,Comment))return r;let n=globalThis.document.createComment("");return r?r[kt](n,this):n[ot](this,null)}if(t===r)return t;if(s!=="object"){let n,i=t;return r?Mr(r,Text)?(r.textContent=i,r):(n=globalThis.document.createTextNode(i),r[kt](n,this),n):(this.appendChild(n=globalThis.document.createTextNode(i)),n)}else return t[ot]?r?r[kt](t,this):t[ot](this,null):this[ri](String(t),e,r)}},tp=pi;c(pi,Ju,"Node",1,Node);var Zu=Symbol(),gi=class{log(...t){return console.log(...t)}get hidden\u03A6(){var t,e;let r=globalThis.getComputedStyle(this);return r.display=="none"||r.visibility=="hidden"?!0:this.offsetParent||this===globalThis.document.body?!1:(e=(t=this.parentElement)==null?void 0:t.hidden\u03A6)!=null?e:!0}get detached\u03A6(){return!globalThis.document.documentElement.contains(this)}get unobstructed\u03A6(){let t=this.getBoundingClientRect(),e=window.visualViewport,r=t.left+t.width*.5,s=t.top+t.height*.5;if(e.width>r&&r>0&&e.height>s&&s>0){let n=globalThis.document.elementFromPoint(r,s);return!!(n&&(n.contains(this)||this.contains(n)))}return!1}get focus\u03A6(){return globalThis.document.activeElement==this}get focin\u03A6(){return this.contains(globalThis.document.activeElement)}emit(t,e,r={}){var s,n,i;e!=null&&((s=r.detail)!=null||(r.detail=e)),(n=r.bubbles)!=null||(r.bubbles=!0),(i=r.cancelable)!=null||(r.cancelable=!0);let o=new CustomEvent(t,r);r.original&&(o.originalEvent=r.original);let l=this.dispatchEvent(o);return o}text$(t){return this.textContent=t,this}[qu](){return this}[Uu](){return this}[Bu](){this[Re]&&(this[Re]=null)}get[Gu](){return this[Re]||(this[Re]={})}get flags(){return this.$flags||(this.$flags=new Bn(this),this.flag$==Element.prototype.flag$&&(this.flags$ext=this.className),this.flagDeopt$()),this.$flags}flag$(t){let e=this.flags$ns;this.className=e?e+(this.flags$ext=t):this.flags$ext=t}flagDeopt$(){var t=this;this.flag$=this.flagExt$,this.flagSelf$=function(e){return t.flagSync$(t.flags$own=e)}}flagExt$(t){return this.flagSync$(this.flags$ext=t)}flagSelf$(t){return this.flagDeopt$(),this.flagSelf$(t)}flagSync$(){return this.className=(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||"")}set$(t,e){let r=xe(this,t,Element);!r||!r.set?this.setAttribute(t,e):this[t]=e}get richValue(){return this.value}set richValue(t){this.value=t}},ep=gi;c(gi,Zu,"Element",1,Element),Element.prototype.setns$=Element.prototype.setAttributeNS,Element.prototype[ai]=!0;function fh(t,e,r,s){let n=globalThis.document.createElement(t);return r&&(n.className=r),s!==null&&n.text$(s),e&&e[Jt]&&e[Jt](n),n}var tc=Symbol(),yi=class{set$(t,e){var r;let s=di[r=this.nodeName]||(di[r]={}),n=fi(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 this.flag$=function(r){return e.flagSync$(e.flags$ext=r)},this.flagSelf$=function(r){return e.flagSync$(e.flags$own=r)},this.flagSelf$(t)}flagSync$(){return this.setAttribute("class",(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||""))}},rp=yi;c(yi,tc,"SVGElement",1,SVGElement);var ec=Symbol(),vi=class{set src(t){if(this[hi]!=t&&(this[hi]=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,i,o;r<n;r++)i=s[r],o=e[i],this.setAttribute(i,o);this.innerHTML=t.content}}}},sp=vi;c(vi,ec,"SVGSVGElement",1,SVGSVGElement);function mh(t,e,r,s,n){let i=globalThis.document.createElementNS("http://www.w3.org/2000/svg",t);return r&&(i.className.baseVal=r),e&&e[Jt]&&e[Jt](i),s&&(i.textContent=s),i}function xt(t){return globalThis.document.createComment(t)}function xr(t){return globalThis.document.createTextNode(t)}function ph(){return globalThis.document.createDocumentFragment()}var Ae=globalThis.navigator,rc=Ae&&Ae.vendor||"",bi=Ae&&Ae.userAgent||"",sc=rc.indexOf("Apple")>-1||bi.indexOf("CriOS")>=0||bi.indexOf("FxiOS")>=0,je=!sc,Si=new Map,nc=Symbol(),wi=class extends HTMLElement{connectedCallback(){return je?this.parentNode.removeChild(this):this.parentNode.connectedCallback()}disconnectedCallback(){if(!je)return this.parentNode.disconnectedCallback()}},ic=wi;c(wi,nc,"CustomHook",0),window.customElements.define("i-hook",ic);function oc(t,e){let r=Si.get(e);if(!r){r={};let s=e.prototype,n=[s];for(;(s=s&&Object.getPrototypeOf(s))&&s.constructor!=t.constructor;)n.unshift(s);for(let i=0,o=ju(n),l=o.length;i<l;i++){let a=o[i],d=Object.getOwnPropertyDescriptors(a);Object.assign(r,d)}Si.set(e,r)}return r}function cn(t,e,r,s,n){let i;typeof t!="string"&&t&&t.nodeName&&(t=t.nodeName);let o=Vr[t]||t;if(Dr[t]){let l=Dr[t],a=l.prototype[Nt];if(a&&je)i=globalThis.document.createElement(a,{is:o});else if(l.create$&&a){i=globalThis.document.createElement(a),i.setAttribute("is",o);let d=oc(i,l);Object.defineProperties(i,d),i.__slots={},i.appendChild(globalThis.document.createElement("i-hook"))}else l.create$?(i=l.create$(i),i.__slots={}):console.warn("could not create tag "+t)}else i=globalThis.document.createElement(Vr[t]||t);return i[ni]=e,i[si](),i[Xn](),s!==null&&i[Wu]("__").text$(s),(r||i.flags$ns)&&i.flag$(r||""),i}function gh(t,e,r,s){return t==null||t==null?xt(""):Mr(t,Node)||t[ai]?t:cn(t,e,r,s)}function dn(t,e){if(Te[t])return Te[t];if(window[e])return window[e];if(window[t])return window[t]}function yh(t,e,r){var s;let n=dn(t,e);if(n||console.warn("could not inherit from undefined tag type "+t),!(n==r||n.prototype instanceof r||n.prototype[Nt])){let i=n.prototype[ui];if(!i){let o=Symbol();i=(s=class extends n{constructor(){super(...arguments),this.__slots={},this.__F=0}},c(s,o,"CustomBuiltInElement",16),s),n.prototype[ui]=i;let l=Object.getOwnPropertyDescriptors(r.prototype);Object.defineProperties(i.prototype,l),i.prototype[Nt]=t}return i}return n}function vh(t,e,r={}){Te[t]=un[t]=e,e.nodeName=t;let s=t,n=e.prototype;if(t.indexOf("-")==-1&&(s=""+t+"-tag",Vr[t]=s),r.cssns){let i=(n._ns_||n[ci]||"")+" "+(r.cssns||"");n._ns_=i.trim()+" ",n[ci]=r.cssns}if(r.cssid){let i=(n.flags$ns||"")+" "+r.cssid;n[Yu]=r.cssid,n.flags$ns=i.trim()+" "}return n[Nt]&&!r.extends&&(r.extends=n[Nt]),r.extends?(n[Nt]=r.extends,Dr[t]=e,je&&window.customElements.define(s,e,{extends:r.extends})):window.customElements.define(s,e),e}var lc=globalThis.imba||(globalThis.imba={});lc.document=globalThis.document;function te(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function zr(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var De=Symbol.for("#parent"),xi=Symbol.for("#closestNode"),ac=Symbol.for("#isRichElement"),hc=Symbol.for("#afterVisit"),uc=Symbol.for("#getRenderContext"),_i=Symbol.for("#appendChild"),Ti=Symbol.for("#removeChild"),Ei=Symbol.for("#replaceChild"),lt=Symbol.for("#insertInto"),Ve=Symbol.for("#replaceWith"),$i=Symbol.for("#insertChild"),ze=Symbol.for("#removeFrom"),ki=Symbol.for("#placeChild"),cc=Symbol.for("#registerFunctionalSlot"),dc=Symbol.for("#getFunctionalSlot"),Ni=Symbol.for("#getSlot"),Kr=Symbol.for("##parent"),yt=Symbol.for("##up"),Oi=Symbol.for("##flags"),fc=Symbol.for("#domFlags"),H=Symbol.for("#end"),Ci=Symbol.for("#textContent"),Ke=Symbol.for("#textNode"),Hr=Symbol.for("#functionalSlots");function bh(){return!0}var mc=Symbol(),Pi=class{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[De](t){this[Kr]=t}get[De](){return this[Kr]||this[yt]}get[xi](){return this[De][xi]}get[ac](){return!0}get flags(){return this[Oi]||(this[Oi]=new Bn(this))}flagSync$(){return this}[hc](){return this}[uc](t){return vr(this,t)}},Bt=Pi;c(Pi,mc,"Fragment",16);var pc=0,gc=Symbol(),Li=class extends Bt{constructor(t,e){super(...arguments),this[yt]=e,this.parentNode=null,this[fc]=t,this.childNodes=[],this[H]=xt("slot"+pc++),e&&e[_i](this)}get[De](){return this[Kr]||this.parentNode||this[yt]}set textContent(t){this[Ci]=t}get textContent(){return this[Ci]}hasChildNodes(){for(let t=0,e=zr(this.childNodes),r=e.length;t<r;t++){let s=e[t];if(te(s,Bt)&&s.hasChildNodes()||!te(s,wr)&&te(s,Sr))return!0}return!1}text$(t){return this[Ke]?this[Ke].textContent=t:this[Ke]=this[ki](t),this[Ke]}appendChild(t){return this.parentNode&&t[lt](this.parentNode,this[H]),this.childNodes.push(t)}[_i](t){var e;return this.parentNode?t[lt](this.parentNode,this[H]):(e=t[yt])!=null||(t[yt]=this[yt]||this),this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[$i](t,e);let r=this.childNodes.indexOf(e);return r>=0&&this.childNodes.splice(r,0,t),t}[Ti](t){this.parentNode&&this.parentNode[Ti](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[Ei](t,e){this.parentNode&&this.parentNode[Ei](t,e);let r=this.childNodes.indexOf(e);return this.childNodes[r]=t,t}[lt](t,e){let r=this.parentNode;if(this.parentNode!=t&&(this.parentNode=t,!0)){this[H]&&(e=this[H][lt](t,e));for(let s=0,n=zr(this.childNodes),i=n.length;s<i;s++)n[s][lt](t,e)}return this}[Ve](t,e){let r=t[lt](e,this[H]);return this[ze](e),r}[$i](t,e){if(this.parentNode&&this.insertBefore(t,e||this[H]),e){let r=this.childNodes.indexOf(e);r>=0&&this.childNodes.splice(r,0,t)}else this.childNodes.push(t);return t}[ze](t){for(let e=0,r=zr(this.childNodes),s=r.length;e<s;e++)r[e][ze](t);return this[H]&&this[H][ze](t),this.parentNode=null,this}[ki](t,e,r){let s=this.parentNode,n=typeof t;if(n==="undefined"||t===null){if(r&&te(r,wr))return r;let i=xt("");if(r){let o=this.childNodes.indexOf(r);return this.childNodes.splice(o,1,i),s&&r[Ve](i,s),i}return this.childNodes.push(i),s&&i[lt](s,this[H]),i}if(t===r)return t;if(n!=="object"){let i,o=t;if(r){if(te(r,rn))return r.textContent=o,r;{i=xr(o);let l=this.childNodes.indexOf(r);return this.childNodes.splice(l,1,i),s&&r[Ve](i,s),i}}else return this.childNodes.push(i=xr(o)),s&&i[lt](s,this[H]),i}else if(r){let i=this.childNodes.indexOf(r);return this.childNodes.splice(i,1,t),s&&r[Ve](t,s),t}else return this.childNodes.push(t),s&&t[lt](s,this[H]),t}},Ii=Li;c(Li,gc,"VirtualFragment",16);function Sh(t,e){return new Ii(t,e)}function $e(t,e){let r=new Ii(t,null);return r[yt]=e,r}var yc=Symbol(),Mi=class{[cc](t){let e=this[Hr]||(this[Hr]={});return e[t]||(e[t]=$e(0,this))}[dc](t,e){let r=this[Hr];return r&&r[t]||this[Ni](t,e)}[Ni](t,e){var r;return t=="__"&&!this.render||!this.__slots?this:(r=this.__slots)[t]||(r[t]=$e(0,this))}},np=Mi;c(Mi,yc,"Node",1,Sr);function vc(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var bc=Symbol.for("#afterVisit"),He=Symbol.for("#insertInto"),Fi=Symbol.for("#appendChild"),Sc=Symbol.for("#replaceWith"),qr=Symbol.for("#removeFrom"),wc=Symbol.for("#domFlags"),xc=Symbol.for("##parent"),ut=Symbol.for("#end"),_c=Symbol.for("#removeChild"),Tc=Symbol.for("#insertChild"),Ec=Symbol(),Ri=class extends Bt{constructor(t,e){super(...arguments),this[wc]=t,this[xc]=e,t&256||(this[ut]=xt("list")),this.$=this.childNodes,this.length=0,e&&e[Fi](this)}hasChildNodes(){return this.length!=0}[bc](t){let e=this.length;if(this.length=t,e==t)return;let r=this.parentNode;if(!r)return;let s=this.childNodes,n=this[ut];if(e>t)for(;e>t;)r[_c](s[--e]);else if(t>e)for(;t>e;)r[Tc](s[e++],n);this.length=t}[He](t,e){this.parentNode=t,this[ut]&&this[ut][He](t,e),e=this[ut];for(let r=0,s=vc(this.childNodes),n=s.length;r<n;r++){let i=s[r];if(r==this.length)break;i[He](t,e)}return this}[Fi](t){}[Sc](t,e){let r=t[He](e,this[ut]);return this[qr](e),r}[qr](t){let e=this.length;for(;e>0;)this.childNodes[--e][qr](t);this[ut]&&t.removeChild(this[ut]),this.parentNode=null}},$c=Ri;c(Ri,Ec,"IndexedTagFragment",16);function wh(t,e){return new $c(t,e)}function Ai(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var Ur=Symbol.for("#appendChild"),qe=Symbol.for("#insertChild"),kc=Symbol.for("#replaceWith"),Ue=Symbol.for("#insertInto"),Br=Symbol.for("#removeFrom"),Nc=Symbol.for("#afterVisit"),Be=Symbol.for("#domFlags"),ji=Symbol.for("##parent"),ct=Symbol.for("#end"),Di=Symbol.for("#removeChild"),Oc=Symbol(),Vi=class extends Bt{constructor(t,e){super(...arguments),this[Be]=t,this[ji]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new Ut(this,Symbol()),t&256||(this[ct]=xt("map")),e&&e[Ur](this)}[Ur](t){if(this.parentNode)return this.parentNode[qe](t,this[ct])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[Be]&1)){this.array.push(t),this[Ur](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[qe](t,n.nextSibling)}else s[qe](t,this.childNodes[e+1]||this[ct])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[Br](t.parentNode)}[qe](t,e){}[kc](t,e){let r=t[Ue](e,this[ct]);return this[Br](e),r}[Ue](t,e){this[ji]=t;let r=this.parentNode;if(t!=r){this.parentNode=t;for(let s=0,n=Ai(this.array),i=n.length;s<i;s++)n[s][Ue](t,e);this[ct]&&this[ct][Ue](t,e)}return this}[Br](t){for(let e=0,r=Ai(this.array),s=r.length;e<s;e++){let n=r[e];t[Di](n)}return this[ct]&&t[Di](this[ct]),this.parentNode=null}[Nc](t){var e=this;if(!(this[Be]&1)){this[Be]|=1;return}if(this.dirty&&(this.changes.forEach(function(r,s){if(r==-1)return e.removeChild(s)}),this.changes.clear(),this.dirty=!1),this.array.length>t)for(;this.array.length>t;){let r=this.array.pop();this.removeChild(r)}}},Cc=Vi;c(Vi,Oc,"KeyedTagFragment",16);function xh(t,e){return new Cc(t,e)}function zi(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Ge=Symbol.for("#__init__"),Pc=Symbol.for("##inited"),Lc=Symbol.for("#afterVisit"),Ic=Symbol.for("#beforeReconcile"),Mc=Symbol.for("#afterReconcile"),Ki=Symbol.for("#__hooks__"),Ot=Symbol.for("#autorender"),We=Symbol.for("##visitContext"),Fc=Symbol(),Gr,Hi=new(Gr=class{constructor(t=null){this[Ge](t)}[Ge](t=null,e=!0,r=!0){var s;this.items=t&&(s=t.items)!==void 0?s:[],this.current=t&&(s=t.current)!==void 0?s:null,this.lastQueued=t&&(s=t.lastQueued)!==void 0?s:null,this.tests=t&&(s=t.tests)!==void 0?s:0}flush(){let t=null;for(;t=this.items.shift();){if(!t.parentNode||t.hydrated\u03A6)continue;let e=this.current;this.current=t,t.__F|=1024,t.connectedCallback(),this.current=e}}queue(t){var e=this;let r=this.items.length,s=0,n=this.lastQueued;this.lastQueued=t;let i=Node.DOCUMENT_POSITION_PRECEDING,o=Node.DOCUMENT_POSITION_FOLLOWING;if(r){let l=this.items.indexOf(n),a=l,d=function(v,p){return e.tests++,v.compareDocumentPosition(p)};(l==-1||n.nodeName!=t.nodeName)&&(a=l=0);let h=this.items[a];for(;h&&d(h,t)&o;)h=this.items[++a];if(a!=l)h?this.items.splice(a,0,t):this.items.push(t);else{for(;h&&d(h,t)&i;)h=this.items[--a];a!=l&&(h?this.items.splice(a+1,0,t):this.items.unshift(t))}}else this.items.push(t),this.current||globalThis.queueMicrotask(this.flush.bind(this))}},c(Gr,Fc,null,16),Gr);function _h(){return Hi.flush()}var Rc=Symbol(),qi=class extends HTMLElement{constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build()}setup$(){return this.__slots={},this.__F=0}[Ge](){return this.__F|=3,this}[Pc](){if(this[Ki])return this[Ki].inited(this)}flag$(t){this.className=this.flags$ext=t}build(){return this}awaken(){return this}mount(){return this}unmount(){return this}rendered(){return this}dehydrate(){return this}hydrate(){return this.autoschedule=!0,this}tick(t,e){return this.commit()}visit(){return this.commit()}commit(){return this.render\u03A6?(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[Ot]||(this[Ot]={});e.value=t,this.mounted\u03A6&&O.schedule(this,e)}get render\u03A6(){return!this.suspended\u03A6}get mounting\u03A6(){return(this.__F&16)!=0}get mounted\u03A6(){return(this.__F&32)!=0}get awakened\u03A6(){return(this.__F&8)!=0}get rendered\u03A6(){return(this.__F&512)!=0}get suspended\u03A6(){return(this.__F&4096)!=0}get rendering\u03A6(){return(this.__F&256)!=0}get scheduled\u03A6(){return(this.__F&128)!=0}get hydrated\u03A6(){return(this.__F&2)!=0}get ssr\u03A6(){return(this.__F&1024)!=0}get scheduler(){return O}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,zi(t,Function)&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("@suspended")==0&&(this.__F&=-4097,this.commit()),this}[Lc](){if(this.visit(),this[We])return this[We]=null}[Ic](){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&&qt.push(this),this[We]&&(this[We]=null),this}[Mc](){return globalThis.DEBUG_IMBA&&qt.pop(this),this}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(!e&&!(t&1024)){Hi.queue(this);return}if(t&48)return;this.__F|=16,e||this[Ge](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),r||(this.awaken(),this.__F|=8),nt(this,"mount",[this]);let s=this.mount();return s&&zi(s.then,Function)&&s.then(O.commit),t=this.__F=(this.__F|32)&-17,t&64&&this.schedule(),this[Ot]&&O.schedule(this,this[Ot]),this}disconnectedCallback(){if(this.__F=this.__F&-49,this.__F&128&&this.unschedule(),nt(this,"unmount",[this]),this.unmount(),this[Ot])return O.unschedule(this,this[Ot])}},ke=qi;c(qi,Rc,"Component",16);var Th=ke;function Ac(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Ui=Symbol.for("#__init__"),jc={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},Bi={prefix:1,suffix:1,content:1},Wr={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]]},Dc=new RegExp("^("+Object.keys(Wr).join("|")+")(\\d+(?:\\.\\d+)?)$"),Vc=/^([xyz])$/,zc=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,Kc=`*,::before,::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor;
}`,Hc=Symbol(),Gi=class{constructor(t=null){this[Ui](t)}[Ui](t=null,e=!0,r=!0){var s;this.entries=t&&(s=t.entries)!==void 0?s:{}}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",Kc),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(`
`)}toValue(t,e,r,s=null){let n;Bi[r]&&(t=String(t));let i=typeof t;if(i=="number"){if(e||(Vc.test(r)?e="px":zc.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return jc[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(i=="string"){if(r&&Bi[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),n=t.match(Dc)){let o=Wr[n[1]][parseInt(n[2])],l="100%";if(typeof s=="number"?l=s+"%":typeof s=="string"&&(l=s),o)return"hsla("+o[0]+","+o[1]+"%,"+o[2]+"%,"+l+")"}}else if(t&&Ac(t.toStyleString,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]}},qc=Gi;c(Gi,Hc,"Styles",16);var fn=new qc,Eh=Object.keys(Wr);function $h(){return globalThis.imba.uses_styles=!0,!0}var Uc=Symbol(),Wi=class{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,s,n=null){let i=fn.toValue(e,r,s,n);this.style.setProperty(t,i)}},ip=Wi;c(Wi,Uc,"Element",1,M);function Bc(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}var Yi=Symbol.for("#insertInto"),Xi=Symbol.for("#removeFrom");function kh(t,e={}){let r=P.context;P.context=e;let s=t(e);return P.context==e&&(P.context=r),s}function mn(t,e,r={}){let s=e||globalThis.document.body,n=t;if(Bc(t,Function)){let i=t,o=r.tick||(r.tick=function(){let l=r.context||(r.context=new Ut(s,null)),a=P.context;P.context=l;let d=t(l,r);return P.context==l&&(P.context=a),r.node!=d&&(r.node&&globalThis.imba.unmount(r.node),d?((r.node=d)[Yi](s),d.tick==ke.prototype.tick&&(d.tick=r.tick,d.scheduled\u03A6),V(d,"unmount",function(){if(r.node==d)return r.node=null,O.unlisten("commit",r.tick)})):(r.node=d,O.unlisten("commit",r.tick))),d});return O.listen("commit",o),o()}else n.__F|=64;return n[Yi](s),n}function pn(t){return t&&t[Xi]&&t.parentNode&&t[Xi](t.parentNode),t}var Qi=globalThis.imba||(globalThis.imba={});Qi.mount=mn,Qi.unmount=pn;function Y(t,e){var r;return typeof e=="string"?typeof t===e:(r=e[Symbol.hasInstance])==null?void 0:r.call(e,t)}function ee(t){let e;return t&&((e=t.toIterable)?e.call(t):t)}var re=Symbol.for("##onchange"),se=Symbol.for("#afterVisit"),ne=Symbol.for("##oninput"),Ye=Symbol.for("##onclick"),ie=Symbol.for("##bound"),dt=Symbol.for("##visitContext");function Nh(){return globalThis.imba.uses_dom_bind=!0,!0}var Gc={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},Yr=function(t){return Y(t,Array)||t&&Y(t.has,Function)},Xr=function(t,e){return t==e?!0:Y(t,Array)?t.indexOf(e)>=0:t&&Y(t.has,Function)?t.has(e):t&&Y(t.contains,Function)?t.contains(e):!1},Qr=function(t,e){if(Y(t,Array))return t.push(e);if(t&&Y(t.add,Function))return t.add(e)},Jr=function(t,e){if(Y(t,Array)){let r=t.indexOf(e);if(r>=0)return t.splice(r,1)}else if(t&&Y(t.delete,Function))return t.delete(e)};function Wc(t){function e(){return t[0]?t[0][t[1]]:void 0}function r(s){return t[0]?t[0][t[1]]=s:null}return{get:e,set:r}}var Yc=Symbol(),Ji=class{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this[ie]&&Gc[this.nodeName]&&(this[ie]=!0,this[re]&&this.addEventListener("change",this[re]=this[re].bind(this)),this[ne]&&this.addEventListener("input",this[ne]=this[ne].bind(this),{capture:!0}),this[Ye]&&this.addEventListener("click",this[Ye]=this[Ye].bind(this),{capture:!0})),Object.defineProperty(this,t,Y(r,Array)?Wc(r):r),r}},op=Ji;c(Ji,Yc,"Element",1,M),Object.defineProperty(M.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(t){return this.setRichValue(t)}});var Xc=Symbol(),Zi=class{[re](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,i=ee(r),o=i.length;n<o;n++){let l=i[n];s.indexOf(l)==-1&&Jr(e,l)}for(let n=0,i=ee(s),o=i.length;n<o;n++){let l=i[n];(!r||r.indexOf(l)==-1)&&Qr(e,l)}}else this.data=s[0];return C(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=ee(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=ee(this.options),n=s.length;r<n;r++){let i=s[r],o=i.richValue,l=Xr(t,o);i.selected=l,l&&e.push(o)}this.$$value=e}else for(let e=0,r=ee(this.options),s=r.length;e<s;e++){let n=r[e].richValue;if(n==t){this.$$value=[n],this.selectedIndex=e;break}}}[se](){if(this.syncValue(),this[dt])return this[dt]=null}},lp=Zi;c(Zi,Xc,"HTMLSelectElement",1,sn);var Qc=Symbol(),to=cl