@jasonshimmy/custom-elements-runtime 2.8.1 → 3.0.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.
- package/README.md +159 -46
- package/dist/css-utils-Cg4o1MqY.js +643 -0
- package/dist/css-utils-Cg4o1MqY.js.map +1 -0
- package/dist/css-utils-RqkyBWft.cjs +576 -0
- package/dist/css-utils-RqkyBWft.cjs.map +1 -0
- package/dist/custom-elements-runtime.cjs.js +3 -3
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js +7 -0
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js.map +1 -0
- package/dist/custom-elements-runtime.dom-jit-css.es.js +136 -0
- package/dist/custom-elements-runtime.dom-jit-css.es.js.map +1 -0
- package/dist/custom-elements-runtime.es.js +70 -67
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.cjs.js +1 -1
- package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.es.js +62 -46
- package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
- package/dist/custom-elements-runtime.jit-css.cjs.js +2 -0
- package/dist/custom-elements-runtime.jit-css.cjs.js.map +1 -0
- package/dist/custom-elements-runtime.jit-css.es.js +38 -0
- package/dist/custom-elements-runtime.jit-css.es.js.map +1 -0
- package/dist/custom-elements-runtime.router.cjs.js +20 -20
- package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.router.es.js +448 -434
- package/dist/custom-elements-runtime.router.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.es.js +33 -18
- package/dist/custom-elements-runtime.ssr.es.js.map +1 -1
- package/dist/custom-elements-runtime.store.cjs.js +1 -1
- package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.store.es.js +21 -16
- package/dist/custom-elements-runtime.store.es.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.cjs.js +1 -1
- package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.es.js +279 -7
- package/dist/custom-elements-runtime.transitions.es.js.map +1 -1
- package/dist/custom-elements-runtime.vite-plugin.cjs.js +2 -0
- package/dist/custom-elements-runtime.vite-plugin.cjs.js.map +1 -0
- package/dist/custom-elements-runtime.vite-plugin.es.js +73 -0
- package/dist/custom-elements-runtime.vite-plugin.es.js.map +1 -0
- package/dist/dom-jit-css.d.ts +66 -0
- package/dist/event-bus.d.ts +3 -1
- package/dist/{namespace-helpers-DhLBqt-7.js → helpers-CweFZFWU.js} +265 -287
- package/dist/helpers-CweFZFWU.js.map +1 -0
- package/dist/helpers-DeWjSmOl.cjs +5 -0
- package/dist/helpers-DeWjSmOl.cjs.map +1 -0
- package/dist/hooks-BrrLKSub.cjs +3 -0
- package/dist/hooks-BrrLKSub.cjs.map +1 -0
- package/dist/hooks-DyShDHKo.js +403 -0
- package/dist/hooks-DyShDHKo.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/jit-css.d.ts +30 -0
- package/dist/namespace-helpers-CnpZ5__p.js +45 -0
- package/dist/namespace-helpers-CnpZ5__p.js.map +1 -0
- package/dist/namespace-helpers-CyIDtI97.cjs +2 -0
- package/dist/namespace-helpers-CyIDtI97.cjs.map +1 -0
- package/dist/router/types.d.ts +4 -2
- package/dist/runtime/css-utils.d.ts +33 -0
- package/dist/runtime/discovery-state.d.ts +3 -0
- package/dist/runtime/hooks.d.ts +78 -0
- package/dist/runtime/jit-hooks.d.ts +28 -0
- package/dist/runtime/render-bridge.d.ts +37 -0
- package/dist/runtime/scheduler.d.ts +3 -4
- package/dist/runtime/secure-expression-evaluator.d.ts +0 -1
- package/dist/runtime/style.d.ts +84 -26
- package/dist/runtime/template-compiler/lru-cache.d.ts +0 -3
- package/dist/runtime/vdom-helpers.d.ts +0 -1
- package/dist/ssr.d.ts +42 -0
- package/dist/{transitions-DMJXs_tY.js → style-BmyOIMcU.js} +904 -1344
- package/dist/style-BmyOIMcU.js.map +1 -0
- package/dist/style-D40DsIqJ.cjs +55 -0
- package/dist/style-D40DsIqJ.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/template-compiler-B5uN1EQw.js +3731 -0
- package/dist/template-compiler-B5uN1EQw.js.map +1 -0
- package/dist/template-compiler-Cx623BSB.cjs +23 -0
- package/dist/template-compiler-Cx623BSB.cjs.map +1 -0
- package/dist/variables.css +1 -1
- package/dist/vite-plugin.d.ts +52 -0
- package/package.json +55 -6
- package/dist/namespace-helpers-Ctd_h7j2.cjs +0 -5
- package/dist/namespace-helpers-Ctd_h7j2.cjs.map +0 -1
- package/dist/namespace-helpers-DhLBqt-7.js.map +0 -1
- package/dist/template-compiler-CVBKYu3j.js +0 -3991
- package/dist/template-compiler-CVBKYu3j.js.map +0 -1
- package/dist/template-compiler-G8h2OJbA.cjs +0 -23
- package/dist/template-compiler-G8h2OJbA.cjs.map +0 -1
- package/dist/transitions-DMJXs_tY.js.map +0 -1
- package/dist/transitions-f4KfN29T.cjs +0 -330
- package/dist/transitions-f4KfN29T.cjs.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";const d=require("./helpers-DeWjSmOl.cjs"),_e=require("./hooks-BrrLKSub.cjs"),ze=require("./custom-elements-runtime.directives.cjs.js"),P=require("./logger-CSALKaYm.cjs"),H=require("./namespace-helpers-CyIDtI97.cjs"),V=require("./css-utils-RqkyBWft.cjs"),le=require("./custom-elements-runtime.transitions.cjs.js"),ue=new Map,je=Symbol.for("cer.registry");function ot(){if(!(typeof window>"u"&&typeof document>"u"&&typeof navigator>"u"))try{const n=globalThis;if(!n[je]){const t=crypto.randomUUID();n[je]=new Map([...ue.entries()]),n[je].__realmId=t}}catch(n){P.devWarn("Could not initialize global registry:",n)}}function at(e,n,t){if(t)for(const[s,r]of Object.entries(t)){let o,i={};if(Array.isArray(r)?(o=r[0],i=r[1]||{}):o=r,n.set(s,{callback:o,options:i,oldValue:d.getNestedValue(e,s)}),i.immediate)try{const a=d.getNestedValue(e,s);o(a,void 0,e)}catch(a){P.devError(`Error in immediate watcher for "${s}":`,a)}}}function ct(e,n,t,s){const r=(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((m,k)=>r(m,a[k]));const f=i,g=a,S=Object.keys(f||{}),h=Object.keys(g||{});return S.length!==h.length?!1:S.every(m=>r(f[m],g[m]))},o=n.get(t);if(o&&!r(s,o.oldValue))try{o.callback(s,o.oldValue,e),o.oldValue=s}catch(i){P.devError(`Error in watcher for "${t}":`,i)}for(const[i,a]of n.entries())if(a.options.deep&&t.startsWith(i+"."))try{const f=d.getNestedValue(e,i);r(f,a.oldValue)||(a.callback(f,a.oldValue,e),a.oldValue=f)}catch(f){P.devError(`Error in deep watcher for "${i}":`,f)}}function $e(e,n){return n===Boolean?e===""||e==="true":n===Number?Number(e):e}function lt(e,n,t){if(n)for(const s in n){const r=n[s],o=d.toKebab(s),i=e.getAttribute(o);if(r.type===Function&&typeof e[s]=="function")t[s]=e[s];else if(i!==null)t[s]=$e(i,r.type);else if(typeof e[s]<"u")try{const a=e[s];if(r.type===String&&a&&typeof a=="object")try{t[s]=$e(String(a),r.type)}catch{t[s]=a}else r.type===Boolean&&typeof a=="boolean"||r.type===Number&&typeof a=="number"||r.type===Function&&typeof a=="function"?t[s]=a:t[s]=$e(String(a),r.type)}catch{t[s]=e[s]}else"default"in r&&r.default!==void 0&&(t[s]=r.default)}}function ft(e,n,t){if(!n.props){try{const s=t?._hookCallbacks?.props||{},r=Array.from(new Set([...Object.keys(e||{}),...Object.keys(s||{})]));for(const o of r){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(t,o);if(!(!Object.prototype.hasOwnProperty.call(s,o)&&i&&(i.get||i.set||!i.configurable)))try{Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get(){try{const f=d.toKebab(o),g=e.getAttribute(f);if(g!==null)return g;const S=e[o];let h;return d.isReactiveState(S)||S&&typeof S=="object"&&"value"in S&&!(S instanceof Node)?h=S.value:h=S,h}catch{return e[o]}}})}catch{}}}catch{}return}lt(e,n.props,t)}function ut(e,n,t,s){e.onConnected&&!t&&(e.onConnected(n),s(!0))}function dt(e,n,t,s,r,o,i,a){e.onDisconnected&&e.onDisconnected(n),t.forEach(f=>f()),s(),r(),o(!1),i(null),a(!1)}function pt(e,n,t,s,r){e.onAttributeChanged&&e.onAttributeChanged(n,t,s,r)}class G{static cleanupFunctions=new WeakMap;static addListener(n,t,s,r){n.addEventListener(t,s,r);const i={event:t,handler:s,wrapper:s,options:r,cleanup:()=>n.removeEventListener(t,s,r),addedAt:Date.now()};this.cleanupFunctions.has(n)||this.cleanupFunctions.set(n,[]),this.cleanupFunctions.get(n).push(i)}static removeListener(n,t,s,r){n.removeEventListener(t,s,r);const o=this.cleanupFunctions.get(n);if(o)for(let i=0;i<o.length;i++){const a=o[i];if(a.event===t&&a.handler===s){o.splice(i,1),o.length===0&&this.cleanupFunctions.delete(n);return}}}static cleanup(n){const t=this.cleanupFunctions.get(n);t&&(t.forEach(s=>{try{s.cleanup()}catch{}}),this.cleanupFunctions.delete(n))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(n){const t=this.cleanupFunctions.get(n);return!!(t&&t.length>0)}static getListenerCount(n){const t=this.cleanupFunctions.get(n);return t?t.length:0}static getListenerInfo(n){const t=this.cleanupFunctions.get(n);return t?t.map(s=>({event:s.event,handler:s.handler,wrapper:s.wrapper,options:s.options})):[]}}class Ze{map=new Map;maxSize;constructor(n){this.maxSize=Math.max(1,n)}get(n){const t=this.map.get(n);if(t!==void 0)return this.map.delete(n),this.map.set(n,t),t}set(n,t){if(this.map.has(n)&&this.map.delete(n),this.map.set(n,t),this.map.size>this.maxSize){const s=this.map.keys().next().value;this.map.delete(s)}}has(n){return this.map.has(n)}clear(){this.map.clear()}get size(){return this.map.size}}const ht=()=>{if(typeof navigator<"u"&&"deviceMemory"in navigator){const n=navigator.deviceMemory;if(n)return Math.min(1e3,Math.max(200,n*100))}return(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"}catch{return!1}})()?100:500},Oe=new Ze(ht()),yt=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","delete","void","throw","return","this","class","extends","import","export","from","as","async","await","yield","if","else","for","while","do","switch","case","break","continue","try","catch","finally","let","const","var","function","NaN","Infinity"]);class mt{static cache=new Ze(1e3);static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/\bfunction\b/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(n,t){const s=this.cache.get(n);if(s){if(!s.isSecure){P.devWarn("Blocked cached dangerous expression:",n);return}return s.evaluator(t)}const r=this.createEvaluator(n);if(this.cache.set(n,r),!r.isSecure){P.devWarn("Blocked dangerous expression:",n);return}return r.evaluator(t)}static createEvaluator(n){if(this.hasDangerousPatterns(n))return{evaluator:()=>{},isSecure:!1};if(n.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(n),isSecure:!0}}catch(t){return P.devWarn("Failed to create evaluator for expression:",n,t),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(n){return this.dangerousPatterns.some(t=>t.test(n))}static createSafeEvaluator(n){const t=n.trim();if(t.startsWith("{")&&t.endsWith("}"))return this.createObjectEvaluator(n);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(n.trim())){const s=n.trim().slice(4);return r=>d.getNestedValue(r,s)}return n.includes("ctx")||/[+\-*/%<>=&|?:[\]]/.test(n)?this.createSimpleEvaluator(n):s=>d.getNestedValue(s,n)}static createObjectEvaluator(n){const t=n.trim().slice(1,-1),s=this.parseObjectProperties(t);return r=>{const o={};for(const{key:i,value:a}of s)try{if(a.startsWith("ctx.")){const f=a.slice(4);o[i]=d.getNestedValue(r,f)}else o[i]=this.evaluateSimpleValue(a,r)}catch{o[i]=void 0}return o}}static parseObjectProperties(n){const t=[],s=[];let r=0,o=null,i=0;for(let a=0;a<n.length;a++){const f=n[a];if(o){if(f==="\\"){a++;continue}f===o&&(o=null)}else f==='"'||f==="'"?o=f:f==="("||f==="["||f==="{"?r++:f===")"||f==="]"||f==="}"?r--:f===","&&r===0&&(s.push(n.slice(i,a)),i=a+1)}s.push(n.slice(i));for(const a of s){let f=-1,g=0,S=null;for(let j=0;j<a.length;j++){const C=a[j];if(S){if(C==="\\"){j++;continue}C===S&&(S=null)}else if(C==='"'||C==="'")S=C;else if(C==="("||C==="["||C==="{")g++;else if(C===")"||C==="]"||C==="}")g--;else if(C===":"&&g===0){f=j;break}}if(f===-1)continue;const h=a.slice(0,f).trim(),m=a.slice(f+1).trim(),k=h.replace(/^['"]|['"]$/g,"");t.push({key:k,value:m})}return t}static createSimpleEvaluator(n){return t=>{try{let s=n;const r=[];s=s.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,h=>`<<#${r.push(h)-1}#>>`);const o=s.match(/ctx\.[\w.]+/g)||[];for(const h of o){const m=h.slice(4),k=d.getNestedValue(t,m);if(k===void 0)return;const j=r.push(JSON.stringify(k))-1;s=s.split(h).join(`<<#${j}#>>`)}const i=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=s.match(i)||[];for(const h of a){if(h.startsWith("ctx."))continue;const m=d.getNestedValue(t,h);if(m===void 0)return;const k=r.push(JSON.stringify(m))-1;s=s.split(h).join(`<<#${k}#>>`)}const f=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let g;const S=new Set;for(;(g=f.exec(s))!==null;){const h=g[1];if(yt.has(h)||/^[0-9]+$/.test(h)||h==="ctx"||S.has(h))continue;S.add(h);const m=d.getNestedValue(t,h);if(m===void 0)return;const k=JSON.stringify(m),j=r.push(k)-1;h.includes(".")?s=s.split(h).join(`<<#${j}#>>`):s=s.replace(new RegExp("\\b"+h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${j}#>>`),f.lastIndex=0}s=s.replace(/<<#(\d+)#>>/g,(h,m)=>r[Number(m)]);try{return this.evaluateBasicExpression(s)}catch{return}}catch{return}}}static evaluateBasicExpression(n){const t=this.tokenize(n);let s=0;function r(){return t[s]}function o(u){const b=t[s++];if(u&&!b)throw new Error(`Unexpected token EOF, expected ${u}`);if(u&&b&&b.type!==u&&b.value!==u)throw new Error(`Unexpected token ${b.type}/${b.value}, expected ${u}`);return b}function i(){return j()}function a(u){if(typeof u=="number")return u;if(u==null)return NaN;if(typeof u=="boolean")return u?1:0;const b=Number(u);return Number.isNaN(b)?NaN:b}function f(u,b){return typeof u=="string"||typeof b=="string"?String(u)+String(b):a(u)+a(b)}function g(u,b){return a(u)-a(b)}function S(u,b){return a(u)*a(b)}function h(u,b){return a(u)/a(b)}function m(u,b){return a(u)%a(b)}function k(u,b,l){if(typeof b=="number"&&typeof l=="number")switch(u){case">":return b>l;case"<":return b<l;case">=":return b>=l;case"<=":return b<=l;default:return!1}const v=String(b),_=String(l);switch(u){case">":return v>_;case"<":return v<_;case">=":return v>=_;case"<=":return v<=_;default:return!1}}function j(){const u=C(),b=r();if(b&&b.value==="?"){o("?");const l=i();o(":");const v=i();return u?l:v}return u}function C(){let u=N();for(;;){const b=r();if(!b||b.value!=="||")break;o("OP");const l=N();u=u||l}return u}function N(){let u=p();for(;;){const b=r();if(!b||b.value!=="&&")break;o("OP");const l=p();u=u&&l}return u}function p(){let u=w();for(;;){const b=r();if(!b||!["==","!=","===","!=="].includes(b.value))break;const l=o("OP").value,v=w();switch(l){case"==":u=u==v;break;case"!=":u=u!=v;break;case"===":u=u===v;break;case"!==":u=u!==v;break}}return u}function w(){let u=c();for(;;){const b=r();if(!b||![">","<",">=","<="].includes(b.value))break;const l=o("OP").value,v=c();switch(l){case">":u=k(">",u,v);break;case"<":u=k("<",u,v);break;case">=":u=k(">=",u,v);break;case"<=":u=k("<=",u,v);break}}return u}function c(){let u=A();for(;;){const b=r();if(!b||b.value!=="+"&&b.value!=="-")break;const l=o("OP").value,v=A();u=l==="+"?f(u,v):g(u,v)}return u}function A(){let u=y();for(;;){const b=r();if(!b||b.value!=="*"&&b.value!=="/"&&b.value!=="%")break;const l=o("OP").value,v=y();switch(l){case"*":u=S(u,v);break;case"/":u=h(u,v);break;case"%":u=m(u,v);break}}return u}function y(){const u=r();if(u&&u.value==="!")return o("OP"),!y();if(u&&u.value==="-"){o("OP");const b=y();return g(0,b)}return L()}function L(){const u=r();if(u){if(u.type==="NUMBER")return o("NUMBER"),Number(u.value);if(u.type==="STRING")return o("STRING"),u.value.slice(1,-1);if(u.type==="IDENT")return o("IDENT"),u.value==="true"?!0:u.value==="false"?!1:u.value==="null"?null:void 0;if(u.value==="["){o("PUNC");const b=[];for(;;){const l=r();if(!l||l.value==="]")break;b.push(i());const v=r();v&&v.value===","&&o("PUNC")}return o("PUNC"),b}if(u.value==="("){o("PUNC");const b=i();return o("PUNC"),b}throw new Error("Unexpected token in expression")}}return i()}static tokenize(n){const t=[],s=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let r;for(;(r=s.exec(n))!==null;){const o=r[1];o&&(/^\d/.test(o)?t.push({type:"NUMBER",value:o}):/^"/.test(o)||/^'/.test(o)?t.push({type:"STRING",value:o}):/^[a-zA-Z_]/.test(o)?t.push({type:"IDENT",value:o}):/^[()?:,[\]]$/.test(o)?t.push({type:"PUNC",value:o}):t.push({type:"OP",value:o}))}return t}static evaluateSimpleValue(n,t){if(n==="true")return!0;if(n==="false")return!1;if(!isNaN(Number(n)))return Number(n);if(n.startsWith("ctx.")){const s=n.slice(4);return d.getNestedValue(t,s)}return n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'")?n.slice(1,-1):n}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}function Te(e,n){return Array.isArray(e)&&Array.isArray(n)?JSON.stringify([...e].sort())!==JSON.stringify([...n].sort()):e!==n}function Ke(e,n,t,s,r){if(e){const o=n.value;if(r&&typeof o=="object"&&o!==null){const i={...o};i[r]=t,n.value=i}else n.value=t}else{const o=s._state||s;d.setNestedValue(o,n,t)}}function we(e,n,t,s){if(typeof e._requestRender=="function"&&e._requestRender(),typeof e._triggerWatchers=="function"){const r=n?"reactiveState":t;e._triggerWatchers(r,s)}}function gt(e,n,t){const s=`update:${d.toKebab(n)}`,r=`update:${n}`,o=new CustomEvent(s,{detail:t,bubbles:!0,cancelable:!0}),i=new CustomEvent(r,{detail:t,bubbles:!0,cancelable:!0});e.dispatchEvent(o),e.dispatchEvent(i)}function Ue(e,n,t,s){const r=t;if(d.safe(()=>{if(typeof e.setAttribute=="function")try{e[n]=r}catch{}else e[n]=r}),r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"){const o=d.safeSerializeAttr(r);o!==null?d.safe(()=>{typeof e.setAttribute=="function"&&H.setAttributeSmart(e,d.toKebab(n),String(o))}):d.safe(()=>{typeof e.removeAttribute=="function"&&H.removeAttributeSmart(e,d.toKebab(n))})}}function bt(e,n,t,s){if(e){const r=n.value;return s&&typeof r=="object"&&r!==null?r[s]:r}else{const r=t._state||t;return d.getNestedValue(r,n)}}function Ee(e){return e!=null&&typeof e=="object"&&"value"in e}function He(e){return e!=null&&typeof e=="object"&&"value"in e?e.value:e}function Q(e,n,t){if(!e)return;e.attrs||(e.attrs={});const s=e.attrs;s[n]=t}function J(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function ae(e){return e!=null&&typeof e=="object"&&"value"in e?ae(e.value):!(e!=null&&typeof e=="object"||e===!1||e==="false"||e===null||e===void 0||e===0)}function Ye(e){return e.substring(2,3).toLowerCase()+e.substring(3)}function xe(e){return typeof e=="boolean"||e==="true"||e==="false"}function St(e,n,t,s,r,o,i,a){if(!o)return;const f=n.includes("lazy"),g=n.includes("trim"),S=n.includes("number"),h=()=>{if(d.isReactiveState(e)){const A=e.value;return a&&i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement)&&typeof A=="object"&&A!==null?A[a]:A}const c=o?._state||o;return d.getNestedValue(c,e)},m=h();let k="text";i instanceof HTMLInputElement?k=s?.type||i.type||"text":i instanceof HTMLSelectElement?k="select":i instanceof HTMLTextAreaElement&&(k="textarea");const j=i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement,N=j?k==="checkbox"||k==="radio"?"checked":"value":a??"modelValue";if(k==="checkbox")if(Array.isArray(m))t[N]=m.includes(String(i?.getAttribute("value")??s?.value??""));else{const c=i?.getAttribute("true-value")??!0;t[N]=m===c}else if(k==="radio")t[N]=m===(s?.value??"");else if(k==="select")if(i&&i.hasAttribute("multiple")&&i instanceof HTMLSelectElement){const c=Array.isArray(m)?m.map(String):[];queueMicrotask(()=>{Array.from(i.options).forEach(A=>{A.selected=c.includes(A.value)})}),t[N]=Array.isArray(m)?m:[]}else t[N]=m;else if(!j&&d.isReactiveState(e))t[N]=e;else{t[N]=m;try{const c=d.toKebab(N);s&&(s[c]=m)}catch{}}const p=f||k==="checkbox"||k==="radio"||k==="select"?"change":"input",w=c=>{if(c.isComposing||r._isComposing)return;const A=globalThis.process,y=!!A&&A.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(c.isTrusted===!1&&!y)return;const L=c.target;if(!L||L._modelUpdating)return;let E=L.value;if(k==="checkbox"){const l=h();if(Array.isArray(l)){const v=L.getAttribute("value")??"",_=Array.from(l);if(L.checked)_.includes(v)||_.push(v);else{const T=_.indexOf(v);T>-1&&_.splice(T,1)}E=_}else{const v=L.getAttribute("true-value")??!0,_=L.getAttribute("false-value")??!1;E=L.checked?v:_}}else if(k==="radio")E=L.getAttribute("value")??L.value;else if(k==="select"&&L.multiple)E=Array.from(L.selectedOptions).map(l=>l.value);else if(g&&typeof E=="string"&&(E=E.trim()),S){const l=Number(E);isNaN(l)||(E=l)}const u=h();if(Te(E,u)){L._modelUpdating=!0;try{Ke(d.isReactiveState(e),e,E,o,a),we(o,d.isReactiveState(e),e,E),L&>(L,N,E)}finally{queueMicrotask(()=>L._modelUpdating=!1)}}};if(j){if(r[p]){const c=r[p];i&&G.removeListener(i,p,c)}r[p]=w}else{const c=`update:${d.toKebab(N)}`,A=`update:${N}`;if(r[c]){const y=r[c];i&&G.removeListener(i,c,y)}if(r[A]){const y=r[A];i&&G.removeListener(i,A,y)}if(r[c]=y=>{const L=y.detail;let E=L!==void 0?L:void 0;if(E===void 0){const l=y.target;if(l&&typeof l=="object"&&"value"in l)try{E=l.value}catch{E=void 0}}const u=bt(d.isReactiveState(e),e,o,a);if(Te(E,u)){Ke(d.isReactiveState(e),e,E,o,a),we(o,d.isReactiveState(e),e,E);const l=y.target;l&&Ue(l,N,d.isReactiveState(e)?e:E,d.isReactiveState(e))}},d.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let y;try{y=Reflect.ownKeys(e.value)}catch{y=Object.keys(e.value)}const L=y.filter(u=>typeof u=="string"&&!String(u).startsWith("_")&&u!=="constructor"),E=new Set(L.map(u=>`update:${d.toKebab(u)}`));for(const u of Object.keys(r))u.startsWith("update:")&&u!==c&&u!==A&&!E.has(u)&&(i&&G.removeListener(i,u,r[u]),delete r[u]);for(const u of L){const b=String(u),l=`update:${d.toKebab(b)}`,v=`update:${b}`;l!==c&&(r[l]&&i&&(G.removeListener(i,l,r[l]),delete r[l]),r[l]=_=>{const T=_.detail!==void 0?_.detail:_.target?.value,R=d.isReactiveState(e)?e.value[b]:d.getNestedValue(o?._state||o,e);if(!Te(T,R))return;if(d.isReactiveState(e)){const M={...e.value};M[b]=T,e.value=M}else d.setNestedValue(o?._state||o,e,T);we(o,d.isReactiveState(e),e,T);const x=_.currentTarget||i||_.target;x&&Ue(x,N,d.isReactiveState(e)?e:T,d.isReactiveState(e))},r[v]=r[l])}}r[A]=r[c]}(k==="text"||k==="textarea")&&(r.compositionstart=()=>r._isComposing=!0,r.compositionend=c=>{r._isComposing=!1;const A=c.target;A&&queueMicrotask(()=>{const y=A.value,L=o?._state||o,E=d.getNestedValue(L,e);let u=y;if(g&&(u=u.trim()),S){const l=Number(u);isNaN(l)||(u=l)}if(Te(u,E)){A._modelUpdating=!0;try{d.setNestedValue(L,e,u),we(o,d.isReactiveState(e),e,u)}finally{queueMicrotask(()=>A._modelUpdating=!1)}}})})}function vt(e,n,t,s,r){if(typeof e=="object"&&e!==null)for(const[o,i]of Object.entries(e))if(o.startsWith("data-")||o.startsWith("aria-")||o==="class")t[o]=i;else if(o==="disabled"&&r&&J(r)){const a=i&&typeof i=="object"&&"value"in i;(()=>{try{return d.isReactiveState(i)}catch{return!1}})()||a?n[o]=i:t[o]=i}else n[o]=i;else if(typeof e=="string"){if(!s)return;try{const o=Ae(e,s);if(typeof o=="object"&&o!==null){for(const[i,a]of Object.entries(o))if(i.startsWith("data-")||i.startsWith("aria-")||i==="class")t[i]=a;else if(i==="disabled"&&r&&J(r)){const f=a&&typeof a=="object"&&"value"in a;(()=>{try{return d.isReactiveState(a)}catch{return!1}})()||f?n[i]=a:t[i]=a}else n[i]=a;return}else{t[e]=o;return}}catch{const o=d.getNestedValue(s,e);t[e]=o}}}function Et(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ae(e,t)}else s=e;const r=String(n.style||"");let o=r;if(s){if(r){const i=String(r).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(r){const i=String(r).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!==r&&(o?n.style=o:n.style=void 0)}function Ae(e,n){return mt.evaluate(e,n)}function Ct(e,n,t,s){let r;if(typeof e=="string"){if(!t)return;r=Ae(e,t)}else r=e;try{if(r&&typeof r=="object"){if(d.isReactiveState(r))r=r.value;else if("value"in r&&typeof r.value<"u"){const g=r.value;g instanceof Node||(r=g)}}}catch{}let o=[];if(typeof r=="string")o=[r];else if(Array.isArray(r))o=r.filter(Boolean);else if(typeof r=="object"&&r!==null)for(const[g,S]of Object.entries(r))S&&o.push(g);const i=o.join(" "),a=s&&s.class||n.class||"",f=a?`${a} ${i}`.trim():i.trim();f?n.class=f:n.class=void 0}function kt(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ae(e,t)}else s=e;let r="";if(typeof s=="string")r=s;else if(s&&typeof s=="object"){const i=[];for(const[a,f]of Object.entries(s))if(f!=null&&f!==""){const g=a.replace(/[A-Z]/g,m=>`-${m.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 h=String(f);typeof f=="number"&&S.includes(g)&&(h=`${f}px`),i.push(`${g}: ${h}`)}r=i.join("; ")+(i.length>0?";":"")}const o=String(n.style||"");n.style=o+(o&&!o.endsWith(";")?"; ":"")+r}function At(e,n,t){let s=e;typeof e=="string"&&t&&(s=Ae(e,t)),d.isReactiveState(s)?n.reactiveRef=s:n.ref=s}function Xe(e,n,t,s){const r={},o={...s||{}},i={};for(const[a,f]of Object.entries(e)){const{value:g,modifiers:S,arg:h}=f;if(a==="model"||a.startsWith("model:")){const m=a.split(":"),k=m.length>1?m[1]:h;St(g,S,r,o,i,n,t,k);continue}switch(a){case"bind":vt(g,r,o,n,t);break;case"show":Et(g,o,n);break;case"class":Ct(g,o,n,s);break;case"style":kt(g,o,n);break;case"ref":At(g,r,n);break}}try{if(Object.prototype.hasOwnProperty.call(r,"disabled")&&t&&J(t)){const f=r.disabled,g=f&&typeof f=="object"&&"value"in f;let S=!1;try{S=d.isReactiveState(f)}catch{S=!1}!g&&!S&&(o.disabled=f,delete r.disabled)}}catch{}return{props:r,attrs:o,listeners:i}}function de(e){return e?e.split(/\s+/).filter(Boolean):[]}function pe(e,n){if(n.length===0)return;const t=n.filter(s=>s&&!e.classList.contains(s));t.length>0&&e.classList.add(...t)}function fe(e,n){if(n.length===0)return;const t=n.filter(Boolean);t.length>0&&e.classList.remove(...t)}function _t(e){const n=window.getComputedStyle(e),t=n.transitionDuration||"0s",s=n.transitionDelay||"0s",r=o=>{const i=parseFloat(o);return o.includes("ms")?i:i*1e3};return r(t)+r(s)}function Qe(e,n){return new Promise(t=>{const s=n??_t(e);if(s<=0){t();return}let r=!1;const o=()=>{r||(r=!0,e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",i),t())},i=()=>o();e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",i),setTimeout(o,s+50)})}async function be(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeEnter)try{s.onBeforeEnter(e)}catch(h){P.devError("Transition onBeforeEnter error:",h)}if(!r)return s?.onEnter?new Promise(h=>{const m=s.onEnter;typeof m=="function"?m(e,()=>{if(s?.onAfterEnter)try{s.onAfterEnter(e)}catch(k){P.devError("Transition onAfterEnter error:",k)}h()}):h()}):void 0;const i=de(t?.enterFrom),a=de(t?.enterActive),f=de(t?.enterTo);pe(e,i),e.offsetHeight,pe(e,a),e.offsetHeight;let g;if(s?.onEnter){const h=new Promise(m=>{g=m});try{const m=s.onEnter;typeof m=="function"&&m(e,()=>{g&&g()})}catch(m){P.devError("Transition onEnter error:",m)}g&&await h}await new Promise(h=>requestAnimationFrame(()=>h())),e.offsetHeight,fe(e,i),pe(e,f),e.offsetHeight,await new Promise(h=>requestAnimationFrame(()=>h()));let S;if(typeof o=="number"?S=o:o&&typeof o=="object"&&"enter"in o&&(S=o.enter),await Qe(e,S),fe(e,a),s?.onAfterEnter)try{s.onAfterEnter(e)}catch(h){P.devError("Transition onAfterEnter error:",h)}}async function Pe(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeLeave)try{s.onBeforeLeave(e)}catch(h){P.devError("Transition onBeforeLeave error:",h)}if(!r)return s?.onLeave?new Promise(h=>{const m=s.onLeave;typeof m=="function"?m(e,()=>{if(s?.onAfterLeave)try{s.onAfterLeave(e)}catch(k){P.devError("Transition onAfterLeave error:",k)}h()}):h()}):void 0;const i=de(t?.leaveFrom),a=de(t?.leaveActive),f=de(t?.leaveTo);pe(e,i),e.offsetHeight,pe(e,a);let g;if(s?.onLeave){const h=new Promise(m=>{g=m});try{const m=s.onLeave;typeof m=="function"&&m(e,()=>{g&&g()})}catch(m){P.devError("Transition onLeave error:",m)}g&&await h}await new Promise(h=>requestAnimationFrame(()=>h())),fe(e,i),pe(e,f);let S;if(typeof o=="number"?S=o:o&&typeof o=="object"&&"leave"in o&&(S=o.leave),await Qe(e,S),fe(e,a),fe(e,f),fe(e,i),s?.onAfterLeave)try{s.onAfterLeave(e)}catch(h){P.devError("Transition onAfterLeave error:",h)}}const et=new WeakMap,tt=new WeakMap;function Le(e){if(!e)return;const n=et.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t.key!=null)return String(t.key)}catch{}if(e instanceof Element){const t=e.getAttribute("data-anchor-key");if(t)return t}}function q(e,n){try{et.set(e,n)}catch{}try{e.key=n}catch{}try{if(e instanceof Element){const t=d.safeSerializeAttr(n);t!==null&&H.setAttributeSmart(e,"data-anchor-key",t)}}catch{}}function Tt(e){if(!e)return;const n=tt.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t._transitionGroup!=null)return t._transitionGroup}catch{}}function wt(e,n){try{tt.set(e,n)}catch{}try{e._transitionGroup=n}catch{}}const Re=new WeakMap;function oe(e,n){if(n){if(e instanceof Element){G.cleanup(e);const t=[];for(const s in n)n[s]===e&&t.push(s);for(const s of t)delete n[s]}if(e.hasChildNodes()){const t=e.childNodes;for(let s=t.length-1;s>=0;s--)oe(t[s],n)}}}function Se(e,n,t){if(typeof e=="string")return;const s=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),r=e.props?.ref??(e.props?.props&&e.props.props.ref);if(s)try{if(d.isReactiveState(s)||typeof s=="object"&&"value"in s)s.value=n;else if(typeof s=="function")s(n);else if(typeof s=="string"&&t)try{const o=String(s);t[o]=n}catch{}}catch{}else if(r&&t)try{const o=String(r);t[o]=n}catch{}}function Ie(e,n){if(Array.isArray(e)){const o=new Set,i=new Map;return e.map(a=>{if(!a||typeof a!="object")return a;let f=a.props?.key??a.key;if(!f){const h=a.tag||"node",k=[a.props?.attrs?.id,a.props?.attrs?.name,a.props?.attrs?.["data-key"],a.props?.props?.id,a.props?.props?.name,a.props?.props?.dataKey,a.props?.props?.["data-key"]].find(j=>j!=null)??"";f=k?`${n}:${h}:${k}`:`${n}:${h}`}let g=f;if(o.has(g)){const h=(i.get(g)??1)+1;i.set(g,h),g=`${f}#${h}`}i.set(f,(i.get(f)??0)+1),o.add(g);let S=a.children;return Array.isArray(S)&&(S=Ie(S,g)),{...a,key:g,children:S}})}const t=e,s=t.props?.key??t.key??n;let r=t.children;return Array.isArray(r)&&(r=Ie(r,s)),{...t,key:s,children:r}}function Ve(e,n,t,s){const r=t.directives??{},o=t.attrs?{...t.attrs}:{},i=Xe(r,s,e,o),a={...n.props||{},...t.props||{},...i.props||{}},f={...o||{},...i.attrs||{}},g=n.props??{},S=a,h=!!(t?.isCustomElement??n?.isCustomElement??!1);let m=!1;const k=new Set;for(const c in g)k.add(c);for(const c in S)k.add(c);for(const c of k){const A=g[c],y=S[c];let L=A,E=y;if(d.safe(()=>{d.isReactiveState(A)?L=A.peek():Ee(A)&&(L=A.value)}),d.safe(()=>{d.isReactiveState(y)?E=y.peek():Ee(y)&&(E=y.value)}),!(A===y&&L===E))if(m=!0,c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const u=He(y),b=u==null?"":String(u);e.value!==b&&(e.value=b)}else if(c==="checked"&&e instanceof HTMLInputElement){const u=He(y);e.checked=!!u}else if(c.startsWith("on")&&typeof y=="function"){const u=Ye(c);typeof A=="function"&&G.removeListener(e,u,A),typeof y=="function"&&G.addListener(e,u,y);try{if(u&&u.startsWith("update:")){const b=u.split(":",2)[1],l=S[b];let v=[];try{if(d.isReactiveState(l)){const T=l.value;v=T&&typeof T=="object"?Object.keys(T):[]}else l&&typeof l=="object"&&(v=Object.keys(l))}catch{v=[]}const _=v.filter(T=>typeof T=="string"&&!T.startsWith("_")&&T!=="constructor");for(const T of _){const R=`update:${T}`,$=x=>{const M=x.detail!==void 0?x.detail:x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement||x.target instanceof HTMLSelectElement?x.target.value:void 0,W={...d.isReactiveState(l)?l.value||{}:S[b]||{},[T]:M};try{typeof y=="function"&&y({detail:W})}catch{}};d.safe(()=>{G.addListener(e,R,$)})}}}catch{}}else if(y==null)H.removeAttributeSmart(e,c);else{const u=t?.isCustomElement??n?.isCustomElement??!1;if(u||c in e)try{e[c]=y,c==="disabled"&&y===!1&&!u&&J(e)&&H.removeAttributeSmart(e,"disabled")}catch{}else y===!1&&H.removeAttributeSmart(e,c)}}const j=i.listeners??{},C=Re.get(e)??{};for(const[c,A]of Object.entries(C))G.removeListener(e,c,A);for(const[c,A]of Object.entries(j))G.addListener(e,c,A);Object.keys(j).length>0?Re.set(e,j):Re.delete(e);const N={...n.attrs??{}},p=f,w=i&&i.attrs||{};if(Object.prototype.hasOwnProperty.call(w,"class")&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(N.class=c)}if(Object.prototype.hasOwnProperty.call(w,"style")&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(N.style=c)}try{if(Object.prototype.hasOwnProperty.call(w,"class")&&w.class===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(N.class=c)}if(Object.prototype.hasOwnProperty.call(w,"style")&&w.style===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(N.style=c)}try{if(typeof e.getAttribute=="function"){const c=e.getAttribute("class");try{e instanceof HTMLInputElement&&e.type==="text"&&c!==null&&c!==N.class&&(N.class=c)}catch{}}}catch{}}catch{}for(const c in{...N,...p}){const A=N[c],y=p[c];let L=A,E=y;if(d.isReactiveState(A)&&(L=A.peek()),d.isReactiveState(y)&&(E=y.peek()),L!==E)if(m=!0,E==null||E===!1)d.safe(()=>{H.removeAttributeSmart(e,c)}),Q(n,c,void 0),c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?d.safe(()=>{e.value=""}):e instanceof HTMLSelectElement?d.safe(()=>{e.value=""}):e instanceof HTMLProgressElement&&d.safe(()=>{e.value=0})),c==="checked"&&e instanceof HTMLInputElement&&d.safe(()=>{e.checked=!1}),c==="disabled"&&J(e)&&d.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(c==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){d.safe(()=>{e.value=E??""});continue}else if(e instanceof HTMLSelectElement){d.safe(()=>{e.value=E??""});continue}else if(e instanceof HTMLProgressElement){d.safe(()=>{e.value=Number(E)});continue}}if(c==="checked"&&e instanceof HTMLInputElement){d.safe(()=>{e.checked=!!E});continue}if(c==="style"){const b=d.safeSerializeAttr(E);b!==null&&H.setAttributeSmart(e,c,String(b)),Q(n,c,E);continue}if(c==="class"){const b=d.safeSerializeAttr(E);b!==null&&H.setAttributeSmart(e,c,String(b)),Q(n,c,E);continue}if(c==="disabled"&&J(e)){d.safe(()=>{const b=ae(E);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=b)}),ae(E)?d.safe(()=>{H.setAttributeSmart(e,c,"")}):d.safe(()=>{H.removeAttributeSmart(e,c)});continue}const u=e.namespaceURI==="http://www.w3.org/2000/svg";if(h&&!u&&c.includes("-"))if(d.isClassLikeAttr(c)){const b=d.safeSerializeAttr(y??E);if(b!==null){try{H.setAttributeSmart(e,c,String(b))}catch{}Q(n,c,E)}}else{const b=d.toCamel(c);try{const l=e;l[b]=d.isReactiveState(y)?y:E,Q(n,c,E)}catch{const l=d.safeSerializeAttr(y??E);l!==null&&H.setAttributeSmart(e,c,String(l))}}else if(!u&&c in e)try{const b=e;b[c]=d.isReactiveState(y)?y:E,Q(n,c,E)}catch{const b=d.safeSerializeAttr(E);b!==null&&(H.setAttributeSmart(e,c,String(b)),Q(n,c,E))}else{const b=d.safeSerializeAttr(E);b!==null&&(H.setAttributeSmart(e,c,String(b)),Q(n,c,E))}}}try{if(J(e)){const c=a.disabled;let A;try{const L=Object.prototype.hasOwnProperty.call(i.props||{},"disabled"),E=c&&typeof c=="object"&&"value"in c;let u=!1;d.safe(()=>{u=!!d.isReactiveState(c)});const b=xe(c);u||E||L||b?A=c:A=f.disabled}catch{A=f.disabled}const y=ae(A);d.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=y)}),y?d.safe(()=>{H.setAttributeSmart(e,"disabled","")}):d.safe(()=>{H.removeAttributeSmart(e,"disabled")})}}catch{}if(h&&m){const c=e;d.safe(()=>{c._applyProps?.(c._cfg)}),d.safe(()=>{typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render?.(c._cfg)})}}function F(e,n,t,s=null){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const p=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&q(p,e.key),p}if(e.tag==="#raw"){const p=typeof e.children=="string"?e.children:"";return P.devWarn("[#raw] Inserting unsanitized HTML. Ensure the content is trusted or sanitized before use — unsanitized input can lead to XSS vulnerabilities."),document.createRange().createContextualFragment(p)}if(e.tag==="#anchor"){const p=e,w=Array.isArray(p.children)?p.children:[],c=document.createTextNode(""),A=document.createTextNode("");p.key!=null&&(q(c,`${p.key}:start`),q(A,`${p.key}:end`)),p._startNode=c,p._endNode=A;const y=document.createDocumentFragment();y.appendChild(c);for(const L of w){const E=F(L,n,t,s);if(p.key!=null&&E instanceof Element&&!E.hasAttribute("data-anchor-key")){const u=L;u&&typeof u=="object"&&u.key!=null||q(E,String(p.key))}y.appendChild(E)}return y.appendChild(A),y}const r=e&&typeof e=="object"&&e.props&&e.props.attrs?e.props.attrs:void 0,i=(r&&typeof r.xmlns=="string"?String(r.xmlns):void 0)??s??H.TAG_NAMESPACE_MAP[e.tag]??null,a=i?document.createElementNS(i,e.tag):document.createElement(e.tag);e.key!=null&&q(a,e.key),e.props&&e.props?._transitionGroup&&wt(a,e.props?._transitionGroup);const{props:f={},attrs:g={},directives:S={}}=e.props??{},h=Xe(S,n,a instanceof HTMLElement?a:void 0,g),m={...f,...h.props},k={...g,...h.attrs};try{const p=(k&&k.class)??(m&&m.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class),w=d.safeSerializeAttr(p);if(w!==null){const c=String(w).trim();c&&H.setAttributeSmart(a,"class",c)}}catch{}try{if(m.disabled!==void 0&&a&&J(a)){const p=m.disabled,w=p&&typeof p=="object"&&"value"in p;let c=!1;try{c=d.isReactiveState(p)}catch{c=!1}!w&&!c&&d.safe(()=>{k.disabled=p,delete m.disabled})}}catch{}const j=a.namespaceURI==="http://www.w3.org/2000/svg";for(const p in k){const w=k[p];if(typeof p!="string"||/\[object Object\]/.test(p))continue;const c=He(w);if(typeof c=="boolean")c?H.setAttributeSmart(a,p,""):d.safe(()=>{H.removeAttributeSmart(a,p)});else if(c!=null){if(p==="disabled"&&J(a)){const A=m.disabled,y=xe(A)?A:c,L=ae(y);d.safe(()=>{a.disabled=L}),L?d.safe(()=>{H.setAttributeSmart(a,p,"")}):d.safe(()=>{H.removeAttributeSmart(a,p)});continue}if(!j&&p==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLProgressElement))try{a instanceof HTMLProgressElement?a.value=Number(c):a.value=String(c??"")}catch{const A=d.safeSerializeAttr(c);A!==null&&H.setAttributeSmart(a,p,String(A))}else if(!j&&p==="checked"&&a instanceof HTMLInputElement)try{a.checked=!!c}catch{const A=d.safeSerializeAttr(c);A!==null&&H.setAttributeSmart(a,p,String(A))}else if(!j&&p in a)try{a[p]=c,p==="disabled"&&c===!1&&J(a)&&H.removeAttributeSmart(a,"disabled"),Q(e.props,p,c)}catch{const A=d.safeSerializeAttr(c);A!==null&&H.setAttributeSmart(a,p,String(A))}else if((e.props?.isCustomElement??!1)&&!j&&p.includes("-")){const y=d.toCamel(p);try{a[y]=c}catch{const L=d.safeSerializeAttr(c);L!==null&&H.setAttributeSmart(a,p,String(L))}}else{const y=d.safeSerializeAttr(c);y!==null&&H.setAttributeSmart(a,p,String(y))}}}for(const p in m){const w=m[p];if(!(typeof p!="string"||/\[object Object\]/.test(p)))if(p==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement)){const c=typeof w=="object"&&w!==null&&Ee(w)?w.value:w;d.safe(()=>{a.value=String(c??"")})}else if(p.startsWith("on")&&typeof w=="function"){const c=Ye(p),A=c.includes(":")?(()=>{const y=c.split(":"),L=y[1];if(L.includes("-")){const E=L.split("-").map((u,b)=>b===0?u:u.charAt(0).toUpperCase()+u.slice(1)).join("");return`${y[0]}:${E}`}else{const E=L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${y[0]}:${E}`}})():c;h.listeners&&(h.listeners[c]||h.listeners[A])||G.addListener(a,c,w)}else{if(p.startsWith("on")&&w===void 0)continue;if(w==null||w===!1)H.removeAttributeSmart(a,p);else{const c=e.props?.isCustomElement??!1,A=typeof w=="object"&&w!==null&&d.isReactiveState(w)?w:Ee(w)&&typeof w.value<"u"?w.value:w;if(p==="class"||p==="style"){try{const y=d.safeSerializeAttr(A);y!==null&&H.setAttributeSmart(a,p,String(y))}catch{}continue}if(c||p in a)try{const y=typeof w=="object"&&w!==null&&d.isReactiveState(w)?w:Ee(w)?w.value:w;if(p==="disabled"&&J(a)){const L=m.disabled!==void 0?m.disabled:y,E=ae(L);d.safe(()=>{a.disabled=E}),E?d.safe(()=>{H.setAttributeSmart(a,p,"")}):d.safe(()=>{H.removeAttributeSmart(a,p)});continue}try{if(typeof a[p]=="boolean"){let E=y;typeof y=="string"?y==="false"?E=!1:y==="true"?E=!0:E=!!y&&y!=="":E=!!y,a[p]=E}else a[p]=y}catch{a[p]=y}}catch{}}}}const C=h.listeners??{};for(const[p,w]of Object.entries(C))G.addListener(a,p,w);Object.keys(C).length>0&&Re.set(a,C);const N={...e,props:{...e.props,...h.props}};Se(N,a,t);try{const p=a;if(typeof p._applyProps=="function")try{p._applyProps(p._cfg)}catch{}typeof p.requestRender=="function"?p.requestRender():typeof p._render=="function"&&p._render(p._cfg)}catch{}if(Array.isArray(e.children)){const p=e.tag==="foreignObject"&&i===H.SVG_NS?null:a.namespaceURI??null;for(const w of e.children)a.appendChild(F(w,n,t,p))}else typeof e.children=="string"&&(a.textContent=e.children);try{if(a instanceof HTMLSelectElement&&k&&Object.prototype.hasOwnProperty.call(k,"value"))try{a.value=String(k.value??"")}catch{}}catch{}try{if(J(a)){const p=m.disabled,w=k.disabled,c=p&&typeof p=="object"&&"value"in p;let A=!1;try{A=!!d.isReactiveState(p)}catch{A=!1}const L=A||c||xe(p)?p:w,E=ae(L);d.safe(()=>{a.disabled=E}),E?d.safe(()=>{H.setAttributeSmart(a,"disabled","")}):d.safe(()=>{H.removeAttributeSmart(a,"disabled")})}}catch{}return a}function Lt(e,n,t,s,r){if(typeof t=="string"){e.textContent!==t&&(e.textContent=t);return}if(!Array.isArray(t))return;const o=e.childNodes,i=[];for(let C=0;C<o.length;C++)i.push(o[C]);const a=Array.isArray(n)?n:[],f=Tt(e);if(f){const C=c=>{if(typeof c=="string")return c.startsWith("each-")?c.substring(5):c;if(typeof c=="number")return String(c)},N=[],p=[];for(const c of t)if(c&&c.tag==="#anchor"){const A=Array.isArray(c.children)?c.children:[];for(const y of A){const L=C(y.key??c.key??"unknown");N.push({...y,key:L})}}else c&&N.push({...c,key:C(c.key)});for(const c of a)if(c&&c.tag==="#anchor"){const A=Array.isArray(c.children)?c.children:[];for(const y of A){const L=C(y.key??c.key??"unknown");p.push({...y,key:L})}}else c&&p.push({...c,key:C(c.key)});if(N.some(c=>c&&c.key!=null)||p.some(c=>c&&c.key!=null)){const c=new Map,A=new Map;for(const l of p)if(l&&l.key!=null){const v=String(l.key);c.set(v,l)}for(let l=0;l<i.length;l++){const v=i[l];let _=Le(v);if(_=C(_),_!=null&&v instanceof Element&&v.nodeType===Node.ELEMENT_NODE){let T=typeof _=="string"&&_.includes(":")?_.substring(0,_.lastIndexOf(":")):_;T=String(T),A.set(T,v)}}const y=new Set,L=new Map,E=i.length>0;if(f.moveClass&&E)for(let l=0;l<i.length;l++){const v=i[l];if(v instanceof HTMLElement&&v.parentElement){const _=v.getBoundingClientRect();L.set(v,_)}}const u=[];for(const l of N){let v=l.key;if(v==null)continue;v=String(v);const _=c.get(v);let T=A.get(v);if(T&&_){const R=ve(T,_,l,s);y.add(T);const $=String(v);q(R,$),u.push({node:R,key:v,newVNode:l,oldVNode:_,isNew:!1})}else{T=F(l,s,void 0,e instanceof Element?e.namespaceURI??null:null),q(T,String(v)),e.appendChild(T);const R=E||f.appear===!0;T instanceof HTMLElement&&R&&be(T,f).catch($=>{P.devError("Enter transition error:",$)}),u.push({node:T,key:v,newVNode:l,isNew:!0})}}const b=[];for(let l=0;l<i.length;l++){const v=i[l],_=Le(v);if(!y.has(v)&&_!=null&&v instanceof HTMLElement){const R=Pe(v,f).then(()=>{e.contains(v)&&e.removeChild(v)}).catch($=>{P.devError("Leave transition error:",$),e.contains(v)&&e.removeChild(v)});b.push(R)}}if(b.length===0){let l=e.firstChild;for(const{node:v}of u)v!==l&&e.insertBefore(v,l),l=v.nextSibling;if(f.moveClass&&L.size>0){const v=[];for(const{node:_,isNew:T}of u)if(!T&&_ instanceof HTMLElement){const R=L.get(_);if(R){const $=_.getBoundingClientRect(),x=R.left-$.left,M=R.top-$.top;if(x!==0||M!==0){const D=f.moveClass.split(/\s+/).filter(W=>W);v.push({node:_,deltaX:x,deltaY:M,moveClasses:D})}}}if(v.length>0){for(const{node:_,deltaX:T,deltaY:R}of v)_.style.transform=`translate(${T}px, ${R}px)`,_.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:_,moveClasses:T}of v)for(const R of T)_.classList.add(R);requestAnimationFrame(()=>{const _=f.moveClass||"",T=_.match(/duration-(\d+)/),R=T?`${T[1]}ms`:"300ms",$=_.match(/ease-(out|in|in-out|linear)/),x=$?`ease-${$[1]}`:"ease-out";for(const{node:M}of v)M.style.transition=`transform ${R} ${x}`;requestAnimationFrame(()=>{for(const{node:M,moveClasses:D}of v){M.style.removeProperty("transform");const W=()=>{for(const Z of D)M.classList.remove(Z);M.style.removeProperty("transition"),M.removeEventListener("transitionend",W),M.removeEventListener("transitioncancel",W)};M.addEventListener("transitionend",W,{once:!0}),M.addEventListener("transitioncancel",W,{once:!0})}})})})})}}}return}}const g=new Map;for(const C of a)C&&C.key!=null&&g.set(C.key,C);const S=new Map;for(let C=0;C<i.length;C++){const N=i[C],p=Le(N);p!=null&&S.set(p,N)}const h=new Set;let m=e.firstChild;function k(C,N){let p=C;for(;p&&(h.add(p),p!==N);)p=p.nextSibling}function j(C,N,p,w,c,A=!0){const y=[];let L=C.nextSibling;for(;L&&L!==N;)y.push(L),L=L.nextSibling;const E=Array.isArray(p)?p:[];if(w.some(b=>b&&b.key!=null)||E.some(b=>b&&b.key!=null)){const b=new Map,l=new Map;for(const R of E)R&&R.key!=null&&b.set(R.key,R);for(const R of y){const $=Le(R);$!=null&&l.set($,R)}const v=c&&c.state==="visible"&&E.length===0&&w.length>0,_=new Set;let T=C.nextSibling;for(const R of w){if(typeof R=="object"&&R.tag==="#anchor"){const x=R.key,M=`${x}:start`,D=`${x}:end`,W=l.get(M),Z=l.get(D),K=Array.isArray(R.children)?R.children:[],I=b.get(x);let O,B;if(W&&Z&&e.contains(W))O=W,B=Z,j(O,B,I?.children,K);else{O=document.createTextNode(""),B=document.createTextNode(""),q(O,M),q(B,D),e.insertBefore(O,T);for(const ce of K){const te=F(ce,s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(te,T),_.add(te)}e.insertBefore(B,T)}let z=O;for(;z&&(_.add(z),z!==B);)z=z.nextSibling;R._startNode=O,R._endNode=B,T=B.nextSibling;continue}let $;if(R.key!=null&&l.has(R.key)){const x=b.get(R.key);$=ve(l.get(R.key),x,R,s),_.add($),c&&$ instanceof HTMLElement&&v&&c.appear&&be($,c).catch(M=>{P.devError("Transition enter error (appear):",M)}),$!==T&&e.contains($)&&e.insertBefore($,T)}else $=F(R,s,void 0,e instanceof Element?e.namespaceURI??null:null),e.insertBefore($,T),_.add($),c&&$ instanceof HTMLElement&&A&&be($,c).catch(x=>{P.devError("Transition enter error:",x)});T=$.nextSibling}for(const R of y)!_.has(R)&&e.contains(R)&&(c&&R instanceof HTMLElement&&A?Pe(R,c).then(()=>{e.contains(R)&&e.removeChild(R)}).catch($=>{P.devError("Transition leave error:",$),e.contains(R)&&e.removeChild(R)}):e.removeChild(R))}else{const b=Math.min(E.length,w.length);for(let l=0;l<b;l++){const v=E[l],_=w[l],T=ve(y[l],v,_,s);T!==y[l]&&(e.insertBefore(T,y[l]),e.removeChild(y[l]))}for(let l=b;l<w.length;l++){const v=F(w[l],s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(v,N),c&&v instanceof HTMLElement&&A&&be(v,c).catch(_=>{P.devError("Transition enter error:",_)})}for(let l=b;l<y.length;l++){const v=y[l];c&&v instanceof HTMLElement&&A?Pe(v,c).then(()=>{e.contains(v)&&e.removeChild(v)}).catch(_=>{P.devError("Transition leave error:",_),e.contains(v)&&e.removeChild(v)}):e.removeChild(v)}}}for(const C of t){let N;if(C.tag==="#anchor"){const p=C.key,w=`${p}:start`,c=`${p}:end`;let A=S.get(w),y=S.get(c);const L=Array.isArray(C.children)?C.children:[];if(A||(A=document.createTextNode(""),q(A,w)),y||(y=document.createTextNode(""),q(y,c)),C._startNode=A,C._endNode=y,!e.contains(A)||!e.contains(y)){e.insertBefore(A,m);const E=C._transition,b=!(E&&E.state==="visible"&&L.length>0)||E.appear;for(const l of L){const v=F(l,s,r,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(v,m),E&&v instanceof HTMLElement&&b&&be(v,E).catch(_=>{P.devError("Transition enter error:",_)})}e.insertBefore(y,m)}else{const E=C._transition,b=g.get(p)._transition,l=b&&b.state!==E?.state,v=E&&E.state==="visible"&&L.length>0&&!l,_=l||!v||E?.appear===!0;j(A,y,g.get(p)?.children,L,E,_)}k(A,y),m=y.nextSibling;continue}if(C.key!=null&&S.has(C.key)){const p=g.get(C.key);N=ve(S.get(C.key),p,C,s,r),h.add(N),N!==m&&e.contains(N)&&(m&&!e.contains(m)&&(m=null),e.insertBefore(N,m))}else N=F(C,s,r,e instanceof Element?e.namespaceURI??null:null),m&&!e.contains(m)&&(m=null),e.insertBefore(N,m),h.add(N);m=N.nextSibling}for(let C=0;C<i.length;C++){const N=i[C];!h.has(N)&&e.contains(N)&&(oe(N,r),e.removeChild(N))}}function ve(e,n,t,s,r){if(n&&typeof n!="string"&&n.props?.ref&&r&&oe(e,r),n===t)return e;if(typeof t=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==t&&(e.textContent=t),e;{const i=document.createTextNode(t);return e.parentNode?.replaceChild(i,e),i}}if(t&&typeof t!="string"&&t.tag==="#anchor"){const i=t,a=Array.isArray(i.children)?i.children:[],f=i._startNode??document.createTextNode(""),g=i._endNode??document.createTextNode("");i.key!=null&&(q(f,`${i.key}:start`),q(g,`${i.key}:end`)),i._startNode=f,i._endNode=g;const S=document.createDocumentFragment();S.appendChild(f);for(const h of a){const m=F(h,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);S.appendChild(m)}return S.appendChild(g),e.parentNode?.replaceChild(S,e),f}if(!t){oe(e,r);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!n||typeof n=="string"){oe(e,r);const i=F(t,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return Se(t,i,r),e.parentNode?.replaceChild(i,e),i}if(t.tag==="#anchor"){const i=Array.isArray(t.children)?t.children:[],a=t._startNode??document.createTextNode(""),f=t._endNode??document.createTextNode("");t.key!=null&&(q(a,`${t.key}:start`),q(f,`${t.key}:end`)),t._startNode=a,t._endNode=f;const g=document.createDocumentFragment();g.appendChild(a);for(const S of i)g.appendChild(F(S,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null));return g.appendChild(f),e.parentNode?.replaceChild(g,e),a}if(typeof n!="string"&&typeof t!="string"&&n.tag===t.tag&&n.key===t.key){const i=e;return Ve(i,n.props||{},t.props||{},s),Lt(i,n.children,t.children,s,r),Se(t,i,r),i}if(typeof n!="string"&&typeof t!="string"&&n.tag===t.tag&&(n.tag&&String(n.tag).includes("-")||t.props&&t.props.isCustomElement||n.props&&n.props.isCustomElement))try{const a=e;return Ve(a,n.props||{},t.props||{},s),Se(t,a,r),a}catch{}oe(e,r);const o=F(t,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return Se(t,o,r),e.parentNode?.replaceChild(o,e),o}function nt(e,n,t,s){let r;Array.isArray(n)?n.length===1?(r=n[0],r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})):r={tag:"div",key:"__root__",children:n}:(r=n,r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})),r&&typeof r=="object"&&r.tag==="#anchor"&&(r={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[r]}),r=Ie(r,String(r.key??"root"));const o=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;o&&i?typeof o!="string"&&typeof r!="string"&&o.tag===r.tag&&o.key===r.key?a=ve(i,o,r,t,s):(a=F(r,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.replaceChild(a,i)):(a=F(r,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const f=[];for(let S=0;S<e.childNodes.length;S++){const h=e.childNodes[S];h!==a&&h.nodeName!=="STYLE"&&(oe(h,s),f.push(h))}f.forEach(S=>e.removeChild(S));const g=r&&typeof r=="object"&&r.props?{...r,props:{...r.props,attrs:r.props.attrs?{...r.props.attrs}:void 0,props:r.props.props?{...r.props.props}:void 0}}:r;e._prevVNode=g,e._prevDom=a}const Ce=[],qe=new WeakMap,he=new WeakMap;function Nt(e,n){he.has(e)||he.set(e,new Set),he.get(e).add(n)}function Rt(e,n){const t=he.get(e);t&&(t.delete(n),t.size===0&&he.delete(e))}function Mt(e,n,t,s,r,o,i,a){if(e){Ce.push(t);try{const f=n.render(t);if(f instanceof Promise){o(!0);const g=e.host.isConnected,S=e,h=S._asyncRenderToken=(S._asyncRenderToken??0)+1;f.then(m=>{g&&!e.host.isConnected||S._asyncRenderToken===h&&(o(!1),i(null),Fe(e,m,t,s,r),a(e.innerHTML))}).catch(m=>{g&&!e.host.isConnected||S._asyncRenderToken===h&&(o(!1),i(m instanceof Error?m:new Error(String(m))))});return}Fe(e,f,t,s,r),a(e.innerHTML)}catch(f){i(f instanceof Error?f:new Error(String(f)))}finally{Ce.pop()}}}function Fe(e,n,t,s,r){if(e)try{nt(e,Array.isArray(n)?n:[n],t,s),r(e.innerHTML)}catch(o){throw P.devError("Error during VDOM rendering:",o),o}}function jt(e,n,t,s,r,o,i){o!==null&&clearTimeout(o);const g=Date.now()-n<16,S=(()=>{try{return typeof window<"u"&&!!window.Cypress}catch{return!1}})(),h=(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"&&!S}catch{return!1}})(),m=h||S;if(g){const C=t+1;r(C);const N=m?50:10,p=m?100:25,w=h?12:50;if(C===N&&!m)P.devWarn(`⚠️ Component rendering frequently. Performance may be impacted.
|
|
2
|
+
Common causes:
|
|
3
|
+
• State updates during render cycle
|
|
4
|
+
• Event handlers with immediate function calls
|
|
5
|
+
• Missing effect dependencies`);else if(C===p&&!m)P.devWarn(`⚠️ Component is re-rendering rapidly. Applying throttling.
|
|
6
|
+
This might indicate:
|
|
7
|
+
• Event handler calling function immediately: @click="\${fn()}" should be @click="\${fn}"
|
|
8
|
+
• State modification during render
|
|
9
|
+
• Missing dependencies in computed/watch`);else if(C>=w){P.devError(`🛑 Infinite render loop detected. Stopping to prevent browser freeze.
|
|
10
|
+
Possible causes:
|
|
11
|
+
• State updates triggering immediate re-renders
|
|
12
|
+
• Computed values changing during evaluation
|
|
13
|
+
• Circular dependencies in reactive system`),i(null);return}}else r(0);let k=0;m||(t>=40?k=500:t>=25?k=100:t>=15&&(k=16));const j=()=>{s(Date.now());try{e()}catch(C){P.devError("Error during render execution:",C)}finally{i(null)}};if(k>0){const C=setTimeout(j,k);i(C)}else m?j():(i({}),queueMicrotask(j))}function $t(e,n){let t=n;try{const s=he.get(e);if(s?.size)for(const r of s)try{const o=r.lastHtmlStringForJitCSS;o?.trim()&&(t+=`
|
|
14
|
+
`+o)}catch{}else{const r=e.querySelectorAll("*");for(const o of r)try{const i=o.lastHtmlStringForJitCSS;i?.trim()&&(t+=`
|
|
15
|
+
`+i)}catch{}}}catch{}return t}function Ge(e){return"adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype}function Je(e,n){let t=e.querySelector("style[data-cer-runtime]");t||(t=document.createElement("style"),H.setAttributeSmart(t,"data-cer-runtime","true"),e.appendChild(t));try{t.textContent=n}catch{}}function Ot(e,n,t,s,r){if(!e)return;const o=$t(e,t);if(qe.get(e)===o)return;qe.set(e,o);const a=V.isJITCSSActiveFor(e)?V.processJITCSS(o):"",f=V.getProseStyleSheet(),g=n._computedStyle;if(!a?.trim()&&!g&&!f){if(r(null),Ge(e))e.adoptedStyleSheets=[V.getBaseResetSheet(),le.getTransitionStyleSheet()];else{const p=V.minifyCSS(V.baseReset),w=le.getTransitionStyleSheet();let c="";try{w?.cssRules&&(c=Array.from(w.cssRules).map(y=>y.cssText).join(`
|
|
16
|
+
`))}catch{c=""}const A=V.minifyCSS(`${p}
|
|
17
|
+
${c}`);Je(e,A);try{e.adoptedStyleSheets=[V.getBaseResetSheet(),le.getTransitionStyleSheet()]}catch{}}return}let S="";if(g&&(S+=g+`
|
|
18
|
+
`),a&&(S+=a+`
|
|
19
|
+
`),S=V.sanitizeCSS(S),S=V.minifyCSS(S),Ge(e)){let N=s;N||(N=new CSSStyleSheet);try{N.replaceSync(S);const p=[V.getBaseResetSheet(),le.getTransitionStyleSheet()];f&&p.push(f),p.push(N),e.adoptedStyleSheets=p,r(N);return}catch{}}const m=V.minifyCSS(V.baseReset),k=le.getTransitionStyleSheet();let j="";try{k?.cssRules&&(j=Array.from(k.cssRules).map(N=>N.cssText).join(`
|
|
20
|
+
`))}catch{j=""}const C=V.minifyCSS(`${m}
|
|
21
|
+
${j}
|
|
22
|
+
${S}`);Je(e,C);try{const N=[V.getBaseResetSheet(),le.getTransitionStyleSheet()];if(f&&N.push(f),typeof CSSStyleSheet<"u")try{const p=new CSSStyleSheet;p.replaceSync(S),N.push(p)}catch{N.push({cssRules:[],replaceSync:()=>{}})}e.adoptedStyleSheets=N}catch{}r(null)}function Pt(e,n){if(!n.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 hasError(){return this._hasError}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=ue.get(e)||n,this._componentId=`${e}-${crypto.randomUUID()}`;const t=this._initContext(n),s=(o,i,a)=>{Object.defineProperty(o,i,{value:a,writable:!1,enumerable:!1,configurable:!1})};s(t,"refs",this._refs),s(t,"requestRender",()=>this.requestRender()),s(t,"_requestRender",()=>this._requestRender()),s(t,"_componentId",this._componentId),s(t,"_triggerWatchers",(o,i)=>this._triggerWatchers(o,i)),this.context=t,d.safe(()=>{s(t,"_host",this)}),s(this.context,"emit",(o,i,a)=>{const f={detail:i,bubbles:!0,composed:!0,...a||{}},g=new CustomEvent(o,f);this.dispatchEvent(g);const S=o.indexOf(":");if(S>0){const h=o.substring(0,S),m=o.substring(S+1),k=m.includes("-")?`${h}:${m.split("-").map((j,C)=>C===0?j:j.charAt(0).toUpperCase()+j.slice(1)).join("")}`:`${h}:${m.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;k!==o&&d.safe(()=>{this.dispatchEvent(new CustomEvent(k,f))})}return!g.defaultPrevented});const r=ue.get(e)||n;for(const o in r){const i=r[o];typeof i=="function"&&(this.context[o]=(...a)=>i(...a,this.context))}if(r.props)for(const o in r.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(r),f!==a&&this._requestRender())},enumerable:!0,configurable:!0})}this._initializing=!1,this._initWatchers(r),this._applyProps(r),this._render(r)}connectedCallback(){this._runLogicWithinErrorBoundary(n,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&Nt(t,this),this._applyProps(n),this._requestRender(),ut(n,this.context,this._mounted,s=>{this._mounted=s})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(n,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&Rt(t,this),dt(n,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},s=>{this._templateLoading=s},s=>{this._templateError=s},s=>{this._mounted=s}),d.reactiveSystem.cleanup(this._componentId)})}attributeChangedCallback(t,s,r){this._runLogicWithinErrorBoundary(n,()=>{this._applyProps(n),s!==r&&this._requestRender(),pt(n,t,s,r,this.context)})}static get observedAttributes(){return n.props?Object.keys(n.props).map(d.toKebab):[]}_render(t){this._runLogicWithinErrorBoundary(t,()=>{Mt(this.shadowRoot,t,this.context,this._refs,s=>{this._lastHtmlStringForJitCSS=s,typeof this.onHtmlStringUpdate=="function"&&this?.onHtmlStringUpdate?.(s)},s=>{this._templateLoading=s,this?.onLoadingStateChange?.(s)},s=>{this._templateError=s,this?.onErrorStateChange?.(s)},s=>this._applyStyle(t,s))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{d.scheduleDOMUpdate(()=>{jt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,t=>{this._lastRenderTime=t},t=>{this._renderCount=t},this._renderTimeoutId,t=>{this._renderTimeoutId=t})},this._componentId)})}_applyStyle(t,s){this._runLogicWithinErrorBoundary(t,()=>{Ot(this.shadowRoot,this.context,s,this._styleSheet,r=>{this._styleSheet=r})})}_runLogicWithinErrorBoundary(t,s){try{s(),this._hasError=!1}catch(r){this._hasError=!0;try{const o=this.tagName?.toLowerCase?.()||"<unknown>",i=this._componentId||"<unknown-id>",a={};if(t&&t.props)for(const f of Object.keys(t.props))try{const g=this.context[f];g instanceof Node?a[f]=`[DOM Node: ${g.nodeName}]`:typeof g=="object"&&g!==null?a[f]=Object.keys(g).length>5?`[object(${Object.keys(g).length} keys)]`:g:a[f]=g}catch{a[f]="[unreadable]"}P.devError(`Error rendering component <${o}> (id=${i}):`,r),P.devError("Component props snapshot:",a),P.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{}if(t.onError&&t.onError(r,this.context),this.tagName.toLowerCase()!=="cer-error-boundary"){let o=this.parentElement;if(!o){const i=this.getRootNode();i instanceof ShadowRoot&&(o=i.host.parentElement)}for(;o;){if(o.tagName.toLowerCase()==="cer-error-boundary"){o._cerHandleChildError?.(r);break}let i=o.parentElement;if(!i){const a=o.getRootNode();a instanceof ShadowRoot&&(i=a.host.parentElement)}o=i}}}}_initContext(t){try{let s=function(o,i=""){if(Array.isArray(o))return new Proxy(o,{get(a,f,g){const S=Reflect.get(a,f,g);return typeof S=="function"&&typeof f=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(f)?function(...m){const k=S.apply(a,m);if(!r._initializing){const j=i||"root";r._triggerWatchers(j,a),d.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return k}:S},set(a,f,g){if(a[String(f)]=g,!r._initializing){const S=i?`${i}.${String(f)}`:String(f);r._triggerWatchers(S,g),d.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return!0},deleteProperty(a,f){if(delete a[String(f)],!r._initializing){const g=i?`${i}.${String(f)}`:String(f);r._triggerWatchers(g,void 0),d.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return!0}});if(o&&typeof o=="object"){if(d.isReactiveState(o))return o;for(const a in o){const f=i?`${i}.${a}`:a;o[a]=s(o[a],f)}return new Proxy(o,{set(a,f,g){const S=i?`${i}.${String(f)}`:String(f);return a[String(f)]=s(g,S),r._initializing||(r._triggerWatchers(S,a[String(f)]),d.scheduleDOMUpdate(()=>r._render(t),r._componentId)),!0},get(a,f,g){return Reflect.get(a,f,g)}})}return o};const r=this;return s({...t.props?Object.fromEntries(Object.entries(t.props).map(([o,i])=>[o,i.default])):{}})}catch{return{}}}_initWatchers(t){this._runLogicWithinErrorBoundary(t,()=>{at(this.context,this._watchers,{})})}_triggerWatchers(t,s){ct(this.context,this._watchers,t,s)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{ft(this,t,this.context)})}}}function Ne(e,n,t,s){for(const r of t)try{r(...s)}catch(o){P.devError(`[${e}] Error in ${n} lifecycle hook:`,o)}}function Ht(e,n){ot();let t=d.toKebab(e);t.includes("-")||(t=`cer-${t}`);const s={},r={props:{},onConnected:o=>{if(s.onConnected)try{s.onConnected(o)}catch(i){P.devError(`[${t}] Error in onConnected lifecycle hook:`,i)}},onDisconnected:o=>{if(s.onDisconnected)try{s.onDisconnected(o)}catch(i){P.devError(`[${t}] Error in onDisconnected lifecycle hook:`,i)}},onAttributeChanged:(o,i,a,f)=>{if(s.onAttributeChanged)try{s.onAttributeChanged(o,i,a,f)}catch(g){P.devError(`[${t}] Error in onAttributeChanged lifecycle hook:`,g)}},onError:(o,i)=>{if(s.onError&&o)try{s.onError(o,i)}catch(a){P.devError(`[${t}] Error in onError handler (the error handler itself threw):`,a)}},render:o=>{const i=o,a=i._componentId||`${t}-${crypto.randomUUID()}`;d.reactiveSystem.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{Object.defineProperty(o,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(o,"_computedStyle",{value:void 0,writable:!0,enumerable:!1,configurable:!0}),_e.setCurrentComponentContext(o),ze.resetWhenCounter();let f;try{f=n()}catch(g){try{const h=i._hookCallbacks?.onError;if(Array.isArray(h))for(const m of h)try{m(g)}catch{}else if(typeof h=="function")try{h(g)}catch{}}catch{}try{const S=i._host;if(S?.parentElement){let h=S.parentElement;for(;h;){if(h.tagName.toLowerCase()==="cer-error-boundary"){h._cerHandleChildError?.(g);break}let m=h.parentElement;if(!m){const k=h.getRootNode();k instanceof ShadowRoot&&(m=k.host.parentElement)}h=m}}}catch{}throw g}if(i._hookCallbacks){const g=i._hookCallbacks;if(g.onConnected){const S=g.onConnected;s.onConnected=h=>{Ne(t,"useOnConnected",S,[h])}}if(g.onDisconnected){const S=g.onDisconnected;s.onDisconnected=h=>{Ne(t,"useOnDisconnected",S,[h])}}if(g.onAttributeChanged){const S=g.onAttributeChanged;s.onAttributeChanged=(h,m,k,j)=>{Ne(t,"useOnAttributeChanged",S,[h,m,k,j])}}if(g.onError){const S=g.onError;s.onError=h=>{Ne(t,"useOnError",S,[h])}}if(g.props&&!Object.keys(r.props??{}).length){const S=g.props;r.props=Object.fromEntries(Object.entries(S).map(([h,m])=>[h,{type:typeof m=="boolean"?Boolean:typeof m=="number"?Number:typeof m=="string"?String:Function,default:m}])),ue.set(t,r)}}return f}finally{_e.clearCurrentComponentContext(),d.reactiveSystem.clearCurrentComponent()}}};if(ue.set(t,r),typeof window<"u"){try{const o={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};_e.setCurrentComponentContext(o),d.beginDiscoveryRender(),ze.resetWhenCounter();try{n()}catch(i){try{const f=o?._hookCallbacks?.onError;if(Array.isArray(f))for(const g of f)try{g(i)}catch{}else if(typeof f=="function")try{f(i)}catch{}P.devError(`Error during component discovery render <${t}>:`,i),P.devWarn("Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().")}catch{}throw i}finally{d.endDiscoveryRender(),_e.clearCurrentComponentContext()}if(o._hookCallbacks?.props){const i=o._hookCallbacks.props;r.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}])),ue.set(t,r)}}catch{}customElements.get(t)||customElements.define(t,Pt(t,r))}}function ee(e,n={},t,s){const r=s??n.key;return{tag:e,key:r,props:n,children:t}}function ke(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function ie(e){return typeof e=="object"&&e!==null&&"tag"in e&&!ke(e)}function xt(e,n){return e.key!=null?e:{...e,key:n}}function It(e,n){if(e==null){P.devWarn(`⚠️ Event handler for '@${n}' is ${e}. This will prevent the event from working. Use a function reference instead: @${n}="\${functionName}"`);return}typeof e!="function"&&P.devWarn(`🚨 Potential infinite loop detected! Event handler for '@${n}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${n}="\${functionName()}" to @${n}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&P.devWarn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${n}="\${fn}" not @${n}="\${fn()}"`)}function Wt(e,n=[],t={}){const s={},r={},o={},i=[],a=/([:@#]?)([a-zA-Z0-9-:.]+)(?:\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|([^\s>]+)))?/g;let f;for(;f=a.exec(e);){const g=f[1],S=f[2];let h="";for(let p=3;p<f.length;p++)if(f[p]!==void 0){h=f[p];break}h.length>=2&&(h[0]==='"'&&h[h.length-1]==='"'||h[0]==="'"&&h[h.length-1]==="'")&&(h=h.slice(1,-1));const m=!/=/.test(f[0]),k=h.match(/^{{(\d+)}}$/),j=!k&&/{{(\d+)}}/.test(h);let C=m?!0:k?n[Number(k[1])]??null:j?h.replace(/{{(\d+)}}/g,(p,w)=>String(n[Number(w)]??"")):h;!k&&!j&&(C==="true"?C=!0:C==="false"?C=!1:C==="null"?C=null:isNaN(Number(C))||(C=Number(C)));const N=["model","bind","show","class","style","ref","when"];if(g===":"){const[p,w]=S.split(":"),[c,...A]=p.split(".");if(N.includes(c)){const y=[...A],L=c==="model"&&w?`model:${w}`:c;o[L]={value:C,modifiers:y,arg:w}}else if(S==="disabled"){let y=C;y&&d.isReactiveState(y)&&(y=y.value);const L=typeof y;if(y===""||L==="boolean"||L==="string"&&(y==="true"||y==="false")||y==null||L==="number")s[S]=y;else{let b=C;b&&d.isReactiveState(b)&&(b=b.value),r[S]=b}i.push(S)}else{let y=C;y&&d.isReactiveState(y)&&(y=y.value),r[S]=y,i.push(S)}}else if(g==="@"){const[p,...w]=S.split("."),c=w;It(C,p);const A=typeof C=="function"?C:typeof t[C]=="function"?t[C]:void 0;if(A){const y=E=>{if(c.includes("prevent")&&E.preventDefault(),c.includes("stop")&&E.stopPropagation(),!(c.includes("self")&&E.target!==E.currentTarget))return c.includes("once")&&E.currentTarget?.removeEventListener(p,y),A(E)},L="on"+p.charAt(0).toUpperCase()+p.slice(1);s[L]=y}}else S==="ref"?s.ref=C:r[S]=C}return{props:s,attrs:r,directives:o,bound:i}}function We(e){if(!ie(e)||ke(e))return e;const n=e.props?.directives;if(n&&n.when){const t=n.when.value,s=d.isReactiveState(t)?t.value:t,r={...n};delete r.when;const o={...e.props};Object.keys(r).length>0?o.directives=r:delete o.directives;const i={...e,props:o};return Array.isArray(i.children)&&(i.children=i.children.map(f=>typeof f=="object"&&f!==null?We(f):f)),{tag:"#anchor",key:e.key!=null?`when-${e.key}`:`when-${e.tag}`,children:s?[i]:[]}}if(Array.isArray(e.children)){const t=e.children.map(s=>typeof s=="object"&&s!==null?We(s):s);return{...e,children:t}}return e}function Bt(e,n,t){const s=Ce.length>0?Ce[Ce.length-1]:void 0,r=t??s,o=!t&&n.length===0,i=o?e.join("<!--TEMPLATE_DELIM-->"):null;if(o&&i){const l=Oe.get(i);if(l)return l}function a(l,v){return ee("#text",{},l,v)}function f(l,v,_=!1){let T=typeof l=="string"?d.decodeEntities(l):l;return!_&&typeof T=="string"&&/[\r\n]/.test(T)&&(T=T.replace(/\s+/g," ")),ee("#text",{},T,v)}let g="";for(let l=0;l<e.length;l++)g+=e[l],l<n.length&&(g+=`{{${l}}}`);const S=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,h=[];let m,k=[],j=null,C={},N,p=0;const w=[],c=new Set(["pre","code","textarea","script","style"]);function A(){if(j&&c.has(j.toLowerCase()))return!0;for(const l of h)if(c.has(l.tag.toLowerCase()))return!0;return!1}function y(l){if(!l||typeof l!="object"||ke(l))return;const v=l,_=C;if(v.props||v.attrs){const T=v;T.props&&(_.props||(_.props={}),Object.assign(_.props,T.props)),T.attrs&&(_.attrs||(_.attrs={}),Object.keys(T.attrs).forEach(R=>{if(R==="style"&&_.attrs.style){const $=String(_.attrs.style).replace(/;?\s*$/,""),x=String(T.attrs.style).replace(/^;?\s*/,"");_.attrs.style=$+"; "+x}else if(R==="class"&&_.attrs.class){const $=String(_.attrs.class).trim().split(/\s+/).filter(Boolean),x=String(T.attrs.class).trim().split(/\s+/).filter(Boolean),M=[...new Set([...$,...x])];_.attrs.class=M.join(" ")}else _.attrs[R]=T.attrs[R]}))}else _.props||(_.props={}),Object.assign(_.props,v)}function L(l,v){const _=j?k:w;if(ke(l)){const T=l.key??v,R=l.children;_.push({...l,key:T,children:R});return}if(ie(l)){_.push(xt(l,void 0));return}if(Array.isArray(l)){if(l.length===0)return;for(let T=0;T<l.length;T++){const R=l[T];ke(R)||ie(R)||Array.isArray(R)?L(R,`${v}-${T}`):R!==null&&typeof R=="object"?d.isUnsafeHTML(R)?_.push(ee("#raw",{},R.__rawHTML,`${v}-${T}`)):y(R):_.push(a(String(R),`${v}-${T}`))}return}if(l!==null&&typeof l=="object"){if(d.isUnsafeHTML(l)){const T=l.__rawHTML??"";_.push(ee("#raw",{},T,v));return}y(l);return}_.push(a(String(l),v))}const E=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;m=S.exec(g);)if(!(m[0].startsWith("<!--")&&m[0].endsWith("-->"))){if(m[1]){const l=m[1],v=m[0][1]==="/",_=m[0][m[0].length-2]==="/"||E.has(l),{props:T,attrs:R,directives:$,bound:x}=Wt(m[2]||"",n,r??{}),M={props:{},attrs:{}};for(const D in T)M.props[D]=T[D];for(const D in R)M.attrs[D]=R[D];M.attrs&&Object.prototype.hasOwnProperty.call(M.attrs,"key")&&!(M.props&&Object.prototype.hasOwnProperty.call(M.props,"key"))&&d.safe(()=>{M.props.key=M.attrs.key});try{const D={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"]},W=l.toLowerCase(),Z=D[W]??[];if(M.attrs){for(const I of Z)if(x&&x.includes(I)&&I in M.attrs&&!(M.props&&I in M.props)){let O=M.attrs[I];if(O&&d.isReactiveState(O))O=O.value,M.props[I]=O,delete M.attrs[I];else if(O&&typeof O=="object"&&"value"in O&&!(O instanceof Node))try{const B=O.value;M.props[I]=(W==="select"||W==="option")&&I==="value"?String(B):B,delete M.attrs[I]}catch{}else{const B=typeof O;if(I==="disabled")(O===""||B==="boolean"||B==="string"&&(O==="true"||O==="false")||O==null||B==="number")&&(M.props[I]=O,delete M.attrs[I]);else if(O===""||B==="string"||B==="number"||B==="boolean"||O==null){const z=(W==="select"||W==="option")&&I==="value"?String(O):O;M.props[I]=z,delete M.attrs[I]}}}}if(l.includes("-")||!!r?.__customElements?.has?.(l)){if(M.isCustomElement=!0,x&&M.attrs){const I=new Set(["id","name","data-key","key"]);for(const O of x)if(O in M.attrs&&!(M.props&&O in M.props)){const B=O.includes("-")?d.toCamel(O):O,z=M.attrs[O];if(M.props[B]=z,I.has(O)||d.isClassLikeAttr(O))try{const te=d.safeSerializeAttr(M.attrs[O]);te===null?delete M.attrs[O]:M.attrs[O]=te}catch{delete M.attrs[O]}else delete M.attrs[O]}}try{if(M.attrs&&!(M.props&&"modelValue"in M.props)){const I=M.attrs["model-value"]??M.attrs.modelValue;typeof I<"u"&&(M.props.modelValue=I)}}catch{}}}catch{}if($&&Object.keys($).some(D=>D==="model"||D.startsWith("model:")))try{const W=globalThis[Symbol.for("cer.registry")],Z=!!(W&&typeof W.has=="function"&&W.has(l)),K=r,I=!!(K&&(K.__customElements instanceof Set&&K.__customElements.has(l)||Array.isArray(K.__isCustomElements)&&K.__isCustomElements.includes(l)));if(!!(l.includes("-")||I||Z))for(const z of Object.keys($)){if(z!=="model"&&!z.startsWith("model:"))continue;const ce=$[z],te=ce.arg??(z.includes(":")?z.split(":",2)[1]:void 0),U=ce.value,Me=te??"modelValue",Be=d.getNestedValue,rt=d.setNestedValue,ye=r?._state||r;let X;if(typeof U=="string"&&ye)X=Be(ye,U);else if(X=U,d.isReactiveState(U))try{U.value}catch{}M.props[Me]=X;try{const ne=d.toKebab(Me);M.attrs||(M.attrs={}),X!=null&&(typeof X=="string"||typeof X=="number"||typeof X=="boolean")&&(M.attrs[ne]=X)}catch{}M.isCustomElement=!0;const De=`update:${d.toKebab(Me)}`.replace(/-([a-z])/g,(ne,Y)=>Y.toUpperCase()),st="on"+De.charAt(0).toUpperCase()+De.slice(1);M.props[st]=function(ne){const Y=ne.detail!==void 0?ne.detail:ne.target?ne.target.value:void 0;if(ye)if(U&&d.isReactiveState(U)){const re=U.value;if(Array.isArray(Y)&&Array.isArray(re)?JSON.stringify([...Y].sort())!==JSON.stringify([...re].sort()):Y!==re){U.value=Y;try{const se=r;if(se){const me=se.requestRender,ge=se._requestRender;typeof me=="function"?me():typeof ge=="function"&&ge()}}catch{}}}else{const re=Be(ye||{},typeof U=="string"?U:String(U));if(Array.isArray(Y)&&Array.isArray(re)?JSON.stringify([...Y].sort())!==JSON.stringify([...re].sort()):Y!==re){rt(ye||{},typeof U=="string"?U:String(U),Y);try{const se=r;if(se){const me=se.requestRender,ge=se._requestRender;typeof me=="function"?me():typeof ge=="function"&&ge()}}catch{}}}},delete $[z]}}catch{}if(Object.keys($).length>0&&(M.directives={...$}),v){const D=k.some(I=>typeof I=="object"&&I.tag!=="#text");let W=k;if(D&&k.length>0){let I=0;for(;I<k.length;){const B=k[I];if(!ie(B)||B.tag!=="#text"||typeof B.children!="string"||B.children.trim()!=="")break;I++}let O=k.length-1;for(;O>=0;){const B=k[O];if(!ie(B)||B.tag!=="#text"||typeof B.children!="string"||B.children.trim()!=="")break;O--}I===0&&O===k.length-1?W=k:I>O?W=[]:W=k.slice(I,O+1)}const Z=ee(j,C,W.length===1&&ie(W[0])&&W[0].tag==="#text"?typeof W[0].children=="string"?W[0].children:"":W.length?W:void 0,N),K=h.pop();K?(j=K.tag,C=K.props,N=K.key,k=K.children,k.push(Z)):(w.push(Z),j=null,C={},N=void 0,k=[])}else _?j?k.push(ee(l,M,void 0,void 0)):w.push(ee(l,M,void 0,void 0)):(j&&h.push({tag:j,props:C,children:k,key:N}),j=l,C=M,k=[])}else if(typeof m[3]<"u"){const l=Number(m[3]),v=n[l],_=`interp-${l}`;L(v,_)}else if(m[4]){const l=m[4],v=j?k:w,_=l.split(/({{\d+}})/);for(const T of _){if(!T)continue;const R=T.match(/^{{(\d+)}}$/);if(R){const $=Number(R[1]),x=n[$],M=`interp-${$}`;L(x,M)}else{const $=`text-${p++}`,x=A();v.push(f(T,$,x))}}}}const b=w.filter(l=>ie(l)&&l.tag==="#text"?typeof l.children=="string"&&l.children.trim()!=="":!0).map(l=>We(l));if(b.length===1){const l=b[0];return o&&i&&Oe.set(i,l),l}else if(b.length>1){const l=b;return o&&i&&Oe.set(i,l),l}return ee("div",{},"","fallback-root")}function Dt(e,...n){if(d.isDiscoveryRender())return[];const t=n[n.length-1],s=typeof t=="object"&&t&&!Array.isArray(t)?t:void 0;return Bt(e,n,s)}exports.component=Ht;exports.html=Dt;exports.vdomRenderer=nt;
|
|
23
|
+
//# sourceMappingURL=template-compiler-Cx623BSB.cjs.map
|