@jasonshimmy/custom-elements-runtime 0.1.1 → 0.1.2
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 +31 -97
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +540 -520
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +31 -97
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/style-utils.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,128 +1,62 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ce(e){let t=new Proxy(e,{set:(o,l,f)=>(o[l]=f,s(),!0)});const n=[];function r(o){n.push(o),o(t)}function i(){return t}function s(){n.forEach(o=>o(t))}return{subscribe:r,getState:i}}class B extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return B.instance||(B.instance=new B),B.instance}emit(t,n){const r=Date.now(),i=this.eventCounters.get(t);if(!i||r-i.window>1e3)this.eventCounters.set(t,{count:1,window:r});else if(i.count++,i.count>50&&(console.error(`Event storm detected for "${t}": ${i.count} events in 1 second. Throttling...`),i.count>100)){console.warn(`Blocking further "${t}" events to prevent infinite loop`);return}this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(n)}catch(l){console.error(`Error in global event handler for "${t}":`,l)}})}on(t,n){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(n),()=>this.off(t,n)}off(t,n){const r=this.handlers[t];r&&r.delete(n)}offAll(t){delete this.handlers[t]}listen(t,n,r){return this.addEventListener(t,n,r),()=>this.removeEventListener(t,n)}once(t,n){return new Promise(r=>{const i=this.on(t,s=>{i(),n(s),r(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[n,r]of this.eventCounters.entries())t[n]={count:r.count,handlersCount:this.getHandlerCount(n)};return t}resetEventCounters(){this.eventCounters.clear()}}const fe=B.getInstance();function P(e,t={},n,r){const i=r??t.key;return{tag:e,key:i,props:t,children:n}}function I(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function R(e){return typeof e=="object"&&e!==null&&"tag"in e&&!I(e)}function de(e,t){return e.key!=null?e:{...e,key:t}}function ue(e,t=[],n={}){const r={},i={},s={},o=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let l;for(;l=o.exec(e);){const f=l[1],u=l[2],p=(l[4]||l[6])??"",d=p.match(/^{{(\d+)}}$/);let c=d?t[Number(d[1])]??null:p;if(d||(c==="true"?c=!0:c==="false"?c=!1:c==="null"?c=null:isNaN(Number(c))||(c=Number(c))),f===":")typeof c=="boolean"?i[u]=c:c!=null&&(r[u]=c);else if(f==="@"){const y="on"+u.charAt(0).toUpperCase()+u.slice(1);r[y]=typeof c=="function"?c:typeof n[c]=="function"?n[c]:void 0}else if(f==="#"){const[y,...h]=u.split("."),S=[...h];let m=c,a=[...S];if(y==="model"&&typeof m=="string"&&m.includes(".")){const b=["trim","number","lazy"],g=m.split(".");let x=m;const w=[];for(let k=g.length-1;k>0&&b.includes(g[k]);k--)w.unshift(g[k]),x=g.slice(0,k).join(".");m=x,a.push(...w)}s[y]={value:m,modifiers:a}}else u==="ref"?r.ref=c:i[u]=c}return{props:r,attrs:i,directives:s}}function pe(e,t,n){function r(a,b){return P("#text",{},a,b)}let i="";for(let a=0;a<e.length;a++)i+=e[a],a<t.length&&(i+=`{{${a}}}`);const s=/<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g,o=[];let l=null,f,u=[],p=null,d={},c,y=0,h=[];function S(a){!a||typeof a!="object"||I(a)||(a.props||a.attrs?(a.props&&(d.props||(d.props={}),Object.assign(d.props,a.props)),a.attrs&&(d.attrs||(d.attrs={}),Object.keys(a.attrs).forEach(b=>{if(b==="style"&&d.attrs.style){const g=d.attrs.style.replace(/;?\s*$/,""),x=a.attrs.style.replace(/^;?\s*/,"");d.attrs.style=g+"; "+x}else if(b==="class"&&d.attrs.class){const g=d.attrs.class.trim().split(/\s+/).filter(Boolean),x=a.attrs.class.trim().split(/\s+/).filter(Boolean),w=[...new Set([...g,...x])];d.attrs.class=w.join(" ")}else d.attrs[b]=a.attrs[b]}))):(d.props||(d.props={}),Object.assign(d.props,a)))}function m(a,b){const g=p?u:h;if(I(a)){const x=a.key??b;let w=a.children;g.push({...a,key:x,children:w});return}if(R(a)){g.push(de(a,void 0));return}if(Array.isArray(a)){if(a.length===0)return;for(let x=0;x<a.length;x++){const w=a[x];I(w)||R(w)||Array.isArray(w)?m(w,`${b}-${x}`):w!==null&&typeof w=="object"?S(w):g.push(r(String(w),`${b}-${x}`))}return}if(a!==null&&typeof a=="object"){S(a);return}g.push(r(String(a),b))}for(;f=s.exec(i);)if(f[1]){const a=f[1],b=f[0][1]==="/",g=f[0][f[0].length-2]==="/",{props:x,attrs:w,directives:k}=ue(f[2]||"",t,n),$={props:{},attrs:{}};for(const v in x)$.props[v]=x[v];for(const v in w)$.attrs[v]=w[v];for(const[v,_]of Object.entries(k))if(v==="bind")if(typeof _.value=="object"&&_.value!==null)for(const[A,E]of Object.entries(_.value))typeof E=="boolean"?$.attrs[A]=E:E!=null&&($.attrs[A]=String(E));else _.value!=null&&($.attrs[v]=String(_.value));else if(v==="show"){const A=!!_.value;$.attrs.style=($.attrs.style||"")+(A?"":"; display: none !important")}else if(v==="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,N]of Object.entries(j))N&&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 M=$.attrs.class||"",O=[...new Set([...M.split(/\s+/).filter(Boolean),...E])];$.attrs.class=O.join(" ")}else if(v==="style"){const A=_.value;let E="";if(typeof A=="string")E=A;else if(A&&typeof A=="object"){const O=[];for(const[j,L]of Object.entries(A))if(L!=null&&L!==""){const N=j.replace(/[A-Z]/g,le=>`-${le.toLowerCase()}`),ae=["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 X=String(L);typeof L=="number"&&ae.includes(N)&&(X=`${L}px`),O.push(`${N}: ${X}`)}E=O.join("; ")+(O.length>0?";":"")}const M=$.attrs.style||"";$.attrs.style=M+(M&&!M.endsWith(";")?"; ":"")+E}const C={};for(const[v,_]of Object.entries(k))["bind","show","class","style"].includes(v)||(C[v]=_);if(Object.keys(C).length>0&&($.directives=C),b){const v=P(p,d,u.length===1&&R(u[0])&&u[0].tag==="#text"?typeof u[0].children=="string"?u[0].children:"":u.length?u:void 0,c),_=o.pop();_?(p=_.tag,d=_.props,c=_.key,u=_.children,u.push(v)):l=v}else g?(p?u:h).push(P(a,$,void 0,void 0)):(p&&o.push({tag:p,props:d,children:u,key:c}),p=a,d=$,u=[])}else if(typeof f[3]<"u"){const a=Number(f[3]),b=t[a],g=`interp-${a}`;m(b,g)}else if(f[4]){const a=f[4],b=p?u:h,g=a.split(/({{\d+}})/);for(const x of g){if(!x)continue;const w=x.match(/^{{(\d+)}}$/);if(w){const k=Number(w[1]),$=t[k],C=`interp-${k}`;m($,C)}else{const k=`text-${y++}`;b.push(r(x,k))}}}if(l)return R(l)&&Array.isArray(l.children)&&(l.children=l.children.filter(a=>R(a)?a.tag!=="#text"||typeof a.children=="string"&&a.children.trim()!=="":!0)),l;if(h.length>0){const a=h.filter(b=>R(b)?b.tag!=="#text"||typeof b.children=="string"&&b.children.trim()!=="":!0);return a.length===1?a[0]:a}return P("div",{},"","fallback-root")}function he(e,...t){const n=t[t.length-1],r=typeof n=="object"&&n&&!Array.isArray(n)?n:void 0;return pe(e,t,r)}function ge(e,t){return K(e?t:[],"when-block")}function ye(e,t){return e.map((n,r)=>{const i=typeof n=="object"?n?.key??n?.id??`idx-${r}`:String(n);return K(t(n,r),`each-${i}`)})}function me(){const e=[];return{when(t,n){return e.push([t,n]),this},otherwise(t){return e.push([!0,t]),this},done(){return be(...e)}}}function be(...e){for(let t=0;t<e.length;t++){const[n,r]=e[t];if(n)return[K(r,`whenChain-branch-${t}`)]}return[K([],"whenChain-empty")]}function K(e,t){const n=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:n}}function z(e,t){return t.split(".").reduce((n,r)=>n?.[r],e)}function Y(e,t,n){const r=t.split("."),i=r.pop();if(!i)return;const s=r.reduce((o,l)=>(l in o||(o[l]={}),o[l]),e);s[i]=n}function xe(e,t,n,r,i,s,o){if(!s)return;const l=t.includes("lazy"),f=t.includes("trim"),u=t.includes("number"),p=()=>{const m=s._state||s;return z(m,e)},d=p();let c="text";const y=r?.type;if(o instanceof HTMLInputElement?c=y||o.type||"text":o instanceof HTMLSelectElement?c="select":o instanceof HTMLTextAreaElement&&(c="textarea"),c==="checkbox")if(Array.isArray(d)){const m=o?.getAttribute("value")||r?.value||"",a=d.includes(m);o&&o.checked!==a&&(n.checked=a)}else{const m=o?.getAttribute("true-value")||!0,a=d===m;o&&o.checked!==a&&(n.checked=a)}else if(c==="radio"){const m=r?.value||"",a=d===m;o&&o.checked!==a&&(n.checked=a)}else if(c==="select")if(o&&o.hasAttribute("multiple")){const m=o,a=Array.isArray(d)?d:[];setTimeout(()=>{Array.from(m.options).forEach(b=>{const g=a.includes(b.value);b.selected!==g&&(b.selected=g)})},0)}else setTimeout(()=>{o instanceof HTMLSelectElement&&o.value!==String(d)&&(o.value=String(d))},0);else{const m=String(d??"");(!o||o.value!==m)&&(n.value=d)}const h=l||c==="checkbox"||c==="radio"||c==="select"?"change":"input",S=m=>{if(m.isComposing||i._isComposing||m.isTrusted===!1)return;const a=m.target;if(a._modelUpdating)return;const b=p();let g=a.value;if(c==="checkbox")if(Array.isArray(b)){const $=a.getAttribute("value")||"",C=[...b];if(a.checked)C.includes($)||C.push($);else{const v=C.indexOf($);v>-1&&C.splice(v,1)}g=C}else{const $=a.getAttribute("true-value")||!0,C=a.getAttribute("false-value")||!1;g=a.checked?$:C}else if(c==="radio")g=a.getAttribute("value")||a.value;else if(c==="select"&&a.multiple){const $=a;g=Array.from($.selectedOptions).map(C=>C.value)}else if(f&&(g=g.trim()),u){const $=Number(g);isNaN($)||(g=$)}const x=s._state||s,w=z(x,e);if(Array.isArray(g)&&Array.isArray(w)?JSON.stringify([...g].sort())!==JSON.stringify([...w].sort()):g!==w){const $=m.target;$._modelUpdating=!0,Y(x,e,g),setTimeout(()=>{$._modelUpdating=!1},0),s._requestRender&&s._requestRender()}};if(i[h]=S,c==="text"||c==="textarea"){const m=()=>{i._isComposing=!0},a=b=>{i._isComposing=!1;const g=b.target;setTimeout(()=>{if(g){let x=g.value;if(f&&(x=x.trim()),u){const C=Number(x);isNaN(C)||(x=C)}const w=s._state||s,k=z(w,e);(Array.isArray(x)&&Array.isArray(k)?JSON.stringify([...x].sort())!==JSON.stringify([...k].sort()):x!==k)&&(g&&(g._modelUpdating=!0,setTimeout(()=>{g._modelUpdating=!1},0)),Y(w,e,x),s._requestRender&&s._requestRender())}},0)};i.compositionstart=m,i.compositionend=a}}function ve(e,t,n,r){if(r)try{const i=JSON.parse(e);if(typeof i=="object")for(const[s,o]of Object.entries(i))t[s]=o}catch{const i=z(r,e);n[e]=i}}function we(e,t,n){if(!n)return;const r=z(n,e),i=t.style||"",s=r?"":"none";if(i){const o=i.split(";").filter(Boolean),l=o.findIndex(f=>f.trim().startsWith("display:"));l>=0?o[l]=`display: ${s}`:o.push(`display: ${s}`),t.style=o.join("; ")}else t.style=`display: ${s}`}function ke(e,t,n){if(!n)return;const r=z(n,e);let i=[];typeof r=="string"?i=[r]:Array.isArray(r)?i=r.filter(Boolean):typeof r=="object"&&(i=Object.entries(r).filter(([,l])=>!!l).map(([l])=>l));const s=t.class||"",o=s?`${s} ${i.join(" ")}`.trim():i.join(" ");o&&(t.class=o)}function _e(e,t,n){let r;if(typeof e=="string"){if(!n)return;r=z(n,e)}else r=e;let i="";if(typeof r=="string")i=r;else if(r&&typeof r=="object"){const o=[];for(const[l,f]of Object.entries(r))if(f!=null&&f!==""){const u=l.replace(/[A-Z]/g,c=>`-${c.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(f);typeof f=="number"&&p.includes(u)&&(d=`${f}px`),o.push(`${u}: ${d}`)}i=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+i}function ie(e,t,n,r){const i={},s={...r||{}},o={};for(const[l,f]of Object.entries(e)){const{value:u,modifiers:p}=f;switch(l){case"model":xe(typeof u=="string"?u:String(u),p,i,s,o,t,n);break;case"bind":ve(u,i,s,t);break;case"show":we(u,s,t);break;case"class":ke(u,s,t);break;case"style":_e(u,s,t);break}}return{props:i,attrs:s,listeners:o}}function Z(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let l=o.props?.key??o.key;if(!l){const d=o.tag||"node",c=o.props?.attrs?.id??o.props?.attrs?.name??o.props?.attrs?.["data-key"]??"";l=c?`${t}:${d}:${c}`:`${t}:${d}`}let f=l,u=1;for(;s.has(f);)f=`${l}#${u++}`;s.add(f);let p=o.children;return Array.isArray(p)&&(p=Z(p,f)),{...o,key:f,children:p}})}const n=e;let r=n.props?.key??n.key??t,i=n.children;return Array.isArray(i)&&(i=Z(i,r)),{...n,key:r,children:i}}function $e(e,t,n,r){const i=n.directives??{},s=ie(i,r,e,n.attrs),o={...t.props,...n.props,...s.props},l={...t.attrs,...n.attrs,...s.attrs},f=t.props??{},u=o;for(const c in{...f,...u}){const y=f[c],h=u[c];y!==h&&(c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)?e.value!==h&&(e.value=h??""):c==="checked"&&e instanceof HTMLInputElement?e.checked=!!h:c.startsWith("on")&&typeof h=="function"?(typeof y=="function"&&e.removeEventListener(c.slice(2).toLowerCase(),y),e.addEventListener(c.slice(2).toLowerCase(),h)):h==null||h===!1?e.removeAttribute(c):e.setAttribute(c,String(h)))}for(const[c,y]of Object.entries(s.listeners||{}))e.addEventListener(c,y);const p=t.attrs??{},d=l;for(const c in{...p,...d}){const y=p[c],h=d[c];y!==h&&(h==null||h===!1?e.removeAttribute(c):e.setAttribute(c,String(h)))}}function T(e,t,n){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,c=Array.isArray(d.children)?d.children:[],y=document.createTextNode(""),h=document.createTextNode("");d.key!=null&&(y.key=`${d.key}:start`,h.key=`${d.key}:end`),d._startNode=y,d._endNode=h;const S=document.createDocumentFragment();S.appendChild(y);for(const m of c)S.appendChild(T(m,t));return S.appendChild(h),S}const r=document.createElement(e.tag);e.key!=null&&(r.key=e.key);const{props:i={},attrs:s={},directives:o={}}=e.props??{},l=ie(o,t,r,s),f={...i,...l.props},u={...s,...l.attrs};for(const d in u){const c=u[d];typeof c=="boolean"?c&&r.setAttribute(d,""):c!=null&&r.setAttribute(d,String(c))}for(const d in f){const c=f[d];if(d==="value"&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement))r.value=c??"";else if(d==="checked"&&r instanceof HTMLInputElement)r.checked=!!c;else if(d.startsWith("on")&&typeof c=="function")r.addEventListener(d.slice(2).toLowerCase(),c);else{if(d.startsWith("on")&&c===void 0)continue;c==null||c===!1?r.removeAttribute(d):r.setAttribute(d,String(c))}}for(const[d,c]of Object.entries(l.listeners||{}))r.addEventListener(d,c);const p=e.props?.ref??(e.props?.props&&e.props.props.ref);if(typeof e!="string"&&p&&n&&(n[p]=r),Array.isArray(e.children))for(const d of e.children)r.appendChild(T(d,t,n));else typeof e.children=="string"&&(r.textContent=e.children);return r}function Se(e,t,n,r,i){if(typeof n=="string"){e.textContent!==n&&(e.textContent=n);return}if(!Array.isArray(n))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],l=new Map;for(const y of o)y&&y.key!=null&&l.set(y.key,y);const f=new Map;for(const y of s){const h=y.key;h!=null&&f.set(h,y)}const u=new Set;let p=e.firstChild;function d(y,h){let S=y;for(;S&&(u.add(S),S!==h);)S=S.nextSibling}function c(y,h,S,m){const a=[];let b=y.nextSibling;for(;b&&b!==h;)a.push(b),b=b.nextSibling;const g=Array.isArray(S)?S:[];if(m.some(w=>w&&w.key!=null)||g.some(w=>w&&w.key!=null)){const w=new Map,k=new Map;for(const v of g)v&&v.key!=null&&w.set(v.key,v);for(const v of a){const _=v.key;_!=null&&k.set(_,v)}const $=new Set;let C=y.nextSibling;for(const v of m){let _;if(v.key!=null&&k.has(v.key)){const A=w.get(v.key);_=D(k.get(v.key),A,v,r),$.add(_),_!==C&&e.contains(_)&&e.insertBefore(_,C)}else _=T(v,r),e.insertBefore(_,C),$.add(_);C=_.nextSibling}for(const v of a)!$.has(v)&&e.contains(v)&&e.removeChild(v)}else{const w=Math.min(g.length,m.length);for(let k=0;k<w;k++){const $=g[k],C=m[k],v=D(a[k],$,C,r);v!==a[k]&&(e.insertBefore(v,a[k]),e.removeChild(a[k]))}for(let k=w;k<m.length;k++)e.insertBefore(T(m[k],r),h);for(let k=w;k<a.length;k++)e.removeChild(a[k])}}for(const y of n){let h;if(y.tag==="#anchor"){const S=y.key,m=`${S}:start`,a=`${S}:end`;let b=f.get(m),g=f.get(a);const x=Array.isArray(y.children)?y.children:[];if(b||(b=document.createTextNode(""),b.key=m),g||(g=document.createTextNode(""),g.key=a),y._startNode=b,y._endNode=g,!e.contains(b)||!e.contains(g)){e.insertBefore(b,p);for(const w of x)e.insertBefore(T(w,r),p);e.insertBefore(g,p)}else c(b,g,l.get(S)?.children,x);d(b,g),p=g.nextSibling;continue}if(y.key!=null&&f.has(y.key)){const S=l.get(y.key);h=D(f.get(y.key),S,y,r,i),u.add(h),h!==p&&e.contains(h)&&(p&&!e.contains(p)&&(p=null),e.insertBefore(h,p))}else h=T(y,r,i),p&&!e.contains(p)&&(p=null),e.insertBefore(h,p),u.add(h);p=h.nextSibling}for(const y of s)if(!u.has(y)&&e.contains(y)){if(y instanceof HTMLElement&&i)for(const h in i)i[h]===y&&delete i[h];e.removeChild(y)}}function D(e,t,n,r,i){if(t&&typeof t!="string"&&t.props?.ref&&i&&delete i[t.props.ref],t===n)return e;if(typeof n=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==n&&(e.textContent=n),e;{const o=document.createTextNode(n);return e.parentNode?.replaceChild(o,e),o}}if(n&&typeof n!="string"&&n.tag==="#anchor"){const o=n,l=Array.isArray(o.children)?o.children:[],f=o._startNode??document.createTextNode(""),u=o._endNode??document.createTextNode("");o.key!=null&&(f.key=`${o.key}:start`,u.key=`${o.key}:end`),o._startNode=f,o._endNode=u;const p=document.createDocumentFragment();p.appendChild(f);for(const d of l)p.appendChild(T(d,r));return p.appendChild(u),e.parentNode?.replaceChild(p,e),f}if(!n){const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){const o=T(n,r,i);return typeof n!="string"&&n.props?.ref&&i&&(i[n.props.ref]=o),e.parentNode?.replaceChild(o,e),o}if(n.tag==="#anchor"){const o=Array.isArray(n.children)?n.children:[],l=n._startNode??document.createTextNode(""),f=n._endNode??document.createTextNode("");n.key!=null&&(l.key=`${n.key}:start`,f.key=`${n.key}:end`),n._startNode=l,n._endNode=f;const u=document.createDocumentFragment();u.appendChild(l);for(const p of o)u.appendChild(T(p,r));return u.appendChild(f),e.parentNode?.replaceChild(u,e),l}if(typeof t!="string"&&typeof n!="string"&&t.tag===n.tag&&t.key===n.key){const o=e;return $e(o,t.props||{},n.props||{},r),Se(o,t.children,n.children,r,i),typeof n!="string"&&n.props?.ref&&i&&(i[n.props.ref]=o),o}const s=T(n,r,i);return typeof n!="string"&&n.props?.ref&&i&&(i[n.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function Ce(e,t,n,r){const i=p=>p.key==null?{...p,key:"__root__"}:p;let s=Array.isArray(t)?{tag:"div",key:"__root__",children:t}:i(t);s=Z(s,String(s.key??"root"));const o=e._prevVNode??null,l=e._prevDom??e.firstChild??null;let f;o&&l?typeof o!="string"&&typeof s!="string"&&o.tag===s.tag&&o.key===s.key?f=D(l,o,s,n,r):(f=T(s,n,r),e.replaceChild(f,l)):(f=T(s,n,r),e.firstChild?e.replaceChild(f,e.firstChild):e.appendChild(f));const u=[];for(let p=0;p<e.childNodes.length;p++){const d=e.childNodes[p];if(d!==f&&d.nodeName!=="STYLE"){if(d instanceof HTMLElement&&r)for(const c in r)r[c]===d&&delete r[c];u.push(d)}}u.forEach(p=>e.removeChild(p)),e._prevVNode=s,e._prevDom=f}function oe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let H=null;function G(){return H||(H=new CSSStyleSheet,H.replaceSync(oe(Ee))),H}function Ae(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Ee=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ce(e){let t=new Proxy(e,{set:(i,l,c)=>(i[l]=c,s(),!0)});const n=[];function r(i){n.push(i),i(t)}function o(){return t}function s(){n.forEach(i=>i(t))}return{subscribe:r,getState:o}}class B extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return B.instance||(B.instance=new B),B.instance}emit(t,n){const r=Date.now(),o=this.eventCounters.get(t);if(!o||r-o.window>1e3)this.eventCounters.set(t,{count:1,window:r});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:n,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(i=>{try{i(n)}catch(l){console.error(`Error in global event handler for "${t}":`,l)}})}on(t,n){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(n),()=>this.off(t,n)}off(t,n){const r=this.handlers[t];r&&r.delete(n)}offAll(t){delete this.handlers[t]}listen(t,n,r){return this.addEventListener(t,n,r),()=>this.removeEventListener(t,n)}once(t,n){return new Promise(r=>{const o=this.on(t,s=>{o(),n(s),r(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[n,r]of this.eventCounters.entries())t[n]={count:r.count,handlersCount:this.getHandlerCount(n)};return t}resetEventCounters(){this.eventCounters.clear()}}const fe=B.getInstance();function P(e,t={},n,r){const o=r??t.key;return{tag:e,key:o,props:t,children:n}}function I(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function R(e){return typeof e=="object"&&e!==null&&"tag"in e&&!I(e)}function ue(e,t){return e.key!=null?e:{...e,key:t}}function de(e,t=[],n={}){const r={},o={},s={},i=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let l;for(;l=i.exec(e);){const c=l[1],d=l[2],p=(l[4]||l[6])??"",u=p.match(/^{{(\d+)}}$/);let f=u?t[Number(u[1])]??null:p;if(u||(f==="true"?f=!0:f==="false"?f=!1:f==="null"?f=null:isNaN(Number(f))||(f=Number(f))),c===":")typeof f=="boolean"?o[d]=f:f!=null&&(r[d]=f);else if(c==="@"){const m="on"+d.charAt(0).toUpperCase()+d.slice(1);r[m]=typeof f=="function"?f:typeof n[f]=="function"?n[f]:void 0}else if(c==="#"){const[m,...h]=d.split("."),S=[...h];let y=f,a=[...S];if(m==="model"&&typeof y=="string"&&y.includes(".")){const b=["trim","number","lazy"],g=y.split(".");let x=y;const w=[];for(let k=g.length-1;k>0&&b.includes(g[k]);k--)w.unshift(g[k]),x=g.slice(0,k).join(".");y=x,a.push(...w)}s[m]={value:y,modifiers:a}}else d==="ref"?r.ref=f:o[d]=f}return{props:r,attrs:o,directives:s}}function pe(e,t,n){function r(a,b){return P("#text",{},a,b)}let o="";for(let a=0;a<e.length;a++)o+=e[a],a<t.length&&(o+=`{{${a}}}`);const s=/<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g,i=[];let l=null,c,d=[],p=null,u={},f,m=0,h=[];function S(a){!a||typeof a!="object"||I(a)||(a.props||a.attrs?(a.props&&(u.props||(u.props={}),Object.assign(u.props,a.props)),a.attrs&&(u.attrs||(u.attrs={}),Object.keys(a.attrs).forEach(b=>{if(b==="style"&&u.attrs.style){const g=u.attrs.style.replace(/;?\s*$/,""),x=a.attrs.style.replace(/^;?\s*/,"");u.attrs.style=g+"; "+x}else if(b==="class"&&u.attrs.class){const g=u.attrs.class.trim().split(/\s+/).filter(Boolean),x=a.attrs.class.trim().split(/\s+/).filter(Boolean),w=[...new Set([...g,...x])];u.attrs.class=w.join(" ")}else u.attrs[b]=a.attrs[b]}))):(u.props||(u.props={}),Object.assign(u.props,a)))}function y(a,b){const g=p?d:h;if(I(a)){const x=a.key??b;let w=a.children;g.push({...a,key:x,children:w});return}if(R(a)){g.push(ue(a,void 0));return}if(Array.isArray(a)){if(a.length===0)return;for(let x=0;x<a.length;x++){const w=a[x];I(w)||R(w)||Array.isArray(w)?y(w,`${b}-${x}`):w!==null&&typeof w=="object"?S(w):g.push(r(String(w),`${b}-${x}`))}return}if(a!==null&&typeof a=="object"){S(a);return}g.push(r(String(a),b))}for(;c=s.exec(o);)if(c[1]){const a=c[1],b=c[0][1]==="/",g=c[0][c[0].length-2]==="/",{props:x,attrs:w,directives:k}=de(c[2]||"",t,n),$={props:{},attrs:{}};for(const v in x)$.props[v]=x[v];for(const v in w)$.attrs[v]=w[v];for(const[v,_]of Object.entries(k))if(v==="bind")if(typeof _.value=="object"&&_.value!==null)for(const[A,E]of Object.entries(_.value))typeof E=="boolean"?$.attrs[A]=E:E!=null&&($.attrs[A]=String(E));else _.value!=null&&($.attrs[v]=String(_.value));else if(v==="show"){const A=!!_.value;$.attrs.style=($.attrs.style||"")+(A?"":"; display: none !important")}else if(v==="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,N]of Object.entries(j))N&&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 O=$.attrs.class||"",M=[...new Set([...O.split(/\s+/).filter(Boolean),...E])];$.attrs.class=M.join(" ")}else if(v==="style"){const A=_.value;let E="";if(typeof A=="string")E=A;else if(A&&typeof A=="object"){const M=[];for(const[j,L]of Object.entries(A))if(L!=null&&L!==""){const N=j.replace(/[A-Z]/g,le=>`-${le.toLowerCase()}`),ae=["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 X=String(L);typeof L=="number"&&ae.includes(N)&&(X=`${L}px`),M.push(`${N}: ${X}`)}E=M.join("; ")+(M.length>0?";":"")}const O=$.attrs.style||"";$.attrs.style=O+(O&&!O.endsWith(";")?"; ":"")+E}const C={};for(const[v,_]of Object.entries(k))["bind","show","class","style"].includes(v)||(C[v]=_);if(Object.keys(C).length>0&&($.directives=C),b){const v=P(p,u,d.length===1&&R(d[0])&&d[0].tag==="#text"?typeof d[0].children=="string"?d[0].children:"":d.length?d:void 0,f),_=i.pop();_?(p=_.tag,u=_.props,f=_.key,d=_.children,d.push(v)):l=v}else g?(p?d:h).push(P(a,$,void 0,void 0)):(p&&i.push({tag:p,props:u,children:d,key:f}),p=a,u=$,d=[])}else if(typeof c[3]<"u"){const a=Number(c[3]),b=t[a],g=`interp-${a}`;y(b,g)}else if(c[4]){const a=c[4],b=p?d:h,g=a.split(/({{\d+}})/);for(const x of g){if(!x)continue;const w=x.match(/^{{(\d+)}}$/);if(w){const k=Number(w[1]),$=t[k],C=`interp-${k}`;y($,C)}else{const k=`text-${m++}`;b.push(r(x,k))}}}if(l)return R(l)&&Array.isArray(l.children)&&(l.children=l.children.filter(a=>R(a)?a.tag!=="#text"||typeof a.children=="string"&&a.children.trim()!=="":!0)),l;if(h.length>0){const a=h.filter(b=>R(b)?b.tag!=="#text"||typeof b.children=="string"&&b.children.trim()!=="":!0);return a.length===1?a[0]:a}return P("div",{},"","fallback-root")}function he(e,...t){const n=t[t.length-1],r=typeof n=="object"&&n&&!Array.isArray(n)?n:void 0;return pe(e,t,r)}function ge(e,t){return K(e?t:[],"when-block")}function me(e,t){return e.map((n,r)=>{const o=typeof n=="object"?n?.key??n?.id??`idx-${r}`:String(n);return K(t(n,r),`each-${o}`)})}function ye(){const e=[];return{when(t,n){return e.push([t,n]),this},otherwise(t){return e.push([!0,t]),this},done(){return be(...e)}}}function be(...e){for(let t=0;t<e.length;t++){const[n,r]=e[t];if(n)return[K(r,`whenChain-branch-${t}`)]}return[K([],"whenChain-empty")]}function K(e,t){const n=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:n}}function z(e,t){return t.split(".").reduce((n,r)=>n?.[r],e)}function Y(e,t,n){const r=t.split("."),o=r.pop();if(!o)return;const s=r.reduce((i,l)=>(l in i||(i[l]={}),i[l]),e);s[o]=n}function xe(e,t,n,r,o,s,i){if(!s)return;const l=t.includes("lazy"),c=t.includes("trim"),d=t.includes("number"),p=()=>{const y=s._state||s;return z(y,e)},u=p();let f="text";const m=r?.type;if(i instanceof HTMLInputElement?f=m||i.type||"text":i instanceof HTMLSelectElement?f="select":i instanceof HTMLTextAreaElement&&(f="textarea"),f==="checkbox")if(Array.isArray(u)){const y=i?.getAttribute("value")||r?.value||"",a=u.includes(y);i&&i.checked!==a&&(n.checked=a)}else{const y=i?.getAttribute("true-value")||!0,a=u===y;i&&i.checked!==a&&(n.checked=a)}else if(f==="radio"){const y=r?.value||"",a=u===y;i&&i.checked!==a&&(n.checked=a)}else if(f==="select")if(i&&i.hasAttribute("multiple")){const y=i,a=Array.isArray(u)?u:[];setTimeout(()=>{Array.from(y.options).forEach(b=>{const g=a.includes(b.value);b.selected!==g&&(b.selected=g)})},0)}else setTimeout(()=>{i instanceof HTMLSelectElement&&i.value!==String(u)&&(i.value=String(u))},0);else{const y=String(u??"");(!i||i.value!==y)&&(n.value=u)}const h=l||f==="checkbox"||f==="radio"||f==="select"?"change":"input",S=y=>{if(y.isComposing||o._isComposing||y.isTrusted===!1)return;const a=y.target;if(a._modelUpdating)return;const b=p();let g=a.value;if(f==="checkbox")if(Array.isArray(b)){const $=a.getAttribute("value")||"",C=[...b];if(a.checked)C.includes($)||C.push($);else{const v=C.indexOf($);v>-1&&C.splice(v,1)}g=C}else{const $=a.getAttribute("true-value")||!0,C=a.getAttribute("false-value")||!1;g=a.checked?$:C}else if(f==="radio")g=a.getAttribute("value")||a.value;else if(f==="select"&&a.multiple){const $=a;g=Array.from($.selectedOptions).map(C=>C.value)}else if(c&&(g=g.trim()),d){const $=Number(g);isNaN($)||(g=$)}const x=s._state||s,w=z(x,e);if(Array.isArray(g)&&Array.isArray(w)?JSON.stringify([...g].sort())!==JSON.stringify([...w].sort()):g!==w){const $=y.target;$._modelUpdating=!0,Y(x,e,g),setTimeout(()=>{$._modelUpdating=!1},0),s._requestRender&&s._requestRender()}};if(o[h]=S,f==="text"||f==="textarea"){const y=()=>{o._isComposing=!0},a=b=>{o._isComposing=!1;const g=b.target;setTimeout(()=>{if(g){let x=g.value;if(c&&(x=x.trim()),d){const C=Number(x);isNaN(C)||(x=C)}const w=s._state||s,k=z(w,e);(Array.isArray(x)&&Array.isArray(k)?JSON.stringify([...x].sort())!==JSON.stringify([...k].sort()):x!==k)&&(g&&(g._modelUpdating=!0,setTimeout(()=>{g._modelUpdating=!1},0)),Y(w,e,x),s._requestRender&&s._requestRender())}},0)};o.compositionstart=y,o.compositionend=a}}function ve(e,t,n,r){if(r)try{const o=JSON.parse(e);if(typeof o=="object")for(const[s,i]of Object.entries(o))t[s]=i}catch{const o=z(r,e);n[e]=o}}function we(e,t,n){if(!n)return;const r=z(n,e),o=t.style||"",s=r?"":"none";if(o){const i=o.split(";").filter(Boolean),l=i.findIndex(c=>c.trim().startsWith("display:"));l>=0?i[l]=`display: ${s}`:i.push(`display: ${s}`),t.style=i.join("; ")}else t.style=`display: ${s}`}function ke(e,t,n){if(!n)return;const r=z(n,e);let o=[];typeof r=="string"?o=[r]:Array.isArray(r)?o=r.filter(Boolean):typeof r=="object"&&(o=Object.entries(r).filter(([,l])=>!!l).map(([l])=>l));const s=t.class||"",i=s?`${s} ${o.join(" ")}`.trim():o.join(" ");i&&(t.class=i)}function _e(e,t,n){let r;if(typeof e=="string"){if(!n)return;r=z(n,e)}else r=e;let o="";if(typeof r=="string")o=r;else if(r&&typeof r=="object"){const i=[];for(const[l,c]of Object.entries(r))if(c!=null&&c!==""){const d=l.replace(/[A-Z]/g,f=>`-${f.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 u=String(c);typeof c=="number"&&p.includes(d)&&(u=`${c}px`),i.push(`${d}: ${u}`)}o=i.join("; ")+(i.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+o}function ie(e,t,n,r){const o={},s={...r||{}},i={};for(const[l,c]of Object.entries(e)){const{value:d,modifiers:p}=c;switch(l){case"model":xe(typeof d=="string"?d:String(d),p,o,s,i,t,n);break;case"bind":ve(d,o,s,t);break;case"show":we(d,s,t);break;case"class":ke(d,s,t);break;case"style":_e(d,s,t);break}}return{props:o,attrs:s,listeners:i}}function Z(e,t){if(Array.isArray(e)){const s=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let l=i.props?.key??i.key;if(!l){const u=i.tag||"node",f=i.props?.attrs?.id??i.props?.attrs?.name??i.props?.attrs?.["data-key"]??"";l=f?`${t}:${u}:${f}`:`${t}:${u}`}let c=l,d=1;for(;s.has(c);)c=`${l}#${d++}`;s.add(c);let p=i.children;return Array.isArray(p)&&(p=Z(p,c)),{...i,key:c,children:p}})}const n=e;let r=n.props?.key??n.key??t,o=n.children;return Array.isArray(o)&&(o=Z(o,r)),{...n,key:r,children:o}}function $e(e,t,n,r){const o=n.directives??{},s=ie(o,r,e,n.attrs),i={...t.props,...n.props,...s.props},l={...t.attrs,...n.attrs,...s.attrs},c=t.props??{},d=i;for(const f in{...c,...d}){const m=c[f],h=d[f];m!==h&&(f==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)?e.value!==h&&(e.value=h??""):f==="checked"&&e instanceof HTMLInputElement?e.checked=!!h:f.startsWith("on")&&typeof h=="function"?(typeof m=="function"&&e.removeEventListener(f.slice(2).toLowerCase(),m),e.addEventListener(f.slice(2).toLowerCase(),h)):h==null||h===!1?e.removeAttribute(f):e.setAttribute(f,String(h)))}for(const[f,m]of Object.entries(s.listeners||{}))e.addEventListener(f,m);const p=t.attrs??{},u=l;for(const f in{...p,...u}){const m=p[f],h=u[f];m!==h&&(h==null||h===!1?e.removeAttribute(f):e.setAttribute(f,String(h)))}}function T(e,t,n){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const u=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(u.key=e.key),u}if(e.tag==="#anchor"){const u=e,f=Array.isArray(u.children)?u.children:[],m=document.createTextNode(""),h=document.createTextNode("");u.key!=null&&(m.key=`${u.key}:start`,h.key=`${u.key}:end`),u._startNode=m,u._endNode=h;const S=document.createDocumentFragment();S.appendChild(m);for(const y of f)S.appendChild(T(y,t));return S.appendChild(h),S}const r=document.createElement(e.tag);e.key!=null&&(r.key=e.key);const{props:o={},attrs:s={},directives:i={}}=e.props??{},l=ie(i,t,r,s),c={...o,...l.props},d={...s,...l.attrs};for(const u in d){const f=d[u];typeof f=="boolean"?f&&r.setAttribute(u,""):f!=null&&r.setAttribute(u,String(f))}for(const u in c){const f=c[u];if(u==="value"&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement))r.value=f??"";else if(u==="checked"&&r instanceof HTMLInputElement)r.checked=!!f;else if(u.startsWith("on")&&typeof f=="function")r.addEventListener(u.slice(2).toLowerCase(),f);else{if(u.startsWith("on")&&f===void 0)continue;f==null||f===!1?r.removeAttribute(u):r.setAttribute(u,String(f))}}for(const[u,f]of Object.entries(l.listeners||{}))r.addEventListener(u,f);const p=e.props?.ref??(e.props?.props&&e.props.props.ref);if(typeof e!="string"&&p&&n&&(n[p]=r),Array.isArray(e.children))for(const u of e.children)r.appendChild(T(u,t,n));else typeof e.children=="string"&&(r.textContent=e.children);return r}function Se(e,t,n,r,o){if(typeof n=="string"){e.textContent!==n&&(e.textContent=n);return}if(!Array.isArray(n))return;const s=Array.from(e.childNodes),i=Array.isArray(t)?t:[],l=new Map;for(const m of i)m&&m.key!=null&&l.set(m.key,m);const c=new Map;for(const m of s){const h=m.key;h!=null&&c.set(h,m)}const d=new Set;let p=e.firstChild;function u(m,h){let S=m;for(;S&&(d.add(S),S!==h);)S=S.nextSibling}function f(m,h,S,y){const a=[];let b=m.nextSibling;for(;b&&b!==h;)a.push(b),b=b.nextSibling;const g=Array.isArray(S)?S:[];if(y.some(w=>w&&w.key!=null)||g.some(w=>w&&w.key!=null)){const w=new Map,k=new Map;for(const v of g)v&&v.key!=null&&w.set(v.key,v);for(const v of a){const _=v.key;_!=null&&k.set(_,v)}const $=new Set;let C=m.nextSibling;for(const v of y){let _;if(v.key!=null&&k.has(v.key)){const A=w.get(v.key);_=D(k.get(v.key),A,v,r),$.add(_),_!==C&&e.contains(_)&&e.insertBefore(_,C)}else _=T(v,r),e.insertBefore(_,C),$.add(_);C=_.nextSibling}for(const v of a)!$.has(v)&&e.contains(v)&&e.removeChild(v)}else{const w=Math.min(g.length,y.length);for(let k=0;k<w;k++){const $=g[k],C=y[k],v=D(a[k],$,C,r);v!==a[k]&&(e.insertBefore(v,a[k]),e.removeChild(a[k]))}for(let k=w;k<y.length;k++)e.insertBefore(T(y[k],r),h);for(let k=w;k<a.length;k++)e.removeChild(a[k])}}for(const m of n){let h;if(m.tag==="#anchor"){const S=m.key,y=`${S}:start`,a=`${S}:end`;let b=c.get(y),g=c.get(a);const x=Array.isArray(m.children)?m.children:[];if(b||(b=document.createTextNode(""),b.key=y),g||(g=document.createTextNode(""),g.key=a),m._startNode=b,m._endNode=g,!e.contains(b)||!e.contains(g)){e.insertBefore(b,p);for(const w of x)e.insertBefore(T(w,r),p);e.insertBefore(g,p)}else f(b,g,l.get(S)?.children,x);u(b,g),p=g.nextSibling;continue}if(m.key!=null&&c.has(m.key)){const S=l.get(m.key);h=D(c.get(m.key),S,m,r,o),d.add(h),h!==p&&e.contains(h)&&(p&&!e.contains(p)&&(p=null),e.insertBefore(h,p))}else h=T(m,r,o),p&&!e.contains(p)&&(p=null),e.insertBefore(h,p),d.add(h);p=h.nextSibling}for(const m of s)if(!d.has(m)&&e.contains(m)){if(m instanceof HTMLElement&&o)for(const h in o)o[h]===m&&delete o[h];e.removeChild(m)}}function D(e,t,n,r,o){if(t&&typeof t!="string"&&t.props?.ref&&o&&delete o[t.props.ref],t===n)return e;if(typeof n=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==n&&(e.textContent=n),e;{const i=document.createTextNode(n);return e.parentNode?.replaceChild(i,e),i}}if(n&&typeof n!="string"&&n.tag==="#anchor"){const i=n,l=Array.isArray(i.children)?i.children:[],c=i._startNode??document.createTextNode(""),d=i._endNode??document.createTextNode("");i.key!=null&&(c.key=`${i.key}:start`,d.key=`${i.key}:end`),i._startNode=c,i._endNode=d;const p=document.createDocumentFragment();p.appendChild(c);for(const u of l)p.appendChild(T(u,r));return p.appendChild(d),e.parentNode?.replaceChild(p,e),c}if(!n){const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!t||typeof t=="string"){const i=T(n,r,o);return typeof n!="string"&&n.props?.ref&&o&&(o[n.props.ref]=i),e.parentNode?.replaceChild(i,e),i}if(n.tag==="#anchor"){const i=Array.isArray(n.children)?n.children:[],l=n._startNode??document.createTextNode(""),c=n._endNode??document.createTextNode("");n.key!=null&&(l.key=`${n.key}:start`,c.key=`${n.key}:end`),n._startNode=l,n._endNode=c;const d=document.createDocumentFragment();d.appendChild(l);for(const p of i)d.appendChild(T(p,r));return d.appendChild(c),e.parentNode?.replaceChild(d,e),l}if(typeof t!="string"&&typeof n!="string"&&t.tag===n.tag&&t.key===n.key){const i=e;return $e(i,t.props||{},n.props||{},r),Se(i,t.children,n.children,r,o),typeof n!="string"&&n.props?.ref&&o&&(o[n.props.ref]=i),i}const s=T(n,r,o);return typeof n!="string"&&n.props?.ref&&o&&(o[n.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function Ce(e,t,n,r){const o=p=>p.key==null?{...p,key:"__root__"}:p;let s=Array.isArray(t)?{tag:"div",key:"__root__",children:t}:o(t);s=Z(s,String(s.key??"root"));const i=e._prevVNode??null,l=e._prevDom??e.firstChild??null;let c;i&&l?typeof i!="string"&&typeof s!="string"&&i.tag===s.tag&&i.key===s.key?c=D(l,i,s,n,r):(c=T(s,n,r),e.replaceChild(c,l)):(c=T(s,n,r),e.firstChild?e.replaceChild(c,e.firstChild):e.appendChild(c));const d=[];for(let p=0;p<e.childNodes.length;p++){const u=e.childNodes[p];if(u!==c&&u.nodeName!=="STYLE"){if(u instanceof HTMLElement&&r)for(const f in r)r[f]===u&&delete r[f];d.push(u)}}d.forEach(p=>e.removeChild(p)),e._prevVNode=s,e._prevDom=c}function oe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let H=null;function G(){return H||(H=new CSSStyleSheet,H.replaceSync(oe(Ee))),H}function Ae(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Ee=`
|
|
2
2
|
:host, *, ::before, ::after {
|
|
3
|
+
all: isolate;
|
|
3
4
|
box-sizing: border-box;
|
|
4
|
-
border
|
|
5
|
-
border-style: solid;
|
|
6
|
-
border-color: currentColor;
|
|
7
|
-
}
|
|
8
|
-
:host {
|
|
9
|
-
font-size: 16px;
|
|
10
|
-
line-height: 1.5;
|
|
11
|
-
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
12
|
-
-webkit-text-size-adjust: 100%;
|
|
13
|
-
text-size-adjust: 100%;
|
|
14
|
-
color: inherit;
|
|
15
|
-
background-color: transparent;
|
|
16
|
-
}
|
|
17
|
-
*, ::before, ::after {
|
|
18
|
-
-webkit-tap-highlight-color: transparent;
|
|
5
|
+
border: 0 solid currentColor;
|
|
19
6
|
margin: 0;
|
|
20
7
|
padding: 0;
|
|
21
8
|
font: inherit;
|
|
22
9
|
vertical-align: baseline;
|
|
23
10
|
background: transparent;
|
|
24
11
|
color: inherit;
|
|
12
|
+
-webkit-tap-highlight-color: transparent;
|
|
25
13
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
:host {
|
|
15
|
+
display: contents;
|
|
16
|
+
font: 16px/1.5 ui-sans-serif, system-ui, sans-serif;
|
|
17
|
+
-webkit-text-size-adjust: 100%;
|
|
18
|
+
text-size-adjust: 100%;
|
|
19
|
+
}
|
|
20
|
+
button, input, select, textarea {
|
|
29
21
|
background: transparent;
|
|
30
|
-
border: none;
|
|
31
22
|
outline: none;
|
|
32
|
-
margin: 0;
|
|
33
|
-
padding: 0;
|
|
34
|
-
}
|
|
35
|
-
textarea {
|
|
36
|
-
resize: vertical;
|
|
37
|
-
}
|
|
38
|
-
progress {
|
|
39
|
-
vertical-align: baseline;
|
|
40
|
-
}
|
|
41
|
-
button, textarea {
|
|
42
|
-
overflow: visible;
|
|
43
|
-
}
|
|
44
|
-
input[type="search"]::-webkit-search-decoration,
|
|
45
|
-
input[type="search"]::-webkit-search-cancel-button,
|
|
46
|
-
input[type="search"]::-webkit-search-results-button,
|
|
47
|
-
input[type="search"]::-webkit-search-results-decoration {
|
|
48
|
-
-webkit-appearance: none;
|
|
49
23
|
}
|
|
24
|
+
textarea { resize: vertical }
|
|
25
|
+
progress { vertical-align: baseline }
|
|
26
|
+
button, textarea { overflow: visible }
|
|
50
27
|
img, svg, video, canvas, audio, iframe, embed, object {
|
|
51
28
|
display: block;
|
|
52
29
|
max-width: 100%;
|
|
53
30
|
height: auto;
|
|
54
|
-
vertical-align: middle;
|
|
55
|
-
}
|
|
56
|
-
select {
|
|
57
|
-
text-transform: none;
|
|
58
|
-
}
|
|
59
|
-
optgroup {
|
|
60
|
-
font-weight: bold;
|
|
61
|
-
}
|
|
62
|
-
fieldset {
|
|
63
|
-
border: none;
|
|
64
|
-
}
|
|
65
|
-
svg {
|
|
66
|
-
fill: currentColor;
|
|
67
|
-
stroke: none;
|
|
68
31
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
a, button {
|
|
32
|
+
svg { fill: currentColor; stroke: none }
|
|
33
|
+
a { text-decoration: inherit; cursor: pointer }
|
|
34
|
+
button, [type=button], [type=reset], [type=submit] {
|
|
74
35
|
cursor: pointer;
|
|
75
|
-
}
|
|
76
|
-
input[type="file"] {
|
|
77
|
-
border: 0;
|
|
78
|
-
}
|
|
79
|
-
button, [type="button"], [type="reset"], [type="submit"] {
|
|
80
36
|
appearance: button;
|
|
81
|
-
background
|
|
82
|
-
background-image: none;
|
|
83
|
-
}
|
|
84
|
-
[type='button'], [type='reset'], [type='submit'] {
|
|
37
|
+
background: none;
|
|
85
38
|
-webkit-user-select: none;
|
|
86
39
|
user-select: none;
|
|
87
40
|
}
|
|
88
|
-
::-webkit-input-placeholder {
|
|
89
|
-
|
|
41
|
+
::-webkit-input-placeholder, ::placeholder {
|
|
42
|
+
color: inherit; opacity: .5;
|
|
43
|
+
}
|
|
90
44
|
*:focus {
|
|
91
|
-
outline: 2px solid #3b82f6;
|
|
45
|
+
outline: 2px solid var(--color-blue-500, #3b82f6);
|
|
92
46
|
outline-offset: 2px;
|
|
93
47
|
}
|
|
94
|
-
ol, ul {
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
table {
|
|
98
|
-
border-collapse: collapse;
|
|
99
|
-
border-spacing: 0;
|
|
100
|
-
}
|
|
101
|
-
strong {
|
|
102
|
-
font-weight: bolder;
|
|
103
|
-
}
|
|
48
|
+
ol, ul { list-style: none }
|
|
49
|
+
table { border-collapse: collapse }
|
|
104
50
|
sub, sup {
|
|
105
|
-
font-size:
|
|
51
|
+
font-size: .75em;
|
|
106
52
|
line-height: 0;
|
|
107
53
|
position: relative;
|
|
108
|
-
vertical-align: baseline;
|
|
109
|
-
}
|
|
110
|
-
sub {
|
|
111
|
-
bottom: -0.25em;
|
|
112
|
-
}
|
|
113
|
-
sup {
|
|
114
|
-
top: -0.5em;
|
|
115
|
-
}
|
|
116
|
-
[disabled] {
|
|
117
|
-
cursor: not-allowed;
|
|
118
|
-
}
|
|
119
|
-
[hidden] {
|
|
120
|
-
display: none;
|
|
121
|
-
}
|
|
122
|
-
[aria-disabled="true"] {
|
|
123
|
-
cursor: not-allowed;
|
|
124
54
|
}
|
|
125
|
-
`,Te={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)"},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)"}},F={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;","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-end":"justify-content:flex-end;","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;"},je="0.25rem",ee={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"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]},Le={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}}`},te={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)"},V=["sm","md","lg","xl","2xl"];function U(e){const t=e.startsWith("-"),r=(t?e.slice(1):e).split("-");if(r.length<2)return null;const i=r.slice(0,-1).join("-"),s=r[r.length-1],o=parseFloat(s);if(Number.isNaN(o)||!ee[i])return null;const l=t?"-":"";return ee[i].map(f=>`${f}:calc(${l}${je} * ${o});`).join("")}function re(e){const t=e.replace("#",""),n=parseInt(t,16),r=n>>16&255,i=n>>8&255,s=n&255;return`${r} ${i} ${s}`}function ze(e){const t=/^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,n,r,i="DEFAULT"]=t,s=Te[r]?.[i];return s?`${{bg:"background-color",text:"color",border:"border-color",shadow:"box-shadow",outline:"outline-color",caret:"caret-color",accent:"accent-color"}[n]}:${s};`:null}function Re(e){const[t,n]=e.split("/");if(!n)return{base:t};const r=parseInt(n,10);return isNaN(r)||r<0||r>100?{base:t}:{base:t,opacity:r/100}}function q(e){const{base:t,opacity:n}=Re(e),r=ze(t);if(r){if(n!==void 0){const s=/#([0-9a-f]{6})/i.exec(r);if(s){const o=re(s[0]);return r.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${n})`)}}return r}const i=W(t);if(i&&n!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=re(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${n})`)}}return i}function W(e){const t=e.indexOf("-["),n=e.endsWith("]");if(t>0&&n){const r=e.slice(0,t);let i=e.slice(t+2,-1);i=i.replace(/_/g," ");const o={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"}[r]??r.replace(/_/g,"-");if(o&&i)return`${o}:${i};`}return null}function Be(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Me(e){const t=/class\s*=\s*["']([^"']+)["']/g,n=[];let r;for(;r=t.exec(e);){let i="",s=!1;for(const o of r[1])o==="["&&(s=!0),o==="]"&&(s=!1),o===" "&&!s?(i&&n.push(i),i=""):i+=o;i&&n.push(i)}return n.filter(Boolean)}const ne=new Map,Oe=16;function Ne(e){const t=Date.now(),n=ne.get(e);if(n&&t-n.timestamp<Oe)return n.css;const r=Me(e),i=new Set(r),s=[],o=[],l=[],f=[],u={};function p(h,S=!1){const m=(S?"dark|":"")+h;if(m in u)return u[m];const a=c(h,S);return u[m]=a,a}function d(h){const S=h.some(a=>V.includes(a)),m=h.includes("dark");return h.length===0?1:!S&&!m?2:S&&!m?3:4}function c(h,S=!1){const m=h.split(":"),a=m.find(_=>F[_]||U(_)||q(_)||W(_));if(!a)return null;const b=F[a]??U(a)??q(a)??W(a);if(!b)return null;let g=`.${Be(h)}`,x=b;const w=m.indexOf(a);let k=w>=0?m.slice(0,w):[];S&&(k=k.filter(_=>_!=="dark"));const $=k.filter(_=>V.includes(_)),C=$.length?$[$.length-1]:null;for(const _ of k){if(V.includes(_))continue;const A=Le[_];typeof A=="function"&&(g=A(g,x).replace(/\{.*$/,""))}let v=`${g}{${x}}`;return S&&C?v=`@media (prefers-color-scheme: dark) and ${te[C]}{${v}}`:S?v=`@media (prefers-color-scheme: dark){${v}}`:C&&(v=`@media ${te[C]}{${v}}`),v}for(const h of i){const S=h.split(":"),m=S.find(x=>F[x]||U(x)||q(x)||W(x));if(!m)continue;const a=S.indexOf(m),b=a>=0?S.slice(0,a):[],g=d(b);if(g===4){const x=p(h,!0);x&&f.push(x)}else{const x=p(h);x&&(g===1?s.push(x):g===2?o.push(x):g===3&&l.push(x))}}const y=[...s,...o,...l,...f].join("");return ne.set(e,{css:y,timestamp:t}),y}const Pe=new Map;function Q(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function J(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function He(e,...t){let n="";for(let r=0;r<e.length;r++)n+=e[r],r<t.length&&(n+=t[r]);return n}function Ie(e,t,n){let r=Q(e);r.includes("-")||(r=`cer-${r}`);let i;typeof t=="function"?i={...n,render:t}:i=t,typeof i.onError!="function"&&(i.onError=(s,o)=>{console.error(`[${r}] Error:`,s,o)}),Pe.set(r,i),typeof window<"u"&&!customElements.get(r)&&customElements.define(r,se(i))}function se(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="";_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}),this.context=t,Object.keys(e).forEach(n=>{const r=e[n];typeof r=="function"&&!n.startsWith("on")&&(this.context[n]=(...i)=>r(...i,this.context))}),this._applyProps(e),this._applyComputed(e),this._initializing=!1,this._initWatchers(e),this._render(e)}connectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{e.onConnected&&!this._mounted&&(e.onConnected(this.context),this._mounted=!0)})}disconnectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{e.onDisconnected&&e.onDisconnected(this.context),this._listeners.forEach(t=>t()),this._listeners=[],this._watchers.clear(),this._templateLoading=!1,this._templateError=null,this._mounted=!1})}attributeChangedCallback(t,n,r){this._runLogicWithinErrorBoundary(e,()=>{this._applyProps(e),e.onAttributeChanged&&e.onAttributeChanged(t,n,r,this.context)})}static get observedAttributes(){return e.props?Object.keys(e.props).map(Q):[]}_applyComputed(t){this._runLogicWithinErrorBoundary(e,()=>{t.computed&&Object.entries(t.computed).forEach(([n,r])=>{Object.defineProperty(this.context,n,{get:()=>{const i=r(this.context);return J(i)},enumerable:!0})})})}_render(t){this._runLogicWithinErrorBoundary(t,()=>{if(!this.shadowRoot)return;if(this._templateLoading&&t.loadingTemplate){this._renderOutput(t.loadingTemplate(this.context));return}if(this._templateError&&t.errorTemplate){this._renderOutput(t.errorTemplate(this._templateError,this.context));return}const n=t.render(this.context);if(n instanceof Promise){this._templateLoading=!0,n.then(r=>(this._templateLoading=!1,this._templateError=null,this._renderOutput(r),r)).catch(r=>{if(this._templateLoading=!1,this._templateError=r,t.errorTemplate){const i=t.errorTemplate(r,this.context);return this._renderOutput(i),i}throw r}),t.loadingTemplate&&this._renderOutput(t.loadingTemplate(this.context));return}this._renderOutput(n),this._applyStyle(t)})}_renderOutput(t){if(!this.shadowRoot)return;const n=new Proxy(this.context,{get:(r,i)=>i==="_requestRender"?()=>this._requestRender():i==="context"?r:typeof i=="string"&&i.includes(".")?i.split(".").reduce((s,o)=>s?.[o],r):r[i],set:(r,i,s)=>{if(typeof i=="string"&&i.includes(".")){const o=i.split("."),l=o.pop();if(!l)return!1;const f=o.reduce((u,p)=>(p in u||(u[p]={}),u[p]),r);return f[l]=s,!0}return r[i]=s,!0}});Ce(this.shadowRoot,Array.isArray(t)?t:[t],n,this._refs),this._lastHtmlStringForJitCSS=this.shadowRoot.innerHTML}_requestRender(){if(this._renderTimeoutId!==null&&clearTimeout(this._renderTimeoutId),Date.now()-this._lastRenderTime<16){if(this._renderCount++,this._renderCount>10){console.warn(`[${this.tagName}] Potential infinite render loop detected. Skipping render.`),this._renderTimeoutId=null;return}}else this._renderCount=0;this._renderTimeoutId=setTimeout(()=>{this._lastRenderTime=Date.now(),this._render(this._cfg),this._renderTimeoutId=null},0)}_applyStyle(t){this._runLogicWithinErrorBoundary(t,()=>{if(!this.shadowRoot)return;const n=Ne(this._lastHtmlStringForJitCSS);if(!t.style&&(!n||n.trim()==="")){this._styleSheet=null,this.shadowRoot.adoptedStyleSheets=[G()];return}let r="";t.style&&(typeof t.style=="string"?r=t.style:typeof t.style=="function"&&(r=t.style(this.context)));let i=Ae(`${r}
|
|
55
|
+
sub { bottom: -.25em }
|
|
56
|
+
sup { top: -.5em }
|
|
57
|
+
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
58
|
+
[hidden] { display: none }
|
|
59
|
+
`,Te={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)"}},F={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;"},je="var(--spacing, 0.25rem)",ee={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"]},Le={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}}`},te={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)"},V=["sm","md","lg","xl","2xl"];function U(e){const t=e.startsWith("-"),r=(t?e.slice(1):e).split("-");if(r.length<2)return null;const o=r.slice(0,-1).join("-"),s=r[r.length-1],i=parseFloat(s);if(Number.isNaN(i)||!ee[o])return null;const l=t?"-":"";return ee[o].map(c=>`${c}:calc(${l}${je} * ${i});`).join("")}function re(e){const t=e.replace("#",""),n=parseInt(t,16),r=n>>16&255,o=n>>8&255,s=n&255;return`${r} ${o} ${s}`}function ze(e){const t=/^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,n,r,o="DEFAULT"]=t,s=Te[r]?.[o];return s?`${{bg:"background-color",text:"color",border:"border-color",shadow:"box-shadow",outline:"outline-color",caret:"caret-color",accent:"accent-color"}[n]}:${s};`:null}function Re(e){const[t,n]=e.split("/");if(!n)return{base:t};const r=parseInt(n,10);return isNaN(r)||r<0||r>100?{base:t}:{base:t,opacity:r/100}}function q(e){const{base:t,opacity:n}=Re(e),r=ze(t);if(r){if(n!==void 0){const s=/#([0-9a-f]{6})/i.exec(r);if(s){const i=re(s[0]);return r.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${n})`)}}return r}const o=W(t);if(o&&n!==void 0){const s=/#([0-9a-f]{6})/i.exec(o);if(s){const i=re(s[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${n})`)}}return o}function W(e){const t=e.indexOf("-["),n=e.endsWith("]");if(t>0&&n){const r=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"}[r]??r.replace(/_/g,"-");if(i&&o)return`${i}:${o};`}return null}function Be(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Oe(e){const t=/class\s*=\s*["']([^"']+)["']/g,n=[];let r;for(;r=t.exec(e);){let o="",s=!1;for(const i of r[1])i==="["&&(s=!0),i==="]"&&(s=!1),i===" "&&!s?(o&&n.push(o),o=""):o+=i;o&&n.push(o)}return n.filter(Boolean)}const ne=new Map,Me=16;function Ne(e){const t=Date.now(),n=ne.get(e);if(n&&t-n.timestamp<Me)return n.css;const r=Oe(e),o=new Set(r),s=[],i=[],l=[],c=[],d={};function p(h,S=!1){const y=(S?"dark|":"")+h;if(y in d)return d[y];const a=f(h,S);return d[y]=a,a}function u(h){const S=h.some(a=>V.includes(a)),y=h.includes("dark");return h.length===0?1:!S&&!y?2:S&&!y?3:4}function f(h,S=!1){const y=h.split(":"),a=y.find(_=>F[_]||U(_)||q(_)||W(_));if(!a)return null;const b=F[a]??U(a)??q(a)??W(a);if(!b)return null;let g=`.${Be(h)}`,x=b;const w=y.indexOf(a);let k=w>=0?y.slice(0,w):[];S&&(k=k.filter(_=>_!=="dark"));const $=k.filter(_=>V.includes(_)),C=$.length?$[$.length-1]:null;for(const _ of k){if(V.includes(_))continue;const A=Le[_];typeof A=="function"&&(g=A(g,x).replace(/\{.*$/,""))}let v=`${g}{${x}}`;return S&&C?v=`@media (prefers-color-scheme: dark) and ${te[C]}{${v}}`:S?v=`@media (prefers-color-scheme: dark){${v}}`:C&&(v=`@media ${te[C]}{${v}}`),v}for(const h of o){const S=h.split(":"),y=S.find(x=>F[x]||U(x)||q(x)||W(x));if(!y)continue;const a=S.indexOf(y),b=a>=0?S.slice(0,a):[],g=u(b);if(g===4){const x=p(h,!0);x&&c.push(x)}else{const x=p(h);x&&(g===1?s.push(x):g===2?i.push(x):g===3&&l.push(x))}}const m=[...s,...i,...l,...c].join("");return ne.set(e,{css:m,timestamp:t}),m}const Pe=new Map;function Q(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function J(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function He(e,...t){let n="";for(let r=0;r<e.length;r++)n+=e[r],r<t.length&&(n+=t[r]);return n}function Ie(e,t,n){let r=Q(e);r.includes("-")||(r=`cer-${r}`);let o;typeof t=="function"?o={...n,render:t}:o=t,typeof o.onError!="function"&&(o.onError=(s,i)=>{console.error(`[${r}] Error:`,s,i)}),Pe.set(r,o),typeof window<"u"&&!customElements.get(r)&&customElements.define(r,se(o))}function se(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="";_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}),this.context=t,this._applyProps(e),Object.defineProperty(this.context,"emit",{value:(n,r,o)=>{this.dispatchEvent(new CustomEvent(n,{detail:r,bubbles:!0,composed:!0,...o||{}}));const s=`on${n.charAt(0).toUpperCase()}${n.slice(1)}`,i=typeof this[s]=="function"?this[s]:void 0,l=typeof this.context[s]=="function"?this.context[s]:void 0,c=typeof e[s]=="function"?e[s]:void 0;i&&i(r,this.context),l&&l!==i&&l(r,this.context),c&&c!==i&&c!==l&&c(r,this.context)},writable:!1,enumerable:!1,configurable:!1}),Object.keys(e).forEach(n=>{const r=e[n];if(typeof r=="function"&&!n.startsWith("on"))this.context[n]=(...o)=>r(...o,this.context);else if(n.startsWith("on")&&n.length>2&&n[2]===n[2].toUpperCase()){const o=n.slice(2,3).toLowerCase()+n.slice(3);this.addEventListener(o,s=>{const i=typeof this[n]=="function"?this[n]:this.context[n];typeof i=="function"&&i(s.detail,this.context)})}}),this._applyComputed(e),this._initializing=!1,this._initWatchers(e),this._render(e)}connectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{e.onConnected&&!this._mounted&&(e.onConnected(this.context),this._mounted=!0)})}disconnectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{e.onDisconnected&&e.onDisconnected(this.context),this._listeners.forEach(t=>t()),this._listeners=[],this._watchers.clear(),this._templateLoading=!1,this._templateError=null,this._mounted=!1})}attributeChangedCallback(t,n,r){this._runLogicWithinErrorBoundary(e,()=>{this._applyProps(e),e.onAttributeChanged&&e.onAttributeChanged(t,n,r,this.context)})}static get observedAttributes(){return e.props?Object.keys(e.props).map(Q):[]}_applyComputed(t){this._runLogicWithinErrorBoundary(e,()=>{t.computed&&Object.entries(t.computed).forEach(([n,r])=>{Object.defineProperty(this.context,n,{get:()=>{const o=r(this.context);return J(o)},enumerable:!0})})})}_render(t){this._runLogicWithinErrorBoundary(t,()=>{if(!this.shadowRoot)return;if(this._templateLoading&&t.loadingTemplate){this._renderOutput(t.loadingTemplate(this.context));return}if(this._templateError&&t.errorTemplate){this._renderOutput(t.errorTemplate(this._templateError,this.context));return}const n=t.render(this.context);if(n instanceof Promise){this._templateLoading=!0,n.then(r=>(this._templateLoading=!1,this._templateError=null,this._renderOutput(r),r)).catch(r=>{if(this._templateLoading=!1,this._templateError=r,t.errorTemplate){const o=t.errorTemplate(r,this.context);return this._renderOutput(o),o}throw r}),t.loadingTemplate&&this._renderOutput(t.loadingTemplate(this.context));return}this._renderOutput(n),this._applyStyle(t)})}_renderOutput(t){if(!this.shadowRoot)return;const n=new Proxy(this.context,{get:(r,o)=>o==="_requestRender"?()=>this._requestRender():o==="context"?r:typeof o=="string"&&o.includes(".")?o.split(".").reduce((s,i)=>s?.[i],r):r[o],set:(r,o,s)=>{if(typeof o=="string"&&o.includes(".")){const i=o.split("."),l=i.pop();if(!l)return!1;const c=i.reduce((d,p)=>(p in d||(d[p]={}),d[p]),r);return c[l]=s,!0}return r[o]=s,!0}});Ce(this.shadowRoot,Array.isArray(t)?t:[t],n,this._refs),this._lastHtmlStringForJitCSS=this.shadowRoot.innerHTML}_requestRender(){if(this._renderTimeoutId!==null&&clearTimeout(this._renderTimeoutId),Date.now()-this._lastRenderTime<16){if(this._renderCount++,this._renderCount>10){console.warn(`[${this.tagName}] Potential infinite render loop detected. Skipping render.`),this._renderTimeoutId=null;return}}else this._renderCount=0;this._renderTimeoutId=setTimeout(()=>{this._lastRenderTime=Date.now(),this._render(this._cfg),this._renderTimeoutId=null},0)}_applyStyle(t){this._runLogicWithinErrorBoundary(t,()=>{if(!this.shadowRoot)return;const n=Ne(this._lastHtmlStringForJitCSS);if(!t.style&&(!n||n.trim()==="")){this._styleSheet=null,this.shadowRoot.adoptedStyleSheets=[G()];return}let r="";t.style&&(typeof t.style=="string"?r=t.style:typeof t.style=="function"&&(r=t.style(this.context)));let o=Ae(`${r}
|
|
126
60
|
${n}
|
|
127
|
-
`);
|
|
61
|
+
`);o=oe(o),this._styleSheet||(this._styleSheet=new CSSStyleSheet),(this._styleSheet.cssRules.length===0||this._styleSheet.toString()!==o)&&this._styleSheet.replaceSync(o),this.shadowRoot.adoptedStyleSheets=[G(),this._styleSheet]})}_runLogicWithinErrorBoundary(t,n){this._hasError&&(this._hasError=!1);try{n()}catch(r){this._hasError=!0,t.onError&&t.onError(r,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(r,this.context))}}_initContext(t){try{let n=function(o,s=""){return Array.isArray(o)?new Proxy(o,{get(i,l,c){const d=Reflect.get(i,l,c);return typeof d=="function"&&typeof l=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(l)?function(...u){const f=d.apply(i,u);if(!r._initializing){const m=s||"root";r._triggerWatchers(m,i),r._render(t)}return f}:d},set(i,l,c){if(i[l]=c,!r._initializing){const d=s?`${s}.${String(l)}`:String(l);r._triggerWatchers(d,c),r._render(t)}return!0},deleteProperty(i,l){if(delete i[l],!r._initializing){const c=s?`${s}.${String(l)}`:String(l);r._triggerWatchers(c,void 0),r._render(t)}return!0}}):o&&typeof o=="object"?(Object.keys(o).forEach(i=>{const l=s?`${s}.${i}`:i;o[i]=n(o[i],l)}),new Proxy(o,{set(i,l,c){const d=s?`${s}.${String(l)}`:String(l);return i[l]=n(c,d),r._initializing||(r._triggerWatchers(d,i[l]),r._render(t)),!0},get(i,l,c){return Reflect.get(i,l,c)}})):o};const r=this;return n({...t.state})}catch{return{}}}_initWatchers(t){if(t.watch)for(const[n,r]of Object.entries(t.watch)){let o,s={};if(Array.isArray(r)?(o=r[0],s=r[1]||{}):o=r,this._watchers.set(n,{callback:o,options:s,oldValue:this._getNestedValue(n)}),s.immediate)try{const i=this._getNestedValue(n);o(i,void 0,this.context)}catch(i){console.error(`Error in immediate watcher for "${n}":`,i)}}}_getNestedValue(t){return t.split(".").reduce((n,r)=>n?.[r],this.context)}_triggerWatchers(t,n){const r=(s,i)=>{if(s===i)return!0;if(typeof s!=typeof i||typeof s!="object"||s===null||i===null)return!1;if(Array.isArray(s)&&Array.isArray(i))return s.length!==i.length?!1:s.every((d,p)=>r(d,i[p]));const l=Object.keys(s),c=Object.keys(i);return l.length!==c.length?!1:l.every(d=>r(s[d],i[d]))},o=this._watchers.get(t);if(o&&!r(n,o.oldValue))try{o.callback(n,o.oldValue,this.context),o.oldValue=n}catch(s){console.error(`Error in watcher for "${t}":`,s)}for(const[s,i]of this._watchers.entries())if(i.options.deep&&t.startsWith(s+"."))try{const l=this._getNestedValue(s);r(l,i.oldValue)||(i.callback(l,i.oldValue,this.context),i.oldValue=l)}catch(l){console.error(`Error in deep watcher for "${s}":`,l)}}_applyProps(t){try{let n=function(r,o){return o===Boolean?r==="true":o===Number?Number(r):r};if(!t.props)return;Object.entries(t.props).forEach(([r,o])=>{if(o.type===Function&&typeof this[r]=="function")this.context[r]=this[r];else{const s=this.getAttribute(Q(r));s!==null?this.context[r]=J(n(s,o.type)):"default"in o&&o.default!==void 0&&(this.context[r]=J(o.default))}})}catch(n){this._hasError=!0,t.onError&&t.onError(n,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(n,this.context))}}}}exports.component=Ie;exports.createElementClass=se;exports.createStore=ce;exports.css=He;exports.each=me;exports.eventBus=fe;exports.html=he;exports.match=ye;exports.when=ge;
|
|
128
62
|
//# sourceMappingURL=custom-elements-runtime.cjs.js.map
|