smbls 3.14.753 → 3.14.755

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.755
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-generated cross-repo patch release.
8
+
3
9
  ## 3.14.753
4
10
 
5
11
  ### Patch Changes
package/dist/smbls.cjs CHANGED
@@ -42,7 +42,7 @@ FROM ${a}${l}`},w0=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(oh(s,!0),pb(s,e,o),typeof s.html=="function"&&s.node&&!s.node.innerHTML){let p=s.context?.designSystem;p&&tt(p);try{let m=s.html(s,s.state,s.context);m!=null&&typeof m!="function"&&(s.node.innerHTML=m)}catch{}finally{p&&Z()}}if(qe("Create",s,n),qe("Complete",s,n),qe("Render",s,n),qe("RenderRouter",s,n),ob(s,n),typeof s.onFrame=="function"){let p=s.onFrame,m=s.context?.designSystem,b=()=>{if(s.node){if(s.node.isConnected){m&&tt(m);try{p(s,s.state,s.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{m&&Z()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return s}function mv(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&&!at(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Gt(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 h in u)c[h]===void 0&&(c[h]=u[h]);let d=new Set(l.languages||[]);for(let h in l.translations)!d.has(h)&&c[h]===void 0&&(c[h]=l.translations[h])}t.state=at(c)?c:Ht(c),t.state.__element=t,t.state.root=t.state,Gt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Gt(t,t.state);return}if(typeof i=="string"){if(t.state=sb(i,e),t.state&&typeof t.state=="object"&&!at(t.state)){let a=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:a,enumerable:!1,configurable:!0,writable:!0})}Gt(t,t.state);return}if(typeof i=="function"){let a=i(t,e?.state);t.state=at(a)?a:Ht(a||{})}else at(i)?t.state=i:t.state=Ht({...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,Gt(t,t.state)}function Xp(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 sb(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let o=t.slice(3);return o?Xp(e.state,o):e.state??{}}if(t.startsWith("~/")){let o=e.state?.root||e.state,s=t.slice(2);return s?Xp(o,s):o??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=Xp(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{}}var yv=new Set(["s","state","ctx","context"]);function bv(t){try{let r=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return r?r[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function xv(t){if(typeof t!="function"||t.length!==2)return!1;let e=bv(t);if(e.length<2)return!1;let r=e[1].replace(/[{}[\]]/g,"").trim();return r.length>0&&!yv.has(r)}function _v(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"||Rt.has(a))continue;let c=a.charCodeAt(0);c>=65&&c<=90||Zn(a)||ut[a]||yt&&yt.has(a)||wr(r,a)||(Mt()&&xv(t[a])&&console.warn(`[smbls] custom prop "${a}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${a}', \u2026) instead of reading el.${a}(\u2026) directly (see RULES.md Rule 8).`),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&&tt(n);try{return c(t,t.state,t.context)}catch{return}finally{n&&Z()}},set(l){delete e.__exec[a],Object.defineProperty(t,a,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Sv(t,e){if(!(!Array.isArray(e)||e.length===0))for(let r=0;r<e.length;r++){let n=e[r];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function Ut(t,e,r){return!Array.isArray(e)||e.length===0?r:function(...n){return Sv(t,e),r.apply(this,n)}}function Ci(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function ib(t,e){let r=t.__ref,n=!!(e&&e.skipIfEffect);if(_v(t),typeof t.text=="function"){let s=t.text,i=Ut(t,t.textDeps,s),a=J(()=>{if(!r.contentManaged)try{let c=i(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&typeof c!="object"&&(typeof c=="string"&&c.includes("{{")&&(c=Lr.call(t,c,t.state)),t.tag==="string"?t.node.nodeValue=c:t.node.textContent=c)}catch{}},{depth:r.path.length});r.__effects.push(a),r.__exec.text=s}else if(typeof t.text=="string"&&t.text.includes("{{")){let s=t.text,i=J(()=>{if(r.contentManaged)return;let a=Lr.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"&&!Rt.has(s)&&!Zn(s)&&!r.__exec[s]){if(ut[s]){let i=t[s],a=Ut(t,t[s+"Deps"],i),c=s,l,f=J(()=>{let u=t.context?.designSystem;u&&tt(u);try{let d=a(t,t.state,t.context),h=ut[c](d,t,t.state,t.context);if(h&&t.node){let g=rh(h);(g===null||g!==l)&&(l=g,Jn(t.node,h))}else t.node&&(c==="show"||c==="hide")&&(l=void 0,t.node.style.display="")}finally{u&&Z()}},{depth:r.path.length});r.__effects.push(f),r.__exec[s]=i}else if(yt&&yt.has(s)){let i=t[s],a=Ut(t,t[s+"Deps"],i),c=s,l,f=J(()=>{let u=t.context?.designSystem;u&&tt(u);try{let d=a(t,t.state,t.context);if(t.node)if(d!=null){let h=c+":"+String(d);h!==l&&(l=h,Jn(t.node,{[c]:d}))}else l=void 0,t.node.style[c]=""}finally{u&&Z()}},{depth:r.path.length});r.__effects.push(f),r.__exec[s]=i}}if(typeof t.html=="function"){let s=t.html,i=Ut(t,t.htmlDeps,s),a=J(()=>{let c=t.context?.designSystem;c&&tt(c);try{let l=i(t,t.state,t.context);t.node&&l!=null&&typeof l!="function"&&(t.node.innerHTML=l)}finally{c&&Z()}},{depth:r.path.length});r.__effects.push(a),r.__exec.html=s}if(typeof t.value=="function"){let s=t.value,i=Ut(t,t.valueDeps,s),a=J(()=>{try{let c=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let l=c==null?"":String(c);if(t.node.value===l)return;let f=typeof document<"u"&&document.activeElement===t.node,u=f&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,d=f&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=l,f&&u!=null&&d!=null)try{t.node.setSelectionRange(u,d)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(a),r.__exec.value=s}if(typeof t.style=="function"){let s=t.style,i=Ut(t,t.styleDeps,s),a,c=J(()=>{let l=i(t,t.state,t.context),f=rh(l);(f===null||f!==a)&&(a=f,Jn(t.node,l))},{depth:r.path.length});r.__effects.push(c),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=Ut(t,Ci(t.styleDeps,s),i),c,l=J(()=>{try{let f=a(t,t.state,t.context);if(t.node){let u=s+":"+String(f);u!==c&&(c=u,Jn(t.node,{[s]:f}))}}catch{}},{depth:r.path.length});r.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(let s in t.attr)if(typeof t.attr[s]=="function"){let i=Ut(t,Ci(t.attrDeps,s),t.attr[s]),a=s,c=J(()=>{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){if(typeof t.aria[s]!="function")continue;let i=Ut(t,Ci(t.ariaDeps,s),t.aria[s]),a="aria-"+s.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),c=J(()=>{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){if(typeof t.data[s]!="function")continue;let i=Ut(t,Ci(t.dataDeps,s),t.data[s]),c="data-"+s.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),l=J(()=>{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){if(typeof o[s]!="function")continue;let i=Ut(t,Ci(t.classDeps,s),o[s]),a=J(()=>{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"&&ab(t,r,t.if);for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||Rt.has(s)||typeof t[s]!="function")continue;let i=s.charCodeAt(0);if(i>=65&&i<=90||Zn(s))continue;let a=t[s];r.__exec[s]=a;let c=t.tag||"div";if(wr(c,s)&&!ut[s]&&!(yt&&yt.has(s))){let l=Sr(s)||s,f=Ut(t,t[s+"Deps"],a),u=J(()=>{try{let d=f(t,t.state,t.context);t.node?.setAttribute&&(d==null||d===!1?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&(l==="src"&&"src"in t.node?t.node.src=d:t.node.setAttribute(l,d===!0?"":d)))}catch{}},{depth:r.path.length});r.__effects.push(u)}}if(vv(t),Ev(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){let s=t.onStateUpdate,i=t.stateDeps,a=!1,c=[],l=J(()=>{let f=[];for(let g=0;g<i.length;g++){let p=i[g];try{f[g]=typeof p=="function"?p(t,t.state,t.context):t.state?.[p]}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 h=t.context?.designSystem;h&&tt(h);try{s(t,t.state,t.context,{prev:d,next:f})}catch(g){if(t.context?.plugins?.length&&Et("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{h&&Z()}},{depth:r.path.length});r.__effects.push(l)}Av(t)}function eb(t){let e=t.parent,r=e?.node;if(!r||!t.node){pb(t,t.parent);return}let n=null,o=Object.keys(e),s=o.indexOf(t.key);for(let i=s+1;i<o.length;i++){let a=e[o[i]];if(a?.node?.parentNode===r){n=a.node;break}}n?r.insertBefore(t.node,n):r.appendChild(t.node)}function ab(t,e,r){let n=Ut(t,t.ifDeps,r),o=J(()=>{let s;try{s=n(t,t.state,t.context)}catch(a){if(s=!1,e.__ifError=a,typeof console<"u"&&console.warn){let c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,a?.message||a)}return}let i=e.__if;if(e.__if=!!s,i&&!e.__if&&t.node)t.node.remove();else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=br(t)),t.node&&(t.node.ref=t),eb(t),eh(t);else{if(e.__ifInitialized=!0,t.tag||(t.tag=yr(t)),qe("Init",t,{}),t.node||(t.node=br(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!e.__fragmentAnchor){let c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),e.__fragmentAnchor=c}qe("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),ub(t,{}),ib(t,{skipIfEffect:!0}),eh(t),lb(t),db(t,{}),eb(t),ob(t,{})}},{depth:e.path.length});e.__effects.push(o)}function eh(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),Ov(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"&&Jn(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 rh(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Jn(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&&kv(t,r)}var wv=0;function kv(t,e){let r=`_ds${wv++}`;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 h=l[d];if(typeof h=="object"){let g=d.includes("&")?c.split(", ").map(m=>d.replace(/&/g,m)).join(", "):c.split(", ").map(m=>`${m} ${d}`).join(", "),p="";for(let m in h)p+=`${m.replace(/[A-Z]/g,b=>"-"+b.toLowerCase())}: ${h[m]};`;u+=ge(`${g} { ${p} }`,g)+`
44
44
  `}else f+=`${d.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${h};`}f&&(s+=ge(`${c} { ${f} }`,c)+`
45
- `),u&&(s+=u)}}s&&(o.textContent+=s)}function vv(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=J(()=>{let f=t.state&&(at(t.state)?t.state.root:null);if(!f||!at(f))return;let u=f;u=u[i];for(let h=0;h<a.length&&!(u==null||typeof u!="object");h++)if(at(u))u=u[a[h]];else break;if(!c.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let h=t.context?.designSystem;h&&tt(h);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(g){t.context?.plugins?.length&&Et("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{h&&Z()}}if(!d&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){let g=r.__effects[h];g&&g!==l&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!d&&typeof t.onUpdate=="function"){let h=t.context?.designSystem;h&&tt(h);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&Et("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{h&&Z()}}},{depth:r.path.length});c.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function sh(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 rb=new Set;function Cv(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;rb.has(n)||(rb.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 Qn(t,e,r){let n={},o=new Set,s=(i,a,c)=>{let l=c?new Set(Object.keys(n)):null;if(ut[i]){let f=ut[i](a,e,e.state,e.context);if(f){let u=Array.isArray(f)?f:[f];for(let d of u)d&&Object.assign(n,d)}}else n[i]=a;if(c)for(let f in n)l.has(f)||o.add(f)};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let a=t[i];if(typeof a=="function"&&(a=a(e,e.state,e.context)),a==null||typeof a=="function")continue;if(typeof a=="object"&&!Array.isArray(a)){if(i==="style"){for(let u in a){let d=a[u];if(typeof d=="function"&&(d=d(e,e.state,e.context)),d==null||typeof d=="function")continue;let h=typeof e[u]=="function"&&(ut[u]||yt&&yt.has(u));s(u,d,h)}continue}if(sh(i,e)){let u=Qn(a,e,!0);Object.keys(u).length&&(n[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){Mt()&&Cv(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){let u=e.context?.designSystem?.media?.[i.slice(1)];u&&(l=`@media ${u}`)}let f=Qn(a,e,!1);Object.keys(f).length&&(n[l]=f);continue}let c=typeof e[i]=="function"&&(ut[i]||yt&&yt.has(i));s(i,a,c)}if(r)for(let i in n)o.add(i);for(let i of o){let a=n[i];typeof a=="string"&&!a.includes("!important")&&(n[i]=a+" !important")}return n}function ih(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&ih(t[r],e+1))return!0}return!1}function cb(t,e,r){if(!e||typeof e!="object"||Array.isArray(e))return null;if(sh(t,r)){let s=Qn(e,r,!0);return Object.keys(s).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:s}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){let s=r.context?.designSystem?.media?.[t.slice(1)];s&&(n=`@media ${s}`)}let o=Qn(e,r,!1);return Object.keys(o).length?{cssProp:n,block:o}:null}function Av(t){let e=t.__ref;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!th(r))continue;let n=t[r];if(!n||typeof n!="object"||Array.isArray(n)||!ih(n))continue;let o=null,s,i=J(()=>{if(!t.node)return;let a=t.context?.designSystem;a&&tt(a);let c,l=!1;try{let f=cb(r,n,t),u=f?rh(f.block)+"::"+f.cssProp:null;if(u!==null&&u===s)l=!0;else if(s=u,f){let d=ne({[f.cssProp]:f.block},null,t.context?.cssPrefix);c=d?d.split(" ").filter(Boolean):null}else c=null}finally{a&&Z()}if(!(l||!t.node.classList)){if(o)for(let f of o)t.node.classList.remove(f);if(c&&c.length)for(let f of c)t.node.classList.add(f);o=c}},{depth:e.path.length});e.__effects.push(i)}}function Ev(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;if(/[:@\s>~+[\]]/.test(s)){if(typeof console<"u"&&console.warn){let u=s.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${o}\` is read as one prop name. Nest the selector inside instead: \`${o}${u}: { '${s.slice(u.length)}': {...} }\`.`)}continue}let i=t[n];if(!i||typeof i!="object")continue;let a=o==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let u,d=t[s];if(d===void 0){let p=!!t.state&&s in t.state,m=t.state?t.state[s]:void 0;if(p||m!==void 0)u=m;else{let b=t.context?.cases?.[s];if(b===void 0)return;try{u=typeof b=="function"?b.call(t,t):b}catch(x){u=!1,e.__conditionalError=x,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,x?.message||x)}}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(p){u=!1,e.__conditionalError=p,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,p?.message||p)}else u=d;let h=a?!u:!!u;if(!t.node||h===c.lastMatch)return;c.lastMatch=h;let g=t.context?.designSystem;g&&tt(g);try{if(h){let p={},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(sh(y,t)){let I=Qn(_,t,!0);Object.keys(I).length&&(m[`[data-theme="${y.slice(1)}"] &`]=I,b=!0)}else{let I=y;if(v==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let R=t.context?.designSystem?.media?.[y.slice(1)];R&&(I=`@media ${R}`)}let z=Qn(_,t,!1);Object.keys(z).length&&(m[I]=z,b=!0)}continue}let E=typeof _=="function"?_(t,t.state,t.context):_;if(E!=null)if(ut[y]){let I=ut[y](E,t,t.state,t.context);if(I){let z=Array.isArray(I)?I:[I];for(let R of z)R&&Object.assign(p,R)}}else yt&&yt.has(y)&&(p[y]=E)}let x=Object.keys(p);if(x.length){Jn(t.node,p);for(let y of x)r.set(y,n);c.appliedKeys=x}else c.appliedKeys=null;if(b){let y=ne(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 p of c.appliedKeys)r.get(p)===n&&(t.node.style[p]="",r.delete(p));c.appliedKeys=null}if(c.appliedClasses){for(let p of c.appliedClasses)t.node.classList.remove(p);c.appliedClasses=null}}}finally{g&&Z()}};e.__conditionalRunners.push(l);let f=J(l,{depth:e.path.length});e.__effects.push(f)}}var Jp=new WeakSet;function Tv(t){let e=t.ownerDocument;!e||Jp.has(e)||(Jp.add(e),queueMicrotask(()=>{Jp.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var Zp=new WeakSet,nb=!1;function Ov(t){let{node:e}=t;if(!e)return;if(nb||(nb=!0,ne({display:"none"})),Zp.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Zp.add(t);let r=t.context?.designSystem;r&&tt(r);try{let n={},o=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&ut.theme){let s=ut.theme(t.theme,t,t.state,t.context);if(s){if(Array.isArray(s))for(let i of s)i&&Object.assign(n,i);else Object.assign(n,s);o=!0}}for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||Rt.has(s)||s==="theme")continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!Zn(s)){if(ut[s]){let a=t[s],c=ut[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(yt&&yt.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)==="&"||s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"&&!Array.isArray(a)){if(ih(a))continue;let c=cb(s,a,t);c&&(n[c.cssProp]=c.block,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=ne(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&&Tv(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&&Z(),Zp.delete(t)}}function lb(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=Rp(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"||Rt.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!Zn(o)&&!(ut[o]||yt&&yt.has(o))&&wr(n,o)){let i=t[o];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=Lr(i,t,t.state,t.context),t[o]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!Uc(Sr(o)||o))continue;let a=Sr(o)||o;e.setAttribute(a,Si(a,i))}}}function Rv(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 fb=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function ub(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!Zn(r)||fb.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=hv(r);xr.has(o)||qn(gv(o),t,n)}Pv(t)}function Pv(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of fb){let h=t[d];typeof h=="function"&&(r[d]=h,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 h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(i=h.clientX,a=h.clientY,c=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 g=h.clientX-i,p=h.clientY-a,m=Date.now()-c;if(m>s)return;let b=Math.abs(g),x=Math.abs(p);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=p<0?"up":"down";else return;let _="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),v=r[_],E=r.onSwipe;v&&v.call(t,d,t,t.state,t.context),E&&E.call(t,{direction:y,dx:g,dy:p,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 Xc(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]=Xc(o,s):r[n]=s}return r}function nh(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 p=u;(typeof u=="string"||typeof u=="number")&&(p={value:u,text:u}),f=d?{...d,state:p}:{state:p}}else d&&(f=Xc(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let p=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...p]}}else f={...f,extends:n};let h=f?.key||u&&typeof u=="object"&&u.key||`${l}`,g;try{g=oe(f,t,h,r)}catch(p){if(typeof console<"u"&&console.error){let m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${h}" failed to construct at ${m} (initial render, skipping this row):`,p?.message||p)}continue}!o&&g?.node&&i.appendChild(g.node)}return o||t.node.appendChild(i),!0}if(typeof e=="string"){let o=sb(e,t);if(Array.isArray(o))return nh(t,o,r)}if(typeof e=="object")for(let o in e){if(Rt.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=Xc(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};oe(s,t,o,r)}}}function oh(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 db(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let a=r;try{r=a(t,t.state,t.context)}catch(d){if(r=void 0,typeof console<"u"&&console.error){let h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${h} (initial run, treating as empty):`,d?.message||d)}}t.children=r;let c=t.__ref,l=!1,f=Ut(t,t.childrenDeps,a),u=J(()=>{let d=l;l=!0;let h;try{h=f(t,t.state,t.context)}catch(v){if(typeof console<"u"&&console.error){let E=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${E}${d?"":" (initial tracking run)"}:`,v?.message||v)}return}if(!d||h===t.children)return;t.children=h;let g=typeof t.onContentUpdate=="function",p=g?[]:null,m=g?[]:null,b=g?[]:null;if(Array.isArray(h)&&t.childrenAs==="state"){let v=t.childProps,E=[],I=new Map;for(let N=0;N<h.length;N++){let X=h[N],D=v;if(typeof v=="function")try{D=v(t,X)}catch{D=null}let q=D&&D.key||X&&X.key||`${N}`;E.push(q),I.set(q,{rawChild:X,childProps:D})}let z=new Set(E),R=c.__children.slice();for(let N of R)if(!z.has(N)){let X=t[N];X?.remove&&X.remove(),delete t[N],m&&m.push(N)}let P=t.childExtends,G=t.tag==="fragment",bt=t.context?.document||globalThis.document,V=G?null:bt?.createDocumentFragment(),Q=new Set;for(let N of E){let X=I.get(N),D=X.rawChild,q=t[N];if(q&&q.state){if(D&&typeof D=="object"){let U=q.state,Ze=U.$replace||U.replace,Xt=U.$update||U.update;if(typeof Ze=="function")Ze.call(U,D);else if(typeof Xt=="function"){for(let Wt in U)if(!(Wt==="__element"||Wt==="root"||Wt==="parent"||Wt==="update")&&!Object.prototype.hasOwnProperty.call(D,Wt))try{U[Wt]=void 0}catch{}Xt.call(U,D)}else for(let Wt in D)U[Wt]=D[Wt]}b&&b.push(N);continue}let dt=D;(typeof D=="string"||typeof D=="number")&&(dt={value:D,text:D});let At=X.childProps,gt=At?{...At,state:dt}:{state:dt};if(P&&!gt.ignoreChildExtends)if(gt.extends){let U=Array.isArray(gt.extends)?gt.extends:[gt.extends],Ze=Array.isArray(P)?P:[P];gt={...gt,extends:[...Ze,...U]}}else gt={...gt,extends:P};let Je;try{Je=oe(gt,t,N,e)}catch(U){if(typeof console<"u"&&console.error){let Ze=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${N}" failed to construct at ${Ze} (reconcile, skipping this row):`,U?.message||U)}Q.add(N);continue}!G&&Je?.node&&V&&V.appendChild(Je.node),p&&p.push(N)}if(!G&&V&&V.childNodes.length&&t.node&&t.node.appendChild(V),!G&&t.node){let N=null;for(let X of E){let D=t[X]?.node;if(!D)continue;let q=N?N.nextSibling:t.node.firstChild;D!==q&&t.node.insertBefore(D,q),N=D}}c.__children=Q.size?E.filter(N=>!Q.has(N)):E,g&&(p.length||m.length)&&tb(t,{added:p,removed:m,kept:b}),oh(t,!1);return}let _=g?[...c.__children]:null;for(let v of[...c.__children]){let E=t[v];E?.remove&&E.remove(),delete t[v]}c.__children=[],nh(t,h,e),oh(t,!1),g&&tb(t,{added:[...c.__children],removed:_,kept:[]})},{depth:c.path.length});c.__effects.push(u)}let s=nh(t,r||n,e);if((r||n)&&!s)return;let i=t.context?.components||{};{let a=Object.keys(t);for(let c=0;c<a.length;c++){let l=a[c];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;let f=l.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;let u={extends:t[l]};delete t[l];for(let d=c+1;d<a.length;d++){let h=a[d],g=h.charCodeAt(0);if(g>=65&&g<=90||Rt.has(h)||typeof t[h]=="function"&&(h.startsWith("on")||h.startsWith(".")))break;let p=t[h];p!==void 0&&(u[h]=p,delete t[h])}t[f]&&typeof t[f]=="object"?t[f]={...u,...t[f]}:t[f]=u}}for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a)||Rt.has(a)||typeof t[a]!="object"||t[a]===null)continue;let c=a.charCodeAt(0);if(c<65||c>90)continue;let l=t[a];if(!l.__ref){if(!l.extends&&!l.extend){let f=i[a]||i[`smbls.${a}`];f&&(l={...l,extends:f})}if(t.childProps&&(l=Xc(t.childProps,l)),o&&!l.ignoreChildExtends)if(l.extends){let f=Array.isArray(l.extends)?l.extends:[l.extends],u=Array.isArray(o)?o:[o];l={...l,extends:[...u,...f]}}else l={...l,extends:o};oe(l,t,a,e)}}}function pb(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 qe(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Et(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&&tt(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&Et("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&Z(),i&&(e.__ref.__inRender=!1)}}return!0}var hb={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"]},gb={"gradient-blue-light":`linear-gradient(to right,
45
+ `),u&&(s+=u)}}s&&(o.textContent+=s)}function vv(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=J(()=>{let f=t.state&&(at(t.state)?t.state.root:null);if(!f||!at(f))return;let u=f;u=u[i];for(let h=0;h<a.length&&!(u==null||typeof u!="object");h++)if(at(u))u=u[a[h]];else break;if(!c.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let h=t.context?.designSystem;h&&tt(h);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(g){t.context?.plugins?.length&&Et("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{h&&Z()}}if(!d&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){let g=r.__effects[h];g&&g!==l&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!d&&typeof t.onUpdate=="function"){let h=t.context?.designSystem;h&&tt(h);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&Et("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{h&&Z()}}},{depth:r.path.length});c.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function sh(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 rb=new Set;function Cv(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;rb.has(n)||(rb.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 Qn(t,e,r){let n={},o=new Set,s=(i,a,c)=>{let l=c?new Set(Object.keys(n)):null;if(ut[i]){let f=ut[i](a,e,e.state,e.context);if(f){let u=Array.isArray(f)?f:[f];for(let d of u)d&&Object.assign(n,d)}}else n[i]=a;if(c)for(let f in n)l.has(f)||o.add(f)};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let a=t[i];if(typeof a=="function"&&(a=a(e,e.state,e.context)),a==null||typeof a=="function")continue;if(typeof a=="object"&&!Array.isArray(a)){if(i==="style"){for(let u in a){let d=a[u];if(typeof d=="function"&&(d=d(e,e.state,e.context)),d==null||typeof d=="function")continue;let h=typeof e[u]=="function"&&(ut[u]||yt&&yt.has(u));s(u,d,h)}continue}if(sh(i,e)){let u=Qn(a,e,!1);Object.keys(u).length&&(n[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){Mt()&&Cv(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){let u=e.context?.designSystem?.media?.[i.slice(1)];u&&(l=`@media ${u}`)}let f=Qn(a,e,!1);Object.keys(f).length&&(n[l]=f);continue}let c=typeof e[i]=="function"&&(ut[i]||yt&&yt.has(i));s(i,a,c)}if(r)for(let i in n)o.add(i);for(let i of o){let a=n[i];typeof a=="string"&&!a.includes("!important")&&(n[i]=a+" !important")}return n}function ih(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&ih(t[r],e+1))return!0}return!1}function cb(t,e,r){if(!e||typeof e!="object"||Array.isArray(e))return null;if(sh(t,r)){let s=Qn(e,r,!1);return Object.keys(s).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:s}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){let s=r.context?.designSystem?.media?.[t.slice(1)];s&&(n=`@media ${s}`)}let o=Qn(e,r,!1);return Object.keys(o).length?{cssProp:n,block:o}:null}function Av(t){let e=t.__ref;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!th(r))continue;let n=t[r];if(!n||typeof n!="object"||Array.isArray(n)||!ih(n))continue;let o=null,s,i=J(()=>{if(!t.node)return;let a=t.context?.designSystem;a&&tt(a);let c,l=!1;try{let f=cb(r,n,t),u=f?rh(f.block)+"::"+f.cssProp:null;if(u!==null&&u===s)l=!0;else if(s=u,f){let d=ne({[f.cssProp]:f.block},null,t.context?.cssPrefix);c=d?d.split(" ").filter(Boolean):null}else c=null}finally{a&&Z()}if(!(l||!t.node.classList)){if(o)for(let f of o)t.node.classList.remove(f);if(c&&c.length)for(let f of c)t.node.classList.add(f);o=c}},{depth:e.path.length});e.__effects.push(i)}}function Ev(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;if(/[:@\s>~+[\]]/.test(s)){if(typeof console<"u"&&console.warn){let u=s.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${o}\` is read as one prop name. Nest the selector inside instead: \`${o}${u}: { '${s.slice(u.length)}': {...} }\`.`)}continue}let i=t[n];if(!i||typeof i!="object")continue;let a=o==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let u,d=t[s];if(d===void 0){let p=!!t.state&&s in t.state,m=t.state?t.state[s]:void 0;if(p||m!==void 0)u=m;else{let b=t.context?.cases?.[s];if(b===void 0)return;try{u=typeof b=="function"?b.call(t,t):b}catch(x){u=!1,e.__conditionalError=x,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,x?.message||x)}}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(p){u=!1,e.__conditionalError=p,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,p?.message||p)}else u=d;let h=a?!u:!!u;if(!t.node||h===c.lastMatch)return;c.lastMatch=h;let g=t.context?.designSystem;g&&tt(g);try{if(h){let p={},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(sh(y,t)){let I=Qn(_,t,!1);Object.keys(I).length&&(m[`[data-theme="${y.slice(1)}"] &`]=I,b=!0)}else{let I=y;if(v==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let R=t.context?.designSystem?.media?.[y.slice(1)];R&&(I=`@media ${R}`)}let z=Qn(_,t,!1);Object.keys(z).length&&(m[I]=z,b=!0)}continue}let E=typeof _=="function"?_(t,t.state,t.context):_;if(E!=null)if(ut[y]){let I=ut[y](E,t,t.state,t.context);if(I){let z=Array.isArray(I)?I:[I];for(let R of z)R&&Object.assign(p,R)}}else yt&&yt.has(y)&&(p[y]=E)}let x=Object.keys(p);if(x.length){Jn(t.node,p);for(let y of x)r.set(y,n);c.appliedKeys=x}else c.appliedKeys=null;if(b){let y=ne(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 p of c.appliedKeys)r.get(p)===n&&(t.node.style[p]="",r.delete(p));c.appliedKeys=null}if(c.appliedClasses){for(let p of c.appliedClasses)t.node.classList.remove(p);c.appliedClasses=null}}}finally{g&&Z()}};e.__conditionalRunners.push(l);let f=J(l,{depth:e.path.length});e.__effects.push(f)}}var Jp=new WeakSet;function Tv(t){let e=t.ownerDocument;!e||Jp.has(e)||(Jp.add(e),queueMicrotask(()=>{Jp.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var Zp=new WeakSet,nb=!1;function Ov(t){let{node:e}=t;if(!e)return;if(nb||(nb=!0,ne({display:"none"})),Zp.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Zp.add(t);let r=t.context?.designSystem;r&&tt(r);try{let n={},o=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&ut.theme){let s=ut.theme(t.theme,t,t.state,t.context);if(s){if(Array.isArray(s))for(let i of s)i&&Object.assign(n,i);else Object.assign(n,s);o=!0}}for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||Rt.has(s)||s==="theme")continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!Zn(s)){if(ut[s]){let a=t[s],c=ut[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(yt&&yt.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)==="&"||s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"&&!Array.isArray(a)){if(ih(a))continue;let c=cb(s,a,t);c&&(n[c.cssProp]=c.block,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=ne(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&&Tv(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&&Z(),Zp.delete(t)}}function lb(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=Rp(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"||Rt.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!Zn(o)&&!(ut[o]||yt&&yt.has(o))&&wr(n,o)){let i=t[o];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=Lr(i,t,t.state,t.context),t[o]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!Uc(Sr(o)||o))continue;let a=Sr(o)||o;e.setAttribute(a,Si(a,i))}}}function Rv(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 fb=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function ub(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!Zn(r)||fb.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=hv(r);xr.has(o)||qn(gv(o),t,n)}Pv(t)}function Pv(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of fb){let h=t[d];typeof h=="function"&&(r[d]=h,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 h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(i=h.clientX,a=h.clientY,c=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 g=h.clientX-i,p=h.clientY-a,m=Date.now()-c;if(m>s)return;let b=Math.abs(g),x=Math.abs(p);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=p<0?"up":"down";else return;let _="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),v=r[_],E=r.onSwipe;v&&v.call(t,d,t,t.state,t.context),E&&E.call(t,{direction:y,dx:g,dy:p,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 Xc(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]=Xc(o,s):r[n]=s}return r}function nh(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 p=u;(typeof u=="string"||typeof u=="number")&&(p={value:u,text:u}),f=d?{...d,state:p}:{state:p}}else d&&(f=Xc(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let p=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...p]}}else f={...f,extends:n};let h=f?.key||u&&typeof u=="object"&&u.key||`${l}`,g;try{g=oe(f,t,h,r)}catch(p){if(typeof console<"u"&&console.error){let m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${h}" failed to construct at ${m} (initial render, skipping this row):`,p?.message||p)}continue}!o&&g?.node&&i.appendChild(g.node)}return o||t.node.appendChild(i),!0}if(typeof e=="string"){let o=sb(e,t);if(Array.isArray(o))return nh(t,o,r)}if(typeof e=="object")for(let o in e){if(Rt.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=Xc(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};oe(s,t,o,r)}}}function oh(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 db(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let a=r;try{r=a(t,t.state,t.context)}catch(d){if(r=void 0,typeof console<"u"&&console.error){let h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${h} (initial run, treating as empty):`,d?.message||d)}}t.children=r;let c=t.__ref,l=!1,f=Ut(t,t.childrenDeps,a),u=J(()=>{let d=l;l=!0;let h;try{h=f(t,t.state,t.context)}catch(v){if(typeof console<"u"&&console.error){let E=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${E}${d?"":" (initial tracking run)"}:`,v?.message||v)}return}if(!d||h===t.children)return;t.children=h;let g=typeof t.onContentUpdate=="function",p=g?[]:null,m=g?[]:null,b=g?[]:null;if(Array.isArray(h)&&t.childrenAs==="state"){let v=t.childProps,E=[],I=new Map;for(let N=0;N<h.length;N++){let X=h[N],D=v;if(typeof v=="function")try{D=v(t,X)}catch{D=null}let q=D&&D.key||X&&X.key||`${N}`;E.push(q),I.set(q,{rawChild:X,childProps:D})}let z=new Set(E),R=c.__children.slice();for(let N of R)if(!z.has(N)){let X=t[N];X?.remove&&X.remove(),delete t[N],m&&m.push(N)}let P=t.childExtends,G=t.tag==="fragment",bt=t.context?.document||globalThis.document,V=G?null:bt?.createDocumentFragment(),Q=new Set;for(let N of E){let X=I.get(N),D=X.rawChild,q=t[N];if(q&&q.state){if(D&&typeof D=="object"){let U=q.state,Ze=U.$replace||U.replace,Xt=U.$update||U.update;if(typeof Ze=="function")Ze.call(U,D);else if(typeof Xt=="function"){for(let Wt in U)if(!(Wt==="__element"||Wt==="root"||Wt==="parent"||Wt==="update")&&!Object.prototype.hasOwnProperty.call(D,Wt))try{U[Wt]=void 0}catch{}Xt.call(U,D)}else for(let Wt in D)U[Wt]=D[Wt]}b&&b.push(N);continue}let dt=D;(typeof D=="string"||typeof D=="number")&&(dt={value:D,text:D});let At=X.childProps,gt=At?{...At,state:dt}:{state:dt};if(P&&!gt.ignoreChildExtends)if(gt.extends){let U=Array.isArray(gt.extends)?gt.extends:[gt.extends],Ze=Array.isArray(P)?P:[P];gt={...gt,extends:[...Ze,...U]}}else gt={...gt,extends:P};let Je;try{Je=oe(gt,t,N,e)}catch(U){if(typeof console<"u"&&console.error){let Ze=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${N}" failed to construct at ${Ze} (reconcile, skipping this row):`,U?.message||U)}Q.add(N);continue}!G&&Je?.node&&V&&V.appendChild(Je.node),p&&p.push(N)}if(!G&&V&&V.childNodes.length&&t.node&&t.node.appendChild(V),!G&&t.node){let N=null;for(let X of E){let D=t[X]?.node;if(!D)continue;let q=N?N.nextSibling:t.node.firstChild;D!==q&&t.node.insertBefore(D,q),N=D}}c.__children=Q.size?E.filter(N=>!Q.has(N)):E,g&&(p.length||m.length)&&tb(t,{added:p,removed:m,kept:b}),oh(t,!1);return}let _=g?[...c.__children]:null;for(let v of[...c.__children]){let E=t[v];E?.remove&&E.remove(),delete t[v]}c.__children=[],nh(t,h,e),oh(t,!1),g&&tb(t,{added:[...c.__children],removed:_,kept:[]})},{depth:c.path.length});c.__effects.push(u)}let s=nh(t,r||n,e);if((r||n)&&!s)return;let i=t.context?.components||{};{let a=Object.keys(t);for(let c=0;c<a.length;c++){let l=a[c];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;let f=l.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;let u={extends:t[l]};delete t[l];for(let d=c+1;d<a.length;d++){let h=a[d],g=h.charCodeAt(0);if(g>=65&&g<=90||Rt.has(h)||typeof t[h]=="function"&&(h.startsWith("on")||h.startsWith(".")))break;let p=t[h];p!==void 0&&(u[h]=p,delete t[h])}t[f]&&typeof t[f]=="object"?t[f]={...u,...t[f]}:t[f]=u}}for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a)||Rt.has(a)||typeof t[a]!="object"||t[a]===null)continue;let c=a.charCodeAt(0);if(c<65||c>90)continue;let l=t[a];if(!l.__ref){if(!l.extends&&!l.extend){let f=i[a]||i[`smbls.${a}`];f&&(l={...l,extends:f})}if(t.childProps&&(l=Xc(t.childProps,l)),o&&!l.ignoreChildExtends)if(l.extends){let f=Array.isArray(l.extends)?l.extends:[l.extends],u=Array.isArray(o)?o:[o];l={...l,extends:[...u,...f]}}else l={...l,extends:o};oe(l,t,a,e)}}}function pb(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 qe(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Et(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&&tt(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&Et("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&Z(),i&&(e.__ref.__inRender=!1)}}return!0}var hb={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"]},gb={"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}`},ac=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(kn(o,!0),gi(o,e,s),typeof o.html=="function"&&o.node&&!o.node.innerHTML){let d=o.context?.designSystem;d&&z(d);try{let m=o.html(o,o.state,o.context);m!=null&&typeof m!="function"&&(o.node.innerHTML=m)}catch{}finally{d&&U()}}if($t("Create",o,n),$t("Complete",o,n),$t("Render",o,n),$t("RenderRouter",o,n),ii(o,n),typeof o.onFrame=="function"){let d=o.onFrame,m=o.context?.designSystem,x=()=>{if(o.node){if(o.node.isConnected){m&&z(m);try{d(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{m&&U()}}requestAnimationFrame(x)}};requestAnimationFrame(x)}return o}function Wa(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&&!G(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Lt(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 p in u)a[p]===void 0&&(a[p]=u[p]);let h=new Set(l.languages||[]);for(let p in l.translations)!h.has(p)&&a[p]===void 0&&(a[p]=l.translations[p])}t.state=G(a)?a:lt(a),t.state.__element=t,t.state.root=t.state,Lt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Lt(t,t.state);return}if(typeof i=="string"){if(t.state=ci(i,e),t.state&&typeof t.state=="object"&&!G(t.state)){let c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}Lt(t,t.state);return}if(typeof i=="function"){let c=i(t,e?.state);t.state=G(c)?c:lt(c||{})}else G(i)?t.state=i:t.state=lt({...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,Lt(t,t.state)}function hn(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 ci(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let s=t.slice(3);return s?hn(e.state,s):e.state??{}}if(t.startsWith("~/")){let s=e.state?.root||e.state,o=t.slice(2);return o?hn(s,o):s??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=hn(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{}}var za=new Set(["s","state","ctx","context"]);function Ga(t){try{let r=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return r?r[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function Ha(t){if(typeof t!="function"||t.length!==2)return!1;let e=Ga(t);if(e.length<2)return!1;let r=e[1].replace(/[{}[\]]/g,"").trim();return r.length>0&&!za.has(r)}function qa(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||ne(c)||X[c]||H&&H.has(c)||De(r,c)||(At()&&Ha(t[c])&&console.warn(`[smbls] custom prop "${c}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${c}', \u2026) instead of reading el.${c}(\u2026) directly (see RULES.md Rule 8).`),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&&z(n);try{return a(t,t.state,t.context)}catch{return}finally{n&&U()}},set(l){delete e.__exec[c],Object.defineProperty(t,c,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Ka(t,e){if(!(!Array.isArray(e)||e.length===0))for(let r=0;r<e.length;r++){let n=e[r];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function nt(t,e,r){return!Array.isArray(e)||e.length===0?r:function(...n){return Ka(t,e),r.apply(this,n)}}function je(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function ai(t,e){let r=t.__ref,n=!!(e&&e.skipIfEffect);if(qa(t),typeof t.text=="function"){let o=t.text,i=nt(t,t.textDeps,o),c=V(()=>{if(!r.contentManaged)try{let a=i(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=ze.call(t,a,t.state)),t.tag==="string"?t.node.nodeValue=a:t.node.textContent=a)}catch{}},{depth:r.path.length});r.__effects.push(c),r.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){let o=t.text,i=V(()=>{if(r.contentManaged)return;let c=ze.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)&&!ne(o)&&!r.__exec[o]){if(X[o]){let i=t[o],c=nt(t,t[o+"Deps"],i),a=o,l,f=V(()=>{let u=t.context?.designSystem;u&&z(u);try{let h=c(t,t.state,t.context),p=X[a](h,t,t.state,t.context);if(p&&t.node){let y=Sn(p);(y===null||y!==l)&&(l=y,re(t.node,p))}else t.node&&(a==="show"||a==="hide")&&(l=void 0,t.node.style.display="")}finally{u&&U()}},{depth:r.path.length});r.__effects.push(f),r.__exec[o]=i}else if(H&&H.has(o)){let i=t[o],c=nt(t,t[o+"Deps"],i),a=o,l,f=V(()=>{let u=t.context?.designSystem;u&&z(u);try{let h=c(t,t.state,t.context);if(t.node)if(h!=null){let p=a+":"+String(h);p!==l&&(l=p,re(t.node,{[a]:h}))}else l=void 0,t.node.style[a]=""}finally{u&&U()}},{depth:r.path.length});r.__effects.push(f),r.__exec[o]=i}}if(typeof t.html=="function"){let o=t.html,i=nt(t,t.htmlDeps,o),c=V(()=>{let a=t.context?.designSystem;a&&z(a);try{let l=i(t,t.state,t.context);t.node&&l!=null&&typeof l!="function"&&(t.node.innerHTML=l)}finally{a&&U()}},{depth:r.path.length});r.__effects.push(c),r.__exec.html=o}if(typeof t.value=="function"){let o=t.value,i=nt(t,t.valueDeps,o),c=V(()=>{try{let a=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let l=a==null?"":String(a);if(t.node.value===l)return;let f=typeof document<"u"&&document.activeElement===t.node,u=f&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,h=f&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=l,f&&u!=null&&h!=null)try{t.node.setSelectionRange(u,h)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(c),r.__exec.value=o}if(typeof t.style=="function"){let o=t.style,i=nt(t,t.styleDeps,o),c,a=V(()=>{let l=i(t,t.state,t.context),f=Sn(l);(f===null||f!==c)&&(c=f,re(t.node,l))},{depth:r.path.length});r.__effects.push(a),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=nt(t,je(t.styleDeps,o),i),a,l=V(()=>{try{let f=c(t,t.state,t.context);if(t.node){let u=o+":"+String(f);u!==a&&(a=u,re(t.node,{[o]:f}))}}catch{}},{depth:r.path.length});r.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(let o in t.attr)if(typeof t.attr[o]=="function"){let i=nt(t,je(t.attrDeps,o),t.attr[o]),c=o,a=V(()=>{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){if(typeof t.aria[o]!="function")continue;let i=nt(t,je(t.ariaDeps,o),t.aria[o]),c="aria-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=V(()=>{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){if(typeof t.data[o]!="function")continue;let i=nt(t,je(t.dataDeps,o),t.data[o]),a="data-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),l=V(()=>{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){if(typeof s[o]!="function")continue;let i=nt(t,je(t.classDeps,o),s[o]),c=V(()=>{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"&&fi(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||ne(o))continue;let c=t[o];r.__exec[o]=c;let a=t.tag||"div";if(De(a,o)&&!X[o]&&!(H&&H.has(o))){let l=Re(o)||o,f=nt(t,t[o+"Deps"],c),u=V(()=>{try{let h=f(t,t.state,t.context);t.node?.setAttribute&&(h==null||h===!1?t.node.removeAttribute(l):typeof h!="function"&&typeof h!="object"&&(l==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(l,h===!0?"":h)))}catch{}},{depth:r.path.length});r.__effects.push(u)}}if(Xa(t),tf(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){let o=t.onStateUpdate,i=t.stateDeps,c=!1,a=[],l=V(()=>{let f=[];for(let y=0;y<i.length;y++){let d=i[y];try{f[y]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{f[y]=void 0}}if(!c){c=!0,a=f;return}let u=f.length!==a.length;for(let y=0;!u&&y<f.length;y++)f[y]!==a[y]&&(u=!0);let h=a;if(a=f,!u)return;let p=t.context?.designSystem;p&&z(p);try{o(t,t.state,t.context,{prev:h,next:f})}catch(y){if(t.context?.plugins?.length&&wt("error",t,{hook:"onStateUpdate",error:y})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',y),t.context?.strictMode)throw y}finally{p&&U()}},{depth:r.path.length});r.__effects.push(l)}Za(t)}function ni(t){let e=t.parent,r=e?.node;if(!r||!t.node){gi(t,t.parent);return}let n=null,s=Object.keys(e),o=s.indexOf(t.key);for(let i=o+1;i<s.length;i++){let c=e[s[i]];if(c?.node?.parentNode===r){n=c.node;break}}n?r.insertBefore(t.node,n):r.appendChild(t.node)}function fi(t,e,r){let n=nt(t,t.ifDeps,r),s=V(()=>{let o;try{o=n(t,t.state,t.context)}catch(c){if(o=!1,e.__ifError=c,typeof console<"u"&&console.warn){let a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,c?.message||c)}return}let i=e.__if;if(e.__if=!!o,i&&!e.__if&&t.node)t.node.remove();else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=ue(t)),t.node&&(t.node.ref=t),ni(t),_n(t);else{if(e.__ifInitialized=!0,t.tag||(t.tag=le(t)),$t("Init",t,{}),t.node||(t.node=ue(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!e.__fragmentAnchor){let a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),e.__fragmentAnchor=a}$t("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),pi(t,{}),ai(t,{skipIfEffect:!0}),_n(t),ui(t),hi(t,{}),ni(t),ii(t,{})}},{depth:e.path.length});e.__effects.push(s)}function _n(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),rf(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"&&re(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 Sn(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function re(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&&Ja(t,r)}var Qa=0;function Ja(t,e){let r=`_ds${Qa++}`;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 h in l){let p=l[h];if(typeof p=="object"){let y=h.includes("&")?a.split(", ").map(m=>h.replace(/&/g,m)).join(", "):a.split(", ").map(m=>`${m} ${h}`).join(", "),d="";for(let m in p)d+=`${m.replace(/[A-Z]/g,x=>"-"+x.toLowerCase())}: ${p[m]};`;u+=Gt(`${y} { ${d} }`,y)+`
15
15
  `}else f+=`${h.replace(/[A-Z]/g,y=>"-"+y.toLowerCase())}: ${p};`}f&&(o+=Gt(`${a} { ${f} }`,a)+`
16
- `),u&&(o+=u)}}o&&(s.textContent+=o)}function Xa(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=V(()=>{let f=t.state&&(G(t.state)?t.state.root:null);if(!f||!G(f))return;let u=f;u=u[i];for(let p=0;p<c.length&&!(u==null||typeof u!="object");p++)if(G(u))u=u[c[p]];else break;if(!a.value)return;let h=!1;if(typeof t.onBeforeUpdate=="function"){let p=t.context?.designSystem;p&&z(p);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(h=!0)}catch(y){t.context?.plugins?.length&&wt("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}finally{p&&U()}}if(!h&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){let y=r.__effects[p];y&&y!==l&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}if(!h&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&z(p);try{t.onUpdate(t,t.state,t.context)}catch(y){t.context?.plugins?.length&&wt("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}finally{p&&U()}}},{depth:r.path.length});a.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function Cn(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 oi=new Set;function Ya(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;oi.has(n)||(oi.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 oe(t,e,r){let n={},s=new Set,o=(i,c,a)=>{let l=a?new Set(Object.keys(n)):null;if(X[i]){let f=X[i](c,e,e.state,e.context);if(f){let u=Array.isArray(f)?f:[f];for(let h of u)h&&Object.assign(n,h)}}else n[i]=c;if(a)for(let f in n)l.has(f)||s.add(f)};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let c=t[i];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(i==="style"){for(let u in c){let h=c[u];if(typeof h=="function"&&(h=h(e,e.state,e.context)),h==null||typeof h=="function")continue;let p=typeof e[u]=="function"&&(X[u]||H&&H.has(u));o(u,h,p)}continue}if(Cn(i,e)){let u=oe(c,e,!0);Object.keys(u).length&&(n[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){At()&&Ya(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){let u=e.context?.designSystem?.media?.[i.slice(1)];u&&(l=`@media ${u}`)}let f=oe(c,e,!1);Object.keys(f).length&&(n[l]=f);continue}let a=typeof e[i]=="function"&&(X[i]||H&&H.has(i));o(i,c,a)}if(r)for(let i in n)s.add(i);for(let i of s){let c=n[i];typeof c=="string"&&!c.includes("!important")&&(n[i]=c+" !important")}return n}function vn(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&vn(t[r],e+1))return!0}return!1}function li(t,e,r){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Cn(t,r)){let o=oe(e,r,!0);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){let o=r.context?.designSystem?.media?.[t.slice(1)];o&&(n=`@media ${o}`)}let s=oe(e,r,!1);return Object.keys(s).length?{cssProp:n,block:s}:null}function Za(t){let e=t.__ref;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!xn(r))continue;let n=t[r];if(!n||typeof n!="object"||Array.isArray(n)||!vn(n))continue;let s=null,o,i=V(()=>{if(!t.node)return;let c=t.context?.designSystem;c&&z(c);let a,l=!1;try{let f=li(r,n,t),u=f?Sn(f.block)+"::"+f.cssProp:null;if(u!==null&&u===o)l=!0;else if(o=u,f){let h=ee({[f.cssProp]:f.block},null,t.context?.cssPrefix);a=h?h.split(" ").filter(Boolean):null}else a=null}finally{c&&U()}if(!(l||!t.node.classList)){if(s)for(let f of s)t.node.classList.remove(f);if(a&&a.length)for(let f of a)t.node.classList.add(f);s=a}},{depth:e.path.length});e.__effects.push(i)}}function tf(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;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){let u=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${s}\` is read as one prop name. Nest the selector inside instead: \`${s}${u}: { '${o.slice(u.length)}': {...} }\`.`)}continue}let i=t[n];if(!i||typeof i!="object")continue;let c=s==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let u,h=t[o];if(h===void 0){let d=!!t.state&&o in t.state,m=t.state?t.state[o]:void 0;if(d||m!==void 0)u=m;else{let x=t.context?.cases?.[o];if(x===void 0)return;try{u=typeof x=="function"?x.call(t,t):x}catch(b){u=!1,e.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}}}else if(typeof h=="function")try{u=h(t,t.state,t.context)}catch(d){u=!1,e.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else u=h;let p=c?!u:!!u;if(!t.node||p===a.lastMatch)return;a.lastMatch=p;let y=t.context?.designSystem;y&&z(y);try{if(p){let d={},m={},x=!1;for(let g in i){if(!Object.prototype.hasOwnProperty.call(i,g))continue;let _=i[g],S=g.charAt(0);if((S===":"||S==="@"||S==="&")&&_&&typeof _=="object"&&!Array.isArray(_)){if(Cn(g,t)){let D=oe(_,t,!0);Object.keys(D).length&&(m[`[data-theme="${g.slice(1)}"] &`]=D,x=!0)}else{let D=g;if(S==="@"&&!g.startsWith("@media")&&!g.startsWith("@keyframes")){let F=t.context?.designSystem?.media?.[g.slice(1)];F&&(D=`@media ${F}`)}let ot=oe(_,t,!1);Object.keys(ot).length&&(m[D]=ot,x=!0)}continue}let v=typeof _=="function"?_(t,t.state,t.context):_;if(v!=null)if(X[g]){let D=X[g](v,t,t.state,t.context);if(D){let ot=Array.isArray(D)?D:[D];for(let F of ot)F&&Object.assign(d,F)}}else H&&H.has(g)&&(d[g]=v)}let b=Object.keys(d);if(b.length){re(t.node,d);for(let g of b)r.set(g,n);a.appliedKeys=b}else a.appliedKeys=null;if(x){let g=ee(m,null,t.context?.cssPrefix),_=g?g.split(" ").filter(Boolean):[];if(_.length&&t.node.classList){for(let S of _)t.node.classList.add(S);a.appliedClasses=_}else a.appliedClasses=null}else if(a.appliedClasses){for(let g of a.appliedClasses)t.node.classList.remove(g);a.appliedClasses=null}}else{if(a.appliedKeys){for(let d of a.appliedKeys)r.get(d)===n&&(t.node.style[d]="",r.delete(d));a.appliedKeys=null}if(a.appliedClasses){for(let d of a.appliedClasses)t.node.classList.remove(d);a.appliedClasses=null}}}finally{y&&U()}};e.__conditionalRunners.push(l);let f=V(l,{depth:e.path.length});e.__effects.push(f)}}var gn=new WeakSet;function ef(t){let e=t.ownerDocument;!e||gn.has(e)||(gn.add(e),queueMicrotask(()=>{gn.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var yn=new WeakSet,si=!1;function rf(t){let{node:e}=t;if(!e)return;if(si||(si=!0,ee({display:"none"})),yn.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}yn.add(t);let r=t.context?.designSystem;r&&z(r);try{let n={},s=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&X.theme){let o=X.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(let i of o)i&&Object.assign(n,i);else Object.assign(n,o);s=!0}}for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||rt.has(o)||o==="theme")continue;let i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!ne(o)){if(X[o]){let c=t[o],a=X[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(H&&H.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)==="&"||o.charAt(0)==="@"||o.charAt(0)===":"){let c=t[o];if(c&&typeof c=="object"&&!Array.isArray(c)){if(vn(c))continue;let a=li(o,c,t);a&&(n[a.cssProp]=a.block,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=ee(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&&ef(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&&U(),yn.delete(t)}}function ui(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=js(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)&&!ne(s)&&!(X[s]||H&&H.has(s))&&De(n,s)){let i=t[s];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=ze(i,t,t.state,t.context),t[s]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!nn(Re(s)||s))continue;let c=Re(s)||s;e.setAttribute(c,ir(c,i))}}}function nf(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 di=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function pi(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!ne(r)||di.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=Ba(r);de.has(s)||Te(Ua(s),t,n)}of(t)}function of(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let h of di){let p=t[h];typeof p=="function"&&(r[h]=p,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=h=>{let p=h.touches&&h.touches[0]||h.changedTouches&&h.changedTouches[0];p&&(i=p.clientX,c=p.clientY,a=Date.now(),l=!0)},u=h=>{if(!l)return;l=!1;let p=h.changedTouches&&h.changedTouches[0]||h.touches&&h.touches[0];if(!p)return;let y=p.clientX-i,d=p.clientY-c,m=Date.now()-a;if(m>o)return;let x=Math.abs(y),b=Math.abs(d);if(Math.max(x,b)<s)return;let g;if(x>b*1.2)g=y<0?"left":"right";else if(b>x*1.2)g=d<0?"up":"down";else return;let _="onSwipe"+g.charAt(0).toUpperCase()+g.slice(1),S=r[_],v=r.onSwipe;S&&S.call(t,h,t,t.state,t.context),v&&v.call(t,{direction:g,dx:y,dy:d,dt:m,event:h},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 dr(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]=dr(s,o):r[n]=o}return r}function wn(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 h=c;if(typeof c=="function")try{h=c(t,f)}catch{h=null}if(a==="state"){let d=u;(typeof u=="string"||typeof u=="number")&&(d={value:u,text:u}),f=h?{...h,state:d}:{state:d}}else h&&(f=dr(h,f));if(n&&!f.ignoreChildExtends)if(f.extends){let d=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...d]}}else f={...f,extends:n};let p=f?.key||u&&typeof u=="object"&&u.key||`${l}`,y;try{y=ht(f,t,p,r)}catch(d){if(typeof console<"u"&&console.error){let m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${p}" failed to construct at ${m} (initial render, skipping this row):`,d?.message||d)}continue}!s&&y?.node&&i.appendChild(y.node)}return s||t.node.appendChild(i),!0}if(typeof e=="string"){let s=ci(e,t);if(Array.isArray(s))return wn(t,s,r)}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=dr(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};ht(o,t,s,r)}}}function kn(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 hi(t,e){let{children:r,content:n}=t,s=t.childExtends;if(typeof r=="function"){let c=r;try{r=c(t,t.state,t.context)}catch(h){if(r=void 0,typeof console<"u"&&console.error){let p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,h?.message||h)}}t.children=r;let a=t.__ref,l=!1,f=nt(t,t.childrenDeps,c),u=V(()=>{let h=l;l=!0;let p;try{p=f(t,t.state,t.context)}catch(S){if(typeof console<"u"&&console.error){let v=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${v}${h?"":" (initial tracking run)"}:`,S?.message||S)}return}if(!h||p===t.children)return;t.children=p;let y=typeof t.onContentUpdate=="function",d=y?[]:null,m=y?[]:null,x=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){let S=t.childProps,v=[],D=new Map;for(let $=0;$<p.length;$++){let N=p[$],T=S;if(typeof S=="function")try{T=S(t,N)}catch{T=null}let tt=T&&T.key||N&&N.key||`${$}`;v.push(tt),D.set(tt,{rawChild:N,childProps:T})}let ot=new Set(v),F=a.__children.slice();for(let $ of F)if(!ot.has($)){let N=t[$];N?.remove&&N.remove(),delete t[$],m&&m.push($)}let q=t.childExtends,ct=t.tag==="fragment",Tt=t.context?.document||globalThis.document,K=ct?null:Tt?.createDocumentFragment(),st=new Set;for(let $ of v){let N=D.get($),T=N.rawChild,tt=t[$];if(tt&&tt.state){if(T&&typeof T=="object"){let P=tt.state,Pt=P.$replace||P.replace,ft=P.$update||P.update;if(typeof Pt=="function")Pt.call(P,T);else if(typeof ft=="function"){for(let it in P)if(!(it==="__element"||it==="root"||it==="parent"||it==="update")&&!Object.prototype.hasOwnProperty.call(T,it))try{P[it]=void 0}catch{}ft.call(P,T)}else for(let it in T)P[it]=T[it]}x&&x.push($);continue}let Ft=T;(typeof T=="string"||typeof T=="number")&&(Ft={value:T,text:T});let se=N.childProps,at=se?{...se,state:Ft}:{state:Ft};if(q&&!at.ignoreChildExtends)if(at.extends){let P=Array.isArray(at.extends)?at.extends:[at.extends],Pt=Array.isArray(q)?q:[q];at={...at,extends:[...Pt,...P]}}else at={...at,extends:q};let ie;try{ie=ht(at,t,$,e)}catch(P){if(typeof console<"u"&&console.error){let Pt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${$}" failed to construct at ${Pt} (reconcile, skipping this row):`,P?.message||P)}st.add($);continue}!ct&&ie?.node&&K&&K.appendChild(ie.node),d&&d.push($)}if(!ct&&K&&K.childNodes.length&&t.node&&t.node.appendChild(K),!ct&&t.node){let $=null;for(let N of v){let T=t[N]?.node;if(!T)continue;let tt=$?$.nextSibling:t.node.firstChild;T!==tt&&t.node.insertBefore(T,tt),$=T}}a.__children=st.size?v.filter($=>!st.has($)):v,y&&(d.length||m.length)&&ri(t,{added:d,removed:m,kept:x}),kn(t,!1);return}let _=y?[...a.__children]:null;for(let S of[...a.__children]){let v=t[S];v?.remove&&v.remove(),delete t[S]}a.__children=[],wn(t,p,e),kn(t,!1),y&&ri(t,{added:[...a.__children],removed:_,kept:[]})},{depth:a.path.length});a.__effects.push(u)}let o=wn(t,r||n,e);if((r||n)&&!o)return;let i=t.context?.components||{};{let c=Object.keys(t);for(let a=0;a<c.length;a++){let l=c[a];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;let f=l.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;let u={extends:t[l]};delete t[l];for(let h=a+1;h<c.length;h++){let p=c[h],y=p.charCodeAt(0);if(y>=65&&y<=90||rt.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;let d=t[p];d!==void 0&&(u[p]=d,delete t[p])}t[f]&&typeof t[f]=="object"?t[f]={...u,...t[f]}:t[f]=u}}for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||rt.has(c)||typeof t[c]!="object"||t[c]===null)continue;let a=c.charCodeAt(0);if(a<65||a>90)continue;let l=t[c];if(!l.__ref){if(!l.extends&&!l.extend){let f=i[c]||i[`smbls.${c}`];f&&(l={...l,extends:f})}if(t.childProps&&(l=dr(t.childProps,l)),s&&!l.ignoreChildExtends)if(l.extends){let f=Array.isArray(l.extends)?l.extends:[l.extends],u=Array.isArray(s)?s:[s];l={...l,extends:[...u,...f]}}else l={...l,extends:s};ht(l,t,c,e)}}}function gi(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 $t(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&wt(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&&z(c);try{if(o(e,e.state,e.context,r)===!1)return!1}catch(a){if(e.context?.plugins?.length&&wt("error",e,{hook:s,error:a})||console.error(`[DOMQL] Lifecycle "${s}" error:`,a),e.context?.strictMode)throw a}finally{c&&U(),i&&(e.__ref.__inRender=!1)}}return!0}var sf=ht;var cf=(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?lt(r.state):void 0;return ht(t,e,"Root",{state:n,context:r.context||{}})};return _i(af);})();
16
+ `),u&&(o+=u)}}o&&(s.textContent+=o)}function Xa(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=V(()=>{let f=t.state&&(G(t.state)?t.state.root:null);if(!f||!G(f))return;let u=f;u=u[i];for(let p=0;p<c.length&&!(u==null||typeof u!="object");p++)if(G(u))u=u[c[p]];else break;if(!a.value)return;let h=!1;if(typeof t.onBeforeUpdate=="function"){let p=t.context?.designSystem;p&&z(p);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(h=!0)}catch(y){t.context?.plugins?.length&&wt("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}finally{p&&U()}}if(!h&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){let y=r.__effects[p];y&&y!==l&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}if(!h&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&z(p);try{t.onUpdate(t,t.state,t.context)}catch(y){t.context?.plugins?.length&&wt("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}finally{p&&U()}}},{depth:r.path.length});a.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function Cn(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 oi=new Set;function Ya(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;oi.has(n)||(oi.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 oe(t,e,r){let n={},s=new Set,o=(i,c,a)=>{let l=a?new Set(Object.keys(n)):null;if(X[i]){let f=X[i](c,e,e.state,e.context);if(f){let u=Array.isArray(f)?f:[f];for(let h of u)h&&Object.assign(n,h)}}else n[i]=c;if(a)for(let f in n)l.has(f)||s.add(f)};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let c=t[i];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(i==="style"){for(let u in c){let h=c[u];if(typeof h=="function"&&(h=h(e,e.state,e.context)),h==null||typeof h=="function")continue;let p=typeof e[u]=="function"&&(X[u]||H&&H.has(u));o(u,h,p)}continue}if(Cn(i,e)){let u=oe(c,e,!1);Object.keys(u).length&&(n[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){At()&&Ya(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){let u=e.context?.designSystem?.media?.[i.slice(1)];u&&(l=`@media ${u}`)}let f=oe(c,e,!1);Object.keys(f).length&&(n[l]=f);continue}let a=typeof e[i]=="function"&&(X[i]||H&&H.has(i));o(i,c,a)}if(r)for(let i in n)s.add(i);for(let i of s){let c=n[i];typeof c=="string"&&!c.includes("!important")&&(n[i]=c+" !important")}return n}function vn(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&vn(t[r],e+1))return!0}return!1}function li(t,e,r){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Cn(t,r)){let o=oe(e,r,!1);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){let o=r.context?.designSystem?.media?.[t.slice(1)];o&&(n=`@media ${o}`)}let s=oe(e,r,!1);return Object.keys(s).length?{cssProp:n,block:s}:null}function Za(t){let e=t.__ref;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!xn(r))continue;let n=t[r];if(!n||typeof n!="object"||Array.isArray(n)||!vn(n))continue;let s=null,o,i=V(()=>{if(!t.node)return;let c=t.context?.designSystem;c&&z(c);let a,l=!1;try{let f=li(r,n,t),u=f?Sn(f.block)+"::"+f.cssProp:null;if(u!==null&&u===o)l=!0;else if(o=u,f){let h=ee({[f.cssProp]:f.block},null,t.context?.cssPrefix);a=h?h.split(" ").filter(Boolean):null}else a=null}finally{c&&U()}if(!(l||!t.node.classList)){if(s)for(let f of s)t.node.classList.remove(f);if(a&&a.length)for(let f of a)t.node.classList.add(f);s=a}},{depth:e.path.length});e.__effects.push(i)}}function tf(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;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){let u=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${s}\` is read as one prop name. Nest the selector inside instead: \`${s}${u}: { '${o.slice(u.length)}': {...} }\`.`)}continue}let i=t[n];if(!i||typeof i!="object")continue;let c=s==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let u,h=t[o];if(h===void 0){let d=!!t.state&&o in t.state,m=t.state?t.state[o]:void 0;if(d||m!==void 0)u=m;else{let x=t.context?.cases?.[o];if(x===void 0)return;try{u=typeof x=="function"?x.call(t,t):x}catch(b){u=!1,e.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}}}else if(typeof h=="function")try{u=h(t,t.state,t.context)}catch(d){u=!1,e.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else u=h;let p=c?!u:!!u;if(!t.node||p===a.lastMatch)return;a.lastMatch=p;let y=t.context?.designSystem;y&&z(y);try{if(p){let d={},m={},x=!1;for(let g in i){if(!Object.prototype.hasOwnProperty.call(i,g))continue;let _=i[g],S=g.charAt(0);if((S===":"||S==="@"||S==="&")&&_&&typeof _=="object"&&!Array.isArray(_)){if(Cn(g,t)){let D=oe(_,t,!1);Object.keys(D).length&&(m[`[data-theme="${g.slice(1)}"] &`]=D,x=!0)}else{let D=g;if(S==="@"&&!g.startsWith("@media")&&!g.startsWith("@keyframes")){let F=t.context?.designSystem?.media?.[g.slice(1)];F&&(D=`@media ${F}`)}let ot=oe(_,t,!1);Object.keys(ot).length&&(m[D]=ot,x=!0)}continue}let v=typeof _=="function"?_(t,t.state,t.context):_;if(v!=null)if(X[g]){let D=X[g](v,t,t.state,t.context);if(D){let ot=Array.isArray(D)?D:[D];for(let F of ot)F&&Object.assign(d,F)}}else H&&H.has(g)&&(d[g]=v)}let b=Object.keys(d);if(b.length){re(t.node,d);for(let g of b)r.set(g,n);a.appliedKeys=b}else a.appliedKeys=null;if(x){let g=ee(m,null,t.context?.cssPrefix),_=g?g.split(" ").filter(Boolean):[];if(_.length&&t.node.classList){for(let S of _)t.node.classList.add(S);a.appliedClasses=_}else a.appliedClasses=null}else if(a.appliedClasses){for(let g of a.appliedClasses)t.node.classList.remove(g);a.appliedClasses=null}}else{if(a.appliedKeys){for(let d of a.appliedKeys)r.get(d)===n&&(t.node.style[d]="",r.delete(d));a.appliedKeys=null}if(a.appliedClasses){for(let d of a.appliedClasses)t.node.classList.remove(d);a.appliedClasses=null}}}finally{y&&U()}};e.__conditionalRunners.push(l);let f=V(l,{depth:e.path.length});e.__effects.push(f)}}var gn=new WeakSet;function ef(t){let e=t.ownerDocument;!e||gn.has(e)||(gn.add(e),queueMicrotask(()=>{gn.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var yn=new WeakSet,si=!1;function rf(t){let{node:e}=t;if(!e)return;if(si||(si=!0,ee({display:"none"})),yn.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}yn.add(t);let r=t.context?.designSystem;r&&z(r);try{let n={},s=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&X.theme){let o=X.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(let i of o)i&&Object.assign(n,i);else Object.assign(n,o);s=!0}}for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||rt.has(o)||o==="theme")continue;let i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!ne(o)){if(X[o]){let c=t[o],a=X[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(H&&H.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)==="&"||o.charAt(0)==="@"||o.charAt(0)===":"){let c=t[o];if(c&&typeof c=="object"&&!Array.isArray(c)){if(vn(c))continue;let a=li(o,c,t);a&&(n[a.cssProp]=a.block,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=ee(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&&ef(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&&U(),yn.delete(t)}}function ui(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=js(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)&&!ne(s)&&!(X[s]||H&&H.has(s))&&De(n,s)){let i=t[s];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=ze(i,t,t.state,t.context),t[s]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!nn(Re(s)||s))continue;let c=Re(s)||s;e.setAttribute(c,ir(c,i))}}}function nf(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 di=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function pi(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!ne(r)||di.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=Ba(r);de.has(s)||Te(Ua(s),t,n)}of(t)}function of(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let h of di){let p=t[h];typeof p=="function"&&(r[h]=p,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=h=>{let p=h.touches&&h.touches[0]||h.changedTouches&&h.changedTouches[0];p&&(i=p.clientX,c=p.clientY,a=Date.now(),l=!0)},u=h=>{if(!l)return;l=!1;let p=h.changedTouches&&h.changedTouches[0]||h.touches&&h.touches[0];if(!p)return;let y=p.clientX-i,d=p.clientY-c,m=Date.now()-a;if(m>o)return;let x=Math.abs(y),b=Math.abs(d);if(Math.max(x,b)<s)return;let g;if(x>b*1.2)g=y<0?"left":"right";else if(b>x*1.2)g=d<0?"up":"down";else return;let _="onSwipe"+g.charAt(0).toUpperCase()+g.slice(1),S=r[_],v=r.onSwipe;S&&S.call(t,h,t,t.state,t.context),v&&v.call(t,{direction:g,dx:y,dy:d,dt:m,event:h},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 dr(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]=dr(s,o):r[n]=o}return r}function wn(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 h=c;if(typeof c=="function")try{h=c(t,f)}catch{h=null}if(a==="state"){let d=u;(typeof u=="string"||typeof u=="number")&&(d={value:u,text:u}),f=h?{...h,state:d}:{state:d}}else h&&(f=dr(h,f));if(n&&!f.ignoreChildExtends)if(f.extends){let d=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...d]}}else f={...f,extends:n};let p=f?.key||u&&typeof u=="object"&&u.key||`${l}`,y;try{y=ht(f,t,p,r)}catch(d){if(typeof console<"u"&&console.error){let m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${p}" failed to construct at ${m} (initial render, skipping this row):`,d?.message||d)}continue}!s&&y?.node&&i.appendChild(y.node)}return s||t.node.appendChild(i),!0}if(typeof e=="string"){let s=ci(e,t);if(Array.isArray(s))return wn(t,s,r)}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=dr(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};ht(o,t,s,r)}}}function kn(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 hi(t,e){let{children:r,content:n}=t,s=t.childExtends;if(typeof r=="function"){let c=r;try{r=c(t,t.state,t.context)}catch(h){if(r=void 0,typeof console<"u"&&console.error){let p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,h?.message||h)}}t.children=r;let a=t.__ref,l=!1,f=nt(t,t.childrenDeps,c),u=V(()=>{let h=l;l=!0;let p;try{p=f(t,t.state,t.context)}catch(S){if(typeof console<"u"&&console.error){let v=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${v}${h?"":" (initial tracking run)"}:`,S?.message||S)}return}if(!h||p===t.children)return;t.children=p;let y=typeof t.onContentUpdate=="function",d=y?[]:null,m=y?[]:null,x=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){let S=t.childProps,v=[],D=new Map;for(let $=0;$<p.length;$++){let N=p[$],T=S;if(typeof S=="function")try{T=S(t,N)}catch{T=null}let tt=T&&T.key||N&&N.key||`${$}`;v.push(tt),D.set(tt,{rawChild:N,childProps:T})}let ot=new Set(v),F=a.__children.slice();for(let $ of F)if(!ot.has($)){let N=t[$];N?.remove&&N.remove(),delete t[$],m&&m.push($)}let q=t.childExtends,ct=t.tag==="fragment",Tt=t.context?.document||globalThis.document,K=ct?null:Tt?.createDocumentFragment(),st=new Set;for(let $ of v){let N=D.get($),T=N.rawChild,tt=t[$];if(tt&&tt.state){if(T&&typeof T=="object"){let P=tt.state,Pt=P.$replace||P.replace,ft=P.$update||P.update;if(typeof Pt=="function")Pt.call(P,T);else if(typeof ft=="function"){for(let it in P)if(!(it==="__element"||it==="root"||it==="parent"||it==="update")&&!Object.prototype.hasOwnProperty.call(T,it))try{P[it]=void 0}catch{}ft.call(P,T)}else for(let it in T)P[it]=T[it]}x&&x.push($);continue}let Ft=T;(typeof T=="string"||typeof T=="number")&&(Ft={value:T,text:T});let se=N.childProps,at=se?{...se,state:Ft}:{state:Ft};if(q&&!at.ignoreChildExtends)if(at.extends){let P=Array.isArray(at.extends)?at.extends:[at.extends],Pt=Array.isArray(q)?q:[q];at={...at,extends:[...Pt,...P]}}else at={...at,extends:q};let ie;try{ie=ht(at,t,$,e)}catch(P){if(typeof console<"u"&&console.error){let Pt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${$}" failed to construct at ${Pt} (reconcile, skipping this row):`,P?.message||P)}st.add($);continue}!ct&&ie?.node&&K&&K.appendChild(ie.node),d&&d.push($)}if(!ct&&K&&K.childNodes.length&&t.node&&t.node.appendChild(K),!ct&&t.node){let $=null;for(let N of v){let T=t[N]?.node;if(!T)continue;let tt=$?$.nextSibling:t.node.firstChild;T!==tt&&t.node.insertBefore(T,tt),$=T}}a.__children=st.size?v.filter($=>!st.has($)):v,y&&(d.length||m.length)&&ri(t,{added:d,removed:m,kept:x}),kn(t,!1);return}let _=y?[...a.__children]:null;for(let S of[...a.__children]){let v=t[S];v?.remove&&v.remove(),delete t[S]}a.__children=[],wn(t,p,e),kn(t,!1),y&&ri(t,{added:[...a.__children],removed:_,kept:[]})},{depth:a.path.length});a.__effects.push(u)}let o=wn(t,r||n,e);if((r||n)&&!o)return;let i=t.context?.components||{};{let c=Object.keys(t);for(let a=0;a<c.length;a++){let l=c[a];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;let f=l.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;let u={extends:t[l]};delete t[l];for(let h=a+1;h<c.length;h++){let p=c[h],y=p.charCodeAt(0);if(y>=65&&y<=90||rt.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;let d=t[p];d!==void 0&&(u[p]=d,delete t[p])}t[f]&&typeof t[f]=="object"?t[f]={...u,...t[f]}:t[f]=u}}for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||rt.has(c)||typeof t[c]!="object"||t[c]===null)continue;let a=c.charCodeAt(0);if(a<65||a>90)continue;let l=t[c];if(!l.__ref){if(!l.extends&&!l.extend){let f=i[c]||i[`smbls.${c}`];f&&(l={...l,extends:f})}if(t.childProps&&(l=dr(t.childProps,l)),s&&!l.ignoreChildExtends)if(l.extends){let f=Array.isArray(l.extends)?l.extends:[l.extends],u=Array.isArray(s)?s:[s];l={...l,extends:[...u,...f]}}else l={...l,extends:s};ht(l,t,c,e)}}}function gi(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 $t(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&wt(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&&z(c);try{if(o(e,e.state,e.context,r)===!1)return!1}catch(a){if(e.context?.plugins?.length&&wt("error",e,{hook:s,error:a})||console.error(`[DOMQL] Lifecycle "${s}" error:`,a),e.context?.strictMode)throw a}finally{c&&U(),i&&(e.__ref.__inRender=!1)}}return!0}var sf=ht;var cf=(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?lt(r.state):void 0;return ht(t,e,"Root",{state:n,context:r.context||{}})};return _i(af);})();
package/dist/smbls.esm.js CHANGED
@@ -42,7 +42,7 @@ FROM ${a}${l}`},S0=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(oh(s,!0),db(s,e,o),typeof s.html=="function"&&s.node&&!s.node.innerHTML){let p=s.context?.designSystem;p&&tt(p);try{let m=s.html(s,s.state,s.context);m!=null&&typeof m!="function"&&(s.node.innerHTML=m)}catch{}finally{p&&Z()}}if(qe("Create",s,n),qe("Complete",s,n),qe("Render",s,n),qe("RenderRouter",s,n),nb(s,n),typeof s.onFrame=="function"){let p=s.onFrame,m=s.context?.designSystem,b=()=>{if(s.node){if(s.node.isConnected){m&&tt(m);try{p(s,s.state,s.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{m&&Z()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return s}function gv(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&&!at(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Gt(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 h in u)c[h]===void 0&&(c[h]=u[h]);let d=new Set(l.languages||[]);for(let h in l.translations)!d.has(h)&&c[h]===void 0&&(c[h]=l.translations[h])}t.state=at(c)?c:Ht(c),t.state.__element=t,t.state.root=t.state,Gt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Gt(t,t.state);return}if(typeof i=="string"){if(t.state=ob(i,e),t.state&&typeof t.state=="object"&&!at(t.state)){let a=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:a,enumerable:!1,configurable:!0,writable:!0})}Gt(t,t.state);return}if(typeof i=="function"){let a=i(t,e?.state);t.state=at(a)?a:Ht(a||{})}else at(i)?t.state=i:t.state=Ht({...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,Gt(t,t.state)}function Xp(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 ob(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let o=t.slice(3);return o?Xp(e.state,o):e.state??{}}if(t.startsWith("~/")){let o=e.state?.root||e.state,s=t.slice(2);return s?Xp(o,s):o??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=Xp(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{}}var mv=new Set(["s","state","ctx","context"]);function yv(t){try{let r=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return r?r[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function bv(t){if(typeof t!="function"||t.length!==2)return!1;let e=yv(t);if(e.length<2)return!1;let r=e[1].replace(/[{}[\]]/g,"").trim();return r.length>0&&!mv.has(r)}function xv(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"||Rt.has(a))continue;let c=a.charCodeAt(0);c>=65&&c<=90||Zn(a)||ut[a]||yt&&yt.has(a)||wr(r,a)||(Mt()&&bv(t[a])&&console.warn(`[smbls] custom prop "${a}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${a}', \u2026) instead of reading el.${a}(\u2026) directly (see RULES.md Rule 8).`),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&&tt(n);try{return c(t,t.state,t.context)}catch{return}finally{n&&Z()}},set(l){delete e.__exec[a],Object.defineProperty(t,a,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function _v(t,e){if(!(!Array.isArray(e)||e.length===0))for(let r=0;r<e.length;r++){let n=e[r];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function Ut(t,e,r){return!Array.isArray(e)||e.length===0?r:function(...n){return _v(t,e),r.apply(this,n)}}function Ci(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function sb(t,e){let r=t.__ref,n=!!(e&&e.skipIfEffect);if(xv(t),typeof t.text=="function"){let s=t.text,i=Ut(t,t.textDeps,s),a=J(()=>{if(!r.contentManaged)try{let c=i(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&typeof c!="object"&&(typeof c=="string"&&c.includes("{{")&&(c=Lr.call(t,c,t.state)),t.tag==="string"?t.node.nodeValue=c:t.node.textContent=c)}catch{}},{depth:r.path.length});r.__effects.push(a),r.__exec.text=s}else if(typeof t.text=="string"&&t.text.includes("{{")){let s=t.text,i=J(()=>{if(r.contentManaged)return;let a=Lr.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"&&!Rt.has(s)&&!Zn(s)&&!r.__exec[s]){if(ut[s]){let i=t[s],a=Ut(t,t[s+"Deps"],i),c=s,l,f=J(()=>{let u=t.context?.designSystem;u&&tt(u);try{let d=a(t,t.state,t.context),h=ut[c](d,t,t.state,t.context);if(h&&t.node){let g=rh(h);(g===null||g!==l)&&(l=g,Jn(t.node,h))}else t.node&&(c==="show"||c==="hide")&&(l=void 0,t.node.style.display="")}finally{u&&Z()}},{depth:r.path.length});r.__effects.push(f),r.__exec[s]=i}else if(yt&&yt.has(s)){let i=t[s],a=Ut(t,t[s+"Deps"],i),c=s,l,f=J(()=>{let u=t.context?.designSystem;u&&tt(u);try{let d=a(t,t.state,t.context);if(t.node)if(d!=null){let h=c+":"+String(d);h!==l&&(l=h,Jn(t.node,{[c]:d}))}else l=void 0,t.node.style[c]=""}finally{u&&Z()}},{depth:r.path.length});r.__effects.push(f),r.__exec[s]=i}}if(typeof t.html=="function"){let s=t.html,i=Ut(t,t.htmlDeps,s),a=J(()=>{let c=t.context?.designSystem;c&&tt(c);try{let l=i(t,t.state,t.context);t.node&&l!=null&&typeof l!="function"&&(t.node.innerHTML=l)}finally{c&&Z()}},{depth:r.path.length});r.__effects.push(a),r.__exec.html=s}if(typeof t.value=="function"){let s=t.value,i=Ut(t,t.valueDeps,s),a=J(()=>{try{let c=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let l=c==null?"":String(c);if(t.node.value===l)return;let f=typeof document<"u"&&document.activeElement===t.node,u=f&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,d=f&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=l,f&&u!=null&&d!=null)try{t.node.setSelectionRange(u,d)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(a),r.__exec.value=s}if(typeof t.style=="function"){let s=t.style,i=Ut(t,t.styleDeps,s),a,c=J(()=>{let l=i(t,t.state,t.context),f=rh(l);(f===null||f!==a)&&(a=f,Jn(t.node,l))},{depth:r.path.length});r.__effects.push(c),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=Ut(t,Ci(t.styleDeps,s),i),c,l=J(()=>{try{let f=a(t,t.state,t.context);if(t.node){let u=s+":"+String(f);u!==c&&(c=u,Jn(t.node,{[s]:f}))}}catch{}},{depth:r.path.length});r.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(let s in t.attr)if(typeof t.attr[s]=="function"){let i=Ut(t,Ci(t.attrDeps,s),t.attr[s]),a=s,c=J(()=>{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){if(typeof t.aria[s]!="function")continue;let i=Ut(t,Ci(t.ariaDeps,s),t.aria[s]),a="aria-"+s.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),c=J(()=>{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){if(typeof t.data[s]!="function")continue;let i=Ut(t,Ci(t.dataDeps,s),t.data[s]),c="data-"+s.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),l=J(()=>{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){if(typeof o[s]!="function")continue;let i=Ut(t,Ci(t.classDeps,s),o[s]),a=J(()=>{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"&&ib(t,r,t.if);for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||Rt.has(s)||typeof t[s]!="function")continue;let i=s.charCodeAt(0);if(i>=65&&i<=90||Zn(s))continue;let a=t[s];r.__exec[s]=a;let c=t.tag||"div";if(wr(c,s)&&!ut[s]&&!(yt&&yt.has(s))){let l=Sr(s)||s,f=Ut(t,t[s+"Deps"],a),u=J(()=>{try{let d=f(t,t.state,t.context);t.node?.setAttribute&&(d==null||d===!1?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&(l==="src"&&"src"in t.node?t.node.src=d:t.node.setAttribute(l,d===!0?"":d)))}catch{}},{depth:r.path.length});r.__effects.push(u)}}if(kv(t),Av(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){let s=t.onStateUpdate,i=t.stateDeps,a=!1,c=[],l=J(()=>{let f=[];for(let g=0;g<i.length;g++){let p=i[g];try{f[g]=typeof p=="function"?p(t,t.state,t.context):t.state?.[p]}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 h=t.context?.designSystem;h&&tt(h);try{s(t,t.state,t.context,{prev:d,next:f})}catch(g){if(t.context?.plugins?.length&&Et("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{h&&Z()}},{depth:r.path.length});r.__effects.push(l)}Cv(t)}function tb(t){let e=t.parent,r=e?.node;if(!r||!t.node){db(t,t.parent);return}let n=null,o=Object.keys(e),s=o.indexOf(t.key);for(let i=s+1;i<o.length;i++){let a=e[o[i]];if(a?.node?.parentNode===r){n=a.node;break}}n?r.insertBefore(t.node,n):r.appendChild(t.node)}function ib(t,e,r){let n=Ut(t,t.ifDeps,r),o=J(()=>{let s;try{s=n(t,t.state,t.context)}catch(a){if(s=!1,e.__ifError=a,typeof console<"u"&&console.warn){let c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,a?.message||a)}return}let i=e.__if;if(e.__if=!!s,i&&!e.__if&&t.node)t.node.remove();else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=br(t)),t.node&&(t.node.ref=t),tb(t),eh(t);else{if(e.__ifInitialized=!0,t.tag||(t.tag=yr(t)),qe("Init",t,{}),t.node||(t.node=br(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!e.__fragmentAnchor){let c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),e.__fragmentAnchor=c}qe("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),fb(t,{}),sb(t,{skipIfEffect:!0}),eh(t),cb(t),ub(t,{}),tb(t),nb(t,{})}},{depth:e.path.length});e.__effects.push(o)}function eh(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),Tv(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"&&Jn(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 rh(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Jn(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&&wv(t,r)}var Sv=0;function wv(t,e){let r=`_ds${Sv++}`;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 h=l[d];if(typeof h=="object"){let g=d.includes("&")?c.split(", ").map(m=>d.replace(/&/g,m)).join(", "):c.split(", ").map(m=>`${m} ${d}`).join(", "),p="";for(let m in h)p+=`${m.replace(/[A-Z]/g,b=>"-"+b.toLowerCase())}: ${h[m]};`;u+=ge(`${g} { ${p} }`,g)+`
44
44
  `}else f+=`${d.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${h};`}f&&(s+=ge(`${c} { ${f} }`,c)+`
45
- `),u&&(s+=u)}}s&&(o.textContent+=s)}function kv(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=J(()=>{let f=t.state&&(at(t.state)?t.state.root:null);if(!f||!at(f))return;let u=f;u=u[i];for(let h=0;h<a.length&&!(u==null||typeof u!="object");h++)if(at(u))u=u[a[h]];else break;if(!c.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let h=t.context?.designSystem;h&&tt(h);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(g){t.context?.plugins?.length&&Et("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{h&&Z()}}if(!d&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){let g=r.__effects[h];g&&g!==l&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!d&&typeof t.onUpdate=="function"){let h=t.context?.designSystem;h&&tt(h);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&Et("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{h&&Z()}}},{depth:r.path.length});c.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function sh(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 eb=new Set;function vv(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;eb.has(n)||(eb.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 Qn(t,e,r){let n={},o=new Set,s=(i,a,c)=>{let l=c?new Set(Object.keys(n)):null;if(ut[i]){let f=ut[i](a,e,e.state,e.context);if(f){let u=Array.isArray(f)?f:[f];for(let d of u)d&&Object.assign(n,d)}}else n[i]=a;if(c)for(let f in n)l.has(f)||o.add(f)};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let a=t[i];if(typeof a=="function"&&(a=a(e,e.state,e.context)),a==null||typeof a=="function")continue;if(typeof a=="object"&&!Array.isArray(a)){if(i==="style"){for(let u in a){let d=a[u];if(typeof d=="function"&&(d=d(e,e.state,e.context)),d==null||typeof d=="function")continue;let h=typeof e[u]=="function"&&(ut[u]||yt&&yt.has(u));s(u,d,h)}continue}if(sh(i,e)){let u=Qn(a,e,!0);Object.keys(u).length&&(n[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){Mt()&&vv(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){let u=e.context?.designSystem?.media?.[i.slice(1)];u&&(l=`@media ${u}`)}let f=Qn(a,e,!1);Object.keys(f).length&&(n[l]=f);continue}let c=typeof e[i]=="function"&&(ut[i]||yt&&yt.has(i));s(i,a,c)}if(r)for(let i in n)o.add(i);for(let i of o){let a=n[i];typeof a=="string"&&!a.includes("!important")&&(n[i]=a+" !important")}return n}function ih(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&ih(t[r],e+1))return!0}return!1}function ab(t,e,r){if(!e||typeof e!="object"||Array.isArray(e))return null;if(sh(t,r)){let s=Qn(e,r,!0);return Object.keys(s).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:s}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){let s=r.context?.designSystem?.media?.[t.slice(1)];s&&(n=`@media ${s}`)}let o=Qn(e,r,!1);return Object.keys(o).length?{cssProp:n,block:o}:null}function Cv(t){let e=t.__ref;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!th(r))continue;let n=t[r];if(!n||typeof n!="object"||Array.isArray(n)||!ih(n))continue;let o=null,s,i=J(()=>{if(!t.node)return;let a=t.context?.designSystem;a&&tt(a);let c,l=!1;try{let f=ab(r,n,t),u=f?rh(f.block)+"::"+f.cssProp:null;if(u!==null&&u===s)l=!0;else if(s=u,f){let d=ne({[f.cssProp]:f.block},null,t.context?.cssPrefix);c=d?d.split(" ").filter(Boolean):null}else c=null}finally{a&&Z()}if(!(l||!t.node.classList)){if(o)for(let f of o)t.node.classList.remove(f);if(c&&c.length)for(let f of c)t.node.classList.add(f);o=c}},{depth:e.path.length});e.__effects.push(i)}}function Av(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;if(/[:@\s>~+[\]]/.test(s)){if(typeof console<"u"&&console.warn){let u=s.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${o}\` is read as one prop name. Nest the selector inside instead: \`${o}${u}: { '${s.slice(u.length)}': {...} }\`.`)}continue}let i=t[n];if(!i||typeof i!="object")continue;let a=o==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let u,d=t[s];if(d===void 0){let p=!!t.state&&s in t.state,m=t.state?t.state[s]:void 0;if(p||m!==void 0)u=m;else{let b=t.context?.cases?.[s];if(b===void 0)return;try{u=typeof b=="function"?b.call(t,t):b}catch(x){u=!1,e.__conditionalError=x,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,x?.message||x)}}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(p){u=!1,e.__conditionalError=p,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,p?.message||p)}else u=d;let h=a?!u:!!u;if(!t.node||h===c.lastMatch)return;c.lastMatch=h;let g=t.context?.designSystem;g&&tt(g);try{if(h){let p={},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(sh(y,t)){let I=Qn(_,t,!0);Object.keys(I).length&&(m[`[data-theme="${y.slice(1)}"] &`]=I,b=!0)}else{let I=y;if(v==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let R=t.context?.designSystem?.media?.[y.slice(1)];R&&(I=`@media ${R}`)}let z=Qn(_,t,!1);Object.keys(z).length&&(m[I]=z,b=!0)}continue}let E=typeof _=="function"?_(t,t.state,t.context):_;if(E!=null)if(ut[y]){let I=ut[y](E,t,t.state,t.context);if(I){let z=Array.isArray(I)?I:[I];for(let R of z)R&&Object.assign(p,R)}}else yt&&yt.has(y)&&(p[y]=E)}let x=Object.keys(p);if(x.length){Jn(t.node,p);for(let y of x)r.set(y,n);c.appliedKeys=x}else c.appliedKeys=null;if(b){let y=ne(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 p of c.appliedKeys)r.get(p)===n&&(t.node.style[p]="",r.delete(p));c.appliedKeys=null}if(c.appliedClasses){for(let p of c.appliedClasses)t.node.classList.remove(p);c.appliedClasses=null}}}finally{g&&Z()}};e.__conditionalRunners.push(l);let f=J(l,{depth:e.path.length});e.__effects.push(f)}}var Jp=new WeakSet;function Ev(t){let e=t.ownerDocument;!e||Jp.has(e)||(Jp.add(e),queueMicrotask(()=>{Jp.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var Zp=new WeakSet,rb=!1;function Tv(t){let{node:e}=t;if(!e)return;if(rb||(rb=!0,ne({display:"none"})),Zp.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Zp.add(t);let r=t.context?.designSystem;r&&tt(r);try{let n={},o=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&ut.theme){let s=ut.theme(t.theme,t,t.state,t.context);if(s){if(Array.isArray(s))for(let i of s)i&&Object.assign(n,i);else Object.assign(n,s);o=!0}}for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||Rt.has(s)||s==="theme")continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!Zn(s)){if(ut[s]){let a=t[s],c=ut[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(yt&&yt.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)==="&"||s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"&&!Array.isArray(a)){if(ih(a))continue;let c=ab(s,a,t);c&&(n[c.cssProp]=c.block,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=ne(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&&Ev(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&&Z(),Zp.delete(t)}}function cb(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=Rp(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"||Rt.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!Zn(o)&&!(ut[o]||yt&&yt.has(o))&&wr(n,o)){let i=t[o];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=Lr(i,t,t.state,t.context),t[o]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!Vc(Sr(o)||o))continue;let a=Sr(o)||o;e.setAttribute(a,Si(a,i))}}}function Ov(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 lb=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function fb(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!Zn(r)||lb.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=pv(r);xr.has(o)||qn(hv(o),t,n)}Rv(t)}function Rv(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of lb){let h=t[d];typeof h=="function"&&(r[d]=h,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 h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(i=h.clientX,a=h.clientY,c=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 g=h.clientX-i,p=h.clientY-a,m=Date.now()-c;if(m>s)return;let b=Math.abs(g),x=Math.abs(p);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=p<0?"up":"down";else return;let _="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),v=r[_],E=r.onSwipe;v&&v.call(t,d,t,t.state,t.context),E&&E.call(t,{direction:y,dx:g,dy:p,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 Yc(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]=Yc(o,s):r[n]=s}return r}function nh(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 p=u;(typeof u=="string"||typeof u=="number")&&(p={value:u,text:u}),f=d?{...d,state:p}:{state:p}}else d&&(f=Yc(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let p=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...p]}}else f={...f,extends:n};let h=f?.key||u&&typeof u=="object"&&u.key||`${l}`,g;try{g=oe(f,t,h,r)}catch(p){if(typeof console<"u"&&console.error){let m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${h}" failed to construct at ${m} (initial render, skipping this row):`,p?.message||p)}continue}!o&&g?.node&&i.appendChild(g.node)}return o||t.node.appendChild(i),!0}if(typeof e=="string"){let o=ob(e,t);if(Array.isArray(o))return nh(t,o,r)}if(typeof e=="object")for(let o in e){if(Rt.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=Yc(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};oe(s,t,o,r)}}}function oh(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 ub(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let a=r;try{r=a(t,t.state,t.context)}catch(d){if(r=void 0,typeof console<"u"&&console.error){let h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${h} (initial run, treating as empty):`,d?.message||d)}}t.children=r;let c=t.__ref,l=!1,f=Ut(t,t.childrenDeps,a),u=J(()=>{let d=l;l=!0;let h;try{h=f(t,t.state,t.context)}catch(v){if(typeof console<"u"&&console.error){let E=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${E}${d?"":" (initial tracking run)"}:`,v?.message||v)}return}if(!d||h===t.children)return;t.children=h;let g=typeof t.onContentUpdate=="function",p=g?[]:null,m=g?[]:null,b=g?[]:null;if(Array.isArray(h)&&t.childrenAs==="state"){let v=t.childProps,E=[],I=new Map;for(let N=0;N<h.length;N++){let X=h[N],D=v;if(typeof v=="function")try{D=v(t,X)}catch{D=null}let q=D&&D.key||X&&X.key||`${N}`;E.push(q),I.set(q,{rawChild:X,childProps:D})}let z=new Set(E),R=c.__children.slice();for(let N of R)if(!z.has(N)){let X=t[N];X?.remove&&X.remove(),delete t[N],m&&m.push(N)}let P=t.childExtends,G=t.tag==="fragment",bt=t.context?.document||globalThis.document,V=G?null:bt?.createDocumentFragment(),Q=new Set;for(let N of E){let X=I.get(N),D=X.rawChild,q=t[N];if(q&&q.state){if(D&&typeof D=="object"){let U=q.state,Ze=U.$replace||U.replace,Xt=U.$update||U.update;if(typeof Ze=="function")Ze.call(U,D);else if(typeof Xt=="function"){for(let Wt in U)if(!(Wt==="__element"||Wt==="root"||Wt==="parent"||Wt==="update")&&!Object.prototype.hasOwnProperty.call(D,Wt))try{U[Wt]=void 0}catch{}Xt.call(U,D)}else for(let Wt in D)U[Wt]=D[Wt]}b&&b.push(N);continue}let dt=D;(typeof D=="string"||typeof D=="number")&&(dt={value:D,text:D});let At=X.childProps,gt=At?{...At,state:dt}:{state:dt};if(P&&!gt.ignoreChildExtends)if(gt.extends){let U=Array.isArray(gt.extends)?gt.extends:[gt.extends],Ze=Array.isArray(P)?P:[P];gt={...gt,extends:[...Ze,...U]}}else gt={...gt,extends:P};let Je;try{Je=oe(gt,t,N,e)}catch(U){if(typeof console<"u"&&console.error){let Ze=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${N}" failed to construct at ${Ze} (reconcile, skipping this row):`,U?.message||U)}Q.add(N);continue}!G&&Je?.node&&V&&V.appendChild(Je.node),p&&p.push(N)}if(!G&&V&&V.childNodes.length&&t.node&&t.node.appendChild(V),!G&&t.node){let N=null;for(let X of E){let D=t[X]?.node;if(!D)continue;let q=N?N.nextSibling:t.node.firstChild;D!==q&&t.node.insertBefore(D,q),N=D}}c.__children=Q.size?E.filter(N=>!Q.has(N)):E,g&&(p.length||m.length)&&Qy(t,{added:p,removed:m,kept:b}),oh(t,!1);return}let _=g?[...c.__children]:null;for(let v of[...c.__children]){let E=t[v];E?.remove&&E.remove(),delete t[v]}c.__children=[],nh(t,h,e),oh(t,!1),g&&Qy(t,{added:[...c.__children],removed:_,kept:[]})},{depth:c.path.length});c.__effects.push(u)}let s=nh(t,r||n,e);if((r||n)&&!s)return;let i=t.context?.components||{};{let a=Object.keys(t);for(let c=0;c<a.length;c++){let l=a[c];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;let f=l.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;let u={extends:t[l]};delete t[l];for(let d=c+1;d<a.length;d++){let h=a[d],g=h.charCodeAt(0);if(g>=65&&g<=90||Rt.has(h)||typeof t[h]=="function"&&(h.startsWith("on")||h.startsWith(".")))break;let p=t[h];p!==void 0&&(u[h]=p,delete t[h])}t[f]&&typeof t[f]=="object"?t[f]={...u,...t[f]}:t[f]=u}}for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a)||Rt.has(a)||typeof t[a]!="object"||t[a]===null)continue;let c=a.charCodeAt(0);if(c<65||c>90)continue;let l=t[a];if(!l.__ref){if(!l.extends&&!l.extend){let f=i[a]||i[`smbls.${a}`];f&&(l={...l,extends:f})}if(t.childProps&&(l=Yc(t.childProps,l)),o&&!l.ignoreChildExtends)if(l.extends){let f=Array.isArray(l.extends)?l.extends:[l.extends],u=Array.isArray(o)?o:[o];l={...l,extends:[...u,...f]}}else l={...l,extends:o};oe(l,t,a,e)}}}function db(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 qe(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Et(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&&tt(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&Et("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&Z(),i&&(e.__ref.__inRender=!1)}}return!0}var pb={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"]},hb={"gradient-blue-light":`linear-gradient(to right,
45
+ `),u&&(s+=u)}}s&&(o.textContent+=s)}function kv(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=J(()=>{let f=t.state&&(at(t.state)?t.state.root:null);if(!f||!at(f))return;let u=f;u=u[i];for(let h=0;h<a.length&&!(u==null||typeof u!="object");h++)if(at(u))u=u[a[h]];else break;if(!c.value)return;let d=!1;if(typeof t.onBeforeUpdate=="function"){let h=t.context?.designSystem;h&&tt(h);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(d=!0)}catch(g){t.context?.plugins?.length&&Et("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{h&&Z()}}if(!d&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){let g=r.__effects[h];g&&g!==l&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!d&&typeof t.onUpdate=="function"){let h=t.context?.designSystem;h&&tt(h);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&Et("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{h&&Z()}}},{depth:r.path.length});c.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function sh(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 eb=new Set;function vv(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;eb.has(n)||(eb.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 Qn(t,e,r){let n={},o=new Set,s=(i,a,c)=>{let l=c?new Set(Object.keys(n)):null;if(ut[i]){let f=ut[i](a,e,e.state,e.context);if(f){let u=Array.isArray(f)?f:[f];for(let d of u)d&&Object.assign(n,d)}}else n[i]=a;if(c)for(let f in n)l.has(f)||o.add(f)};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let a=t[i];if(typeof a=="function"&&(a=a(e,e.state,e.context)),a==null||typeof a=="function")continue;if(typeof a=="object"&&!Array.isArray(a)){if(i==="style"){for(let u in a){let d=a[u];if(typeof d=="function"&&(d=d(e,e.state,e.context)),d==null||typeof d=="function")continue;let h=typeof e[u]=="function"&&(ut[u]||yt&&yt.has(u));s(u,d,h)}continue}if(sh(i,e)){let u=Qn(a,e,!1);Object.keys(u).length&&(n[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){Mt()&&vv(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){let u=e.context?.designSystem?.media?.[i.slice(1)];u&&(l=`@media ${u}`)}let f=Qn(a,e,!1);Object.keys(f).length&&(n[l]=f);continue}let c=typeof e[i]=="function"&&(ut[i]||yt&&yt.has(i));s(i,a,c)}if(r)for(let i in n)o.add(i);for(let i of o){let a=n[i];typeof a=="string"&&!a.includes("!important")&&(n[i]=a+" !important")}return n}function ih(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&ih(t[r],e+1))return!0}return!1}function ab(t,e,r){if(!e||typeof e!="object"||Array.isArray(e))return null;if(sh(t,r)){let s=Qn(e,r,!1);return Object.keys(s).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:s}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){let s=r.context?.designSystem?.media?.[t.slice(1)];s&&(n=`@media ${s}`)}let o=Qn(e,r,!1);return Object.keys(o).length?{cssProp:n,block:o}:null}function Cv(t){let e=t.__ref;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!th(r))continue;let n=t[r];if(!n||typeof n!="object"||Array.isArray(n)||!ih(n))continue;let o=null,s,i=J(()=>{if(!t.node)return;let a=t.context?.designSystem;a&&tt(a);let c,l=!1;try{let f=ab(r,n,t),u=f?rh(f.block)+"::"+f.cssProp:null;if(u!==null&&u===s)l=!0;else if(s=u,f){let d=ne({[f.cssProp]:f.block},null,t.context?.cssPrefix);c=d?d.split(" ").filter(Boolean):null}else c=null}finally{a&&Z()}if(!(l||!t.node.classList)){if(o)for(let f of o)t.node.classList.remove(f);if(c&&c.length)for(let f of c)t.node.classList.add(f);o=c}},{depth:e.path.length});e.__effects.push(i)}}function Av(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;if(/[:@\s>~+[\]]/.test(s)){if(typeof console<"u"&&console.warn){let u=s.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${o}\` is read as one prop name. Nest the selector inside instead: \`${o}${u}: { '${s.slice(u.length)}': {...} }\`.`)}continue}let i=t[n];if(!i||typeof i!="object")continue;let a=o==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let u,d=t[s];if(d===void 0){let p=!!t.state&&s in t.state,m=t.state?t.state[s]:void 0;if(p||m!==void 0)u=m;else{let b=t.context?.cases?.[s];if(b===void 0)return;try{u=typeof b=="function"?b.call(t,t):b}catch(x){u=!1,e.__conditionalError=x,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,x?.message||x)}}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(p){u=!1,e.__conditionalError=p,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,p?.message||p)}else u=d;let h=a?!u:!!u;if(!t.node||h===c.lastMatch)return;c.lastMatch=h;let g=t.context?.designSystem;g&&tt(g);try{if(h){let p={},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(sh(y,t)){let I=Qn(_,t,!1);Object.keys(I).length&&(m[`[data-theme="${y.slice(1)}"] &`]=I,b=!0)}else{let I=y;if(v==="@"&&!y.startsWith("@media")&&!y.startsWith("@keyframes")){let R=t.context?.designSystem?.media?.[y.slice(1)];R&&(I=`@media ${R}`)}let z=Qn(_,t,!1);Object.keys(z).length&&(m[I]=z,b=!0)}continue}let E=typeof _=="function"?_(t,t.state,t.context):_;if(E!=null)if(ut[y]){let I=ut[y](E,t,t.state,t.context);if(I){let z=Array.isArray(I)?I:[I];for(let R of z)R&&Object.assign(p,R)}}else yt&&yt.has(y)&&(p[y]=E)}let x=Object.keys(p);if(x.length){Jn(t.node,p);for(let y of x)r.set(y,n);c.appliedKeys=x}else c.appliedKeys=null;if(b){let y=ne(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 p of c.appliedKeys)r.get(p)===n&&(t.node.style[p]="",r.delete(p));c.appliedKeys=null}if(c.appliedClasses){for(let p of c.appliedClasses)t.node.classList.remove(p);c.appliedClasses=null}}}finally{g&&Z()}};e.__conditionalRunners.push(l);let f=J(l,{depth:e.path.length});e.__effects.push(f)}}var Jp=new WeakSet;function Ev(t){let e=t.ownerDocument;!e||Jp.has(e)||(Jp.add(e),queueMicrotask(()=>{Jp.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var Zp=new WeakSet,rb=!1;function Tv(t){let{node:e}=t;if(!e)return;if(rb||(rb=!0,ne({display:"none"})),Zp.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Zp.add(t);let r=t.context?.designSystem;r&&tt(r);try{let n={},o=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&ut.theme){let s=ut.theme(t.theme,t,t.state,t.context);if(s){if(Array.isArray(s))for(let i of s)i&&Object.assign(n,i);else Object.assign(n,s);o=!0}}for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||Rt.has(s)||s==="theme")continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!Zn(s)){if(ut[s]){let a=t[s],c=ut[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(yt&&yt.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)==="&"||s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"&&!Array.isArray(a)){if(ih(a))continue;let c=ab(s,a,t);c&&(n[c.cssProp]=c.block,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=ne(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&&Ev(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&&Z(),Zp.delete(t)}}function cb(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=Rp(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"||Rt.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!Zn(o)&&!(ut[o]||yt&&yt.has(o))&&wr(n,o)){let i=t[o];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=Lr(i,t,t.state,t.context),t[o]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!Vc(Sr(o)||o))continue;let a=Sr(o)||o;e.setAttribute(a,Si(a,i))}}}function Ov(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 lb=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function fb(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!Zn(r)||lb.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=pv(r);xr.has(o)||qn(hv(o),t,n)}Rv(t)}function Rv(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let d of lb){let h=t[d];typeof h=="function"&&(r[d]=h,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 h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(i=h.clientX,a=h.clientY,c=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 g=h.clientX-i,p=h.clientY-a,m=Date.now()-c;if(m>s)return;let b=Math.abs(g),x=Math.abs(p);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=p<0?"up":"down";else return;let _="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),v=r[_],E=r.onSwipe;v&&v.call(t,d,t,t.state,t.context),E&&E.call(t,{direction:y,dx:g,dy:p,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 Yc(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]=Yc(o,s):r[n]=s}return r}function nh(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 p=u;(typeof u=="string"||typeof u=="number")&&(p={value:u,text:u}),f=d?{...d,state:p}:{state:p}}else d&&(f=Yc(d,f));if(n&&!f.ignoreChildExtends)if(f.extends){let p=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...p]}}else f={...f,extends:n};let h=f?.key||u&&typeof u=="object"&&u.key||`${l}`,g;try{g=oe(f,t,h,r)}catch(p){if(typeof console<"u"&&console.error){let m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${h}" failed to construct at ${m} (initial render, skipping this row):`,p?.message||p)}continue}!o&&g?.node&&i.appendChild(g.node)}return o||t.node.appendChild(i),!0}if(typeof e=="string"){let o=ob(e,t);if(Array.isArray(o))return nh(t,o,r)}if(typeof e=="object")for(let o in e){if(Rt.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=Yc(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};oe(s,t,o,r)}}}function oh(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 ub(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let a=r;try{r=a(t,t.state,t.context)}catch(d){if(r=void 0,typeof console<"u"&&console.error){let h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${h} (initial run, treating as empty):`,d?.message||d)}}t.children=r;let c=t.__ref,l=!1,f=Ut(t,t.childrenDeps,a),u=J(()=>{let d=l;l=!0;let h;try{h=f(t,t.state,t.context)}catch(v){if(typeof console<"u"&&console.error){let E=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${E}${d?"":" (initial tracking run)"}:`,v?.message||v)}return}if(!d||h===t.children)return;t.children=h;let g=typeof t.onContentUpdate=="function",p=g?[]:null,m=g?[]:null,b=g?[]:null;if(Array.isArray(h)&&t.childrenAs==="state"){let v=t.childProps,E=[],I=new Map;for(let N=0;N<h.length;N++){let X=h[N],D=v;if(typeof v=="function")try{D=v(t,X)}catch{D=null}let q=D&&D.key||X&&X.key||`${N}`;E.push(q),I.set(q,{rawChild:X,childProps:D})}let z=new Set(E),R=c.__children.slice();for(let N of R)if(!z.has(N)){let X=t[N];X?.remove&&X.remove(),delete t[N],m&&m.push(N)}let P=t.childExtends,G=t.tag==="fragment",bt=t.context?.document||globalThis.document,V=G?null:bt?.createDocumentFragment(),Q=new Set;for(let N of E){let X=I.get(N),D=X.rawChild,q=t[N];if(q&&q.state){if(D&&typeof D=="object"){let U=q.state,Ze=U.$replace||U.replace,Xt=U.$update||U.update;if(typeof Ze=="function")Ze.call(U,D);else if(typeof Xt=="function"){for(let Wt in U)if(!(Wt==="__element"||Wt==="root"||Wt==="parent"||Wt==="update")&&!Object.prototype.hasOwnProperty.call(D,Wt))try{U[Wt]=void 0}catch{}Xt.call(U,D)}else for(let Wt in D)U[Wt]=D[Wt]}b&&b.push(N);continue}let dt=D;(typeof D=="string"||typeof D=="number")&&(dt={value:D,text:D});let At=X.childProps,gt=At?{...At,state:dt}:{state:dt};if(P&&!gt.ignoreChildExtends)if(gt.extends){let U=Array.isArray(gt.extends)?gt.extends:[gt.extends],Ze=Array.isArray(P)?P:[P];gt={...gt,extends:[...Ze,...U]}}else gt={...gt,extends:P};let Je;try{Je=oe(gt,t,N,e)}catch(U){if(typeof console<"u"&&console.error){let Ze=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${N}" failed to construct at ${Ze} (reconcile, skipping this row):`,U?.message||U)}Q.add(N);continue}!G&&Je?.node&&V&&V.appendChild(Je.node),p&&p.push(N)}if(!G&&V&&V.childNodes.length&&t.node&&t.node.appendChild(V),!G&&t.node){let N=null;for(let X of E){let D=t[X]?.node;if(!D)continue;let q=N?N.nextSibling:t.node.firstChild;D!==q&&t.node.insertBefore(D,q),N=D}}c.__children=Q.size?E.filter(N=>!Q.has(N)):E,g&&(p.length||m.length)&&Qy(t,{added:p,removed:m,kept:b}),oh(t,!1);return}let _=g?[...c.__children]:null;for(let v of[...c.__children]){let E=t[v];E?.remove&&E.remove(),delete t[v]}c.__children=[],nh(t,h,e),oh(t,!1),g&&Qy(t,{added:[...c.__children],removed:_,kept:[]})},{depth:c.path.length});c.__effects.push(u)}let s=nh(t,r||n,e);if((r||n)&&!s)return;let i=t.context?.components||{};{let a=Object.keys(t);for(let c=0;c<a.length;c++){let l=a[c];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;let f=l.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;let u={extends:t[l]};delete t[l];for(let d=c+1;d<a.length;d++){let h=a[d],g=h.charCodeAt(0);if(g>=65&&g<=90||Rt.has(h)||typeof t[h]=="function"&&(h.startsWith("on")||h.startsWith(".")))break;let p=t[h];p!==void 0&&(u[h]=p,delete t[h])}t[f]&&typeof t[f]=="object"?t[f]={...u,...t[f]}:t[f]=u}}for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a)||Rt.has(a)||typeof t[a]!="object"||t[a]===null)continue;let c=a.charCodeAt(0);if(c<65||c>90)continue;let l=t[a];if(!l.__ref){if(!l.extends&&!l.extend){let f=i[a]||i[`smbls.${a}`];f&&(l={...l,extends:f})}if(t.childProps&&(l=Yc(t.childProps,l)),o&&!l.ignoreChildExtends)if(l.extends){let f=Array.isArray(l.extends)?l.extends:[l.extends],u=Array.isArray(o)?o:[o];l={...l,extends:[...u,...f]}}else l={...l,extends:o};oe(l,t,a,e)}}}function db(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 qe(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Et(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&&tt(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&Et("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&Z(),i&&(e.__ref.__inRender=!1)}}return!0}var pb={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"]},hb={"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,