smbls 3.14.646 → 3.14.647

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # smbls
2
2
 
3
+ ## 3.14.647
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-generated cross-repo patch release.
8
+
3
9
  ## 3.14.646
4
10
 
5
11
  ### Patch Changes
package/dist/smbls.cjs CHANGED
@@ -42,7 +42,7 @@ FROM ${a}${l}`},_w=t=>{let e=[],r=(n,o)=>{for(let s in n){let i=o?`${o}/${s}`:s;
42
42
  `).slice(0,6).join(`
43
43
  `):"")}}if(gp(s,!0),mp(s,e,o),e&&(e[s.key]=s,e.__ref?.__children&&(e.__ref.__children.includes(s.key)||e.__ref.__children.push(s.key))),typeof s.html=="function"&&s.node&&!s.node.innerHTML){let h=s.context?.designSystem;h&&et(h);try{let m=s.html(s,s.state,s.context);m!=null&&typeof m!="function"&&(s.node.innerHTML=m)}catch{}finally{h&&J()}}if(Pe("Create",s,n),Pe("Complete",s,n),Pe("Render",s,n),Pe("RenderRouter",s,n),iy(s,n),typeof s.onFrame=="function"){let h=s.onFrame,m=s.context?.designSystem,b=()=>{if(s.node){if(s.node.isConnected){m&&et(m);try{h(s,s.state,s.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{m&&J()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return s}function ok(t,e,r){let n=!e,o=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)&&Object.keys(r.state).length===0,s=n&&o&&t.context?.state,i=r.state!==void 0&&!s?r.state:t.state&&!st(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Mt(t,t.state);else if(t.context?.state){let a=t.context.state,c={...a},l=t.context?.polyglot;if(l?.translations){let f=a.lang||l.defaultLang||"en",u=l.translations[f];if(u&&typeof u=="object")for(let p in u)c[p]===void 0&&(c[p]=u[p]);let d=new Set(l.languages||[]);for(let p in l.translations)!d.has(p)&&c[p]===void 0&&(c[p]=l.translations[p])}t.state=st(c)?c:$t(c),t.state.__element=t,t.state.root=t.state,Mt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Mt(t,t.state);return}if(typeof i=="string"){if(t.state=ay(i,e),t.state&&typeof t.state=="object"&&!st(t.state)){let a=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:a,enumerable:!1,configurable:!0,writable:!0})}Mt(t,t.state);return}if(typeof i=="function"){let a=i(t,e?.state);t.state=st(a)?a:$t(a||{})}else st(i)?t.state=i:t.state=$t({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,Mt(t,t.state)}function lp(t,e){if(!e)return t;let r=e.split("/"),n=t;for(let o of r){if(n==null)return{};n=n[o]}return n??{}}function ay(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let o=t.slice(3);return o?lp(e.state,o):e.state??{}}if(t.startsWith("~/")){let o=e.state?.root||e.state,s=t.slice(2);return s?lp(o,s):o??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=lp(e.state,t);if(r!=null&&Object.keys(r).length>0)return r;let n=e.context?.polyglot;if(n?.translations){let o=e.state?.root?.lang||n.defaultLang||"en",s=n.translations[o];if(s?.[t]!==void 0)return s[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function sk(t){let e=t.__ref,r=t.tag||"div",n=t.context?.designSystem,o=[],s=Object.keys(t);for(let i=0;i<s.length;i++){let a=s[i];if(typeof t[a]!="function"||wt.has(a))continue;let c=a.charCodeAt(0);c>=65&&c<=90||wn(a)||gt[a]||bt&&bt.has(a)||or(r,a)||o.push({prop:a,fn:t[a]})}for(let i=0;i<o.length;i++){let{prop:a,fn:c}=o[i];e.__exec[a]=c,Object.defineProperty(t,a,{get(){n&&et(n);try{return c(t,t.state,t.context)}catch{return}finally{n&&J()}},set(l){delete e.__exec[a],Object.defineProperty(t,a,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function cy(t,e){let r=t.__ref,n=!!(e&&e.skipIfEffect);if(sk(t),typeof t.text=="function"){let s=t.text,i=Q(()=>{if(!r.contentManaged)try{let a=s(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=mr.call(t,a,t.state)),t.tag==="string"?t.node.nodeValue=a:t.node.textContent=a)}catch{}},{depth:r.path.length});r.__effects.push(i),r.__exec.text=s}else if(typeof t.text=="string"&&t.text.includes("{{")){let s=t.text,i=Q(()=>{if(r.contentManaged)return;let a=mr.call(t,s,t.state);a!=null&&(t.text=a),t.node&&(t.tag==="string"?t.node.nodeValue=a??"":t.node.textContent=a??"")},{depth:r.path.length});r.__effects.push(i),r.__exec.text=s}for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&typeof t[s]=="function"&&!wt.has(s)&&!wn(s)&&!r.__exec[s]){if(gt[s]){let i=t[s],a=s,c,l=Q(()=>{let f=t.context?.designSystem;f&&et(f);try{let u=i(t,t.state,t.context),d=gt[a](u,t,t.state,t.context);if(d&&t.node){let p=ny(d);(p===null||p!==c)&&(c=p,Sn(t.node,d))}else t.node&&(a==="show"||a==="hide")&&(c=void 0,t.node.style.display="")}finally{f&&J()}},{depth:r.path.length});r.__effects.push(l),r.__exec[s]=i}else if(bt&&bt.has(s)){let i=t[s],a=s,c,l=Q(()=>{let f=t.context?.designSystem;f&&et(f);try{let u=i(t,t.state,t.context);if(t.node)if(u!=null){let d=a+":"+String(u);d!==c&&(c=d,Sn(t.node,{[a]:u}))}else c=void 0,t.node.style[a]=""}finally{f&&J()}},{depth:r.path.length});r.__effects.push(l),r.__exec[s]=i}}if(typeof t.html=="function"){let s=t.html,i=Q(()=>{let a=t.context?.designSystem;a&&et(a);try{let c=s(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&(t.node.innerHTML=c)}finally{a&&J()}},{depth:r.path.length});r.__effects.push(i),r.__exec.html=s}if(typeof t.value=="function"){let s=t.value,i=Q(()=>{try{let a=s(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let c=a==null?"":String(a);if(t.node.value===c)return;let l=typeof document<"u"&&document.activeElement===t.node,f=l&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,u=l&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=c,l&&f!=null&&u!=null)try{t.node.setSelectionRange(f,u)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(i),r.__exec.value=s}if(typeof t.style=="function"){let s=t.style,i,a=Q(()=>{let c=s(t,t.state,t.context),l=ny(c);(l===null||l!==i)&&(i=l,Sn(t.node,c))},{depth:r.path.length});r.__effects.push(a),r.__exec.style=s}else if(t.style&&typeof t.style=="object")for(let s in t.style){let i=t.style[s];if(typeof i!="function")continue;let a,c=Q(()=>{try{let l=i(t,t.state,t.context);if(t.node){let f=s+":"+String(l);f!==a&&(a=f,Sn(t.node,{[s]:l}))}}catch{}},{depth:r.path.length});r.__effects.push(c)}if(t.attr&&typeof t.attr=="object"){for(let s in t.attr)if(typeof t.attr[s]=="function"){let i=t.attr[s],a=s,c=Q(()=>{try{let l=i(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1?t.node.removeAttribute(a):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(a,l===!0?"":l))}catch{}},{depth:r.path.length});r.__effects.push(c)}}if(t.aria&&typeof t.aria=="object")for(let s in t.aria){let i=t.aria[s];if(typeof i!="function")continue;let a="aria-"+s.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),c=Q(()=>{try{let l=i(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(a):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(a,l===!0?"":l)}catch{}},{depth:r.path.length});r.__effects.push(c)}if(t.data&&typeof t.data=="object")for(let s in t.data){let i=t.data[s];if(typeof i!="function")continue;let c="data-"+s.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),l=Q(()=>{try{let f=i(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(c):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(c,f===!0?"":f)}catch{}},{depth:r.path.length});r.__effects.push(l)}let o=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(o)for(let s in o){let i=o[s];if(typeof i!="function")continue;let a=Q(()=>{try{let c=i(t,t.state,t.context);if(!t.node?.classList)return;typeof c=="string"?t.node.classList.add(c):c?t.node.classList.add(s):t.node.classList.remove(s)}catch{}},{depth:r.path.length});r.__effects.push(a)}!n&&typeof t.if=="function"&&ly(t,r,t.if);for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||wt.has(s)||typeof t[s]!="function")continue;let i=s.charCodeAt(0);if(i>=65&&i<=90||wn(s))continue;let a=t[s];r.__exec[s]=a;let c=t.tag||"div";if(or(c,s)&&!gt[s]&&!(bt&&bt.has(s))){let l=s,f=Q(()=>{try{let u=a(t,t.state,t.context);t.node?.setAttribute&&(u==null||u===!1?t.node.removeAttribute(l):typeof u!="function"&&typeof u!="object"&&(l==="src"&&"src"in t.node?t.node.src=u:t.node.setAttribute(l,u===!0?"":u)))}catch{}},{depth:r.path.length});r.__effects.push(f)}}if(ck(t),fk(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){let s=t.onStateUpdate,i=t.stateDeps,a=!1,c=[],l=Q(()=>{let f=[];for(let g=0;g<i.length;g++){let h=i[g];try{f[g]=typeof h=="function"?h(t,t.state,t.context):t.state?.[h]}catch{f[g]=void 0}}if(!a){a=!0,c=f;return}let u=f.length!==c.length;for(let g=0;!u&&g<f.length;g++)f[g]!==c[g]&&(u=!0);let d=c;if(c=f,!u)return;let p=t.context?.designSystem;p&&et(p);try{s(t,t.state,t.context,{prev:d,next:f})}catch(g){if(t.context?.plugins?.length&&yt("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{p&&J()}},{depth:r.path.length});r.__effects.push(l)}}function ly(t,e,r){let n=Q(()=>{let o;try{o=r(t,t.state,t.context)}catch(i){if(o=!1,e.__ifError=i,typeof console<"u"&&console.warn){let a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,i?.message||i)}return}let s=e.__if;if(e.__if=!!o,s&&!e.__if&&t.node)t.node.remove();else if(!s&&e.__if)if(e.__ifInitialized){t.node||(t.node=tr(t)),t.node&&(t.node.ref=t);let i=t.parent,a=i?.node;if(a&&t.node){let c=null,l=Object.keys(i),f=l.indexOf(t.key);for(let u=f+1;u<l.length;u++){let d=i[l[u]];if(d?.node?.parentNode===a){c=d.node;break}}c?a.insertBefore(t.node,c):a.appendChild(t.node)}else mp(t,t.parent);pp(t)}else{if(e.__ifInitialized=!0,t.tag||(t.tag=Qe(t)),Pe("Init",t,{}),t.node||(t.node=tr(t)),!t.node)return;if(t.tag==="fragment"&&!e.__fragmentAnchor){let a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),e.__fragmentAnchor=a}Pe("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),dy(t,{}),cy(t,{skipIfEffect:!0}),pp(t),fy(t),py(t,{}),mp(t,t.parent),iy(t,{})}},{depth:e.path.length});e.__effects.push(n)}function pp(t){let{node:e}=t;if(e){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?e.nodeValue=t.text:e.textContent=t.text:typeof t.text=="number"&&(e.textContent=t.text),dk(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){let r=String(t.value);e.value!==r&&(e.value=r)}if(t.style&&typeof t.style=="object"&&Sn(e,t.style),t.attr&&typeof t.attr=="object")for(let r in t.attr){let n=t.attr[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.setAttribute&&e.setAttribute(r,n===!0?"":n)}if(t.data&&typeof t.data=="object")for(let r in t.data){let n=t.data[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.dataset&&(e.dataset[r]=n===!0?"":n)}if(t.classlist||t.class){let r=t.classlist||t.class;if(typeof r=="string")r.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof r=="object")for(let n in r){let o=typeof r[n]=="function"?r[n](t,t.state,t.context):r[n];o&&e.classList.add(typeof o=="string"?o:n)}}}}function ny(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Sn(t,e){if(!t||!e||!t.style)return;let r=null;for(let n in e){let o=e[n];if(o!=null){if(n.charAt(0)==="&"&&typeof o=="object"){r||(r={}),r[n]=o;continue}try{let s=String(o),i=n.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),a=s.trim(),c=/\s*!important\s*$/.test(a),l=a.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,c?"important":"")}catch{}}}r&&ak(t,r)}var ik=0;function ak(t,e){let r=`_ds${ik++}`;t.classList.add(r);let n=t.ownerDocument,o=n.querySelector("style[data-smbls-scoped]");o||(o=n.createElement("style"),o.setAttribute("data-smbls-scoped",""),n.head.appendChild(o));let s="";for(let i in e){let a="."+r,c=i.replace(/&/g,a).split(",").map(f=>{let u=f.trim();return u.includes(a)?u:a+u}).join(", "),l=e[i];if(typeof l=="object"){let f="",u="";for(let d in l){let p=l[d];if(typeof p=="object"){let g=d.includes("&")?c.split(", ").map(m=>d.replace(/&/g,m)).join(", "):c.split(", ").map(m=>`${m} ${d}`).join(", "),h="";for(let m in p)h+=`${m.replace(/[A-Z]/g,b=>"-"+b.toLowerCase())}: ${p[m]};`;u+=`${g} { ${h} }
44
44
  `}else f+=`${d.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${p};`}f&&(s+=`${c} { ${f} }
45
- `),u&&(s+=u)}}s&&(o.textContent+=s)}function ck(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],a=s.slice(1),c={value:!1},l=Q(()=>{let f=t.state&&(st(t.state)?t.state.root:null);if(!f||!st(f))return;let u=f;u=u[i];for(let p=0;p<a.length&&!(u==null||typeof u!="object");p++)if(st(u))u=u[a[p]];else break;if(!c.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let p=t.context?.designSystem;p&&et(p);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(g){t.context?.plugins?.length&&yt("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{p&&J()}}if(!d&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){let g=r.__effects[p];g&&g!==l&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!d&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&et(p);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&yt("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{p&&J()}}},{depth:r.path.length});c.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function yp(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}var oy=new Set;function lk(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;oy.has(n)||(oy.add(n),console.warn(`[smbls/css] "${t}" at ${r} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function kn(t,e,r){let n={},o=(s,i)=>{if(gt[s]){let a=gt[s](i,e,e.state,e.context);if(a){let c=Array.isArray(a)?a:[a];for(let l of c)l&&Object.assign(n,l)}}else n[s]=i};for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let i=t[s];if(typeof i=="function"&&(i=i(e,e.state,e.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(s==="style"){for(let l in i){let f=i[l];typeof f=="function"&&(f=f(e,e.state,e.context)),!(f==null||typeof f=="function")&&o(l,f)}continue}if(yp(s,e)){let l=kn(i,e,!0);Object.keys(l).length&&(n[`[data-theme="${s.slice(1)}"] &`]=l);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(s)){zs()&&lk(s,e);continue}let a=s;if(s.charCodeAt(0)===64&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let l=e.context?.designSystem?.media?.[s.slice(1)];l&&(a=`@media ${l}`)}let c=kn(i,e,!1);Object.keys(c).length&&(n[a]=c);continue}o(s,i)}}if(r)for(let s in n){let i=n[s];typeof i=="string"&&!i.includes("!important")&&(n[s]=i+" !important")}return n}function fk(t){let e=t.__ref;e.__conditionalRunners=[];let r=new Map;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let o=n.charAt(0);if(o!=="."&&o!=="!")continue;let s=n.slice(1);if(!s)continue;let i=t[n];if(!i||typeof i!="object")continue;let a=o==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{if(!t.node)return;let u,d=t[s];if(d===void 0)if(t.state&&s in t.state)u=t.state[s];else{let h=t.context?.cases?.[s];if(h===void 0)return;try{u=typeof h=="function"?h.call(t,t):h}catch(m){u=!1,e.__conditionalError=m,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,m?.message||m)}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(h){u=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else u=d;let p=a?!u:!!u;if(p===c.lastMatch)return;c.lastMatch=p;let g=t.context?.designSystem;g&&et(g);try{if(p){let h={},m={},b=!1;for(let y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;let _=i[y],v=y.charAt(0);if((v===":"||v==="@"||v==="&")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yp(y,t)){let P=kn(_,t,!0);Object.keys(P).length&&(m[`[data-theme="${y.slice(1)}"] &`]=P,b=!0)}else{let P=y;if(v==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let E=t.context?.designSystem?.media?.[y.slice(1)];E&&(P=`@media ${E}`)}let U=kn(_,t,!1);Object.keys(U).length&&(m[P]=U,b=!0)}continue}let O=typeof _=="function"?_(t,t.state,t.context):_;if(O!=null)if(gt[y]){let P=gt[y](O,t,t.state,t.context);if(P){let U=Array.isArray(P)?P:[P];for(let E of U)E&&Object.assign(h,E)}}else bt&&bt.has(y)&&(h[y]=O)}let x=Object.keys(h);if(x.length){Sn(t.node,h);for(let y of x)r.set(y,n);c.appliedKeys=x}else c.appliedKeys=null;if(b){let y=oe(m,null,t.context?.cssPrefix),_=y?y.split(" ").filter(Boolean):[];if(_.length&&t.node.classList){for(let v of _)t.node.classList.add(v);c.appliedClasses=_}else c.appliedClasses=null}else if(c.appliedClasses){for(let y of c.appliedClasses)t.node.classList.remove(y);c.appliedClasses=null}}else{if(c.appliedKeys){for(let h of c.appliedKeys)r.get(h)===n&&(t.node.style[h]="",r.delete(h));c.appliedKeys=null}if(c.appliedClasses){for(let h of c.appliedClasses)t.node.classList.remove(h);c.appliedClasses=null}}}finally{g&&J()}};e.__conditionalRunners.push(l);let f=Q(l,{depth:e.path.length});e.__effects.push(f)}}var fp=new WeakSet;function uk(t){let e=t.ownerDocument;!e||fp.has(e)||(fp.add(e),queueMicrotask(()=>{fp.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var up=new WeakSet,sy=!1;function dk(t){let{node:e}=t;if(!e)return;if(sy||(sy=!0,oe({display:"none"})),up.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}up.add(t);let r=t.context?.designSystem;r&&et(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||wt.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!wn(s)){if(gt[s]){let a=t[s],c=gt[s](a,t,t.state,t.context);if(c){if(Array.isArray(c))for(let l of c)l&&Object.assign(n,l);else Object.assign(n,c);o=!0}}else if(bt&&bt.has(s)){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charCodeAt(0)===45){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="&"){let a=t[s];a&&typeof a=="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"){if(yp(s,t)){let c=kn(a,t,!0);Object.keys(c).length&&(n[`[data-theme="${s.slice(1)}"] &`]=c,o=!0)}else{let c=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let f=t.context?.designSystem?.media?.[s.slice(1)];f&&(c=`@media ${f}`)}let l=kn(a,t,!1);Object.keys(l).length&&(n[c]=l,o=!0)}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=oe(n,null,t.context?.cssPrefix);if(s&&e.classList){let a=s.split(" ").filter(Boolean),c=!1;for(let l of a)e.classList.add(l),c||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(c=!0);c&&uk(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let a=n.display;if(a&&a!==i)if(i==="none"){let c=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&c.push(l);for(let l of c)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&J(),up.delete(t)}}function fy(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=cp(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||wt.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!wn(o)&&!(gt[o]||bt&&bt.has(o))&&or(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=mr(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function pk(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var uy=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function dy(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!wn(r)||uy.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(a){return t.call(s,a)}}if(typeof n!="function")continue;let o=rk(r);er.has(o)||mn(nk(o),t,n)}hk(t)}function hk(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of uy){let p=t[d];typeof p=="function"&&(r[d]=p,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,a=0,c=0,l=!1,f=d=>{let p=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];p&&(i=p.clientX,a=p.clientY,c=Date.now(),l=!0)},u=d=>{if(!l)return;l=!1;let p=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!p)return;let g=p.clientX-i,h=p.clientY-a,m=Date.now()-c;if(m>s)return;let b=Math.abs(g),x=Math.abs(h);if(Math.max(b,x)<o)return;let y;if(b>x*1.2)y=g<0?"left":"right";else if(x>b*1.2)y=h<0?"up":"down";else return;let _="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),v=r[_],O=r.onSwipe;v&&v.call(t,d,t,t.state,t.context),O&&O.call(t,{direction:y,dx:g,dy:h,dt:m,event:d},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function cc(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=cc(o,s):r[n]=s}return r}function hp(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let o=t.tag==="fragment",s=t.context?.document||globalThis.document,i=o?null:s?.createDocumentFragment();if(!o&&!i)return;let a=t.childProps,c=t.childrenAs;for(let l=0;l<e.length;l++){let f=e[l],u=f;(typeof f=="string"||typeof f=="number")&&(f={text:f});let d=a;if(typeof a=="function")try{d=a(t,f)}catch{d=null}if(c==="state"){let h=u;(typeof u=="string"||typeof u=="number")&&(h={value:u,text:u}),f=d?{...d,state:h}:{state:h}}else d&&(f=cc(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let h=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...h]}}else f={...f,extends:n};let p=f?.key||u&&typeof u=="object"&&u.key||`${l}`,g=qt(f,t,p,r);!o&&g?.node&&i.appendChild(g.node)}o||t.node.appendChild(i);return}if(typeof e=="string"){let o=ay(e,t);if(Array.isArray(o)){hp(t,o,r);return}}if(typeof e=="object")for(let o in e){if(wt.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=cc(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],a=Array.isArray(n)?n:[n];s={...s,extends:[...a,...i]}}else s={...s,extends:n};qt(s,t,o,r)}}}function gp(t,e){let r=t.node;if(!r||r.tagName!=="SELECT")return;let n=r.options;if(!n||!n.length)return;let o=t.__ref,s=o&&o.__exec&&o.__exec.value,i=typeof s=="function",a=t.value!=null&&typeof t.value!="function";if(i||a){let f;if(i)try{f=s(t,t.state,t.context)}catch{return}else f=t.value;let u=f==null?"":String(f);r.value!==u&&(r.value=u);return}let c=e||!(o&&o.__selectSynced);if(o&&(o.__selectSynced=!0),!c)return;let l=-1;for(let f=0;f<n.length;f++)n[f].defaultSelected&&(l=f);l>=0&&r.selectedIndex!==l&&(r.selectedIndex=l)}function py(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let a=t.__ref,c=!1,l=Q(()=>{let f=i(t,t.state,t.context);if(!c){c=!0;return}if(f===t.children)return;t.children=f;let u=typeof t.onContentUpdate=="function",d=u?[]:null,p=u?[]:null,g=u?[]:null;if(Array.isArray(f)&&t.childrenAs==="state"){let x=t.childProps,y=[],_=new Map;for(let B=0;B<f.length;B++){let z=f[B],$=x;if(typeof x=="function")try{$=x(t,z)}catch{$=null}let D=$&&$.key||z&&z.key||`${B}`;y.push(D),_.set(D,{rawChild:z,childProps:$})}let v=new Set(y),O=a.__children.slice();for(let B of O)if(!v.has(B)){let z=t[B];z?.remove&&z.remove(),delete t[B],p&&p.push(B)}let P=t.childExtends,U=t.tag==="fragment",E=t.context?.document||globalThis.document,F=U?null:E?.createDocumentFragment();for(let B of y){let z=_.get(B),$=z.rawChild,D=t[B];if(D&&D.state){if($&&typeof $=="object"){let xt=D.state,ur=xt.$replace||xt.replace,_i=xt.$update||xt.update;if(typeof ur=="function")ur.call(xt,$);else if(typeof _i=="function"){for(let Jt in xt)if(!(Jt==="__element"||Jt==="root"||Jt==="parent"||Jt==="update")&&!Object.prototype.hasOwnProperty.call($,Jt))try{xt[Jt]=void 0}catch{}_i.call(xt,$)}else for(let Jt in $)xt[Jt]=$[Jt]}g&&g.push(B);continue}let W=$;(typeof $=="string"||typeof $=="number")&&(W={value:$,text:$});let X=z.childProps,q=X?{...X,state:W}:{state:W};if(P&&!q.ignoreChildExtends)if(q.extends){let xt=Array.isArray(q.extends)?q.extends:[q.extends],ur=Array.isArray(P)?P:[P];q={...q,extends:[...ur,...xt]}}else q={...q,extends:P};let Le=qt(q,t,B,e);!U&&Le?.node&&F&&F.appendChild(Le.node),d&&d.push(B)}if(!U&&F&&F.childNodes.length&&t.node&&t.node.appendChild(F),!U&&t.node){let B=null;for(let z of y){let $=t[z]?.node;if(!$)continue;let D=B?B.nextSibling:t.node.firstChild;$!==D&&t.node.insertBefore($,D),B=$}}a.__children=y,u&&(d.length||p.length)&&ey(t,{added:d,removed:p,kept:g}),gp(t,!1);return}let b=u?[...a.__children]:null;for(let x of[...a.__children]){let y=t[x];y?.remove&&y.remove(),delete t[x]}a.__children=[],hp(t,f,e),gp(t,!1),u&&ey(t,{added:[...a.__children],removed:b,kept:[]})},{depth:a.path.length});a.__effects.push(l)}if(hp(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let a=0;a<i.length;a++){let c=i[a];if(!c.endsWith("Extends")||typeof t[c]!="string")continue;let l=c.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[c]};delete t[c];for(let u=a+1;u<i.length;u++){let d=i[u],p=d.charCodeAt(0);if(p>=65&&p<=90||wt.has(d)||typeof t[d]=="function"&&(d.startsWith("on")||d.startsWith(".")))break;let g=t[d];g!==void 0&&(f[d]=g,delete t[d])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||wt.has(i)||typeof t[i]!="object"||t[i]===null)continue;let a=i.charCodeAt(0);if(a<65||a>90)continue;let c=t[i];if(!c.__ref){if(!c.extends&&!c.extend){let l=s[i]||s[`smbls.${i}`];l&&(c={...c,extends:l})}if(t.childProps&&(c=cc(t.childProps,c)),o&&!c.ignoreChildExtends)if(c.extends){let l=Array.isArray(c.extends)?c.extends:[c.extends],f=Array.isArray(o)?o:[o];c={...c,extends:[...f,...l]}}else c={...c,extends:o};qt(c,t,i,e)}}}function mp(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(o){let i=o.parentNode;if(i){if(r?.position==="before"&&r.node)i.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let a=r.node.nextSibling;i.insertBefore(n,a||o)}else i.insertBefore(n,o);return}}let s=e?.node||(e?.nodeType?e:null);if(s)if(r?.position==="before"&&r.node)s.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let i=r.node.nextSibling;i?s.insertBefore(n,i):s.appendChild(n)}else s.appendChild(n)}function Pe(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&yt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let a=e.context?.designSystem;a&&et(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&yt("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&J(),i&&(e.__ref.__inRender=!1)}}return!0}var hy={blue:"#213eb0",green:"#389d34",red:"#e15c55",yellow:"#EDCB38",orange:"#e97c16",transparent:"rgba(0, 0, 0, 0)",black:"black",gray:"#4e4e50",white:"white",title:["--gray 1 -168","--gray 1 +168"],caption:["--gray 1 -68","--gray 1 +68"],paragraph:["--gray 1 -42","--gray 1 +42"],disabled:["--gray 1 -26","--gray 1 +26"],line:["--gray 1 -16","--gray 1 +16"]},gy={"gradient-blue-light":`linear-gradient(to right,
45
+ `),u&&(s+=u)}}s&&(o.textContent+=s)}function ck(t){let e=t.subscribeTo;if(typeof e=="function")try{e=e(t,t.state,t.context)}catch{e=null}if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],a=s.slice(1),c={value:!1},l=Q(()=>{let f=t.state&&(st(t.state)?t.state.root:null);if(!f||!st(f))return;let u=f;u=u[i];for(let p=0;p<a.length&&!(u==null||typeof u!="object");p++)if(st(u))u=u[a[p]];else break;if(!c.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let p=t.context?.designSystem;p&&et(p);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(g){t.context?.plugins?.length&&yt("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{p&&J()}}if(!d&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){let g=r.__effects[p];g&&g!==l&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!d&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&et(p);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&yt("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{p&&J()}}},{depth:r.path.length});c.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function yp(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}var oy=new Set;function lk(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;oy.has(n)||(oy.add(n),console.warn(`[smbls/css] "${t}" at ${r} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function kn(t,e,r){let n={},o=(s,i)=>{if(gt[s]){let a=gt[s](i,e,e.state,e.context);if(a){let c=Array.isArray(a)?a:[a];for(let l of c)l&&Object.assign(n,l)}}else n[s]=i};for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let i=t[s];if(typeof i=="function"&&(i=i(e,e.state,e.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(s==="style"){for(let l in i){let f=i[l];typeof f=="function"&&(f=f(e,e.state,e.context)),!(f==null||typeof f=="function")&&o(l,f)}continue}if(yp(s,e)){let l=kn(i,e,!0);Object.keys(l).length&&(n[`[data-theme="${s.slice(1)}"] &`]=l);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(s)){zs()&&lk(s,e);continue}let a=s;if(s.charCodeAt(0)===64&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let l=e.context?.designSystem?.media?.[s.slice(1)];l&&(a=`@media ${l}`)}let c=kn(i,e,!1);Object.keys(c).length&&(n[a]=c);continue}o(s,i)}}if(r)for(let s in n){let i=n[s];typeof i=="string"&&!i.includes("!important")&&(n[s]=i+" !important")}return n}function fk(t){let e=t.__ref;e.__conditionalRunners=[];let r=new Map;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let o=n.charAt(0);if(o!=="."&&o!=="!")continue;let s=n.slice(1);if(!s)continue;let i=t[n];if(!i||typeof i!="object")continue;let a=o==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{if(!t.node)return;let u,d=t[s];if(d===void 0)if(t.state&&s in t.state)u=t.state[s];else{let h=t.context?.cases?.[s];if(h===void 0)return;try{u=typeof h=="function"?h.call(t,t):h}catch(m){u=!1,e.__conditionalError=m,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,m?.message||m)}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(h){u=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else u=d;let p=a?!u:!!u;if(p===c.lastMatch)return;c.lastMatch=p;let g=t.context?.designSystem;g&&et(g);try{if(p){let h={},m={},b=!1;for(let y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;let _=i[y],v=y.charAt(0);if((v===":"||v==="@"||v==="&")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yp(y,t)){let P=kn(_,t,!0);Object.keys(P).length&&(m[`[data-theme="${y.slice(1)}"] &`]=P,b=!0)}else{let P=y;if(v==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let E=t.context?.designSystem?.media?.[y.slice(1)];E&&(P=`@media ${E}`)}let U=kn(_,t,!1);Object.keys(U).length&&(m[P]=U,b=!0)}continue}let O=typeof _=="function"?_(t,t.state,t.context):_;if(O!=null)if(gt[y]){let P=gt[y](O,t,t.state,t.context);if(P){let U=Array.isArray(P)?P:[P];for(let E of U)E&&Object.assign(h,E)}}else bt&&bt.has(y)&&(h[y]=O)}let x=Object.keys(h);if(x.length){Sn(t.node,h);for(let y of x)r.set(y,n);c.appliedKeys=x}else c.appliedKeys=null;if(b){let y=oe(m,null,t.context?.cssPrefix),_=y?y.split(" ").filter(Boolean):[];if(_.length&&t.node.classList){for(let v of _)t.node.classList.add(v);c.appliedClasses=_}else c.appliedClasses=null}else if(c.appliedClasses){for(let y of c.appliedClasses)t.node.classList.remove(y);c.appliedClasses=null}}else{if(c.appliedKeys){for(let h of c.appliedKeys)r.get(h)===n&&(t.node.style[h]="",r.delete(h));c.appliedKeys=null}if(c.appliedClasses){for(let h of c.appliedClasses)t.node.classList.remove(h);c.appliedClasses=null}}}finally{g&&J()}};e.__conditionalRunners.push(l);let f=Q(l,{depth:e.path.length});e.__effects.push(f)}}var fp=new WeakSet;function uk(t){let e=t.ownerDocument;!e||fp.has(e)||(fp.add(e),queueMicrotask(()=>{fp.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var up=new WeakSet,sy=!1;function dk(t){let{node:e}=t;if(!e)return;if(sy||(sy=!0,oe({display:"none"})),up.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}up.add(t);let r=t.context?.designSystem;r&&et(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||wt.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!wn(s)){if(gt[s]){let a=t[s],c=gt[s](a,t,t.state,t.context);if(c){if(Array.isArray(c))for(let l of c)l&&Object.assign(n,l);else Object.assign(n,c);o=!0}}else if(bt&&bt.has(s)){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charCodeAt(0)===45){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="&"){let a=t[s];a&&typeof a=="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"){if(yp(s,t)){let c=kn(a,t,!0);Object.keys(c).length&&(n[`[data-theme="${s.slice(1)}"] &`]=c,o=!0)}else{let c=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let f=t.context?.designSystem?.media?.[s.slice(1)];f&&(c=`@media ${f}`)}let l=kn(a,t,!1);Object.keys(l).length&&(n[c]=l,o=!0)}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=oe(n,null,t.context?.cssPrefix);if(s&&e.classList){let a=s.split(" ").filter(Boolean),c=!1;for(let l of a)e.classList.add(l),c||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(c=!0);c&&uk(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let a=n.display;if(a&&a!==i)if(i==="none"){let c=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&c.push(l);for(let l of c)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&J(),up.delete(t)}}function fy(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=cp(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||wt.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!wn(o)&&!(gt[o]||bt&&bt.has(o))&&or(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=mr(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function pk(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var uy=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function dy(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!wn(r)||uy.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(a){return t.call(s,a)}}if(typeof n!="function")continue;let o=rk(r);er.has(o)||mn(nk(o),t,n)}hk(t)}function hk(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of uy){let p=t[d];typeof p=="function"&&(r[d]=p,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,a=0,c=0,l=!1,f=d=>{let p=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];p&&(i=p.clientX,a=p.clientY,c=Date.now(),l=!0)},u=d=>{if(!l)return;l=!1;let p=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!p)return;let g=p.clientX-i,h=p.clientY-a,m=Date.now()-c;if(m>s)return;let b=Math.abs(g),x=Math.abs(h);if(Math.max(b,x)<o)return;let y;if(b>x*1.2)y=g<0?"left":"right";else if(x>b*1.2)y=h<0?"up":"down";else return;let _="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),v=r[_],O=r.onSwipe;v&&v.call(t,d,t,t.state,t.context),O&&O.call(t,{direction:y,dx:g,dy:h,dt:m,event:d},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function cc(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=cc(o,s):r[n]=s}return r}function hp(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let o=t.tag==="fragment",s=t.context?.document||globalThis.document,i=o?null:s?.createDocumentFragment();if(!o&&!i)return;let a=t.childProps,c=t.childrenAs;for(let l=0;l<e.length;l++){let f=e[l],u=f;(typeof f=="string"||typeof f=="number")&&(f={text:f});let d=a;if(typeof a=="function")try{d=a(t,f)}catch{d=null}if(c==="state"){let h=u;(typeof u=="string"||typeof u=="number")&&(h={value:u,text:u}),f=d?{...d,state:h}:{state:h}}else d&&(f=cc(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let h=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...h]}}else f={...f,extends:n};let p=f?.key||u&&typeof u=="object"&&u.key||`${l}`,g=qt(f,t,p,r);!o&&g?.node&&i.appendChild(g.node)}o||t.node.appendChild(i);return}if(typeof e=="string"){let o=ay(e,t);if(Array.isArray(o)){hp(t,o,r);return}}if(typeof e=="object")for(let o in e){if(wt.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=cc(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],a=Array.isArray(n)?n:[n];s={...s,extends:[...a,...i]}}else s={...s,extends:n};qt(s,t,o,r)}}}function gp(t,e){let r=t.node;if(!r||r.tagName!=="SELECT")return;let n=r.options;if(!n||!n.length)return;let o=t.__ref,s=o&&o.__exec&&o.__exec.value,i=typeof s=="function",a=t.value!=null&&typeof t.value!="function";if(i||a){let f;if(i)try{f=s(t,t.state,t.context)}catch{return}else f=t.value;let u=f==null?"":String(f);r.value!==u&&(r.value=u);return}let c=e||!(o&&o.__selectSynced);if(o&&(o.__selectSynced=!0),!c)return;let l=-1;for(let f=0;f<n.length;f++)n[f].defaultSelected&&(l=f);l>=0&&r.selectedIndex!==l&&(r.selectedIndex=l)}function py(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let a=t.__ref,c=!1,l=Q(()=>{let f=i(t,t.state,t.context);if(!c){c=!0;return}if(f===t.children)return;t.children=f;let u=typeof t.onContentUpdate=="function",d=u?[]:null,p=u?[]:null,g=u?[]:null;if(Array.isArray(f)&&t.childrenAs==="state"){let x=t.childProps,y=[],_=new Map;for(let B=0;B<f.length;B++){let z=f[B],$=x;if(typeof x=="function")try{$=x(t,z)}catch{$=null}let D=$&&$.key||z&&z.key||`${B}`;y.push(D),_.set(D,{rawChild:z,childProps:$})}let v=new Set(y),O=a.__children.slice();for(let B of O)if(!v.has(B)){let z=t[B];z?.remove&&z.remove(),delete t[B],p&&p.push(B)}let P=t.childExtends,U=t.tag==="fragment",E=t.context?.document||globalThis.document,F=U?null:E?.createDocumentFragment();for(let B of y){let z=_.get(B),$=z.rawChild,D=t[B];if(D&&D.state){if($&&typeof $=="object"){let xt=D.state,ur=xt.$replace||xt.replace,_i=xt.$update||xt.update;if(typeof ur=="function")ur.call(xt,$);else if(typeof _i=="function"){for(let Jt in xt)if(!(Jt==="__element"||Jt==="root"||Jt==="parent"||Jt==="update")&&!Object.prototype.hasOwnProperty.call($,Jt))try{xt[Jt]=void 0}catch{}_i.call(xt,$)}else for(let Jt in $)xt[Jt]=$[Jt]}g&&g.push(B);continue}let W=$;(typeof $=="string"||typeof $=="number")&&(W={value:$,text:$});let X=z.childProps,q=X?{...X,state:W}:{state:W};if(P&&!q.ignoreChildExtends)if(q.extends){let xt=Array.isArray(q.extends)?q.extends:[q.extends],ur=Array.isArray(P)?P:[P];q={...q,extends:[...ur,...xt]}}else q={...q,extends:P};let Le=qt(q,t,B,e);!U&&Le?.node&&F&&F.appendChild(Le.node),d&&d.push(B)}if(!U&&F&&F.childNodes.length&&t.node&&t.node.appendChild(F),!U&&t.node){let B=null;for(let z of y){let $=t[z]?.node;if(!$)continue;let D=B?B.nextSibling:t.node.firstChild;$!==D&&t.node.insertBefore($,D),B=$}}a.__children=y,u&&(d.length||p.length)&&ey(t,{added:d,removed:p,kept:g}),gp(t,!1);return}let b=u?[...a.__children]:null;for(let x of[...a.__children]){let y=t[x];y?.remove&&y.remove(),delete t[x]}a.__children=[],hp(t,f,e),gp(t,!1),u&&ey(t,{added:[...a.__children],removed:b,kept:[]})},{depth:a.path.length});a.__effects.push(l)}if(hp(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let a=0;a<i.length;a++){let c=i[a];if(!c.endsWith("Extends")||typeof t[c]!="string")continue;let l=c.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[c]};delete t[c];for(let u=a+1;u<i.length;u++){let d=i[u],p=d.charCodeAt(0);if(p>=65&&p<=90||wt.has(d)||typeof t[d]=="function"&&(d.startsWith("on")||d.startsWith(".")))break;let g=t[d];g!==void 0&&(f[d]=g,delete t[d])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||wt.has(i)||typeof t[i]!="object"||t[i]===null)continue;let a=i.charCodeAt(0);if(a<65||a>90)continue;let c=t[i];if(!c.__ref){if(!c.extends&&!c.extend){let l=s[i]||s[`smbls.${i}`];l&&(c={...c,extends:l})}if(t.childProps&&(c=cc(t.childProps,c)),o&&!c.ignoreChildExtends)if(c.extends){let l=Array.isArray(c.extends)?c.extends:[c.extends],f=Array.isArray(o)?o:[o];c={...c,extends:[...f,...l]}}else c={...c,extends:o};qt(c,t,i,e)}}}function mp(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(o){let i=o.parentNode;if(i){if(r?.position==="before"&&r.node)i.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let a=r.node.nextSibling;i.insertBefore(n,a||o)}else i.insertBefore(n,o);return}}let s=e?.node||(e?.nodeType?e:null);if(s)if(r?.position==="before"&&r.node)s.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let i=r.node.nextSibling;i?s.insertBefore(n,i):s.appendChild(n)}else s.appendChild(n)}function Pe(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&yt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let a=e.context?.designSystem;a&&et(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&yt("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&J(),i&&(e.__ref.__inRender=!1)}}return!0}var hy={blue:"#213eb0",green:"#389d34",red:"#e15c55",yellow:"#EDCB38",orange:"#e97c16",transparent:"rgba(0, 0, 0, 0)",black:"black",gray:"#4e4e50",white:"white",title:["--gray 1 -168","--gray 1 +168"],caption:["--gray 1 -68","--gray 1 +68"],paragraph:["--gray 1 -42","--gray 1 +42"],disabled:["--gray 1 -26","--gray 1 +26"],line:["--gray 1 -16","--gray 1 +16"]},gy={"gradient-blue-light":`linear-gradient(to right,
46
46
  rgba(4, 116, 242, 1),
47
47
  rgba(0, 48, 103, 1)
48
48
  )`,"gradient-blue-dark":`linear-gradient(to right,
@@ -13,4 +13,4 @@ FROM ${c}${l}`},nc=t=>{let e=[],r=(n,s)=>{for(let o in n){let i=s?`${s}/${o}`:o;
13
13
  `).slice(0,6).join(`
14
14
  `):"")}}if(pn(o,!0),hn(o,e,s),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),typeof o.html=="function"&&o.node&&!o.node.innerHTML){let g=o.context?.designSystem;g&&K(g);try{let m=o.html(o,o.state,o.context);m!=null&&typeof m!="function"&&(o.node.innerHTML=m)}catch{}finally{g&&z()}}if(At("Create",o,n),At("Complete",o,n),At("Render",o,n),At("RenderRouter",o,n),Zs(o,n),typeof o.onFrame=="function"){let g=o.onFrame,m=o.context?.designSystem,_=()=>{if(o.node){if(o.node.isConnected){m&&K(m);try{g(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{m&&z()}}requestAnimationFrame(_)}};requestAnimationFrame(_)}return o}function Ta(t,e,r){let n=!e,s=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)&&Object.keys(r.state).length===0,o=n&&s&&t.context?.state,i=r.state!==void 0&&!o?r.state:t.state&&!H(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Rt(t,t.state);else if(t.context?.state){let c=t.context.state,a={...c},l=t.context?.polyglot;if(l?.translations){let f=c.lang||l.defaultLang||"en",u=l.translations[f];if(u&&typeof u=="object")for(let h in u)a[h]===void 0&&(a[h]=u[h]);let d=new Set(l.languages||[]);for(let h in l.translations)!d.has(h)&&a[h]===void 0&&(a[h]=l.translations[h])}t.state=H(a)?a:it(a),t.state.__element=t,t.state.root=t.state,Rt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Rt(t,t.state);return}if(typeof i=="string"){if(t.state=ti(i,e),t.state&&typeof t.state=="object"&&!H(t.state)){let c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}Rt(t,t.state);return}if(typeof i=="function"){let c=i(t,e?.state);t.state=H(c)?c:it(c||{})}else H(i)?t.state=i:t.state=it({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,Rt(t,t.state)}function sn(t,e){if(!e)return t;let r=e.split("/"),n=t;for(let s of r){if(n==null)return{};n=n[s]}return n??{}}function ti(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let s=t.slice(3);return s?sn(e.state,s):e.state??{}}if(t.startsWith("~/")){let s=e.state?.root||e.state,o=t.slice(2);return o?sn(s,o):s??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=sn(e.state,t);if(r!=null&&Object.keys(r).length>0)return r;let n=e.context?.polyglot;if(n?.translations){let s=e.state?.root?.lang||n.defaultLang||"en",o=n.translations[s];if(o?.[t]!==void 0)return o[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function Pa(t){let e=t.__ref,r=t.tag||"div",n=t.context?.designSystem,s=[],o=Object.keys(t);for(let i=0;i<o.length;i++){let c=o[i];if(typeof t[c]!="function"||rt.has(c))continue;let a=c.charCodeAt(0);a>=65&&a<=90||Jt(c)||lt[c]||ot&&ot.has(c)||ke(r,c)||s.push({prop:c,fn:t[c]})}for(let i=0;i<s.length;i++){let{prop:c,fn:a}=s[i];e.__exec[c]=a,Object.defineProperty(t,c,{get(){n&&K(n);try{return a(t,t.state,t.context)}catch{return}finally{n&&z()}},set(l){delete e.__exec[c],Object.defineProperty(t,c,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function ei(t,e){let r=t.__ref,n=!!(e&&e.skipIfEffect);if(Pa(t),typeof t.text=="function"){let o=t.text,i=F(()=>{if(!r.contentManaged)try{let c=o(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&typeof c!="object"&&(typeof c=="string"&&c.includes("{{")&&(c=Me.call(t,c,t.state)),t.tag==="string"?t.node.nodeValue=c:t.node.textContent=c)}catch{}},{depth:r.path.length});r.__effects.push(i),r.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){let o=t.text,i=F(()=>{if(r.contentManaged)return;let c=Me.call(t,o,t.state);c!=null&&(t.text=c),t.node&&(t.tag==="string"?t.node.nodeValue=c??"":t.node.textContent=c??"")},{depth:r.path.length});r.__effects.push(i),r.__exec.text=o}for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!rt.has(o)&&!Jt(o)&&!r.__exec[o]){if(lt[o]){let i=t[o],c=o,a,l=F(()=>{let f=t.context?.designSystem;f&&K(f);try{let u=i(t,t.state,t.context),d=lt[c](u,t,t.state,t.context);if(d&&t.node){let h=Js(d);(h===null||h!==a)&&(a=h,Qt(t.node,d))}else t.node&&(c==="show"||c==="hide")&&(a=void 0,t.node.style.display="")}finally{f&&z()}},{depth:r.path.length});r.__effects.push(l),r.__exec[o]=i}else if(ot&&ot.has(o)){let i=t[o],c=o,a,l=F(()=>{let f=t.context?.designSystem;f&&K(f);try{let u=i(t,t.state,t.context);if(t.node)if(u!=null){let d=c+":"+String(u);d!==a&&(a=d,Qt(t.node,{[c]:u}))}else a=void 0,t.node.style[c]=""}finally{f&&z()}},{depth:r.path.length});r.__effects.push(l),r.__exec[o]=i}}if(typeof t.html=="function"){let o=t.html,i=F(()=>{let c=t.context?.designSystem;c&&K(c);try{let a=o(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&(t.node.innerHTML=a)}finally{c&&z()}},{depth:r.path.length});r.__effects.push(i),r.__exec.html=o}if(typeof t.value=="function"){let o=t.value,i=F(()=>{try{let c=o(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let a=c==null?"":String(c);if(t.node.value===a)return;let l=typeof document<"u"&&document.activeElement===t.node,f=l&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,u=l&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=a,l&&f!=null&&u!=null)try{t.node.setSelectionRange(f,u)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(i),r.__exec.value=o}if(typeof t.style=="function"){let o=t.style,i,c=F(()=>{let a=o(t,t.state,t.context),l=Js(a);(l===null||l!==i)&&(i=l,Qt(t.node,a))},{depth:r.path.length});r.__effects.push(c),r.__exec.style=o}else if(t.style&&typeof t.style=="object")for(let o in t.style){let i=t.style[o];if(typeof i!="function")continue;let c,a=F(()=>{try{let l=i(t,t.state,t.context);if(t.node){let f=o+":"+String(l);f!==c&&(c=f,Qt(t.node,{[o]:l}))}}catch{}},{depth:r.path.length});r.__effects.push(a)}if(t.attr&&typeof t.attr=="object"){for(let o in t.attr)if(typeof t.attr[o]=="function"){let i=t.attr[o],c=o,a=F(()=>{try{let l=i(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,l===!0?"":l))}catch{}},{depth:r.path.length});r.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let i=t.aria[o];if(typeof i!="function")continue;let c="aria-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=F(()=>{try{let l=i(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,l===!0?"":l)}catch{}},{depth:r.path.length});r.__effects.push(a)}if(t.data&&typeof t.data=="object")for(let o in t.data){let i=t.data[o];if(typeof i!="function")continue;let a="data-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),l=F(()=>{try{let f=i(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(a):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(a,f===!0?"":f)}catch{}},{depth:r.path.length});r.__effects.push(l)}let s=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(s)for(let o in s){let i=s[o];if(typeof i!="function")continue;let c=F(()=>{try{let a=i(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:r.path.length});r.__effects.push(c)}!n&&typeof t.if=="function"&&ri(t,r,t.if);for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||rt.has(o)||typeof t[o]!="function")continue;let i=o.charCodeAt(0);if(i>=65&&i<=90||Jt(o))continue;let c=t[o];r.__exec[o]=c;let a=t.tag||"div";if(ke(a,o)&&!lt[o]&&!(ot&&ot.has(o))){let l=o,f=F(()=>{try{let u=c(t,t.state,t.context);t.node?.setAttribute&&(u==null||u===!1?t.node.removeAttribute(l):typeof u!="function"&&typeof u!="object"&&(l==="src"&&"src"in t.node?t.node.src=u:t.node.setAttribute(l,u===!0?"":u)))}catch{}},{depth:r.path.length});r.__effects.push(f)}}if(Da(t),ja(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){let o=t.onStateUpdate,i=t.stateDeps,c=!1,a=[],l=F(()=>{let f=[];for(let p=0;p<i.length;p++){let g=i[p];try{f[p]=typeof g=="function"?g(t,t.state,t.context):t.state?.[g]}catch{f[p]=void 0}}if(!c){c=!0,a=f;return}let u=f.length!==a.length;for(let p=0;!u&&p<f.length;p++)f[p]!==a[p]&&(u=!0);let d=a;if(a=f,!u)return;let h=t.context?.designSystem;h&&K(h);try{o(t,t.state,t.context,{prev:d,next:f})}catch(p){if(t.context?.plugins?.length&&xt("error",t,{hook:"onStateUpdate",error:p})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',p),t.context?.strictMode)throw p}finally{h&&z()}},{depth:r.path.length});r.__effects.push(l)}}function ri(t,e,r){let n=F(()=>{let s;try{s=r(t,t.state,t.context)}catch(i){if(s=!1,e.__ifError=i,typeof console<"u"&&console.warn){let c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,i?.message||i)}return}let o=e.__if;if(e.__if=!!s,o&&!e.__if&&t.node)t.node.remove();else if(!o&&e.__if)if(e.__ifInitialized){t.node||(t.node=ee(t)),t.node&&(t.node.ref=t);let i=t.parent,c=i?.node;if(c&&t.node){let a=null,l=Object.keys(i),f=l.indexOf(t.key);for(let u=f+1;u<l.length;u++){let d=i[l[u]];if(d?.node?.parentNode===c){a=d.node;break}}a?c.insertBefore(t.node,a):c.appendChild(t.node)}else hn(t,t.parent);un(t)}else{if(e.__ifInitialized=!0,t.tag||(t.tag=te(t)),At("Init",t,{}),t.node||(t.node=ee(t)),!t.node)return;if(t.tag==="fragment"&&!e.__fragmentAnchor){let c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),e.__fragmentAnchor=c}At("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),si(t,{}),ei(t,{skipIfEffect:!0}),un(t),ni(t),ii(t,{}),hn(t,t.parent),Zs(t,{})}},{depth:e.path.length});e.__effects.push(n)}function un(t){let{node:e}=t;if(e){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?e.nodeValue=t.text:e.textContent=t.text:typeof t.text=="number"&&(e.textContent=t.text),La(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){let r=String(t.value);e.value!==r&&(e.value=r)}if(t.style&&typeof t.style=="object"&&Qt(e,t.style),t.attr&&typeof t.attr=="object")for(let r in t.attr){let n=t.attr[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.setAttribute&&e.setAttribute(r,n===!0?"":n)}if(t.data&&typeof t.data=="object")for(let r in t.data){let n=t.data[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.dataset&&(e.dataset[r]=n===!0?"":n)}if(t.classlist||t.class){let r=t.classlist||t.class;if(typeof r=="string")r.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof r=="object")for(let n in r){let s=typeof r[n]=="function"?r[n](t,t.state,t.context):r[n];s&&e.classList.add(typeof s=="string"?s:n)}}}}function Js(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Qt(t,e){if(!t||!e||!t.style)return;let r=null;for(let n in e){let s=e[n];if(s!=null){if(n.charAt(0)==="&"&&typeof s=="object"){r||(r={}),r[n]=s;continue}try{let o=String(s),i=n.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),c=o.trim(),a=/\s*!important\s*$/.test(c),l=c.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,a?"important":"")}catch{}}}r&&Ia(t,r)}var Ra=0;function Ia(t,e){let r=`_ds${Ra++}`;t.classList.add(r);let n=t.ownerDocument,s=n.querySelector("style[data-smbls-scoped]");s||(s=n.createElement("style"),s.setAttribute("data-smbls-scoped",""),n.head.appendChild(s));let o="";for(let i in e){let c="."+r,a=i.replace(/&/g,c).split(",").map(f=>{let u=f.trim();return u.includes(c)?u:c+u}).join(", "),l=e[i];if(typeof l=="object"){let f="",u="";for(let d in l){let h=l[d];if(typeof h=="object"){let p=d.includes("&")?a.split(", ").map(m=>d.replace(/&/g,m)).join(", "):a.split(", ").map(m=>`${m} ${d}`).join(", "),g="";for(let m in h)g+=`${m.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${h[m]};`;u+=`${p} { ${g} }
15
15
  `}else f+=`${d.replace(/[A-Z]/g,p=>"-"+p.toLowerCase())}: ${h};`}f&&(o+=`${a} { ${f} }
16
- `),u&&(o+=u)}}o&&(s.textContent+=o)}function Da(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let s=e[n];if(typeof s!="string"||s.length===0)continue;let o=s.split("."),i=o[0],c=o.slice(1),a={value:!1},l=F(()=>{let f=t.state&&(H(t.state)?t.state.root:null);if(!f||!H(f))return;let u=f;u=u[i];for(let h=0;h<c.length&&!(u==null||typeof u!="object");h++)if(H(u))u=u[c[h]];else break;if(!a.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let h=t.context?.designSystem;h&&K(h);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(p){t.context?.plugins?.length&&xt("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}finally{h&&z()}}if(!d&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){let p=r.__effects[h];p&&p!==l&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}if(!d&&typeof t.onUpdate=="function"){let h=t.context?.designSystem;h&&K(h);try{t.onUpdate(t,t.state,t.context)}catch(p){t.context?.plugins?.length&&xt("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}finally{h&&z()}}},{depth:r.path.length});a.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function gn(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}var Xs=new Set;function Ma(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;Xs.has(n)||(Xs.add(n),console.warn(`[smbls/css] "${t}" at ${r} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function Xt(t,e,r){let n={},s=(o,i)=>{if(lt[o]){let c=lt[o](i,e,e.state,e.context);if(c){let a=Array.isArray(c)?c:[c];for(let l of a)l&&Object.assign(n,l)}}else n[o]=i};for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let i=t[o];if(typeof i=="function"&&(i=i(e,e.state,e.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(o==="style"){for(let l in i){let f=i[l];typeof f=="function"&&(f=f(e,e.state,e.context)),!(f==null||typeof f=="function")&&s(l,f)}continue}if(gn(o,e)){let l=Xt(i,e,!0);Object.keys(l).length&&(n[`[data-theme="${o.slice(1)}"] &`]=l);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(o)){we()&&Ma(o,e);continue}let c=o;if(o.charCodeAt(0)===64&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){let l=e.context?.designSystem?.media?.[o.slice(1)];l&&(c=`@media ${l}`)}let a=Xt(i,e,!1);Object.keys(a).length&&(n[c]=a);continue}s(o,i)}}if(r)for(let o in n){let i=n[o];typeof i=="string"&&!i.includes("!important")&&(n[o]=i+" !important")}return n}function ja(t){let e=t.__ref;e.__conditionalRunners=[];let r=new Map;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=n.charAt(0);if(s!=="."&&s!=="!")continue;let o=n.slice(1);if(!o)continue;let i=t[n];if(!i||typeof i!="object")continue;let c=s==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{if(!t.node)return;let u,d=t[o];if(d===void 0)if(t.state&&o in t.state)u=t.state[o];else{let g=t.context?.cases?.[o];if(g===void 0)return;try{u=typeof g=="function"?g.call(t,t):g}catch(m){u=!1,e.__conditionalError=m,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,m?.message||m)}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(g){u=!1,e.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}else u=d;let h=c?!u:!!u;if(h===a.lastMatch)return;a.lastMatch=h;let p=t.context?.designSystem;p&&K(p);try{if(h){let g={},m={},_=!1;for(let y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;let x=i[y],S=y.charAt(0);if((S===":"||S==="@"||S==="&")&&x&&typeof x=="object"&&!Array.isArray(x)){if(gn(y,t)){let $=Xt(x,t,!0);Object.keys($).length&&(m[`[data-theme="${y.slice(1)}"] &`]=$,_=!0)}else{let $=y;if(S==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let M=t.context?.designSystem?.media?.[y.slice(1)];M&&($=`@media ${M}`)}let q=Xt(x,t,!1);Object.keys(q).length&&(m[$]=q,_=!0)}continue}let P=typeof x=="function"?x(t,t.state,t.context):x;if(P!=null)if(lt[y]){let $=lt[y](P,t,t.state,t.context);if($){let q=Array.isArray($)?$:[$];for(let M of q)M&&Object.assign(g,M)}}else ot&&ot.has(y)&&(g[y]=P)}let b=Object.keys(g);if(b.length){Qt(t.node,g);for(let y of b)r.set(y,n);a.appliedKeys=b}else a.appliedKeys=null;if(_){let y=ve(m,null,t.context?.cssPrefix),x=y?y.split(" ").filter(Boolean):[];if(x.length&&t.node.classList){for(let S of x)t.node.classList.add(S);a.appliedClasses=x}else a.appliedClasses=null}else if(a.appliedClasses){for(let y of a.appliedClasses)t.node.classList.remove(y);a.appliedClasses=null}}else{if(a.appliedKeys){for(let g of a.appliedKeys)r.get(g)===n&&(t.node.style[g]="",r.delete(g));a.appliedKeys=null}if(a.appliedClasses){for(let g of a.appliedClasses)t.node.classList.remove(g);a.appliedClasses=null}}}finally{p&&z()}};e.__conditionalRunners.push(l);let f=F(l,{depth:e.path.length});e.__effects.push(f)}}var cn=new WeakSet;function Fa(t){let e=t.ownerDocument;!e||cn.has(e)||(cn.add(e),queueMicrotask(()=>{cn.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var an=new WeakSet,Ys=!1;function La(t){let{node:e}=t;if(!e)return;if(Ys||(Ys=!0,ve({display:"none"})),an.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}an.add(t);let r=t.context?.designSystem;r&&K(r);try{let n={},s=!1;for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||rt.has(o))continue;let i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!Jt(o)){if(lt[o]){let c=t[o],a=lt[o](c,t,t.state,t.context);if(a){if(Array.isArray(a))for(let l of a)l&&Object.assign(n,l);else Object.assign(n,a);s=!0}}else if(ot&&ot.has(o)){let c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,s=!0)}else if(o.charCodeAt(0)===45){let c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,s=!0)}else if(o.charAt(0)==="&"){let c=t[o];c&&typeof c=="object"&&(n[o]=c,s=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){let c=t[o];if(c&&typeof c=="object"){if(gn(o,t)){let a=Xt(c,t,!0);Object.keys(a).length&&(n[`[data-theme="${o.slice(1)}"] &`]=a,s=!0)}else{let a=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){let f=t.context?.designSystem?.media?.[o.slice(1)];f&&(a=`@media ${f}`)}let l=Xt(c,t,!1);Object.keys(l).length&&(n[a]=l,s=!0)}s=!0}}}}if(s){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let o=ve(n,null,t.context?.cssPrefix);if(o&&e.classList){let c=o.split(" ").filter(Boolean),a=!1;for(let l of c)e.classList.add(l),a||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(a=!0);a&&Fa(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let c=n.display;if(c&&c!==i)if(i==="none"){let a=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&a.push(l);for(let l of a)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&z(),an.delete(t)}}function ni(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let s in t.aria){let o=t.aria[s];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;let i="aria-"+s.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(i,o===!0?"":o)}let r=Ks(t);for(let s in r){let o=r[s];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&e.setAttribute(s,o===!0?"":o)}let n=t.tag||"div";for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||rt.has(s)||s==="on"||r[s]!==void 0)continue;let o=s.charCodeAt(0);if(!(o>=65&&o<=90)&&!Jt(s)&&!(lt[s]||ot&&ot.has(s))&&ke(n,s)){let i=t[s];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=Me(i,t,t.state,t.context),t[s]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(s,i===!0?"":i)}}}function Na(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let s=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};s(),e.addEventListener("input",s),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",s)}catch{}})}var oi=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function si(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!Jt(r)||oi.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let o=n;n=function(c){return t.call(o,c)}}if(typeof n!="function")continue;let s=Oa(r);re.has(s)||_e($a(s),t,n)}Va(t)}function Va(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of oi){let h=t[d];typeof h=="function"&&(r[d]=h,n=!0)}if(!n)return;let s=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,c=0,a=0,l=!1,f=d=>{let h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(i=h.clientX,c=h.clientY,a=Date.now(),l=!0)},u=d=>{if(!l)return;l=!1;let h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;let p=h.clientX-i,g=h.clientY-c,m=Date.now()-a;if(m>o)return;let _=Math.abs(p),b=Math.abs(g);if(Math.max(_,b)<s)return;let y;if(_>b*1.2)y=p<0?"left":"right";else if(b>_*1.2)y=g<0?"up":"down";else return;let x="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),S=r[x],P=r.onSwipe;S&&S.call(t,d,t,t.state,t.context),P&&P.call(t,{direction:y,dx:p,dy:g,dt:m,event:d},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function er(t,e){let r={...t};for(let n in e){let s=r[n],o=e[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)&&typeof s!="function"&&typeof o!="function"?r[n]=er(s,o):r[n]=o}return r}function dn(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=t.tag==="fragment",o=t.context?.document||globalThis.document,i=s?null:o?.createDocumentFragment();if(!s&&!i)return;let c=t.childProps,a=t.childrenAs;for(let l=0;l<e.length;l++){let f=e[l],u=f;(typeof f=="string"||typeof f=="number")&&(f={text:f});let d=c;if(typeof c=="function")try{d=c(t,f)}catch{d=null}if(a==="state"){let g=u;(typeof u=="string"||typeof u=="number")&&(g={value:u,text:u}),f=d?{...d,state:g}:{state:g}}else d&&(f=er(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let g=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...g]}}else f={...f,extends:n};let h=f?.key||u&&typeof u=="object"&&u.key||`${l}`,p=ft(f,t,h,r);!s&&p?.node&&i.appendChild(p.node)}s||t.node.appendChild(i);return}if(typeof e=="string"){let s=ti(e,t);if(Array.isArray(s)){dn(t,s,r);return}}if(typeof e=="object")for(let s in e){if(rt.has(s))continue;let o=e[s];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=er(t.childProps,o)),n&&!o.ignoreChildExtends)if(o.extends){let i=Array.isArray(o.extends)?o.extends:[o.extends],c=Array.isArray(n)?n:[n];o={...o,extends:[...c,...i]}}else o={...o,extends:n};ft(o,t,s,r)}}}function pn(t,e){let r=t.node;if(!r||r.tagName!=="SELECT")return;let n=r.options;if(!n||!n.length)return;let s=t.__ref,o=s&&s.__exec&&s.__exec.value,i=typeof o=="function",c=t.value!=null&&typeof t.value!="function";if(i||c){let f;if(i)try{f=o(t,t.state,t.context)}catch{return}else f=t.value;let u=f==null?"":String(f);r.value!==u&&(r.value=u);return}let a=e||!(s&&s.__selectSynced);if(s&&(s.__selectSynced=!0),!a)return;let l=-1;for(let f=0;f<n.length;f++)n[f].defaultSelected&&(l=f);l>=0&&r.selectedIndex!==l&&(r.selectedIndex=l)}function ii(t,e){let{children:r,content:n}=t,s=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let c=t.__ref,a=!1,l=F(()=>{let f=i(t,t.state,t.context);if(!a){a=!0;return}if(f===t.children)return;t.children=f;let u=typeof t.onContentUpdate=="function",d=u?[]:null,h=u?[]:null,p=u?[]:null;if(Array.isArray(f)&&t.childrenAs==="state"){let b=t.childProps,y=[],x=new Map;for(let R=0;R<f.length;R++){let W=f[R],E=b;if(typeof b=="function")try{E=b(t,W)}catch{E=null}let G=E&&E.key||W&&W.key||`${R}`;y.push(G),x.set(G,{rawChild:W,childProps:E})}let S=new Set(y),P=c.__children.slice();for(let R of P)if(!S.has(R)){let W=t[R];W?.remove&&W.remove(),delete t[R],h&&h.push(R)}let $=t.childExtends,q=t.tag==="fragment",M=t.context?.document||globalThis.document,Q=q?null:M?.createDocumentFragment();for(let R of y){let W=x.get(R),E=W.rawChild,G=t[R];if(G&&G.state){if(E&&typeof E=="object"){let Z=G.state,Dt=Z.$replace||Z.replace,Ee=Z.$update||Z.update;if(typeof Dt=="function")Dt.call(Z,E);else if(typeof Ee=="function"){for(let ut in Z)if(!(ut==="__element"||ut==="root"||ut==="parent"||ut==="update")&&!Object.prototype.hasOwnProperty.call(E,ut))try{Z[ut]=void 0}catch{}Ee.call(Z,E)}else for(let ut in E)Z[ut]=E[ut]}p&&p.push(R);continue}let Y=E;(typeof E=="string"||typeof E=="number")&&(Y={value:E,text:E});let nt=W.childProps,j=nt?{...nt,state:Y}:{state:Y};if($&&!j.ignoreChildExtends)if(j.extends){let Z=Array.isArray(j.extends)?j.extends:[j.extends],Dt=Array.isArray($)?$:[$];j={...j,extends:[...Dt,...Z]}}else j={...j,extends:$};let It=ft(j,t,R,e);!q&&It?.node&&Q&&Q.appendChild(It.node),d&&d.push(R)}if(!q&&Q&&Q.childNodes.length&&t.node&&t.node.appendChild(Q),!q&&t.node){let R=null;for(let W of y){let E=t[W]?.node;if(!E)continue;let G=R?R.nextSibling:t.node.firstChild;E!==G&&t.node.insertBefore(E,G),R=E}}c.__children=y,u&&(d.length||h.length)&&qs(t,{added:d,removed:h,kept:p}),pn(t,!1);return}let _=u?[...c.__children]:null;for(let b of[...c.__children]){let y=t[b];y?.remove&&y.remove(),delete t[b]}c.__children=[],dn(t,f,e),pn(t,!1),u&&qs(t,{added:[...c.__children],removed:_,kept:[]})},{depth:c.path.length});c.__effects.push(l)}if(dn(t,r||n,e),r||n)return;let o=t.context?.components||{};{let i=Object.keys(t);for(let c=0;c<i.length;c++){let a=i[c];if(!a.endsWith("Extends")||typeof t[a]!="string")continue;let l=a.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[a]};delete t[a];for(let u=c+1;u<i.length;u++){let d=i[u],h=d.charCodeAt(0);if(h>=65&&h<=90||rt.has(d)||typeof t[d]=="function"&&(d.startsWith("on")||d.startsWith(".")))break;let p=t[d];p!==void 0&&(f[d]=p,delete t[d])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||rt.has(i)||typeof t[i]!="object"||t[i]===null)continue;let c=i.charCodeAt(0);if(c<65||c>90)continue;let a=t[i];if(!a.__ref){if(!a.extends&&!a.extend){let l=o[i]||o[`smbls.${i}`];l&&(a={...a,extends:l})}if(t.childProps&&(a=er(t.childProps,a)),s&&!a.ignoreChildExtends)if(a.extends){let l=Array.isArray(a.extends)?a.extends:[a.extends],f=Array.isArray(s)?s:[s];a={...a,extends:[...f,...l]}}else a={...a,extends:s};ft(a,t,i,e)}}}function hn(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let s=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(s){let i=s.parentNode;if(i){if(r?.position==="before"&&r.node)i.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let c=r.node.nextSibling;i.insertBefore(n,c||s)}else i.insertBefore(n,s);return}}let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let i=r.node.nextSibling;i?o.insertBefore(n,i):o.appendChild(n)}else o.appendChild(n)}function At(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&xt(n,e,r);let s="on"+t,o=e[s];if(typeof o=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let c=e.context?.designSystem;c&&K(c);try{if(o(e,e.state,e.context,r)===!1)return!1}catch(a){if(e.context?.plugins?.length&&xt("error",e,{hook:s,error:a})||console.error(`[DOMQL] Lifecycle "${s}" error:`,a),e.context?.strictMode)throw a}finally{c&&z(),i&&(e.__ref.__inRender=!1)}}return!0}var Ba=ft;var Ua=(t,e,r={})=>{if(!t||typeof t!="object")throw new Error("[SymbolsEmbed.mount] rootDef must be an object");if(typeof Node>"u"||!(e instanceof Node))throw new Error("[SymbolsEmbed.mount] host must be a DOM element");let n=r.state?it(r.state):void 0;return ft(t,e,"Root",{state:n,context:r.context||{}})};return di(Wa);})();
16
+ `),u&&(o+=u)}}o&&(s.textContent+=o)}function Da(t){let e=t.subscribeTo;if(typeof e=="function")try{e=e(t,t.state,t.context)}catch{e=null}if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let s=e[n];if(typeof s!="string"||s.length===0)continue;let o=s.split("."),i=o[0],c=o.slice(1),a={value:!1},l=F(()=>{let f=t.state&&(H(t.state)?t.state.root:null);if(!f||!H(f))return;let u=f;u=u[i];for(let h=0;h<c.length&&!(u==null||typeof u!="object");h++)if(H(u))u=u[c[h]];else break;if(!a.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let h=t.context?.designSystem;h&&K(h);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(p){t.context?.plugins?.length&&xt("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}finally{h&&z()}}if(!d&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){let p=r.__effects[h];p&&p!==l&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}if(!d&&typeof t.onUpdate=="function"){let h=t.context?.designSystem;h&&K(h);try{t.onUpdate(t,t.state,t.context)}catch(p){t.context?.plugins?.length&&xt("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}finally{h&&z()}}},{depth:r.path.length});a.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function gn(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}var Xs=new Set;function Ma(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;Xs.has(n)||(Xs.add(n),console.warn(`[smbls/css] "${t}" at ${r} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function Xt(t,e,r){let n={},s=(o,i)=>{if(lt[o]){let c=lt[o](i,e,e.state,e.context);if(c){let a=Array.isArray(c)?c:[c];for(let l of a)l&&Object.assign(n,l)}}else n[o]=i};for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let i=t[o];if(typeof i=="function"&&(i=i(e,e.state,e.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(o==="style"){for(let l in i){let f=i[l];typeof f=="function"&&(f=f(e,e.state,e.context)),!(f==null||typeof f=="function")&&s(l,f)}continue}if(gn(o,e)){let l=Xt(i,e,!0);Object.keys(l).length&&(n[`[data-theme="${o.slice(1)}"] &`]=l);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(o)){we()&&Ma(o,e);continue}let c=o;if(o.charCodeAt(0)===64&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){let l=e.context?.designSystem?.media?.[o.slice(1)];l&&(c=`@media ${l}`)}let a=Xt(i,e,!1);Object.keys(a).length&&(n[c]=a);continue}s(o,i)}}if(r)for(let o in n){let i=n[o];typeof i=="string"&&!i.includes("!important")&&(n[o]=i+" !important")}return n}function ja(t){let e=t.__ref;e.__conditionalRunners=[];let r=new Map;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=n.charAt(0);if(s!=="."&&s!=="!")continue;let o=n.slice(1);if(!o)continue;let i=t[n];if(!i||typeof i!="object")continue;let c=s==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{if(!t.node)return;let u,d=t[o];if(d===void 0)if(t.state&&o in t.state)u=t.state[o];else{let g=t.context?.cases?.[o];if(g===void 0)return;try{u=typeof g=="function"?g.call(t,t):g}catch(m){u=!1,e.__conditionalError=m,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,m?.message||m)}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(g){u=!1,e.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}else u=d;let h=c?!u:!!u;if(h===a.lastMatch)return;a.lastMatch=h;let p=t.context?.designSystem;p&&K(p);try{if(h){let g={},m={},_=!1;for(let y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;let x=i[y],S=y.charAt(0);if((S===":"||S==="@"||S==="&")&&x&&typeof x=="object"&&!Array.isArray(x)){if(gn(y,t)){let $=Xt(x,t,!0);Object.keys($).length&&(m[`[data-theme="${y.slice(1)}"] &`]=$,_=!0)}else{let $=y;if(S==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let M=t.context?.designSystem?.media?.[y.slice(1)];M&&($=`@media ${M}`)}let q=Xt(x,t,!1);Object.keys(q).length&&(m[$]=q,_=!0)}continue}let P=typeof x=="function"?x(t,t.state,t.context):x;if(P!=null)if(lt[y]){let $=lt[y](P,t,t.state,t.context);if($){let q=Array.isArray($)?$:[$];for(let M of q)M&&Object.assign(g,M)}}else ot&&ot.has(y)&&(g[y]=P)}let b=Object.keys(g);if(b.length){Qt(t.node,g);for(let y of b)r.set(y,n);a.appliedKeys=b}else a.appliedKeys=null;if(_){let y=ve(m,null,t.context?.cssPrefix),x=y?y.split(" ").filter(Boolean):[];if(x.length&&t.node.classList){for(let S of x)t.node.classList.add(S);a.appliedClasses=x}else a.appliedClasses=null}else if(a.appliedClasses){for(let y of a.appliedClasses)t.node.classList.remove(y);a.appliedClasses=null}}else{if(a.appliedKeys){for(let g of a.appliedKeys)r.get(g)===n&&(t.node.style[g]="",r.delete(g));a.appliedKeys=null}if(a.appliedClasses){for(let g of a.appliedClasses)t.node.classList.remove(g);a.appliedClasses=null}}}finally{p&&z()}};e.__conditionalRunners.push(l);let f=F(l,{depth:e.path.length});e.__effects.push(f)}}var cn=new WeakSet;function Fa(t){let e=t.ownerDocument;!e||cn.has(e)||(cn.add(e),queueMicrotask(()=>{cn.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var an=new WeakSet,Ys=!1;function La(t){let{node:e}=t;if(!e)return;if(Ys||(Ys=!0,ve({display:"none"})),an.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}an.add(t);let r=t.context?.designSystem;r&&K(r);try{let n={},s=!1;for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||rt.has(o))continue;let i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!Jt(o)){if(lt[o]){let c=t[o],a=lt[o](c,t,t.state,t.context);if(a){if(Array.isArray(a))for(let l of a)l&&Object.assign(n,l);else Object.assign(n,a);s=!0}}else if(ot&&ot.has(o)){let c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,s=!0)}else if(o.charCodeAt(0)===45){let c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,s=!0)}else if(o.charAt(0)==="&"){let c=t[o];c&&typeof c=="object"&&(n[o]=c,s=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){let c=t[o];if(c&&typeof c=="object"){if(gn(o,t)){let a=Xt(c,t,!0);Object.keys(a).length&&(n[`[data-theme="${o.slice(1)}"] &`]=a,s=!0)}else{let a=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){let f=t.context?.designSystem?.media?.[o.slice(1)];f&&(a=`@media ${f}`)}let l=Xt(c,t,!1);Object.keys(l).length&&(n[a]=l,s=!0)}s=!0}}}}if(s){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let o=ve(n,null,t.context?.cssPrefix);if(o&&e.classList){let c=o.split(" ").filter(Boolean),a=!1;for(let l of c)e.classList.add(l),a||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(a=!0);a&&Fa(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let c=n.display;if(c&&c!==i)if(i==="none"){let a=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&a.push(l);for(let l of a)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&z(),an.delete(t)}}function ni(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let s in t.aria){let o=t.aria[s];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;let i="aria-"+s.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(i,o===!0?"":o)}let r=Ks(t);for(let s in r){let o=r[s];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&e.setAttribute(s,o===!0?"":o)}let n=t.tag||"div";for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||rt.has(s)||s==="on"||r[s]!==void 0)continue;let o=s.charCodeAt(0);if(!(o>=65&&o<=90)&&!Jt(s)&&!(lt[s]||ot&&ot.has(s))&&ke(n,s)){let i=t[s];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=Me(i,t,t.state,t.context),t[s]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(s,i===!0?"":i)}}}function Na(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let s=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};s(),e.addEventListener("input",s),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",s)}catch{}})}var oi=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function si(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!Jt(r)||oi.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let o=n;n=function(c){return t.call(o,c)}}if(typeof n!="function")continue;let s=Oa(r);re.has(s)||_e($a(s),t,n)}Va(t)}function Va(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of oi){let h=t[d];typeof h=="function"&&(r[d]=h,n=!0)}if(!n)return;let s=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,c=0,a=0,l=!1,f=d=>{let h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(i=h.clientX,c=h.clientY,a=Date.now(),l=!0)},u=d=>{if(!l)return;l=!1;let h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;let p=h.clientX-i,g=h.clientY-c,m=Date.now()-a;if(m>o)return;let _=Math.abs(p),b=Math.abs(g);if(Math.max(_,b)<s)return;let y;if(_>b*1.2)y=p<0?"left":"right";else if(b>_*1.2)y=g<0?"up":"down";else return;let x="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),S=r[x],P=r.onSwipe;S&&S.call(t,d,t,t.state,t.context),P&&P.call(t,{direction:y,dx:p,dy:g,dt:m,event:d},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function er(t,e){let r={...t};for(let n in e){let s=r[n],o=e[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)&&typeof s!="function"&&typeof o!="function"?r[n]=er(s,o):r[n]=o}return r}function dn(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=t.tag==="fragment",o=t.context?.document||globalThis.document,i=s?null:o?.createDocumentFragment();if(!s&&!i)return;let c=t.childProps,a=t.childrenAs;for(let l=0;l<e.length;l++){let f=e[l],u=f;(typeof f=="string"||typeof f=="number")&&(f={text:f});let d=c;if(typeof c=="function")try{d=c(t,f)}catch{d=null}if(a==="state"){let g=u;(typeof u=="string"||typeof u=="number")&&(g={value:u,text:u}),f=d?{...d,state:g}:{state:g}}else d&&(f=er(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let g=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...g]}}else f={...f,extends:n};let h=f?.key||u&&typeof u=="object"&&u.key||`${l}`,p=ft(f,t,h,r);!s&&p?.node&&i.appendChild(p.node)}s||t.node.appendChild(i);return}if(typeof e=="string"){let s=ti(e,t);if(Array.isArray(s)){dn(t,s,r);return}}if(typeof e=="object")for(let s in e){if(rt.has(s))continue;let o=e[s];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=er(t.childProps,o)),n&&!o.ignoreChildExtends)if(o.extends){let i=Array.isArray(o.extends)?o.extends:[o.extends],c=Array.isArray(n)?n:[n];o={...o,extends:[...c,...i]}}else o={...o,extends:n};ft(o,t,s,r)}}}function pn(t,e){let r=t.node;if(!r||r.tagName!=="SELECT")return;let n=r.options;if(!n||!n.length)return;let s=t.__ref,o=s&&s.__exec&&s.__exec.value,i=typeof o=="function",c=t.value!=null&&typeof t.value!="function";if(i||c){let f;if(i)try{f=o(t,t.state,t.context)}catch{return}else f=t.value;let u=f==null?"":String(f);r.value!==u&&(r.value=u);return}let a=e||!(s&&s.__selectSynced);if(s&&(s.__selectSynced=!0),!a)return;let l=-1;for(let f=0;f<n.length;f++)n[f].defaultSelected&&(l=f);l>=0&&r.selectedIndex!==l&&(r.selectedIndex=l)}function ii(t,e){let{children:r,content:n}=t,s=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let c=t.__ref,a=!1,l=F(()=>{let f=i(t,t.state,t.context);if(!a){a=!0;return}if(f===t.children)return;t.children=f;let u=typeof t.onContentUpdate=="function",d=u?[]:null,h=u?[]:null,p=u?[]:null;if(Array.isArray(f)&&t.childrenAs==="state"){let b=t.childProps,y=[],x=new Map;for(let R=0;R<f.length;R++){let W=f[R],E=b;if(typeof b=="function")try{E=b(t,W)}catch{E=null}let G=E&&E.key||W&&W.key||`${R}`;y.push(G),x.set(G,{rawChild:W,childProps:E})}let S=new Set(y),P=c.__children.slice();for(let R of P)if(!S.has(R)){let W=t[R];W?.remove&&W.remove(),delete t[R],h&&h.push(R)}let $=t.childExtends,q=t.tag==="fragment",M=t.context?.document||globalThis.document,Q=q?null:M?.createDocumentFragment();for(let R of y){let W=x.get(R),E=W.rawChild,G=t[R];if(G&&G.state){if(E&&typeof E=="object"){let Z=G.state,Dt=Z.$replace||Z.replace,Ee=Z.$update||Z.update;if(typeof Dt=="function")Dt.call(Z,E);else if(typeof Ee=="function"){for(let ut in Z)if(!(ut==="__element"||ut==="root"||ut==="parent"||ut==="update")&&!Object.prototype.hasOwnProperty.call(E,ut))try{Z[ut]=void 0}catch{}Ee.call(Z,E)}else for(let ut in E)Z[ut]=E[ut]}p&&p.push(R);continue}let Y=E;(typeof E=="string"||typeof E=="number")&&(Y={value:E,text:E});let nt=W.childProps,j=nt?{...nt,state:Y}:{state:Y};if($&&!j.ignoreChildExtends)if(j.extends){let Z=Array.isArray(j.extends)?j.extends:[j.extends],Dt=Array.isArray($)?$:[$];j={...j,extends:[...Dt,...Z]}}else j={...j,extends:$};let It=ft(j,t,R,e);!q&&It?.node&&Q&&Q.appendChild(It.node),d&&d.push(R)}if(!q&&Q&&Q.childNodes.length&&t.node&&t.node.appendChild(Q),!q&&t.node){let R=null;for(let W of y){let E=t[W]?.node;if(!E)continue;let G=R?R.nextSibling:t.node.firstChild;E!==G&&t.node.insertBefore(E,G),R=E}}c.__children=y,u&&(d.length||h.length)&&qs(t,{added:d,removed:h,kept:p}),pn(t,!1);return}let _=u?[...c.__children]:null;for(let b of[...c.__children]){let y=t[b];y?.remove&&y.remove(),delete t[b]}c.__children=[],dn(t,f,e),pn(t,!1),u&&qs(t,{added:[...c.__children],removed:_,kept:[]})},{depth:c.path.length});c.__effects.push(l)}if(dn(t,r||n,e),r||n)return;let o=t.context?.components||{};{let i=Object.keys(t);for(let c=0;c<i.length;c++){let a=i[c];if(!a.endsWith("Extends")||typeof t[a]!="string")continue;let l=a.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[a]};delete t[a];for(let u=c+1;u<i.length;u++){let d=i[u],h=d.charCodeAt(0);if(h>=65&&h<=90||rt.has(d)||typeof t[d]=="function"&&(d.startsWith("on")||d.startsWith(".")))break;let p=t[d];p!==void 0&&(f[d]=p,delete t[d])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||rt.has(i)||typeof t[i]!="object"||t[i]===null)continue;let c=i.charCodeAt(0);if(c<65||c>90)continue;let a=t[i];if(!a.__ref){if(!a.extends&&!a.extend){let l=o[i]||o[`smbls.${i}`];l&&(a={...a,extends:l})}if(t.childProps&&(a=er(t.childProps,a)),s&&!a.ignoreChildExtends)if(a.extends){let l=Array.isArray(a.extends)?a.extends:[a.extends],f=Array.isArray(s)?s:[s];a={...a,extends:[...f,...l]}}else a={...a,extends:s};ft(a,t,i,e)}}}function hn(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let s=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(s){let i=s.parentNode;if(i){if(r?.position==="before"&&r.node)i.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let c=r.node.nextSibling;i.insertBefore(n,c||s)}else i.insertBefore(n,s);return}}let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let i=r.node.nextSibling;i?o.insertBefore(n,i):o.appendChild(n)}else o.appendChild(n)}function At(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&xt(n,e,r);let s="on"+t,o=e[s];if(typeof o=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let c=e.context?.designSystem;c&&K(c);try{if(o(e,e.state,e.context,r)===!1)return!1}catch(a){if(e.context?.plugins?.length&&xt("error",e,{hook:s,error:a})||console.error(`[DOMQL] Lifecycle "${s}" error:`,a),e.context?.strictMode)throw a}finally{c&&z(),i&&(e.__ref.__inRender=!1)}}return!0}var Ba=ft;var Ua=(t,e,r={})=>{if(!t||typeof t!="object")throw new Error("[SymbolsEmbed.mount] rootDef must be an object");if(typeof Node>"u"||!(e instanceof Node))throw new Error("[SymbolsEmbed.mount] host must be a DOM element");let n=r.state?it(r.state):void 0;return ft(t,e,"Root",{state:n,context:r.context||{}})};return di(Wa);})();
package/dist/smbls.esm.js CHANGED
@@ -42,7 +42,7 @@ FROM ${a}${l}`},xw=t=>{let e=[],r=(n,o)=>{for(let s in n){let i=o?`${o}/${s}`:s;
42
42
  `).slice(0,6).join(`
43
43
  `):"")}}if(gp(s,!0),mp(s,e,o),e&&(e[s.key]=s,e.__ref?.__children&&(e.__ref.__children.includes(s.key)||e.__ref.__children.push(s.key))),typeof s.html=="function"&&s.node&&!s.node.innerHTML){let h=s.context?.designSystem;h&&et(h);try{let m=s.html(s,s.state,s.context);m!=null&&typeof m!="function"&&(s.node.innerHTML=m)}catch{}finally{h&&J()}}if(Pe("Create",s,n),Pe("Complete",s,n),Pe("Render",s,n),Pe("RenderRouter",s,n),sy(s,n),typeof s.onFrame=="function"){let h=s.onFrame,m=s.context?.designSystem,b=()=>{if(s.node){if(s.node.isConnected){m&&et(m);try{h(s,s.state,s.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{m&&J()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return s}function nk(t,e,r){let n=!e,o=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)&&Object.keys(r.state).length===0,s=n&&o&&t.context?.state,i=r.state!==void 0&&!s?r.state:t.state&&!st(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Mt(t,t.state);else if(t.context?.state){let a=t.context.state,c={...a},l=t.context?.polyglot;if(l?.translations){let f=a.lang||l.defaultLang||"en",u=l.translations[f];if(u&&typeof u=="object")for(let p in u)c[p]===void 0&&(c[p]=u[p]);let d=new Set(l.languages||[]);for(let p in l.translations)!d.has(p)&&c[p]===void 0&&(c[p]=l.translations[p])}t.state=st(c)?c:$t(c),t.state.__element=t,t.state.root=t.state,Mt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Mt(t,t.state);return}if(typeof i=="string"){if(t.state=iy(i,e),t.state&&typeof t.state=="object"&&!st(t.state)){let a=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:a,enumerable:!1,configurable:!0,writable:!0})}Mt(t,t.state);return}if(typeof i=="function"){let a=i(t,e?.state);t.state=st(a)?a:$t(a||{})}else st(i)?t.state=i:t.state=$t({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,Mt(t,t.state)}function lp(t,e){if(!e)return t;let r=e.split("/"),n=t;for(let o of r){if(n==null)return{};n=n[o]}return n??{}}function iy(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let o=t.slice(3);return o?lp(e.state,o):e.state??{}}if(t.startsWith("~/")){let o=e.state?.root||e.state,s=t.slice(2);return s?lp(o,s):o??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=lp(e.state,t);if(r!=null&&Object.keys(r).length>0)return r;let n=e.context?.polyglot;if(n?.translations){let o=e.state?.root?.lang||n.defaultLang||"en",s=n.translations[o];if(s?.[t]!==void 0)return s[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function ok(t){let e=t.__ref,r=t.tag||"div",n=t.context?.designSystem,o=[],s=Object.keys(t);for(let i=0;i<s.length;i++){let a=s[i];if(typeof t[a]!="function"||wt.has(a))continue;let c=a.charCodeAt(0);c>=65&&c<=90||wn(a)||gt[a]||bt&&bt.has(a)||or(r,a)||o.push({prop:a,fn:t[a]})}for(let i=0;i<o.length;i++){let{prop:a,fn:c}=o[i];e.__exec[a]=c,Object.defineProperty(t,a,{get(){n&&et(n);try{return c(t,t.state,t.context)}catch{return}finally{n&&J()}},set(l){delete e.__exec[a],Object.defineProperty(t,a,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function ay(t,e){let r=t.__ref,n=!!(e&&e.skipIfEffect);if(ok(t),typeof t.text=="function"){let s=t.text,i=Q(()=>{if(!r.contentManaged)try{let a=s(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=mr.call(t,a,t.state)),t.tag==="string"?t.node.nodeValue=a:t.node.textContent=a)}catch{}},{depth:r.path.length});r.__effects.push(i),r.__exec.text=s}else if(typeof t.text=="string"&&t.text.includes("{{")){let s=t.text,i=Q(()=>{if(r.contentManaged)return;let a=mr.call(t,s,t.state);a!=null&&(t.text=a),t.node&&(t.tag==="string"?t.node.nodeValue=a??"":t.node.textContent=a??"")},{depth:r.path.length});r.__effects.push(i),r.__exec.text=s}for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&typeof t[s]=="function"&&!wt.has(s)&&!wn(s)&&!r.__exec[s]){if(gt[s]){let i=t[s],a=s,c,l=Q(()=>{let f=t.context?.designSystem;f&&et(f);try{let u=i(t,t.state,t.context),d=gt[a](u,t,t.state,t.context);if(d&&t.node){let p=ry(d);(p===null||p!==c)&&(c=p,Sn(t.node,d))}else t.node&&(a==="show"||a==="hide")&&(c=void 0,t.node.style.display="")}finally{f&&J()}},{depth:r.path.length});r.__effects.push(l),r.__exec[s]=i}else if(bt&&bt.has(s)){let i=t[s],a=s,c,l=Q(()=>{let f=t.context?.designSystem;f&&et(f);try{let u=i(t,t.state,t.context);if(t.node)if(u!=null){let d=a+":"+String(u);d!==c&&(c=d,Sn(t.node,{[a]:u}))}else c=void 0,t.node.style[a]=""}finally{f&&J()}},{depth:r.path.length});r.__effects.push(l),r.__exec[s]=i}}if(typeof t.html=="function"){let s=t.html,i=Q(()=>{let a=t.context?.designSystem;a&&et(a);try{let c=s(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&(t.node.innerHTML=c)}finally{a&&J()}},{depth:r.path.length});r.__effects.push(i),r.__exec.html=s}if(typeof t.value=="function"){let s=t.value,i=Q(()=>{try{let a=s(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let c=a==null?"":String(a);if(t.node.value===c)return;let l=typeof document<"u"&&document.activeElement===t.node,f=l&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,u=l&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=c,l&&f!=null&&u!=null)try{t.node.setSelectionRange(f,u)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(i),r.__exec.value=s}if(typeof t.style=="function"){let s=t.style,i,a=Q(()=>{let c=s(t,t.state,t.context),l=ry(c);(l===null||l!==i)&&(i=l,Sn(t.node,c))},{depth:r.path.length});r.__effects.push(a),r.__exec.style=s}else if(t.style&&typeof t.style=="object")for(let s in t.style){let i=t.style[s];if(typeof i!="function")continue;let a,c=Q(()=>{try{let l=i(t,t.state,t.context);if(t.node){let f=s+":"+String(l);f!==a&&(a=f,Sn(t.node,{[s]:l}))}}catch{}},{depth:r.path.length});r.__effects.push(c)}if(t.attr&&typeof t.attr=="object"){for(let s in t.attr)if(typeof t.attr[s]=="function"){let i=t.attr[s],a=s,c=Q(()=>{try{let l=i(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1?t.node.removeAttribute(a):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(a,l===!0?"":l))}catch{}},{depth:r.path.length});r.__effects.push(c)}}if(t.aria&&typeof t.aria=="object")for(let s in t.aria){let i=t.aria[s];if(typeof i!="function")continue;let a="aria-"+s.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),c=Q(()=>{try{let l=i(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(a):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(a,l===!0?"":l)}catch{}},{depth:r.path.length});r.__effects.push(c)}if(t.data&&typeof t.data=="object")for(let s in t.data){let i=t.data[s];if(typeof i!="function")continue;let c="data-"+s.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),l=Q(()=>{try{let f=i(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(c):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(c,f===!0?"":f)}catch{}},{depth:r.path.length});r.__effects.push(l)}let o=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(o)for(let s in o){let i=o[s];if(typeof i!="function")continue;let a=Q(()=>{try{let c=i(t,t.state,t.context);if(!t.node?.classList)return;typeof c=="string"?t.node.classList.add(c):c?t.node.classList.add(s):t.node.classList.remove(s)}catch{}},{depth:r.path.length});r.__effects.push(a)}!n&&typeof t.if=="function"&&cy(t,r,t.if);for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||wt.has(s)||typeof t[s]!="function")continue;let i=s.charCodeAt(0);if(i>=65&&i<=90||wn(s))continue;let a=t[s];r.__exec[s]=a;let c=t.tag||"div";if(or(c,s)&&!gt[s]&&!(bt&&bt.has(s))){let l=s,f=Q(()=>{try{let u=a(t,t.state,t.context);t.node?.setAttribute&&(u==null||u===!1?t.node.removeAttribute(l):typeof u!="function"&&typeof u!="object"&&(l==="src"&&"src"in t.node?t.node.src=u:t.node.setAttribute(l,u===!0?"":u)))}catch{}},{depth:r.path.length});r.__effects.push(f)}}if(ak(t),lk(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){let s=t.onStateUpdate,i=t.stateDeps,a=!1,c=[],l=Q(()=>{let f=[];for(let g=0;g<i.length;g++){let h=i[g];try{f[g]=typeof h=="function"?h(t,t.state,t.context):t.state?.[h]}catch{f[g]=void 0}}if(!a){a=!0,c=f;return}let u=f.length!==c.length;for(let g=0;!u&&g<f.length;g++)f[g]!==c[g]&&(u=!0);let d=c;if(c=f,!u)return;let p=t.context?.designSystem;p&&et(p);try{s(t,t.state,t.context,{prev:d,next:f})}catch(g){if(t.context?.plugins?.length&&yt("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{p&&J()}},{depth:r.path.length});r.__effects.push(l)}}function cy(t,e,r){let n=Q(()=>{let o;try{o=r(t,t.state,t.context)}catch(i){if(o=!1,e.__ifError=i,typeof console<"u"&&console.warn){let a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,i?.message||i)}return}let s=e.__if;if(e.__if=!!o,s&&!e.__if&&t.node)t.node.remove();else if(!s&&e.__if)if(e.__ifInitialized){t.node||(t.node=tr(t)),t.node&&(t.node.ref=t);let i=t.parent,a=i?.node;if(a&&t.node){let c=null,l=Object.keys(i),f=l.indexOf(t.key);for(let u=f+1;u<l.length;u++){let d=i[l[u]];if(d?.node?.parentNode===a){c=d.node;break}}c?a.insertBefore(t.node,c):a.appendChild(t.node)}else mp(t,t.parent);pp(t)}else{if(e.__ifInitialized=!0,t.tag||(t.tag=Qe(t)),Pe("Init",t,{}),t.node||(t.node=tr(t)),!t.node)return;if(t.tag==="fragment"&&!e.__fragmentAnchor){let a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),e.__fragmentAnchor=a}Pe("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),uy(t,{}),ay(t,{skipIfEffect:!0}),pp(t),ly(t),dy(t,{}),mp(t,t.parent),sy(t,{})}},{depth:e.path.length});e.__effects.push(n)}function pp(t){let{node:e}=t;if(e){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?e.nodeValue=t.text:e.textContent=t.text:typeof t.text=="number"&&(e.textContent=t.text),uk(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){let r=String(t.value);e.value!==r&&(e.value=r)}if(t.style&&typeof t.style=="object"&&Sn(e,t.style),t.attr&&typeof t.attr=="object")for(let r in t.attr){let n=t.attr[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.setAttribute&&e.setAttribute(r,n===!0?"":n)}if(t.data&&typeof t.data=="object")for(let r in t.data){let n=t.data[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.dataset&&(e.dataset[r]=n===!0?"":n)}if(t.classlist||t.class){let r=t.classlist||t.class;if(typeof r=="string")r.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof r=="object")for(let n in r){let o=typeof r[n]=="function"?r[n](t,t.state,t.context):r[n];o&&e.classList.add(typeof o=="string"?o:n)}}}}function ry(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Sn(t,e){if(!t||!e||!t.style)return;let r=null;for(let n in e){let o=e[n];if(o!=null){if(n.charAt(0)==="&"&&typeof o=="object"){r||(r={}),r[n]=o;continue}try{let s=String(o),i=n.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),a=s.trim(),c=/\s*!important\s*$/.test(a),l=a.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,c?"important":"")}catch{}}}r&&ik(t,r)}var sk=0;function ik(t,e){let r=`_ds${sk++}`;t.classList.add(r);let n=t.ownerDocument,o=n.querySelector("style[data-smbls-scoped]");o||(o=n.createElement("style"),o.setAttribute("data-smbls-scoped",""),n.head.appendChild(o));let s="";for(let i in e){let a="."+r,c=i.replace(/&/g,a).split(",").map(f=>{let u=f.trim();return u.includes(a)?u:a+u}).join(", "),l=e[i];if(typeof l=="object"){let f="",u="";for(let d in l){let p=l[d];if(typeof p=="object"){let g=d.includes("&")?c.split(", ").map(m=>d.replace(/&/g,m)).join(", "):c.split(", ").map(m=>`${m} ${d}`).join(", "),h="";for(let m in p)h+=`${m.replace(/[A-Z]/g,b=>"-"+b.toLowerCase())}: ${p[m]};`;u+=`${g} { ${h} }
44
44
  `}else f+=`${d.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${p};`}f&&(s+=`${c} { ${f} }
45
- `),u&&(s+=u)}}s&&(o.textContent+=s)}function ak(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],a=s.slice(1),c={value:!1},l=Q(()=>{let f=t.state&&(st(t.state)?t.state.root:null);if(!f||!st(f))return;let u=f;u=u[i];for(let p=0;p<a.length&&!(u==null||typeof u!="object");p++)if(st(u))u=u[a[p]];else break;if(!c.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let p=t.context?.designSystem;p&&et(p);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(g){t.context?.plugins?.length&&yt("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{p&&J()}}if(!d&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){let g=r.__effects[p];g&&g!==l&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!d&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&et(p);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&yt("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{p&&J()}}},{depth:r.path.length});c.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function yp(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}var ny=new Set;function ck(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;ny.has(n)||(ny.add(n),console.warn(`[smbls/css] "${t}" at ${r} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function kn(t,e,r){let n={},o=(s,i)=>{if(gt[s]){let a=gt[s](i,e,e.state,e.context);if(a){let c=Array.isArray(a)?a:[a];for(let l of c)l&&Object.assign(n,l)}}else n[s]=i};for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let i=t[s];if(typeof i=="function"&&(i=i(e,e.state,e.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(s==="style"){for(let l in i){let f=i[l];typeof f=="function"&&(f=f(e,e.state,e.context)),!(f==null||typeof f=="function")&&o(l,f)}continue}if(yp(s,e)){let l=kn(i,e,!0);Object.keys(l).length&&(n[`[data-theme="${s.slice(1)}"] &`]=l);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(s)){zs()&&ck(s,e);continue}let a=s;if(s.charCodeAt(0)===64&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let l=e.context?.designSystem?.media?.[s.slice(1)];l&&(a=`@media ${l}`)}let c=kn(i,e,!1);Object.keys(c).length&&(n[a]=c);continue}o(s,i)}}if(r)for(let s in n){let i=n[s];typeof i=="string"&&!i.includes("!important")&&(n[s]=i+" !important")}return n}function lk(t){let e=t.__ref;e.__conditionalRunners=[];let r=new Map;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let o=n.charAt(0);if(o!=="."&&o!=="!")continue;let s=n.slice(1);if(!s)continue;let i=t[n];if(!i||typeof i!="object")continue;let a=o==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{if(!t.node)return;let u,d=t[s];if(d===void 0)if(t.state&&s in t.state)u=t.state[s];else{let h=t.context?.cases?.[s];if(h===void 0)return;try{u=typeof h=="function"?h.call(t,t):h}catch(m){u=!1,e.__conditionalError=m,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,m?.message||m)}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(h){u=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else u=d;let p=a?!u:!!u;if(p===c.lastMatch)return;c.lastMatch=p;let g=t.context?.designSystem;g&&et(g);try{if(p){let h={},m={},b=!1;for(let y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;let _=i[y],v=y.charAt(0);if((v===":"||v==="@"||v==="&")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yp(y,t)){let P=kn(_,t,!0);Object.keys(P).length&&(m[`[data-theme="${y.slice(1)}"] &`]=P,b=!0)}else{let P=y;if(v==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let E=t.context?.designSystem?.media?.[y.slice(1)];E&&(P=`@media ${E}`)}let U=kn(_,t,!1);Object.keys(U).length&&(m[P]=U,b=!0)}continue}let O=typeof _=="function"?_(t,t.state,t.context):_;if(O!=null)if(gt[y]){let P=gt[y](O,t,t.state,t.context);if(P){let U=Array.isArray(P)?P:[P];for(let E of U)E&&Object.assign(h,E)}}else bt&&bt.has(y)&&(h[y]=O)}let x=Object.keys(h);if(x.length){Sn(t.node,h);for(let y of x)r.set(y,n);c.appliedKeys=x}else c.appliedKeys=null;if(b){let y=oe(m,null,t.context?.cssPrefix),_=y?y.split(" ").filter(Boolean):[];if(_.length&&t.node.classList){for(let v of _)t.node.classList.add(v);c.appliedClasses=_}else c.appliedClasses=null}else if(c.appliedClasses){for(let y of c.appliedClasses)t.node.classList.remove(y);c.appliedClasses=null}}else{if(c.appliedKeys){for(let h of c.appliedKeys)r.get(h)===n&&(t.node.style[h]="",r.delete(h));c.appliedKeys=null}if(c.appliedClasses){for(let h of c.appliedClasses)t.node.classList.remove(h);c.appliedClasses=null}}}finally{g&&J()}};e.__conditionalRunners.push(l);let f=Q(l,{depth:e.path.length});e.__effects.push(f)}}var fp=new WeakSet;function fk(t){let e=t.ownerDocument;!e||fp.has(e)||(fp.add(e),queueMicrotask(()=>{fp.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var up=new WeakSet,oy=!1;function uk(t){let{node:e}=t;if(!e)return;if(oy||(oy=!0,oe({display:"none"})),up.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}up.add(t);let r=t.context?.designSystem;r&&et(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||wt.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!wn(s)){if(gt[s]){let a=t[s],c=gt[s](a,t,t.state,t.context);if(c){if(Array.isArray(c))for(let l of c)l&&Object.assign(n,l);else Object.assign(n,c);o=!0}}else if(bt&&bt.has(s)){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charCodeAt(0)===45){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="&"){let a=t[s];a&&typeof a=="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"){if(yp(s,t)){let c=kn(a,t,!0);Object.keys(c).length&&(n[`[data-theme="${s.slice(1)}"] &`]=c,o=!0)}else{let c=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let f=t.context?.designSystem?.media?.[s.slice(1)];f&&(c=`@media ${f}`)}let l=kn(a,t,!1);Object.keys(l).length&&(n[c]=l,o=!0)}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=oe(n,null,t.context?.cssPrefix);if(s&&e.classList){let a=s.split(" ").filter(Boolean),c=!1;for(let l of a)e.classList.add(l),c||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(c=!0);c&&fk(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let a=n.display;if(a&&a!==i)if(i==="none"){let c=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&c.push(l);for(let l of c)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&J(),up.delete(t)}}function ly(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=cp(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||wt.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!wn(o)&&!(gt[o]||bt&&bt.has(o))&&or(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=mr(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function dk(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var fy=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function uy(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!wn(r)||fy.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(a){return t.call(s,a)}}if(typeof n!="function")continue;let o=ek(r);er.has(o)||mn(rk(o),t,n)}pk(t)}function pk(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of fy){let p=t[d];typeof p=="function"&&(r[d]=p,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,a=0,c=0,l=!1,f=d=>{let p=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];p&&(i=p.clientX,a=p.clientY,c=Date.now(),l=!0)},u=d=>{if(!l)return;l=!1;let p=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!p)return;let g=p.clientX-i,h=p.clientY-a,m=Date.now()-c;if(m>s)return;let b=Math.abs(g),x=Math.abs(h);if(Math.max(b,x)<o)return;let y;if(b>x*1.2)y=g<0?"left":"right";else if(x>b*1.2)y=h<0?"up":"down";else return;let _="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),v=r[_],O=r.onSwipe;v&&v.call(t,d,t,t.state,t.context),O&&O.call(t,{direction:y,dx:g,dy:h,dt:m,event:d},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function ac(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=ac(o,s):r[n]=s}return r}function hp(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let o=t.tag==="fragment",s=t.context?.document||globalThis.document,i=o?null:s?.createDocumentFragment();if(!o&&!i)return;let a=t.childProps,c=t.childrenAs;for(let l=0;l<e.length;l++){let f=e[l],u=f;(typeof f=="string"||typeof f=="number")&&(f={text:f});let d=a;if(typeof a=="function")try{d=a(t,f)}catch{d=null}if(c==="state"){let h=u;(typeof u=="string"||typeof u=="number")&&(h={value:u,text:u}),f=d?{...d,state:h}:{state:h}}else d&&(f=ac(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let h=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...h]}}else f={...f,extends:n};let p=f?.key||u&&typeof u=="object"&&u.key||`${l}`,g=qt(f,t,p,r);!o&&g?.node&&i.appendChild(g.node)}o||t.node.appendChild(i);return}if(typeof e=="string"){let o=iy(e,t);if(Array.isArray(o)){hp(t,o,r);return}}if(typeof e=="object")for(let o in e){if(wt.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=ac(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],a=Array.isArray(n)?n:[n];s={...s,extends:[...a,...i]}}else s={...s,extends:n};qt(s,t,o,r)}}}function gp(t,e){let r=t.node;if(!r||r.tagName!=="SELECT")return;let n=r.options;if(!n||!n.length)return;let o=t.__ref,s=o&&o.__exec&&o.__exec.value,i=typeof s=="function",a=t.value!=null&&typeof t.value!="function";if(i||a){let f;if(i)try{f=s(t,t.state,t.context)}catch{return}else f=t.value;let u=f==null?"":String(f);r.value!==u&&(r.value=u);return}let c=e||!(o&&o.__selectSynced);if(o&&(o.__selectSynced=!0),!c)return;let l=-1;for(let f=0;f<n.length;f++)n[f].defaultSelected&&(l=f);l>=0&&r.selectedIndex!==l&&(r.selectedIndex=l)}function dy(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let a=t.__ref,c=!1,l=Q(()=>{let f=i(t,t.state,t.context);if(!c){c=!0;return}if(f===t.children)return;t.children=f;let u=typeof t.onContentUpdate=="function",d=u?[]:null,p=u?[]:null,g=u?[]:null;if(Array.isArray(f)&&t.childrenAs==="state"){let x=t.childProps,y=[],_=new Map;for(let B=0;B<f.length;B++){let z=f[B],$=x;if(typeof x=="function")try{$=x(t,z)}catch{$=null}let D=$&&$.key||z&&z.key||`${B}`;y.push(D),_.set(D,{rawChild:z,childProps:$})}let v=new Set(y),O=a.__children.slice();for(let B of O)if(!v.has(B)){let z=t[B];z?.remove&&z.remove(),delete t[B],p&&p.push(B)}let P=t.childExtends,U=t.tag==="fragment",E=t.context?.document||globalThis.document,F=U?null:E?.createDocumentFragment();for(let B of y){let z=_.get(B),$=z.rawChild,D=t[B];if(D&&D.state){if($&&typeof $=="object"){let xt=D.state,ur=xt.$replace||xt.replace,_i=xt.$update||xt.update;if(typeof ur=="function")ur.call(xt,$);else if(typeof _i=="function"){for(let Jt in xt)if(!(Jt==="__element"||Jt==="root"||Jt==="parent"||Jt==="update")&&!Object.prototype.hasOwnProperty.call($,Jt))try{xt[Jt]=void 0}catch{}_i.call(xt,$)}else for(let Jt in $)xt[Jt]=$[Jt]}g&&g.push(B);continue}let W=$;(typeof $=="string"||typeof $=="number")&&(W={value:$,text:$});let X=z.childProps,q=X?{...X,state:W}:{state:W};if(P&&!q.ignoreChildExtends)if(q.extends){let xt=Array.isArray(q.extends)?q.extends:[q.extends],ur=Array.isArray(P)?P:[P];q={...q,extends:[...ur,...xt]}}else q={...q,extends:P};let Le=qt(q,t,B,e);!U&&Le?.node&&F&&F.appendChild(Le.node),d&&d.push(B)}if(!U&&F&&F.childNodes.length&&t.node&&t.node.appendChild(F),!U&&t.node){let B=null;for(let z of y){let $=t[z]?.node;if(!$)continue;let D=B?B.nextSibling:t.node.firstChild;$!==D&&t.node.insertBefore($,D),B=$}}a.__children=y,u&&(d.length||p.length)&&ty(t,{added:d,removed:p,kept:g}),gp(t,!1);return}let b=u?[...a.__children]:null;for(let x of[...a.__children]){let y=t[x];y?.remove&&y.remove(),delete t[x]}a.__children=[],hp(t,f,e),gp(t,!1),u&&ty(t,{added:[...a.__children],removed:b,kept:[]})},{depth:a.path.length});a.__effects.push(l)}if(hp(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let a=0;a<i.length;a++){let c=i[a];if(!c.endsWith("Extends")||typeof t[c]!="string")continue;let l=c.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[c]};delete t[c];for(let u=a+1;u<i.length;u++){let d=i[u],p=d.charCodeAt(0);if(p>=65&&p<=90||wt.has(d)||typeof t[d]=="function"&&(d.startsWith("on")||d.startsWith(".")))break;let g=t[d];g!==void 0&&(f[d]=g,delete t[d])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||wt.has(i)||typeof t[i]!="object"||t[i]===null)continue;let a=i.charCodeAt(0);if(a<65||a>90)continue;let c=t[i];if(!c.__ref){if(!c.extends&&!c.extend){let l=s[i]||s[`smbls.${i}`];l&&(c={...c,extends:l})}if(t.childProps&&(c=ac(t.childProps,c)),o&&!c.ignoreChildExtends)if(c.extends){let l=Array.isArray(c.extends)?c.extends:[c.extends],f=Array.isArray(o)?o:[o];c={...c,extends:[...f,...l]}}else c={...c,extends:o};qt(c,t,i,e)}}}function mp(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(o){let i=o.parentNode;if(i){if(r?.position==="before"&&r.node)i.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let a=r.node.nextSibling;i.insertBefore(n,a||o)}else i.insertBefore(n,o);return}}let s=e?.node||(e?.nodeType?e:null);if(s)if(r?.position==="before"&&r.node)s.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let i=r.node.nextSibling;i?s.insertBefore(n,i):s.appendChild(n)}else s.appendChild(n)}function Pe(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&yt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let a=e.context?.designSystem;a&&et(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&yt("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&J(),i&&(e.__ref.__inRender=!1)}}return!0}var py={blue:"#213eb0",green:"#389d34",red:"#e15c55",yellow:"#EDCB38",orange:"#e97c16",transparent:"rgba(0, 0, 0, 0)",black:"black",gray:"#4e4e50",white:"white",title:["--gray 1 -168","--gray 1 +168"],caption:["--gray 1 -68","--gray 1 +68"],paragraph:["--gray 1 -42","--gray 1 +42"],disabled:["--gray 1 -26","--gray 1 +26"],line:["--gray 1 -16","--gray 1 +16"]},hy={"gradient-blue-light":`linear-gradient(to right,
45
+ `),u&&(s+=u)}}s&&(o.textContent+=s)}function ak(t){let e=t.subscribeTo;if(typeof e=="function")try{e=e(t,t.state,t.context)}catch{e=null}if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],a=s.slice(1),c={value:!1},l=Q(()=>{let f=t.state&&(st(t.state)?t.state.root:null);if(!f||!st(f))return;let u=f;u=u[i];for(let p=0;p<a.length&&!(u==null||typeof u!="object");p++)if(st(u))u=u[a[p]];else break;if(!c.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let p=t.context?.designSystem;p&&et(p);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(g){t.context?.plugins?.length&&yt("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{p&&J()}}if(!d&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){let g=r.__effects[p];g&&g!==l&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!d&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&et(p);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&yt("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{p&&J()}}},{depth:r.path.length});c.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function yp(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}var ny=new Set;function ck(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;ny.has(n)||(ny.add(n),console.warn(`[smbls/css] "${t}" at ${r} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function kn(t,e,r){let n={},o=(s,i)=>{if(gt[s]){let a=gt[s](i,e,e.state,e.context);if(a){let c=Array.isArray(a)?a:[a];for(let l of c)l&&Object.assign(n,l)}}else n[s]=i};for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let i=t[s];if(typeof i=="function"&&(i=i(e,e.state,e.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(s==="style"){for(let l in i){let f=i[l];typeof f=="function"&&(f=f(e,e.state,e.context)),!(f==null||typeof f=="function")&&o(l,f)}continue}if(yp(s,e)){let l=kn(i,e,!0);Object.keys(l).length&&(n[`[data-theme="${s.slice(1)}"] &`]=l);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(s)){zs()&&ck(s,e);continue}let a=s;if(s.charCodeAt(0)===64&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let l=e.context?.designSystem?.media?.[s.slice(1)];l&&(a=`@media ${l}`)}let c=kn(i,e,!1);Object.keys(c).length&&(n[a]=c);continue}o(s,i)}}if(r)for(let s in n){let i=n[s];typeof i=="string"&&!i.includes("!important")&&(n[s]=i+" !important")}return n}function lk(t){let e=t.__ref;e.__conditionalRunners=[];let r=new Map;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let o=n.charAt(0);if(o!=="."&&o!=="!")continue;let s=n.slice(1);if(!s)continue;let i=t[n];if(!i||typeof i!="object")continue;let a=o==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{if(!t.node)return;let u,d=t[s];if(d===void 0)if(t.state&&s in t.state)u=t.state[s];else{let h=t.context?.cases?.[s];if(h===void 0)return;try{u=typeof h=="function"?h.call(t,t):h}catch(m){u=!1,e.__conditionalError=m,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,m?.message||m)}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(h){u=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else u=d;let p=a?!u:!!u;if(p===c.lastMatch)return;c.lastMatch=p;let g=t.context?.designSystem;g&&et(g);try{if(p){let h={},m={},b=!1;for(let y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;let _=i[y],v=y.charAt(0);if((v===":"||v==="@"||v==="&")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yp(y,t)){let P=kn(_,t,!0);Object.keys(P).length&&(m[`[data-theme="${y.slice(1)}"] &`]=P,b=!0)}else{let P=y;if(v==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let E=t.context?.designSystem?.media?.[y.slice(1)];E&&(P=`@media ${E}`)}let U=kn(_,t,!1);Object.keys(U).length&&(m[P]=U,b=!0)}continue}let O=typeof _=="function"?_(t,t.state,t.context):_;if(O!=null)if(gt[y]){let P=gt[y](O,t,t.state,t.context);if(P){let U=Array.isArray(P)?P:[P];for(let E of U)E&&Object.assign(h,E)}}else bt&&bt.has(y)&&(h[y]=O)}let x=Object.keys(h);if(x.length){Sn(t.node,h);for(let y of x)r.set(y,n);c.appliedKeys=x}else c.appliedKeys=null;if(b){let y=oe(m,null,t.context?.cssPrefix),_=y?y.split(" ").filter(Boolean):[];if(_.length&&t.node.classList){for(let v of _)t.node.classList.add(v);c.appliedClasses=_}else c.appliedClasses=null}else if(c.appliedClasses){for(let y of c.appliedClasses)t.node.classList.remove(y);c.appliedClasses=null}}else{if(c.appliedKeys){for(let h of c.appliedKeys)r.get(h)===n&&(t.node.style[h]="",r.delete(h));c.appliedKeys=null}if(c.appliedClasses){for(let h of c.appliedClasses)t.node.classList.remove(h);c.appliedClasses=null}}}finally{g&&J()}};e.__conditionalRunners.push(l);let f=Q(l,{depth:e.path.length});e.__effects.push(f)}}var fp=new WeakSet;function fk(t){let e=t.ownerDocument;!e||fp.has(e)||(fp.add(e),queueMicrotask(()=>{fp.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var up=new WeakSet,oy=!1;function uk(t){let{node:e}=t;if(!e)return;if(oy||(oy=!0,oe({display:"none"})),up.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}up.add(t);let r=t.context?.designSystem;r&&et(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||wt.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!wn(s)){if(gt[s]){let a=t[s],c=gt[s](a,t,t.state,t.context);if(c){if(Array.isArray(c))for(let l of c)l&&Object.assign(n,l);else Object.assign(n,c);o=!0}}else if(bt&&bt.has(s)){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charCodeAt(0)===45){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="&"){let a=t[s];a&&typeof a=="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"){if(yp(s,t)){let c=kn(a,t,!0);Object.keys(c).length&&(n[`[data-theme="${s.slice(1)}"] &`]=c,o=!0)}else{let c=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let f=t.context?.designSystem?.media?.[s.slice(1)];f&&(c=`@media ${f}`)}let l=kn(a,t,!1);Object.keys(l).length&&(n[c]=l,o=!0)}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=oe(n,null,t.context?.cssPrefix);if(s&&e.classList){let a=s.split(" ").filter(Boolean),c=!1;for(let l of a)e.classList.add(l),c||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(c=!0);c&&fk(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let a=n.display;if(a&&a!==i)if(i==="none"){let c=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&c.push(l);for(let l of c)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&J(),up.delete(t)}}function ly(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=cp(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||wt.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!wn(o)&&!(gt[o]||bt&&bt.has(o))&&or(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=mr(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function dk(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var fy=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function uy(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!wn(r)||fy.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(a){return t.call(s,a)}}if(typeof n!="function")continue;let o=ek(r);er.has(o)||mn(rk(o),t,n)}pk(t)}function pk(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of fy){let p=t[d];typeof p=="function"&&(r[d]=p,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,a=0,c=0,l=!1,f=d=>{let p=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];p&&(i=p.clientX,a=p.clientY,c=Date.now(),l=!0)},u=d=>{if(!l)return;l=!1;let p=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!p)return;let g=p.clientX-i,h=p.clientY-a,m=Date.now()-c;if(m>s)return;let b=Math.abs(g),x=Math.abs(h);if(Math.max(b,x)<o)return;let y;if(b>x*1.2)y=g<0?"left":"right";else if(x>b*1.2)y=h<0?"up":"down";else return;let _="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),v=r[_],O=r.onSwipe;v&&v.call(t,d,t,t.state,t.context),O&&O.call(t,{direction:y,dx:g,dy:h,dt:m,event:d},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function ac(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=ac(o,s):r[n]=s}return r}function hp(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let o=t.tag==="fragment",s=t.context?.document||globalThis.document,i=o?null:s?.createDocumentFragment();if(!o&&!i)return;let a=t.childProps,c=t.childrenAs;for(let l=0;l<e.length;l++){let f=e[l],u=f;(typeof f=="string"||typeof f=="number")&&(f={text:f});let d=a;if(typeof a=="function")try{d=a(t,f)}catch{d=null}if(c==="state"){let h=u;(typeof u=="string"||typeof u=="number")&&(h={value:u,text:u}),f=d?{...d,state:h}:{state:h}}else d&&(f=ac(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let h=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...h]}}else f={...f,extends:n};let p=f?.key||u&&typeof u=="object"&&u.key||`${l}`,g=qt(f,t,p,r);!o&&g?.node&&i.appendChild(g.node)}o||t.node.appendChild(i);return}if(typeof e=="string"){let o=iy(e,t);if(Array.isArray(o)){hp(t,o,r);return}}if(typeof e=="object")for(let o in e){if(wt.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=ac(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],a=Array.isArray(n)?n:[n];s={...s,extends:[...a,...i]}}else s={...s,extends:n};qt(s,t,o,r)}}}function gp(t,e){let r=t.node;if(!r||r.tagName!=="SELECT")return;let n=r.options;if(!n||!n.length)return;let o=t.__ref,s=o&&o.__exec&&o.__exec.value,i=typeof s=="function",a=t.value!=null&&typeof t.value!="function";if(i||a){let f;if(i)try{f=s(t,t.state,t.context)}catch{return}else f=t.value;let u=f==null?"":String(f);r.value!==u&&(r.value=u);return}let c=e||!(o&&o.__selectSynced);if(o&&(o.__selectSynced=!0),!c)return;let l=-1;for(let f=0;f<n.length;f++)n[f].defaultSelected&&(l=f);l>=0&&r.selectedIndex!==l&&(r.selectedIndex=l)}function dy(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let a=t.__ref,c=!1,l=Q(()=>{let f=i(t,t.state,t.context);if(!c){c=!0;return}if(f===t.children)return;t.children=f;let u=typeof t.onContentUpdate=="function",d=u?[]:null,p=u?[]:null,g=u?[]:null;if(Array.isArray(f)&&t.childrenAs==="state"){let x=t.childProps,y=[],_=new Map;for(let B=0;B<f.length;B++){let z=f[B],$=x;if(typeof x=="function")try{$=x(t,z)}catch{$=null}let D=$&&$.key||z&&z.key||`${B}`;y.push(D),_.set(D,{rawChild:z,childProps:$})}let v=new Set(y),O=a.__children.slice();for(let B of O)if(!v.has(B)){let z=t[B];z?.remove&&z.remove(),delete t[B],p&&p.push(B)}let P=t.childExtends,U=t.tag==="fragment",E=t.context?.document||globalThis.document,F=U?null:E?.createDocumentFragment();for(let B of y){let z=_.get(B),$=z.rawChild,D=t[B];if(D&&D.state){if($&&typeof $=="object"){let xt=D.state,ur=xt.$replace||xt.replace,_i=xt.$update||xt.update;if(typeof ur=="function")ur.call(xt,$);else if(typeof _i=="function"){for(let Jt in xt)if(!(Jt==="__element"||Jt==="root"||Jt==="parent"||Jt==="update")&&!Object.prototype.hasOwnProperty.call($,Jt))try{xt[Jt]=void 0}catch{}_i.call(xt,$)}else for(let Jt in $)xt[Jt]=$[Jt]}g&&g.push(B);continue}let W=$;(typeof $=="string"||typeof $=="number")&&(W={value:$,text:$});let X=z.childProps,q=X?{...X,state:W}:{state:W};if(P&&!q.ignoreChildExtends)if(q.extends){let xt=Array.isArray(q.extends)?q.extends:[q.extends],ur=Array.isArray(P)?P:[P];q={...q,extends:[...ur,...xt]}}else q={...q,extends:P};let Le=qt(q,t,B,e);!U&&Le?.node&&F&&F.appendChild(Le.node),d&&d.push(B)}if(!U&&F&&F.childNodes.length&&t.node&&t.node.appendChild(F),!U&&t.node){let B=null;for(let z of y){let $=t[z]?.node;if(!$)continue;let D=B?B.nextSibling:t.node.firstChild;$!==D&&t.node.insertBefore($,D),B=$}}a.__children=y,u&&(d.length||p.length)&&ty(t,{added:d,removed:p,kept:g}),gp(t,!1);return}let b=u?[...a.__children]:null;for(let x of[...a.__children]){let y=t[x];y?.remove&&y.remove(),delete t[x]}a.__children=[],hp(t,f,e),gp(t,!1),u&&ty(t,{added:[...a.__children],removed:b,kept:[]})},{depth:a.path.length});a.__effects.push(l)}if(hp(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let a=0;a<i.length;a++){let c=i[a];if(!c.endsWith("Extends")||typeof t[c]!="string")continue;let l=c.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[c]};delete t[c];for(let u=a+1;u<i.length;u++){let d=i[u],p=d.charCodeAt(0);if(p>=65&&p<=90||wt.has(d)||typeof t[d]=="function"&&(d.startsWith("on")||d.startsWith(".")))break;let g=t[d];g!==void 0&&(f[d]=g,delete t[d])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||wt.has(i)||typeof t[i]!="object"||t[i]===null)continue;let a=i.charCodeAt(0);if(a<65||a>90)continue;let c=t[i];if(!c.__ref){if(!c.extends&&!c.extend){let l=s[i]||s[`smbls.${i}`];l&&(c={...c,extends:l})}if(t.childProps&&(c=ac(t.childProps,c)),o&&!c.ignoreChildExtends)if(c.extends){let l=Array.isArray(c.extends)?c.extends:[c.extends],f=Array.isArray(o)?o:[o];c={...c,extends:[...f,...l]}}else c={...c,extends:o};qt(c,t,i,e)}}}function mp(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(o){let i=o.parentNode;if(i){if(r?.position==="before"&&r.node)i.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let a=r.node.nextSibling;i.insertBefore(n,a||o)}else i.insertBefore(n,o);return}}let s=e?.node||(e?.nodeType?e:null);if(s)if(r?.position==="before"&&r.node)s.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let i=r.node.nextSibling;i?s.insertBefore(n,i):s.appendChild(n)}else s.appendChild(n)}function Pe(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&yt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let a=e.context?.designSystem;a&&et(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&yt("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&J(),i&&(e.__ref.__inRender=!1)}}return!0}var py={blue:"#213eb0",green:"#389d34",red:"#e15c55",yellow:"#EDCB38",orange:"#e97c16",transparent:"rgba(0, 0, 0, 0)",black:"black",gray:"#4e4e50",white:"white",title:["--gray 1 -168","--gray 1 +168"],caption:["--gray 1 -68","--gray 1 +68"],paragraph:["--gray 1 -42","--gray 1 +42"],disabled:["--gray 1 -26","--gray 1 +26"],line:["--gray 1 -16","--gray 1 +16"]},hy={"gradient-blue-light":`linear-gradient(to right,
46
46
  rgba(4, 116, 242, 1),
47
47
  rgba(0, 48, 103, 1)
48
48
  )`,"gradient-blue-dark":`linear-gradient(to right,