@jasonshimmy/custom-elements-runtime 0.1.3 → 0.1.4
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 +12 -12
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +575 -528
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +13 -13
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/router.d.ts +34 -4
- package/dist/store.d.ts +2 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ke(e,t){return J(e?t:[],"when-block")}function $e(e,t){return e.map((r,n)=>{const o=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return J(t(r,n),`each-${o}`)})}function he(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return Ce(...e)}}}function Ce(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[J(n,`whenChain-branch-${t}`)]}return[J([],"whenChain-empty")]}function J(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class B extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return B.instance||(B.instance=new B),B.instance}emit(t,r){const n=Date.now(),o=this.eventCounters.get(t);if(!o||n-o.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(o.count++,o.count>50&&(console.error(`Event storm detected for "${t}": ${o.count} events in 1 second. Throttling...`),o.count>100)){console.warn(`Blocking further "${t}" events to prevent infinite loop`);return}this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(i=>{try{i(r)}catch(a){console.error(`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 o=this.on(t,s=>{o(),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 W=B.getInstance(),Se=(e,t)=>W.emit(e,t),_e=(e,t)=>W.on(e,t),Ae=(e,t)=>W.off(e,t),Ee=(e,t)=>W.once(e,t),Te=(e,t,r)=>W.listen(e,t,r);function ee(e){let t=new Proxy(e,{set:(i,a,l)=>(i[a]=l,s(),!0)});const r=[];function n(i){r.push(i),i(t)}function o(){return t}function s(){r.forEach(i=>i(t))}return{subscribe:n,getState:o}}function ie(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function te(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function je(e,t,r){if(r)for(const[n,o]of Object.entries(r)){let s,i={};if(Array.isArray(o)?(s=o[0],i=o[1]||{}):s=o,t.set(n,{callback:s,options:i,oldValue:re(e,n)}),i.immediate)try{const a=re(e,n);s(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${n}":`,a)}}}function re(e,t){return t.split(".").reduce((r,n)=>r?.[n],e)}function Le(e,t,r,n){const o=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((p,d)=>o(p,a[d]));const l=Object.keys(i),f=Object.keys(a);return l.length!==f.length?!1:l.every(p=>o(i[p],a[p]))},s=t.get(r);if(s&&!o(n,s.oldValue))try{s.callback(n,s.oldValue,e),s.oldValue=n}catch(i){console.error(`Error in watcher for "${r}":`,i)}for(const[i,a]of t.entries())if(a.options.deep&&r.startsWith(i+"."))try{const l=re(e,i);o(l,a.oldValue)||(a.callback(l,a.oldValue,e),a.oldValue=l)}catch(l){console.error(`Error in deep watcher for "${i}":`,l)}}function Re(e,t,r){if(!t.props)return;function n(o,s){return s===Boolean?o==="true":s===Number?Number(o):o}Object.entries(t.props).forEach(([o,s])=>{if(s.type===Function&&typeof e[o]=="function")r[o]=e[o];else{const i=e.getAttribute(ie(o));i!==null?r[o]=te(n(i,s.type)):"default"in s&&s.default!==void 0&&(r[o]=te(s.default))}})}function Be(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function ze(e,t,r,n,o,s,i,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(l=>l()),n(),o(),s(!1),i(null),a(!1)}function Me(e,t,r,n,o){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,o)}function z(e,t){if(t&&e instanceof HTMLElement){for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))z(r,t)}}function M(e,t){return t.split(".").reduce((r,n)=>r?.[n],e)}function le(e,t,r){const n=t.split("."),o=n.pop();if(!o)return;const s=n.reduce((i,a)=>(a in i||(i[a]={}),i[a]),e);s[o]=r}function Ne(e,t,r,n,o,s,i){if(!s)return;const a=t.includes("lazy"),l=t.includes("trim"),f=t.includes("number"),p=()=>{const y=s._state||s;return M(y,e)},d=p();let u="text";const m=n?.type;if(i instanceof HTMLInputElement?u=m||i.type||"text":i instanceof HTMLSelectElement?u="select":i instanceof HTMLTextAreaElement&&(u="textarea"),u==="checkbox")if(Array.isArray(d)){const y=i?.getAttribute("value")||n?.value||"",c=d.includes(y);i&&i.checked!==c&&(r.checked=c)}else{const y=i?.getAttribute("true-value")||!0,c=d===y;i&&i.checked!==c&&(r.checked=c)}else if(u==="radio"){const y=n?.value||"",c=d===y;i&&i.checked!==c&&(r.checked=c)}else if(u==="select")if(i&&i.hasAttribute("multiple")){const y=i,c=Array.isArray(d)?d:[];setTimeout(()=>{Array.from(y.options).forEach(b=>{const g=c.includes(b.value);b.selected!==g&&(b.selected=g)})},0)}else setTimeout(()=>{i instanceof HTMLSelectElement&&i.value!==String(d)&&(i.value=String(d))},0);else{const y=String(d??"");(!i||i.value!==y)&&(r.value=d)}const h=a||u==="checkbox"||u==="radio"||u==="select"?"change":"input",C=y=>{if(y.isComposing||o._isComposing||y.isTrusted===!1)return;const c=y.target;if(c._modelUpdating)return;const b=p();let g=c.value;if(u==="checkbox")if(Array.isArray(b)){const S=c.getAttribute("value")||"",_=[...b];if(c.checked)_.includes(S)||_.push(S);else{const x=_.indexOf(S);x>-1&&_.splice(x,1)}g=_}else{const S=c.getAttribute("true-value")||!0,_=c.getAttribute("false-value")||!1;g=c.checked?S:_}else if(u==="radio")g=c.getAttribute("value")||c.value;else if(u==="select"&&c.multiple){const S=c;g=Array.from(S.selectedOptions).map(_=>_.value)}else if(l&&(g=g.trim()),f){const S=Number(g);isNaN(S)||(g=S)}const v=s._state||s,w=M(v,e);if(Array.isArray(g)&&Array.isArray(w)?JSON.stringify([...g].sort())!==JSON.stringify([...w].sort()):g!==w){const S=y.target;S._modelUpdating=!0,le(v,e,g),setTimeout(()=>{S._modelUpdating=!1},0),s._requestRender&&s._requestRender()}};if(o[h]=C,u==="text"||u==="textarea"){const y=()=>{o._isComposing=!0},c=b=>{o._isComposing=!1;const g=b.target;setTimeout(()=>{if(g){let v=g.value;if(l&&(v=v.trim()),f){const _=Number(v);isNaN(_)||(v=_)}const w=s._state||s,k=M(w,e);(Array.isArray(v)&&Array.isArray(k)?JSON.stringify([...v].sort())!==JSON.stringify([...k].sort()):v!==k)&&(g&&(g._modelUpdating=!0,setTimeout(()=>{g._modelUpdating=!1},0)),le(w,e,v),s._requestRender&&s._requestRender())}},0)};o.compositionstart=y,o.compositionend=c}}function Pe(e,t,r,n){if(n)try{const o=JSON.parse(e);if(typeof o=="object")for(const[s,i]of Object.entries(o))t[s]=i}catch{const o=M(n,e);r[e]=o}}function Oe(e,t,r){if(!r)return;const n=M(r,e),o=t.style||"",s=n?"":"none";if(o){const i=o.split(";").filter(Boolean),a=i.findIndex(l=>l.trim().startsWith("display:"));a>=0?i[a]=`display: ${s}`:i.push(`display: ${s}`),t.style=i.join("; ")}else t.style=`display: ${s}`}function We(e,t,r){if(!r)return;const n=M(r,e);let o=[];typeof n=="string"?o=[n]:Array.isArray(n)?o=n.filter(Boolean):typeof n=="object"&&(o=Object.entries(n).filter(([,a])=>!!a).map(([a])=>a));const s=t.class||"",i=s?`${s} ${o.join(" ")}`.trim():o.join(" ");i&&(t.class=i)}function De(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=M(r,e)}else n=e;let o="";if(typeof n=="string")o=n;else if(n&&typeof n=="object"){const i=[];for(const[a,l]of Object.entries(n))if(l!=null&&l!==""){const f=a.replace(/[A-Z]/g,u=>`-${u.toLowerCase()}`),p=["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 d=String(l);typeof l=="number"&&p.includes(f)&&(d=`${l}px`),i.push(`${f}: ${d}`)}o=i.join("; ")+(i.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+o}function ge(e,t,r,n){const o={},s={...n||{}},i={};for(const[a,l]of Object.entries(e)){const{value:f,modifiers:p}=l;switch(a){case"model":Ne(typeof f=="string"?f:String(f),p,o,s,i,t,r);break;case"bind":Pe(f,o,s,t);break;case"show":Oe(f,s,t);break;case"class":We(f,s,t);break;case"style":De(f,s,t);break}}return{props:o,attrs:s,listeners:i}}function ne(e,t){if(Array.isArray(e)){const s=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const d=i.tag||"node",u=i.props?.attrs?.id??i.props?.attrs?.name??i.props?.attrs?.["data-key"]??"";a=u?`${t}:${d}:${u}`:`${t}:${d}`}let l=a,f=1;for(;s.has(l);)l=`${a}#${f++}`;s.add(l);let p=i.children;return Array.isArray(p)&&(p=ne(p,l)),{...i,key:l,children:p}})}const r=e;let n=r.props?.key??r.key??t,o=r.children;return Array.isArray(o)&&(o=ne(o,n)),{...r,key:n,children:o}}function He(e,t,r,n){const o=r.directives??{},s=ge(o,n,e,r.attrs),i={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},l=t.props??{},f=i;for(const u in{...l,...f}){const m=l[u],h=f[u];m!==h&&(u==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)?e.value!==h&&(e.value=h??""):u==="checked"&&e instanceof HTMLInputElement?e.checked=!!h:u.startsWith("on")&&typeof h=="function"?(typeof m=="function"&&e.removeEventListener(u.slice(2).toLowerCase(),m),e.addEventListener(u.slice(2).toLowerCase(),h)):h==null||h===!1?e.removeAttribute(u):e.setAttribute(u,String(h)))}for(const[u,m]of Object.entries(s.listeners||{}))e.addEventListener(u,m);const p=t.attrs??{},d=a;for(const u in{...p,...d}){const m=p[u],h=d[u];m!==h&&(h==null||h===!1?e.removeAttribute(u):e.setAttribute(u,String(h)))}}function T(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const d=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(d.key=e.key),d}if(e.tag==="#anchor"){const d=e,u=Array.isArray(d.children)?d.children:[],m=document.createTextNode(""),h=document.createTextNode("");d.key!=null&&(m.key=`${d.key}:start`,h.key=`${d.key}:end`),d._startNode=m,d._endNode=h;const C=document.createDocumentFragment();C.appendChild(m);for(const y of u)C.appendChild(T(y,t));return C.appendChild(h),C}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:o={},attrs:s={},directives:i={}}=e.props??{},a=ge(i,t,n,s),l={...o,...a.props},f={...s,...a.attrs};for(const d in f){const u=f[d];typeof u=="boolean"?u&&n.setAttribute(d,""):u!=null&&n.setAttribute(d,String(u))}for(const d in l){const u=l[d];if(d==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement))n.value=u??"";else if(d==="checked"&&n instanceof HTMLInputElement)n.checked=!!u;else if(d.startsWith("on")&&typeof u=="function")n.addEventListener(d.slice(2).toLowerCase(),u);else{if(d.startsWith("on")&&u===void 0)continue;u==null||u===!1?n.removeAttribute(d):n.setAttribute(d,String(u))}}for(const[d,u]of Object.entries(a.listeners||{}))n.addEventListener(d,u);const p=e.props?.ref??(e.props?.props&&e.props.props.ref);if(typeof e!="string"&&p&&r&&(r[p]=n),Array.isArray(e.children))for(const d of e.children)n.appendChild(T(d,t,r));else typeof e.children=="string"&&(n.textContent=e.children);return n}function Ie(e,t,r,n,o){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),i=Array.isArray(t)?t:[],a=new Map;for(const m of i)m&&m.key!=null&&a.set(m.key,m);const l=new Map;for(const m of s){const h=m.key;h!=null&&l.set(h,m)}const f=new Set;let p=e.firstChild;function d(m,h){let C=m;for(;C&&(f.add(C),C!==h);)C=C.nextSibling}function u(m,h,C,y){const c=[];let b=m.nextSibling;for(;b&&b!==h;)c.push(b),b=b.nextSibling;const g=Array.isArray(C)?C:[];if(y.some(w=>w&&w.key!=null)||g.some(w=>w&&w.key!=null)){const w=new Map,k=new Map;for(const x of g)x&&x.key!=null&&w.set(x.key,x);for(const x of c){const $=x.key;$!=null&&k.set($,x)}const S=new Set;let _=m.nextSibling;for(const x of y){let $;if(x.key!=null&&k.has(x.key)){const A=w.get(x.key);$=K(k.get(x.key),A,x,n),S.add($),$!==_&&e.contains($)&&e.insertBefore($,_)}else $=T(x,n),e.insertBefore($,_),S.add($);_=$.nextSibling}for(const x of c)!S.has(x)&&e.contains(x)&&e.removeChild(x)}else{const w=Math.min(g.length,y.length);for(let k=0;k<w;k++){const S=g[k],_=y[k],x=K(c[k],S,_,n);x!==c[k]&&(e.insertBefore(x,c[k]),e.removeChild(c[k]))}for(let k=w;k<y.length;k++)e.insertBefore(T(y[k],n),h);for(let k=w;k<c.length;k++)e.removeChild(c[k])}}for(const m of r){let h;if(m.tag==="#anchor"){const C=m.key,y=`${C}:start`,c=`${C}:end`;let b=l.get(y),g=l.get(c);const v=Array.isArray(m.children)?m.children:[];if(b||(b=document.createTextNode(""),b.key=y),g||(g=document.createTextNode(""),g.key=c),m._startNode=b,m._endNode=g,!e.contains(b)||!e.contains(g)){e.insertBefore(b,p);for(const w of v)e.insertBefore(T(w,n),p);e.insertBefore(g,p)}else u(b,g,a.get(C)?.children,v);d(b,g),p=g.nextSibling;continue}if(m.key!=null&&l.has(m.key)){const C=a.get(m.key);h=K(l.get(m.key),C,m,n,o),f.add(h),h!==p&&e.contains(h)&&(p&&!e.contains(p)&&(p=null),e.insertBefore(h,p))}else h=T(m,n,o),p&&!e.contains(p)&&(p=null),e.insertBefore(h,p),f.add(h);p=h.nextSibling}for(const m of s)!f.has(m)&&e.contains(m)&&(z(m,o),e.removeChild(m))}function K(e,t,r,n,o){if(t&&typeof t!="string"&&t.props?.ref&&o&&z(e,o),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const i=document.createTextNode(r);return e.parentNode?.replaceChild(i,e),i}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const i=r,a=Array.isArray(i.children)?i.children:[],l=i._startNode??document.createTextNode(""),f=i._endNode??document.createTextNode("");i.key!=null&&(l.key=`${i.key}:start`,f.key=`${i.key}:end`),i._startNode=l,i._endNode=f;const p=document.createDocumentFragment();p.appendChild(l);for(const d of a)p.appendChild(T(d,n));return p.appendChild(f),e.parentNode?.replaceChild(p,e),l}if(!r){z(e,o);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!t||typeof t=="string"){z(e,o);const i=T(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),e.parentNode?.replaceChild(i,e),i}if(r.tag==="#anchor"){const i=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),l=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,l.key=`${r.key}:end`),r._startNode=a,r._endNode=l;const f=document.createDocumentFragment();f.appendChild(a);for(const p of i)f.appendChild(T(p,n));return f.appendChild(l),e.parentNode?.replaceChild(f,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const i=e;return He(i,t.props||{},r.props||{},n),Ie(i,t.children,r.children,n,o),typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),i}z(e,o);const s=T(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function qe(e,t,r,n){let o;Array.isArray(t)?t.length===1?(o=t[0],o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})):o={tag:"div",key:"__root__",children:t}:(o=t,o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})),o=ne(o,String(o.key??"root"));const s=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;s&&i?typeof s!="string"&&typeof o!="string"&&s.tag===o.tag&&s.key===o.key?a=K(i,s,o,r,n):(a=T(o,r,n),e.replaceChild(a,i)):(a=T(o,r,n),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const l=[];for(let f=0;f<e.childNodes.length;f++){const p=e.childNodes[f];p!==a&&p.nodeName!=="STYLE"&&(z(p,n),l.push(p))}l.forEach(f=>e.removeChild(f)),e._prevVNode=o,e._prevDom=a}function se(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function me(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let q=null;function ce(){return q||(q=new CSSStyleSheet,q.replaceSync(me(Ke))),q}function Fe(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Ke=se`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ke(e,t){return J(e?t:[],"when-block")}function $e(e,t){return e.map((r,n)=>{const o=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return J(t(r,n),`each-${o}`)})}function ge(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return Se(...e)}}}function Se(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[J(n,`whenChain-branch-${t}`)]}return[J([],"whenChain-empty")]}function J(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class z extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return z.instance||(z.instance=new z),z.instance}emit(t,r){const n=Date.now(),o=this.eventCounters.get(t);if(!o||n-o.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(o.count++,o.count>50&&(console.error(`Event storm detected for "${t}": ${o.count} events in 1 second. Throttling...`),o.count>100)){console.warn(`Blocking further "${t}" events to prevent infinite loop`);return}this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(i=>{try{i(r)}catch(a){console.error(`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 o=this.on(t,s=>{o(),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 W=z.getInstance(),Ce=(e,t)=>W.emit(e,t),_e=(e,t)=>W.on(e,t),Ae=(e,t)=>W.off(e,t),Ee=(e,t)=>W.once(e,t),Te=(e,t,r)=>W.listen(e,t,r);function ee(e){let t={...e};const r=[];function n(a){r.push(a),a(t)}function o(){return t}function s(a){const c=typeof a=="function"?a(t):a;t={...t,...c},i()}function i(){r.forEach(a=>a(t))}return{subscribe:n,getState:o,setState:s}}function se(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function te(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function je(e,t,r){if(r)for(const[n,o]of Object.entries(r)){let s,i={};if(Array.isArray(o)?(s=o[0],i=o[1]||{}):s=o,t.set(n,{callback:s,options:i,oldValue:re(e,n)}),i.immediate)try{const a=re(e,n);s(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${n}":`,a)}}}function re(e,t){return t.split(".").reduce((r,n)=>r?.[n],e)}function Le(e,t,r,n){const o=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((g,d)=>o(g,a[d]));const c=Object.keys(i),f=Object.keys(a);return c.length!==f.length?!1:c.every(g=>o(i[g],a[g]))},s=t.get(r);if(s&&!o(n,s.oldValue))try{s.callback(n,s.oldValue,e),s.oldValue=n}catch(i){console.error(`Error in watcher for "${r}":`,i)}for(const[i,a]of t.entries())if(a.options.deep&&r.startsWith(i+"."))try{const c=re(e,i);o(c,a.oldValue)||(a.callback(c,a.oldValue,e),a.oldValue=c)}catch(c){console.error(`Error in deep watcher for "${i}":`,c)}}function Be(e,t,r){if(!t.props)return;function n(o,s){return s===Boolean?o==="true":s===Number?Number(o):o}Object.entries(t.props).forEach(([o,s])=>{if(s.type===Function&&typeof e[o]=="function")r[o]=e[o];else{const i=e.getAttribute(se(o));i!==null?r[o]=te(n(i,s.type)):"default"in s&&s.default!==void 0&&(r[o]=te(s.default))}})}function Re(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function ze(e,t,r,n,o,s,i,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(c=>c()),n(),o(),s(!1),i(null),a(!1)}function Ne(e,t,r,n,o){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,o)}function N(e,t){if(t&&e instanceof HTMLElement){for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))N(r,t)}}function M(e,t){return t.split(".").reduce((r,n)=>r?.[n],e)}function ce(e,t,r){const n=t.split("."),o=n.pop();if(!o)return;const s=n.reduce((i,a)=>(a in i||(i[a]={}),i[a]),e);s[o]=r}function Me(e,t,r,n,o,s,i){if(!s)return;const a=t.includes("lazy"),c=t.includes("trim"),f=t.includes("number"),g=()=>{const h=s._state||s;return M(h,e)},d=g();let u="text";const v=n?.type;if(i instanceof HTMLInputElement?u=v||i.type||"text":i instanceof HTMLSelectElement?u="select":i instanceof HTMLTextAreaElement&&(u="textarea"),u==="checkbox")if(Array.isArray(d)){const h=i?.getAttribute("value")||n?.value||"",l=d.includes(h);i&&i.checked!==l&&(r.checked=l)}else{const h=i?.getAttribute("true-value")||!0,l=d===h;i&&i.checked!==l&&(r.checked=l)}else if(u==="radio"){const h=n?.value||"",l=d===h;i&&i.checked!==l&&(r.checked=l)}else if(u==="select")if(i&&i.hasAttribute("multiple")){const h=i,l=Array.isArray(d)?d:[];setTimeout(()=>{Array.from(h.options).forEach(p=>{const m=l.includes(p.value);p.selected!==m&&(p.selected=m)})},0)}else setTimeout(()=>{i instanceof HTMLSelectElement&&i.value!==String(d)&&(i.value=String(d))},0);else{const h=String(d??"");(!i||i.value!==h)&&(r.value=d)}const y=a||u==="checkbox"||u==="radio"||u==="select"?"change":"input",b=h=>{if(h.isComposing||o._isComposing||h.isTrusted===!1)return;const l=h.target;if(l._modelUpdating)return;const p=g();let m=l.value;if(u==="checkbox")if(Array.isArray(p)){const C=l.getAttribute("value")||"",_=[...p];if(l.checked)_.includes(C)||_.push(C);else{const w=_.indexOf(C);w>-1&&_.splice(w,1)}m=_}else{const C=l.getAttribute("true-value")||!0,_=l.getAttribute("false-value")||!1;m=l.checked?C:_}else if(u==="radio")m=l.getAttribute("value")||l.value;else if(u==="select"&&l.multiple){const C=l;m=Array.from(C.selectedOptions).map(_=>_.value)}else if(c&&(m=m.trim()),f){const C=Number(m);isNaN(C)||(m=C)}const x=s._state||s,k=M(x,e);if(Array.isArray(m)&&Array.isArray(k)?JSON.stringify([...m].sort())!==JSON.stringify([...k].sort()):m!==k){const C=h.target;C._modelUpdating=!0,ce(x,e,m),setTimeout(()=>{C._modelUpdating=!1},0),s._requestRender&&s._requestRender()}};if(o[y]=b,u==="text"||u==="textarea"){const h=()=>{o._isComposing=!0},l=p=>{o._isComposing=!1;const m=p.target;setTimeout(()=>{if(m){let x=m.value;if(c&&(x=x.trim()),f){const _=Number(x);isNaN(_)||(x=_)}const k=s._state||s,$=M(k,e);(Array.isArray(x)&&Array.isArray($)?JSON.stringify([...x].sort())!==JSON.stringify([...$].sort()):x!==$)&&(m&&(m._modelUpdating=!0,setTimeout(()=>{m._modelUpdating=!1},0)),ce(k,e,x),s._requestRender&&s._requestRender())}},0)};o.compositionstart=h,o.compositionend=l}}function Pe(e,t,r,n){if(n)try{const o=JSON.parse(e);if(typeof o=="object")for(const[s,i]of Object.entries(o))t[s]=i}catch{const o=M(n,e);r[e]=o}}function Oe(e,t,r){if(!r)return;const n=M(r,e),o=t.style||"",s=n?"":"none";if(o){const i=o.split(";").filter(Boolean),a=i.findIndex(c=>c.trim().startsWith("display:"));a>=0?i[a]=`display: ${s}`:i.push(`display: ${s}`),t.style=i.join("; ")}else t.style=`display: ${s}`}function We(e,t,r){if(!r)return;const n=M(r,e);let o=[];typeof n=="string"?o=[n]:Array.isArray(n)?o=n.filter(Boolean):typeof n=="object"&&(o=Object.entries(n).filter(([,a])=>!!a).map(([a])=>a));const s=t.class||"",i=s?`${s} ${o.join(" ")}`.trim():o.join(" ");i&&(t.class=i)}function De(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=M(r,e)}else n=e;let o="";if(typeof n=="string")o=n;else if(n&&typeof n=="object"){const i=[];for(const[a,c]of Object.entries(n))if(c!=null&&c!==""){const f=a.replace(/[A-Z]/g,u=>`-${u.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 d=String(c);typeof c=="number"&&g.includes(f)&&(d=`${c}px`),i.push(`${f}: ${d}`)}o=i.join("; ")+(i.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+o}function ye(e,t,r,n){const o={},s={...n||{}},i={};for(const[a,c]of Object.entries(e)){const{value:f,modifiers:g}=c;switch(a){case"model":Me(typeof f=="string"?f:String(f),g,o,s,i,t,r);break;case"bind":Pe(f,o,s,t);break;case"show":Oe(f,s,t);break;case"class":We(f,s,t);break;case"style":De(f,s,t);break}}return{props:o,attrs:s,listeners:i}}function ne(e,t){if(Array.isArray(e)){const s=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const d=i.tag||"node",u=i.props?.attrs?.id??i.props?.attrs?.name??i.props?.attrs?.["data-key"]??"";a=u?`${t}:${d}:${u}`:`${t}:${d}`}let c=a,f=1;for(;s.has(c);)c=`${a}#${f++}`;s.add(c);let g=i.children;return Array.isArray(g)&&(g=ne(g,c)),{...i,key:c,children:g}})}const r=e;let n=r.props?.key??r.key??t,o=r.children;return Array.isArray(o)&&(o=ne(o,n)),{...r,key:n,children:o}}function He(e,t,r,n){const o=r.directives??{},s=ye(o,n,e,r.attrs),i={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},c=t.props??{},f=i;for(const u in{...c,...f}){const v=c[u],y=f[u];v!==y&&(u==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)?e.value!==y&&(e.value=y??""):u==="checked"&&e instanceof HTMLInputElement?e.checked=!!y:u.startsWith("on")&&typeof y=="function"?(typeof v=="function"&&e.removeEventListener(u.slice(2).toLowerCase(),v),e.addEventListener(u.slice(2).toLowerCase(),y)):y==null||y===!1?e.removeAttribute(u):e.setAttribute(u,String(y)))}for(const[u,v]of Object.entries(s.listeners||{}))e.addEventListener(u,v);const g=t.attrs??{},d=a;for(const u in{...g,...d}){const v=g[u],y=d[u];v!==y&&(y==null||y===!1?e.removeAttribute(u):e.setAttribute(u,String(y)))}}function T(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const d=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(d.key=e.key),d}if(e.tag==="#anchor"){const d=e,u=Array.isArray(d.children)?d.children:[],v=document.createTextNode(""),y=document.createTextNode("");d.key!=null&&(v.key=`${d.key}:start`,y.key=`${d.key}:end`),d._startNode=v,d._endNode=y;const b=document.createDocumentFragment();b.appendChild(v);for(const h of u)b.appendChild(T(h,t));return b.appendChild(y),b}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:o={},attrs:s={},directives:i={}}=e.props??{},a=ye(i,t,n,s),c={...o,...a.props},f={...s,...a.attrs};for(const d in f){const u=f[d];typeof u=="boolean"?u&&n.setAttribute(d,""):u!=null&&n.setAttribute(d,String(u))}for(const d in c){const u=c[d];if(d==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement))n.value=u??"";else if(d==="checked"&&n instanceof HTMLInputElement)n.checked=!!u;else if(d.startsWith("on")&&typeof u=="function")n.addEventListener(d.slice(2).toLowerCase(),u);else{if(d.startsWith("on")&&u===void 0)continue;u==null||u===!1?n.removeAttribute(d):n.setAttribute(d,String(u))}}for(const[d,u]of Object.entries(a.listeners||{}))n.addEventListener(d,u);const g=e.props?.ref??(e.props?.props&&e.props.props.ref);if(typeof e!="string"&&g&&r&&(r[g]=n),Array.isArray(e.children))for(const d of e.children)n.appendChild(T(d,t,r));else typeof e.children=="string"&&(n.textContent=e.children);return n}function qe(e,t,r,n,o){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),i=Array.isArray(t)?t:[],a=new Map;for(const v of i)v&&v.key!=null&&a.set(v.key,v);const c=new Map;for(const v of s){const y=v.key;y!=null&&c.set(y,v)}const f=new Set;let g=e.firstChild;function d(v,y){let b=v;for(;b&&(f.add(b),b!==y);)b=b.nextSibling}function u(v,y,b,h){const l=[];let p=v.nextSibling;for(;p&&p!==y;)l.push(p),p=p.nextSibling;const m=Array.isArray(b)?b:[];if(h.some(k=>k&&k.key!=null)||m.some(k=>k&&k.key!=null)){const k=new Map,$=new Map;for(const w of m)w&&w.key!=null&&k.set(w.key,w);for(const w of l){const S=w.key;S!=null&&$.set(S,w)}const C=new Set;let _=v.nextSibling;for(const w of h){let S;if(w.key!=null&&$.has(w.key)){const A=k.get(w.key);S=K($.get(w.key),A,w,n),C.add(S),S!==_&&e.contains(S)&&e.insertBefore(S,_)}else S=T(w,n),e.insertBefore(S,_),C.add(S);_=S.nextSibling}for(const w of l)!C.has(w)&&e.contains(w)&&e.removeChild(w)}else{const k=Math.min(m.length,h.length);for(let $=0;$<k;$++){const C=m[$],_=h[$],w=K(l[$],C,_,n);w!==l[$]&&(e.insertBefore(w,l[$]),e.removeChild(l[$]))}for(let $=k;$<h.length;$++)e.insertBefore(T(h[$],n),y);for(let $=k;$<l.length;$++)e.removeChild(l[$])}}for(const v of r){let y;if(v.tag==="#anchor"){const b=v.key,h=`${b}:start`,l=`${b}:end`;let p=c.get(h),m=c.get(l);const x=Array.isArray(v.children)?v.children:[];if(p||(p=document.createTextNode(""),p.key=h),m||(m=document.createTextNode(""),m.key=l),v._startNode=p,v._endNode=m,!e.contains(p)||!e.contains(m)){e.insertBefore(p,g);for(const k of x)e.insertBefore(T(k,n),g);e.insertBefore(m,g)}else u(p,m,a.get(b)?.children,x);d(p,m),g=m.nextSibling;continue}if(v.key!=null&&c.has(v.key)){const b=a.get(v.key);y=K(c.get(v.key),b,v,n,o),f.add(y),y!==g&&e.contains(y)&&(g&&!e.contains(g)&&(g=null),e.insertBefore(y,g))}else y=T(v,n,o),g&&!e.contains(g)&&(g=null),e.insertBefore(y,g),f.add(y);g=y.nextSibling}for(const v of s)!f.has(v)&&e.contains(v)&&(N(v,o),e.removeChild(v))}function K(e,t,r,n,o){if(t&&typeof t!="string"&&t.props?.ref&&o&&N(e,o),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const i=document.createTextNode(r);return e.parentNode?.replaceChild(i,e),i}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const i=r,a=Array.isArray(i.children)?i.children:[],c=i._startNode??document.createTextNode(""),f=i._endNode??document.createTextNode("");i.key!=null&&(c.key=`${i.key}:start`,f.key=`${i.key}:end`),i._startNode=c,i._endNode=f;const g=document.createDocumentFragment();g.appendChild(c);for(const d of a)g.appendChild(T(d,n));return g.appendChild(f),e.parentNode?.replaceChild(g,e),c}if(!r){N(e,o);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!t||typeof t=="string"){N(e,o);const i=T(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),e.parentNode?.replaceChild(i,e),i}if(r.tag==="#anchor"){const i=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),c=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,c.key=`${r.key}:end`),r._startNode=a,r._endNode=c;const f=document.createDocumentFragment();f.appendChild(a);for(const g of i)f.appendChild(T(g,n));return f.appendChild(c),e.parentNode?.replaceChild(f,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const i=e;return He(i,t.props||{},r.props||{},n),qe(i,t.children,r.children,n,o),typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),i}N(e,o);const s=T(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function Ie(e,t,r,n){let o;Array.isArray(t)?t.length===1?(o=t[0],o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})):o={tag:"div",key:"__root__",children:t}:(o=t,o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})),o=ne(o,String(o.key??"root"));const s=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;s&&i?typeof s!="string"&&typeof o!="string"&&s.tag===o.tag&&s.key===o.key?a=K(i,s,o,r,n):(a=T(o,r,n),e.replaceChild(a,i)):(a=T(o,r,n),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const c=[];for(let f=0;f<e.childNodes.length;f++){const g=e.childNodes[f];g!==a&&g.nodeName!=="STYLE"&&(N(g,n),c.push(g))}c.forEach(f=>e.removeChild(f)),e._prevVNode=o,e._prevDom=a}function ae(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function me(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let I=null;function fe(){return I||(I=new CSSStyleSheet,I.replaceSync(me(Ke))),I}function Fe(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Ke=ae`
|
|
2
2
|
:host, *, ::before, ::after {
|
|
3
3
|
all: isolate;
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -56,33 +56,33 @@
|
|
|
56
56
|
sup { top: -.5em }
|
|
57
57
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
58
58
|
[hidden] { display: none }
|
|
59
|
-
`,Ve={gray:{50:"var(--color-gray-50, #f9fafb)",100:"var(--color-gray-100, #f3f4f6)",200:"var(--color-gray-200, #e5e7eb)",300:"var(--color-gray-300, #d1d5db)",400:"var(--color-gray-400, #9ca3af)",500:"var(--color-gray-500, #6b7280)",600:"var(--color-gray-600, #4b5563)",700:"var(--color-gray-700, #374151)",800:"var(--color-gray-800, #1f2937)",900:"var(--color-gray-900, #111827)"},neutral:{50:"var(--color-neutral-50, #fafafa)",100:"var(--color-neutral-100, #f5f5f5)",200:"var(--color-neutral-200, #e5e5e5)",300:"var(--color-neutral-300, #d4d4d4)",400:"var(--color-neutral-400, #a3a3a3)",500:"var(--color-neutral-500, #737373)",600:"var(--color-neutral-600, #525252)",700:"var(--color-neutral-700, #404040)",800:"var(--color-neutral-800, #262626)",900:"var(--color-neutral-900, #171717)"},slate:{50:"var(--color-slate-50, #f8fafc)",100:"var(--color-slate-100, #f1f5f9)",200:"var(--color-slate-200, #e2e8f0)",300:"var(--color-slate-300, #cbd5e1)",400:"var(--color-slate-400, #94a3b8)",500:"var(--color-slate-500, #64748b)",600:"var(--color-slate-600, #475569)",700:"var(--color-slate-700, #334155)",800:"var(--color-slate-800, #1e293b)",900:"var(--color-slate-900, #0f172a)"},zinc:{50:"var(--color-zinc-50, #fafafa)",100:"var(--color-zinc-100, #f4f4f5)",200:"var(--color-zinc-200, #e4e4e7)",300:"var(--color-zinc-300, #d4d4d8)",400:"var(--color-zinc-400, #a1a1aa)",500:"var(--color-zinc-500, #71717a)",600:"var(--color-zinc-600, #52525b)",700:"var(--color-zinc-700, #3f3f46)",800:"var(--color-zinc-800, #27272a)",900:"var(--color-zinc-900, #18181b)"},red:{50:"var(--color-red-50, #fef2f2)",100:"var(--color-red-100, #fee2e2)",200:"var(--color-red-200, #fecaca)",300:"var(--color-red-300, #fca5a5)",400:"var(--color-red-400, #f87171)",500:"var(--color-red-500, #ef4444)",600:"var(--color-red-600, #dc2626)",700:"var(--color-red-700, #b91c1c)",800:"var(--color-red-800, #991b1b)",900:"var(--color-red-900, #7f1d1d)"},blue:{50:"var(--color-blue-50, #eff6ff)",100:"var(--color-blue-100, #dbeafe)",200:"var(--color-blue-200, #bfdbfe)",300:"var(--color-blue-300, #93c5fd)",400:"var(--color-blue-400, #60a5fa)",500:"var(--color-blue-500, #3b82f6)",600:"var(--color-blue-600, #2563eb)",700:"var(--color-blue-700, #1d4ed8)",800:"var(--color-blue-800, #1e40af)",900:"var(--color-blue-900, #1e3a8a)"},green:{50:"var(--color-green-50, #f0fdf4)",100:"var(--color-green-100, #dcfce7)",200:"var(--color-green-200, #bbf7d0)",300:"var(--color-green-300, #86efac)",400:"var(--color-green-400, #4ade80)",500:"var(--color-green-500, #22c55e)",600:"var(--color-green-600, #16a34a)",700:"var(--color-green-700, #15803d)",800:"var(--color-green-800, #166534)",900:"var(--color-green-900, #14532d)"},amber:{50:"var(--color-amber-50, #fffbeb)",100:"var(--color-amber-100, #fef3c7)",200:"var(--color-amber-200, #fde68a)",300:"var(--color-amber-300, #fcd34d)",400:"var(--color-amber-400, #fbbf24)",500:"var(--color-amber-500, #f59e0b)",600:"var(--color-amber-600, #d97706)",700:"var(--color-amber-700, #b45309)",800:"var(--color-amber-800, #92400e)",900:"var(--color-amber-900, #78350f)"},indigo:{50:"var(--color-indigo-50, #eef2ff)",100:"var(--color-indigo-100, #e0e7ff)",200:"var(--color-indigo-200, #c7d2fe)",300:"var(--color-indigo-300, #a5b4fc)",400:"var(--color-indigo-400, #818cf8)",500:"var(--color-indigo-500, #6366f1)",600:"var(--color-indigo-600, #4f46e5)",700:"var(--color-indigo-700, #4338ca)",800:"var(--color-indigo-800, #3730a3)",900:"var(--color-indigo-900, #312e81)"},emerald:{50:"var(--color-emerald-50, #ecfdf5)",100:"var(--color-emerald-100, #d1fae5)",200:"var(--color-emerald-200, #a7f3d0)",300:"var(--color-emerald-300, #6ee7b7)",400:"var(--color-emerald-400, #34d399)",500:"var(--color-emerald-500, #10b981)",600:"var(--color-emerald-600, #059669)",700:"var(--color-emerald-700, #047857)",800:"var(--color-emerald-800, #065f46)",900:"var(--color-emerald-900, #064e3b)"},rose:{50:"var(--color-rose-50, #fff1f2)",100:"var(--color-rose-100, #ffe4e6)",200:"var(--color-rose-200, #fecdd3)",300:"var(--color-rose-300, #fda4af)",400:"var(--color-rose-400, #fb7185)",500:"var(--color-rose-500, #f43f5e)",600:"var(--color-rose-600, #e11d48)",700:"var(--color-rose-700, #be123c)",800:"var(--color-rose-800, #9f1239)",900:"var(--color-rose-900, #881337)"},white:{DEFAULT:"var(--color-white, #ffffff)"},black:{DEFAULT:"var(--color-black, #000000)"}},Q={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%;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","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;","grid-cols-1":"grid-template-columns:repeat(1,minmax(0,1fr));","grid-cols-2":"grid-template-columns:repeat(2,minmax(0,1fr));","grid-cols-3":"grid-template-columns:repeat(3,minmax(0,1fr));","grid-cols-4":"grid-template-columns:repeat(4,minmax(0,1fr));","grid-cols-5":"grid-template-columns:repeat(5,minmax(0,1fr));","grid-cols-6":"grid-template-columns:repeat(6,minmax(0,1fr));","grid-cols-12":"grid-template-columns:repeat(12,minmax(0,1fr));","grid-rows-1":"grid-template-rows:repeat(1,minmax(0,1fr));","grid-rows-2":"grid-template-rows:repeat(2,minmax(0,1fr));","grid-rows-3":"grid-template-rows:repeat(3,minmax(0,1fr));","grid-rows-4":"grid-template-rows:repeat(4,minmax(0,1fr));","grid-rows-6":"grid-template-rows:repeat(6,minmax(0,1fr));","grid-rows-12":"grid-template-rows:repeat(12,minmax(0,1fr));","col-span-1":"grid-column:span 1 / span 1;","col-span-2":"grid-column:span 2 / span 2;","col-span-3":"grid-column:span 3 / span 3;","col-span-4":"grid-column:span 4 / span 4;","col-span-5":"grid-column:span 5 / span 5;","col-span-6":"grid-column:span 6 / span 6;","col-span-12":"grid-column:span 12 / span 12;","row-span-1":"grid-row:span 1 / span 1;","row-span-2":"grid-row:span 2 / span 2;","row-span-3":"grid-row:span 3 / span 3;","row-span-4":"grid-row:span 4 / span 4;","row-span-6":"grid-row:span 6 / span 6;","row-span-12":"grid-row:span 12 / span 12;",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;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;",rounded:"border-radius:0.25rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-full":"border-radius:9999px;","ring-0":"box-shadow:none;","ring-1":"box-shadow:0 0 0 1px rgba(59,130,246,0.5);","ring-2":"box-shadow:0 0 0 2px rgba(59,130,246,0.5);","ring-4":"box-shadow:0 0 0 4px rgba(59,130,246,0.5);","ring-8":"box-shadow:0 0 0 8px rgba(59,130,246,0.5);","shadow-none":"box-shadow:0 0 #0000;","shadow-xs":"box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);","shadow-sm":"box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);","shadow-md":"box-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);","shadow-lg":"box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);","shadow-xl":"box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);","shadow-2xl":"box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",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-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;"},Ue="var(--spacing, 0.25rem)",fe={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"]},Je={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${e}:hover{${t}}`,focus:(e,t)=>`${e}:focus{${t}}`,active:(e,t)=>`${e}:active{${t}}`,disabled:(e,t)=>`${e}:disabled{${t}}`,visited:(e,t)=>`${e}:visited{${t}}`,checked:(e,t)=>`${e}:checked{${t}}`,first:(e,t)=>`${e}:first-child{${t}}`,last:(e,t)=>`${e}:last-child{${t}}`,odd:(e,t)=>`${e}:nth-child(odd){${t}}`,even:(e,t)=>`${e}:nth-child(even){${t}}`,"focus-within":(e,t)=>`${e}:focus-within{${t}}`,"focus-visible":(e,t)=>`${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}}`},ue={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)"},Z=["sm","md","lg","xl","2xl"];function X(e){const t=e.startsWith("-"),n=(t?e.slice(1):e).split("-");if(n.length<2)return null;const o=n.slice(0,-1).join("-"),s=n[n.length-1],i=parseFloat(s);if(Number.isNaN(i)||!fe[o])return null;const a=t?"-":"";return fe[o].map(l=>`${l}:calc(${a}${Ue} * ${i});`).join("")}function de(e){const t=e.replace("#",""),r=parseInt(t,16),n=r>>16&255,o=r>>8&255,s=r&255;return`${n} ${o} ${s}`}function Qe(e){const t=/^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,n,o="DEFAULT"]=t,s=Ve[n]?.[o];return s?`${{bg:"background-color",text:"color",border:"border-color",shadow:"box-shadow",outline:"outline-color",caret:"caret-color",accent:"accent-color"}[r]}:${s};`:null}function Ze(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 Y(e){const{base:t,opacity:r}=Ze(e),n=Qe(t);if(n){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const i=de(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return n}const o=V(t);if(o&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(o);if(s){const i=de(s[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return o}function V(e){const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const n=e.slice(0,t);let o=e.slice(t+2,-1);o=o.replace(/_/g," ");const i={bg:"background-color",text:"color",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",shadow:"box-shadow",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",delay:"transition-delay",weight:"font-weight",leading:"line-height",z:"z-index"}[n]??n.replace(/_/g,"-");if(i&&o)return`${i}:${o};`}return null}function Xe(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Ye(e){const t=/class\s*=\s*["']([^"']+)["']/g,r=[];let n;for(;n=t.exec(e);){let o="",s=!1;for(const i of n[1])i==="["&&(s=!0),i==="]"&&(s=!1),i===" "&&!s?(o&&r.push(o),o=""):o+=i;o&&r.push(o)}return r.filter(Boolean)}const pe=new Map,Ge=16;function et(e){const t=Date.now(),r=pe.get(e);if(r&&t-r.timestamp<Ge)return r.css;const n=Ye(e),o=new Set(n),s=[],i=[],a=[],l=[],f={};function p(h,C=!1){const y=(C?"dark|":"")+h;if(y in f)return f[y];const c=u(h,C);return f[y]=c,c}function d(h){const C=h.some(c=>Z.includes(c)),y=h.includes("dark");return h.length===0?1:!C&&!y?2:C&&!y?3:4}function u(h,C=!1){const y=h.split(":"),c=y.find($=>Q[$]||X($)||Y($)||V($));if(!c)return null;const b=Q[c]??X(c)??Y(c)??V(c);if(!b)return null;let g=`.${Xe(h)}`,v=b;const w=y.indexOf(c);let k=w>=0?y.slice(0,w):[];C&&(k=k.filter($=>$!=="dark"));const S=k.filter($=>Z.includes($)),_=S.length?S[S.length-1]:null;for(const $ of k){if(Z.includes($))continue;const A=Je[$];typeof A=="function"&&(g=A(g,v).replace(/\{.*$/,""))}let x=`${g}{${v}}`;return C&&_?x=`@media (prefers-color-scheme: dark) and ${ue[_]}{${x}}`:C?x=`@media (prefers-color-scheme: dark){${x}}`:_&&(x=`@media ${ue[_]}{${x}}`),x}for(const h of o){const C=h.split(":"),y=C.find(v=>Q[v]||X(v)||Y(v)||V(v));if(!y)continue;const c=C.indexOf(y),b=c>=0?C.slice(0,c):[],g=d(b);if(g===4){const v=p(h,!0);v&&l.push(v)}else{const v=p(h);v&&(g===1?s.push(v):g===2?i.push(v):g===3&&a.push(v))}}const m=[...s,...i,...a,...l].join("");return pe.set(e,{css:m,timestamp:t}),m}function tt(e,t,r,n,o,s,i,a){if(!e)return;if(t.loadingTemplate&&r.isLoading){N(e,t.loadingTemplate(r),r,n,o);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&N(e,t.errorTemplate(r.error,r),r,n,o);return}const l=t.render(r);if(l instanceof Promise){s(!0),l.then(f=>{s(!1),i(null),N(e,f,r,n,o),a(e.innerHTML)}).catch(f=>{s(!1),i(f),t.errorTemplate&&N(e,t.errorTemplate(f,r),r,n,o)}),t.loadingTemplate&&N(e,t.loadingTemplate(r),r,n,o);return}N(e,l,r,n,o),a(e.innerHTML)}function N(e,t,r,n,o){e&&(qe(e,Array.isArray(t)?t:[t],r,n),o(e.innerHTML))}function rt(e,t,r,n,o,s,i){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(o(r+1),r>10){console.warn("Potential infinite render loop detected. Skipping render."),i(null);return}}else o(0);const l=setTimeout(()=>{n(Date.now()),e(),i(null)},0);i(l)}function nt(e,t,r,n,o,s){if(!e)return;const i=et(n);if(!t.style&&(!i||i.trim()==="")){s(null),e.adoptedStyleSheets=[ce()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let l=Fe(`${a}
|
|
59
|
+
`,Ue={gray:{50:"var(--color-gray-50, #f9fafb)",100:"var(--color-gray-100, #f3f4f6)",200:"var(--color-gray-200, #e5e7eb)",300:"var(--color-gray-300, #d1d5db)",400:"var(--color-gray-400, #9ca3af)",500:"var(--color-gray-500, #6b7280)",600:"var(--color-gray-600, #4b5563)",700:"var(--color-gray-700, #374151)",800:"var(--color-gray-800, #1f2937)",900:"var(--color-gray-900, #111827)"},neutral:{50:"var(--color-neutral-50, #fafafa)",100:"var(--color-neutral-100, #f5f5f5)",200:"var(--color-neutral-200, #e5e5e5)",300:"var(--color-neutral-300, #d4d4d4)",400:"var(--color-neutral-400, #a3a3a3)",500:"var(--color-neutral-500, #737373)",600:"var(--color-neutral-600, #525252)",700:"var(--color-neutral-700, #404040)",800:"var(--color-neutral-800, #262626)",900:"var(--color-neutral-900, #171717)"},slate:{50:"var(--color-slate-50, #f8fafc)",100:"var(--color-slate-100, #f1f5f9)",200:"var(--color-slate-200, #e2e8f0)",300:"var(--color-slate-300, #cbd5e1)",400:"var(--color-slate-400, #94a3b8)",500:"var(--color-slate-500, #64748b)",600:"var(--color-slate-600, #475569)",700:"var(--color-slate-700, #334155)",800:"var(--color-slate-800, #1e293b)",900:"var(--color-slate-900, #0f172a)"},zinc:{50:"var(--color-zinc-50, #fafafa)",100:"var(--color-zinc-100, #f4f4f5)",200:"var(--color-zinc-200, #e4e4e7)",300:"var(--color-zinc-300, #d4d4d8)",400:"var(--color-zinc-400, #a1a1aa)",500:"var(--color-zinc-500, #71717a)",600:"var(--color-zinc-600, #52525b)",700:"var(--color-zinc-700, #3f3f46)",800:"var(--color-zinc-800, #27272a)",900:"var(--color-zinc-900, #18181b)"},red:{50:"var(--color-red-50, #fef2f2)",100:"var(--color-red-100, #fee2e2)",200:"var(--color-red-200, #fecaca)",300:"var(--color-red-300, #fca5a5)",400:"var(--color-red-400, #f87171)",500:"var(--color-red-500, #ef4444)",600:"var(--color-red-600, #dc2626)",700:"var(--color-red-700, #b91c1c)",800:"var(--color-red-800, #991b1b)",900:"var(--color-red-900, #7f1d1d)"},blue:{50:"var(--color-blue-50, #eff6ff)",100:"var(--color-blue-100, #dbeafe)",200:"var(--color-blue-200, #bfdbfe)",300:"var(--color-blue-300, #93c5fd)",400:"var(--color-blue-400, #60a5fa)",500:"var(--color-blue-500, #3b82f6)",600:"var(--color-blue-600, #2563eb)",700:"var(--color-blue-700, #1d4ed8)",800:"var(--color-blue-800, #1e40af)",900:"var(--color-blue-900, #1e3a8a)"},green:{50:"var(--color-green-50, #f0fdf4)",100:"var(--color-green-100, #dcfce7)",200:"var(--color-green-200, #bbf7d0)",300:"var(--color-green-300, #86efac)",400:"var(--color-green-400, #4ade80)",500:"var(--color-green-500, #22c55e)",600:"var(--color-green-600, #16a34a)",700:"var(--color-green-700, #15803d)",800:"var(--color-green-800, #166534)",900:"var(--color-green-900, #14532d)"},amber:{50:"var(--color-amber-50, #fffbeb)",100:"var(--color-amber-100, #fef3c7)",200:"var(--color-amber-200, #fde68a)",300:"var(--color-amber-300, #fcd34d)",400:"var(--color-amber-400, #fbbf24)",500:"var(--color-amber-500, #f59e0b)",600:"var(--color-amber-600, #d97706)",700:"var(--color-amber-700, #b45309)",800:"var(--color-amber-800, #92400e)",900:"var(--color-amber-900, #78350f)"},indigo:{50:"var(--color-indigo-50, #eef2ff)",100:"var(--color-indigo-100, #e0e7ff)",200:"var(--color-indigo-200, #c7d2fe)",300:"var(--color-indigo-300, #a5b4fc)",400:"var(--color-indigo-400, #818cf8)",500:"var(--color-indigo-500, #6366f1)",600:"var(--color-indigo-600, #4f46e5)",700:"var(--color-indigo-700, #4338ca)",800:"var(--color-indigo-800, #3730a3)",900:"var(--color-indigo-900, #312e81)"},emerald:{50:"var(--color-emerald-50, #ecfdf5)",100:"var(--color-emerald-100, #d1fae5)",200:"var(--color-emerald-200, #a7f3d0)",300:"var(--color-emerald-300, #6ee7b7)",400:"var(--color-emerald-400, #34d399)",500:"var(--color-emerald-500, #10b981)",600:"var(--color-emerald-600, #059669)",700:"var(--color-emerald-700, #047857)",800:"var(--color-emerald-800, #065f46)",900:"var(--color-emerald-900, #064e3b)"},rose:{50:"var(--color-rose-50, #fff1f2)",100:"var(--color-rose-100, #ffe4e6)",200:"var(--color-rose-200, #fecdd3)",300:"var(--color-rose-300, #fda4af)",400:"var(--color-rose-400, #fb7185)",500:"var(--color-rose-500, #f43f5e)",600:"var(--color-rose-600, #e11d48)",700:"var(--color-rose-700, #be123c)",800:"var(--color-rose-800, #9f1239)",900:"var(--color-rose-900, #881337)"},white:{DEFAULT:"var(--color-white, #ffffff)"},black:{DEFAULT:"var(--color-black, #000000)"}},Q={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%;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","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;","grid-cols-1":"grid-template-columns:repeat(1,minmax(0,1fr));","grid-cols-2":"grid-template-columns:repeat(2,minmax(0,1fr));","grid-cols-3":"grid-template-columns:repeat(3,minmax(0,1fr));","grid-cols-4":"grid-template-columns:repeat(4,minmax(0,1fr));","grid-cols-5":"grid-template-columns:repeat(5,minmax(0,1fr));","grid-cols-6":"grid-template-columns:repeat(6,minmax(0,1fr));","grid-cols-12":"grid-template-columns:repeat(12,minmax(0,1fr));","grid-rows-1":"grid-template-rows:repeat(1,minmax(0,1fr));","grid-rows-2":"grid-template-rows:repeat(2,minmax(0,1fr));","grid-rows-3":"grid-template-rows:repeat(3,minmax(0,1fr));","grid-rows-4":"grid-template-rows:repeat(4,minmax(0,1fr));","grid-rows-6":"grid-template-rows:repeat(6,minmax(0,1fr));","grid-rows-12":"grid-template-rows:repeat(12,minmax(0,1fr));","col-span-1":"grid-column:span 1 / span 1;","col-span-2":"grid-column:span 2 / span 2;","col-span-3":"grid-column:span 3 / span 3;","col-span-4":"grid-column:span 4 / span 4;","col-span-5":"grid-column:span 5 / span 5;","col-span-6":"grid-column:span 6 / span 6;","col-span-12":"grid-column:span 12 / span 12;","row-span-1":"grid-row:span 1 / span 1;","row-span-2":"grid-row:span 2 / span 2;","row-span-3":"grid-row:span 3 / span 3;","row-span-4":"grid-row:span 4 / span 4;","row-span-6":"grid-row:span 6 / span 6;","row-span-12":"grid-row:span 12 / span 12;",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;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;",rounded:"border-radius:0.25rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-full":"border-radius:9999px;","ring-0":"box-shadow:none;","ring-1":"box-shadow:0 0 0 1px rgba(59,130,246,0.5);","ring-2":"box-shadow:0 0 0 2px rgba(59,130,246,0.5);","ring-4":"box-shadow:0 0 0 4px rgba(59,130,246,0.5);","ring-8":"box-shadow:0 0 0 8px rgba(59,130,246,0.5);","shadow-none":"box-shadow:0 0 #0000;","shadow-xs":"box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);","shadow-sm":"box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);","shadow-md":"box-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);","shadow-lg":"box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);","shadow-xl":"box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);","shadow-2xl":"box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",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-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;"},Ve="var(--spacing, 0.25rem)",ue={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"]},Je={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${e}:hover{${t}}`,focus:(e,t)=>`${e}:focus{${t}}`,active:(e,t)=>`${e}:active{${t}}`,disabled:(e,t)=>`${e}:disabled{${t}}`,visited:(e,t)=>`${e}:visited{${t}}`,checked:(e,t)=>`${e}:checked{${t}}`,first:(e,t)=>`${e}:first-child{${t}}`,last:(e,t)=>`${e}:last-child{${t}}`,odd:(e,t)=>`${e}:nth-child(odd){${t}}`,even:(e,t)=>`${e}:nth-child(even){${t}}`,"focus-within":(e,t)=>`${e}:focus-within{${t}}`,"focus-visible":(e,t)=>`${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}}`},de={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)"},Z=["sm","md","lg","xl","2xl"];function X(e){const t=e.startsWith("-"),n=(t?e.slice(1):e).split("-");if(n.length<2)return null;const o=n.slice(0,-1).join("-"),s=n[n.length-1],i=parseFloat(s);if(Number.isNaN(i)||!ue[o])return null;const a=t?"-":"";return ue[o].map(c=>`${c}:calc(${a}${Ve} * ${i});`).join("")}function pe(e){const t=e.replace("#",""),r=parseInt(t,16),n=r>>16&255,o=r>>8&255,s=r&255;return`${n} ${o} ${s}`}function Qe(e){const t=/^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,n,o="DEFAULT"]=t,s=Ue[n]?.[o];return s?`${{bg:"background-color",text:"color",border:"border-color",shadow:"box-shadow",outline:"outline-color",caret:"caret-color",accent:"accent-color"}[r]}:${s};`:null}function Ze(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 Y(e){const{base:t,opacity:r}=Ze(e),n=Qe(t);if(n){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const i=pe(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return n}const o=U(t);if(o&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(o);if(s){const i=pe(s[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return o}function U(e){const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const n=e.slice(0,t);let o=e.slice(t+2,-1);o=o.replace(/_/g," ");const i={bg:"background-color",text:"color",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",shadow:"box-shadow",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",delay:"transition-delay",weight:"font-weight",leading:"line-height",z:"z-index"}[n]??n.replace(/_/g,"-");if(i&&o)return`${i}:${o};`}return null}function Xe(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Ye(e){const t=/class\s*=\s*["']([^"']+)["']/g,r=[];let n;for(;n=t.exec(e);){let o="",s=!1;for(const i of n[1])i==="["&&(s=!0),i==="]"&&(s=!1),i===" "&&!s?(o&&r.push(o),o=""):o+=i;o&&r.push(o)}return r.filter(Boolean)}const he=new Map,Ge=16;function et(e){const t=Date.now(),r=he.get(e);if(r&&t-r.timestamp<Ge)return r.css;const n=Ye(e),o=new Set(n),s=[],i=[],a=[],c=[],f={};function g(y,b=!1){const h=(b?"dark|":"")+y;if(h in f)return f[h];const l=u(y,b);return f[h]=l,l}function d(y){const b=y.some(l=>Z.includes(l)),h=y.includes("dark");return y.length===0?1:!b&&!h?2:b&&!h?3:4}function u(y,b=!1){const h=y.split(":"),l=h.find(S=>Q[S]||X(S)||Y(S)||U(S));if(!l)return null;const p=Q[l]??X(l)??Y(l)??U(l);if(!p)return null;let m=`.${Xe(y)}`,x=p;const k=h.indexOf(l);let $=k>=0?h.slice(0,k):[];b&&($=$.filter(S=>S!=="dark"));const C=$.filter(S=>Z.includes(S)),_=C.length?C[C.length-1]:null;for(const S of $){if(Z.includes(S))continue;const A=Je[S];typeof A=="function"&&(m=A(m,x).replace(/\{.*$/,""))}let w=`${m}{${x}}`;return b&&_?w=`@media (prefers-color-scheme: dark) and ${de[_]}{${w}}`:b?w=`@media (prefers-color-scheme: dark){${w}}`:_&&(w=`@media ${de[_]}{${w}}`),w}for(const y of o){const b=y.split(":"),h=b.find(x=>Q[x]||X(x)||Y(x)||U(x));if(!h)continue;const l=b.indexOf(h),p=l>=0?b.slice(0,l):[],m=d(p);if(m===4){const x=g(y,!0);x&&c.push(x)}else{const x=g(y);x&&(m===1?s.push(x):m===2?i.push(x):m===3&&a.push(x))}}const v=[...s,...i,...a,...c].join("");return he.set(e,{css:v,timestamp:t}),v}function tt(e,t,r,n,o,s,i,a){if(!e)return;if(t.loadingTemplate&&r.isLoading){P(e,t.loadingTemplate(r),r,n,o);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&P(e,t.errorTemplate(r.error,r),r,n,o);return}const c=t.render(r);if(c instanceof Promise){s(!0),c.then(f=>{s(!1),i(null),P(e,f,r,n,o),a(e.innerHTML)}).catch(f=>{s(!1),i(f),t.errorTemplate&&P(e,t.errorTemplate(f,r),r,n,o)}),t.loadingTemplate&&P(e,t.loadingTemplate(r),r,n,o);return}P(e,c,r,n,o),a(e.innerHTML)}function P(e,t,r,n,o){e&&(Ie(e,Array.isArray(t)?t:[t],r,n),o(e.innerHTML))}function rt(e,t,r,n,o,s,i){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(o(r+1),r>10){console.warn("Potential infinite render loop detected. Skipping render."),i(null);return}}else o(0);const c=setTimeout(()=>{n(Date.now()),e(),i(null)},0);i(c)}function nt(e,t,r,n,o,s){if(!e)return;const i=et(n);if(!t.style&&(!i||i.trim()==="")){s(null),e.adoptedStyleSheets=[fe()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let c=Fe(`${a}
|
|
60
60
|
${i}
|
|
61
|
-
`);l=me(l);let f=o;f||(f=new CSSStyleSheet),(f.cssRules.length===0||f.toString()!==l)&&f.replaceSync(l),e.adoptedStyleSheets=[ce(),f],s(f)}const ot=new Map;function oe(e,t,r){let n=ie(e);n.includes("-")||(n=`cer-${n}`);let o;typeof t=="function"?o={...r,render:t}:o=t,typeof o.onError!="function"&&(o.onError=(s,i)=>{console.error(`[${n}] Error:`,s,i)}),ot.set(n,o),typeof window<"u"&&!customElements.get(n)&&customElements.define(n,it(o))}function it(e){if(!e.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;_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=e;const t=this._initContext(e);Object.defineProperty(t,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(t,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),this.context=t,this._applyProps(e),Object.defineProperty(this.context,"emit",{value:(r,n,o)=>{this.dispatchEvent(new CustomEvent(r,{detail:n,bubbles:!0,composed:!0,...o||{}}));const s=`on${r.charAt(0).toUpperCase()}${r.slice(1)}`,i=typeof this[s]=="function"?this[s]:void 0,a=typeof this.context[s]=="function"?this.context[s]:void 0,l=typeof e[s]=="function"?e[s]:void 0;i&&i(n,this.context),a&&a!==i&&a(n,this.context),l&&l!==i&&l!==a&&l(n,this.context)},writable:!1,enumerable:!1,configurable:!1}),Object.keys(e).forEach(r=>{const n=e[r];if(typeof n=="function"&&!r.startsWith("on"))this.context[r]=(...o)=>n(...o,this.context);else if(r.startsWith("on")&&r.length>2&&r[2]===r[2].toUpperCase()){const o=r.slice(2,3).toLowerCase()+r.slice(3);this.addEventListener(o,s=>{const i=typeof this[r]=="function"?this[r]:this.context[r];typeof i=="function"&&i(s.detail,this.context)})}}),this._applyComputed(e),this._initializing=!1,this._initWatchers(e),this._render(e)}connectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{Be(e,this.context,this._mounted,t=>{this._mounted=t})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{ze(e,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},t=>{this._templateLoading=t},t=>{this._templateError=t},t=>{this._mounted=t})})}attributeChangedCallback(t,r,n){this._runLogicWithinErrorBoundary(e,()=>{this._applyProps(e),Me(e,t,r,n,this.context)})}static get observedAttributes(){return e.props?Object.keys(e.props).map(ie):[]}_applyComputed(t){this._runLogicWithinErrorBoundary(e,()=>{t.computed&&Object.entries(t.computed).forEach(([r,n])=>{Object.defineProperty(this.context,r,{get:()=>{const o=n(this.context);return te(o)},enumerable:!0})})})}_render(t){this._runLogicWithinErrorBoundary(t,()=>{tt(this.shadowRoot,t,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(t,r))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{rt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,t=>{this._lastRenderTime=t},t=>{this._renderCount=t},this._renderTimeoutId,t=>{this._renderTimeoutId=t})})}_applyStyle(t,r){this._runLogicWithinErrorBoundary(t,()=>{nt(this.shadowRoot,t,this.context,r,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(t,r){this._hasError&&(this._hasError=!1);try{r()}catch(n){this._hasError=!0,t.onError&&t.onError(n,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(n,this.context))}}_initContext(t){try{let r=function(o,s=""){return Array.isArray(o)?new Proxy(o,{get(i,a,l){const f=Reflect.get(i,a,l);return typeof f=="function"&&typeof a=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(a)?function(...d){const u=f.apply(i,d);if(!n._initializing){const m=s||"root";n._triggerWatchers(m,i),n._render(t)}return u}:f},set(i,a,l){if(i[a]=l,!n._initializing){const f=s?`${s}.${String(a)}`:String(a);n._triggerWatchers(f,l),n._render(t)}return!0},deleteProperty(i,a){if(delete i[a],!n._initializing){const l=s?`${s}.${String(a)}`:String(a);n._triggerWatchers(l,void 0),n._render(t)}return!0}}):o&&typeof o=="object"?(Object.keys(o).forEach(i=>{const a=s?`${s}.${i}`:i;o[i]=r(o[i],a)}),new Proxy(o,{set(i,a,l){const f=s?`${s}.${String(a)}`:String(a);return i[a]=r(l,f),n._initializing||(n._triggerWatchers(f,i[a]),n._render(t)),!0},get(i,a,l){return Reflect.get(i,a,l)}})):o};const n=this;return r({...t.state})}catch{return{}}}_initWatchers(t){this._runLogicWithinErrorBoundary(t,()=>{je(this.context,this._watchers,t.watch||{})})}_triggerWatchers(t,r){Le(this.context,this._watchers,t,r)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{try{Re(this,t,this.context)}catch(r){this._hasError=!0,t.onError&&t.onError(r,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(r,this.context))}})}}}function F(e,t={},r,n){const o=n??t.key;return{tag:e,key:o,props:t,children:r}}function U(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function P(e){return typeof e=="object"&&e!==null&&"tag"in e&&!U(e)}function st(e,t){return e.key!=null?e:{...e,key:t}}function at(e,t=[],r={}){const n={},o={},s={},i=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let a;for(;a=i.exec(e);){const l=a[1],f=a[2],p=(a[4]||a[6])??"",d=p.match(/^{{(\d+)}}$/);let u=d?t[Number(d[1])]??null:p;if(d||(u==="true"?u=!0:u==="false"?u=!1:u==="null"?u=null:isNaN(Number(u))||(u=Number(u))),l===":")typeof u=="boolean"?o[f]=u:u!=null&&(n[f]=u);else if(l==="@"){const m="on"+f.charAt(0).toUpperCase()+f.slice(1);n[m]=typeof u=="function"?u:typeof r[u]=="function"?r[u]:void 0}else if(l==="#"){const[m,...h]=f.split("."),C=[...h];let y=u,c=[...C];if(m==="model"&&typeof y=="string"&&y.includes(".")){const b=["trim","number","lazy"],g=y.split(".");let v=y;const w=[];for(let k=g.length-1;k>0&&b.includes(g[k]);k--)w.unshift(g[k]),v=g.slice(0,k).join(".");y=v,c.push(...w)}s[m]={value:y,modifiers:c}}else f==="ref"?n.ref=u:o[f]=u}return{props:n,attrs:o,directives:s}}function lt(e,t,r){function n(c,b){return F("#text",{},c,b)}let o="";for(let c=0;c<e.length;c++)o+=e[c],c<t.length&&(o+=`{{${c}}}`);const s=/<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g,i=[];let a=null,l,f=[],p=null,d={},u,m=0,h=[];function C(c){!c||typeof c!="object"||U(c)||(c.props||c.attrs?(c.props&&(d.props||(d.props={}),Object.assign(d.props,c.props)),c.attrs&&(d.attrs||(d.attrs={}),Object.keys(c.attrs).forEach(b=>{if(b==="style"&&d.attrs.style){const g=d.attrs.style.replace(/;?\s*$/,""),v=c.attrs.style.replace(/^;?\s*/,"");d.attrs.style=g+"; "+v}else if(b==="class"&&d.attrs.class){const g=d.attrs.class.trim().split(/\s+/).filter(Boolean),v=c.attrs.class.trim().split(/\s+/).filter(Boolean),w=[...new Set([...g,...v])];d.attrs.class=w.join(" ")}else d.attrs[b]=c.attrs[b]}))):(d.props||(d.props={}),Object.assign(d.props,c)))}function y(c,b){const g=p?f:h;if(U(c)){const v=c.key??b;let w=c.children;g.push({...c,key:v,children:w});return}if(P(c)){g.push(st(c,void 0));return}if(Array.isArray(c)){if(c.length===0)return;for(let v=0;v<c.length;v++){const w=c[v];U(w)||P(w)||Array.isArray(w)?y(w,`${b}-${v}`):w!==null&&typeof w=="object"?C(w):g.push(n(String(w),`${b}-${v}`))}return}if(c!==null&&typeof c=="object"){C(c);return}g.push(n(String(c),b))}for(;l=s.exec(o);)if(l[1]){const c=l[1],b=l[0][1]==="/",g=l[0][l[0].length-2]==="/",{props:v,attrs:w,directives:k}=at(l[2]||"",t,r),S={props:{},attrs:{}};for(const x in v)S.props[x]=v[x];for(const x in w)S.attrs[x]=w[x];for(const[x,$]of Object.entries(k))if(x==="bind")if(typeof $.value=="object"&&$.value!==null)for(const[A,E]of Object.entries($.value))typeof E=="boolean"?S.attrs[A]=E:E!=null&&(S.attrs[A]=String(E));else $.value!=null&&(S.attrs[x]=String($.value));else if(x==="show"){const A=!!$.value;S.attrs.style=(S.attrs.style||"")+(A?"":"; display: none !important")}else if(x==="class"){const A=$.value;let E=[];if(typeof A=="string")E=A.split(/\s+/).filter(Boolean);else if(Array.isArray(A)){for(const j of A)if(typeof j=="string")E.push(...j.split(/\s+/).filter(Boolean));else if(j&&typeof j=="object")for(const[L,I]of Object.entries(j))I&&E.push(...L.split(/\s+/).filter(Boolean))}else if(A&&typeof A=="object")for(const[j,L]of Object.entries(A))L&&E.push(...j.split(/\s+/).filter(Boolean));const D=S.attrs.class||"",H=[...new Set([...D.split(/\s+/).filter(Boolean),...E])];S.attrs.class=H.join(" ")}else if(x==="style"){const A=$.value;let E="";if(typeof A=="string")E=A;else if(A&&typeof A=="object"){const H=[];for(const[j,L]of Object.entries(A))if(L!=null&&L!==""){const I=j.replace(/[A-Z]/g,we=>`-${we.toLowerCase()}`),xe=["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 ae=String(L);typeof L=="number"&&xe.includes(I)&&(ae=`${L}px`),H.push(`${I}: ${ae}`)}E=H.join("; ")+(H.length>0?";":"")}const D=S.attrs.style||"";S.attrs.style=D+(D&&!D.endsWith(";")?"; ":"")+E}const _={};for(const[x,$]of Object.entries(k))["bind","show","class","style"].includes(x)||(_[x]=$);if(Object.keys(_).length>0&&(S.directives=_),b){const x=F(p,d,f.length===1&&P(f[0])&&f[0].tag==="#text"?typeof f[0].children=="string"?f[0].children:"":f.length?f:void 0,u),$=i.pop();$?(p=$.tag,d=$.props,u=$.key,f=$.children,f.push(x)):a=x}else g?(p?f:h).push(F(c,S,void 0,void 0)):(p&&i.push({tag:p,props:d,children:f,key:u}),p=c,d=S,f=[])}else if(typeof l[3]<"u"){const c=Number(l[3]),b=t[c],g=`interp-${c}`;y(b,g)}else if(l[4]){const c=l[4],b=p?f:h,g=c.split(/({{\d+}})/);for(const v of g){if(!v)continue;const w=v.match(/^{{(\d+)}}$/);if(w){const k=Number(w[1]),S=t[k],_=`interp-${k}`;y(S,_)}else{const k=`text-${m++}`;b.push(n(v,k))}}}if(a)return P(a)&&Array.isArray(a.children)&&(a.children=a.children.filter(c=>P(c)?c.tag!=="#text"||typeof c.children=="string"&&c.children.trim()!=="":!0)),a;if(h.length>0){const c=h.filter(b=>P(b)?b.tag!=="#text"||typeof b.children=="string"&&b.children.trim()!=="":!0);return c.length===1?c[0]:c}return F("div",{},"","fallback-root")}function R(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return lt(e,t,n)}const ye=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},O=(e,t)=>{for(const r of e){const n=[],o=r.path.replace(/:[^/]+/g,a=>(n.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${o}$`),i=t.match(s);if(i){const a={};return n.forEach((l,f)=>{a[l]=i[f+1]}),{route:r,params:a}}}return{route:null,params:{}}},G={};async function be(e){if(e.component)return e.component;if(e.load){if(G[e.path])return G[e.path];try{const t=await e.load();return G[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 ve(e){const{routes:t,base:r=""}=e;let n,o,s,i,a,l,f;if(typeof window<"u"&&typeof document<"u"){n=()=>{const d=new URL(window.location.href),u=d.pathname.replace(r,"")||"/",m=ye(d.search);return{path:u,query:m}},o=n();const p=O(t,o.path);s=ee({path:o.path,params:p.params,query:o.query}),i=()=>{const d=n(),u=O(t,d.path),m=s.getState();m.path=d.path,m.params=u.params,m.query=d.query},window.addEventListener("popstate",i),a=d=>{window.history.pushState({},"",r+d),i()},l=d=>{window.history.replaceState({},"",r+d),i()},f=()=>window.history.back()}else{n=()=>({path:"/",query:{}}),o=n();const p=O(t,o.path);s=ee({path:o.path,params:p.params,query:o.query}),i=()=>{},a=()=>{},l=()=>{},f=()=>{}}return{store:s,push:a,replace:l,back:f,subscribe:s.subscribe,matchRoute:p=>O(t,p),getCurrent:()=>s.getState(),resolveRouteComponent:be}}function ct(e,t){return O(e,t)}function ft(e){const t=ve(e);return oe("router-view",{async render(){if(!t)return R`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:n}=r,o=t.matchRoute(n);if(!o.route)return R`<div>Not found</div>`;let s=o.route.component;if(o.route.load){const i=await o.route.load();typeof i.default=="string"&&(s=i.default)}return typeof s=="string"?R`<${s}></${s}>`:R`<div>Invalid route component</div>`},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),oe("router-link",{state:{},props:{to:{type:String,default:""},tag:{type:String,default:"a"},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},activeClass:{type:String,default:"active"},exactActiveClass:{type:String,default:"exact-active"},ariaCurrentValue:{type:String,default:"page"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},style:{type:String,default:se`
|
|
61
|
+
`);c=me(c);let f=o;f||(f=new CSSStyleSheet),(f.cssRules.length===0||f.toString()!==c)&&f.replaceSync(c),e.adoptedStyleSheets=[fe(),f],s(f)}const ot=new Map;function oe(e,t,r){let n=se(e);n.includes("-")||(n=`cer-${n}`);let o;typeof t=="function"?o={...r,render:t}:o=t,typeof o.onError!="function"&&(o.onError=(s,i)=>{console.error(`[${n}] Error:`,s,i)}),ot.set(n,o),typeof window<"u"&&!customElements.get(n)&&customElements.define(n,it(o))}function it(e){if(!e.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;_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=e;const t=this._initContext(e);Object.defineProperty(t,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(t,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),this.context=t,this._applyProps(e),Object.defineProperty(this.context,"emit",{value:(r,n,o)=>{this.dispatchEvent(new CustomEvent(r,{detail:n,bubbles:!0,composed:!0,...o||{}}));const s=`on${r.charAt(0).toUpperCase()}${r.slice(1)}`,i=typeof this[s]=="function"?this[s]:void 0,a=typeof this.context[s]=="function"?this.context[s]:void 0,c=typeof e[s]=="function"?e[s]:void 0;i&&i(n,this.context),a&&a!==i&&a(n,this.context),c&&c!==i&&c!==a&&c(n,this.context)},writable:!1,enumerable:!1,configurable:!1}),Object.keys(e).forEach(r=>{const n=e[r];if(typeof n=="function"&&!r.startsWith("on"))this.context[r]=(...o)=>n(...o,this.context);else if(r.startsWith("on")&&r.length>2&&r[2]===r[2].toUpperCase()){const o=r.slice(2,3).toLowerCase()+r.slice(3);this.addEventListener(o,s=>{const i=typeof this[r]=="function"?this[r]:this.context[r];typeof i=="function"&&i(s.detail,this.context)})}}),this._applyComputed(e),this._initializing=!1,this._initWatchers(e),this._render(e)}connectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{Re(e,this.context,this._mounted,t=>{this._mounted=t})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{ze(e,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},t=>{this._templateLoading=t},t=>{this._templateError=t},t=>{this._mounted=t})})}attributeChangedCallback(t,r,n){this._runLogicWithinErrorBoundary(e,()=>{this._applyProps(e),Ne(e,t,r,n,this.context)})}static get observedAttributes(){return e.props?Object.keys(e.props).map(se):[]}_applyComputed(t){this._runLogicWithinErrorBoundary(e,()=>{t.computed&&Object.entries(t.computed).forEach(([r,n])=>{Object.defineProperty(this.context,r,{get:()=>{const o=n(this.context);return te(o)},enumerable:!0})})})}_render(t){this._runLogicWithinErrorBoundary(t,()=>{tt(this.shadowRoot,t,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(t,r))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{rt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,t=>{this._lastRenderTime=t},t=>{this._renderCount=t},this._renderTimeoutId,t=>{this._renderTimeoutId=t})})}_applyStyle(t,r){this._runLogicWithinErrorBoundary(t,()=>{nt(this.shadowRoot,t,this.context,r,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(t,r){this._hasError&&(this._hasError=!1);try{r()}catch(n){this._hasError=!0,t.onError&&t.onError(n,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(n,this.context))}}_initContext(t){try{let r=function(o,s=""){return Array.isArray(o)?new Proxy(o,{get(i,a,c){const f=Reflect.get(i,a,c);return typeof f=="function"&&typeof a=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(a)?function(...d){const u=f.apply(i,d);if(!n._initializing){const v=s||"root";n._triggerWatchers(v,i),n._render(t)}return u}:f},set(i,a,c){if(i[a]=c,!n._initializing){const f=s?`${s}.${String(a)}`:String(a);n._triggerWatchers(f,c),n._render(t)}return!0},deleteProperty(i,a){if(delete i[a],!n._initializing){const c=s?`${s}.${String(a)}`:String(a);n._triggerWatchers(c,void 0),n._render(t)}return!0}}):o&&typeof o=="object"?(Object.keys(o).forEach(i=>{const a=s?`${s}.${i}`:i;o[i]=r(o[i],a)}),new Proxy(o,{set(i,a,c){const f=s?`${s}.${String(a)}`:String(a);return i[a]=r(c,f),n._initializing||(n._triggerWatchers(f,i[a]),n._render(t)),!0},get(i,a,c){return Reflect.get(i,a,c)}})):o};const n=this;return r({...t.state})}catch{return{}}}_initWatchers(t){this._runLogicWithinErrorBoundary(t,()=>{je(this.context,this._watchers,t.watch||{})})}_triggerWatchers(t,r){Le(this.context,this._watchers,t,r)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{try{Be(this,t,this.context)}catch(r){this._hasError=!0,t.onError&&t.onError(r,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(r,this.context))}})}}}function F(e,t={},r,n){const o=n??t.key;return{tag:e,key:o,props:t,children:r}}function V(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function O(e){return typeof e=="object"&&e!==null&&"tag"in e&&!V(e)}function st(e,t){return e.key!=null?e:{...e,key:t}}function at(e,t=[],r={}){const n={},o={},s={},i=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let a;for(;a=i.exec(e);){const c=a[1],f=a[2],g=(a[4]||a[6])??"",d=g.match(/^{{(\d+)}}$/);let u=d?t[Number(d[1])]??null:g;if(d||(u==="true"?u=!0:u==="false"?u=!1:u==="null"?u=null:isNaN(Number(u))||(u=Number(u))),c===":")typeof u=="boolean"?o[f]=u:u!=null&&(n[f]=u);else if(c==="@"){const v="on"+f.charAt(0).toUpperCase()+f.slice(1);n[v]=typeof u=="function"?u:typeof r[u]=="function"?r[u]:void 0}else if(c==="#"){const[v,...y]=f.split("."),b=[...y];let h=u,l=[...b];if(v==="model"&&typeof h=="string"&&h.includes(".")){const p=["trim","number","lazy"],m=h.split(".");let x=h;const k=[];for(let $=m.length-1;$>0&&p.includes(m[$]);$--)k.unshift(m[$]),x=m.slice(0,$).join(".");h=x,l.push(...k)}s[v]={value:h,modifiers:l}}else f==="ref"?n.ref=u:o[f]=u}return{props:n,attrs:o,directives:s}}function lt(e,t,r){function n(l,p){return F("#text",{},l,p)}let o="";for(let l=0;l<e.length;l++)o+=e[l],l<t.length&&(o+=`{{${l}}}`);const s=/<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g,i=[];let a=null,c,f=[],g=null,d={},u,v=0,y=[];function b(l){!l||typeof l!="object"||V(l)||(l.props||l.attrs?(l.props&&(d.props||(d.props={}),Object.assign(d.props,l.props)),l.attrs&&(d.attrs||(d.attrs={}),Object.keys(l.attrs).forEach(p=>{if(p==="style"&&d.attrs.style){const m=d.attrs.style.replace(/;?\s*$/,""),x=l.attrs.style.replace(/^;?\s*/,"");d.attrs.style=m+"; "+x}else if(p==="class"&&d.attrs.class){const m=d.attrs.class.trim().split(/\s+/).filter(Boolean),x=l.attrs.class.trim().split(/\s+/).filter(Boolean),k=[...new Set([...m,...x])];d.attrs.class=k.join(" ")}else d.attrs[p]=l.attrs[p]}))):(d.props||(d.props={}),Object.assign(d.props,l)))}function h(l,p){const m=g?f:y;if(V(l)){const x=l.key??p;let k=l.children;m.push({...l,key:x,children:k});return}if(O(l)){m.push(st(l,void 0));return}if(Array.isArray(l)){if(l.length===0)return;for(let x=0;x<l.length;x++){const k=l[x];V(k)||O(k)||Array.isArray(k)?h(k,`${p}-${x}`):k!==null&&typeof k=="object"?b(k):m.push(n(String(k),`${p}-${x}`))}return}if(l!==null&&typeof l=="object"){b(l);return}m.push(n(String(l),p))}for(;c=s.exec(o);)if(c[1]){const l=c[1],p=c[0][1]==="/",m=c[0][c[0].length-2]==="/",{props:x,attrs:k,directives:$}=at(c[2]||"",t,r),C={props:{},attrs:{}};for(const w in x)C.props[w]=x[w];for(const w in k)C.attrs[w]=k[w];for(const[w,S]of Object.entries($))if(w==="bind")if(typeof S.value=="object"&&S.value!==null)for(const[A,E]of Object.entries(S.value))typeof E=="boolean"?C.attrs[A]=E:E!=null&&(C.attrs[A]=String(E));else S.value!=null&&(C.attrs[w]=String(S.value));else if(w==="show"){const A=!!S.value;C.attrs.style=(C.attrs.style||"")+(A?"":"; display: none !important")}else if(w==="class"){const A=S.value;let E=[];if(typeof A=="string")E=A.split(/\s+/).filter(Boolean);else if(Array.isArray(A)){for(const j of A)if(typeof j=="string")E.push(...j.split(/\s+/).filter(Boolean));else if(j&&typeof j=="object")for(const[L,q]of Object.entries(j))q&&E.push(...L.split(/\s+/).filter(Boolean))}else if(A&&typeof A=="object")for(const[j,L]of Object.entries(A))L&&E.push(...j.split(/\s+/).filter(Boolean));const D=C.attrs.class||"",H=[...new Set([...D.split(/\s+/).filter(Boolean),...E])];C.attrs.class=H.join(" ")}else if(w==="style"){const A=S.value;let E="";if(typeof A=="string")E=A;else if(A&&typeof A=="object"){const H=[];for(const[j,L]of Object.entries(A))if(L!=null&&L!==""){const q=j.replace(/[A-Z]/g,we=>`-${we.toLowerCase()}`),xe=["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 le=String(L);typeof L=="number"&&xe.includes(q)&&(le=`${L}px`),H.push(`${q}: ${le}`)}E=H.join("; ")+(H.length>0?";":"")}const D=C.attrs.style||"";C.attrs.style=D+(D&&!D.endsWith(";")?"; ":"")+E}const _={};for(const[w,S]of Object.entries($))["bind","show","class","style"].includes(w)||(_[w]=S);if(Object.keys(_).length>0&&(C.directives=_),p){const w=F(g,d,f.length===1&&O(f[0])&&f[0].tag==="#text"?typeof f[0].children=="string"?f[0].children:"":f.length?f:void 0,u),S=i.pop();S?(g=S.tag,d=S.props,u=S.key,f=S.children,f.push(w)):a=w}else m?(g?f:y).push(F(l,C,void 0,void 0)):(g&&i.push({tag:g,props:d,children:f,key:u}),g=l,d=C,f=[])}else if(typeof c[3]<"u"){const l=Number(c[3]),p=t[l],m=`interp-${l}`;h(p,m)}else if(c[4]){const l=c[4],p=g?f:y,m=l.split(/({{\d+}})/);for(const x of m){if(!x)continue;const k=x.match(/^{{(\d+)}}$/);if(k){const $=Number(k[1]),C=t[$],_=`interp-${$}`;h(C,_)}else{const $=`text-${v++}`;p.push(n(x,$))}}}if(a)return O(a)&&Array.isArray(a.children)&&(a.children=a.children.filter(l=>O(l)?l.tag!=="#text"||typeof l.children=="string"&&l.children.trim()!=="":!0)),a;if(y.length>0){const l=y.filter(p=>O(p)?p.tag!=="#text"||typeof p.children=="string"&&p.children.trim()!=="":!0);return l.length===1?l[0]:l}return F("div",{},"","fallback-root")}function R(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return lt(e,t,n)}const ie=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},B=(e,t)=>{for(const r of e){const n=[],o=r.path.replace(/:[^/]+/g,a=>(n.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${o}$`),i=t.match(s);if(i){const a={};return n.forEach((c,f)=>{a[c]=i[f+1]}),{route:r,params:a}}}return{route:null,params:{}}},G={};async function be(e){if(e.component)return e.component;if(e.load){if(G[e.path])return G[e.path];try{const t=await e.load();return G[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 ve(e){const{routes:t,base:r="",initialUrl:n}=e;let o,s,i,a,c,f,g;const d=async(b,h)=>{const l=t.find(p=>B([p],b.path).route!==null);if(l?.beforeEnter)try{const p=await l.beforeEnter(b,h);return typeof p=="string"?(await y(p,!0),!1):p!==!1}catch(p){return console.error("beforeEnter error",p),!1}return!0},u=async(b,h)=>{const l=t.find(p=>B([p],b.path).route!==null);if(l?.onEnter)try{const p=await l.onEnter(b,h);return typeof p=="string"?(await y(p,!0),!1):p!==!1}catch(p){return console.error("onEnter error",p),!1}return!0},v=(b,h)=>{const l=t.find(p=>B([p],b.path).route!==null);if(l?.afterEnter)try{l.afterEnter(b,h)}catch(p){console.error("afterEnter error",p)}},y=async(b,h=!1)=>{try{const l={path:b.replace(r,"")||"/",query:{}},p=B(t,l.path);if(!p)throw new Error(`No route found for ${l.path}`);const m=i.getState(),x={path:l.path,params:p.params,query:l.query};if(!await d(x,m)||!await u(x,m))return;typeof window<"u"&&typeof document<"u"&&(h?window.history.replaceState({},"",r+b):window.history.pushState({},"",r+b)),i.setState(x),v(x,m)}catch(l){console.error("Navigation error:",l)}};if(typeof window<"u"&&typeof document<"u"){o=()=>{const h=new URL(window.location.href),l=h.pathname.replace(r,"")||"/",p=ie(h.search);return{path:l,query:p}},s=o();const b=B(t,s.path);i=ee({path:s.path,params:b.params,query:s.query}),a=async(h=!1)=>{const l=o();await y(l.path,h)},window.addEventListener("popstate",()=>a(!0)),c=h=>y(h,!1),f=h=>y(h,!0),g=()=>window.history.back()}else{o=()=>{const h=new URL(n||"/","http://localhost"),l=h.pathname.replace(r,"")||"/",p=ie(h.search);return{path:l,query:p}},s=o();const b=B(t,s.path);i=ee({path:s.path,params:b.params,query:s.query}),a=async()=>{},c=async()=>{},f=async()=>{},g=()=>{}}return{store:i,push:c,replace:f,back:g,subscribe:i.subscribe,matchRoute:b=>B(t,b),getCurrent:()=>i.getState(),resolveRouteComponent:be}}function ct(e,t){return B(e,t)}function ft(e){const t=ve(e);return oe("router-view",{async render(){if(!t)return R`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:n}=r,o=t.matchRoute(n);if(!o.route)return R`<div>Not found</div>`;let s=o.route.component;if(o.route.load){const i=await o.route.load();typeof i.default=="string"&&(s=i.default)}return typeof s=="string"?R`<${s}></${s}>`:R`<div>Invalid route component</div>`},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),oe("router-link",{state:{},props:{to:{type:String,default:""},tag:{type:String,default:"a"},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},activeClass:{type:String,default:"active"},exactActiveClass:{type:String,default:"exact-active"},ariaCurrentValue:{type:String,default:"page"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},style:{type:String,default:ae`
|
|
62
62
|
[aria-disabled="true"] {
|
|
63
63
|
pointer-events: none;
|
|
64
64
|
opacity: 0.5;
|
|
65
65
|
}
|
|
66
|
-
`}},style:r=>r.props.style,render:r=>{const n=t.getCurrent(),o=r.props.to,s=r.props.exact,i=r.props.exactActiveClass,a=r.props.activeClass,
|
|
67
|
-
${
|
|
66
|
+
`}},style:r=>r.props.style,render:r=>{const n=t.getCurrent(),o=r.props.to,s=r.props.exact,i=r.props.exactActiveClass,a=r.props.activeClass,c=r.props.ariaCurrentValue,f=r.props.tag,g=r.props.disabled,d=r.props.external,u=n.path===o,v=s?u:n&&typeof n.path=="string"?n.path.startsWith(o):!1,y=u?i:v?a:"",b=u?`aria-current="${c}"`:"",h=f==="button",l=g?h?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",p=d&&(f==="a"||!f)?'target="_blank" rel="noopener noreferrer"':"";return R`
|
|
67
|
+
${ge().when(h,R`
|
|
68
68
|
<button
|
|
69
69
|
part="button"
|
|
70
|
-
class="${
|
|
71
|
-
${C}
|
|
72
|
-
${c}
|
|
70
|
+
class="${y}"
|
|
73
71
|
${b}
|
|
72
|
+
${l}
|
|
73
|
+
${p}
|
|
74
74
|
data-on-click="navigate"
|
|
75
75
|
><slot></slot></button>
|
|
76
76
|
`).otherwise(R`
|
|
77
77
|
<a
|
|
78
78
|
part="link"
|
|
79
79
|
href="${o}"
|
|
80
|
-
class="${
|
|
81
|
-
${C}
|
|
82
|
-
${c}
|
|
80
|
+
class="${y}"
|
|
83
81
|
${b}
|
|
82
|
+
${l}
|
|
83
|
+
${p}
|
|
84
84
|
data-on-click="navigate"
|
|
85
85
|
><slot></slot></a>
|
|
86
86
|
`).done()}
|
|
87
|
-
`},navigate:(r,n)=>{const{disabled:o,external:s,tag:i,replace:a,to:
|
|
87
|
+
`},navigate:(r,n)=>{const{disabled:o,external:s,tag:i,replace:a,to:c}=n.props;if(o){r.preventDefault();return}s&&(i==="a"||!i)||(r.preventDefault(),a?t.replace(c):t.push(c))}}),t}exports.GlobalEventBus=z;exports.component=oe;exports.createStore=ee;exports.css=ae;exports.each=$e;exports.emit=Ce;exports.eventBus=W;exports.html=R;exports.initRouter=ft;exports.listen=Te;exports.match=ge;exports.matchRoute=B;exports.matchRouteSSR=ct;exports.off=Ae;exports.on=_e;exports.once=Ee;exports.parseQuery=ie;exports.resolveRouteComponent=be;exports.useRouter=ve;exports.when=ke;
|
|
88
88
|
//# sourceMappingURL=custom-elements-runtime.cjs.js.map
|