regor 1.6.9 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- var $e=Symbol(":regor");var Ce=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];fr(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},fr=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 _e=[],ht=!1,yt,qn=()=>{if(ht=!1,yt=void 0,_e.length!==0){for(let t=0;t<_e.length;++t)Ce(_e[t]);_e.length=0}},Y=t=>{t.remove(),_e.push(t),ht||(ht=!0,yt=setTimeout(qn,1))},pr=async()=>{_e.length===0&&!ht||(yt&&clearTimeout(yt),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(),mr=Object.prototype.toString,nn=t=>mr.call(t),Ne=t=>nn(t)==="[object Map]",le=t=>nn(t)==="[object Set]",on=t=>nn(t)==="[object Date]",tt=t=>typeof t=="symbol",R=Array.isArray,V=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 gt=[],Wn=()=>{let t={onMounted:[],onUnmounted:[]};return gt.push(t),t},Pe=t=>{let e=gt[gt.length-1];if(!e&&!t)throw _(2);return e},Gn=t=>{let e=Pe();return t&&sn(t),gt.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()},bt=t=>t[rn];var Oe=t=>{bt(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=Fe.warning;r&&(G(o)?r(o):r(o,...o.args))},Fe={warning:console.warn};var xt=Symbol("ref"),J=Symbol("sref"),Tt=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}.`)},Ct=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(x(t))return`ref<${Ct(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(R(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"},dr=t=>t.length>60?`${t.slice(0,57)}...`:t,nt=(t,e=0)=>{if(e>1)return"unknown";if(x(t)){let s=t();return`ref(${nt(s,e+1)})`}if(typeof t=="string")return dr(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(R(t)){let s=t.slice(0,5).map(i=>nt(i,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(V(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let i=s.map(([a,c])=>{let u=nt(c,e+1);return`${a}: ${u}`}).join(", ");return Object.keys(t).length>5?`{ ${i}, ... }`:`{ ${i} }`}return"unknown"},ce=t=>{if(x(t))return`got ${Ct(t)}(${nt(t())})`;let e=Ct(t),n=nt(t);return`got ${e} (${n})`},hr=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},yr=(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 hr(e)},gr=(t,e,n)=>{let o=[];for(let r of e){let s=yr(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)}`},br=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":Ct(t),xr=(t,e)=>{typeof t!="string"&&be(e,`expected string, ${ce(t)}`)},Tr=(t,e)=>{typeof t!="number"&&be(e,`expected number, ${ce(t)}`)},Cr=(t,e)=>{typeof t!="boolean"&&be(e,`expected boolean, ${ce(t)}`)},Er=t=>(e,n)=>{e instanceof t||be(n,`expected instance of ${t.name||"provided class"}, ${ce(e)}`)},vr=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},Rr=t=>(e,n,o)=>{e!==null&&t(e,n,o)},wr=(...t)=>(e,n,o)=>{let r=[];for(let s of t)try{s(e,n,o);return}catch(i){r.push(i)}be(n,gr(n,r,e))},Sr=t=>(e,n)=>{t.includes(e)||be(n,`expected one of ${t.map(o=>br(o)).join(", ")}, ${ce(e)}`)},Ar=t=>(e,n,o)=>{R(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 kr(t){return(e,n,o)=>{V(e)||be(n,`expected object, ${ce(e)}`);let r=e;for(let s in t){let i=t[s];if(!i)continue;i(r[s],`${n}.${s}`,o)}}}var Nr=t=>(e,n,o)=>{if(x(e)){t(e(),`${n}.value`,o);return}be(n,`expected ref, ${ce(e)}`)},Or={fail:be,describe:ce,isString:xr,isNumber:Tr,isBoolean:Cr,isClass:Er,optional:vr,nullable:Rr,or:wr,oneOf:Sr,arrayOf:Ar,shape:kr,refOf:Nr};var Mr=(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})},ot=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;J;Q;constructor(e,n,o,r,s,i){this.props=e,this.J=n,this.ctx=o,this.start=r,this.end=s,this.Q=i}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(i){let a=Mr(this.J,o,i);if(this.Q==="warn"){Fe.warning(a.message,a);continue}throw a}}}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 rt=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 vt={},Et={},Xn=1,Yn=t=>{let e=(Xn++).toString();return vt[e]=t,Et[e]=0,e},an=t=>{Et[t]+=1},cn=t=>{--Et[t]===0&&(delete vt[t],delete Et[t])},Zn=t=>vt[t],un=()=>Xn!==1&&Object.keys(vt).length>0,st="r-switch",Lr=t=>{let e=t.filter(o=>Ee(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(st))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},qe=(t,e)=>{if(!un())return;let n=Lr(e);n.length!==0&&(n.forEach(an),Q(t,()=>{n.forEach(cn)}))};var Rt=()=>{},ln=(t,e,n,o)=>{let r=[];for(let s of t){let i=s.cloneNode(!0);n.insertBefore(i,o),r.push(i)}Le(e,r)},fn=Symbol("r-if"),eo=Symbol("r-else"),to=t=>t[eo]===1,wt=class{o;N;Te;X;Y;x;R;constructor(e){this.o=e,this.N=e.r.u.if,this.Te=At(e.r.u.if),this.X=e.r.u.else,this.Y=e.r.u.elseif,this.x=e.r.u.for,this.R=e.r.u.pre}rt(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.o.r.u.is)||e.hasAttribute("is")||this.o.E.Z(e)||this.o.E.j(e,r=>{r.hasAttribute(this.N)&&this.y(r)}),n}ee(e){return e[fn]?!0:(e[fn]=!0,St(e,this.Te).forEach(n=>n[fn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.ee(e)||this.rt(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=ze(e),s=e.parentNode,i=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(i,e),qe(i,r),r.forEach(c=>{Y(c)}),e.remove(),n!=="if"&&(e[eo]=1);let a=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(a,i.nextSibling),{nodes:r,parent:s,commentBegin:i,commentEnd:a}}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:i,commentEnd:a}=this.U(e,"else");return[{mount:()=>{ln(r,this.o,s,a)},unmount:()=>{ve(i,a)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.Y);if(!r)return[];e.removeAttribute(this.Y);let{nodes:s,parent:i,commentBegin:a,commentEnd:c}=this.U(e,"elseif",` => ${r} `),u=this.o.m.O(r),l=u.value,f=this.Re(o,n),p=Rt;return Q(a,()=>{u.stop(),p(),p=Rt}),p=u.subscribe(n),[{mount:()=>{ln(s,this.o,i,c)},unmount:()=>{ve(a,c)},isTrue:()=>rt(l()[0]),isMounted:!1},...f]}}M(e,n){let o=e.nextElementSibling,{nodes:r,parent:s,commentBegin:i,commentEnd:a}=this.U(e,"if",` => ${n} `),c=this.o.m.O(n),u=c.value,l=!1,f=this.o.m,p=f.L(),d=()=>{f.C(p,()=>{if(rt(u()[0]))l||(ln(r,this.o,s,a),l=!0),y.forEach(E=>{E.unmount(),E.isMounted=!1});else{ve(i,a),l=!1;let E=!1;for(let w of y)!E&&w.isTrue()?(w.isMounted||(w.mount(),w.isMounted=!0),E=!0):(w.unmount(),w.isMounted=!1)}})},y=this.Re(o,d),m=Rt;Q(i,()=>{c.stop(),m(),m=Rt}),d(),m=c.subscribe(d)}};var ze=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))}},St=(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,it=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()},Vr=function(t){return this(t)},Ir=()=>{throw new Error("value is readonly.")},Pr={get:oo,set:Vr,enumerable:!0,configurable:!1},Dr={get:oo,set:Ir,enumerable:!0,configurable:!1},Ve=(t,e)=>{t[J]=e?2:1,Object.defineProperty(t,"value",e?Dr:Pr)},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},At=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),pn=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Ur=/-(\w)/g,F=pn(t=>t&&t.replace(Ur,(e,n)=>n?n.toUpperCase():"")),Hr=/\B([A-Z])/g,Ke=pn(t=>t&&t.replace(Hr,"-$1").toLowerCase()),at=pn(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var Nt={mount:()=>{}};var We=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Ot=t=>{bt(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=>V(t)?mn in t:!1;var hn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(V(o))for(let r of Object.entries(o)){let s=r[0],i=r[1],a=n[s];a!==i&&(x(a)?a(i):n[s]=i)}}})};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 io=t=>t[J]===2,ct=(t,e)=>{if(t===e)return()=>{};let n=io(t),o=io(e);if(n&&o)return()=>{};if(n){let i=ne(t,()=>e(t()));return e(t()),i}if(o){let i=ne(e,()=>t(e()));return t(e()),i}let r=ne(t,i=>e(i)),s=ne(e,i=>t(i));return e(t()),()=>{r(),s()}};var he=[],ao=t=>{he.length!==0&&he[he.length-1]?.add(t)},Ge=t=>{if(!t)return()=>{};let e={stop:()=>{}};return Br(t,e),se(()=>e.stop(),!0),e.stop},Br=(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(i=>n.push(i)),o)return;for(let i of[...s]){let a=ne(i,()=>{r(),Ge(t)});n.push(a)}}finally{he.pop()}},yn=t=>{let e=he.length,n=e>0&&he[e-1];try{return n&&he.push(null),t()}finally{n&&he.pop()}},gn=t=>{try{let e=new Set;return he.push(e),{value:t(),refs:[...e]}}finally{he.pop()}};var ut=t=>!!t&&t[Tt]===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(R(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(V(r))for(let s in r)ee(r[s],e,!0)}};function jr(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Je=(t,e,n)=>{n.forEach(function(o){let r=t[o];jr(e,o,function(...i){let a=r.apply(this,i),c=this[J];for(let u of c)ee(u);return a})})},Mt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var co=Array.prototype,bn=Object.create(co),$r=["push","pop","shift","unshift","splice","sort","reverse"];Je(co,bn,$r);var uo=Map.prototype,Lt=Object.create(uo),_r=["set","clear","delete"];Mt(Lt,"Map");Je(uo,Lt,_r);var lo=Set.prototype,Vt=Object.create(lo),Fr=["add","clear","delete"];Mt(Vt,"Set");Je(lo,Vt,Fr);var xe={},oe=t=>{if(x(t)||ut(t))return t;let e={auto:!0,_value:t},n=c=>V(c)?J in c?!0:R(c)?(Object.setPrototypeOf(c,bn),!0):le(c)?(Object.setPrototypeOf(c,Vt),!0):Ne(c)?(Object.setPrototypeOf(c,Lt),!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(a);return}r.size!==0&&yn(()=>{for(let l of[...r.keys()])r.has(l)&&l(c,u)})},i=c=>{let u=c[J];u||(c[J]=u=new Set),u.add(a)},a=(...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)&&i(l),e._value=l,e.auto&&s(l,f),e._value):(ao(a),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(a,!1),o&&i(t),a};var fo=Symbol("modelBridge"),It=()=>{},qr=t=>!!t?.[fo],zr=t=>{t[fo]=1},Kr=t=>{let e=oe(t());return zr(e),e},po={collectRefObj:!0,mount:({parseResult:t,option:e})=>{if(typeof e!="string"||!e)return It;let n=F(e),o,r,s=It,i=()=>{s(),s=It,o=void 0,r=void 0},a=()=>{s(),s=It},c=(l,f)=>{o!==l&&(a(),s=ct(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(i(),x(p)){p(l);return}f[n]=oe(l);return}if(qr(l)){if(p===l)return;x(p)?c(l,p):f[n]=l;return}r||(r=Kr(l)),f[n]=r,c(l,r)};return{update:()=>{u()},unmount:()=>{s()}}}};var Pt=class{o;_;Ee="";Ce=-1;constructor(e){this.o=e,this._=e.r.u.inherit}k(e){this.st(e)}it(e){if(this.Ce!==e.size){let n=[...e.keys()];this.Ee=[...n,...n.map(Ke)].join(","),this.Ce=e.size}return this.Ee}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.o,o=n.m,r=n.r.te,s=n.r.F;if(r.size===0&&!this.ct(o.p))return;let i=o.ne(),a=this.oe();if(j(a))return;let c=this.pt(e,a);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=i[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),w=new Comment(" end component: "+u.tagName);T.insertBefore(E,u),u.remove();let H=n.r.u.context,B=n.r.u.contextAlias,O=n.r.u.bind,q=y.props?.map(F)??[],M=[],S=g=>g==="class"||g==="style",fe=(g,C,v=!1)=>{let U={},X=g.hasAttribute(H);return o.C(C,()=>{if(o.w(U),X?n.y(hn,g,H):g.hasAttribute(B)&&n.y(hn,g,B),q.length===0)return;let N=new Map(q.map(h=>[h.toLowerCase(),h]));for(let h of[...q,...q.map(Ke)]){let A=g.getAttribute(h);if(A===null)continue;let I=F(h);U[I]=A,v&&y.inheritAttrs===!0&&S(I)&&M.push({name:h,value:A}),g.removeAttribute(h)}let K=n.q.ve(g,!1);for(let[h,A]of K.entries()){let[I,ie]=A.re;if(!ie)continue;let ae=N.get(F(ie).toLowerCase());if(ae&&!(I!=="."&&I!==":"&&I!==O)){if(v&&I!=="."&&y.inheritAttrs===!0&&S(ae)){let Fn=g.getAttribute(h);Fn!==null&&M.push({name:h,value:Fn})}n.y(po,g,h,!0,ae,A.se)}}}),U},b=[...o.L()],P=()=>{let g=fe(u,b,!0),C=new ot(g,u,b,E,w,n.r.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,ct(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,L=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.r.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.C(b,()=>{o.w(z);let K=fe(g,o.L());o.C(b,()=>{o.w(K);let h=o.L(),A=Yn(h);for(let I of N)Ee(I)&&(I.setAttribute(st,A),an(A),Q(I,()=>{cn(A)}))})})};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)){L(g),g.remove();return}for(let v of C)L(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(w,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=`${O}:class`,X=`${O}:style`,N=(h,A,I)=>{let ie=v.hasAttribute(h)?h:v.hasAttribute(A)?A:h,ae=v.getAttribute(ie);v.setAttribute(ie,j(ae)?I:`${ae}, ${I}`)},K=(h,A)=>{if(h==="class"){let I=We(A);I.length>0&&v.classList.add(...I)}else if(h===":class"||h===U)N(":class",U,A);else if(h==="style"){let I=v.style,ie=u.style;for(let ae of ie)I.setProperty(ae,ie.getPropertyValue(ae))}else h===":style"||h===X?N(":style",X,A):v.setAttribute(kt(h,n.r),A)};for(let{name:h,value:A}of M)u.setAttribute(h,A);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.r.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)}),Ot(z)};o.C(b,ke)}}oe(){let e=this.o,n=e.m,o=e.r.te,r=n.ft(),s=this.it(o);return[...s?[s]:[],...r,...r.map(Ke)].join(",")}Z(e){let n=this.oe();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.o,r=this.oe(),s=o.r.u.is,i=this.K(e).reverse();for(;i.length>0;){let a=i.pop();n(a),!(!j(r)&&a.matches(r))&&(a.hasAttribute(s)||a.hasAttribute("is")||i.push(...this.K(a).reverse()))}}K(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let i=n[s];Ee(i)&&r.push(i)}return r}let o=e?.childNodes;if(o?.length!=null){let r=[];for(let s=0;s<o.length;++s){let i=o[s];Ee(i)&&r.push(i)}return r}return[]}};var xn=class{re;se;Se=[];constructor(e,n){this.re=e,this.se=n}},Dt=class{o;Ae;Ve;ie;constructor(e){this.o=e,this.Ae=e.r.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("."),a=(s<0?o:o.substring(0,s)).split(/[:@]/);j(a[0])&&(a[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&&(a[a.length-1]=F(a[a.length-1])),l&&(a[0]=".");let f={terms:a,flags:c};return this.ie.set(e,f),f}ve(e,n){let o=new Map;if(!it(e))return o;let r=this.Ve,s=(a,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 xn(p.terms,p.flags),o.set(c,f)}f.Se.push(a);return}},i=a=>{let c=a.attributes;if(!(!c||c.length===0))for(let u=0;u<c.length;++u){let l=c.item(u)?.name;l&&s(a,l)}};return i(e),!n||!e.firstElementChild||this.o.E.j(e,i),o}};var mo=()=>{},Wr=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},Ut=class{o;I;constructor(e){this.o=e,this.I=e.r.u.is}k(e){let n=e.hasAttribute(this.I);return(n||e.hasAttribute("is"))&&this.y(e),this.o.E.Z(e)||this.o.E.j(e,o=>{(o.hasAttribute(this.I)||o.hasAttribute("is"))&&this.y(o)}),n}y(e){let n=e.getAttribute(this.I);if(!n){if(n=e.getAttribute("is"),!n)return;if(!n.startsWith("regor:")){if(!n.startsWith("r-"))return;let o=n.slice(2).trim().toLowerCase();if(!o)return;let r=e.parentNode;if(!r)return;let s=document.createElement(o);for(let i of e.getAttributeNames())i!=="is"&&s.setAttribute(i,e.getAttribute(i));for(;e.firstChild;)s.appendChild(e.firstChild);r.insertBefore(s,e),e.remove(),this.o.$(s);return}n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.I),this.M(e,n)}U(e,n){let o=ze(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),qe(s,o),o.forEach(a=>{Y(a)}),e.remove();let i=document.createComment(`__end__ dynamic ${n??""}`);return r.insertBefore(i,s.nextSibling),{nodes:o,parent:r,commentBegin:s,commentEnd:i}}M(e,n){let{nodes:o,commentBegin:r,commentEnd:s}=this.U(e,` => ${n} `),i=this.o.m.O(n),a=i.value,c=this.o.m,u=c.L(),l={name:""},f=de(e)?o:[...o[0].childNodes],p=()=>{c.C(u,()=>{let m=a()[0];if(V(m)&&(m.name?m=m.name:m=Object.entries(c.ne()).filter(w=>w[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 w of e.getAttributeNames())w!==this.I&&E.setAttribute(w,e.getAttribute(w));Wr(f,E),T.insertBefore(E,s),this.o.$(E),l.name=m})},d=mo;Q(r,()=>{i.stop(),d(),d=mo}),p(),d=i.subscribe(p)}};var k=t=>{let e=t;return e!=null&&e[J]>0?e():e};var Gr=(t,e)=>{let[n,o]=e;W(o)?o(t,n):t.innerHTML=n?.toString()},Ht={mount:()=>({update:({el:t,values:e})=>{Gr(t,e)}})};var Bt=class t{ae;constructor(e){this.ae=e}static mt(e,n){let o=e.m,r=e.r,s=r.u,i=new Set([s.for,s.if,s.else,s.elseif,s.pre]),a=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 w=0;w<E.length;++w){let H=E.item(w)?.name;if(!H)continue;if(i.has(H))return;let{terms:B,flags:O}=u.ke(H),[q,M]=B,S=a[H]??a[q];if(S){if(S===Ht)return;l.push({nodeIndex:f,attrName:H,directive:S,option:M,flags:O})}}++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 i=s.childNodes;for(let a=i.length-1;a>=0;--a)r.push(i[a])}for(let s=0;s<this.ae.length;++s){let i=this.ae[s],a=o[i.nodeIndex];a&&e.y(i.directive,a,i.attrName,!1,i.option,i.flags)}}};var Jr=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},Qr=t=>{let e=t.length,n=t.slice(),o=[],r,s,i;for(let a=0;a<e;++a){let c=t[a];if(c===0)continue;let u=o[o.length-1];if(u===void 0||t[u]<c){n[a]=u??-1,o.push(a);continue}for(r=0,s=o.length-1;r<s;)i=r+s>>1,t[o[i]]<c?r=i+1:s=i;c<t[o[r]]&&(r>0&&(n[a]=o[r-1]),o[r]=a)}for(r=o.length,s=o[r-1]??-1;r-- >0;)o[r]=s,s=n[s];return o},jt=class{static yt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:i,removeMountItem:a,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]=i(b,o[b],P)}return d}if(y>T){for(let b=y;b<=m;++b)a(n[b]);return d}let E=y,w=y,H=T-w+1,B=new Array(H).fill(0),O=new Map;for(let b=w;b<=T;++b)O.set(f[b],b);let q=!1,M=0;for(let b=E;b<=m;++b){let P=n[b],z=O.get(r(P.value));if(z===void 0){a(P);continue}if(!s(P.value,o[z])){a(P);continue}P.value=o[z],d[z]=P,B[z-w]=b+1,z>=M?M=z:q=!0}let S=q?Qr(B):[],fe=S.length-1;for(let b=H-1;b>=0;--b){let P=w+b,z=P+1<l?d[P+1].items[0]:c;if(B[b]===0){d[P]=i(P,o[P],z);continue}let Ie=d[P];q&&(fe>=0&&S[fe]===b?--fe:Ie&&Jr(Ie,z))}return d}};var lt=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}Ne(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}Me(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 Tn=Symbol("r-for"),Xr=t=>-1,ho=()=>{},$t=class t{o;x;Oe;R;constructor(e){this.o=e,this.x=e.r.u.for,this.Oe=At(this.x),this.R=e.r.u.pre}k(e){let n=e.hasAttribute(this.x);return n&&this.Le(e),e.hasAttribute(this.o.r.u.is)||e.hasAttribute("is")||this.o.E.Z(e)||this.o.E.j(e,r=>{r.hasAttribute(this.x)&&this.Le(r)}),n}ee(e){return e[Tn]?!0:(e[Tn]=!0,St(e,this.Oe).forEach(n=>n[Tn]=!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.o.r.u.key,s=this.o.r.u.keyBind,i=e.getAttribute(r)??e.getAttribute(s);e.removeAttribute(r),e.removeAttribute(s);let a=ze(e),c=Bt.mt(this.o,a),u=e.parentNode;if(!u)return;let l=`${this.x} => ${n}`,f=new Comment(`__begin__ ${l}`);u.insertBefore(f,e),qe(f,a),a.forEach(L=>{Y(L)}),e.remove();let p=new Comment(`__end__ ${l}`);u.insertBefore(p,f.nextSibling);let d=this.o,y=d.m,m=y.L(),E=m.length===1?[void 0,m[0]]:void 0,w=this.Rt(i),H=(L,Z)=>w(L)===w(Z),B=(L,Z)=>L===Z,O=(L,Z,re)=>{let te=o.createContext(Z,L),Te=lt.ht(te.index,Z),ke=()=>{let g=p.parentNode??f.parentNode??u,C=re.previousSibling,v=[];for(let U=0;U<a.length;++U){let X=a[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.C(E,ke)):y.C(m,()=>{y.w(te.ctx),ke()}),Te},q=(L,Z)=>{let re=D.D(L).items,te=re[re.length-1].nextSibling;for(let Te of re)Y(Te);D.pe(L,O(L,Z,te))},M=(L,Z)=>{D.w(O(L,Z,p))},S=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 Te=k(L[0]);if(R(Te)&&Te.length===0){ve(f,p),D.Me(0);return}let ke=[];for(let h of this.Ie(L[0]))ke.push(h);let g=jt.yt({oldItems:D.T,newValues:ke,getKey:w,isSameValue:B,mountNewValue:(h,A,I)=>O(h,A,I),removeMountItem:h=>{for(let A=0;A<h.items.length;++A)Y(h.items[A])},endAnchor:p});if(g){D.T=g,D.P.clear();for(let h=0;h<g.length;++h){let A=g[h];A.order=h,A.index(h);let I=w(A.value);I!==void 0&&D.P.set(I,A)}return}let C=0,v=Number.MAX_SAFE_INTEGER,U=te,X=this.o.r.forGrowThreshold,N=()=>D.S<U+X;for(let h of ke){let A=()=>{if(C<te){let I=D.D(C++);if(H(I.value,h)){if(B(I.value,h))return;q(C-1,h);return}let ie=D.bt(w(h));if(ie>=C&&ie-C<10){if(--C,v=Math.min(v,C),S(C),D.Ne(C),--te,ie>C+1)for(let ae=C;ae<ie-1&&ae<te&&!H(D.D(C).value,h);)++ae,S(C),D.Ne(C),--te;A();return}N()?(D.gt(C-1,O(C,h,D.D(C-1).items[0])),v=Math.min(v,C-1),++te):q(C-1,h)}else M(C++,h)};A()}let K=C;for(te=D.S;C<te;)S(C++);D.Me(K),fe(v)},P=()=>{z.stop(),pe(),pe=ho},z=y.O(o.list),Ie=z.value,pe=ho,tn=0,D=new lt(w);for(let L of this.Ie(Ie()[0]))D.w(O(tn++,L,p));Q(f,P),pe=z.subscribe(b)}static Et=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;Tt(e){let n=t.Et.exec(e);if(!n)return;let o=(n[1]+(n[2]??"")).split(",").map(c=>c.trim()),r=o.length>1?o.length-1:-1,s=r!==-1&&(o[r]==="index"||o[r]?.startsWith("#"))?o[r]:"";s&&o.splice(r,1);let i=n[3];if(!i||o.length===0)return;let a=/[{[]/.test(e);return{list:i,createContext:(c,u)=>{let l={},f=k(c);if(!a&&o.length===1)l[o[0]]=c;else if(R(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:Xr};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.Ct(n),r=o.length>1?o.slice(1):void 0;return s=>{let i=k(s),a=this.Pe(i,o);return a!==void 0||!r?a:this.Pe(i,r)}}return o=>k(k(o)?.[n])}Ct(e){return e.split(".").filter(n=>n.length>0)}Pe(e,n){let o=e;for(let r of n)o=k(o)?.[r];return k(o)}};var _t=class{fe=0;de=new Map;m;De;Ue;Be;E;q;r;R;He;constructor(e){this.m=e,this.r=e.r,this.Ue=new $t(this),this.De=new wt(this),this.Be=new Ut(this),this.E=new Pt(this),this.q=new Dt(this),this.R=this.r.u.pre,this.He=this.r.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 i=[...o.content.childNodes];for(let a of i)r.insertBefore(a,s);Le(this,i)}}$(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.E.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.r.B;for(let[s,i]of o.entries()){let[a,c]=i.re,u=r[s]??r[a];if(!u){console.error("directive not found:",a);continue}let l=i.Se;for(let f=0;f<l.length;++f){let p=l[f];this.y(u,p,s,!1,c,i.se)}}}y(e,n,o,r,s,i){if(n.hasAttribute(this.R))return;let a=n.getAttribute(o);n.removeAttribute(o);let c=u=>{let l=u;for(;l;){let f=l.getAttribute(st);if(f)return f;l=l.parentElement}return null};if(un()){let u=c(n);if(u){this.m.C(Zn(u),()=>{this.M(e,n,a,s,i)});return}}this.M(e,n,a,s,i)}Vt(e,n,o){return e!==Nt?!1:(j(o)||this.je(n,o)||this.At(n,o),!0)}M(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.Vt(e,n,o))return;let i=this.kt(r,e.once),a=this.Nt(e,o),c=this.Mt(a,i);Q(n,c.stop);let u=this.Ot(n,o,a,i,r,s),l=this.Lt(e,u,c);if(!l)return;let f=this.It(u,a,i,r,l);f(),e.once||(c.result=a.subscribe(f),i&&(c.dynamic=i.subscribe(f)))}kt(e,n){let o=ro(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,i){return{el:e,expr:n,values:o.value(),previousValues:void 0,option:r?r.value()[0]:s,previousOption:void 0,flags:i,parseResult:o,dynamicOption:r}}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 i,a;return()=>{let c=n.value(),u=o?o.value()[0]:r;e.values=c,e.previousValues=i,e.option=u,e.previousOption=a,i=c,a=u,s(e)}}};var yo="http://www.w3.org/1999/xlink",Yr={itemscope:2,allowfullscreen:2,formnovalidate:2,ismap:2,nomodule:2,novalidate:2,readonly:2,async:1,autofocus:1,autoplay:1,controls:1,default:1,defer:1,disabled:1,hidden:1,inert:1,loop:1,open:1,required:1,reversed:1,scoped:1,seamless:1,checked:1,muted:1,multiple:1,selected:1};function Zr(t){return!!t||t===""}var es=(t,e,n,o,r,s)=>{if(o){s&&s.includes("camel")&&(o=F(o)),Ft(t,o,e[0],r);return}let i=e.length;for(let a=0;a<i;++a){let c=e[a];if(R(c)){let u=n?.[a]?.[0],l=c[0],f=c[1];Ft(t,l,f,u)}else if(V(c))for(let u of Object.entries(c)){let l=u[0],f=u[1],p=n?.[a],d=p&&l in p?l:void 0;Ft(t,l,f,d)}else{let u=n?.[a],l=e[a++],f=e[a];Ft(t,l,f,u)}}},Cn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{es(t,e,n,o,r,s)}})},Ft=(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(yo,e.slice(6,e.length)):t.setAttributeNS(yo,e,n);return}let r=e in Yr;me(n)||r&&!Zr(n)?t.removeAttribute(e):t.setAttribute(e,r?"":n)};var ts=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],i=n?.[r];if(R(s)){let a=s.length;for(let c=0;c<a;++c)go(t,s[c],i?.[c])}else go(t,s,i)}},En={mount:()=>({update:({el:t,values:e,previousValues:n})=>{ts(t,e,n)}})},go=(t,e,n)=>{let o=k(e),r=k(n),s=t.classList,i=G(o),a=G(r);if(o&&!i){let c=o;if(r&&!a){let u=r;for(let l in u)(!(l in c)||!k(c[l]))&&s.remove(l)}for(let u in c)k(c[u])&&s.add(u)}else if(i){if(r!==o){let c=a?We(r):[],u=We(o);c.length>0&&s.remove(...c),u.length>0&&s.add(...u)}}else if(r){let c=a?We(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=tt(t),o=tt(e),n||o)return t===e;if(n=R(t),o=R(e),n||o)return n&&o?ns(t,e):!1;if(n=V(t),o=V(e),n||o){if(!n||!o)return!1;let r=Object.keys(t).length,s=Object.keys(e).length;if(r!==s)return!1;for(let i in t){let a=Object.prototype.hasOwnProperty.call(t,i),c=Object.prototype.hasOwnProperty.call(e,i);if(a&&!c||!we(t[i],e[i]))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})=>{os(t,o[0])},unmount:rs(t,e,n)})},os=(t,e)=>{let n=Ro(t);if(n&&Co(t))R(e)?e=qt(e,Se(t))>-1:le(e)?e=e.has(Se(t)):e=ls(t,e),t.checked=e;else if(n&&Eo(t))t.checked=we(e,Se(t));else if(n||wo(t))vo(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(So(t)){let o=t.options,r=o.length,s=t.multiple;for(let i=0;i<r;i++){let a=o[i],c=Se(a);if(s)R(e)?a.selected=qt(e,c)>-1:a.selected=e.has(c);else if(we(Se(a),e)){t.selectedIndex!==i&&(t.selectedIndex=i);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else $(7,t)},ft=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}),Co=t=>t.type==="checkbox",Eo=t=>t.type==="radio",vo=t=>t.type==="number"||t.type==="range",Ro=t=>t.tagName==="INPUT",wo=t=>t.tagName==="TEXTAREA",So=t=>t.tagName==="SELECT",rs=(t,e,n)=>{let o=e.value,r=ft(n?.join(",")),s=ft(o()[1]),i={int:r.int||s.int,lazy:r.lazy||s.lazy,number:r.number||s.number,trim:r.trim||s.trim};if(!e.refs[0])return $(8,t),()=>{};let a=()=>e.refs[0],c=Ro(t);return c&&Co(t)?is(t,a):c&&Eo(t)?fs(t,a):c||wo(t)?ss(t,i,a,o):So(t)?ps(t,a,o):($(7,t),()=>{})},xo=/[.,' ·٫]/,ss=(t,e,n,o)=>{let s=e.lazy?"change":"input",i=vo(t),a=()=>{!e.trim&&!ft(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",a),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=ft(o()[1]);if(i||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",a),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",u),t.addEventListener("change",u),l},is=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let i=Se(t),a=t.checked,c=s();if(R(c)){let u=qt(c,i),l=u!==-1;a&&!l?c.push(i):!a&&l&&c.splice(u,1)}else le(c)?a?c.add(i):c.delete(i):s(us(t,a))};return t.addEventListener(n,r),o},Se=t=>"_value"in t?t._value:t.value,Ao="trueValue",as="falseValue",ko="true-value",cs="false-value",us=(t,e)=>{let n=e?Ao:as;if(n in t)return t[n];let o=e?ko:cs;return t.hasAttribute(o)?t.getAttribute(o):e},ls=(t,e)=>{if(Ao in t)return we(e,t.trueValue);let o=ko;return t.hasAttribute(o)?we(e,t.getAttribute(o)):we(e,!0)},fs=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let i=Se(t);s(i)};return t.addEventListener(n,r),o},ps=(t,e,n)=>{let o="change",r=()=>{t.removeEventListener(o,s)},s=()=>{let i=e();if(!i)return;let c=ft(n()[1]).number,u=Array.prototype.filter.call(t.options,l=>l.selected).map(l=>c?bo(Se(l)):Se(l));if(t.multiple){let l=i();try{if(vn(i),le(l)){l.clear();for(let f of u)l.add(f)}else R(l)?(l.splice(0),l.push(...u)):i(u)}finally{Rn(i),ee(i)}}else i(u[0])};return t.addEventListener(o,s),r};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=k(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=[],i=()=>{s.forEach(u=>u())},a=e.value(),c=a.length;for(let u=0;u<c;++u){let l=a[u];if(W(l)&&(l=l()),V(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 i},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"),i=n.includes("alt"),a=n.includes("meta"),c=u=>!(r&&!u.ctrlKey||s&&!u.shiftKey||i&&!u.altKey||a&&!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,i;[e,i]=ys(e,o);let a=l=>{if(!i(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){a(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(),a(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)),Qe(t,n,e[0]);return}let r=e.length;for(let s=0;s<r;++s){let i=e[s];if(R(i)){let a=i[0],c=i[1];Qe(t,a,c)}else if(V(i))for(let a of Object.entries(i)){let c=a[0],u=a[1];Qe(t,c,u)}else{let a=e[s++],c=e[s];Qe(t,a,c)}}},No={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{gs(t,e,n,o)}})};function bs(t){return!!t||t===""}var Qe=(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,i=n??"";s!==i&&(t.value=i),n==null&&t.removeAttribute(e);return}let r=!1;if(n===""||n==null){let s=typeof t[e];s==="boolean"?n=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 Oo={once:!0,mount:({el:t,parseResult:e,expr:n})=>{let o=e,r=o.value()[0],s=R(r),i=o.refs[0];return s?r.push(t):i?i?.(t):o.context[n]=t,()=>{if(s){let a=r.indexOf(t);a!==-1&&r.splice(a,1)}else i?.(null)}}};var xs=(t,e)=>{let n=De(t).data,o=n._ord;zn(o)&&(o=n._ord=t.style.display),rt(e[0])?t.style.display=o:t.style.display="none"},Mo={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],i=n?.[r];if(R(s)){let a=s.length;for(let c=0;c<a;++c)Lo(t,s[c],i?.[c])}else Lo(t,s,i)}},zt={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Ts(t,e,n)}})},Lo=(t,e,n)=>{let o=k(e),r=k(n),s=t.style,i=G(o);if(o&&!i){let a=o;if(r&&!G(r)){let c=r;for(let u in c)k(a[u])==null&&kn(s,u,"")}for(let c in a)kn(s,c,a[c])}else{let a=s.display;if(i?r!==o&&(s.cssText=o):r&&t.removeAttribute("style"),"_ord"in De(t).data)return;s.display=a}},Vo=/\s*!important$/;function kn(t,e,n){let o=k(n);if(R(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);Vo.test(r)?t.setProperty(Ke(s),r.replace(Vo,""),"important"):t[s]=r}}}var Io=["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=at(o);for(let r=0;r<Io.length;r++){let s=Io[r]+o;if(s in t)return An[e]=s}return e}var ue=t=>Po(k(t)),Po=(t,e=new WeakMap)=>{if(!t||!V(t))return t;if(R(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 k(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Po(k(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])):V(n)?JSON.stringify(ue(n)):n?.toString()??""},Do={mount:()=>({update:({el:t,values:e})=>{Es(t,e)}})};var Uo={mount:()=>({update:({el:t,values:e})=>{Qe(t,"value",e[0])}})};var Xe=t=>t?.[xt]===1;function He(t){if(ut(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[xt]=1,R(t)){let n=t.length;for(let o=0;o<n;++o){let r=t[o];Xe(r)||(t[o]=He(r))}return e}if(!V(t))return e;for(let n of Object.entries(t)){let o=n[1];if(Xe(o))continue;let r=n[0];tt(r)||(t[r]=null,t[r]=He(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=He,e.sref=oe,e.flatten=ue,e}addComponent(...e){for(let n of e){if(!n.defaultName){Fe.warning("Registered component's default name is not defined",n);continue}this.te.set(at(n.defaultName),n),this.F.set(at(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":No,":":Cn,"@":Sn,[`${e}on`]:Sn,[`${e}bind`]:Cn,[`${e}html`]:Ht,[`${e}text`]:Do,[`${e}show`]:Mo,[`${e}model`]:To,":style":zt,[`${e}style`]:zt,[`${e}bind:style`]:zt,":class":En,[`${e}bind:class`]:En,":ref":Oo,":value":Uo,[`${e}teleport`]:Nt},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 i of Rs(t,o.pre,s))vs(i,o.text,r,s)},vs=(t,e,n,o)=>{let r=t.textContent;if(!r)return;let s=n,i=r.split(s);if(i.length<=1)return;if(t.parentElement?.childNodes.length===1&&i.length===3){let c=i[1],u=Ho(c,o);if(u&&j(i[0])&&j(i[2])){let l=t.parentElement;l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),l.innerText="";return}}let a=document.createDocumentFragment();for(let c of i){let u=Ho(c,o);if(u){let l=document.createElement("span");l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),a.appendChild(l)}else a.appendChild(document.createTextNode(c))}t.replaceWith(a)},Rs=(t,e,n)=>{let o=[],r=s=>{if(s.nodeType===Node.TEXT_NODE)n.some(i=>s.textContent?.includes(i.start))&&o.push(s);else{if(s?.hasAttribute?.(e))return;for(let i of Re(s))r(i)}};return r(t),o},Ho=(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,Ye=41,Jt=91,Nn=93,On=63,Ms=59,Bo=58,jo=123,Qt=125,Be=43,Xt=45,Mn=96,$o=47,Ln=92,_o=new Set([2,3]),Go={"=":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,...Go,"||":3,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"/":12,"%":12,"**":13},Jo=Object.keys(Go),Vs=new Set(Jo),In=new Set(["=>"]);Jo.forEach(t=>In.add(t));var Fo={true:!0,false:!1,null:null},Is="this",Ze="Expected ",je="Unexpected ",Dn="Unclosed ",Ps=Ze+":",qo=Ze+"expression",Ds="missing }",Us=je+"object property",Hs=Dn+"(",zo=Ze+"comma",Ko=je+"token ",Bs=je+"period",Vn=Ze+"expression after ",js="missing unaryOp argument",$s=Dn+"[",_s=Ze+"exponent (",Fs="Variable names cannot start with a number (",qs=Dn+'quote after "',pt=t=>t>=48&&t<=57,Wo=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)||pt(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(je+'"'+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),i=e.charCodeAt(n+3);if(isNaN(o))return!1;let a=!1,c=0;return o===62&&r===62&&s===62&&i===61?(a=">>>=",c=4):o===61&&r===61&&s===61?(a="===",c=3):o===33&&r===61&&s===61?(a="!==",c=3):o===62&&r===62&&s===62?(a=">>>",c=3):o===60&&r===60&&s===61?(a="<<=",c=3):o===62&&r===62&&s===61?(a=">>=",c=3):o===42&&r===42&&s===61?(a="**=",c=3):o===61&&r===62?(a="=>",c=2):o===124&&r===124?(a="||",c=2):o===63&&r===63?(a="??",c=2):o===38&&r===38?(a="&&",c=2):o===61&&r===61?(a="==",c=2):o===33&&r===61?(a="!=",c=2):o===60&&r===61?(a="<=",c=2):o===62&&r===61?(a=">=",c=2):o===60&&r===60?(a="<<",c=2):o===62&&r===62?(a=">>",c=2):o===43&&r===61?(a="+=",c=2):o===45&&r===61?(a="-=",c=2):o===42&&r===61?(a="*=",c=2):o===47&&r===61?(a="/=",c=2):o===37&&r===61?(a="%=",c=2):o===38&&r===61?(a="&=",c=2):o===94&&r===61?(a="^=",c=2):o===124&&r===61?(a="|=",c=2):o===42&&r===42?(a="**",c=2):o===105&&r===110?this.me(e.charCodeAt(n+2))||(a="in",c=2):o===61?(a="=",c=1):o===124?(a="|",c=1):o===94?(a="^",c=1):o===38?(a="&",c=1):o===60?(a="<",c=1):o===62?(a=">",c=1):o===43?(a="+",c=1):o===45?(a="-",c=1):o===42?(a="*",c=1):o===47?(a="/",c=1):o===37&&(a="%",c=1),a?(this.e+=c,a):!1}_e(){let e,n,o,r,s,i,a,c;if(s=this.W(),!s||(n=this.he(),!n))return s;if(r={value:n,prec:Wo(n),right_a:In.has(n)},i=this.W(),!i)throw this.i(Vn+n);let u=[s,r,i];for(;n=this.he();){o=Wo(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]);)i=u.pop(),n=u.pop().value,s=u.pop(),e=this.Fe(n,s,i),u.push(e);if(e=this.W(),!e)throw this.i(Vn+c);u.push(r,e)}for(a=u.length-1,e=u[a];a>1;)e=this.Fe(u[a-1].value,u[a-2],e),a-=2;return e}W(){let e;if(this.g(),e=this.Ht(),e)return this.ge(e);let n=this.h;if(pt(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 Fo?e={type:4,value:Fo[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),i=e.charCodeAt(n+3);return o===Xt?(this.e++,"-"):o===33?(this.e++,"!"):o===126?(this.e++,"~"):o===Be?(this.e++,"+"):o===110&&r===101&&s===119&&!this.me(i)?(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(Ye),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(;pt(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===Ae)for(o++;pt(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let a=e.charCodeAt(o);(a===Be||a===Xt)&&o++;let c=o;for(;pt(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),i=e.charCodeAt(o);if(this.z(i))throw this.i(Fs+s+this.H+")");if(i===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,i=s,a=[],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),a.push(e.slice(i,s));let p=e.charCodeAt(s+1);a.push(this.ze(p)),s+=2,i=s}else s++}let l=c?a.join("")+e.slice(i,u?s:n):e.slice(i,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(je+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===Ye&&r&&r>=n.length)throw this.i(Ko+String.fromCharCode(e));break}else if(s===Wt){if(this.e++,r++,r!==n.length){if(e===Ye)throw this.i(Ko+",");for(let i=n.length;i<r;i++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(zo);{let i=this.A();if(!i||i.type===0)throw this.i(zo);n.push(i)}}}if(!o)throw this.i(Ze+String.fromCharCode(e));return n}qt(){this.e++;let e=this.ye(Ye);if(this.f(Ye))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(jo)){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(Bo)){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===Be||n===Xt)&&n===this.l.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===Be?"++":"--",argument:this.G(this.be()),prefix:!0};if(!o.argument||!_o.has(o.argument.type))throw this.i(je+o.operator)}}Qt(e){let n=e.node,o=this.h;if((o===Be||o===Xt)&&o===this.l.charCodeAt(this.e+1)){if(!_o.has(n.type))throw this.i(je+(o===Be?"++":"--"));this.e+=2,e.node={type:13,operator:o===Be?"++":"--",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(qo);if(this.g(),this.f(Bo)){this.e++;let r=this.A();if(!r)throw this.i(qo);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(Ye)){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,i=[],a=[],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})}i.push(n.slice(s,this.e)),a.push(n.slice(s,this.e));let f=i.join(""),p=a.join("");return i.length=0,a.length=0,c=!1,r.quasis.push({type:18,value:{raw:f,cooked:p},tail: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)===jo){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),i.push(n.slice(s,this.e)),a.push(n.slice(s,this.e));let f=n.charCodeAt(this.e+1);i.push(n.slice(this.e,this.e+2)),a.push(this.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 a=this.h;if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)s+=this.H;else break}let i;try{i=new RegExp(r,s)}catch(a){throw this.i(a.message)}return e.node={type:4,value:i,raw:this.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")}},Qo=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},er=t=>{if(!t?.some(Zo))return t;let e=[];return t.forEach(n=>Zo(n)?e.push(...n):e.push(n)),e},Xo=(...t)=>er(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]--}},Yo={"=":(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=R(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(k(o[r]),o);for(let i of this.p)if(r in i)return this.V=i[r],Yt(k(i[r]),i);let s=this.We;if(s&&r in s)return this.V=s[r],Yt(k(s[r]),s)}5(e,n,o){return this.p[0]}0(e,n,o){return this.Ze(n,o,Xo,...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),i=r?.[s];return this.V=i,Yt(k(i),r)}4(e,n,o){return e.value}6(e,n,o){let r=(i,...a)=>W(i)?i(...er(a)):i,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,Xo,...e.elements)}10(e,n,o){let r={},s=(...i)=>{i.forEach(a=>{Object.assign(r,a)})};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,i=this.Je??(()=>!1),a=n===0&&this.Xe,c=l=>this.et(a,e.key,n,Un(l,o)),u=l=>this.et(a,e.value,n,Un(l,o));if(e.shorthand){let l=e.key.name;r[l]=s(e.key)&&i(l,n)?c:c()}else if(e.computed){let l=k(c());r[l]=s(e.value)&&i(l,n)?u:u()}else{let l=e.key.type===4?e.key.value:e.key.name;r[l]=s(e.value)&&i(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,i=e.prefix?Ws:Gs;if(r.type===2){let a=r.name,c=this.Ye(a,o);return me(c)?void 0:i[s](c,a)}if(r.type===3){let{obj:a,key:c}=this.xe(r,n,o);return i[s](a,c)}}16(e,n,o){let r=e.left,s=e.operator;if(r.type===2){let i=r.name,a=this.Ye(i,o);if(me(a))return;let c=this.b(e.right,n,o);return Yo[s](a,i,c)}if(r.type===3){let{obj:i,key:a}=this.xe(r,n,o),c=this.b(e.right,n,o);return Yo[s](i,a,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return R(r)&&(r.s=tr),r}17(e,n,o){return this[6]({type:6,callee:e.tag,arguments:[{type:9,elements:e.quasi.quasis},...e.quasi.expressions]},n,o)}19(e,n,o){let r=(...s)=>s.reduce((i,a,c)=>i+=a+e.quasis[c+1].value.cooked,e.quasis[0].value.cooked);return this.v(n,o,r,...e.expressions)}18(e,n,o){return e.value.cooked}20(e,n,o){let r=(s,...i)=>new s(...i);return this.v(n,o,r,e.callee,...e.arguments)}15(e,n,o){return(...r)=>{let s=Object.create(o??{}),i=e.params;if(i){let a=0;for(let c of i)s[c.name]=r[a++]}return this.b(e.body,n,s)}}b(e,n,o){let r=k(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}=gn(()=>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(i=>i&&this.b(i,e,n));return o(...s)}Ze(e,n,o,...r){let s=this.Ge;if(!s)return this.v(e,n,o,...r);let i=r.map((a,c)=>a&&(a.type!==15&&s(c,e)?u=>this.b(a,e,Un(u,n)):this.b(a,e,n)));return o(...i)}},tr=Symbol("s"),Zo=t=>t?.s===tr,nr=(t,e,n,o,r,s,i)=>new Hn(e,n,o,r,i).eval(t,s);var or={},rr=t=>!!t,Zt=class{p;r;constructor(e,n){this.p=e,this.r=n}w(e){this.p=[e,...this.p]}ne(){return this.p.map(n=>n.components).filter(rr).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(rr).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 i=[],a=[],c=new Set,u=()=>{for(let E=0;E<a.length;++E)a[E]();a.length=0},p={value:()=>i,stop:()=>{u(),c.clear()},subscribe:(E,w)=>(c.add(E),w&&E(i),()=>{c.delete(E)}),refs:[],context:this.p[0]};if(j(e))return p;let d=this.r.globalContext,y=[],m=new Set,T=(E,w,H,B)=>{try{let O=nr(E,w,d,n,o,B,r);return H&&O.refs.length>0&&y.push(...O.refs),{value:O.value,refs:O.refs,ref:O.ref}}catch(O){$(6,`evaluation error: ${e}`,O)}return{value:void 0,refs:[]}};try{let E=or[e]??Qo("["+e+"]");or[e]=E;let w=this.p.slice(),H=E.elements,B=H.length,O=new Array(B);p.refs=O;let q=()=>{y.length=0,s||(m.clear(),u());let M=new Array(B);for(let S=0;S<B;++S){let fe=H[S];if(n?.(S,-1)){M[S]=P=>T(fe,w,!1,{$event:P}).value;continue}let b=T(fe,w,!0);M[S]=b.value,O[S]=b.ref}if(!s)for(let S of y)m.has(S)||(m.add(S),a.push(ne(S,q)));if(i=M,c.size!==0)for(let S of c)c.has(S)&&S(i)};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}C(e,n){try{this.pe(e),n()}finally{this.en()}}en(){this.p=this.nt.pop()??[]}};var sr=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||!sr(t[n]))return null;let o=n,r=!1;for(;n<t.length&&sr(t[n]);){let s=t.charCodeAt(n);s>=65&&s<=90&&(r=!0),++n}return{start:o,end:n,hasUppercase:r}},ir=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}},mt=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}>`,ar=(t,e)=>`${t.slice(0,t.length-2)}></${e}>`,en=t=>{let e=0,n=[],o=[],r=[],s=0;for(;e<t.length;){let i=t.indexOf("<",e);if(i===-1){n.push(t.slice(e));break}if(n.push(t.slice(e,i)),t.startsWith("<!--",i)){let M=t.indexOf("-->",i+4);if(M===-1){n.push(t.slice(i));break}n.push(t.slice(i,M+3)),e=M+3;continue}let a=Js(t,i);if(a===-1){n.push(t.slice(i));break}let c=t.slice(i,a+1),u=c.startsWith("</");if(c.startsWith("<!")||c.startsWith("<?")){n.push(c),e=a+1;continue}let f=Qs(c,u);if(!f){n.push(c),e=a+1;continue}let p=c.slice(f.start,f.end),d=f.hasUppercase?"":p;if(u){let M=r[r.length-1];if(M?.tagName===p){r.pop(),M.emit&&n.push(c),e=a+1;continue}let S=o[o.length-1];S?(o.pop(),n.push(S.replacementHost?`</${S.replacementHost}>`:c),!S.isTableAlias&&ir(S.effectiveTag)&&--s):n.push(c),e=a+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),w=E!==void 0,H=y&&!mt.has(T||d),B=!!T&&E===d&&mt.has(d),O=!y&&!!T&&mt.has(T)&&!B,q=!y&&!T&&mt.has(d);if(T){let M=`${c.slice(0,f.start)}${T} is="${E?`r-${E}`:`regor:${p}`}"${c.slice(f.end)}`;n.push(H?ar(M,T):B?ti(M,T):M)}else n.push(H?ar(c,p):c);if(O?r.push({tagName:p,emit:!1}):B&&!y?r.push({tagName:p,emit:!1}):q&&r.push({tagName:p,emit:!0}),!y&&!B&&!O&&!q&&!mt.has(T??d)){let M=E??T??(d||p);o.push({replacementHost:T,effectiveTag:M,isTableAlias:w}),!w&&ir(M)&&++s}e=a+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",cr=(t,e)=>{de(t)?t.content.appendChild(e):t.appendChild(e)},Bn=(t,e,n,o)=>{let r=t.t;if(r){let i=n&&oi.has(r.toUpperCase())?document.createElementNS(ri,r.toLowerCase()):document.createElement(r),a=t.a;if(a)for(let u of Object.entries(a)){let l=u[0],f=u[1];l.startsWith("#")&&(f=l.substring(1),l="name"),i.setAttribute(kt(l,o),f)}let c=t.c;if(c)for(let u of c)Bn(u,i,n,o);cr(e,i);return}let s=t.d;if(s){let i;switch(t.n??Node.TEXT_NODE){case Node.COMMENT_NODE:i=document.createComment(s);break;case Node.TEXT_NODE:i=document.createTextNode(s);break}if(i)cr(e,i);else throw new Error("unsupported node type.")}},et=(t,e,n)=>{n??=ye.getDefault();let o=document.createDocumentFragment();if(!R(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 a of[...o.childNodes])Y(a)},s=a=>{for(;a.length>0;)o.appendChild(a[0])};if(e.template){let a=document.createRange().createContextualFragment(en(e.template));r(),s(a.childNodes),e.element=a}else if(e.json){let a=et(e.json,e.isSVG,n);r(),s(a.childNodes)}return n.useInterpolation&&Kt(o,n),new jn(t,o,n).y(),Q(o,()=>{Oe(t)}),Ot(t),{context:t,unmount:()=>{Y(o)},unbind:()=>{Ce(o)}}},jn=class{tn;ot;r;m;o;constructor(e,n,o){this.tn=e,this.ot=n,this.r=o,this.m=new Zt([e],o),this.o=new _t(this.m)}y(){this.o.$(this.ot)}};var dt=t=>{if(R(t))return t.map(r=>dt(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=>dt(r))),e};var ii=(t,e={})=>{R(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=et(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??(it(r)&&r.hasAttribute?.("isSVG")))||it(r)&&r.querySelector("[isSVG]"))){let s=r.content,i=s?[...s.childNodes]:[...r.childNodes],a=dt(i);t.element=et(a,!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=Ge(()=>{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=a=>{if(r>0){o.stop(),n.isStopped=!0,ee(o);return}let c=t.map(u=>u());o(e(...c)),++r},i=[];for(let a of t){let c=ne(a,s);i.push(c)}return s(null),o.stop=()=>{i.forEach(a=>{a()})},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[Tt]=1,t);var hi=(t,e)=>{if(!e)throw _(5);let o=Xe(t)?He:a=>a,r=()=>localStorage.setItem(e,JSON.stringify(ue(t()))),s=localStorage.getItem(e);if(s!=null)try{t(o(JSON.parse(s)))}catch(a){$(6,`persist: failed to parse data for key ${e}`,a),r()}else r();let i=Ge(r);return se(i,!0),t};var _n=(t,...e)=>{let n="",o=t,r=e,s=o.length,i=r.length;for(let a=0;a<s;++a)n+=o[a],a<i&&(n+=r[a]);return n},yi=_n,gi=_n;var bi=(t,e,n)=>{let o=[],r=()=>{e(t.map(i=>i()))};for(let i of t)o.push(ne(i,r));n&&r();let s=()=>{for(let i of o)i()};return se(s,!0),s};var xi=t=>{if(!x(t))throw _(3,"observerCount");return t(void 0,void 0,2)};var Ti=t=>{ur();try{t()}finally{lr()}},ur=()=>{xe.stack||(xe.stack=[]),xe.stack.push(new Set)},lr=()=>{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{ot as ComponentHead,$n as ContextRegistry,ye as RegorConfig,Q as addUnbinder,Ti as batch,gn as collectRefs,li as computeMany,pi as computeRef,ci as computed,si as createApp,ii as defineComponent,pr as drainUnbind,lr as endBatch,ct as entangle,ue as flatten,De as getBindData,_n as html,Xe as isDeepRef,ut 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,Or as pval,yi as raw,He as ref,Y as removeNode,Rn as resume,yn as silence,oe as sref,ur as startBatch,gi as svg,et as toFragment,dt as toJsonTemplate,ee as trigger,Ce as unbind,k as unref,dn as useScope,Fe as warningHandler,Ge as watchEffect};
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 _e=[],ht=!1,yt,qn=()=>{if(ht=!1,yt=void 0,_e.length!==0){for(let t=0;t<_e.length;++t)Ce(_e[t]);_e.length=0}},Y=t=>{t.remove(),_e.push(t),ht||(ht=!0,yt=setTimeout(qn,1))},mr=async()=>{_e.length===0&&!ht||(yt&&clearTimeout(yt),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]",tt=t=>typeof t=="symbol",R=Array.isArray,V=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 gt=[],Wn=()=>{let t={onMounted:[],onUnmounted:[]};return gt.push(t),t},Pe=t=>{let e=gt[gt.length-1];if(!e&&!t)throw _(2);return e},Gn=t=>{let e=Pe();return t&&sn(t),gt.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()},bt=t=>t[rn];var Oe=t=>{bt(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=Fe.warning;r&&(G(o)?r(o):r(o,...o.args))},Fe={warning:console.warn};var xt=Symbol("ref"),J=Symbol("sref"),Tt=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}.`)},Ct=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(x(t))return`ref<${Ct(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(R(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,nt=(t,e=0)=>{if(e>1)return"unknown";if(x(t)){let s=t();return`ref(${nt(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(R(t)){let s=t.slice(0,5).map(a=>nt(a,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(V(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let a=s.map(([i,c])=>{let u=nt(c,e+1);return`${i}: ${u}`}).join(", ");return Object.keys(t).length>5?`{ ${a}, ... }`:`{ ${a} }`}return"unknown"},ce=t=>{if(x(t))return`got ${Ct(t)}(${nt(t())})`;let e=Ct(t),n=nt(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":Ct(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)=>{R(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)=>{V(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})},ot=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"){Fe.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 rt=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 vt={},Et={},Xn=1,Yn=t=>{let e=(Xn++).toString();return vt[e]=t,Et[e]=0,e},an=t=>{Et[t]+=1},cn=t=>{--Et[t]===0&&(delete vt[t],delete Et[t])},Zn=t=>vt[t],un=()=>Xn!==1&&Object.keys(vt).length>0,st="r-switch",Vr=t=>{let e=t.filter(o=>Ee(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(st))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},qe=(t,e)=>{if(!un())return;let n=Vr(e);n.length!==0&&(n.forEach(an),Q(t,()=>{n.forEach(cn)}))};var Rt=()=>{},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,wt=class{o;M;Te;X;Y;x;R;constructor(e){this.o=e,this.M=e.r.u.if,this.Te=At(e.r.u.if),this.X=e.r.u.else,this.Y=e.r.u.elseif,this.x=e.r.u.for,this.R=e.r.u.pre}rt(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.o.r.u.is)||e.hasAttribute("is")||this.o.E.Z(e)||this.o.E.j(e,r=>{r.hasAttribute(this.M)&&this.y(r)}),n}ee(e){return e[fn]?!0:(e[fn]=!0,St(e,this.Te).forEach(n=>n[fn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.ee(e)||this.rt(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=ze(e),s=e.parentNode,a=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(a,e),qe(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.o,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.o.m.N(r),l=u.value,f=this.Re(o,n),p=Rt;return Q(i,()=>{u.stop(),p(),p=Rt}),p=u.subscribe(n),[{mount:()=>{ln(s,this.o,a,c)},unmount:()=>{ve(i,c)},isTrue:()=>rt(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.o.m.N(n),u=c.value,l=!1,f=this.o.m,p=f.L(),d=()=>{f.C(p,()=>{if(rt(u()[0]))l||(ln(r,this.o,s,i),l=!0),y.forEach(E=>{E.unmount(),E.isMounted=!1});else{ve(a,i),l=!1;let E=!1;for(let w of y)!E&&w.isTrue()?(w.isMounted||(w.mount(),w.isMounted=!0),E=!0):(w.unmount(),w.isMounted=!1)}})},y=this.Re(o,d),m=Rt;Q(a,()=>{c.stop(),m(),m=Rt}),d(),m=c.subscribe(d)}};var ze=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))}},St=(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,it=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},At=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),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,Ke=pn(t=>t&&t.replace(Br,"-$1").toLowerCase()),at=pn(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var Nt={mount:()=>{}};var We=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Ot=t=>{bt(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=>V(t)?mn in t:!1;var hn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(V(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 io=t=>t[J]===2,ct=(t,e)=>{if(t===e)return()=>{};let n=io(t),o=io(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=[],ao=t=>{he.length!==0&&he[he.length-1]?.add(t)},Ge=t=>{if(!t)return()=>{};let e={stop:()=>{}};return jr(t,e),se(()=>e.stop(),!0),e.stop},jr=(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(),Ge(t)});n.push(i)}}finally{he.pop()}},yn=t=>{let e=he.length,n=e>0&&he[e-1];try{return n&&he.push(null),t()}finally{n&&he.pop()}},gn=t=>{try{let e=new Set;return he.push(e),{value:t(),refs:[...e]}}finally{he.pop()}};var ut=t=>!!t&&t[Tt]===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(R(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(V(r))for(let s in r)ee(r[s],e,!0)}};function $r(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Je=(t,e,n)=>{n.forEach(function(o){let r=t[o];$r(e,o,function(...a){let i=r.apply(this,a),c=this[J];for(let u of c)ee(u);return i})})},Mt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var co=Array.prototype,bn=Object.create(co),_r=["push","pop","shift","unshift","splice","sort","reverse"];Je(co,bn,_r);var uo=Map.prototype,Lt=Object.create(uo),Fr=["set","clear","delete"];Mt(Lt,"Map");Je(uo,Lt,Fr);var lo=Set.prototype,Vt=Object.create(lo),qr=["add","clear","delete"];Mt(Vt,"Set");Je(lo,Vt,qr);var xe={},oe=t=>{if(x(t)||ut(t))return t;let e={auto:!0,_value:t},n=c=>V(c)?J in c?!0:R(c)?(Object.setPrototypeOf(c,bn),!0):le(c)?(Object.setPrototypeOf(c,Vt),!0):Ne(c)?(Object.setPrototypeOf(c,Lt),!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&&yn(()=>{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):(ao(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 fo=Symbol("modelBridge"),It=()=>{},zr=t=>!!t?.[fo],Kr=t=>{t[fo]=1},Wr=t=>{let e=oe(t());return Kr(e),e},po={collectRefObj:!0,mount:({parseResult:t,option:e})=>{if(typeof e!="string"||!e)return It;let n=F(e),o,r,s=It,a=()=>{s(),s=It,o=void 0,r=void 0},i=()=>{s(),s=It},c=(l,f)=>{o!==l&&(i(),s=ct(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(zr(l)){if(p===l)return;x(p)?c(l,p):f[n]=l;return}r||(r=Wr(l)),f[n]=r,c(l,r)};return{update:()=>{u()},unmount:()=>{s()}}}};var Pt=class{o;_;Ee="";Ce=-1;constructor(e){this.o=e,this._=e.r.u.inherit}k(e){this.st(e)}it(e){if(this.Ce!==e.size){let n=[...e.keys()];this.Ee=[...n,...n.map(Ke)].join(","),this.Ce=e.size}return this.Ee}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.o,o=n.m,r=n.r.te,s=n.r.F;if(r.size===0&&!this.ct(o.p))return;let a=o.ne(),i=this.oe();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),w=new Comment(" end component: "+u.tagName);T.insertBefore(E,u),u.remove();let H=n.r.u.context,B=n.r.u.contextAlias,O=n.r.u.bind,q=y.props?.map(F)??[],M=[],S=g=>g==="class"||g==="style",fe=(g,C,v=!1)=>{let U={},X=g.hasAttribute(H);return o.C(C,()=>{if(o.w(U),X?n.y(hn,g,H):g.hasAttribute(B)&&n.y(hn,g,B),q.length===0)return;let N=new Map(q.map(h=>[h.toLowerCase(),h]));for(let h of[...q,...q.map(Ke)]){let A=g.getAttribute(h);if(A===null)continue;let I=F(h);U[I]=A,v&&y.inheritAttrs===!0&&S(I)&&M.push({name:h,value:A}),g.removeAttribute(h)}let K=n.q.ve(g,!1);for(let[h,A]of K.entries()){let[I,ie]=A.re;if(!ie)continue;let ae=N.get(F(ie).toLowerCase());if(ae&&!(I!=="."&&I!==":"&&I!==O)){if(v&&I!=="."&&y.inheritAttrs===!0&&S(ae)){let Fn=g.getAttribute(h);Fn!==null&&M.push({name:h,value:Fn})}n.y(po,g,h,!0,ae,A.se)}}}),U},b=[...o.L()],P=()=>{let g=fe(u,b,!0),C=new ot(g,u,b,E,w,n.r.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,ct(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,L=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.r.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.C(b,()=>{o.w(z);let K=fe(g,o.L());o.C(b,()=>{o.w(K);let h=o.L(),A=Yn(h);for(let I of N)Ee(I)&&(I.setAttribute(st,A),an(A),Q(I,()=>{cn(A)}))})})};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)){L(g),g.remove();return}for(let v of C)L(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(w,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=`${O}:class`,X=`${O}:style`,N=(h,A,I)=>{let ie=v.hasAttribute(h)?h:v.hasAttribute(A)?A:h,ae=v.getAttribute(ie);v.setAttribute(ie,j(ae)?I:`${ae}, ${I}`)},K=(h,A)=>{if(h==="class"){let I=We(A);I.length>0&&v.classList.add(...I)}else if(h===":class"||h===U)N(":class",U,A);else if(h==="style"){let I=v.style,ie=u.style;for(let ae of ie)I.setProperty(ae,ie.getPropertyValue(ae))}else h===":style"||h===X?N(":style",X,A):v.setAttribute(kt(h,n.r),A)};for(let{name:h,value:A}of M)u.setAttribute(h,A);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.r.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)}),Ot(z)};o.C(b,ke)}}oe(){let e=this.o,n=e.m,o=e.r.te,r=n.ft(),s=this.it(o);return[...s?[s]:[],...r,...r.map(Ke)].join(",")}Z(e){let n=this.oe();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.o,r=this.oe(),s=o.r.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 xn=class{re;se;Se=[];constructor(e,n){this.re=e,this.se=n}},Dt=class{o;Ae;Ve;ie;constructor(e){this.o=e,this.Ae=e.r.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(!it(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 xn(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.o.E.j(e,a),o}};var mo=()=>{},Gr=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},Ut=class{o;I;constructor(e){this.o=e,this.I=e.r.u.is}k(e){let n=e.hasAttribute(this.I);return(n||e.hasAttribute("is"))&&this.y(e),this.o.E.Z(e)||this.o.E.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.o.$(s);return}n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.I),this.O(e,n)}U(e,n){let o=ze(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),qe(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.o.m.N(n),i=a.value,c=this.o.m,u=c.L(),l={name:""},f=de(e)?o:[...o[0].childNodes],p=()=>{c.C(u,()=>{let m=i()[0];if(V(m)&&(m.name?m=m.name:m=Object.entries(c.ne()).filter(w=>w[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 w of e.getAttributeNames())w!==this.I&&E.setAttribute(w,e.getAttribute(w));Gr(f,E),T.insertBefore(E,s),this.o.$(E),l.name=m})},d=mo;Q(r,()=>{a.stop(),d(),d=mo}),p(),d=a.subscribe(p)}};var k=t=>{let e=t;return e!=null&&e[J]>0?e():e};var Jr=(t,e)=>{let[n,o]=e;W(o)?o(t,n):t.innerHTML=n?.toString()},Ht={mount:()=>({update:({el:t,values:e})=>{Jr(t,e)}})};var Bt=class t{ae;constructor(e){this.ae=e}static mt(e,n){let o=e.m,r=e.r,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 w=0;w<E.length;++w){let H=E.item(w)?.name;if(!H)continue;if(a.has(H))return;let{terms:B,flags:O}=u.ke(H),[q,M]=B,S=i[H]??i[q];if(S){if(S===Ht)return;l.push({nodeIndex:f,attrName:H,directive:S,option:M,flags:O})}}++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 Qr=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},Xr=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},jt=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,w=y,H=T-w+1,B=new Array(H).fill(0),O=new Map;for(let b=w;b<=T;++b)O.set(f[b],b);let q=!1,M=0;for(let b=E;b<=m;++b){let P=n[b],z=O.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-w]=b+1,z>=M?M=z:q=!0}let S=q?Xr(B):[],fe=S.length-1;for(let b=H-1;b>=0;--b){let P=w+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&&S[fe]===b?--fe:Ie&&Qr(Ie,z))}return d}};var lt=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 Tn=Symbol("r-for"),Yr=t=>-1,ho=()=>{},$t=class t{o;x;Ne;R;constructor(e){this.o=e,this.x=e.r.u.for,this.Ne=At(this.x),this.R=e.r.u.pre}k(e){let n=e.hasAttribute(this.x);return n&&this.Le(e),e.hasAttribute(this.o.r.u.is)||e.hasAttribute("is")||this.o.E.Z(e)||this.o.E.j(e,r=>{r.hasAttribute(this.x)&&this.Le(r)}),n}ee(e){return e[Tn]?!0:(e[Tn]=!0,St(e,this.Ne).forEach(n=>n[Tn]=!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.o.r.u.key,s=this.o.r.u.keyBind,a=e.getAttribute(r)??e.getAttribute(s);e.removeAttribute(r),e.removeAttribute(s);let i=ze(e),c=Bt.mt(this.o,i),u=e.parentNode;if(!u)return;let l=`${this.x} => ${n}`,f=new Comment(`__begin__ ${l}`);u.insertBefore(f,e),qe(f,i),i.forEach(L=>{Y(L)}),e.remove();let p=new Comment(`__end__ ${l}`);u.insertBefore(p,f.nextSibling);let d=this.o,y=d.m,m=y.L(),E=m.length===1?[void 0,m[0]]:void 0,w=this.Rt(a),H=(L,Z)=>w(L)===w(Z),B=(L,Z)=>L===Z,O=(L,Z,re)=>{let te=o.createContext(Z,L),Te=lt.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.C(E,ke)):y.C(m,()=>{y.w(te.ctx),ke()}),Te},q=(L,Z)=>{let re=D.D(L).items,te=re[re.length-1].nextSibling;for(let Te of re)Y(Te);D.pe(L,O(L,Z,te))},M=(L,Z)=>{D.w(O(L,Z,p))},S=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 Te=k(L[0]);if(R(Te)&&Te.length===0){ve(f,p),D.Oe(0);return}let ke=[];for(let h of this.Ie(L[0]))ke.push(h);let g=jt.yt({oldItems:D.T,newValues:ke,getKey:w,isSameValue:B,mountNewValue:(h,A,I)=>O(h,A,I),removeMountItem:h=>{for(let A=0;A<h.items.length;++A)Y(h.items[A])},endAnchor:p});if(g){D.T=g,D.P.clear();for(let h=0;h<g.length;++h){let A=g[h];A.order=h,A.index(h);let I=w(A.value);I!==void 0&&D.P.set(I,A)}return}let C=0,v=Number.MAX_SAFE_INTEGER,U=te,X=this.o.r.forGrowThreshold,N=()=>D.S<U+X;for(let h of ke){let A=()=>{if(C<te){let I=D.D(C++);if(H(I.value,h)){if(B(I.value,h))return;q(C-1,h);return}let ie=D.bt(w(h));if(ie>=C&&ie-C<10){if(--C,v=Math.min(v,C),S(C),D.Me(C),--te,ie>C+1)for(let ae=C;ae<ie-1&&ae<te&&!H(D.D(C).value,h);)++ae,S(C),D.Me(C),--te;A();return}N()?(D.gt(C-1,O(C,h,D.D(C-1).items[0])),v=Math.min(v,C-1),++te):q(C-1,h)}else M(C++,h)};A()}let K=C;for(te=D.S;C<te;)S(C++);D.Oe(K),fe(v)},P=()=>{z.stop(),pe(),pe=ho},z=y.N(o.list),Ie=z.value,pe=ho,tn=0,D=new lt(w);for(let L of this.Ie(Ie()[0]))D.w(O(tn++,L,p));Q(f,P),pe=z.subscribe(b)}static Et=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;Tt(e){let n=t.Et.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=k(c);if(!i&&o.length===1)l[o[0]]=c;else if(R(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:Yr};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.Ct(n),r=o.length>1?o.slice(1):void 0;return s=>{let a=k(s),i=this.Pe(a,o);return i!==void 0||!r?i:this.Pe(a,r)}}return o=>k(k(o)?.[n])}Ct(e){return e.split(".").filter(n=>n.length>0)}Pe(e,n){let o=e;for(let r of n)o=k(o)?.[r];return k(o)}};var _t=class{fe=0;de=new Map;m;De;Ue;Be;E;q;r;R;He;constructor(e){this.m=e,this.r=e.r,this.Ue=new $t(this),this.De=new wt(this),this.Be=new Ut(this),this.E=new Pt(this),this.q=new Dt(this),this.R=this.r.u.pre,this.He=this.r.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.E.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.r.B;for(let[s,a]of o.entries()){let[i,c]=a.re,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(st);if(f)return f;l=l.parentElement}return null};if(un()){let u=c(n);if(u){this.m.C(Zn(u),()=>{this.O(e,n,i,s,a)});return}}this.O(e,n,i,s,a)}Vt(e,n,o){return e!==Nt?!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 yo="http://www.w3.org/1999/xlink",Zr={itemscope:2,allowfullscreen:2,formnovalidate:2,ismap:2,nomodule:2,novalidate:2,readonly:2,async:1,autofocus:1,autoplay:1,controls:1,default:1,defer:1,disabled:1,hidden:1,inert:1,loop:1,open:1,required:1,reversed:1,scoped:1,seamless:1,checked:1,muted:1,multiple:1,selected:1};function es(t){return!!t||t===""}var ts=(t,e,n,o,r,s)=>{if(o){s&&s.includes("camel")&&(o=F(o)),Ft(t,o,e[0],r);return}let a=e.length;for(let i=0;i<a;++i){let c=e[i];if(R(c)){let u=n?.[i]?.[0],l=c[0],f=c[1];Ft(t,l,f,u)}else if(V(c))for(let u of Object.entries(c)){let l=u[0],f=u[1],p=n?.[i],d=p&&l in p?l:void 0;Ft(t,l,f,d)}else{let u=n?.[i],l=e[i++],f=e[i];Ft(t,l,f,u)}}},Cn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{ts(t,e,n,o,r,s)}})},Ft=(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(yo,e.slice(6,e.length)):t.setAttributeNS(yo,e,n);return}let r=e in Zr;me(n)||r&&!es(n)?t.removeAttribute(e):t.setAttribute(e,r?"":n)};var ns=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(R(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})=>{ns(t,e,n)}})},go=(t,e,n)=>{let o=k(e),r=k(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)||!k(c[l]))&&s.remove(l)}for(let u in c)k(c[u])&&s.add(u)}else if(a){if(r!==o){let c=i?We(r):[],u=We(o);c.length>0&&s.remove(...c),u.length>0&&s.add(...u)}}else if(r){let c=i?We(r):[];c.length>0&&s.remove(...c)}};function os(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=tt(t),o=tt(e),n||o)return t===e;if(n=R(t),o=R(e),n||o)return n&&o?os(t,e):!1;if(n=V(t),o=V(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:rs(t,e,n)})},Co=(t,e)=>{let n=wo(t);if(n&&Eo(t))R(e)?e=qt(e,Se(t))>-1:le(e)?e=e.has(Se(t)):e=ls(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)R(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)},ft=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",rs=(t,e,n)=>{let o=e.value,r=ft(n?.join(",")),s=ft(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)?is(t,i):c&&vo(t)?fs(t,i):c||So(t)?ss(t,a,i,o):Ao(t)?ps(t,i,o):($(7,t),()=>{})},xo=/[.,' ·٫]/,ss=(t,e,n,o)=>{let s=e.lazy?"change":"input",a=Ro(t),i=()=>{!e.trim&&!ft(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=ft(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},is=(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(R(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(us(t,i))};return t.addEventListener(n,r),o},Se=t=>"_value"in t?t._value:t.value,ko="trueValue",as="falseValue",No="true-value",cs="false-value",us=(t,e)=>{let n=e?ko:as;if(n in t)return t[n];let o=e?No:cs;return t.hasAttribute(o)?t.getAttribute(o):e},ls=(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)},fs=(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},ps=(t,e,n)=>{let o="change",r=ms(t,n),s=()=>{t.removeEventListener(o,a),r()},a=()=>{let i=e();if(!i)return;let u=ft(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 R(f)?(f.splice(0),f.push(...l)):i(l)}finally{Rn(i),ee(i)}}else i(l[0])};return t.addEventListener(o,a),s},ms=(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 ds=["stop","prevent","capture","self","once","left","right","middle","passive"],hs=t=>{let e={};if(j(t))return;let n=t.split(",");for(let o of ds)e[o]=n.includes(o);return e},ys=(t,e,n,o,r)=>{if(o){let u=e.value(),l=k(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()),V(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})=>ys(t,e,n,o,r)},gs=(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=hs(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,a;[e,a]=gs(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 bs=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=F(n)),Qe(t,n,e[0]);return}let r=e.length;for(let s=0;s<r;++s){let a=e[s];if(R(a)){let i=a[0],c=a[1];Qe(t,i,c)}else if(V(a))for(let i of Object.entries(a)){let c=i[0],u=i[1];Qe(t,c,u)}else{let i=e[s++],c=e[s];Qe(t,i,c)}}},Oo={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{bs(t,e,n,o)}})};function xs(t){return!!t||t===""}var Qe=(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=xs(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=R(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 Ts=(t,e)=>{let n=De(t).data,o=n._ord;zn(o)&&(o=n._ord=t.style.display),rt(e[0])?t.style.display=o:t.style.display="none"},Lo={mount:()=>({update:({el:t,values:e})=>{Ts(t,e)}})};var Cs=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(R(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})=>{Cs(t,e,n)}})},Vo=(t,e,n)=>{let o=k(e),r=k(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)k(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=k(n);if(R(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=Es(t,e);Io.test(r)?t.setProperty(Ke(s),r.replace(Io,""),"important"):t[s]=r}}}var Po=["Webkit","Moz","ms"],An={};function Es(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=at(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(k(t)),Do=(t,e=new WeakMap)=>{if(!t||!V(t))return t;if(R(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 k(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Do(k(o[1]),e);return n};var vs=(t,e)=>{let n=e[0];t.textContent=le(n)?JSON.stringify(ue([...n])):Ne(n)?JSON.stringify(ue([...n])):V(n)?JSON.stringify(ue(n)):n?.toString()??""},Uo={mount:()=>({update:({el:t,values:e})=>{vs(t,e)}})};var Ho={mount:()=>({update:({el:t,values:e})=>{Qe(t,"value",e[0])}})};var Xe=t=>t?.[xt]===1;function He(t){if(ut(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[xt]=1,R(t)){let n=t.length;for(let o=0;o<n;++o){let r=t[o];Xe(r)||(t[o]=He(r))}return e}if(!V(t))return e;for(let n of Object.entries(t)){let o=n[1];if(Xe(o))continue;let r=n[0];tt(r)||(t[r]=null,t[r]=He(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=He,e.sref=oe,e.flatten=ue,e}addComponent(...e){for(let n of e){if(!n.defaultName){Fe.warning("Registered component's default name is not defined",n);continue}this.te.set(at(n.defaultName),n),this.F.set(at(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":Oo,":":Cn,"@":Sn,[`${e}on`]:Sn,[`${e}bind`]:Cn,[`${e}html`]:Ht,[`${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`]:Nt},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 ws(t,o.pre,s))Rs(a,o.text,r,s)},Rs=(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)},ws=(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 Ss=9,As=10,ks=13,Ns=32,Ae=46,Wt=44,Os=39,Ms=34,Gt=40,Ye=41,Jt=91,Nn=93,On=63,Ls=59,jo=58,$o=123,Qt=125,Be=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},Vs={"=>":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),Is=new Set(Qo),In=new Set(["=>"]);Qo.forEach(t=>In.add(t));var qo={true:!0,false:!1,null:null},Ps="this",Ze="Expected ",je="Unexpected ",Dn="Unclosed ",Ds=Ze+":",zo=Ze+"expression",Us="missing }",Hs=je+"object property",Bs=Dn+"(",Ko=Ze+"comma",Wo=je+"token ",js=je+"period",Vn=Ze+"expression after ",$s="missing unaryOp argument",_s=Dn+"[",Fs=Ze+"exponent (",qs="Variable names cannot start with a number (",zs=Dn+'quote after "',pt=t=>t>=48&&t<=57,Go=t=>Vs[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)||pt(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.l,o=this.e;for(;e===Ns||e===Ss||e===As||e===ks;)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===Ls||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(je+'"'+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(pt(n)||n===Ae)return this.jt();if(n===Os||n===Ms)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($s);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===Ps&&(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 Is.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===Be?(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(Ye),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(;pt(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===Ae)for(o++;pt(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let i=e.charCodeAt(o);(i===Be||i===Xt)&&o++;let c=o;for(;pt(e.charCodeAt(o));)o++;if(c===o){this.e=o;let u=e.slice(n,o);throw this.i(Fs+u+this.H+")")}}this.e=o;let s=e.slice(n,o),a=e.charCodeAt(o);if(this.z(a))throw this.i(qs+s+this.H+")");if(a===Ae||s.length===1&&s.charCodeAt(0)===Ae)throw this.i(js);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(zs+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(je+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===Ye&&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===Ye)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(Ze+String.fromCharCode(e));return n}qt(){this.e++;let e=this.ye(Ye);if(this.f(Ye))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(Bs)}_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(Hs);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(Us)}}zt(e){let n=this.h;if((n===Be||n===Xt)&&n===this.l.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===Be?"++":"--",argument:this.G(this.be()),prefix:!0};if(!o.argument||!Fo.has(o.argument.type))throw this.i(je+o.operator)}}Qt(e){let n=e.node,o=this.h;if((o===Be||o===Xt)&&o===this.l.charCodeAt(this.e+1)){if(!Fo.has(n.type))throw this.i(je+(o===Be?"++":"--"));this.e+=2,e.node={type:13,operator:o===Be?"++":"--",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(Ds)}}Yt(e){if(this.g(),this.f(Gt)){let n=this.e;if(this.e++,this.g(),this.f(Ye)){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 Ks={"=>":(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},Ws={"-":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},Gs={"++":(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]}},Js={"++":(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=R(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(k(o[r]),o);for(let a of this.p)if(r in a)return this.V=a[r],Yt(k(a[r]),a);let s=this.We;if(s&&r in s)return this.V=s[r],Yt(k(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(k(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,Ws[e.operator],e.argument)}8(e,n,o){let r=Ks[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=k(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?Gs:Js;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 R(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=k(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}=gn(()=>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;r;constructor(e,n){this.p=e,this.r=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,w)=>(c.add(E),w&&E(a),()=>{c.delete(E)}),refs:[],context:this.p[0]};if(j(e))return p;let d=this.r.globalContext,y=[],m=new Set,T=(E,w,H,B)=>{try{let O=or(E,w,d,n,o,B,r);return H&&O.refs.length>0&&y.push(...O.refs),{value:O.value,refs:O.refs,ref:O.ref}}catch(O){$(6,`evaluation error: ${e}`,O)}return{value:void 0,refs:[]}};try{let E=rr[e]??Xo("["+e+"]");rr[e]=E;let w=this.p.slice(),H=E.elements,B=H.length,O=new Array(B);p.refs=O;let q=()=>{y.length=0,s||(m.clear(),u());let M=new Array(B);for(let S=0;S<B;++S){let fe=H[S];if(n?.(S,-1)){M[S]=P=>T(fe,w,!1,{$event:P}).value;continue}let b=T(fe,w,!0);M[S]=b.value,O[S]=b.ref}if(!s)for(let S of y)m.has(S)||(m.add(S),i.push(ne(S,q)));if(a=M,c.size!==0)for(let S of c)c.has(S)&&S(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}C(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===":"},Qs=(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},Xs=(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}},Ys=t=>{switch(t){case"thead":case"tbody":case"tfoot":return!0;default:return!1}},Zs=t=>{switch(t){case"caption":case"colgroup":case"thead":case"tbody":case"tfoot":case"tr":return!0;default:return!1}},mt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ei=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}},ti=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}},ni=(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 M=t.indexOf("-->",a+4);if(M===-1){n.push(t.slice(a));break}n.push(t.slice(a,M+3)),e=M+3;continue}let i=Qs(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=Xs(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 M=r[r.length-1];if(M?.tagName===p){r.pop(),M.emit&&n.push(c),e=i+1;continue}let S=o[o.length-1];S?(o.pop(),n.push(S.replacementHost?`</${S.replacementHost}>`:c),!S.isTableAlias&&ar(S.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=ei(d):Ys(m?.effectiveTag??"")?T=d==="tr"?null:"tr":m?.effectiveTag==="table"?T=Zs(d)?null:"tr":m?.effectiveTag==="tr"?T=d==="td"||d==="th"?null:"td":m?.effectiveTag==="colgroup"&&(T=d==="col"?null:"col");let E=ti(T),w=E!==void 0,H=y&&!mt.has(T||d),B=!!T&&E===d&&mt.has(d),O=!y&&!!T&&mt.has(T)&&!B,q=!y&&!T&&mt.has(d);if(T){let M=`${c.slice(0,f.start)}${T} is="${E?`r-${E}`:`regor:${p}`}"${c.slice(f.end)}`;n.push(H?cr(M,T):B?ni(M,T):M)}else n.push(H?cr(c,p):c);if(O?r.push({tagName:p,emit:!1}):B&&!y?r.push({tagName:p,emit:!1}):q&&r.push({tagName:p,emit:!0}),!y&&!B&&!O&&!q&&!mt.has(T??d)){let M=E??T??(d||p);o.push({replacementHost:T,effectiveTag:M,isTableAlias:w}),!w&&ar(M)&&++s}e=i+1}return n.join("")};var oi="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",ri=new Set(oi.toUpperCase().split(",")),si="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&&ri.has(r.toUpperCase())?document.createElementNS(si,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)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.")}},et=(t,e,n)=>{n??=ye.getDefault();let o=document.createDocumentFragment();if(!R(t))return Bn(t,o,!!e,n),o;for(let r of t)Bn(r,o,!!e,n);return o};var ii=(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=et(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)}),Ot(t),{context:t,unmount:()=>{Y(o)},unbind:()=>{Ce(o)}}},jn=class{tn;ot;r;m;o;constructor(e,n,o){this.tn=e,this.ot=n,this.r=o,this.m=new Zt([e],o),this.o=new _t(this.m)}y(){this.o.$(this.ot)}};var dt=t=>{if(R(t))return t.map(r=>dt(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=>dt(r))),e};var ai=(t,e={})=>{R(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=et(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??(it(r)&&r.hasAttribute?.("isSVG")))||it(r)&&r.querySelector("[isSVG]"))){let s=r.content,a=s?[...s.childNodes]:[...r.childNodes],i=dt(a);t.element=et(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 ci=t=>{Pe()?.onMounted.push(t)};var ui=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw _(4);return e&&!n.isStopped?e(...r):(e=li(t,n),e(...r))};return o[J]=1,Ve(o,!0),o.stop=()=>n.ref?.stop?.(),se(()=>o.stop(),!0),o},li=(t,e)=>{let n=e.ref??oe(null);e.ref=n,e.isStopped=!1;let o=0,r=Ge(()=>{if(o>0){r(),e.isStopped=!0,ee(n);return}n(t()),++o});return n.stop=r,n};var fi=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw _(4);return o&&!n.isStopped?o(...s):(o=pi(t,e,n),o(...s))};return r[J]=1,Ve(r,!0),r.stop=()=>n.ref?.stop?.(),se(()=>r.stop(),!0),r},pi=(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 mi=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw _(4);return o&&!n.isStopped?o(...s):(o=di(t,e,n),o(...s))};return r[J]=1,Ve(r,!0),r.stop=()=>n.ref?.stop?.(),se(()=>r.stop(),!0),r},di=(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 hi=t=>(t[Tt]=1,t);var yi=(t,e)=>{if(!e)throw _(5);let o=Xe(t)?He: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=Ge(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},gi=_n,bi=_n;var xi=(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 Ti=t=>{if(!x(t))throw _(3,"observerCount");return t(void 0,void 0,2)};var Ci=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{ot as ComponentHead,$n as ContextRegistry,ye as RegorConfig,Q as addUnbinder,Ci as batch,gn as collectRefs,fi as computeMany,mi as computeRef,ui as computed,ii as createApp,ai as defineComponent,mr as drainUnbind,fr as endBatch,ct as entangle,ue as flatten,De as getBindData,_n as html,Xe as isDeepRef,ut as isRaw,x as isRef,hi as markRaw,ne as observe,xi as observeMany,Ti as observerCount,ci as onMounted,se as onUnmounted,vn as pause,yi as persist,Mr as pval,gi as raw,He as ref,Y as removeNode,Rn as resume,yn as silence,oe as sref,lr as startBatch,bi as svg,et as toFragment,dt as toJsonTemplate,ee as trigger,Ce as unbind,k as unref,dn as useScope,Fe as warningHandler,Ge as watchEffect};
@@ -3685,8 +3685,10 @@ var Regor = (() => {
3685
3685
  };
3686
3686
  var handleSelect = (el, getModelRef, parsedValue) => {
3687
3687
  const eventType = "change";
3688
+ const stopObservingOptions = observeSelectOptions(el, parsedValue);
3688
3689
  const unbinder = () => {
3689
3690
  el.removeEventListener(eventType, listener);
3691
+ stopObservingOptions();
3690
3692
  };
3691
3693
  const listener = () => {
3692
3694
  const modelRef = getModelRef();
@@ -3720,6 +3722,35 @@ var Regor = (() => {
3720
3722
  el.addEventListener(eventType, listener);
3721
3723
  return unbinder;
3722
3724
  };
3725
+ var observeSelectOptions = (el, parsedValue) => {
3726
+ const MutationObserverCtor = globalThis.MutationObserver ?? globalThis.window?.MutationObserver;
3727
+ if (!MutationObserverCtor) return () => {
3728
+ };
3729
+ let pending = false;
3730
+ let stopped = false;
3731
+ const flush = () => {
3732
+ pending = false;
3733
+ if (stopped) return;
3734
+ updateDomElementValue(el, parsedValue()[0]);
3735
+ };
3736
+ const scheduleFlush = () => {
3737
+ if (pending) return;
3738
+ pending = true;
3739
+ if (typeof queueMicrotask === "function") queueMicrotask(flush);
3740
+ else Promise.resolve().then(flush);
3741
+ };
3742
+ const observer = new MutationObserverCtor(scheduleFlush);
3743
+ observer.observe(el, {
3744
+ attributes: true,
3745
+ attributeFilter: ["value"],
3746
+ childList: true,
3747
+ subtree: true
3748
+ });
3749
+ return () => {
3750
+ stopped = true;
3751
+ observer.disconnect();
3752
+ };
3753
+ };
3723
3754
 
3724
3755
  // src/directives/on.ts
3725
3756
  var availableFlags = [