regor 1.4.8 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- var Ue=Symbol(":regor");var ye=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];or(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},or=t=>{let e=t[Ue];if(!e)return;let n=e.unbinders;for(let o=0;o<n.length;++o)n[o]();n.length=0,t[Ue]=void 0};var He=[],lt=!1,pt,Un=()=>{if(lt=!1,pt=void 0,He.length!==0){for(let t=0;t<He.length;++t)ye(He[t]);He.length=0}},z=t=>{t.remove(),He.push(t),lt||(lt=!0,pt=setTimeout(Un,1))},rr=async()=>{He.length===0&&!lt||(pt&&clearTimeout(pt),Un())};var $=t=>typeof t=="function",F=t=>typeof t=="string",Hn=t=>typeof t>"u",ue=t=>t==null||typeof t>"u",B=t=>typeof t!="string"||!t?.trim(),sr=Object.prototype.toString,Xt=t=>sr.call(t),we=t=>Xt(t)==="[object Map]",ae=t=>Xt(t)==="[object Set]",Yt=t=>Xt(t)==="[object Date]",Ye=t=>typeof t=="symbol",E=Array.isArray,M=t=>t!==null&&typeof t=="object";var Bn={0:"createApp can't find root element. You must define either a valid `selector` or an `element`. Example: createApp({}, {selector: '#app', html: '...'})",1:t=>`Component template cannot be found. selector: ${t} .`,2:"Use composables in scope. usage: useScope(() => new MyApp()).",3:t=>`${t} requires ref source argument`,4:"computed is readonly.",5:"persist requires a string key."},P=(t,...e)=>{let n=Bn[t];return new Error($(n)?n.call(Bn,...e):n)};var ft=[],jn=()=>{let t={onMounted:[],onUnmounted:[]};return ft.push(t),t},Me=t=>{let e=ft[ft.length-1];if(!e&&!t)throw P(2);return e},_n=t=>{let e=Me();return t&&en(t),ft.pop(),e},Zt=Symbol("csp"),en=t=>{let e=t,n=e[Zt];if(n){let o=Me();if(n===o)return;o.onMounted.length>0&&n.onMounted.push(...o.onMounted),o.onUnmounted.length>0&&n.onUnmounted.push(...o.onUnmounted);return}e[Zt]=Me()},mt=t=>t[Zt];var Se=t=>{mt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var $n={8:t=>`Model binding requires a ref at ${t.outerHTML}`,7:t=>`Model binding is not supported on ${t.tagName} element at ${t.outerHTML}`,0:(t,e)=>`${t} binding expression is missing at ${e.outerHTML}`,1:(t,e,n)=>`invalid ${t} expression: ${e} at ${n.outerHTML}`,2:(t,e)=>`${t} requires object expression at ${e.outerHTML}`,3:(t,e)=>`${t} binder: key is empty on ${e.outerHTML}.`,4:(t,e,n,o)=>({msg:`Failed setting prop "${t}" on <${e.toLowerCase()}>: value ${n} is invalid.`,args:[o]}),5:(t,e)=>`${t} binding missing event type at ${e.outerHTML}`,6:(t,e)=>({msg:t,args:[e]})},D=(t,...e)=>{let n=$n[t],o=$(n)?n.call($n,...e):n,r=Be.warning;r&&(F(o)?r(o):r(o,...o.args))},Be={warning:console.warn};var dt=Symbol("ref"),J=Symbol("sref"),ht=Symbol("raw");var T=t=>t!=null&&t[J]===1;var je=class extends Error{propPath;detail;constructor(e,n){super(n),this.name="PropValidationError",this.propPath=e,this.detail=n}},ge=(t,e)=>{throw new je(t,`${e}.`)},ir=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return"string";if(typeof t=="number")return"number";if(typeof t=="boolean")return"boolean";if(typeof t=="bigint")return"bigint";if(typeof t=="symbol")return"symbol";if(typeof t=="function")return"function";if(E(t))return"array";if(t instanceof Date)return"Date";if(t instanceof RegExp)return"RegExp";if(t instanceof Map)return"Map";if(t instanceof Set)return"Set";let e=t?.constructor?.name;return e&&e!=="Object"?e:"object"},ar=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":ir(t),cr=(t,e)=>{typeof t!="string"&&ge(e,"expected string")},ur=(t,e)=>{typeof t!="number"&&ge(e,"expected number")},lr=(t,e)=>{typeof t!="boolean"&&ge(e,"expected boolean")},pr=t=>(e,n)=>{e instanceof t||ge(n,`expected instance of ${t.name||"provided class"}`)},fr=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},mr=t=>(e,n,o)=>{e!==null&&t(e,n,o)},dr=t=>(e,n)=>{t.includes(e)||ge(n,`expected one of ${t.map(o=>ar(o)).join(", ")}`)},hr=t=>(e,n,o)=>{E(e)||ge(n,"expected array");let r=e;for(let s=0;s<r.length;++s)t(r[s],`${n}[${s}]`,o)},yr=t=>(e,n,o)=>{M(e)||ge(n,"expected object");let r=e;for(let s in t){let a=t[s];a(r[s],`${n}.${s}`,o)}},gr=t=>(e,n,o)=>{T(e)||ge(n,"expected ref"),t(e(),`${n}.value`,o)},br={fail:ge,isString:cr,isNumber:ur,isBoolean:lr,isClass:pr,optional:fr,nullable:mr,oneOf:dr,arrayOf:hr,shape:yr,refOf:gr};var xr=(t,e,n)=>{let o=t.tagName?.toLowerCase?.()||"unknown",r=n instanceof je?n.propPath:e,s=n instanceof je?n.detail:n instanceof Error?n.message:String(n);return n instanceof Error?new Error(`Invalid prop "${r}" on <${o}>: ${s}`,{cause:n}):new Error(`Invalid prop "${r}" on <${o}>: ${s}`,{cause:n})},Ze=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;G;J;constructor(e,n,o,r,s,a){this.props=e,this.G=n,this.ctx=o,this.start=r,this.end=s,this.J=a}emit=(e,n)=>{this.G.dispatchEvent(new CustomEvent(e,{detail:n}))};findContext(e,n=0){if(n<0)return;let o=0;for(let r of this.ctx??[])if(r instanceof e){if(o===n)return r;++o}}requireContext(e,n=0){let o=this.findContext(e,n);if(o!==void 0)return o;throw new Error(`${e} was not found in the context stack at occurrence ${n}.`)}validateProps(e){if(this.J==="off")return;let n=this.props;for(let o in e){let r=e[o];if(!r)continue;let s=r;try{s(n[o],o,this)}catch(a){let i=xr(this.G,o,a);if(this.J==="warn"){Be.warning(i.message,i);continue}throw i}}}unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)z(e),e=e.nextSibling;for(let o of this.ctx)Se(o)}};var ke=t=>{let e=t,n=e[Ue];if(n)return n;let o={unbinders:[],data:{}};return e[Ue]=o,o};var q=(t,e)=>{ke(t).unbinders.push(e)};var gt={},yt={},Fn=1,qn=t=>{let e=(Fn++).toString();return gt[e]=t,yt[e]=0,e},tn=t=>{yt[t]+=1},nn=t=>{--yt[t]===0&&(delete gt[t],delete yt[t])},zn=t=>gt[t],on=()=>Fn!==1&&Object.keys(gt).length>0,et="r-switch",Tr=t=>{let e=t.filter(o=>be(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(et))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},_e=(t,e)=>{if(!on())return;let n=Tr(e);n.length!==0&&(n.forEach(tn),q(t,()=>{n.forEach(nn)}))};var bt=()=>{},rn=(t,e,n,o)=>{let r=[];for(let s of t){let a=s.cloneNode(!0);n.insertBefore(a,o),r.push(a)}Ae(e,r)},sn=Symbol("r-if"),Kn=Symbol("r-else"),Wn=t=>t[Kn]===1,xt=class{r;N;ge;Q;X;x;R;constructor(e){this.r=e,this.N=e.o.u.if,this.ge=Ct(e.o.u.if),this.Q=e.o.u.else,this.X=e.o.u.elseif,this.x=e.o.u.for,this.R=e.o.u.pre}ot(e,n){let o=e.parentElement;for(;o!==null&&o!==document.documentElement;){if(o.hasAttribute(n))return!0;o=o.parentElement}return!1}k(e){let n=e.hasAttribute(this.N);return n&&this.y(e),this.r.M.j(e,o=>{o.hasAttribute(this.N)&&this.y(o)}),n}Y(e){return e[sn]?!0:(e[sn]=!0,Tt(e,this.ge).forEach(n=>n[sn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.Y(e)||this.ot(e,this.x))return;let n=e.getAttribute(this.N);if(!n){D(0,this.N,e);return}e.removeAttribute(this.N),this.O(e,n)}U(e,n,o){let r=$e(e),s=e.parentNode,a=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(a,e),_e(a,r),r.forEach(c=>{z(c)}),e.remove(),n!=="if"&&(e[Kn]=1);let i=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(i,a.nextSibling),{nodes:r,parent:s,commentBegin:a,commentEnd:i}}be(e,n){if(!e)return[];let o=e.nextElementSibling;if(e.hasAttribute(this.Q)){e.removeAttribute(this.Q);let{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"else");return[{mount:()=>{rn(r,this.r,s,i)},unmount:()=>{xe(a,i)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.X);if(!r)return[];e.removeAttribute(this.X);let{nodes:s,parent:a,commentBegin:i,commentEnd:c}=this.U(e,"elseif",` => ${r} `),l=this.r.m.V(r),u=l.value,p=this.be(o,n),f=bt;return q(i,()=>{l.stop(),f(),f=bt}),f=l.subscribe(n),[{mount:()=>{rn(s,this.r,a,c)},unmount:()=>{xe(i,c)},isTrue:()=>!!u()[0],isMounted:!1},...p]}}O(e,n){let o=e.nextElementSibling,{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"if",` => ${n} `),c=this.r.m.V(n),l=c.value,u=!1,p=this.r.m,f=p.L(),h=()=>{p.C(f,()=>{if(l()[0])u||(rn(r,this.r,s,i),u=!0),m.forEach(C=>{C.unmount(),C.isMounted=!1});else{xe(a,i),u=!1;let C=!1;for(let R of m)!C&&R.isTrue()?(R.isMounted||(R.mount(),R.isMounted=!0),C=!0):(R.unmount(),R.isMounted=!1)}})},m=this.be(o,h),d=bt;q(a,()=>{c.stop(),d(),d=bt}),h(),d=c.subscribe(h)}};var $e=t=>{let e=le(t)?t.content.childNodes:[t],n=[];for(let o=0;o<e.length;++o){let r=e[o];if(r.nodeType===1){let s=r?.tagName;if(s==="SCRIPT"||s==="STYLE")continue}n.push(r)}return n},Ae=(t,e)=>{for(let n=0;n<e.length;++n){let o=e[n];o.nodeType===Node.ELEMENT_NODE&&(Wn(o)||t._(o))}},Tt=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},le=t=>t instanceof HTMLTemplateElement,be=t=>t.nodeType===Node.ELEMENT_NODE,tt=t=>t.nodeType===Node.ELEMENT_NODE,Gn=t=>t instanceof HTMLSlotElement,Te=t=>le(t)?t.content.childNodes:t.childNodes,xe=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let o=n.nextSibling;z(n),n=o}},Jn=function(){return this()},Cr=function(t){return this(t)},Er=()=>{throw new Error("value is readonly.")},vr={get:Jn,set:Cr,enumerable:!0,configurable:!1},Rr={get:Jn,set:Er,enumerable:!0,configurable:!1},Ne=(t,e)=>{Object.defineProperty(t,"value",e?Rr:vr)},Qn=(t,e)=>{if(!t)return!1;if(t.startsWith("["))return t.substring(1,t.length-1);let n=e.length;return t.startsWith(e)?t.substring(n,t.length-n):!1},Ct=t=>`[${CSS.escape(t)}]`,Et=(t,e)=>(t.startsWith("@")&&(t=e.u.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.u.dynamic)),t),an=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},wr=/-(\w)/g,U=an(t=>t&&t.replace(wr,(e,n)=>n?n.toUpperCase():"")),Sr=/\B([A-Z])/g,Fe=an(t=>t&&t.replace(Sr,"-$1").toLowerCase()),nt=an(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var vt={mount:()=>{}};var qe=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Rt=t=>{mt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var cn=Symbol("scope"),un=t=>{try{jn();let e=t();en(e);let n={context:e,unmount:()=>Se(e),[cn]:1};return n[cn]=1,n}finally{_n()}},Xn=t=>M(t)?cn in t:!1;var ln={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(M(o))for(let r of Object.entries(o)){let s=r[0],a=r[1],i=n[s];i!==a&&(T(i)?i(a):n[s]=a)}}})};var te=(t,e)=>{Me(e)?.onUnmounted.push(t)};var re=(t,e,n,o=!0)=>{if(!T(t))throw P(3,"observe");n&&e(t());let s=t(void 0,void 0,0,e);return o&&te(s,!0),s};var ot=(t,e)=>{if(t===e)return()=>{};let n=re(t,r=>e(r)),o=re(e,r=>t(r));return e(t()),()=>{n(),o()}};var rt=t=>!!t&&t[ht]===1;var ze=t=>t?.[dt]===1;var pe=[],Yn=t=>{pe.length!==0&&pe[pe.length-1]?.add(t)},Ke=t=>{if(!t)return()=>{};let e={stop:()=>{}};return Ar(t,e),te(()=>e.stop(),!0),e.stop},Ar=(t,e)=>{if(!t)return;let n=[],o=!1,r=()=>{for(let s of n)s();n=[],o=!0};e.stop=r;try{let s=new Set;if(pe.push(s),t(a=>n.push(a)),o)return;for(let a of[...s]){let i=re(a,()=>{r(),Ke(t)});n.push(i)}}finally{pe.pop()}},pn=t=>{let e=pe.length,n=e>0&&pe[e-1];try{return n&&pe.push(null),t()}finally{n&&pe.pop()}},fn=t=>{try{let e=new Set;return pe.push(e),{value:t(),refs:[...e]}}finally{pe.pop()}};var Q=(t,e,n)=>{if(!T(t))return;let o=t;if(o(void 0,e,1),!n)return;let r=o();if(r){if(E(r)||ae(r))for(let s of r)Q(s,e,!0);else if(we(r))for(let s of r)Q(s[0],e,!0),Q(s[1],e,!0);if(M(r))for(let s in r)Q(r[s],e,!0)}};function Nr(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var We=(t,e,n)=>{n.forEach(function(o){let r=t[o];Nr(e,o,function(...a){let i=r.apply(this,a),c=this[J];for(let l of c)Q(l);return i})})},wt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var Zn=Array.prototype,mn=Object.create(Zn),Or=["push","pop","shift","unshift","splice","sort","reverse"];We(Zn,mn,Or);var eo=Map.prototype,St=Object.create(eo),Mr=["set","clear","delete"];wt(St,"Map");We(eo,St,Mr);var to=Set.prototype,At=Object.create(to),kr=["add","clear","delete"];wt(At,"Set");We(to,At,kr);var de={},se=t=>{if(T(t)||rt(t))return t;let e={auto:!0,_value:t},n=c=>M(c)?J in c?!0:E(c)?(Object.setPrototypeOf(c,mn),!0):ae(c)?(Object.setPrototypeOf(c,At),!0):we(c)?(Object.setPrototypeOf(c,St),!0):!1:!1,o=n(t),r=new Set,s=(c,l)=>{if(de.stack&&de.stack.length){de.stack[de.stack.length-1].add(i);return}r.size!==0&&pn(()=>{for(let u of[...r.keys()])r.has(u)&&u(c,l)})},a=c=>{let l=c[J];l||(c[J]=l=new Set),l.add(i)},i=(...c)=>{if(!(2 in c)){let u=c[0],p=c[1];return 0 in c?e._value===u||T(u)&&(u=u(),e._value===u)?u:(n(u)&&a(u),e._value=u,e.auto&&s(u,p),e._value):(Yn(i),e._value)}switch(c[2]){case 0:{let u=c[3];if(!u)return()=>{};let p=f=>{r.delete(f)};return r.add(u),()=>{p(u)}}case 1:{let u=c[1],p=e._value;s(p,u);break}case 2:return r.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return i[J]=1,Ne(i,!1),o&&a(t),i};var Ce=t=>{if(rt(t))return t;let e;if(T(t)?(e=t,t=e()):e=se(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[dt]=1,E(t)){let n=t.length;for(let o=0;o<n;++o){let r=t[o];ze(r)||(t[o]=Ce(r))}return e}if(!M(t))return e;for(let n of Object.entries(t)){let o=n[1];if(ze(o))continue;let r=n[0];Ye(r)||(t[r]=null,t[r]=Ce(o))}return e};var no=Symbol("modelBridge"),Nt=()=>{},Lr=t=>!!t?.[no],Ir=t=>{t[no]=1},Vr=t=>{let e=Ce(t());return Ir(e),e},oo={collectRefObj:!0,mount:({parseResult:t,option:e})=>{if(typeof e!="string"||!e)return Nt;let n=U(e),o,r,s=Nt,a=()=>{s(),s=Nt,o=void 0,r=void 0},i=()=>{s(),s=Nt},c=(u,p)=>{o!==u&&(i(),s=ot(u,p),o=u)},l=()=>{let u=t.refs[0]??t.value()[0],p=t.context,f=p[n];if(!T(u)){if(r&&f===r){r(u);return}if(a(),T(f)){f(u);return}p[n]=u;return}if(Lr(u)){if(f===u)return;T(f)?c(u,f):p[n]=u;return}r||(r=Vr(u)),p[n]=r,c(u,r)};return{update:()=>{l()},unmount:()=>{s()}}}};var Ot=class{r;xe;Te="";Re=-1;constructor(e){this.r=e,this.xe=e.o.u.inherit}k(e){this.rt(e)}st(e){if(this.Re!==e.size){let n=[...e.keys()];this.Te=[...n,...n.map(Fe)].join(","),this.Re=e.size}return this.Te}it(e){for(let n=0;n<e.length;++n){let o=e[n]?.components;if(o)for(let r in o)return!0}return!1}at(e){if(!le(e))return!1;let n=e.getAttributeNames();return e.hasAttribute("name")?!0:n.some(o=>o.startsWith("#"))}ct(e){return le(e)&&e.getAttributeNames().length===0}rt(e){let n=this.r,o=n.m,r=n.o.Z,s=n.o.$;if(r.size===0&&!this.it(o.l))return;let a=o.ee(),i=this.Ce();if(B(i))return;let c=this.ut(e,i);for(let l of c){if(l.hasAttribute(n.R))continue;let u=l.parentNode;if(!u)continue;let p=l.nextSibling,f=U(l.tagName).toUpperCase(),m=a[f]??s.get(f);if(!m)continue;let d=m.template;if(!d)continue;let g=l.parentElement;if(!g)continue;let C=new Comment(" begin component: "+l.tagName),R=new Comment(" end component: "+l.tagName);g.insertBefore(C,l),l.remove();let j=n.o.u.context,K=n.o.u.contextAlias,V=n.o.u.bind,ne=(y,A)=>{let v={},_=y.hasAttribute(j);return o.C(A,()=>{o.v(v),_?n.y(ln,y,j):y.hasAttribute(K)&&n.y(ln,y,K);let b=m.props;if(!b||b.length===0)return;b=b.map(U);let w=new Map(b.map(G=>[G.toLowerCase(),G]));for(let G of[...b,...b.map(Fe)]){let ce=y.getAttribute(G);ce!==null&&(v[U(G)]=ce,y.removeAttribute(G))}let k=n.F.Ee(y,!1);for(let[G,ce]of k.entries()){let[he,I]=ce.te;if(!I)continue;let ee=w.get(U(I).toLowerCase());ee&&(he!=="."&&he!==":"&&he!==V||n.y(oo,y,G,!0,ee,ce.ne))}}),v},X=[...o.L()],N=()=>{let y=ne(l,X),A=new Ze(y,l,X,C,R,n.o.propValidationMode),v=un(()=>m.context(A)??{}).context;if(A.autoProps){for(let[_,b]of Object.entries(y))if(_ in v){let w=v[_];if(w===b)continue;if(T(w)){T(b)?A.entangle?q(C,ot(b,w)):w(b()):w(b);continue}}else v[_]=b;A.onAutoPropsAssigned?.()}return{componentCtx:v,head:A}},{componentCtx:oe,head:x}=N(),S=[...Te(d)],Y=S.length,De=l.childNodes.length===0,Pe=y=>{let A=y.parentElement,v=y.name;if(B(v)&&(v=y.getAttributeNames().filter(w=>w.startsWith("#"))[0],B(v)?v="default":v=v.substring(1)),De){if(v==="default"){let w=n.o.u.text,k=l.getAttribute(w);if(!B(k)){let G=document.createElement("span");G.setAttribute(w,k),A.insertBefore(G,y),l.removeAttribute(w);return}}for(let w of[...y.childNodes])A.insertBefore(w,y);return}let _=l.querySelector(`template[name='${v}'], template[\\#${v}]`);!_&&v==="default"&&(_=[...l.querySelectorAll("template:not([name])")].find(k=>this.ct(k))??null);let b=w=>{x.enableSwitch&&o.C(X,()=>{o.v(oe);let k=ne(y,o.L());o.C(X,()=>{o.v(k);let G=o.L(),ce=qn(G);for(let he of w)be(he)&&(he.setAttribute(et,ce),tn(ce),q(he,()=>{nn(ce)}))})})};if(_){let w=[...Te(_)];for(let k of w)A.insertBefore(k,y);b(w)}else{if(v!=="default"){for(let k of[...Te(y)])A.insertBefore(k,y);return}let w=[...Te(l)].filter(k=>!this.at(k));for(let k of w)A.insertBefore(k,y);b(w)}},Jt=y=>{if(!be(y))return;let A=y.querySelectorAll("slot");if(Gn(y)){Pe(y),y.remove();return}for(let v of A)Pe(v),v.remove()};(()=>{for(let y=0;y<Y;++y)S[y]=S[y].cloneNode(!0),u.insertBefore(S[y],p),Jt(S[y])})(),g.insertBefore(R,p);let O=()=>{if(!m.inheritAttrs)return;let y=S.filter(v=>v.nodeType===Node.ELEMENT_NODE);y.length>1&&(y=y.filter(v=>v.hasAttribute(this.xe)));let A=y[0];if(A)for(let v of l.getAttributeNames()){if(v===j||v===K)continue;let _=l.getAttribute(v);if(v==="class"){let b=qe(_);b.length>0&&A.classList.add(...b)}else if(v==="style"){let b=A.style,w=l.style;for(let k of w)b.setProperty(k,w.getPropertyValue(k))}else A.setAttribute(Et(v,n.o),_)}},W=()=>{for(let y of l.getAttributeNames())!y.startsWith("@")&&!y.startsWith(n.o.u.on)&&l.removeAttribute(y)},Z=()=>{O(),W(),o.v(oe),n.ve(l,!1),oe.$emit=x.emit,Ae(n,S),q(l,()=>{Se(oe)}),q(C,()=>{ye(l)}),Rt(oe)};o.C(X,Z)}}Ce(){let e=this.r,n=e.m,o=e.o.Z,r=n.pt(),s=this.st(o);return[...s?[s]:[],...r,...r.map(Fe)].join(",")}ut(e,n){let o=[];if(B(n))return o;if(e.matches?.(n))return[e];let r=this.q(e).reverse();for(;r.length>0;){let s=r.pop();if(s.matches(n)){o.push(s);continue}r.push(...this.q(s).reverse())}return o}j(e,n){let o=this.Ce(),r=this.q(e).reverse();for(;r.length>0;){let s=r.pop();n(s),!(!B(o)&&s.matches(o))&&r.push(...this.q(s).reverse())}}q(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let a=n[s];be(a)&&r.push(a)}return r}let o=e?.childNodes;if(o?.length!=null){let r=[];for(let s=0;s<o.length;++s){let a=o[s];be(a)&&r.push(a)}return r}return[]}};var dn=class{te;ne;we=[];constructor(e,n){this.te=e,this.ne=n}},Mt=class{r;Se;Ae;oe;constructor(e){this.r=e,this.Se=e.o.lt(),this.oe=new Map;let n=new Map;for(let o of this.Se){let r=o[0]??"",s=n.get(r);s?s.push(o):n.set(r,[o])}this.Ae=n}ke(e){let n=this.oe.get(e);if(n)return n;let o=e,r=o.startsWith(".");r&&(o=":"+o.slice(1));let s=o.indexOf("."),i=(s<0?o:o.substring(0,s)).split(/[:@]/);B(i[0])&&(i[0]=r?".":o[0]);let c=s>=0?o.slice(s+1).split("."):[],l=!1,u=!1;for(let f=0;f<c.length;++f){let h=c[f];if(!l&&h==="camel"?l=!0:!u&&h==="prop"&&(u=!0),l&&u)break}l&&(i[i.length-1]=U(i[i.length-1])),u&&(i[0]=".");let p={terms:i,flags:c};return this.oe.set(e,p),p}Ee(e,n){let o=new Map;if(!tt(e))return o;let r=this.Ae,s=(i,c)=>{let l=r.get(c[0]??"");if(l)for(let u=0;u<l.length;++u){if(!c.startsWith(l[u]))continue;let p=o.get(c);if(!p){let f=this.ke(c);p=new dn(f.terms,f.flags),o.set(c,p)}p.we.push(i);return}},a=i=>{let c=i.attributes;if(!(!c||c.length===0))for(let l=0;l<c.length;++l){let u=c.item(l)?.name;u&&s(i,u)}};return a(e),!n||!e.firstElementChild||this.r.M.j(e,a),o}};var ro=()=>{},Dr=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},kt=class{r;I;constructor(e){this.r=e,this.I=e.o.u.is}k(e){let n=e.hasAttribute(this.I);return(n||e.hasAttribute("is"))&&this.y(e),this.r.M.j(e,o=>{(o.hasAttribute(this.I)||o.hasAttribute("is"))&&this.y(o)}),n}y(e){let n=e.getAttribute(this.I);if(!n){if(n=e.getAttribute("is"),!n)return;if(!n.startsWith("regor:")){if(!n.startsWith("r-"))return;let o=n.slice(2).trim().toLowerCase();if(!o)return;let r=e.parentNode;if(!r)return;let s=document.createElement(o);for(let a of e.getAttributeNames())a!=="is"&&s.setAttribute(a,e.getAttribute(a));for(;e.firstChild;)s.appendChild(e.firstChild);r.insertBefore(s,e),e.remove(),this.r._(s);return}n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.I),this.O(e,n)}U(e,n){let o=$e(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),_e(s,o),o.forEach(i=>{z(i)}),e.remove();let a=document.createComment(`__end__ dynamic ${n??""}`);return r.insertBefore(a,s.nextSibling),{nodes:o,parent:r,commentBegin:s,commentEnd:a}}O(e,n){let{nodes:o,parent:r,commentBegin:s,commentEnd:a}=this.U(e,` => ${n} `),i=this.r.m.V(n),c=i.value,l=this.r.m,u=l.L(),p={name:""},f=le(e)?o:[...o[0].childNodes],h=()=>{l.C(u,()=>{let g=c()[0];if(M(g)&&(g.name?g=g.name:g=Object.entries(l.ee()).filter(R=>R[1]===g)[0]?.[0]),!F(g)||B(g)){xe(s,a);return}if(p.name===g)return;xe(s,a);let C=document.createElement(g);for(let R of e.getAttributeNames())R!==this.I&&C.setAttribute(R,e.getAttribute(R));Dr(f,C),r.insertBefore(C,a),this.r._(C),p.name=g})},m=ro;q(s,()=>{i.stop(),m(),m=ro}),h(),m=i.subscribe(h)}};var H=t=>{let e=t;return e!=null&&e[J]===1?e():e};var Pr=(t,e)=>{let[n,o]=e;$(o)?o(t,n):t.innerHTML=n?.toString()},Lt={mount:()=>({update:({el:t,values:e})=>{Pr(t,e)}})};var It=class t{re;constructor(e){this.re=e}static ft(e,n){let o=e.m,r=e.o,s=r.u,a=new Set([s.for,s.if,s.else,s.elseif,s.pre]),i=r.B,c=o.ee();if(Object.keys(c).length>0||r.$.size>0)return;let l=e.F,u=[],p=0,f=[];for(let h=n.length-1;h>=0;--h)f.push(n[h]);for(;f.length>0;){let h=f.pop();if(h.nodeType===Node.ELEMENT_NODE){let d=h;if(d.tagName==="TEMPLATE"||d.tagName.includes("-"))return;let g=U(d.tagName).toUpperCase();if(r.$.has(g)||c[g])return;let C=d.attributes;for(let R=0;R<C.length;++R){let j=C.item(R)?.name;if(!j)continue;if(a.has(j))return;let{terms:K,flags:V}=l.ke(j),[ne,X]=K,N=i[j]??i[ne];if(N){if(N===Lt)return;u.push({nodeIndex:p,attrName:j,directive:N,option:X,flags:V})}}++p}let m=h.childNodes;for(let d=m.length-1;d>=0;--d)f.push(m[d])}if(u.length!==0)return new t(u)}y(e,n){let o=[],r=[];for(let s=n.length-1;s>=0;--s)r.push(n[s]);for(;r.length>0;){let s=r.pop();s.nodeType===Node.ELEMENT_NODE&&o.push(s);let a=s.childNodes;for(let i=a.length-1;i>=0;--i)r.push(a[i])}for(let s=0;s<this.re.length;++s){let a=this.re[s],i=o[a.nodeIndex];i&&e.y(a.directive,i,a.attrName,!1,a.option,a.flags)}}};var Ur=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},Hr=t=>{let e=t.length,n=t.slice(),o=[],r,s,a;for(let i=0;i<e;++i){let c=t[i];if(c===0)continue;let l=o[o.length-1];if(l===void 0||t[l]<c){n[i]=l??-1,o.push(i);continue}for(r=0,s=o.length-1;r<s;)a=r+s>>1,t[o[a]]<c?r=a+1:s=a;c<t[o[r]]&&(r>0&&(n[i]=o[r-1]),o[r]=i)}for(r=o.length,s=o[r-1]??-1;r-- >0;)o[r]=s,s=n[s];return o},Vt=class{static mt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:a,removeMountItem:i,endAnchor:c}=e,l=n.length,u=o.length,p=new Array(u),f=new Set;for(let x=0;x<u;++x){let S=r(o[x]);if(S===void 0||f.has(S))return;f.add(S),p[x]=S}let h=new Array(u),m=0,d=l-1,g=u-1;for(;m<=d&&m<=g;){let x=n[m];if(r(x.value)!==p[m]||!s(x.value,o[m]))break;x.value=o[m],h[m]=x,++m}for(;m<=d&&m<=g;){let x=n[d];if(r(x.value)!==p[g]||!s(x.value,o[g]))break;x.value=o[g],h[g]=x,--d,--g}if(m>d){for(let x=g;x>=m;--x){let S=x+1<u?h[x+1].items[0]:c;h[x]=a(x,o[x],S)}return h}if(m>g){for(let x=m;x<=d;++x)i(n[x]);return h}let C=m,R=m,j=g-R+1,K=new Array(j).fill(0),V=new Map;for(let x=R;x<=g;++x)V.set(p[x],x);let ne=!1,X=0;for(let x=C;x<=d;++x){let S=n[x],Y=V.get(r(S.value));if(Y===void 0){i(S);continue}if(!s(S.value,o[Y])){i(S);continue}S.value=o[Y],h[Y]=S,K[Y-R]=x+1,Y>=X?X=Y:ne=!0}let N=ne?Hr(K):[],oe=N.length-1;for(let x=j-1;x>=0;--x){let S=R+x,Y=S+1<u?h[S+1].items[0]:c;if(K[x]===0){h[S]=a(S,o[S],Y);continue}let De=h[S];ne&&(oe>=0&&N[oe]===x?--oe:De&&Ur(De,Y))}return h}};var st=class{T=[];P=new Map;get w(){return this.T.length}se;constructor(e){this.se=e}ie(e){let n=this.se(e.value);n!==void 0&&this.P.set(n,e)}ae(e){let n=this.se(this.T[e]?.value);n!==void 0&&this.P.delete(n)}static dt(e,n){return{items:[],index:e,value:n,order:-1}}v(e){e.order=this.w,this.T.push(e),this.ie(e)}yt(e,n){let o=this.w;for(let r=e;r<o;++r)this.T[r].order=r+1;n.order=e,this.T.splice(e,0,n),this.ie(n)}D(e){return this.T[e]}ce(e,n){this.ae(e),this.T[e]=n,this.ie(n),n.order=e}Ne(e){this.ae(e),this.T.splice(e,1);let n=this.w;for(let o=e;o<n;++o)this.T[o].order=o}Me(e){let n=this.w;for(let o=e;o<n;++o)this.ae(o);this.T.splice(e)}en(e){return this.P.has(e)}ht(e){return this.P.get(e)?.order??-1}};var hn=Symbol("r-for"),Br=t=>-1,so=()=>{},Dt=class t{r;x;Oe;R;constructor(e){this.r=e,this.x=e.o.u.for,this.Oe=Ct(this.x),this.R=e.o.u.pre}k(e){let n=e.hasAttribute(this.x);return n&&this.Ve(e),this.r.M.j(e,o=>{o.hasAttribute(this.x)&&this.Ve(o)}),n}Y(e){return e[hn]?!0:(e[hn]=!0,Tt(e,this.Oe).forEach(n=>n[hn]=!0),!1)}Ve(e){if(e.hasAttribute(this.R)||this.Y(e))return;let n=e.getAttribute(this.x);if(!n){D(0,this.x,e);return}e.removeAttribute(this.x),this.gt(e,n)}Le(e){return ue(e)?[]:($(e)&&(e=e()),Symbol.iterator in Object(e)?e:typeof e=="number"?(o=>({*[Symbol.iterator](){for(let r=1;r<=o;r++)yield r}}))(e):Object.entries(e))}gt(e,n){let o=this.bt(n);if(!o?.list){D(1,this.x,n,e);return}let r=this.r.o.u.key,s=this.r.o.u.keyBind,a=e.getAttribute(r)??e.getAttribute(s);e.removeAttribute(r),e.removeAttribute(s);let i=$e(e),c=It.ft(this.r,i),l=e.parentNode;if(!l)return;let u=`${this.x} => ${n}`,p=new Comment(`__begin__ ${u}`);l.insertBefore(p,e),_e(p,i),i.forEach(O=>{z(O)}),e.remove();let f=new Comment(`__end__ ${u}`);l.insertBefore(f,p.nextSibling);let h=this.r,m=h.m,d=m.L(),C=d.length===1?[void 0,d[0]]:void 0,R=this.xt(a),j=(O,W)=>R(O)===R(W),K=(O,W)=>O===W,V=(O,W,Z)=>{let y=o.createContext(W,O),A=st.dt(y.index,W),v=()=>{let _=f.parentNode??p.parentNode??l,b=Z.previousSibling,w=[];for(let k=0;k<i.length;++k){let G=i[k].cloneNode(!0);_.insertBefore(G,Z),w.push(G)}for(c?c.y(h,w):Ae(h,w),b=b.nextSibling;b!==Z;)A.items.push(b),b=b.nextSibling};return C?(C[0]=y.ctx,m.C(C,v)):m.C(d,()=>{m.v(y.ctx),v()}),A},ne=(O,W)=>{let Z=L.D(O).items,y=Z[Z.length-1].nextSibling;for(let A of Z)z(A);L.ce(O,V(O,W,y))},X=(O,W)=>{L.v(V(O,W,f))},N=O=>{for(let W of L.D(O).items)z(W)},oe=O=>{let W=L.w;for(let Z=O;Z<W;++Z)L.D(Z).index(Z)},x=O=>{let W=p.parentNode,Z=f.parentNode;if(!W||!Z)return;let y=L.w;$(O)&&(O=O());let A=H(O[0]);if(E(A)&&A.length===0){xe(p,f),L.Me(0);return}let v=[];for(let I of this.Le(O[0]))v.push(I);let _=Vt.mt({oldItems:L.T,newValues:v,getKey:R,isSameValue:K,mountNewValue:(I,ee,Oe)=>V(I,ee,Oe),removeMountItem:I=>{for(let ee=0;ee<I.items.length;++ee)z(I.items[ee])},endAnchor:f});if(_){L.T=_,L.P.clear();for(let I=0;I<_.length;++I){let ee=_[I];ee.order=I,ee.index(I);let Oe=R(ee.value);Oe!==void 0&&L.P.set(Oe,ee)}return}let b=0,w=Number.MAX_SAFE_INTEGER,k=y,G=this.r.o.forGrowThreshold,ce=()=>L.w<k+G;for(let I of v){let ee=()=>{if(b<y){let Oe=L.D(b++);if(j(Oe.value,I)){if(K(Oe.value,I))return;ne(b-1,I);return}let ut=L.ht(R(I));if(ut>=b&&ut-b<10){if(--b,w=Math.min(w,b),N(b),L.Ne(b),--y,ut>b+1)for(let Qt=b;Qt<ut-1&&Qt<y&&!j(L.D(b).value,I);)++Qt,N(b),L.Ne(b),--y;ee();return}ce()?(L.yt(b-1,V(b,I,L.D(b-1).items[0])),w=Math.min(w,b-1),++y):ne(b-1,I)}else X(b++,I)};ee()}let he=b;for(y=L.w;b<y;)N(b++);L.Me(he),oe(w)},S=()=>{Y.stop(),Pe(),Pe=so},Y=m.V(o.list),De=Y.value,Pe=so,Jt=0,L=new st(R);for(let O of this.Le(De()[0]))L.v(V(Jt++,O,f));q(p,S),Pe=Y.subscribe(x)}static Tt=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;bt(e){let n=t.Tt.exec(e);if(!n)return;let o=(n[1]+(n[2]??"")).split(",").map(c=>c.trim()),r=o.length>1?o.length-1:-1,s=r!==-1&&(o[r]==="index"||o[r]?.startsWith("#"))?o[r]:"";s&&o.splice(r,1);let a=n[3];if(!a||o.length===0)return;let i=/[{[]/.test(e);return{list:a,createContext:(c,l)=>{let u={},p=H(c);if(!i&&o.length===1)u[o[0]]=c;else if(E(p)){let h=0;for(let m of o)u[m]=p[h++]}else for(let h of o)u[h]=p[h];let f={ctx:u,index:Br};return s&&(f.index=u[s.startsWith("#")?s.substring(1):s]=se(l)),f}}}xt(e){if(!e)return o=>o;let n=e.trim();if(!n)return o=>o;if(n.includes(".")){let o=this.Rt(n),r=o.length>1?o.slice(1):void 0;return s=>{let a=H(s),i=this.Ie(a,o);return i!==void 0||!r?i:this.Ie(a,r)}}return o=>H(H(o)?.[n])}Rt(e){return e.split(".").filter(n=>n.length>0)}Ie(e,n){let o=e;for(let r of n)o=H(o)?.[r];return H(o)}};var Pt=class{ue=0;pe=new Map;m;Pe;De;Ue;M;F;o;R;Be;constructor(e){this.m=e,this.o=e.o,this.De=new Dt(this),this.Pe=new xt(this),this.Ue=new kt(this),this.M=new Ot(this),this.F=new Mt(this),this.R=this.o.u.pre,this.Be=this.o.u.dynamic}Ct(e){let n=le(e)?[e]:e.querySelectorAll("template");for(let o of n){if(o.hasAttribute(this.R))continue;let r=o.parentNode;if(!r)continue;let s=o.nextSibling;if(o.remove(),!o.content)continue;let a=[...o.content.childNodes];for(let i of a)r.insertBefore(i,s);Ae(this,a)}}_(e){++this.ue;try{if(e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.R)||this.Pe.k(e)||this.De.k(e)||this.Ue.k(e))return;this.M.k(e),this.Ct(e),this.ve(e,!0)}finally{--this.ue,this.ue===0&&this.Et()}}vt(e,n){let o=document;if(!o){let r=e.parentNode;for(;r?.parentNode;)r=r.parentNode;if(!r)return null;o=r}return o.querySelector(n)}He(e,n){let o=this.vt(e,n);if(!o)return!1;let r=e.parentElement;if(!r)return!1;let s=new Comment(`teleported => '${n}'`);return r.insertBefore(s,e),e.teleportedFrom=s,s.teleportedTo=e,q(s,()=>{z(e)}),o.appendChild(e),!0}wt(e,n){this.pe.set(e,n)}Et(){let e=this.pe;if(e.size!==0){this.pe=new Map;for(let[n,o]of e.entries())this.He(n,o)}}ve(e,n){let o=this.F.Ee(e,n),r=this.o.B;for(let[s,a]of o.entries()){let[i,c]=a.te,l=r[s]??r[i];if(!l){console.error("directive not found:",i);continue}let u=a.we;for(let p=0;p<u.length;++p){let f=u[p];this.y(l,f,s,!1,c,a.ne)}}}y(e,n,o,r,s,a){if(n.hasAttribute(this.R))return;let i=n.getAttribute(o);n.removeAttribute(o);let c=l=>{let u=l;for(;u;){let p=u.getAttribute(et);if(p)return p;u=u.parentElement}return null};if(on()){let l=c(n);if(l){this.m.C(zn(l),()=>{this.O(e,n,i,s,a)});return}}this.O(e,n,i,s,a)}St(e,n,o){return e!==vt?!1:(B(o)||this.He(n,o)||this.wt(n,o),!0)}O(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.St(e,n,o))return;let a=this.At(r,e.once),i=this.kt(e,o),c=this.Nt(i,a);q(n,c.stop);let l=this.Mt(n,o,i,a,r,s),u=this.Ot(e,l,c);if(!u)return;let p=this.Vt(l,i,a,r,u);p(),e.once||(c.result=i.subscribe(p),a&&(c.dynamic=a.subscribe(p)))}At(e,n){let o=Qn(e,this.Be);if(o)return this.m.V(U(o),void 0,void 0,void 0,n)}kt(e,n){return this.m.V(n,e.isLazy,e.isLazyKey,e.collectRefObj,e.once)}Nt(e,n){let o={stop:()=>{e.stop(),n?.stop(),o.result?.(),o.dynamic?.(),o.mounted?.(),o.result=void 0,o.dynamic=void 0,o.mounted=void 0}};return o}Mt(e,n,o,r,s,a){return{el:e,expr:n,values:o.value(),previousValues:void 0,option:r?r.value()[0]:s,previousOption:void 0,flags:a,parseResult:o,dynamicOption:r}}Ot(e,n,o){let r=e.mount(n);if(typeof r=="function"){o.mounted=r;return}return r?.unmount&&(o.mounted=r.unmount),r?.update}Vt(e,n,o,r,s){let a,i;return()=>{let c=n.value(),l=o?o.value()[0]:r;e.values=c,e.previousValues=a,e.option=l,e.previousOption=i,a=c,i=l,s(e)}}};var io="http://www.w3.org/1999/xlink",jr={itemscope:2,allowfullscreen:2,formnovalidate:2,ismap:2,nomodule:2,novalidate:2,readonly:2,async:1,autofocus:1,autoplay:1,controls:1,default:1,defer:1,disabled:1,hidden:1,inert:1,loop:1,open:1,required:1,reversed:1,scoped:1,seamless:1,checked:1,muted:1,multiple:1,selected:1};function _r(t){return!!t||t===""}var $r=(t,e,n,o,r,s)=>{if(o){s&&s.includes("camel")&&(o=U(o)),Ut(t,o,e[0],r);return}let a=e.length;for(let i=0;i<a;++i){let c=e[i];if(E(c)){let l=n?.[i]?.[0],u=c[0],p=c[1];Ut(t,u,p,l)}else if(M(c))for(let l of Object.entries(c)){let u=l[0],p=l[1],f=n?.[i],h=f&&u in f?u:void 0;Ut(t,u,p,h)}else{let l=n?.[i],u=e[i++],p=e[i];Ut(t,u,p,l)}}},yn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{$r(t,e,n,o,r,s)}})},Ut=(t,e,n,o)=>{if(o&&o!==e&&t.removeAttribute(o),ue(e)){D(3,"r-bind",t);return}if(!F(e)){D(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){ue(n)?t.removeAttributeNS(io,e.slice(6,e.length)):t.setAttributeNS(io,e,n);return}let r=e in jr;ue(n)||r&&!_r(n)?t.removeAttribute(e):t.setAttribute(e,r?"":n)};var Fr=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(E(s)){let i=s.length;for(let c=0;c<i;++c)ao(t,s[c],a?.[c])}else ao(t,s,a)}},gn={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Fr(t,e,n)}})},ao=(t,e,n)=>{let o=t.classList,r=F(e),s=F(n);if(e&&!r){if(n&&!s)for(let a in n)(!(a in e)||!e[a])&&o.remove(a);for(let a in e)e[a]&&o.add(a)}else if(r){if(n!==e){let a=s?qe(n):[],i=qe(e);a.length>0&&o.remove(...a),i.length>0&&o.add(...i)}}else if(n){let a=s?qe(n):[];a.length>0&&o.remove(...a)}};function qr(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Ee(t[o],e[o]);return n}function Ee(t,e){if(t===e)return!0;let n=Yt(t),o=Yt(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=Ye(t),o=Ye(e),n||o)return t===e;if(n=E(t),o=E(e),n||o)return n&&o?qr(t,e):!1;if(n=M(t),o=M(e),n||o){if(!n||!o)return!1;let r=Object.keys(t).length,s=Object.keys(e).length;if(r!==s)return!1;for(let a in t){let i=Object.prototype.hasOwnProperty.call(t,a),c=Object.prototype.hasOwnProperty.call(e,a);if(i&&!c||!Ee(t[a],e[a]))return!1}return!0}return String(t)===String(e)}function Ht(t,e){return t.findIndex(n=>Ee(n,e))}var co=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var bn=t=>{if(!T(t))throw P(3,"pause");t(void 0,void 0,3)};var xn=t=>{if(!T(t))throw P(3,"resume");t(void 0,void 0,4)};var lo={mount:({el:t,parseResult:e,flags:n})=>({update:({values:o})=>{zr(t,o[0])},unmount:Kr(t,e,n)})},zr=(t,e)=>{let n=ho(t);if(n&&po(t))E(e)?e=Ht(e,ve(t))>-1:ae(e)?e=e.has(ve(t)):e=Yr(t,e),t.checked=e;else if(n&&fo(t))t.checked=Ee(e,ve(t));else if(n||yo(t))mo(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(go(t)){let o=t.options,r=o.length,s=t.multiple;for(let a=0;a<r;a++){let i=o[a],c=ve(i);if(s)E(e)?i.selected=Ht(e,c)>-1:i.selected=e.has(c);else if(Ee(ve(i),e)){t.selectedIndex!==a&&(t.selectedIndex=a);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else D(7,t)},it=t=>(T(t)&&(t=t()),$(t)&&(t=t()),t?F(t)?{trim:t.includes("trim"),lazy:t.includes("lazy"),number:t.includes("number"),int:t.includes("int")}:{trim:!!t.trim,lazy:!!t.lazy,number:!!t.number,int:!!t.int}:{trim:!1,lazy:!1,number:!1,int:!1}),po=t=>t.type==="checkbox",fo=t=>t.type==="radio",mo=t=>t.type==="number"||t.type==="range",ho=t=>t.tagName==="INPUT",yo=t=>t.tagName==="TEXTAREA",go=t=>t.tagName==="SELECT",Kr=(t,e,n)=>{let o=e.value,r=it(n?.join(",")),s=it(o()[1]),a={int:r.int||s.int,lazy:r.lazy||s.lazy,number:r.number||s.number,trim:r.trim||s.trim};if(!e.refs[0])return D(8,t),()=>{};let i=()=>e.refs[0],c=ho(t);return c&&po(t)?Gr(t,i):c&&fo(t)?Zr(t,i):c||yo(t)?Wr(t,a,i,o):go(t)?es(t,i,o):(D(7,t),()=>{})},uo=/[.,' ·٫]/,Wr=(t,e,n,o)=>{let s=e.lazy?"change":"input",a=mo(t),i=()=>{!e.trim&&!it(o()[1]).trim||(t.value=t.value.trim())},c=f=>{let h=f.target;h.composing=1},l=f=>{let h=f.target;h.composing&&(h.composing=0,h.dispatchEvent(new Event(s)))},u=()=>{t.removeEventListener(s,p),t.removeEventListener("change",i),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",l),t.removeEventListener("change",l)},p=f=>{let h=n();if(!h)return;let m=f.target;if(!m||m.composing)return;let d=m.value,g=it(o()[1]);if(a||g.number||g.int){if(g.int)d=parseInt(d);else{if(uo.test(d[d.length-1])&&d.split(uo).length===2){if(d+="0",d=parseFloat(d),isNaN(d))d="";else if(h()===d)return}d=parseFloat(d)}isNaN(d)&&(d=""),t.value=d}else g.trim&&(d=d.trim());h(d)};return t.addEventListener(s,p),t.addEventListener("change",i),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",l),t.addEventListener("change",l),u},Gr=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=ve(t),i=t.checked,c=s();if(E(c)){let l=Ht(c,a),u=l!==-1;i&&!u?c.push(a):!i&&u&&c.splice(l,1)}else ae(c)?i?c.add(a):c.delete(a):s(Xr(t,i))};return t.addEventListener(n,r),o},ve=t=>"_value"in t?t._value:t.value,bo="trueValue",Jr="falseValue",xo="true-value",Qr="false-value",Xr=(t,e)=>{let n=e?bo:Jr;if(n in t)return t[n];let o=e?xo:Qr;return t.hasAttribute(o)?t.getAttribute(o):e},Yr=(t,e)=>{if(bo in t)return Ee(e,t.trueValue);let o=xo;return t.hasAttribute(o)?Ee(e,t.getAttribute(o)):Ee(e,!0)},Zr=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=ve(t);s(a)};return t.addEventListener(n,r),o},es=(t,e,n)=>{let o="change",r=()=>{t.removeEventListener(o,s)},s=()=>{let a=e();if(!a)return;let c=it(n()[1]).number,l=Array.prototype.filter.call(t.options,u=>u.selected).map(u=>c?co(ve(u)):ve(u));if(t.multiple){let u=a();try{if(bn(a),ae(u)){u.clear();for(let p of l)u.add(p)}else E(u)?(u.splice(0),u.push(...l)):a(l)}finally{xn(a),Q(a)}}else a(l[0])};return t.addEventListener(o,s),r};var ts=["stop","prevent","capture","self","once","left","right","middle","passive"],ns=t=>{let e={};if(B(t))return;let n=t.split(",");for(let o of ts)e[o]=n.includes(o);return e},os=(t,e,n,o,r)=>{if(o){let l=e.value(),u=H(o.value()[0]);return F(u)?Tn(t,U(u),()=>e.value()[0],r?.join(",")??l[1]):()=>{}}else if(n){let l=e.value();return Tn(t,U(n),()=>e.value()[0],r?.join(",")??l[1])}let s=[],a=()=>{s.forEach(l=>l())},i=e.value(),c=i.length;for(let l=0;l<c;++l){let u=i[l];if($(u)&&(u=u()),M(u))for(let p of Object.entries(u)){let f=p[0],h=()=>{let d=e.value()[l];return $(d)&&(d=d()),d=d[f],$(d)&&(d=d()),d},m=u[f+"_flags"];s.push(Tn(t,f,h,m))}else D(2,"r-on",t)}return a},Cn={isLazy:(t,e)=>e===-1&&t%2===0,isLazyKey:(t,e)=>e===0&&!t.endsWith("_flags"),once:!1,collectRefObj:!0,mount:({el:t,parseResult:e,option:n,dynamicOption:o,flags:r})=>os(t,e,n,o,r)},rs=(t,e)=>{if(t.startsWith("keydown")||t.startsWith("keyup")||t.startsWith("keypress")){e??="";let n=[...t.split("."),...e.split(",")];t=n[0];let o=n[1],r=n.includes("ctrl"),s=n.includes("shift"),a=n.includes("alt"),i=n.includes("meta"),c=l=>!(r&&!l.ctrlKey||s&&!l.shiftKey||a&&!l.altKey||i&&!l.metaKey);return o?[t,l=>c(l)?l.key.toUpperCase()===o.toUpperCase():!1]:[t,c]}return[t,n=>!0]},Tn=(t,e,n,o)=>{if(B(e))return D(5,"r-on",t),()=>{};let r=ns(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,a;[e,a]=rs(e,o);let i=u=>{if(!a(u)||!n&&e==="submit"&&r?.prevent)return;let p=n(u);$(p)&&(p=p(u)),$(p)&&p(u)},c=()=>{t.removeEventListener(e,l,s)},l=u=>{if(!r){i(u);return}try{if(r.left&&u.button!==0||r.middle&&u.button!==1||r.right&&u.button!==2||r.self&&u.target!==t)return;r.stop&&u.stopPropagation(),r.prevent&&u.preventDefault(),i(u)}finally{r.once&&c()}};return t.addEventListener(e,l,s),c};var ss=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=U(n)),Ge(t,n,e[0]);return}let r=e.length;for(let s=0;s<r;++s){let a=e[s];if(E(a)){let i=a[0],c=a[1];Ge(t,i,c)}else if(M(a))for(let i of Object.entries(a)){let c=i[0],l=i[1];Ge(t,c,l)}else{let i=e[s++],c=e[s];Ge(t,i,c)}}},To={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{ss(t,e,n,o)}})};function is(t){return!!t||t===""}var Ge=(t,e,n)=>{if(ue(e)){D(3,":prop",t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(ye),1),t[e]=n??"";return}let o=t.tagName;if(e==="value"&&o!=="PROGRESS"&&!o.includes("-")){t._value=n;let s=o==="OPTION"?t.getAttribute("value"):t.value,a=n??"";s!==a&&(t.value=a),n==null&&t.removeAttribute(e);return}let r=!1;if(n===""||n==null){let s=typeof t[e];s==="boolean"?n=is(n):n==null&&s==="string"?(n="",r=!0):s==="number"&&(n=0,r=!0)}try{t[e]=n}catch(s){r||D(4,e,o,n,s)}r&&t.removeAttribute(e)};var Co={once:!0,mount:({el:t,parseResult:e,expr:n})=>{let o=e,r=o.value()[0],s=E(r),a=o.refs[0];return s?r.push(t):a?a?.(t):o.context[n]=t,()=>{if(s){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}else a?.(null)}}};var as=(t,e)=>{let n=ke(t).data,o=n._ord;Hn(o)&&(o=n._ord=t.style.display),!!e[0]?t.style.display=o:t.style.display="none"},Eo={mount:()=>({update:({el:t,values:e})=>{as(t,e)}})};var cs=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(E(s)){let i=s.length;for(let c=0;c<i;++c)vo(t,s[c],a?.[c])}else vo(t,s,a)}},Bt={mount:()=>({update:({el:t,values:e,previousValues:n})=>{cs(t,e,n)}})},vo=(t,e,n)=>{let o=t.style,r=F(e);if(e&&!r){if(n&&!F(n))for(let s in n)e[s]==null&&vn(o,s,"");for(let s in e)vn(o,s,e[s])}else{let s=o.display;if(r?n!==e&&(o.cssText=e):n&&t.removeAttribute("style"),"_ord"in ke(t).data)return;o.display=s}},Ro=/\s*!important$/;function vn(t,e,n){if(E(n))n.forEach(o=>{vn(t,e,o)});else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{let o=us(t,e);Ro.test(n)?t.setProperty(Fe(o),n.replace(Ro,""),"important"):t[o]=n}}var wo=["Webkit","Moz","ms"],En={};function us(t,e){let n=En[e];if(n)return n;let o=U(e);if(o!=="filter"&&o in t)return En[e]=o;o=nt(o);for(let r=0;r<wo.length;r++){let s=wo[r]+o;if(s in t)return En[e]=s}return e}var ie=t=>So(H(t)),So=(t,e=new WeakMap)=>{if(!t||!M(t))return t;if(E(t))return t.map(ie);if(ae(t)){let o=new Set;for(let r of t.keys())o.add(ie(r));return o}if(we(t)){let o=new Map;for(let r of t)o.set(ie(r[0]),ie(r[1]));return o}if(e.has(t))return H(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=So(H(o[1]),e);return n};var ls=(t,e)=>{let n=e[0];t.textContent=ae(n)?JSON.stringify(ie([...n])):we(n)?JSON.stringify(ie([...n])):M(n)?JSON.stringify(ie(n)):n?.toString()??""},Ao={mount:()=>({update:({el:t,values:e})=>{ls(t,e)}})};var No={mount:()=>({update:({el:t,values:e})=>{Ge(t,"value",e[0])}})};var fe=class t{static getDefault(){return t.je??(t.je=new t)}B={};u={};lt=()=>Object.keys(this.B).filter(e=>e.length===1||!e.startsWith(":"));Z=new Map;$=new Map;static je;static Lt="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";forGrowThreshold=10;globalContext;useInterpolation=!0;propValidationMode="throw";constructor(e){if(this.setDirectives("r-"),e){this.globalContext=e;return}this.globalContext=this.It()}It(){let e={},n=globalThis;for(let o of t.Lt.split(","))e[o]=n[o];return e.ref=Ce,e.sref=se,e.flatten=ie,e}addComponent(...e){for(let n of e){if(!n.defaultName){Be.warning("Registered component's default name is not defined",n);continue}this.Z.set(nt(n.defaultName),n),this.$.set(nt(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":To,":":yn,"@":Cn,[`${e}on`]:Cn,[`${e}bind`]:yn,[`${e}html`]:Lt,[`${e}text`]:Ao,[`${e}show`]:Eo,[`${e}model`]:lo,":style":Bt,[`${e}style`]:Bt,[`${e}bind:style`]:Bt,":class":gn,[`${e}bind:class`]:gn,":ref":Co,":value":No,[`${e}teleport`]:vt},this.u={for:`${e}for`,if:`${e}if`,else:`${e}else`,elseif:`${e}else-if`,pre:`${e}pre`,inherit:`${e}inherit`,text:`${e}text`,context:":context",contextAlias:`${e}context`,bind:`${e}bind`,on:`${e}on`,keyBind:":key",key:"key",is:":is",teleport:`${e}teleport`,dynamic:"_d_"}}updateDirectives(e){e(this.B,this.u)}};var jt=(t,e)=>{if(!t)return;let o=(e??fe.getDefault()).u,r=/(\{\{[^]*?\}\}|\[\[[^]*?\]\])/g,s=[{start:"{{",end:"}}"},{start:"[[",end:"]]"}];for(let a of fs(t,o.pre,s))ps(a,o.text,r,s)},ps=(t,e,n,o)=>{let r=t.textContent;if(!r)return;let s=n,a=r.split(s);if(a.length<=1)return;if(t.parentElement?.childNodes.length===1&&a.length===3){let c=a[1],l=Oo(c,o);if(l&&B(a[0])&&B(a[2])){let u=t.parentElement;u.setAttribute(e,c.substring(l.start.length,c.length-l.end.length)),u.innerText="";return}}let i=document.createDocumentFragment();for(let c of a){let l=Oo(c,o);if(l){let u=document.createElement("span");u.setAttribute(e,c.substring(l.start.length,c.length-l.end.length)),i.appendChild(u)}else i.appendChild(document.createTextNode(c))}t.replaceWith(i)},fs=(t,e,n)=>{let o=[],r=s=>{if(s.nodeType===Node.TEXT_NODE)n.some(a=>s.textContent?.includes(a.start))&&o.push(s);else{if(s?.hasAttribute?.(e))return;for(let a of Te(s))r(a)}};return r(t),o},Oo=(t,e)=>e.find(n=>t.startsWith(n.start)&&t.endsWith(n.end));var ms=9,ds=10,hs=13,ys=32,Re=46,_t=44,gs=39,bs=34,$t=40,Je=41,Ft=91,Rn=93,wn=63,xs=59,Mo=58,ko=123,qt=125,Ie=43,zt=45,Sn=96,Lo=47,An=92,Io=new Set([2,3]),Bo={"=":2.5,"*=":2.5,"**=":2.5,"/=":2.5,"%=":2.5,"+=":2.5,"-=":2.5,"<<=":2.5,">>=":2.5,">>>=":2.5,"&=":2.5,"^=":2.5,"|=":2.5},Ts={"=>":2,...Bo,"||":3,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"/":12,"%":12,"**":13},jo=Object.keys(Bo),Cs=new Set(jo),On=new Set(["=>"]);jo.forEach(t=>On.add(t));var Vo={true:!0,false:!1,null:null},Es="this",Qe="Expected ",Ve="Unexpected ",kn="Unclosed ",vs=Qe+":",Do=Qe+"expression",Rs="missing }",ws=Ve+"object property",Ss=kn+"(",Po=Qe+"comma",Uo=Ve+"token ",As=Ve+"period",Nn=Qe+"expression after ",Ns="missing unaryOp argument",Os=kn+"[",Ms=Qe+"exponent (",ks="Variable names cannot start with a number (",Ls=kn+'quote after "',at=t=>t>=48&&t<=57,Ho=t=>Ts[t],Mn=class{p;e;get H(){return this.p.charAt(this.e)}get h(){return this.p.charCodeAt(this.e)}f(e){return this.p.charCodeAt(this.e)===e}constructor(e){this.p=e,this.e=0}K(e){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>=128}le(e){return this.K(e)||at(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.p,o=this.e;for(;e===ys||e===ms||e===ds||e===hs;)e=n.charCodeAt(++o);this.e=o}parse(){let e=this.fe();return e.length===1?e[0]:{type:0,body:e}}fe(e){let n=[];for(;this.e<this.p.length;){let o=this.h;if(o===xs||o===_t)this.e++;else{let r=this.S();if(r)n.push(r);else if(this.e<this.p.length){if(o===e)break;throw this.i(Ve+'"'+this.H+'"')}}}return n}S(){let e=this.Pt()??this._e();return this.g(),this.Dt(e)}me(){this.g();let e=this.p,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),a=e.charCodeAt(n+3);if(isNaN(o))return!1;let i=!1,c=0;return o===62&&r===62&&s===62&&a===61?(i=">>>=",c=4):o===61&&r===61&&s===61?(i="===",c=3):o===33&&r===61&&s===61?(i="!==",c=3):o===62&&r===62&&s===62?(i=">>>",c=3):o===60&&r===60&&s===61?(i="<<=",c=3):o===62&&r===62&&s===61?(i=">>=",c=3):o===42&&r===42&&s===61?(i="**=",c=3):o===61&&r===62?(i="=>",c=2):o===124&&r===124?(i="||",c=2):o===63&&r===63?(i="??",c=2):o===38&&r===38?(i="&&",c=2):o===61&&r===61?(i="==",c=2):o===33&&r===61?(i="!=",c=2):o===60&&r===61?(i="<=",c=2):o===62&&r===61?(i=">=",c=2):o===60&&r===60?(i="<<",c=2):o===62&&r===62?(i=">>",c=2):o===43&&r===61?(i="+=",c=2):o===45&&r===61?(i="-=",c=2):o===42&&r===61?(i="*=",c=2):o===47&&r===61?(i="/=",c=2):o===37&&r===61?(i="%=",c=2):o===38&&r===61?(i="&=",c=2):o===94&&r===61?(i="^=",c=2):o===124&&r===61?(i="|=",c=2):o===42&&r===42?(i="**",c=2):o===105&&r===110?this.le(e.charCodeAt(n+2))||(i="in",c=2):o===61?(i="=",c=1):o===124?(i="|",c=1):o===94?(i="^",c=1):o===38?(i="&",c=1):o===60?(i="<",c=1):o===62?(i=">",c=1):o===43?(i="+",c=1):o===45?(i="-",c=1):o===42?(i="*",c=1):o===47?(i="/",c=1):o===37&&(i="%",c=1),i?(this.e+=c,i):!1}_e(){let e,n,o,r,s,a,i,c;if(s=this.z(),!s||(n=this.me(),!n))return s;if(r={value:n,prec:Ho(n),right_a:On.has(n)},a=this.z(),!a)throw this.i(Nn+n);let l=[s,r,a];for(;n=this.me();){o=Ho(n),r={value:n,prec:o,right_a:On.has(n)},c=n;let u=p=>r.right_a&&p.right_a?o>p.prec:o<=p.prec;for(;l.length>2&&u(l[l.length-2]);)a=l.pop(),n=l.pop().value,s=l.pop(),e=this.$e(n,s,a),l.push(e);if(e=this.z(),!e)throw this.i(Nn+c);l.push(r,e)}for(i=l.length-1,e=l[i];i>1;)e=this.$e(l[i-1].value,l[i-2],e),i-=2;return e}z(){let e;if(this.g(),e=this.Ut(),e)return this.de(e);let n=this.h;if(at(n)||n===Re)return this.Bt();if(n===gs||n===bs)e=this.Ht();else if(n===Ft)e=this.jt();else{let o=this._t();if(o){let r=this.z();if(!r)throw this.i(Ns);return this.de({type:7,operator:o,argument:r})}this.K(n)?(e=this.ye(),e.name in Vo?e={type:4,value:Vo[e.name],raw:e.name}:e.name===Es&&(e={type:5})):n===$t&&(e=this.$t())}return e?(e=this.W(e),this.de(e)):!1}$e(e,n,o){if(e==="=>"){let r=n.type===1?n.expressions:[n];return{type:15,params:r,body:o}}return Cs.has(e)?{type:16,operator:e,left:n,right:o}:{type:8,operator:e,left:n,right:o}}Ut(){let e={node:!1};return this.Ft(e),e.node||(this.qt(e),e.node)||(this.Kt(e),e.node)||(this.Fe(e),e.node)||this.zt(e),e.node}de(e){let n={node:e};return this.Wt(n),this.Gt(n),this.Jt(n),n.node}_t(){let e=this.p,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),a=e.charCodeAt(n+3);return o===zt?(this.e++,"-"):o===33?(this.e++,"!"):o===126?(this.e++,"~"):o===Ie?(this.e++,"+"):o===110&&r===101&&s===119&&!this.le(a)?(this.e+=3,"new"):!1}Pt(){let e={};return this.Qt(e),e.node}Dt(e){let n={node:e};return this.Xt(n),n.node}W(e){this.g();let n=this.h;for(;n===Re||n===Ft||n===$t||n===wn;){let o;if(n===wn){if(this.p.charCodeAt(this.e+1)!==Re)break;o=!0,this.e+=2,this.g(),n=this.h}if(this.e++,n===Ft){if(e={type:3,computed:!0,object:e,property:this.S()},this.g(),n=this.h,n!==Rn)throw this.i(Os);this.e++}else n===$t?e={type:6,arguments:this.qe(Je),callee:e}:(o&&this.e--,this.g(),e={type:3,computed:!1,object:e,property:this.ye()});o&&(e.optional=!0),this.g(),n=this.h}return e}Bt(){let e=this.p,n=this.e,o=n;for(;at(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===Re)for(o++;at(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let i=e.charCodeAt(o);(i===Ie||i===zt)&&o++;let c=o;for(;at(e.charCodeAt(o));)o++;if(c===o){this.e=o;let l=e.slice(n,o);throw this.i(Ms+l+this.H+")")}}this.e=o;let s=e.slice(n,o),a=e.charCodeAt(o);if(this.K(a))throw this.i(ks+s+this.H+")");if(a===Re||s.length===1&&s.charCodeAt(0)===Re)throw this.i(As);return{type:4,value:parseFloat(s),raw:s}}Ht(){let e=this.p,n=e.length,o=this.e,r=e.charCodeAt(this.e++),s=this.e,a=s,i=[],c=!1,l=!1;for(;s<n;){let p=e.charCodeAt(s);if(p===r){l=!0,this.e=s+1;break}if(p===An){c||(c=!0),i.push(e.slice(a,s));let f=e.charCodeAt(s+1);i.push(this.Ke(f)),s+=2,a=s}else s++}let u=c?i.join("")+e.slice(a,l?s:n):e.slice(a,l?s:n);if(!l)throw this.e=s,this.i(Ls+u+'"');return{type:4,value:u,raw:e.substring(o,this.e)}}Ke(e){switch(e){case 110:return`
2
- `;case 114:return"\r";case 116:return" ";case 98:return"\b";case 102:return"\f";case 118:return"\v";default:return isNaN(e)?"":String.fromCharCode(e)}}ye(){let e=this.h,n=this.e;if(this.K(e))this.e++;else throw this.i(Ve+this.H);for(;this.e<this.p.length&&(e=this.h,this.le(e));)this.e++;return{type:2,name:this.p.slice(n,this.e)}}qe(e){let n=[],o=!1,r=0;for(;this.e<this.p.length;){this.g();let s=this.h;if(s===e){if(o=!0,this.e++,e===Je&&r&&r>=n.length)throw this.i(Uo+String.fromCharCode(e));break}else if(s===_t){if(this.e++,r++,r!==n.length){if(e===Je)throw this.i(Uo+",");for(let a=n.length;a<r;a++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(Po);{let a=this.S();if(!a||a.type===0)throw this.i(Po);n.push(a)}}}if(!o)throw this.i(Qe+String.fromCharCode(e));return n}$t(){this.e++;let e=this.fe(Je);if(this.f(Je))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(Ss)}jt(){return this.e++,{type:9,elements:this.qe(Rn)}}Ft(e){if(this.f(ko)){this.e++;let n=[];for(;!isNaN(this.h);){if(this.g(),this.f(qt)){this.e++,e.node=this.W({type:10,properties:n});return}let o=this.S();if(!o)break;if(this.g(),o.type===2&&(this.f(_t)||this.f(qt)))n.push({type:12,computed:!1,key:o,value:o,shorthand:!0});else if(this.f(Mo)){this.e++;let r=this.S();if(!r)throw this.i(ws);let s=o.type===9;n.push({type:12,computed:s,key:s?o.elements[0]:o,value:r,shorthand:!1}),this.g()}else n.push(o);this.f(_t)&&this.e++}throw this.i(Rs)}}qt(e){let n=this.h;if((n===Ie||n===zt)&&n===this.p.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===Ie?"++":"--",argument:this.W(this.ye()),prefix:!0};if(!o.argument||!Io.has(o.argument.type))throw this.i(Ve+o.operator)}}Gt(e){let n=e.node,o=this.h;if((o===Ie||o===zt)&&o===this.p.charCodeAt(this.e+1)){if(!Io.has(n.type))throw this.i(Ve+(o===Ie?"++":"--"));this.e+=2,e.node={type:13,operator:o===Ie?"++":"--",argument:n,prefix:!1}}}Kt(e){this.p.charCodeAt(this.e)===Re&&this.p.charCodeAt(this.e+1)===Re&&this.p.charCodeAt(this.e+2)===Re&&(this.e+=3,e.node={type:14,argument:this.S()})}Xt(e){if(e.node&&this.f(wn)){this.e++;let n=e.node,o=this.S();if(!o)throw this.i(Do);if(this.g(),this.f(Mo)){this.e++;let r=this.S();if(!r)throw this.i(Do);e.node={type:11,test:n,consequent:o,alternate:r}}else throw this.i(vs)}}Qt(e){if(this.g(),this.f($t)){let n=this.e;if(this.e++,this.g(),this.f(Je)){this.e++;let o=this.me();if(o==="=>"){let r=this._e();if(!r)throw this.i(Nn+o);e.node={type:15,params:null,body:r};return}}this.e=n}}Jt(e){let n=e.node,o=n.type;(o===2||o===3)&&this.f(Sn)&&(e.node={type:17,tag:n,quasi:this.Fe(e)})}Fe(e){if(!this.f(Sn))return;let n=this.p,o=n.length,r={type:19,quasis:[],expressions:[]},s=++this.e,a=[],i=[],c=!1,l=u=>{if(!c){let h=n.slice(s,this.e);return r.quasis.push({type:18,value:{raw:h,cooked:h},tail:u})}a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let p=a.join(""),f=i.join("");return a.length=0,i.length=0,c=!1,r.quasis.push({type:18,value:{raw:p,cooked:f},tail:u})};for(;this.e<o;){let u=n.charCodeAt(this.e);if(u===Sn)return l(!0),this.e+=1,e.node=r,r;if(u===36&&n.charCodeAt(this.e+1)===ko){if(l(!1),this.e+=2,r.expressions.push(...this.fe(qt)),!this.f(qt))throw this.i("unclosed ${");this.e+=1,s=this.e}else if(u===An){c||(c=!0),a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let p=n.charCodeAt(this.e+1);a.push(n.slice(this.e,this.e+2)),i.push(this.Ke(p)),this.e+=2,s=this.e}else this.e+=1}throw this.i("Unclosed `")}Wt(e){let n=e.node;if(!n||n.operator!=="new"||!n.argument)return;if(!n.argument||![6,3].includes(n.argument.type))throw this.i("Expected new function()");e.node=n.argument;let o=e.node;for(;o.type===3||o.type===6&&o.callee.type===3;)o=o.type===3?o.object:o.callee.object;o.type=20}zt(e){if(!this.f(Lo))return;let n=++this.e,o=!1;for(;this.e<this.p.length;){if(this.h===Lo&&!o){let r=this.p.slice(n,this.e),s="";for(;++this.e<this.p.length;){let i=this.h;if(i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)s+=this.H;else break}let a;try{a=new RegExp(r,s)}catch(i){throw this.i(i.message)}return e.node={type:4,value:a,raw:this.p.slice(n-1,this.e)},e.node=this.W(e.node),e.node}this.f(Ft)?o=!0:o&&this.f(Rn)&&(o=!1),this.e+=this.f(An)?2:1}throw this.i("Unclosed Regex")}},_o=t=>new Mn(t).parse();var Is={"=>":(t,e)=>{},"=":(t,e)=>{},"*=":(t,e)=>{},"**=":(t,e)=>{},"/=":(t,e)=>{},"%=":(t,e)=>{},"+=":(t,e)=>{},"-=":(t,e)=>{},"<<=":(t,e)=>{},">>=":(t,e)=>{},">>>=":(t,e)=>{},"&=":(t,e)=>{},"^=":(t,e)=>{},"|=":(t,e)=>{},"||":(t,e)=>t()||e(),"??":(t,e)=>t()??e(),"&&":(t,e)=>t()&&e(),"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,in:(t,e)=>t in e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,"**":(t,e)=>t**e},Vs={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},zo=t=>{if(!t?.some(qo))return t;let e=[];return t.forEach(n=>qo(n)?e.push(...n):e.push(n)),e},$o=(...t)=>zo(t),Ln=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},Ds={"++":(t,e)=>{let n=t[e];if(T(n)){let o=n();return n(++o),o}return++t[e]},"--":(t,e)=>{let n=t[e];if(T(n)){let o=n();return n(--o),o}return--t[e]}},Ps={"++":(t,e)=>{let n=t[e];if(T(n)){let o=n();return n(o+1),o}return t[e]++},"--":(t,e)=>{let n=t[e];if(T(n)){let o=n();return n(o-1),o}return t[e]--}},Fo={"=":(t,e,n)=>{let o=t[e];return T(o)?o(n):t[e]=n},"+=":(t,e,n)=>{let o=t[e];return T(o)?o(o()+n):t[e]+=n},"-=":(t,e,n)=>{let o=t[e];return T(o)?o(o()-n):t[e]-=n},"*=":(t,e,n)=>{let o=t[e];return T(o)?o(o()*n):t[e]*=n},"/=":(t,e,n)=>{let o=t[e];return T(o)?o(o()/n):t[e]/=n},"%=":(t,e,n)=>{let o=t[e];return T(o)?o(o()%n):t[e]%=n},"**=":(t,e,n)=>{let o=t[e];return T(o)?o(o()**n):t[e]**=n},"<<=":(t,e,n)=>{let o=t[e];return T(o)?o(o()<<n):t[e]<<=n},">>=":(t,e,n)=>{let o=t[e];return T(o)?o(o()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let o=t[e];return T(o)?o(o()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let o=t[e];return T(o)?o(o()|n):t[e]|=n},"&=":(t,e,n)=>{let o=t[e];return T(o)?o(o()&n):t[e]&=n},"^=":(t,e,n)=>{let o=t[e];return T(o)?o(o()^n):t[e]^=n}},Kt=(t,e)=>$(t)?t.bind(e):t,In=class{l;ze;We;Ge;A;Je;Qe;constructor(e,n,o,r,s){this.l=E(e)?e:[e],this.ze=n,this.We=o,this.Ge=r,this.Qe=!!s}Xe(e,n){if(n&&e in n)return n;for(let o of this.l)if(e in o)return o}2(e,n,o){let r=e.name;if(r==="$root")return this.l[this.l.length-1];if(r==="$parent")return this.l[1];if(r==="$ctx")return[...this.l];if(o&&r in o)return this.A=o[r],Kt(H(o[r]),o);for(let a of this.l)if(r in a)return this.A=a[r],Kt(H(a[r]),a);let s=this.ze;if(s&&r in s)return this.A=s[r],Kt(H(s[r]),s)}5(e,n,o){return this.l[0]}0(e,n,o){return this.Ye(n,o,$o,...e.body)}1(e,n,o){return this.E(n,o,(...r)=>r.pop(),...e.expressions)}3(e,n,o){let{obj:r,key:s}=this.he(e,n,o),a=r?.[s];return this.A=a,Kt(H(a),r)}4(e,n,o){return e.value}6(e,n,o){let r=(a,...i)=>$(a)?a(...zo(i)):a,s=this.E(++n,o,r,e.callee,...e.arguments);return this.A=s,s}7(e,n,o){return this.E(n,o,Vs[e.operator],e.argument)}8(e,n,o){let r=Is[e.operator];switch(e.operator){case"||":case"&&":case"??":return r(()=>this.b(e.left,n,o),()=>this.b(e.right,n,o))}return this.E(n,o,r,e.left,e.right)}9(e,n,o){return this.Ye(++n,o,$o,...e.elements)}10(e,n,o){let r={},s=(...a)=>{a.forEach(i=>{Object.assign(r,i)})};return this.E(++n,o,s,...e.properties),r}11(e,n,o){return this.E(n,o,r=>this.b(r?e.consequent:e.alternate,n,o),e.test)}12(e,n,o){let r={},s=u=>u?.type!==15,a=this.Ge??(()=>!1),i=n===0&&this.Qe,c=u=>this.Ze(i,e.key,n,Ln(u,o)),l=u=>this.Ze(i,e.value,n,Ln(u,o));if(e.shorthand){let u=e.key.name;r[u]=s(e.key)&&a(u,n)?c:c()}else if(e.computed){let u=H(c());r[u]=s(e.value)&&a(u,n)?l:l()}else{let u=e.key.type===4?e.key.value:e.key.name;r[u]=s(e.value)&&a(u,n)?()=>l:l()}return r}he(e,n,o){let r=this.b(e.object,n,o),s=e.computed?this.b(e.property,n,o):e.property.name;return{obj:r,key:s}}13(e,n,o){let r=e.argument,s=e.operator,a=e.prefix?Ds:Ps;if(r.type===2){let i=r.name,c=this.Xe(i,o);return ue(c)?void 0:a[s](c,i)}if(r.type===3){let{obj:i,key:c}=this.he(r,n,o);return a[s](i,c)}}16(e,n,o){let r=e.left,s=e.operator;if(r.type===2){let a=r.name,i=this.Xe(a,o);if(ue(i))return;let c=this.b(e.right,n,o);return Fo[s](i,a,c)}if(r.type===3){let{obj:a,key:i}=this.he(r,n,o),c=this.b(e.right,n,o);return Fo[s](a,i,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return E(r)&&(r.s=Ko),r}17(e,n,o){return this[6]({type:6,callee:e.tag,arguments:[{type:9,elements:e.quasi.quasis},...e.quasi.expressions]},n,o)}19(e,n,o){let r=(...s)=>s.reduce((a,i,c)=>a+=i+e.quasis[c+1].value.cooked,e.quasis[0].value.cooked);return this.E(n,o,r,...e.expressions)}18(e,n,o){return e.value.cooked}20(e,n,o){let r=(s,...a)=>new s(...a);return this.E(n,o,r,e.callee,...e.arguments)}15(e,n,o){return(...r)=>{let s=Object.create(o??{}),a=e.params;if(a){let i=0;for(let c of a)s[c.name]=r[i++]}return this.b(e.body,n,s)}}b(e,n,o){let r=H(this[e.type](e,n,o));return this.Je=e.type,r}Ze(e,n,o,r){let s=this.b(n,o,r);return e&&this.et()?this.A:s}et(){let e=this.Je;return(e===2||e===3||e===6)&&T(this.A)}eval(e,n){let{value:o,refs:r}=fn(()=>this.b(e,-1,n)),s={value:o,refs:r};return this.et()&&(s.ref=this.A),s}E(e,n,o,...r){let s=r.map(a=>a&&this.b(a,e,n));return o(...s)}Ye(e,n,o,...r){let s=this.We;if(!s)return this.E(e,n,o,...r);let a=r.map((i,c)=>i&&(i.type!==15&&s(c,e)?l=>this.b(i,e,Ln(l,n)):this.b(i,e,n)));return o(...a)}},Ko=Symbol("s"),qo=t=>t?.s===Ko,Wo=(t,e,n,o,r,s,a)=>new In(e,n,o,r,a).eval(t,s);var Go={},Jo=t=>!!t,Wt=class{l;o;constructor(e,n){this.l=e,this.o=n}v(e){this.l=[e,...this.l]}ee(){return this.l.map(n=>n.components).filter(Jo).reverse().reduce((n,o)=>{for(let[r,s]of Object.entries(o))n[r.toUpperCase()]=s;return n},{})}pt(){let e=[],n=new Set,o=this.l.map(r=>r.components).filter(Jo).reverse();for(let r of o)for(let s of Object.keys(r))n.has(s)||(n.add(s),e.push(s));return e}V(e,n,o,r,s){let a=[],i=[],c=new Set,l=()=>{for(let C=0;C<i.length;++C)i[C]();i.length=0},f={value:()=>a,stop:()=>{l(),c.clear()},subscribe:(C,R)=>(c.add(C),R&&C(a),()=>{c.delete(C)}),refs:[],context:this.l[0]};if(B(e))return f;let h=this.o.globalContext,m=[],d=new Set,g=(C,R,j,K)=>{try{let V=Wo(C,R,h,n,o,K,r);return j&&V.refs.length>0&&m.push(...V.refs),{value:V.value,refs:V.refs,ref:V.ref}}catch(V){D(6,`evaluation error: ${e}`,V)}return{value:void 0,refs:[]}};try{let C=Go[e]??_o("["+e+"]");Go[e]=C;let R=this.l.slice(),j=C.elements,K=j.length,V=new Array(K);f.refs=V;let ne=()=>{m.length=0,s||(d.clear(),l());let X=new Array(K);for(let N=0;N<K;++N){let oe=j[N];if(n?.(N,-1)){X[N]=S=>g(oe,R,!1,{$event:S}).value;continue}let x=g(oe,R,!0);X[N]=x.value,V[N]=x.ref}if(!s)for(let N of m)d.has(N)||(d.add(N),i.push(re(N,ne)));if(a=X,c.size!==0)for(let N of c)c.has(N)&&N(a)};ne()}catch(C){D(6,`parse error: ${e}`,C)}return f}L(){return this.l.slice()}tt=[];ce(e){this.tt.push(this.l),this.l=e}C(e,n){try{this.ce(e),n()}finally{this.Yt()}}Yt(){this.l=this.tt.pop()??[]}};var Qo=t=>{let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||t==="-"||t==="_"||t===":"},Us=(t,e)=>{let n="";for(let o=e;o<t.length;++o){let r=t[o];if(n){r===n&&(n="");continue}if(r==='"'||r==="'"){n=r;continue}if(r===">")return o}return-1},Hs=(t,e)=>{let n=e?2:1;for(;n<t.length&&(t[n]===" "||t[n]===`
3
- `);)++n;if(n>=t.length||!Qo(t[n]))return null;let o=n;for(;n<t.length&&Qo(t[n]);)++n;return{start:o,end:n}},Xo=new Set(["table","thead","tbody","tfoot"]),Bs=new Set(["thead","tbody","tfoot"]),js=new Set(["caption","colgroup","thead","tbody","tfoot","tr"]),_s=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Yo=(t,e)=>`${t.slice(0,t.length-2)}></${e}>`,Gt=t=>{let e=0,n=[],o=[],r=0;for(;e<t.length;){let s=t.indexOf("<",e);if(s===-1){n.push(t.slice(e));break}if(n.push(t.slice(e,s)),t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);if(g===-1){n.push(t.slice(s));break}n.push(t.slice(s,g+3)),e=g+3;continue}let a=Us(t,s);if(a===-1){n.push(t.slice(s));break}let i=t.slice(s,a+1),c=i.startsWith("</");if(i.startsWith("<!")||i.startsWith("<?")){n.push(i),e=a+1;continue}let u=Hs(i,c);if(!u){n.push(i),e=a+1;continue}let p=i.slice(u.start,u.end);if(c){let g=o[o.length-1];g?(o.pop(),n.push(g.replacementHost?`</${g.replacementHost}>`:i),Xo.has(g.effectiveTag)&&--r):n.push(i),e=a+1;continue}let f=i.charCodeAt(i.length-2)===47,h=o[o.length-1],m=null;r===0?p==="tr"?m="trx":p==="td"?m="tdx":p==="th"&&(m="thx"):Bs.has(h?.effectiveTag??"")?m=p==="tr"?null:"tr":h?.effectiveTag==="table"?m=js.has(p)?null:"tr":h?.effectiveTag==="tr"&&(m=p==="td"||p==="th"?null:"td");let d=f&&!_s.has(m||p);if(m){let g=m==="trx"||m==="tdx"||m==="thx",C=`${i.slice(0,u.start)}${m} is="${g?`r-${p}`:`regor:${p}`}"${i.slice(u.end)}`;n.push(d?Yo(C,m):C)}else n.push(d?Yo(i,p):i);if(!f){let g=m==="trx"?"tr":m==="tdx"?"td":m==="thx"?"th":m||p;o.push({replacementHost:m,effectiveTag:g}),Xo.has(g)&&++r}e=a+1}return n.join("")};var $s="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",Fs=new Set($s.toUpperCase().split(",")),qs="http://www.w3.org/2000/svg",Zo=(t,e)=>{le(t)?t.content.appendChild(e):t.appendChild(e)},Vn=(t,e,n,o)=>{let r=t.t;if(r){let a=n&&Fs.has(r.toUpperCase())?document.createElementNS(qs,r.toLowerCase()):document.createElement(r),i=t.a;if(i)for(let l of Object.entries(i)){let u=l[0],p=l[1];u.startsWith("#")&&(p=u.substring(1),u="name"),a.setAttribute(Et(u,o),p)}let c=t.c;if(c)for(let l of c)Vn(l,a,n,o);Zo(e,a);return}let s=t.d;if(s){let a;switch(t.n??Node.TEXT_NODE){case Node.COMMENT_NODE:a=document.createComment(s);break;case Node.TEXT_NODE:a=document.createTextNode(s);break}if(a)Zo(e,a);else throw new Error("unsupported node type.")}},Xe=(t,e,n)=>{n??=fe.getDefault();let o=document.createDocumentFragment();if(!E(t))return Vn(t,o,!!e,n),o;for(let r of t)Vn(r,o,!!e,n);return o};var zs=(t,e={selector:"#app"},n)=>{F(e)&&(e={selector:"#app",template:e}),Xn(t)&&(t=t.context);let o=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!o||!be(o))throw P(0);n||(n=fe.getDefault());let r=()=>{for(let i of[...o.childNodes])z(i)},s=i=>{for(let c of i)o.appendChild(c)};if(e.template){let i=document.createRange().createContextualFragment(Gt(e.template));r(),s(i.childNodes),e.element=i}else if(e.json){let i=Xe(e.json,e.isSVG,n);r(),s(i.childNodes)}return n.useInterpolation&&jt(o,n),new Dn(t,o,n).y(),q(o,()=>{Se(t)}),Rt(t),{context:t,unmount:()=>{z(o)},unbind:()=>{ye(o)}}},Dn=class{Zt;nt;o;m;r;constructor(e,n,o){this.Zt=e,this.nt=n,this.o=o,this.m=new Wt([e],o),this.r=new Pt(this.m)}y(){this.r._(this.nt)}};var ct=t=>{if(E(t))return t.map(r=>ct(r));let e={};if(t.tagName)e.t=t.tagName;else return t.nodeType===Node.COMMENT_NODE&&(e.n=Node.COMMENT_NODE),t.textContent&&(e.d=t.textContent),e;let n=t.getAttributeNames();n.length>0&&(e.a=Object.fromEntries(n.map(r=>[r,t.getAttribute(r)??""])));let o=Te(t);return o.length>0&&(e.c=[...o].map(r=>ct(r))),e};var Ks=(t,e={})=>{E(e)&&(e={props:e}),F(t)&&(t={template:t});let n=e.context??(()=>({})),o=!1;if(t.element){let s=t.element;s.remove(),t.element=s}else if(t.selector){let s=document.querySelector(t.selector);if(!s)throw P(1,t.selector);s.remove(),t.element=s}else if(t.template){let s=document.createRange().createContextualFragment(Gt(t.template));t.element=s}else t.json&&(t.element=Xe(t.json,t.isSVG,e.config),o=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&jt(t.element,e.config??fe.getDefault());let r=t.element;if(!o&&((t.isSVG??(tt(r)&&r.hasAttribute?.("isSVG")))||tt(r)&&r.querySelector("[isSVG]"))){let s=r.content,a=s?[...s.childNodes]:[...r.childNodes],i=ct(a);t.element=Xe(i,!0,e.config)}return{context:n,template:t.element,inheritAttrs:e.inheritAttrs??!0,props:e.props,defaultName:e.defaultName}};var Pn=class{byConstructor=new Map;register(e){this.byConstructor.set(e.constructor,e)}unregisterByClass(e){this.byConstructor.delete(e)}unregister(e){let n=e.constructor;this.byConstructor.get(n)===e&&this.byConstructor.delete(n)}find(e){for(let n of this.byConstructor.values())if(n instanceof e)return n}require(e){let n=this.find(e);if(n)return n;throw new Error(`${e.name} is not registered in ContextRegistry.`)}};var Ws=t=>{Me()?.onMounted.push(t)};var Gs=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw P(4);return e&&!n.isStopped?e(...r):(e=Js(t,n),e(...r))};return o[J]=1,Ne(o,!0),o.stop=()=>n.ref?.stop?.(),te(()=>o.stop(),!0),o},Js=(t,e)=>{let n=e.ref??se(null);e.ref=n,e.isStopped=!1;let o=0,r=Ke(()=>{if(o>0){r(),e.isStopped=!0,Q(n);return}n(t()),++o});return n.stop=r,n};var Qs=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw P(4);return o&&!n.isStopped?o(...s):(o=Xs(t,e,n),o(...s))};return r[J]=1,Ne(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},Xs=(t,e,n)=>{let o=n.ref??se(null);n.ref=o,n.isStopped=!1;let r=0,s=i=>{if(r>0){o.stop(),n.isStopped=!0,Q(o);return}let c=t.map(l=>l());o(e(...c)),++r},a=[];for(let i of t){let c=re(i,s);a.push(c)}return s(null),o.stop=()=>{a.forEach(i=>{i()})},o};var Ys=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw P(4);return o&&!n.isStopped?o(...s):(o=Zs(t,e,n),o(...s))};return r[J]=1,Ne(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},Zs=(t,e,n)=>{let o=n.ref??se(null);n.ref=o,n.isStopped=!1;let r=0;return o.stop=re(t,s=>{if(r>0){o.stop(),n.isStopped=!0,Q(o);return}o(e(s)),++r},!0),o};var ei=t=>(t[ht]=1,t);var ti=(t,e)=>{if(!e)throw P(5);let o=ze(t)?Ce:i=>i,r=()=>localStorage.setItem(e,JSON.stringify(ie(t()))),s=localStorage.getItem(e);if(s!=null)try{t(o(JSON.parse(s)))}catch(i){D(6,`persist: failed to parse data for key ${e}`,i),r()}else r();let a=Ke(r);return te(a,!0),t};var er=(t,...e)=>{let n="",o=t,r=e,s=o.length,a=r.length;for(let i=0;i<s;++i)n+=o[i],i<a&&(n+=r[i]);return n},ni=er;var oi=(t,e,n)=>{let o=[],r=()=>{e(t.map(a=>a()))};for(let a of t)o.push(re(a,r));n&&r();let s=()=>{for(let a of o)a()};return te(s,!0),s};var ri=t=>{if(!T(t))throw P(3,"observerCount");return t(void 0,void 0,2)};var si=t=>{tr();try{t()}finally{nr()}},tr=()=>{de.stack||(de.stack=[]),de.stack.push(new Set)},nr=()=>{let t=de.stack;if(!t||t.length===0)return;let e=t.pop();if(t.length){let n=t[t.length-1];for(let o of e)n.add(o);return}delete de.stack;for(let n of e)try{Q(n)}catch(o){console.error(o)}};export{Ze as ComponentHead,Pn as ContextRegistry,fe as RegorConfig,q as addUnbinder,si as batch,fn as collectRefs,Qs as computeMany,Ys as computeRef,Gs as computed,zs as createApp,Ks as defineComponent,rr as drainUnbind,nr as endBatch,ot as entangle,ie as flatten,ke as getBindData,er as html,ze as isDeepRef,rt as isRaw,T as isRef,ei as markRaw,re as observe,oi as observeMany,ri as observerCount,Ws as onMounted,te as onUnmounted,bn as pause,ti as persist,br as pval,ni as raw,Ce as ref,z as removeNode,xn as resume,pn as silence,se as sref,tr as startBatch,Xe as toFragment,ct as toJsonTemplate,Q as trigger,ye as unbind,H as unref,un as useScope,Be as warningHandler,Ke as watchEffect};
1
+ var Be=Symbol(":regor");var be=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];ir(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},ir=t=>{let e=t[Be];if(!e)return;let n=e.unbinders;for(let o=0;o<n.length;++o)n[o]();n.length=0,t[Be]=void 0};var je=[],ft=!1,pt,jn=()=>{if(ft=!1,pt=void 0,je.length!==0){for(let t=0;t<je.length;++t)be(je[t]);je.length=0}},z=t=>{t.remove(),je.push(t),ft||(ft=!0,pt=setTimeout(jn,1))},ar=async()=>{je.length===0&&!ft||(pt&&clearTimeout(pt),jn())};var _=t=>typeof t=="function",F=t=>typeof t=="string",$n=t=>typeof t>"u",le=t=>t==null||typeof t>"u",B=t=>typeof t!="string"||!t?.trim(),cr=Object.prototype.toString,Zt=t=>cr.call(t),Se=t=>Zt(t)==="[object Map]",ce=t=>Zt(t)==="[object Set]",en=t=>Zt(t)==="[object Date]",Ze=t=>typeof t=="symbol",E=Array.isArray,N=t=>t!==null&&typeof t=="object";var _n={0:"createApp can't find root element. You must define either a valid `selector` or an `element`. Example: createApp({}, {selector: '#app', html: '...'})",1:t=>`Component template cannot be found. selector: ${t} .`,2:"Use composables in scope. usage: useScope(() => new MyApp()).",3:t=>`${t} requires ref source argument`,4:"computed is readonly.",5:"persist requires a string key."},P=(t,...e)=>{let n=_n[t];return new Error(_(n)?n.call(_n,...e):n)};var mt=[],Fn=()=>{let t={onMounted:[],onUnmounted:[]};return mt.push(t),t},Me=t=>{let e=mt[mt.length-1];if(!e&&!t)throw P(2);return e},qn=t=>{let e=Me();return t&&nn(t),mt.pop(),e},tn=Symbol("csp"),nn=t=>{let e=t,n=e[tn];if(n){let o=Me();if(n===o)return;o.onMounted.length>0&&n.onMounted.push(...o.onMounted),o.onUnmounted.length>0&&n.onUnmounted.push(...o.onUnmounted);return}e[tn]=Me()},dt=t=>t[tn];var Ae=t=>{dt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var zn={8:t=>`Model binding requires a ref at ${t.outerHTML}`,7:t=>`Model binding is not supported on ${t.tagName} element at ${t.outerHTML}`,0:(t,e)=>`${t} binding expression is missing at ${e.outerHTML}`,1:(t,e,n)=>`invalid ${t} expression: ${e} at ${n.outerHTML}`,2:(t,e)=>`${t} requires object expression at ${e.outerHTML}`,3:(t,e)=>`${t} binder: key is empty on ${e.outerHTML}.`,4:(t,e,n,o)=>({msg:`Failed setting prop "${t}" on <${e.toLowerCase()}>: value ${n} is invalid.`,args:[o]}),5:(t,e)=>`${t} binding missing event type at ${e.outerHTML}`,6:(t,e)=>({msg:t,args:[e]})},D=(t,...e)=>{let n=zn[t],o=_(n)?n.call(zn,...e):n,r=$e.warning;r&&(F(o)?r(o):r(o,...o.args))},$e={warning:console.warn};var ht=Symbol("ref"),J=Symbol("sref"),yt=Symbol("raw");var T=t=>t!=null&&t[J]===1;var Le=class extends Error{propPath;detail;constructor(e,n){super(n),this.name="PropValidationError",this.propPath=e,this.detail=n}},he=(t,e)=>{throw new Le(t,`${e}.`)},on=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(T(t))return`ref<${on(t())}>`;if(typeof t=="string")return"string";if(typeof t=="number")return"number";if(typeof t=="boolean")return"boolean";if(typeof t=="bigint")return"bigint";if(typeof t=="symbol")return"symbol";if(typeof t=="function")return"function";if(E(t))return"array";if(t instanceof Date)return"Date";if(t instanceof RegExp)return"RegExp";if(t instanceof Map)return"Map";if(t instanceof Set)return"Set";let e=t?.constructor?.name;return e&&e!=="Object"?e:"object"},ur=t=>t.length>60?`${t.slice(0,57)}...`:t,gt=(t,e=0)=>{if(e>1)return"unknown";if(T(t)){let s=t();return`ref(${gt(s,e+1)})`}if(typeof t=="string")return ur(JSON.stringify(t));if(typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||typeof t=="symbol")return String(t);if(t===null)return"null";if(t===void 0)return"undefined";if(t instanceof Date)return t.toISOString();if(t instanceof RegExp)return String(t);if(E(t)){let s=t.slice(0,5).map(i=>gt(i,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(N(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let i=s.map(([a,c])=>{let l=gt(c,e+1);return`${a}: ${l}`}).join(", ");return Object.keys(t).length>5?`{ ${i}, ... }`:`{ ${i} }`}return"unknown"},se=t=>{let e=on(t),n=gt(t);return`got ${e} (${n})`},lr=t=>t instanceof Le?t.detail:t instanceof Error?t.message:String(t),fr=(t,e)=>{let n=`, ${se(e)}.`,o=[];for(let r of t){let s=lr(r),i=s.endsWith(n)?s.slice(0,-n.length):s;o.includes(i)||o.push(i)}return o.length===0?se(e):o.length===1?`${o[0]}, ${se(e)}`:`${o.join(" or ")}, ${se(e)}`},pr=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":on(t),mr=(t,e)=>{typeof t!="string"&&he(e,`expected string, ${se(t)}`)},dr=(t,e)=>{typeof t!="number"&&he(e,`expected number, ${se(t)}`)},hr=(t,e)=>{typeof t!="boolean"&&he(e,`expected boolean, ${se(t)}`)},yr=t=>(e,n)=>{e instanceof t||he(n,`expected instance of ${t.name||"provided class"}, ${se(e)}`)},gr=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},br=t=>(e,n,o)=>{e!==null&&t(e,n,o)},xr=(...t)=>(e,n,o)=>{let r=[];for(let s of t)try{s(e,n,o);return}catch(i){r.push(i)}he(n,fr(r,e))},Tr=t=>(e,n)=>{t.includes(e)||he(n,`expected one of ${t.map(o=>pr(o)).join(", ")}, ${se(e)}`)},Cr=t=>(e,n,o)=>{E(e)||he(n,`expected array, ${se(e)}`);let r=e;for(let s=0;s<r.length;++s)t(r[s],`${n}[${s}]`,o)},Er=t=>(e,n,o)=>{N(e)||he(n,`expected object, ${se(e)}`);let r=e;for(let s in t){let i=t[s];i(r[s],`${n}.${s}`,o)}},Rr=t=>(e,n,o)=>{if(T(e)){t(e(),`${n}.value`,o);return}he(n,`expected ref, ${se(e)}`)},vr={fail:he,describe:se,isString:mr,isNumber:dr,isBoolean:hr,isClass:yr,optional:gr,nullable:br,or:xr,oneOf:Tr,arrayOf:Cr,shape:Er,refOf:Rr};var wr=(t,e,n)=>{let o=t.tagName?.toLowerCase?.()||"unknown",r=n instanceof Le?n.propPath:e,s=n instanceof Le?n.detail:n instanceof Error?n.message:String(n);return n instanceof Error?new Error(`Invalid prop "${r}" on <${o}>: ${s}`,{cause:n}):new Error(`Invalid prop "${r}" on <${o}>: ${s}`,{cause:n})},et=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;G;J;constructor(e,n,o,r,s,i){this.props=e,this.G=n,this.ctx=o,this.start=r,this.end=s,this.J=i}emit=(e,n)=>{this.G.dispatchEvent(new CustomEvent(e,{detail:n}))};findContext(e,n=0){if(n<0)return;let o=0;for(let r of this.ctx??[])if(r instanceof e){if(o===n)return r;++o}}requireContext(e,n=0){let o=this.findContext(e,n);if(o!==void 0)return o;throw new Error(`${e} was not found in the context stack at occurrence ${n}.`)}validateProps(e){if(this.J==="off")return;let n=this.props;for(let o in e){let r=e[o];if(!r)continue;let s=r;try{s(n[o],o,this)}catch(i){let a=wr(this.G,o,i);if(this.J==="warn"){$e.warning(a.message,a);continue}throw a}}}unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)z(e),e=e.nextSibling;for(let o of this.ctx)Ae(o)}};var Ve=t=>{let e=t,n=e[Be];if(n)return n;let o={unbinders:[],data:{}};return e[Be]=o,o};var q=(t,e)=>{Ve(t).unbinders.push(e)};var xt={},bt={},Kn=1,Wn=t=>{let e=(Kn++).toString();return xt[e]=t,bt[e]=0,e},rn=t=>{bt[t]+=1},sn=t=>{--bt[t]===0&&(delete xt[t],delete bt[t])},Gn=t=>xt[t],an=()=>Kn!==1&&Object.keys(xt).length>0,tt="r-switch",Sr=t=>{let e=t.filter(o=>xe(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(tt))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},_e=(t,e)=>{if(!an())return;let n=Sr(e);n.length!==0&&(n.forEach(rn),q(t,()=>{n.forEach(sn)}))};var Tt=()=>{},cn=(t,e,n,o)=>{let r=[];for(let s of t){let i=s.cloneNode(!0);n.insertBefore(i,o),r.push(i)}Ne(e,r)},un=Symbol("r-if"),Jn=Symbol("r-else"),Qn=t=>t[Jn]===1,Ct=class{r;N;ge;Q;X;x;E;constructor(e){this.r=e,this.N=e.o.p.if,this.ge=Rt(e.o.p.if),this.Q=e.o.p.else,this.X=e.o.p.elseif,this.x=e.o.p.for,this.E=e.o.p.pre}ot(e,n){let o=e.parentElement;for(;o!==null&&o!==document.documentElement;){if(o.hasAttribute(n))return!0;o=o.parentElement}return!1}k(e){let n=e.hasAttribute(this.N);return n&&this.y(e),this.r.V.j(e,o=>{o.hasAttribute(this.N)&&this.y(o)}),n}Y(e){return e[un]?!0:(e[un]=!0,Et(e,this.ge).forEach(n=>n[un]=!0),!1)}y(e){if(e.hasAttribute(this.E)||this.Y(e)||this.ot(e,this.x))return;let n=e.getAttribute(this.N);if(!n){D(0,this.N,e);return}e.removeAttribute(this.N),this.O(e,n)}U(e,n,o){let r=Fe(e),s=e.parentNode,i=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(i,e),_e(i,r),r.forEach(c=>{z(c)}),e.remove(),n!=="if"&&(e[Jn]=1);let a=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(a,i.nextSibling),{nodes:r,parent:s,commentBegin:i,commentEnd:a}}be(e,n){if(!e)return[];let o=e.nextElementSibling;if(e.hasAttribute(this.Q)){e.removeAttribute(this.Q);let{nodes:r,parent:s,commentBegin:i,commentEnd:a}=this.U(e,"else");return[{mount:()=>{cn(r,this.r,s,a)},unmount:()=>{Te(i,a)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.X);if(!r)return[];e.removeAttribute(this.X);let{nodes:s,parent:i,commentBegin:a,commentEnd:c}=this.U(e,"elseif",` => ${r} `),l=this.r.m.M(r),u=l.value,f=this.be(o,n),p=Tt;return q(a,()=>{l.stop(),p(),p=Tt}),p=l.subscribe(n),[{mount:()=>{cn(s,this.r,i,c)},unmount:()=>{Te(a,c)},isTrue:()=>!!u()[0],isMounted:!1},...f]}}O(e,n){let o=e.nextElementSibling,{nodes:r,parent:s,commentBegin:i,commentEnd:a}=this.U(e,"if",` => ${n} `),c=this.r.m.M(n),l=c.value,u=!1,f=this.r.m,p=f.L(),h=()=>{f.R(p,()=>{if(l()[0])u||(cn(r,this.r,s,a),u=!0),m.forEach(C=>{C.unmount(),C.isMounted=!1});else{Te(i,a),u=!1;let C=!1;for(let v of m)!C&&v.isTrue()?(v.isMounted||(v.mount(),v.isMounted=!0),C=!0):(v.unmount(),v.isMounted=!1)}})},m=this.be(o,h),d=Tt;q(i,()=>{c.stop(),d(),d=Tt}),h(),d=c.subscribe(h)}};var Fe=t=>{let e=fe(t)?t.content.childNodes:[t],n=[];for(let o=0;o<e.length;++o){let r=e[o];if(r.nodeType===1){let s=r?.tagName;if(s==="SCRIPT"||s==="STYLE")continue}n.push(r)}return n},Ne=(t,e)=>{for(let n=0;n<e.length;++n){let o=e[n];o.nodeType===Node.ELEMENT_NODE&&(Qn(o)||t.$(o))}},Et=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},fe=t=>t instanceof HTMLTemplateElement,xe=t=>t.nodeType===Node.ELEMENT_NODE,nt=t=>t.nodeType===Node.ELEMENT_NODE,Xn=t=>t instanceof HTMLSlotElement,Ce=t=>fe(t)?t.content.childNodes:t.childNodes,Te=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let o=n.nextSibling;z(n),n=o}},Yn=function(){return this()},Ar=function(t){return this(t)},Nr=()=>{throw new Error("value is readonly.")},Or={get:Yn,set:Ar,enumerable:!0,configurable:!1},kr={get:Yn,set:Nr,enumerable:!0,configurable:!1},Oe=(t,e)=>{Object.defineProperty(t,"value",e?kr:Or)},Zn=(t,e)=>{if(!t)return!1;if(t.startsWith("["))return t.substring(1,t.length-1);let n=e.length;return t.startsWith(e)?t.substring(n,t.length-n):!1},Rt=t=>`[${CSS.escape(t)}]`,vt=(t,e)=>(t.startsWith("@")&&(t=e.p.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.p.dynamic)),t),ln=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Mr=/-(\w)/g,U=ln(t=>t&&t.replace(Mr,(e,n)=>n?n.toUpperCase():"")),Lr=/\B([A-Z])/g,qe=ln(t=>t&&t.replace(Lr,"-$1").toLowerCase()),ot=ln(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var wt={mount:()=>{}};var ze=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var St=t=>{dt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var fn=Symbol("scope"),pn=t=>{try{Fn();let e=t();nn(e);let n={context:e,unmount:()=>Ae(e),[fn]:1};return n[fn]=1,n}finally{qn()}},eo=t=>N(t)?fn in t:!1;var mn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(N(o))for(let r of Object.entries(o)){let s=r[0],i=r[1],a=n[s];a!==i&&(T(a)?a(i):n[s]=i)}}})};var te=(t,e)=>{Me(e)?.onUnmounted.push(t)};var re=(t,e,n,o=!0)=>{if(!T(t))throw P(3,"observe");n&&e(t());let s=t(void 0,void 0,0,e);return o&&te(s,!0),s};var rt=(t,e)=>{if(t===e)return()=>{};let n=re(t,r=>e(r)),o=re(e,r=>t(r));return e(t()),()=>{n(),o()}};var st=t=>!!t&&t[yt]===1;var Ke=t=>t?.[ht]===1;var pe=[],to=t=>{pe.length!==0&&pe[pe.length-1]?.add(t)},We=t=>{if(!t)return()=>{};let e={stop:()=>{}};return Vr(t,e),te(()=>e.stop(),!0),e.stop},Vr=(t,e)=>{if(!t)return;let n=[],o=!1,r=()=>{for(let s of n)s();n=[],o=!0};e.stop=r;try{let s=new Set;if(pe.push(s),t(i=>n.push(i)),o)return;for(let i of[...s]){let a=re(i,()=>{r(),We(t)});n.push(a)}}finally{pe.pop()}},dn=t=>{let e=pe.length,n=e>0&&pe[e-1];try{return n&&pe.push(null),t()}finally{n&&pe.pop()}},hn=t=>{try{let e=new Set;return pe.push(e),{value:t(),refs:[...e]}}finally{pe.pop()}};var Q=(t,e,n)=>{if(!T(t))return;let o=t;if(o(void 0,e,1),!n)return;let r=o();if(r){if(E(r)||ce(r))for(let s of r)Q(s,e,!0);else if(Se(r))for(let s of r)Q(s[0],e,!0),Q(s[1],e,!0);if(N(r))for(let s in r)Q(r[s],e,!0)}};function Ir(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Ge=(t,e,n)=>{n.forEach(function(o){let r=t[o];Ir(e,o,function(...i){let a=r.apply(this,i),c=this[J];for(let l of c)Q(l);return a})})},At=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var no=Array.prototype,yn=Object.create(no),Dr=["push","pop","shift","unshift","splice","sort","reverse"];Ge(no,yn,Dr);var oo=Map.prototype,Nt=Object.create(oo),Pr=["set","clear","delete"];At(Nt,"Map");Ge(oo,Nt,Pr);var ro=Set.prototype,Ot=Object.create(ro),Ur=["add","clear","delete"];At(Ot,"Set");Ge(ro,Ot,Ur);var ye={},ie=t=>{if(T(t)||st(t))return t;let e={auto:!0,_value:t},n=c=>N(c)?J in c?!0:E(c)?(Object.setPrototypeOf(c,yn),!0):ce(c)?(Object.setPrototypeOf(c,Ot),!0):Se(c)?(Object.setPrototypeOf(c,Nt),!0):!1:!1,o=n(t),r=new Set,s=(c,l)=>{if(ye.stack&&ye.stack.length){ye.stack[ye.stack.length-1].add(a);return}r.size!==0&&dn(()=>{for(let u of[...r.keys()])r.has(u)&&u(c,l)})},i=c=>{let l=c[J];l||(c[J]=l=new Set),l.add(a)},a=(...c)=>{if(!(2 in c)){let u=c[0],f=c[1];return 0 in c?e._value===u||T(u)&&(u=u(),e._value===u)?u:(n(u)&&i(u),e._value=u,e.auto&&s(u,f),e._value):(to(a),e._value)}switch(c[2]){case 0:{let u=c[3];if(!u)return()=>{};let f=p=>{r.delete(p)};return r.add(u),()=>{f(u)}}case 1:{let u=c[1],f=e._value;s(f,u);break}case 2:return r.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return a[J]=1,Oe(a,!1),o&&i(t),a};var Ee=t=>{if(st(t))return t;let e;if(T(t)?(e=t,t=e()):e=ie(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[ht]=1,E(t)){let n=t.length;for(let o=0;o<n;++o){let r=t[o];Ke(r)||(t[o]=Ee(r))}return e}if(!N(t))return e;for(let n of Object.entries(t)){let o=n[1];if(Ke(o))continue;let r=n[0];Ze(r)||(t[r]=null,t[r]=Ee(o))}return e};var so=Symbol("modelBridge"),kt=()=>{},Hr=t=>!!t?.[so],Br=t=>{t[so]=1},jr=t=>{let e=Ee(t());return Br(e),e},io={collectRefObj:!0,mount:({parseResult:t,option:e})=>{if(typeof e!="string"||!e)return kt;let n=U(e),o,r,s=kt,i=()=>{s(),s=kt,o=void 0,r=void 0},a=()=>{s(),s=kt},c=(u,f)=>{o!==u&&(a(),s=rt(u,f),o=u)},l=()=>{let u=t.refs[0]??t.value()[0],f=t.context,p=f[n];if(!T(u)){if(r&&p===r){r(u);return}if(i(),T(p)){p(u);return}f[n]=u;return}if(Hr(u)){if(p===u)return;T(p)?c(u,p):f[n]=u;return}r||(r=jr(u)),f[n]=r,c(u,r)};return{update:()=>{l()},unmount:()=>{s()}}}};var Mt=class{r;xe;Te="";Ee=-1;constructor(e){this.r=e,this.xe=e.o.p.inherit}k(e){this.rt(e)}st(e){if(this.Ee!==e.size){let n=[...e.keys()];this.Te=[...n,...n.map(qe)].join(","),this.Ee=e.size}return this.Te}it(e){for(let n=0;n<e.length;++n){let o=e[n]?.components;if(o)for(let r in o)return!0}return!1}at(e){if(!fe(e))return!1;let n=e.getAttributeNames();return e.hasAttribute("name")?!0:n.some(o=>o.startsWith("#"))}ct(e){return fe(e)&&e.getAttributeNames().length===0}rt(e){let n=this.r,o=n.m,r=n.o.Z,s=n.o._;if(r.size===0&&!this.it(o.l))return;let i=o.ee(),a=this.Re();if(B(a))return;let c=this.pt(e,a);for(let l of c){if(l.hasAttribute(n.E))continue;let u=l.parentNode;if(!u)continue;let f=l.nextSibling,p=U(l.tagName).toUpperCase(),m=i[p]??s.get(p);if(!m)continue;let d=m.template;if(!d)continue;let g=l.parentElement;if(!g)continue;let C=new Comment(" begin component: "+l.tagName),v=new Comment(" end component: "+l.tagName);g.insertBefore(C,l),l.remove();let j=n.o.p.context,K=n.o.p.contextAlias,I=n.o.p.bind,ne=(y,A)=>{let R={},$=y.hasAttribute(j);return o.R(A,()=>{o.v(R),$?n.y(mn,y,j):y.hasAttribute(K)&&n.y(mn,y,K);let b=m.props;if(!b||b.length===0)return;b=b.map(U);let w=new Map(b.map(G=>[G.toLowerCase(),G]));for(let G of[...b,...b.map(qe)]){let ue=y.getAttribute(G);ue!==null&&(R[U(G)]=ue,y.removeAttribute(G))}let M=n.F.Ce(y,!1);for(let[G,ue]of M.entries()){let[ge,V]=ue.te;if(!V)continue;let ee=w.get(U(V).toLowerCase());ee&&(ge!=="."&&ge!==":"&&ge!==I||n.y(io,y,G,!0,ee,ue.ne))}}),R},X=[...o.L()],O=()=>{let y=ne(l,X),A=new et(y,l,X,C,v,n.o.propValidationMode),R=pn(()=>m.context(A)??{}).context;if(A.autoProps){for(let[$,b]of Object.entries(y))if($ in R){let w=R[$];if(w===b)continue;if(T(w)){T(b)?A.entangle?q(C,rt(b,w)):w(b()):w(b);continue}}else R[$]=b;A.onAutoPropsAssigned?.()}return{componentCtx:R,head:A}},{componentCtx:oe,head:x}=O(),S=[...Ce(d)],Y=S.length,Ue=l.childNodes.length===0,He=y=>{let A=y.parentElement,R=y.name;if(B(R)&&(R=y.getAttributeNames().filter(w=>w.startsWith("#"))[0],B(R)?R="default":R=R.substring(1)),Ue){if(R==="default"){let w=n.o.p.text,M=l.getAttribute(w);if(!B(M)){let G=document.createElement("span");G.setAttribute(w,M),A.insertBefore(G,y),l.removeAttribute(w);return}}for(let w of[...y.childNodes])A.insertBefore(w,y);return}let $=l.querySelector(`template[name='${R}'], template[\\#${R}]`);!$&&R==="default"&&($=[...l.querySelectorAll("template:not([name])")].find(M=>this.ct(M))??null);let b=w=>{x.enableSwitch&&o.R(X,()=>{o.v(oe);let M=ne(y,o.L());o.R(X,()=>{o.v(M);let G=o.L(),ue=Wn(G);for(let ge of w)xe(ge)&&(ge.setAttribute(tt,ue),rn(ue),q(ge,()=>{sn(ue)}))})})};if($){let w=[...Ce($)];for(let M of w)A.insertBefore(M,y);b(w)}else{if(R!=="default"){for(let M of[...Ce(y)])A.insertBefore(M,y);return}let w=[...Ce(l)].filter(M=>!this.at(M));for(let M of w)A.insertBefore(M,y);b(w)}},Xt=y=>{if(!xe(y))return;let A=y.querySelectorAll("slot");if(Xn(y)){He(y),y.remove();return}for(let R of A)He(R),R.remove()};(()=>{for(let y=0;y<Y;++y)S[y]=S[y].cloneNode(!0),u.insertBefore(S[y],f),Xt(S[y])})(),g.insertBefore(v,f);let k=()=>{if(!m.inheritAttrs)return;let y=S.filter(R=>R.nodeType===Node.ELEMENT_NODE);y.length>1&&(y=y.filter(R=>R.hasAttribute(this.xe)));let A=y[0];if(A)for(let R of l.getAttributeNames()){if(R===j||R===K)continue;let $=l.getAttribute(R);if(R==="class"){let b=ze($);b.length>0&&A.classList.add(...b)}else if(R==="style"){let b=A.style,w=l.style;for(let M of w)b.setProperty(M,w.getPropertyValue(M))}else A.setAttribute(vt(R,n.o),$)}},W=()=>{for(let y of l.getAttributeNames())!y.startsWith("@")&&!y.startsWith(n.o.p.on)&&l.removeAttribute(y)},Z=()=>{k(),W(),o.v(oe),n.ve(l,!1),oe.$emit=x.emit,Ne(n,S),q(l,()=>{Ae(oe)}),q(C,()=>{be(l)}),St(oe)};o.R(X,Z)}}Re(){let e=this.r,n=e.m,o=e.o.Z,r=n.ut(),s=this.st(o);return[...s?[s]:[],...r,...r.map(qe)].join(",")}pt(e,n){let o=[];if(B(n))return o;if(e.matches?.(n))return[e];let r=this.q(e).reverse();for(;r.length>0;){let s=r.pop();if(s.matches(n)){o.push(s);continue}r.push(...this.q(s).reverse())}return o}j(e,n){let o=this.Re(),r=this.q(e).reverse();for(;r.length>0;){let s=r.pop();n(s),!(!B(o)&&s.matches(o))&&r.push(...this.q(s).reverse())}}q(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let i=n[s];xe(i)&&r.push(i)}return r}let o=e?.childNodes;if(o?.length!=null){let r=[];for(let s=0;s<o.length;++s){let i=o[s];xe(i)&&r.push(i)}return r}return[]}};var gn=class{te;ne;we=[];constructor(e,n){this.te=e,this.ne=n}},Lt=class{r;Se;Ae;oe;constructor(e){this.r=e,this.Se=e.o.lt(),this.oe=new Map;let n=new Map;for(let o of this.Se){let r=o[0]??"",s=n.get(r);s?s.push(o):n.set(r,[o])}this.Ae=n}ke(e){let n=this.oe.get(e);if(n)return n;let o=e,r=o.startsWith(".");r&&(o=":"+o.slice(1));let s=o.indexOf("."),a=(s<0?o:o.substring(0,s)).split(/[:@]/);B(a[0])&&(a[0]=r?".":o[0]);let c=s>=0?o.slice(s+1).split("."):[],l=!1,u=!1;for(let p=0;p<c.length;++p){let h=c[p];if(!l&&h==="camel"?l=!0:!u&&h==="prop"&&(u=!0),l&&u)break}l&&(a[a.length-1]=U(a[a.length-1])),u&&(a[0]=".");let f={terms:a,flags:c};return this.oe.set(e,f),f}Ce(e,n){let o=new Map;if(!nt(e))return o;let r=this.Ae,s=(a,c)=>{let l=r.get(c[0]??"");if(l)for(let u=0;u<l.length;++u){if(!c.startsWith(l[u]))continue;let f=o.get(c);if(!f){let p=this.ke(c);f=new gn(p.terms,p.flags),o.set(c,f)}f.we.push(a);return}},i=a=>{let c=a.attributes;if(!(!c||c.length===0))for(let l=0;l<c.length;++l){let u=c.item(l)?.name;u&&s(a,u)}};return i(e),!n||!e.firstElementChild||this.r.V.j(e,i),o}};var ao=()=>{},$r=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},Vt=class{r;I;constructor(e){this.r=e,this.I=e.o.p.is}k(e){let n=e.hasAttribute(this.I);return(n||e.hasAttribute("is"))&&this.y(e),this.r.V.j(e,o=>{(o.hasAttribute(this.I)||o.hasAttribute("is"))&&this.y(o)}),n}y(e){let n=e.getAttribute(this.I);if(!n){if(n=e.getAttribute("is"),!n)return;if(!n.startsWith("regor:")){if(!n.startsWith("r-"))return;let o=n.slice(2).trim().toLowerCase();if(!o)return;let r=e.parentNode;if(!r)return;let s=document.createElement(o);for(let i of e.getAttributeNames())i!=="is"&&s.setAttribute(i,e.getAttribute(i));for(;e.firstChild;)s.appendChild(e.firstChild);r.insertBefore(s,e),e.remove(),this.r.$(s);return}n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.I),this.O(e,n)}U(e,n){let o=Fe(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),_e(s,o),o.forEach(a=>{z(a)}),e.remove();let i=document.createComment(`__end__ dynamic ${n??""}`);return r.insertBefore(i,s.nextSibling),{nodes:o,parent:r,commentBegin:s,commentEnd:i}}O(e,n){let{nodes:o,parent:r,commentBegin:s,commentEnd:i}=this.U(e,` => ${n} `),a=this.r.m.M(n),c=a.value,l=this.r.m,u=l.L(),f={name:""},p=fe(e)?o:[...o[0].childNodes],h=()=>{l.R(u,()=>{let g=c()[0];if(N(g)&&(g.name?g=g.name:g=Object.entries(l.ee()).filter(v=>v[1]===g)[0]?.[0]),!F(g)||B(g)){Te(s,i);return}if(f.name===g)return;Te(s,i);let C=document.createElement(g);for(let v of e.getAttributeNames())v!==this.I&&C.setAttribute(v,e.getAttribute(v));$r(p,C),r.insertBefore(C,i),this.r.$(C),f.name=g})},m=ao;q(s,()=>{a.stop(),m(),m=ao}),h(),m=a.subscribe(h)}};var H=t=>{let e=t;return e!=null&&e[J]===1?e():e};var _r=(t,e)=>{let[n,o]=e;_(o)?o(t,n):t.innerHTML=n?.toString()},It={mount:()=>({update:({el:t,values:e})=>{_r(t,e)}})};var Dt=class t{re;constructor(e){this.re=e}static ft(e,n){let o=e.m,r=e.o,s=r.p,i=new Set([s.for,s.if,s.else,s.elseif,s.pre]),a=r.B,c=o.ee();if(Object.keys(c).length>0||r._.size>0)return;let l=e.F,u=[],f=0,p=[];for(let h=n.length-1;h>=0;--h)p.push(n[h]);for(;p.length>0;){let h=p.pop();if(h.nodeType===Node.ELEMENT_NODE){let d=h;if(d.tagName==="TEMPLATE"||d.tagName.includes("-"))return;let g=U(d.tagName).toUpperCase();if(r._.has(g)||c[g])return;let C=d.attributes;for(let v=0;v<C.length;++v){let j=C.item(v)?.name;if(!j)continue;if(i.has(j))return;let{terms:K,flags:I}=l.ke(j),[ne,X]=K,O=a[j]??a[ne];if(O){if(O===It)return;u.push({nodeIndex:f,attrName:j,directive:O,option:X,flags:I})}}++f}let m=h.childNodes;for(let d=m.length-1;d>=0;--d)p.push(m[d])}if(u.length!==0)return new t(u)}y(e,n){let o=[],r=[];for(let s=n.length-1;s>=0;--s)r.push(n[s]);for(;r.length>0;){let s=r.pop();s.nodeType===Node.ELEMENT_NODE&&o.push(s);let i=s.childNodes;for(let a=i.length-1;a>=0;--a)r.push(i[a])}for(let s=0;s<this.re.length;++s){let i=this.re[s],a=o[i.nodeIndex];a&&e.y(i.directive,a,i.attrName,!1,i.option,i.flags)}}};var Fr=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},qr=t=>{let e=t.length,n=t.slice(),o=[],r,s,i;for(let a=0;a<e;++a){let c=t[a];if(c===0)continue;let l=o[o.length-1];if(l===void 0||t[l]<c){n[a]=l??-1,o.push(a);continue}for(r=0,s=o.length-1;r<s;)i=r+s>>1,t[o[i]]<c?r=i+1:s=i;c<t[o[r]]&&(r>0&&(n[a]=o[r-1]),o[r]=a)}for(r=o.length,s=o[r-1]??-1;r-- >0;)o[r]=s,s=n[s];return o},Pt=class{static dt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:i,removeMountItem:a,endAnchor:c}=e,l=n.length,u=o.length,f=new Array(u),p=new Set;for(let x=0;x<u;++x){let S=r(o[x]);if(S===void 0||p.has(S))return;p.add(S),f[x]=S}let h=new Array(u),m=0,d=l-1,g=u-1;for(;m<=d&&m<=g;){let x=n[m];if(r(x.value)!==f[m]||!s(x.value,o[m]))break;x.value=o[m],h[m]=x,++m}for(;m<=d&&m<=g;){let x=n[d];if(r(x.value)!==f[g]||!s(x.value,o[g]))break;x.value=o[g],h[g]=x,--d,--g}if(m>d){for(let x=g;x>=m;--x){let S=x+1<u?h[x+1].items[0]:c;h[x]=i(x,o[x],S)}return h}if(m>g){for(let x=m;x<=d;++x)a(n[x]);return h}let C=m,v=m,j=g-v+1,K=new Array(j).fill(0),I=new Map;for(let x=v;x<=g;++x)I.set(f[x],x);let ne=!1,X=0;for(let x=C;x<=d;++x){let S=n[x],Y=I.get(r(S.value));if(Y===void 0){a(S);continue}if(!s(S.value,o[Y])){a(S);continue}S.value=o[Y],h[Y]=S,K[Y-v]=x+1,Y>=X?X=Y:ne=!0}let O=ne?qr(K):[],oe=O.length-1;for(let x=j-1;x>=0;--x){let S=v+x,Y=S+1<u?h[S+1].items[0]:c;if(K[x]===0){h[S]=i(S,o[S],Y);continue}let Ue=h[S];ne&&(oe>=0&&O[oe]===x?--oe:Ue&&Fr(Ue,Y))}return h}};var it=class{T=[];P=new Map;get w(){return this.T.length}se;constructor(e){this.se=e}ie(e){let n=this.se(e.value);n!==void 0&&this.P.set(n,e)}ae(e){let n=this.se(this.T[e]?.value);n!==void 0&&this.P.delete(n)}static mt(e,n){return{items:[],index:e,value:n,order:-1}}v(e){e.order=this.w,this.T.push(e),this.ie(e)}yt(e,n){let o=this.w;for(let r=e;r<o;++r)this.T[r].order=r+1;n.order=e,this.T.splice(e,0,n),this.ie(n)}D(e){return this.T[e]}ce(e,n){this.ae(e),this.T[e]=n,this.ie(n),n.order=e}Ne(e){this.ae(e),this.T.splice(e,1);let n=this.w;for(let o=e;o<n;++o)this.T[o].order=o}Ve(e){let n=this.w;for(let o=e;o<n;++o)this.ae(o);this.T.splice(e)}en(e){return this.P.has(e)}ht(e){return this.P.get(e)?.order??-1}};var bn=Symbol("r-for"),zr=t=>-1,co=()=>{},Ut=class t{r;x;Oe;E;constructor(e){this.r=e,this.x=e.o.p.for,this.Oe=Rt(this.x),this.E=e.o.p.pre}k(e){let n=e.hasAttribute(this.x);return n&&this.Me(e),this.r.V.j(e,o=>{o.hasAttribute(this.x)&&this.Me(o)}),n}Y(e){return e[bn]?!0:(e[bn]=!0,Et(e,this.Oe).forEach(n=>n[bn]=!0),!1)}Me(e){if(e.hasAttribute(this.E)||this.Y(e))return;let n=e.getAttribute(this.x);if(!n){D(0,this.x,e);return}e.removeAttribute(this.x),this.gt(e,n)}Le(e){return le(e)?[]:(_(e)&&(e=e()),Symbol.iterator in Object(e)?e:typeof e=="number"?(o=>({*[Symbol.iterator](){for(let r=1;r<=o;r++)yield r}}))(e):Object.entries(e))}gt(e,n){let o=this.bt(n);if(!o?.list){D(1,this.x,n,e);return}let r=this.r.o.p.key,s=this.r.o.p.keyBind,i=e.getAttribute(r)??e.getAttribute(s);e.removeAttribute(r),e.removeAttribute(s);let a=Fe(e),c=Dt.ft(this.r,a),l=e.parentNode;if(!l)return;let u=`${this.x} => ${n}`,f=new Comment(`__begin__ ${u}`);l.insertBefore(f,e),_e(f,a),a.forEach(k=>{z(k)}),e.remove();let p=new Comment(`__end__ ${u}`);l.insertBefore(p,f.nextSibling);let h=this.r,m=h.m,d=m.L(),C=d.length===1?[void 0,d[0]]:void 0,v=this.xt(i),j=(k,W)=>v(k)===v(W),K=(k,W)=>k===W,I=(k,W,Z)=>{let y=o.createContext(W,k),A=it.mt(y.index,W),R=()=>{let $=p.parentNode??f.parentNode??l,b=Z.previousSibling,w=[];for(let M=0;M<a.length;++M){let G=a[M].cloneNode(!0);$.insertBefore(G,Z),w.push(G)}for(c?c.y(h,w):Ne(h,w),b=b.nextSibling;b!==Z;)A.items.push(b),b=b.nextSibling};return C?(C[0]=y.ctx,m.R(C,R)):m.R(d,()=>{m.v(y.ctx),R()}),A},ne=(k,W)=>{let Z=L.D(k).items,y=Z[Z.length-1].nextSibling;for(let A of Z)z(A);L.ce(k,I(k,W,y))},X=(k,W)=>{L.v(I(k,W,p))},O=k=>{for(let W of L.D(k).items)z(W)},oe=k=>{let W=L.w;for(let Z=k;Z<W;++Z)L.D(Z).index(Z)},x=k=>{let W=f.parentNode,Z=p.parentNode;if(!W||!Z)return;let y=L.w;_(k)&&(k=k());let A=H(k[0]);if(E(A)&&A.length===0){Te(f,p),L.Ve(0);return}let R=[];for(let V of this.Le(k[0]))R.push(V);let $=Pt.dt({oldItems:L.T,newValues:R,getKey:v,isSameValue:K,mountNewValue:(V,ee,ke)=>I(V,ee,ke),removeMountItem:V=>{for(let ee=0;ee<V.items.length;++ee)z(V.items[ee])},endAnchor:p});if($){L.T=$,L.P.clear();for(let V=0;V<$.length;++V){let ee=$[V];ee.order=V,ee.index(V);let ke=v(ee.value);ke!==void 0&&L.P.set(ke,ee)}return}let b=0,w=Number.MAX_SAFE_INTEGER,M=y,G=this.r.o.forGrowThreshold,ue=()=>L.w<M+G;for(let V of R){let ee=()=>{if(b<y){let ke=L.D(b++);if(j(ke.value,V)){if(K(ke.value,V))return;ne(b-1,V);return}let lt=L.ht(v(V));if(lt>=b&&lt-b<10){if(--b,w=Math.min(w,b),O(b),L.Ne(b),--y,lt>b+1)for(let Yt=b;Yt<lt-1&&Yt<y&&!j(L.D(b).value,V);)++Yt,O(b),L.Ne(b),--y;ee();return}ue()?(L.yt(b-1,I(b,V,L.D(b-1).items[0])),w=Math.min(w,b-1),++y):ne(b-1,V)}else X(b++,V)};ee()}let ge=b;for(y=L.w;b<y;)O(b++);L.Ve(ge),oe(w)},S=()=>{Y.stop(),He(),He=co},Y=m.M(o.list),Ue=Y.value,He=co,Xt=0,L=new it(v);for(let k of this.Le(Ue()[0]))L.v(I(Xt++,k,p));q(f,S),He=Y.subscribe(x)}static Tt=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;bt(e){let n=t.Tt.exec(e);if(!n)return;let o=(n[1]+(n[2]??"")).split(",").map(c=>c.trim()),r=o.length>1?o.length-1:-1,s=r!==-1&&(o[r]==="index"||o[r]?.startsWith("#"))?o[r]:"";s&&o.splice(r,1);let i=n[3];if(!i||o.length===0)return;let a=/[{[]/.test(e);return{list:i,createContext:(c,l)=>{let u={},f=H(c);if(!a&&o.length===1)u[o[0]]=c;else if(E(f)){let h=0;for(let m of o)u[m]=f[h++]}else for(let h of o)u[h]=f[h];let p={ctx:u,index:zr};return s&&(p.index=u[s.startsWith("#")?s.substring(1):s]=ie(l)),p}}}xt(e){if(!e)return o=>o;let n=e.trim();if(!n)return o=>o;if(n.includes(".")){let o=this.Et(n),r=o.length>1?o.slice(1):void 0;return s=>{let i=H(s),a=this.Ie(i,o);return a!==void 0||!r?a:this.Ie(i,r)}}return o=>H(H(o)?.[n])}Et(e){return e.split(".").filter(n=>n.length>0)}Ie(e,n){let o=e;for(let r of n)o=H(o)?.[r];return H(o)}};var Ht=class{pe=0;ue=new Map;m;Pe;De;Ue;V;F;o;E;Be;constructor(e){this.m=e,this.o=e.o,this.De=new Ut(this),this.Pe=new Ct(this),this.Ue=new Vt(this),this.V=new Mt(this),this.F=new Lt(this),this.E=this.o.p.pre,this.Be=this.o.p.dynamic}Rt(e){let n=fe(e)?[e]:e.querySelectorAll("template");for(let o of n){if(o.hasAttribute(this.E))continue;let r=o.parentNode;if(!r)continue;let s=o.nextSibling;if(o.remove(),!o.content)continue;let i=[...o.content.childNodes];for(let a of i)r.insertBefore(a,s);Ne(this,i)}}$(e){++this.pe;try{if(e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.E)||this.Pe.k(e)||this.De.k(e)||this.Ue.k(e))return;this.V.k(e),this.Rt(e),this.ve(e,!0)}finally{--this.pe,this.pe===0&&this.Ct()}}vt(e,n){let o=document;if(!o){let r=e.parentNode;for(;r?.parentNode;)r=r.parentNode;if(!r)return null;o=r}return o.querySelector(n)}He(e,n){let o=this.vt(e,n);if(!o)return!1;let r=e.parentElement;if(!r)return!1;let s=new Comment(`teleported => '${n}'`);return r.insertBefore(s,e),e.teleportedFrom=s,s.teleportedTo=e,q(s,()=>{z(e)}),o.appendChild(e),!0}wt(e,n){this.ue.set(e,n)}Ct(){let e=this.ue;if(e.size!==0){this.ue=new Map;for(let[n,o]of e.entries())this.He(n,o)}}ve(e,n){let o=this.F.Ce(e,n),r=this.o.B;for(let[s,i]of o.entries()){let[a,c]=i.te,l=r[s]??r[a];if(!l){console.error("directive not found:",a);continue}let u=i.we;for(let f=0;f<u.length;++f){let p=u[f];this.y(l,p,s,!1,c,i.ne)}}}y(e,n,o,r,s,i){if(n.hasAttribute(this.E))return;let a=n.getAttribute(o);n.removeAttribute(o);let c=l=>{let u=l;for(;u;){let f=u.getAttribute(tt);if(f)return f;u=u.parentElement}return null};if(an()){let l=c(n);if(l){this.m.R(Gn(l),()=>{this.O(e,n,a,s,i)});return}}this.O(e,n,a,s,i)}St(e,n,o){return e!==wt?!1:(B(o)||this.He(n,o)||this.wt(n,o),!0)}O(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.St(e,n,o))return;let i=this.At(r,e.once),a=this.kt(e,o),c=this.Nt(a,i);q(n,c.stop);let l=this.Vt(n,o,a,i,r,s),u=this.Ot(e,l,c);if(!u)return;let f=this.Mt(l,a,i,r,u);f(),e.once||(c.result=a.subscribe(f),i&&(c.dynamic=i.subscribe(f)))}At(e,n){let o=Zn(e,this.Be);if(o)return this.m.M(U(o),void 0,void 0,void 0,n)}kt(e,n){return this.m.M(n,e.isLazy,e.isLazyKey,e.collectRefObj,e.once)}Nt(e,n){let o={stop:()=>{e.stop(),n?.stop(),o.result?.(),o.dynamic?.(),o.mounted?.(),o.result=void 0,o.dynamic=void 0,o.mounted=void 0}};return o}Vt(e,n,o,r,s,i){return{el:e,expr:n,values:o.value(),previousValues:void 0,option:r?r.value()[0]:s,previousOption:void 0,flags:i,parseResult:o,dynamicOption:r}}Ot(e,n,o){let r=e.mount(n);if(typeof r=="function"){o.mounted=r;return}return r?.unmount&&(o.mounted=r.unmount),r?.update}Mt(e,n,o,r,s){let i,a;return()=>{let c=n.value(),l=o?o.value()[0]:r;e.values=c,e.previousValues=i,e.option=l,e.previousOption=a,i=c,a=l,s(e)}}};var uo="http://www.w3.org/1999/xlink",Kr={itemscope:2,allowfullscreen:2,formnovalidate:2,ismap:2,nomodule:2,novalidate:2,readonly:2,async:1,autofocus:1,autoplay:1,controls:1,default:1,defer:1,disabled:1,hidden:1,inert:1,loop:1,open:1,required:1,reversed:1,scoped:1,seamless:1,checked:1,muted:1,multiple:1,selected:1};function Wr(t){return!!t||t===""}var Gr=(t,e,n,o,r,s)=>{if(o){s&&s.includes("camel")&&(o=U(o)),Bt(t,o,e[0],r);return}let i=e.length;for(let a=0;a<i;++a){let c=e[a];if(E(c)){let l=n?.[a]?.[0],u=c[0],f=c[1];Bt(t,u,f,l)}else if(N(c))for(let l of Object.entries(c)){let u=l[0],f=l[1],p=n?.[a],h=p&&u in p?u:void 0;Bt(t,u,f,h)}else{let l=n?.[a],u=e[a++],f=e[a];Bt(t,u,f,l)}}},xn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{Gr(t,e,n,o,r,s)}})},Bt=(t,e,n,o)=>{if(o&&o!==e&&t.removeAttribute(o),le(e)){D(3,"r-bind",t);return}if(!F(e)){D(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){le(n)?t.removeAttributeNS(uo,e.slice(6,e.length)):t.setAttributeNS(uo,e,n);return}let r=e in Kr;le(n)||r&&!Wr(n)?t.removeAttribute(e):t.setAttribute(e,r?"":n)};var Jr=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],i=n?.[r];if(E(s)){let a=s.length;for(let c=0;c<a;++c)lo(t,s[c],i?.[c])}else lo(t,s,i)}},Tn={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Jr(t,e,n)}})},lo=(t,e,n)=>{let o=t.classList,r=F(e),s=F(n);if(e&&!r){if(n&&!s)for(let i in n)(!(i in e)||!e[i])&&o.remove(i);for(let i in e)e[i]&&o.add(i)}else if(r){if(n!==e){let i=s?ze(n):[],a=ze(e);i.length>0&&o.remove(...i),a.length>0&&o.add(...a)}}else if(n){let i=s?ze(n):[];i.length>0&&o.remove(...i)}};function Qr(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Re(t[o],e[o]);return n}function Re(t,e){if(t===e)return!0;let n=en(t),o=en(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=Ze(t),o=Ze(e),n||o)return t===e;if(n=E(t),o=E(e),n||o)return n&&o?Qr(t,e):!1;if(n=N(t),o=N(e),n||o){if(!n||!o)return!1;let r=Object.keys(t).length,s=Object.keys(e).length;if(r!==s)return!1;for(let i in t){let a=Object.prototype.hasOwnProperty.call(t,i),c=Object.prototype.hasOwnProperty.call(e,i);if(a&&!c||!Re(t[i],e[i]))return!1}return!0}return String(t)===String(e)}function jt(t,e){return t.findIndex(n=>Re(n,e))}var fo=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var Cn=t=>{if(!T(t))throw P(3,"pause");t(void 0,void 0,3)};var En=t=>{if(!T(t))throw P(3,"resume");t(void 0,void 0,4)};var mo={mount:({el:t,parseResult:e,flags:n})=>({update:({values:o})=>{Xr(t,o[0])},unmount:Yr(t,e,n)})},Xr=(t,e)=>{let n=bo(t);if(n&&ho(t))E(e)?e=jt(e,ve(t))>-1:ce(e)?e=e.has(ve(t)):e=rs(t,e),t.checked=e;else if(n&&yo(t))t.checked=Re(e,ve(t));else if(n||xo(t))go(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(To(t)){let o=t.options,r=o.length,s=t.multiple;for(let i=0;i<r;i++){let a=o[i],c=ve(a);if(s)E(e)?a.selected=jt(e,c)>-1:a.selected=e.has(c);else if(Re(ve(a),e)){t.selectedIndex!==i&&(t.selectedIndex=i);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else D(7,t)},at=t=>(T(t)&&(t=t()),_(t)&&(t=t()),t?F(t)?{trim:t.includes("trim"),lazy:t.includes("lazy"),number:t.includes("number"),int:t.includes("int")}:{trim:!!t.trim,lazy:!!t.lazy,number:!!t.number,int:!!t.int}:{trim:!1,lazy:!1,number:!1,int:!1}),ho=t=>t.type==="checkbox",yo=t=>t.type==="radio",go=t=>t.type==="number"||t.type==="range",bo=t=>t.tagName==="INPUT",xo=t=>t.tagName==="TEXTAREA",To=t=>t.tagName==="SELECT",Yr=(t,e,n)=>{let o=e.value,r=at(n?.join(",")),s=at(o()[1]),i={int:r.int||s.int,lazy:r.lazy||s.lazy,number:r.number||s.number,trim:r.trim||s.trim};if(!e.refs[0])return D(8,t),()=>{};let a=()=>e.refs[0],c=bo(t);return c&&ho(t)?es(t,a):c&&yo(t)?ss(t,a):c||xo(t)?Zr(t,i,a,o):To(t)?is(t,a,o):(D(7,t),()=>{})},po=/[.,' ·٫]/,Zr=(t,e,n,o)=>{let s=e.lazy?"change":"input",i=go(t),a=()=>{!e.trim&&!at(o()[1]).trim||(t.value=t.value.trim())},c=p=>{let h=p.target;h.composing=1},l=p=>{let h=p.target;h.composing&&(h.composing=0,h.dispatchEvent(new Event(s)))},u=()=>{t.removeEventListener(s,f),t.removeEventListener("change",a),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",l),t.removeEventListener("change",l)},f=p=>{let h=n();if(!h)return;let m=p.target;if(!m||m.composing)return;let d=m.value,g=at(o()[1]);if(i||g.number||g.int){if(g.int)d=parseInt(d);else{if(po.test(d[d.length-1])&&d.split(po).length===2){if(d+="0",d=parseFloat(d),isNaN(d))d="";else if(h()===d)return}d=parseFloat(d)}isNaN(d)&&(d=""),t.value=d}else g.trim&&(d=d.trim());h(d)};return t.addEventListener(s,f),t.addEventListener("change",a),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",l),t.addEventListener("change",l),u},es=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let i=ve(t),a=t.checked,c=s();if(E(c)){let l=jt(c,i),u=l!==-1;a&&!u?c.push(i):!a&&u&&c.splice(l,1)}else ce(c)?a?c.add(i):c.delete(i):s(os(t,a))};return t.addEventListener(n,r),o},ve=t=>"_value"in t?t._value:t.value,Co="trueValue",ts="falseValue",Eo="true-value",ns="false-value",os=(t,e)=>{let n=e?Co:ts;if(n in t)return t[n];let o=e?Eo:ns;return t.hasAttribute(o)?t.getAttribute(o):e},rs=(t,e)=>{if(Co in t)return Re(e,t.trueValue);let o=Eo;return t.hasAttribute(o)?Re(e,t.getAttribute(o)):Re(e,!0)},ss=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let i=ve(t);s(i)};return t.addEventListener(n,r),o},is=(t,e,n)=>{let o="change",r=()=>{t.removeEventListener(o,s)},s=()=>{let i=e();if(!i)return;let c=at(n()[1]).number,l=Array.prototype.filter.call(t.options,u=>u.selected).map(u=>c?fo(ve(u)):ve(u));if(t.multiple){let u=i();try{if(Cn(i),ce(u)){u.clear();for(let f of l)u.add(f)}else E(u)?(u.splice(0),u.push(...l)):i(l)}finally{En(i),Q(i)}}else i(l[0])};return t.addEventListener(o,s),r};var as=["stop","prevent","capture","self","once","left","right","middle","passive"],cs=t=>{let e={};if(B(t))return;let n=t.split(",");for(let o of as)e[o]=n.includes(o);return e},us=(t,e,n,o,r)=>{if(o){let l=e.value(),u=H(o.value()[0]);return F(u)?Rn(t,U(u),()=>e.value()[0],r?.join(",")??l[1]):()=>{}}else if(n){let l=e.value();return Rn(t,U(n),()=>e.value()[0],r?.join(",")??l[1])}let s=[],i=()=>{s.forEach(l=>l())},a=e.value(),c=a.length;for(let l=0;l<c;++l){let u=a[l];if(_(u)&&(u=u()),N(u))for(let f of Object.entries(u)){let p=f[0],h=()=>{let d=e.value()[l];return _(d)&&(d=d()),d=d[p],_(d)&&(d=d()),d},m=u[p+"_flags"];s.push(Rn(t,p,h,m))}else D(2,"r-on",t)}return i},vn={isLazy:(t,e)=>e===-1&&t%2===0,isLazyKey:(t,e)=>e===0&&!t.endsWith("_flags"),once:!1,collectRefObj:!0,mount:({el:t,parseResult:e,option:n,dynamicOption:o,flags:r})=>us(t,e,n,o,r)},ls=(t,e)=>{if(t.startsWith("keydown")||t.startsWith("keyup")||t.startsWith("keypress")){e??="";let n=[...t.split("."),...e.split(",")];t=n[0];let o=n[1],r=n.includes("ctrl"),s=n.includes("shift"),i=n.includes("alt"),a=n.includes("meta"),c=l=>!(r&&!l.ctrlKey||s&&!l.shiftKey||i&&!l.altKey||a&&!l.metaKey);return o?[t,l=>c(l)?l.key.toUpperCase()===o.toUpperCase():!1]:[t,c]}return[t,n=>!0]},Rn=(t,e,n,o)=>{if(B(e))return D(5,"r-on",t),()=>{};let r=cs(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,i;[e,i]=ls(e,o);let a=u=>{if(!i(u)||!n&&e==="submit"&&r?.prevent)return;let f=n(u);_(f)&&(f=f(u)),_(f)&&f(u)},c=()=>{t.removeEventListener(e,l,s)},l=u=>{if(!r){a(u);return}try{if(r.left&&u.button!==0||r.middle&&u.button!==1||r.right&&u.button!==2||r.self&&u.target!==t)return;r.stop&&u.stopPropagation(),r.prevent&&u.preventDefault(),a(u)}finally{r.once&&c()}};return t.addEventListener(e,l,s),c};var fs=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=U(n)),Je(t,n,e[0]);return}let r=e.length;for(let s=0;s<r;++s){let i=e[s];if(E(i)){let a=i[0],c=i[1];Je(t,a,c)}else if(N(i))for(let a of Object.entries(i)){let c=a[0],l=a[1];Je(t,c,l)}else{let a=e[s++],c=e[s];Je(t,a,c)}}},Ro={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{fs(t,e,n,o)}})};function ps(t){return!!t||t===""}var Je=(t,e,n)=>{if(le(e)){D(3,":prop",t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(be),1),t[e]=n??"";return}let o=t.tagName;if(e==="value"&&o!=="PROGRESS"&&!o.includes("-")){t._value=n;let s=o==="OPTION"?t.getAttribute("value"):t.value,i=n??"";s!==i&&(t.value=i),n==null&&t.removeAttribute(e);return}let r=!1;if(n===""||n==null){let s=typeof t[e];s==="boolean"?n=ps(n):n==null&&s==="string"?(n="",r=!0):s==="number"&&(n=0,r=!0)}try{t[e]=n}catch(s){r||D(4,e,o,n,s)}r&&t.removeAttribute(e)};var vo={once:!0,mount:({el:t,parseResult:e,expr:n})=>{let o=e,r=o.value()[0],s=E(r),i=o.refs[0];return s?r.push(t):i?i?.(t):o.context[n]=t,()=>{if(s){let a=r.indexOf(t);a!==-1&&r.splice(a,1)}else i?.(null)}}};var ms=(t,e)=>{let n=Ve(t).data,o=n._ord;$n(o)&&(o=n._ord=t.style.display),!!e[0]?t.style.display=o:t.style.display="none"},wo={mount:()=>({update:({el:t,values:e})=>{ms(t,e)}})};var ds=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],i=n?.[r];if(E(s)){let a=s.length;for(let c=0;c<a;++c)So(t,s[c],i?.[c])}else So(t,s,i)}},$t={mount:()=>({update:({el:t,values:e,previousValues:n})=>{ds(t,e,n)}})},So=(t,e,n)=>{let o=t.style,r=F(e);if(e&&!r){if(n&&!F(n))for(let s in n)e[s]==null&&Sn(o,s,"");for(let s in e)Sn(o,s,e[s])}else{let s=o.display;if(r?n!==e&&(o.cssText=e):n&&t.removeAttribute("style"),"_ord"in Ve(t).data)return;o.display=s}},Ao=/\s*!important$/;function Sn(t,e,n){if(E(n))n.forEach(o=>{Sn(t,e,o)});else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{let o=hs(t,e);Ao.test(n)?t.setProperty(qe(o),n.replace(Ao,""),"important"):t[o]=n}}var No=["Webkit","Moz","ms"],wn={};function hs(t,e){let n=wn[e];if(n)return n;let o=U(e);if(o!=="filter"&&o in t)return wn[e]=o;o=ot(o);for(let r=0;r<No.length;r++){let s=No[r]+o;if(s in t)return wn[e]=s}return e}var ae=t=>Oo(H(t)),Oo=(t,e=new WeakMap)=>{if(!t||!N(t))return t;if(E(t))return t.map(ae);if(ce(t)){let o=new Set;for(let r of t.keys())o.add(ae(r));return o}if(Se(t)){let o=new Map;for(let r of t)o.set(ae(r[0]),ae(r[1]));return o}if(e.has(t))return H(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Oo(H(o[1]),e);return n};var ys=(t,e)=>{let n=e[0];t.textContent=ce(n)?JSON.stringify(ae([...n])):Se(n)?JSON.stringify(ae([...n])):N(n)?JSON.stringify(ae(n)):n?.toString()??""},ko={mount:()=>({update:({el:t,values:e})=>{ys(t,e)}})};var Mo={mount:()=>({update:({el:t,values:e})=>{Je(t,"value",e[0])}})};var me=class t{static getDefault(){return t.je??(t.je=new t)}B={};p={};lt=()=>Object.keys(this.B).filter(e=>e.length===1||!e.startsWith(":"));Z=new Map;_=new Map;static je;static Lt="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";forGrowThreshold=10;globalContext;useInterpolation=!0;propValidationMode="throw";constructor(e){if(this.setDirectives("r-"),e){this.globalContext=e;return}this.globalContext=this.It()}It(){let e={},n=globalThis;for(let o of t.Lt.split(","))e[o]=n[o];return e.ref=Ee,e.sref=ie,e.flatten=ae,e}addComponent(...e){for(let n of e){if(!n.defaultName){$e.warning("Registered component's default name is not defined",n);continue}this.Z.set(ot(n.defaultName),n),this._.set(ot(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":Ro,":":xn,"@":vn,[`${e}on`]:vn,[`${e}bind`]:xn,[`${e}html`]:It,[`${e}text`]:ko,[`${e}show`]:wo,[`${e}model`]:mo,":style":$t,[`${e}style`]:$t,[`${e}bind:style`]:$t,":class":Tn,[`${e}bind:class`]:Tn,":ref":vo,":value":Mo,[`${e}teleport`]:wt},this.p={for:`${e}for`,if:`${e}if`,else:`${e}else`,elseif:`${e}else-if`,pre:`${e}pre`,inherit:`${e}inherit`,text:`${e}text`,context:":context",contextAlias:`${e}context`,bind:`${e}bind`,on:`${e}on`,keyBind:":key",key:"key",is:":is",teleport:`${e}teleport`,dynamic:"_d_"}}updateDirectives(e){e(this.B,this.p)}};var _t=(t,e)=>{if(!t)return;let o=(e??me.getDefault()).p,r=/(\{\{[^]*?\}\}|\[\[[^]*?\]\])/g,s=[{start:"{{",end:"}}"},{start:"[[",end:"]]"}];for(let i of bs(t,o.pre,s))gs(i,o.text,r,s)},gs=(t,e,n,o)=>{let r=t.textContent;if(!r)return;let s=n,i=r.split(s);if(i.length<=1)return;if(t.parentElement?.childNodes.length===1&&i.length===3){let c=i[1],l=Lo(c,o);if(l&&B(i[0])&&B(i[2])){let u=t.parentElement;u.setAttribute(e,c.substring(l.start.length,c.length-l.end.length)),u.innerText="";return}}let a=document.createDocumentFragment();for(let c of i){let l=Lo(c,o);if(l){let u=document.createElement("span");u.setAttribute(e,c.substring(l.start.length,c.length-l.end.length)),a.appendChild(u)}else a.appendChild(document.createTextNode(c))}t.replaceWith(a)},bs=(t,e,n)=>{let o=[],r=s=>{if(s.nodeType===Node.TEXT_NODE)n.some(i=>s.textContent?.includes(i.start))&&o.push(s);else{if(s?.hasAttribute?.(e))return;for(let i of Ce(s))r(i)}};return r(t),o},Lo=(t,e)=>e.find(n=>t.startsWith(n.start)&&t.endsWith(n.end));var xs=9,Ts=10,Cs=13,Es=32,we=46,Ft=44,Rs=39,vs=34,qt=40,Qe=41,zt=91,An=93,Nn=63,ws=59,Vo=58,Io=123,Kt=125,De=43,Wt=45,On=96,Do=47,kn=92,Po=new Set([2,3]),_o={"=":2.5,"*=":2.5,"**=":2.5,"/=":2.5,"%=":2.5,"+=":2.5,"-=":2.5,"<<=":2.5,">>=":2.5,">>>=":2.5,"&=":2.5,"^=":2.5,"|=":2.5},Ss={"=>":2,..._o,"||":3,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"/":12,"%":12,"**":13},Fo=Object.keys(_o),As=new Set(Fo),Ln=new Set(["=>"]);Fo.forEach(t=>Ln.add(t));var Uo={true:!0,false:!1,null:null},Ns="this",Xe="Expected ",Pe="Unexpected ",In="Unclosed ",Os=Xe+":",Ho=Xe+"expression",ks="missing }",Ms=Pe+"object property",Ls=In+"(",Bo=Xe+"comma",jo=Pe+"token ",Vs=Pe+"period",Mn=Xe+"expression after ",Is="missing unaryOp argument",Ds=In+"[",Ps=Xe+"exponent (",Us="Variable names cannot start with a number (",Hs=In+'quote after "',ct=t=>t>=48&&t<=57,$o=t=>Ss[t],Vn=class{u;e;get H(){return this.u.charAt(this.e)}get h(){return this.u.charCodeAt(this.e)}f(e){return this.u.charCodeAt(this.e)===e}constructor(e){this.u=e,this.e=0}K(e){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>=128}le(e){return this.K(e)||ct(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.u,o=this.e;for(;e===Es||e===xs||e===Ts||e===Cs;)e=n.charCodeAt(++o);this.e=o}parse(){let e=this.fe();return e.length===1?e[0]:{type:0,body:e}}fe(e){let n=[];for(;this.e<this.u.length;){let o=this.h;if(o===ws||o===Ft)this.e++;else{let r=this.S();if(r)n.push(r);else if(this.e<this.u.length){if(o===e)break;throw this.i(Pe+'"'+this.H+'"')}}}return n}S(){let e=this.Pt()??this.$e();return this.g(),this.Dt(e)}de(){this.g();let e=this.u,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),i=e.charCodeAt(n+3);if(isNaN(o))return!1;let a=!1,c=0;return o===62&&r===62&&s===62&&i===61?(a=">>>=",c=4):o===61&&r===61&&s===61?(a="===",c=3):o===33&&r===61&&s===61?(a="!==",c=3):o===62&&r===62&&s===62?(a=">>>",c=3):o===60&&r===60&&s===61?(a="<<=",c=3):o===62&&r===62&&s===61?(a=">>=",c=3):o===42&&r===42&&s===61?(a="**=",c=3):o===61&&r===62?(a="=>",c=2):o===124&&r===124?(a="||",c=2):o===63&&r===63?(a="??",c=2):o===38&&r===38?(a="&&",c=2):o===61&&r===61?(a="==",c=2):o===33&&r===61?(a="!=",c=2):o===60&&r===61?(a="<=",c=2):o===62&&r===61?(a=">=",c=2):o===60&&r===60?(a="<<",c=2):o===62&&r===62?(a=">>",c=2):o===43&&r===61?(a="+=",c=2):o===45&&r===61?(a="-=",c=2):o===42&&r===61?(a="*=",c=2):o===47&&r===61?(a="/=",c=2):o===37&&r===61?(a="%=",c=2):o===38&&r===61?(a="&=",c=2):o===94&&r===61?(a="^=",c=2):o===124&&r===61?(a="|=",c=2):o===42&&r===42?(a="**",c=2):o===105&&r===110?this.le(e.charCodeAt(n+2))||(a="in",c=2):o===61?(a="=",c=1):o===124?(a="|",c=1):o===94?(a="^",c=1):o===38?(a="&",c=1):o===60?(a="<",c=1):o===62?(a=">",c=1):o===43?(a="+",c=1):o===45?(a="-",c=1):o===42?(a="*",c=1):o===47?(a="/",c=1):o===37&&(a="%",c=1),a?(this.e+=c,a):!1}$e(){let e,n,o,r,s,i,a,c;if(s=this.z(),!s||(n=this.de(),!n))return s;if(r={value:n,prec:$o(n),right_a:Ln.has(n)},i=this.z(),!i)throw this.i(Mn+n);let l=[s,r,i];for(;n=this.de();){o=$o(n),r={value:n,prec:o,right_a:Ln.has(n)},c=n;let u=f=>r.right_a&&f.right_a?o>f.prec:o<=f.prec;for(;l.length>2&&u(l[l.length-2]);)i=l.pop(),n=l.pop().value,s=l.pop(),e=this._e(n,s,i),l.push(e);if(e=this.z(),!e)throw this.i(Mn+c);l.push(r,e)}for(a=l.length-1,e=l[a];a>1;)e=this._e(l[a-1].value,l[a-2],e),a-=2;return e}z(){let e;if(this.g(),e=this.Ut(),e)return this.me(e);let n=this.h;if(ct(n)||n===we)return this.Bt();if(n===Rs||n===vs)e=this.Ht();else if(n===zt)e=this.jt();else{let o=this.$t();if(o){let r=this.z();if(!r)throw this.i(Is);return this.me({type:7,operator:o,argument:r})}this.K(n)?(e=this.ye(),e.name in Uo?e={type:4,value:Uo[e.name],raw:e.name}:e.name===Ns&&(e={type:5})):n===qt&&(e=this._t())}return e?(e=this.W(e),this.me(e)):!1}_e(e,n,o){if(e==="=>"){let r=n.type===1?n.expressions:[n];return{type:15,params:r,body:o}}return As.has(e)?{type:16,operator:e,left:n,right:o}:{type:8,operator:e,left:n,right:o}}Ut(){let e={node:!1};return this.Ft(e),e.node||(this.qt(e),e.node)||(this.Kt(e),e.node)||(this.Fe(e),e.node)||this.zt(e),e.node}me(e){let n={node:e};return this.Wt(n),this.Gt(n),this.Jt(n),n.node}$t(){let e=this.u,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),i=e.charCodeAt(n+3);return o===Wt?(this.e++,"-"):o===33?(this.e++,"!"):o===126?(this.e++,"~"):o===De?(this.e++,"+"):o===110&&r===101&&s===119&&!this.le(i)?(this.e+=3,"new"):!1}Pt(){let e={};return this.Qt(e),e.node}Dt(e){let n={node:e};return this.Xt(n),n.node}W(e){this.g();let n=this.h;for(;n===we||n===zt||n===qt||n===Nn;){let o;if(n===Nn){if(this.u.charCodeAt(this.e+1)!==we)break;o=!0,this.e+=2,this.g(),n=this.h}if(this.e++,n===zt){if(e={type:3,computed:!0,object:e,property:this.S()},this.g(),n=this.h,n!==An)throw this.i(Ds);this.e++}else n===qt?e={type:6,arguments:this.qe(Qe),callee:e}:(o&&this.e--,this.g(),e={type:3,computed:!1,object:e,property:this.ye()});o&&(e.optional=!0),this.g(),n=this.h}return e}Bt(){let e=this.u,n=this.e,o=n;for(;ct(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===we)for(o++;ct(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let a=e.charCodeAt(o);(a===De||a===Wt)&&o++;let c=o;for(;ct(e.charCodeAt(o));)o++;if(c===o){this.e=o;let l=e.slice(n,o);throw this.i(Ps+l+this.H+")")}}this.e=o;let s=e.slice(n,o),i=e.charCodeAt(o);if(this.K(i))throw this.i(Us+s+this.H+")");if(i===we||s.length===1&&s.charCodeAt(0)===we)throw this.i(Vs);return{type:4,value:parseFloat(s),raw:s}}Ht(){let e=this.u,n=e.length,o=this.e,r=e.charCodeAt(this.e++),s=this.e,i=s,a=[],c=!1,l=!1;for(;s<n;){let f=e.charCodeAt(s);if(f===r){l=!0,this.e=s+1;break}if(f===kn){c||(c=!0),a.push(e.slice(i,s));let p=e.charCodeAt(s+1);a.push(this.Ke(p)),s+=2,i=s}else s++}let u=c?a.join("")+e.slice(i,l?s:n):e.slice(i,l?s:n);if(!l)throw this.e=s,this.i(Hs+u+'"');return{type:4,value:u,raw:e.substring(o,this.e)}}Ke(e){switch(e){case 110:return`
2
+ `;case 114:return"\r";case 116:return" ";case 98:return"\b";case 102:return"\f";case 118:return"\v";default:return isNaN(e)?"":String.fromCharCode(e)}}ye(){let e=this.h,n=this.e;if(this.K(e))this.e++;else throw this.i(Pe+this.H);for(;this.e<this.u.length&&(e=this.h,this.le(e));)this.e++;return{type:2,name:this.u.slice(n,this.e)}}qe(e){let n=[],o=!1,r=0;for(;this.e<this.u.length;){this.g();let s=this.h;if(s===e){if(o=!0,this.e++,e===Qe&&r&&r>=n.length)throw this.i(jo+String.fromCharCode(e));break}else if(s===Ft){if(this.e++,r++,r!==n.length){if(e===Qe)throw this.i(jo+",");for(let i=n.length;i<r;i++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(Bo);{let i=this.S();if(!i||i.type===0)throw this.i(Bo);n.push(i)}}}if(!o)throw this.i(Xe+String.fromCharCode(e));return n}_t(){this.e++;let e=this.fe(Qe);if(this.f(Qe))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(Ls)}jt(){return this.e++,{type:9,elements:this.qe(An)}}Ft(e){if(this.f(Io)){this.e++;let n=[];for(;!isNaN(this.h);){if(this.g(),this.f(Kt)){this.e++,e.node=this.W({type:10,properties:n});return}let o=this.S();if(!o)break;if(this.g(),o.type===2&&(this.f(Ft)||this.f(Kt)))n.push({type:12,computed:!1,key:o,value:o,shorthand:!0});else if(this.f(Vo)){this.e++;let r=this.S();if(!r)throw this.i(Ms);let s=o.type===9;n.push({type:12,computed:s,key:s?o.elements[0]:o,value:r,shorthand:!1}),this.g()}else n.push(o);this.f(Ft)&&this.e++}throw this.i(ks)}}qt(e){let n=this.h;if((n===De||n===Wt)&&n===this.u.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===De?"++":"--",argument:this.W(this.ye()),prefix:!0};if(!o.argument||!Po.has(o.argument.type))throw this.i(Pe+o.operator)}}Gt(e){let n=e.node,o=this.h;if((o===De||o===Wt)&&o===this.u.charCodeAt(this.e+1)){if(!Po.has(n.type))throw this.i(Pe+(o===De?"++":"--"));this.e+=2,e.node={type:13,operator:o===De?"++":"--",argument:n,prefix:!1}}}Kt(e){this.u.charCodeAt(this.e)===we&&this.u.charCodeAt(this.e+1)===we&&this.u.charCodeAt(this.e+2)===we&&(this.e+=3,e.node={type:14,argument:this.S()})}Xt(e){if(e.node&&this.f(Nn)){this.e++;let n=e.node,o=this.S();if(!o)throw this.i(Ho);if(this.g(),this.f(Vo)){this.e++;let r=this.S();if(!r)throw this.i(Ho);e.node={type:11,test:n,consequent:o,alternate:r}}else throw this.i(Os)}}Qt(e){if(this.g(),this.f(qt)){let n=this.e;if(this.e++,this.g(),this.f(Qe)){this.e++;let o=this.de();if(o==="=>"){let r=this.$e();if(!r)throw this.i(Mn+o);e.node={type:15,params:null,body:r};return}}this.e=n}}Jt(e){let n=e.node,o=n.type;(o===2||o===3)&&this.f(On)&&(e.node={type:17,tag:n,quasi:this.Fe(e)})}Fe(e){if(!this.f(On))return;let n=this.u,o=n.length,r={type:19,quasis:[],expressions:[]},s=++this.e,i=[],a=[],c=!1,l=u=>{if(!c){let h=n.slice(s,this.e);return r.quasis.push({type:18,value:{raw:h,cooked:h},tail:u})}i.push(n.slice(s,this.e)),a.push(n.slice(s,this.e));let f=i.join(""),p=a.join("");return i.length=0,a.length=0,c=!1,r.quasis.push({type:18,value:{raw:f,cooked:p},tail:u})};for(;this.e<o;){let u=n.charCodeAt(this.e);if(u===On)return l(!0),this.e+=1,e.node=r,r;if(u===36&&n.charCodeAt(this.e+1)===Io){if(l(!1),this.e+=2,r.expressions.push(...this.fe(Kt)),!this.f(Kt))throw this.i("unclosed ${");this.e+=1,s=this.e}else if(u===kn){c||(c=!0),i.push(n.slice(s,this.e)),a.push(n.slice(s,this.e));let f=n.charCodeAt(this.e+1);i.push(n.slice(this.e,this.e+2)),a.push(this.Ke(f)),this.e+=2,s=this.e}else this.e+=1}throw this.i("Unclosed `")}Wt(e){let n=e.node;if(!n||n.operator!=="new"||!n.argument)return;if(!n.argument||![6,3].includes(n.argument.type))throw this.i("Expected new function()");e.node=n.argument;let o=e.node;for(;o.type===3||o.type===6&&o.callee.type===3;)o=o.type===3?o.object:o.callee.object;o.type=20}zt(e){if(!this.f(Do))return;let n=++this.e,o=!1;for(;this.e<this.u.length;){if(this.h===Do&&!o){let r=this.u.slice(n,this.e),s="";for(;++this.e<this.u.length;){let a=this.h;if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)s+=this.H;else break}let i;try{i=new RegExp(r,s)}catch(a){throw this.i(a.message)}return e.node={type:4,value:i,raw:this.u.slice(n-1,this.e)},e.node=this.W(e.node),e.node}this.f(zt)?o=!0:o&&this.f(An)&&(o=!1),this.e+=this.f(kn)?2:1}throw this.i("Unclosed Regex")}},qo=t=>new Vn(t).parse();var Bs={"=>":(t,e)=>{},"=":(t,e)=>{},"*=":(t,e)=>{},"**=":(t,e)=>{},"/=":(t,e)=>{},"%=":(t,e)=>{},"+=":(t,e)=>{},"-=":(t,e)=>{},"<<=":(t,e)=>{},">>=":(t,e)=>{},">>>=":(t,e)=>{},"&=":(t,e)=>{},"^=":(t,e)=>{},"|=":(t,e)=>{},"||":(t,e)=>t()||e(),"??":(t,e)=>t()??e(),"&&":(t,e)=>t()&&e(),"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,in:(t,e)=>t in e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,"**":(t,e)=>t**e},js={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},Go=t=>{if(!t?.some(Wo))return t;let e=[];return t.forEach(n=>Wo(n)?e.push(...n):e.push(n)),e},zo=(...t)=>Go(t),Dn=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},$s={"++":(t,e)=>{let n=t[e];if(T(n)){let o=n();return n(++o),o}return++t[e]},"--":(t,e)=>{let n=t[e];if(T(n)){let o=n();return n(--o),o}return--t[e]}},_s={"++":(t,e)=>{let n=t[e];if(T(n)){let o=n();return n(o+1),o}return t[e]++},"--":(t,e)=>{let n=t[e];if(T(n)){let o=n();return n(o-1),o}return t[e]--}},Ko={"=":(t,e,n)=>{let o=t[e];return T(o)?o(n):t[e]=n},"+=":(t,e,n)=>{let o=t[e];return T(o)?o(o()+n):t[e]+=n},"-=":(t,e,n)=>{let o=t[e];return T(o)?o(o()-n):t[e]-=n},"*=":(t,e,n)=>{let o=t[e];return T(o)?o(o()*n):t[e]*=n},"/=":(t,e,n)=>{let o=t[e];return T(o)?o(o()/n):t[e]/=n},"%=":(t,e,n)=>{let o=t[e];return T(o)?o(o()%n):t[e]%=n},"**=":(t,e,n)=>{let o=t[e];return T(o)?o(o()**n):t[e]**=n},"<<=":(t,e,n)=>{let o=t[e];return T(o)?o(o()<<n):t[e]<<=n},">>=":(t,e,n)=>{let o=t[e];return T(o)?o(o()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let o=t[e];return T(o)?o(o()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let o=t[e];return T(o)?o(o()|n):t[e]|=n},"&=":(t,e,n)=>{let o=t[e];return T(o)?o(o()&n):t[e]&=n},"^=":(t,e,n)=>{let o=t[e];return T(o)?o(o()^n):t[e]^=n}},Gt=(t,e)=>_(t)?t.bind(e):t,Pn=class{l;ze;We;Ge;A;Je;Qe;constructor(e,n,o,r,s){this.l=E(e)?e:[e],this.ze=n,this.We=o,this.Ge=r,this.Qe=!!s}Xe(e,n){if(n&&e in n)return n;for(let o of this.l)if(e in o)return o}2(e,n,o){let r=e.name;if(r==="$root")return this.l[this.l.length-1];if(r==="$parent")return this.l[1];if(r==="$ctx")return[...this.l];if(o&&r in o)return this.A=o[r],Gt(H(o[r]),o);for(let i of this.l)if(r in i)return this.A=i[r],Gt(H(i[r]),i);let s=this.ze;if(s&&r in s)return this.A=s[r],Gt(H(s[r]),s)}5(e,n,o){return this.l[0]}0(e,n,o){return this.Ye(n,o,zo,...e.body)}1(e,n,o){return this.C(n,o,(...r)=>r.pop(),...e.expressions)}3(e,n,o){let{obj:r,key:s}=this.he(e,n,o),i=r?.[s];return this.A=i,Gt(H(i),r)}4(e,n,o){return e.value}6(e,n,o){let r=(i,...a)=>_(i)?i(...Go(a)):i,s=this.C(++n,o,r,e.callee,...e.arguments);return this.A=s,s}7(e,n,o){return this.C(n,o,js[e.operator],e.argument)}8(e,n,o){let r=Bs[e.operator];switch(e.operator){case"||":case"&&":case"??":return r(()=>this.b(e.left,n,o),()=>this.b(e.right,n,o))}return this.C(n,o,r,e.left,e.right)}9(e,n,o){return this.Ye(++n,o,zo,...e.elements)}10(e,n,o){let r={},s=(...i)=>{i.forEach(a=>{Object.assign(r,a)})};return this.C(++n,o,s,...e.properties),r}11(e,n,o){return this.C(n,o,r=>this.b(r?e.consequent:e.alternate,n,o),e.test)}12(e,n,o){let r={},s=u=>u?.type!==15,i=this.Ge??(()=>!1),a=n===0&&this.Qe,c=u=>this.Ze(a,e.key,n,Dn(u,o)),l=u=>this.Ze(a,e.value,n,Dn(u,o));if(e.shorthand){let u=e.key.name;r[u]=s(e.key)&&i(u,n)?c:c()}else if(e.computed){let u=H(c());r[u]=s(e.value)&&i(u,n)?l:l()}else{let u=e.key.type===4?e.key.value:e.key.name;r[u]=s(e.value)&&i(u,n)?()=>l:l()}return r}he(e,n,o){let r=this.b(e.object,n,o),s=e.computed?this.b(e.property,n,o):e.property.name;return{obj:r,key:s}}13(e,n,o){let r=e.argument,s=e.operator,i=e.prefix?$s:_s;if(r.type===2){let a=r.name,c=this.Xe(a,o);return le(c)?void 0:i[s](c,a)}if(r.type===3){let{obj:a,key:c}=this.he(r,n,o);return i[s](a,c)}}16(e,n,o){let r=e.left,s=e.operator;if(r.type===2){let i=r.name,a=this.Xe(i,o);if(le(a))return;let c=this.b(e.right,n,o);return Ko[s](a,i,c)}if(r.type===3){let{obj:i,key:a}=this.he(r,n,o),c=this.b(e.right,n,o);return Ko[s](i,a,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return E(r)&&(r.s=Jo),r}17(e,n,o){return this[6]({type:6,callee:e.tag,arguments:[{type:9,elements:e.quasi.quasis},...e.quasi.expressions]},n,o)}19(e,n,o){let r=(...s)=>s.reduce((i,a,c)=>i+=a+e.quasis[c+1].value.cooked,e.quasis[0].value.cooked);return this.C(n,o,r,...e.expressions)}18(e,n,o){return e.value.cooked}20(e,n,o){let r=(s,...i)=>new s(...i);return this.C(n,o,r,e.callee,...e.arguments)}15(e,n,o){return(...r)=>{let s=Object.create(o??{}),i=e.params;if(i){let a=0;for(let c of i)s[c.name]=r[a++]}return this.b(e.body,n,s)}}b(e,n,o){let r=H(this[e.type](e,n,o));return this.Je=e.type,r}Ze(e,n,o,r){let s=this.b(n,o,r);return e&&this.et()?this.A:s}et(){let e=this.Je;return(e===2||e===3||e===6)&&T(this.A)}eval(e,n){let{value:o,refs:r}=hn(()=>this.b(e,-1,n)),s={value:o,refs:r};return this.et()&&(s.ref=this.A),s}C(e,n,o,...r){let s=r.map(i=>i&&this.b(i,e,n));return o(...s)}Ye(e,n,o,...r){let s=this.We;if(!s)return this.C(e,n,o,...r);let i=r.map((a,c)=>a&&(a.type!==15&&s(c,e)?l=>this.b(a,e,Dn(l,n)):this.b(a,e,n)));return o(...i)}},Jo=Symbol("s"),Wo=t=>t?.s===Jo,Qo=(t,e,n,o,r,s,i)=>new Pn(e,n,o,r,i).eval(t,s);var Xo={},Yo=t=>!!t,Jt=class{l;o;constructor(e,n){this.l=e,this.o=n}v(e){this.l=[e,...this.l]}ee(){return this.l.map(n=>n.components).filter(Yo).reverse().reduce((n,o)=>{for(let[r,s]of Object.entries(o))n[r.toUpperCase()]=s;return n},{})}ut(){let e=[],n=new Set,o=this.l.map(r=>r.components).filter(Yo).reverse();for(let r of o)for(let s of Object.keys(r))n.has(s)||(n.add(s),e.push(s));return e}M(e,n,o,r,s){let i=[],a=[],c=new Set,l=()=>{for(let C=0;C<a.length;++C)a[C]();a.length=0},p={value:()=>i,stop:()=>{l(),c.clear()},subscribe:(C,v)=>(c.add(C),v&&C(i),()=>{c.delete(C)}),refs:[],context:this.l[0]};if(B(e))return p;let h=this.o.globalContext,m=[],d=new Set,g=(C,v,j,K)=>{try{let I=Qo(C,v,h,n,o,K,r);return j&&I.refs.length>0&&m.push(...I.refs),{value:I.value,refs:I.refs,ref:I.ref}}catch(I){D(6,`evaluation error: ${e}`,I)}return{value:void 0,refs:[]}};try{let C=Xo[e]??qo("["+e+"]");Xo[e]=C;let v=this.l.slice(),j=C.elements,K=j.length,I=new Array(K);p.refs=I;let ne=()=>{m.length=0,s||(d.clear(),l());let X=new Array(K);for(let O=0;O<K;++O){let oe=j[O];if(n?.(O,-1)){X[O]=S=>g(oe,v,!1,{$event:S}).value;continue}let x=g(oe,v,!0);X[O]=x.value,I[O]=x.ref}if(!s)for(let O of m)d.has(O)||(d.add(O),a.push(re(O,ne)));if(i=X,c.size!==0)for(let O of c)c.has(O)&&O(i)};ne()}catch(C){D(6,`parse error: ${e}`,C)}return p}L(){return this.l.slice()}tt=[];ce(e){this.tt.push(this.l),this.l=e}R(e,n){try{this.ce(e),n()}finally{this.Yt()}}Yt(){this.l=this.tt.pop()??[]}};var Zo=t=>{let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||t==="-"||t==="_"||t===":"},Fs=(t,e)=>{let n="";for(let o=e;o<t.length;++o){let r=t[o];if(n){r===n&&(n="");continue}if(r==='"'||r==="'"){n=r;continue}if(r===">")return o}return-1},qs=(t,e)=>{let n=e?2:1;for(;n<t.length&&(t[n]===" "||t[n]===`
3
+ `);)++n;if(n>=t.length||!Zo(t[n]))return null;let o=n;for(;n<t.length&&Zo(t[n]);)++n;return{start:o,end:n}},er=new Set(["table","thead","tbody","tfoot"]),zs=new Set(["thead","tbody","tfoot"]),Ks=new Set(["caption","colgroup","thead","tbody","tfoot","tr"]),Ws=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),tr=(t,e)=>`${t.slice(0,t.length-2)}></${e}>`,Qt=t=>{let e=0,n=[],o=[],r=0;for(;e<t.length;){let s=t.indexOf("<",e);if(s===-1){n.push(t.slice(e));break}if(n.push(t.slice(e,s)),t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);if(g===-1){n.push(t.slice(s));break}n.push(t.slice(s,g+3)),e=g+3;continue}let i=Fs(t,s);if(i===-1){n.push(t.slice(s));break}let a=t.slice(s,i+1),c=a.startsWith("</");if(a.startsWith("<!")||a.startsWith("<?")){n.push(a),e=i+1;continue}let u=qs(a,c);if(!u){n.push(a),e=i+1;continue}let f=a.slice(u.start,u.end);if(c){let g=o[o.length-1];g?(o.pop(),n.push(g.replacementHost?`</${g.replacementHost}>`:a),er.has(g.effectiveTag)&&--r):n.push(a),e=i+1;continue}let p=a.charCodeAt(a.length-2)===47,h=o[o.length-1],m=null;r===0?f==="tr"?m="trx":f==="td"?m="tdx":f==="th"&&(m="thx"):zs.has(h?.effectiveTag??"")?m=f==="tr"?null:"tr":h?.effectiveTag==="table"?m=Ks.has(f)?null:"tr":h?.effectiveTag==="tr"&&(m=f==="td"||f==="th"?null:"td");let d=p&&!Ws.has(m||f);if(m){let g=m==="trx"||m==="tdx"||m==="thx",C=`${a.slice(0,u.start)}${m} is="${g?`r-${f}`:`regor:${f}`}"${a.slice(u.end)}`;n.push(d?tr(C,m):C)}else n.push(d?tr(a,f):a);if(!p){let g=m==="trx"?"tr":m==="tdx"?"td":m==="thx"?"th":m||f;o.push({replacementHost:m,effectiveTag:g}),er.has(g)&&++r}e=i+1}return n.join("")};var Gs="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",Js=new Set(Gs.toUpperCase().split(",")),Qs="http://www.w3.org/2000/svg",nr=(t,e)=>{fe(t)?t.content.appendChild(e):t.appendChild(e)},Un=(t,e,n,o)=>{let r=t.t;if(r){let i=n&&Js.has(r.toUpperCase())?document.createElementNS(Qs,r.toLowerCase()):document.createElement(r),a=t.a;if(a)for(let l of Object.entries(a)){let u=l[0],f=l[1];u.startsWith("#")&&(f=u.substring(1),u="name"),i.setAttribute(vt(u,o),f)}let c=t.c;if(c)for(let l of c)Un(l,i,n,o);nr(e,i);return}let s=t.d;if(s){let i;switch(t.n??Node.TEXT_NODE){case Node.COMMENT_NODE:i=document.createComment(s);break;case Node.TEXT_NODE:i=document.createTextNode(s);break}if(i)nr(e,i);else throw new Error("unsupported node type.")}},Ye=(t,e,n)=>{n??=me.getDefault();let o=document.createDocumentFragment();if(!E(t))return Un(t,o,!!e,n),o;for(let r of t)Un(r,o,!!e,n);return o};var Xs=(t,e={selector:"#app"},n)=>{F(e)&&(e={selector:"#app",template:e}),eo(t)&&(t=t.context);let o=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!o||!xe(o))throw P(0);n||(n=me.getDefault());let r=()=>{for(let a of[...o.childNodes])z(a)},s=a=>{for(let c of a)o.appendChild(c)};if(e.template){let a=document.createRange().createContextualFragment(Qt(e.template));r(),s(a.childNodes),e.element=a}else if(e.json){let a=Ye(e.json,e.isSVG,n);r(),s(a.childNodes)}return n.useInterpolation&&_t(o,n),new Hn(t,o,n).y(),q(o,()=>{Ae(t)}),St(t),{context:t,unmount:()=>{z(o)},unbind:()=>{be(o)}}},Hn=class{Zt;nt;o;m;r;constructor(e,n,o){this.Zt=e,this.nt=n,this.o=o,this.m=new Jt([e],o),this.r=new Ht(this.m)}y(){this.r.$(this.nt)}};var ut=t=>{if(E(t))return t.map(r=>ut(r));let e={};if(t.tagName)e.t=t.tagName;else return t.nodeType===Node.COMMENT_NODE&&(e.n=Node.COMMENT_NODE),t.textContent&&(e.d=t.textContent),e;let n=t.getAttributeNames();n.length>0&&(e.a=Object.fromEntries(n.map(r=>[r,t.getAttribute(r)??""])));let o=Ce(t);return o.length>0&&(e.c=[...o].map(r=>ut(r))),e};var Ys=(t,e={})=>{E(e)&&(e={props:e}),F(t)&&(t={template:t});let n=e.context??(()=>({})),o=!1;if(t.element){let s=t.element;s.remove(),t.element=s}else if(t.selector){let s=document.querySelector(t.selector);if(!s)throw P(1,t.selector);s.remove(),t.element=s}else if(t.template){let s=document.createRange().createContextualFragment(Qt(t.template));t.element=s}else t.json&&(t.element=Ye(t.json,t.isSVG,e.config),o=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&_t(t.element,e.config??me.getDefault());let r=t.element;if(!o&&((t.isSVG??(nt(r)&&r.hasAttribute?.("isSVG")))||nt(r)&&r.querySelector("[isSVG]"))){let s=r.content,i=s?[...s.childNodes]:[...r.childNodes],a=ut(i);t.element=Ye(a,!0,e.config)}return{context:n,template:t.element,inheritAttrs:e.inheritAttrs??!0,props:e.props,defaultName:e.defaultName}};var Bn=class{byConstructor=new Map;register(e){this.byConstructor.set(e.constructor,e)}unregisterByClass(e){this.byConstructor.delete(e)}unregister(e){let n=e.constructor;this.byConstructor.get(n)===e&&this.byConstructor.delete(n)}find(e){for(let n of this.byConstructor.values())if(n instanceof e)return n}require(e){let n=this.find(e);if(n)return n;throw new Error(`${e.name} is not registered in ContextRegistry.`)}};var Zs=t=>{Me()?.onMounted.push(t)};var ei=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw P(4);return e&&!n.isStopped?e(...r):(e=ti(t,n),e(...r))};return o[J]=1,Oe(o,!0),o.stop=()=>n.ref?.stop?.(),te(()=>o.stop(),!0),o},ti=(t,e)=>{let n=e.ref??ie(null);e.ref=n,e.isStopped=!1;let o=0,r=We(()=>{if(o>0){r(),e.isStopped=!0,Q(n);return}n(t()),++o});return n.stop=r,n};var ni=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw P(4);return o&&!n.isStopped?o(...s):(o=oi(t,e,n),o(...s))};return r[J]=1,Oe(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},oi=(t,e,n)=>{let o=n.ref??ie(null);n.ref=o,n.isStopped=!1;let r=0,s=a=>{if(r>0){o.stop(),n.isStopped=!0,Q(o);return}let c=t.map(l=>l());o(e(...c)),++r},i=[];for(let a of t){let c=re(a,s);i.push(c)}return s(null),o.stop=()=>{i.forEach(a=>{a()})},o};var ri=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw P(4);return o&&!n.isStopped?o(...s):(o=si(t,e,n),o(...s))};return r[J]=1,Oe(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},si=(t,e,n)=>{let o=n.ref??ie(null);n.ref=o,n.isStopped=!1;let r=0;return o.stop=re(t,s=>{if(r>0){o.stop(),n.isStopped=!0,Q(o);return}o(e(s)),++r},!0),o};var ii=t=>(t[yt]=1,t);var ai=(t,e)=>{if(!e)throw P(5);let o=Ke(t)?Ee:a=>a,r=()=>localStorage.setItem(e,JSON.stringify(ae(t()))),s=localStorage.getItem(e);if(s!=null)try{t(o(JSON.parse(s)))}catch(a){D(6,`persist: failed to parse data for key ${e}`,a),r()}else r();let i=We(r);return te(i,!0),t};var or=(t,...e)=>{let n="",o=t,r=e,s=o.length,i=r.length;for(let a=0;a<s;++a)n+=o[a],a<i&&(n+=r[a]);return n},ci=or;var ui=(t,e,n)=>{let o=[],r=()=>{e(t.map(i=>i()))};for(let i of t)o.push(re(i,r));n&&r();let s=()=>{for(let i of o)i()};return te(s,!0),s};var li=t=>{if(!T(t))throw P(3,"observerCount");return t(void 0,void 0,2)};var fi=t=>{rr();try{t()}finally{sr()}},rr=()=>{ye.stack||(ye.stack=[]),ye.stack.push(new Set)},sr=()=>{let t=ye.stack;if(!t||t.length===0)return;let e=t.pop();if(t.length){let n=t[t.length-1];for(let o of e)n.add(o);return}delete ye.stack;for(let n of e)try{Q(n)}catch(o){console.error(o)}};export{et as ComponentHead,Bn as ContextRegistry,me as RegorConfig,q as addUnbinder,fi as batch,hn as collectRefs,ni as computeMany,ri as computeRef,ei as computed,Xs as createApp,Ys as defineComponent,ar as drainUnbind,sr as endBatch,rt as entangle,ae as flatten,Ve as getBindData,or as html,Ke as isDeepRef,st as isRaw,T as isRef,ii as markRaw,re as observe,ui as observeMany,li as observerCount,Zs as onMounted,te as onUnmounted,Cn as pause,ai as persist,vr as pval,ci as raw,Ee as ref,z as removeNode,En as resume,dn as silence,ie as sref,rr as startBatch,Ye as toFragment,ut as toJsonTemplate,Q as trigger,be as unbind,H as unref,pn as useScope,$e as warningHandler,We as watchEffect};
@@ -260,6 +260,9 @@ var Regor = (() => {
260
260
  var describeValue = (value) => {
261
261
  if (value === null) return "null";
262
262
  if (value === void 0) return "undefined";
263
+ if (isRef(value)) {
264
+ return `ref<${describeValue(value())}>`;
265
+ }
263
266
  if (typeof value === "string") return "string";
264
267
  if (typeof value === "number") return "number";
265
268
  if (typeof value === "boolean") return "boolean";
@@ -274,6 +277,64 @@ var Regor = (() => {
274
277
  const ctorName = value?.constructor?.name;
275
278
  return ctorName && ctorName !== "Object" ? ctorName : "object";
276
279
  };
280
+ var trimPreview = (value) => {
281
+ return value.length > 60 ? `${value.slice(0, 57)}...` : value;
282
+ };
283
+ var formatPreview = (value, depth = 0) => {
284
+ const maxPreviewDepth = 1;
285
+ const maxArrayItems = 5;
286
+ const maxObjectEntries = 5;
287
+ if (depth > maxPreviewDepth) return "unknown";
288
+ if (isRef(value)) {
289
+ const refValue = value();
290
+ return `ref(${formatPreview(refValue, depth + 1)})`;
291
+ }
292
+ if (typeof value === "string") return trimPreview(JSON.stringify(value));
293
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
294
+ return String(value);
295
+ }
296
+ if (typeof value === "symbol") return String(value);
297
+ if (value === null) return "null";
298
+ if (value === void 0) return "undefined";
299
+ if (value instanceof Date) return value.toISOString();
300
+ if (value instanceof RegExp) return String(value);
301
+ if (isArray(value)) {
302
+ const items = value.slice(0, maxArrayItems).map((x) => formatPreview(x, depth + 1)).join(", ");
303
+ return value.length > maxArrayItems ? `[${items}, ...]` : `[${items}]`;
304
+ }
305
+ if (isObject(value)) {
306
+ const entries = Object.entries(value).slice(0, maxObjectEntries);
307
+ if (entries.length === 0) return "{}";
308
+ const text = entries.map(([key, entry]) => {
309
+ const preview = formatPreview(entry, depth + 1);
310
+ return `${key}: ${preview}`;
311
+ }).join(", ");
312
+ return Object.keys(value).length > maxObjectEntries ? `{ ${text}, ... }` : `{ ${text} }`;
313
+ }
314
+ return "unknown";
315
+ };
316
+ var describe = (value) => {
317
+ const type = describeValue(value);
318
+ const preview = formatPreview(value);
319
+ return `got ${type} (${preview})`;
320
+ };
321
+ var getErrorDetail = (error) => {
322
+ if (error instanceof PropValidationError) return error.detail;
323
+ if (error instanceof Error) return error.message;
324
+ return String(error);
325
+ };
326
+ var formatOrDetail = (errors2, value) => {
327
+ const received = `, ${describe(value)}.`;
328
+ const reasons = [];
329
+ for (const error of errors2) {
330
+ const detail = getErrorDetail(error);
331
+ const reason = detail.endsWith(received) ? detail.slice(0, -received.length) : detail;
332
+ if (!reasons.includes(reason)) reasons.push(reason);
333
+ }
334
+ if (reasons.length === 0) return describe(value);
335
+ if (reasons.length === 1) return `${reasons[0]}, ${describe(value)}`;
336
+ return `${reasons.join(" or ")}, ${describe(value)}`;
337
+ };
277
338
  var formatLiteral = (value) => {
278
339
  if (typeof value === "string") return `"${value}"`;
279
340
  if (typeof value === "number" || typeof value === "boolean") {
@@ -284,18 +345,24 @@ var Regor = (() => {
284
345
  return describeValue(value);
285
346
  };
286
347
  var isString2 = (value, name) => {
287
- if (typeof value !== "string") fail(name, "expected string");
348
+ if (typeof value !== "string")
349
+ fail(name, `expected string, ${describe(value)}`);
288
350
  };
289
351
  var isNumber = (value, name) => {
290
- if (typeof value !== "number") fail(name, "expected number");
352
+ if (typeof value !== "number")
353
+ fail(name, `expected number, ${describe(value)}`);
291
354
  };
292
355
  var isBoolean = (value, name) => {
293
- if (typeof value !== "boolean") fail(name, "expected boolean");
356
+ if (typeof value !== "boolean")
357
+ fail(name, `expected boolean, ${describe(value)}`);
294
358
  };
295
359
  var isClass = (ctor) => {
296
360
  return (value, name) => {
297
361
  if (!(value instanceof ctor)) {
298
- fail(name, `expected instance of ${ctor.name || "provided class"}`);
362
+ fail(
363
+ name,
364
+ `expected instance of ${ctor.name || "provided class"}, ${describe(value)}`
365
+ );
299
366
  }
300
367
  };
301
368
  };
@@ -311,18 +378,32 @@ var Regor = (() => {
311
378
  validator(value, name, head);
312
379
  };
313
380
  };
381
+ var or = (...validators) => {
382
+ return (value, name, head) => {
383
+ const errors2 = [];
384
+ for (const validator of validators) {
385
+ try {
386
+ validator(value, name, head);
387
+ return;
388
+ } catch (error) {
389
+ errors2.push(error);
390
+ }
391
+ }
392
+ fail(name, formatOrDetail(errors2, value));
393
+ };
394
+ };
314
395
  var oneOf = (values) => {
315
396
  return (value, name) => {
316
397
  if (values.includes(value)) return;
317
398
  fail(
318
399
  name,
319
- `expected one of ${values.map((x) => formatLiteral(x)).join(", ")}`
400
+ `expected one of ${values.map((x) => formatLiteral(x)).join(", ")}, ${describe(value)}`
320
401
  );
321
402
  };
322
403
  };
323
404
  var arrayOf = (validator) => {
324
405
  return (value, name, head) => {
325
- if (!isArray(value)) fail(name, "expected array");
406
+ if (!isArray(value)) fail(name, `expected array, ${describe(value)}`);
326
407
  const items = value;
327
408
  for (let i = 0; i < items.length; ++i) {
328
409
  validator(items[i], `${name}[${i}]`, head);
@@ -331,7 +412,7 @@ var Regor = (() => {
331
412
  };
332
413
  var shape = (schema) => {
333
414
  return (value, name, head) => {
334
- if (!isObject(value)) fail(name, "expected object");
415
+ if (!isObject(value)) fail(name, `expected object, ${describe(value)}`);
335
416
  const record = value;
336
417
  for (const key in schema) {
337
418
  const validator = schema[key];
@@ -341,19 +422,23 @@ var Regor = (() => {
341
422
  };
342
423
  var refOf = (validator) => {
343
424
  return (value, name, head) => {
344
- if (!isRef(value)) fail(name, "expected ref");
345
- const refValue = value;
346
- validator(refValue(), `${name}.value`, head);
425
+ if (isRef(value)) {
426
+ validator(value(), `${name}.value`, head);
427
+ return;
428
+ }
429
+ fail(name, `expected ref, ${describe(value)}`);
347
430
  };
348
431
  };
349
432
  var pval = {
350
433
  fail,
434
+ describe,
351
435
  isString: isString2,
352
436
  isNumber,
353
437
  isBoolean,
354
438
  isClass,
355
439
  optional,
356
440
  nullable,
441
+ or,
357
442
  oneOf,
358
443
  arrayOf,
359
444
  shape,