regor 1.7.1 → 1.7.3

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 _e=Symbol(":regor");var Ce=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];pr(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},pr=t=>{let e=t[_e];if(!e)return;let n=e.unbinders;for(let o=0;o<n.length;++o)n[o]();n.length=0,t[_e]=void 0};var Fe=[],yt=!1,gt,qn=()=>{if(yt=!1,gt=void 0,Fe.length!==0){for(let t=0;t<Fe.length;++t)Ce(Fe[t]);Fe.length=0}},Y=t=>{t.remove(),Fe.push(t),yt||(yt=!0,gt=setTimeout(qn,1))},mr=async()=>{Fe.length===0&&!yt||(gt&&clearTimeout(gt),qn())};var W=t=>typeof t=="function",G=t=>typeof t=="string",zn=t=>typeof t>"u",me=t=>t==null||typeof t>"u",j=t=>typeof t!="string"||!t?.trim(),dr=Object.prototype.toString,nn=t=>dr.call(t),Ne=t=>nn(t)==="[object Map]",le=t=>nn(t)==="[object Set]",on=t=>nn(t)==="[object Date]",ot=t=>typeof t=="symbol",w=Array.isArray,I=t=>t!==null&&typeof t=="object";var Kn={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."},_=(t,...e)=>{let n=Kn[t];return new Error(W(n)?n.call(Kn,...e):n)};var bt=[],Wn=()=>{let t={onMounted:[],onUnmounted:[]};return bt.push(t),t},Pe=t=>{let e=bt[bt.length-1];if(!e&&!t)throw _(2);return e},Gn=t=>{let e=Pe();return t&&sn(t),bt.pop(),e},rn=Symbol("csp"),sn=t=>{let e=t,n=e[rn];if(n){let o=Pe();if(n===o)return;o.onMounted.length>0&&n.onMounted.push(...o.onMounted),o.onUnmounted.length>0&&n.onUnmounted.push(...o.onUnmounted);return}e[rn]=Pe()},xt=t=>t[rn];var Oe=t=>{xt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Jn={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]})},$=(t,...e)=>{let n=Jn[t],o=W(n)?n.call(Jn,...e):n,r=qe.warning;r&&(G(o)?r(o):r(o,...o.args))},qe={warning:console.warn};var Tt=Symbol("ref"),J=Symbol("sref"),Ct=Symbol("raw");var x=t=>t!=null&&t[J]>0;var Me=class extends Error{propPath;detail;constructor(e,n){super(n),this.name="PropValidationError",this.propPath=e,this.detail=n}},be=(t,e)=>{throw new Me(t,`${e}.`)},Et=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(x(t))return`ref<${Et(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(w(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"},hr=t=>t.length>60?`${t.slice(0,57)}...`:t,rt=(t,e=0)=>{if(e>1)return"unknown";if(x(t)){let s=t();return`ref(${rt(s,e+1)})`}if(typeof t=="string")return hr(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(w(t)){let s=t.slice(0,5).map(a=>rt(a,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(I(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let a=s.map(([i,c])=>{let u=rt(c,e+1);return`${i}: ${u}`}).join(", ");return Object.keys(t).length>5?`{ ${a}, ... }`:`{ ${a} }`}return"unknown"},ce=t=>{if(x(t))return`got ${Et(t)}(${rt(t())})`;let e=Et(t),n=rt(t);return`got ${e} (${n})`},yr=t=>t instanceof Me?t.detail:t instanceof Error?t.message:String(t),Qn=(t,e)=>{let n=`, ${ce(e)}.`;return t.endsWith(n)?t.slice(0,-n.length):t},gr=(t,e,n)=>{if(e instanceof Me){if(e.propPath===t)return Qn(e.detail,n);if(e.propPath===`${t}.value`&&x(n)){let o=Qn(e.detail,n());return o.startsWith("expected ")?`expected ref<${o.slice(9)}>`:`expected ref where ${o}`}}return yr(e)},br=(t,e,n)=>{let o=[];for(let r of e){let s=gr(t,r,n);o.includes(s)||o.push(s)}return o.length===0?ce(n):o.length===1?`${o[0]}, ${ce(n)}`:`${o.join(" or ")}, ${ce(n)}`},xr=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":Et(t),Tr=(t,e)=>{typeof t!="string"&&be(e,`expected string, ${ce(t)}`)},Cr=(t,e)=>{typeof t!="number"&&be(e,`expected number, ${ce(t)}`)},Er=(t,e)=>{typeof t!="boolean"&&be(e,`expected boolean, ${ce(t)}`)},vr=t=>(e,n)=>{e instanceof t||be(n,`expected instance of ${t.name||"provided class"}, ${ce(e)}`)},Rr=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},wr=t=>(e,n,o)=>{e!==null&&t(e,n,o)},Sr=(...t)=>(e,n,o)=>{let r=[];for(let s of t)try{s(e,n,o);return}catch(a){r.push(a)}be(n,br(n,r,e))},Ar=t=>(e,n)=>{t.includes(e)||be(n,`expected one of ${t.map(o=>xr(o)).join(", ")}, ${ce(e)}`)},kr=t=>(e,n,o)=>{w(e)||be(n,`expected array, ${ce(e)}`);let r=e;for(let s=0;s<r.length;++s)t(r[s],`${n}[${s}]`,o)};function Nr(t){return(e,n,o)=>{I(e)||be(n,`expected object, ${ce(e)}`);let r=e;for(let s in t){let a=t[s];if(!a)continue;a(r[s],`${n}.${s}`,o)}}}var Or=t=>(e,n,o)=>{if(x(e)){t(e(),`${n}.value`,o);return}be(n,`expected ref, ${ce(e)}`)},Mr={fail:be,describe:ce,isString:Tr,isNumber:Cr,isBoolean:Er,isClass:vr,optional:Rr,nullable:wr,or:Sr,oneOf:Ar,arrayOf:kr,shape:Nr,refOf:Or};var Lr=(t,e,n)=>{let o=t.tagName?.toLowerCase?.()||"unknown",r=n instanceof Me?n.propPath:e,s=n instanceof Me?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})},st=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;J;Q;constructor(e,n,o,r,s,a){this.props=e,this.J=n,this.ctx=o,this.start=r,this.end=s,this.Q=a}emit=(e,n)=>{this.J.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.Q==="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=Lr(this.J,o,a);if(this.Q==="warn"){qe.warning(i.message,i);continue}throw i}}}unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)Y(e),e=e.nextSibling;for(let o of this.ctx)Oe(o)}};var De=t=>{let e=t,n=e[_e];if(n)return n;let o={unbinders:[],data:{}};return e[_e]=o,o};var Q=(t,e)=>{De(t).unbinders.push(e)};var Ue=t=>{if(typeof t=="string"){let e=t.trim().toLowerCase();if(e===""||e==="0"||e==="false")return!1;if(e==="true")return!0}return!!t};var Rt={},vt={},Xn=1,Yn=t=>{let e=(Xn++).toString();return Rt[e]=t,vt[e]=0,e},an=t=>{vt[t]+=1},cn=t=>{--vt[t]===0&&(delete Rt[t],delete vt[t])},Zn=t=>Rt[t],un=()=>Xn!==1&&Object.keys(Rt).length>0,it="r-switch",Vr=t=>{let e=t.filter(o=>Ee(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(it))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},ze=(t,e)=>{if(!un())return;let n=Vr(e);n.length!==0&&(n.forEach(an),Q(t,()=>{n.forEach(cn)}))};var wt=()=>{},ln=(t,e,n,o)=>{let r=[];for(let s of t){let a=s.cloneNode(!0);n.insertBefore(a,o),r.push(a)}Le(e,r)},fn=Symbol("r-if"),eo=Symbol("r-else"),to=t=>t[eo]===1,St=class{r;M;Te;X;Y;x;R;constructor(e){this.r=e,this.M=e.o.u.if,this.Te=kt(e.o.u.if),this.X=e.o.u.else,this.Y=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.M);return n&&this.y(e),e.hasAttribute(this.r.o.u.is)||e.hasAttribute("is")||this.r.C.Z(e)||this.r.C.j(e,r=>{r.hasAttribute(this.M)&&this.y(r)}),n}ee(e){return e[fn]?!0:(e[fn]=!0,At(e,this.Te).forEach(n=>n[fn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.ee(e)||this.ot(e,this.x))return;let n=e.getAttribute(this.M);if(!n){$(0,this.M,e);return}e.removeAttribute(this.M),this.O(e,n)}U(e,n,o){let r=Ke(e),s=e.parentNode,a=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(a,e),ze(a,r),r.forEach(c=>{Y(c)}),e.remove(),n!=="if"&&(e[eo]=1);let i=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(i,a.nextSibling),{nodes:r,parent:s,commentBegin:a,commentEnd:i}}Re(e,n){if(!e)return[];let o=e.nextElementSibling;if(e.hasAttribute(this.X)){e.removeAttribute(this.X);let{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"else");return[{mount:()=>{ln(r,this.r,s,i)},unmount:()=>{ve(a,i)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.Y);if(!r)return[];e.removeAttribute(this.Y);let{nodes:s,parent:a,commentBegin:i,commentEnd:c}=this.U(e,"elseif",` => ${r} `),u=this.r.m.N(r),l=u.value,f=this.Re(o,n),p=wt;return Q(i,()=>{u.stop(),p(),p=wt}),p=u.subscribe(n),[{mount:()=>{ln(s,this.r,a,c)},unmount:()=>{ve(i,c)},isTrue:()=>Ue(l()[0]),isMounted:!1},...f]}}O(e,n){let o=e.nextElementSibling,{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"if",` => ${n} `),c=this.r.m.N(n),u=c.value,l=!1,f=this.r.m,p=f.L(),d=()=>{f.E(p,()=>{if(Ue(u()[0]))l||(ln(r,this.r,s,i),l=!0),y.forEach(E=>{E.unmount(),E.isMounted=!1});else{ve(a,i),l=!1;let E=!1;for(let S of y)!E&&S.isTrue()?(S.isMounted||(S.mount(),S.isMounted=!0),E=!0):(S.unmount(),S.isMounted=!1)}})},y=this.Re(o,d),m=wt;Q(a,()=>{c.stop(),m(),m=wt}),d(),m=c.subscribe(d)}};var Ke=t=>{let e=de(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},Le=(t,e)=>{for(let n=0;n<e.length;++n){let o=e[n];o.nodeType===Node.ELEMENT_NODE&&(to(o)||t.$(o))}},At=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},de=t=>t instanceof HTMLTemplateElement,Ee=t=>t.nodeType===Node.ELEMENT_NODE,at=t=>t.nodeType===Node.ELEMENT_NODE,no=t=>t instanceof HTMLSlotElement,Re=t=>de(t)?t.content.childNodes:t.childNodes,ve=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let o=n.nextSibling;Y(n),n=o}},oo=function(){return this()},Ir=function(t){return this(t)},Pr=()=>{throw new Error("value is readonly.")},Dr={get:oo,set:Ir,enumerable:!0,configurable:!1},Ur={get:oo,set:Pr,enumerable:!0,configurable:!1},Ve=(t,e)=>{t[J]=e?2:1,Object.defineProperty(t,"value",e?Ur:Dr)},ro=(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},kt=t=>`[${CSS.escape(t)}]`,Nt=(t,e)=>(t.startsWith("@")&&(t=e.u.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.u.dynamic)),t),pn=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Hr=/-(\w)/g,F=pn(t=>t&&t.replace(Hr,(e,n)=>n?n.toUpperCase():"")),Br=/\B([A-Z])/g,We=pn(t=>t&&t.replace(Br,"-$1").toLowerCase()),ct=pn(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var Ot={mount:()=>{}};var Ge=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Mt=t=>{xt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var mn=Symbol("scope"),dn=t=>{try{Wn();let e=t();sn(e);let n={context:e,unmount:()=>Oe(e),[mn]:1};return n[mn]=1,n}finally{Gn()}},so=t=>I(t)?mn in t:!1;var R=t=>{let e=t;return e!=null&&e[J]>0?e():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},$r=(t,e,n,o,r,s)=>{if(o){o=R(o),s&&s.includes("camel")&&(o=F(o)),Je(t,o,R(e[0]),R(r));return}let a=e.length;for(let i=0;i<a;++i){let c=e[i];if(w(c)){let u=R(n?.[i]?.[0]),l=R(c[0]),f=R(c[1]);Je(t,l,f,u)}else if(I(c))for(let u of Object.entries(c)){let l=u[0],f=R(u[1]),p=R(n?.[i]),d=p&&l in p?l:void 0;Je(t,l,f,d)}else{let u=R(n?.[i]),l=R(e[i++]),f=R(e[i]);Je(t,l,f,u)}}},hn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{$r(t,e,n,o,r,s)}})},Je=(t,e,n,o)=>{if(o&&o!==e&&t.removeAttribute(o),me(e)){$(3,"r-bind",t);return}if(!G(e)){$(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){me(n)?t.removeAttributeNS(io,e.slice(6,e.length)):t.setAttributeNS(io,e,n);return}if(me(n)){t.removeAttribute(e);return}if(e in jr){Ue(n)?t.setAttribute(e,""):t.removeAttribute(e);return}t.setAttribute(e,n)};var yn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(I(o))for(let r of Object.entries(o)){let s=r[0],a=r[1],i=n[s];i!==a&&(x(i)?i(a):n[s]=a)}}})};var se=(t,e)=>{Pe(e)?.onUnmounted.push(t)};var ne=(t,e,n,o=!0)=>{if(!x(t))throw _(3,"observe");n&&e(t());let s=t(void 0,void 0,0,e);return o&&se(s,!0),s};var ao=t=>t[J]===2,ut=(t,e)=>{if(t===e)return()=>{};let n=ao(t),o=ao(e);if(n&&o)return()=>{};if(n){let a=ne(t,()=>e(t()));return e(t()),a}if(o){let a=ne(e,()=>t(e()));return t(e()),a}let r=ne(t,a=>e(a)),s=ne(e,a=>t(a));return e(t()),()=>{r(),s()}};var he=[],co=t=>{he.length!==0&&he[he.length-1]?.add(t)},Qe=t=>{if(!t)return()=>{};let e={stop:()=>{}};return _r(t,e),se(()=>e.stop(),!0),e.stop},_r=(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(he.push(s),t(a=>n.push(a)),o)return;for(let a of[...s]){let i=ne(a,()=>{r(),Qe(t)});n.push(i)}}finally{he.pop()}},gn=t=>{let e=he.length,n=e>0&&he[e-1];try{return n&&he.push(null),t()}finally{n&&he.pop()}},bn=t=>{try{let e=new Set;return he.push(e),{value:t(),refs:[...e]}}finally{he.pop()}};var lt=t=>!!t&&t[Ct]===1;var ee=(t,e,n)=>{if(!x(t))return;let o=t;if(o(void 0,e,1),!n)return;let r=o();if(r){if(w(r)||le(r))for(let s of r)ee(s,e,!0);else if(Ne(r))for(let s of r)ee(s[0],e,!0),ee(s[1],e,!0);if(I(r))for(let s in r)ee(r[s],e,!0)}};function Fr(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Xe=(t,e,n)=>{n.forEach(function(o){let r=t[o];Fr(e,o,function(...a){let i=r.apply(this,a),c=this[J];for(let u of c)ee(u);return i})})},Lt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var uo=Array.prototype,xn=Object.create(uo),qr=["push","pop","shift","unshift","splice","sort","reverse"];Xe(uo,xn,qr);var lo=Map.prototype,Vt=Object.create(lo),zr=["set","clear","delete"];Lt(Vt,"Map");Xe(lo,Vt,zr);var fo=Set.prototype,It=Object.create(fo),Kr=["add","clear","delete"];Lt(It,"Set");Xe(fo,It,Kr);var xe={},oe=t=>{if(x(t)||lt(t))return t;let e={auto:!0,_value:t},n=c=>I(c)?J in c?!0:w(c)?(Object.setPrototypeOf(c,xn),!0):le(c)?(Object.setPrototypeOf(c,It),!0):Ne(c)?(Object.setPrototypeOf(c,Vt),!0):!1:!1,o=n(t),r=new Set,s=(c,u)=>{if(xe.stack&&xe.stack.length){xe.stack[xe.stack.length-1].add(i);return}r.size!==0&&gn(()=>{for(let l of[...r.keys()])r.has(l)&&l(c,u)})},a=c=>{let u=c[J];u||(c[J]=u=new Set),u.add(i)},i=(...c)=>{if(!(2 in c)){let l=c[0],f=c[1];return 0 in c?e._value===l||x(l)&&(l=l(),e._value===l)?l:(n(l)&&a(l),e._value=l,e.auto&&s(l,f),e._value):(co(i),e._value)}switch(c[2]){case 0:{let l=c[3];if(!l)return()=>{};let f=p=>{r.delete(p)};return r.add(l),()=>{f(l)}}case 1:{let l=c[1],f=e._value;s(f,l);break}case 2:return r.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return Ve(i,!1),o&&a(t),i};var po=Symbol("modelBridge"),Pt=()=>{},Wr=t=>!!t?.[po],Gr=t=>{t[po]=1},Jr=t=>{let e=oe(t());return Gr(e),e},mo={collectRefObj:!0,mount:({parseResult:t,option:e})=>{if(typeof e!="string"||!e)return Pt;let n=F(e),o,r,s=Pt,a=()=>{s(),s=Pt,o=void 0,r=void 0},i=()=>{s(),s=Pt},c=(l,f)=>{o!==l&&(i(),s=ut(l,f),o=l)},u=()=>{let l=t.refs[0]??t.value()[0],f=t.context,p=f[n];if(!x(l)){if(r&&p===r){r(l);return}if(a(),x(p)){p(l);return}f[n]=oe(l);return}if(Wr(l)){if(p===l)return;x(p)?c(l,p):f[n]=l;return}r||(r=Jr(l)),f[n]=r,c(l,r)};return{update:()=>{u()},unmount:()=>{s()}}}};var Dt=class{r;_;Ce="";Ee=-1;constructor(e){this.r=e,this._=e.o.u.inherit}k(e){this.st(e)}it(e){if(this.Ee!==e.size){let n=[...e.keys()];this.Ce=[...n,...n.map(We)].join(","),this.Ee=e.size}return this.Ce}ct(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}ut(e){if(!de(e))return!1;let n=e.getAttributeNames();return e.hasAttribute("name")?!0:n.some(o=>o.startsWith("#"))}lt(e){return de(e)&&e.getAttributeNames().length===0}st(e){let n=this.r,o=n.m,r=n.o.te,s=n.o.F;if(r.size===0&&!this.ct(o.p))return;let a=o.ne(),i=this.re();if(j(i))return;let c=this.pt(e,i);for(let u of c){if(u.hasAttribute(n.R))continue;let l=u.parentNode;if(!l)continue;let f=u.nextSibling,p=F(u.tagName).toUpperCase(),y=a[p]??s.get(p);if(!y)continue;let m=y.template;if(!m)continue;let T=u.parentElement;if(!T)continue;let E=new Comment(" begin component: "+u.tagName),S=new Comment(" end component: "+u.tagName);T.insertBefore(E,u),u.remove();let H=n.o.u.context,B=n.o.u.contextAlias,M=n.o.u.bind,q=y.props?.map(F)??[],L=[],A=g=>g==="class"||g==="style",fe=(g,C,v=!1)=>{let U={},X=g.hasAttribute(H);return o.E(C,()=>{if(o.w(U),X?n.y(yn,g,H):g.hasAttribute(B)&&n.y(yn,g,B),q.length===0)return;let N=new Map(q.map(h=>[h.toLowerCase(),h]));for(let h of[...q,...q.map(We)]){let k=g.getAttribute(h);if(k===null)continue;let O=F(h);U[O]=k,v&&y.inheritAttrs===!0&&A(O)&&L.push({name:h,value:k}),g.removeAttribute(h)}let K=n.q.ve(g,!1);for(let[h,k]of K.entries()){let[O,ie]=k.oe;if(!ie)continue;let ae=N.get(F(ie).toLowerCase());if(ae&&!(O!=="."&&O!==":"&&O!==M)){if(v&&O!=="."&&y.inheritAttrs===!0&&A(ae)){let Fn=g.getAttribute(h);Fn!==null&&L.push({name:h,value:Fn})}n.y(mo,g,h,!0,ae,k.se)}}}),U},b=[...o.L()],P=()=>{let g=fe(u,b,!0),C=new st(g,u,b,E,S,n.o.propValidationMode),v=dn(()=>y.context(C)??{}).context;if(C.autoProps){for(let[U,X]of Object.entries(g))if(U in v){let N=v[U];if(N===X)continue;if(x(N)){x(X)?C.entangle?Q(E,ut(X,N)):N(X()):N(X);continue}}else v[U]=X;for(let U of q)U in v||(v[U]=void 0);C.onAutoPropsAssigned?.()}return{componentCtx:v,head:C}},{componentCtx:z,head:Ie}=P(),pe=[...Re(m)],tn=pe.length,D=u.childNodes.length===0,V=g=>{let C=g.parentElement,v=g.name;if(j(v)&&(v=g.getAttributeNames().filter(N=>N.startsWith("#"))[0],j(v)?v="default":v=v.substring(1)),D){if(v==="default"){let N=n.o.u.text,K=u.getAttribute(N);if(!j(K)){let h=document.createElement("span");h.setAttribute(N,K),C.insertBefore(h,g),u.removeAttribute(N);return}}for(let N of[...g.childNodes])C.insertBefore(N,g);return}let U=u.querySelector(`template[name='${v}'], template[\\#${v}]`);!U&&v==="default"&&(U=[...u.querySelectorAll("template:not([name])")].find(K=>this.lt(K))??null);let X=N=>{Ie.enableSwitch&&o.E(b,()=>{o.w(z);let K=fe(g,o.L());o.E(b,()=>{o.w(K);let h=o.L(),k=Yn(h);for(let O of N)Ee(O)&&(O.setAttribute(it,k),an(k),Q(O,()=>{cn(k)}))})})};if(U){let N=[...Re(U)];for(let K of N)C.insertBefore(K,g);X(N)}else{if(v!=="default"){for(let K of[...Re(g)])C.insertBefore(K,g);return}let N=[...Re(u)].filter(K=>!this.ut(K));for(let K of N)C.insertBefore(K,g);X(N)}},Z=g=>{if(!Ee(g))return;let C=g.querySelectorAll("slot");if(no(g)){V(g),g.remove();return}for(let v of C)V(v),v.remove()};(()=>{for(let g=0;g<tn;++g)pe[g]=pe[g].cloneNode(!0),l.insertBefore(pe[g],f),Z(pe[g])})(),T.insertBefore(S,f);let te=()=>{if(!y.inheritAttrs)return;let g=pe.filter(h=>h.nodeType===Node.ELEMENT_NODE),v=g.flatMap(h=>[...h.hasAttribute(this._)?[h]:[],...h.querySelectorAll(`[${this._}]`)]).at(0)??(g.length===1?g[0]:void 0);if(!v)return;v.removeAttribute(this._);let U=`${M}:class`,X=`${M}:style`,N=(h,k,O)=>{let ie=v.hasAttribute(h)?h:v.hasAttribute(k)?k:h,ae=v.getAttribute(ie);v.setAttribute(ie,j(ae)?O:`${ae}, ${O}`)},K=(h,k)=>{if(h==="class"){let O=Ge(k);O.length>0&&v.classList.add(...O)}else if(h===":class"||h===U)N(":class",U,k);else if(h==="style"){let O=v.style,ie=u.style;for(let ae of ie)O.setProperty(ae,ie.getPropertyValue(ae))}else if(h===":style"||h===X)N(":style",X,k);else{let O=Nt(h,n.o);Je(v,O,k)}};for(let{name:h,value:k}of L)u.setAttribute(h,k);for(let h of u.getAttributeNames())h===H||h===B||K(h,u.getAttribute(h))},Te=()=>{for(let g of u.getAttributeNames())!g.startsWith("@")&&!g.startsWith(n.o.u.on)&&u.removeAttribute(g)},ke=()=>{te(),Te(),o.w(z),n.we(u,!1),z.$emit=Ie.emit,Le(n,pe),Q(u,()=>{Oe(z)}),Q(E,()=>{Ce(u)}),Mt(z)};o.E(b,ke)}}re(){let e=this.r,n=e.m,o=e.o.te,r=n.ft(),s=this.it(o);return[...s?[s]:[],...r,...r.map(We)].join(",")}Z(e){let n=this.re();return!j(n)&&e.matches?.(n)}pt(e,n){let o=[];if(j(n))return o;if(e.matches?.(n))return[e];let r=this.K(e).reverse();for(;r.length>0;){let s=r.pop();if(s.matches(n)){o.push(s);continue}r.push(...this.K(s).reverse())}return o}j(e,n){let o=this.r,r=this.re(),s=o.o.u.is,a=this.K(e).reverse();for(;a.length>0;){let i=a.pop();n(i),!(!j(r)&&i.matches(r))&&(i.hasAttribute(s)||i.hasAttribute("is")||a.push(...this.K(i).reverse()))}}K(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let a=n[s];Ee(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];Ee(a)&&r.push(a)}return r}return[]}};var Tn=class{oe;se;Se=[];constructor(e,n){this.oe=e,this.se=n}},Ut=class{r;Ae;Ve;ie;constructor(e){this.r=e,this.Ae=e.o.dt(),this.ie=new Map;let n=new Map;for(let o of this.Ae){let r=o[0]??"",s=n.get(r);s?s.push(o):n.set(r,[o])}this.Ve=n}ke(e){let n=this.ie.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(/[:@]/);j(i[0])&&(i[0]=r?".":o[0]);let c=s>=0?o.slice(s+1).split("."):[],u=!1,l=!1;for(let p=0;p<c.length;++p){let d=c[p];if(!u&&d==="camel"?u=!0:!l&&d==="prop"&&(l=!0),u&&l)break}u&&(i[i.length-1]=F(i[i.length-1])),l&&(i[0]=".");let f={terms:i,flags:c};return this.ie.set(e,f),f}ve(e,n){let o=new Map;if(!at(e))return o;let r=this.Ve,s=(i,c)=>{let u=r.get(c[0]??"");if(u)for(let l=0;l<u.length;++l){if(!c.startsWith(u[l]))continue;let f=o.get(c);if(!f){let p=this.ke(c);f=new Tn(p.terms,p.flags),o.set(c,f)}f.Se.push(i);return}},a=i=>{let c=i.attributes;if(!(!c||c.length===0))for(let u=0;u<c.length;++u){let l=c.item(u)?.name;l&&s(i,l)}};return a(e),!n||!e.firstElementChild||this.r.C.j(e,a),o}};var ho=()=>{},Qr=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},Ht=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.C.Z(e)||this.r.C.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=Ke(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),ze(s,o),o.forEach(i=>{Y(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,commentBegin:r,commentEnd:s}=this.U(e,` => ${n} `),a=this.r.m.N(n),i=a.value,c=this.r.m,u=c.L(),l={name:""},f=de(e)?o:[...o[0].childNodes],p=()=>{c.E(u,()=>{let m=i()[0];if(I(m)&&(m.name?m=m.name:m=Object.entries(c.ne()).filter(S=>S[1]===m)[0]?.[0]),!G(m)||j(m)){ve(r,s);return}if(l.name===m)return;ve(r,s);let T=s.parentNode??r.parentNode;if(!T)return;let E=document.createElement(m);for(let S of e.getAttributeNames())S!==this.I&&E.setAttribute(S,e.getAttribute(S));Qr(f,E),T.insertBefore(E,s),this.r.$(E),l.name=m})},d=ho;Q(r,()=>{a.stop(),d(),d=ho}),p(),d=a.subscribe(p)}};var Xr=(t,e)=>{let[n,o]=e;W(o)?o(t,n):t.innerHTML=n?.toString()},Bt={mount:()=>({update:({el:t,values:e})=>{Xr(t,e)}})};var jt=class t{ae;constructor(e){this.ae=e}static mt(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.ne();if(Object.keys(c).length>0||r.F.size>0)return;let u=e.q,l=[],f=0,p=[];for(let d=n.length-1;d>=0;--d)p.push(n[d]);for(;p.length>0;){let d=p.pop();if(d.nodeType===Node.ELEMENT_NODE){let m=d;if(m.tagName==="TEMPLATE"||m.tagName.includes("-"))return;let T=F(m.tagName).toUpperCase();if(r.F.has(T)||c[T])return;let E=m.attributes;for(let S=0;S<E.length;++S){let H=E.item(S)?.name;if(!H)continue;if(a.has(H))return;let{terms:B,flags:M}=u.ke(H),[q,L]=B,A=i[H]??i[q];if(A){if(A===Bt)return;l.push({nodeIndex:f,attrName:H,directive:A,option:L,flags:M})}}++f}let y=d.childNodes;for(let m=y.length-1;m>=0;--m)p.push(y[m])}if(l.length!==0)return new t(l)}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.ae.length;++s){let a=this.ae[s],i=o[a.nodeIndex];i&&e.y(a.directive,i,a.attrName,!1,a.option,a.flags)}}};var Yr=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},Zr=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 u=o[o.length-1];if(u===void 0||t[u]<c){n[i]=u??-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},$t=class{static yt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:a,removeMountItem:i,endAnchor:c}=e,u=n.length,l=o.length,f=new Array(l),p=new Set;for(let b=0;b<l;++b){let P=r(o[b]);if(P===void 0||p.has(P))return;p.add(P),f[b]=P}let d=new Array(l),y=0,m=u-1,T=l-1;for(;y<=m&&y<=T;){let b=n[y];if(r(b.value)!==f[y]||!s(b.value,o[y]))break;b.value=o[y],d[y]=b,++y}for(;y<=m&&y<=T;){let b=n[m];if(r(b.value)!==f[T]||!s(b.value,o[T]))break;b.value=o[T],d[T]=b,--m,--T}if(y>m){for(let b=T;b>=y;--b){let P=b+1<l?d[b+1].items[0]:c;d[b]=a(b,o[b],P)}return d}if(y>T){for(let b=y;b<=m;++b)i(n[b]);return d}let E=y,S=y,H=T-S+1,B=new Array(H).fill(0),M=new Map;for(let b=S;b<=T;++b)M.set(f[b],b);let q=!1,L=0;for(let b=E;b<=m;++b){let P=n[b],z=M.get(r(P.value));if(z===void 0){i(P);continue}if(!s(P.value,o[z])){i(P);continue}P.value=o[z],d[z]=P,B[z-S]=b+1,z>=L?L=z:q=!0}let A=q?Zr(B):[],fe=A.length-1;for(let b=H-1;b>=0;--b){let P=S+b,z=P+1<l?d[P+1].items[0]:c;if(B[b]===0){d[P]=a(P,o[P],z);continue}let Ie=d[P];q&&(fe>=0&&A[fe]===b?--fe:Ie&&Yr(Ie,z))}return d}};var ft=class{T=[];P=new Map;get S(){return this.T.length}ce;constructor(e){this.ce=e}ue(e){let n=this.ce(e.value);n!==void 0&&this.P.set(n,e)}le(e){let n=this.ce(this.T[e]?.value);n!==void 0&&this.P.delete(n)}static ht(e,n){return{items:[],index:e,value:n,order:-1}}w(e){e.order=this.S,this.T.push(e),this.ue(e)}gt(e,n){let o=this.S;for(let r=e;r<o;++r)this.T[r].order=r+1;n.order=e,this.T.splice(e,0,n),this.ue(n)}D(e){return this.T[e]}pe(e,n){this.le(e),this.T[e]=n,this.ue(n),n.order=e}Me(e){this.le(e),this.T.splice(e,1);let n=this.S;for(let o=e;o<n;++o)this.T[o].order=o}Oe(e){let n=this.S;for(let o=e;o<n;++o)this.le(o);this.T.splice(e)}nn(e){return this.P.has(e)}bt(e){return this.P.get(e)?.order??-1}};var Cn=Symbol("r-for"),es=t=>-1,yo=()=>{},_t=class t{r;x;Ne;R;constructor(e){this.r=e,this.x=e.o.u.for,this.Ne=kt(this.x),this.R=e.o.u.pre}k(e){let n=e.hasAttribute(this.x);return n&&this.Le(e),e.hasAttribute(this.r.o.u.is)||e.hasAttribute("is")||this.r.C.Z(e)||this.r.C.j(e,r=>{r.hasAttribute(this.x)&&this.Le(r)}),n}ee(e){return e[Cn]?!0:(e[Cn]=!0,At(e,this.Ne).forEach(n=>n[Cn]=!0),!1)}Le(e){if(e.hasAttribute(this.R)||this.ee(e))return;let n=e.getAttribute(this.x);if(!n){$(0,this.x,e);return}e.removeAttribute(this.x),this.xt(e,n)}Ie(e){return me(e)?[]:(W(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))}xt(e,n){let o=this.Tt(n);if(!o?.list){$(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=Ke(e),c=jt.mt(this.r,i),u=e.parentNode;if(!u)return;let l=`${this.x} => ${n}`,f=new Comment(`__begin__ ${l}`);u.insertBefore(f,e),ze(f,i),i.forEach(V=>{Y(V)}),e.remove();let p=new Comment(`__end__ ${l}`);u.insertBefore(p,f.nextSibling);let d=this.r,y=d.m,m=y.L(),E=m.length===1?[void 0,m[0]]:void 0,S=this.Rt(a),H=(V,Z)=>S(V)===S(Z),B=(V,Z)=>V===Z,M=(V,Z,re)=>{let te=o.createContext(Z,V),Te=ft.ht(te.index,Z),ke=()=>{let g=p.parentNode??f.parentNode??u,C=re.previousSibling,v=[];for(let U=0;U<i.length;++U){let X=i[U].cloneNode(!0);g.insertBefore(X,re),v.push(X)}for(c?c.y(d,v):Le(d,v),C=C.nextSibling;C!==re;)Te.items.push(C),C=C.nextSibling};return E?(E[0]=te.ctx,y.E(E,ke)):y.E(m,()=>{y.w(te.ctx),ke()}),Te},q=(V,Z)=>{let re=D.D(V).items,te=re[re.length-1].nextSibling;for(let Te of re)Y(Te);D.pe(V,M(V,Z,te))},L=(V,Z)=>{D.w(M(V,Z,p))},A=V=>{for(let Z of D.D(V).items)Y(Z)},fe=V=>{let Z=D.S;for(let re=V;re<Z;++re)D.D(re).index(re)},b=V=>{let Z=f.parentNode,re=p.parentNode;if(!Z||!re)return;let te=D.S;W(V)&&(V=V());let Te=R(V[0]);if(w(Te)&&Te.length===0){ve(f,p),D.Oe(0);return}let ke=[];for(let h of this.Ie(V[0]))ke.push(h);let g=$t.yt({oldItems:D.T,newValues:ke,getKey:S,isSameValue:B,mountNewValue:(h,k,O)=>M(h,k,O),removeMountItem:h=>{for(let k=0;k<h.items.length;++k)Y(h.items[k])},endAnchor:p});if(g){D.T=g,D.P.clear();for(let h=0;h<g.length;++h){let k=g[h];k.order=h,k.index(h);let O=S(k.value);O!==void 0&&D.P.set(O,k)}return}let C=0,v=Number.MAX_SAFE_INTEGER,U=te,X=this.r.o.forGrowThreshold,N=()=>D.S<U+X;for(let h of ke){let k=()=>{if(C<te){let O=D.D(C++);if(H(O.value,h)){if(B(O.value,h))return;q(C-1,h);return}let ie=D.bt(S(h));if(ie>=C&&ie-C<10){if(--C,v=Math.min(v,C),A(C),D.Me(C),--te,ie>C+1)for(let ae=C;ae<ie-1&&ae<te&&!H(D.D(C).value,h);)++ae,A(C),D.Me(C),--te;k();return}N()?(D.gt(C-1,M(C,h,D.D(C-1).items[0])),v=Math.min(v,C-1),++te):q(C-1,h)}else L(C++,h)};k()}let K=C;for(te=D.S;C<te;)A(C++);D.Oe(K),fe(v)},P=()=>{z.stop(),pe(),pe=yo},z=y.N(o.list),Ie=z.value,pe=yo,tn=0,D=new ft(S);for(let V of this.Ie(Ie()[0]))D.w(M(tn++,V,p));Q(f,P),pe=z.subscribe(b)}static Ct=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;Tt(e){let n=t.Ct.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,u)=>{let l={},f=R(c);if(!i&&o.length===1)l[o[0]]=c;else if(w(f)){let d=0;for(let y of o)l[y]=f[d++]}else for(let d of o)l[d]=f[d];let p={ctx:l,index:es};return s&&(p.index=l[s.startsWith("#")?s.substring(1):s]=oe(u)),p}}}Rt(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 a=R(s),i=this.Pe(a,o);return i!==void 0||!r?i:this.Pe(a,r)}}return o=>R(R(o)?.[n])}Et(e){return e.split(".").filter(n=>n.length>0)}Pe(e,n){let o=e;for(let r of n)o=R(o)?.[r];return R(o)}};var Ft=class{fe=0;de=new Map;m;De;Ue;Be;C;q;o;R;He;constructor(e){this.m=e,this.o=e.o,this.Ue=new _t(this),this.De=new St(this),this.Be=new Ht(this),this.C=new Dt(this),this.q=new Ut(this),this.R=this.o.u.pre,this.He=this.o.u.dynamic}vt(e){let n=de(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);Le(this,a)}}$(e){++this.fe;try{if(e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.R)||this.De.k(e)||this.Ue.k(e)||this.Be.k(e))return;this.C.k(e),this.vt(e),this.we(e,!0)}finally{--this.fe,this.fe===0&&this.wt()}}St(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)}je(e,n){let o=this.St(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,()=>{Y(e)}),o.appendChild(e),!0}At(e,n){this.de.set(e,n)}wt(){let e=this.de;if(e.size!==0){this.de=new Map;for(let[n,o]of e.entries())this.je(n,o)}}we(e,n){let o=this.q.ve(e,n),r=this.o.B;for(let[s,a]of o.entries()){let[i,c]=a.oe,u=r[s]??r[i];if(!u){console.error("directive not found:",i);continue}let l=a.Se;for(let f=0;f<l.length;++f){let p=l[f];this.y(u,p,s,!1,c,a.se)}}}y(e,n,o,r,s,a){if(n.hasAttribute(this.R))return;let i=n.getAttribute(o);n.removeAttribute(o);let c=u=>{let l=u;for(;l;){let f=l.getAttribute(it);if(f)return f;l=l.parentElement}return null};if(un()){let u=c(n);if(u){this.m.E(Zn(u),()=>{this.O(e,n,i,s,a)});return}}this.O(e,n,i,s,a)}Vt(e,n,o){return e!==Ot?!1:(j(o)||this.je(n,o)||this.At(n,o),!0)}O(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.Vt(e,n,o))return;let a=this.kt(r,e.once),i=this.Mt(e,o),c=this.Ot(i,a);Q(n,c.stop);let u=this.Nt(n,o,i,a,r,s),l=this.Lt(e,u,c);if(!l)return;let f=this.It(u,i,a,r,l);f(),e.once||(c.result=i.subscribe(f),a&&(c.dynamic=a.subscribe(f)))}kt(e,n){let o=ro(e,this.He);if(o)return this.m.N(F(o),void 0,void 0,void 0,n)}Mt(e,n){return this.m.N(n,e.isLazy,e.isLazyKey,e.collectRefObj,e.once)}Ot(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}Nt(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}}Lt(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}It(e,n,o,r,s){let a,i;return()=>{let c=n.value(),u=o?o.value()[0]:r;e.values=c,e.previousValues=a,e.option=u,e.previousOption=i,a=c,i=u,s(e)}}};var ts=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(w(s)){let i=s.length;for(let c=0;c<i;++c)go(t,s[c],a?.[c])}else go(t,s,a)}},En={mount:()=>({update:({el:t,values:e,previousValues:n})=>{ts(t,e,n)}})},go=(t,e,n)=>{let o=R(e),r=R(n),s=t.classList,a=G(o),i=G(r);if(o&&!a){let c=o;if(r&&!i){let u=r;for(let l in u)(!(l in c)||!R(c[l]))&&s.remove(l)}for(let u in c)R(c[u])&&s.add(u)}else if(a){if(r!==o){let c=i?Ge(r):[],u=Ge(o);c.length>0&&s.remove(...c),u.length>0&&s.add(...u)}}else if(r){let c=i?Ge(r):[];c.length>0&&s.remove(...c)}};function ns(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=we(t[o],e[o]);return n}function we(t,e){if(t===e)return!0;let n=on(t),o=on(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=ot(t),o=ot(e),n||o)return t===e;if(n=w(t),o=w(e),n||o)return n&&o?ns(t,e):!1;if(n=I(t),o=I(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||!we(t[a],e[a]))return!1}return!0}return String(t)===String(e)}function qt(t,e){return t.findIndex(n=>we(n,e))}var bo=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var vn=t=>{if(!x(t))throw _(3,"pause");t(void 0,void 0,3)};var Rn=t=>{if(!x(t))throw _(3,"resume");t(void 0,void 0,4)};var To={mount:({el:t,parseResult:e,flags:n})=>({update:({values:o})=>{Co(t,o[0])},unmount:os(t,e,n)})},Co=(t,e)=>{let n=wo(t);if(n&&Eo(t))w(e)?e=qt(e,Se(t))>-1:le(e)?e=e.has(Se(t)):e=us(t,e),t.checked=e;else if(n&&vo(t))t.checked=we(e,Se(t));else if(n||So(t))Ro(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(Ao(t)){let o=t.options,r=o.length,s=t.multiple;for(let a=0;a<r;a++){let i=o[a],c=Se(i);if(s)w(e)?i.selected=qt(e,c)>-1:i.selected=e.has(c);else if(we(Se(i),e)){t.selectedIndex!==a&&(t.selectedIndex=a);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else $(7,t)},pt=t=>(x(t)&&(t=t()),W(t)&&(t=t()),t?G(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}),Eo=t=>t.type==="checkbox",vo=t=>t.type==="radio",Ro=t=>t.type==="number"||t.type==="range",wo=t=>t.tagName==="INPUT",So=t=>t.tagName==="TEXTAREA",Ao=t=>t.tagName==="SELECT",os=(t,e,n)=>{let o=e.value,r=pt(n?.join(",")),s=pt(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 $(8,t),()=>{};let i=()=>e.refs[0],c=wo(t);return c&&Eo(t)?ss(t,i):c&&vo(t)?ls(t,i):c||So(t)?rs(t,a,i,o):Ao(t)?fs(t,i,o):($(7,t),()=>{})},xo=/[.,' ·٫]/,rs=(t,e,n,o)=>{let s=e.lazy?"change":"input",a=Ro(t),i=()=>{!e.trim&&!pt(o()[1]).trim||(t.value=t.value.trim())},c=p=>{let d=p.target;d.composing=1},u=p=>{let d=p.target;d.composing&&(d.composing=0,d.dispatchEvent(new Event(s)))},l=()=>{t.removeEventListener(s,f),t.removeEventListener("change",i),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",u),t.removeEventListener("change",u)},f=p=>{let d=n();if(!d)return;let y=p.target;if(!y||y.composing)return;let m=y.value,T=pt(o()[1]);if(a||T.number||T.int){if(T.int)m=parseInt(m);else{if(xo.test(m[m.length-1])&&m.split(xo).length===2){if(m+="0",m=parseFloat(m),isNaN(m))m="";else if(d()===m)return}m=parseFloat(m)}isNaN(m)&&(m=""),t.value=m}else T.trim&&(m=m.trim());d(m)};return t.addEventListener(s,f),t.addEventListener("change",i),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",u),t.addEventListener("change",u),l},ss=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=Se(t),i=t.checked,c=s();if(w(c)){let u=qt(c,a),l=u!==-1;i&&!l?c.push(a):!i&&l&&c.splice(u,1)}else le(c)?i?c.add(a):c.delete(a):s(cs(t,i))};return t.addEventListener(n,r),o},Se=t=>"_value"in t?t._value:t.value,ko="trueValue",is="falseValue",No="true-value",as="false-value",cs=(t,e)=>{let n=e?ko:is;if(n in t)return t[n];let o=e?No:as;return t.hasAttribute(o)?t.getAttribute(o):e},us=(t,e)=>{if(ko in t)return we(e,t.trueValue);let o=No;return t.hasAttribute(o)?we(e,t.getAttribute(o)):we(e,!0)},ls=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=Se(t);s(a)};return t.addEventListener(n,r),o},fs=(t,e,n)=>{let o="change",r=ps(t,n),s=()=>{t.removeEventListener(o,a),r()},a=()=>{let i=e();if(!i)return;let u=pt(n()[1]).number,l=Array.prototype.filter.call(t.options,f=>f.selected).map(f=>u?bo(Se(f)):Se(f));if(t.multiple){let f=i();try{if(vn(i),le(f)){f.clear();for(let p of l)f.add(p)}else w(f)?(f.splice(0),f.push(...l)):i(l)}finally{Rn(i),ee(i)}}else i(l[0])};return t.addEventListener(o,a),s},ps=(t,e)=>{let n=globalThis.MutationObserver??globalThis.window?.MutationObserver;if(!n)return()=>{};let o=!1,r=!1,s=()=>{o=!1,!r&&Co(t,e()[0])},a=()=>{o||(o=!0,typeof queueMicrotask=="function"?queueMicrotask(s):Promise.resolve().then(s))},i=new n(a);return i.observe(t,{attributes:!0,attributeFilter:["value"],childList:!0,subtree:!0}),()=>{r=!0,i.disconnect()}};var ms=["stop","prevent","capture","self","once","left","right","middle","passive"],ds=t=>{let e={};if(j(t))return;let n=t.split(",");for(let o of ms)e[o]=n.includes(o);return e},hs=(t,e,n,o,r)=>{if(o){let u=e.value(),l=R(o.value()[0]);return G(l)?wn(t,F(l),()=>e.value()[0],r?.join(",")??u[1]):()=>{}}else if(n){let u=e.value();return wn(t,F(n),()=>e.value()[0],r?.join(",")??u[1])}let s=[],a=()=>{s.forEach(u=>u())},i=e.value(),c=i.length;for(let u=0;u<c;++u){let l=i[u];if(W(l)&&(l=l()),I(l))for(let f of Object.entries(l)){let p=f[0],d=()=>{let m=e.value()[u];return W(m)&&(m=m()),m=m[p],W(m)&&(m=m()),m},y=l[p+"_flags"];s.push(wn(t,p,d,y))}else $(2,"r-on",t)}return a},Sn={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})=>hs(t,e,n,o,r)},ys=(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=u=>!(r&&!u.ctrlKey||s&&!u.shiftKey||a&&!u.altKey||i&&!u.metaKey);return o?[t,u=>c(u)?u.key.toUpperCase()===o.toUpperCase():!1]:[t,c]}return[t,n=>!0]},wn=(t,e,n,o)=>{if(j(e))return $(5,"r-on",t),()=>{};let r=ds(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,a;[e,a]=ys(e,o);let i=l=>{if(!a(l)||!n&&e==="submit"&&r?.prevent)return;let f=n(l);W(f)&&(f=f(l)),W(f)&&f(l)},c=()=>{t.removeEventListener(e,u,s)},u=l=>{if(!r){i(l);return}try{if(r.left&&l.button!==0||r.middle&&l.button!==1||r.right&&l.button!==2||r.self&&l.target!==t)return;r.stop&&l.stopPropagation(),r.prevent&&l.preventDefault(),i(l)}finally{r.once&&c()}};return t.addEventListener(e,u,s),c};var gs=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=F(n)),Ye(t,n,e[0]);return}let r=e.length;for(let s=0;s<r;++s){let a=e[s];if(w(a)){let i=a[0],c=a[1];Ye(t,i,c)}else if(I(a))for(let i of Object.entries(a)){let c=i[0],u=i[1];Ye(t,c,u)}else{let i=e[s++],c=e[s];Ye(t,i,c)}}},Oo={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{gs(t,e,n,o)}})};function bs(t){return!!t||t===""}var Ye=(t,e,n)=>{if(me(e)){$(3,":prop",t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(Ce),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=bs(n):n==null&&s==="string"?(n="",r=!0):s==="number"&&(n=0,r=!0)}try{t[e]=n}catch(s){r||$(4,e,o,n,s)}r&&t.removeAttribute(e)};var Mo={once:!0,mount:({el:t,parseResult:e,expr:n})=>{let o=e,r=o.value()[0],s=w(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 xs=(t,e)=>{let n=De(t).data,o=n._ord;zn(o)&&(o=n._ord=t.style.display),Ue(e[0])?t.style.display=o:t.style.display="none"},Lo={mount:()=>({update:({el:t,values:e})=>{xs(t,e)}})};var Ts=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(w(s)){let i=s.length;for(let c=0;c<i;++c)Vo(t,s[c],a?.[c])}else Vo(t,s,a)}},zt={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Ts(t,e,n)}})},Vo=(t,e,n)=>{let o=R(e),r=R(n),s=t.style,a=G(o);if(o&&!a){let i=o;if(r&&!G(r)){let c=r;for(let u in c)R(i[u])==null&&kn(s,u,"")}for(let c in i)kn(s,c,i[c])}else{let i=s.display;if(a?r!==o&&(s.cssText=o):r&&t.removeAttribute("style"),"_ord"in De(t).data)return;s.display=i}},Io=/\s*!important$/;function kn(t,e,n){let o=R(n);if(w(o))o.forEach(r=>{kn(t,e,r)});else{let r=o==null?"":String(o);if(e.startsWith("--"))t.setProperty(e,r);else{let s=Cs(t,e);Io.test(r)?t.setProperty(We(s),r.replace(Io,""),"important"):t[s]=r}}}var Po=["Webkit","Moz","ms"],An={};function Cs(t,e){let n=An[e];if(n)return n;let o=F(e);if(o!=="filter"&&o in t)return An[e]=o;o=ct(o);for(let r=0;r<Po.length;r++){let s=Po[r]+o;if(s in t)return An[e]=s}return e}var ue=t=>Do(R(t)),Do=(t,e=new WeakMap)=>{if(!t||!I(t))return t;if(w(t))return t.map(ue);if(le(t)){let o=new Set;for(let r of t.keys())o.add(ue(r));return o}if(Ne(t)){let o=new Map;for(let r of t)o.set(ue(r[0]),ue(r[1]));return o}if(e.has(t))return R(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Do(R(o[1]),e);return n};var Es=(t,e)=>{let n=e[0];t.textContent=le(n)?JSON.stringify(ue([...n])):Ne(n)?JSON.stringify(ue([...n])):I(n)?JSON.stringify(ue(n)):n?.toString()??""},Uo={mount:()=>({update:({el:t,values:e})=>{Es(t,e)}})};var Ho={mount:()=>({update:({el:t,values:e})=>{Ye(t,"value",e[0])}})};var Ze=t=>t?.[Tt]===1;function Be(t){if(lt(t))return t;let e;if(x(t)?(e=t,t=e()):e=oe(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[Tt]=1,w(t)){let n=t.length;for(let o=0;o<n;++o){let r=t[o];Ze(r)||(t[o]=Be(r))}return e}if(!I(t))return e;for(let n of Object.entries(t)){let o=n[1];if(Ze(o))continue;let r=n[0];ot(r)||(t[r]=null,t[r]=Be(o))}return e}var ye=class t{static getDefault(){return t.$e??(t.$e=new t)}B={};u={};dt=()=>Object.keys(this.B).filter(e=>e.length===1||!e.startsWith(":"));te=new Map;F=new Map;static $e;static Pt="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.Dt()}Dt(){let e={},n=globalThis;for(let o of t.Pt.split(","))e[o]=n[o];return e.ref=Be,e.sref=oe,e.flatten=ue,e}addComponent(...e){for(let n of e){if(!n.defaultName){qe.warning("Registered component's default name is not defined",n);continue}this.te.set(ct(n.defaultName),n),this.F.set(ct(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":Oo,":":hn,"@":Sn,[`${e}on`]:Sn,[`${e}bind`]:hn,[`${e}html`]:Bt,[`${e}text`]:Uo,[`${e}show`]:Lo,[`${e}model`]:To,":style":zt,[`${e}style`]:zt,[`${e}bind:style`]:zt,":class":En,[`${e}bind:class`]:En,":ref":Mo,":value":Ho,[`${e}teleport`]:Ot},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 Kt=(t,e)=>{if(!t)return;let o=(e??ye.getDefault()).u,r=/(\{\{[^]*?\}\}|\[\[[^]*?\]\])/g,s=[{start:"{{",end:"}}"},{start:"[[",end:"]]"}];for(let a of Rs(t,o.pre,s))vs(a,o.text,r,s)},vs=(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],u=Bo(c,o);if(u&&j(a[0])&&j(a[2])){let l=t.parentElement;l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),l.innerText="";return}}let i=document.createDocumentFragment();for(let c of a){let u=Bo(c,o);if(u){let l=document.createElement("span");l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),i.appendChild(l)}else i.appendChild(document.createTextNode(c))}t.replaceWith(i)},Rs=(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 Re(s))r(a)}};return r(t),o},Bo=(t,e)=>e.find(n=>t.startsWith(n.start)&&t.endsWith(n.end));var ws=9,Ss=10,As=13,ks=32,Ae=46,Wt=44,Ns=39,Os=34,Gt=40,et=41,Jt=91,Nn=93,On=63,Ms=59,jo=58,$o=123,Qt=125,je=43,Xt=45,Mn=96,_o=47,Ln=92,Fo=new Set([2,3]),Jo={"=":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},Ls={"=>":2,...Jo,"||":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},Qo=Object.keys(Jo),Vs=new Set(Qo),In=new Set(["=>"]);Qo.forEach(t=>In.add(t));var qo={true:!0,false:!1,null:null},Is="this",tt="Expected ",$e="Unexpected ",Dn="Unclosed ",Ps=tt+":",zo=tt+"expression",Ds="missing }",Us=$e+"object property",Hs=Dn+"(",Ko=tt+"comma",Wo=$e+"token ",Bs=$e+"period",Vn=tt+"expression after ",js="missing unaryOp argument",$s=Dn+"[",_s=tt+"exponent (",Fs="Variable names cannot start with a number (",qs=Dn+'quote after "',mt=t=>t>=48&&t<=57,Go=t=>Ls[t],Pn=class{l;e;get H(){return this.l.charAt(this.e)}get h(){return this.l.charCodeAt(this.e)}f(e){return this.l.charCodeAt(this.e)===e}constructor(e){this.l=e,this.e=0}z(e){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>=128}me(e){return this.z(e)||mt(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.l,o=this.e;for(;e===ks||e===ws||e===Ss||e===As;)e=n.charCodeAt(++o);this.e=o}parse(){let e=this.ye();return e.length===1?e[0]:{type:0,body:e}}ye(e){let n=[];for(;this.e<this.l.length;){let o=this.h;if(o===Ms||o===Wt)this.e++;else{let r=this.A();if(r)n.push(r);else if(this.e<this.l.length){if(o===e)break;throw this.i($e+'"'+this.H+'"')}}}return n}A(){let e=this.Ut()??this._e();return this.g(),this.Bt(e)}he(){this.g();let e=this.l,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.me(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.W(),!s||(n=this.he(),!n))return s;if(r={value:n,prec:Go(n),right_a:In.has(n)},a=this.W(),!a)throw this.i(Vn+n);let u=[s,r,a];for(;n=this.he();){o=Go(n),r={value:n,prec:o,right_a:In.has(n)},c=n;let l=f=>r.right_a&&f.right_a?o>f.prec:o<=f.prec;for(;u.length>2&&l(u[u.length-2]);)a=u.pop(),n=u.pop().value,s=u.pop(),e=this.Fe(n,s,a),u.push(e);if(e=this.W(),!e)throw this.i(Vn+c);u.push(r,e)}for(i=u.length-1,e=u[i];i>1;)e=this.Fe(u[i-1].value,u[i-2],e),i-=2;return e}W(){let e;if(this.g(),e=this.Ht(),e)return this.ge(e);let n=this.h;if(mt(n)||n===Ae)return this.jt();if(n===Ns||n===Os)e=this.$t();else if(n===Jt)e=this._t();else{let o=this.Ft();if(o){let r=this.W();if(!r)throw this.i(js);return this.ge({type:7,operator:o,argument:r})}this.z(n)?(e=this.be(),e.name in qo?e={type:4,value:qo[e.name],raw:e.name}:e.name===Is&&(e={type:5})):n===Gt&&(e=this.qt())}return e?(e=this.G(e),this.ge(e)):!1}Fe(e,n,o){if(e==="=>"){let r=n.type===1?n.expressions:[n];return{type:15,params:r,body:o}}return Vs.has(e)?{type:16,operator:e,left:n,right:o}:{type:8,operator:e,left:n,right:o}}Ht(){let e={node:!1};return this.Kt(e),e.node||(this.zt(e),e.node)||(this.Wt(e),e.node)||(this.qe(e),e.node)||this.Gt(e),e.node}ge(e){let n={node:e};return this.Jt(n),this.Qt(n),this.Xt(n),n.node}Ft(){let e=this.l,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),a=e.charCodeAt(n+3);return o===Xt?(this.e++,"-"):o===33?(this.e++,"!"):o===126?(this.e++,"~"):o===je?(this.e++,"+"):o===110&&r===101&&s===119&&!this.me(a)?(this.e+=3,"new"):!1}Ut(){let e={};return this.Yt(e),e.node}Bt(e){let n={node:e};return this.Zt(n),n.node}G(e){this.g();let n=this.h;for(;n===Ae||n===Jt||n===Gt||n===On;){let o;if(n===On){if(this.l.charCodeAt(this.e+1)!==Ae)break;o=!0,this.e+=2,this.g(),n=this.h}if(this.e++,n===Jt){if(e={type:3,computed:!0,object:e,property:this.A()},this.g(),n=this.h,n!==Nn)throw this.i($s);this.e++}else n===Gt?e={type:6,arguments:this.Ke(et),callee:e}:(o&&this.e--,this.g(),e={type:3,computed:!1,object:e,property:this.be()});o&&(e.optional=!0),this.g(),n=this.h}return e}jt(){let e=this.l,n=this.e,o=n;for(;mt(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===Ae)for(o++;mt(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let i=e.charCodeAt(o);(i===je||i===Xt)&&o++;let c=o;for(;mt(e.charCodeAt(o));)o++;if(c===o){this.e=o;let u=e.slice(n,o);throw this.i(_s+u+this.H+")")}}this.e=o;let s=e.slice(n,o),a=e.charCodeAt(o);if(this.z(a))throw this.i(Fs+s+this.H+")");if(a===Ae||s.length===1&&s.charCodeAt(0)===Ae)throw this.i(Bs);return{type:4,value:parseFloat(s),raw:s}}$t(){let e=this.l,n=e.length,o=this.e,r=e.charCodeAt(this.e++),s=this.e,a=s,i=[],c=!1,u=!1;for(;s<n;){let f=e.charCodeAt(s);if(f===r){u=!0,this.e=s+1;break}if(f===Ln){c||(c=!0),i.push(e.slice(a,s));let p=e.charCodeAt(s+1);i.push(this.ze(p)),s+=2,a=s}else s++}let l=c?i.join("")+e.slice(a,u?s:n):e.slice(a,u?s:n);if(!u)throw this.e=s,this.i(qs+l+'"');return{type:4,value:l,raw:e.substring(o,this.e)}}ze(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)}}be(){let e=this.h,n=this.e;if(this.z(e))this.e++;else throw this.i($e+this.H);for(;this.e<this.l.length&&(e=this.h,this.me(e));)this.e++;return{type:2,name:this.l.slice(n,this.e)}}Ke(e){let n=[],o=!1,r=0;for(;this.e<this.l.length;){this.g();let s=this.h;if(s===e){if(o=!0,this.e++,e===et&&r&&r>=n.length)throw this.i(Wo+String.fromCharCode(e));break}else if(s===Wt){if(this.e++,r++,r!==n.length){if(e===et)throw this.i(Wo+",");for(let a=n.length;a<r;a++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(Ko);{let a=this.A();if(!a||a.type===0)throw this.i(Ko);n.push(a)}}}if(!o)throw this.i(tt+String.fromCharCode(e));return n}qt(){this.e++;let e=this.ye(et);if(this.f(et))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(Hs)}_t(){return this.e++,{type:9,elements:this.Ke(Nn)}}Kt(e){if(this.f($o)){this.e++;let n=[];for(;!isNaN(this.h);){if(this.g(),this.f(Qt)){this.e++,e.node=this.G({type:10,properties:n});return}let o=this.A();if(!o)break;if(this.g(),o.type===2&&(this.f(Wt)||this.f(Qt)))n.push({type:12,computed:!1,key:o,value:o,shorthand:!0});else if(this.f(jo)){this.e++;let r=this.A();if(!r)throw this.i(Us);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(Wt)&&this.e++}throw this.i(Ds)}}zt(e){let n=this.h;if((n===je||n===Xt)&&n===this.l.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===je?"++":"--",argument:this.G(this.be()),prefix:!0};if(!o.argument||!Fo.has(o.argument.type))throw this.i($e+o.operator)}}Qt(e){let n=e.node,o=this.h;if((o===je||o===Xt)&&o===this.l.charCodeAt(this.e+1)){if(!Fo.has(n.type))throw this.i($e+(o===je?"++":"--"));this.e+=2,e.node={type:13,operator:o===je?"++":"--",argument:n,prefix:!1}}}Wt(e){this.l.charCodeAt(this.e)===Ae&&this.l.charCodeAt(this.e+1)===Ae&&this.l.charCodeAt(this.e+2)===Ae&&(this.e+=3,e.node={type:14,argument:this.A()})}Zt(e){if(e.node&&this.f(On)){this.e++;let n=e.node,o=this.A();if(!o)throw this.i(zo);if(this.g(),this.f(jo)){this.e++;let r=this.A();if(!r)throw this.i(zo);e.node={type:11,test:n,consequent:o,alternate:r}}else throw this.i(Ps)}}Yt(e){if(this.g(),this.f(Gt)){let n=this.e;if(this.e++,this.g(),this.f(et)){this.e++;let o=this.he();if(o==="=>"){let r=this._e();if(!r)throw this.i(Vn+o);e.node={type:15,params:null,body:r};return}}this.e=n}}Xt(e){let n=e.node,o=n.type;(o===2||o===3)&&this.f(Mn)&&(e.node={type:17,tag:n,quasi:this.qe(e)})}qe(e){if(!this.f(Mn))return;let n=this.l,o=n.length,r={type:19,quasis:[],expressions:[]},s=++this.e,a=[],i=[],c=!1,u=l=>{if(!c){let d=n.slice(s,this.e);return r.quasis.push({type:18,value:{raw:d,cooked:d},tail:l})}a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let f=a.join(""),p=i.join("");return a.length=0,i.length=0,c=!1,r.quasis.push({type:18,value:{raw:f,cooked:p},tail:l})};for(;this.e<o;){let l=n.charCodeAt(this.e);if(l===Mn)return u(!0),this.e+=1,e.node=r,r;if(l===36&&n.charCodeAt(this.e+1)===$o){if(u(!1),this.e+=2,r.expressions.push(...this.ye(Qt)),!this.f(Qt))throw this.i("unclosed ${");this.e+=1,s=this.e}else if(l===Ln){c||(c=!0),a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let f=n.charCodeAt(this.e+1);a.push(n.slice(this.e,this.e+2)),i.push(this.ze(f)),this.e+=2,s=this.e}else this.e+=1}throw this.i("Unclosed `")}Jt(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}Gt(e){if(!this.f(_o))return;let n=++this.e,o=!1;for(;this.e<this.l.length;){if(this.h===_o&&!o){let r=this.l.slice(n,this.e),s="";for(;++this.e<this.l.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.l.slice(n-1,this.e)},e.node=this.G(e.node),e.node}this.f(Jt)?o=!0:o&&this.f(Nn)&&(o=!1),this.e+=this.f(Ln)?2:1}throw this.i("Unclosed Regex")}},Xo=t=>new Pn(t).parse();var zs={"=>":(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},Ks={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},tr=t=>{if(!t?.some(er))return t;let e=[];return t.forEach(n=>er(n)?e.push(...n):e.push(n)),e},Yo=(...t)=>tr(t),Un=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},Ws={"++":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(++o),o}return++t[e]},"--":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(--o),o}return--t[e]}},Gs={"++":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(o+1),o}return t[e]++},"--":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(o-1),o}return t[e]--}},Zo={"=":(t,e,n)=>{let o=t[e];return x(o)?o(n):t[e]=n},"+=":(t,e,n)=>{let o=t[e];return x(o)?o(o()+n):t[e]+=n},"-=":(t,e,n)=>{let o=t[e];return x(o)?o(o()-n):t[e]-=n},"*=":(t,e,n)=>{let o=t[e];return x(o)?o(o()*n):t[e]*=n},"/=":(t,e,n)=>{let o=t[e];return x(o)?o(o()/n):t[e]/=n},"%=":(t,e,n)=>{let o=t[e];return x(o)?o(o()%n):t[e]%=n},"**=":(t,e,n)=>{let o=t[e];return x(o)?o(o()**n):t[e]**=n},"<<=":(t,e,n)=>{let o=t[e];return x(o)?o(o()<<n):t[e]<<=n},">>=":(t,e,n)=>{let o=t[e];return x(o)?o(o()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let o=t[e];return x(o)?o(o()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let o=t[e];return x(o)?o(o()|n):t[e]|=n},"&=":(t,e,n)=>{let o=t[e];return x(o)?o(o()&n):t[e]&=n},"^=":(t,e,n)=>{let o=t[e];return x(o)?o(o()^n):t[e]^=n}},Yt=(t,e)=>W(t)?t.bind(e):t,Hn=class{p;We;Ge;Je;V;Qe;Xe;constructor(e,n,o,r,s){this.p=w(e)?e:[e],this.We=n,this.Ge=o,this.Je=r,this.Xe=!!s}Ye(e,n){if(n&&e in n)return n;for(let o of this.p)if(e in o)return o}2(e,n,o){let r=e.name;if(r==="$root")return this.p[this.p.length-1];if(r==="$parent")return this.p[1];if(r==="$ctx")return[...this.p];if(o&&r in o)return this.V=o[r],Yt(R(o[r]),o);for(let a of this.p)if(r in a)return this.V=a[r],Yt(R(a[r]),a);let s=this.We;if(s&&r in s)return this.V=s[r],Yt(R(s[r]),s)}5(e,n,o){return this.p[0]}0(e,n,o){return this.Ze(n,o,Yo,...e.body)}1(e,n,o){return this.v(n,o,(...r)=>r.pop(),...e.expressions)}3(e,n,o){let{obj:r,key:s}=this.xe(e,n,o),a=r?.[s];return this.V=a,Yt(R(a),r)}4(e,n,o){return e.value}6(e,n,o){let r=(a,...i)=>W(a)?a(...tr(i)):a,s=this.v(++n,o,r,e.callee,...e.arguments);return this.V=s,s}7(e,n,o){return this.v(n,o,Ks[e.operator],e.argument)}8(e,n,o){let r=zs[e.operator];switch(e.operator){case"||":case"&&":case"??":return r(()=>this.b(e.left,n,o),()=>this.b(e.right,n,o))}return this.v(n,o,r,e.left,e.right)}9(e,n,o){return this.Ze(++n,o,Yo,...e.elements)}10(e,n,o){let r={},s=(...a)=>{a.forEach(i=>{Object.assign(r,i)})};return this.v(++n,o,s,...e.properties),r}11(e,n,o){return this.v(n,o,r=>this.b(r?e.consequent:e.alternate,n,o),e.test)}12(e,n,o){let r={},s=l=>l?.type!==15,a=this.Je??(()=>!1),i=n===0&&this.Xe,c=l=>this.et(i,e.key,n,Un(l,o)),u=l=>this.et(i,e.value,n,Un(l,o));if(e.shorthand){let l=e.key.name;r[l]=s(e.key)&&a(l,n)?c:c()}else if(e.computed){let l=R(c());r[l]=s(e.value)&&a(l,n)?u:u()}else{let l=e.key.type===4?e.key.value:e.key.name;r[l]=s(e.value)&&a(l,n)?()=>u:u()}return r}xe(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?Ws:Gs;if(r.type===2){let i=r.name,c=this.Ye(i,o);return me(c)?void 0:a[s](c,i)}if(r.type===3){let{obj:i,key:c}=this.xe(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.Ye(a,o);if(me(i))return;let c=this.b(e.right,n,o);return Zo[s](i,a,c)}if(r.type===3){let{obj:a,key:i}=this.xe(r,n,o),c=this.b(e.right,n,o);return Zo[s](a,i,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return w(r)&&(r.s=nr),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.v(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.v(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=R(this[e.type](e,n,o));return this.Qe=e.type,r}et(e,n,o,r){let s=this.b(n,o,r);return e&&this.tt()?this.V:s}tt(){let e=this.Qe;return(e===2||e===3||e===6)&&x(this.V)}eval(e,n){let{value:o,refs:r}=bn(()=>this.b(e,-1,n)),s={value:o,refs:r};return this.tt()&&(s.ref=this.V),s}v(e,n,o,...r){let s=r.map(a=>a&&this.b(a,e,n));return o(...s)}Ze(e,n,o,...r){let s=this.Ge;if(!s)return this.v(e,n,o,...r);let a=r.map((i,c)=>i&&(i.type!==15&&s(c,e)?u=>this.b(i,e,Un(u,n)):this.b(i,e,n)));return o(...a)}},nr=Symbol("s"),er=t=>t?.s===nr,or=(t,e,n,o,r,s,a)=>new Hn(e,n,o,r,a).eval(t,s);var rr={},sr=t=>!!t,Zt=class{p;o;constructor(e,n){this.p=e,this.o=n}w(e){this.p=[e,...this.p]}ne(){return this.p.map(n=>n.components).filter(sr).reverse().reduce((n,o)=>{for(let[r,s]of Object.entries(o))n[r.toUpperCase()]=s;return n},{})}ft(){let e=[],n=new Set,o=this.p.map(r=>r.components).filter(sr).reverse();for(let r of o)for(let s of Object.keys(r))n.has(s)||(n.add(s),e.push(s));return e}N(e,n,o,r,s){let a=[],i=[],c=new Set,u=()=>{for(let E=0;E<i.length;++E)i[E]();i.length=0},p={value:()=>a,stop:()=>{u(),c.clear()},subscribe:(E,S)=>(c.add(E),S&&E(a),()=>{c.delete(E)}),refs:[],context:this.p[0]};if(j(e))return p;let d=this.o.globalContext,y=[],m=new Set,T=(E,S,H,B)=>{try{let M=or(E,S,d,n,o,B,r);return H&&M.refs.length>0&&y.push(...M.refs),{value:M.value,refs:M.refs,ref:M.ref}}catch(M){$(6,`evaluation error: ${e}`,M)}return{value:void 0,refs:[]}};try{let E=rr[e]??Xo("["+e+"]");rr[e]=E;let S=this.p.slice(),H=E.elements,B=H.length,M=new Array(B);p.refs=M;let q=()=>{y.length=0,s||(m.clear(),u());let L=new Array(B);for(let A=0;A<B;++A){let fe=H[A];if(n?.(A,-1)){L[A]=P=>T(fe,S,!1,{$event:P}).value;continue}let b=T(fe,S,!0);L[A]=b.value,M[A]=b.ref}if(!s)for(let A of y)m.has(A)||(m.add(A),i.push(ne(A,q)));if(a=L,c.size!==0)for(let A of c)c.has(A)&&A(a)};q()}catch(E){$(6,`parse error: ${e}`,E)}return p}L(){return this.p.slice()}nt=[];pe(e){this.nt.push(this.p),this.p=e}E(e,n){try{this.pe(e),n()}finally{this.en()}}en(){this.p=this.nt.pop()??[]}};var ir=t=>{let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||t==="-"||t==="_"||t===":"},Js=(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||!ir(t[n]))return null;let o=n,r=!1;for(;n<t.length&&ir(t[n]);){let s=t.charCodeAt(n);s>=65&&s<=90&&(r=!0),++n}return{start:o,end:n,hasUppercase:r}},ar=t=>{switch(t){case"table":case"thead":case"tbody":case"tfoot":return!0;default:return!1}},Xs=t=>{switch(t){case"thead":case"tbody":case"tfoot":return!0;default:return!1}},Ys=t=>{switch(t){case"caption":case"colgroup":case"thead":case"tbody":case"tfoot":case"tr":return!0;default:return!1}},dt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Zs=t=>{switch(t){case"caption":return"captionx";case"thead":return"theadx";case"tbody":return"tbodyx";case"tfoot":return"tfootx";case"tr":return"trx";case"td":return"tdx";case"th":return"thx";case"colgroup":return"colgroupx";case"col":return"colx";default:return null}},ei=t=>{switch(t){case"captionx":return"caption";case"theadx":return"thead";case"tbodyx":return"tbody";case"tfootx":return"tfoot";case"trx":return"tr";case"tdx":return"td";case"thx":return"th";case"colgroupx":return"colgroup";case"colx":return"col";default:return}},ti=(t,e)=>`${t}</${e}>`,cr=(t,e)=>`${t.slice(0,t.length-2)}></${e}>`,en=t=>{let e=0,n=[],o=[],r=[],s=0;for(;e<t.length;){let a=t.indexOf("<",e);if(a===-1){n.push(t.slice(e));break}if(n.push(t.slice(e,a)),t.startsWith("<!--",a)){let L=t.indexOf("-->",a+4);if(L===-1){n.push(t.slice(a));break}n.push(t.slice(a,L+3)),e=L+3;continue}let i=Js(t,a);if(i===-1){n.push(t.slice(a));break}let c=t.slice(a,i+1),u=c.startsWith("</");if(c.startsWith("<!")||c.startsWith("<?")){n.push(c),e=i+1;continue}let f=Qs(c,u);if(!f){n.push(c),e=i+1;continue}let p=c.slice(f.start,f.end),d=f.hasUppercase?"":p;if(u){let L=r[r.length-1];if(L?.tagName===p){r.pop(),L.emit&&n.push(c),e=i+1;continue}let A=o[o.length-1];A?(o.pop(),n.push(A.replacementHost?`</${A.replacementHost}>`:c),!A.isTableAlias&&ar(A.effectiveTag)&&--s):n.push(c),e=i+1;continue}let y=c.charCodeAt(c.length-2)===47,m=o[o.length-1],T=null;s===0?T=Zs(d):Xs(m?.effectiveTag??"")?T=d==="tr"?null:"tr":m?.effectiveTag==="table"?T=Ys(d)?null:"tr":m?.effectiveTag==="tr"?T=d==="td"||d==="th"?null:"td":m?.effectiveTag==="colgroup"&&(T=d==="col"?null:"col");let E=ei(T),S=E!==void 0,H=y&&!dt.has(T||d),B=!!T&&E===d&&dt.has(d),M=!y&&!!T&&dt.has(T)&&!B,q=!y&&!T&&dt.has(d);if(T){let L=`${c.slice(0,f.start)}${T} is="${E?`r-${E}`:`regor:${p}`}"${c.slice(f.end)}`;n.push(H?cr(L,T):B?ti(L,T):L)}else n.push(H?cr(c,p):c);if(M?r.push({tagName:p,emit:!1}):B&&!y?r.push({tagName:p,emit:!1}):q&&r.push({tagName:p,emit:!0}),!y&&!B&&!M&&!q&&!dt.has(T??d)){let L=E??T??(d||p);o.push({replacementHost:T,effectiveTag:L,isTableAlias:S}),!S&&ar(L)&&++s}e=i+1}return n.join("")};var ni="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",oi=new Set(ni.toUpperCase().split(",")),ri="http://www.w3.org/2000/svg",ur=(t,e)=>{de(t)?t.content.appendChild(e):t.appendChild(e)},Bn=(t,e,n,o)=>{let r=t.t;if(r){let a=n&&oi.has(r.toUpperCase())?document.createElementNS(ri,r.toLowerCase()):document.createElement(r),i=t.a;if(i)for(let u of Object.entries(i)){let l=u[0],f=u[1];l.startsWith("#")&&(f=l.substring(1),l="name"),a.setAttribute(Nt(l,o),f)}let c=t.c;if(c)for(let u of c)Bn(u,a,n,o);ur(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)ur(e,a);else throw new Error("unsupported node type.")}},nt=(t,e,n)=>{n??=ye.getDefault();let o=document.createDocumentFragment();if(!w(t))return Bn(t,o,!!e,n),o;for(let r of t)Bn(r,o,!!e,n);return o};var si=(t,e={selector:"#app"},n)=>{G(e)&&(e={selector:"#app",template:e}),so(t)&&(t=t.context);let o=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!o||!Ee(o))throw _(0);n||(n=ye.getDefault());let r=()=>{for(let i of[...o.childNodes])Y(i)},s=i=>{for(;i.length>0;)o.appendChild(i[0])};if(e.template){let i=document.createRange().createContextualFragment(en(e.template));r(),s(i.childNodes),e.element=i}else if(e.json){let i=nt(e.json,e.isSVG,n);r(),s(i.childNodes)}return n.useInterpolation&&Kt(o,n),new jn(t,o,n).y(),Q(o,()=>{Oe(t)}),Mt(t),{context:t,unmount:()=>{Y(o)},unbind:()=>{Ce(o)}}},jn=class{tn;rt;o;m;r;constructor(e,n,o){this.tn=e,this.rt=n,this.o=o,this.m=new Zt([e],o),this.r=new Ft(this.m)}y(){this.r.$(this.rt)}};var ht=t=>{if(w(t))return t.map(r=>ht(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=Re(t);return o.length>0&&(e.c=[...o].map(r=>ht(r))),e};var ii=(t,e={})=>{w(e)&&(e={props:e}),G(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 _(1,t.selector);s.remove(),t.element=s}else if(t.template){let s=document.createRange().createContextualFragment(en(t.template));t.element=s}else t.json&&(t.element=nt(t.json,t.isSVG,e.config),o=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&Kt(t.element,e.config??ye.getDefault());let r=t.element;if(!o&&((t.isSVG??(at(r)&&r.hasAttribute?.("isSVG")))||at(r)&&r.querySelector("[isSVG]"))){let s=r.content,a=s?[...s.childNodes]:[...r.childNodes],i=ht(a);t.element=nt(i,!0,e.config)}return{context:n,template:t.element,inheritAttrs:e.inheritAttrs??!0,props:e.props,defaultName:e.defaultName}};var $n=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 ai=t=>{Pe()?.onMounted.push(t)};var ci=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw _(4);return e&&!n.isStopped?e(...r):(e=ui(t,n),e(...r))};return o[J]=1,Ve(o,!0),o.stop=()=>n.ref?.stop?.(),se(()=>o.stop(),!0),o},ui=(t,e)=>{let n=e.ref??oe(null);e.ref=n,e.isStopped=!1;let o=0,r=Qe(()=>{if(o>0){r(),e.isStopped=!0,ee(n);return}n(t()),++o});return n.stop=r,n};var li=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw _(4);return o&&!n.isStopped?o(...s):(o=fi(t,e,n),o(...s))};return r[J]=1,Ve(r,!0),r.stop=()=>n.ref?.stop?.(),se(()=>r.stop(),!0),r},fi=(t,e,n)=>{let o=n.ref??oe(null);n.ref=o,n.isStopped=!1;let r=0,s=i=>{if(r>0){o.stop(),n.isStopped=!0,ee(o);return}let c=t.map(u=>u());o(e(...c)),++r},a=[];for(let i of t){let c=ne(i,s);a.push(c)}return s(null),o.stop=()=>{a.forEach(i=>{i()})},o};var pi=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw _(4);return o&&!n.isStopped?o(...s):(o=mi(t,e,n),o(...s))};return r[J]=1,Ve(r,!0),r.stop=()=>n.ref?.stop?.(),se(()=>r.stop(),!0),r},mi=(t,e,n)=>{let o=n.ref??oe(null);n.ref=o,n.isStopped=!1;let r=0;return o.stop=ne(t,s=>{if(r>0){o.stop(),n.isStopped=!0,ee(o);return}o(e(s)),++r},!0),o};var di=t=>(t[Ct]=1,t);var hi=(t,e)=>{if(!e)throw _(5);let o=Ze(t)?Be:i=>i,r=()=>localStorage.setItem(e,JSON.stringify(ue(t()))),s=localStorage.getItem(e);if(s!=null)try{t(o(JSON.parse(s)))}catch(i){$(6,`persist: failed to parse data for key ${e}`,i),r()}else r();let a=Qe(r);return se(a,!0),t};var _n=(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},yi=_n,gi=_n;var bi=(t,e,n)=>{let o=[],r=()=>{e(t.map(a=>a()))};for(let a of t)o.push(ne(a,r));n&&r();let s=()=>{for(let a of o)a()};return se(s,!0),s};var xi=t=>{if(!x(t))throw _(3,"observerCount");return t(void 0,void 0,2)};var Ti=t=>{lr();try{t()}finally{fr()}},lr=()=>{xe.stack||(xe.stack=[]),xe.stack.push(new Set)},fr=()=>{let t=xe.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 xe.stack;for(let n of e)try{ee(n)}catch(o){console.error(o)}};export{st as ComponentHead,$n as ContextRegistry,ye as RegorConfig,Q as addUnbinder,Ti as batch,bn as collectRefs,li as computeMany,pi as computeRef,ci as computed,si as createApp,ii as defineComponent,mr as drainUnbind,fr as endBatch,ut as entangle,ue as flatten,De as getBindData,_n as html,Ze as isDeepRef,lt as isRaw,x as isRef,di as markRaw,ne as observe,bi as observeMany,xi as observerCount,ai as onMounted,se as onUnmounted,vn as pause,hi as persist,Mr as pval,yi as raw,Be as ref,Y as removeNode,Rn as resume,gn as silence,oe as sref,lr as startBatch,gi as svg,nt as toFragment,ht as toJsonTemplate,ee as trigger,Ce as unbind,R as unref,dn as useScope,qe as warningHandler,Qe as watchEffect};
1
+ var ge=Symbol(":regor");var Ee=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];dr(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},dr=t=>{let e=t[ge];if(!e)return;let n=e.unbinders;for(let o=0;o<n.length;++o)n[o]();n.length=0,t[ge]=void 0};var Fe=[],yt=!1,gt,Kn=()=>{if(yt=!1,gt=void 0,Fe.length!==0){for(let t=0;t<Fe.length;++t)Ee(Fe[t]);Fe.length=0}},Y=t=>{t.remove(),Fe.push(t),yt||(yt=!0,gt=setTimeout(Kn,1))},hr=async()=>{Fe.length===0&&!yt||(gt&&clearTimeout(gt),Kn())};var W=t=>typeof t=="function",G=t=>typeof t=="string",Wn=t=>typeof t>"u",me=t=>t==null||typeof t>"u",j=t=>typeof t!="string"||!t?.trim(),yr=Object.prototype.toString,on=t=>yr.call(t),Me=t=>on(t)==="[object Map]",le=t=>on(t)==="[object Set]",rn=t=>on(t)==="[object Date]",ot=t=>typeof t=="symbol",w=Array.isArray,I=t=>t!==null&&typeof t=="object";var Gn={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."},_=(t,...e)=>{let n=Gn[t];return new Error(W(n)?n.call(Gn,...e):n)};var bt=[],Jn=()=>{let t={onMounted:[],onUnmounted:[]};return bt.push(t),t},Ue=t=>{let e=bt[bt.length-1];if(!e&&!t)throw _(2);return e},Qn=t=>{let e=Ue();return t&&an(t),bt.pop(),e},sn=Symbol("csp"),an=t=>{let e=t,n=e[sn];if(n){let o=Ue();if(n===o)return;o.onMounted.length>0&&n.onMounted.push(...o.onMounted),o.onUnmounted.length>0&&n.onUnmounted.push(...o.onUnmounted);return}e[sn]=Ue()},xt=t=>t[sn];var Ve=t=>{xt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Xn={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]})},$=(t,...e)=>{let n=Xn[t],o=W(n)?n.call(Xn,...e):n,r=qe.warning;r&&(G(o)?r(o):r(o,...o.args))},qe={warning:console.warn};var Tt=Symbol("ref"),J=Symbol("sref"),Ct=Symbol("raw");var x=t=>t!=null&&t[J]>0;var Le=class extends Error{propPath;detail;constructor(e,n){super(n),this.name="PropValidationError",this.propPath=e,this.detail=n}},xe=(t,e)=>{throw new Le(t,`${e}.`)},Et=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(x(t))return`ref<${Et(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(w(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"},gr=t=>t.length>60?`${t.slice(0,57)}...`:t,rt=(t,e=0)=>{if(e>1)return"unknown";if(x(t)){let s=t();return`ref(${rt(s,e+1)})`}if(typeof t=="string")return gr(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(w(t)){let s=t.slice(0,5).map(a=>rt(a,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(I(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let a=s.map(([i,c])=>{let u=rt(c,e+1);return`${i}: ${u}`}).join(", ");return Object.keys(t).length>5?`{ ${a}, ... }`:`{ ${a} }`}return"unknown"},ue=t=>{if(x(t))return`got ${Et(t)}(${rt(t())})`;let e=Et(t),n=rt(t);return`got ${e} (${n})`},br=t=>t instanceof Le?t.detail:t instanceof Error?t.message:String(t),Yn=(t,e)=>{let n=`, ${ue(e)}.`;return t.endsWith(n)?t.slice(0,-n.length):t},xr=(t,e,n)=>{if(e instanceof Le){if(e.propPath===t)return Yn(e.detail,n);if(e.propPath===`${t}.value`&&x(n)){let o=Yn(e.detail,n());return o.startsWith("expected ")?`expected ref<${o.slice(9)}>`:`expected ref where ${o}`}}return br(e)},Tr=(t,e,n)=>{let o=[];for(let r of e){let s=xr(t,r,n);o.includes(s)||o.push(s)}return o.length===0?ue(n):o.length===1?`${o[0]}, ${ue(n)}`:`${o.join(" or ")}, ${ue(n)}`},Cr=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":Et(t),Er=(t,e)=>{typeof t!="string"&&xe(e,`expected string, ${ue(t)}`)},vr=(t,e)=>{typeof t!="number"&&xe(e,`expected number, ${ue(t)}`)},Rr=(t,e)=>{typeof t!="boolean"&&xe(e,`expected boolean, ${ue(t)}`)},wr=t=>(e,n)=>{e instanceof t||xe(n,`expected instance of ${t.name||"provided class"}, ${ue(e)}`)},Sr=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},Ar=t=>(e,n,o)=>{e!==null&&t(e,n,o)},Nr=(...t)=>(e,n,o)=>{let r=[];for(let s of t)try{s(e,n,o);return}catch(a){r.push(a)}xe(n,Tr(n,r,e))},kr=t=>(e,n)=>{t.includes(e)||xe(n,`expected one of ${t.map(o=>Cr(o)).join(", ")}, ${ue(e)}`)},Or=t=>(e,n,o)=>{w(e)||xe(n,`expected array, ${ue(e)}`);let r=e;for(let s=0;s<r.length;++s)t(r[s],`${n}[${s}]`,o)};function Mr(t){return(e,n,o)=>{I(e)||xe(n,`expected object, ${ue(e)}`);let r=e;for(let s in t){let a=t[s];if(!a)continue;a(r[s],`${n}.${s}`,o)}}}var Vr=t=>(e,n,o)=>{if(x(e)){t(e(),`${n}.value`,o);return}xe(n,`expected ref, ${ue(e)}`)},Lr={fail:xe,describe:ue,isString:Er,isNumber:vr,isBoolean:Rr,isClass:wr,optional:Sr,nullable:Ar,or:Nr,oneOf:kr,arrayOf:Or,shape:Mr,refOf:Vr};var Ir=(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})},st=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;J;Q;constructor(e,n,o,r,s,a){this.props=e,this.J=n,this.ctx=o,this.start=r,this.end=s,this.Q=a}emit=(e,n)=>{this.J.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.Q==="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=Ir(this.J,o,a);if(this.Q==="warn"){qe.warning(i.message,i);continue}throw i}}}unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)Y(e),e=e.nextSibling;for(let o of this.ctx)Ve(o)}};var He=t=>{let e=t,n=e[ge];if(n)return n;let o={unbinders:[],data:{}};return e[ge]=o,o};var Q=(t,e)=>{He(t).unbinders.push(e)};var Be=t=>{if(typeof t=="string"){let e=t.trim().toLowerCase();if(e===""||e==="0"||e==="false")return!1;if(e==="true")return!0}return!!t};var Rt={},vt={},Zn=1,eo=t=>{let e=(Zn++).toString();return Rt[e]=t,vt[e]=0,e},cn=t=>{vt[t]+=1},un=t=>{--vt[t]===0&&(delete Rt[t],delete vt[t])},to=t=>Rt[t],ln=()=>Zn!==1&&Object.keys(Rt).length>0,it="r-switch",Pr=t=>{let e=t.filter(o=>ve(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(it))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},ze=(t,e)=>{if(!ln())return;let n=Pr(e);n.length!==0&&(n.forEach(cn),Q(t,()=>{n.forEach(un)}))};var wt=()=>{},fn=(t,e,n,o)=>{let r=[];for(let s of t){let a=s.cloneNode(!0);n.insertBefore(a,o),r.push(a)}Ie(e,r)},pn=Symbol("r-if"),no=Symbol("r-else"),oo=t=>t[no]===1,St=class{r;N;Te;X;Y;x;R;constructor(e){this.r=e,this.N=e.o.u.if,this.Te=Nt(e.o.u.if),this.X=e.o.u.else,this.Y=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),e.hasAttribute(this.r.o.u.is)||e.hasAttribute("is")||this.r.C.Z(e)||this.r.C.j(e,r=>{r.hasAttribute(this.N)&&this.y(r)}),n}ee(e){return e[pn]?!0:(e[pn]=!0,At(e,this.Te).forEach(n=>n[pn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.ee(e)||this.ot(e,this.x))return;let n=e.getAttribute(this.N);if(!n){$(0,this.N,e);return}e.removeAttribute(this.N),this.M(e,n)}U(e,n,o){let r=Ke(e),s=e.parentNode,a=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(a,e),ze(a,r),r.forEach(c=>{Y(c)}),e.remove(),n!=="if"&&(e[no]=1);let i=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(i,a.nextSibling),{nodes:r,parent:s,commentBegin:a,commentEnd:i}}Re(e,n){if(!e)return[];let o=e.nextElementSibling;if(e.hasAttribute(this.X)){e.removeAttribute(this.X);let{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"else");return[{mount:()=>{fn(r,this.r,s,i)},unmount:()=>{Re(a,i)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.Y);if(!r)return[];e.removeAttribute(this.Y);let{nodes:s,parent:a,commentBegin:i,commentEnd:c}=this.U(e,"elseif",` => ${r} `),u=this.r.m.O(r),l=u.value,f=this.Re(o,n),p=wt;return Q(i,()=>{u.stop(),p(),p=wt}),p=u.subscribe(n),[{mount:()=>{fn(s,this.r,a,c)},unmount:()=>{Re(i,c)},isTrue:()=>Be(l()[0]),isMounted:!1},...f]}}M(e,n){let o=e.nextElementSibling,{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"if",` => ${n} `),c=this.r.m.O(n),u=c.value,l=!1,f=this.r.m,p=f.L(),d=()=>{f.E(p,()=>{if(Be(u()[0]))l||(fn(r,this.r,s,i),l=!0),y.forEach(E=>{E.unmount(),E.isMounted=!1});else{Re(a,i),l=!1;let E=!1;for(let S of y)!E&&S.isTrue()?(S.isMounted||(S.mount(),S.isMounted=!0),E=!0):(S.unmount(),S.isMounted=!1)}})},y=this.Re(o,d),m=wt;Q(a,()=>{c.stop(),m(),m=wt}),d(),m=c.subscribe(d)}};var Ke=t=>{let e=de(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},Ie=(t,e)=>{for(let n=0;n<e.length;++n){let o=e[n];o.nodeType===Node.ELEMENT_NODE&&(oo(o)||t.$(o))}},At=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},de=t=>t instanceof HTMLTemplateElement,ve=t=>t.nodeType===Node.ELEMENT_NODE,at=t=>t.nodeType===Node.ELEMENT_NODE,ro=t=>t instanceof HTMLSlotElement,we=t=>de(t)?t.content.childNodes:t.childNodes,Re=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let o=n.nextSibling;Y(n),n=o}},so=function(){return this()},Dr=function(t){return this(t)},Ur=()=>{throw new Error("value is readonly.")},Hr={get:so,set:Dr,enumerable:!0,configurable:!1},Br={get:so,set:Ur,enumerable:!0,configurable:!1},Pe=(t,e)=>{t[J]=e?2:1,Object.defineProperty(t,"value",e?Br:Hr)},io=(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},Nt=t=>`[${CSS.escape(t)}]`,kt=(t,e)=>(t.startsWith("@")&&(t=e.u.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.u.dynamic)),t),mn=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},jr=/-(\w)/g,F=mn(t=>t&&t.replace(jr,(e,n)=>n?n.toUpperCase():"")),$r=/\B([A-Z])/g,We=mn(t=>t&&t.replace($r,"-$1").toLowerCase()),ct=mn(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var Ot={mount:()=>{}};var Ge=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Mt=t=>{xt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var dn=Symbol("scope"),hn=t=>{try{Jn();let e=t();an(e);let n={context:e,unmount:()=>Ve(e),[dn]:1};return n[dn]=1,n}finally{Qn()}},ao=t=>I(t)?dn in t:!1;var R=t=>{let e=t;return e!=null&&e[J]>0?e():e};var co="http://www.w3.org/1999/xlink",_r={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},Fr=(t,e,n,o,r,s)=>{if(o){o=R(o),s&&s.includes("camel")&&(o=F(o)),Je(t,o,R(e[0]),R(r));return}let a=e.length;for(let i=0;i<a;++i){let c=e[i];if(w(c)){let u=R(n?.[i]?.[0]),l=R(c[0]),f=R(c[1]);Je(t,l,f,u)}else if(I(c))for(let u of Object.entries(c)){let l=u[0],f=R(u[1]),p=R(n?.[i]),d=p&&l in p?l:void 0;Je(t,l,f,d)}else{let u=R(n?.[i]),l=R(e[i++]),f=R(e[i]);Je(t,l,f,u)}}},yn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{Fr(t,e,n,o,r,s)}})},Je=(t,e,n,o)=>{if(o&&o!==e&&t.removeAttribute(o),me(e)){$(3,"r-bind",t);return}if(!G(e)){$(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){me(n)?t.removeAttributeNS(co,e.slice(6,e.length)):t.setAttributeNS(co,e,n);return}if(me(n)){t.removeAttribute(e);return}if(e in _r){Be(n)?t.setAttribute(e,""):t.removeAttribute(e);return}t.setAttribute(e,n)};var gn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(I(o))for(let r of Object.entries(o)){let s=r[0],a=r[1],i=n[s];i!==a&&(x(i)?i(a):n[s]=a)}}})};var se=(t,e)=>{Ue(e)?.onUnmounted.push(t)};var ne=(t,e,n,o=!0)=>{if(!x(t))throw _(3,"observe");n&&e(t());let s=t(void 0,void 0,0,e);return o&&se(s,!0),s};var uo=t=>t[J]===2,ut=(t,e)=>{if(t===e)return()=>{};let n=uo(t),o=uo(e);if(n&&o)return()=>{};if(n){let a=ne(t,()=>e(t()));return e(t()),a}if(o){let a=ne(e,()=>t(e()));return t(e()),a}let r=ne(t,a=>e(a)),s=ne(e,a=>t(a));return e(t()),()=>{r(),s()}};var he=[],lo=t=>{he.length!==0&&he[he.length-1]?.add(t)},Qe=t=>{if(!t)return()=>{};let e={stop:()=>{}};return qr(t,e),se(()=>e.stop(),!0),e.stop},qr=(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(he.push(s),t(a=>n.push(a)),o)return;for(let a of[...s]){let i=ne(a,()=>{r(),Qe(t)});n.push(i)}}finally{he.pop()}},bn=t=>{let e=he.length,n=e>0&&he[e-1];try{return n&&he.push(null),t()}finally{n&&he.pop()}},xn=t=>{try{let e=new Set;return he.push(e),{value:t(),refs:[...e]}}finally{he.pop()}};var lt=t=>!!t&&t[Ct]===1;var ee=(t,e,n)=>{if(!x(t))return;let o=t;if(o(void 0,e,1),!n)return;let r=o();if(r){if(w(r)||le(r))for(let s of r)ee(s,e,!0);else if(Me(r))for(let s of r)ee(s[0],e,!0),ee(s[1],e,!0);if(I(r))for(let s in r)ee(r[s],e,!0)}};function zr(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Xe=(t,e,n)=>{n.forEach(function(o){let r=t[o];zr(e,o,function(...a){let i=r.apply(this,a),c=this[J];for(let u of c)ee(u);return i})})},Vt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var fo=Array.prototype,Tn=Object.create(fo),Kr=["push","pop","shift","unshift","splice","sort","reverse"];Xe(fo,Tn,Kr);var po=Map.prototype,Lt=Object.create(po),Wr=["set","clear","delete"];Vt(Lt,"Map");Xe(po,Lt,Wr);var mo=Set.prototype,It=Object.create(mo),Gr=["add","clear","delete"];Vt(It,"Set");Xe(mo,It,Gr);var Te={},oe=t=>{if(x(t)||lt(t))return t;let e={auto:!0,_value:t},n=c=>I(c)?J in c?!0:w(c)?(Object.setPrototypeOf(c,Tn),!0):le(c)?(Object.setPrototypeOf(c,It),!0):Me(c)?(Object.setPrototypeOf(c,Lt),!0):!1:!1,o=n(t),r=new Set,s=(c,u)=>{if(Te.stack&&Te.stack.length){Te.stack[Te.stack.length-1].add(i);return}r.size!==0&&bn(()=>{for(let l of[...r.keys()])r.has(l)&&l(c,u)})},a=c=>{let u=c[J];u||(c[J]=u=new Set),u.add(i)},i=(...c)=>{if(!(2 in c)){let l=c[0],f=c[1];return 0 in c?e._value===l||x(l)&&(l=l(),e._value===l)?l:(n(l)&&a(l),e._value=l,e.auto&&s(l,f),e._value):(lo(i),e._value)}switch(c[2]){case 0:{let l=c[3];if(!l)return()=>{};let f=p=>{r.delete(p)};return r.add(l),()=>{f(l)}}case 1:{let l=c[1],f=e._value;s(f,l);break}case 2:return r.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return Pe(i,!1),o&&a(t),i};var ho=Symbol("modelBridge"),Pt=()=>{},Jr=t=>!!t?.[ho],Qr=t=>{t[ho]=1},Xr=t=>{let e=oe(t());return Qr(e),e},yo={collectRefObj:!0,mount:({parseResult:t,option:e})=>{if(typeof e!="string"||!e)return Pt;let n=F(e),o,r,s=Pt,a=()=>{s(),s=Pt,o=void 0,r=void 0},i=()=>{s(),s=Pt},c=(l,f)=>{o!==l&&(i(),s=ut(l,f),o=l)},u=()=>{let l=t.refs[0]??t.value()[0],f=t.context,p=f[n];if(!x(l)){if(r&&p===r){r(l);return}if(a(),x(p)){p(l);return}f[n]=oe(l);return}if(Jr(l)){if(p===l)return;x(p)?c(l,p):f[n]=l;return}r||(r=Xr(l)),f[n]=r,c(l,r)};return{update:()=>{u()},unmount:()=>{s()}}}};var Dt=class{r;_;Ce="";Ee=-1;constructor(e){this.r=e,this._=e.o.u.inherit}k(e){this.st(e)}it(e){if(this.Ee!==e.size){let n=[...e.keys()];this.Ce=[...n,...n.map(We)].join(","),this.Ee=e.size}return this.Ce}ct(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}ut(e){if(!de(e))return!1;let n=e.getAttributeNames();return e.hasAttribute("name")?!0:n.some(o=>o.startsWith("#"))}pt(e){return de(e)&&e.getAttributeNames().length===0}st(e){let n=this.r,o=n.m,r=n.o.te,s=n.o.F;if(r.size===0&&!this.ct(o.l))return;let a=o.ne(),i=this.re();if(j(i))return;let c=this.lt(e,i);for(let u of c){if(u.hasAttribute(n.R))continue;let l=u.parentNode;if(!l)continue;let f=u.nextSibling,p=F(u.tagName).toUpperCase(),y=a[p]??s.get(p);if(!y)continue;let m=y.template;if(!m)continue;let T=u.parentElement;if(!T)continue;let E=new Comment(" begin component: "+u.tagName),S=new Comment(" end component: "+u.tagName);T.insertBefore(E,u),u.remove();let H=n.o.u.context,B=n.o.u.contextAlias,M=n.o.u.bind,q=y.props?.map(F)??[],V=[],A=g=>g==="class"||g==="style",fe=(g,C,v=!1)=>{let U={},X=g.hasAttribute(H);return o.E(C,()=>{if(o.w(U),X?n.y(gn,g,H):g.hasAttribute(B)&&n.y(gn,g,B),q.length===0)return;let k=new Map(q.map(h=>[h.toLowerCase(),h]));for(let h of[...q,...q.map(We)]){let N=g.getAttribute(h);if(N===null)continue;let O=F(h);U[O]=N,v&&y.inheritAttrs===!0&&A(O)&&V.push({name:h,value:N}),g.removeAttribute(h)}let K=n.q.ve(g,!1);for(let[h,N]of K.entries()){let[O,ae]=N.oe;if(!ae)continue;let ce=k.get(F(ae).toLowerCase());if(ce&&!(O!=="."&&O!==":"&&O!==M)){if(v&&O!=="."&&y.inheritAttrs===!0&&A(ce)){let zn=g.getAttribute(h);zn!==null&&V.push({name:h,value:zn})}n.y(yo,g,h,!0,ce,N.se)}}}),U},b=[...o.L()],P=()=>{let g=fe(u,b,!0),C=new st(g,u,b,E,S,n.o.propValidationMode),v=hn(()=>y.context(C)??{}).context;if(C.autoProps){for(let[U,X]of Object.entries(g))if(U in v){let k=v[U];if(k===X)continue;if(x(k)){x(X)?C.entangle?Q(E,ut(X,k)):k(X()):k(X);continue}}else v[U]=X;for(let U of q)U in v||(v[U]=void 0);C.onAutoPropsAssigned?.()}return{componentCtx:v,head:C}},{componentCtx:z,head:De}=P(),pe=[...we(m)],nn=pe.length,D=u.childNodes.length===0,L=g=>{let C=g.parentElement,v=g.name;if(j(v)&&(v=g.getAttributeNames().filter(k=>k.startsWith("#"))[0],j(v)?v="default":v=v.substring(1)),D){if(v==="default"){let k=n.o.u.text,K=u.getAttribute(k);if(!j(K)){let h=document.createElement("span");h.setAttribute(k,K),C.insertBefore(h,g),u.removeAttribute(k);return}}for(let k of[...g.childNodes])C.insertBefore(k,g);return}let U=u.querySelector(`template[name='${v}'], template[\\#${v}]`);!U&&v==="default"&&(U=[...u.querySelectorAll("template:not([name])")].find(K=>this.pt(K))??null);let X=k=>{De.enableSwitch&&o.E(b,()=>{o.w(z);let K=fe(g,o.L());o.E(b,()=>{o.w(K);let h=o.L(),N=eo(h);for(let O of k)ve(O)&&(O.setAttribute(it,N),cn(N),Q(O,()=>{un(N)}))})})};if(U){let k=[...we(U)];for(let K of k)C.insertBefore(K,g);X(k)}else{if(v!=="default"){for(let K of[...we(g)])C.insertBefore(K,g);return}let k=[...we(u)].filter(K=>!this.ut(K));for(let K of k)C.insertBefore(K,g);X(k)}},Z=g=>{if(!ve(g))return;let C=g.querySelectorAll("slot");if(ro(g)){L(g),g.remove();return}for(let v of C)L(v),v.remove()};(()=>{for(let g=0;g<nn;++g)pe[g]=pe[g].cloneNode(!0),l.insertBefore(pe[g],f),Z(pe[g])})(),T.insertBefore(S,f);let te=()=>{if(!y.inheritAttrs)return;let g=pe.filter(h=>h.nodeType===Node.ELEMENT_NODE),v=g.flatMap(h=>[...h.hasAttribute(this._)?[h]:[],...h.querySelectorAll(`[${this._}]`)]).at(0)??(g.length===1?g[0]:void 0);if(!v)return;v.removeAttribute(this._);let U=`${M}:class`,X=`${M}:style`,k=(h,N,O)=>{let ae=v.hasAttribute(h)?h:v.hasAttribute(N)?N:h,ce=v.getAttribute(ae);v.setAttribute(ae,j(ce)?O:`${ce}, ${O}`)},K=(h,N)=>{if(h==="class"){let O=Ge(N);O.length>0&&v.classList.add(...O)}else if(h===":class"||h===U)k(":class",U,N);else if(h==="style"){let O=v.style,ae=u.style;for(let ce of ae)O.setProperty(ce,ae.getPropertyValue(ce))}else if(h===":style"||h===X)k(":style",X,N);else{let O=kt(h,n.o);Je(v,O,N)}};for(let{name:h,value:N}of V)u.setAttribute(h,N);for(let h of u.getAttributeNames())h===H||h===B||K(h,u.getAttribute(h))},Ce=()=>{for(let g of u.getAttributeNames())!g.startsWith("@")&&!g.startsWith(n.o.u.on)&&u.removeAttribute(g)},Oe=()=>{te(),Ce(),o.w(z),n.we(u,!1),z.$emit=De.emit,Ie(n,pe),Q(u,()=>{Ve(z)}),Q(E,()=>{Ee(u)}),Mt(z)};o.E(b,Oe)}}re(){let e=this.r,n=e.m,o=e.o.te,r=n.ft(),s=this.it(o);return[...s?[s]:[],...r,...r.map(We)].join(",")}Z(e){let n=this.re();return!j(n)&&e.matches?.(n)}lt(e,n){let o=[];if(j(n))return o;if(e.matches?.(n))return[e];let r=this.K(e).reverse();for(;r.length>0;){let s=r.pop();if(s.matches(n)){o.push(s);continue}r.push(...this.K(s).reverse())}return o}j(e,n){let o=this.r,r=this.re(),s=o.o.u.is,a=this.K(e).reverse();for(;a.length>0;){let i=a.pop();n(i),!(!j(r)&&i.matches(r))&&(i.hasAttribute(s)||i.hasAttribute("is")||a.push(...this.K(i).reverse()))}}K(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let a=n[s];ve(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];ve(a)&&r.push(a)}return r}return[]}};var Cn=class{oe;se;Se=[];constructor(e,n){this.oe=e,this.se=n}},Ut=class{r;Ve;Ae;ie;constructor(e){this.r=e,this.Ve=e.o.dt(),this.ie=new Map;let n=new Map;for(let o of this.Ve){let r=o[0]??"",s=n.get(r);s?s.push(o):n.set(r,[o])}this.Ae=n}ke(e){let n=this.ie.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(/[:@]/);j(i[0])&&(i[0]=r?".":o[0]);let c=s>=0?o.slice(s+1).split("."):[],u=!1,l=!1;for(let p=0;p<c.length;++p){let d=c[p];if(!u&&d==="camel"?u=!0:!l&&d==="prop"&&(l=!0),u&&l)break}u&&(i[i.length-1]=F(i[i.length-1])),l&&(i[0]=".");let f={terms:i,flags:c};return this.ie.set(e,f),f}ve(e,n){let o=new Map;if(!at(e))return o;let r=this.Ae,s=(i,c)=>{let u=r.get(c[0]??"");if(u)for(let l=0;l<u.length;++l){if(!c.startsWith(u[l]))continue;let f=o.get(c);if(!f){let p=this.ke(c);f=new Cn(p.terms,p.flags),o.set(c,f)}f.Se.push(i);return}},a=i=>{let c=i.attributes;if(!(!c||c.length===0))for(let u=0;u<c.length;++u){let l=c.item(u)?.name;l&&s(i,l)}};return a(e),!n||!e.firstElementChild||this.r.C.j(e,a),o}};var go=()=>{},Yr=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},Ht=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.C.Z(e)||this.r.C.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.M(e,n)}U(e,n){let o=Ke(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),ze(s,o),o.forEach(i=>{Y(i)}),e.remove();let a=document.createComment(`__end__ dynamic ${n??""}`);return r.insertBefore(a,s.nextSibling),{nodes:o,parent:r,commentBegin:s,commentEnd:a}}M(e,n){let{nodes:o,commentBegin:r,commentEnd:s}=this.U(e,` => ${n} `),a=this.r.m.O(n),i=a.value,c=this.r.m,u=c.L(),l={name:""},f=de(e)?o:[...o[0].childNodes],p=()=>{c.E(u,()=>{let m=i()[0];if(I(m)&&(m.name?m=m.name:m=Object.entries(c.ne()).filter(S=>S[1]===m)[0]?.[0]),!G(m)||j(m)){Re(r,s);return}if(l.name===m)return;Re(r,s);let T=s.parentNode??r.parentNode;if(!T)return;let E=document.createElement(m);for(let S of e.getAttributeNames())S!==this.I&&E.setAttribute(S,e.getAttribute(S));Yr(f,E),T.insertBefore(E,s),this.r.$(E),l.name=m})},d=go;Q(r,()=>{a.stop(),d(),d=go}),p(),d=a.subscribe(p)}};var Zr=(t,e)=>{let[n,o]=e;W(o)?o(t,n):t.innerHTML=n?.toString()},Bt={mount:()=>({update:({el:t,values:e})=>{Zr(t,e)}})};var jt=class t{ae;constructor(e){this.ae=e}static mt(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.ne();if(Object.keys(c).length>0||r.F.size>0)return;let u=e.q,l=[],f=0,p=[];for(let d=n.length-1;d>=0;--d)p.push(n[d]);for(;p.length>0;){let d=p.pop();if(d.nodeType===Node.ELEMENT_NODE){let m=d;if(m.tagName==="TEMPLATE"||m.tagName.includes("-"))return;let T=F(m.tagName).toUpperCase();if(r.F.has(T)||c[T])return;let E=m.attributes;for(let S=0;S<E.length;++S){let H=E.item(S)?.name;if(!H)continue;if(a.has(H))return;let{terms:B,flags:M}=u.ke(H),[q,V]=B,A=i[H]??i[q];if(A){if(A===Bt)return;l.push({nodeIndex:f,attrName:H,directive:A,option:V,flags:M})}}++f}let y=d.childNodes;for(let m=y.length-1;m>=0;--m)p.push(y[m])}if(l.length!==0)return new t(l)}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.ae.length;++s){let a=this.ae[s],i=o[a.nodeIndex];i&&e.y(a.directive,i,a.attrName,!1,a.option,a.flags)}}};var es=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},ts=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 u=o[o.length-1];if(u===void 0||t[u]<c){n[i]=u??-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},$t=class{static yt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:a,removeMountItem:i,endAnchor:c}=e,u=n.length,l=o.length,f=new Array(l),p=new Set;for(let b=0;b<l;++b){let P=r(o[b]);if(P===void 0||p.has(P))return;p.add(P),f[b]=P}let d=new Array(l),y=0,m=u-1,T=l-1;for(;y<=m&&y<=T;){let b=n[y];if(r(b.value)!==f[y]||!s(b.value,o[y]))break;b.value=o[y],d[y]=b,++y}for(;y<=m&&y<=T;){let b=n[m];if(r(b.value)!==f[T]||!s(b.value,o[T]))break;b.value=o[T],d[T]=b,--m,--T}if(y>m){for(let b=T;b>=y;--b){let P=b+1<l?d[b+1].items[0]:c;d[b]=a(b,o[b],P)}return d}if(y>T){for(let b=y;b<=m;++b)i(n[b]);return d}let E=y,S=y,H=T-S+1,B=new Array(H).fill(0),M=new Map;for(let b=S;b<=T;++b)M.set(f[b],b);let q=!1,V=0;for(let b=E;b<=m;++b){let P=n[b],z=M.get(r(P.value));if(z===void 0){i(P);continue}if(!s(P.value,o[z])){i(P);continue}P.value=o[z],d[z]=P,B[z-S]=b+1,z>=V?V=z:q=!0}let A=q?ts(B):[],fe=A.length-1;for(let b=H-1;b>=0;--b){let P=S+b,z=P+1<l?d[P+1].items[0]:c;if(B[b]===0){d[P]=a(P,o[P],z);continue}let De=d[P];q&&(fe>=0&&A[fe]===b?--fe:De&&es(De,z))}return d}};var ft=class{T=[];P=new Map;get S(){return this.T.length}ce;constructor(e){this.ce=e}ue(e){let n=this.ce(e.value);n!==void 0&&this.P.set(n,e)}pe(e){let n=this.ce(this.T[e]?.value);n!==void 0&&this.P.delete(n)}static ht(e,n){return{items:[],index:e,value:n,order:-1}}w(e){e.order=this.S,this.T.push(e),this.ue(e)}gt(e,n){let o=this.S;for(let r=e;r<o;++r)this.T[r].order=r+1;n.order=e,this.T.splice(e,0,n),this.ue(n)}D(e){return this.T[e]}le(e,n){this.pe(e),this.T[e]=n,this.ue(n),n.order=e}Ne(e){this.pe(e),this.T.splice(e,1);let n=this.S;for(let o=e;o<n;++o)this.T[o].order=o}Me(e){let n=this.S;for(let o=e;o<n;++o)this.pe(o);this.T.splice(e)}nn(e){return this.P.has(e)}bt(e){return this.P.get(e)?.order??-1}};var En=Symbol("r-for"),ns=t=>-1,bo=()=>{},_t=class t{r;x;Oe;R;constructor(e){this.r=e,this.x=e.o.u.for,this.Oe=Nt(this.x),this.R=e.o.u.pre}k(e){let n=e.hasAttribute(this.x);return n&&this.Le(e),e.hasAttribute(this.r.o.u.is)||e.hasAttribute("is")||this.r.C.Z(e)||this.r.C.j(e,r=>{r.hasAttribute(this.x)&&this.Le(r)}),n}ee(e){return e[En]?!0:(e[En]=!0,At(e,this.Oe).forEach(n=>n[En]=!0),!1)}Le(e){if(e.hasAttribute(this.R)||this.ee(e))return;let n=e.getAttribute(this.x);if(!n){$(0,this.x,e);return}e.removeAttribute(this.x),this.xt(e,n)}Ie(e){return me(e)?[]:(W(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))}xt(e,n){let o=this.Tt(n);if(!o?.list){$(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=Ke(e),c=jt.mt(this.r,i),u=e.parentNode;if(!u)return;let l=`${this.x} => ${n}`,f=new Comment(`__begin__ ${l}`);u.insertBefore(f,e),ze(f,i),i.forEach(L=>{Y(L)}),e.remove();let p=new Comment(`__end__ ${l}`);u.insertBefore(p,f.nextSibling);let d=this.r,y=d.m,m=y.L(),E=m.length===1?[void 0,m[0]]:void 0,S=this.Rt(a),H=(L,Z)=>S(L)===S(Z),B=(L,Z)=>L===Z,M=(L,Z,re)=>{let te=o.createContext(Z,L),Ce=ft.ht(te.index,Z),Oe=()=>{let g=p.parentNode??f.parentNode??u,C=re.previousSibling,v=[];for(let U=0;U<i.length;++U){let X=i[U].cloneNode(!0);g.insertBefore(X,re),v.push(X)}for(c?c.y(d,v):Ie(d,v),C=C.nextSibling;C!==re;)Ce.items.push(C),C=C.nextSibling};return E?(E[0]=te.ctx,y.E(E,Oe)):y.E(m,()=>{y.w(te.ctx),Oe()}),Ce},q=(L,Z)=>{let re=D.D(L).items,te=re[re.length-1].nextSibling;for(let Ce of re)Y(Ce);D.le(L,M(L,Z,te))},V=(L,Z)=>{D.w(M(L,Z,p))},A=L=>{for(let Z of D.D(L).items)Y(Z)},fe=L=>{let Z=D.S;for(let re=L;re<Z;++re)D.D(re).index(re)},b=L=>{let Z=f.parentNode,re=p.parentNode;if(!Z||!re)return;let te=D.S;W(L)&&(L=L());let Ce=R(L[0]);if(w(Ce)&&Ce.length===0){Re(f,p),D.Me(0);return}let Oe=[];for(let h of this.Ie(L[0]))Oe.push(h);let g=$t.yt({oldItems:D.T,newValues:Oe,getKey:S,isSameValue:B,mountNewValue:(h,N,O)=>M(h,N,O),removeMountItem:h=>{for(let N=0;N<h.items.length;++N)Y(h.items[N])},endAnchor:p});if(g){D.T=g,D.P.clear();for(let h=0;h<g.length;++h){let N=g[h];N.order=h,N.index(h);let O=S(N.value);O!==void 0&&D.P.set(O,N)}return}let C=0,v=Number.MAX_SAFE_INTEGER,U=te,X=this.r.o.forGrowThreshold,k=()=>D.S<U+X;for(let h of Oe){let N=()=>{if(C<te){let O=D.D(C++);if(H(O.value,h)){if(B(O.value,h))return;q(C-1,h);return}let ae=D.bt(S(h));if(ae>=C&&ae-C<10){if(--C,v=Math.min(v,C),A(C),D.Ne(C),--te,ae>C+1)for(let ce=C;ce<ae-1&&ce<te&&!H(D.D(C).value,h);)++ce,A(C),D.Ne(C),--te;N();return}k()?(D.gt(C-1,M(C,h,D.D(C-1).items[0])),v=Math.min(v,C-1),++te):q(C-1,h)}else V(C++,h)};N()}let K=C;for(te=D.S;C<te;)A(C++);D.Me(K),fe(v)},P=()=>{z.stop(),pe(),pe=bo},z=y.O(o.list),De=z.value,pe=bo,nn=0,D=new ft(S);for(let L of this.Ie(De()[0]))D.w(M(nn++,L,p));Q(f,P),pe=z.subscribe(b)}static Ct=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;Tt(e){let n=t.Ct.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,u)=>{let l={},f=R(c);if(!i&&o.length===1)l[o[0]]=c;else if(w(f)){let d=0;for(let y of o)l[y]=f[d++]}else for(let d of o)l[d]=f[d];let p={ctx:l,index:ns};return s&&(p.index=l[s.startsWith("#")?s.substring(1):s]=oe(u)),p}}}Rt(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 a=R(s),i=this.Pe(a,o);return i!==void 0||!r?i:this.Pe(a,r)}}return o=>R(R(o)?.[n])}Et(e){return e.split(".").filter(n=>n.length>0)}Pe(e,n){let o=e;for(let r of n)o=R(o)?.[r];return R(o)}};var Ft=class{fe=0;de=new Map;m;De;Ue;Be;C;q;o;R;He;constructor(e){this.m=e,this.o=e.o,this.Ue=new _t(this),this.De=new St(this),this.Be=new Ht(this),this.C=new Dt(this),this.q=new Ut(this),this.R=this.o.u.pre,this.He=this.o.u.dynamic}vt(e){let n=de(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);Ie(this,a)}}$(e){++this.fe;try{if(e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.R)||this.De.k(e)||this.Ue.k(e)||this.Be.k(e))return;this.C.k(e),this.vt(e),this.we(e,!0)}finally{--this.fe,this.fe===0&&this.wt()}}St(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)}je(e,n){let o=this.St(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,()=>{Y(e)}),o.appendChild(e),!0}Vt(e,n){this.de.set(e,n)}wt(){let e=this.de;if(e.size!==0){this.de=new Map;for(let[n,o]of e.entries())this.je(n,o)}}we(e,n){let o=this.q.ve(e,n),r=this.o.B;for(let[s,a]of o.entries()){let[i,c]=a.oe,u=r[s]??r[i];if(!u){console.error("directive not found:",i);continue}let l=a.Se;for(let f=0;f<l.length;++f){let p=l[f];this.y(u,p,s,!1,c,a.se)}}}y(e,n,o,r,s,a){if(n.hasAttribute(this.R))return;let i=n.getAttribute(o);n.removeAttribute(o);let c=u=>{let l=u;for(;l;){let f=l.getAttribute(it);if(f)return f;l=l.parentElement}return null};if(ln()){let u=c(n);if(u){this.m.E(to(u),()=>{this.M(e,n,i,s,a)});return}}this.M(e,n,i,s,a)}At(e,n,o){return e!==Ot?!1:(j(o)||this.je(n,o)||this.Vt(n,o),!0)}M(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.At(e,n,o))return;let a=this.kt(r,e.once),i=this.Nt(e,o),c=this.Mt(i,a);Q(n,c.stop);let u=this.Ot(n,o,i,a,r,s),l=this.Lt(e,u,c);if(!l)return;let f=this.It(u,i,a,r,l);f(),e.once||(c.result=i.subscribe(f),a&&(c.dynamic=a.subscribe(f)))}kt(e,n){let o=io(e,this.He);if(o)return this.m.O(F(o),void 0,void 0,void 0,n)}Nt(e,n){return this.m.O(n,e.isLazy,e.isLazyKey,e.collectRefObj,e.once)}Mt(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}Ot(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}}Lt(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}It(e,n,o,r,s){let a,i;return()=>{let c=n.value(),u=o?o.value()[0]:r;e.values=c,e.previousValues=a,e.option=u,e.previousOption=i,a=c,i=u,s(e)}}};var os=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(w(s)){let i=s.length;for(let c=0;c<i;++c)xo(t,s[c],a?.[c])}else xo(t,s,a)}},vn={mount:()=>({update:({el:t,values:e,previousValues:n})=>{os(t,e,n)}})},xo=(t,e,n)=>{let o=R(e),r=R(n),s=t.classList,a=G(o),i=G(r);if(o&&!a){let c=o;if(r&&!i){let u=r;for(let l in u)(!(l in c)||!R(c[l]))&&s.remove(l)}for(let u in c)R(c[u])&&s.add(u)}else if(a){if(r!==o){let c=i?Ge(r):[],u=Ge(o);c.length>0&&s.remove(...c),u.length>0&&s.add(...u)}}else if(r){let c=i?Ge(r):[];c.length>0&&s.remove(...c)}};function rs(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Se(t[o],e[o]);return n}function Se(t,e){if(t===e)return!0;let n=rn(t),o=rn(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=ot(t),o=ot(e),n||o)return t===e;if(n=w(t),o=w(e),n||o)return n&&o?rs(t,e):!1;if(n=I(t),o=I(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||!Se(t[a],e[a]))return!1}return!0}return String(t)===String(e)}function qt(t,e){return t.findIndex(n=>Se(n,e))}var To=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var Rn=t=>{if(!x(t))throw _(3,"pause");t(void 0,void 0,3)};var wn=t=>{if(!x(t))throw _(3,"resume");t(void 0,void 0,4)};var Eo={mount:({el:t,parseResult:e,flags:n})=>({update:({values:o})=>{vo(t,o[0])},unmount:ss(t,e,n)})},vo=(t,e)=>{let n=Ao(t);if(n&&Ro(t))w(e)?e=qt(e,Ae(t))>-1:le(e)?e=e.has(Ae(t)):e=fs(t,e),t.checked=e;else if(n&&wo(t))t.checked=Se(e,Ae(t));else if(n||No(t))So(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(ko(t)){let o=t.options,r=o.length,s=t.multiple;for(let a=0;a<r;a++){let i=o[a],c=Ae(i);if(s)w(e)?i.selected=qt(e,c)>-1:i.selected=e.has(c);else if(Se(Ae(i),e)){t.selectedIndex!==a&&(t.selectedIndex=a);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else $(7,t)},pt=t=>(x(t)&&(t=t()),W(t)&&(t=t()),t?G(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}),Ro=t=>t.type==="checkbox",wo=t=>t.type==="radio",So=t=>t.type==="number"||t.type==="range",Ao=t=>t.tagName==="INPUT",No=t=>t.tagName==="TEXTAREA",ko=t=>t.tagName==="SELECT",ss=(t,e,n)=>{let o=e.value,r=pt(n?.join(",")),s=pt(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 $(8,t),()=>{};let i=()=>e.refs[0],c=Ao(t);return c&&Ro(t)?as(t,i):c&&wo(t)?ps(t,i):c||No(t)?is(t,a,i,o):ko(t)?ms(t,i,o):($(7,t),()=>{})},Co=/[.,' ·٫]/,is=(t,e,n,o)=>{let s=e.lazy?"change":"input",a=So(t),i=()=>{!e.trim&&!pt(o()[1]).trim||(t.value=t.value.trim())},c=p=>{let d=p.target;d.composing=1},u=p=>{let d=p.target;d.composing&&(d.composing=0,d.dispatchEvent(new Event(s)))},l=()=>{t.removeEventListener(s,f),t.removeEventListener("change",i),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",u),t.removeEventListener("change",u)},f=p=>{let d=n();if(!d)return;let y=p.target;if(!y||y.composing)return;let m=y.value,T=pt(o()[1]);if(a||T.number||T.int){if(T.int)m=parseInt(m);else{if(Co.test(m[m.length-1])&&m.split(Co).length===2){if(m+="0",m=parseFloat(m),isNaN(m))m="";else if(d()===m)return}m=parseFloat(m)}isNaN(m)&&(m=""),t.value=m}else T.trim&&(m=m.trim());d(m)};return t.addEventListener(s,f),t.addEventListener("change",i),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",u),t.addEventListener("change",u),l},as=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=Ae(t),i=t.checked,c=s();if(w(c)){let u=qt(c,a),l=u!==-1;i&&!l?c.push(a):!i&&l&&c.splice(u,1)}else le(c)?i?c.add(a):c.delete(a):s(ls(t,i))};return t.addEventListener(n,r),o},Ae=t=>"_value"in t?t._value:t.value,Oo="trueValue",cs="falseValue",Mo="true-value",us="false-value",ls=(t,e)=>{let n=e?Oo:cs;if(n in t)return t[n];let o=e?Mo:us;return t.hasAttribute(o)?t.getAttribute(o):e},fs=(t,e)=>{if(Oo in t)return Se(e,t.trueValue);let o=Mo;return t.hasAttribute(o)?Se(e,t.getAttribute(o)):Se(e,!0)},ps=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=Ae(t);s(a)};return t.addEventListener(n,r),o},ms=(t,e,n)=>{let o="change",r=ds(t,n),s=()=>{t.removeEventListener(o,a),r()},a=()=>{let i=e();if(!i)return;let u=pt(n()[1]).number,l=Array.prototype.filter.call(t.options,f=>f.selected).map(f=>u?To(Ae(f)):Ae(f));if(t.multiple){let f=i();try{if(Rn(i),le(f)){f.clear();for(let p of l)f.add(p)}else w(f)?(f.splice(0),f.push(...l)):i(l)}finally{wn(i),ee(i)}}else i(l[0])};return t.addEventListener(o,a),s},ds=(t,e)=>{let n=globalThis.MutationObserver??globalThis.window?.MutationObserver;if(!n)return()=>{};let o=!1,r=!1,s=()=>{o=!1,!r&&vo(t,e()[0])},a=()=>{o||(o=!0,typeof queueMicrotask=="function"?queueMicrotask(s):Promise.resolve().then(s))},i=new n(a);return i.observe(t,{attributes:!0,attributeFilter:["value"],childList:!0,subtree:!0}),()=>{r=!0,i.disconnect()}};var hs=["stop","prevent","capture","self","once","left","right","middle","passive"],ys=t=>{let e={};if(j(t))return;let n=t.split(",");for(let o of hs)e[o]=n.includes(o);return e},gs=(t,e,n,o,r)=>{if(o){let u=e.value(),l=R(o.value()[0]);return G(l)?Sn(t,F(l),()=>e.value()[0],r?.join(",")??u[1]):()=>{}}else if(n){let u=e.value();return Sn(t,F(n),()=>e.value()[0],r?.join(",")??u[1])}let s=[],a=()=>{s.forEach(u=>u())},i=e.value(),c=i.length;for(let u=0;u<c;++u){let l=i[u];if(W(l)&&(l=l()),I(l))for(let f of Object.entries(l)){let p=f[0],d=()=>{let m=e.value()[u];return W(m)&&(m=m()),m=m[p],W(m)&&(m=m()),m},y=l[p+"_flags"];s.push(Sn(t,p,d,y))}else $(2,"r-on",t)}return a},An={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})=>gs(t,e,n,o,r)},bs=(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=u=>!(r&&!u.ctrlKey||s&&!u.shiftKey||a&&!u.altKey||i&&!u.metaKey);return o?[t,u=>c(u)?u.key.toUpperCase()===o.toUpperCase():!1]:[t,c]}return[t,n=>!0]},Sn=(t,e,n,o)=>{if(j(e))return $(5,"r-on",t),()=>{};let r=ys(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,a;[e,a]=bs(e,o);let i=l=>{if(!a(l)||!n&&e==="submit"&&r?.prevent)return;let f=n(l);W(f)&&(f=f(l)),W(f)&&f(l)},c=()=>{t.removeEventListener(e,u,s)},u=l=>{if(!r){i(l);return}try{if(r.left&&l.button!==0||r.middle&&l.button!==1||r.right&&l.button!==2||r.self&&l.target!==t)return;r.stop&&l.stopPropagation(),r.prevent&&l.preventDefault(),i(l)}finally{r.once&&c()}};return t.addEventListener(e,u,s),c};var xs=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=F(n)),Ye(t,n,e[0]);return}let r=e.length;for(let s=0;s<r;++s){let a=e[s];if(w(a)){let i=a[0],c=a[1];Ye(t,i,c)}else if(I(a))for(let i of Object.entries(a)){let c=i[0],u=i[1];Ye(t,c,u)}else{let i=e[s++],c=e[s];Ye(t,i,c)}}},Vo={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{xs(t,e,n,o)}})};function Ts(t){return!!t||t===""}var Ye=(t,e,n)=>{if(me(e)){$(3,":prop",t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(Ee),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=Ts(n):n==null&&s==="string"?(n="",r=!0):s==="number"&&(n=0,r=!0)}try{t[e]=n}catch(s){r||$(4,e,o,n,s)}r&&t.removeAttribute(e)};var Lo={once:!0,mount:({el:t,parseResult:e,expr:n})=>{let o=e,r=o.value()[0],s=w(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 Cs=(t,e)=>{let n=He(t).data,o=n._ord;Wn(o)&&(o=n._ord=t.style.display),Be(e[0])?t.style.display=o:t.style.display="none"},Io={mount:()=>({update:({el:t,values:e})=>{Cs(t,e)}})};var Es=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(w(s)){let i=s.length;for(let c=0;c<i;++c)Po(t,s[c],a?.[c])}else Po(t,s,a)}},zt={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Es(t,e,n)}})},Po=(t,e,n)=>{let o=R(e),r=R(n),s=t.style,a=G(o);if(o&&!a){let i=o;if(r&&!G(r)){let c=r;for(let u in c)R(i[u])==null&&kn(s,u,"")}for(let c in i)kn(s,c,i[c])}else{let i=s.display;if(a?r!==o&&(s.cssText=o):r&&t.removeAttribute("style"),"_ord"in He(t).data)return;s.display=i}},Do=/\s*!important$/;function kn(t,e,n){let o=R(n);if(w(o))o.forEach(r=>{kn(t,e,r)});else{let r=o==null?"":String(o);if(e.startsWith("--"))t.setProperty(e,r);else{let s=vs(t,e);Do.test(r)?t.setProperty(We(s),r.replace(Do,""),"important"):t[s]=r}}}var Uo=["Webkit","Moz","ms"],Nn={};function vs(t,e){let n=Nn[e];if(n)return n;let o=F(e);if(o!=="filter"&&o in t)return Nn[e]=o;o=ct(o);for(let r=0;r<Uo.length;r++){let s=Uo[r]+o;if(s in t)return Nn[e]=s}return e}var Kt="r-rgi";var ie=t=>Ho(R(t)),Ho=(t,e=new WeakMap)=>{if(!t||!I(t)||t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return t;if(w(t))return t.map(ie);if(le(t)){let o=new Set;for(let r of t.keys())o.add(ie(r));return o}if(Me(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 R(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Ho(R(o[1]),e);return n};var Rs=(t,e)=>{let n=e[0];t.textContent=le(n)?JSON.stringify(ie([...n])):Me(n)?JSON.stringify(ie([...n])):I(n)?JSON.stringify(ie(n)):n?.toString()??""},ws=(t,e)=>{let n=t,o=n[ge];o&&(e[ge]=o,n[ge]=void 0)},Ss=t=>{if(t.tagName!=="SPAN"||!t.hasAttribute(Kt))return t;let e=t.parentNode;if(!e)return t;let n=t.ownerDocument.createTextNode("");return ws(t,n),e.replaceChild(n,t),n},Bo={mount:({el:t})=>{let e=Ss(t);return{update:({values:n})=>{Rs(e,n)}}}};var jo={mount:()=>({update:({el:t,values:e})=>{Ye(t,"value",e[0])}})};var Ze=t=>t?.[Tt]===1;function Ne(t){if(lt(t))return t;let e;if(x(t)?(e=t,t=e()):e=oe(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[Tt]=1,w(t)){let n=t.length;for(let o=0;o<n;++o){let r=t[o];Ze(r)||(t[o]=Ne(r))}return e}if(!I(t))return e;for(let n of Object.entries(t)){let o=n[1];if(Ze(o))continue;let r=n[0];ot(r)||(t[r]=null,t[r]=Ne(o))}return e}function On(t){return Ne(ie(t))}var ye=class t{static getDefault(){return t.$e??(t.$e=new t)}B={};u={};dt=()=>Object.keys(this.B).filter(e=>e.length===1||!e.startsWith(":"));te=new Map;F=new Map;static $e;static Pt="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.Dt()}Dt(){let e={},n=globalThis;for(let o of t.Pt.split(","))e[o]=n[o];return e.ref=Ne,e.cref=On,e.sref=oe,e.flatten=ie,e}addComponent(...e){for(let n of e){if(!n.defaultName){qe.warning("Registered component's default name is not defined",n);continue}this.te.set(ct(n.defaultName),n),this.F.set(ct(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":Vo,":":yn,"@":An,[`${e}on`]:An,[`${e}bind`]:yn,[`${e}html`]:Bt,[`${e}text`]:Bo,[`${e}show`]:Io,[`${e}model`]:Eo,":style":zt,[`${e}style`]:zt,[`${e}bind:style`]:zt,":class":vn,[`${e}bind:class`]:vn,":ref":Lo,":value":jo,[`${e}teleport`]:Ot},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 Wt=(t,e)=>{if(!t)return;let o=(e??ye.getDefault()).u,r=/(\{\{[^]*?\}\}|\[\[[^]*?\]\])/g,s=[{start:"{{",end:"}}"},{start:"[[",end:"]]"}];for(let a of Ns(t,o.pre,s))As(a,o.text,r,s)},As=(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],u=$o(c,o);if(u&&j(a[0])&&j(a[2])){let l=t.parentElement;l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),l.innerText="";return}}let i=document.createDocumentFragment();for(let c of a){let u=$o(c,o);if(u){let l=document.createElement("span");l.setAttribute(Kt,""),l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),i.appendChild(l)}else i.appendChild(document.createTextNode(c))}t.replaceWith(i)},Ns=(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 we(s))r(a)}};return r(t),o},$o=(t,e)=>e.find(n=>t.startsWith(n.start)&&t.endsWith(n.end));var ks=9,Os=10,Ms=13,Vs=32,ke=46,Gt=44,Ls=39,Is=34,Jt=40,et=41,Qt=91,Mn=93,Vn=63,Ps=59,_o=58,Fo=123,Xt=125,$e=43,Yt=45,Ln=96,qo=47,In=92,zo=new Set([2,3]),Xo={"=":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},Ds={"=>":2,...Xo,"||":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},Yo=Object.keys(Xo),Us=new Set(Yo),Dn=new Set(["=>"]);Yo.forEach(t=>Dn.add(t));var Ko={true:!0,false:!1,null:null},Hs="this",tt="Expected ",_e="Unexpected ",Hn="Unclosed ",Bs=tt+":",Wo=tt+"expression",js="missing }",$s=_e+"object property",_s=Hn+"(",Go=tt+"comma",Jo=_e+"token ",Fs=_e+"period",Pn=tt+"expression after ",qs="missing unaryOp argument",zs=Hn+"[",Ks=tt+"exponent (",Ws="Variable names cannot start with a number (",Gs=Hn+'quote after "',mt=t=>t>=48&&t<=57,Qo=t=>Ds[t],Un=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}z(e){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>=128}me(e){return this.z(e)||mt(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.p,o=this.e;for(;e===Vs||e===ks||e===Os||e===Ms;)e=n.charCodeAt(++o);this.e=o}parse(){let e=this.ye();return e.length===1?e[0]:{type:0,body:e}}ye(e){let n=[];for(;this.e<this.p.length;){let o=this.h;if(o===Ps||o===Gt)this.e++;else{let r=this.V();if(r)n.push(r);else if(this.e<this.p.length){if(o===e)break;throw this.i(_e+'"'+this.H+'"')}}}return n}V(){let e=this.Ut()??this._e();return this.g(),this.Bt(e)}he(){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.me(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.W(),!s||(n=this.he(),!n))return s;if(r={value:n,prec:Qo(n),right_a:Dn.has(n)},a=this.W(),!a)throw this.i(Pn+n);let u=[s,r,a];for(;n=this.he();){o=Qo(n),r={value:n,prec:o,right_a:Dn.has(n)},c=n;let l=f=>r.right_a&&f.right_a?o>f.prec:o<=f.prec;for(;u.length>2&&l(u[u.length-2]);)a=u.pop(),n=u.pop().value,s=u.pop(),e=this.Fe(n,s,a),u.push(e);if(e=this.W(),!e)throw this.i(Pn+c);u.push(r,e)}for(i=u.length-1,e=u[i];i>1;)e=this.Fe(u[i-1].value,u[i-2],e),i-=2;return e}W(){let e;if(this.g(),e=this.Ht(),e)return this.ge(e);let n=this.h;if(mt(n)||n===ke)return this.jt();if(n===Ls||n===Is)e=this.$t();else if(n===Qt)e=this._t();else{let o=this.Ft();if(o){let r=this.W();if(!r)throw this.i(qs);return this.ge({type:7,operator:o,argument:r})}this.z(n)?(e=this.be(),e.name in Ko?e={type:4,value:Ko[e.name],raw:e.name}:e.name===Hs&&(e={type:5})):n===Jt&&(e=this.qt())}return e?(e=this.G(e),this.ge(e)):!1}Fe(e,n,o){if(e==="=>"){let r=n.type===1?n.expressions:[n];return{type:15,params:r,body:o}}return Us.has(e)?{type:16,operator:e,left:n,right:o}:{type:8,operator:e,left:n,right:o}}Ht(){let e={node:!1};return this.Kt(e),e.node||(this.zt(e),e.node)||(this.Wt(e),e.node)||(this.qe(e),e.node)||this.Gt(e),e.node}ge(e){let n={node:e};return this.Jt(n),this.Qt(n),this.Xt(n),n.node}Ft(){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===Yt?(this.e++,"-"):o===33?(this.e++,"!"):o===126?(this.e++,"~"):o===$e?(this.e++,"+"):o===110&&r===101&&s===119&&!this.me(a)?(this.e+=3,"new"):!1}Ut(){let e={};return this.Yt(e),e.node}Bt(e){let n={node:e};return this.Zt(n),n.node}G(e){this.g();let n=this.h;for(;n===ke||n===Qt||n===Jt||n===Vn;){let o;if(n===Vn){if(this.p.charCodeAt(this.e+1)!==ke)break;o=!0,this.e+=2,this.g(),n=this.h}if(this.e++,n===Qt){if(e={type:3,computed:!0,object:e,property:this.V()},this.g(),n=this.h,n!==Mn)throw this.i(zs);this.e++}else n===Jt?e={type:6,arguments:this.Ke(et),callee:e}:(o&&this.e--,this.g(),e={type:3,computed:!1,object:e,property:this.be()});o&&(e.optional=!0),this.g(),n=this.h}return e}jt(){let e=this.p,n=this.e,o=n;for(;mt(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===ke)for(o++;mt(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let i=e.charCodeAt(o);(i===$e||i===Yt)&&o++;let c=o;for(;mt(e.charCodeAt(o));)o++;if(c===o){this.e=o;let u=e.slice(n,o);throw this.i(Ks+u+this.H+")")}}this.e=o;let s=e.slice(n,o),a=e.charCodeAt(o);if(this.z(a))throw this.i(Ws+s+this.H+")");if(a===ke||s.length===1&&s.charCodeAt(0)===ke)throw this.i(Fs);return{type:4,value:parseFloat(s),raw:s}}$t(){let e=this.p,n=e.length,o=this.e,r=e.charCodeAt(this.e++),s=this.e,a=s,i=[],c=!1,u=!1;for(;s<n;){let f=e.charCodeAt(s);if(f===r){u=!0,this.e=s+1;break}if(f===In){c||(c=!0),i.push(e.slice(a,s));let p=e.charCodeAt(s+1);i.push(this.ze(p)),s+=2,a=s}else s++}let l=c?i.join("")+e.slice(a,u?s:n):e.slice(a,u?s:n);if(!u)throw this.e=s,this.i(Gs+l+'"');return{type:4,value:l,raw:e.substring(o,this.e)}}ze(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)}}be(){let e=this.h,n=this.e;if(this.z(e))this.e++;else throw this.i(_e+this.H);for(;this.e<this.p.length&&(e=this.h,this.me(e));)this.e++;return{type:2,name:this.p.slice(n,this.e)}}Ke(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===et&&r&&r>=n.length)throw this.i(Jo+String.fromCharCode(e));break}else if(s===Gt){if(this.e++,r++,r!==n.length){if(e===et)throw this.i(Jo+",");for(let a=n.length;a<r;a++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(Go);{let a=this.V();if(!a||a.type===0)throw this.i(Go);n.push(a)}}}if(!o)throw this.i(tt+String.fromCharCode(e));return n}qt(){this.e++;let e=this.ye(et);if(this.f(et))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(_s)}_t(){return this.e++,{type:9,elements:this.Ke(Mn)}}Kt(e){if(this.f(Fo)){this.e++;let n=[];for(;!isNaN(this.h);){if(this.g(),this.f(Xt)){this.e++,e.node=this.G({type:10,properties:n});return}let o=this.V();if(!o)break;if(this.g(),o.type===2&&(this.f(Gt)||this.f(Xt)))n.push({type:12,computed:!1,key:o,value:o,shorthand:!0});else if(this.f(_o)){this.e++;let r=this.V();if(!r)throw this.i($s);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(Gt)&&this.e++}throw this.i(js)}}zt(e){let n=this.h;if((n===$e||n===Yt)&&n===this.p.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===$e?"++":"--",argument:this.G(this.be()),prefix:!0};if(!o.argument||!zo.has(o.argument.type))throw this.i(_e+o.operator)}}Qt(e){let n=e.node,o=this.h;if((o===$e||o===Yt)&&o===this.p.charCodeAt(this.e+1)){if(!zo.has(n.type))throw this.i(_e+(o===$e?"++":"--"));this.e+=2,e.node={type:13,operator:o===$e?"++":"--",argument:n,prefix:!1}}}Wt(e){this.p.charCodeAt(this.e)===ke&&this.p.charCodeAt(this.e+1)===ke&&this.p.charCodeAt(this.e+2)===ke&&(this.e+=3,e.node={type:14,argument:this.V()})}Zt(e){if(e.node&&this.f(Vn)){this.e++;let n=e.node,o=this.V();if(!o)throw this.i(Wo);if(this.g(),this.f(_o)){this.e++;let r=this.V();if(!r)throw this.i(Wo);e.node={type:11,test:n,consequent:o,alternate:r}}else throw this.i(Bs)}}Yt(e){if(this.g(),this.f(Jt)){let n=this.e;if(this.e++,this.g(),this.f(et)){this.e++;let o=this.he();if(o==="=>"){let r=this._e();if(!r)throw this.i(Pn+o);e.node={type:15,params:null,body:r};return}}this.e=n}}Xt(e){let n=e.node,o=n.type;(o===2||o===3)&&this.f(Ln)&&(e.node={type:17,tag:n,quasi:this.qe(e)})}qe(e){if(!this.f(Ln))return;let n=this.p,o=n.length,r={type:19,quasis:[],expressions:[]},s=++this.e,a=[],i=[],c=!1,u=l=>{if(!c){let d=n.slice(s,this.e);return r.quasis.push({type:18,value:{raw:d,cooked:d},tail:l})}a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let f=a.join(""),p=i.join("");return a.length=0,i.length=0,c=!1,r.quasis.push({type:18,value:{raw:f,cooked:p},tail:l})};for(;this.e<o;){let l=n.charCodeAt(this.e);if(l===Ln)return u(!0),this.e+=1,e.node=r,r;if(l===36&&n.charCodeAt(this.e+1)===Fo){if(u(!1),this.e+=2,r.expressions.push(...this.ye(Xt)),!this.f(Xt))throw this.i("unclosed ${");this.e+=1,s=this.e}else if(l===In){c||(c=!0),a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let f=n.charCodeAt(this.e+1);a.push(n.slice(this.e,this.e+2)),i.push(this.ze(f)),this.e+=2,s=this.e}else this.e+=1}throw this.i("Unclosed `")}Jt(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}Gt(e){if(!this.f(qo))return;let n=++this.e,o=!1;for(;this.e<this.p.length;){if(this.h===qo&&!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.G(e.node),e.node}this.f(Qt)?o=!0:o&&this.f(Mn)&&(o=!1),this.e+=this.f(In)?2:1}throw this.i("Unclosed Regex")}},Zo=t=>new Un(t).parse();var Js={"=>":(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},Qs={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},or=t=>{if(!t?.some(nr))return t;let e=[];return t.forEach(n=>nr(n)?e.push(...n):e.push(n)),e},er=(...t)=>or(t),Bn=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},Xs={"++":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(++o),o}return++t[e]},"--":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(--o),o}return--t[e]}},Ys={"++":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(o+1),o}return t[e]++},"--":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(o-1),o}return t[e]--}},tr={"=":(t,e,n)=>{let o=t[e];return x(o)?o(n):t[e]=n},"+=":(t,e,n)=>{let o=t[e];return x(o)?o(o()+n):t[e]+=n},"-=":(t,e,n)=>{let o=t[e];return x(o)?o(o()-n):t[e]-=n},"*=":(t,e,n)=>{let o=t[e];return x(o)?o(o()*n):t[e]*=n},"/=":(t,e,n)=>{let o=t[e];return x(o)?o(o()/n):t[e]/=n},"%=":(t,e,n)=>{let o=t[e];return x(o)?o(o()%n):t[e]%=n},"**=":(t,e,n)=>{let o=t[e];return x(o)?o(o()**n):t[e]**=n},"<<=":(t,e,n)=>{let o=t[e];return x(o)?o(o()<<n):t[e]<<=n},">>=":(t,e,n)=>{let o=t[e];return x(o)?o(o()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let o=t[e];return x(o)?o(o()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let o=t[e];return x(o)?o(o()|n):t[e]|=n},"&=":(t,e,n)=>{let o=t[e];return x(o)?o(o()&n):t[e]&=n},"^=":(t,e,n)=>{let o=t[e];return x(o)?o(o()^n):t[e]^=n}},Zt=(t,e)=>W(t)?t.bind(e):t,jn=class{l;We;Ge;Je;A;Qe;Xe;constructor(e,n,o,r,s){this.l=w(e)?e:[e],this.We=n,this.Ge=o,this.Je=r,this.Xe=!!s}Ye(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],Zt(R(o[r]),o);for(let a of this.l)if(r in a)return this.A=a[r],Zt(R(a[r]),a);let s=this.We;if(s&&r in s)return this.A=s[r],Zt(R(s[r]),s)}5(e,n,o){return this.l[0]}0(e,n,o){return this.Ze(n,o,er,...e.body)}1(e,n,o){return this.v(n,o,(...r)=>r.pop(),...e.expressions)}3(e,n,o){let{obj:r,key:s}=this.xe(e,n,o),a=r?.[s];return this.A=a,Zt(R(a),r)}4(e,n,o){return e.value}6(e,n,o){let r=(a,...i)=>W(a)?a(...or(i)):a,s=this.v(++n,o,r,e.callee,...e.arguments);return this.A=s,s}7(e,n,o){return this.v(n,o,Qs[e.operator],e.argument)}8(e,n,o){let r=Js[e.operator];switch(e.operator){case"||":case"&&":case"??":return r(()=>this.b(e.left,n,o),()=>this.b(e.right,n,o))}return this.v(n,o,r,e.left,e.right)}9(e,n,o){return this.Ze(++n,o,er,...e.elements)}10(e,n,o){let r={},s=(...a)=>{a.forEach(i=>{Object.assign(r,i)})};return this.v(++n,o,s,...e.properties),r}11(e,n,o){return this.v(n,o,r=>this.b(r?e.consequent:e.alternate,n,o),e.test)}12(e,n,o){let r={},s=l=>l?.type!==15,a=this.Je??(()=>!1),i=n===0&&this.Xe,c=l=>this.et(i,e.key,n,Bn(l,o)),u=l=>this.et(i,e.value,n,Bn(l,o));if(e.shorthand){let l=e.key.name;r[l]=s(e.key)&&a(l,n)?c:c()}else if(e.computed){let l=R(c());r[l]=s(e.value)&&a(l,n)?u:u()}else{let l=e.key.type===4?e.key.value:e.key.name;r[l]=s(e.value)&&a(l,n)?()=>u:u()}return r}xe(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?Xs:Ys;if(r.type===2){let i=r.name,c=this.Ye(i,o);return me(c)?void 0:a[s](c,i)}if(r.type===3){let{obj:i,key:c}=this.xe(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.Ye(a,o);if(me(i))return;let c=this.b(e.right,n,o);return tr[s](i,a,c)}if(r.type===3){let{obj:a,key:i}=this.xe(r,n,o),c=this.b(e.right,n,o);return tr[s](a,i,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return w(r)&&(r.s=rr),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.v(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.v(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=R(this[e.type](e,n,o));return this.Qe=e.type,r}et(e,n,o,r){let s=this.b(n,o,r);return e&&this.tt()?this.A:s}tt(){let e=this.Qe;return(e===2||e===3||e===6)&&x(this.A)}eval(e,n){let{value:o,refs:r}=xn(()=>this.b(e,-1,n)),s={value:o,refs:r};return this.tt()&&(s.ref=this.A),s}v(e,n,o,...r){let s=r.map(a=>a&&this.b(a,e,n));return o(...s)}Ze(e,n,o,...r){let s=this.Ge;if(!s)return this.v(e,n,o,...r);let a=r.map((i,c)=>i&&(i.type!==15&&s(c,e)?u=>this.b(i,e,Bn(u,n)):this.b(i,e,n)));return o(...a)}},rr=Symbol("s"),nr=t=>t?.s===rr,sr=(t,e,n,o,r,s,a)=>new jn(e,n,o,r,a).eval(t,s);var ir={},ar=t=>!!t,en=class{l;o;constructor(e,n){this.l=e,this.o=n}w(e){this.l=[e,...this.l]}ne(){return this.l.map(n=>n.components).filter(ar).reverse().reduce((n,o)=>{for(let[r,s]of Object.entries(o))n[r.toUpperCase()]=s;return n},{})}ft(){let e=[],n=new Set,o=this.l.map(r=>r.components).filter(ar).reverse();for(let r of o)for(let s of Object.keys(r))n.has(s)||(n.add(s),e.push(s));return e}O(e,n,o,r,s){let a=[],i=[],c=new Set,u=()=>{for(let E=0;E<i.length;++E)i[E]();i.length=0},p={value:()=>a,stop:()=>{u(),c.clear()},subscribe:(E,S)=>(c.add(E),S&&E(a),()=>{c.delete(E)}),refs:[],context:this.l[0]};if(j(e))return p;let d=this.o.globalContext,y=[],m=new Set,T=(E,S,H,B)=>{try{let M=sr(E,S,d,n,o,B,r);return H&&M.refs.length>0&&y.push(...M.refs),{value:M.value,refs:M.refs,ref:M.ref}}catch(M){$(6,`evaluation error: ${e}`,M)}return{value:void 0,refs:[]}};try{let E=ir[e]??Zo("["+e+"]");ir[e]=E;let S=this.l.slice(),H=E.elements,B=H.length,M=new Array(B);p.refs=M;let q=()=>{y.length=0,s||(m.clear(),u());let V=new Array(B);for(let A=0;A<B;++A){let fe=H[A];if(n?.(A,-1)){V[A]=P=>T(fe,S,!1,{$event:P}).value;continue}let b=T(fe,S,!0);V[A]=b.value,M[A]=b.ref}if(!s)for(let A of y)m.has(A)||(m.add(A),i.push(ne(A,q)));if(a=V,c.size!==0)for(let A of c)c.has(A)&&A(a)};q()}catch(E){$(6,`parse error: ${e}`,E)}return p}L(){return this.l.slice()}nt=[];le(e){this.nt.push(this.l),this.l=e}E(e,n){try{this.le(e),n()}finally{this.en()}}en(){this.l=this.nt.pop()??[]}};var cr=t=>{let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||t==="-"||t==="_"||t===":"},Zs=(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},ei=(t,e)=>{let n=e?2:1;for(;n<t.length&&(t[n]===" "||t[n]===`
3
+ `);)++n;if(n>=t.length||!cr(t[n]))return null;let o=n,r=!1;for(;n<t.length&&cr(t[n]);){let s=t.charCodeAt(n);s>=65&&s<=90&&(r=!0),++n}return{start:o,end:n,hasUppercase:r}},ur=t=>{switch(t){case"table":case"thead":case"tbody":case"tfoot":return!0;default:return!1}},ti=t=>{switch(t){case"thead":case"tbody":case"tfoot":return!0;default:return!1}},ni=t=>{switch(t){case"caption":case"colgroup":case"thead":case"tbody":case"tfoot":case"tr":return!0;default:return!1}},dt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),oi=t=>{switch(t){case"caption":return"captionx";case"thead":return"theadx";case"tbody":return"tbodyx";case"tfoot":return"tfootx";case"tr":return"trx";case"td":return"tdx";case"th":return"thx";case"colgroup":return"colgroupx";case"col":return"colx";default:return null}},ri=t=>{switch(t){case"captionx":return"caption";case"theadx":return"thead";case"tbodyx":return"tbody";case"tfootx":return"tfoot";case"trx":return"tr";case"tdx":return"td";case"thx":return"th";case"colgroupx":return"colgroup";case"colx":return"col";default:return}},si=(t,e)=>`${t}</${e}>`,lr=(t,e)=>`${t.slice(0,t.length-2)}></${e}>`,tn=t=>{let e=0,n=[],o=[],r=[],s=0;for(;e<t.length;){let a=t.indexOf("<",e);if(a===-1){n.push(t.slice(e));break}if(n.push(t.slice(e,a)),t.startsWith("<!--",a)){let V=t.indexOf("-->",a+4);if(V===-1){n.push(t.slice(a));break}n.push(t.slice(a,V+3)),e=V+3;continue}let i=Zs(t,a);if(i===-1){n.push(t.slice(a));break}let c=t.slice(a,i+1),u=c.startsWith("</");if(c.startsWith("<!")||c.startsWith("<?")){n.push(c),e=i+1;continue}let f=ei(c,u);if(!f){n.push(c),e=i+1;continue}let p=c.slice(f.start,f.end),d=f.hasUppercase?"":p;if(u){let V=r[r.length-1];if(V?.tagName===p){r.pop(),V.emit&&n.push(c),e=i+1;continue}let A=o[o.length-1];A?(o.pop(),n.push(A.replacementHost?`</${A.replacementHost}>`:c),!A.isTableAlias&&ur(A.effectiveTag)&&--s):n.push(c),e=i+1;continue}let y=c.charCodeAt(c.length-2)===47,m=o[o.length-1],T=null;s===0?T=oi(d):ti(m?.effectiveTag??"")?T=d==="tr"?null:"tr":m?.effectiveTag==="table"?T=ni(d)?null:"tr":m?.effectiveTag==="tr"?T=d==="td"||d==="th"?null:"td":m?.effectiveTag==="colgroup"&&(T=d==="col"?null:"col");let E=ri(T),S=E!==void 0,H=y&&!dt.has(T||d),B=!!T&&E===d&&dt.has(d),M=!y&&!!T&&dt.has(T)&&!B,q=!y&&!T&&dt.has(d);if(T){let V=`${c.slice(0,f.start)}${T} is="${E?`r-${E}`:`regor:${p}`}"${c.slice(f.end)}`;n.push(H?lr(V,T):B?si(V,T):V)}else n.push(H?lr(c,p):c);if(M?r.push({tagName:p,emit:!1}):B&&!y?r.push({tagName:p,emit:!1}):q&&r.push({tagName:p,emit:!0}),!y&&!B&&!M&&!q&&!dt.has(T??d)){let V=E??T??(d||p);o.push({replacementHost:T,effectiveTag:V,isTableAlias:S}),!S&&ur(V)&&++s}e=i+1}return n.join("")};var ii="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",ai=new Set(ii.toUpperCase().split(",")),ci="http://www.w3.org/2000/svg",fr=(t,e)=>{de(t)?t.content.appendChild(e):t.appendChild(e)},$n=(t,e,n,o)=>{let r=t.t;if(r){let a=n&&ai.has(r.toUpperCase())?document.createElementNS(ci,r.toLowerCase()):document.createElement(r),i=t.a;if(i)for(let u of Object.entries(i)){let l=u[0],f=u[1];l.startsWith("#")&&(f=l.substring(1),l="name"),a.setAttribute(kt(l,o),f)}let c=t.c;if(c)for(let u of c)$n(u,a,n,o);fr(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)fr(e,a);else throw new Error("unsupported node type.")}},nt=(t,e,n)=>{n??=ye.getDefault();let o=document.createDocumentFragment();if(!w(t))return $n(t,o,!!e,n),o;for(let r of t)$n(r,o,!!e,n);return o};var ui=(t,e={selector:"#app"},n)=>{G(e)&&(e={selector:"#app",template:e}),ao(t)&&(t=t.context);let o=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!o||!ve(o))throw _(0);n||(n=ye.getDefault());let r=()=>{for(let i of[...o.childNodes])Y(i)},s=i=>{for(;i.length>0;)o.appendChild(i[0])};if(e.template){let i=document.createRange().createContextualFragment(tn(e.template));r(),s(i.childNodes),e.element=i}else if(e.json){let i=nt(e.json,e.isSVG,n);r(),s(i.childNodes)}return n.useInterpolation&&Wt(o,n),new _n(t,o,n).y(),Q(o,()=>{Ve(t)}),Mt(t),{context:t,unmount:()=>{Y(o)},unbind:()=>{Ee(o)}}},_n=class{tn;rt;o;m;r;constructor(e,n,o){this.tn=e,this.rt=n,this.o=o,this.m=new en([e],o),this.r=new Ft(this.m)}y(){this.r.$(this.rt)}};var ht=t=>{if(w(t))return t.map(r=>ht(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=we(t);return o.length>0&&(e.c=[...o].map(r=>ht(r))),e};var li=(t,e={})=>{w(e)&&(e={props:e}),G(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 _(1,t.selector);s.remove(),t.element=s}else if(t.template){let s=document.createRange().createContextualFragment(tn(t.template));t.element=s}else t.json&&(t.element=nt(t.json,t.isSVG,e.config),o=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&Wt(t.element,e.config??ye.getDefault());let r=t.element;if(!o&&((t.isSVG??(at(r)&&r.hasAttribute?.("isSVG")))||at(r)&&r.querySelector("[isSVG]"))){let s=r.content,a=s?[...s.childNodes]:[...r.childNodes],i=ht(a);t.element=nt(i,!0,e.config)}return{context:n,template:t.element,inheritAttrs:e.inheritAttrs??!0,props:e.props,defaultName:e.defaultName}};var Fn=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 fi=t=>{Ue()?.onMounted.push(t)};var pi=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw _(4);return e&&!n.isStopped?e(...r):(e=mi(t,n),e(...r))};return o[J]=1,Pe(o,!0),o.stop=()=>n.ref?.stop?.(),se(()=>o.stop(),!0),o},mi=(t,e)=>{let n=e.ref??oe(null);e.ref=n,e.isStopped=!1;let o=0,r=Qe(()=>{if(o>0){r(),e.isStopped=!0,ee(n);return}n(t()),++o});return n.stop=r,n};var di=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw _(4);return o&&!n.isStopped?o(...s):(o=hi(t,e,n),o(...s))};return r[J]=1,Pe(r,!0),r.stop=()=>n.ref?.stop?.(),se(()=>r.stop(),!0),r},hi=(t,e,n)=>{let o=n.ref??oe(null);n.ref=o,n.isStopped=!1;let r=0,s=i=>{if(r>0){o.stop(),n.isStopped=!0,ee(o);return}let c=t.map(u=>u());o(e(...c)),++r},a=[];for(let i of t){let c=ne(i,s);a.push(c)}return s(null),o.stop=()=>{a.forEach(i=>{i()})},o};var yi=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw _(4);return o&&!n.isStopped?o(...s):(o=gi(t,e,n),o(...s))};return r[J]=1,Pe(r,!0),r.stop=()=>n.ref?.stop?.(),se(()=>r.stop(),!0),r},gi=(t,e,n)=>{let o=n.ref??oe(null);n.ref=o,n.isStopped=!1;let r=0;return o.stop=ne(t,s=>{if(r>0){o.stop(),n.isStopped=!0,ee(o);return}o(e(s)),++r},!0),o};var bi=t=>(t[Ct]=1,t);var xi=(t,e)=>{if(!e)throw _(5);let o=Ze(t)?Ne: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){$(6,`persist: failed to parse data for key ${e}`,i),r()}else r();let a=Qe(r);return se(a,!0),t};var qn=(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},Ti=qn,Ci=qn;var Ei=(t,e,n)=>{let o=[],r=()=>{e(t.map(a=>a()))};for(let a of t)o.push(ne(a,r));n&&r();let s=()=>{for(let a of o)a()};return se(s,!0),s};var vi=t=>{if(!x(t))throw _(3,"observerCount");return t(void 0,void 0,2)};var Ri=t=>{pr();try{t()}finally{mr()}},pr=()=>{Te.stack||(Te.stack=[]),Te.stack.push(new Set)},mr=()=>{let t=Te.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 Te.stack;for(let n of e)try{ee(n)}catch(o){console.error(o)}};export{st as ComponentHead,Fn as ContextRegistry,ye as RegorConfig,Q as addUnbinder,Ri as batch,xn as collectRefs,di as computeMany,yi as computeRef,pi as computed,ui as createApp,On as cref,li as defineComponent,hr as drainUnbind,mr as endBatch,ut as entangle,ie as flatten,He as getBindData,qn as html,Ze as isDeepRef,lt as isRaw,x as isRef,bi as markRaw,ne as observe,Ei as observeMany,vi as observerCount,fi as onMounted,se as onUnmounted,Rn as pause,xi as persist,Lr as pval,Ti as raw,Ne as ref,Y as removeNode,wn as resume,bn as silence,oe as sref,pr as startBatch,Ci as svg,nt as toFragment,ht as toJsonTemplate,ee as trigger,Ee as unbind,R as unref,hn as useScope,qe as warningHandler,Qe as watchEffect};
@@ -31,6 +31,7 @@ var Regor = (() => {
31
31
  computeRef: () => computeRef,
32
32
  computed: () => computed,
33
33
  createApp: () => createApp,
34
+ cref: () => cref,
34
35
  defineComponent: () => defineComponent,
35
36
  drainUnbind: () => drainUnbind,
36
37
  endBatch: () => endBatch,
@@ -4150,6 +4151,9 @@ var Regor = (() => {
4150
4151
  return rawName;
4151
4152
  }
4152
4153
 
4154
+ // src/bind/rgi.ts
4155
+ var rgi = "r-rgi";
4156
+
4153
4157
  // src/misc/flatten.ts
4154
4158
  var flatten = (reference) => {
4155
4159
  return flattenContent(unref(reference));
@@ -4157,6 +4161,8 @@ var Regor = (() => {
4157
4161
  var flattenContent = (value, weakMap = /* @__PURE__ */ new WeakMap()) => {
4158
4162
  if (!value) return value;
4159
4163
  if (!isObject(value)) return value;
4164
+ if (value instanceof Node || value instanceof Date || value instanceof RegExp || value instanceof Promise || value instanceof Error)
4165
+ return value;
4160
4166
  if (isArray(value)) {
4161
4167
  return value.map(flatten);
4162
4168
  }
@@ -4188,12 +4194,32 @@ var Regor = (() => {
4188
4194
  const value = values[0];
4189
4195
  el.textContent = isSet(value) ? JSON.stringify(flatten([...value])) : isMap(value) ? JSON.stringify(flatten([...value])) : isObject(value) ? JSON.stringify(flatten(value)) : value?.toString() ?? "";
4190
4196
  };
4197
+ var moveBindData = (from, to) => {
4198
+ const bindableFrom = from;
4199
+ const bindData = bindableFrom[bindDataSymbol];
4200
+ if (!bindData) return;
4201
+ to[bindDataSymbol] = bindData;
4202
+ bindableFrom[bindDataSymbol] = void 0;
4203
+ };
4204
+ var createInterpolationTextNode = (el) => {
4205
+ if (el.tagName !== "SPAN") return el;
4206
+ if (!el.hasAttribute(rgi)) return el;
4207
+ const parent = el.parentNode;
4208
+ if (!parent) return el;
4209
+ const textNode = el.ownerDocument.createTextNode("");
4210
+ moveBindData(el, textNode);
4211
+ parent.replaceChild(textNode, el);
4212
+ return textNode;
4213
+ };
4191
4214
  var textDirective = {
4192
- mount: () => ({
4193
- update: ({ el, values }) => {
4194
- updateText(el, values);
4195
- }
4196
- })
4215
+ mount: ({ el }) => {
4216
+ const target = createInterpolationTextNode(el);
4217
+ return {
4218
+ update: ({ values }) => {
4219
+ updateText(target, values);
4220
+ }
4221
+ };
4222
+ }
4197
4223
  };
4198
4224
 
4199
4225
  // src/directives/value.ts
@@ -4244,6 +4270,11 @@ var Regor = (() => {
4244
4270
  return result;
4245
4271
  }
4246
4272
 
4273
+ // src/reactivity/cref.ts
4274
+ function cref(value) {
4275
+ return ref(flatten(value));
4276
+ }
4277
+
4247
4278
  // src/app/RegorConfig.ts
4248
4279
  var RegorConfig = class _RegorConfig {
4249
4280
  static getDefault() {
@@ -4311,6 +4342,7 @@ var Regor = (() => {
4311
4342
  obj[key] = global[key];
4312
4343
  }
4313
4344
  obj.ref = ref;
4345
+ obj.cref = cref;
4314
4346
  obj.sref = sref;
4315
4347
  obj.flatten = flatten;
4316
4348
  return obj;
@@ -4428,6 +4460,7 @@ var Regor = (() => {
4428
4460
  const delimiter = getInterpolationDelimiter(part, delimiters);
4429
4461
  if (delimiter) {
4430
4462
  const spanTag = document.createElement("span");
4463
+ spanTag.setAttribute(rgi, "");
4431
4464
  spanTag.setAttribute(
4432
4465
  textDirective2,
4433
4466
  part.substring(