@jasonshimmy/custom-elements-runtime 1.0.3 → 1.0.5
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/dist/custom-elements-runtime.cjs.js +9 -9
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +799 -749
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +10 -10
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class yt{pendingUpdates=new Map;isFlushScheduled=!1;schedule(t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class yt{pendingUpdates=new Map;isFlushScheduled=!1;schedule(t,r){const n=r||t.toString();this.pendingUpdates.set(n,t),this.isFlushScheduled||(this.isFlushScheduled=!0,typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&(window.__vitest__||window.Cypress)?this.flush():queueMicrotask(()=>this.flush()))}flush(){const t=Array.from(this.pendingUpdates.values());this.pendingUpdates.clear(),this.isFlushScheduled=!1;for(const r of t)try{r()}catch(n){typeof console<"u"&&console.error&&console.error("Error in batched update:",n)}}get pendingCount(){return this.pendingUpdates.size}}const bt=new yt;function de(e,t){bt.schedule(e,t)}const Ze=new WeakSet;class wt{static cache=new WeakMap;static arrayHandlerCache=new WeakMap;static objectHandlerCache=new WeakMap;static getOrCreateProxy(t,r,n=!1){const i=this.cache.get(t);if(i)return i;const s=n?this.getOrCreateArrayHandler(r):this.getOrCreateObjectHandler(r),o=new Proxy(t,s);try{it.markAsProxy(o)}catch{}return this.cache.set(t,o),o}static getOrCreateArrayHandler(t){if(!this.arrayHandlerCache.has(t)){const r={get:(n,i,s)=>{const o=Reflect.get(n,i,s);return typeof o=="function"&&typeof i=="string"&&["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].includes(i)?function(...u){const m=o.apply(n,u);return t.triggerUpdate(),m}:o},set:(n,i,s)=>(n[i]=t.makeReactiveValue(s),t.triggerUpdate(),!0),deleteProperty:(n,i)=>(delete n[i],t.triggerUpdate(),!0)};this.arrayHandlerCache.set(t,r)}return this.arrayHandlerCache.get(t)}static getOrCreateObjectHandler(t){if(!this.objectHandlerCache.has(t)){const r={get:(n,i,s)=>Reflect.get(n,i,s),set:(n,i,s)=>(n[i]=t.makeReactiveValue(s),t.triggerUpdate(),!0),deleteProperty:(n,i)=>(delete n[i],t.triggerUpdate(),!0)};this.objectHandlerCache.set(t,r)}return this.objectHandlerCache.get(t)}static hasProxy(t){return this.cache.has(t)}static clear(){this.cache=new WeakMap,this.arrayHandlerCache=new WeakMap,this.objectHandlerCache=new WeakMap}static getStats(){return{hasCachedProxies:this.cache instanceof WeakMap}}}class it{static contextCache=new WeakMap;static createReactiveProxy(t,r,n){try{if(Ze.has(t))return t}catch{}const i=Array.isArray(t);let s=this.contextCache.get(r);s||(s=new WeakMap,this.contextCache.set(r,s));let o=s.get(n);return o||(o={triggerUpdate:r,makeReactiveValue:n},s.set(n,o)),wt.getOrCreateProxy(t,o,i)}static markAsProxy(t){if(t)try{Ze.add(t)}catch{}}}class xt{currentComponent=null;componentDependencies=new Map;componentRenderFunctions=new Map;stateStorage=new Map;stateIndexCounter=new Map;trackingDisabled=!1;lastWarningTime=new Map;setCurrentComponent(t,r){this.currentComponent=t,this.componentRenderFunctions.set(t,r),this.componentDependencies.has(t)||this.componentDependencies.set(t,new Set),this.stateIndexCounter.set(t,0)}clearCurrentComponent(){this.currentComponent=null}disableTracking(){this.trackingDisabled=!0}enableTracking(){this.trackingDisabled=!1}isRenderingComponent(){return this.currentComponent!==null}shouldEmitRenderWarning(){if(!this.currentComponent)return!0;const t=this.currentComponent,r=this.lastWarningTime.get(t)||0,n=Date.now();return n-r<1e3?!1:(this.lastWarningTime.set(t,n),!0)}withoutTracking(t){const r=this.trackingDisabled;this.trackingDisabled=!0;try{return t()}finally{this.trackingDisabled=r}}getOrCreateState(t){if(!this.currentComponent)return new He(t);const r=this.currentComponent,n=this.stateIndexCounter.get(r)||0,i=`${r}:${n}`;if(this.stateIndexCounter.set(r,n+1),this.stateStorage.has(i))return this.stateStorage.get(i);const s=new He(t);return this.stateStorage.set(i,s),s}trackDependency(t){this.trackingDisabled||this.currentComponent&&(this.componentDependencies.get(this.currentComponent)?.add(t),t.addDependent(this.currentComponent))}triggerUpdate(t){t.getDependents().forEach(r=>{const n=this.componentRenderFunctions.get(r);n&&de(n,r)})}cleanup(t){const r=this.componentDependencies.get(t);r&&(r.forEach(n=>n.removeDependent(t)),this.componentDependencies.delete(t)),this.componentRenderFunctions.delete(t);for(const n of Array.from(this.stateStorage.keys()))n.startsWith(t+":")&&this.stateStorage.delete(n);this.stateIndexCounter.delete(t)}}const F=new xt;class He{_value;dependents=new Set;constructor(t){this._value=this.makeReactive(t);try{const r=Symbol.for("@cer/ReactiveState");Object.defineProperty(this,r,{value:!0,enumerable:!1,configurable:!1})}catch{}}get value(){return F.trackDependency(this),this._value}set value(t){F.isRenderingComponent()&&F.shouldEmitRenderWarning()&&console.warn(`🚨 State modification detected during render! This can cause infinite loops.
|
|
2
2
|
• Move state updates to event handlers
|
|
3
3
|
• Use useEffect/watch for side effects
|
|
4
|
-
• Ensure computed properties don't modify state`),this._value=this.makeReactive(t),F.triggerUpdate(this)}addDependent(t){this.dependents.add(t)}removeDependent(t){this.dependents.delete(t)}getDependents(){return this.dependents}makeReactive(t){return t===null||typeof t!="object"||t instanceof Node||t instanceof Element||t instanceof HTMLElement?t:it.createReactiveProxy(t,()=>F.triggerUpdate(this),n=>this.makeReactive(n))}}function xt(e){return F.getOrCreateState(e===void 0?null:e)}function te(e){if(!e||typeof e!="object")return!1;try{const t=Symbol.for("@cer/ReactiveState");if(e[t])return!0}catch{}try{return!!(e.constructor&&e.constructor.name==="ReactiveState")}catch{return!1}}function kt(e){const t=new He(e());return{get value(){return F.trackDependency(t),e()}}}function Ct(e,t,n={}){let r=e();n.immediate&&t(r,r);const i=`watch-${Math.random().toString(36).substr(2,9)}`,s=()=>{F.setCurrentComponent(i,s);const o=e();F.clearCurrentComponent(),o!==r&&(t(o,r),r=o)};return F.setCurrentComponent(i,s),e(),F.clearCurrentComponent(),()=>{F.cleanup(i)}}const xe=new Map,ke=new Map,Ce=new Map,Ke=500;function ne(e){if(xe.has(e))return xe.get(e);const t=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return xe.size<Ke&&xe.set(e,t),t}function st(e){if(ke.has(e))return ke.get(e);const t=e.replace(/-([a-z])/g,(n,r)=>r.toUpperCase());return ke.size<Ke&&ke.set(e,t),t}function se(e){if(typeof e=="string"){if(Ce.has(e))return Ce.get(e);const t=e.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]);return t!==e&&Ce.size<Ke&&Ce.set(e,t),t}return e}function B(e,t){if(typeof t=="string"){const n=t.split(".").reduce((r,i)=>r?.[i],e);return te(n)?n.value:n}return t}function $e(e,t,n){const r=String(t).split("."),i=r.pop();if(!i)return;const s=r.reduce((o,a)=>(o[a]==null&&(o[a]={}),o[a]),e);te(s[i])?s[i].value=n:s[i]=n}const ot=typeof process<"u"&&process.env?.NODE_ENV!=="production";function oe(e,...t){ot&&console.error(e,...t)}function Pe(e,...t){ot&&console.warn(e,...t)}function _t(e,t,n){if(n)for(const[r,i]of Object.entries(n)){let s,o={};if(Array.isArray(i)?(s=i[0],o=i[1]||{}):s=i,t.set(r,{callback:s,options:o,oldValue:B(e,r)}),o.immediate)try{const a=B(e,r);s(a,void 0,e)}catch(a){oe(`Error in immediate watcher for "${r}":`,a)}}}function Et(e,t,n,r){const i=(o,a)=>{if(o===a)return!0;if(typeof o!=typeof a||typeof o!="object"||o===null||a===null)return!1;if(Array.isArray(o)&&Array.isArray(a))return o.length!==a.length?!1:o.every((g,b)=>i(g,a[b]));const u=Object.keys(o),m=Object.keys(a);return u.length!==m.length?!1:u.every(g=>i(o[g],a[g]))},s=t.get(n);if(s&&!i(r,s.oldValue))try{s.callback(r,s.oldValue,e),s.oldValue=r}catch(o){oe(`Error in watcher for "${n}":`,o)}for(const[o,a]of t.entries())if(a.options.deep&&n.startsWith(o+"."))try{const u=B(e,o);i(u,a.oldValue)||(a.callback(u,a.oldValue,e),a.oldValue=u)}catch(u){oe(`Error in deep watcher for "${o}":`,u)}}function Ge(e,t){return t===Boolean?e==="true":t===Number?Number(e):e}function $t(e,t,n){t&&Object.entries(t).forEach(([r,i])=>{const s=ne(r),o=e.getAttribute(s);if(i.type===Function&&typeof e[r]=="function")n[r]=e[r];else if(typeof e[r]<"u")try{const a=e[r];i.type===Boolean&&typeof a=="boolean"||i.type===Number&&typeof a=="number"||i.type===Function&&typeof a=="function"?n[r]=a:n[r]=se(Ge(String(a),i.type))}catch{n[r]=e[r]}else o!==null?n[r]=se(Ge(o,i.type)):"default"in i&&i.default!==void 0&&(n[r]=se(i.default))})}function St(e,t,n){t.props&&$t(e,t.props,n)}function At(e,t,n,r){e.onConnected&&!n&&(e.onConnected(t),r(!0))}function Tt(e,t,n,r,i,s,o,a){e.onDisconnected&&e.onDisconnected(t),n.forEach(u=>u()),r(),i(),s(!1),o(null),a(!1)}function Rt(e,t,n,r,i){e.onAttributeChanged&&e.onAttributeChanged(t,n,r,i)}class Ot{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(t,n){const r=this.cache.get(t);if(r){if(!r.isSecure){Pe("Blocked cached dangerous expression:",t);return}return r.evaluator(n)}const i=this.createEvaluator(t);if(this.cache.size>=this.maxCacheSize){const s=this.cache.keys().next().value;s&&this.cache.delete(s)}if(this.cache.set(t,i),!i.isSecure){Pe("Blocked dangerous expression:",t);return}return i.evaluator(n)}static createEvaluator(t){if(this.hasDangerousPatterns(t))return{evaluator:()=>{},isSecure:!1};if(t.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(t),isSecure:!0}}catch(n){return Pe("Failed to create evaluator for expression:",t,n),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(t){return this.dangerousPatterns.some(n=>n.test(t))}static createSafeEvaluator(t){if(t.trim().startsWith("{")&&t.trim().endsWith("}"))return this.createObjectEvaluator(t);if(/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())){const n=t.trim().slice(4);return r=>B(r,n)}return t.includes("ctx")||/[+\-*/%<>=&|?:\[\]]/.test(t)?this.createSimpleEvaluator(t):n=>B(n,t)}static createObjectEvaluator(t){const n=t.trim().slice(1,-1),r=this.parseObjectProperties(n);return i=>{const s={};for(const{key:o,value:a}of r)try{if(a.startsWith("ctx.")){const u=a.slice(4);s[o]=B(i,u)}else s[o]=this.evaluateSimpleValue(a,i)}catch{s[o]=void 0}return s}}static parseObjectProperties(t){const n=[],r=t.split(",");for(const i of r){const s=i.indexOf(":");if(s===-1)continue;const o=i.slice(0,s).trim(),a=i.slice(s+1).trim(),u=o.replace(/^['"]|['"]$/g,"");n.push({key:u,value:a})}return n}static createSimpleEvaluator(t){return n=>{try{let r=t;const i=[];r=r.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,b=>`<<#${i.push(b)-1}#>>`);const s=r.match(/ctx\.[\w.]+/g)||[];for(const b of s){const p=b.slice(4),l=B(n,p);if(l===void 0)return;const d=i.push(JSON.stringify(l))-1;r=r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`)}const o=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=r.match(o)||[];for(const b of a){if(b.startsWith("ctx."))continue;const p=B(n,b);if(p===void 0)return;const l=i.push(JSON.stringify(p))-1;r=r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${l}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let m;const g=new Set;for(;(m=u.exec(r))!==null;){const b=m[1];if(["true","false","null","undefined"].includes(b)||/^[0-9]+$/.test(b)||b==="ctx"||g.has(b))continue;g.add(b);const p=B(n,b);if(p===void 0)return;const l=JSON.stringify(p),d=i.push(l)-1;b.includes(".")?r=r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`):r=r.replace(new RegExp("\\b"+b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${d}#>>`)}r=r.replace(/<<#(\d+)#>>/g,(b,p)=>i[Number(p)]);try{return this.evaluateBasicExpression(r)}catch{return}}catch{return}}}static evaluateBasicExpression(t){const n=this.tokenize(t);let r=0;function i(){return n[r]}function s(c){const h=n[r++];if(c&&!h)throw new Error(`Unexpected token EOF, expected ${c}`);if(c&&h&&h.type!==c&&h.value!==c)throw new Error(`Unexpected token ${h.type}/${h.value}, expected ${c}`);return h}function o(){return a()}function a(){let c=u();if(i()&&i().value==="?"){s("?");const h=o();s(":");const y=o();return c?h:y}return c}function u(){let c=m();for(;i()&&i().value==="||";){s("OP");const h=m();c=c||h}return c}function m(){let c=g();for(;i()&&i().value==="&&";){s("OP");const h=g();c=c&&h}return c}function g(){let c=b();for(;i()&&["==","!=","===","!=="].includes(i().value);){const h=s("OP").value,y=b();switch(h){case"==":c=c==y;break;case"!=":c=c!=y;break;case"===":c=c===y;break;case"!==":c=c!==y;break}}return c}function b(){let c=p();for(;i()&&[">","<",">=","<="].includes(i().value);){const h=s("OP").value,y=p();switch(h){case">":c=c>y;break;case"<":c=c<y;break;case">=":c=c>=y;break;case"<=":c=c<=y;break}}return c}function p(){let c=l();for(;i()&&(i().value==="+"||i().value==="-");){const h=s("OP").value,y=l();c=h==="+"?c+y:c-y}return c}function l(){let c=d();for(;i()&&(i().value==="*"||i().value==="/"||i().value==="%");){const h=s("OP").value,y=d();switch(h){case"*":c=c*y;break;case"/":c=c/y;break;case"%":c=c%y;break}}return c}function d(){return i()&&i().value==="!"?(s("OP"),!d()):i()&&i().value==="-"?(s("OP"),-d()):v()}function v(){const c=i();if(c){if(c.type==="NUMBER")return s("NUMBER"),Number(c.value);if(c.type==="STRING")return s("STRING"),c.value.slice(1,-1);if(c.type==="IDENT")return s("IDENT"),c.value==="true"?!0:c.value==="false"?!1:c.value==="null"?null:void 0;if(c.value==="["){s("PUNC");const h=[];for(;i()&&i().value!=="]";)h.push(o()),i()&&i().value===","&&s("PUNC");return s("PUNC"),h}if(c.value==="("){s("PUNC");const h=o();return s("PUNC"),h}throw new Error("Unexpected token in expression")}}return o()}static tokenize(t){const n=[],r=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let i;for(;(i=r.exec(t))!==null;){const s=i[1];s&&(/^\d/.test(s)?n.push({type:"NUMBER",value:s}):/^"/.test(s)||/^'/.test(s)?n.push({type:"STRING",value:s}):/^[a-zA-Z_]/.test(s)?n.push({type:"IDENT",value:s}):/^[()?:,\[\]]$/.test(s)?n.push({type:"PUNC",value:s}):n.push({type:"OP",value:s}))}return n}static evaluateSimpleValue(t,n){if(t==="true")return!0;if(t==="false")return!1;if(!isNaN(Number(t)))return Number(t);if(t.startsWith("ctx.")){const r=t.slice(4);return B(n,r)}return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class ae{static cleanupFunctions=new WeakMap;static addListener(t,n,r,i){t.addEventListener(n,r,i);const o={event:n,handler:r,options:i,cleanup:()=>t.removeEventListener(n,r,i),addedAt:Date.now()};this.cleanupFunctions.has(t)||this.cleanupFunctions.set(t,[]);const a=this.cleanupFunctions.get(t);a.push(o),this.cleanupFunctions.get(t).__metaList=a}static removeListener(t,n,r,i){t.removeEventListener(n,r,i);const s=this.cleanupFunctions.get(t);if(s){const o=s.__metaList||null;if(o){const a=o.findIndex(u=>u.event===n&&u.handler===r&&JSON.stringify(u.options)===JSON.stringify(i));if(a>=0){try{o[a].cleanup()}catch{}o.splice(a,1)}o.length===0&&this.cleanupFunctions.delete(t)}else{const a=s.findIndex(()=>!0);a>=0&&(s.splice(a,1),s.length===0&&this.cleanupFunctions.delete(t))}}}static cleanup(t){const n=this.cleanupFunctions.get(t);n&&((n.__metaList||n).forEach(i=>{try{typeof i=="function"?i():i&&typeof i.cleanup=="function"&&i.cleanup()}catch(s){console.error("Error during event cleanup:",s)}}),this.cleanupFunctions.delete(t))}static cleanupAll(){try{this.cleanupFunctions=new WeakMap}catch(t){console.error("Error during global cleanup:",t)}}static hasListeners(t){const n=this.cleanupFunctions.get(t),r=n?n.__metaList||n:void 0;return!!(r&&r.length>0)}static getListenerCount(t){const n=this.cleanupFunctions.get(t),r=n?n.__metaList||n:void 0;return r?r.length:0}}function ue(e,t){if(t&&e instanceof HTMLElement){ae.cleanup(e);for(const n in t)t[n]===e&&delete t[n];for(const n of Array.from(e.childNodes))ue(n,t)}}function ge(e,t,n){if(typeof e=="string")return;const r=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),i=e.props?.ref??(e.props?.props&&e.props.props.ref);r?r.value=t:i&&n&&(n[i]=t)}function Pt(e,t,n,r,i,s,o,a){if(!s)return;const u=t.includes("lazy"),m=t.includes("trim"),g=t.includes("number"),b=e&&typeof e=="object"&&"value"in e&&typeof e.value<"u",p=()=>{if(b){const C=e.value;return a&&typeof C=="object"&&C!==null?C[a]:C}return B(s._state||s,e)},l=p();let d="text";o instanceof HTMLInputElement?d=r?.type||o.type||"text":o instanceof HTMLSelectElement?d="select":o instanceof HTMLTextAreaElement&&(d="textarea");const v=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,c=v?d==="checkbox"||d==="radio"?"checked":"value":a??"modelValue";if(d==="checkbox")if(Array.isArray(l))n[c]=l.includes(String(o?.getAttribute("value")??r?.value??""));else{const C=o?.getAttribute("true-value")??!0;n[c]=l===C}else if(d==="radio")n[c]=l===(r?.value??"");else if(d==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const C=Array.isArray(l)?l.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(k=>{k.selected=C.includes(k.value)})},0),n[c]=Array.isArray(l)?l:[]}else n[c]=l;else{n[c]=l;try{const C=ne(c);r&&(r[C]=l)}catch{}}const h=u||d==="checkbox"||d==="radio"||d==="select"?"change":"input",y=C=>{if(C.isComposing||i._isComposing)return;const k=typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&window.__vitest__;if(C.isTrusted===!1&&!k)return;const f=C.target;if(!f||f._modelUpdating)return;let x=f.value;if(d==="checkbox"){const T=p();if(Array.isArray(T)){const R=f.getAttribute("value")??"",S=Array.from(T);if(f.checked)S.includes(R)||S.push(R);else{const P=S.indexOf(R);P>-1&&S.splice(P,1)}x=S}else{const R=f.getAttribute("true-value")??!0,S=f.getAttribute("false-value")??!1;x=f.checked?R:S}}else if(d==="radio")x=f.getAttribute("value")??f.value;else if(d==="select"&&f.multiple)x=Array.from(f.selectedOptions).map(T=>T.value);else if(m&&typeof x=="string"&&(x=x.trim()),g){const T=Number(x);isNaN(T)||(x=T)}const A=s._state||s,_=p();if(Array.isArray(x)&&Array.isArray(_)?JSON.stringify([...x].sort())!==JSON.stringify([..._].sort()):x!==_){f._modelUpdating=!0;try{if(b)if(a&&typeof e.value=="object"&&e.value!==null){const T={...e.value};T[a]=x,e.value=T}else e.value=x;else $e(A,e,x);if(s._requestRender&&s._requestRender(),s._triggerWatchers){const T=b?"reactiveState":e;s._triggerWatchers(T,x)}if(f){const T=`update:${ne(c)}`,R=new CustomEvent(T,{detail:x,bubbles:!0,composed:!0});f.dispatchEvent(R)}}finally{setTimeout(()=>f._modelUpdating=!1,0)}}};if(v){if(i[h]){const C=i[h];o&&ae.removeListener(o,h,C)}i[h]=y}else{const C=`update:${ne(c)}`;if(i[C]){const k=i[C];o&&ae.removeListener(o,C,k)}i[C]=k=>{const f=s._state||s,x=k.detail!==void 0?k.detail:k.target?.value,A=B(f,e);if(Array.isArray(x)&&Array.isArray(A)?JSON.stringify([...x].sort())!==JSON.stringify([...A].sort()):x!==A){$e(f,e,x),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,x);const $=k.target;if($){$[c]=x;try{const T=ne(c);typeof x=="boolean"?x?$.setAttribute(T,"true"):$.setAttribute(T,"false"):$.setAttribute(T,String(x))}catch{}queueMicrotask(()=>{typeof $._applyProps=="function"&&$._applyProps($._cfg),typeof $._requestRender=="function"&&$._requestRender()})}}}}(d==="text"||d==="textarea")&&(i.compositionstart=(()=>i._isComposing=!0),i.compositionend=C=>{i._isComposing=!1;const k=C.target;k&&setTimeout(()=>{const f=k.value,x=s._state||s,A=B(x,e);let _=f;if(m&&(_=_.trim()),g){const T=Number(_);isNaN(T)||(_=T)}if(Array.isArray(_)&&Array.isArray(A)?JSON.stringify([..._].sort())!==JSON.stringify([...A].sort()):_!==A){k._modelUpdating=!0;try{$e(x,e,_),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,_)}finally{setTimeout(()=>k._modelUpdating=!1,0)}}},0)})}function at(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function Lt(e,t,n,r){if(typeof e=="object"&&e!==null)for(const[i,s]of Object.entries(e))i.startsWith("data-")||i.startsWith("aria-")||i==="class"?n[i]=s:t[i]=s;else if(typeof e=="string"){if(!r)return;try{const i=ye(e,r);if(typeof i=="object"&&i!==null){for(const[s,o]of Object.entries(i))s.startsWith("data-")||s.startsWith("aria-")||s==="class"?n[s]=o:t[s]=o;return}else{n[e]=i;return}}catch{const i=B(r,e);n[e]=i}}}function Mt(e,t,n){let r;if(typeof e=="string"){if(!n)return;r=ye(e,n)}else r=e;const i=t.style||"";let s=i;if(r){if(i){const o=i.split(";").map(u=>u.trim()).filter(Boolean),a=o.findIndex(u=>u.startsWith("display:"));a>=0&&o[a]==="display: none"&&(o.splice(a,1),s=o.length>0?o.join("; ")+";":"")}}else if(i){const o=i.split(";").filter(Boolean),a=o.findIndex(u=>u.trim().startsWith("display:"));a>=0?o[a]="display: none":o.push("display: none"),s=o.join("; ")}else s="display: none";s!==i&&(s?t.style=s:delete t.style)}function ye(e,t){return Ot.evaluate(e,t)}function jt(e,t,n){let r;if(typeof e=="string"){if(!n)return;r=ye(e,n)}else r=e;let i=[];typeof r=="string"?i=[r]:Array.isArray(r)?i=r.filter(Boolean):typeof r=="object"&&r!==null&&(i=Object.entries(r).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",o=s?`${s} ${i.join(" ")}`.trim():i.join(" ");o&&(t.class=o)}function Nt(e,t,n){let r;if(typeof e=="string"){if(!n)return;r=ye(e,n)}else r=e;let i="";if(typeof r=="string")i=r;else if(r&&typeof r=="object"){const o=[];for(const[a,u]of Object.entries(r))if(u!=null&&u!==""){const m=a.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`),g=["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 b=String(u);typeof u=="number"&&g.includes(m)&&(b=`${u}px`),o.push(`${m}: ${b}`)}i=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+i}function Wt(e,t,n){let r=e;typeof e=="string"&&n&&(r=ye(e,n)),te(r)?t.reactiveRef=r:t.ref=r}function ct(e,t,n,r){const i={},s={...r||{}},o={};for(const[a,u]of Object.entries(e)){const{value:m,modifiers:g,arg:b}=u;if(a==="model"||a.startsWith("model:")){const p=a.split(":"),l=p.length>1?p[1]:b;Pt(m,g,i,s,o,t,n,l);continue}switch(a){case"bind":Lt(m,i,s,t);break;case"show":Mt(m,s,t);break;case"class":jt(m,s,t);break;case"style":Nt(m,s,t);break;case"ref":Wt(m,i,t);break}}return{props:i,attrs:s,listeners:o}}function Be(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let a=o.props?.key??o.key;if(!a){const b=o.tag||"node",l=[o.props?.attrs?.id,o.props?.attrs?.name,o.props?.attrs?.["data-key"],o.props?.props?.id,o.props?.props?.name,o.props?.props?.dataKey,o.props?.props?.["data-key"]].find(d=>d!=null)??"";a=l?`${t}:${b}:${l}`:`${t}:${b}`}let u=a,m=1;for(;s.has(u);)u=`${a}#${m++}`;s.add(u);let g=o.children;return Array.isArray(g)&&(g=Be(g,u)),{...o,key:u,children:g}})}const n=e;let r=n.props?.key??n.key??t,i=n.children;return Array.isArray(i)&&(i=Be(i,r)),{...n,key:r,children:i}}function Qe(e,t,n,r){const i=n.directives??{},s=ct(i,r,e,n.attrs),o={...t.props,...n.props,...s.props},a={...t.attrs,...n.attrs,...s.attrs},u=t.props??{},m=o,g=n?.isCustomElement??t?.isCustomElement??!1;let b=!1;for(const d in{...u,...m}){const v=u[d],w=m[d];if(v!==w)if(b=!0,d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==w&&(e.value=w??"");else if(d==="checked"&&e instanceof HTMLInputElement)e.checked=!!w;else if(d.startsWith("on")&&typeof w=="function"){const c=at(d);typeof v=="function"&&ae.removeListener(e,c,v),ae.addListener(e,c,w)}else if(w==null)e.removeAttribute(d);else if((n?.isCustomElement??t?.isCustomElement??!1)||d in e)try{e[d]=w}catch{}else w===!1&&e.removeAttribute(d)}for(const[d,v]of Object.entries(s.listeners||{}))ae.addListener(e,d,v);const p=t.attrs??{},l=a;for(const d in{...p,...l}){const v=p[d],w=l[d];let c=v,h=w;if(te(v)&&(c=v.value),te(w)&&(h=w.value),c!==h)if(b=!0,h==null||h===!1){if(e.removeAttribute(d),d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)try{e.value=""}catch{}else if(e instanceof HTMLSelectElement)try{e.value=""}catch{}else if(e instanceof HTMLProgressElement)try{e.value=0}catch{}}if(d==="checked"&&e instanceof HTMLInputElement)try{e.checked=!1}catch{}if(d==="disabled")try{e.disabled=!1}catch{}}else{if(d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){try{e.value=h??""}catch{e.setAttribute(d,String(h))}continue}else if(e instanceof HTMLSelectElement){try{e.value=h??""}catch{}continue}else if(e instanceof HTMLProgressElement){try{e.value=Number(h)}catch{}continue}}if(d==="checked"&&e instanceof HTMLInputElement){try{e.checked=!!h}catch{}continue}if(d==="style"){e.setAttribute(d,String(h));continue}const y=e.namespaceURI==="http://www.w3.org/2000/svg";if(g&&!y&&d.includes("-")){const C=st(d);try{e[C]=h}catch{e.setAttribute(d,String(h))}}else if(!y&&d in e)try{e[d]=h}catch{e.setAttribute(d,String(h))}else e.setAttribute(d,String(h))}}if(g&&b)try{if(typeof e._applyProps=="function")try{e._applyProps(e._cfg)}catch{}typeof e.requestRender=="function"?e.requestRender():typeof e._render=="function"&&e._render(e._cfg)}catch{}}function Q(e,t,n){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&&(p.key=e.key),p}if(e.tag==="#anchor"){const p=e,l=Array.isArray(p.children)?p.children:[],d=document.createTextNode(""),v=document.createTextNode("");p.key!=null&&(d.key=`${p.key}:start`,v.key=`${p.key}:end`),p._startNode=d,p._endNode=v;const w=document.createDocumentFragment();w.appendChild(d);for(const c of l){const h=Q(c,t);w.appendChild(h)}return w.appendChild(v),w}const r=document.createElement(e.tag);e.key!=null&&(r.key=e.key);const{props:i={},attrs:s={},directives:o={}}=e.props??{},a=ct(o,t,r,s),u={...i,...a.props},m={...s,...a.attrs},g=r.namespaceURI==="http://www.w3.org/2000/svg";for(const p in m){const l=m[p];if(!(typeof p!="string"||/\[object Object\]/.test(p))){if(typeof l=="boolean")l&&r.setAttribute(p,"");else if(l!=null)if(!g&&p==="value"&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement||r instanceof HTMLProgressElement))try{r instanceof HTMLProgressElement?r.value=Number(l):r.value=l??""}catch{r.setAttribute(p,String(l))}else if(!g&&p==="checked"&&r instanceof HTMLInputElement)try{r.checked=!!l}catch{r.setAttribute(p,String(l))}else if(!g&&p in r)try{r[p]=l}catch{r.setAttribute(p,String(l))}else if((e.props?.isCustomElement??!1)&&!g&&p.includes("-")){const v=st(p);try{r[v]=l}catch{r.setAttribute(p,String(l))}}else r.setAttribute(p,String(l))}}for(const p in u){const l=u[p];if(!(typeof p!="string"||/\[object Object\]/.test(p)))if(p==="value"&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)){const d=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;r.value=d??""}else if(p==="checked"&&r instanceof HTMLInputElement){const d=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;r.checked=!!d}else if(p.startsWith("on")&&typeof l=="function")ae.addListener(r,at(p),l);else{if(p.startsWith("on")&&l===void 0)continue;if(l==null||l===!1)r.removeAttribute(p);else if((e.props?.isCustomElement??!1)||p in r)try{const v=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;r[p]=v}catch{}}}for(const[p,l]of Object.entries(a.listeners||{}))ae.addListener(r,p,l);const b={...e,props:{...e.props,...a.props}};ge(b,r,n);try{if(typeof r._applyProps=="function")try{r._applyProps(r._cfg)}catch{}typeof r.requestRender=="function"?r.requestRender():typeof r._render=="function"&&r._render(r._cfg)}catch{}if(Array.isArray(e.children))for(const p of e.children)r.appendChild(Q(p,t,n));else typeof e.children=="string"&&(r.textContent=e.children);try{if(r instanceof HTMLSelectElement&&m&&m.hasOwnProperty("value"))try{r.value=m.value??""}catch{}}catch{}return r}function zt(e,t,n,r,i){if(typeof n=="string"){e.textContent!==n&&(e.textContent=n);return}if(!Array.isArray(n))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],a=new Map;for(const l of o)l&&l.key!=null&&a.set(l.key,l);const u=new Map;for(const l of s){const d=l.key;d!=null&&u.set(d,l)}const m=new Set;let g=e.firstChild;function b(l,d){let v=l;for(;v&&(m.add(v),v!==d);)v=v.nextSibling}function p(l,d,v,w){const c=[];let h=l.nextSibling;for(;h&&h!==d;)c.push(h),h=h.nextSibling;const y=Array.isArray(v)?v:[];if(w.some(k=>k&&k.key!=null)||y.some(k=>k&&k.key!=null)){const k=new Map,f=new Map;for(const _ of y)_&&_.key!=null&&k.set(_.key,_);for(const _ of c){const $=_.key;$!=null&&f.set($,_)}const x=new Set;let A=l.nextSibling;for(const _ of w){let $;if(_.key!=null&&f.has(_.key)){const T=k.get(_.key);$=Se(f.get(_.key),T,_,r),x.add($),$!==A&&e.contains($)&&e.insertBefore($,A)}else $=Q(_,r),e.insertBefore($,A),x.add($);A=$.nextSibling}for(const _ of c)!x.has(_)&&e.contains(_)&&e.removeChild(_)}else{const k=Math.min(y.length,w.length);for(let f=0;f<k;f++){const x=y[f],A=w[f],_=Se(c[f],x,A,r);_!==c[f]&&(e.insertBefore(_,c[f]),e.removeChild(c[f]))}for(let f=k;f<w.length;f++)e.insertBefore(Q(w[f],r),d);for(let f=k;f<c.length;f++)e.removeChild(c[f])}}for(const l of n){let d;if(l.tag==="#anchor"){const v=l.key,w=`${v}:start`,c=`${v}:end`;let h=u.get(w),y=u.get(c);const C=Array.isArray(l.children)?l.children:[];if(h||(h=document.createTextNode(""),h.key=w),y||(y=document.createTextNode(""),y.key=c),l._startNode=h,l._endNode=y,!e.contains(h)||!e.contains(y)){e.insertBefore(h,g);for(const k of C)e.insertBefore(Q(k,r),g);e.insertBefore(y,g)}else p(h,y,a.get(v)?.children,C);b(h,y),g=y.nextSibling;continue}if(l.key!=null&&u.has(l.key)){const v=a.get(l.key);d=Se(u.get(l.key),v,l,r,i),m.add(d),d!==g&&e.contains(d)&&(g&&!e.contains(g)&&(g=null),e.insertBefore(d,g))}else d=Q(l,r,i),g&&!e.contains(g)&&(g=null),e.insertBefore(d,g),m.add(d);g=d.nextSibling}for(const l of s)!m.has(l)&&e.contains(l)&&(ue(l,i),e.removeChild(l))}function Se(e,t,n,r,i){if(t&&typeof t!="string"&&t.props?.ref&&i&&ue(e,i),t===n)return e;if(typeof n=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==n&&(e.textContent=n),e;{const o=document.createTextNode(n);return e.parentNode?.replaceChild(o,e),o}}if(n&&typeof n!="string"&&n.tag==="#anchor"){const o=n,a=Array.isArray(o.children)?o.children:[],u=o._startNode??document.createTextNode(""),m=o._endNode??document.createTextNode("");o.key!=null&&(u.key=`${o.key}:start`,m.key=`${o.key}:end`),o._startNode=u,o._endNode=m;const g=document.createDocumentFragment();g.appendChild(u);for(const b of a){const p=Q(b,r);g.appendChild(p)}return g.appendChild(m),e.parentNode?.replaceChild(g,e),u}if(!n){ue(e,i);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){ue(e,i);const o=Q(n,r,i);return ge(n,o,i),e.parentNode?.replaceChild(o,e),o}if(n.tag==="#anchor"){const o=Array.isArray(n.children)?n.children:[],a=n._startNode??document.createTextNode(""),u=n._endNode??document.createTextNode("");n.key!=null&&(a.key=`${n.key}:start`,u.key=`${n.key}:end`),n._startNode=a,n._endNode=u;const m=document.createDocumentFragment();m.appendChild(a);for(const g of o)m.appendChild(Q(g,r));return m.appendChild(u),e.parentNode?.replaceChild(m,e),a}if(typeof t!="string"&&typeof n!="string"&&t.tag===n.tag&&t.key===n.key){const o=e;return Qe(o,t.props||{},n.props||{},r),zt(o,t.children,n.children,r,i),ge(n,o,i),o}if(typeof t!="string"&&typeof n!="string"&&t.tag===n.tag&&(t.tag&&String(t.tag).includes("-")||n.props&&n.props.isCustomElement||t.props&&t.props.isCustomElement))try{const a=e;return Qe(a,t.props||{},n.props||{},r),ge(n,a,i),a}catch{}ue(e,i);const s=Q(n,r,i);return ge(n,s,i),e.parentNode?.replaceChild(s,e),s}function Dt(e,t,n,r){let i;Array.isArray(t)?t.length===1?(i=t[0],i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})):i={tag:"div",key:"__root__",children:t}:(i=t,i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})),i&&typeof i=="object"&&i.tag==="#anchor"&&(i={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[i]}),i=Be(i,String(i.key??"root"));const s=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let a;s&&o?typeof s!="string"&&typeof i!="string"&&s.tag===i.tag&&s.key===i.key?a=Se(o,s,i,n,r):(a=Q(i,n,r),e.replaceChild(a,o)):(a=Q(i,n,r),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const u=[];for(let m=0;m<e.childNodes.length;m++){const g=e.childNodes[m];g!==a&&g.nodeName!=="STYLE"&&(ue(g,r),u.push(g))}u.forEach(m=>e.removeChild(m)),e._prevVNode=i,e._prevDom=a}function Ae(e){if(typeof e=="string")return se(e);if(e.tag==="#text")return typeof e.children=="string"?se(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(Ae).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([i,s])=>` ${i}="${se(String(s))}"`).join(""));let n="";e.props&&(n=Object.entries(e.props).filter(([i])=>i!=="attrs"&&i!=="directives"&&i!=="ref"&&i!=="key").map(([i,s])=>` ${i}="${se(String(s))}"`).join(""));const r=Array.isArray(e.children)?e.children.filter(Boolean).map(Ae).join(""):typeof e.children=="string"?se(e.children):e.children?Ae(e.children):"";return`<${e.tag}${t}${n}>${r}</${e.tag}>`}function lt(e,...t){let n="";for(let r=0;r<e.length;r++)n+=e[r],r<t.length&&(n+=t[r]);return n}function ut(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let _e=null;function Xe(){return _e||(_e=new CSSStyleSheet,_e.replaceSync(ut(Ht))),_e}function It(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Ht=lt`
|
|
4
|
+
• Ensure computed properties don't modify state`),this._value=this.makeReactive(t),F.triggerUpdate(this)}addDependent(t){this.dependents.add(t)}removeDependent(t){this.dependents.delete(t)}getDependents(){return this.dependents}makeReactive(t){return t===null||typeof t!="object"||t instanceof Node||t instanceof Element||t instanceof HTMLElement?t:it.createReactiveProxy(t,()=>F.triggerUpdate(this),r=>this.makeReactive(r))}}function vt(e){return F.getOrCreateState(e===void 0?null:e)}function te(e){if(!e||typeof e!="object")return!1;try{const t=Symbol.for("@cer/ReactiveState");if(e[t])return!0}catch{}try{return!!(e.constructor&&e.constructor.name==="ReactiveState")}catch{return!1}}function kt(e){const t=new He(e());return{get value(){return F.trackDependency(t),e()}}}function Ct(e,t,r={}){let n=e();r.immediate&&t(n,n);const i=`watch-${Math.random().toString(36).substr(2,9)}`,s=()=>{F.setCurrentComponent(i,s);const o=e();F.clearCurrentComponent(),o!==n&&(t(o,n),n=o)};return F.setCurrentComponent(i,s),e(),F.clearCurrentComponent(),()=>{F.cleanup(i)}}const ve=new Map,ke=new Map,Ce=new Map,Ke=500;function re(e){if(ve.has(e))return ve.get(e);const t=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return ve.size<Ke&&ve.set(e,t),t}function st(e){if(ke.has(e))return ke.get(e);const t=e.replace(/-([a-z])/g,(r,n)=>n.toUpperCase());return ke.size<Ke&&ke.set(e,t),t}function se(e){if(typeof e=="string"){if(Ce.has(e))return Ce.get(e);const t=e.replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r]);return t!==e&&Ce.size<Ke&&Ce.set(e,t),t}return e}function B(e,t){if(typeof t=="string"){const r=t.split(".").reduce((n,i)=>n?.[i],e);return te(r)?r.value:r}return t}function $e(e,t,r){const n=String(t).split("."),i=n.pop();if(!i)return;const s=n.reduce((o,a)=>(o[a]==null&&(o[a]={}),o[a]),e);te(s[i])?s[i].value=r:s[i]=r}const ot=typeof process<"u"&&process.env?.NODE_ENV!=="production";function oe(e,...t){ot&&console.error(e,...t)}function Pe(e,...t){ot&&console.warn(e,...t)}function _t(e,t,r){if(r)for(const[n,i]of Object.entries(r)){let s,o={};if(Array.isArray(i)?(s=i[0],o=i[1]||{}):s=i,t.set(n,{callback:s,options:o,oldValue:B(e,n)}),o.immediate)try{const a=B(e,n);s(a,void 0,e)}catch(a){oe(`Error in immediate watcher for "${n}":`,a)}}}function Et(e,t,r,n){const i=(o,a)=>{if(o===a)return!0;if(typeof o!=typeof a||typeof o!="object"||o===null||a===null)return!1;if(Array.isArray(o)&&Array.isArray(a))return o.length!==a.length?!1:o.every((g,b)=>i(g,a[b]));const u=Object.keys(o),m=Object.keys(a);return u.length!==m.length?!1:u.every(g=>i(o[g],a[g]))},s=t.get(r);if(s&&!i(n,s.oldValue))try{s.callback(n,s.oldValue,e),s.oldValue=n}catch(o){oe(`Error in watcher for "${r}":`,o)}for(const[o,a]of t.entries())if(a.options.deep&&r.startsWith(o+"."))try{const u=B(e,o);i(u,a.oldValue)||(a.callback(u,a.oldValue,e),a.oldValue=u)}catch(u){oe(`Error in deep watcher for "${o}":`,u)}}function Ge(e,t){return t===Boolean?e==="true":t===Number?Number(e):e}function $t(e,t,r){t&&Object.entries(t).forEach(([n,i])=>{const s=re(n),o=e.getAttribute(s);if(i.type===Function&&typeof e[n]=="function")r[n]=e[n];else if(typeof e[n]<"u")try{const a=e[n];i.type===Boolean&&typeof a=="boolean"||i.type===Number&&typeof a=="number"||i.type===Function&&typeof a=="function"?r[n]=a:r[n]=se(Ge(String(a),i.type))}catch{r[n]=e[n]}else o!==null?r[n]=se(Ge(o,i.type)):"default"in i&&i.default!==void 0&&(r[n]=se(i.default))})}function St(e,t,r){t.props&&$t(e,t.props,r)}function At(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function Tt(e,t,r,n,i,s,o,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(u=>u()),n(),i(),s(!1),o(null),a(!1)}function Rt(e,t,r,n,i){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,i)}class Ot{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(t,r){const n=this.cache.get(t);if(n){if(!n.isSecure){Pe("Blocked cached dangerous expression:",t);return}return n.evaluator(r)}const i=this.createEvaluator(t);if(this.cache.size>=this.maxCacheSize){const s=this.cache.keys().next().value;s&&this.cache.delete(s)}if(this.cache.set(t,i),!i.isSecure){Pe("Blocked dangerous expression:",t);return}return i.evaluator(r)}static createEvaluator(t){if(this.hasDangerousPatterns(t))return{evaluator:()=>{},isSecure:!1};if(t.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(t),isSecure:!0}}catch(r){return Pe("Failed to create evaluator for expression:",t,r),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(t){return this.dangerousPatterns.some(r=>r.test(t))}static createSafeEvaluator(t){if(t.trim().startsWith("{")&&t.trim().endsWith("}"))return this.createObjectEvaluator(t);if(/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())){const r=t.trim().slice(4);return n=>B(n,r)}return t.includes("ctx")||/[+\-*/%<>=&|?:\[\]]/.test(t)?this.createSimpleEvaluator(t):r=>B(r,t)}static createObjectEvaluator(t){const r=t.trim().slice(1,-1),n=this.parseObjectProperties(r);return i=>{const s={};for(const{key:o,value:a}of n)try{if(a.startsWith("ctx.")){const u=a.slice(4);s[o]=B(i,u)}else s[o]=this.evaluateSimpleValue(a,i)}catch{s[o]=void 0}return s}}static parseObjectProperties(t){const r=[],n=t.split(",");for(const i of n){const s=i.indexOf(":");if(s===-1)continue;const o=i.slice(0,s).trim(),a=i.slice(s+1).trim(),u=o.replace(/^['"]|['"]$/g,"");r.push({key:u,value:a})}return r}static createSimpleEvaluator(t){return r=>{try{let n=t;const i=[];n=n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,b=>`<<#${i.push(b)-1}#>>`);const s=n.match(/ctx\.[\w.]+/g)||[];for(const b of s){const p=b.slice(4),l=B(r,p);if(l===void 0)return;const d=i.push(JSON.stringify(l))-1;n=n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`)}const o=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=n.match(o)||[];for(const b of a){if(b.startsWith("ctx."))continue;const p=B(r,b);if(p===void 0)return;const l=i.push(JSON.stringify(p))-1;n=n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${l}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let m;const g=new Set;for(;(m=u.exec(n))!==null;){const b=m[1];if(["true","false","null","undefined"].includes(b)||/^[0-9]+$/.test(b)||b==="ctx"||g.has(b))continue;g.add(b);const p=B(r,b);if(p===void 0)return;const l=JSON.stringify(p),d=i.push(l)-1;b.includes(".")?n=n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`):n=n.replace(new RegExp("\\b"+b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${d}#>>`)}n=n.replace(/<<#(\d+)#>>/g,(b,p)=>i[Number(p)]);try{return this.evaluateBasicExpression(n)}catch{return}}catch{return}}}static evaluateBasicExpression(t){const r=this.tokenize(t);let n=0;function i(){return r[n]}function s(c){const h=r[n++];if(c&&!h)throw new Error(`Unexpected token EOF, expected ${c}`);if(c&&h&&h.type!==c&&h.value!==c)throw new Error(`Unexpected token ${h.type}/${h.value}, expected ${c}`);return h}function o(){return a()}function a(){let c=u();if(i()&&i().value==="?"){s("?");const h=o();s(":");const y=o();return c?h:y}return c}function u(){let c=m();for(;i()&&i().value==="||";){s("OP");const h=m();c=c||h}return c}function m(){let c=g();for(;i()&&i().value==="&&";){s("OP");const h=g();c=c&&h}return c}function g(){let c=b();for(;i()&&["==","!=","===","!=="].includes(i().value);){const h=s("OP").value,y=b();switch(h){case"==":c=c==y;break;case"!=":c=c!=y;break;case"===":c=c===y;break;case"!==":c=c!==y;break}}return c}function b(){let c=p();for(;i()&&[">","<",">=","<="].includes(i().value);){const h=s("OP").value,y=p();switch(h){case">":c=c>y;break;case"<":c=c<y;break;case">=":c=c>=y;break;case"<=":c=c<=y;break}}return c}function p(){let c=l();for(;i()&&(i().value==="+"||i().value==="-");){const h=s("OP").value,y=l();c=h==="+"?c+y:c-y}return c}function l(){let c=d();for(;i()&&(i().value==="*"||i().value==="/"||i().value==="%");){const h=s("OP").value,y=d();switch(h){case"*":c=c*y;break;case"/":c=c/y;break;case"%":c=c%y;break}}return c}function d(){return i()&&i().value==="!"?(s("OP"),!d()):i()&&i().value==="-"?(s("OP"),-d()):x()}function x(){const c=i();if(c){if(c.type==="NUMBER")return s("NUMBER"),Number(c.value);if(c.type==="STRING")return s("STRING"),c.value.slice(1,-1);if(c.type==="IDENT")return s("IDENT"),c.value==="true"?!0:c.value==="false"?!1:c.value==="null"?null:void 0;if(c.value==="["){s("PUNC");const h=[];for(;i()&&i().value!=="]";)h.push(o()),i()&&i().value===","&&s("PUNC");return s("PUNC"),h}if(c.value==="("){s("PUNC");const h=o();return s("PUNC"),h}throw new Error("Unexpected token in expression")}}return o()}static tokenize(t){const r=[],n=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let i;for(;(i=n.exec(t))!==null;){const s=i[1];s&&(/^\d/.test(s)?r.push({type:"NUMBER",value:s}):/^"/.test(s)||/^'/.test(s)?r.push({type:"STRING",value:s}):/^[a-zA-Z_]/.test(s)?r.push({type:"IDENT",value:s}):/^[()?:,\[\]]$/.test(s)?r.push({type:"PUNC",value:s}):r.push({type:"OP",value:s}))}return r}static evaluateSimpleValue(t,r){if(t==="true")return!0;if(t==="false")return!1;if(!isNaN(Number(t)))return Number(t);if(t.startsWith("ctx.")){const n=t.slice(4);return B(r,n)}return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class ae{static cleanupFunctions=new WeakMap;static addListener(t,r,n,i){t.addEventListener(r,n,i);const o={event:r,handler:n,options:i,cleanup:()=>t.removeEventListener(r,n,i),addedAt:Date.now()};this.cleanupFunctions.has(t)||this.cleanupFunctions.set(t,[]);const a=this.cleanupFunctions.get(t);a.push(o),this.cleanupFunctions.get(t).__metaList=a}static removeListener(t,r,n,i){t.removeEventListener(r,n,i);const s=this.cleanupFunctions.get(t);if(s){const o=s.__metaList||null;if(o){const a=o.findIndex(u=>u.event===r&&u.handler===n&&JSON.stringify(u.options)===JSON.stringify(i));if(a>=0){try{o[a].cleanup()}catch{}o.splice(a,1)}o.length===0&&this.cleanupFunctions.delete(t)}else{const a=s.findIndex(()=>!0);a>=0&&(s.splice(a,1),s.length===0&&this.cleanupFunctions.delete(t))}}}static cleanup(t){const r=this.cleanupFunctions.get(t);r&&((r.__metaList||r).forEach(i=>{try{typeof i=="function"?i():i&&typeof i.cleanup=="function"&&i.cleanup()}catch(s){console.error("Error during event cleanup:",s)}}),this.cleanupFunctions.delete(t))}static cleanupAll(){try{this.cleanupFunctions=new WeakMap}catch(t){console.error("Error during global cleanup:",t)}}static hasListeners(t){const r=this.cleanupFunctions.get(t),n=r?r.__metaList||r:void 0;return!!(n&&n.length>0)}static getListenerCount(t){const r=this.cleanupFunctions.get(t),n=r?r.__metaList||r:void 0;return n?n.length:0}}function ue(e,t){if(t&&e instanceof HTMLElement){ae.cleanup(e);for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))ue(r,t)}}function ge(e,t,r){if(typeof e=="string")return;const n=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),i=e.props?.ref??(e.props?.props&&e.props.props.ref);n?n.value=t:i&&r&&(r[i]=t)}function Pt(e,t,r,n,i,s,o,a){if(!s)return;const u=t.includes("lazy"),m=t.includes("trim"),g=t.includes("number"),b=e&&typeof e=="object"&&"value"in e&&typeof e.value<"u",p=()=>{if(b){const C=e.value;return a&&typeof C=="object"&&C!==null?C[a]:C}return B(s._state||s,e)},l=p();let d="text";o instanceof HTMLInputElement?d=n?.type||o.type||"text":o instanceof HTMLSelectElement?d="select":o instanceof HTMLTextAreaElement&&(d="textarea");const x=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,c=x?d==="checkbox"||d==="radio"?"checked":"value":a??"modelValue";if(d==="checkbox")if(Array.isArray(l))r[c]=l.includes(String(o?.getAttribute("value")??n?.value??""));else{const C=o?.getAttribute("true-value")??!0;r[c]=l===C}else if(d==="radio")r[c]=l===(n?.value??"");else if(d==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const C=Array.isArray(l)?l.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(k=>{k.selected=C.includes(k.value)})},0),r[c]=Array.isArray(l)?l:[]}else r[c]=l;else{r[c]=l;try{const C=re(c);n&&(n[C]=l)}catch{}}const h=u||d==="checkbox"||d==="radio"||d==="select"?"change":"input",y=C=>{if(C.isComposing||i._isComposing)return;const k=typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&window.__vitest__;if(C.isTrusted===!1&&!k)return;const f=C.target;if(!f||f._modelUpdating)return;let v=f.value;if(d==="checkbox"){const T=p();if(Array.isArray(T)){const R=f.getAttribute("value")??"",S=Array.from(T);if(f.checked)S.includes(R)||S.push(R);else{const P=S.indexOf(R);P>-1&&S.splice(P,1)}v=S}else{const R=f.getAttribute("true-value")??!0,S=f.getAttribute("false-value")??!1;v=f.checked?R:S}}else if(d==="radio")v=f.getAttribute("value")??f.value;else if(d==="select"&&f.multiple)v=Array.from(f.selectedOptions).map(T=>T.value);else if(m&&typeof v=="string"&&(v=v.trim()),g){const T=Number(v);isNaN(T)||(v=T)}const A=s._state||s,_=p();if(Array.isArray(v)&&Array.isArray(_)?JSON.stringify([...v].sort())!==JSON.stringify([..._].sort()):v!==_){f._modelUpdating=!0;try{if(b)if(a&&typeof e.value=="object"&&e.value!==null){const T={...e.value};T[a]=v,e.value=T}else e.value=v;else $e(A,e,v);if(s._requestRender&&s._requestRender(),s._triggerWatchers){const T=b?"reactiveState":e;s._triggerWatchers(T,v)}if(f){const T=`update:${re(c)}`,R=new CustomEvent(T,{detail:v,bubbles:!0,composed:!0});f.dispatchEvent(R)}}finally{setTimeout(()=>f._modelUpdating=!1,0)}}};if(x){if(i[h]){const C=i[h];o&&ae.removeListener(o,h,C)}i[h]=y}else{const C=`update:${re(c)}`;if(i[C]){const k=i[C];o&&ae.removeListener(o,C,k)}i[C]=k=>{const f=s._state||s,v=k.detail!==void 0?k.detail:k.target?.value,A=B(f,e);if(Array.isArray(v)&&Array.isArray(A)?JSON.stringify([...v].sort())!==JSON.stringify([...A].sort()):v!==A){$e(f,e,v),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,v);const $=k.target;if($){$[c]=v;try{const T=re(c);typeof v=="boolean"?v?$.setAttribute(T,"true"):$.setAttribute(T,"false"):$.setAttribute(T,String(v))}catch{}queueMicrotask(()=>{typeof $._applyProps=="function"&&$._applyProps($._cfg),typeof $._requestRender=="function"&&$._requestRender()})}}}}(d==="text"||d==="textarea")&&(i.compositionstart=(()=>i._isComposing=!0),i.compositionend=C=>{i._isComposing=!1;const k=C.target;k&&setTimeout(()=>{const f=k.value,v=s._state||s,A=B(v,e);let _=f;if(m&&(_=_.trim()),g){const T=Number(_);isNaN(T)||(_=T)}if(Array.isArray(_)&&Array.isArray(A)?JSON.stringify([..._].sort())!==JSON.stringify([...A].sort()):_!==A){k._modelUpdating=!0;try{$e(v,e,_),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,_)}finally{setTimeout(()=>k._modelUpdating=!1,0)}}},0)})}function at(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function Lt(e,t,r,n){if(typeof e=="object"&&e!==null)for(const[i,s]of Object.entries(e))i.startsWith("data-")||i.startsWith("aria-")||i==="class"?r[i]=s:t[i]=s;else if(typeof e=="string"){if(!n)return;try{const i=ye(e,n);if(typeof i=="object"&&i!==null){for(const[s,o]of Object.entries(i))s.startsWith("data-")||s.startsWith("aria-")||s==="class"?r[s]=o:t[s]=o;return}else{r[e]=i;return}}catch{const i=B(n,e);r[e]=i}}}function Mt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ye(e,r)}else n=e;const i=t.style||"";let s=i;if(n){if(i){const o=i.split(";").map(u=>u.trim()).filter(Boolean),a=o.findIndex(u=>u.startsWith("display:"));a>=0&&o[a]==="display: none"&&(o.splice(a,1),s=o.length>0?o.join("; ")+";":"")}}else if(i){const o=i.split(";").filter(Boolean),a=o.findIndex(u=>u.trim().startsWith("display:"));a>=0?o[a]="display: none":o.push("display: none"),s=o.join("; ")}else s="display: none";s!==i&&(s?t.style=s:delete t.style)}function ye(e,t){return Ot.evaluate(e,t)}function jt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ye(e,r)}else n=e;let i=[];typeof n=="string"?i=[n]:Array.isArray(n)?i=n.filter(Boolean):typeof n=="object"&&n!==null&&(i=Object.entries(n).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",o=s?`${s} ${i.join(" ")}`.trim():i.join(" ");o&&(t.class=o)}function Nt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ye(e,r)}else n=e;let i="";if(typeof n=="string")i=n;else if(n&&typeof n=="object"){const o=[];for(const[a,u]of Object.entries(n))if(u!=null&&u!==""){const m=a.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`),g=["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 b=String(u);typeof u=="number"&&g.includes(m)&&(b=`${u}px`),o.push(`${m}: ${b}`)}i=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+i}function Wt(e,t,r){let n=e;typeof e=="string"&&r&&(n=ye(e,r)),te(n)?t.reactiveRef=n:t.ref=n}function ct(e,t,r,n){const i={},s={...n||{}},o={};for(const[a,u]of Object.entries(e)){const{value:m,modifiers:g,arg:b}=u;if(a==="model"||a.startsWith("model:")){const p=a.split(":"),l=p.length>1?p[1]:b;Pt(m,g,i,s,o,t,r,l);continue}switch(a){case"bind":Lt(m,i,s,t);break;case"show":Mt(m,s,t);break;case"class":jt(m,s,t);break;case"style":Nt(m,s,t);break;case"ref":Wt(m,i,t);break}}return{props:i,attrs:s,listeners:o}}function Be(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let a=o.props?.key??o.key;if(!a){const b=o.tag||"node",l=[o.props?.attrs?.id,o.props?.attrs?.name,o.props?.attrs?.["data-key"],o.props?.props?.id,o.props?.props?.name,o.props?.props?.dataKey,o.props?.props?.["data-key"]].find(d=>d!=null)??"";a=l?`${t}:${b}:${l}`:`${t}:${b}`}let u=a,m=1;for(;s.has(u);)u=`${a}#${m++}`;s.add(u);let g=o.children;return Array.isArray(g)&&(g=Be(g,u)),{...o,key:u,children:g}})}const r=e;let n=r.props?.key??r.key??t,i=r.children;return Array.isArray(i)&&(i=Be(i,n)),{...r,key:n,children:i}}function Qe(e,t,r,n){const i=r.directives??{},s=ct(i,n,e,r.attrs),o={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},u=t.props??{},m=o,g=r?.isCustomElement??t?.isCustomElement??!1;let b=!1;for(const d in{...u,...m}){const x=u[d],w=m[d];if(x!==w)if(b=!0,d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==w&&(e.value=w??"");else if(d==="checked"&&e instanceof HTMLInputElement)e.checked=!!w;else if(d.startsWith("on")&&typeof w=="function"){const c=at(d);typeof x=="function"&&ae.removeListener(e,c,x),ae.addListener(e,c,w)}else if(w==null)e.removeAttribute(d);else if((r?.isCustomElement??t?.isCustomElement??!1)||d in e)try{e[d]=w}catch{}else w===!1&&e.removeAttribute(d)}for(const[d,x]of Object.entries(s.listeners||{}))ae.addListener(e,d,x);const p=t.attrs??{},l=a;for(const d in{...p,...l}){const x=p[d],w=l[d];let c=x,h=w;if(te(x)&&(c=x.value),te(w)&&(h=w.value),c!==h)if(b=!0,h==null||h===!1){if(e.removeAttribute(d),d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)try{e.value=""}catch{}else if(e instanceof HTMLSelectElement)try{e.value=""}catch{}else if(e instanceof HTMLProgressElement)try{e.value=0}catch{}}if(d==="checked"&&e instanceof HTMLInputElement)try{e.checked=!1}catch{}if(d==="disabled")try{e.disabled=!1}catch{}}else{if(d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){try{e.value=h??""}catch{e.setAttribute(d,String(h))}continue}else if(e instanceof HTMLSelectElement){try{e.value=h??""}catch{}continue}else if(e instanceof HTMLProgressElement){try{e.value=Number(h)}catch{}continue}}if(d==="checked"&&e instanceof HTMLInputElement){try{e.checked=!!h}catch{}continue}if(d==="style"){e.setAttribute(d,String(h));continue}const y=e.namespaceURI==="http://www.w3.org/2000/svg";if(g&&!y&&d.includes("-")){const C=st(d);try{e[C]=h}catch{e.setAttribute(d,String(h))}}else if(!y&&d in e)try{e[d]=h}catch{e.setAttribute(d,String(h))}else e.setAttribute(d,String(h))}}if(g&&b)try{if(typeof e._applyProps=="function")try{e._applyProps(e._cfg)}catch{}typeof e.requestRender=="function"?e.requestRender():typeof e._render=="function"&&e._render(e._cfg)}catch{}}function Q(e,t,r){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&&(p.key=e.key),p}if(e.tag==="#anchor"){const p=e,l=Array.isArray(p.children)?p.children:[],d=document.createTextNode(""),x=document.createTextNode("");p.key!=null&&(d.key=`${p.key}:start`,x.key=`${p.key}:end`),p._startNode=d,p._endNode=x;const w=document.createDocumentFragment();w.appendChild(d);for(const c of l){const h=Q(c,t);w.appendChild(h)}return w.appendChild(x),w}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:i={},attrs:s={},directives:o={}}=e.props??{},a=ct(o,t,n,s),u={...i,...a.props},m={...s,...a.attrs},g=n.namespaceURI==="http://www.w3.org/2000/svg";for(const p in m){const l=m[p];if(!(typeof p!="string"||/\[object Object\]/.test(p))){if(typeof l=="boolean")l&&n.setAttribute(p,"");else if(l!=null)if(!g&&p==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement||n instanceof HTMLProgressElement))try{n instanceof HTMLProgressElement?n.value=Number(l):n.value=l??""}catch{n.setAttribute(p,String(l))}else if(!g&&p==="checked"&&n instanceof HTMLInputElement)try{n.checked=!!l}catch{n.setAttribute(p,String(l))}else if(!g&&p in n)try{n[p]=l}catch{n.setAttribute(p,String(l))}else if((e.props?.isCustomElement??!1)&&!g&&p.includes("-")){const x=st(p);try{n[x]=l}catch{n.setAttribute(p,String(l))}}else n.setAttribute(p,String(l))}}for(const p in u){const l=u[p];if(!(typeof p!="string"||/\[object Object\]/.test(p)))if(p==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)){const d=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;n.value=d??""}else if(p==="checked"&&n instanceof HTMLInputElement){const d=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;n.checked=!!d}else if(p.startsWith("on")&&typeof l=="function")ae.addListener(n,at(p),l);else{if(p.startsWith("on")&&l===void 0)continue;if(l==null||l===!1)n.removeAttribute(p);else if((e.props?.isCustomElement??!1)||p in n)try{const x=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;n[p]=x}catch{}}}for(const[p,l]of Object.entries(a.listeners||{}))ae.addListener(n,p,l);const b={...e,props:{...e.props,...a.props}};ge(b,n,r);try{if(typeof n._applyProps=="function")try{n._applyProps(n._cfg)}catch{}typeof n.requestRender=="function"?n.requestRender():typeof n._render=="function"&&n._render(n._cfg)}catch{}if(Array.isArray(e.children))for(const p of e.children)n.appendChild(Q(p,t,r));else typeof e.children=="string"&&(n.textContent=e.children);try{if(n instanceof HTMLSelectElement&&m&&m.hasOwnProperty("value"))try{n.value=m.value??""}catch{}}catch{}return n}function zt(e,t,r,n,i){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],a=new Map;for(const l of o)l&&l.key!=null&&a.set(l.key,l);const u=new Map;for(const l of s){const d=l.key;d!=null&&u.set(d,l)}const m=new Set;let g=e.firstChild;function b(l,d){let x=l;for(;x&&(m.add(x),x!==d);)x=x.nextSibling}function p(l,d,x,w){const c=[];let h=l.nextSibling;for(;h&&h!==d;)c.push(h),h=h.nextSibling;const y=Array.isArray(x)?x:[];if(w.some(k=>k&&k.key!=null)||y.some(k=>k&&k.key!=null)){const k=new Map,f=new Map;for(const _ of y)_&&_.key!=null&&k.set(_.key,_);for(const _ of c){const $=_.key;$!=null&&f.set($,_)}const v=new Set;let A=l.nextSibling;for(const _ of w){let $;if(_.key!=null&&f.has(_.key)){const T=k.get(_.key);$=Se(f.get(_.key),T,_,n),v.add($),$!==A&&e.contains($)&&e.insertBefore($,A)}else $=Q(_,n),e.insertBefore($,A),v.add($);A=$.nextSibling}for(const _ of c)!v.has(_)&&e.contains(_)&&e.removeChild(_)}else{const k=Math.min(y.length,w.length);for(let f=0;f<k;f++){const v=y[f],A=w[f],_=Se(c[f],v,A,n);_!==c[f]&&(e.insertBefore(_,c[f]),e.removeChild(c[f]))}for(let f=k;f<w.length;f++)e.insertBefore(Q(w[f],n),d);for(let f=k;f<c.length;f++)e.removeChild(c[f])}}for(const l of r){let d;if(l.tag==="#anchor"){const x=l.key,w=`${x}:start`,c=`${x}:end`;let h=u.get(w),y=u.get(c);const C=Array.isArray(l.children)?l.children:[];if(h||(h=document.createTextNode(""),h.key=w),y||(y=document.createTextNode(""),y.key=c),l._startNode=h,l._endNode=y,!e.contains(h)||!e.contains(y)){e.insertBefore(h,g);for(const k of C)e.insertBefore(Q(k,n),g);e.insertBefore(y,g)}else p(h,y,a.get(x)?.children,C);b(h,y),g=y.nextSibling;continue}if(l.key!=null&&u.has(l.key)){const x=a.get(l.key);d=Se(u.get(l.key),x,l,n,i),m.add(d),d!==g&&e.contains(d)&&(g&&!e.contains(g)&&(g=null),e.insertBefore(d,g))}else d=Q(l,n,i),g&&!e.contains(g)&&(g=null),e.insertBefore(d,g),m.add(d);g=d.nextSibling}for(const l of s)!m.has(l)&&e.contains(l)&&(ue(l,i),e.removeChild(l))}function Se(e,t,r,n,i){if(t&&typeof t!="string"&&t.props?.ref&&i&&ue(e,i),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const o=document.createTextNode(r);return e.parentNode?.replaceChild(o,e),o}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const o=r,a=Array.isArray(o.children)?o.children:[],u=o._startNode??document.createTextNode(""),m=o._endNode??document.createTextNode("");o.key!=null&&(u.key=`${o.key}:start`,m.key=`${o.key}:end`),o._startNode=u,o._endNode=m;const g=document.createDocumentFragment();g.appendChild(u);for(const b of a){const p=Q(b,n);g.appendChild(p)}return g.appendChild(m),e.parentNode?.replaceChild(g,e),u}if(!r){ue(e,i);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){ue(e,i);const o=Q(r,n,i);return ge(r,o,i),e.parentNode?.replaceChild(o,e),o}if(r.tag==="#anchor"){const o=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),u=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,u.key=`${r.key}:end`),r._startNode=a,r._endNode=u;const m=document.createDocumentFragment();m.appendChild(a);for(const g of o)m.appendChild(Q(g,n));return m.appendChild(u),e.parentNode?.replaceChild(m,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const o=e;return Qe(o,t.props||{},r.props||{},n),zt(o,t.children,r.children,n,i),ge(r,o,i),o}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&(t.tag&&String(t.tag).includes("-")||r.props&&r.props.isCustomElement||t.props&&t.props.isCustomElement))try{const a=e;return Qe(a,t.props||{},r.props||{},n),ge(r,a,i),a}catch{}ue(e,i);const s=Q(r,n,i);return ge(r,s,i),e.parentNode?.replaceChild(s,e),s}function Dt(e,t,r,n){let i;Array.isArray(t)?t.length===1?(i=t[0],i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})):i={tag:"div",key:"__root__",children:t}:(i=t,i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})),i&&typeof i=="object"&&i.tag==="#anchor"&&(i={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[i]}),i=Be(i,String(i.key??"root"));const s=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let a;s&&o?typeof s!="string"&&typeof i!="string"&&s.tag===i.tag&&s.key===i.key?a=Se(o,s,i,r,n):(a=Q(i,r,n),e.replaceChild(a,o)):(a=Q(i,r,n),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const u=[];for(let m=0;m<e.childNodes.length;m++){const g=e.childNodes[m];g!==a&&g.nodeName!=="STYLE"&&(ue(g,n),u.push(g))}u.forEach(m=>e.removeChild(m)),e._prevVNode=i,e._prevDom=a}function Ae(e){if(typeof e=="string")return se(e);if(e.tag==="#text")return typeof e.children=="string"?se(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(Ae).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([i,s])=>` ${i}="${se(String(s))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([i])=>i!=="attrs"&&i!=="directives"&&i!=="ref"&&i!=="key").map(([i,s])=>` ${i}="${se(String(s))}"`).join(""));const n=Array.isArray(e.children)?e.children.filter(Boolean).map(Ae).join(""):typeof e.children=="string"?se(e.children):e.children?Ae(e.children):"";return`<${e.tag}${t}${r}>${n}</${e.tag}>`}function lt(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function ut(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let _e=null;function Xe(){return _e||(_e=new CSSStyleSheet,_e.replaceSync(ut(Ht))),_e}function It(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Ht=lt`
|
|
5
5
|
:host, *, ::before, ::after {
|
|
6
6
|
all: isolate;
|
|
7
7
|
box-sizing: border-box;
|
|
@@ -59,24 +59,24 @@
|
|
|
59
59
|
sup { top: -.5em }
|
|
60
60
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
61
61
|
[hidden] { display: none }
|
|
62
|
-
`,Bt={neutral:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},info:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},warning:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}},Ut=Object.fromEntries(Object.entries(Bt).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([n,r])=>[n,`var(--color-${e}${n==="DEFAULT"?"":`-${n}`}, ${r})`]))])),le="0.25rem",qt={"3xs":64,"2xs":72,xs:80,sm:96,md:112,lg:128,xl:144,"2xl":168,"3xl":192,"4xl":224,"5xl":256,"6xl":288,"7xl":320},Ft=()=>{const e={};for(const[t,n]of Object.entries(qt))e[`max-w-${t}`]=`max-width:calc(${le} * ${n});`,e[`min-w-${t}`]=`min-width:calc(${le} * ${n});`,e[`w-${t}`]=`width:calc(${le} * ${n});`,e[`max-h-${t}`]=`max-height:calc(${le} * ${n});`,e[`min-h-${t}`]=`min-height:calc(${le} * ${n});`,e[`h-${t}`]=`height:calc(${le} * ${n});`;return e},Kt=()=>{const e={};for(const t of[1,2,3,4,5,6,7,8,9,10,11,12])e[`grid-cols-${t}`]=`grid-template-columns:repeat(${t},minmax(0,1fr));`,e[`grid-rows-${t}`]=`grid-template-rows:repeat(${t},minmax(0,1fr));`,e[`col-span-${t}`]=`grid-column:span ${t} / span ${t};`,e[`row-span-${t}`]=`grid-row:span ${t} / span ${t};`;return e},Le={block:"display:block;",inline:"display:inline;","inline-block":"display:inline-block;",flex:"display:flex;","inline-flex":"display:inline-flex;",grid:"display:grid;",hidden:"display:none;","w-full":"width:100%;","w-screen":"width:100dvw;","h-full":"height:100%;","h-screen":"height:100dvw;","max-w-full":"max-width:100%;","max-h-full":"max-height:100%;","max-w-screen":"max-width:100dvw;","max-h-screen":"max-height:100dvh;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","min-w-screen":"min-width:100dvw;","min-h-screen":"min-height:100dvh;",...Ft(),"m-auto":"margin:auto;","mx-auto":"margin-inline:auto;","my-auto":"margin-block:auto;","overflow-auto":"overflow:auto;","overflow-hidden":"overflow:hidden;","overflow-visible":"overflow:visible;","overflow-scroll":"overflow:scroll;","pointer-events-none":"pointer-events:none;","pointer-events-auto":"pointer-events:auto;","sr-only":"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;","not-sr-only":"position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",...Kt(),absolute:"position:absolute;",relative:"position:relative;",fixed:"position:fixed;",sticky:"position:sticky;","font-bold":"font-weight:700;","font-semibold":"font-weight:600;","font-medium":"font-weight:500;","font-light":"font-weight:300;",underline:"text-decoration-line:underline;",overline:"text-decoration-line:overline;","line-through":"text-decoration-line:line-through;","no-underline":"text-decoration-line:none;",italic:"font-style:italic;","not-italic":"font-style:normal;",uppercase:"text-transform:uppercase;",lowercase:"text-transform:lowercase;",capitalize:"text-transform:capitalize;","normal-case":"text-transform:none;","text-left":"text-align:left;","text-center":"text-align:center;","text-right":"text-align:right;","text-xs":"font-size:0.75rem;line-height:calc(1 / 0.75)","text-sm":"font-size:0.875rem;line-height:calc(1.25 / 0.875)","text-base":"font-size:1rem;line-height:calc(1.5 / 1)","text-lg":"font-size:1.125rem;line-height:calc(1.75 / 1.125)","text-xl":"font-size:1.25rem;line-height:calc(1.75 / 1.25)","text-2xl":"font-size:1.5rem;line-height:calc(2 / 1.5)","text-3xl":"font-size:1.875rem;line-height:calc(2.25 / 1.875)","text-4xl":"font-size:2.25rem;line-height:calc(2.5 / 2.25)","text-5xl":"font-size:3rem;line-height:1","text-6xl":"font-size:3.75rem;line-height:1","text-7xl":"font-size:4.5rem;line-height:1","text-8xl":"font-size:6rem;line-height:1",border:"border-width:1px;","border-2":"border-width:2px;","border-4":"border-width:4px;","border-6":"border-width:6px;","border-8":"border-width:8px;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-xl":"border-radius:0.75rem;","rounded-2xl":"border-radius:1rem;","rounded-3xl":"border-radius:1.5rem;","rounded-4xl":"border-radius:2rem;","rounded-full":"border-radius:9999px;","shadow-none":"--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);","shadow-xs":"--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));","shadow-sm":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-md":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-lg":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-xl":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-2xl":"--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, rgb(0 0 0 / 0.25));",truncate:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",visible:"visibility:visible;",invisible:"visibility:hidden;","items-center":"align-items:center;","items-start":"align-items:flex-start;","items-end":"align-items:flex-end;","items-baseline":"align-items:baseline;","items-stretch":"align-items:stretch;","justify-center":"justify-content:center;","justify-start":"justify-content:flex-start;","justify-between":"justify-content:space-between;","justify-around":"justify-content:space-around;","justify-evenly":"justify-content:space-evenly;","justify-end":"justify-content:flex-end;","flex-wrap":"flex-wrap:wrap;","flex-nowrap":"flex-wrap:nowrap;","flex-wrap-reverse":"flex-wrap:wrap-reverse;","content-center":"align-content:center;","content-start":"align-content:flex-start;","content-end":"align-content:flex-end;","content-between":"align-content:space-between;","content-around":"align-content:space-around;","content-stretch":"align-content:stretch;","self-auto":"align-self:auto;","self-start":"align-self:flex-start;","self-end":"align-self:flex-end;","self-center":"align-self:center;","self-stretch":"align-self:stretch;","flex-1":"flex:1 1 0%;","flex-auto":"flex:1 1 auto;","flex-initial":"flex:0 1 auto;","flex-none":"flex:0 0 auto;","flex-col":"flex-direction:column;","flex-row":"flex-direction:row;",grow:"flex-grow:1;",shrink:"flex-shrink:1;","grow-0":"flex-grow:0;","shrink-0":"flex-shrink:0;","font-sans":"font-family:ui-sans-serif,system-ui,sans-serif;","font-serif":"font-family:ui-serif,Georgia,serif;","font-mono":"font-family:ui-monospace,SFMono-Regular,monospace;","line-clamp-1":"display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-2":"display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-3":"display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-4":"display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;","transition-all":"transition-property:all;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-shadow":"transition-property:box-shadow;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","transition-none":"transition-property:none;","cursor-auto":"cursor:auto;","cursor-default":"cursor:default;","cursor-pointer":"cursor:pointer;","cursor-wait":"cursor:wait;","cursor-text":"cursor:text;","cursor-move":"cursor:move;","cursor-help":"cursor:help;","cursor-not-allowed":"cursor:not-allowed;","z-0":"z-index:0;","z-10":"z-index:10;","z-20":"z-index:20;","z-30":"z-index:30;","z-40":"z-index:40;","z-50":"z-index:50;"},Ye={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]};function G(e,t){let n=0,r=0;for(let i=0;i<e.length;i++){const s=e[i];if(s==="[")n++;else if(s==="]"&&n>0)n--;else if(s==="(")r++;else if(s===")"&&r>0)r--;else if(n===0&&r===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,i)+t+e.slice(i)}return e+t}const Vt={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${G(e,":hover")}{${t}}`,focus:(e,t)=>`${G(e,":focus")}{${t}}`,active:(e,t)=>`${G(e,":active")}{${t}}`,disabled:(e,t)=>`${G(e,":disabled")}{${t}}`,visited:(e,t)=>`${G(e,":visited")}{${t}}`,checked:(e,t)=>`${G(e,":checked")}{${t}}`,first:(e,t)=>`${G(e,":first-child")}{${t}}`,last:(e,t)=>`${G(e,":last-child")}{${t}}`,odd:(e,t)=>`${G(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${G(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${G(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${G(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},Me={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},je=["sm","md","lg","xl","2xl"];function Ne(e){const t=e.startsWith("-"),r=(t?e.slice(1):e).split("-");if(r.length<2)return null;const i=r.slice(0,-1).join("-"),s=r[r.length-1],o=parseFloat(s);if(Number.isNaN(o)||!Ye[i])return null;const a=t?"-":"";return Ye[i].map(u=>`${u}:calc(${a}${le} * ${o});`).join("")}function et(e){const t=e.replace("#",""),n=parseInt(t,16),r=n>>16&255,i=n>>8&255,s=n&255;return`${r} ${i} ${s}`}function Jt(e){const t=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,n,r,i="DEFAULT"]=t,s=Ut[r]?.[i];if(!s)return null;if(n==="shadow")return`--ce-shadow-color:${s};`;const a={bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",outline:"outline-color",caret:"caret-color",accent:"accent-color",fill:"fill",stroke:"stroke"}[n];return a?`${a}:${s};`:null}function Zt(e){const[t,n]=e.split("/");if(!n)return{base:t};const r=parseInt(n,10);return isNaN(r)||r<0||r>100?{base:t}:{base:t,opacity:r/100}}function We(e){const{base:t,opacity:n}=Zt(e),r=Jt(t);if(r){if(n!==void 0){const s=/#([0-9a-f]{6})/i.exec(r);if(s){const o=et(s[0]);return r.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${n})`)}}return r}const i=Te(t);if(i&&n!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=et(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${n})`)}}return i}function ze(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const n=parseInt(t[1],10);return n<0||n>100?null:`opacity:${n/100};`}function Te(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const i=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(i){const s=i[1].trim();let o=i[2].trim();return o=o.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),o=o.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${o};`}return null}const t=e.indexOf("-["),n=e.endsWith("]");if(t>0&&n){const r=e.slice(0,t);let i=e.slice(t+2,-1);i=i.replace(/_/g," ");const s={bg:"background-color",text:"color",shadow:"box-shadow",p:"padding",px:"padding-inline",py:"padding-block",m:"margin",mx:"margin-inline",my:"margin-block",w:"width",h:"height","min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height","border-t":"border-top","border-b":"border-bottom","border-l":"border-left","border-r":"border-right","border-x":"border-inline","border-y":"border-block","grid-cols":"grid-template-columns","grid-rows":"grid-template-rows",transition:"transition-property",ease:"transition-timing-function",delay:"transition-delay",duration:"transition-duration",list:"list-style",break:"word-break",flex:"flex-direction",items:"align-items",justify:"justify-content",whitespace:"white-space",select:"user-select",content:"align-content",self:"align-self",basis:"flex-basis",tracking:"letter-spacing",scroll:"scroll-behavior",weight:"font-weight",leading:"line-height",z:"z-index"};if(r==="rotate")return`transform:rotate(${i});`;const o=s[r]??r.replace(/_/g,"-");if(o&&i)return`${o}:${i};`}return null}function Gt(e){if(e.startsWith("[")&&e.endsWith("]")){const n=e.slice(1,-1);return n.includes("&")?n:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const n=e.slice(t+2,-1).replace(/_/g,"-");return n.includes("&")?n:e.replace(/_/g,"-")}return null}function Qt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Xt(e){const t=/class\s*=\s*(['"])(.*?)\1/g,n=[];let r;for(;r=t.exec(e);){const i=r[2].split(/\s+/).filter(Boolean);i.length&&n.push(...i)}return n.filter(Boolean)}const tt=new Map,Yt=16;function en(e){const t=Date.now(),n=tt.get(e);if(n&&t-n.timestamp<Yt)return n.css;const r=Xt(e),i=new Set(r),s=[],o=[],a=[],u=[],m={};function g(w,c=!1){const h=(c?"dark|":"")+w;if(h in m)return m[h];const y=d(w,c);return m[h]=y,y}function b(w){const c=w.some(y=>je.includes(y)),h=w.includes("dark");return w.length===0?1:!c&&!h?2:c&&!h?3:4}function p(w){const c=[];let h="",y=0,C=0;for(let k=0;k<w.length;k++){const f=w[k];f==="["?y++:f==="]"&&y>0?y--:f==="("?C++:f===")"&&C>0&&C--,f===":"&&y===0&&C===0?(c.push(h),h=""):h+=f}return h&&c.push(h),c}function l(w){switch(w){case"hover":return":hover";case"focus":return":focus";case"active":return":active";case"visited":return":visited";case"disabled":return":disabled";case"checked":return":checked";case"first":return":first-child";case"last":return":last-child";case"odd":return":nth-child(odd)";case"even":return":nth-child(even)";case"focus-within":return":focus-within";case"focus-visible":return":focus-visible";default:return null}}function d(w,c=!1){const h=p(w);let y=!1;const C=h.find(E=>(E.startsWith("!")&&(y=!0,E=E.slice(1)),Le[E]||Ne(E)||ze(E)||We(E)||Te(E)));if(!C)return null;const k=C.replace(/^!/,""),f=Le[k]??Ne(k)??ze(k)??We(k)??Te(k);if(!f)return null;const x=h.indexOf(C);let A=x>=0?h.slice(0,x):[];c&&(A=A.filter(E=>E!=="dark"));const _=`.${Qt(w)}`,$="__SUBJECT__",T=y?f.replace(/;$/," !important;"):f;let R=$;const S=[];for(const E of A)E.startsWith("group-")?(R=`.group:${E.slice(6)} ${R}`,S.push(E)):E.startsWith("peer-")&&(R=R.replace($,`.peer:${E.slice(5)}~${$}`),S.push(E));A=A.filter(E=>!S.includes(E));const P=[],U=[];let V=null;for(const E of A){if(E==="dark"||je.includes(E))continue;const q=Gt(E);if(q){V=q;continue}const D=l(E);if(D){V?U.push(D):P.push(D);continue}const W=Vt[E];typeof W=="function"&&(R=W(R,T).split("{")[0])}function ve(E,q){if(!q)return E;let D=0,W=0;if(E.length&&(E[0]===">"||E[0]==="+"||E[0]==="~"||E[0]===" ")){let O=1;for(;O<E.length&&E[O]===" ";)O++;for(;O<E.length;O++){const I=E[O];if(I==="["?D++:I==="]"&&D>0?D--:I==="("?W++:I===")"&&W>0&&W--,D===0&&W===0&&(E[O]===">"||E[O]==="+"||E[O]==="~"||E[O]===" "))return E.slice(0,O)+q+E.slice(O)}return E+q}for(let O=0;O<E.length;O++){const I=E[O];if(I==="["?D++:I==="]"&&D>0?D--:I==="("?W++:I===")"&&W>0&&W--,D===0&&W===0&&(I===">"||I==="+"||I==="~"||I===" "))return E.slice(0,O)+q+E.slice(O)}return E+q}const K=P.join(""),L=U.join("");if(V)if(V.includes("&")){const E=V.indexOf("&"),q=V.slice(0,E),D=V.slice(E+1),W=$+K,O=R;if(P.length===0)R=O.replace($,q+W+L+D);else{const I=ve(D,L);R=O.replace($,q+W+I)}}else R=R.replace($,`${V}${$+K}`),L&&(R=R.replace($,`${$}${L}`));else R=$+K+L;R=R.replace(new RegExp($,"g"),_);let j=`${R}{${T}}`;const J=A.filter(E=>je.includes(E)),Z=J.length?J[J.length-1]:null,z=A.includes("dark");return c&&Z?j=`@media (prefers-color-scheme: dark) and ${Me[Z]}{${j}}`:c?j=`@media (prefers-color-scheme: dark){${j}}`:z&&Z?j=`@media (prefers-color-scheme: dark) and ${Me[Z]}{${j}}`:z?j=`@media (prefers-color-scheme: dark){${j}}`:Z&&(j=`@media ${Me[Z]}{${j}}`),j}for(const w of i){const c=p(w),h=c.find(f=>Le[f]||Ne(f)||ze(f)||We(f)||Te(f));if(!h)continue;const y=c.indexOf(h),C=y>=0?c.slice(0,y):[],k=b(C);if(k===4){const f=g(w,!0);f&&u.push(f)}else{const f=g(w);f&&(k===1?s.push(f):k===2?o.push(f):k===3&&a.push(f))}}const v=[...s,...o,...a,...u].join("");return tt.set(e,{css:v,timestamp:t}),v}const me=[];function tn(e,t,n,r,i,s,o,a){if(e){me.push(n);try{const u=t.render(n);if(u instanceof Promise){s(!0),u.then(m=>{s(!1),o(null),nt(e,m,n,r,i),a(e.innerHTML)}).catch(m=>{s(!1),o(m)});return}nt(e,u,n,r,i),a(e.innerHTML)}finally{me.pop()}}}function nt(e,t,n,r,i){e&&(Dt(e,Array.isArray(t)?t:[t],n,r),i(e.innerHTML))}function nn(e,t,n,r,i,s,o){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(i(n+1),n===15)console.warn(`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
62
|
+
`,Bt={neutral:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},info:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},warning:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}},Ut=Object.fromEntries(Object.entries(Bt).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([r,n])=>[r,`var(--color-${e}${r==="DEFAULT"?"":`-${r}`}, ${n})`]))])),le="0.25rem",qt={"3xs":64,"2xs":72,xs:80,sm:96,md:112,lg:128,xl:144,"2xl":168,"3xl":192,"4xl":224,"5xl":256,"6xl":288,"7xl":320},Ft=()=>{const e={};for(const[t,r]of Object.entries(qt))e[`max-w-${t}`]=`max-width:calc(${le} * ${r});`,e[`min-w-${t}`]=`min-width:calc(${le} * ${r});`,e[`w-${t}`]=`width:calc(${le} * ${r});`,e[`max-h-${t}`]=`max-height:calc(${le} * ${r});`,e[`min-h-${t}`]=`min-height:calc(${le} * ${r});`,e[`h-${t}`]=`height:calc(${le} * ${r});`;return e},Kt=()=>{const e={};for(const t of[1,2,3,4,5,6,7,8,9,10,11,12])e[`grid-cols-${t}`]=`grid-template-columns:repeat(${t},minmax(0,1fr));`,e[`grid-rows-${t}`]=`grid-template-rows:repeat(${t},minmax(0,1fr));`,e[`col-span-${t}`]=`grid-column:span ${t} / span ${t};`,e[`row-span-${t}`]=`grid-row:span ${t} / span ${t};`;return e},Le={block:"display:block;",inline:"display:inline;","inline-block":"display:inline-block;",flex:"display:flex;","inline-flex":"display:inline-flex;",grid:"display:grid;",hidden:"display:none;","w-full":"width:100%;","w-screen":"width:100dvw;","h-full":"height:100%;","h-screen":"height:100dvw;","max-w-full":"max-width:100%;","max-h-full":"max-height:100%;","max-w-screen":"max-width:100dvw;","max-h-screen":"max-height:100dvh;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","min-w-screen":"min-width:100dvw;","min-h-screen":"min-height:100dvh;",...Ft(),"m-auto":"margin:auto;","mx-auto":"margin-inline:auto;","my-auto":"margin-block:auto;","overflow-auto":"overflow:auto;","overflow-hidden":"overflow:hidden;","overflow-visible":"overflow:visible;","overflow-scroll":"overflow:scroll;","overflow-y-auto":"overflow-y:auto;","overflow-y-hidden":"overflow-y:hidden;","overflow-y-visible":"overflow-y:visible;","overflow-y-scroll":"overflow-y:scroll;","overflow-x-auto":"overflow-x:auto;","overflow-x-hidden":"overflow-x:hidden;","overflow-x-visible":"overflow-x:visible;","overflow-x-scroll":"overflow-x:scroll;","pointer-events-none":"pointer-events:none;","pointer-events-auto":"pointer-events:auto;","sr-only":"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;","not-sr-only":"position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",...Kt(),absolute:"position:absolute;",relative:"position:relative;",fixed:"position:fixed;",sticky:"position:sticky;","font-bold":"font-weight:700;","font-semibold":"font-weight:600;","font-medium":"font-weight:500;","font-light":"font-weight:300;",underline:"text-decoration-line:underline;",overline:"text-decoration-line:overline;","line-through":"text-decoration-line:line-through;","no-underline":"text-decoration-line:none;",italic:"font-style:italic;","not-italic":"font-style:normal;",uppercase:"text-transform:uppercase;",lowercase:"text-transform:lowercase;",capitalize:"text-transform:capitalize;","normal-case":"text-transform:none;","text-left":"text-align:left;","text-center":"text-align:center;","text-right":"text-align:right;","text-xs":"font-size:0.75rem;line-height:calc(1 / 0.75)","text-sm":"font-size:0.875rem;line-height:calc(1.25 / 0.875)","text-base":"font-size:1rem;line-height:calc(1.5 / 1)","text-lg":"font-size:1.125rem;line-height:calc(1.75 / 1.125)","text-xl":"font-size:1.25rem;line-height:calc(1.75 / 1.25)","text-2xl":"font-size:1.5rem;line-height:calc(2 / 1.5)","text-3xl":"font-size:1.875rem;line-height:calc(2.25 / 1.875)","text-4xl":"font-size:2.25rem;line-height:calc(2.5 / 2.25)","text-5xl":"font-size:3rem;line-height:1","text-6xl":"font-size:3.75rem;line-height:1","text-7xl":"font-size:4.5rem;line-height:1","text-8xl":"font-size:6rem;line-height:1",border:"border-width:1px;","border-t":"border-top-width:1px;","border-r":"border-right-width:1px;","border-b":"border-bottom-width:1px;","border-l":"border-left-width:1px;","border-x":"border-inline-width:1px;","border-y":"border-block-width:1px;","border-2":"border-width:2px;","border-4":"border-width:4px;","border-6":"border-width:6px;","border-8":"border-width:8px;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;","rounded-t-xs":"border-top-left-radius:0.125rem;border-top-right-radius:0.125rem;","rounded-r-xs":"border-top-right-radius:0.125rem;border-bottom-right-radius:0.125rem;","rounded-b-xs":"border-bottom-left-radius:0.125rem;border-bottom-right-radius:0.125rem;","rounded-l-xs":"border-top-left-radius:0.125rem;border-bottom-left-radius:0.125rem;","rounded-sm":"border-radius:0.25rem;","rounded-t-sm":"border-top-left-radius:0.25rem;border-top-right-radius:0.25rem;","rounded-r-sm":"border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;","rounded-b-sm":"border-bottom-left-radius:0.25rem;border-bottom-right-radius:0.25rem;","rounded-l-sm":"border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-t-md":"border-top-left-radius:0.375rem;border-top-right-radius:0.375rem;","rounded-r-md":"border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem;","rounded-b-md":"border-bottom-left-radius:0.375rem;border-bottom-right-radius:0.375rem;","rounded-l-md":"border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-t-lg":"border-top-left-radius:0.5rem;border-top-right-radius:0.5rem;","rounded-r-lg":"border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;","rounded-b-lg":"border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;","rounded-l-lg":"border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;","rounded-xl":"border-radius:0.75rem;","rounded-t-xl":"border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;","rounded-r-xl":"border-top-right-radius:0.75rem;border-bottom-right-radius:0.75rem;","rounded-b-xl":"border-bottom-left-radius:0.75rem;border-bottom-right-radius:0.75rem;","rounded-l-xl":"border-top-left-radius:0.75rem;border-bottom-left-radius:0.75rem;","rounded-2xl":"border-radius:1rem;","rounded-t-2xl":"border-top-left-radius:1rem;border-top-right-radius:1rem;","rounded-r-2xl":"border-top-right-radius:1rem;border-bottom-right-radius:1rem;","rounded-b-2xl":"border-bottom-left-radius:1rem;border-bottom-right-radius:1rem;","rounded-l-2xl":"border-top-left-radius:1rem;border-bottom-left-radius:1rem;","rounded-3xl":"border-radius:1.5rem;","rounded-t-3xl":"border-top-left-radius:1.5rem;border-top-right-radius:1.5rem;","rounded-r-3xl":"border-top-right-radius:1.5rem;border-bottom-right-radius:1.5rem;","rounded-b-3xl":"border-bottom-left-radius:1.5rem;border-bottom-right-radius:1.5rem;","rounded-l-3xl":"border-top-left-radius:1.5rem;border-bottom-left-radius:1.5rem;","rounded-4xl":"border-radius:2rem;","rounded-t-4xl":"border-top-left-radius:2rem;border-top-right-radius:2rem;","rounded-r-4xl":"border-top-right-radius:2rem;border-bottom-right-radius:2rem;","rounded-b-4xl":"border-bottom-left-radius:2rem;border-bottom-right-radius:2rem;","rounded-l-4xl":"border-top-left-radius:2rem;border-bottom-left-radius:2rem;","rounded-full":"border-radius:9999px;","rounded-t-full":"border-top-left-radius:9999px;border-top-right-radius:9999px;","rounded-r-full":"border-top-right-radius:9999px;border-bottom-right-radius:9999px;","rounded-b-full":"border-bottom-left-radius:9999px;border-bottom-right-radius:9999px;","rounded-l-full":"border-top-left-radius:9999px;border-bottom-left-radius:9999px;","shadow-none":"--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);","shadow-xs":"--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));","shadow-sm":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-md":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-lg":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-xl":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-2xl":"--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, rgb(0 0 0 / 0.25));",truncate:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",visible:"visibility:visible;",invisible:"visibility:hidden;","items-center":"align-items:center;","items-start":"align-items:flex-start;","items-end":"align-items:flex-end;","items-baseline":"align-items:baseline;","items-stretch":"align-items:stretch;","justify-center":"justify-content:center;","justify-start":"justify-content:flex-start;","justify-between":"justify-content:space-between;","justify-around":"justify-content:space-around;","justify-evenly":"justify-content:space-evenly;","justify-end":"justify-content:flex-end;","flex-wrap":"flex-wrap:wrap;","flex-nowrap":"flex-wrap:nowrap;","flex-wrap-reverse":"flex-wrap:wrap-reverse;","content-center":"align-content:center;","content-start":"align-content:flex-start;","content-end":"align-content:flex-end;","content-between":"align-content:space-between;","content-around":"align-content:space-around;","content-stretch":"align-content:stretch;","self-auto":"align-self:auto;","self-start":"align-self:flex-start;","self-end":"align-self:flex-end;","self-center":"align-self:center;","self-stretch":"align-self:stretch;","flex-1":"flex:1 1 0%;","flex-auto":"flex:1 1 auto;","flex-initial":"flex:0 1 auto;","flex-none":"flex:0 0 auto;","flex-col":"flex-direction:column;","flex-row":"flex-direction:row;",grow:"flex-grow:1;",shrink:"flex-shrink:1;","grow-0":"flex-grow:0;","shrink-0":"flex-shrink:0;","font-sans":"font-family:ui-sans-serif,system-ui,sans-serif;","font-serif":"font-family:ui-serif,Georgia,serif;","font-mono":"font-family:ui-monospace,SFMono-Regular,monospace;","line-clamp-1":"display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-2":"display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-3":"display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-4":"display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;","transition-all":"transition-property:all;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-shadow":"transition-property:box-shadow;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","transition-none":"transition-property:none;","cursor-auto":"cursor:auto;","cursor-default":"cursor:default;","cursor-pointer":"cursor:pointer;","cursor-wait":"cursor:wait;","cursor-text":"cursor:text;","cursor-move":"cursor:move;","cursor-help":"cursor:help;","cursor-not-allowed":"cursor:not-allowed;","z-0":"z-index:0;","z-10":"z-index:10;","z-20":"z-index:20;","z-30":"z-index:30;","z-40":"z-index:40;","z-50":"z-index:50;"},Ye={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]};function G(e,t){let r=0,n=0;for(let i=0;i<e.length;i++){const s=e[i];if(s==="[")r++;else if(s==="]"&&r>0)r--;else if(s==="(")n++;else if(s===")"&&n>0)n--;else if(r===0&&n===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,i)+t+e.slice(i)}return e+t}const Vt={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${G(e,":hover")}{${t}}`,focus:(e,t)=>`${G(e,":focus")}{${t}}`,active:(e,t)=>`${G(e,":active")}{${t}}`,disabled:(e,t)=>`${G(e,":disabled")}{${t}}`,visited:(e,t)=>`${G(e,":visited")}{${t}}`,checked:(e,t)=>`${G(e,":checked")}{${t}}`,first:(e,t)=>`${G(e,":first-child")}{${t}}`,last:(e,t)=>`${G(e,":last-child")}{${t}}`,odd:(e,t)=>`${G(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${G(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${G(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${G(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},Me={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},je=["sm","md","lg","xl","2xl"];function Ne(e){const t=e.startsWith("-"),n=(t?e.slice(1):e).split("-");if(n.length<2)return null;const i=n.slice(0,-1).join("-"),s=n[n.length-1],o=parseFloat(s);if(Number.isNaN(o)||!Ye[i])return null;const a=t?"-":"";return Ye[i].map(u=>`${u}:calc(${a}${le} * ${o});`).join("")}function et(e){const t=e.replace("#",""),r=parseInt(t,16),n=r>>16&255,i=r>>8&255,s=r&255;return`${n} ${i} ${s}`}function Jt(e){const t=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,n,i="DEFAULT"]=t,s=Ut[n]?.[i];if(!s)return null;if(r==="shadow")return`--ce-shadow-color:${s};`;const a={bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",outline:"outline-color",caret:"caret-color",accent:"accent-color",fill:"fill",stroke:"stroke"}[r];return a?`${a}:${s};`:null}function Zt(e){const[t,r]=e.split("/");if(!r)return{base:t};const n=parseInt(r,10);return isNaN(n)||n<0||n>100?{base:t}:{base:t,opacity:n/100}}function We(e){const{base:t,opacity:r}=Zt(e),n=Jt(t);if(n){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const o=et(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return n}const i=Te(t);if(i&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=et(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return i}function ze(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const r=parseInt(t[1],10);return r<0||r>100?null:`opacity:${r/100};`}function Te(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const i=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(i){const s=i[1].trim();let o=i[2].trim();return o=o.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),o=o.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${o};`}return null}const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const n=e.slice(0,t);let i=e.slice(t+2,-1);i=i.replace(/_/g," ");const s={bg:"background-color",text:"color",shadow:"box-shadow",p:"padding",px:"padding-inline",py:"padding-block",m:"margin",mx:"margin-inline",my:"margin-block",w:"width",h:"height","min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height","border-t":"border-top-width","border-b":"border-bottom-width","border-l":"border-left-width","border-r":"border-right-width","border-x":"border-inline-width","border-y":"border-block-width","grid-cols":"grid-template-columns","grid-rows":"grid-template-rows",transition:"transition-property",ease:"transition-timing-function",delay:"transition-delay",duration:"transition-duration",list:"list-style",break:"word-break",flex:"flex-direction",items:"align-items",justify:"justify-content",whitespace:"white-space",select:"user-select",content:"align-content",self:"align-self",basis:"flex-basis",tracking:"letter-spacing",scroll:"scroll-behavior",weight:"font-weight",leading:"line-height",z:"z-index"};if(n==="rotate")return`transform:rotate(${i});`;const o=s[n]??n.replace(/_/g,"-");if(o&&i)return`${o}:${i};`}return null}function Gt(e){if(e.startsWith("[")&&e.endsWith("]")){const r=e.slice(1,-1);return r.includes("&")?r:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const r=e.slice(t+2,-1).replace(/_/g,"-");return r.includes("&")?r:e.replace(/_/g,"-")}return null}function Qt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Xt(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let n;for(;n=t.exec(e);){const i=n[2].split(/\s+/).filter(Boolean);i.length&&r.push(...i)}return r.filter(Boolean)}const tt=new Map,Yt=16;function er(e){const t=Date.now(),r=tt.get(e);if(r&&t-r.timestamp<Yt)return r.css;const n=Xt(e),i=new Set(n),s=[],o=[],a=[],u=[],m={};function g(w,c=!1){const h=(c?"dark|":"")+w;if(h in m)return m[h];const y=d(w,c);return m[h]=y,y}function b(w){const c=w.some(y=>je.includes(y)),h=w.includes("dark");return w.length===0?1:!c&&!h?2:c&&!h?3:4}function p(w){const c=[];let h="",y=0,C=0;for(let k=0;k<w.length;k++){const f=w[k];f==="["?y++:f==="]"&&y>0?y--:f==="("?C++:f===")"&&C>0&&C--,f===":"&&y===0&&C===0?(c.push(h),h=""):h+=f}return h&&c.push(h),c}function l(w){switch(w){case"hover":return":hover";case"focus":return":focus";case"active":return":active";case"visited":return":visited";case"disabled":return":disabled";case"checked":return":checked";case"first":return":first-child";case"last":return":last-child";case"odd":return":nth-child(odd)";case"even":return":nth-child(even)";case"focus-within":return":focus-within";case"focus-visible":return":focus-visible";default:return null}}function d(w,c=!1){const h=p(w);let y=!1;const C=h.find(E=>(E.startsWith("!")&&(y=!0,E=E.slice(1)),Le[E]||Ne(E)||ze(E)||We(E)||Te(E)));if(!C)return null;const k=C.replace(/^!/,""),f=Le[k]??Ne(k)??ze(k)??We(k)??Te(k);if(!f)return null;const v=h.indexOf(C);let A=v>=0?h.slice(0,v):[];c&&(A=A.filter(E=>E!=="dark"));const _=`.${Qt(w)}`,$="__SUBJECT__",T=y?f.replace(/;$/," !important;"):f;let R=$;const S=[];for(const E of A)E.startsWith("group-")?(R=`.group:${E.slice(6)} ${R}`,S.push(E)):E.startsWith("peer-")&&(R=R.replace($,`.peer:${E.slice(5)}~${$}`),S.push(E));A=A.filter(E=>!S.includes(E));const P=[],U=[];let V=null;for(const E of A){if(E==="dark"||je.includes(E))continue;const q=Gt(E);if(q){V=q;continue}const D=l(E);if(D){V?U.push(D):P.push(D);continue}const W=Vt[E];typeof W=="function"&&(R=W(R,T).split("{")[0])}function xe(E,q){if(!q)return E;let D=0,W=0;if(E.length&&(E[0]===">"||E[0]==="+"||E[0]==="~"||E[0]===" ")){let O=1;for(;O<E.length&&E[O]===" ";)O++;for(;O<E.length;O++){const I=E[O];if(I==="["?D++:I==="]"&&D>0?D--:I==="("?W++:I===")"&&W>0&&W--,D===0&&W===0&&(E[O]===">"||E[O]==="+"||E[O]==="~"||E[O]===" "))return E.slice(0,O)+q+E.slice(O)}return E+q}for(let O=0;O<E.length;O++){const I=E[O];if(I==="["?D++:I==="]"&&D>0?D--:I==="("?W++:I===")"&&W>0&&W--,D===0&&W===0&&(I===">"||I==="+"||I==="~"||I===" "))return E.slice(0,O)+q+E.slice(O)}return E+q}const K=P.join(""),L=U.join("");if(V)if(V.includes("&")){const E=V.indexOf("&"),q=V.slice(0,E),D=V.slice(E+1),W=$+K,O=R;if(P.length===0)R=O.replace($,q+W+L+D);else{const I=xe(D,L);R=O.replace($,q+W+I)}}else R=R.replace($,`${V}${$+K}`),L&&(R=R.replace($,`${$}${L}`));else R=$+K+L;R=R.replace(new RegExp($,"g"),_);let j=`${R}{${T}}`;const J=A.filter(E=>je.includes(E)),Z=J.length?J[J.length-1]:null,z=A.includes("dark");return c&&Z?j=`@media (prefers-color-scheme: dark) and ${Me[Z]}{${j}}`:c?j=`@media (prefers-color-scheme: dark){${j}}`:z&&Z?j=`@media (prefers-color-scheme: dark) and ${Me[Z]}{${j}}`:z?j=`@media (prefers-color-scheme: dark){${j}}`:Z&&(j=`@media ${Me[Z]}{${j}}`),j}for(const w of i){const c=p(w),h=c.find(f=>Le[f]||Ne(f)||ze(f)||We(f)||Te(f));if(!h)continue;const y=c.indexOf(h),C=y>=0?c.slice(0,y):[],k=b(C);if(k===4){const f=g(w,!0);f&&u.push(f)}else{const f=g(w);f&&(k===1?s.push(f):k===2?o.push(f):k===3&&a.push(f))}}const x=[...s,...o,...a,...u].join("");return tt.set(e,{css:x,timestamp:t}),x}const me=[];function tr(e,t,r,n,i,s,o,a){if(e){me.push(r);try{const u=t.render(r);if(u instanceof Promise){s(!0),u.then(m=>{s(!1),o(null),rt(e,m,r,n,i),a(e.innerHTML)}).catch(m=>{s(!1),o(m)});return}rt(e,u,r,n,i),a(e.innerHTML)}finally{me.pop()}}}function rt(e,t,r,n,i){e&&(Dt(e,Array.isArray(t)?t:[t],r,n),i(e.innerHTML))}function rr(e,t,r,n,i,s,o){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(i(r+1),r===15)console.warn(`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
63
63
|
Common causes:
|
|
64
64
|
• Event handler calling a function immediately: @click="\${fn()}" should be @click="\${fn}"
|
|
65
65
|
• State modification during render
|
|
66
66
|
• Missing dependencies in computed/watch
|
|
67
|
-
Component rendering will be throttled to prevent browser freeze.`);else if(
|
|
67
|
+
Component rendering will be throttled to prevent browser freeze.`);else if(r>20){console.error(`🛑 Infinite loop detected in component render:
|
|
68
68
|
• This might be caused by state updates during render
|
|
69
69
|
• Ensure all state modifications are done in event handlers or effects
|
|
70
|
-
Stopping runaway component render to prevent browser freeze`),o(null);return}}else i(0);const m=setTimeout(()=>{
|
|
70
|
+
Stopping runaway component render to prevent browser freeze`),o(null);return}}else i(0);const m=setTimeout(()=>{n(Date.now()),e(),o(null)},r>10?100:0);o(m)}function nr(e,t,r,n,i){if(!e)return;const s=er(r);if((!s||s.trim()==="")&&!t._computedStyle){i(null),e.adoptedStyleSheets=[Xe()];return}let o="";t._computedStyle&&(o=t._computedStyle);let a=It(`${o}
|
|
71
71
|
${s}
|
|
72
|
-
`);a=ut(a);let u=r;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==a)&&u.replaceSync(a),e.adoptedStyleSheets=[Xe(),u],i(u)}let N=null;function sn(e){N=e}function on(){N=null}function an(){if(!N)throw new Error("useEmit must be called during component render");const e=N.emit;return(t,n)=>e(t,n)}function be(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function cn(e){if(!N)throw new Error("useOnConnected must be called during component render");be(N),N._hookCallbacks.onConnected=e}function ln(e){if(!N)throw new Error("useOnDisconnected must be called during component render");be(N),N._hookCallbacks.onDisconnected=e}function un(e){if(!N)throw new Error("useOnAttributeChanged must be called during component render");be(N),N._hookCallbacks.onAttributeChanged=e}function fn(e){if(!N)throw new Error("useOnError must be called during component render");be(N),N._hookCallbacks.onError=e}function dn(e){if(!N)throw new Error("useStyle must be called during component render");be(N);try{const t=e();Object.defineProperty(N,"_computedStyle",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(t){console.warn("Error in useStyle callback:",t),Object.defineProperty(N,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const Oe=new Map,rt=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[rt]||(e[rt]=Oe)}function hn(e,t){if(!t.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=Oe.get(e)||t,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const n=this._initContext(t);Object.defineProperty(n,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"_requestRender",{value:()=>this._requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"_componentId",{value:this._componentId,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"_triggerWatchers",{value:(i,s)=>this._triggerWatchers(i,s),writable:!1,enumerable:!1,configurable:!1}),this.context=n,Object.defineProperty(this.context,"emit",{value:(i,s,o)=>{const a=new CustomEvent(i,{detail:s,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const r=Oe.get(e)||t;Object.keys(r).forEach(i=>{const s=r[i];typeof s=="function"&&(this.context[i]=(...o)=>s(...o,this.context))}),this._applyComputed(r),r.props&&Object.keys(r.props).forEach(i=>{let s=this[i];Object.defineProperty(this,i,{get(){return s},set(o){const a=s;s=o,this.context[i]=o,this._initializing||(this._applyProps(r),a!==o&&this._requestRender())},enumerable:!0,configurable:!0})}),this._initializing=!1,this._initWatchers(r),this._applyProps(r),this._render(r)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),this._requestRender(),At(t,this.context,this._mounted,n=>{this._mounted=n})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Tt(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},n=>{this._templateLoading=n},n=>{this._templateError=n},n=>{this._mounted=n})})}attributeChangedCallback(n,r,i){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),r!==i&&this._requestRender(),Rt(t,n,r,i,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(ne):[]}_applyComputed(n){}_render(n){this._runLogicWithinErrorBoundary(n,()=>{tn(this.shadowRoot,n,this.context,this._refs,r=>{this._lastHtmlStringForJitCSS=r,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(r)},r=>{this._templateLoading=r,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(r)},r=>{this._templateError=r,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(r)},r=>this._applyStyle(n,r))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{de(()=>{nn(()=>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,r){this._runLogicWithinErrorBoundary(n,()=>{rn(this.shadowRoot,this.context,r,this._styleSheet,i=>{this._styleSheet=i})})}_runLogicWithinErrorBoundary(n,r){this._hasError&&(this._hasError=!1);try{r()}catch(i){this._hasError=!0,n.onError&&n.onError(i,this.context)}}_initContext(n){try{let r=function(s,o=""){return Array.isArray(s)?new Proxy(s,{get(a,u,m){const g=Reflect.get(a,u,m);return typeof g=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...p){const l=g.apply(a,p);if(!i._initializing){const d=o||"root";i._triggerWatchers(d,a),de(()=>i._render(n),i._componentId)}return l}:g},set(a,u,m){if(a[u]=m,!i._initializing){const g=o?`${o}.${String(u)}`:String(u);i._triggerWatchers(g,m),de(()=>i._render(n),i._componentId)}return!0},deleteProperty(a,u){if(delete a[u],!i._initializing){const m=o?`${o}.${String(u)}`:String(u);i._triggerWatchers(m,void 0),de(()=>i._render(n),i._componentId)}return!0}}):s&&typeof s=="object"?s.constructor&&s.constructor.name==="ReactiveState"?s:(Object.keys(s).forEach(a=>{const u=o?`${o}.${a}`:a;s[a]=r(s[a],u)}),new Proxy(s,{set(a,u,m){const g=o?`${o}.${String(u)}`:String(u);return a[u]=r(m,g),i._initializing||(i._triggerWatchers(g,a[u]),de(()=>i._render(n),i._componentId)),!0},get(a,u,m){return Reflect.get(a,u,m)}})):s};const i=this;return r({...n.props?Object.fromEntries(Object.entries(n.props).map(([s,o])=>[s,o.default])):{}})}catch{return{}}}_initWatchers(n){this._runLogicWithinErrorBoundary(n,()=>{_t(this.context,this._watchers,{})})}_triggerWatchers(n,r){Et(this.context,this._watchers,n,r)}_applyProps(n){this._runLogicWithinErrorBoundary(n,()=>{try{St(this,n,this.context)}catch(r){this._hasError=!0,n.onError&&n.onError(r,this.context)}})}}}function Ue(e,t){let n=ne(e);n.includes("-")||(n=`cer-${n}`);let r={};if(typeof window<"u")try{const a=t.toString().match(/\(\s*{\s*([^}]+)\s*}/);if(a){const m=a[1].split(",").map(g=>g.trim());for(const g of m){const b=g.indexOf("=");if(b!==-1){const p=g.substring(0,b).trim(),l=g.substring(b+1).trim();try{l==="true"?r[p]=!0:l==="false"?r[p]=!1:l==="[]"?r[p]=[]:l==="{}"?r[p]={}:/^\d+$/.test(l)?r[p]=parseInt(l):/^'.*'$/.test(l)||/^".*"$/.test(l)?r[p]=l.slice(1,-1):r[p]=l}catch{r[p]=""}}else{const p=g.split(":")[0].trim();p&&!p.includes("}")&&(r[p]="")}}}}catch{}let i={};const s={props:Object.fromEntries(Object.entries(r).map(([o,a])=>[o,{type:typeof a=="boolean"?Boolean:typeof a=="number"?Number:typeof a=="string"?String:Function,default:a}])),onConnected:o=>{i.onConnected&&i.onConnected()},onDisconnected:o=>{i.onDisconnected&&i.onDisconnected()},onAttributeChanged:(o,a,u,m)=>{i.onAttributeChanged&&i.onAttributeChanged(o,a,u)},onError:(o,a)=>{i.onError&&o&&i.onError(o)},render:o=>{const a=o._componentId||`${n}-${Math.random().toString(36).substr(2,9)}`;F.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{sn(o);const u=Object.keys(r).length>0;let m;if(u){const g={};Object.keys(r).forEach(b=>{g[b]=o[b]??r[b]}),m=t(g)}else m=t();if(o._hookCallbacks){const g=o._hookCallbacks;g.onConnected&&(i.onConnected=g.onConnected),g.onDisconnected&&(i.onDisconnected=g.onDisconnected),g.onAttributeChanged&&(i.onAttributeChanged=g.onAttributeChanged),g.onError&&(i.onError=g.onError),g.style&&(o._styleCallback=g.style)}return m}finally{on(),F.clearCurrentComponent()}}};Oe.set(n,s),typeof window<"u"&&(customElements.get(n)||customElements.define(n,hn(n,s)))}class pn{map=new Map;maxSize;constructor(t){this.maxSize=t}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}set(t,n){if(this.map.has(t)&&this.map.delete(t),this.map.set(t,n),this.map.size>this.maxSize){const r=this.map.keys().next().value;r!==void 0&&this.map.delete(r)}}has(t){return this.map.has(t)}clear(){this.map.clear()}}const De=new pn(500);function gn(e,t){if(e==null){console.warn(`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`);return}typeof e!="function"&&console.warn(`🚨 Potential infinite loop detected! Event handler for '@${t}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${t}="\${functionName()}" to @${t}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&console.warn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`)}function pe(e,t={},n,r){const i=r??t.key;return{tag:e,key:i,props:t,children:n}}function Re(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function Ee(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Re(e)}function mn(e,t){return e.key!=null?e:{...e,key:t}}function yn(e,t=[],n={}){const r={},i={},s={},o=[],a=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let u;for(;u=a.exec(e);){const m=u[1],g=u[2],b=(u[4]||u[6])??"",p=b.match(/^{{(\d+)}}$/);let l=p?t[Number(p[1])]??null:b;p||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const d=["model","bind","show","class","style","ref"];if(m===":"){const[v,w]=g.split(":"),[c,...h]=v.split(".");if(d.includes(c)){const y=[...h],C=c==="model"&&w?`model:${w}`:c;s[C]={value:l,modifiers:y,arg:w}}else{let y=l;y&&te(y)&&(y=y.value),i[g]=y,o.push(g)}}else if(m==="@"){const[v,...w]=g.split("."),c=w;gn(l,v);const h=typeof l=="function"?l:typeof n[l]=="function"?n[l]:void 0;if(h){const y=k=>{if(c.includes("prevent")&&k.preventDefault(),c.includes("stop")&&k.stopPropagation(),!(c.includes("self")&&k.target!==k.currentTarget))return c.includes("once")&&k.currentTarget?.removeEventListener(v,y),h(k)},C="on"+v.charAt(0).toUpperCase()+v.slice(1);r[C]=y}}else g==="ref"?r.ref=l:i[g]=l}return{props:r,attrs:i,directives:s,bound:o}}function bn(e,t,n){const r=me.length>0?me[me.length-1]:void 0,i=n??r,s=!n&&t.length===0,o=s?e.join("<!--TEMPLATE_DELIM-->"):null;if(s&&o){const f=De.get(o);if(f)return f}function a(f,x){return pe("#text",{},f,x)}let u="";for(let f=0;f<e.length;f++)u+=e[f],f<t.length&&(u+=`{{${f}}}`);const m=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,g=[];let b,p=[],l=null,d={},v,w=0,c=[];function h(f){!f||typeof f!="object"||Re(f)||(f.props||f.attrs?(f.props&&(d.props||(d.props={}),Object.assign(d.props,f.props)),f.attrs&&(d.attrs||(d.attrs={}),Object.keys(f.attrs).forEach(x=>{if(x==="style"&&d.attrs.style){const A=d.attrs.style.replace(/;?\s*$/,""),_=f.attrs.style.replace(/^;?\s*/,"");d.attrs.style=A+"; "+_}else if(x==="class"&&d.attrs.class){const A=d.attrs.class.trim().split(/\s+/).filter(Boolean),_=f.attrs.class.trim().split(/\s+/).filter(Boolean),$=[...new Set([...A,..._])];d.attrs.class=$.join(" ")}else d.attrs[x]=f.attrs[x]}))):(d.props||(d.props={}),Object.assign(d.props,f)))}function y(f,x){const A=l?p:c;if(Re(f)){const _=f.key??x;let $=f.children;A.push({...f,key:_,children:$});return}if(Ee(f)){A.push(mn(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let _=0;_<f.length;_++){const $=f[_];Re($)||Ee($)||Array.isArray($)?y($,`${x}-${_}`):$!==null&&typeof $=="object"?h($):A.push(a(String($),`${x}-${_}`))}return}if(f!==null&&typeof f=="object"){h(f);return}A.push(a(String(f),x))}const C=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;b=m.exec(u);)if(!(b[0].startsWith("<!--")&&b[0].endsWith("-->"))){if(b[1]){const f=b[1],x=b[0][1]==="/",A=b[0][b[0].length-2]==="/"||C.has(f),{props:_,attrs:$,directives:T,bound:R}=yn(b[2]||"",t,i),S={props:{},attrs:{}};for(const P in _)S.props[P]=_[P];for(const P in $)S.attrs[P]=$[P];if(S.attrs&&Object.prototype.hasOwnProperty.call(S.attrs,"key")&&!(S.props&&Object.prototype.hasOwnProperty.call(S.props,"key")))try{S.props.key=S.attrs.key}catch{}try{const P={input:["value","checked","disabled","readonly","required","placeholder","maxlength","minlength"],textarea:["value","disabled","readonly","required","placeholder","maxlength","minlength"],select:["value","disabled","required","multiple"],option:["selected","disabled","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","disabled","autofocus","form"]},U=f.toLowerCase(),V=P[U]??[];if(S.attrs){for(const K of V)if(R&&R.includes(K)&&K in S.attrs&&!(S.props&&K in S.props)){let L=S.attrs[K];L&&te(L)&&(L=L.value),S.props[K]=L,delete S.attrs[K]}}if((f.includes("-")||!!i?.__customElements?.has?.(f))&&(S.isCustomElement=!0,R&&S.attrs)){const K=new Set(["id","name","data-key","key"]);for(const L of R)if(L in S.attrs&&!(S.props&&L in S.props)){const j=L.includes("-")?L.split("-").map((Z,z)=>z===0?Z:Z.charAt(0).toUpperCase()+Z.slice(1)).join(""):L;let J=S.attrs[L];J&&te(J)&&(J=J.value),S.props[j]=J,K.has(L)||delete S.attrs[L]}}}catch{}if(T&&Object.keys(T).some(P=>P==="model"||P.startsWith("model:")))try{const P=Symbol.for("cer.registry"),U=globalThis[P],V=!!(U&&typeof U.has=="function"&&U.has(f)),ve=!!(i&&(i.__customElements instanceof Set&&i.__customElements.has(f)||Array.isArray(i.__isCustomElements)&&i.__isCustomElements.includes(f)));if(!!(f.includes("-")||ve||V))for(const j of Object.keys(T)){if(j!=="model"&&!j.startsWith("model:"))continue;const J=T[j],Z=J.arg??(j.includes(":")?j.split(":",2)[1]:void 0),z=J.value,E=Z??"modelValue",q=B,D=$e,W=i?i._state||i:void 0;let O;typeof z=="string"&&i?O=q(W,z):(O=z,O&&te(O)&&(O=O.value)),S.props[E]=O;try{const re=ne(E);S.attrs||(S.attrs={}),O!==void 0&&(S.attrs[re]=O)}catch{}S.isCustomElement=!0;const Je=`update:${ne(E)}`.replace(/-([a-z])/g,(re,Y)=>Y.toUpperCase()),gt="on"+Je.charAt(0).toUpperCase()+Je.slice(1);S.props[gt]=function(re){const Y=re.detail!==void 0?re.detail:re.target?re.target.value:void 0;if(W)if(z&&te(z)){const ce=z.value;(Array.isArray(Y)&&Array.isArray(ce)?JSON.stringify([...Y].sort())!==JSON.stringify([...ce].sort()):Y!==ce)&&(z.value=Y,i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}else{const ce=q(W,typeof z=="string"?z:String(z));(Array.isArray(Y)&&Array.isArray(ce)?JSON.stringify([...Y].sort())!==JSON.stringify([...ce].sort()):Y!==ce)&&(D(W,typeof z=="string"?z:String(z),Y),i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}},delete T[j]}}catch{}if(Object.keys(T).length>0&&(S.directives={...T}),x){const P=pe(l,d,p.length===1&&Ee(p[0])&&p[0].tag==="#text"?typeof p[0].children=="string"?p[0].children:"":p.length?p:void 0,v),U=g.pop();U?(l=U.tag,d=U.props,v=U.key,p=U.children,p.push(P)):(c.push(P),l=null,d={},v=void 0,p=[])}else A?l?p.push(pe(f,S,void 0,void 0)):c.push(pe(f,S,void 0,void 0)):(l&&g.push({tag:l,props:d,children:p,key:v}),l=f,d=S,p=[])}else if(typeof b[3]<"u"){const f=Number(b[3]),x=t[f],A=`interp-${f}`;y(x,A)}else if(b[4]){const f=b[4],x=l?p:c,A=f.split(/({{\d+}})/);for(const _ of A){if(!_)continue;const $=_.match(/^{{(\d+)}}$/);if($){const T=Number($[1]),R=t[T],S=`interp-${T}`;y(R,S)}else{const T=`text-${w++}`;x.push(a(_,T))}}}}const k=c.filter(f=>Ee(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0);if(k.length===1){const f=k[0];return s&&o&&De.set(o,f),f}else if(k.length>1){const f=k;return s&&o&&De.set(o,f),f}return pe("div",{},"","fallback-root")}function ie(e,...t){const n=t[t.length-1],r=typeof n=="object"&&n&&!Array.isArray(n)?n:void 0;return bn(e,t,r)}function we(e,t){return M(e?t:[],"when-block")}function wn(e,t){return e.map((n,r)=>{const i=typeof n=="object"?n?.key??n?.id??`idx-${r}`:String(n);return M(t(n,r),`each-${i}`)})}function ft(){const e=[];return{when(t,n){return e.push([t,n]),this},otherwise(t){return e.push([!0,t]),this},done(){return vn(...e)}}}function vn(...e){for(let t=0;t<e.length;t++){const[n,r]=e[t];if(n)return[M(r,`whenChain-branch-${t}`)]}return[M([],"whenChain-empty")]}function M(e,t){const n=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:n}}function xn(e,t){return we(!e,t)}function kn(e,t){const n=!e||e.length===0;return we(n,t)}function Cn(e,t){const n=!!(e&&e.length>0);return we(n,t)}function _n(e,t,n){const r=[];return e.forEach((i,s)=>{t(i,s)&&r.push({item:i,originalIndex:s})}),r.map(({item:i,originalIndex:s},o)=>{const a=typeof i=="object"&&i!=null?i?.key??i?.id??`filtered-${s}`:`filtered-${s}`;return M(n(i,s,o),`each-where-${a}`)})}function En(e,t){const n=e?.length??0;return n===0&&t.empty?M(t.empty,"switch-length-empty"):n===1&&t.one?M(t.one(e[0]),"switch-length-one"):t.exactly?.[n]?M(t.exactly[n](e),`switch-length-${n}`):n>1&&t.many?M(t.many(e),"switch-length-many"):M([],"switch-length-fallback")}function $n(e,t,n){const r=new Map;return e.forEach(i=>{const s=t(i);r.has(s)||r.set(s,[]),r.get(s).push(i)}),Array.from(r.entries()).map(([i,s],o)=>M(n(i,s,o),`each-group-${i}`))}function Sn(e,t,n,r){const i=n*t,s=Math.min(i+t,e.length);return e.slice(i,s).map((a,u)=>{const m=i+u,g=typeof a=="object"&&a!=null?a?.key??a?.id??`page-${m}`:`page-${m}`;return M(r(a,m,u),`each-page-${g}`)})}function An(e,t){return e.loading&&t.loading?M(t.loading,"promise-loading"):e.error&&t.error?M(t.error(e.error),"promise-error"):e.data!==void 0&&t.success?M(t.success(e.data),"promise-success"):t.idle?M(t.idle,"promise-idle"):M([],"promise-fallback")}function H(e,t){const n=typeof window<"u"&&window.matchMedia?.(e)?.matches;return we(!!n,t)}const ee={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},Ve=["sm","md","lg","xl","2xl"],dt={sm:e=>H(ee.sm,e),md:e=>H(ee.md,e),lg:e=>H(ee.lg,e),xl:e=>H(ee.xl,e),"2xl":e=>H(ee["2xl"],e),dark:e=>H(ee.dark,e),light:e=>H("(prefers-color-scheme: light)",e),touch:e=>H("(hover: none) and (pointer: coarse)",e),mouse:e=>H("(hover: hover) and (pointer: fine)",e),reducedMotion:e=>H("(prefers-reduced-motion: reduce)",e),highContrast:e=>H("(prefers-contrast: high)",e),portrait:e=>H("(orientation: portrait)",e),landscape:e=>H("(orientation: landscape)",e)};function Tn(e,t){const n=[];e.includes("dark")?n.push(ee.dark):e.includes("light")&&n.push("(prefers-color-scheme: light)");const r=e.filter(o=>Ve.includes(o)),i=r[r.length-1];i&&i in ee&&n.push(ee[i]);const s=n.length>0?n.join(" and "):"all";return H(s,t)}function Rn(e){const t=[];return e.base&&t.push(M(e.base,"responsive-base")),Ve.forEach(n=>{const r=e[n];r&&t.push(dt[n](r))}),t}function On(e){const t=[];let n=null;return{case(r,i){const s=typeof r=="function"?r:o=>o===r;return t.push({condition:s,content:i}),this},when(r,i){return t.push({condition:r,content:i}),this},otherwise(r){return n=r,this},done(){for(let r=0;r<t.length;r++){const{condition:i,content:s}=t[r];if(i(e))return M(s,`switch-case-${r}`)}return M(n||[],"switch-otherwise")}}}class fe extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return fe.instance||(fe.instance=new fe),fe.instance}emit(t,n){const r=Date.now(),i=this.eventCounters.get(t);if(!i||r-i.window>1e3)this.eventCounters.set(t,{count:1,window:r});else if(i.count++,i.count>50&&i.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(n)}catch(a){oe(`Error in global event handler for "${t}":`,a)}})}on(t,n){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(n),()=>this.off(t,n)}off(t,n){const r=this.handlers[t];r&&r.delete(n)}offAll(t){delete this.handlers[t]}listen(t,n,r){return this.addEventListener(t,n,r),()=>this.removeEventListener(t,n)}once(t,n){return new Promise(r=>{const i=this.on(t,s=>{i(),n(s),r(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[n,r]of this.eventCounters.entries())t[n]={count:r.count,handlersCount:this.getHandlerCount(n)};return t}resetEventCounters(){this.eventCounters.clear()}}const he=fe.getInstance(),Pn=(e,t)=>he.emit(e,t),Ln=(e,t)=>he.on(e,t),Mn=(e,t)=>he.off(e,t),jn=(e,t)=>he.once(e,t),Nn=(e,t,n)=>he.listen(e,t,n);function qe(e){let t={...e};const n=[];function r(a){n.push(a),a(t)}function i(){return t}function s(a){const u=typeof a=="function"?a(t):a;t={...t,...u},o()}function o(){n.forEach(a=>a(t))}return{subscribe:r,getState:i,setState:s}}const Fe=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},X=(e,t)=>{for(const n of e){const r=[],i=n.path.replace(/:[^/]+/g,a=>(r.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${i}$`),o=t.match(s);if(o){const a={};return r.forEach((u,m)=>{a[u]=o[m+1]}),{route:n,params:a}}}return{route:null,params:{}}},Ie={};async function ht(e){if(e.component)return e.component;if(e.load){if(Ie[e.path])return Ie[e.path];try{const t=await e.load();return Ie[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function pt(e){const{routes:t,base:n="",initialUrl:r}=e;let i,s,o,a,u,m,g;const b=async(v,w)=>{const c=t.find(h=>X([h],v.path).route!==null);if(c?.beforeEnter)try{const h=await c.beforeEnter(v,w);return typeof h=="string"?(await d(h,!0),!1):h!==!1}catch(h){return oe("beforeEnter error",h),!1}return!0},p=async(v,w)=>{const c=t.find(h=>X([h],v.path).route!==null);if(c?.onEnter)try{const h=await c.onEnter(v,w);return typeof h=="string"?(await d(h,!0),!1):h!==!1}catch(h){return oe("onEnter error",h),!1}return!0},l=(v,w)=>{const c=t.find(h=>X([h],v.path).route!==null);if(c?.afterEnter)try{c.afterEnter(v,w)}catch(h){oe("afterEnter error",h)}},d=async(v,w=!1)=>{try{const c={path:v.replace(n,"")||"/",query:{}},h=X(t,c.path);if(!h)throw new Error(`No route found for ${c.path}`);const y=o.getState(),C={path:c.path,params:h.params,query:c.query};if(!await b(C,y)||!await p(C,y))return;typeof window<"u"&&typeof document<"u"&&(w?window.history.replaceState({},"",n+v):window.history.pushState({},"",n+v)),o.setState(C),l(C,y)}catch(c){oe("Navigation error:",c)}};if(typeof window<"u"&&typeof document<"u"&&typeof r>"u"){i=()=>{const w=new URL(window.location.href),c=w.pathname.replace(n,"")||"/",h=Fe(w.search);return{path:c,query:h}},s=i();const v=X(t,s.path);o=qe({path:s.path,params:v.params,query:s.query}),a=async(w=!1)=>{const c=i();await d(c.path,w)},window.addEventListener("popstate",()=>a(!0)),u=w=>d(w,!1),m=w=>d(w,!0),g=()=>window.history.back()}else{i=()=>{const c=new URL(r||"/","http://localhost"),h=c.pathname.replace(n,"")||"/",y=Fe(c.search);return{path:h,query:y}},s=i();const v=X(t,s.path);o=qe({path:s.path,params:v.params,query:s.query}),a=async()=>{const c=i();await w(c.path)};const w=async c=>{try{const h={path:c.replace(n,"")||"/",query:{}},y=X(t,h.path);if(!y)throw new Error(`No route found for ${h.path}`);const C=o.getState(),k={path:h.path,params:y.params,query:h.query},f=t.find(x=>X([x],k.path).route!==null);if(f?.beforeEnter)try{const x=await f.beforeEnter(k,C);if(typeof x=="string"){await w(x);return}if(x===!1)return}catch{return}if(f?.onEnter)try{const x=await f.onEnter(k,C);if(typeof x=="string"){await w(x);return}if(x===!1)return}catch{return}if(o.setState(k),f?.afterEnter)try{f.afterEnter(k,C)}catch{}}catch{}};u=async c=>w(c),m=async c=>w(c),g=()=>{}}return{store:o,push:u,replace:m,back:g,subscribe:o.subscribe,matchRoute:v=>X(t,v),getCurrent:()=>o.getState(),resolveRouteComponent:ht}}function Wn(e,t){return X(e,t)}function zn(e){const t=pt(e);return Ue("router-view",(n={},r={})=>{const{onConnected:i}=r;if(i&&i(()=>{t&&typeof t.subscribe=="function"&&t.subscribe(()=>{})}),!t)return ie`<div>Router not initialized.</div>`;const s=t.getCurrent(),{path:o}=s,a=t.matchRoute(o);return a.route?t.resolveRouteComponent(a.route).then(u=>{if(typeof u=="string")return{tag:u,props:{},children:[]};if(typeof u=="function"){const m=u();return(m instanceof Promise?m:Promise.resolve(m)).then(b=>typeof b=="string"?{tag:b,props:{},children:[]}:b)}return ie`<div>Invalid route component</div>`}).catch(()=>ie`<div>Invalid route component</div>`):ie`<div>Not found</div>`}),Ue("router-link",(n={},r={})=>{const{to:i="",tag:s="a",replace:o=!1,exact:a=!1,activeClass:u="active",exactActiveClass:m="exact-active",ariaCurrentValue:g="page",disabled:b=!1,external:p=!1,class:l=""}=n,d=t.getCurrent(),v=d.path===i,w=a?v:d&&typeof d.path=="string"?d.path.startsWith(i):!1,c=v?`aria-current="${g}"`:"",h=(l||"").split(/\s+/).filter(Boolean),y={};for(const _ of h)y[_]=!0;const C={...y,[u]:w,[m]:v},k=s==="button",f=b?k?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",x=p&&(s==="a"||!s)?'target="_blank" rel="noopener noreferrer"':"",A=_=>{if(b){_.preventDefault();return}p&&(s==="a"||!s)||(_.preventDefault(),o?t.replace(i):t.push(i))};return ie`
|
|
72
|
+
`);a=ut(a);let u=n;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==a)&&u.replaceSync(a),e.adoptedStyleSheets=[Xe(),u],i(u)}let N=null;function ir(e){N=e}function sr(){N=null}function or(){if(!N)throw new Error("useEmit must be called during component render");const e=N.emit;return(t,r)=>e(t,r)}function be(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function ar(e){if(!N)throw new Error("useOnConnected must be called during component render");be(N),N._hookCallbacks.onConnected=e}function cr(e){if(!N)throw new Error("useOnDisconnected must be called during component render");be(N),N._hookCallbacks.onDisconnected=e}function lr(e){if(!N)throw new Error("useOnAttributeChanged must be called during component render");be(N),N._hookCallbacks.onAttributeChanged=e}function ur(e){if(!N)throw new Error("useOnError must be called during component render");be(N),N._hookCallbacks.onError=e}function fr(e){if(!N)throw new Error("useStyle must be called during component render");be(N);try{const t=e();Object.defineProperty(N,"_computedStyle",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(t){console.warn("Error in useStyle callback:",t),Object.defineProperty(N,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const Oe=new Map,nt=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[nt]||(e[nt]=Oe)}function dr(e,t){if(!t.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=Oe.get(e)||t,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const r=this._initContext(t);Object.defineProperty(r,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_requestRender",{value:()=>this._requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_componentId",{value:this._componentId,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_triggerWatchers",{value:(i,s)=>this._triggerWatchers(i,s),writable:!1,enumerable:!1,configurable:!1}),this.context=r,Object.defineProperty(this.context,"emit",{value:(i,s,o)=>{const a=new CustomEvent(i,{detail:s,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const n=Oe.get(e)||t;Object.keys(n).forEach(i=>{const s=n[i];typeof s=="function"&&(this.context[i]=(...o)=>s(...o,this.context))}),this._applyComputed(n),n.props&&Object.keys(n.props).forEach(i=>{let s=this[i];Object.defineProperty(this,i,{get(){return s},set(o){const a=s;s=o,this.context[i]=o,this._initializing||(this._applyProps(n),a!==o&&this._requestRender())},enumerable:!0,configurable:!0})}),this._initializing=!1,this._initWatchers(n),this._applyProps(n),this._render(n)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),this._requestRender(),At(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Tt(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,n,i){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),n!==i&&this._requestRender(),Rt(t,r,n,i,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(re):[]}_applyComputed(r){}_render(r){this._runLogicWithinErrorBoundary(r,()=>{tr(this.shadowRoot,r,this.context,this._refs,n=>{this._lastHtmlStringForJitCSS=n,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(n)},n=>{this._templateLoading=n,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(n)},n=>{this._templateError=n,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(n)},n=>this._applyStyle(r,n))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{de(()=>{rr(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})},this._componentId)})}_applyStyle(r,n){this._runLogicWithinErrorBoundary(r,()=>{nr(this.shadowRoot,this.context,n,this._styleSheet,i=>{this._styleSheet=i})})}_runLogicWithinErrorBoundary(r,n){this._hasError&&(this._hasError=!1);try{n()}catch(i){this._hasError=!0,r.onError&&r.onError(i,this.context)}}_initContext(r){try{let n=function(s,o=""){return Array.isArray(s)?new Proxy(s,{get(a,u,m){const g=Reflect.get(a,u,m);return typeof g=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...p){const l=g.apply(a,p);if(!i._initializing){const d=o||"root";i._triggerWatchers(d,a),de(()=>i._render(r),i._componentId)}return l}:g},set(a,u,m){if(a[u]=m,!i._initializing){const g=o?`${o}.${String(u)}`:String(u);i._triggerWatchers(g,m),de(()=>i._render(r),i._componentId)}return!0},deleteProperty(a,u){if(delete a[u],!i._initializing){const m=o?`${o}.${String(u)}`:String(u);i._triggerWatchers(m,void 0),de(()=>i._render(r),i._componentId)}return!0}}):s&&typeof s=="object"?s.constructor&&s.constructor.name==="ReactiveState"?s:(Object.keys(s).forEach(a=>{const u=o?`${o}.${a}`:a;s[a]=n(s[a],u)}),new Proxy(s,{set(a,u,m){const g=o?`${o}.${String(u)}`:String(u);return a[u]=n(m,g),i._initializing||(i._triggerWatchers(g,a[u]),de(()=>i._render(r),i._componentId)),!0},get(a,u,m){return Reflect.get(a,u,m)}})):s};const i=this;return n({...r.props?Object.fromEntries(Object.entries(r.props).map(([s,o])=>[s,o.default])):{}})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{_t(this.context,this._watchers,{})})}_triggerWatchers(r,n){Et(this.context,this._watchers,r,n)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{St(this,r,this.context)}catch(n){this._hasError=!0,r.onError&&r.onError(n,this.context)}})}}}function Ue(e,t){let r=re(e);r.includes("-")||(r=`cer-${r}`);let n={};if(typeof window<"u")try{const a=t.toString().match(/\(\s*{\s*([^}]+)\s*}/);if(a){const m=a[1].split(",").map(g=>g.trim());for(const g of m){const b=g.indexOf("=");if(b!==-1){const p=g.substring(0,b).trim(),l=g.substring(b+1).trim();try{l==="true"?n[p]=!0:l==="false"?n[p]=!1:l==="[]"?n[p]=[]:l==="{}"?n[p]={}:/^\d+$/.test(l)?n[p]=parseInt(l):/^'.*'$/.test(l)||/^".*"$/.test(l)?n[p]=l.slice(1,-1):n[p]=l}catch{n[p]=""}}else{const p=g.split(":")[0].trim();p&&!p.includes("}")&&(n[p]="")}}}}catch{}let i={};const s={props:Object.fromEntries(Object.entries(n).map(([o,a])=>[o,{type:typeof a=="boolean"?Boolean:typeof a=="number"?Number:typeof a=="string"?String:Function,default:a}])),onConnected:o=>{i.onConnected&&i.onConnected()},onDisconnected:o=>{i.onDisconnected&&i.onDisconnected()},onAttributeChanged:(o,a,u,m)=>{i.onAttributeChanged&&i.onAttributeChanged(o,a,u)},onError:(o,a)=>{i.onError&&o&&i.onError(o)},render:o=>{const a=o._componentId||`${r}-${Math.random().toString(36).substr(2,9)}`;F.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{ir(o);const u=Object.keys(n).length>0;let m;if(u){const g={};Object.keys(n).forEach(b=>{g[b]=o[b]??n[b]}),m=t(g)}else m=t();if(o._hookCallbacks){const g=o._hookCallbacks;g.onConnected&&(i.onConnected=g.onConnected),g.onDisconnected&&(i.onDisconnected=g.onDisconnected),g.onAttributeChanged&&(i.onAttributeChanged=g.onAttributeChanged),g.onError&&(i.onError=g.onError),g.style&&(o._styleCallback=g.style)}return m}finally{sr(),F.clearCurrentComponent()}}};Oe.set(r,s),typeof window<"u"&&(customElements.get(r)||customElements.define(r,dr(r,s)))}class hr{map=new Map;maxSize;constructor(t){this.maxSize=t}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}set(t,r){if(this.map.has(t)&&this.map.delete(t),this.map.set(t,r),this.map.size>this.maxSize){const n=this.map.keys().next().value;n!==void 0&&this.map.delete(n)}}has(t){return this.map.has(t)}clear(){this.map.clear()}}const De=new hr(500);function pr(e,t){if(e==null){console.warn(`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`);return}typeof e!="function"&&console.warn(`🚨 Potential infinite loop detected! Event handler for '@${t}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${t}="\${functionName()}" to @${t}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&console.warn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`)}function pe(e,t={},r,n){const i=n??t.key;return{tag:e,key:i,props:t,children:r}}function Re(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function Ee(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Re(e)}function gr(e,t){return e.key!=null?e:{...e,key:t}}function mr(e,t=[],r={}){const n={},i={},s={},o=[],a=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let u;for(;u=a.exec(e);){const m=u[1],g=u[2],b=(u[4]||u[6])??"",p=b.match(/^{{(\d+)}}$/);let l=p?t[Number(p[1])]??null:b;p||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const d=["model","bind","show","class","style","ref"];if(m===":"){const[x,w]=g.split(":"),[c,...h]=x.split(".");if(d.includes(c)){const y=[...h],C=c==="model"&&w?`model:${w}`:c;s[C]={value:l,modifiers:y,arg:w}}else{let y=l;y&&te(y)&&(y=y.value),i[g]=y,o.push(g)}}else if(m==="@"){const[x,...w]=g.split("."),c=w;pr(l,x);const h=typeof l=="function"?l:typeof r[l]=="function"?r[l]:void 0;if(h){const y=k=>{if(c.includes("prevent")&&k.preventDefault(),c.includes("stop")&&k.stopPropagation(),!(c.includes("self")&&k.target!==k.currentTarget))return c.includes("once")&&k.currentTarget?.removeEventListener(x,y),h(k)},C="on"+x.charAt(0).toUpperCase()+x.slice(1);n[C]=y}}else g==="ref"?n.ref=l:i[g]=l}return{props:n,attrs:i,directives:s,bound:o}}function yr(e,t,r){const n=me.length>0?me[me.length-1]:void 0,i=r??n,s=!r&&t.length===0,o=s?e.join("<!--TEMPLATE_DELIM-->"):null;if(s&&o){const f=De.get(o);if(f)return f}function a(f,v){return pe("#text",{},f,v)}let u="";for(let f=0;f<e.length;f++)u+=e[f],f<t.length&&(u+=`{{${f}}}`);const m=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,g=[];let b,p=[],l=null,d={},x,w=0,c=[];function h(f){!f||typeof f!="object"||Re(f)||(f.props||f.attrs?(f.props&&(d.props||(d.props={}),Object.assign(d.props,f.props)),f.attrs&&(d.attrs||(d.attrs={}),Object.keys(f.attrs).forEach(v=>{if(v==="style"&&d.attrs.style){const A=d.attrs.style.replace(/;?\s*$/,""),_=f.attrs.style.replace(/^;?\s*/,"");d.attrs.style=A+"; "+_}else if(v==="class"&&d.attrs.class){const A=d.attrs.class.trim().split(/\s+/).filter(Boolean),_=f.attrs.class.trim().split(/\s+/).filter(Boolean),$=[...new Set([...A,..._])];d.attrs.class=$.join(" ")}else d.attrs[v]=f.attrs[v]}))):(d.props||(d.props={}),Object.assign(d.props,f)))}function y(f,v){const A=l?p:c;if(Re(f)){const _=f.key??v;let $=f.children;A.push({...f,key:_,children:$});return}if(Ee(f)){A.push(gr(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let _=0;_<f.length;_++){const $=f[_];Re($)||Ee($)||Array.isArray($)?y($,`${v}-${_}`):$!==null&&typeof $=="object"?h($):A.push(a(String($),`${v}-${_}`))}return}if(f!==null&&typeof f=="object"){h(f);return}A.push(a(String(f),v))}const C=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;b=m.exec(u);)if(!(b[0].startsWith("<!--")&&b[0].endsWith("-->"))){if(b[1]){const f=b[1],v=b[0][1]==="/",A=b[0][b[0].length-2]==="/"||C.has(f),{props:_,attrs:$,directives:T,bound:R}=mr(b[2]||"",t,i),S={props:{},attrs:{}};for(const P in _)S.props[P]=_[P];for(const P in $)S.attrs[P]=$[P];if(S.attrs&&Object.prototype.hasOwnProperty.call(S.attrs,"key")&&!(S.props&&Object.prototype.hasOwnProperty.call(S.props,"key")))try{S.props.key=S.attrs.key}catch{}try{const P={input:["value","checked","disabled","readonly","required","placeholder","maxlength","minlength"],textarea:["value","disabled","readonly","required","placeholder","maxlength","minlength"],select:["value","disabled","required","multiple"],option:["selected","disabled","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","disabled","autofocus","form"]},U=f.toLowerCase(),V=P[U]??[];if(S.attrs){for(const K of V)if(R&&R.includes(K)&&K in S.attrs&&!(S.props&&K in S.props)){let L=S.attrs[K];L&&te(L)&&(L=L.value),S.props[K]=L,delete S.attrs[K]}}if((f.includes("-")||!!i?.__customElements?.has?.(f))&&(S.isCustomElement=!0,R&&S.attrs)){const K=new Set(["id","name","data-key","key"]);for(const L of R)if(L in S.attrs&&!(S.props&&L in S.props)){const j=L.includes("-")?L.split("-").map((Z,z)=>z===0?Z:Z.charAt(0).toUpperCase()+Z.slice(1)).join(""):L;let J=S.attrs[L];J&&te(J)&&(J=J.value),S.props[j]=J,K.has(L)||delete S.attrs[L]}}}catch{}if(T&&Object.keys(T).some(P=>P==="model"||P.startsWith("model:")))try{const P=Symbol.for("cer.registry"),U=globalThis[P],V=!!(U&&typeof U.has=="function"&&U.has(f)),xe=!!(i&&(i.__customElements instanceof Set&&i.__customElements.has(f)||Array.isArray(i.__isCustomElements)&&i.__isCustomElements.includes(f)));if(!!(f.includes("-")||xe||V))for(const j of Object.keys(T)){if(j!=="model"&&!j.startsWith("model:"))continue;const J=T[j],Z=J.arg??(j.includes(":")?j.split(":",2)[1]:void 0),z=J.value,E=Z??"modelValue",q=B,D=$e,W=i?i._state||i:void 0;let O;typeof z=="string"&&i?O=q(W,z):(O=z,O&&te(O)&&(O=O.value)),S.props[E]=O;try{const ne=re(E);S.attrs||(S.attrs={}),O!==void 0&&(S.attrs[ne]=O)}catch{}S.isCustomElement=!0;const Je=`update:${re(E)}`.replace(/-([a-z])/g,(ne,Y)=>Y.toUpperCase()),gt="on"+Je.charAt(0).toUpperCase()+Je.slice(1);S.props[gt]=function(ne){const Y=ne.detail!==void 0?ne.detail:ne.target?ne.target.value:void 0;if(W)if(z&&te(z)){const ce=z.value;(Array.isArray(Y)&&Array.isArray(ce)?JSON.stringify([...Y].sort())!==JSON.stringify([...ce].sort()):Y!==ce)&&(z.value=Y,i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}else{const ce=q(W,typeof z=="string"?z:String(z));(Array.isArray(Y)&&Array.isArray(ce)?JSON.stringify([...Y].sort())!==JSON.stringify([...ce].sort()):Y!==ce)&&(D(W,typeof z=="string"?z:String(z),Y),i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}},delete T[j]}}catch{}if(Object.keys(T).length>0&&(S.directives={...T}),v){const P=pe(l,d,p.length===1&&Ee(p[0])&&p[0].tag==="#text"?typeof p[0].children=="string"?p[0].children:"":p.length?p:void 0,x),U=g.pop();U?(l=U.tag,d=U.props,x=U.key,p=U.children,p.push(P)):(c.push(P),l=null,d={},x=void 0,p=[])}else A?l?p.push(pe(f,S,void 0,void 0)):c.push(pe(f,S,void 0,void 0)):(l&&g.push({tag:l,props:d,children:p,key:x}),l=f,d=S,p=[])}else if(typeof b[3]<"u"){const f=Number(b[3]),v=t[f],A=`interp-${f}`;y(v,A)}else if(b[4]){const f=b[4],v=l?p:c,A=f.split(/({{\d+}})/);for(const _ of A){if(!_)continue;const $=_.match(/^{{(\d+)}}$/);if($){const T=Number($[1]),R=t[T],S=`interp-${T}`;y(R,S)}else{const T=`text-${w++}`;v.push(a(_,T))}}}}const k=c.filter(f=>Ee(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0);if(k.length===1){const f=k[0];return s&&o&&De.set(o,f),f}else if(k.length>1){const f=k;return s&&o&&De.set(o,f),f}return pe("div",{},"","fallback-root")}function ie(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return yr(e,t,n)}function we(e,t){return M(e?t:[],"when-block")}function br(e,t){return e.map((r,n)=>{const i=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return M(t(r,n),`each-${i}`)})}function ft(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return wr(...e)}}}function wr(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[M(n,`whenChain-branch-${t}`)]}return[M([],"whenChain-empty")]}function M(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}function xr(e,t){return we(!e,t)}function vr(e,t){const r=!e||e.length===0;return we(r,t)}function kr(e,t){const r=!!(e&&e.length>0);return we(r,t)}function Cr(e,t,r){const n=[];return e.forEach((i,s)=>{t(i,s)&&n.push({item:i,originalIndex:s})}),n.map(({item:i,originalIndex:s},o)=>{const a=typeof i=="object"&&i!=null?i?.key??i?.id??`filtered-${s}`:`filtered-${s}`;return M(r(i,s,o),`each-where-${a}`)})}function _r(e,t){const r=e?.length??0;return r===0&&t.empty?M(t.empty,"switch-length-empty"):r===1&&t.one?M(t.one(e[0]),"switch-length-one"):t.exactly?.[r]?M(t.exactly[r](e),`switch-length-${r}`):r>1&&t.many?M(t.many(e),"switch-length-many"):M([],"switch-length-fallback")}function Er(e,t,r){const n=new Map;return e.forEach(i=>{const s=t(i);n.has(s)||n.set(s,[]),n.get(s).push(i)}),Array.from(n.entries()).map(([i,s],o)=>M(r(i,s,o),`each-group-${i}`))}function $r(e,t,r,n){const i=r*t,s=Math.min(i+t,e.length);return e.slice(i,s).map((a,u)=>{const m=i+u,g=typeof a=="object"&&a!=null?a?.key??a?.id??`page-${m}`:`page-${m}`;return M(n(a,m,u),`each-page-${g}`)})}function Sr(e,t){return e.loading&&t.loading?M(t.loading,"promise-loading"):e.error&&t.error?M(t.error(e.error),"promise-error"):e.data!==void 0&&t.success?M(t.success(e.data),"promise-success"):t.idle?M(t.idle,"promise-idle"):M([],"promise-fallback")}function H(e,t){const r=typeof window<"u"&&window.matchMedia?.(e)?.matches;return we(!!r,t)}const ee={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},Ve=["sm","md","lg","xl","2xl"],dt={sm:e=>H(ee.sm,e),md:e=>H(ee.md,e),lg:e=>H(ee.lg,e),xl:e=>H(ee.xl,e),"2xl":e=>H(ee["2xl"],e),dark:e=>H(ee.dark,e),light:e=>H("(prefers-color-scheme: light)",e),touch:e=>H("(hover: none) and (pointer: coarse)",e),mouse:e=>H("(hover: hover) and (pointer: fine)",e),reducedMotion:e=>H("(prefers-reduced-motion: reduce)",e),highContrast:e=>H("(prefers-contrast: high)",e),portrait:e=>H("(orientation: portrait)",e),landscape:e=>H("(orientation: landscape)",e)};function Ar(e,t){const r=[];e.includes("dark")?r.push(ee.dark):e.includes("light")&&r.push("(prefers-color-scheme: light)");const n=e.filter(o=>Ve.includes(o)),i=n[n.length-1];i&&i in ee&&r.push(ee[i]);const s=r.length>0?r.join(" and "):"all";return H(s,t)}function Tr(e){const t=[];return e.base&&t.push(M(e.base,"responsive-base")),Ve.forEach(r=>{const n=e[r];n&&t.push(dt[r](n))}),t}function Rr(e){const t=[];let r=null;return{case(n,i){const s=typeof n=="function"?n:o=>o===n;return t.push({condition:s,content:i}),this},when(n,i){return t.push({condition:n,content:i}),this},otherwise(n){return r=n,this},done(){for(let n=0;n<t.length;n++){const{condition:i,content:s}=t[n];if(i(e))return M(s,`switch-case-${n}`)}return M(r||[],"switch-otherwise")}}}class fe extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return fe.instance||(fe.instance=new fe),fe.instance}emit(t,r){const n=Date.now(),i=this.eventCounters.get(t);if(!i||n-i.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(i.count++,i.count>50&&i.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(r)}catch(a){oe(`Error in global event handler for "${t}":`,a)}})}on(t,r){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(r),()=>this.off(t,r)}off(t,r){const n=this.handlers[t];n&&n.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,n){return this.addEventListener(t,r,n),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(n=>{const i=this.on(t,s=>{i(),r(s),n(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,n]of this.eventCounters.entries())t[r]={count:n.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const he=fe.getInstance(),Or=(e,t)=>he.emit(e,t),Pr=(e,t)=>he.on(e,t),Lr=(e,t)=>he.off(e,t),Mr=(e,t)=>he.once(e,t),jr=(e,t,r)=>he.listen(e,t,r);function qe(e){let t={...e};const r=[];function n(a){r.push(a),a(t)}function i(){return t}function s(a){const u=typeof a=="function"?a(t):a;t={...t,...u},o()}function o(){r.forEach(a=>a(t))}return{subscribe:n,getState:i,setState:s}}const Fe=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},X=(e,t)=>{for(const r of e){const n=[],i=r.path.replace(/:[^/]+/g,a=>(n.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${i}$`),o=t.match(s);if(o){const a={};return n.forEach((u,m)=>{a[u]=o[m+1]}),{route:r,params:a}}}return{route:null,params:{}}},Ie={};async function ht(e){if(e.component)return e.component;if(e.load){if(Ie[e.path])return Ie[e.path];try{const t=await e.load();return Ie[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function pt(e){const{routes:t,base:r="",initialUrl:n}=e;let i,s,o,a,u,m,g;const b=async(x,w)=>{const c=t.find(h=>X([h],x.path).route!==null);if(c?.beforeEnter)try{const h=await c.beforeEnter(x,w);return typeof h=="string"?(await d(h,!0),!1):h!==!1}catch(h){return oe("beforeEnter error",h),!1}return!0},p=async(x,w)=>{const c=t.find(h=>X([h],x.path).route!==null);if(c?.onEnter)try{const h=await c.onEnter(x,w);return typeof h=="string"?(await d(h,!0),!1):h!==!1}catch(h){return oe("onEnter error",h),!1}return!0},l=(x,w)=>{const c=t.find(h=>X([h],x.path).route!==null);if(c?.afterEnter)try{c.afterEnter(x,w)}catch(h){oe("afterEnter error",h)}},d=async(x,w=!1)=>{try{const c={path:x.replace(r,"")||"/",query:{}},h=X(t,c.path);if(!h)throw new Error(`No route found for ${c.path}`);const y=o.getState(),C={path:c.path,params:h.params,query:c.query};if(!await b(C,y)||!await p(C,y))return;typeof window<"u"&&typeof document<"u"&&(w?window.history.replaceState({},"",r+x):window.history.pushState({},"",r+x)),o.setState(C),l(C,y)}catch(c){oe("Navigation error:",c)}};if(typeof window<"u"&&typeof document<"u"&&typeof n>"u"){i=()=>{const w=new URL(window.location.href),c=w.pathname.replace(r,"")||"/",h=Fe(w.search);return{path:c,query:h}},s=i();const x=X(t,s.path);o=qe({path:s.path,params:x.params,query:s.query}),a=async(w=!1)=>{const c=i();await d(c.path,w)},window.addEventListener("popstate",()=>a(!0)),u=w=>d(w,!1),m=w=>d(w,!0),g=()=>window.history.back()}else{i=()=>{const c=new URL(n||"/","http://localhost"),h=c.pathname.replace(r,"")||"/",y=Fe(c.search);return{path:h,query:y}},s=i();const x=X(t,s.path);o=qe({path:s.path,params:x.params,query:s.query}),a=async()=>{const c=i();await w(c.path)};const w=async c=>{try{const h={path:c.replace(r,"")||"/",query:{}},y=X(t,h.path);if(!y)throw new Error(`No route found for ${h.path}`);const C=o.getState(),k={path:h.path,params:y.params,query:h.query},f=t.find(v=>X([v],k.path).route!==null);if(f?.beforeEnter)try{const v=await f.beforeEnter(k,C);if(typeof v=="string"){await w(v);return}if(v===!1)return}catch{return}if(f?.onEnter)try{const v=await f.onEnter(k,C);if(typeof v=="string"){await w(v);return}if(v===!1)return}catch{return}if(o.setState(k),f?.afterEnter)try{f.afterEnter(k,C)}catch{}}catch{}};u=async c=>w(c),m=async c=>w(c),g=()=>{}}return{store:o,push:u,replace:m,back:g,subscribe:o.subscribe,matchRoute:x=>X(t,x),getCurrent:()=>o.getState(),resolveRouteComponent:ht}}function Nr(e,t){return X(e,t)}function Wr(e){const t=pt(e);return Ue("router-view",(r={},n={})=>{const{onConnected:i}=n;if(i&&i(()=>{t&&typeof t.subscribe=="function"&&t.subscribe(()=>{})}),!t)return ie`<div>Router not initialized.</div>`;const s=t.getCurrent(),{path:o}=s,a=t.matchRoute(o);return a.route?t.resolveRouteComponent(a.route).then(u=>{if(typeof u=="string")return{tag:u,props:{},children:[]};if(typeof u=="function"){const m=u();return(m instanceof Promise?m:Promise.resolve(m)).then(b=>typeof b=="string"?{tag:b,props:{},children:[]}:b)}return ie`<div>Invalid route component</div>`}).catch(()=>ie`<div>Invalid route component</div>`):ie`<div>Not found</div>`}),Ue("router-link",(r={},n={})=>{const{to:i="",tag:s="a",replace:o=!1,exact:a=!1,activeClass:u="active",exactActiveClass:m="exact-active",ariaCurrentValue:g="page",disabled:b=!1,external:p=!1,class:l=""}=r,d=t.getCurrent(),x=d.path===i,w=a?x:d&&typeof d.path=="string"?d.path.startsWith(i):!1,c=x?`aria-current="${g}"`:"",h=(l||"").split(/\s+/).filter(Boolean),y={};for(const _ of h)y[_]=!0;const C={...y,[u]:w,[m]:x},k=s==="button",f=b?k?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",v=p&&(s==="a"||!s)?'target="_blank" rel="noopener noreferrer"':"",A=_=>{if(b){_.preventDefault();return}p&&(s==="a"||!s)||(_.preventDefault(),o?t.replace(i):t.push(i))};return ie`
|
|
73
73
|
${ft().when(k,ie`
|
|
74
74
|
<button
|
|
75
75
|
part="button"
|
|
76
76
|
:class="${C}"
|
|
77
77
|
${c}
|
|
78
78
|
${f}
|
|
79
|
-
${
|
|
79
|
+
${v}
|
|
80
80
|
@click="${A}"
|
|
81
81
|
><slot></slot></button>
|
|
82
82
|
`).otherwise(ie`
|
|
@@ -86,9 +86,9 @@ ${s}
|
|
|
86
86
|
:class="${C}"
|
|
87
87
|
${c}
|
|
88
88
|
${f}
|
|
89
|
-
${
|
|
89
|
+
${v}
|
|
90
90
|
@click="${A}"
|
|
91
91
|
><slot></slot></a>
|
|
92
92
|
`).done()}
|
|
93
|
-
`}),t}exports.GlobalEventBus=fe;exports.anchorBlock=M;exports.component=Ue;exports.computed=kt;exports.createStore=qe;exports.css=lt;exports.each=
|
|
93
|
+
`}),t}exports.GlobalEventBus=fe;exports.anchorBlock=M;exports.component=Ue;exports.computed=kt;exports.createStore=qe;exports.css=lt;exports.each=br;exports.eachGroup=Er;exports.eachPage=$r;exports.eachWhere=Cr;exports.emit=Or;exports.eventBus=he;exports.html=ie;exports.initRouter=Wr;exports.listen=jr;exports.match=ft;exports.matchRoute=X;exports.matchRouteSSR=Nr;exports.mediaVariants=ee;exports.off=Lr;exports.on=Pr;exports.once=Mr;exports.parseQuery=Fe;exports.ref=vt;exports.renderToString=Ae;exports.resolveRouteComponent=ht;exports.responsive=dt;exports.responsiveOrder=Ve;exports.responsiveSwitch=Tr;exports.switchOn=Rr;exports.switchOnLength=_r;exports.switchOnPromise=Sr;exports.unless=xr;exports.useEmit=or;exports.useOnAttributeChanged=lr;exports.useOnConnected=ar;exports.useOnDisconnected=cr;exports.useOnError=ur;exports.useRouter=pt;exports.useStyle=fr;exports.watch=Ct;exports.when=we;exports.whenEmpty=vr;exports.whenMedia=H;exports.whenNotEmpty=kr;exports.whenVariants=Ar;
|
|
94
94
|
//# sourceMappingURL=custom-elements-runtime.cjs.js.map
|