UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

8 lines (7 loc) 141 kB
var oe=Symbol.for("#__init__"),So=Symbol.for("#__initor__"),Nu=Symbol.for("#__inited__"),bo=Symbol.for("#__hooks__"),Xd=Symbol.for("#__patch__"),Cu=Symbol.for("#has"),Iu=Symbol.for("#meta"),Br=Symbol.for("imba"),Qd=Symbol.for("#__mixin__"),Ou=Symbol.for("#matcher"),De=Symbol.for("#L"),Jd=Symbol.for("#appendChild"),Zd=Symbol.for("#afterVisit"),tp=Symbol.for("#beforeReconcile"),ep=Symbol.for("#afterReconcile"),rp=Symbol.for("##up"),ip={SUPERCALLS:8,CONSTRUCTOR:16},Et={IsExtension:1,IsTag:2,HasDescriptors:4,HasSuperCalls:8,HasConstructor:16,HasFields:32,HasMixins:64,HasInitor:128,HasDecorators:256,IsObjectExtension:512,IsMixin:1024},Dt=new Map,Lu=globalThis[Br]||(globalThis[Br]={counter:0,classes:Dt});function Tt(i,t={}){var e;return Dt.has(i)||Dt.set(i,{symbol:Symbol(i.name),parent:(e=Object.getPrototypeOf(i.prototype))==null?void 0:e.constructor,for:i,uses:null,inits:null,id:Lu.counter++,...t}),Dt.get(i)}var vo=new WeakMap;function sp(i,t){var e;return i==t||((e=t==null?void 0:t[Ou])==null?void 0:e.call(t,i))}function np(i,t){var e;return typeof t=="string"?typeof i===t:(e=t==null?void 0:t[Symbol.hasInstance])==null?void 0:e.call(t,i)}function op(i,t){var e,r,s,n,o,l;return(l=(o=(s=(e=t==null?void 0:t[Cu])==null?void 0:e.call(t,i))!=null?s:(r=t==null?void 0:t.includes)==null?void 0:r.call(t,i))!=null?o:(n=t==null?void 0:t.has)==null?void 0:n.call(t,i))!=null?l:!1}function lp(i,t){return t!=null&&t.indexOf?t.indexOf(i):Array.prototype.indexOf.call(i,t)}function hp(i,t,...e){return t&&t[De]instanceof Function?i=t[De](i,t,...e):globalThis[De]instanceof Function&&(i=globalThis[De](i,t,...e)),i}function xo(i){return vo.get(i)||vo.set(i,{}).get(i)}function wo(i){var t;return((t=i==null?void 0:i.toIterable)==null?void 0:t.call(i))||i}function up(i,t,e,r){let s,n=arguments.length,o=i.length,l=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r;for(;o>0;)(s=i[--o])&&(l=(n<3?s(l):n>3?s(t,e,l):s(t,e))||l);return n>3&&l&&Object.defineProperty(t,e,l),l}function Pu(i,t){if(!i||!t)return!1;if(i.get)return t.get===i.get;if(i.set)return t.set===i.set;if(i.value)return i.value===t.value}function _o(i,t,e,r={}){let s=i.constructor;!e&&t&&(e=Object.getOwnPropertyDescriptors(t),delete e.constructor,e[oe]&&(console.warn(`Cannot define plain fields when extending class ${s.name}`),delete e[oe]));let n=Tt(s);if(n&&n.augments){let o=new Map;for(let l of Object.keys(e)){let h=Object.getOwnPropertyDescriptor(i,l);for(let u of n.augments){let d=o.get(u);d||o.set(u,d={});let a=Object.getOwnPropertyDescriptor(u.prototype,l);a&&!Pu(h,a)?console.warn("wont extend",l,a,h):d[l]=e[l]}}for(let[l,h]of o)Object.keys(h).length&&_o(l.prototype,null,h)}return Object.defineProperties(i,e),i}function Ve(i,t){var o;let e=Tt(i),r=Tt(t),s=r.parent;for(;s&&((o=Tt(s))==null?void 0:o.flags)&Et.IsMixin;){Ve(i,s),s=null;break}if(s&&!(i.prototype instanceof s))throw new Error(`Mixin ${t.name} has superclass not present in target class`);if(!r.augments){r.augments=new Set;let l=r.ref=Symbol(t.name),h=Object[Symbol.hasInstance];t.prototype[l]=!0,Object.defineProperty(t,Symbol.hasInstance,{value:function(u){return this===t?u&&!!u[l]:h.call(this,u)}})}if(i.prototype[r.ref])return i;if(r.uses)for(let l of r.uses)Ve(i,l);r.augments.add(i),e.uses||(e.uses=[]),e.uses.push(t);let n=Object.getOwnPropertyDescriptors(t.prototype);return delete n.constructor,n[oe]&&(e.inits||(e.inits=[]),e.inits.push(t.prototype[oe]),delete n[oe]),Object.defineProperties(i.prototype,n),(t==null?void 0:t.mixed)instanceof Function&&t.mixed(i),i}function ap(i,t,...e){let r=t?class extends t{}:class{},s=Tt(r,{symbol:i});for(let n of e)Ve(r,n);return r.prototype[i]=function(n,o,l){if(s.inits)for(let h of s.inits)h.call(this,n,!1,l)},r}var G={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(i,t,e)=>Reflect.apply(G.target,t,e),get:(i,t)=>{let e=Reflect.get(G.target,t,G.self);return e instanceof Function?e.bind(G.self):e},set:(i,t,e,r)=>Reflect.set(G.target,t,e,G.self)})};function cp(i,t){return G.self=i,G.target=G.cache[t],G.proxy}function c(i,t,e,r,s=null){var u;let n=Object.getPrototypeOf(i.prototype),o=(r&(Et.HasMixins|Et.IsExtension))==Et.HasMixins,l;if(o&&(Dt.set(i,Dt.get(n.constructor)),n=Object.getPrototypeOf(n)),s){let d=r&Et.IsObjectExtension?s:s.prototype,a=Tt(i);if(a.uses){s===d&&console.warn("Cannot extend object with mixins");for(let b of a.uses)Ve(s,b)}return r&Et.HasSuperCalls&&(G.cache[t]=Object.create(Object.getPrototypeOf(d),Object.getOwnPropertyDescriptors(d))),_o(d,i.prototype),s}let h=n==null?void 0:n.constructor;if(l=Tt(i,{symbol:t}),Object.defineProperty(i,Iu,{value:l,enumerable:!1,configurable:!0}),e&&i.name!==e&&Object.defineProperty(i,"name",{value:e,configurable:!0}),l.flags=r,r&Et.HasConstructor&&(i.prototype[So]=t),l.uses)for(let d of l.uses)(u=d.mixes)==null||u.call(d,i);return(h==null?void 0:h.inherited)instanceof Function&&h.inherited(i),i}function fp(i,t){var e;i[So]===t&&((e=i[Nu])==null||e.call(i),i[bo]&&i[bo].inited(i))}var le=Symbol.for("#__listeners__"),ku=/-./g,yp=new Set,Fu=Symbol(),Gr=class Gr{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}};c(Gr,Fu,"LazyProxy",16);var Wr=Gr;function To(i,t={}){return new Proxy(t,new Wr(i))}function he(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 $p(i){return i.indexOf("-")>=0?i.replace(ku,function(t){return t.charAt(1).toUpperCase()}):i}function ze(i,t,e){if(!i)return;let r=Object.getOwnPropertyDescriptor(i,t);return r||i==e?r||void 0:ze(Reflect.getPrototypeOf(i),t,e)}var Eo=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 j(i,t,e,r){let s,n,o;return s=i[le]||(i[le]={}),n=s[t]||(s[t]={}),o=n.tail||(n.tail=n.next={}),o.listener=e,o.path=r,n.tail=o.next={},o}function M(i,t,e){let r=j(i,t,e);return r.times=1,r}function Nt(i,t,e,r){if(!e)return;let s,n,o=i[le];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 q(i,t,e=null){let r;(r=i[le])&&(r[t]&&Eo(t,e,r[t]),r.all&&Eo(t,[t,e],r.all))}var Mu=Symbol(),Yr=class Yr{emit(t,...e){return q(this,t,e)}on(t,...e){return j(this,t,...e)}once(t,...e){return M(this,t,...e)}un(t,...e){return Nt(this,t,...e)}};c(Yr,Mu,"Emitter",0);var Vt=Yr;function bp(i){return i}function Xr(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}function Ru(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var No=Symbol.for("#__init__"),Co=Symbol.for("#schedule"),Qr=Symbol.for("#frames"),Ke=Symbol.for("#interval"),zt=Symbol.for("#stage"),Kt=Symbol.for("#scheduled"),je=Symbol.for("#version"),Au=Symbol.for("#fps"),Io=Symbol.for("#ticker"),Du=globalThis.requestAnimationFrame||function(i){return globalThis.setTimeout(i,1e3/60)};var xp=1/60,Vu=Symbol(),ti=class ti{constructor(t=null){this[No](t)}[No](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[Qr],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[Ke]=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[Ke]&&(globalThis.clearInterval(this[Ke]),this[Ke]=null),this.active=!1,this}};c(ti,Vu,"Scheduled",16);var Jr=ti,zu=Symbol(),ei=class ei{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[zt]=-1,this[Qr]=0,this[Kt]=!1,this[je]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[Au]=0,this.$promise=null,this.$resolve=null,this[Io]=function(e){return t[Kt]=!1,t.tick(e)}}touch(){return this[je]++}get version(){return this[je]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Kt]||this[Co](),this}get committingΦ(){return this.queue.indexOf("commit")>=0}get syncingΦ(){return this[zt]==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[Qr]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[zt]=1,this[je]++,r.length)for(let n=0,o=Ru(r),l=o.length;n<l;n++){let h=o[n];typeof h=="string"&&this.listeners[h]?this.listeners[h].forEach(function(u){if(Xr(u.tick,Function))return u.tick(e,h);if(Xr(u,Function))return u(e,h)}):Xr(h,Function)?h(this.dt,this):h.tick&&h.tick(this.dt,this)}return this[zt]=this[Kt]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[Co](){return this[Kt]||(this[Kt]=!0,this[zt]==-1&&(this[zt]=0),Du(this[Io])),this}schedule(t,e){var s,n;return e||(e=t[s=this.id]||(t[s]={value:!0})),(e[n=this.id]||(e[n]=new Jr({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}};c(ei,zu,"Scheduler",16);var Zr=ei,L=new Zr;function P(){return L.add("commit").promise}function Ku(i,t){return globalThis.setTimeout(function(){i(),P()},t)}function ju(i,t){return globalThis.setInterval(function(){i(),P()},t)}var qu=globalThis.clearInterval,Hu=globalThis.clearTimeout,ue=globalThis.imba||(globalThis.imba={});ue.commit=P;ue.setTimeout=Ku;ue.setInterval=ju;ue.clearInterval=qu;ue.clearTimeout=Hu;var Oo={on:function(i,t){return j(this,i,t)},inited:function(i){return q(this,"inited",[i])}};function Ep(){return!0}function Po(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}function Np(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 Cp(i,t,e){var r,s;if(Po(e.value,Function)){let n=e.value;e.get=function(){if(this==i)return n;let o=n.bind(this);return Object.defineProperty(this,t,{enumerable:!1,value:o}),o},r=e.value,delete e.value,s=e.writable,delete e.writable}return e}var Lo=new WeakMap;function Ip(i,t,e){var x;let r=this[0]||{},s=e.value,n=Symbol(),o=new WeakMap,l=Lo.get(i),h=r.timeout||20*1e3,u=""+(((x=i.constructor)==null?void 0:x.name)||"")+"."+String(typeof t=="symbol"?t.description:t);if(l||Lo.set(i,l={}),l.key)throw new Error("@thenable "+u+" not allowed - @thenable "+l.key+" already defined");if(!Po(s,Function))throw new Error("@thenable "+u+" only supports functions");if(s.length>0)throw new Error("@thenable "+u+" methods cannot be called with arguments");let d=function(f){return console.trace("@thenable "+u+" took more than "+h+"ms - make sure method does not return self.",f)},a=function(f){let p=o.get(f);return p||o.set(f,p={}),p},b=function(f,p){let g=this,m=a(g);return(m.promise||(m.promise=new Promise(function(S,y){let $=r.timeout!==!1?setTimeout(d,r.timeout||2e4,g):null,E=function(T){return $&&clearTimeout($),m.met=!0,m.error=T,console.trace("@thenable "+u+" threw error",T),y(T)};return g[t]().then(function(){return $&&clearTimeout($),m.met=!0,S(g)},E)}))).then(f,p)};return Object.defineProperty(i,"then",{enumerable:!1,configurable:!0,get:function(){return a(this).met?null:b}}),e.value=function(f){var g;let p=a(this);return(g=p.wrapped)!=null||(p.wrapped=Promise.resolve(s.call(this,p))),p.wrapped},e.value.reset=function(f){let p=a(f);o.delete(f)},e.value.check=a,e}function Lp(){return console.warn("imba.serve is not available on the client")}var Uu=Symbol(),jt,Fp=new(jt=class{},c(jt,Uu,"Env",0),jt);var ri={};function Rp(i,t,e){if(t!=null){let r=ri[i]||(ri[i]=new WeakMap);return r.get(t)||r.set(t,(e.memoized=i)&&e).get(t)}return e}function Bu(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}var ae=Symbol.for("#idler"),ce=Symbol.for("#resolve"),Wu=Symbol(),ii=class ii extends Set{constructor(){super(),this[ae]=Promise.resolve(this)}emit(t,...e){return q(this,t,e)}on(t,...e){return j(this,t,...e)}once(t,...e){return M(this,t,...e)}un(t,...e){return Nt(this,t,...e)}add(t){var e=this;if(Bu(t,Function)&&(t=t()),!this.has(t)){let r=this.size==0;super.add(t),r&&(this[ae]=this[ce]=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[ce]&&(this[ce](!0),this[ce]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[ae]||(this[ae]=new Promise(function(e){return t.size==0?e(!0):t[ce]=e}))}get idleΦ(){return this.size==0}then(t,e){return this.idle.then(t,e)}};c(ii,Wu,"Queue",24);var qe=ii;function Gu(i,t){let e=[],r=[];for(let s=0,n=wo(i),o=n.length;s<o;s++){let l=n[s];if(s%2!=0)continue;let h=i[s+1];l==""?(r.push("%o"),e.push(h)):(r.push("%c%s%c %o"),e.push("background-color:#4c73e8;color:white",l,"background-color:none;color:initial"),e.push(h))}return[r.join(" "),...e]}var He=Symbol.for("#L");function jp(){return globalThis[He]||(globalThis[He]=globalThis[He]||Gu),!0}var ko=Symbol.for("#toStringDeopt"),fe=Symbol.for("#named"),Fo=Symbol.for("#symbols"),Mo=Symbol.for("#batches"),Ro=Symbol.for("#extras"),si=Symbol.for("#stacks"),Yu=Symbol(),ni=class ni{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)}set(t,e){this[fe]||(this[fe]={});let r=this[fe][t];return r!=e&&(r&&this.decr(r),e&&this.incr(e),this[fe][t]=e),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,r){let s=this[Fo],n=this[Mo],o=!0;if(!s)s=this[Fo]=[t],n=this[Mo]=[e||""],r&&(this.dom.className||"").indexOf(r)==-1&&(s.push(t),n.push(r)),this.toString=this.valueOf=this[ko];else{let l=s.indexOf(t),h=e||"";l==-1?(s.push(t),n.push(h),r&&(this.dom.className||"").indexOf(r)==-1&&(s.push(t),n.push(r))):n[l]!=h?n[l]=h:o=!1}o&&(this[Ro]=" "+n.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[ko](){return this.string+(this[Ro]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[si]||(this[si]={})}};c(ni,Yu,"Flags",16);var qt=ni;var Ao=Symbol.for("#__init__"),oi=Symbol.for("#getRenderContext"),Xu=Symbol.for("#getDynamicContext"),Qu=Symbol.for("#removeFromCache"),k={context:null,document:null,createTextNode:function(i){return globalThis.document.createTextNode(i)}},Ju=Symbol(),hi=class hi{constructor(t=null){this[Ao](t)}[Ao](t=null,e=!0,r=!0){var s;this.stack=t&&(s=t.stack)!==void 0?s:[],this.moving=t&&(s=t.moving)!==void 0?s:new Set}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}};c(hi,Ju,"Renderer",16);var li=hi,Y=new li,Zu=Symbol(),Ue=class Ue extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return k.context=null}[oi](t){let e=this.get(t);return e||this.set(t,e=new Ue(this._,t)),k.context=e}[Xu](t,e){return this[oi](t)[oi](e)}[Qu](t){let e=this[t];return e&&(this.delete(e),this[t]=null,this.value==e&&(this.value=null)),this}run(t,e=1){if(this.value=t,k.context==this&&(k.context=null),typeof t=="number"&&(t=String(t)),typeof t=="string"&&e==0){let r=this.text||(this.text=k.createTextNode(t));return t!=r.textContent&&(r.textContent=t),r}return this.get(t)}cache(t){return this.set(this.value,t),t}};c(Ue,Zu,"RenderContext",16);var ct=Ue;function Be(i,t=Symbol(),e=i){return k.context=i[t]||(i[t]=new ct(e,t))}function Wp(){let i=k.context,t=i||new ct(null);return globalThis.DEBUG_IMBA&&!i&&Y.stack.length>0&&console.trace("detected unmemoized nodes in",Y.stack.slice(0),"see https://imba.io",t),i&&(k.context=null),t}function pi(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}function ta(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var ge=Symbol.for("#parent"),Do=Symbol.for("#closestNode"),ea=Symbol.for("#parentNode"),ra=Symbol.for("#context"),il=Symbol.for("##inited"),ui=Symbol.for("#getRenderContext"),ia=Symbol.for("#getDynamicContext"),Vo=Symbol.for("#insertChild"),ye=Symbol.for("#appendChild"),ai=Symbol.for("#replaceChild"),zo=Symbol.for("#removeChild"),ht=Symbol.for("#insertInto"),Ko=Symbol.for("#insertIntoDeopt"),de=Symbol.for("#removeFrom"),jo=Symbol.for("#removeFromDeopt"),Ht=Symbol.for("#replaceWith"),qo=Symbol.for("#replaceWithDeopt"),ci=Symbol.for("#placeholderNode"),sa=Symbol.for("#attachToParent"),na=Symbol.for("#detachFromParent"),Ho=Symbol.for("#placeChild"),oa=Symbol.for("#beforeReconcile"),la=Symbol.for("#afterReconcile"),ha=Symbol.for("#afterVisit"),ua=Symbol.for("#visitContext"),sl=Symbol.for("#__init__"),nl=Symbol.for("##parent"),We=Symbol.for("##up"),fi=Symbol.for("##context"),Ct=Symbol.for("#domNode"),pe=Symbol.for("##placeholderNode"),Uo=Symbol.for("#forNode"),Bo=Symbol.for("#domDeopt"),me=Symbol.for("##visitContext"),ol=Symbol.for("#isRichElement"),Wo=Symbol.for("#src"),Ut=Symbol.for("#htmlNodeName"),aa=Symbol.for("#getSlot"),Go=Symbol.for("#ImbaElement"),Yo=Symbol.for("#cssns"),ca=Symbol.for("#cssid"),Xe=window.Event,em=window.UIEvent,rm=window.FocusEvent,ll=window.MouseEvent,hl=window.PointerEvent,ul=window.KeyboardEvent,R=window.CustomEvent,bi=window.Node,vi=window.Comment,al=window.Text,N=window.Element,im=window.HTMLElement,sm=window.HTMLHtmlElement,cl=window.HTMLSelectElement,fl=window.HTMLInputElement,dl=window.HTMLTextAreaElement,pl=window.HTMLButtonElement,ml=window.HTMLOptionElement,nm=window.HTMLScriptElement,om=window.SVGElement,lm=window.DocumentFragment,hm=window.ShadowRoot,gl=window.Document,um=window.Window,am=window.customElements;var di={};function yl(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==SVGElement?e[t]=r||null:yl(Reflect.getPrototypeOf(i),t,e)}var mi={},gi={},yi={},fa={};function Qe(){return globalThis.document}function cm(){return globalThis.imba.uses_window=!0,!0}var da={get(i,t){let e=i,r;for(;e&&r==null;)(e=e[ge])&&(r=e[t]);return r},set(i,t,e){let r=i,s;for(;r&&s==null;){if(ze(r,t,Element))return r[t]=e,!0;r=r[ge]}return!0}},pa=Symbol(),xi=class xi{get flags(){return this.documentElement.flags}emit(...t){return this.documentElement.emit(...t)}};c(xi,pa,"Document",1,Document);var Xo=xi;Node.prototype[sl]=function(){return this};var ma=Symbol(),wi=class wi{get[ge](){return this[nl]||this.parentNode||this[We]}get[Do](){return this}get[ea](){var t;return(t=this[ge])==null?void 0:t[Do]}get[ra](){return this[fi]||(this[fi]=new Proxy(this,da))}[il](){return this}[ui](t){return Be(this,t)}[ia](t,e){return this[ui](t)[ui](e)}[Vo](t,e){return t[ht](this,e)}[ye](t){return t[ht](this,null)}[ai](t,e){let r=this[Vo](t,e);return this[zo](e),r}[zo](t){return t[de](this)}[ht](t,e=null){return e?t.insertBefore(this,e):t.appendChild(this),this}[Ko](t,e){return e?t.insertBefore(this[Ct]||this,e):t.appendChild(this[Ct]||this),this}[de](t){return t.removeChild(this)}[jo](t){return t.removeChild(this[Ct]||this)}[Ht](t,e){return e[ai](t,this)}[qo](t,e){return e[ai](t,this[Ct]||this)}get[ci](){let t;return this[pe]||(this[pe]=(t=globalThis.document.createComment("placeholder"),t[Uo]=this,t))}set[ci](t){let e=this[pe];this[pe]=t,t[Uo]=this,e&&e!=t&&e.parentNode&&e[Ht](t)}[sa](){let t=this[Ct],e=t&&t.parentNode;return t&&e&&t!=this&&(this[Ct]=null,this[ht](e,t),t[de](e)),this}[na](){this[Bo]!=!0&&(this[Bo]=!0,!0)&&(this[Ht]=this[qo],this[de]=this[jo],this[ht]=this[Ko],this[We]||(this[We]=this[ge]));let t=this[ci];return this.parentNode&&t!=this&&(t[ht](this.parentNode,this),this[de](this.parentNode)),this[Ct]=t,this}[Ho](t,e,r){let s=typeof t;if(s==="undefined"||t===null){if(r&&pi(r,Comment))return r;let n=globalThis.document.createComment("");return r?r[Ht](n,this):n[ht](this,null)}if(t===r)return t;if(s!=="object"){let n,o=t;return r?pi(r,Text)?(r.textContent=o,r):(n=globalThis.document.createTextNode(o),r[Ht](n,this),n):(this.appendChild(n=globalThis.document.createTextNode(o)),n)}else return t[ht]?r?r[Ht](t,this):t[ht](this,null):this[Ho](String(t),e,r)}};c(wi,ma,"Node",1,Node);var Qo=wi,ga=Symbol(),_i=class _i{log(...t){return console.log(...t)}get hiddenΦ(){var e,r;let t=globalThis.getComputedStyle(this);return t.display=="none"||t.visibility=="hidden"?!0:this.offsetParent||this===globalThis.document.body?!1:(r=(e=this.parentElement)==null?void 0:e.hiddenΦ)!=null?r:!0}get detachedΦ(){return!globalThis.document.documentElement.contains(this)}get unobstructedΦ(){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Φ(){return globalThis.document.activeElement==this}get focinΦ(){return this.contains(globalThis.document.activeElement)}emit(t,e,r={}){var o,l,h;e!=null&&((o=r.detail)!=null||(r.detail=e)),(l=r.bubbles)!=null||(r.bubbles=!0),(h=r.cancelable)!=null||(r.cancelable=!0);let s=new CustomEvent(t,r);r.original&&(s.originalEvent=r.original);let n=this.dispatchEvent(s);return s}text$(t){return this.textContent=t,this}[oa](){return this}[la](){return this}[ha](){this[me]&&(this[me]=null)}get[ua](){return this[me]||(this[me]={})}get flags(){return this.$flags||(this.$flags=new qt(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=ze(this,t,Element);!r||!r.set?this.setAttribute(t,e):this[t]=e}get richValue(){return this.value}set richValue(t){this.value=t}};c(_i,ga,"Element",1,Element);var Jo=_i;Element.prototype.setns$=Element.prototype.setAttributeNS;Element.prototype[ol]=!0;function fm(i,t,e,r){let s=globalThis.document.createElement(i);return e&&(s.className=e),r!==null&&s.text$(r),t&&t[ye]&&t[ye](s),s}var ya=Symbol(),Ei=class Ei{set$(t,e){var n;let r=di[n=this.nodeName]||(di[n]={}),s=yl(this,t,r);!s||!s.set?this.setAttribute(t,e):this[t]=e}flag$(t){let e=this.flags$ns;this.setAttribute("class",e?e+(this.flags$ext=t):this.flags$ext=t)}flagSelf$(t){var e=this;return this.flag$=function(r){return e.flagSync$(e.flags$ext=r)},this.flagSelf$=function(r){return e.flagSync$(e.flags$own=r)},this.flagSelf$(t)}flagSync$(){return this.setAttribute("class",(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||""))}};c(Ei,ya,"SVGElement",1,SVGElement);var Zo=Ei,$a=Symbol(),Ti=class Ti{set src(t){if(this[Wo]!=t&&(this[Wo]=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}}}};c(Ti,$a,"SVGSVGElement",1,SVGSVGElement);var tl=Ti;function dm(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[ye]&&t[ye](n),r&&(n.textContent=r),n}function ft(i){return globalThis.document.createComment(i)}function Si(i){return globalThis.document.createTextNode(i)}function pm(){return globalThis.document.createDocumentFragment()}var Ge=globalThis.navigator,ba=Ge&&Ge.vendor||"",el=Ge&&Ge.userAgent||"",va=ba.indexOf("Apple")>-1||el.indexOf("CriOS")>=0||el.indexOf("FxiOS")>=0,Ye=!va,rl=new Map,Sa=Symbol(),Ni=class Ni extends HTMLElement{connectedCallback(){return Ye?this.parentNode.removeChild(this):this.parentNode.connectedCallback()}disconnectedCallback(){if(!Ye)return this.parentNode.disconnectedCallback()}};c(Ni,Sa,"CustomHook",0);var $i=Ni;window.customElements.define("i-hook",$i);function xa(i,t){let e=rl.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=ta(s),l=o.length;n<l;n++){let h=o[n],u=Object.getOwnPropertyDescriptors(h);Object.assign(e,u)}rl.set(t,e)}return e}function wa(i,t,e,r,s){let n;typeof i!="string"&&i&&i.nodeName&&(i=i.nodeName);let o=gi[i]||i;if(mi[i]){let l=mi[i],h=l.prototype[Ut];if(h&&Ye)n=globalThis.document.createElement(h,{is:o});else if(l.create$&&h){n=globalThis.document.createElement(h),n.setAttribute("is",o);let u=xa(n,l);Object.defineProperties(n,u),n.__slots={},n.appendChild(globalThis.document.createElement("i-hook"))}else l.create$?(n=l.create$(n),n.__slots={}):console.warn("could not create tag "+i)}else n=globalThis.document.createElement(gi[i]||i);return n[nl]=t,n[sl](),n[il](),r!==null&&n[aa]("__").text$(r),(e||n.flags$ns)&&n.flag$(e||""),n}function mm(i,t,e,r){return i==null||i==null?ft(""):pi(i,Node)||i[ol]?i:wa(i,t,e,r)}function _a(i,t){if(yi[i])return yi[i];if(window[t])return window[t];if(window[i])return window[i]}function gm(i,t,e){var n;let r=_a(i,t);if(r||console.warn("could not inherit from undefined tag type "+i),!(r==e||r.prototype instanceof e||r.prototype[Ut])){let o=r.prototype[Go];if(!o){let l=Symbol();o=(n=class extends r{constructor(){super(...arguments),this.__slots={},this.__F=0}},c(n,l,"CustomBuiltInElement",16),n),r.prototype[Go]=o;let h=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(o.prototype,h),o.prototype[Ut]=i}return o}return r}function ym(i,t,e={}){yi[i]=fa[i]=t,t.nodeName=i;let r=i,s=t.prototype;if(i.indexOf("-")==-1&&(r=""+i+"-tag",gi[i]=r),e.cssns){let n=(s._ns_||s[Yo]||"")+" "+(e.cssns||"");s._ns_=n.trim()+" ",s[Yo]=e.cssns}if(e.cssid){let n=(s.flags$ns||"")+" "+e.cssid;s[ca]=e.cssid,s.flags$ns=n.trim()+" "}return s[Ut]&&!e.extends&&(e.extends=s[Ut]),e.extends?(s[Ut]=e.extends,mi[i]=t,Ye&&window.customElements.define(r,t,{extends:e.extends})):window.customElements.define(r,t),t}var Ea=globalThis.imba||(globalThis.imba={});Ea.document=globalThis.document;function $e(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}function Ci(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var rr=Symbol.for("#parent"),$l=Symbol.for("#closestNode"),Ta=Symbol.for("#isRichElement"),Na=Symbol.for("#afterVisit"),Ca=Symbol.for("#getRenderContext"),bl=Symbol.for("#appendChild"),vl=Symbol.for("#removeChild"),Sl=Symbol.for("#replaceChild"),ut=Symbol.for("#insertInto"),Je=Symbol.for("#replaceWith"),xl=Symbol.for("#insertChild"),Ze=Symbol.for("#removeFrom"),wl=Symbol.for("#placeChild"),Ia=Symbol.for("#registerFunctionalSlot"),Oa=Symbol.for("#getFunctionalSlot"),_l=Symbol.for("#getSlot"),Oi=Symbol.for("##parent"),dt=Symbol.for("##up"),Ii=Symbol.for("##flags"),La=Symbol.for("#domFlags"),U=Symbol.for("#end"),El=Symbol.for("#textContent"),tr=Symbol.for("#textNode"),er=Symbol.for("#functionalSlots");function _m(){return!0}var Pa=Symbol(),Li=class Li{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[rr](t){this[Oi]=t}get[rr](){return this[Oi]||this[dt]}get[$l](){return this[rr][$l]}get[Ta](){return!0}get flags(){return this[Ii]||(this[Ii]=new qt(this))}flagSync$(){return this}[Na](){return this}[Ca](t){return Be(this,t)}};c(Li,Pa,"Fragment",16);var pt=Li,ka=0,Fa=Symbol(),Pi=class Pi extends pt{constructor(t,e){super(...arguments),this[dt]=e,this.parentNode=null,this[La]=t,this.childNodes=[],this[U]=ft("slot"+ka++),e&&e[bl](this)}get[rr](){return this[Oi]||this.parentNode||this[dt]}set textContent(t){this[El]=t}get textContent(){return this[El]}hasChildNodes(){for(let t=0,e=Ci(this.childNodes),r=e.length;t<r;t++){let s=e[t];if($e(s,pt)&&s.hasChildNodes())return!0;if(!$e(s,vi)){if($e(s,bi))return!0}}return!1}text$(t){return this[tr]?this[tr].textContent=t:this[tr]=this[wl](t),this[tr]}appendChild(t){return this.parentNode&&t[ut](this.parentNode,this[U]),this.childNodes.push(t)}[bl](t){var e;return this.parentNode?t[ut](this.parentNode,this[U]):(e=t[dt])!=null||(t[dt]=this[dt]||this),this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[xl](t,e);let r=this.childNodes.indexOf(e);return r>=0&&this.childNodes.splice(r,0,t),t}[vl](t){this.parentNode&&this.parentNode[vl](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[Sl](t,e){this.parentNode&&this.parentNode[Sl](t,e);let r=this.childNodes.indexOf(e);return this.childNodes[r]=t,t}[ut](t,e){let r=this.parentNode;if(this.parentNode!=t&&(this.parentNode=t,!0)){this[U]&&(e=this[U][ut](t,e));for(let s=0,n=Ci(this.childNodes),o=n.length;s<o;s++)n[s][ut](t,e)}return this}[Je](t,e){let r=t[ut](e,this[U]);return this[Ze](e),r}[xl](t,e){if(this.parentNode&&this.insertBefore(t,e||this[U]),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=Ci(this.childNodes),s=r.length;e<s;e++)r[e][Ze](t);return this[U]&&this[U][Ze](t),this.parentNode=null,this}[wl](t,e,r){let s=this.parentNode,n=typeof t;if(n==="undefined"||t===null){if(r&&$e(r,vi))return r;let o=ft("");if(r){let l=this.childNodes.indexOf(r);return this.childNodes.splice(l,1,o),s&&r[Je](o,s),o}return this.childNodes.push(o),s&&o[ut](s,this[U]),o}if(t===r)return t;if(n!=="object"){let o,l=t;if(r){if($e(r,al))return r.textContent=l,r;{o=Si(l);let h=this.childNodes.indexOf(r);return this.childNodes.splice(h,1,o),s&&r[Je](o,s),o}}else return this.childNodes.push(o=Si(l)),s&&o[ut](s,this[U]),o}else if(r){let o=this.childNodes.indexOf(r);return this.childNodes.splice(o,1,t),s&&r[Je](t,s),t}else return this.childNodes.push(t),s&&t[ut](s,this[U]),t}};c(Pi,Fa,"VirtualFragment",16);var ir=Pi;function Em(i,t){return new ir(i,t)}function sr(i,t){let e=new ir(i,null);return e[dt]=t,e}var Ma=Symbol(),ki=class ki{[Ia](t){let e=this[er]||(this[er]={});return e[t]||(e[t]=sr(0,this))}[Oa](t,e){let r=this[er];return r&&r[t]||this[_l](t,e)}[_l](t,e){var r;return t=="__"&&!this.render||!this.__slots?this:(r=this.__slots)[t]||(r[t]=sr(0,this))}};c(ki,Ma,"Node",1,bi);var Tl=ki;function Ra(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Aa=Symbol.for("#afterVisit"),nr=Symbol.for("#insertInto"),Nl=Symbol.for("#appendChild"),Da=Symbol.for("#replaceWith"),Fi=Symbol.for("#removeFrom"),Va=Symbol.for("#domFlags"),za=Symbol.for("##parent"),mt=Symbol.for("#end"),Ka=Symbol.for("#removeChild"),ja=Symbol.for("#insertChild"),qa=Symbol(),Ri=class Ri extends pt{constructor(t,e){super(...arguments),this[Va]=t,this[za]=e,t&256||(this[mt]=ft("list")),this.$=this.childNodes,this.length=0,e&&e[Nl](this)}hasChildNodes(){return this.length!=0}[Aa](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[mt];if(e>t)for(;e>t;)r[Ka](s[--e]);else if(t>e)for(;t>e;)r[ja](s[e++],n);this.length=t}[nr](t,e){this.parentNode=t,this[mt]&&this[mt][nr](t,e),e=this[mt];for(let r=0,s=Ra(this.childNodes),n=s.length;r<n;r++){let o=s[r];if(r==this.length)break;o[nr](t,e)}return this}[Nl](t){}[Da](t,e){let r=t[nr](e,this[mt]);return this[Fi](e),r}[Fi](t){let e=this.length;for(;e>0;)this.childNodes[--e][Fi](t);this[mt]&&t.removeChild(this[mt]),this.parentNode=null}};c(Ri,qa,"IndexedTagFragment",16);var Mi=Ri;function Om(i,t){return new Mi(i,t)}function Cl(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Ai=Symbol.for("#appendChild"),or=Symbol.for("#insertChild"),Ha=Symbol.for("#replaceWith"),lr=Symbol.for("#insertInto"),Di=Symbol.for("#removeFrom"),Ua=Symbol.for("#afterVisit"),hr=Symbol.for("#domFlags"),Il=Symbol.for("##parent"),gt=Symbol.for("#end"),Ol=Symbol.for("#removeChild"),Ba=Symbol(),zi=class zi extends pt{constructor(t,e){super(...arguments),this[hr]=t,this[Il]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new ct(this,Symbol()),t&256||(this[gt]=ft("map")),e&&e[Ai](this)}[Ai](t){if(this.parentNode)return this.parentNode[or](t,this[gt])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[hr]&1)){this.array.push(t),this[Ai](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[or](t,n.nextSibling)}else s[or](t,this.childNodes[e+1]||this[gt])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[Di](t.parentNode)}[or](t,e){}[Ha](t,e){let r=t[lr](e,this[gt]);return this[Di](e),r}[lr](t,e){this[Il]=t;let r=this.parentNode;if(t!=r){this.parentNode=t;for(let s=0,n=Cl(this.array),o=n.length;s<o;s++)n[s][lr](t,e);this[gt]&&this[gt][lr](t,e)}return this}[Di](t){for(let e=0,r=Cl(this.array),s=r.length;e<s;e++){let n=r[e];t[Ol](n)}return this[gt]&&t[Ol](this[gt]),this.parentNode=null}[Ua](t){var e=this;if(!(this[hr]&1)){this[hr]|=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)}}};c(zi,Ba,"KeyedTagFragment",16);var Vi=zi;function Rm(i,t){return new Vi(i,t)}function Ll(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}function Wa(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var ar=Symbol.for("#__init__"),Ga=Symbol.for("##inited"),Ya=Symbol.for("#afterVisit"),Xa=Symbol.for("#insertInto"),Qa=Symbol.for("#insertIntoDeopt"),Ja=Symbol.for("#beforeReconcile"),Za=Symbol.for("#afterReconcile"),Pl=Symbol.for("#__hooks__"),It=Symbol.for("#autorender"),ur=Symbol.for("##visitContext"),kl=Symbol.for("#domNode"),tc=Symbol(),Bt,Fl=new(Bt=class{constructor(t=null){this[ar](t)}[ar](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Φ)continue;let e=this.current;this.current=t,t.__F|=1024;try{t.connectedCallback()}catch(r){console.error(r)}this.current=e}}queue(t){var e=this;let r=this.items.length,s=0,n=this.lastQueued;this.lastQueued=t;let o=Node.DOCUMENT_POSITION_PRECEDING,l=Node.DOCUMENT_POSITION_FOLLOWING;if(r){let h=this.items.indexOf(n),u=h,d=function(b,x){return e.tests++,b.compareDocumentPosition(x)};(h==-1||n.nodeName!=t.nodeName)&&(u=h=0);let a=this.items[u];for(;a&&d(a,t)&l;)a=this.items[++u];if(u!=h)a?this.items.splice(u,0,t):this.items.push(t);else{for(;a&&d(a,t)&o;)a=this.items[--u];u!=h&&(a?this.items.splice(u+1,0,t):this.items.unshift(t))}}else this.items.push(t),this.current||globalThis.queueMicrotask(this.flush.bind(this))}},c(Bt,tc,null,16),Bt);function jm(){return Fl.flush()}var ec=Symbol(),Ki=class Ki extends HTMLElement{constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build()}setup$(){return this.__slots={},this.__F=0}[ar](){return this.__F|=3,this}[Ga](){if(this[Pl])return this[Pl].inited(this)}flag$(t){this.className=this.flags$ext=t}build(){return this}awaken(){return this}mount(){return this}remount(){return this.mount(),this}unmount(){return this}rendered(){return this}dehydrate(){return this}hydrate(){return this.autoschedule=!0,this}tick(t,e){return this.commit()}visit(){return this.commit()}commit(){return this.renderΦ?(this.__F|=256,this.render&&this.render(),this.rendered(),this.__F=(this.__F|512)&-257&-8193):(this.__F|=8192,this)}get autoschedule(){return(this.__F&64)!=0}set autoschedule(t){t?this.__F|=64:this.__F&=-65}set autorender(t){let e=this[It]||(this[It]={});e.value=t,this.mountedΦ&&L.schedule(this,e)}get renderΦ(){return!this.suspendedΦ}get mountingΦ(){return(this.__F&16)!=0}get mountedΦ(){return(this.__F&32)!=0}get awakenedΦ(){return(this.__F&8)!=0}get renderedΦ(){return(this.__F&512)!=0}get suspendedΦ(){return(this.__F&4096)!=0}get renderingΦ(){return(this.__F&256)!=0}get scheduledΦ(){return(this.__F&128)!=0}get hydratedΦ(){return(this.__F&2)!=0}get ssrΦ(){return(this.__F&1024)!=0}get scheduler(){return L}schedule(){return L.on("commit",this),this.__F|=128,this}unschedule(){return L.un("commit",this),this.__F&=-129,this}async suspend(t=null){let e=this.flags.incr("@suspended");return this.__F|=4096,Ll(t,Function)&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("@suspended")==0&&(this.__F&=-4097,this.commit()),this}[Ya](){if(this.visit(),this[ur])return this[ur]=null}[Xa](t,e=null){if(this.mountedΦ&&t.moveBefore)t.moveBefore(this,e);else{let r=(this.__F&32)!=0&&t==this.parentNode;r&&Y.moving.add(this),e?t.insertBefore(this,e):t.appendChild(this),r&&Y.moving.delete(this)}return this}[Qa](t,e){if(this.mountedΦ&&t.moveBefore)t.moveBefore(this[kl]||this,e);else{let r=this[kl]||this,s=(this.__F&32)!=0&&t==this.parentNode;s&&Y.moving.add(this),e?t.insertBefore(r,e):t.appendChild(r),s&&Y.moving.delete(this)}return this}[Ja](){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&&Y.push(this),this[ur]&&(this[ur]=null),this}[Za](){return globalThis.DEBUG_IMBA&&Y.pop(this),this}connectedMoveCallback(){this.remount()}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(t&ENV_EL_MOVING){this.__F=t&~ENV_EL_MOVING,this.remount();return}if(!e&&!(t&1024)){Fl.queue(this);return}if(t&48)return;this.__F|=16,e||this[ar](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),r||(this.awaken(),this.__F|=8),q(this,"mount",[this]);let s=this.mount();return s&&Ll(s.then,Function)&&s.then(L.commit),t=this.__F=(this.__F|32)&-17,t&64&&this.schedule(),this[It]&&L.schedule(this,this[It]),this}disconnectedCallback(){var t;if(!(this.__F&ENV_EL_MOVING)){if(Y.moving.size){for(let e of Wa(Y.moving))if((t=e==null?void 0:e.contains)!=null&&t.call(e,this)){this.__F|=ENV_EL_MOVING;return}}if(this.__F=this.__F&-49,this.__F&128&&this.unschedule(),q(this,"unmount",[this]),this.unmount(),this[It])return L.unschedule(this,this[It])}}dataForTagName(t){}};c(Ki,ec,"Component",16);var Ot=Ki,qm=Ot;function rc(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}var Ml=Symbol.for("#__init__"),ic={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 Rl={prefix:1,suffix:1,content:1},qi={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]]},sc=new RegExp("^("+Object.keys(qi).join("|")+")(\\d+(?:\\.\\d+)?)$"),nc=/^([xyz])$/,oc=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,lc=`*,::before,::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: currentColor; }`,hc=Symbol(),Hi=class Hi{constructor(t=null){this[Ml](t)}[Ml](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",lc),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;Rl[r]&&(t=String(t));let o=typeof t;if(o=="number"){if(e||(nc.test(r)?e="px":oc.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return ic[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(o=="string"){if(r&&Rl[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),n=t.match(sc)){let h=qi[n[1]][parseInt(n[2])],u="100%";if(typeof s=="number"?u=s+"%":typeof s=="string"&&(u=s),h)return"hsla("+h[0]+","+h[1]+"%,"+h[2]+"%,"+u+")"}}else if(t&&rc(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]}};c(Hi,hc,"Styles",16);var ji=Hi,uc=new ji,Wm=Object.keys(qi);function Gm(){return globalThis.imba.uses_styles=!0,!0}var ac=Symbol(),Ui=class Ui{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,s,n=null){let o=uc.toValue(e,r,s,n);this.style.setProperty(t,o)}};c(Ui,ac,"Element",1,N);var Al=Ui;function cc(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}var Dl=Symbol.for("#insertInto"),Vl=Symbol.for("#removeFrom");function rg(i,t={}){let e=k.context;k.context=t;let r=i(t);return k.context==t&&(k.context=e),r}function fc(i,t,e={}){let r=t||globalThis.document.body,s=i;if(cc(i,Function)){let n=i,o=e.tick||(e.tick=function(){let l=e.context||(e.context=new ct(r,null)),h=k.context;k.context=l;let u=i(l,e);return k.context==l&&(k.context=h),e.node!=u&&(e.node&&globalThis.imba.unmount(e.node),u?((e.node=u)[Dl](r),u.tick==Ot.prototype.tick&&(u.tick=e.tick,u.scheduledΦ),M(u,"unmount",function(){if(e.node==u)return e.node=null,L.unlisten("commit",e.tick)})):(e.node=u,L.unlisten("commit",e.tick))),u});return L.listen("commit",o),o()}else s.__F|=64;return s[Dl](r),s}function dc(i){return i&&i[Vl]&&i.parentNode&&i[Vl](i.parentNode),i}var zl=globalThis.imba||(globalThis.imba={});zl.mount=fc;zl.unmount=dc;function Z(i,t){var e;return typeof t=="string"?typeof i===t:(e=t[Symbol.hasInstance])==null?void 0:e.call(t,i)}function be(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var ve=Symbol.for("##onchange"),xe=Symbol.for("#afterVisit"),Se=Symbol.for("##oninput"),cr=Symbol.for("##onclick"),we=Symbol.for("##bound"),yt=Symbol.for("##visitContext");function lg(){return globalThis.imba.uses_dom_bind=!0,!0}var pc={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},Bi=function(i){return Z(i,Array)||i&&Z(i.has,Function)},Wi=function(i,t){return i==t?!0:Z(i,Array)?i.indexOf(t)>=0:i&&Z(i.has,Function)?i.has(t):i&&Z(i.contains,Function)?i.contains(t):!1},Gi=function(i,t){if(Z(i,Array))return i.push(t);if(i&&Z(i.add,Function))return i.add(t)},Yi=function(i,t){if(Z(i,Array)){let e=i.indexOf(t);if(e>=0)return i.splice(e,1)}else if(i&&Z(i.delete,Function))return i.delete(t)};function mc(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 gc=Symbol(),Xi=class Xi{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this[we]&&pc[this.nodeName]&&(this[we]=!0,this[ve]&&this.addEventListener("change",this[ve]=this[ve].bind(this)),this[Se]&&this.addEventListener("input",this[Se]=this[Se].bind(this),{capture:!0}),this[cr]&&this.addEventListener("click",this[cr]=this[cr].bind(this),{capture:!0})),Object.defineProperty(this,t,Z(r,Array)?mc(r):r),r}};c(Xi,gc,"Element",1,N);var Kl=Xi;Object.defineProperty(N.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(i){return this.setRichValue(i)}});var yc=Symbol(),Qi=class Qi{[ve](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=be(r),l=o.length;n<l;n++){let h=o[n];s.indexOf(h)==-1&&Yi(e,h)}for(let n=0,o=be(s),l=o.length;n<l;n++){let h=o[n];(!r||r.indexOf(h)==-1)&&Gi(e,h)}}else this.data=s[0];return P(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=be(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=be(this.options||[]),n=s.length;r<n;r++){let o=s[r],l=o.richValue,h=Wi(t,l);o.selected=h,h&&e.push(l)}this.$$value=e}else for(let e=0,r=be(this.options||[]),s=r.length;e<s;e++){let o=r[e].richValue;if(o==t){this.$$value=[o],this.selectedIndex=e;break}}}[xe](){if(this.syncValue(),this[yt])return this[yt]=null}};c(Qi,yc,"HTMLSelectElement",1,cl);var jl=Qi,$c=Symbol(),Ji=class Ji{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};c(Ji,$c,"HTMLOptionElement",1,ml);var ql=Ji,bc=Symbol(),Zi=class Zi{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[Se](t){return this.data=this.value,P()}[xe](){let t=this.data;if(t==null&&(t=""),this[we]&&this.value!=t&&(this.value=t),this[yt])return this[yt]=null}};c(Zi,bc,"HTMLTextAreaElement",1,dl);var Hl=Zi,vc=Symbol(),ts=class ts{[Se](t){let e=this.type;if(!(e=="checkbox"||e=="radio")&&!(e=="number"&&Number.isNaN(this.valueAsNumber)))return this.$$value=void 0,this.data=this.richValue,P()}[ve](t){let e=this.data,r=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let s=this.checked;Bi(e)?s?Gi(e,r):Yi(e,r):this.data=s?r:!1}return P()}setRichValue(t){this.$$value!==t&&(this.$$value=t,this.value!==t&&(this.value=t))}getRichValue(){if(this.$$value!==void 0)return this.$$value;let t=this.value,e=this.type;if(e=="range"||e=="number"){let r=this.valueAsNumber;Number.isNaN(r)&&(r=Number(t.replace(/\,/,".")+0)),Number.isNaN(r)&&(r=null),t=r}else e=="checkbox"&&(t==null||t==="on")&&(t=!0);return t}[xe](){if(this[we]){let t=this.type;if(t=="checkbox"||t=="radio"){let e=this.data;e===!0||e===!1||e==null?this.checked=!!e:this.checked=Wi(e,this.richValue)}else this.richValue=this.data}this[yt]&&(this[yt]=null)}};c(ts,vc,"HTMLInputElement",1,fl);var Ul=ts,Sc=Symbol(),es=class es{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}[cr]