@jasonshimmy/custom-elements-runtime 2.1.2 → 2.2.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,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./helpers-D3UjNfYY.cjs"),j=require("./logger-CqdBMdui.cjs"),Y=require("./transitions-ComAUaWb.cjs");function Je(e,r,n){if(n)for(const[t,s]of Object.entries(n)){let o,i={};if(Array.isArray(s)?(o=s[0],i=s[1]||{}):o=s,r.set(t,{callback:o,options:i,oldValue:p.getNestedValue(e,t)}),i.immediate)try{const a=p.getNestedValue(e,t);o(a,void 0,e)}catch(a){j.devError(`Error in immediate watcher for "${t}":`,a)}}}function Ye(e,r,n,t){const s=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((c,g)=>s(c,a[g]));const f=i,u=a,S=Object.keys(f||{}),k=Object.keys(u||{});return S.length!==k.length?!1:S.every(c=>s(f[c],u[c]))},o=r.get(n);if(o&&!s(t,o.oldValue))try{o.callback(t,o.oldValue,e),o.oldValue=t}catch(i){j.devError(`Error in watcher for "${n}":`,i)}for(const[i,a]of r.entries())if(a.options.deep&&n.startsWith(i+"."))try{const f=p.getNestedValue(e,i);s(f,a.oldValue)||(a.callback(f,a.oldValue,e),a.oldValue=f)}catch(f){j.devError(`Error in deep watcher for "${i}":`,f)}}function Ae(e,r){return r===Boolean?e===""||e==="true":r===Number?Number(e):e}function Xe(e,r,n){if(r)for(const t in r){const s=r[t],o=p.toKebab(t),i=e.getAttribute(o);if(s.type===Function&&typeof e[t]=="function")n[t]=e[t];else if(i!==null)n[t]=Ae(i,s.type);else if(typeof e[t]<"u")try{const a=e[t];if(s.type===String&&a&&typeof a=="object")try{n[t]=Ae(String(a),s.type)}catch{n[t]=a}else s.type===Boolean&&typeof a=="boolean"||s.type===Number&&typeof a=="number"||s.type===Function&&typeof a=="function"?n[t]=a:n[t]=Ae(String(a),s.type)}catch{n[t]=e[t]}else"default"in s&&s.default!==void 0&&(n[t]=s.default)}}function Qe(e,r,n){if(!r.props){try{const t=n?._hookCallbacks?.props||{},s=Array.from(new Set([...Object.keys(e||{}),...Object.keys(t||{})]));for(const o of s){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(n,o);if(!(!Object.prototype.hasOwnProperty.call(t,o)&&i&&(i.get||i.set||!i.configurable)))try{Object.defineProperty(n,o,{enumerable:!0,configurable:!0,get(){try{const f=p.toKebab(o),u=e.getAttribute(f);if(u!==null)return u;const S=e[o];let k;return p.isReactiveState(S)||S&&typeof S=="object"&&"value"in S&&!(S instanceof Node)?k=S.value:k=S,k}catch{return e[o]}}})}catch{}}}catch{}return}Xe(e,r.props,n)}function et(e,r,n,t){e.onConnected&&!n&&(e.onConnected(r),t(!0))}function tt(e,r,n,t,s,o,i,a){e.onDisconnected&&e.onDisconnected(r),n.forEach(f=>f()),t(),s(),o(!1),i(null),a(!1)}function nt(e,r,n,t,s){e.onAttributeChanged&&e.onAttributeChanged(r,n,t,s)}class rt{static cache=new Map;static maxCacheSize=1e3;static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i,/setTimeout/i,/setInterval/i,/fetch/i,/XMLHttpRequest/i];static evaluate(r,n){const t=this.cache.get(r);if(t){if(!t.isSecure){j.devWarn("Blocked cached dangerous expression:",r);return}try{this.cache.delete(r),this.cache.set(r,t)}catch{}return t.evaluator(n)}const s=this.createEvaluator(r);if(this.cache.size>=this.maxCacheSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}if(this.cache.set(r,s),!s.isSecure){j.devWarn("Blocked dangerous expression:",r);return}return s.evaluator(n)}static createEvaluator(r){if(this.hasDangerousPatterns(r))return{evaluator:()=>{},isSecure:!1};if(r.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(r),isSecure:!0}}catch(n){return j.devWarn("Failed to create evaluator for expression:",r,n),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(r){return this.dangerousPatterns.some(n=>n.test(r))}static createSafeEvaluator(r){const n=r.trim();if(n.startsWith("{")&&n.endsWith("}"))return this.createObjectEvaluator(r);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(r.trim())){const t=r.trim().slice(4);return s=>p.getNestedValue(s,t)}return r.includes("ctx")||/[+\-*/%<>=&|?:[\]]/.test(r)?this.createSimpleEvaluator(r):t=>p.getNestedValue(t,r)}static createObjectEvaluator(r){const n=r.trim().slice(1,-1),t=this.parseObjectProperties(n);return s=>{const o={};for(const{key:i,value:a}of t)try{if(a.startsWith("ctx.")){const f=a.slice(4);o[i]=p.getNestedValue(s,f)}else o[i]=this.evaluateSimpleValue(a,s)}catch{o[i]=void 0}return o}}static parseObjectProperties(r){const n=[],t=r.split(",");for(const s of t){const o=s.indexOf(":");if(o===-1)continue;const i=s.slice(0,o).trim(),a=s.slice(o+1).trim(),f=i.replace(/^['"]|['"]$/g,"");n.push({key:f,value:a})}return n}static createSimpleEvaluator(r){return n=>{try{let t=r;const s=[];t=t.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,k=>`<<#${s.push(k)-1}#>>`);const o=t.match(/ctx\.[\w.]+/g)||[];for(const k of o){const c=k.slice(4),g=p.getNestedValue(n,c);if(g===void 0)return;const d=s.push(JSON.stringify(g))-1;t=t.replace(new RegExp(k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`)}const i=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=t.match(i)||[];for(const k of a){if(k.startsWith("ctx."))continue;const c=p.getNestedValue(n,k);if(c===void 0)return;const g=s.push(JSON.stringify(c))-1;t=t.replace(new RegExp(k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${g}#>>`)}const f=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let u;const S=new Set;for(;(u=f.exec(t))!==null;){const k=u[1];if(["true","false","null","undefined"].includes(k)||/^[0-9]+$/.test(k)||k==="ctx"||S.has(k))continue;S.add(k);const c=p.getNestedValue(n,k);if(c===void 0)return;const g=JSON.stringify(c),d=s.push(g)-1;k.includes(".")?t=t.replace(new RegExp(k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`):t=t.replace(new RegExp("\\b"+k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${d}#>>`)}t=t.replace(/<<#(\d+)#>>/g,(k,c)=>s[Number(c)]);try{return this.evaluateBasicExpression(t)}catch{return}}catch{return}}}static evaluateBasicExpression(r){const n=this.tokenize(r);let t=0;function s(){return n[t]}function o(l){const E=n[t++];if(l&&!E)throw new Error(`Unexpected token EOF, expected ${l}`);if(l&&E&&E.type!==l&&E.value!==l)throw new Error(`Unexpected token ${E.type}/${E.value}, expected ${l}`);return E}function i(){return d()}function a(l){if(typeof l=="number")return l;if(l==null)return NaN;if(typeof l=="boolean")return l?1:0;const E=Number(l);return Number.isNaN(E)?NaN:E}function f(l,E){return typeof l=="string"||typeof E=="string"?String(l)+String(E):a(l)+a(E)}function u(l,E){return a(l)-a(E)}function S(l,E){return a(l)*a(E)}function k(l,E){return a(l)/a(E)}function c(l,E){return a(l)%a(E)}function g(l,E,y){if(typeof E=="number"&&typeof y=="number")switch(l){case">":return E>y;case"<":return E<y;case">=":return E>=y;case"<=":return E<=y;default:return!1}const h=String(E),C=String(y);switch(l){case">":return h>C;case"<":return h<C;case">=":return h>=C;case"<=":return h<=C;default:return!1}}function d(){const l=b(),E=s();if(E&&E.value==="?"){o("?");const y=i();o(":");const h=i();return l?y:h}return l}function b(){let l=m();for(;;){const E=s();if(!E||E.value!=="||")break;o("OP");const y=m();l=l||y}return l}function m(){let l=L();for(;;){const E=s();if(!E||E.value!=="&&")break;o("OP");const y=L();l=l&&y}return l}function L(){let l=w();for(;;){const E=s();if(!E||!["==","!=","===","!=="].includes(E.value))break;const y=o("OP").value,h=w();switch(y){case"==":l=l==h;break;case"!=":l=l!=h;break;case"===":l=l===h;break;case"!==":l=l!==h;break}}return l}function w(){let l=v();for(;;){const E=s();if(!E||![">","<",">=","<="].includes(E.value))break;const y=o("OP").value,h=v();switch(y){case">":l=g(">",l,h);break;case"<":l=g("<",l,h);break;case">=":l=g(">=",l,h);break;case"<=":l=g("<=",l,h);break}}return l}function v(){let l=_();for(;;){const E=s();if(!E||E.value!=="+"&&E.value!=="-")break;const y=o("OP").value,h=_();l=y==="+"?f(l,h):u(l,h)}return l}function _(){let l=T();for(;;){const E=s();if(!E||E.value!=="*"&&E.value!=="/"&&E.value!=="%")break;const y=o("OP").value,h=T();switch(y){case"*":l=S(l,h);break;case"/":l=k(l,h);break;case"%":l=c(l,h);break}}return l}function T(){const l=s();if(l&&l.value==="!")return o("OP"),!T();if(l&&l.value==="-"){o("OP");const E=T();return u(0,E)}return N()}function N(){const l=s();if(l){if(l.type==="NUMBER")return o("NUMBER"),Number(l.value);if(l.type==="STRING")return o("STRING"),l.value.slice(1,-1);if(l.type==="IDENT")return o("IDENT"),l.value==="true"?!0:l.value==="false"?!1:l.value==="null"?null:void 0;if(l.value==="["){o("PUNC");const E=[];for(;;){const y=s();if(!y||y.value==="]")break;E.push(i());const h=s();h&&h.value===","&&o("PUNC")}return o("PUNC"),E}if(l.value==="("){o("PUNC");const E=i();return o("PUNC"),E}throw new Error("Unexpected token in expression")}}return i()}static tokenize(r){const n=[],t=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let s;for(;(s=t.exec(r))!==null;){const o=s[1];o&&(/^\d/.test(o)?n.push({type:"NUMBER",value:o}):/^"/.test(o)||/^'/.test(o)?n.push({type:"STRING",value:o}):/^[a-zA-Z_]/.test(o)?n.push({type:"IDENT",value:o}):/^[()?:,[\]]$/.test(o)?n.push({type:"PUNC",value:o}):n.push({type:"OP",value:o}))}return n}static evaluateSimpleValue(r,n){if(r==="true")return!0;if(r==="false")return!1;if(!isNaN(Number(r)))return Number(r);if(r.startsWith("ctx.")){const t=r.slice(4);return p.getNestedValue(n,t)}return r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class U{static cleanupFunctions=new WeakMap;static addListener(r,n,t,s){r.addEventListener(n,t,s);const i={event:n,handler:t,wrapper:t,options:s,cleanup:()=>r.removeEventListener(n,t,s),addedAt:Date.now()};this.cleanupFunctions.has(r)||this.cleanupFunctions.set(r,[]);const a=this.cleanupFunctions.get(r);a.push(i),a.__metaList=a}static removeListener(r,n,t,s){r.removeEventListener(n,t,s);const o=this.cleanupFunctions.get(r);if(o)for(let i=0;i<o.length;i++){const a=o[i];if(a.event===n&&a.handler===t){o.splice(i,1),o.length===0&&this.cleanupFunctions.delete(r);return}}}static cleanup(r){const n=this.cleanupFunctions.get(r);n&&(n.forEach(t=>{try{t.cleanup()}catch{}}),this.cleanupFunctions.delete(r))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(r){const n=this.cleanupFunctions.get(r);return!!(n&&n.length>0)}static getListenerCount(r){const n=this.cleanupFunctions.get(r);return n?n.length:0}static getListenerInfo(r){const n=this.cleanupFunctions.get(r);return n?n.map(t=>({event:t.event,handler:t.handler,wrapper:t.wrapper,options:t.options})):[]}}function Se(e,r){return Array.isArray(e)&&Array.isArray(r)?JSON.stringify([...e].sort())!==JSON.stringify([...r].sort()):e!==r}function He(e,r,n,t,s){if(e){const o=r.value;if(s&&typeof o=="object"&&o!==null){const i={...o};i[s]=n,r.value=i}else r.value=n}else{const o=t._state||t;p.setNestedValue(o,r,n)}}function _e(e,r,n,t){if(typeof e._requestRender=="function"&&e._requestRender(),typeof e._triggerWatchers=="function"){const s=r?"reactiveState":n;e._triggerWatchers(s,t)}}function st(e,r,n){const t=`update:${p.toKebab(r)}`,s=`update:${r}`,o=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}),i=new CustomEvent(s,{detail:n,bubbles:!0,cancelable:!0});e.dispatchEvent(o),e.dispatchEvent(i)}function xe(e,r,n,t){const s=n;if(p.safe(()=>{if(typeof e.setAttribute=="function")try{e[r]=s}catch{}else e[r]=s}),s==null||typeof s=="string"||typeof s=="number"||typeof s=="boolean"){const o=p.safeSerializeAttr(s);o!==null?p.safe(()=>{typeof e.setAttribute=="function"&&e.setAttribute(p.toKebab(r),o)}):p.safe(()=>{typeof e.removeAttribute=="function"&&e.removeAttribute(p.toKebab(r))})}}function it(e,r,n,t){if(e){const s=r.value;return t&&typeof s=="object"&&s!==null?s[t]:s}else{const s=n._state||n;return p.getNestedValue(s,r)}}function se(e){return e?e.split(/\s+/).filter(Boolean):[]}function ie(e,r){if(r.length===0)return;const n=r.filter(t=>t&&!e.classList.contains(t));n.length>0&&e.classList.add(...n)}function re(e,r){if(r.length===0)return;const n=r.filter(Boolean);n.length>0&&e.classList.remove(...n)}let we=!1;async function ot(e,r,n=10){if(!we){if(!e.isConnected){j.devWarn("⚠️ Element not connected to DOM, skipping style wait");return}for(let t=0;t<n;t++){const s=window.getComputedStyle(e),o=s.transform&&s.transform!=="",i=s.opacity&&s.opacity!=="";if(o||i){we=!0;return}await new Promise(a=>requestAnimationFrame(()=>a(void 0)))}we=!0,j.devWarn("⚠️ Styles did not load in time for transition, continuing anyway")}}function at(e){const r=window.getComputedStyle(e),n=r.transitionDuration||"0s",t=r.transitionDelay||"0s",s=o=>{const i=parseFloat(o);return o.includes("ms")?i:i*1e3};return s(n)+s(t)}function ze(e,r){return new Promise(n=>{const t=r??at(e);if(t<=0){n();return}let s=!1;const o=()=>{s||(s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",i),n())},i=()=>o();e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",i),setTimeout(o,t+50)})}async function pe(e,r){const{classes:n,hooks:t,css:s,duration:o}=r;if(t?.onBeforeEnter)try{t.onBeforeEnter(e)}catch(d){j.devError("Transition onBeforeEnter error:",d)}if(!s)return t?.onEnter?new Promise(d=>{const b=t.onEnter;typeof b=="function"?b(e,()=>{if(t?.onAfterEnter)try{t.onAfterEnter(e)}catch(m){j.devError("Transition onAfterEnter error:",m)}d()}):d()}):void 0;const i=se(n?.enterFrom),a=se(n?.enterActive),f=se(n?.enterTo);ie(e,i),e.offsetHeight,ie(e,a),e.offsetHeight;let u;if(t?.onEnter){const d=new Promise(b=>{u=b});try{const b=t.onEnter;typeof b=="function"&&b(e,()=>{u&&u()})}catch(b){j.devError("Transition onEnter error:",b)}u&&await d}await new Promise(d=>requestAnimationFrame(()=>d(void 0))),e.offsetHeight;const S=window.getComputedStyle(e),k=S.transform,c=S.opacity;re(e,i),k&&k!=="none"&&(e.style.transform=k),c&&c!==""&&(e.style.opacity=c),e.offsetHeight,await new Promise(d=>requestAnimationFrame(()=>d(void 0))),e.style.transform="",e.style.opacity="",ie(e,f),e.offsetHeight,await new Promise(d=>requestAnimationFrame(()=>d(void 0)));let g;if(typeof o=="number"?g=o:o&&typeof o=="object"&&"enter"in o&&(g=o.enter),await ze(e,g),re(e,a),t?.onAfterEnter)try{t.onAfterEnter(e)}catch(d){j.devError("Transition onAfterEnter error:",d)}}async function Te(e,r){const{classes:n,hooks:t,css:s,duration:o}=r;if(t?.onBeforeLeave)try{t.onBeforeLeave(e)}catch(k){j.devError("Transition onBeforeLeave error:",k)}if(!s)return t?.onLeave?new Promise(k=>{const c=t.onLeave;typeof c=="function"?c(e,()=>{if(t?.onAfterLeave)try{t.onAfterLeave(e)}catch(g){j.devError("Transition onAfterLeave error:",g)}k()}):k()}):void 0;const i=se(n?.leaveFrom),a=se(n?.leaveActive),f=se(n?.leaveTo);ie(e,i),e.offsetHeight,ie(e,a);let u;if(t?.onLeave){const k=new Promise(c=>{u=c});try{const c=t.onLeave;typeof c=="function"&&c(e,()=>{u&&u()})}catch(c){j.devError("Transition onLeave error:",c)}u&&await k}await new Promise(k=>requestAnimationFrame(()=>k(void 0))),await ot(e,[...i,...a]),re(e,i),ie(e,f);let S;if(typeof o=="number"?S=o:o&&typeof o=="object"&&"leave"in o&&(S=o.leave),await ze(e,S),re(e,a),re(e,f),re(e,i),t?.onAfterLeave)try{t.onAfterLeave(e)}catch(k){j.devError("Transition onAfterLeave error:",k)}}const Ke=new WeakMap,Ve=new WeakMap;function ke(e){if(!e)return;const r=Ke.get(e);if(r!==void 0)return r;try{const n=e;if(n&&n.key!=null)return String(n.key)}catch{}if(e instanceof Element){const n=e.getAttribute("data-anchor-key");if(n)return n}}function z(e,r){try{Ke.set(e,r)}catch{}try{e.key=r}catch{}try{if(e instanceof Element){const n=p.safeSerializeAttr(r);n!==null&&e.setAttribute("data-anchor-key",n)}}catch{}}function ct(e){if(!e)return;const r=Ve.get(e);if(r!==void 0)return r;try{const n=e;if(n&&n._transitionGroup!=null)return n._transitionGroup}catch{}}function lt(e,r){try{Ve.set(e,r)}catch{}try{e._transitionGroup=r}catch{}}function oe(e){return e!==null&&typeof e=="object"&&"value"in e}function Oe(e){try{if(p.isReactiveState(e))return e.value}catch{}try{if(oe(e))return e.value}catch{}return e}function V(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function ae(e){return e===""?!0:typeof e=="string"?e==="false"?!1:e==="true"?!0:e!=="":e&&typeof e=="object"?p.isReactiveState(e)||"value"in e?!!e.value:!1:!!e}function ne(e,r){if(!r||!(e instanceof HTMLElement))return;U.cleanup(e);for(const t in r)r[t]===e&&delete r[t];const n=e.childNodes;for(let t=0;t<n.length;t++)ne(n[t],r)}function he(e,r,n){if(typeof e=="string")return;const t=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),s=e.props?.ref??(e.props?.props&&e.props.props.ref);if(t)try{if(p.isReactiveState(t)||typeof t=="object"&&"value"in t)t.value=r;else if(typeof t=="function")t(r);else if(typeof t=="string"&&n)try{const o=String(t);n[o]=r}catch{}}catch{}else if(s&&n)try{const o=String(s);n[o]=r}catch{}}function ft(e,r,n,t,s,o,i,a){if(!o)return;const f=r.includes("lazy"),u=r.includes("trim"),S=r.includes("number"),k=()=>{if(p.isReactiveState(e)){const _=e.value;return a&&i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement)&&typeof _=="object"&&_!==null?_[a]:_}const v=o?._state||o;return p.getNestedValue(v,e)},c=k();let g="text";i instanceof HTMLInputElement?g=t?.type||i.type||"text":i instanceof HTMLSelectElement?g="select":i instanceof HTMLTextAreaElement&&(g="textarea");const d=i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement,m=d?g==="checkbox"||g==="radio"?"checked":"value":a??"modelValue";if(g==="checkbox")if(Array.isArray(c))n[m]=c.includes(String(i?.getAttribute("value")??t?.value??""));else{const v=i?.getAttribute("true-value")??!0;n[m]=c===v}else if(g==="radio")n[m]=c===(t?.value??"");else if(g==="select")if(i&&i.hasAttribute("multiple")&&i instanceof HTMLSelectElement){const v=Array.isArray(c)?c.map(String):[];setTimeout(()=>{Array.from(i.options).forEach(_=>{_.selected=v.includes(_.value)})},0),n[m]=Array.isArray(c)?c:[]}else n[m]=c;else{!d&&p.isReactiveState(e)?n[m]=e:n[m]=c;try{const v=p.toKebab(m);t&&(t[v]=c)}catch{}}const L=f||g==="checkbox"||g==="radio"||g==="select"?"change":"input",w=v=>{if(v.isComposing||s._isComposing)return;const _=globalThis.process,T=!!_&&_.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(v.isTrusted===!1&&!T)return;const N=v.target;if(!N||N._modelUpdating)return;let O=N.value;if(g==="checkbox"){const y=k();if(Array.isArray(y)){const h=N.getAttribute("value")??"",C=Array.from(y);if(N.checked)C.includes(h)||C.push(h);else{const P=C.indexOf(h);P>-1&&C.splice(P,1)}O=C}else{const h=N.getAttribute("true-value")??!0,C=N.getAttribute("false-value")??!1;O=N.checked?h:C}}else if(g==="radio")O=N.getAttribute("value")??N.value;else if(g==="select"&&N.multiple)O=Array.from(N.selectedOptions).map(y=>y.value);else if(u&&typeof O=="string"&&(O=O.trim()),S){const y=Number(O);isNaN(y)||(O=y)}const l=k();if(Se(O,l)){N._modelUpdating=!0;try{He(p.isReactiveState(e),e,O,o,a),_e(o,p.isReactiveState(e),e,O),N&&st(N,m,O)}finally{setTimeout(()=>N._modelUpdating=!1,0)}}};if(d){if(s[L]){const v=s[L];i&&U.removeListener(i,L,v)}s[L]=w}else{const v=`update:${p.toKebab(m)}`,_=`update:${m}`;if(s[v]){const T=s[v];i&&U.removeListener(i,v,T)}if(s[_]){const T=s[_];i&&U.removeListener(i,_,T)}if(s[v]=T=>{const N=T.detail;let O=N!==void 0?N:void 0;if(O===void 0){const y=T.target;if(y&&typeof y=="object"&&"value"in y)try{O=y.value}catch{O=void 0}}const l=it(p.isReactiveState(e),e,o,a);if(Se(O,l)){He(p.isReactiveState(e),e,O,o,a),_e(o,p.isReactiveState(e),e,O);const y=T.target;y&&xe(y,m,p.isReactiveState(e)?e:O,p.isReactiveState(e))}},p.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let T=[];try{T=Reflect.ownKeys(e.value)}catch{T=Object.keys(e.value)}const N=T.filter(O=>typeof O=="string"&&!String(O).startsWith("_")&&O!=="constructor");for(const O of N){const l=String(O),E=`update:${p.toKebab(l)}`,y=`update:${l}`;s[E]||(s[E]=h=>{const C=h.detail!==void 0?h.detail:h.target?.value,P=p.isReactiveState(e)?e.value[l]:p.getNestedValue(o?._state||o,e);if(!Se(C,P))return;if(p.isReactiveState(e)){const x={...e.value};x[l]=C,e.value=x}else p.setNestedValue(o?._state||o,e,C);_e(o,p.isReactiveState(e),e,C);const A=h.currentTarget||i||h.target;A&&xe(A,m,p.isReactiveState(e)?e:C,p.isReactiveState(e))},s[y]=s[E])}}s[_]=s[v]}(g==="text"||g==="textarea")&&(s.compositionstart=()=>s._isComposing=!0,s.compositionend=v=>{s._isComposing=!1;const _=v.target;_&&setTimeout(()=>{const T=_.value,N=o?._state||o,O=p.getNestedValue(N,e);let l=T;if(u&&(l=l.trim()),S){const y=Number(l);isNaN(y)||(l=y)}if(Se(l,O)){_._modelUpdating=!0;try{p.setNestedValue(N,e,l),_e(o,p.isReactiveState(e),e,l)}finally{setTimeout(()=>_._modelUpdating=!1,0)}}},0)})}function Fe(e){const r=e.slice(2);return r?r.charAt(0).toLowerCase()+r.slice(1):""}function ut(e,r,n,t,s){if(typeof e=="object"&&e!==null)for(const[o,i]of Object.entries(e))if(o.startsWith("data-")||o.startsWith("aria-")||o==="class")n[o]=i;else if(o==="disabled"&&s&&V(s)){const a=i&&typeof i=="object"&&"value"in i;(()=>{try{return p.isReactiveState(i)}catch{return!1}})()||a?r[o]=i:n[o]=i}else r[o]=i;else if(typeof e=="string"){if(!t)return;try{const o=be(e,t);if(typeof o=="object"&&o!==null){for(const[i,a]of Object.entries(o))if(i.startsWith("data-")||i.startsWith("aria-")||i==="class")n[i]=a;else if(i==="disabled"&&s&&V(s)){const f=a&&typeof a=="object"&&"value"in a;(()=>{try{return p.isReactiveState(a)}catch{return!1}})()||f?r[i]=a:n[i]=a}else r[i]=a;return}else{n[e]=o;return}}catch{const o=p.getNestedValue(t,e);n[e]=o}}}function dt(e,r,n){let t;if(typeof e=="string"){if(!n)return;t=be(e,n)}else t=e;const s=String(r.style||"");let o=s;if(t){if(s){const i=String(s).split(";").map(f=>f.trim()).filter(Boolean),a=i.findIndex(f=>f.startsWith("display:"));a>=0&&i[a]==="display: none"&&(i.splice(a,1),o=i.length>0?i.join("; ")+";":"")}}else if(s){const i=String(s).split(";").filter(Boolean),a=i.findIndex(f=>f.trim().startsWith("display:"));a>=0?i[a]="display: none":i.push("display: none"),o=i.join("; ")}else o="display: none";o!==s&&(o?r.style=o:delete r.style)}function be(e,r){return rt.evaluate(e,r)}function pt(e,r,n){let t;if(typeof e=="string"){if(!n)return;t=be(e,n)}else t=e;try{if(t&&typeof t=="object"){if(p.isReactiveState(t))t=t.value;else if("value"in t&&typeof t.value<"u"){const a=t.value;a instanceof Node||(t=a)}}}catch{}let s=[];if(typeof t=="string")s=[t];else if(Array.isArray(t))s=t.filter(Boolean);else if(typeof t=="object"&&t!==null)for(const[a,f]of Object.entries(t))f&&s.push(a);const o=r.class||"",i=s.join(" ");r.class=o?`${o} ${i}`.trim():i}function Re(e){if(e===!0||e===!1)return!0;if(e==null)return!1;if(typeof e==="string")return e===""||e==="true"||e==="false";try{if(e&&typeof e=="object"&&"value"in e){const n=e.value,t=typeof n;return t==="boolean"?!0:t==="string"?n===""||n==="true"||n==="false":!1}}catch{}return!1}function ht(e,r,n){let t;if(typeof e=="string"){if(!n)return;t=be(e,n)}else t=e;let s="";if(typeof t=="string")s=t;else if(t&&typeof t=="object"){const i=[];for(const[a,f]of Object.entries(t))if(f!=null&&f!==""){const u=a.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`),S=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let k=String(f);typeof f=="number"&&S.includes(u)&&(k=`${f}px`),i.push(`${u}: ${k}`)}s=i.join("; ")+(i.length>0?";":"")}const o=String(r.style||"");r.style=o+(o&&!o.endsWith(";")?"; ":"")+s}function yt(e,r,n){let t=e;typeof e=="string"&&n&&(t=be(e,n)),p.isReactiveState(t)?r.reactiveRef=t:r.ref=t}function Ue(e,r,n,t){const s={},o={...t||{}},i={};for(const[a,f]of Object.entries(e)){const{value:u,modifiers:S,arg:k}=f;if(a==="model"||a.startsWith("model:")){const c=a.split(":"),g=c.length>1?c[1]:k;ft(u,S,s,o,i,r,n,g);continue}switch(a){case"bind":ut(u,s,o,r,n);break;case"show":dt(u,o,r);break;case"class":pt(u,o,r);break;case"style":ht(u,o,r);break;case"ref":yt(u,s,r);break}}try{if(Object.prototype.hasOwnProperty.call(s,"disabled")&&n&&V(n)){const f=s.disabled,u=f&&typeof f=="object"&&"value"in f;let S=!1;try{S=p.isReactiveState(f)}catch{S=!1}if(!u&&!S)try{o.disabled=f,delete s.disabled;const k=globalThis;k.__VDOM_DISABLED_PROMOTIONS||(k.__VDOM_DISABLED_PROMOTIONS=[]),k.__VDOM_DISABLED_PROMOTIONS.push({phase:"bind-directive:postfix-move",location:"attrs",key:"disabled",value:f,time:Date.now(),stack:new Error().stack})}catch{}}}catch{}return{props:s,attrs:o,listeners:i}}function Pe(e,r){if(Array.isArray(e)){const o=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const k=i.tag||"node",g=[i.props?.attrs?.id,i.props?.attrs?.name,i.props?.attrs?.["data-key"],i.props?.props?.id,i.props?.props?.name,i.props?.props?.dataKey,i.props?.props?.["data-key"]].find(d=>d!=null)??"";a=g?`${r}:${k}:${g}`:`${r}:${k}`}let f=a,u=1;for(;o.has(f);)f=`${a}#${u++}`;o.add(f);let S=i.children;return Array.isArray(S)&&(S=Pe(S,f)),{...i,key:f,children:S}})}const n=e,t=n.props?.key??n.key??r;let s=n.children;return Array.isArray(s)&&(s=Pe(s,t)),{...n,key:t,children:s}}function Ie(e,r,n,t){const s=n.directives??{},o=Ue(s,t,e,n.attrs),i={...r.props||{},...n.props||{},...o.props||{}},a={...r.attrs||{},...n.attrs||{},...o.attrs||{}},f=r.props??{},u=i,S=!!(n?.isCustomElement??r?.isCustomElement??!1);let k=!1;for(const d in{...f,...u}){const b=f[d],m=u[d];let L=b,w=m;if(p.safe(()=>{(p.isReactiveState(b)||oe(b))&&(L=b.value)}),p.safe(()=>{(p.isReactiveState(m)||oe(m))&&(w=m.value)}),!(b===m&&L===w))if(k=!0,d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const v=Oe(m),_=v==null?"":String(v);e.value!==_&&(e.value=_)}else if(d==="checked"&&e instanceof HTMLInputElement){const v=Oe(m);e.checked=!!v}else if(d.startsWith("on")&&typeof m=="function"){const v=Fe(d);typeof b=="function"&&U.removeListener(e,v,b),typeof m=="function"&&U.addListener(e,v,m);try{if(v&&v.startsWith("update:")){const _=v.split(":",2)[1],T=u[_];let N=[];try{if(p.isReactiveState(T)){const l=T.value;N=l&&typeof l=="object"?Object.keys(l):[]}else T&&typeof T=="object"&&(N=Object.keys(T))}catch{N=[]}const O=N.filter(l=>typeof l=="string"&&!l.startsWith("_")&&l!=="constructor");for(const l of O){const E=`update:${l}`,y=h=>{const C=h.detail!==void 0?h.detail:h.target instanceof HTMLInputElement||h.target instanceof HTMLTextAreaElement||h.target instanceof HTMLSelectElement?h.target.value:void 0,R={...p.isReactiveState(T)?T.value||{}:u[_]||{},[l]:C};try{typeof m=="function"&&m({detail:R})}catch{}};p.safe(()=>{U.addListener(e,E,y)})}}}catch{}}else if(m==null)e.removeAttribute(d);else{const v=n?.isCustomElement??r?.isCustomElement??!1;if(v||d in e)try{e[d]=m,d==="disabled"&&m===!1&&!v&&V(e)&&e.removeAttribute("disabled")}catch{}else m===!1&&e.removeAttribute(d)}}for(const[d,b]of Object.entries(o.listeners||{})){U.addListener(e,d,b);try{const m=e&&e.parentElement;m&&m!==e&&U.addListener(m,d,b)}catch{}}const c=r.attrs??{},g=a;for(const d in{...c,...g}){const b=c[d],m=g[d];let L=b,w=m;if(p.isReactiveState(b)&&(L=b.value),p.isReactiveState(m)&&(w=m.value),L!==w)if(k=!0,w==null||w===!1)p.safe(()=>{e.removeAttribute(d)}),d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?p.safe(()=>{e.value=""}):e instanceof HTMLSelectElement?p.safe(()=>{e.value=""}):e instanceof HTMLProgressElement&&p.safe(()=>{e.value=0})),d==="checked"&&e instanceof HTMLInputElement&&p.safe(()=>{e.checked=!1}),d==="disabled"&&V(e)&&p.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){p.safe(()=>{e.value=w??""});continue}else if(e instanceof HTMLSelectElement){p.safe(()=>{e.value=w??""});continue}else if(e instanceof HTMLProgressElement){p.safe(()=>{e.value=Number(w)});continue}}if(d==="checked"&&e instanceof HTMLInputElement){p.safe(()=>{e.checked=!!w});continue}if(d==="style"){const _=p.safeSerializeAttr(w);_!==null&&e.setAttribute(d,_);continue}if(d==="disabled"&&V(e)){p.safe(()=>{const _=ae(w);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=_)}),ae(w)?p.safe(()=>{e.setAttribute(d,"")}):p.safe(()=>{e.removeAttribute(d)});continue}const v=e.namespaceURI==="http://www.w3.org/2000/svg";if(S&&!v&&d.includes("-"))if(p.isClassLikeAttr(d)){const _=p.safeSerializeAttr(m??w);if(_!==null)try{e.setAttribute(d,_)}catch{}}else{const _=p.toCamel(d);try{const T=e;T[_]=p.isReactiveState(m)?m:w}catch{const T=p.safeSerializeAttr(m??w);T!==null&&e.setAttribute(d,T)}}else if(!v&&d in e)try{const _=e;_[d]=p.isReactiveState(m)?m:w}catch{const _=p.safeSerializeAttr(w);_!==null&&e.setAttribute(d,_)}else{const _=p.safeSerializeAttr(w);_!==null&&e.setAttribute(d,_)}}}try{if(V(e)){const d=i.disabled;let b;try{const L=Object.prototype.hasOwnProperty.call(o.props||{},"disabled"),w=d&&typeof d=="object"&&"value"in d;let v=!1;p.safe(()=>{v=!!p.isReactiveState(d)});const _=Re(d);v||w||L||_?b=d:b=a.disabled}catch{b=a.disabled}const m=ae(b);p.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=m)}),m?p.safe(()=>{e.setAttribute("disabled","")}):p.safe(()=>{e.removeAttribute("disabled")})}}catch{}if(S&&k){const d=e;p.safe(()=>{d._applyProps?.(d._cfg)}),p.safe(()=>{typeof d.requestRender=="function"?d.requestRender():typeof d._render=="function"&&d._render?.(d._cfg)})}}function K(e,r,n){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const c=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&z(c,e.key),c}if(e.tag==="#raw"){const c=typeof e.children=="string"?e.children:"";return document.createRange().createContextualFragment(c)}if(e.tag==="#anchor"){const c=e,g=Array.isArray(c.children)?c.children:[],d=document.createTextNode(""),b=document.createTextNode("");c.key!=null&&(z(d,`${c.key}:start`),z(b,`${c.key}:end`)),c._startNode=d,c._endNode=b;const m=document.createDocumentFragment();m.appendChild(d);for(const L of g){const w=K(L,r);if(c.key!=null&&w instanceof Element&&!w.hasAttribute("data-anchor-key")){const v=L;v&&typeof v=="object"&&v.key!=null||z(w,String(c.key))}m.appendChild(w)}return m.appendChild(b),m}const t=document.createElement(e.tag);e.key!=null&&z(t,e.key),e.props&&e.props?._transitionGroup&&lt(t,e.props?._transitionGroup);const{props:s={},attrs:o={},directives:i={}}=e.props??{},a=Ue(i,r,t,o),f={...s,...a.props},u={...o,...a.attrs};try{const c=(u&&u.class)??(f&&f.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class),g=p.safeSerializeAttr(c);if(g!==null){const d=String(g).trim();d&&t.setAttribute("class",d)}}catch{}try{if(f.disabled!==void 0&&t&&V(t)){const c=f.disabled,g=c&&typeof c=="object"&&"value"in c;let d=!1;try{d=p.isReactiveState(c)}catch{d=!1}!g&&!d&&p.safe(()=>{u.disabled=c,delete f.disabled})}}catch{}const S=t.namespaceURI==="http://www.w3.org/2000/svg";for(const c in u){const g=u[c];if(typeof c!="string"||/\[object Object\]/.test(c))continue;const d=Oe(g);if(typeof d=="boolean")d?t.setAttribute(c,""):p.safe(()=>{t.removeAttribute(c)});else if(d!=null){if(c==="disabled"&&V(t)){const b=f.disabled,m=Re(b)?b:d,L=ae(m);p.safe(()=>{t.disabled=L}),L?p.safe(()=>{t.setAttribute(c,"")}):p.safe(()=>{t.removeAttribute(c)});continue}if(!S&&c==="value"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLProgressElement))try{t instanceof HTMLProgressElement?t.value=Number(d):t.value=String(d??"")}catch{const b=p.safeSerializeAttr(d);b!==null&&t.setAttribute(c,b)}else if(!S&&c==="checked"&&t instanceof HTMLInputElement)try{t.checked=!!d}catch{const b=p.safeSerializeAttr(d);b!==null&&t.setAttribute(c,b)}else if(!S&&c in t)try{t[c]=d,c==="disabled"&&d===!1&&V(t)&&t.removeAttribute("disabled")}catch{const b=p.safeSerializeAttr(d);b!==null&&t.setAttribute(c,b)}else if((e.props?.isCustomElement??!1)&&!S&&c.includes("-")){const m=p.toCamel(c);try{t[m]=d}catch{const L=p.safeSerializeAttr(d);L!==null&&t.setAttribute(c,L)}}else{const m=p.safeSerializeAttr(d);m!==null&&t.setAttribute(c,m)}}}for(const c in f){const g=f[c];if(!(typeof c!="string"||/\[object Object\]/.test(c)))if(c==="value"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)){const d=typeof g=="object"&&g!==null&&oe(g)?g.value:g;p.safe(()=>{t.value=String(d??"")})}else if(c.startsWith("on")&&typeof g=="function"){const d=Fe(c),b=d.includes(":")?(()=>{const m=d.split(":"),L=m[1];if(L.includes("-")){const w=L.split("-").map((v,_)=>_===0?v:v.charAt(0).toUpperCase()+v.slice(1)).join("");return`${m[0]}:${w}`}else{const w=L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${m[0]}:${w}`}})():d;a.listeners&&(a.listeners[d]||a.listeners[b])||U.addListener(t,d,g)}else{if(c.startsWith("on")&&g===void 0)continue;if(g==null||g===!1)t.removeAttribute(c);else{const d=e.props?.isCustomElement??!1,b=typeof g=="object"&&g!==null&&p.isReactiveState(g)?g:oe(g)&&typeof g.value<"u"?g.value:g;if(c==="class"||c==="style"){try{const m=p.safeSerializeAttr(b);m!==null&&t.setAttribute(c,m)}catch{}continue}if(d||c in t)try{const m=typeof g=="object"&&g!==null&&p.isReactiveState(g)?g:oe(g)?g.value:g;if(c==="disabled"&&V(t)){const L=f.disabled!==void 0?f.disabled:m,w=ae(L);p.safe(()=>{t.disabled=w}),w?p.safe(()=>{t.setAttribute(c,"")}):p.safe(()=>{t.removeAttribute(c)});continue}try{if(typeof t[c]=="boolean"){let w=m;typeof m=="string"?m==="false"?w=!1:m==="true"?w=!0:w=!!m&&m!=="":w=!!m,t[c]=w}else t[c]=m}catch{t[c]=m}}catch{}}}}for(const[c,g]of Object.entries(a.listeners||{}))U.addListener(t,c,g);const k={...e,props:{...e.props,...a.props}};he(k,t,n);try{const c=t;if(typeof c._applyProps=="function")try{c._applyProps(c._cfg)}catch{}typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render(c._cfg)}catch{}if(Array.isArray(e.children))for(const c of e.children)t.appendChild(K(c,r,n));else typeof e.children=="string"&&(t.textContent=e.children);try{if(t instanceof HTMLSelectElement&&u&&Object.prototype.hasOwnProperty.call(u,"value"))try{t.value=String(u.value??"")}catch{}}catch{}try{if(V(t)){const c=f.disabled,g=u.disabled,d=c&&typeof c=="object"&&"value"in c;let b=!1;try{b=!!p.isReactiveState(c)}catch{b=!1}const L=b||d||Re(c)?c:g,w=ae(L);p.safe(()=>{t.disabled=w}),w?p.safe(()=>{t.setAttribute("disabled","")}):p.safe(()=>{t.removeAttribute("disabled")})}}catch{}return t}function mt(e,r,n,t,s){if(typeof n=="string"){e.textContent!==n&&(e.textContent=n);return}if(!Array.isArray(n))return;const o=e.childNodes,i=[];for(let b=0;b<o.length;b++)i.push(o[b]);const a=Array.isArray(r)?r:[],f=ct(e);if(f){const b=v=>{if(typeof v=="string")return v.startsWith("each-")?v.substring(5):v;if(typeof v=="number")return String(v)},m=[],L=[];for(const v of n)if(v&&v.tag==="#anchor"){const _=Array.isArray(v.children)?v.children:[];for(const T of _){const N=b(T.key??v.key??"unknown");m.push({...T,key:N})}}else v&&m.push({...v,key:b(v.key)});for(const v of a)if(v&&v.tag==="#anchor"){const _=Array.isArray(v.children)?v.children:[];for(const T of _){const N=b(T.key??v.key??"unknown");L.push({...T,key:N})}}else v&&L.push({...v,key:b(v.key)});if(m.some(v=>v&&v.key!=null)||L.some(v=>v&&v.key!=null)){const v=new Map,_=new Map;for(const y of L)if(y&&y.key!=null){const h=String(y.key);v.set(h,y)}for(let y=0;y<i.length;y++){const h=i[y];let C=ke(h);if(C=b(C),C!=null&&h instanceof Element&&h.nodeType===Node.ELEMENT_NODE){let P=typeof C=="string"&&C.includes(":")?C.substring(0,C.lastIndexOf(":")):C;P=String(P),_.set(P,h)}}const T=new Set,N=new Map,O=i.length>0;if(f.moveClass&&O)for(let y=0;y<i.length;y++){const h=i[y];if(h instanceof HTMLElement&&h.parentElement){const C=h.getBoundingClientRect();N.set(h,C)}}const l=[];for(const y of m){let h=y.key;if(h==null)continue;h=String(h);const C=v.get(h);let P=_.get(h);if(P&&C){const R=ye(P,C,y,t);T.add(P);const A=String(h);z(R,A),l.push({node:R,key:h,newVNode:y,oldVNode:C,isNew:!1})}else{P=K(y,t),z(P,String(h)),e.appendChild(P);const R=O||f.appear===!0;P instanceof HTMLElement&&R&&pe(P,f).catch(A=>{j.devError("Enter transition error:",A)}),l.push({node:P,key:h,newVNode:y,isNew:!0})}}const E=[];for(let y=0;y<i.length;y++){const h=i[y],C=ke(h);if(!T.has(h)&&C!=null&&h instanceof HTMLElement){const R=Te(h,f).then(()=>{e.contains(h)&&e.removeChild(h)}).catch(A=>{j.devError("Leave transition error:",A),e.contains(h)&&e.removeChild(h)});E.push(R)}}if(E.length===0){let y=e.firstChild;for(const{node:h}of l)h!==y&&e.insertBefore(h,y),y=h.nextSibling;if(f.moveClass&&N.size>0){const h=[];for(const{node:C,isNew:P}of l)if(!P&&C instanceof HTMLElement){const R=N.get(C);if(R){const A=C.getBoundingClientRect(),x=R.left-A.left,$=R.top-A.top;if(x!==0||$!==0){const q=f.moveClass.split(/\s+/).filter(B=>B);h.push({node:C,deltaX:x,deltaY:$,moveClasses:q})}}}if(h.length>0){for(const{node:C,deltaX:P,deltaY:R}of h)C.style.transform=`translate(${P}px, ${R}px)`,C.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:C,moveClasses:P}of h)for(const R of P)C.classList.add(R);requestAnimationFrame(()=>{const C=f.moveClass||"",P=C.match(/duration-(\d+)/),R=P?`${P[1]}ms`:"300ms",A=C.match(/ease-(out|in|in-out|linear)/),x=A?`ease-${A[1]}`:"ease-out";for(const{node:$}of h)$.style.transition=`transform ${R} ${x}`;requestAnimationFrame(()=>{for(const{node:$,moveClasses:q}of h){$.style.removeProperty("transform");const B=()=>{for(const H of q)$.classList.remove(H);$.style.removeProperty("transition"),$.removeEventListener("transitionend",B),$.removeEventListener("transitioncancel",B)};$.addEventListener("transitionend",B,{once:!0}),$.addEventListener("transitioncancel",B,{once:!0})}})})})})}}}return}}const u=new Map;for(const b of a)b&&b.key!=null&&u.set(b.key,b);const S=new Map;for(let b=0;b<i.length;b++){const m=i[b],L=ke(m);L!=null&&S.set(L,m)}const k=new Set;let c=e.firstChild;function g(b,m){let L=b;for(;L&&(k.add(L),L!==m);)L=L.nextSibling}function d(b,m,L,w,v,_=!0){const T=[];let N=b.nextSibling;for(;N&&N!==m;)T.push(N),N=N.nextSibling;const O=Array.isArray(L)?L:[];if(w.some(E=>E&&E.key!=null)||O.some(E=>E&&E.key!=null)){const E=new Map,y=new Map;for(const R of O)R&&R.key!=null&&E.set(R.key,R);for(const R of T){const A=ke(R);A!=null&&y.set(A,R)}const h=v&&v.state==="visible"&&O.length===0&&w.length>0,C=new Set;let P=b.nextSibling;for(const R of w){let A;if(R.key!=null&&y.has(R.key)){const x=E.get(R.key);A=ye(y.get(R.key),x,R,t),C.add(A),v&&A instanceof HTMLElement&&h&&v.appear&&pe(A,v).catch($=>{j.devError("Transition enter error (appear):",$)}),A!==P&&e.contains(A)&&e.insertBefore(A,P)}else A=K(R,t),e.insertBefore(A,P),C.add(A),v&&A instanceof HTMLElement&&_&&pe(A,v).catch(x=>{j.devError("Transition enter error:",x)});P=A.nextSibling}for(const R of T)!C.has(R)&&e.contains(R)&&(v&&R instanceof HTMLElement&&_?Te(R,v).then(()=>{e.contains(R)&&e.removeChild(R)}).catch(A=>{j.devError("Transition leave error:",A),e.contains(R)&&e.removeChild(R)}):e.removeChild(R))}else{const E=Math.min(O.length,w.length);for(let y=0;y<E;y++){const h=O[y],C=w[y],P=ye(T[y],h,C,t);P!==T[y]&&(e.insertBefore(P,T[y]),e.removeChild(T[y]))}for(let y=E;y<w.length;y++){const h=K(w[y],t);e.insertBefore(h,m),v&&h instanceof HTMLElement&&_&&pe(h,v).catch(C=>{j.devError("Transition enter error:",C)})}for(let y=E;y<T.length;y++){const h=T[y];v&&h instanceof HTMLElement&&_?Te(h,v).then(()=>{e.contains(h)&&e.removeChild(h)}).catch(C=>{j.devError("Transition leave error:",C),e.contains(h)&&e.removeChild(h)}):e.removeChild(h)}}}for(const b of n){let m;if(b.tag==="#anchor"){const L=b.key,w=`${L}:start`,v=`${L}:end`;let _=S.get(w),T=S.get(v);const N=Array.isArray(b.children)?b.children:[];if(_||(_=document.createTextNode(""),z(_,w)),T||(T=document.createTextNode(""),z(T,v)),b._startNode=_,b._endNode=T,!e.contains(_)||!e.contains(T)){e.insertBefore(_,c);const O=b._transition,E=!(O&&O.state==="visible"&&N.length>0)||O.appear;for(const y of N){const h=K(y,t);e.insertBefore(h,c),O&&h instanceof HTMLElement&&E&&pe(h,O).catch(C=>{j.devError("Transition enter error:",C)})}e.insertBefore(T,c)}else{const O=b._transition,E=u.get(L)._transition,y=E&&E.state!==O?.state,h=O&&O.state==="visible"&&N.length>0&&!y,C=y||!h||O?.appear===!0;d(_,T,u.get(L)?.children,N,O,C)}g(_,T),c=T.nextSibling;continue}if(b.key!=null&&S.has(b.key)){const L=u.get(b.key);m=ye(S.get(b.key),L,b,t,s),k.add(m),m!==c&&e.contains(m)&&(c&&!e.contains(c)&&(c=null),e.insertBefore(m,c))}else m=K(b,t,s),c&&!e.contains(c)&&(c=null),e.insertBefore(m,c),k.add(m);c=m.nextSibling}for(let b=0;b<i.length;b++){const m=i[b];!k.has(m)&&e.contains(m)&&(ne(m,s),e.removeChild(m))}}function ye(e,r,n,t,s){if(r&&typeof r!="string"&&r.props?.ref&&s&&ne(e,s),r===n)return e;if(typeof n=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==n&&(e.textContent=n),e;{const i=document.createTextNode(n);return e.parentNode?.replaceChild(i,e),i}}if(n&&typeof n!="string"&&n.tag==="#anchor"){const i=n,a=Array.isArray(i.children)?i.children:[],f=i._startNode??document.createTextNode(""),u=i._endNode??document.createTextNode("");i.key!=null&&(z(f,`${i.key}:start`),z(u,`${i.key}:end`)),i._startNode=f,i._endNode=u;const S=document.createDocumentFragment();S.appendChild(f);for(const k of a){const c=K(k,t);S.appendChild(c)}return S.appendChild(u),e.parentNode?.replaceChild(S,e),f}if(!n){ne(e,s);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!r||typeof r=="string"){ne(e,s);const i=K(n,t,s);return he(n,i,s),e.parentNode?.replaceChild(i,e),i}if(n.tag==="#anchor"){const i=Array.isArray(n.children)?n.children:[],a=n._startNode??document.createTextNode(""),f=n._endNode??document.createTextNode("");n.key!=null&&(z(a,`${n.key}:start`),z(f,`${n.key}:end`)),n._startNode=a,n._endNode=f;const u=document.createDocumentFragment();u.appendChild(a);for(const S of i)u.appendChild(K(S,t));return u.appendChild(f),e.parentNode?.replaceChild(u,e),a}if(typeof r!="string"&&typeof n!="string"&&r.tag===n.tag&&r.key===n.key){const i=e;return Ie(i,r.props||{},n.props||{},t),mt(i,r.children,n.children,t,s),he(n,i,s),i}if(typeof r!="string"&&typeof n!="string"&&r.tag===n.tag&&(r.tag&&String(r.tag).includes("-")||n.props&&n.props.isCustomElement||r.props&&r.props.isCustomElement))try{const a=e;return Ie(a,r.props||{},n.props||{},t),he(n,a,s),a}catch{}ne(e,s);const o=K(n,t,s);return he(n,o,s),e.parentNode?.replaceChild(o,e),o}function gt(e,r,n,t){let s;Array.isArray(r)?r.length===1?(s=r[0],s&&typeof s=="object"&&s.key==null&&(s={...s,key:"__root__"})):s={tag:"div",key:"__root__",children:r}:(s=r,s&&typeof s=="object"&&s.key==null&&(s={...s,key:"__root__"})),s&&typeof s=="object"&&s.tag==="#anchor"&&(s={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[s]}),s=Pe(s,String(s.key??"root"));const o=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;o&&i?typeof o!="string"&&typeof s!="string"&&o.tag===s.tag&&o.key===s.key?a=ye(i,o,s,n,t):(a=K(s,n,t),e.replaceChild(a,i)):(a=K(s,n,t),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const f=[];for(let u=0;u<e.childNodes.length;u++){const S=e.childNodes[u];S!==a&&S.nodeName!=="STYLE"&&(ne(S,t),f.push(S))}f.forEach(u=>e.removeChild(u)),e._prevVNode=s,e._prevDom=a}const me=[];function bt(e,r,n,t,s,o,i,a){if(e){me.push(n);try{const f=r.render(n);if(f instanceof Promise){o(!0),f.then(u=>{o(!1),i(null),We(e,u,n,t,s),a(e.innerHTML)}).catch(u=>{o(!1),i(u)});return}We(e,f,n,t,s),a(e.innerHTML)}finally{me.pop()}}}function We(e,r,n,t,s){e&&(gt(e,Array.isArray(r)?r:[r],n,t),s(e.innerHTML))}function vt(e,r,n,t,s,o,i){if(o!==null&&clearTimeout(o),Date.now()-r<16){if(s(n+1),n===15)j.devWarn(`⚠️ Component is re-rendering rapidly. This might indicate:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./helpers-D3UjNfYY.cjs"),j=require("./logger-CqdBMdui.cjs"),Y=require("./transitions-BO7bCYYx.cjs");function Je(e,r,n){if(n)for(const[t,s]of Object.entries(n)){let o,i={};if(Array.isArray(s)?(o=s[0],i=s[1]||{}):o=s,r.set(t,{callback:o,options:i,oldValue:p.getNestedValue(e,t)}),i.immediate)try{const a=p.getNestedValue(e,t);o(a,void 0,e)}catch(a){j.devError(`Error in immediate watcher for "${t}":`,a)}}}function Ye(e,r,n,t){const s=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((c,g)=>s(c,a[g]));const f=i,u=a,_=Object.keys(f||{}),S=Object.keys(u||{});return _.length!==S.length?!1:_.every(c=>s(f[c],u[c]))},o=r.get(n);if(o&&!s(t,o.oldValue))try{o.callback(t,o.oldValue,e),o.oldValue=t}catch(i){j.devError(`Error in watcher for "${n}":`,i)}for(const[i,a]of r.entries())if(a.options.deep&&n.startsWith(i+"."))try{const f=p.getNestedValue(e,i);s(f,a.oldValue)||(a.callback(f,a.oldValue,e),a.oldValue=f)}catch(f){j.devError(`Error in deep watcher for "${i}":`,f)}}function Ae(e,r){return r===Boolean?e===""||e==="true":r===Number?Number(e):e}function Xe(e,r,n){if(r)for(const t in r){const s=r[t],o=p.toKebab(t),i=e.getAttribute(o);if(s.type===Function&&typeof e[t]=="function")n[t]=e[t];else if(i!==null)n[t]=Ae(i,s.type);else if(typeof e[t]<"u")try{const a=e[t];if(s.type===String&&a&&typeof a=="object")try{n[t]=Ae(String(a),s.type)}catch{n[t]=a}else s.type===Boolean&&typeof a=="boolean"||s.type===Number&&typeof a=="number"||s.type===Function&&typeof a=="function"?n[t]=a:n[t]=Ae(String(a),s.type)}catch{n[t]=e[t]}else"default"in s&&s.default!==void 0&&(n[t]=s.default)}}function Qe(e,r,n){if(!r.props){try{const t=n?._hookCallbacks?.props||{},s=Array.from(new Set([...Object.keys(e||{}),...Object.keys(t||{})]));for(const o of s){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(n,o);if(!(!Object.prototype.hasOwnProperty.call(t,o)&&i&&(i.get||i.set||!i.configurable)))try{Object.defineProperty(n,o,{enumerable:!0,configurable:!0,get(){try{const f=p.toKebab(o),u=e.getAttribute(f);if(u!==null)return u;const _=e[o];let S;return p.isReactiveState(_)||_&&typeof _=="object"&&"value"in _&&!(_ instanceof Node)?S=_.value:S=_,S}catch{return e[o]}}})}catch{}}}catch{}return}Xe(e,r.props,n)}function et(e,r,n,t){e.onConnected&&!n&&(e.onConnected(r),t(!0))}function tt(e,r,n,t,s,o,i,a){e.onDisconnected&&e.onDisconnected(r),n.forEach(f=>f()),t(),s(),o(!1),i(null),a(!1)}function nt(e,r,n,t,s){e.onAttributeChanged&&e.onAttributeChanged(r,n,t,s)}class rt{static cache=new Map;static maxCacheSize=1e3;static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i,/setTimeout/i,/setInterval/i,/fetch/i,/XMLHttpRequest/i];static evaluate(r,n){const t=this.cache.get(r);if(t){if(!t.isSecure){j.devWarn("Blocked cached dangerous expression:",r);return}try{this.cache.delete(r),this.cache.set(r,t)}catch{}return t.evaluator(n)}const s=this.createEvaluator(r);if(this.cache.size>=this.maxCacheSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}if(this.cache.set(r,s),!s.isSecure){j.devWarn("Blocked dangerous expression:",r);return}return s.evaluator(n)}static createEvaluator(r){if(this.hasDangerousPatterns(r))return{evaluator:()=>{},isSecure:!1};if(r.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(r),isSecure:!0}}catch(n){return j.devWarn("Failed to create evaluator for expression:",r,n),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(r){return this.dangerousPatterns.some(n=>n.test(r))}static createSafeEvaluator(r){const n=r.trim();if(n.startsWith("{")&&n.endsWith("}"))return this.createObjectEvaluator(r);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(r.trim())){const t=r.trim().slice(4);return s=>p.getNestedValue(s,t)}return r.includes("ctx")||/[+\-*/%<>=&|?:[\]]/.test(r)?this.createSimpleEvaluator(r):t=>p.getNestedValue(t,r)}static createObjectEvaluator(r){const n=r.trim().slice(1,-1),t=this.parseObjectProperties(n);return s=>{const o={};for(const{key:i,value:a}of t)try{if(a.startsWith("ctx.")){const f=a.slice(4);o[i]=p.getNestedValue(s,f)}else o[i]=this.evaluateSimpleValue(a,s)}catch{o[i]=void 0}return o}}static parseObjectProperties(r){const n=[],t=r.split(",");for(const s of t){const o=s.indexOf(":");if(o===-1)continue;const i=s.slice(0,o).trim(),a=s.slice(o+1).trim(),f=i.replace(/^['"]|['"]$/g,"");n.push({key:f,value:a})}return n}static createSimpleEvaluator(r){return n=>{try{let t=r;const s=[];t=t.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,S=>`<<#${s.push(S)-1}#>>`);const o=t.match(/ctx\.[\w.]+/g)||[];for(const S of o){const c=S.slice(4),g=p.getNestedValue(n,c);if(g===void 0)return;const d=s.push(JSON.stringify(g))-1;t=t.replace(new RegExp(S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`)}const i=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=t.match(i)||[];for(const S of a){if(S.startsWith("ctx."))continue;const c=p.getNestedValue(n,S);if(c===void 0)return;const g=s.push(JSON.stringify(c))-1;t=t.replace(new RegExp(S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${g}#>>`)}const f=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let u;const _=new Set;for(;(u=f.exec(t))!==null;){const S=u[1];if(["true","false","null","undefined"].includes(S)||/^[0-9]+$/.test(S)||S==="ctx"||_.has(S))continue;_.add(S);const c=p.getNestedValue(n,S);if(c===void 0)return;const g=JSON.stringify(c),d=s.push(g)-1;S.includes(".")?t=t.replace(new RegExp(S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`):t=t.replace(new RegExp("\\b"+S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${d}#>>`)}t=t.replace(/<<#(\d+)#>>/g,(S,c)=>s[Number(c)]);try{return this.evaluateBasicExpression(t)}catch{return}}catch{return}}}static evaluateBasicExpression(r){const n=this.tokenize(r);let t=0;function s(){return n[t]}function o(l){const E=n[t++];if(l&&!E)throw new Error(`Unexpected token EOF, expected ${l}`);if(l&&E&&E.type!==l&&E.value!==l)throw new Error(`Unexpected token ${E.type}/${E.value}, expected ${l}`);return E}function i(){return d()}function a(l){if(typeof l=="number")return l;if(l==null)return NaN;if(typeof l=="boolean")return l?1:0;const E=Number(l);return Number.isNaN(E)?NaN:E}function f(l,E){return typeof l=="string"||typeof E=="string"?String(l)+String(E):a(l)+a(E)}function u(l,E){return a(l)-a(E)}function _(l,E){return a(l)*a(E)}function S(l,E){return a(l)/a(E)}function c(l,E){return a(l)%a(E)}function g(l,E,y){if(typeof E=="number"&&typeof y=="number")switch(l){case">":return E>y;case"<":return E<y;case">=":return E>=y;case"<=":return E<=y;default:return!1}const h=String(E),C=String(y);switch(l){case">":return h>C;case"<":return h<C;case">=":return h>=C;case"<=":return h<=C;default:return!1}}function d(){const l=b(),E=s();if(E&&E.value==="?"){o("?");const y=i();o(":");const h=i();return l?y:h}return l}function b(){let l=m();for(;;){const E=s();if(!E||E.value!=="||")break;o("OP");const y=m();l=l||y}return l}function m(){let l=L();for(;;){const E=s();if(!E||E.value!=="&&")break;o("OP");const y=L();l=l&&y}return l}function L(){let l=w();for(;;){const E=s();if(!E||!["==","!=","===","!=="].includes(E.value))break;const y=o("OP").value,h=w();switch(y){case"==":l=l==h;break;case"!=":l=l!=h;break;case"===":l=l===h;break;case"!==":l=l!==h;break}}return l}function w(){let l=v();for(;;){const E=s();if(!E||![">","<",">=","<="].includes(E.value))break;const y=o("OP").value,h=v();switch(y){case">":l=g(">",l,h);break;case"<":l=g("<",l,h);break;case">=":l=g(">=",l,h);break;case"<=":l=g("<=",l,h);break}}return l}function v(){let l=k();for(;;){const E=s();if(!E||E.value!=="+"&&E.value!=="-")break;const y=o("OP").value,h=k();l=y==="+"?f(l,h):u(l,h)}return l}function k(){let l=T();for(;;){const E=s();if(!E||E.value!=="*"&&E.value!=="/"&&E.value!=="%")break;const y=o("OP").value,h=T();switch(y){case"*":l=_(l,h);break;case"/":l=S(l,h);break;case"%":l=c(l,h);break}}return l}function T(){const l=s();if(l&&l.value==="!")return o("OP"),!T();if(l&&l.value==="-"){o("OP");const E=T();return u(0,E)}return N()}function N(){const l=s();if(l){if(l.type==="NUMBER")return o("NUMBER"),Number(l.value);if(l.type==="STRING")return o("STRING"),l.value.slice(1,-1);if(l.type==="IDENT")return o("IDENT"),l.value==="true"?!0:l.value==="false"?!1:l.value==="null"?null:void 0;if(l.value==="["){o("PUNC");const E=[];for(;;){const y=s();if(!y||y.value==="]")break;E.push(i());const h=s();h&&h.value===","&&o("PUNC")}return o("PUNC"),E}if(l.value==="("){o("PUNC");const E=i();return o("PUNC"),E}throw new Error("Unexpected token in expression")}}return i()}static tokenize(r){const n=[],t=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let s;for(;(s=t.exec(r))!==null;){const o=s[1];o&&(/^\d/.test(o)?n.push({type:"NUMBER",value:o}):/^"/.test(o)||/^'/.test(o)?n.push({type:"STRING",value:o}):/^[a-zA-Z_]/.test(o)?n.push({type:"IDENT",value:o}):/^[()?:,[\]]$/.test(o)?n.push({type:"PUNC",value:o}):n.push({type:"OP",value:o}))}return n}static evaluateSimpleValue(r,n){if(r==="true")return!0;if(r==="false")return!1;if(!isNaN(Number(r)))return Number(r);if(r.startsWith("ctx.")){const t=r.slice(4);return p.getNestedValue(n,t)}return r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class U{static cleanupFunctions=new WeakMap;static addListener(r,n,t,s){r.addEventListener(n,t,s);const i={event:n,handler:t,wrapper:t,options:s,cleanup:()=>r.removeEventListener(n,t,s),addedAt:Date.now()};this.cleanupFunctions.has(r)||this.cleanupFunctions.set(r,[]);const a=this.cleanupFunctions.get(r);a.push(i),a.__metaList=a}static removeListener(r,n,t,s){r.removeEventListener(n,t,s);const o=this.cleanupFunctions.get(r);if(o)for(let i=0;i<o.length;i++){const a=o[i];if(a.event===n&&a.handler===t){o.splice(i,1),o.length===0&&this.cleanupFunctions.delete(r);return}}}static cleanup(r){const n=this.cleanupFunctions.get(r);n&&(n.forEach(t=>{try{t.cleanup()}catch{}}),this.cleanupFunctions.delete(r))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(r){const n=this.cleanupFunctions.get(r);return!!(n&&n.length>0)}static getListenerCount(r){const n=this.cleanupFunctions.get(r);return n?n.length:0}static getListenerInfo(r){const n=this.cleanupFunctions.get(r);return n?n.map(t=>({event:t.event,handler:t.handler,wrapper:t.wrapper,options:t.options})):[]}}function Se(e,r){return Array.isArray(e)&&Array.isArray(r)?JSON.stringify([...e].sort())!==JSON.stringify([...r].sort()):e!==r}function He(e,r,n,t,s){if(e){const o=r.value;if(s&&typeof o=="object"&&o!==null){const i={...o};i[s]=n,r.value=i}else r.value=n}else{const o=t._state||t;p.setNestedValue(o,r,n)}}function _e(e,r,n,t){if(typeof e._requestRender=="function"&&e._requestRender(),typeof e._triggerWatchers=="function"){const s=r?"reactiveState":n;e._triggerWatchers(s,t)}}function st(e,r,n){const t=`update:${p.toKebab(r)}`,s=`update:${r}`,o=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}),i=new CustomEvent(s,{detail:n,bubbles:!0,cancelable:!0});e.dispatchEvent(o),e.dispatchEvent(i)}function xe(e,r,n,t){const s=n;if(p.safe(()=>{if(typeof e.setAttribute=="function")try{e[r]=s}catch{}else e[r]=s}),s==null||typeof s=="string"||typeof s=="number"||typeof s=="boolean"){const o=p.safeSerializeAttr(s);o!==null?p.safe(()=>{typeof e.setAttribute=="function"&&e.setAttribute(p.toKebab(r),o)}):p.safe(()=>{typeof e.removeAttribute=="function"&&e.removeAttribute(p.toKebab(r))})}}function it(e,r,n,t){if(e){const s=r.value;return t&&typeof s=="object"&&s!==null?s[t]:s}else{const s=n._state||n;return p.getNestedValue(s,r)}}function se(e){return e?e.split(/\s+/).filter(Boolean):[]}function ie(e,r){if(r.length===0)return;const n=r.filter(t=>t&&!e.classList.contains(t));n.length>0&&e.classList.add(...n)}function re(e,r){if(r.length===0)return;const n=r.filter(Boolean);n.length>0&&e.classList.remove(...n)}let we=!1;async function ot(e,r,n=10){if(!we){if(!e.isConnected){j.devWarn("⚠️ Element not connected to DOM, skipping style wait");return}for(let t=0;t<n;t++){const s=window.getComputedStyle(e),o=s.transform&&s.transform!=="",i=s.opacity&&s.opacity!=="";if(o||i){we=!0;return}await new Promise(a=>requestAnimationFrame(()=>a(void 0)))}we=!0,j.devWarn("⚠️ Styles did not load in time for transition, continuing anyway")}}function at(e){const r=window.getComputedStyle(e),n=r.transitionDuration||"0s",t=r.transitionDelay||"0s",s=o=>{const i=parseFloat(o);return o.includes("ms")?i:i*1e3};return s(n)+s(t)}function ze(e,r){return new Promise(n=>{const t=r??at(e);if(t<=0){n();return}let s=!1;const o=()=>{s||(s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",i),n())},i=()=>o();e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",i),setTimeout(o,t+50)})}async function pe(e,r){const{classes:n,hooks:t,css:s,duration:o}=r;if(t?.onBeforeEnter)try{t.onBeforeEnter(e)}catch(d){j.devError("Transition onBeforeEnter error:",d)}if(!s)return t?.onEnter?new Promise(d=>{const b=t.onEnter;typeof b=="function"?b(e,()=>{if(t?.onAfterEnter)try{t.onAfterEnter(e)}catch(m){j.devError("Transition onAfterEnter error:",m)}d()}):d()}):void 0;const i=se(n?.enterFrom),a=se(n?.enterActive),f=se(n?.enterTo);ie(e,i),e.offsetHeight,ie(e,a),e.offsetHeight;let u;if(t?.onEnter){const d=new Promise(b=>{u=b});try{const b=t.onEnter;typeof b=="function"&&b(e,()=>{u&&u()})}catch(b){j.devError("Transition onEnter error:",b)}u&&await d}await new Promise(d=>requestAnimationFrame(()=>d(void 0))),e.offsetHeight;const _=window.getComputedStyle(e),S=_.transform,c=_.opacity;re(e,i),S&&S!=="none"&&(e.style.transform=S),c&&c!==""&&(e.style.opacity=c),e.offsetHeight,await new Promise(d=>requestAnimationFrame(()=>d(void 0))),e.style.transform="",e.style.opacity="",ie(e,f),e.offsetHeight,await new Promise(d=>requestAnimationFrame(()=>d(void 0)));let g;if(typeof o=="number"?g=o:o&&typeof o=="object"&&"enter"in o&&(g=o.enter),await ze(e,g),re(e,a),t?.onAfterEnter)try{t.onAfterEnter(e)}catch(d){j.devError("Transition onAfterEnter error:",d)}}async function Te(e,r){const{classes:n,hooks:t,css:s,duration:o}=r;if(t?.onBeforeLeave)try{t.onBeforeLeave(e)}catch(S){j.devError("Transition onBeforeLeave error:",S)}if(!s)return t?.onLeave?new Promise(S=>{const c=t.onLeave;typeof c=="function"?c(e,()=>{if(t?.onAfterLeave)try{t.onAfterLeave(e)}catch(g){j.devError("Transition onAfterLeave error:",g)}S()}):S()}):void 0;const i=se(n?.leaveFrom),a=se(n?.leaveActive),f=se(n?.leaveTo);ie(e,i),e.offsetHeight,ie(e,a);let u;if(t?.onLeave){const S=new Promise(c=>{u=c});try{const c=t.onLeave;typeof c=="function"&&c(e,()=>{u&&u()})}catch(c){j.devError("Transition onLeave error:",c)}u&&await S}await new Promise(S=>requestAnimationFrame(()=>S(void 0))),await ot(e,[...i,...a]),re(e,i),ie(e,f);let _;if(typeof o=="number"?_=o:o&&typeof o=="object"&&"leave"in o&&(_=o.leave),await ze(e,_),re(e,a),re(e,f),re(e,i),t?.onAfterLeave)try{t.onAfterLeave(e)}catch(S){j.devError("Transition onAfterLeave error:",S)}}const Ke=new WeakMap,Ve=new WeakMap;function ke(e){if(!e)return;const r=Ke.get(e);if(r!==void 0)return r;try{const n=e;if(n&&n.key!=null)return String(n.key)}catch{}if(e instanceof Element){const n=e.getAttribute("data-anchor-key");if(n)return n}}function z(e,r){try{Ke.set(e,r)}catch{}try{e.key=r}catch{}try{if(e instanceof Element){const n=p.safeSerializeAttr(r);n!==null&&e.setAttribute("data-anchor-key",n)}}catch{}}function ct(e){if(!e)return;const r=Ve.get(e);if(r!==void 0)return r;try{const n=e;if(n&&n._transitionGroup!=null)return n._transitionGroup}catch{}}function lt(e,r){try{Ve.set(e,r)}catch{}try{e._transitionGroup=r}catch{}}function oe(e){return e!==null&&typeof e=="object"&&"value"in e}function Oe(e){try{if(p.isReactiveState(e))return e.value}catch{}try{if(oe(e))return e.value}catch{}return e}function V(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function ae(e){return e===""?!0:typeof e=="string"?e==="false"?!1:e==="true"?!0:e!=="":e&&typeof e=="object"?p.isReactiveState(e)||"value"in e?!!e.value:!1:!!e}function ne(e,r){if(!r||!(e instanceof HTMLElement))return;U.cleanup(e);for(const t in r)r[t]===e&&delete r[t];const n=e.childNodes;for(let t=0;t<n.length;t++)ne(n[t],r)}function he(e,r,n){if(typeof e=="string")return;const t=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),s=e.props?.ref??(e.props?.props&&e.props.props.ref);if(t)try{if(p.isReactiveState(t)||typeof t=="object"&&"value"in t)t.value=r;else if(typeof t=="function")t(r);else if(typeof t=="string"&&n)try{const o=String(t);n[o]=r}catch{}}catch{}else if(s&&n)try{const o=String(s);n[o]=r}catch{}}function ft(e,r,n,t,s,o,i,a){if(!o)return;const f=r.includes("lazy"),u=r.includes("trim"),_=r.includes("number"),S=()=>{if(p.isReactiveState(e)){const k=e.value;return a&&i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement)&&typeof k=="object"&&k!==null?k[a]:k}const v=o?._state||o;return p.getNestedValue(v,e)},c=S();let g="text";i instanceof HTMLInputElement?g=t?.type||i.type||"text":i instanceof HTMLSelectElement?g="select":i instanceof HTMLTextAreaElement&&(g="textarea");const d=i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement,m=d?g==="checkbox"||g==="radio"?"checked":"value":a??"modelValue";if(g==="checkbox")if(Array.isArray(c))n[m]=c.includes(String(i?.getAttribute("value")??t?.value??""));else{const v=i?.getAttribute("true-value")??!0;n[m]=c===v}else if(g==="radio")n[m]=c===(t?.value??"");else if(g==="select")if(i&&i.hasAttribute("multiple")&&i instanceof HTMLSelectElement){const v=Array.isArray(c)?c.map(String):[];setTimeout(()=>{Array.from(i.options).forEach(k=>{k.selected=v.includes(k.value)})},0),n[m]=Array.isArray(c)?c:[]}else n[m]=c;else{!d&&p.isReactiveState(e)?n[m]=e:n[m]=c;try{const v=p.toKebab(m);t&&(t[v]=c)}catch{}}const L=f||g==="checkbox"||g==="radio"||g==="select"?"change":"input",w=v=>{if(v.isComposing||s._isComposing)return;const k=globalThis.process,T=!!k&&k.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(v.isTrusted===!1&&!T)return;const N=v.target;if(!N||N._modelUpdating)return;let O=N.value;if(g==="checkbox"){const y=S();if(Array.isArray(y)){const h=N.getAttribute("value")??"",C=Array.from(y);if(N.checked)C.includes(h)||C.push(h);else{const P=C.indexOf(h);P>-1&&C.splice(P,1)}O=C}else{const h=N.getAttribute("true-value")??!0,C=N.getAttribute("false-value")??!1;O=N.checked?h:C}}else if(g==="radio")O=N.getAttribute("value")??N.value;else if(g==="select"&&N.multiple)O=Array.from(N.selectedOptions).map(y=>y.value);else if(u&&typeof O=="string"&&(O=O.trim()),_){const y=Number(O);isNaN(y)||(O=y)}const l=S();if(Se(O,l)){N._modelUpdating=!0;try{He(p.isReactiveState(e),e,O,o,a),_e(o,p.isReactiveState(e),e,O),N&&st(N,m,O)}finally{setTimeout(()=>N._modelUpdating=!1,0)}}};if(d){if(s[L]){const v=s[L];i&&U.removeListener(i,L,v)}s[L]=w}else{const v=`update:${p.toKebab(m)}`,k=`update:${m}`;if(s[v]){const T=s[v];i&&U.removeListener(i,v,T)}if(s[k]){const T=s[k];i&&U.removeListener(i,k,T)}if(s[v]=T=>{const N=T.detail;let O=N!==void 0?N:void 0;if(O===void 0){const y=T.target;if(y&&typeof y=="object"&&"value"in y)try{O=y.value}catch{O=void 0}}const l=it(p.isReactiveState(e),e,o,a);if(Se(O,l)){He(p.isReactiveState(e),e,O,o,a),_e(o,p.isReactiveState(e),e,O);const y=T.target;y&&xe(y,m,p.isReactiveState(e)?e:O,p.isReactiveState(e))}},p.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let T=[];try{T=Reflect.ownKeys(e.value)}catch{T=Object.keys(e.value)}const N=T.filter(O=>typeof O=="string"&&!String(O).startsWith("_")&&O!=="constructor");for(const O of N){const l=String(O),E=`update:${p.toKebab(l)}`,y=`update:${l}`;s[E]||(s[E]=h=>{const C=h.detail!==void 0?h.detail:h.target?.value,P=p.isReactiveState(e)?e.value[l]:p.getNestedValue(o?._state||o,e);if(!Se(C,P))return;if(p.isReactiveState(e)){const x={...e.value};x[l]=C,e.value=x}else p.setNestedValue(o?._state||o,e,C);_e(o,p.isReactiveState(e),e,C);const A=h.currentTarget||i||h.target;A&&xe(A,m,p.isReactiveState(e)?e:C,p.isReactiveState(e))},s[y]=s[E])}}s[k]=s[v]}(g==="text"||g==="textarea")&&(s.compositionstart=()=>s._isComposing=!0,s.compositionend=v=>{s._isComposing=!1;const k=v.target;k&&setTimeout(()=>{const T=k.value,N=o?._state||o,O=p.getNestedValue(N,e);let l=T;if(u&&(l=l.trim()),_){const y=Number(l);isNaN(y)||(l=y)}if(Se(l,O)){k._modelUpdating=!0;try{p.setNestedValue(N,e,l),_e(o,p.isReactiveState(e),e,l)}finally{setTimeout(()=>k._modelUpdating=!1,0)}}},0)})}function Fe(e){const r=e.slice(2);return r?r.charAt(0).toLowerCase()+r.slice(1):""}function ut(e,r,n,t,s){if(typeof e=="object"&&e!==null)for(const[o,i]of Object.entries(e))if(o.startsWith("data-")||o.startsWith("aria-")||o==="class")n[o]=i;else if(o==="disabled"&&s&&V(s)){const a=i&&typeof i=="object"&&"value"in i;(()=>{try{return p.isReactiveState(i)}catch{return!1}})()||a?r[o]=i:n[o]=i}else r[o]=i;else if(typeof e=="string"){if(!t)return;try{const o=be(e,t);if(typeof o=="object"&&o!==null){for(const[i,a]of Object.entries(o))if(i.startsWith("data-")||i.startsWith("aria-")||i==="class")n[i]=a;else if(i==="disabled"&&s&&V(s)){const f=a&&typeof a=="object"&&"value"in a;(()=>{try{return p.isReactiveState(a)}catch{return!1}})()||f?r[i]=a:n[i]=a}else r[i]=a;return}else{n[e]=o;return}}catch{const o=p.getNestedValue(t,e);n[e]=o}}}function dt(e,r,n){let t;if(typeof e=="string"){if(!n)return;t=be(e,n)}else t=e;const s=String(r.style||"");let o=s;if(t){if(s){const i=String(s).split(";").map(f=>f.trim()).filter(Boolean),a=i.findIndex(f=>f.startsWith("display:"));a>=0&&i[a]==="display: none"&&(i.splice(a,1),o=i.length>0?i.join("; ")+";":"")}}else if(s){const i=String(s).split(";").filter(Boolean),a=i.findIndex(f=>f.trim().startsWith("display:"));a>=0?i[a]="display: none":i.push("display: none"),o=i.join("; ")}else o="display: none";o!==s&&(o?r.style=o:delete r.style)}function be(e,r){return rt.evaluate(e,r)}function pt(e,r,n){let t;if(typeof e=="string"){if(!n)return;t=be(e,n)}else t=e;try{if(t&&typeof t=="object"){if(p.isReactiveState(t))t=t.value;else if("value"in t&&typeof t.value<"u"){const a=t.value;a instanceof Node||(t=a)}}}catch{}let s=[];if(typeof t=="string")s=[t];else if(Array.isArray(t))s=t.filter(Boolean);else if(typeof t=="object"&&t!==null)for(const[a,f]of Object.entries(t))f&&s.push(a);const o=r.class||"",i=s.join(" ");r.class=o?`${o} ${i}`.trim():i}function Re(e){if(e===!0||e===!1)return!0;if(e==null)return!1;if(typeof e==="string")return e===""||e==="true"||e==="false";try{if(e&&typeof e=="object"&&"value"in e){const n=e.value,t=typeof n;return t==="boolean"?!0:t==="string"?n===""||n==="true"||n==="false":!1}}catch{}return!1}function ht(e,r,n){let t;if(typeof e=="string"){if(!n)return;t=be(e,n)}else t=e;let s="";if(typeof t=="string")s=t;else if(t&&typeof t=="object"){const i=[];for(const[a,f]of Object.entries(t))if(f!=null&&f!==""){const u=a.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`),_=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let S=String(f);typeof f=="number"&&_.includes(u)&&(S=`${f}px`),i.push(`${u}: ${S}`)}s=i.join("; ")+(i.length>0?";":"")}const o=String(r.style||"");r.style=o+(o&&!o.endsWith(";")?"; ":"")+s}function yt(e,r,n){let t=e;typeof e=="string"&&n&&(t=be(e,n)),p.isReactiveState(t)?r.reactiveRef=t:r.ref=t}function Ue(e,r,n,t){const s={},o={...t||{}},i={};for(const[a,f]of Object.entries(e)){const{value:u,modifiers:_,arg:S}=f;if(a==="model"||a.startsWith("model:")){const c=a.split(":"),g=c.length>1?c[1]:S;ft(u,_,s,o,i,r,n,g);continue}switch(a){case"bind":ut(u,s,o,r,n);break;case"show":dt(u,o,r);break;case"class":pt(u,o,r);break;case"style":ht(u,o,r);break;case"ref":yt(u,s,r);break}}try{if(Object.prototype.hasOwnProperty.call(s,"disabled")&&n&&V(n)){const f=s.disabled,u=f&&typeof f=="object"&&"value"in f;let _=!1;try{_=p.isReactiveState(f)}catch{_=!1}if(!u&&!_)try{o.disabled=f,delete s.disabled;const S=globalThis;S.__VDOM_DISABLED_PROMOTIONS||(S.__VDOM_DISABLED_PROMOTIONS=[]),S.__VDOM_DISABLED_PROMOTIONS.push({phase:"bind-directive:postfix-move",location:"attrs",key:"disabled",value:f,time:Date.now(),stack:new Error().stack})}catch{}}}catch{}return{props:s,attrs:o,listeners:i}}function Pe(e,r){if(Array.isArray(e)){const o=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const S=i.tag||"node",g=[i.props?.attrs?.id,i.props?.attrs?.name,i.props?.attrs?.["data-key"],i.props?.props?.id,i.props?.props?.name,i.props?.props?.dataKey,i.props?.props?.["data-key"]].find(d=>d!=null)??"";a=g?`${r}:${S}:${g}`:`${r}:${S}`}let f=a,u=1;for(;o.has(f);)f=`${a}#${u++}`;o.add(f);let _=i.children;return Array.isArray(_)&&(_=Pe(_,f)),{...i,key:f,children:_}})}const n=e,t=n.props?.key??n.key??r;let s=n.children;return Array.isArray(s)&&(s=Pe(s,t)),{...n,key:t,children:s}}function Ie(e,r,n,t){const s=n.directives??{},o=Ue(s,t,e,n.attrs),i={...r.props||{},...n.props||{},...o.props||{}},a={...r.attrs||{},...n.attrs||{},...o.attrs||{}},f=r.props??{},u=i,_=!!(n?.isCustomElement??r?.isCustomElement??!1);let S=!1;for(const d in{...f,...u}){const b=f[d],m=u[d];let L=b,w=m;if(p.safe(()=>{(p.isReactiveState(b)||oe(b))&&(L=b.value)}),p.safe(()=>{(p.isReactiveState(m)||oe(m))&&(w=m.value)}),!(b===m&&L===w))if(S=!0,d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const v=Oe(m),k=v==null?"":String(v);e.value!==k&&(e.value=k)}else if(d==="checked"&&e instanceof HTMLInputElement){const v=Oe(m);e.checked=!!v}else if(d.startsWith("on")&&typeof m=="function"){const v=Fe(d);typeof b=="function"&&U.removeListener(e,v,b),typeof m=="function"&&U.addListener(e,v,m);try{if(v&&v.startsWith("update:")){const k=v.split(":",2)[1],T=u[k];let N=[];try{if(p.isReactiveState(T)){const l=T.value;N=l&&typeof l=="object"?Object.keys(l):[]}else T&&typeof T=="object"&&(N=Object.keys(T))}catch{N=[]}const O=N.filter(l=>typeof l=="string"&&!l.startsWith("_")&&l!=="constructor");for(const l of O){const E=`update:${l}`,y=h=>{const C=h.detail!==void 0?h.detail:h.target instanceof HTMLInputElement||h.target instanceof HTMLTextAreaElement||h.target instanceof HTMLSelectElement?h.target.value:void 0,R={...p.isReactiveState(T)?T.value||{}:u[k]||{},[l]:C};try{typeof m=="function"&&m({detail:R})}catch{}};p.safe(()=>{U.addListener(e,E,y)})}}}catch{}}else if(m==null)e.removeAttribute(d);else{const v=n?.isCustomElement??r?.isCustomElement??!1;if(v||d in e)try{e[d]=m,d==="disabled"&&m===!1&&!v&&V(e)&&e.removeAttribute("disabled")}catch{}else m===!1&&e.removeAttribute(d)}}for(const[d,b]of Object.entries(o.listeners||{})){U.addListener(e,d,b);try{const m=e&&e.parentElement;m&&m!==e&&U.addListener(m,d,b)}catch{}}const c=r.attrs??{},g=a;for(const d in{...c,...g}){const b=c[d],m=g[d];let L=b,w=m;if(p.isReactiveState(b)&&(L=b.value),p.isReactiveState(m)&&(w=m.value),L!==w)if(S=!0,w==null||w===!1)p.safe(()=>{e.removeAttribute(d)}),d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?p.safe(()=>{e.value=""}):e instanceof HTMLSelectElement?p.safe(()=>{e.value=""}):e instanceof HTMLProgressElement&&p.safe(()=>{e.value=0})),d==="checked"&&e instanceof HTMLInputElement&&p.safe(()=>{e.checked=!1}),d==="disabled"&&V(e)&&p.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){p.safe(()=>{e.value=w??""});continue}else if(e instanceof HTMLSelectElement){p.safe(()=>{e.value=w??""});continue}else if(e instanceof HTMLProgressElement){p.safe(()=>{e.value=Number(w)});continue}}if(d==="checked"&&e instanceof HTMLInputElement){p.safe(()=>{e.checked=!!w});continue}if(d==="style"){const k=p.safeSerializeAttr(w);k!==null&&e.setAttribute(d,k);continue}if(d==="disabled"&&V(e)){p.safe(()=>{const k=ae(w);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=k)}),ae(w)?p.safe(()=>{e.setAttribute(d,"")}):p.safe(()=>{e.removeAttribute(d)});continue}const v=e.namespaceURI==="http://www.w3.org/2000/svg";if(_&&!v&&d.includes("-"))if(p.isClassLikeAttr(d)){const k=p.safeSerializeAttr(m??w);if(k!==null)try{e.setAttribute(d,k)}catch{}}else{const k=p.toCamel(d);try{const T=e;T[k]=p.isReactiveState(m)?m:w}catch{const T=p.safeSerializeAttr(m??w);T!==null&&e.setAttribute(d,T)}}else if(!v&&d in e)try{const k=e;k[d]=p.isReactiveState(m)?m:w}catch{const k=p.safeSerializeAttr(w);k!==null&&e.setAttribute(d,k)}else{const k=p.safeSerializeAttr(w);k!==null&&e.setAttribute(d,k)}}}try{if(V(e)){const d=i.disabled;let b;try{const L=Object.prototype.hasOwnProperty.call(o.props||{},"disabled"),w=d&&typeof d=="object"&&"value"in d;let v=!1;p.safe(()=>{v=!!p.isReactiveState(d)});const k=Re(d);v||w||L||k?b=d:b=a.disabled}catch{b=a.disabled}const m=ae(b);p.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=m)}),m?p.safe(()=>{e.setAttribute("disabled","")}):p.safe(()=>{e.removeAttribute("disabled")})}}catch{}if(_&&S){const d=e;p.safe(()=>{d._applyProps?.(d._cfg)}),p.safe(()=>{typeof d.requestRender=="function"?d.requestRender():typeof d._render=="function"&&d._render?.(d._cfg)})}}function K(e,r,n){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const c=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&z(c,e.key),c}if(e.tag==="#raw"){const c=typeof e.children=="string"?e.children:"";return document.createRange().createContextualFragment(c)}if(e.tag==="#anchor"){const c=e,g=Array.isArray(c.children)?c.children:[],d=document.createTextNode(""),b=document.createTextNode("");c.key!=null&&(z(d,`${c.key}:start`),z(b,`${c.key}:end`)),c._startNode=d,c._endNode=b;const m=document.createDocumentFragment();m.appendChild(d);for(const L of g){const w=K(L,r);if(c.key!=null&&w instanceof Element&&!w.hasAttribute("data-anchor-key")){const v=L;v&&typeof v=="object"&&v.key!=null||z(w,String(c.key))}m.appendChild(w)}return m.appendChild(b),m}const t=document.createElement(e.tag);e.key!=null&&z(t,e.key),e.props&&e.props?._transitionGroup&&lt(t,e.props?._transitionGroup);const{props:s={},attrs:o={},directives:i={}}=e.props??{},a=Ue(i,r,t,o),f={...s,...a.props},u={...o,...a.attrs};try{const c=(u&&u.class)??(f&&f.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class),g=p.safeSerializeAttr(c);if(g!==null){const d=String(g).trim();d&&t.setAttribute("class",d)}}catch{}try{if(f.disabled!==void 0&&t&&V(t)){const c=f.disabled,g=c&&typeof c=="object"&&"value"in c;let d=!1;try{d=p.isReactiveState(c)}catch{d=!1}!g&&!d&&p.safe(()=>{u.disabled=c,delete f.disabled})}}catch{}const _=t.namespaceURI==="http://www.w3.org/2000/svg";for(const c in u){const g=u[c];if(typeof c!="string"||/\[object Object\]/.test(c))continue;const d=Oe(g);if(typeof d=="boolean")d?t.setAttribute(c,""):p.safe(()=>{t.removeAttribute(c)});else if(d!=null){if(c==="disabled"&&V(t)){const b=f.disabled,m=Re(b)?b:d,L=ae(m);p.safe(()=>{t.disabled=L}),L?p.safe(()=>{t.setAttribute(c,"")}):p.safe(()=>{t.removeAttribute(c)});continue}if(!_&&c==="value"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLProgressElement))try{t instanceof HTMLProgressElement?t.value=Number(d):t.value=String(d??"")}catch{const b=p.safeSerializeAttr(d);b!==null&&t.setAttribute(c,b)}else if(!_&&c==="checked"&&t instanceof HTMLInputElement)try{t.checked=!!d}catch{const b=p.safeSerializeAttr(d);b!==null&&t.setAttribute(c,b)}else if(!_&&c in t)try{t[c]=d,c==="disabled"&&d===!1&&V(t)&&t.removeAttribute("disabled")}catch{const b=p.safeSerializeAttr(d);b!==null&&t.setAttribute(c,b)}else if((e.props?.isCustomElement??!1)&&!_&&c.includes("-")){const m=p.toCamel(c);try{t[m]=d}catch{const L=p.safeSerializeAttr(d);L!==null&&t.setAttribute(c,L)}}else{const m=p.safeSerializeAttr(d);m!==null&&t.setAttribute(c,m)}}}for(const c in f){const g=f[c];if(!(typeof c!="string"||/\[object Object\]/.test(c)))if(c==="value"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)){const d=typeof g=="object"&&g!==null&&oe(g)?g.value:g;p.safe(()=>{t.value=String(d??"")})}else if(c.startsWith("on")&&typeof g=="function"){const d=Fe(c),b=d.includes(":")?(()=>{const m=d.split(":"),L=m[1];if(L.includes("-")){const w=L.split("-").map((v,k)=>k===0?v:v.charAt(0).toUpperCase()+v.slice(1)).join("");return`${m[0]}:${w}`}else{const w=L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${m[0]}:${w}`}})():d;a.listeners&&(a.listeners[d]||a.listeners[b])||U.addListener(t,d,g)}else{if(c.startsWith("on")&&g===void 0)continue;if(g==null||g===!1)t.removeAttribute(c);else{const d=e.props?.isCustomElement??!1,b=typeof g=="object"&&g!==null&&p.isReactiveState(g)?g:oe(g)&&typeof g.value<"u"?g.value:g;if(c==="class"||c==="style"){try{const m=p.safeSerializeAttr(b);m!==null&&t.setAttribute(c,m)}catch{}continue}if(d||c in t)try{const m=typeof g=="object"&&g!==null&&p.isReactiveState(g)?g:oe(g)?g.value:g;if(c==="disabled"&&V(t)){const L=f.disabled!==void 0?f.disabled:m,w=ae(L);p.safe(()=>{t.disabled=w}),w?p.safe(()=>{t.setAttribute(c,"")}):p.safe(()=>{t.removeAttribute(c)});continue}try{if(typeof t[c]=="boolean"){let w=m;typeof m=="string"?m==="false"?w=!1:m==="true"?w=!0:w=!!m&&m!=="":w=!!m,t[c]=w}else t[c]=m}catch{t[c]=m}}catch{}}}}for(const[c,g]of Object.entries(a.listeners||{}))U.addListener(t,c,g);const S={...e,props:{...e.props,...a.props}};he(S,t,n);try{const c=t;if(typeof c._applyProps=="function")try{c._applyProps(c._cfg)}catch{}typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render(c._cfg)}catch{}if(Array.isArray(e.children))for(const c of e.children)t.appendChild(K(c,r,n));else typeof e.children=="string"&&(t.textContent=e.children);try{if(t instanceof HTMLSelectElement&&u&&Object.prototype.hasOwnProperty.call(u,"value"))try{t.value=String(u.value??"")}catch{}}catch{}try{if(V(t)){const c=f.disabled,g=u.disabled,d=c&&typeof c=="object"&&"value"in c;let b=!1;try{b=!!p.isReactiveState(c)}catch{b=!1}const L=b||d||Re(c)?c:g,w=ae(L);p.safe(()=>{t.disabled=w}),w?p.safe(()=>{t.setAttribute("disabled","")}):p.safe(()=>{t.removeAttribute("disabled")})}}catch{}return t}function mt(e,r,n,t,s){if(typeof n=="string"){e.textContent!==n&&(e.textContent=n);return}if(!Array.isArray(n))return;const o=e.childNodes,i=[];for(let b=0;b<o.length;b++)i.push(o[b]);const a=Array.isArray(r)?r:[],f=ct(e);if(f){const b=v=>{if(typeof v=="string")return v.startsWith("each-")?v.substring(5):v;if(typeof v=="number")return String(v)},m=[],L=[];for(const v of n)if(v&&v.tag==="#anchor"){const k=Array.isArray(v.children)?v.children:[];for(const T of k){const N=b(T.key??v.key??"unknown");m.push({...T,key:N})}}else v&&m.push({...v,key:b(v.key)});for(const v of a)if(v&&v.tag==="#anchor"){const k=Array.isArray(v.children)?v.children:[];for(const T of k){const N=b(T.key??v.key??"unknown");L.push({...T,key:N})}}else v&&L.push({...v,key:b(v.key)});if(m.some(v=>v&&v.key!=null)||L.some(v=>v&&v.key!=null)){const v=new Map,k=new Map;for(const y of L)if(y&&y.key!=null){const h=String(y.key);v.set(h,y)}for(let y=0;y<i.length;y++){const h=i[y];let C=ke(h);if(C=b(C),C!=null&&h instanceof Element&&h.nodeType===Node.ELEMENT_NODE){let P=typeof C=="string"&&C.includes(":")?C.substring(0,C.lastIndexOf(":")):C;P=String(P),k.set(P,h)}}const T=new Set,N=new Map,O=i.length>0;if(f.moveClass&&O)for(let y=0;y<i.length;y++){const h=i[y];if(h instanceof HTMLElement&&h.parentElement){const C=h.getBoundingClientRect();N.set(h,C)}}const l=[];for(const y of m){let h=y.key;if(h==null)continue;h=String(h);const C=v.get(h);let P=k.get(h);if(P&&C){const R=ye(P,C,y,t);T.add(P);const A=String(h);z(R,A),l.push({node:R,key:h,newVNode:y,oldVNode:C,isNew:!1})}else{P=K(y,t),z(P,String(h)),e.appendChild(P);const R=O||f.appear===!0;P instanceof HTMLElement&&R&&pe(P,f).catch(A=>{j.devError("Enter transition error:",A)}),l.push({node:P,key:h,newVNode:y,isNew:!0})}}const E=[];for(let y=0;y<i.length;y++){const h=i[y],C=ke(h);if(!T.has(h)&&C!=null&&h instanceof HTMLElement){const R=Te(h,f).then(()=>{e.contains(h)&&e.removeChild(h)}).catch(A=>{j.devError("Leave transition error:",A),e.contains(h)&&e.removeChild(h)});E.push(R)}}if(E.length===0){let y=e.firstChild;for(const{node:h}of l)h!==y&&e.insertBefore(h,y),y=h.nextSibling;if(f.moveClass&&N.size>0){const h=[];for(const{node:C,isNew:P}of l)if(!P&&C instanceof HTMLElement){const R=N.get(C);if(R){const A=C.getBoundingClientRect(),x=R.left-A.left,$=R.top-A.top;if(x!==0||$!==0){const q=f.moveClass.split(/\s+/).filter(B=>B);h.push({node:C,deltaX:x,deltaY:$,moveClasses:q})}}}if(h.length>0){for(const{node:C,deltaX:P,deltaY:R}of h)C.style.transform=`translate(${P}px, ${R}px)`,C.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:C,moveClasses:P}of h)for(const R of P)C.classList.add(R);requestAnimationFrame(()=>{const C=f.moveClass||"",P=C.match(/duration-(\d+)/),R=P?`${P[1]}ms`:"300ms",A=C.match(/ease-(out|in|in-out|linear)/),x=A?`ease-${A[1]}`:"ease-out";for(const{node:$}of h)$.style.transition=`transform ${R} ${x}`;requestAnimationFrame(()=>{for(const{node:$,moveClasses:q}of h){$.style.removeProperty("transform");const B=()=>{for(const H of q)$.classList.remove(H);$.style.removeProperty("transition"),$.removeEventListener("transitionend",B),$.removeEventListener("transitioncancel",B)};$.addEventListener("transitionend",B,{once:!0}),$.addEventListener("transitioncancel",B,{once:!0})}})})})})}}}return}}const u=new Map;for(const b of a)b&&b.key!=null&&u.set(b.key,b);const _=new Map;for(let b=0;b<i.length;b++){const m=i[b],L=ke(m);L!=null&&_.set(L,m)}const S=new Set;let c=e.firstChild;function g(b,m){let L=b;for(;L&&(S.add(L),L!==m);)L=L.nextSibling}function d(b,m,L,w,v,k=!0){const T=[];let N=b.nextSibling;for(;N&&N!==m;)T.push(N),N=N.nextSibling;const O=Array.isArray(L)?L:[];if(w.some(E=>E&&E.key!=null)||O.some(E=>E&&E.key!=null)){const E=new Map,y=new Map;for(const R of O)R&&R.key!=null&&E.set(R.key,R);for(const R of T){const A=ke(R);A!=null&&y.set(A,R)}const h=v&&v.state==="visible"&&O.length===0&&w.length>0,C=new Set;let P=b.nextSibling;for(const R of w){let A;if(R.key!=null&&y.has(R.key)){const x=E.get(R.key);A=ye(y.get(R.key),x,R,t),C.add(A),v&&A instanceof HTMLElement&&h&&v.appear&&pe(A,v).catch($=>{j.devError("Transition enter error (appear):",$)}),A!==P&&e.contains(A)&&e.insertBefore(A,P)}else A=K(R,t),e.insertBefore(A,P),C.add(A),v&&A instanceof HTMLElement&&k&&pe(A,v).catch(x=>{j.devError("Transition enter error:",x)});P=A.nextSibling}for(const R of T)!C.has(R)&&e.contains(R)&&(v&&R instanceof HTMLElement&&k?Te(R,v).then(()=>{e.contains(R)&&e.removeChild(R)}).catch(A=>{j.devError("Transition leave error:",A),e.contains(R)&&e.removeChild(R)}):e.removeChild(R))}else{const E=Math.min(O.length,w.length);for(let y=0;y<E;y++){const h=O[y],C=w[y],P=ye(T[y],h,C,t);P!==T[y]&&(e.insertBefore(P,T[y]),e.removeChild(T[y]))}for(let y=E;y<w.length;y++){const h=K(w[y],t);e.insertBefore(h,m),v&&h instanceof HTMLElement&&k&&pe(h,v).catch(C=>{j.devError("Transition enter error:",C)})}for(let y=E;y<T.length;y++){const h=T[y];v&&h instanceof HTMLElement&&k?Te(h,v).then(()=>{e.contains(h)&&e.removeChild(h)}).catch(C=>{j.devError("Transition leave error:",C),e.contains(h)&&e.removeChild(h)}):e.removeChild(h)}}}for(const b of n){let m;if(b.tag==="#anchor"){const L=b.key,w=`${L}:start`,v=`${L}:end`;let k=_.get(w),T=_.get(v);const N=Array.isArray(b.children)?b.children:[];if(k||(k=document.createTextNode(""),z(k,w)),T||(T=document.createTextNode(""),z(T,v)),b._startNode=k,b._endNode=T,!e.contains(k)||!e.contains(T)){e.insertBefore(k,c);const O=b._transition,E=!(O&&O.state==="visible"&&N.length>0)||O.appear;for(const y of N){const h=K(y,t);e.insertBefore(h,c),O&&h instanceof HTMLElement&&E&&pe(h,O).catch(C=>{j.devError("Transition enter error:",C)})}e.insertBefore(T,c)}else{const O=b._transition,E=u.get(L)._transition,y=E&&E.state!==O?.state,h=O&&O.state==="visible"&&N.length>0&&!y,C=y||!h||O?.appear===!0;d(k,T,u.get(L)?.children,N,O,C)}g(k,T),c=T.nextSibling;continue}if(b.key!=null&&_.has(b.key)){const L=u.get(b.key);m=ye(_.get(b.key),L,b,t,s),S.add(m),m!==c&&e.contains(m)&&(c&&!e.contains(c)&&(c=null),e.insertBefore(m,c))}else m=K(b,t,s),c&&!e.contains(c)&&(c=null),e.insertBefore(m,c),S.add(m);c=m.nextSibling}for(let b=0;b<i.length;b++){const m=i[b];!S.has(m)&&e.contains(m)&&(ne(m,s),e.removeChild(m))}}function ye(e,r,n,t,s){if(r&&typeof r!="string"&&r.props?.ref&&s&&ne(e,s),r===n)return e;if(typeof n=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==n&&(e.textContent=n),e;{const i=document.createTextNode(n);return e.parentNode?.replaceChild(i,e),i}}if(n&&typeof n!="string"&&n.tag==="#anchor"){const i=n,a=Array.isArray(i.children)?i.children:[],f=i._startNode??document.createTextNode(""),u=i._endNode??document.createTextNode("");i.key!=null&&(z(f,`${i.key}:start`),z(u,`${i.key}:end`)),i._startNode=f,i._endNode=u;const _=document.createDocumentFragment();_.appendChild(f);for(const S of a){const c=K(S,t);_.appendChild(c)}return _.appendChild(u),e.parentNode?.replaceChild(_,e),f}if(!n){ne(e,s);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!r||typeof r=="string"){ne(e,s);const i=K(n,t,s);return he(n,i,s),e.parentNode?.replaceChild(i,e),i}if(n.tag==="#anchor"){const i=Array.isArray(n.children)?n.children:[],a=n._startNode??document.createTextNode(""),f=n._endNode??document.createTextNode("");n.key!=null&&(z(a,`${n.key}:start`),z(f,`${n.key}:end`)),n._startNode=a,n._endNode=f;const u=document.createDocumentFragment();u.appendChild(a);for(const _ of i)u.appendChild(K(_,t));return u.appendChild(f),e.parentNode?.replaceChild(u,e),a}if(typeof r!="string"&&typeof n!="string"&&r.tag===n.tag&&r.key===n.key){const i=e;return Ie(i,r.props||{},n.props||{},t),mt(i,r.children,n.children,t,s),he(n,i,s),i}if(typeof r!="string"&&typeof n!="string"&&r.tag===n.tag&&(r.tag&&String(r.tag).includes("-")||n.props&&n.props.isCustomElement||r.props&&r.props.isCustomElement))try{const a=e;return Ie(a,r.props||{},n.props||{},t),he(n,a,s),a}catch{}ne(e,s);const o=K(n,t,s);return he(n,o,s),e.parentNode?.replaceChild(o,e),o}function gt(e,r,n,t){let s;Array.isArray(r)?r.length===1?(s=r[0],s&&typeof s=="object"&&s.key==null&&(s={...s,key:"__root__"})):s={tag:"div",key:"__root__",children:r}:(s=r,s&&typeof s=="object"&&s.key==null&&(s={...s,key:"__root__"})),s&&typeof s=="object"&&s.tag==="#anchor"&&(s={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[s]}),s=Pe(s,String(s.key??"root"));const o=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;o&&i?typeof o!="string"&&typeof s!="string"&&o.tag===s.tag&&o.key===s.key?a=ye(i,o,s,n,t):(a=K(s,n,t),e.replaceChild(a,i)):(a=K(s,n,t),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const f=[];for(let u=0;u<e.childNodes.length;u++){const _=e.childNodes[u];_!==a&&_.nodeName!=="STYLE"&&(ne(_,t),f.push(_))}f.forEach(u=>e.removeChild(u)),e._prevVNode=s,e._prevDom=a}const me=[];function bt(e,r,n,t,s,o,i,a){if(e){me.push(n);try{const f=r.render(n);if(f instanceof Promise){o(!0),f.then(u=>{o(!1),i(null),We(e,u,n,t,s),a(e.innerHTML)}).catch(u=>{o(!1),i(u)});return}We(e,f,n,t,s),a(e.innerHTML)}finally{me.pop()}}}function We(e,r,n,t,s){e&&(gt(e,Array.isArray(r)?r:[r],n,t),s(e.innerHTML))}function vt(e,r,n,t,s,o,i){if(o!==null&&clearTimeout(o),Date.now()-r<16){if(s(n+1),n===15)j.devWarn(`⚠️ Component is re-rendering rapidly. This might indicate:
2
2
  Common causes:
3
3
  • Event handler calling a function immediately: @click="\${fn()}" should be @click="\${fn}"
4
4
  • State modification during render
@@ -6,8 +6,8 @@
6
6
  Component rendering will be throttled to prevent browser freeze.`);else if(n>20){j.devError(`🛑 Infinite loop detected in component render:
7
7
  • This might be caused by state updates during render
8
8
  • Ensure all state modifications are done in event handlers or effects
9
- Stopping runaway component render to prevent browser freeze`),i(null);return}}else s(0);const u=setTimeout(()=>{t(Date.now()),e(),i(null)},n>10?100:0);i(u)}function Et(e,r,n,t,s){if(!e)return;let o=n||"";try{if(e){const k=Array.from(e.querySelectorAll("*"));for(const c of k)try{const g=c.lastHtmlStringForJitCSS;g&&typeof g=="string"&&g.trim()&&(o+=`
9
+ Stopping runaway component render to prevent browser freeze`),i(null);return}}else s(0);const u=setTimeout(()=>{t(Date.now()),e(),i(null)},n>10?100:0);i(u)}function Et(e,r,n,t,s){if(!e)return;let o=n||"";try{if(e){const S=Array.from(e.querySelectorAll("*"));for(const c of S)try{const g=c.lastHtmlStringForJitCSS;g&&typeof g=="string"&&g.trim()&&(o+=`
10
10
  `+g)}catch{}}}catch{}const i=Y.jitCSS(o);if((!i||i.trim()==="")&&!r._computedStyle){s(null),e.adoptedStyleSheets=[Y.getBaseResetSheet(),Y.getTransitionStyleSheet()];return}let a="";r._computedStyle&&(a=r._computedStyle??"");let f=Y.sanitizeCSS(`${a}
11
11
  ${i}
12
- `);f=Y.minifyCSS(f);let u=t;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.cssRules.length>0&&Array.from(u.cssRules).map(k=>k.cssText).join("")!==f)&&u.replaceSync(f),e.adoptedStyleSheets=[Y.getBaseResetSheet(),Y.getTransitionStyleSheet(),u],s(u)}let I=null;function Be(e){I=e}function Le(){I=null}function St(){if(!I)throw new Error("useEmit must be called during component render");const e=I.emit;if(typeof e!="function")throw new Error("useEmit requires an emit function on the component context");const r=e;return(n,t,s)=>r(n,t,s)}function le(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function _t(e){if(!I)throw new Error("useOnConnected must be called during component render");le(I),I._hookCallbacks.onConnected=e}function kt(e){if(!I)throw new Error("useOnDisconnected must be called during component render");le(I),I._hookCallbacks.onDisconnected=e}function Ct(e){if(!I)throw new Error("useOnAttributeChanged must be called during component render");le(I),I._hookCallbacks.onAttributeChanged=e}function At(e){if(!I)throw new Error("useOnError must be called during component render");le(I),I._hookCallbacks.onError=r=>{try{r instanceof Error?e(r):e(new Error(String(r)))}catch{}}}function wt(e){if(!I)throw new Error("useProps must be called during component render");le(I);const r=I._hookCallbacks;r.props={...r.props||{},...e};const n=I;try{const s=Object.keys(e||{});for(const o of s){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(n,o);if(!(i&&!i.configurable))try{let f=Object.prototype.hasOwnProperty.call(n,o)?n[o]:void 0;Object.defineProperty(n,o,{configurable:!0,enumerable:!0,get(){try{const u=n&&n._host;if(u){const S=p.toKebab(o),k=u.getAttribute(S);if(k!==null){const c=typeof e[o];return c==="boolean"?k===""||k==="true":c==="number"?Number(k):k}if(typeof u[o]<"u"){const c=u[o];if(p.isReactiveState(c)||c&&typeof c=="object"&&"value"in c&&!(c instanceof Node))return c.value;const g=typeof e[o];if(!(g==="string"&&c&&typeof c=="object"))return g==="boolean"&&typeof c=="string"?c===""||c==="true":c}}}catch{}return f},set(u){f=u}})}catch{}}}catch{}return new Proxy({},{get(s,o){if(typeof o!="string")return;const i=e[o];try{const f=n&&n._host;if(f){if(f instanceof HTMLElement||typeof f.getAttribute=="function"&&typeof f.hasAttribute=="function"){const S=o.replace(/([A-Z])/g,"-$1").toLowerCase(),k=f.getAttribute(S);if(k!==null)return typeof i=="boolean"?k===""||k==="true":typeof i=="number"?Number(k):k}const u=f[o];if(typeof u<"u"&&u!==""){const S=u&&typeof u=="object"&&"value"in u&&!(u instanceof Node);if(!(typeof i=="string"&&u&&typeof u=="object"&&!S&&!p.isReactiveState(u)))return typeof i=="boolean"&&i===!1&&u===""?i:p.isReactiveState(u)||S?u.value:typeof i=="boolean"&&typeof u=="string"?u==="true"||u!==""&&u!=="false":typeof i=="number"&&typeof u=="string"&&!Number.isNaN(Number(u))?Number(u):u}}}catch{}const a=n[o];return typeof i=="boolean"&&a===""?i===!1?i:!0:p.isReactiveState(a)||a&&typeof a=="object"&&"value"in a&&!(a instanceof Node)?a.value:a!=null&&a!==""?typeof i=="boolean"&&typeof a=="string"?a==="true":typeof i=="number"&&typeof a=="string"&&!Number.isNaN(Number(a))?Number(a):a:i},has(s,o){return typeof o=="string"&&(o in n||o in e)},ownKeys(){return Array.from(new Set([...Object.keys(e),...Object.keys(n||{})]))},getOwnPropertyDescriptor(){return{configurable:!0,enumerable:!0}}})}function Tt(e){if(!I)throw new Error("useStyle must be called during component render");le(I);try{const r=e();Object.defineProperty(I,"_computedStyle",{value:r,writable:!0,enumerable:!1,configurable:!0})}catch(r){j.devWarn("Error in useStyle callback:",r),Object.defineProperty(I,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const ce=new Map,De=Symbol.for("cer.registry");function Lt(){if(typeof window<"u"){const e=globalThis;e[De]||(e[De]=ce)}}function Nt(e,r){if(!r.render)throw new Error("Component must have a render function");return typeof window>"u"?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_componentId;_styleSheet=null;_lastHtmlStringForJitCSS="";get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.attachShadow({mode:"open"}),this._cfg=ce.get(e)||r,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const n=this._initContext(r),t=(o,i,a)=>{Object.defineProperty(o,i,{value:a,writable:!1,enumerable:!1,configurable:!1})};t(n,"refs",this._refs),t(n,"requestRender",()=>this.requestRender()),t(n,"_requestRender",()=>this._requestRender()),t(n,"_componentId",this._componentId),t(n,"_triggerWatchers",(o,i)=>this._triggerWatchers(o,i)),this.context=n,p.safe(()=>{t(n,"_host",this)}),t(this.context,"emit",(o,i,a)=>{const f={detail:i,bubbles:!0,composed:!0,...a||{}},u=new CustomEvent(o,f);this.dispatchEvent(u);const S=o.indexOf(":");if(S>0){const k=o.substring(0,S),c=o.substring(S+1),g=c.includes("-")?`${k}:${c.split("-").map((d,b)=>b===0?d:d.charAt(0).toUpperCase()+d.slice(1)).join("")}`:`${k}:${c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;g!==o&&p.safe(()=>{this.dispatchEvent(new CustomEvent(g,f))})}return!u.defaultPrevented});const s=ce.get(e)||r;for(const o in s){const i=s[o];typeof i=="function"&&(this.context[o]=(...a)=>i(...a,this.context))}if(s.props)for(const o in s.props){let i=this[o];Object.defineProperty(this,o,{get(){return i},set(a){const f=i;i=a,this.context[o]=a,this._initializing||(this._applyProps(s),f!==a&&this._requestRender())},enumerable:!0,configurable:!0})}this._initializing=!1,this._initWatchers(s),this._applyProps(s),this._render(s)}connectedCallback(){this._runLogicWithinErrorBoundary(r,()=>{this._applyProps(r),this._requestRender(),et(r,this.context,this._mounted,n=>{this._mounted=n})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(r,()=>{tt(r,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},n=>{this._templateLoading=n},n=>{this._templateError=n},n=>{this._mounted=n})})}attributeChangedCallback(n,t,s){this._runLogicWithinErrorBoundary(r,()=>{this._applyProps(r),t!==s&&this._requestRender(),nt(r,n,t,s,this.context)})}static get observedAttributes(){return r.props?Object.keys(r.props).map(p.toKebab):[]}_render(n){this._runLogicWithinErrorBoundary(n,()=>{bt(this.shadowRoot,n,this.context,this._refs,t=>{this._lastHtmlStringForJitCSS=t,typeof this.onHtmlStringUpdate=="function"&&this?.onHtmlStringUpdate?.(t)},t=>{this._templateLoading=t,this?.onLoadingStateChange?.(t)},t=>{this._templateError=t,this?.onErrorStateChange?.(t)},t=>this._applyStyle(n,t))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{p.scheduleDOMUpdate(()=>{vt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,n=>{this._lastRenderTime=n},n=>{this._renderCount=n},this._renderTimeoutId,n=>{this._renderTimeoutId=n})},this._componentId)})}_applyStyle(n,t){this._runLogicWithinErrorBoundary(n,()=>{Et(this.shadowRoot,this.context,t,this._styleSheet,s=>{this._styleSheet=s})})}_runLogicWithinErrorBoundary(n,t){this._hasError&&(this._hasError=!1);try{t()}catch(s){this._hasError=!0;try{const o=this.tagName?.toLowerCase?.()||"<unknown>",i=this._componentId||"<unknown-id>",a={};if(n&&n.props)for(const f of Object.keys(n.props))try{const u=this.context[f];u instanceof Node?a[f]=`[DOM Node: ${u.nodeName}]`:typeof u=="object"&&u!==null?a[f]=Object.keys(u).length>5?`[object(${Object.keys(u).length} keys)]`:u:a[f]=u}catch{a[f]="[unreadable]"}j.devError(`Error rendering component <${o}> (id=${i}):`,s),j.devError("Component props snapshot:",a),j.devWarn("Common causes: accessing properties of null/undefined inside template interpolations; expensive or throwing expressions inside templates that evaluate eagerly. Fixes: use optional chaining (obj?.prop), guard with ternary, or use the runtime lazy overload: when(cond, () => html`...`).")}catch{}n.onError&&n.onError(s,this.context)}}_initContext(n){try{let t=function(o,i=""){if(Array.isArray(o))return new Proxy(o,{get(a,f,u){const S=Reflect.get(a,f,u);return typeof S=="function"&&typeof f=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(f)?function(...c){const g=S.apply(a,c);if(!s._initializing){const d=i||"root";s._triggerWatchers(d,a),p.scheduleDOMUpdate(()=>s._render(n),s._componentId)}return g}:S},set(a,f,u){if(a[String(f)]=u,!s._initializing){const S=i?`${i}.${String(f)}`:String(f);s._triggerWatchers(S,u),p.scheduleDOMUpdate(()=>s._render(n),s._componentId)}return!0},deleteProperty(a,f){if(delete a[String(f)],!s._initializing){const u=i?`${i}.${String(f)}`:String(f);s._triggerWatchers(u,void 0),p.scheduleDOMUpdate(()=>s._render(n),s._componentId)}return!0}});if(o&&typeof o=="object"){if(p.isReactiveState(o))return o;for(const a in o){const f=i?`${i}.${a}`:a;o[a]=t(o[a],f)}return new Proxy(o,{set(a,f,u){const S=i?`${i}.${String(f)}`:String(f);return a[String(f)]=t(u,S),s._initializing||(s._triggerWatchers(S,a[String(f)]),p.scheduleDOMUpdate(()=>s._render(n),s._componentId)),!0},get(a,f,u){return Reflect.get(a,f,u)}})}return o};const s=this;return t({...n.props?Object.fromEntries(Object.entries(n.props).map(([o,i])=>[o,i.default])):{}})}catch{return{}}}_initWatchers(n){this._runLogicWithinErrorBoundary(n,()=>{Je(this.context,this._watchers,{})})}_triggerWatchers(n,t){Ye(this.context,this._watchers,n,t)}_applyProps(n){this._runLogicWithinErrorBoundary(n,()=>{try{Qe(this,n,this.context)}catch(t){this._hasError=!0,n.onError&&n.onError(t,this.context)}})}}}function Ot(e,r){Lt();let n=p.toKebab(e);n.includes("-")||(n=`cer-${n}`);const t={},s={props:{},onConnected:()=>{t.onConnected&&t.onConnected()},onDisconnected:()=>{t.onDisconnected&&t.onDisconnected()},onAttributeChanged:(o,i,a)=>{t.onAttributeChanged&&t.onAttributeChanged(o,i,a)},onError:o=>{t.onError&&o&&t.onError(o)},render:o=>{const i=o,a=i._componentId||`${n}-${Math.random().toString(36).substr(2,9)}`;p.reactiveSystem.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{Be(o);let f;try{f=r()}catch(u){try{const S=i._hookCallbacks;if(S&&typeof S.onError=="function")try{S.onError(u)}catch{}}catch{}throw u}if(i._hookCallbacks){const u=i._hookCallbacks;if(u.onConnected&&(t.onConnected=u.onConnected),u.onDisconnected&&(t.onDisconnected=u.onDisconnected),u.onAttributeChanged&&(t.onAttributeChanged=u.onAttributeChanged),u.onError&&(t.onError=u.onError),u.style&&(i._styleCallback=u.style),u.props){const S=u.props;s.props=Object.fromEntries(Object.entries(S).map(([k,c])=>[k,{type:typeof c=="boolean"?Boolean:typeof c=="number"?Number:typeof c=="string"?String:Function,default:c}])),ce.set(n,s)}}return f}finally{Le(),p.reactiveSystem.clearCurrentComponent()}}};if(ce.set(n,s),typeof window<"u"){try{const o={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};Be(o);try{r()}catch(i){try{const a=o?._hookCallbacks;if(a&&typeof a.onError=="function")try{a.onError(i)}catch{}j.devError(`Error during component discovery render <${n}>:`,i),j.devWarn("Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().")}catch{}throw Le(),i}if(Le(),o._hookCallbacks?.props){const i=o._hookCallbacks.props;s.props=Object.fromEntries(Object.entries(i).map(([a,f])=>[a,{type:typeof f=="boolean"?Boolean:typeof f=="number"?Number:typeof f=="string"?String:Function,default:f}])),ce.set(n,s)}}catch{}customElements.get(n)||customElements.define(n,Nt(n,s))}}class Rt{map=new Map;maxSize;constructor(r){this.maxSize=r}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}set(r,n){if(this.map.delete(r),this.map.set(r,n),this.map.size>this.maxSize){const t=this.map.keys().next().value;t!==void 0&&this.map.delete(t)}}has(r){return this.map.has(r)}clear(){this.map.clear()}}const Ne=new Rt(500);function Pt(e,r){if(e==null){j.devWarn(`⚠️ Event handler for '@${r}' is ${e}. This will prevent the event from working. Use a function reference instead: @${r}="\${functionName}"`);return}typeof e!="function"&&j.devWarn(`🚨 Potential infinite loop detected! Event handler for '@${r}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${r}="\${functionName()}" to @${r}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&j.devWarn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${r}="\${fn}" not @${r}="\${fn()}"`)}function J(e,r={},n,t){const s=t??r.key;return{tag:e,key:s,props:r,children:n}}function ge(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function te(e){return typeof e=="object"&&e!==null&&"tag"in e&&!ge(e)}function Mt(e,r){return e.key!=null?e:{...e,key:r}}function $t(e,r=[],n={}){const t={},s={},o={},i=[],a=/([:@#]?)([a-zA-Z0-9-:.]+)(?:=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'))?/g;let f;for(;f=a.exec(e);){const u=f[1],S=f[2],k=(f[4]||f[6])??"",c=f[3]===void 0&&f[6]===void 0,g=k.match(/^{{(\d+)}}$/);let d=c?!0:g?r[Number(g[1])]??null:k;g||(d==="true"?d=!0:d==="false"?d=!1:d==="null"?d=null:isNaN(Number(d))||(d=Number(d)));const b=["model","bind","show","class","style","ref","when"];if(u===":"){const[m,L]=S.split(":"),[w,...v]=m.split(".");if(b.includes(w)){const _=[...v],T=w==="model"&&L?`model:${L}`:w;o[T]={value:d,modifiers:_,arg:L}}else if(S==="disabled"){let _=d;_&&p.isReactiveState(_)&&(_=_.value);const T=typeof _;if(_===""||T==="boolean"||T==="string"&&(_==="true"||_==="false")||_==null||T==="number")t[S]=_;else{let l=d;l&&p.isReactiveState(l)&&(l=l.value),s[S]=l}i.push(S)}else{let _=d;_&&p.isReactiveState(_)&&(_=_.value),s[S]=_,i.push(S)}}else if(u==="@"){const[m,...L]=S.split("."),w=L;Pt(d,m);const v=typeof d=="function"?d:typeof n[d]=="function"?n[d]:void 0;if(v){const _=N=>{if(w.includes("prevent")&&N.preventDefault(),w.includes("stop")&&N.stopPropagation(),!(w.includes("self")&&N.target!==N.currentTarget))return w.includes("once")&&N.currentTarget?.removeEventListener(m,_),v(N)},T="on"+m.charAt(0).toUpperCase()+m.slice(1);t[T]=_}}else S==="ref"?t.ref=d:s[S]=d}return{props:t,attrs:s,directives:o,bound:i}}function Me(e){if(!te(e)||ge(e))return e;const r=e.props?.directives;if(r&&r.when){const n=r.when.value,t=p.isReactiveState(n)?n.value:n,s={...r};delete s.when;const o={...e.props};Object.keys(s).length>0?o.directives=s:delete o.directives;const i={...e,props:o};return Array.isArray(i.children)&&(i.children=i.children.map(f=>typeof f=="object"&&f!==null?Me(f):f)),{tag:"#anchor",key:e.key!=null?`when-${e.key}`:`when-${e.tag}`,children:t?[i]:[]}}if(Array.isArray(e.children)){const n=e.children.map(t=>typeof t=="object"&&t!==null?Me(t):t);return{...e,children:n}}return e}function jt(e,r,n){const t=me.length>0?me[me.length-1]:void 0,s=n??t,o=!n&&r.length===0,i=o?e.join("<!--TEMPLATE_DELIM-->"):null;if(o&&i){const l=Ne.get(i);if(l)return l}function a(l,E){return J("#text",{},l,E)}function f(l,E){let y=typeof l=="string"?p.decodeEntities(l):l;return typeof y=="string"&&/[\r\n]/.test(y)&&(y=y.replace(/\s+/g," ")),J("#text",{},y,E)}let u="";for(let l=0;l<e.length;l++)u+=e[l],l<r.length&&(u+=`{{${l}}}`);const S=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,k=[];let c,g=[],d=null,b={},m,L=0;const w=[];function v(l){if(!l||typeof l!="object"||ge(l))return;const E=l,y=b;if(E.props||E.attrs){const h=E;h.props&&(y.props||(y.props={}),Object.assign(y.props,h.props)),h.attrs&&(y.attrs||(y.attrs={}),Object.keys(h.attrs).forEach(C=>{if(C==="style"&&y.attrs.style){const P=String(y.attrs.style).replace(/;?\s*$/,""),R=String(h.attrs.style).replace(/^;?\s*/,"");y.attrs.style=P+"; "+R}else if(C==="class"&&y.attrs.class){const P=String(y.attrs.class).trim().split(/\s+/).filter(Boolean),R=String(h.attrs.class).trim().split(/\s+/).filter(Boolean),A=[...new Set([...P,...R])];y.attrs.class=A.join(" ")}else y.attrs[C]=h.attrs[C]}))}else y.props||(y.props={}),Object.assign(y.props,E)}function _(l,E){const y=d?g:w;if(ge(l)){const h=l.key??E,C=l.children;y.push({...l,key:h,children:C});return}if(te(l)){y.push(Mt(l,void 0));return}if(Array.isArray(l)){if(l.length===0)return;for(let h=0;h<l.length;h++){const C=l[h];ge(C)||te(C)||Array.isArray(C)?_(C,`${E}-${h}`):C!==null&&typeof C=="object"?p.isUnsafeHTML(C)?y.push(J("#raw",{},C.__rawHTML,`${E}-${h}`)):v(C):y.push(a(String(C),`${E}-${h}`))}return}if(l!==null&&typeof l=="object"){if(p.isUnsafeHTML(l)){const h=l.__rawHTML??"";y.push(J("#raw",{},h,E));return}v(l);return}y.push(a(String(l),E))}const T=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;c=S.exec(u);)if(!(c[0].startsWith("<!--")&&c[0].endsWith("-->"))){if(c[1]){const l=c[1],E=c[0][1]==="/",y=c[0][c[0].length-2]==="/"||T.has(l),{props:h,attrs:C,directives:P,bound:R}=$t(c[2]||"",r,s??{}),A={props:{},attrs:{}};for(const x in h)A.props[x]=h[x];for(const x in C)A.attrs[x]=C[x];A.attrs&&Object.prototype.hasOwnProperty.call(A.attrs,"key")&&!(A.props&&Object.prototype.hasOwnProperty.call(A.props,"key"))&&p.safe(()=>{A.props.key=A.attrs.key});try{const x={input:["value","checked","readonly","required","placeholder","maxlength","minlength"],textarea:["value","readonly","required","placeholder","maxlength","minlength"],select:["value","required","multiple"],option:["selected","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","autofocus","form"]},$=l.toLowerCase(),q=x[$]??[];if(A.attrs){for(const H of q)if(R&&R.includes(H)&&H in A.attrs&&!(A.props&&H in A.props)){let M=A.attrs[H];if(M&&p.isReactiveState(M))M=M.value,A.props[H]=M,delete A.attrs[H];else if(M&&typeof M=="object"&&"value"in M&&!(M instanceof Node))try{const W=M.value;A.props[H]=($==="select"||$==="option")&&H==="value"?String(W):W,delete A.attrs[H]}catch{}else{const W=typeof M;if(H==="disabled")(M===""||W==="boolean"||W==="string"&&(M==="true"||M==="false")||M==null||W==="number")&&(A.props[H]=M,delete A.attrs[H]);else if(M===""||W==="string"||W==="number"||W==="boolean"||M==null){const F=($==="select"||$==="option")&&H==="value"?String(M):M;A.props[H]=F,delete A.attrs[H]}}}}if(l.includes("-")||!!s?.__customElements?.has?.(l)){if(A.isCustomElement=!0,R&&A.attrs){const H=new Set(["id","name","data-key","key"]);for(const M of R)if(M in A.attrs&&!(A.props&&M in A.props)){const W=M.includes("-")?p.toCamel(M):M,F=A.attrs[M];if(A.props[W]=F,H.has(M)||p.isClassLikeAttr(M))try{const Ee=p.safeSerializeAttr(A.attrs[M]);Ee===null?delete A.attrs[M]:A.attrs[M]=Ee}catch{delete A.attrs[M]}else delete A.attrs[M]}}try{if(A.attrs&&!(A.props&&"modelValue"in A.props)){const H=A.attrs["model-value"]??A.attrs.modelValue;typeof H<"u"&&(A.props.modelValue=H)}}catch{}}}catch{}if(P&&Object.keys(P).some(x=>x==="model"||x.startsWith("model:")))try{const x=Symbol.for("cer.registry"),$=globalThis[x],q=!!($&&typeof $.has=="function"&&$.has(l)),B=s,H=!!(B&&(B.__customElements instanceof Set&&B.__customElements.has(l)||Array.isArray(B.__isCustomElements)&&B.__isCustomElements.includes(l)));if(!!(l.includes("-")||H||q))for(const F of Object.keys(P)){if(F!=="model"&&!F.startsWith("model:"))continue;const ve=P[F],Ee=ve.arg??(F.includes(":")?F.split(":",2)[1]:void 0),D=ve.value,Ce=Ee??"modelValue",$e=p.getNestedValue,qe=p.setNestedValue,fe=s?._state||s;let Z;typeof D=="string"&&fe?Z=$e(fe,D):Z=D,A.props[Ce]=Z;try{const X=p.toKebab(Ce);A.attrs||(A.attrs={}),Z!=null&&(typeof Z=="string"||typeof Z=="number"||typeof Z=="boolean")&&(A.attrs[X]=Z)}catch{}A.isCustomElement=!0;const je=`update:${p.toKebab(Ce)}`.replace(/-([a-z])/g,(X,G)=>G.toUpperCase()),Ge="on"+je.charAt(0).toUpperCase()+je.slice(1);A.props[Ge]=function(X){const G=X.detail!==void 0?X.detail:X.target?X.target.value:void 0;if(fe)if(D&&p.isReactiveState(D)){const Q=D.value;if(Array.isArray(G)&&Array.isArray(Q)?JSON.stringify([...G].sort())!==JSON.stringify([...Q].sort()):G!==Q){D.value=G;try{const ee=s;if(ee){const ue=ee.requestRender,de=ee._requestRender;typeof ue=="function"?ue():typeof de=="function"&&de()}}catch{}}}else{const Q=$e(fe||{},typeof D=="string"?D:String(D));if(Array.isArray(G)&&Array.isArray(Q)?JSON.stringify([...G].sort())!==JSON.stringify([...Q].sort()):G!==Q){qe(fe||{},typeof D=="string"?D:String(D),G);try{const ee=s;if(ee){const ue=ee.requestRender,de=ee._requestRender;typeof ue=="function"?ue():typeof de=="function"&&de()}}catch{}}}},delete P[F]}}catch{}if(Object.keys(P).length>0&&(A.directives={...P}),E){const x=g.some(H=>typeof H=="object"&&H.tag!=="#text");let $=g;if(x&&g.length>0){let H=0;for(;H<g.length;){const W=g[H];if(!te(W)||W.tag!=="#text"||typeof W.children!="string"||W.children.trim()!=="")break;H++}let M=g.length-1;for(;M>=0;){const W=g[M];if(!te(W)||W.tag!=="#text"||typeof W.children!="string"||W.children.trim()!=="")break;M--}H===0&&M===g.length-1?$=g:H>M?$=[]:$=g.slice(H,M+1)}const q=J(d,b,$.length===1&&te($[0])&&$[0].tag==="#text"?typeof $[0].children=="string"?$[0].children:"":$.length?$:void 0,m),B=k.pop();B?(d=B.tag,b=B.props,m=B.key,g=B.children,g.push(q)):(w.push(q),d=null,b={},m=void 0,g=[])}else y?d?g.push(J(l,A,void 0,void 0)):w.push(J(l,A,void 0,void 0)):(d&&k.push({tag:d,props:b,children:g,key:m}),d=l,b=A,g=[])}else if(typeof c[3]<"u"){const l=Number(c[3]),E=r[l],y=`interp-${l}`;_(E,y)}else if(c[4]){const l=c[4],E=d?g:w,y=l.split(/({{\d+}})/);for(const h of y){if(!h)continue;const C=h.match(/^{{(\d+)}}$/);if(C){const P=Number(C[1]),R=r[P],A=`interp-${P}`;_(R,A)}else{const P=`text-${L++}`;E.push(f(h,P))}}}}const O=w.filter(l=>te(l)&&l.tag==="#text"?typeof l.children=="string"&&l.children.trim()!=="":!0).map(l=>Me(l));if(O.length===1){const l=O[0];return o&&i&&Ne.set(i,l),l}else if(O.length>1){const l=O;return o&&i&&Ne.set(i,l),l}return J("div",{},"","fallback-root")}function Ht(e,...r){const n=r[r.length-1],t=typeof n=="object"&&n&&!Array.isArray(n)?n:void 0;return jt(e,r,t)}exports.computed=p.computed;exports.decodeEntities=p.decodeEntities;exports.ref=p.ref;exports.unsafeHTML=p.unsafeHTML;exports.watch=p.watch;exports.css=Y.css;exports.component=Ot;exports.html=Ht;exports.useEmit=St;exports.useOnAttributeChanged=Ct;exports.useOnConnected=_t;exports.useOnDisconnected=kt;exports.useOnError=At;exports.useProps=wt;exports.useStyle=Tt;
12
+ `);f=Y.minifyCSS(f);let u=t;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.cssRules.length>0&&Array.from(u.cssRules).map(S=>S.cssText).join("")!==f)&&u.replaceSync(f),e.adoptedStyleSheets=[Y.getBaseResetSheet(),Y.getTransitionStyleSheet(),u],s(u)}let I=null;function Be(e){I=e}function Le(){I=null}function St(){if(!I)throw new Error("useEmit must be called during component render");const e=I.emit;if(typeof e!="function")throw new Error("useEmit requires an emit function on the component context");const r=e;return(n,t,s)=>r(n,t,s)}function le(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function _t(e){if(!I)throw new Error("useOnConnected must be called during component render");le(I),I._hookCallbacks.onConnected=e}function kt(e){if(!I)throw new Error("useOnDisconnected must be called during component render");le(I),I._hookCallbacks.onDisconnected=e}function Ct(e){if(!I)throw new Error("useOnAttributeChanged must be called during component render");le(I),I._hookCallbacks.onAttributeChanged=e}function At(e){if(!I)throw new Error("useOnError must be called during component render");le(I),I._hookCallbacks.onError=r=>{try{r instanceof Error?e(r):e(new Error(String(r)))}catch{}}}function wt(e){if(!I)throw new Error("useProps must be called during component render");le(I);const r=I._hookCallbacks;r.props={...r.props||{},...e};const n=I;try{const s=Object.keys(e||{});for(const o of s){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(n,o);if(!(i&&!i.configurable))try{let f=Object.prototype.hasOwnProperty.call(n,o)?n[o]:void 0;Object.defineProperty(n,o,{configurable:!0,enumerable:!0,get(){try{const u=n&&n._host;if(u){const _=p.toKebab(o),S=u.getAttribute(_);if(S!==null){const c=typeof e[o];return c==="boolean"?S===""||S==="true":c==="number"?Number(S):S}if(typeof u[o]<"u"){const c=u[o];if(p.isReactiveState(c)||c&&typeof c=="object"&&"value"in c&&!(c instanceof Node))return c.value;const g=typeof e[o];if(!(g==="string"&&c&&typeof c=="object"))return g==="boolean"&&typeof c=="string"?c===""||c==="true":c}}}catch{}return f},set(u){f=u}})}catch{}}}catch{}return new Proxy({},{get(s,o){if(typeof o!="string")return;const i=e[o];try{const f=n&&n._host;if(f){if(f instanceof HTMLElement||typeof f.getAttribute=="function"&&typeof f.hasAttribute=="function"){const _=o.replace(/([A-Z])/g,"-$1").toLowerCase(),S=f.getAttribute(_);if(S!==null)return typeof i=="boolean"?S===""||S==="true":typeof i=="number"?Number(S):S}const u=f[o];if(typeof u<"u"&&u!==""){const _=u&&typeof u=="object"&&"value"in u&&!(u instanceof Node);if(!(typeof i=="string"&&u&&typeof u=="object"&&!_&&!p.isReactiveState(u)))return typeof i=="boolean"&&i===!1&&u===""?i:p.isReactiveState(u)||_?u.value:typeof i=="boolean"&&typeof u=="string"?u==="true"||u!==""&&u!=="false":typeof i=="number"&&typeof u=="string"&&!Number.isNaN(Number(u))?Number(u):u}}}catch{}const a=n[o];return typeof i=="boolean"&&a===""?i===!1?i:!0:p.isReactiveState(a)||a&&typeof a=="object"&&"value"in a&&!(a instanceof Node)?a.value:a!=null&&a!==""?typeof i=="boolean"&&typeof a=="string"?a==="true":typeof i=="number"&&typeof a=="string"&&!Number.isNaN(Number(a))?Number(a):a:i},has(s,o){return typeof o=="string"&&(o in n||o in e)},ownKeys(){return Array.from(new Set([...Object.keys(e),...Object.keys(n||{})]))},getOwnPropertyDescriptor(){return{configurable:!0,enumerable:!0}}})}function Tt(e){if(!I)throw new Error("useStyle must be called during component render");le(I);try{const r=e();Object.defineProperty(I,"_computedStyle",{value:r,writable:!0,enumerable:!1,configurable:!0})}catch(r){j.devWarn("Error in useStyle callback:",r),Object.defineProperty(I,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const ce=new Map,De=Symbol.for("cer.registry");function Lt(){if(typeof window<"u"){const e=globalThis;e[De]||(e[De]=ce)}}function Nt(e,r){if(!r.render)throw new Error("Component must have a render function");return typeof window>"u"?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_componentId;_styleSheet=null;_lastHtmlStringForJitCSS="";get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.attachShadow({mode:"open"}),this._cfg=ce.get(e)||r,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const n=this._initContext(r),t=(o,i,a)=>{Object.defineProperty(o,i,{value:a,writable:!1,enumerable:!1,configurable:!1})};t(n,"refs",this._refs),t(n,"requestRender",()=>this.requestRender()),t(n,"_requestRender",()=>this._requestRender()),t(n,"_componentId",this._componentId),t(n,"_triggerWatchers",(o,i)=>this._triggerWatchers(o,i)),this.context=n,p.safe(()=>{t(n,"_host",this)}),t(this.context,"emit",(o,i,a)=>{const f={detail:i,bubbles:!0,composed:!0,...a||{}},u=new CustomEvent(o,f);this.dispatchEvent(u);const _=o.indexOf(":");if(_>0){const S=o.substring(0,_),c=o.substring(_+1),g=c.includes("-")?`${S}:${c.split("-").map((d,b)=>b===0?d:d.charAt(0).toUpperCase()+d.slice(1)).join("")}`:`${S}:${c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;g!==o&&p.safe(()=>{this.dispatchEvent(new CustomEvent(g,f))})}return!u.defaultPrevented});const s=ce.get(e)||r;for(const o in s){const i=s[o];typeof i=="function"&&(this.context[o]=(...a)=>i(...a,this.context))}if(s.props)for(const o in s.props){let i=this[o];Object.defineProperty(this,o,{get(){return i},set(a){const f=i;i=a,this.context[o]=a,this._initializing||(this._applyProps(s),f!==a&&this._requestRender())},enumerable:!0,configurable:!0})}this._initializing=!1,this._initWatchers(s),this._applyProps(s),this._render(s)}connectedCallback(){this._runLogicWithinErrorBoundary(r,()=>{this._applyProps(r),this._requestRender(),et(r,this.context,this._mounted,n=>{this._mounted=n})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(r,()=>{tt(r,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},n=>{this._templateLoading=n},n=>{this._templateError=n},n=>{this._mounted=n})})}attributeChangedCallback(n,t,s){this._runLogicWithinErrorBoundary(r,()=>{this._applyProps(r),t!==s&&this._requestRender(),nt(r,n,t,s,this.context)})}static get observedAttributes(){return r.props?Object.keys(r.props).map(p.toKebab):[]}_render(n){this._runLogicWithinErrorBoundary(n,()=>{bt(this.shadowRoot,n,this.context,this._refs,t=>{this._lastHtmlStringForJitCSS=t,typeof this.onHtmlStringUpdate=="function"&&this?.onHtmlStringUpdate?.(t)},t=>{this._templateLoading=t,this?.onLoadingStateChange?.(t)},t=>{this._templateError=t,this?.onErrorStateChange?.(t)},t=>this._applyStyle(n,t))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{p.scheduleDOMUpdate(()=>{vt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,n=>{this._lastRenderTime=n},n=>{this._renderCount=n},this._renderTimeoutId,n=>{this._renderTimeoutId=n})},this._componentId)})}_applyStyle(n,t){this._runLogicWithinErrorBoundary(n,()=>{Et(this.shadowRoot,this.context,t,this._styleSheet,s=>{this._styleSheet=s})})}_runLogicWithinErrorBoundary(n,t){this._hasError&&(this._hasError=!1);try{t()}catch(s){this._hasError=!0;try{const o=this.tagName?.toLowerCase?.()||"<unknown>",i=this._componentId||"<unknown-id>",a={};if(n&&n.props)for(const f of Object.keys(n.props))try{const u=this.context[f];u instanceof Node?a[f]=`[DOM Node: ${u.nodeName}]`:typeof u=="object"&&u!==null?a[f]=Object.keys(u).length>5?`[object(${Object.keys(u).length} keys)]`:u:a[f]=u}catch{a[f]="[unreadable]"}j.devError(`Error rendering component <${o}> (id=${i}):`,s),j.devError("Component props snapshot:",a),j.devWarn("Common causes: accessing properties of null/undefined inside template interpolations; expensive or throwing expressions inside templates that evaluate eagerly. Fixes: use optional chaining (obj?.prop), guard with ternary, or use the runtime lazy overload: when(cond, () => html`...`).")}catch{}n.onError&&n.onError(s,this.context)}}_initContext(n){try{let t=function(o,i=""){if(Array.isArray(o))return new Proxy(o,{get(a,f,u){const _=Reflect.get(a,f,u);return typeof _=="function"&&typeof f=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(f)?function(...c){const g=_.apply(a,c);if(!s._initializing){const d=i||"root";s._triggerWatchers(d,a),p.scheduleDOMUpdate(()=>s._render(n),s._componentId)}return g}:_},set(a,f,u){if(a[String(f)]=u,!s._initializing){const _=i?`${i}.${String(f)}`:String(f);s._triggerWatchers(_,u),p.scheduleDOMUpdate(()=>s._render(n),s._componentId)}return!0},deleteProperty(a,f){if(delete a[String(f)],!s._initializing){const u=i?`${i}.${String(f)}`:String(f);s._triggerWatchers(u,void 0),p.scheduleDOMUpdate(()=>s._render(n),s._componentId)}return!0}});if(o&&typeof o=="object"){if(p.isReactiveState(o))return o;for(const a in o){const f=i?`${i}.${a}`:a;o[a]=t(o[a],f)}return new Proxy(o,{set(a,f,u){const _=i?`${i}.${String(f)}`:String(f);return a[String(f)]=t(u,_),s._initializing||(s._triggerWatchers(_,a[String(f)]),p.scheduleDOMUpdate(()=>s._render(n),s._componentId)),!0},get(a,f,u){return Reflect.get(a,f,u)}})}return o};const s=this;return t({...n.props?Object.fromEntries(Object.entries(n.props).map(([o,i])=>[o,i.default])):{}})}catch{return{}}}_initWatchers(n){this._runLogicWithinErrorBoundary(n,()=>{Je(this.context,this._watchers,{})})}_triggerWatchers(n,t){Ye(this.context,this._watchers,n,t)}_applyProps(n){this._runLogicWithinErrorBoundary(n,()=>{try{Qe(this,n,this.context)}catch(t){this._hasError=!0,n.onError&&n.onError(t,this.context)}})}}}function Ot(e,r){Lt();let n=p.toKebab(e);n.includes("-")||(n=`cer-${n}`);const t={},s={props:{},onConnected:()=>{t.onConnected&&t.onConnected()},onDisconnected:()=>{t.onDisconnected&&t.onDisconnected()},onAttributeChanged:(o,i,a)=>{t.onAttributeChanged&&t.onAttributeChanged(o,i,a)},onError:o=>{t.onError&&o&&t.onError(o)},render:o=>{const i=o,a=i._componentId||`${n}-${Math.random().toString(36).substr(2,9)}`;p.reactiveSystem.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{Be(o);let f;try{f=r()}catch(u){try{const _=i._hookCallbacks;if(_&&typeof _.onError=="function")try{_.onError(u)}catch{}}catch{}throw u}if(i._hookCallbacks){const u=i._hookCallbacks;if(u.onConnected&&(t.onConnected=u.onConnected),u.onDisconnected&&(t.onDisconnected=u.onDisconnected),u.onAttributeChanged&&(t.onAttributeChanged=u.onAttributeChanged),u.onError&&(t.onError=u.onError),u.style&&(i._styleCallback=u.style),u.props){const _=u.props;s.props=Object.fromEntries(Object.entries(_).map(([S,c])=>[S,{type:typeof c=="boolean"?Boolean:typeof c=="number"?Number:typeof c=="string"?String:Function,default:c}])),ce.set(n,s)}}return f}finally{Le(),p.reactiveSystem.clearCurrentComponent()}}};if(ce.set(n,s),typeof window<"u"){try{const o={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};Be(o);try{r()}catch(i){try{const a=o?._hookCallbacks;if(a&&typeof a.onError=="function")try{a.onError(i)}catch{}j.devError(`Error during component discovery render <${n}>:`,i),j.devWarn("Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().")}catch{}throw Le(),i}if(Le(),o._hookCallbacks?.props){const i=o._hookCallbacks.props;s.props=Object.fromEntries(Object.entries(i).map(([a,f])=>[a,{type:typeof f=="boolean"?Boolean:typeof f=="number"?Number:typeof f=="string"?String:Function,default:f}])),ce.set(n,s)}}catch{}customElements.get(n)||customElements.define(n,Nt(n,s))}}class Rt{map=new Map;maxSize;constructor(r){this.maxSize=r}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}set(r,n){if(this.map.delete(r),this.map.set(r,n),this.map.size>this.maxSize){const t=this.map.keys().next().value;t!==void 0&&this.map.delete(t)}}has(r){return this.map.has(r)}clear(){this.map.clear()}}const Ne=new Rt(500);function Pt(e,r){if(e==null){j.devWarn(`⚠️ Event handler for '@${r}' is ${e}. This will prevent the event from working. Use a function reference instead: @${r}="\${functionName}"`);return}typeof e!="function"&&j.devWarn(`🚨 Potential infinite loop detected! Event handler for '@${r}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${r}="\${functionName()}" to @${r}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&j.devWarn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${r}="\${fn}" not @${r}="\${fn()}"`)}function J(e,r={},n,t){const s=t??r.key;return{tag:e,key:s,props:r,children:n}}function ge(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function te(e){return typeof e=="object"&&e!==null&&"tag"in e&&!ge(e)}function Mt(e,r){return e.key!=null?e:{...e,key:r}}function $t(e,r=[],n={}){const t={},s={},o={},i=[],a=/([:@#]?)([a-zA-Z0-9-:.]+)(?:\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|([^\s>]+)))?/g;let f;for(;f=a.exec(e);){const u=f[1],_=f[2];let S="";for(let m=3;m<f.length;m++)if(f[m]!==void 0){S=f[m];break}S.length>=2&&(S[0]==='"'&&S[S.length-1]==='"'||S[0]==="'"&&S[S.length-1]==="'")&&(S=S.slice(1,-1));const c=!/=/.test(f[0]),g=S.match(/^{{(\d+)}}$/);let d=c?!0:g?r[Number(g[1])]??null:S;g||(d==="true"?d=!0:d==="false"?d=!1:d==="null"?d=null:isNaN(Number(d))||(d=Number(d)));const b=["model","bind","show","class","style","ref","when"];if(u===":"){const[m,L]=_.split(":"),[w,...v]=m.split(".");if(b.includes(w)){const k=[...v],T=w==="model"&&L?`model:${L}`:w;o[T]={value:d,modifiers:k,arg:L}}else if(_==="disabled"){let k=d;k&&p.isReactiveState(k)&&(k=k.value);const T=typeof k;if(k===""||T==="boolean"||T==="string"&&(k==="true"||k==="false")||k==null||T==="number")t[_]=k;else{let l=d;l&&p.isReactiveState(l)&&(l=l.value),s[_]=l}i.push(_)}else{let k=d;k&&p.isReactiveState(k)&&(k=k.value),s[_]=k,i.push(_)}}else if(u==="@"){const[m,...L]=_.split("."),w=L;Pt(d,m);const v=typeof d=="function"?d:typeof n[d]=="function"?n[d]:void 0;if(v){const k=N=>{if(w.includes("prevent")&&N.preventDefault(),w.includes("stop")&&N.stopPropagation(),!(w.includes("self")&&N.target!==N.currentTarget))return w.includes("once")&&N.currentTarget?.removeEventListener(m,k),v(N)},T="on"+m.charAt(0).toUpperCase()+m.slice(1);t[T]=k}}else _==="ref"?t.ref=d:s[_]=d}return{props:t,attrs:s,directives:o,bound:i}}function Me(e){if(!te(e)||ge(e))return e;const r=e.props?.directives;if(r&&r.when){const n=r.when.value,t=p.isReactiveState(n)?n.value:n,s={...r};delete s.when;const o={...e.props};Object.keys(s).length>0?o.directives=s:delete o.directives;const i={...e,props:o};return Array.isArray(i.children)&&(i.children=i.children.map(f=>typeof f=="object"&&f!==null?Me(f):f)),{tag:"#anchor",key:e.key!=null?`when-${e.key}`:`when-${e.tag}`,children:t?[i]:[]}}if(Array.isArray(e.children)){const n=e.children.map(t=>typeof t=="object"&&t!==null?Me(t):t);return{...e,children:n}}return e}function jt(e,r,n){const t=me.length>0?me[me.length-1]:void 0,s=n??t,o=!n&&r.length===0,i=o?e.join("<!--TEMPLATE_DELIM-->"):null;if(o&&i){const l=Ne.get(i);if(l)return l}function a(l,E){return J("#text",{},l,E)}function f(l,E){let y=typeof l=="string"?p.decodeEntities(l):l;return typeof y=="string"&&/[\r\n]/.test(y)&&(y=y.replace(/\s+/g," ")),J("#text",{},y,E)}let u="";for(let l=0;l<e.length;l++)u+=e[l],l<r.length&&(u+=`{{${l}}}`);const _=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,S=[];let c,g=[],d=null,b={},m,L=0;const w=[];function v(l){if(!l||typeof l!="object"||ge(l))return;const E=l,y=b;if(E.props||E.attrs){const h=E;h.props&&(y.props||(y.props={}),Object.assign(y.props,h.props)),h.attrs&&(y.attrs||(y.attrs={}),Object.keys(h.attrs).forEach(C=>{if(C==="style"&&y.attrs.style){const P=String(y.attrs.style).replace(/;?\s*$/,""),R=String(h.attrs.style).replace(/^;?\s*/,"");y.attrs.style=P+"; "+R}else if(C==="class"&&y.attrs.class){const P=String(y.attrs.class).trim().split(/\s+/).filter(Boolean),R=String(h.attrs.class).trim().split(/\s+/).filter(Boolean),A=[...new Set([...P,...R])];y.attrs.class=A.join(" ")}else y.attrs[C]=h.attrs[C]}))}else y.props||(y.props={}),Object.assign(y.props,E)}function k(l,E){const y=d?g:w;if(ge(l)){const h=l.key??E,C=l.children;y.push({...l,key:h,children:C});return}if(te(l)){y.push(Mt(l,void 0));return}if(Array.isArray(l)){if(l.length===0)return;for(let h=0;h<l.length;h++){const C=l[h];ge(C)||te(C)||Array.isArray(C)?k(C,`${E}-${h}`):C!==null&&typeof C=="object"?p.isUnsafeHTML(C)?y.push(J("#raw",{},C.__rawHTML,`${E}-${h}`)):v(C):y.push(a(String(C),`${E}-${h}`))}return}if(l!==null&&typeof l=="object"){if(p.isUnsafeHTML(l)){const h=l.__rawHTML??"";y.push(J("#raw",{},h,E));return}v(l);return}y.push(a(String(l),E))}const T=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;c=_.exec(u);)if(!(c[0].startsWith("<!--")&&c[0].endsWith("-->"))){if(c[1]){const l=c[1],E=c[0][1]==="/",y=c[0][c[0].length-2]==="/"||T.has(l),{props:h,attrs:C,directives:P,bound:R}=$t(c[2]||"",r,s??{}),A={props:{},attrs:{}};for(const x in h)A.props[x]=h[x];for(const x in C)A.attrs[x]=C[x];A.attrs&&Object.prototype.hasOwnProperty.call(A.attrs,"key")&&!(A.props&&Object.prototype.hasOwnProperty.call(A.props,"key"))&&p.safe(()=>{A.props.key=A.attrs.key});try{const x={input:["value","checked","readonly","required","placeholder","maxlength","minlength"],textarea:["value","readonly","required","placeholder","maxlength","minlength"],select:["value","required","multiple"],option:["selected","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","autofocus","form"]},$=l.toLowerCase(),q=x[$]??[];if(A.attrs){for(const H of q)if(R&&R.includes(H)&&H in A.attrs&&!(A.props&&H in A.props)){let M=A.attrs[H];if(M&&p.isReactiveState(M))M=M.value,A.props[H]=M,delete A.attrs[H];else if(M&&typeof M=="object"&&"value"in M&&!(M instanceof Node))try{const W=M.value;A.props[H]=($==="select"||$==="option")&&H==="value"?String(W):W,delete A.attrs[H]}catch{}else{const W=typeof M;if(H==="disabled")(M===""||W==="boolean"||W==="string"&&(M==="true"||M==="false")||M==null||W==="number")&&(A.props[H]=M,delete A.attrs[H]);else if(M===""||W==="string"||W==="number"||W==="boolean"||M==null){const F=($==="select"||$==="option")&&H==="value"?String(M):M;A.props[H]=F,delete A.attrs[H]}}}}if(l.includes("-")||!!s?.__customElements?.has?.(l)){if(A.isCustomElement=!0,R&&A.attrs){const H=new Set(["id","name","data-key","key"]);for(const M of R)if(M in A.attrs&&!(A.props&&M in A.props)){const W=M.includes("-")?p.toCamel(M):M,F=A.attrs[M];if(A.props[W]=F,H.has(M)||p.isClassLikeAttr(M))try{const Ee=p.safeSerializeAttr(A.attrs[M]);Ee===null?delete A.attrs[M]:A.attrs[M]=Ee}catch{delete A.attrs[M]}else delete A.attrs[M]}}try{if(A.attrs&&!(A.props&&"modelValue"in A.props)){const H=A.attrs["model-value"]??A.attrs.modelValue;typeof H<"u"&&(A.props.modelValue=H)}}catch{}}}catch{}if(P&&Object.keys(P).some(x=>x==="model"||x.startsWith("model:")))try{const x=Symbol.for("cer.registry"),$=globalThis[x],q=!!($&&typeof $.has=="function"&&$.has(l)),B=s,H=!!(B&&(B.__customElements instanceof Set&&B.__customElements.has(l)||Array.isArray(B.__isCustomElements)&&B.__isCustomElements.includes(l)));if(!!(l.includes("-")||H||q))for(const F of Object.keys(P)){if(F!=="model"&&!F.startsWith("model:"))continue;const ve=P[F],Ee=ve.arg??(F.includes(":")?F.split(":",2)[1]:void 0),D=ve.value,Ce=Ee??"modelValue",$e=p.getNestedValue,qe=p.setNestedValue,fe=s?._state||s;let Z;typeof D=="string"&&fe?Z=$e(fe,D):Z=D,A.props[Ce]=Z;try{const X=p.toKebab(Ce);A.attrs||(A.attrs={}),Z!=null&&(typeof Z=="string"||typeof Z=="number"||typeof Z=="boolean")&&(A.attrs[X]=Z)}catch{}A.isCustomElement=!0;const je=`update:${p.toKebab(Ce)}`.replace(/-([a-z])/g,(X,G)=>G.toUpperCase()),Ge="on"+je.charAt(0).toUpperCase()+je.slice(1);A.props[Ge]=function(X){const G=X.detail!==void 0?X.detail:X.target?X.target.value:void 0;if(fe)if(D&&p.isReactiveState(D)){const Q=D.value;if(Array.isArray(G)&&Array.isArray(Q)?JSON.stringify([...G].sort())!==JSON.stringify([...Q].sort()):G!==Q){D.value=G;try{const ee=s;if(ee){const ue=ee.requestRender,de=ee._requestRender;typeof ue=="function"?ue():typeof de=="function"&&de()}}catch{}}}else{const Q=$e(fe||{},typeof D=="string"?D:String(D));if(Array.isArray(G)&&Array.isArray(Q)?JSON.stringify([...G].sort())!==JSON.stringify([...Q].sort()):G!==Q){qe(fe||{},typeof D=="string"?D:String(D),G);try{const ee=s;if(ee){const ue=ee.requestRender,de=ee._requestRender;typeof ue=="function"?ue():typeof de=="function"&&de()}}catch{}}}},delete P[F]}}catch{}if(Object.keys(P).length>0&&(A.directives={...P}),E){const x=g.some(H=>typeof H=="object"&&H.tag!=="#text");let $=g;if(x&&g.length>0){let H=0;for(;H<g.length;){const W=g[H];if(!te(W)||W.tag!=="#text"||typeof W.children!="string"||W.children.trim()!=="")break;H++}let M=g.length-1;for(;M>=0;){const W=g[M];if(!te(W)||W.tag!=="#text"||typeof W.children!="string"||W.children.trim()!=="")break;M--}H===0&&M===g.length-1?$=g:H>M?$=[]:$=g.slice(H,M+1)}const q=J(d,b,$.length===1&&te($[0])&&$[0].tag==="#text"?typeof $[0].children=="string"?$[0].children:"":$.length?$:void 0,m),B=S.pop();B?(d=B.tag,b=B.props,m=B.key,g=B.children,g.push(q)):(w.push(q),d=null,b={},m=void 0,g=[])}else y?d?g.push(J(l,A,void 0,void 0)):w.push(J(l,A,void 0,void 0)):(d&&S.push({tag:d,props:b,children:g,key:m}),d=l,b=A,g=[])}else if(typeof c[3]<"u"){const l=Number(c[3]),E=r[l],y=`interp-${l}`;k(E,y)}else if(c[4]){const l=c[4],E=d?g:w,y=l.split(/({{\d+}})/);for(const h of y){if(!h)continue;const C=h.match(/^{{(\d+)}}$/);if(C){const P=Number(C[1]),R=r[P],A=`interp-${P}`;k(R,A)}else{const P=`text-${L++}`;E.push(f(h,P))}}}}const O=w.filter(l=>te(l)&&l.tag==="#text"?typeof l.children=="string"&&l.children.trim()!=="":!0).map(l=>Me(l));if(O.length===1){const l=O[0];return o&&i&&Ne.set(i,l),l}else if(O.length>1){const l=O;return o&&i&&Ne.set(i,l),l}return J("div",{},"","fallback-root")}function Ht(e,...r){const n=r[r.length-1],t=typeof n=="object"&&n&&!Array.isArray(n)?n:void 0;return jt(e,r,t)}exports.computed=p.computed;exports.decodeEntities=p.decodeEntities;exports.ref=p.ref;exports.unsafeHTML=p.unsafeHTML;exports.watch=p.watch;exports.css=Y.css;exports.component=Ot;exports.html=Ht;exports.useEmit=St;exports.useOnAttributeChanged=Ct;exports.useOnConnected=_t;exports.useOnDisconnected=kt;exports.useOnError=At;exports.useProps=wt;exports.useStyle=Tt;
13
13
  //# sourceMappingURL=custom-elements-runtime.cjs.js.map