@symbo.ls/element 3.14.702 → 3.14.717

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,20 @@
1
1
  # @symbo.ls/element
2
2
 
3
+ ## 3.14.717
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-generated cross-repo patch release.
8
+
9
+ ## 3.14.707
10
+
11
+ ### Patch Changes
12
+
13
+ - Auto-generated cross-repo patch release.
14
+ - Updated dependencies
15
+ - css-in-props@3.14.707
16
+ - @symbo.ls/utils@3.14.707
17
+
3
18
  ## 3.14.702
4
19
 
5
20
  ### Patch Changes
@@ -1,6 +1,6 @@
1
- "use strict";var it=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var Ut=Object.prototype.hasOwnProperty;var Vt=(t,s)=>{for(var n in s)it(t,n,{get:s[n],enumerable:!0})},Wt=(t,s,n,c)=>{if(s&&typeof s=="object"||typeof s=="function")for(let f of Kt(s))!Ut.call(t,f)&&f!==n&&it(t,f,{get:()=>s[f],enumerable:!(c=It(s,f))||c.enumerable});return t};var Bt=t=>Wt(it({},"__esModule",{value:!0}),t);var eo={};Vt(eo,{create:()=>V,default:()=>io,flushMounts:()=>_t});module.exports=Bt(eo);var E=require("@symbo.ls/signal"),j=require("@symbo.ls/signal"),W=require("./cache.js"),R=require("./registry.js"),Rt=require("./delegate.js"),Nt=require("./extends.js"),Ft=require("./methods.js"),po=require("./dispose.js"),ht=require("./devRuntime.js"),st=require("@symbo.ls/utils"),U=require("@symbo.ls/utils/function.js"),q=require("@symbo.ls/state"),x=require("css-in-props"),B=require("@symbo.ls/css"),A=require("@symbo.ls/scratch"),L=require("attrs-in-props");let Ht=1;const tt=[];let et=!1;function zt(){et||(et=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(_t):setTimeout(_t,0))}function _t(){if(et=!1,!tt.length)return;const t=tt.splice(0,tt.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||K("Mounted",n,n.__ref?.__mountOptions||{})}}function xt(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,tt.push(t),zt())}function At(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,U.runPluginHook)("contentUpdate",t,s);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(c){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onContentUpdate",error:c})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',c),t.context?.strictMode)throw c}finally{n&&(0,A.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Yt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Gt(t){return t.toLowerCase()}function vt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function X(t,s){const n={...t};for(const c in s){const f=n[c],o=s[c];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[c]=X(f,o):n[c]=o}return n}function V(t,s,n,c={},f){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=n||t.key||`_${Ht++}`,o.parent=s||null,o.context=t.context||s?.context||c.context||{},o.context.__create||(o.context.__create=V);const r=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||o,path:s?.__ref?.path?[...s.__ref.path,o.key]:[o.key]};if(n&&!t.extends&&!t.extend){const l=n.indexOf("_");if(l>0){const h=n.substring(0,l),g=o.context?.components;g&&(g[h]||g["smbls."+h])?t={...t,extends:h}:g&&(0,ht.isLoudDevRuntime)()&&/^[A-Z]\w*_\d+$/.test(n)&&console.warn(`[smbls] auto-extend: key "${n}" looks like a multi-instance (${h}_N) but neither "${h}" nor "smbls.${h}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,Nt.applyExtends)(o,t,c);const i=new Set(["childProps","attr","style","scope","data"]),e=o.props&&typeof o.props=="object"?o.props:null;for(const l in t){if(l==="parent"||l==="node"||l==="__ref"||l==="extends"||l==="context"||l==="props")continue;const h=t[l],g=o[l],k=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";k&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?o[l]=X(g,h):k&&i.has(l)?o[l]={...g,...h}:k&&vt(l)?o[l]=X(g,h):o[l]=h}function a(l){for(const h in l){const g=l[h],k=o[h],b=k&&g&&typeof k=="object"&&typeof g=="object"&&!Array.isArray(k)&&!Array.isArray(g)&&typeof k!="function"&&typeof g!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=X(k,g):b&&i.has(h)?o[h]={...k,...g}:b&&vt(h)?o[h]=X(k,g):o[h]=g}}e&&a(e),t.props&&typeof t.props=="object"&&a(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const d=o.scope&&typeof o.scope=="object"?o.scope:null,u=s?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=u||p||null;if(t.scope!==void 0||d){const l={};d&&Object.assign(l,d),t.scope!==void 0&&Object.assign(l,t.scope),o.scope=(0,E.createScopeStore)(l,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),(0,Ft.addMethods)(o),Zt(o,s,t),o.if!=null){let l;if(typeof o.if=="function")try{l=o.if(o,o.state,o.context)}catch(h){if(l=!1,r.__ifError=h,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,h?.message||h)}}else l=o.if;r.__if=!!l}if(r.__if)typeof o.if=="function"&&(r.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&wt(o,r,o.if),o;o.tag||(o.tag=(0,W.detectTag)(o)),K("Init",o,c);const _=o.node=(0,W.cacheNode)(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),r.__fragmentAnchor=h}K("AttachNode",o,c),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),$t(o,c),St(o),at(o),Ot(o),co(o);try{Dt(o,c)}catch(l){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,l?.message||l,l?.stack?`
2
- `+l.stack.split(`
1
+ "use strict";var et=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var Vt=Object.prototype.hasOwnProperty;var Wt=(t,s)=>{for(var n in s)et(t,n,{get:s[n],enumerable:!0})},Bt=(t,s,n,c)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of Ut(s))!Vt.call(t,i)&&i!==n&&et(t,i,{get:()=>s[i],enumerable:!(c=Kt(s,i))||c.enumerable});return t};var Ht=t=>Bt(et({},"__esModule",{value:!0}),t);var ao={};Wt(ao,{create:()=>V,default:()=>eo,flushMounts:()=>gt});module.exports=Ht(ao);var P=require("@symbo.ls/signal"),w=require("@symbo.ls/signal"),W=require("./cache.js"),R=require("./registry.js"),Nt=require("./delegate.js"),Ft=require("./extends.js"),Mt=require("./methods.js"),lo=require("./dispose.js"),_t=require("./devRuntime.js"),nt=require("@symbo.ls/utils"),K=require("@symbo.ls/utils/function.js"),q=require("@symbo.ls/state"),b=require("css-in-props"),B=require("@symbo.ls/css"),A=require("@symbo.ls/scratch"),$=require("attrs-in-props");let zt=1;const ot=[];let at=!1;function Yt(){at||(at=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(gt):setTimeout(gt,0))}function gt(){if(at=!1,!ot.length)return;const t=ot.splice(0,ot.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||I("Mounted",n,n.__ref?.__mountOptions||{})}}function At(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,ot.push(t),Yt())}function vt(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,K.runPluginHook)("contentUpdate",t,s);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(c){if(t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onContentUpdate",error:c})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',c),t.context?.strictMode)throw c}finally{n&&(0,A.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Gt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Zt(t){return t.toLowerCase()}function Ct(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function J(t,s){const n={...t};for(const c in s){const i=n[c],o=s[c];i&&o&&typeof i=="object"&&typeof o=="object"&&!Array.isArray(i)&&!Array.isArray(o)&&typeof i!="function"&&typeof o!="function"?n[c]=J(i,o):n[c]=o}return n}function V(t,s,n,c={},i){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=n||t.key||`_${zt++}`,o.parent=s||null,o.context=t.context||s?.context||c.context||{},o.context.__create||(o.context.__create=V);const e=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||o,path:s?.__ref?.path?[...s.__ref.path,o.key]:[o.key]};if(n&&!t.extends&&!t.extend){const u=n.indexOf("_");if(u>0){const h=n.substring(0,u),g=o.context?.components;g&&(g[h]||g["smbls."+h])?t={...t,extends:h}:g&&(0,_t.isLoudDevRuntime)()&&/^[A-Z]\w*_\d+$/.test(n)&&console.warn(`[smbls] auto-extend: key "${n}" looks like a multi-instance (${h}_N) but neither "${h}" nor "smbls.${h}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,Ft.applyExtends)(o,t,c);const r=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;const h=t[u],g=o[u],v=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";v&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?o[u]=J(g,h):v&&r.has(u)?o[u]={...g,...h}:v&&Ct(u)?o[u]=J(g,h):o[u]=h}function f(u){for(const h in u){const g=u[h],v=o[h],x=v&&g&&typeof v=="object"&&typeof g=="object"&&!Array.isArray(v)&&!Array.isArray(g)&&typeof v!="function"&&typeof g!="function";x&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=J(v,g):x&&r.has(h)?o[h]={...v,...g}:x&&Ct(h)?o[h]=J(v,g):o[h]=g}}a&&f(a),t.props&&typeof t.props=="object"&&f(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const d=o.scope&&typeof o.scope=="object"?o.scope:null,p=s?.scope,y=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,l=p||y||null;if(t.scope!==void 0||d){const u={};d&&Object.assign(u,d),t.scope!==void 0&&Object.assign(u,t.scope),o.scope=(0,P.createScopeStore)(u,l)}else l&&(o.scope=l);if(t.if!==void 0&&(o.if=t.if),(0,Mt.addMethods)(o),qt(o,s,t),o.if!=null){let u;if(typeof o.if=="function")try{u=o.if(o,o.state,o.context)}catch(h){if(u=!1,e.__ifError=h,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,h?.message||h)}}else u=o.if;e.__if=!!u}if(e.__if)typeof o.if=="function"&&(e.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&jt(o,e,o.if),o;o.tag||(o.tag=(0,W.detectTag)(o)),I("Init",o,c);const _=o.node=(0,W.cacheNode)(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),e.__fragmentAnchor=h}I("AttachNode",o,c),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Dt(o,c),kt(o),dt(o),Lt(o),ro(o);try{Tt(o,c)}catch(u){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,u?.message||u,u?.stack?`
2
+ `+u.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(yt(o,!0),Tt(o,s,f),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const l=o.context?.designSystem;l&&(0,A.pushConfig)(l);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{l&&(0,A.popConfig)()}}if(K("Create",o,c),K("Complete",o,c),K("Render",o,c),K("RenderRouter",o,c),xt(o,c),typeof o.onFrame=="function"){const l=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&(0,A.pushConfig)(h);try{l(o,o.state,o.context)}catch(k){console.error("[DOMQL] onFrame error:",k)}finally{h&&(0,A.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Zt(t,s,n){const c=!s,f=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=c&&f&&t.context?.state,r=n.state!==void 0&&!o?n.state:t.state&&!(0,E.isStore)(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,(0,q.applyStateMethods)(t,t.state);else if(t.context?.state){const i=t.context.state,e={...i},a=t.context?.polyglot;if(a?.translations){const d=i.lang||a.defaultLang||"en",u=a.translations[d];if(u&&typeof u=="object")for(const y in u)e[y]===void 0&&(e[y]=u[y]);const p=new Set(a.languages||[]);for(const y in a.translations)!p.has(y)&&e[y]===void 0&&(e[y]=a.translations[y])}t.state=(0,E.isStore)(e)?e:(0,E.createStore)(e),t.state.__element=t,t.state.root=t.state,(0,q.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,q.applyStateMethods)(t,t.state);return}if(typeof r=="string"){if(t.state=Ct(r,s),t.state&&typeof t.state=="object"&&!(0,E.isStore)(t.state)){const i=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}(0,q.applyStateMethods)(t,t.state);return}if(typeof r=="function"){const i=r(t,s?.state);t.state=(0,E.isStore)(i)?i:(0,E.createStore)(i||{})}else(0,E.isStore)(r)?t.state=r:t.state=(0,E.createStore)({...r});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,q.applyStateMethods)(t,t.state)}function ft(t,s){if(!s)return t;const n=s.split("/");let c=t;for(const f of n){if(c==null)return{};c=c[f]}return c??{}}function Ct(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const f=t.slice(3);return f?ft(s.state,f):s.state??{}}if(t.startsWith("~/")){const f=s.state?.root||s.state,o=t.slice(2);return o?ft(f,o):f??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=ft(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const c=s.context?.polyglot;if(c?.translations){const f=s.state?.root?.lang||c.defaultLang||"en",o=c.translations[f];if(o?.[t]!==void 0)return o[t];if(c.translations[t]!==void 0)return c.translations[t]}return{}}function qt(t){const s=t.__ref,n=t.tag||"div",c=t.context?.designSystem,f=[],o=Object.keys(t);for(let r=0;r<o.length;r++){const i=o[r];if(typeof t[i]!="function"||R.REGISTRY.has(i))continue;const e=i.charCodeAt(0);e>=65&&e<=90||Y(i)||x.CSS_PROPS_REGISTRY[i]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(i)||(0,L.checkAttributeByTagName)(n,i)||f.push({prop:i,fn:t[i]})}for(let r=0;r<f.length;r++){const{prop:i,fn:e}=f[r];s.__exec[i]=e,Object.defineProperty(t,i,{get(){c&&(0,A.pushConfig)(c);try{return e(t,t.state,t.context)}catch{return}finally{c&&(0,A.popConfig)()}},set(a){delete s.__exec[i],Object.defineProperty(t,i,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Qt(t,s){if(!(!Array.isArray(s)||s.length===0))for(let n=0;n<s.length;n++){const c=s[n];try{typeof c=="function"?c(t,t.state,t.context):typeof c=="string"&&t.state?.[c]}catch{}}}function O(t,s,n){return!Array.isArray(s)||s.length===0?n:function(...c){return Qt(t,s),n.apply(this,c)}}function J(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function St(t,s){const n=t.__ref,c=!!(s&&s.skipIfEffect);if(qt(t),typeof t.text=="function"){const o=t.text,r=O(t,t.textDeps,o),i=(0,j.createEffect)(()=>{if(!n.contentManaged)try{let e=r(t,t.state,t.context);t.node&&e!=null&&typeof e!="function"&&typeof e!="object"&&(typeof e=="string"&&e.includes("{{")&&(e=st.replaceLiteralsWithObjectFields.call(t,e,t.state)),t.tag==="string"?t.node.nodeValue=e:t.node.textContent=e)}catch{}},{depth:n.path.length});n.__effects.push(i),n.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,r=(0,j.createEffect)(()=>{if(n.contentManaged)return;const i=st.replaceLiteralsWithObjectFields.call(t,o,t.state);i!=null&&(t.text=i),t.node&&(t.tag==="string"?t.node.nodeValue=i??"":t.node.textContent=i??"")},{depth:n.path.length});n.__effects.push(r),n.__exec.text=o}for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!R.REGISTRY.has(o)&&!Y(o)&&!n.__exec[o]){if(x.CSS_PROPS_REGISTRY[o]){const r=t[o],i=O(t,t[o+"Deps"],r),e=o;let a;const d=(0,j.createEffect)(()=>{const u=t.context?.designSystem;u&&(0,A.pushConfig)(u);try{const p=i(t,t.state,t.context),y=x.CSS_PROPS_REGISTRY[e](p,t,t.state,t.context);if(y&&t.node){const _=jt(y);(_===null||_!==a)&&(a=_,G(t.node,y))}else t.node&&(e==="show"||e==="hide")&&(a=void 0,t.node.style.display="")}finally{u&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=r}else if(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const r=t[o],i=O(t,t[o+"Deps"],r),e=o;let a;const d=(0,j.createEffect)(()=>{const u=t.context?.designSystem;u&&(0,A.pushConfig)(u);try{const p=i(t,t.state,t.context);if(t.node)if(p!=null){const y=e+":"+String(p);y!==a&&(a=y,G(t.node,{[e]:p}))}else a=void 0,t.node.style[e]=""}finally{u&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=r}}if(typeof t.html=="function"){const o=t.html,r=O(t,t.htmlDeps,o),i=(0,j.createEffect)(()=>{const e=t.context?.designSystem;e&&(0,A.pushConfig)(e);try{const a=r(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&(t.node.innerHTML=a)}finally{e&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(i),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,r=O(t,t.valueDeps,o),i=(0,j.createEffect)(()=>{try{const e=r(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const a=e==null?"":String(e);if(t.node.value===a)return;const d=typeof document<"u"&&document.activeElement===t.node,u=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=a,d&&u!=null&&p!=null)try{t.node.setSelectionRange(u,p)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(i),n.__exec.value=o}if(typeof t.style=="function"){const o=t.style,r=O(t,t.styleDeps,o);let i;const e=(0,j.createEffect)(()=>{const a=r(t,t.state,t.context),d=jt(a);(d===null||d!==i)&&(i=d,G(t.node,a))},{depth:n.path.length});n.__effects.push(e),n.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const r=t.style[o];if(typeof r!="function")continue;const i=O(t,J(t.styleDeps,o),r);let e;const a=(0,j.createEffect)(()=>{try{const d=i(t,t.state,t.context);if(t.node){const u=o+":"+String(d);u!==e&&(e=u,G(t.node,{[o]:d}))}}catch{}},{depth:n.path.length});n.__effects.push(a)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const r=O(t,J(t.attrDeps,o),t.attr[o]),i=o,e=(0,j.createEffect)(()=>{try{const a=r(t,t.state,t.context);t.node?.setAttribute&&(a==null||a===!1?t.node.removeAttribute(i):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(i,a===!0?"":a))}catch{}},{depth:n.path.length});n.__effects.push(e)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const r=O(t,J(t.ariaDeps,o),t.aria[o]),i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),e=(0,j.createEffect)(()=>{try{const a=r(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(i):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(i,a===!0?"":a)}catch{}},{depth:n.path.length});n.__effects.push(e)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const r=O(t,J(t.dataDeps,o),t.data[o]),e="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),a=(0,j.createEffect)(()=>{try{const d=r(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(e):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(e,d===!0?"":d)}catch{}},{depth:n.path.length});n.__effects.push(a)}const f=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(f)for(const o in f){if(typeof f[o]!="function")continue;const r=O(t,J(t.classDeps,o),f[o]),i=(0,j.createEffect)(()=>{try{const e=r(t,t.state,t.context);if(!t.node?.classList)return;typeof e=="string"?t.node.classList.add(e):e?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:n.path.length});n.__effects.push(i)}!c&&typeof t.if=="function"&&wt(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||R.REGISTRY.has(o)||typeof t[o]!="function")continue;const r=o.charCodeAt(0);if(r>=65&&r<=90||Y(o))continue;const i=t[o];n.__exec[o]=i;const e=t.tag||"div";if((0,L.checkAttributeByTagName)(e,o)&&!x.CSS_PROPS_REGISTRY[o]&&!(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const a=(0,L.camelToAttr)(o)||o,d=O(t,t[o+"Deps"],i),u=(0,j.createEffect)(()=>{try{const p=d(t,t.state,t.context);t.node?.setAttribute&&(p==null||p===!1?t.node.removeAttribute(a):typeof p!="function"&&typeof p!="object"&&(a==="src"&&"src"in t.node?t.node.src=p:t.node.setAttribute(a,p===!0?"":p)))}catch{}},{depth:n.path.length});n.__effects.push(u)}}if(mt(t),oo(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,r=t.stateDeps;let i=!1,e=[];const a=(0,j.createEffect)(()=>{const d=[];for(let _=0;_<r.length;_++){const l=r[_];try{d[_]=typeof l=="function"?l(t,t.state,t.context):t.state?.[l]}catch{d[_]=void 0}}if(!i){i=!0,e=d;return}let u=d.length!==e.length;for(let _=0;!u&&_<d.length;_++)d[_]!==e[_]&&(u=!0);const p=e;if(e=d,!u)return;const y=t.context?.designSystem;y&&(0,A.pushConfig)(y);try{o(t,t.state,t.context,{prev:p,next:d})}catch(_){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{y&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(a)}}function kt(t){const s=t.parent,n=s?.node;if(!n||!t.node){Tt(t,t.parent);return}let c=null;const f=Object.keys(s),o=f.indexOf(t.key);for(let r=o+1;r<f.length;r++){const i=s[f[r]];if(i?.node?.parentNode===n){c=i.node;break}}c?n.insertBefore(t.node,c):n.appendChild(t.node)}function wt(t,s,n){const c=O(t,t.ifDeps,n),f=(0,j.createEffect)(()=>{let o;try{o=c(t,t.state,t.context)}catch(i){if(o=!1,s.__ifError=i,typeof console<"u"&&console.warn){const e=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${e} \u2014 treating as false:`,i?.message||i)}return}const r=s.__if;if(s.__if=!!o,r&&!s.__if&&t.node)t.node.remove();else if(!r&&s.__if)if(s.__ifInitialized)t.node||(t.node=(0,W.cacheNode)(t)),t.node&&(t.node.ref=t),kt(t),at(t);else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,W.detectTag)(t)),K("Init",t,{}),t.node||(t.node=(0,W.cacheNode)(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"&&!s.__fragmentAnchor){const e=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(e),s.__fragmentAnchor=e}K("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),$t(t,{}),St(t,{skipIfEffect:!0}),at(t),Ot(t),Dt(t,{}),kt(t),xt(t,{})}},{depth:s.path.length});s.__effects.push(f)}function at(t){const{node:s}=t;if(s){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?s.nodeValue=t.text:s.textContent=t.text:typeof t.text=="number"&&(s.textContent=t.text),no(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in s){const n=String(t.value);s.value!==n&&(s.value=n)}if(t.style&&typeof t.style=="object"&&G(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const c=t.attr[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.setAttribute&&s.setAttribute(n,c===!0?"":c)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.dataset&&(s.dataset[n]=c===!0?"":c)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(c=>c&&s.classList.add(c));else if(typeof n=="object")for(const c in n){const f=typeof n[c]=="function"?n[c](t,t.state,t.context):n[c];f&&s.classList.add(typeof f=="string"?f:c)}}}}function jt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function G(t,s){if(!t||!s||!t.style)return;let n=null;for(const c in s){const f=s[c];if(f!=null){if(c.charAt(0)==="&"&&typeof f=="object"){n||(n={}),n[c]=f;continue}try{const o=String(f),r=c.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),i=o.trim(),e=/\s*!important\s*$/.test(i),a=i.replace(/\s*!important\s*$/,"");t.style.setProperty(r,a,e?"important":"")}catch{}}}n&&Jt(t,n)}let Xt=0;function Jt(t,s){const n=`_ds${Xt++}`;t.classList.add(n);const c=t.ownerDocument;let f=c.querySelector("style[data-smbls-scoped]");f||(f=c.createElement("style"),f.setAttribute("data-smbls-scoped",""),c.head.appendChild(f));let o="";for(const r in s){const i="."+n,e=r.replace(/&/g,i).split(",").map(d=>{const u=d.trim();return u.includes(i)?u:i+u}).join(", "),a=s[r];if(typeof a=="object"){let d="",u="";for(const p in a){const y=a[p];if(typeof y=="object"){const _=p.includes("&")?e.split(", ").map(h=>p.replace(/&/g,h)).join(", "):e.split(", ").map(h=>`${h} ${p}`).join(", ");let l="";for(const h in y)l+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[h]};`;u+=(0,B.wrapHoverRule)(`${_} { ${l} }`,_)+`
5
- `}else d+=`${p.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(o+=(0,B.wrapHoverRule)(`${e} { ${d} }`,e)+`
6
- `),u&&(o+=u)}}o&&(f.textContent+=o)}function mt(t){let s=t.subscribeTo;if(typeof s=="function")try{s=s(t,t.state,t.context)}catch{s=null}if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let c=0;c<s.length;c++){const f=s[c];if(typeof f!="string"||f.length===0)continue;const o=f.split("."),r=o[0],i=o.slice(1),e={value:!1},a=(0,j.createEffect)(()=>{const d=t.state&&((0,E.isStore)(t.state)?t.state.root:null);if(!d||!(0,E.isStore)(d))return;let u=d;u=u[r];for(let y=0;y<i.length&&!(u==null||typeof u!="object");y++)if((0,E.isStore)(u))u=u[i[y]];else break;if(!e.value)return;let p=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&(0,A.pushConfig)(y);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(p=!0)}catch(_){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&(0,A.popConfig)()}}if(!p&&t.node&&n.__effects)for(let y=0;y<n.__effects.length;y++){const _=n.__effects[y];_&&_!==a&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!p&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&(0,A.pushConfig)(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&(0,A.popConfig)()}}},{depth:n.path.length});e.value=!0,a._isSubscribeToEffect=!0,n.__effects.push(a)}}function dt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}const Et=new Set;function to(t,s){const n=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",c=n+"::"+t;Et.has(c)||(Et.add(c),console.warn(`[smbls/css] "${t}" at ${n} 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 Z(t,s,n){const c={},f=new Set,o=(r,i,e)=>{const a=e?new Set(Object.keys(c)):null;if(x.CSS_PROPS_REGISTRY[r]){const d=x.CSS_PROPS_REGISTRY[r](i,s,s.state,s.context);if(d){const u=Array.isArray(d)?d:[d];for(const p of u)p&&Object.assign(c,p)}}else c[r]=i;if(e)for(const d in c)a.has(d)||f.add(d)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let p=i[u];if(typeof p=="function"&&(p=p(s,s.state,s.context)),p==null||typeof p=="function")continue;const y=typeof s[u]=="function"&&(x.CSS_PROPS_REGISTRY[u]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(u));o(u,p,y)}continue}if(dt(r,s)){const u=Z(i,s,!0);Object.keys(u).length&&(c[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){(0,ht.isLoudDevRuntime)()&&to(r,s);continue}let a=r;if(r.charCodeAt(0)===64&&!r.startsWith("@media")&&!r.startsWith("@keyframes")){const u=s.context?.designSystem?.media?.[r.slice(1)];u&&(a=`@media ${u}`)}const d=Z(i,s,!1);Object.keys(d).length&&(c[a]=d);continue}const e=typeof s[r]=="function"&&(x.CSS_PROPS_REGISTRY[r]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(r));o(r,i,e)}if(n)for(const r in c)f.add(r);for(const r of f){const i=c[r];typeof i=="string"&&!i.includes("!important")&&(c[r]=i+" !important")}return c}function oo(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;const f=c.charAt(0);if(f!=="."&&f!=="!")continue;const o=c.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const u=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${c}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${f}\` is read as one prop name. Nest the selector inside instead: \`${f}${u}: { '${o.slice(u.length)}': {...} }\`.`)}continue}const r=t[c];if(!r||typeof r!="object")continue;const i=f==="!",e={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{if(!t.node)return;let u;const p=t[o];if(p===void 0)if(t.state&&o in t.state)u=t.state[o];else{const l=t.context?.cases?.[o];if(l===void 0)return;try{u=typeof l=="function"?l.call(t,t):l}catch(h){u=!1,s.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof p=="function")try{u=p(t,t.state,t.context)}catch(l){u=!1,s.__conditionalError=l,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,l?.message||l)}else u=p;const y=i?!u:!!u;if(y===e.lastMatch)return;e.lastMatch=y;const _=t.context?.designSystem;_&&(0,A.pushConfig)(_);try{if(y){const l={},h={};let g=!1;for(const b in r){if(!Object.prototype.hasOwnProperty.call(r,b))continue;const v=r[b],w=b.charAt(0);if((w===":"||w==="@"||w==="&")&&v&&typeof v=="object"&&!Array.isArray(v)){if(dt(b,t)){const $=Z(v,t,!0);Object.keys($).length&&(h[`[data-theme="${b.slice(1)}"] &`]=$,g=!0)}else{let $=b;if(w==="@"&&!b.startsWith("@media")&&!b.startsWith("@keyframes")){const T=t.context?.designSystem?.media?.[b.slice(1)];T&&($=`@media ${T}`)}const H=Z(v,t,!1);Object.keys(H).length&&(h[$]=H,g=!0)}continue}const F=typeof v=="function"?v(t,t.state,t.context):v;if(F!=null)if(x.CSS_PROPS_REGISTRY[b]){const $=x.CSS_PROPS_REGISTRY[b](F,t,t.state,t.context);if($){const H=Array.isArray($)?$:[$];for(const T of H)T&&Object.assign(l,T)}}else x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(b)&&(l[b]=F)}const k=Object.keys(l);if(k.length){G(t.node,l);for(const b of k)n.set(b,c);e.appliedKeys=k}else e.appliedKeys=null;if(g){const b=(0,B.css)(h,null,t.context?.cssPrefix),v=b?b.split(" ").filter(Boolean):[];if(v.length&&t.node.classList){for(const w of v)t.node.classList.add(w);e.appliedClasses=v}else e.appliedClasses=null}else if(e.appliedClasses){for(const b of e.appliedClasses)t.node.classList.remove(b);e.appliedClasses=null}}else{if(e.appliedKeys){for(const l of e.appliedKeys)n.get(l)===c&&(t.node.style[l]="",n.delete(l));e.appliedKeys=null}if(e.appliedClasses){for(const l of e.appliedClasses)t.node.classList.remove(l);e.appliedClasses=null}}}finally{_&&(0,A.popConfig)()}};s.__conditionalRunners.push(a);const d=(0,j.createEffect)(a,{depth:s.path.length});s.__effects.push(d)}}const ut=new WeakSet;function so(t){const s=t.ownerDocument;!s||ut.has(s)||(ut.add(s),queueMicrotask(()=>{ut.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const pt=new WeakSet;let Pt=!1;function no(t){const{node:s}=t;if(!s)return;if(Pt||(Pt=!0,(0,B.css)({display:"none"})),pt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}pt.add(t);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{const c={};let f=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||R.REGISTRY.has(o))continue;const r=o.charCodeAt(0);if(!(r>=65&&r<=90)&&!Y(o)){if(x.CSS_PROPS_REGISTRY[o]){const i=t[o],e=x.CSS_PROPS_REGISTRY[o](i,t,t.state,t.context);if(e){if(Array.isArray(e))for(const a of e)a&&Object.assign(c,a);else Object.assign(c,e);f=!0}}else if(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const i=t[o];i!=null&&typeof i!="object"&&(c[o]=i,f=!0)}else if(o.charCodeAt(0)===45){const i=t[o];i!=null&&typeof i!="object"&&(c[o]=i,f=!0)}else if(o.charAt(0)==="&"){const i=t[o];i&&typeof i=="object"&&(c[o]=i,f=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const i=t[o];if(i&&typeof i=="object"){if(dt(o,t)){const e=Z(i,t,!0);Object.keys(e).length&&(c[`[data-theme="${o.slice(1)}"] &`]=e,f=!0)}else{let e=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const d=t.context?.designSystem?.media?.[o.slice(1)];d&&(e=`@media ${d}`)}const a=Z(i,t,!1);Object.keys(a).length&&(c[e]=a,f=!0)}f=!0}}}}if(f){c.display&&String(c.display).includes("!important")&&(s.style.setProperty("display",String(c.display).replace(/\s*!important\s*$/,""),"important"),delete c.display);const o=(0,B.css)(c,null,t.context?.cssPrefix);if(o&&s.classList){const i=o.split(" ").filter(Boolean);let e=!1;for(const a of i)s.classList.add(a),e||(a.charCodeAt(0)===95&&a.charCodeAt(1)===99||a.charCodeAt(0)===95&&a.indexOf("_c",1)!==-1)&&(e=!0);e&&so(s)}const r=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(r!=null){const i=c.display;if(i&&i!==r)if(r==="none"){const e=[];for(const a of s.classList)a.startsWith("_d-")&&a!=="_d-none"&&e.push(a);for(const a of e)s.classList.remove(a);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&(0,A.popConfig)(),pt.delete(t)}}function Ot(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const f in t.aria){const o=t.aria[f];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const r="aria-"+f.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.setAttribute(r,o===!0?"":o)}const n=(0,L.applyAttrTransforms)(t);for(const f in n){const o=n[f];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(f,o===!0?"":o)}const c=t.tag||"div";for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f)||typeof t[f]=="function"||R.REGISTRY.has(f)||f==="on"||n[f]!==void 0)continue;const o=f.charCodeAt(0);if(!(o>=65&&o<=90)&&!Y(f)&&!(x.CSS_PROPS_REGISTRY[f]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(f))&&(0,L.checkAttributeByTagName)(c,f)){let r=t[f];if(r==null||(typeof r=="string"&&r.includes("{{")&&(r=(0,st.replaceLiteralsWithObjectFields)(r,t,t.state,t.context),t[f]=r),r==null||typeof r=="function"||typeof r=="object")||r===!1&&!(0,L.isEnumeratedTrueFalseAttr)((0,L.camelToAttr)(f)||f))continue;const i=(0,L.camelToAttr)(f)||f;s.setAttribute(i,(0,L.serializeAttrValue)(i,r))}}}function co(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,c=n&&typeof n=="object"&&n.max?String(n.max):null;c&&(s.style.maxHeight=c);const f=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};f(),s.addEventListener("input",f),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",f)}catch{}})}const Lt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function $t(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!Y(n)||Lt.has(n))continue;let c=t[n];if(typeof c=="string"&&/^[A-Za-z_$][\w$]*$/.test(c)){const o=c;c=function(i){return t.call(o,i)}}if(typeof c!="function")continue;const f=Yt(n);R.LIFECYCLE_EVENTS.has(f)||(0,Rt.registerEvent)(Gt(f),t,c)}ro(t)}function ro(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let c=!1;for(const p of Lt){const y=t[p];typeof y=="function"&&(n[p]=y,c=!0)}if(!c)return;const f=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,i=0,e=0,a=!1;const d=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,i=y.clientY,e=Date.now(),a=!0)},u=p=>{if(!a)return;a=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const _=y.clientX-r,l=y.clientY-i,h=Date.now()-e;if(h>o)return;const g=Math.abs(_),k=Math.abs(l);if(Math.max(g,k)<f)return;let b;if(g>k*1.2)b=_<0?"left":"right";else if(k>g*1.2)b=l<0?"up":"down";else return;const v="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),w=n[v],F=n.onSwipe;w&&w.call(t,p,t,t.state,t.context),F&&F.call(t,{direction:b,dx:_,dy:l,dt:h,event:p},t,t.state,t.context)};s.addEventListener("touchstart",d,{passive:!0}),s.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",d)}catch{}try{s.removeEventListener("touchend",u)}catch{}})}function ot(t,s){const n={...t};for(const c in s){const f=n[c],o=s[c];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[c]=ot(f,o):n[c]=o}return n}function lt(t,s,n){if(!s||!t.node)return;const c=t.childExtends;if(Array.isArray(s)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,r=f?null:o?.createDocumentFragment();if(!f&&!r)return;const i=t.childProps,e=t.childrenAs;for(let a=0;a<s.length;a++){let d=s[a];const u=d;(typeof d=="string"||typeof d=="number")&&(d={text:d});let p=i;if(typeof i=="function")try{p=i(t,d)}catch{p=null}if(e==="state"){let l=u;(typeof u=="string"||typeof u=="number")&&(l={value:u,text:u}),d=p?{...p,state:l}:{state:l}}else p&&(d=ot(p,d));if(c&&!d.ignoreChildExtends)if(d.extends){const l=Array.isArray(d.extends)?d.extends:[d.extends],h=Array.isArray(c)?c:[c];d={...d,extends:[...h,...l]}}else d={...d,extends:c};const y=d?.key||u&&typeof u=="object"&&u.key||`${a}`;let _;try{_=V(d,t,y,n)}catch(l){if(typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y}" failed to construct at ${h} (initial render, skipping this row):`,l?.message||l)}continue}!f&&_?.node&&r.appendChild(_.node)}f||t.node.appendChild(r);return}if(typeof s=="string"){const f=Ct(s,t);if(Array.isArray(f)){lt(t,f,n);return}}if(typeof s=="object")for(const f in s){if(R.REGISTRY.has(f))continue;let o=s[f];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=ot(t.childProps,o)),c&&!o.ignoreChildExtends)if(o.extends){const r=Array.isArray(o.extends)?o.extends:[o.extends],i=Array.isArray(c)?c:[c];o={...o,extends:[...i,...r]}}else o={...o,extends:c};V(o,t,f,n)}}}function yt(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const c=n.options;if(!c||!c.length)return;const f=t.__ref,o=f&&f.__exec&&f.__exec.value,r=typeof o=="function",i=t.value!=null&&typeof t.value!="function";if(r||i){let d;if(r)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const u=d==null?"":String(d);n.value!==u&&(n.value=u);return}const e=s||!(f&&f.__selectSynced);if(f&&(f.__selectSynced=!0),!e)return;let a=-1;for(let d=0;d<c.length;d++)c[d].defaultSelected&&(a=d);a>=0&&n.selectedIndex!==a&&(n.selectedIndex=a)}function Dt(t,s){let{children:n,content:c}=t;const f=t.childExtends;if(typeof n=="function"){const r=n;try{n=r(t,t.state,t.context)}catch(u){if(n=void 0,typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,u?.message||u)}}t.children=n;const i=t.__ref;let e=!1;const a=O(t,t.childrenDeps,r),d=(0,j.createEffect)(()=>{const u=e;e=!0;let p;try{p=a(t,t.state,t.context)}catch(v){if(typeof console<"u"&&console.error){const w=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${w}${u?"":" (initial tracking run)"}:`,v?.message||v)}return}if(!u||p===t.children)return;t.children=p;const y=typeof t.onContentUpdate=="function",_=y?[]:null,l=y?[]:null,h=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const v=t.childProps,w=[],F=new Map;for(let C=0;C<p.length;C++){const D=p[C];let S=v;if(typeof v=="function")try{S=v(t,D)}catch{S=null}const M=S&&S.key||D&&D.key||`${C}`;w.push(M),F.set(M,{rawChild:D,childProps:S})}const $=new Set(w),H=i.__children.slice();for(const C of H)if(!$.has(C)){const D=t[C];D?.remove&&D.remove(),delete t[C],l&&l.push(C)}const T=t.childExtends,m=t.tag==="fragment",Mt=t.context?.document||globalThis.document,Q=m?null:Mt?.createDocumentFragment(),nt=new Set;for(const C of w){const D=F.get(C),S=D.rawChild,M=t[C];if(M&&M.state){if(S&&typeof S=="object"){const P=M.state,z=P.$replace||P.replace,bt=P.$update||P.update;if(typeof z=="function")z.call(P,S);else if(typeof bt=="function"){for(const I in P)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(S,I))try{P[I]=void 0}catch{}bt.call(P,S)}else for(const I in S)P[I]=S[I]}h&&h.push(C);continue}let ct=S;(typeof S=="string"||typeof S=="number")&&(ct={value:S,text:S});const gt=D.childProps;let N=gt?{...gt,state:ct}:{state:ct};if(T&&!N.ignoreChildExtends)if(N.extends){const P=Array.isArray(N.extends)?N.extends:[N.extends],z=Array.isArray(T)?T:[T];N={...N,extends:[...z,...P]}}else N={...N,extends:T};let rt;try{rt=V(N,t,C,s)}catch(P){if(typeof console<"u"&&console.error){const z=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${z} (reconcile, skipping this row):`,P?.message||P)}nt.add(C);continue}!m&&rt?.node&&Q&&Q.appendChild(rt.node),_&&_.push(C)}if(!m&&Q&&Q.childNodes.length&&t.node&&t.node.appendChild(Q),!m&&t.node){let C=null;for(const D of w){const S=t[D]?.node;if(!S)continue;const M=C?C.nextSibling:t.node.firstChild;S!==M&&t.node.insertBefore(S,M),C=S}}i.__children=nt.size?w.filter(C=>!nt.has(C)):w,y&&(_.length||l.length)&&At(t,{added:_,removed:l,kept:h}),yt(t,!1);return}const b=y?[...i.__children]:null;for(const v of[...i.__children]){const w=t[v];w?.remove&&w.remove(),delete t[v]}i.__children=[],lt(t,p,s),yt(t,!1),y&&At(t,{added:[...i.__children],removed:b,kept:[]})},{depth:i.path.length});i.__effects.push(d)}if(lt(t,n||c,s),n||c)return;const o=t.context?.components||{};{const r=Object.keys(t);for(let i=0;i<r.length;i++){const e=r[i];if(!e.endsWith("Extends")||typeof t[e]!="string")continue;const a=e.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const d={extends:t[e]};delete t[e];for(let u=i+1;u<r.length;u++){const p=r[u],y=p.charCodeAt(0);if(y>=65&&y<=90||R.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const _=t[p];_!==void 0&&(d[p]=_,delete t[p])}t[a]&&typeof t[a]=="object"?t[a]={...d,...t[a]}:t[a]=d}}for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||R.REGISTRY.has(r)||typeof t[r]!="object"||t[r]===null)continue;const i=r.charCodeAt(0);if(i<65||i>90)continue;let e=t[r];if(!e.__ref){if(!e.extends&&!e.extend){const a=o[r]||o[`smbls.${r}`];a&&(e={...e,extends:a})}if(t.childProps&&(e=ot(t.childProps,e)),f&&!e.ignoreChildExtends)if(e.extends){const a=Array.isArray(e.extends)?e.extends:[e.extends],d=Array.isArray(f)?f:[f];e={...e,extends:[...d,...a]}}else e={...e,extends:f};V(e,t,r,s)}}}function Tt(t,s,n){const{node:c}=t;if(!c)return;c.ref=t;const f=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(f){const r=f.parentNode;if(r){if(n?.position==="before"&&n.node)r.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;r.insertBefore(c,i||f)}else r.insertBefore(c,f);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const r=n.node.nextSibling;r?o.insertBefore(c,r):o.appendChild(c)}else o.appendChild(c)}function K(t,s,n){const c=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,U.runPluginHook)(c,s,n);const f="on"+t,o=s[f];if(typeof o=="function"){const r=t==="Render"||t==="RenderRouter";if(r){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const i=s.context?.designSystem;i&&(0,A.pushConfig)(i);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(e){if(s.context?.plugins?.length&&(0,U.runPluginHook)("error",s,{hook:f,error:e})||console.error(`[DOMQL] Lifecycle "${f}" error:`,e),s.context?.strictMode)throw e}finally{i&&(0,A.popConfig)(),r&&(s.__ref.__inRender=!1)}}return!0}var io=V;
4
+ `):"")}}if(ht(o,!0),Rt(o,s,i),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const u=o.context?.designSystem;u&&(0,A.pushConfig)(u);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{u&&(0,A.popConfig)()}}if(I("Create",o,c),I("Complete",o,c),I("Render",o,c),I("RenderRouter",o,c),At(o,c),typeof o.onFrame=="function"){const u=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&(0,A.pushConfig)(h);try{u(o,o.state,o.context)}catch(v){console.error("[DOMQL] onFrame error:",v)}finally{h&&(0,A.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function qt(t,s,n){const c=!s,i=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=c&&i&&t.context?.state,e=n.state!==void 0&&!o?n.state:t.state&&!(0,P.isStore)(t.state)?t.state:void 0;if(e==null){if(s?.state)t.state=s.state,(0,q.applyStateMethods)(t,t.state);else if(t.context?.state){const r=t.context.state,a={...r},f=t.context?.polyglot;if(f?.translations){const d=r.lang||f.defaultLang||"en",p=f.translations[d];if(p&&typeof p=="object")for(const l in p)a[l]===void 0&&(a[l]=p[l]);const y=new Set(f.languages||[]);for(const l in f.translations)!y.has(l)&&a[l]===void 0&&(a[l]=f.translations[l])}t.state=(0,P.isStore)(a)?a:(0,P.createStore)(a),t.state.__element=t,t.state.root=t.state,(0,q.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,q.applyStateMethods)(t,t.state);return}if(typeof e=="string"){if(t.state=St(e,s),t.state&&typeof t.state=="object"&&!(0,P.isStore)(t.state)){const r=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:r,enumerable:!1,configurable:!0,writable:!0})}(0,q.applyStateMethods)(t,t.state);return}if(typeof e=="function"){const r=e(t,s?.state);t.state=(0,P.isStore)(r)?r:(0,P.createStore)(r||{})}else(0,P.isStore)(e)?t.state=e:t.state=(0,P.createStore)({...e});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,q.applyStateMethods)(t,t.state)}function ft(t,s){if(!s)return t;const n=s.split("/");let c=t;for(const i of n){if(c==null)return{};c=c[i]}return c??{}}function St(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const i=t.slice(3);return i?ft(s.state,i):s.state??{}}if(t.startsWith("~/")){const i=s.state?.root||s.state,o=t.slice(2);return o?ft(i,o):i??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=ft(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const c=s.context?.polyglot;if(c?.translations){const i=s.state?.root?.lang||c.defaultLang||"en",o=c.translations[i];if(o?.[t]!==void 0)return o[t];if(c.translations[t]!==void 0)return c.translations[t]}return{}}function Qt(t){const s=t.__ref,n=t.tag||"div",c=t.context?.designSystem,i=[],o=Object.keys(t);for(let e=0;e<o.length;e++){const r=o[e];if(typeof t[r]!="function"||R.REGISTRY.has(r))continue;const a=r.charCodeAt(0);a>=65&&a<=90||Y(r)||b.CSS_PROPS_REGISTRY[r]||b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(r)||(0,$.checkAttributeByTagName)(n,r)||i.push({prop:r,fn:t[r]})}for(let e=0;e<i.length;e++){const{prop:r,fn:a}=i[e];s.__exec[r]=a,Object.defineProperty(t,r,{get(){c&&(0,A.pushConfig)(c);try{return a(t,t.state,t.context)}catch{return}finally{c&&(0,A.popConfig)()}},set(f){delete s.__exec[r],Object.defineProperty(t,r,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Xt(t,s){if(!(!Array.isArray(s)||s.length===0))for(let n=0;n<s.length;n++){const c=s[n];try{typeof c=="function"?c(t,t.state,t.context):typeof c=="string"&&t.state?.[c]}catch{}}}function L(t,s,n){return!Array.isArray(s)||s.length===0?n:function(...c){return Xt(t,s),n.apply(this,c)}}function m(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function kt(t,s){const n=t.__ref,c=!!(s&&s.skipIfEffect);if(Qt(t),typeof t.text=="function"){const o=t.text,e=L(t,t.textDeps,o),r=(0,w.createEffect)(()=>{if(!n.contentManaged)try{let a=e(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=nt.replaceLiteralsWithObjectFields.call(t,a,t.state)),t.tag==="string"?t.node.nodeValue=a:t.node.textContent=a)}catch{}},{depth:n.path.length});n.__effects.push(r),n.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,e=(0,w.createEffect)(()=>{if(n.contentManaged)return;const r=nt.replaceLiteralsWithObjectFields.call(t,o,t.state);r!=null&&(t.text=r),t.node&&(t.tag==="string"?t.node.nodeValue=r??"":t.node.textContent=r??"")},{depth:n.path.length});n.__effects.push(e),n.__exec.text=o}for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!R.REGISTRY.has(o)&&!Y(o)&&!n.__exec[o]){if(b.CSS_PROPS_REGISTRY[o]){const e=t[o],r=L(t,t[o+"Deps"],e),a=o;let f;const d=(0,w.createEffect)(()=>{const p=t.context?.designSystem;p&&(0,A.pushConfig)(p);try{const y=r(t,t.state,t.context),l=b.CSS_PROPS_REGISTRY[a](y,t,t.state,t.context);if(l&&t.node){const _=Et(l);(_===null||_!==f)&&(f=_,G(t.node,l))}else t.node&&(a==="show"||a==="hide")&&(f=void 0,t.node.style.display="")}finally{p&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=e}else if(b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const e=t[o],r=L(t,t[o+"Deps"],e),a=o;let f;const d=(0,w.createEffect)(()=>{const p=t.context?.designSystem;p&&(0,A.pushConfig)(p);try{const y=r(t,t.state,t.context);if(t.node)if(y!=null){const l=a+":"+String(y);l!==f&&(f=l,G(t.node,{[a]:y}))}else f=void 0,t.node.style[a]=""}finally{p&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=e}}if(typeof t.html=="function"){const o=t.html,e=L(t,t.htmlDeps,o),r=(0,w.createEffect)(()=>{const a=t.context?.designSystem;a&&(0,A.pushConfig)(a);try{const f=e(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&(t.node.innerHTML=f)}finally{a&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(r),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,e=L(t,t.valueDeps,o),r=(0,w.createEffect)(()=>{try{const a=e(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const f=a==null?"":String(a);if(t.node.value===f)return;const d=typeof document<"u"&&document.activeElement===t.node,p=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,y=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=f,d&&p!=null&&y!=null)try{t.node.setSelectionRange(p,y)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(r),n.__exec.value=o}if(typeof t.style=="function"){const o=t.style,e=L(t,t.styleDeps,o);let r;const a=(0,w.createEffect)(()=>{const f=e(t,t.state,t.context),d=Et(f);(d===null||d!==r)&&(r=d,G(t.node,f))},{depth:n.path.length});n.__effects.push(a),n.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const e=t.style[o];if(typeof e!="function")continue;const r=L(t,m(t.styleDeps,o),e);let a;const f=(0,w.createEffect)(()=>{try{const d=r(t,t.state,t.context);if(t.node){const p=o+":"+String(d);p!==a&&(a=p,G(t.node,{[o]:d}))}}catch{}},{depth:n.path.length});n.__effects.push(f)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const e=L(t,m(t.attrDeps,o),t.attr[o]),r=o,a=(0,w.createEffect)(()=>{try{const f=e(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1?t.node.removeAttribute(r):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(r,f===!0?"":f))}catch{}},{depth:n.path.length});n.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const e=L(t,m(t.ariaDeps,o),t.aria[o]),r="aria-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),a=(0,w.createEffect)(()=>{try{const f=e(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(r):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(r,f===!0?"":f)}catch{}},{depth:n.path.length});n.__effects.push(a)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const e=L(t,m(t.dataDeps,o),t.data[o]),a="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),f=(0,w.createEffect)(()=>{try{const d=e(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(a):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(a,d===!0?"":d)}catch{}},{depth:n.path.length});n.__effects.push(f)}const i=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(i)for(const o in i){if(typeof i[o]!="function")continue;const e=L(t,m(t.classDeps,o),i[o]),r=(0,w.createEffect)(()=>{try{const a=e(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:n.path.length});n.__effects.push(r)}!c&&typeof t.if=="function"&&jt(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||R.REGISTRY.has(o)||typeof t[o]!="function")continue;const e=o.charCodeAt(0);if(e>=65&&e<=90||Y(o))continue;const r=t[o];n.__exec[o]=r;const a=t.tag||"div";if((0,$.checkAttributeByTagName)(a,o)&&!b.CSS_PROPS_REGISTRY[o]&&!(b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const f=(0,$.camelToAttr)(o)||o,d=L(t,t[o+"Deps"],r),p=(0,w.createEffect)(()=>{try{const y=d(t,t.state,t.context);t.node?.setAttribute&&(y==null||y===!1?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&(f==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(f,y===!0?"":y)))}catch{}},{depth:n.path.length});n.__effects.push(p)}}if(to(t),so(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,e=t.stateDeps;let r=!1,a=[];const f=(0,w.createEffect)(()=>{const d=[];for(let _=0;_<e.length;_++){const u=e[_];try{d[_]=typeof u=="function"?u(t,t.state,t.context):t.state?.[u]}catch{d[_]=void 0}}if(!r){r=!0,a=d;return}let p=d.length!==a.length;for(let _=0;!p&&_<d.length;_++)d[_]!==a[_]&&(p=!0);const y=a;if(a=d,!p)return;const l=t.context?.designSystem;l&&(0,A.pushConfig)(l);try{o(t,t.state,t.context,{prev:y,next:d})}catch(_){if(t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{l&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(f)}}function wt(t){const s=t.parent,n=s?.node;if(!n||!t.node){Rt(t,t.parent);return}let c=null;const i=Object.keys(s),o=i.indexOf(t.key);for(let e=o+1;e<i.length;e++){const r=s[i[e]];if(r?.node?.parentNode===n){c=r.node;break}}c?n.insertBefore(t.node,c):n.appendChild(t.node)}function jt(t,s,n){const c=L(t,t.ifDeps,n),i=(0,w.createEffect)(()=>{let o;try{o=c(t,t.state,t.context)}catch(r){if(o=!1,s.__ifError=r,typeof console<"u"&&console.warn){const a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,r?.message||r)}return}const e=s.__if;if(s.__if=!!o,e&&!s.__if&&t.node)t.node.remove();else if(!e&&s.__if)if(s.__ifInitialized)t.node||(t.node=(0,W.cacheNode)(t)),t.node&&(t.node.ref=t),wt(t),dt(t);else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,W.detectTag)(t)),I("Init",t,{}),t.node||(t.node=(0,W.cacheNode)(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"&&!s.__fragmentAnchor){const a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),s.__fragmentAnchor=a}I("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Dt(t,{}),kt(t,{skipIfEffect:!0}),dt(t),Lt(t),Tt(t,{}),wt(t),At(t,{})}},{depth:s.path.length});s.__effects.push(i)}function dt(t){const{node:s}=t;if(s){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?s.nodeValue=t.text:s.textContent=t.text:typeof t.text=="number"&&(s.textContent=t.text),co(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in s){const n=String(t.value);s.value!==n&&(s.value=n)}if(t.style&&typeof t.style=="object"&&G(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const c=t.attr[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.setAttribute&&s.setAttribute(n,c===!0?"":c)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.dataset&&(s.dataset[n]=c===!0?"":c)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(c=>c&&s.classList.add(c));else if(typeof n=="object")for(const c in n){const i=typeof n[c]=="function"?n[c](t,t.state,t.context):n[c];i&&s.classList.add(typeof i=="string"?i:c)}}}}function Et(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function G(t,s){if(!t||!s||!t.style)return;let n=null;for(const c in s){const i=s[c];if(i!=null){if(c.charAt(0)==="&"&&typeof i=="object"){n||(n={}),n[c]=i;continue}try{const o=String(i),e=c.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),r=o.trim(),a=/\s*!important\s*$/.test(r),f=r.replace(/\s*!important\s*$/,"");t.style.setProperty(e,f,a?"important":"")}catch{}}}n&&mt(t,n)}let Jt=0;function mt(t,s){const n=`_ds${Jt++}`;t.classList.add(n);const c=t.ownerDocument;let i=c.querySelector("style[data-smbls-scoped]");i||(i=c.createElement("style"),i.setAttribute("data-smbls-scoped",""),c.head.appendChild(i));let o="";for(const e in s){const r="."+n,a=e.replace(/&/g,r).split(",").map(d=>{const p=d.trim();return p.includes(r)?p:r+p}).join(", "),f=s[e];if(typeof f=="object"){let d="",p="";for(const y in f){const l=f[y];if(typeof l=="object"){const _=y.includes("&")?a.split(", ").map(h=>y.replace(/&/g,h)).join(", "):a.split(", ").map(h=>`${h} ${y}`).join(", ");let u="";for(const h in l)u+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${l[h]};`;p+=(0,B.wrapHoverRule)(`${_} { ${u} }`,_)+`
5
+ `}else d+=`${y.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${l};`}d&&(o+=(0,B.wrapHoverRule)(`${a} { ${d} }`,a)+`
6
+ `),p&&(o+=p)}}o&&(i.textContent+=o)}function to(t){let s=t.subscribeTo;if(typeof s=="function")try{s=s(t,t.state,t.context)}catch{s=null}if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let c=0;c<s.length;c++){const i=s[c];if(typeof i!="string"||i.length===0)continue;const o=i.split("."),e=o[0],r=o.slice(1),a={value:!1},f=(0,w.createEffect)(()=>{const d=t.state&&((0,P.isStore)(t.state)?t.state.root:null);if(!d||!(0,P.isStore)(d))return;let p=d;p=p[e];for(let l=0;l<r.length&&!(p==null||typeof p!="object");l++)if((0,P.isStore)(p))p=p[r[l]];else break;if(!a.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const l=t.context?.designSystem;l&&(0,A.pushConfig)(l);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(y=!0)}catch(_){t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{l&&(0,A.popConfig)()}}if(!y&&t.node&&n.__effects)for(let l=0;l<n.__effects.length;l++){const _=n.__effects[l];_&&_!==f&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!y&&typeof t.onUpdate=="function"){const l=t.context?.designSystem;l&&(0,A.pushConfig)(l);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{l&&(0,A.popConfig)()}}},{depth:n.path.length});a.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function ut(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}const Pt=new Set;function oo(t,s){const n=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",c=n+"::"+t;Pt.has(c)||(Pt.add(c),console.warn(`[smbls/css] "${t}" at ${n} 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 Z(t,s,n){const c={},i=new Set,o=(e,r,a)=>{const f=a?new Set(Object.keys(c)):null;if(b.CSS_PROPS_REGISTRY[e]){const d=b.CSS_PROPS_REGISTRY[e](r,s,s.state,s.context);if(d){const p=Array.isArray(d)?d:[d];for(const y of p)y&&Object.assign(c,y)}}else c[e]=r;if(a)for(const d in c)f.has(d)||i.add(d)};for(const e in t){if(!Object.prototype.hasOwnProperty.call(t,e))continue;let r=t[e];if(typeof r=="function"&&(r=r(s,s.state,s.context)),r==null||typeof r=="function")continue;if(typeof r=="object"&&!Array.isArray(r)){if(e==="style"){for(const p in r){let y=r[p];if(typeof y=="function"&&(y=y(s,s.state,s.context)),y==null||typeof y=="function")continue;const l=typeof s[p]=="function"&&(b.CSS_PROPS_REGISTRY[p]||b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(p));o(p,y,l)}continue}if(ut(e,s)){const p=Z(r,s,!0);Object.keys(p).length&&(c[`[data-theme="${e.slice(1)}"] &`]=p);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(e)){(0,_t.isLoudDevRuntime)()&&oo(e,s);continue}let f=e;if(e.charCodeAt(0)===64&&!e.startsWith("@media")&&!e.startsWith("@keyframes")){const p=s.context?.designSystem?.media?.[e.slice(1)];p&&(f=`@media ${p}`)}const d=Z(r,s,!1);Object.keys(d).length&&(c[f]=d);continue}const a=typeof s[e]=="function"&&(b.CSS_PROPS_REGISTRY[e]||b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(e));o(e,r,a)}if(n)for(const e in c)i.add(e);for(const e of i){const r=c[e];typeof r=="string"&&!r.includes("!important")&&(c[e]=r+" !important")}return c}function so(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;const i=c.charAt(0);if(i!=="."&&i!=="!")continue;const o=c.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const p=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${c}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${i}\` is read as one prop name. Nest the selector inside instead: \`${i}${p}: { '${o.slice(p.length)}': {...} }\`.`)}continue}const e=t[c];if(!e||typeof e!="object")continue;const r=i==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},f=()=>{let p;const y=t[o];if(y===void 0){const u=!!t.state&&o in t.state,h=t.state?t.state[o]:void 0;if(u||h!==void 0)p=h;else{const g=t.context?.cases?.[o];if(g===void 0)return;try{p=typeof g=="function"?g.call(t,t):g}catch(v){p=!1,s.__conditionalError=v,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,v?.message||v)}}}else if(typeof y=="function")try{p=y(t,t.state,t.context)}catch(u){p=!1,s.__conditionalError=u,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,u?.message||u)}else p=y;const l=r?!p:!!p;if(!t.node||l===a.lastMatch)return;a.lastMatch=l;const _=t.context?.designSystem;_&&(0,A.pushConfig)(_);try{if(l){const u={},h={};let g=!1;for(const x in e){if(!Object.prototype.hasOwnProperty.call(e,x))continue;const E=e[x],k=x.charAt(0);if((k===":"||k==="@"||k==="&")&&E&&typeof E=="object"&&!Array.isArray(E)){if(ut(x,t)){const D=Z(E,t,!0);Object.keys(D).length&&(h[`[data-theme="${x.slice(1)}"] &`]=D,g=!0)}else{let D=x;if(k==="@"&&!x.startsWith("@media")&&!x.startsWith("@keyframes")){const U=t.context?.designSystem?.media?.[x.slice(1)];U&&(D=`@media ${U}`)}const H=Z(E,t,!1);Object.keys(H).length&&(h[D]=H,g=!0)}continue}const j=typeof E=="function"?E(t,t.state,t.context):E;if(j!=null)if(b.CSS_PROPS_REGISTRY[x]){const D=b.CSS_PROPS_REGISTRY[x](j,t,t.state,t.context);if(D){const H=Array.isArray(D)?D:[D];for(const U of H)U&&Object.assign(u,U)}}else b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(x)&&(u[x]=j)}const v=Object.keys(u);if(v.length){G(t.node,u);for(const x of v)n.set(x,c);a.appliedKeys=v}else a.appliedKeys=null;if(g){const x=(0,B.css)(h,null,t.context?.cssPrefix),E=x?x.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const k of E)t.node.classList.add(k);a.appliedClasses=E}else a.appliedClasses=null}else if(a.appliedClasses){for(const x of a.appliedClasses)t.node.classList.remove(x);a.appliedClasses=null}}else{if(a.appliedKeys){for(const u of a.appliedKeys)n.get(u)===c&&(t.node.style[u]="",n.delete(u));a.appliedKeys=null}if(a.appliedClasses){for(const u of a.appliedClasses)t.node.classList.remove(u);a.appliedClasses=null}}}finally{_&&(0,A.popConfig)()}};s.__conditionalRunners.push(f);const d=(0,w.createEffect)(f,{depth:s.path.length});s.__effects.push(d)}}const pt=new WeakSet;function no(t){const s=t.ownerDocument;!s||pt.has(s)||(pt.add(s),queueMicrotask(()=>{pt.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const lt=new WeakSet;let Ot=!1;function co(t){const{node:s}=t;if(!s)return;if(Ot||(Ot=!0,(0,B.css)({display:"none"})),lt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}lt.add(t);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{const c={};let i=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&b.CSS_PROPS_REGISTRY.theme){const o=b.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(const e of o)e&&Object.assign(c,e);else Object.assign(c,o);i=!0}}for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||R.REGISTRY.has(o)||o==="theme")continue;const e=o.charCodeAt(0);if(!(e>=65&&e<=90)&&!Y(o)){if(b.CSS_PROPS_REGISTRY[o]){const r=t[o],a=b.CSS_PROPS_REGISTRY[o](r,t,t.state,t.context);if(a){if(Array.isArray(a))for(const f of a)f&&Object.assign(c,f);else Object.assign(c,a);i=!0}}else if(b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const r=t[o];r!=null&&typeof r!="object"&&(c[o]=r,i=!0)}else if(o.charCodeAt(0)===45){const r=t[o];r!=null&&typeof r!="object"&&(c[o]=r,i=!0)}else if(o.charAt(0)==="&"){const r=t[o];r&&typeof r=="object"&&(c[o]=r,i=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const r=t[o];if(r&&typeof r=="object"){if(ut(o,t)){const a=Z(r,t,!0);Object.keys(a).length&&(c[`[data-theme="${o.slice(1)}"] &`]=a,i=!0)}else{let a=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const d=t.context?.designSystem?.media?.[o.slice(1)];d&&(a=`@media ${d}`)}const f=Z(r,t,!1);Object.keys(f).length&&(c[a]=f,i=!0)}i=!0}}}}if(i){c.display&&String(c.display).includes("!important")&&(s.style.setProperty("display",String(c.display).replace(/\s*!important\s*$/,""),"important"),delete c.display);const o=(0,B.css)(c,null,t.context?.cssPrefix);if(o&&s.classList){const r=o.split(" ").filter(Boolean);let a=!1;for(const f of r)s.classList.add(f),a||(f.charCodeAt(0)===95&&f.charCodeAt(1)===99||f.charCodeAt(0)===95&&f.indexOf("_c",1)!==-1)&&(a=!0);a&&no(s)}const e=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(e!=null){const r=c.display;if(r&&r!==e)if(e==="none"){const a=[];for(const f of s.classList)f.startsWith("_d-")&&f!=="_d-none"&&a.push(f);for(const f of a)s.classList.remove(f);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&(0,A.popConfig)(),lt.delete(t)}}function Lt(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const o=t.aria[i];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const e="aria-"+i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());s.setAttribute(e,o===!0?"":o)}const n=(0,$.applyAttrTransforms)(t);for(const i in n){const o=n[i];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(i,o===!0?"":o)}const c=t.tag||"div";for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||typeof t[i]=="function"||R.REGISTRY.has(i)||i==="on"||n[i]!==void 0)continue;const o=i.charCodeAt(0);if(!(o>=65&&o<=90)&&!Y(i)&&!(b.CSS_PROPS_REGISTRY[i]||b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(i))&&(0,$.checkAttributeByTagName)(c,i)){let e=t[i];if(e==null||(typeof e=="string"&&e.includes("{{")&&(e=(0,nt.replaceLiteralsWithObjectFields)(e,t,t.state,t.context),t[i]=e),e==null||typeof e=="function"||typeof e=="object")||e===!1&&!(0,$.isEnumeratedTrueFalseAttr)((0,$.camelToAttr)(i)||i))continue;const r=(0,$.camelToAttr)(i)||i;s.setAttribute(r,(0,$.serializeAttrValue)(r,e))}}}function ro(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,c=n&&typeof n=="object"&&n.max?String(n.max):null;c&&(s.style.maxHeight=c);const i=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};i(),s.addEventListener("input",i),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",i)}catch{}})}const $t=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Dt(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!Y(n)||$t.has(n))continue;let c=t[n];if(typeof c=="string"&&/^[A-Za-z_$][\w$]*$/.test(c)){const o=c;c=function(r){return t.call(o,r)}}if(typeof c!="function")continue;const i=Gt(n);R.LIFECYCLE_EVENTS.has(i)||(0,Nt.registerEvent)(Zt(i),t,c)}io(t)}function io(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let c=!1;for(const y of $t){const l=t[y];typeof l=="function"&&(n[y]=l,c=!0)}if(!c)return;const i=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let e=0,r=0,a=0,f=!1;const d=y=>{const l=y.touches&&y.touches[0]||y.changedTouches&&y.changedTouches[0];l&&(e=l.clientX,r=l.clientY,a=Date.now(),f=!0)},p=y=>{if(!f)return;f=!1;const l=y.changedTouches&&y.changedTouches[0]||y.touches&&y.touches[0];if(!l)return;const _=l.clientX-e,u=l.clientY-r,h=Date.now()-a;if(h>o)return;const g=Math.abs(_),v=Math.abs(u);if(Math.max(g,v)<i)return;let x;if(g>v*1.2)x=_<0?"left":"right";else if(v>g*1.2)x=u<0?"up":"down";else return;const E="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),k=n[E],j=n.onSwipe;k&&k.call(t,y,t,t.state,t.context),j&&j.call(t,{direction:x,dx:_,dy:u,dt:h,event:y},t,t.state,t.context)};s.addEventListener("touchstart",d,{passive:!0}),s.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",d)}catch{}try{s.removeEventListener("touchend",p)}catch{}})}function st(t,s){const n={...t};for(const c in s){const i=n[c],o=s[c];i&&o&&typeof i=="object"&&typeof o=="object"&&!Array.isArray(i)&&!Array.isArray(o)&&typeof i!="function"&&typeof o!="function"?n[c]=st(i,o):n[c]=o}return n}function yt(t,s,n){if(!s||!t.node)return;const c=t.childExtends;if(Array.isArray(s)){const i=t.tag==="fragment",o=t.context?.document||globalThis.document,e=i?null:o?.createDocumentFragment();if(!i&&!e)return;const r=t.childProps,a=t.childrenAs;for(let f=0;f<s.length;f++){let d=s[f];const p=d;(typeof d=="string"||typeof d=="number")&&(d={text:d});let y=r;if(typeof r=="function")try{y=r(t,d)}catch{y=null}if(a==="state"){let u=p;(typeof p=="string"||typeof p=="number")&&(u={value:p,text:p}),d=y?{...y,state:u}:{state:u}}else y&&(d=st(y,d));if(c&&!d.ignoreChildExtends)if(d.extends){const u=Array.isArray(d.extends)?d.extends:[d.extends],h=Array.isArray(c)?c:[c];d={...d,extends:[...h,...u]}}else d={...d,extends:c};const l=d?.key||p&&typeof p=="object"&&p.key||`${f}`;let _;try{_=V(d,t,l,n)}catch(u){if(typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${l}" failed to construct at ${h} (initial render, skipping this row):`,u?.message||u)}continue}!i&&_?.node&&e.appendChild(_.node)}return i||t.node.appendChild(e),!0}if(typeof s=="string"){const i=St(s,t);if(Array.isArray(i))return yt(t,i,n)}if(typeof s=="object")for(const i in s){if(R.REGISTRY.has(i))continue;let o=s[i];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=st(t.childProps,o)),c&&!o.ignoreChildExtends)if(o.extends){const e=Array.isArray(o.extends)?o.extends:[o.extends],r=Array.isArray(c)?c:[c];o={...o,extends:[...r,...e]}}else o={...o,extends:c};V(o,t,i,n)}}}function ht(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const c=n.options;if(!c||!c.length)return;const i=t.__ref,o=i&&i.__exec&&i.__exec.value,e=typeof o=="function",r=t.value!=null&&typeof t.value!="function";if(e||r){let d;if(e)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const p=d==null?"":String(d);n.value!==p&&(n.value=p);return}const a=s||!(i&&i.__selectSynced);if(i&&(i.__selectSynced=!0),!a)return;let f=-1;for(let d=0;d<c.length;d++)c[d].defaultSelected&&(f=d);f>=0&&n.selectedIndex!==f&&(n.selectedIndex=f)}function Tt(t,s){let{children:n,content:c}=t;const i=t.childExtends;if(typeof n=="function"){const r=n;try{n=r(t,t.state,t.context)}catch(y){if(n=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,y?.message||y)}}t.children=n;const a=t.__ref;let f=!1;const d=L(t,t.childrenDeps,r),p=(0,w.createEffect)(()=>{const y=f;f=!0;let l;try{l=d(t,t.state,t.context)}catch(k){if(typeof console<"u"&&console.error){const j=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${j}${y?"":" (initial tracking run)"}:`,k?.message||k)}return}if(!y||l===t.children)return;t.children=l;const _=typeof t.onContentUpdate=="function",u=_?[]:null,h=_?[]:null,g=_?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const k=t.childProps,j=[],D=new Map;for(let C=0;C<l.length;C++){const T=l[C];let S=k;if(typeof k=="function")try{S=k(t,T)}catch{S=null}const F=S&&S.key||T&&T.key||`${C}`;j.push(F),D.set(F,{rawChild:T,childProps:S})}const H=new Set(j),U=a.__children.slice();for(const C of U)if(!H.has(C)){const T=t[C];T?.remove&&T.remove(),delete t[C],h&&h.push(C)}const Q=t.childExtends,tt=t.tag==="fragment",It=t.context?.document||globalThis.document,X=tt?null:It?.createDocumentFragment(),ct=new Set;for(const C of j){const T=D.get(C),S=T.rawChild,F=t[C];if(F&&F.state){if(S&&typeof S=="object"){const O=F.state,z=O.$replace||O.replace,xt=O.$update||O.update;if(typeof z=="function")z.call(O,S);else if(typeof xt=="function"){for(const M in O)if(!(M==="__element"||M==="root"||M==="parent"||M==="update")&&!Object.prototype.hasOwnProperty.call(S,M))try{O[M]=void 0}catch{}xt.call(O,S)}else for(const M in S)O[M]=S[M]}g&&g.push(C);continue}let rt=S;(typeof S=="string"||typeof S=="number")&&(rt={value:S,text:S});const bt=T.childProps;let N=bt?{...bt,state:rt}:{state:rt};if(Q&&!N.ignoreChildExtends)if(N.extends){const O=Array.isArray(N.extends)?N.extends:[N.extends],z=Array.isArray(Q)?Q:[Q];N={...N,extends:[...z,...O]}}else N={...N,extends:Q};let it;try{it=V(N,t,C,s)}catch(O){if(typeof console<"u"&&console.error){const z=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${z} (reconcile, skipping this row):`,O?.message||O)}ct.add(C);continue}!tt&&it?.node&&X&&X.appendChild(it.node),u&&u.push(C)}if(!tt&&X&&X.childNodes.length&&t.node&&t.node.appendChild(X),!tt&&t.node){let C=null;for(const T of j){const S=t[T]?.node;if(!S)continue;const F=C?C.nextSibling:t.node.firstChild;S!==F&&t.node.insertBefore(S,F),C=S}}a.__children=ct.size?j.filter(C=>!ct.has(C)):j,_&&(u.length||h.length)&&vt(t,{added:u,removed:h,kept:g}),ht(t,!1);return}const E=_?[...a.__children]:null;for(const k of[...a.__children]){const j=t[k];j?.remove&&j.remove(),delete t[k]}a.__children=[],yt(t,l,s),ht(t,!1),_&&vt(t,{added:[...a.__children],removed:E,kept:[]})},{depth:a.path.length});a.__effects.push(p)}const o=yt(t,n||c,s);if((n||c)&&!o)return;const e=t.context?.components||{};{const r=Object.keys(t);for(let a=0;a<r.length;a++){const f=r[a];if(!f.endsWith("Extends")||typeof t[f]!="string")continue;const d=f.slice(0,-7);if(!d||d.charCodeAt(0)<65||d.charCodeAt(0)>90)continue;const p={extends:t[f]};delete t[f];for(let y=a+1;y<r.length;y++){const l=r[y],_=l.charCodeAt(0);if(_>=65&&_<=90||R.REGISTRY.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const u=t[l];u!==void 0&&(p[l]=u,delete t[l])}t[d]&&typeof t[d]=="object"?t[d]={...p,...t[d]}:t[d]=p}}for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||R.REGISTRY.has(r)||typeof t[r]!="object"||t[r]===null)continue;const a=r.charCodeAt(0);if(a<65||a>90)continue;let f=t[r];if(!f.__ref){if(!f.extends&&!f.extend){const d=e[r]||e[`smbls.${r}`];d&&(f={...f,extends:d})}if(t.childProps&&(f=st(t.childProps,f)),i&&!f.ignoreChildExtends)if(f.extends){const d=Array.isArray(f.extends)?f.extends:[f.extends],p=Array.isArray(i)?i:[i];f={...f,extends:[...p,...d]}}else f={...f,extends:i};V(f,t,r,s)}}}function Rt(t,s,n){const{node:c}=t;if(!c)return;c.ref=t;const i=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(i){const e=i.parentNode;if(e){if(n?.position==="before"&&n.node)e.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const r=n.node.nextSibling;e.insertBefore(c,r||i)}else e.insertBefore(c,i);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const e=n.node.nextSibling;e?o.insertBefore(c,e):o.appendChild(c)}else o.appendChild(c)}function I(t,s,n){const c=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,K.runPluginHook)(c,s,n);const i="on"+t,o=s[i];if(typeof o=="function"){const e=t==="Render"||t==="RenderRouter";if(e){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const r=s.context?.designSystem;r&&(0,A.pushConfig)(r);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(a){if(s.context?.plugins?.length&&(0,K.runPluginHook)("error",s,{hook:i,error:a})||console.error(`[DOMQL] Lifecycle "${i}" error:`,a),s.context?.strictMode)throw a}finally{r&&(0,A.popConfig)(),e&&(s.__ref.__inRender=!1)}}return!0}var eo=V;
@@ -1 +1 @@
1
- var g=Object.create;var f=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty;var n=(e,t)=>{for(var E in t)f(e,E,{get:t[E],enumerable:!0})},s=(e,t,E,T)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of v(t))!i.call(e,p)&&p!==E&&f(e,p,{get:()=>t[p],enumerable:!(T=l(t,p))||T.enumerable});return e};var G=(e,t,E)=>(E=e!=null?g(c(e)):{},s(t||!e||!e.__esModule?f(E,"default",{value:e,enumerable:!0}):E,e)),I=e=>s(f({},"__esModule",{value:!0}),e);var L={};n(L,{DELEGATED_EVENTS:()=>r.DELEGATED_EVENTS,LIFECYCLE_EVENTS:()=>r.LIFECYCLE_EVENTS,MIXINS:()=>r.MIXINS,NON_BUBBLING_EVENTS:()=>r.NON_BUBBLING_EVENTS,REGISTRY:()=>r.REGISTRY,SVG_TAGS:()=>o.SVG_TAGS,addDelegatedEvent:()=>a.addDelegatedEvent,addMethods:()=>S.addMethods,applyExtends:()=>N.applyExtends,cacheNode:()=>o.cacheNode,create:()=>d.create,createHTMLNode:()=>o.createHTMLNode,default:()=>d.default,detectTag:()=>o.detectTag,dispose:()=>m.dispose,flushMounts:()=>d.flushMounts,isSvgTag:()=>o.isSvgTag,isValidTag:()=>o.isValidTag,registerEvent:()=>a.registerEvent,remove:()=>m.remove,removeDelegatedEvent:()=>a.removeDelegatedEvent,update:()=>x.update});module.exports=I(L);var d=G(require("./create.js"),1),x=require("./update.js"),m=require("./dispose.js"),r=require("./registry.js"),a=require("./delegate.js"),o=require("./cache.js"),N=require("./extends.js"),S=require("./methods.js");
1
+ var g=Object.create;var f=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var i=(e,t)=>{for(var E in t)f(e,E,{get:t[E],enumerable:!0})},T=(e,t,E,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of n(t))!c.call(e,p)&&p!==E&&f(e,p,{get:()=>t[p],enumerable:!(x=l(t,p))||x.enumerable});return e};var G=(e,t,E)=>(E=e!=null?g(v(e)):{},T(t||!e||!e.__esModule?f(E,"default",{value:e,enumerable:!0}):E,e)),I=e=>T(f({},"__esModule",{value:!0}),e);var L={};i(L,{DELEGATED_EVENTS:()=>r.DELEGATED_EVENTS,LIFECYCLE_EVENTS:()=>r.LIFECYCLE_EVENTS,MIXINS:()=>r.MIXINS,NON_BUBBLING_EVENTS:()=>r.NON_BUBBLING_EVENTS,REGISTRY:()=>r.REGISTRY,SVG_TAGS:()=>o.SVG_TAGS,addDelegatedEvent:()=>a.addDelegatedEvent,addMethods:()=>s.addMethods,applyExtends:()=>S.applyExtends,cacheNode:()=>o.cacheNode,create:()=>d.create,createHTMLNode:()=>o.createHTMLNode,default:()=>d.default,detectTag:()=>o.detectTag,dispose:()=>m.dispose,flushMounts:()=>d.flushMounts,isSvgTag:()=>o.isSvgTag,isValidTag:()=>o.isValidTag,refreshContextProto:()=>s.refreshContextProto,registerEvent:()=>a.registerEvent,remove:()=>m.remove,removeDelegatedEvent:()=>a.removeDelegatedEvent,update:()=>N.update});module.exports=I(L);var d=G(require("./create.js"),1),N=require("./update.js"),m=require("./dispose.js"),r=require("./registry.js"),a=require("./delegate.js"),o=require("./cache.js"),S=require("./extends.js"),s=require("./methods.js");
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var n in e)c(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k(e))!m.call(t,r)&&r!==n&&c(t,r,{get:()=>e[r],enumerable:!(o=y(e,r))||o.enumerable});return t};var C=t=>x(c({},"__esModule",{value:!0}),t);var D={};w(D,{addMethods:()=>P,elementProto:()=>f});module.exports=C(D);var _=require("./update.js"),d=require("./dispose.js"),g=require("./devRuntime.js"),j=require("css-in-props"),s=require("@symbo.ls/utils");function u(t,e,n){const o=t?.context?.analyze;if(!o||!o.emit||e==="warn"&&!o.shouldCapture("warnings")||e==="error"&&!o.shouldCapture("errors"))return;const r=n.map(i=>i?.message||(typeof i=="string"?i:null)).filter(Boolean).join(" ");o.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:r||null,args:n})}const a=new Set;function S(t,e,n){const o=String(e);if(a.has(o))return;a.add(o);const r=t?.__ref?.path,i=Array.isArray(r)&&r.length?r.join("."):t?.key!=null?String(t.key):"(unknown element)",p=n!=null?`resolves to a non-function (${typeof n}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",l=`[smbls] el.call('${o}') at <${i}>: "${o}" ${p}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;u(t,"error",[l]),console.error(l)}function R(...t){return u(this,"warn",t),s.warn.apply(this,t)}function v(...t){return u(this,"error",t),s.error.apply(this,t)}const f={update:_.update,remove:d.remove,getDB:s.getDB,getQuery:s.getQuery,getRootData:s.getRootData,getChildren:s.getChildren,getPath:s.getPath,nextElement:s.nextElement,previousElement:s.previousElement,verbose:s.verbose,warn:R,error:v,variables:s.variables,spotByPath:s.spotByPath,set(t,e){const n=this.__ref;if(n){if(n.__setLocked){n.__setQueued={content:t,options:e};return}n.__setLocked=!0}try{if(this.removeContent(),t!=null){const o=this.context?.__create;o&&o(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(n){n.__setLocked=!1;const o=n.__setQueued;o&&(n.__setQueued=null,this.set(o.content,o.options))}}},reset(t){const e=this.context?.__create;if(!e)return this;const n=this.parent,o=this.key,r=this.parse();return this.remove(),e(r,n,o,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){const e=this.__ref;if(!e?.__children)return null;for(const n of e.__children){const o=this[n];if(!o)continue;if(typeof t=="function"){if(t(o))return o}else if(typeof t=="string"&&o.key===t)return o;const r=o.lookdown?.(t);if(r)return r}return null},lookdownAll(t,e=[]){const n=this.__ref;if(!n?.__children)return e;for(const o of n.__children){const r=this[o];r&&(typeof t=="function"?t(r)&&e.push(r):typeof t=="string"&&r.key===t&&e.push(r),r.lookdownAll?.(t,e))}return e},getRef(){return this.__ref},getRoot:s.getRoot,getRootState:s.getRootState,getRootContext:s.getRootContext,getContext:s.getContext,parse(t){const e={},n=t?new Set(t):null,o=this.__ref?.__exec;for(const r in this)if(!(r==="parent"||r==="node"||r==="__ref")&&!n?.has(r)){if(o&&o[r]!==void 0){e[r]=o[r];continue}typeof this[r]!="function"&&(e[r]=this[r])}return e},parseDeep(t){const e=this.parse(t),n=this.__ref;if(n?.__children)for(const o of n.__children)this[o]?.parseDeep&&(e[o]=this[o].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){const e={};for(const n of t)e[n]=this[n];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(const e in t){const n=t[e];if(n==null)continue;const o=e.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),r=String(n).replace(/\s*!important\s*$/,"");this.node.style.setProperty(o,r,"important")}},call(t,...e){const n=this.context,o=n?.methods?.[t]||n?.functions?.[t]||n?.utils?.[t]||this[t];if(typeof o=="function")return o.call(this,...e);(0,g.isLoudDevRuntime)()&&S(this,t,o)},removeContent(){const t=this.__ref;if(!t?.__children)return;const e=this.content;if(e?.remove){e.remove(),delete this.content;const n=t.__children.indexOf("content");n!==-1&&t.__children.splice(n,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},h=new WeakMap;function b(t){if(!t)return f;let e=h.get(t);if(e)return e;e=Object.create(f);const n=t.methods;if(n)for(const o in n)e[o]=n[o];return h.set(t,e),e}function P(t){const e=b(t.context);Object.setPrototypeOf(t,e)}
1
+ "use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var n in e)c(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!k.call(t,r)&&r!==n&&c(t,r,{get:()=>e[r],enumerable:!(o=y(e,r))||o.enumerable});return t};var C=t=>x(c({},"__esModule",{value:!0}),t);var $={};w($,{addMethods:()=>P,elementProto:()=>f,refreshContextProto:()=>D});module.exports=C($);var _=require("./update.js"),d=require("./dispose.js"),g=require("./devRuntime.js"),A=require("css-in-props"),s=require("@symbo.ls/utils");function u(t,e,n){const o=t?.context?.analyze;if(!o||!o.emit||e==="warn"&&!o.shouldCapture("warnings")||e==="error"&&!o.shouldCapture("errors"))return;const r=n.map(i=>i?.message||(typeof i=="string"?i:null)).filter(Boolean).join(" ");o.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:r||null,args:n})}const h=new Set;function S(t,e,n){const o=String(e);if(h.has(o))return;h.add(o);const r=t?.__ref?.path,i=Array.isArray(r)&&r.length?r.join("."):t?.key!=null?String(t.key):"(unknown element)",p=n!=null?`resolves to a non-function (${typeof n}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",a=`[smbls] el.call('${o}') at <${i}>: "${o}" ${p}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;u(t,"error",[a]),console.error(a)}function R(...t){return u(this,"warn",t),s.warn.apply(this,t)}function v(...t){return u(this,"error",t),s.error.apply(this,t)}const f={update:_.update,remove:d.remove,getDB:s.getDB,getQuery:s.getQuery,getRootData:s.getRootData,getChildren:s.getChildren,getPath:s.getPath,nextElement:s.nextElement,previousElement:s.previousElement,verbose:s.verbose,warn:R,error:v,variables:s.variables,spotByPath:s.spotByPath,set(t,e){const n=this.__ref;if(n){if(n.__setLocked){n.__setQueued={content:t,options:e};return}n.__setLocked=!0}try{if(this.removeContent(),t!=null){const o=this.context?.__create;o&&o(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(n){n.__setLocked=!1;const o=n.__setQueued;o&&(n.__setQueued=null,this.set(o.content,o.options))}}},reset(t){const e=this.context?.__create;if(!e)return this;const n=this.parent,o=this.key,r=this.parse();return this.remove(),e(r,n,o,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){const e=this.__ref;if(!e?.__children)return null;for(const n of e.__children){const o=this[n];if(!o)continue;if(typeof t=="function"){if(t(o))return o}else if(typeof t=="string"&&o.key===t)return o;const r=o.lookdown?.(t);if(r)return r}return null},lookdownAll(t,e=[]){const n=this.__ref;if(!n?.__children)return e;for(const o of n.__children){const r=this[o];r&&(typeof t=="function"?t(r)&&e.push(r):typeof t=="string"&&r.key===t&&e.push(r),r.lookdownAll?.(t,e))}return e},getRef(){return this.__ref},getRoot:s.getRoot,getRootState:s.getRootState,getRootContext:s.getRootContext,getContext:s.getContext,parse(t){const e={},n=t?new Set(t):null,o=this.__ref?.__exec;for(const r in this)if(!(r==="parent"||r==="node"||r==="__ref")&&!n?.has(r)){if(o&&o[r]!==void 0){e[r]=o[r];continue}typeof this[r]!="function"&&(e[r]=this[r])}return e},parseDeep(t){const e=this.parse(t),n=this.__ref;if(n?.__children)for(const o of n.__children)this[o]?.parseDeep&&(e[o]=this[o].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){const e={};for(const n of t)e[n]=this[n];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(const e in t){const n=t[e];if(n==null)continue;const o=e.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),r=String(n).replace(/\s*!important\s*$/,"");this.node.style.setProperty(o,r,"important")}},call(t,...e){const n=this.context,o=n?.methods?.[t]||n?.functions?.[t]||n?.utils?.[t]||this[t];if(typeof o=="function")return o.call(this,...e);(0,g.isLoudDevRuntime)()&&S(this,t,o)},removeContent(){const t=this.__ref;if(!t?.__children)return;const e=this.content;if(e?.remove){e.remove(),delete this.content;const n=t.__children.indexOf("content");n!==-1&&t.__children.splice(n,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},l=new WeakMap;function b(t){if(!t)return f;let e=l.get(t);if(e)return e;e=Object.create(f);const n=t.methods;if(n)for(const o in n)e[o]=n[o];return l.set(t,e),e}function P(t){const e=b(t.context);Object.setPrototypeOf(t,e)}function D(t){if(!t)return!1;const e=l.get(t);if(!e)return!1;const n=t.methods;if(!n)return!1;for(const o in n)e[o]=n[o];return!0}
@@ -1,6 +1,6 @@
1
- import{createStore as ct,createScopeStore as Ut,isStore as K}from"@symbo.ls/signal";import{createEffect as k}from"@symbo.ls/signal";import{cacheNode as rt,detectTag as At}from"./cache.js";import{REGISTRY as U,LIFECYCLE_EVENTS as Vt}from"./registry.js";import{registerEvent as Wt}from"./delegate.js";import{applyExtends as Bt}from"./extends.js";import{addMethods as Ht}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as vt}from"./devRuntime.js";import{replaceLiteralsWithObjectFields as it}from"@symbo.ls/utils";import{runPluginHook as V}from"@symbo.ls/utils/function.js";import{applyStateMethods as q}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as P,DEFAULT_CSS_PROPERTIES_LIST as w}from"css-in-props";import{css as et,wrapHoverRule as Ct}from"@symbo.ls/css";import{pushConfig as O,popConfig as L}from"@symbo.ls/scratch";import{checkAttributeByTagName as ft,applyAttrTransforms as zt,camelToAttr as at,serializeAttrValue as Yt,isEnumeratedTrueFalseAttr as Gt}from"attrs-in-props";let Zt=1;const m=[];let dt=!1;function qt(){dt||(dt=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(St):setTimeout(St,0))}function St(){if(dt=!1,!m.length)return;const t=m.splice(0,m.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||I("Mounted",n,n.__ref?.__mountOptions||{})}}function kt(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,m.push(t),qt())}function wt(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&V("contentUpdate",t,s);const n=t.context?.designSystem;n&&O(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(c){if(t.context?.plugins?.length&&V("error",t,{hook:"onContentUpdate",error:c})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',c),t.context?.strictMode)throw c}finally{n&&L()}}function H(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Qt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Xt(t){return t.toLowerCase()}function jt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function Q(t,s){const n={...t};for(const c in s){const f=n[c],o=s[c];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[c]=Q(f,o):n[c]=o}return n}function z(t,s,n,c={},f){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=n||t.key||`_${Zt++}`,o.parent=s||null,o.context=t.context||s?.context||c.context||{},o.context.__create||(o.context.__create=z);const r=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||o,path:s?.__ref?.path?[...s.__ref.path,o.key]:[o.key]};if(n&&!t.extends&&!t.extend){const l=n.indexOf("_");if(l>0){const h=n.substring(0,l),g=o.context?.components;g&&(g[h]||g["smbls."+h])?t={...t,extends:h}:g&&vt()&&/^[A-Z]\w*_\d+$/.test(n)&&console.warn(`[smbls] auto-extend: key "${n}" looks like a multi-instance (${h}_N) but neither "${h}" nor "smbls.${h}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}Bt(o,t,c);const i=new Set(["childProps","attr","style","scope","data"]),e=o.props&&typeof o.props=="object"?o.props:null;for(const l in t){if(l==="parent"||l==="node"||l==="__ref"||l==="extends"||l==="context"||l==="props")continue;const h=t[l],g=o[l],C=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";C&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?o[l]=Q(g,h):C&&i.has(l)?o[l]={...g,...h}:C&&jt(l)?o[l]=Q(g,h):o[l]=h}function a(l){for(const h in l){const g=l[h],C=o[h],b=C&&g&&typeof C=="object"&&typeof g=="object"&&!Array.isArray(C)&&!Array.isArray(g)&&typeof C!="function"&&typeof g!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=Q(C,g):b&&i.has(h)?o[h]={...C,...g}:b&&jt(h)?o[h]=Q(C,g):o[h]=g}}e&&a(e),t.props&&typeof t.props=="object"&&a(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const d=o.scope&&typeof o.scope=="object"?o.scope:null,u=s?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=u||p||null;if(t.scope!==void 0||d){const l={};d&&Object.assign(l,d),t.scope!==void 0&&Object.assign(l,t.scope),o.scope=Ut(l,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),Ht(o),Jt(o,s,t),o.if!=null){let l;if(typeof o.if=="function")try{l=o.if(o,o.state,o.context)}catch(h){if(l=!1,r.__ifError=h,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,h?.message||h)}}else l=o.if;r.__if=!!l}if(r.__if)typeof o.if=="function"&&(r.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&Lt(o,r,o.if),o;o.tag||(o.tag=At(o)),I("Init",o,c);const _=o.node=rt(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),r.__fragmentAnchor=h}I("AttachNode",o,c),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Ft(o,c),Pt(o),pt(o),Rt(o),fo(o);try{Mt(o,c)}catch(l){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,l?.message||l,l?.stack?`
2
- `+l.stack.split(`
1
+ import{createStore as rt,createScopeStore as Vt,isStore as I}from"@symbo.ls/signal";import{createEffect as k}from"@symbo.ls/signal";import{cacheNode as it,detectTag as vt}from"./cache.js";import{REGISTRY as K,LIFECYCLE_EVENTS as Wt}from"./registry.js";import{registerEvent as Bt}from"./delegate.js";import{applyExtends as Ht}from"./extends.js";import{addMethods as zt}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as Ct}from"./devRuntime.js";import{replaceLiteralsWithObjectFields as et}from"@symbo.ls/utils";import{runPluginHook as V}from"@symbo.ls/utils/function.js";import{applyStateMethods as Q}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as E,DEFAULT_CSS_PROPERTIES_LIST as j}from"css-in-props";import{css as at,wrapHoverRule as St}from"@symbo.ls/css";import{pushConfig as $,popConfig as D}from"@symbo.ls/scratch";import{checkAttributeByTagName as ft,applyAttrTransforms as Yt,camelToAttr as dt,serializeAttrValue as Gt,isEnumeratedTrueFalseAttr as Zt}from"attrs-in-props";let qt=1;const tt=[];let ut=!1;function Qt(){ut||(ut=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(kt):setTimeout(kt,0))}function kt(){if(ut=!1,!tt.length)return;const t=tt.splice(0,tt.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||M("Mounted",n,n.__ref?.__mountOptions||{})}}function wt(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,tt.push(t),Qt())}function jt(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&V("contentUpdate",t,s);const n=t.context?.designSystem;n&&$(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(c){if(t.context?.plugins?.length&&V("error",t,{hook:"onContentUpdate",error:c})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',c),t.context?.strictMode)throw c}finally{n&&D()}}function H(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Xt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Jt(t){return t.toLowerCase()}function Et(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function X(t,s){const n={...t};for(const c in s){const a=n[c],o=s[c];a&&o&&typeof a=="object"&&typeof o=="object"&&!Array.isArray(a)&&!Array.isArray(o)&&typeof a!="function"&&typeof o!="function"?n[c]=X(a,o):n[c]=o}return n}function z(t,s,n,c={},a){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=n||t.key||`_${qt++}`,o.parent=s||null,o.context=t.context||s?.context||c.context||{},o.context.__create||(o.context.__create=z);const i=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||o,path:s?.__ref?.path?[...s.__ref.path,o.key]:[o.key]};if(n&&!t.extends&&!t.extend){const u=n.indexOf("_");if(u>0){const h=n.substring(0,u),g=o.context?.components;g&&(g[h]||g["smbls."+h])?t={...t,extends:h}:g&&Ct()&&/^[A-Z]\w*_\d+$/.test(n)&&console.warn(`[smbls] auto-extend: key "${n}" looks like a multi-instance (${h}_N) but neither "${h}" nor "smbls.${h}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}Ht(o,t,c);const r=new Set(["childProps","attr","style","scope","data"]),e=o.props&&typeof o.props=="object"?o.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;const h=t[u],g=o[u],x=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";x&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?o[u]=X(g,h):x&&r.has(u)?o[u]={...g,...h}:x&&Et(u)?o[u]=X(g,h):o[u]=h}function f(u){for(const h in u){const g=u[h],x=o[h],b=x&&g&&typeof x=="object"&&typeof g=="object"&&!Array.isArray(x)&&!Array.isArray(g)&&typeof x!="function"&&typeof g!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=X(x,g):b&&r.has(h)?o[h]={...x,...g}:b&&Et(h)?o[h]=X(x,g):o[h]=g}}e&&f(e),t.props&&typeof t.props=="object"&&f(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const d=o.scope&&typeof o.scope=="object"?o.scope:null,p=s?.scope,y=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,l=p||y||null;if(t.scope!==void 0||d){const u={};d&&Object.assign(u,d),t.scope!==void 0&&Object.assign(u,t.scope),o.scope=Vt(u,l)}else l&&(o.scope=l);if(t.if!==void 0&&(o.if=t.if),zt(o),mt(o,s,t),o.if!=null){let u;if(typeof o.if=="function")try{u=o.if(o,o.state,o.context)}catch(h){if(u=!1,i.__ifError=h,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,h?.message||h)}}else u=o.if;i.__if=!!u}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&$t(o,i,o.if),o;o.tag||(o.tag=vt(o)),M("Init",o,c);const _=o.node=it(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),i.__fragmentAnchor=h}M("AttachNode",o,c),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Mt(o,c),Ot(o),lt(o),Nt(o),fo(o);try{It(o,c)}catch(u){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,u?.message||u,u?.stack?`
2
+ `+u.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(gt(o,!0),It(o,s,f),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const l=o.context?.designSystem;l&&O(l);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{l&&L()}}if(I("Create",o,c),I("Complete",o,c),I("Render",o,c),I("RenderRouter",o,c),kt(o,c),typeof o.onFrame=="function"){const l=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&O(h);try{l(o,o.state,o.context)}catch(C){console.error("[DOMQL] onFrame error:",C)}finally{h&&L()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Jt(t,s,n){const c=!s,f=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=c&&f&&t.context?.state,r=n.state!==void 0&&!o?n.state:t.state&&!K(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,q(t,t.state);else if(t.context?.state){const i=t.context.state,e={...i},a=t.context?.polyglot;if(a?.translations){const d=i.lang||a.defaultLang||"en",u=a.translations[d];if(u&&typeof u=="object")for(const y in u)e[y]===void 0&&(e[y]=u[y]);const p=new Set(a.languages||[]);for(const y in a.translations)!p.has(y)&&e[y]===void 0&&(e[y]=a.translations[y])}t.state=K(e)?e:ct(e),t.state.__element=t,t.state.root=t.state,q(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),q(t,t.state);return}if(typeof r=="string"){if(t.state=Et(r,s),t.state&&typeof t.state=="object"&&!K(t.state)){const i=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}q(t,t.state);return}if(typeof r=="function"){const i=r(t,s?.state);t.state=K(i)?i:ct(i||{})}else K(r)?t.state=r:t.state=ct({...r});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,q(t,t.state)}function ut(t,s){if(!s)return t;const n=s.split("/");let c=t;for(const f of n){if(c==null)return{};c=c[f]}return c??{}}function Et(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const f=t.slice(3);return f?ut(s.state,f):s.state??{}}if(t.startsWith("~/")){const f=s.state?.root||s.state,o=t.slice(2);return o?ut(f,o):f??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=ut(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const c=s.context?.polyglot;if(c?.translations){const f=s.state?.root?.lang||c.defaultLang||"en",o=c.translations[f];if(o?.[t]!==void 0)return o[t];if(c.translations[t]!==void 0)return c.translations[t]}return{}}function mt(t){const s=t.__ref,n=t.tag||"div",c=t.context?.designSystem,f=[],o=Object.keys(t);for(let r=0;r<o.length;r++){const i=o[r];if(typeof t[i]!="function"||U.has(i))continue;const e=i.charCodeAt(0);e>=65&&e<=90||H(i)||P[i]||w&&w.has(i)||ft(n,i)||f.push({prop:i,fn:t[i]})}for(let r=0;r<f.length;r++){const{prop:i,fn:e}=f[r];s.__exec[i]=e,Object.defineProperty(t,i,{get(){c&&O(c);try{return e(t,t.state,t.context)}catch{return}finally{c&&L()}},set(a){delete s.__exec[i],Object.defineProperty(t,i,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function to(t,s){if(!(!Array.isArray(s)||s.length===0))for(let n=0;n<s.length;n++){const c=s[n];try{typeof c=="function"?c(t,t.state,t.context):typeof c=="string"&&t.state?.[c]}catch{}}}function E(t,s,n){return!Array.isArray(s)||s.length===0?n:function(...c){return to(t,s),n.apply(this,c)}}function X(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function Pt(t,s){const n=t.__ref,c=!!(s&&s.skipIfEffect);if(mt(t),typeof t.text=="function"){const o=t.text,r=E(t,t.textDeps,o),i=k(()=>{if(!n.contentManaged)try{let e=r(t,t.state,t.context);t.node&&e!=null&&typeof e!="function"&&typeof e!="object"&&(typeof e=="string"&&e.includes("{{")&&(e=it.call(t,e,t.state)),t.tag==="string"?t.node.nodeValue=e:t.node.textContent=e)}catch{}},{depth:n.path.length});n.__effects.push(i),n.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,r=k(()=>{if(n.contentManaged)return;const i=it.call(t,o,t.state);i!=null&&(t.text=i),t.node&&(t.tag==="string"?t.node.nodeValue=i??"":t.node.textContent=i??"")},{depth:n.path.length});n.__effects.push(r),n.__exec.text=o}for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!U.has(o)&&!H(o)&&!n.__exec[o]){if(P[o]){const r=t[o],i=E(t,t[o+"Deps"],r),e=o;let a;const d=k(()=>{const u=t.context?.designSystem;u&&O(u);try{const p=i(t,t.state,t.context),y=P[e](p,t,t.state,t.context);if(y&&t.node){const _=$t(y);(_===null||_!==a)&&(a=_,Y(t.node,y))}else t.node&&(e==="show"||e==="hide")&&(a=void 0,t.node.style.display="")}finally{u&&L()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=r}else if(w&&w.has(o)){const r=t[o],i=E(t,t[o+"Deps"],r),e=o;let a;const d=k(()=>{const u=t.context?.designSystem;u&&O(u);try{const p=i(t,t.state,t.context);if(t.node)if(p!=null){const y=e+":"+String(p);y!==a&&(a=y,Y(t.node,{[e]:p}))}else a=void 0,t.node.style[e]=""}finally{u&&L()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=r}}if(typeof t.html=="function"){const o=t.html,r=E(t,t.htmlDeps,o),i=k(()=>{const e=t.context?.designSystem;e&&O(e);try{const a=r(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&(t.node.innerHTML=a)}finally{e&&L()}},{depth:n.path.length});n.__effects.push(i),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,r=E(t,t.valueDeps,o),i=k(()=>{try{const e=r(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const a=e==null?"":String(e);if(t.node.value===a)return;const d=typeof document<"u"&&document.activeElement===t.node,u=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=a,d&&u!=null&&p!=null)try{t.node.setSelectionRange(u,p)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(i),n.__exec.value=o}if(typeof t.style=="function"){const o=t.style,r=E(t,t.styleDeps,o);let i;const e=k(()=>{const a=r(t,t.state,t.context),d=$t(a);(d===null||d!==i)&&(i=d,Y(t.node,a))},{depth:n.path.length});n.__effects.push(e),n.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const r=t.style[o];if(typeof r!="function")continue;const i=E(t,X(t.styleDeps,o),r);let e;const a=k(()=>{try{const d=i(t,t.state,t.context);if(t.node){const u=o+":"+String(d);u!==e&&(e=u,Y(t.node,{[o]:d}))}}catch{}},{depth:n.path.length});n.__effects.push(a)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const r=E(t,X(t.attrDeps,o),t.attr[o]),i=o,e=k(()=>{try{const a=r(t,t.state,t.context);t.node?.setAttribute&&(a==null||a===!1?t.node.removeAttribute(i):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(i,a===!0?"":a))}catch{}},{depth:n.path.length});n.__effects.push(e)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const r=E(t,X(t.ariaDeps,o),t.aria[o]),i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),e=k(()=>{try{const a=r(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(i):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(i,a===!0?"":a)}catch{}},{depth:n.path.length});n.__effects.push(e)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const r=E(t,X(t.dataDeps,o),t.data[o]),e="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),a=k(()=>{try{const d=r(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(e):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(e,d===!0?"":d)}catch{}},{depth:n.path.length});n.__effects.push(a)}const f=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(f)for(const o in f){if(typeof f[o]!="function")continue;const r=E(t,X(t.classDeps,o),f[o]),i=k(()=>{try{const e=r(t,t.state,t.context);if(!t.node?.classList)return;typeof e=="string"?t.node.classList.add(e):e?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:n.path.length});n.__effects.push(i)}!c&&typeof t.if=="function"&&Lt(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||U.has(o)||typeof t[o]!="function")continue;const r=o.charCodeAt(0);if(r>=65&&r<=90||H(o))continue;const i=t[o];n.__exec[o]=i;const e=t.tag||"div";if(ft(e,o)&&!P[o]&&!(w&&w.has(o))){const a=at(o)||o,d=E(t,t[o+"Deps"],i),u=k(()=>{try{const p=d(t,t.state,t.context);t.node?.setAttribute&&(p==null||p===!1?t.node.removeAttribute(a):typeof p!="function"&&typeof p!="object"&&(a==="src"&&"src"in t.node?t.node.src=p:t.node.setAttribute(a,p===!0?"":p)))}catch{}},{depth:n.path.length});n.__effects.push(u)}}if(no(t),ro(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,r=t.stateDeps;let i=!1,e=[];const a=k(()=>{const d=[];for(let _=0;_<r.length;_++){const l=r[_];try{d[_]=typeof l=="function"?l(t,t.state,t.context):t.state?.[l]}catch{d[_]=void 0}}if(!i){i=!0,e=d;return}let u=d.length!==e.length;for(let _=0;!u&&_<d.length;_++)d[_]!==e[_]&&(u=!0);const p=e;if(e=d,!u)return;const y=t.context?.designSystem;y&&O(y);try{o(t,t.state,t.context,{prev:p,next:d})}catch(_){if(t.context?.plugins?.length&&V("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{y&&L()}},{depth:n.path.length});n.__effects.push(a)}}function Ot(t){const s=t.parent,n=s?.node;if(!n||!t.node){It(t,t.parent);return}let c=null;const f=Object.keys(s),o=f.indexOf(t.key);for(let r=o+1;r<f.length;r++){const i=s[f[r]];if(i?.node?.parentNode===n){c=i.node;break}}c?n.insertBefore(t.node,c):n.appendChild(t.node)}function Lt(t,s,n){const c=E(t,t.ifDeps,n),f=k(()=>{let o;try{o=c(t,t.state,t.context)}catch(i){if(o=!1,s.__ifError=i,typeof console<"u"&&console.warn){const e=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${e} \u2014 treating as false:`,i?.message||i)}return}const r=s.__if;if(s.__if=!!o,r&&!s.__if&&t.node)t.node.remove();else if(!r&&s.__if)if(s.__ifInitialized)t.node||(t.node=rt(t)),t.node&&(t.node.ref=t),Ot(t),pt(t);else{if(s.__ifInitialized=!0,t.tag||(t.tag=At(t)),I("Init",t,{}),t.node||(t.node=rt(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"&&!s.__fragmentAnchor){const e=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(e),s.__fragmentAnchor=e}I("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ft(t,{}),Pt(t,{skipIfEffect:!0}),pt(t),Rt(t),Mt(t,{}),Ot(t),kt(t,{})}},{depth:s.path.length});s.__effects.push(f)}function pt(t){const{node:s}=t;if(s){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?s.nodeValue=t.text:s.textContent=t.text:typeof t.text=="number"&&(s.textContent=t.text),eo(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in s){const n=String(t.value);s.value!==n&&(s.value=n)}if(t.style&&typeof t.style=="object"&&Y(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const c=t.attr[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.setAttribute&&s.setAttribute(n,c===!0?"":c)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.dataset&&(s.dataset[n]=c===!0?"":c)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(c=>c&&s.classList.add(c));else if(typeof n=="object")for(const c in n){const f=typeof n[c]=="function"?n[c](t,t.state,t.context):n[c];f&&s.classList.add(typeof f=="string"?f:c)}}}}function $t(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Y(t,s){if(!t||!s||!t.style)return;let n=null;for(const c in s){const f=s[c];if(f!=null){if(c.charAt(0)==="&"&&typeof f=="object"){n||(n={}),n[c]=f;continue}try{const o=String(f),r=c.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),i=o.trim(),e=/\s*!important\s*$/.test(i),a=i.replace(/\s*!important\s*$/,"");t.style.setProperty(r,a,e?"important":"")}catch{}}}n&&so(t,n)}let oo=0;function so(t,s){const n=`_ds${oo++}`;t.classList.add(n);const c=t.ownerDocument;let f=c.querySelector("style[data-smbls-scoped]");f||(f=c.createElement("style"),f.setAttribute("data-smbls-scoped",""),c.head.appendChild(f));let o="";for(const r in s){const i="."+n,e=r.replace(/&/g,i).split(",").map(d=>{const u=d.trim();return u.includes(i)?u:i+u}).join(", "),a=s[r];if(typeof a=="object"){let d="",u="";for(const p in a){const y=a[p];if(typeof y=="object"){const _=p.includes("&")?e.split(", ").map(h=>p.replace(/&/g,h)).join(", "):e.split(", ").map(h=>`${h} ${p}`).join(", ");let l="";for(const h in y)l+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[h]};`;u+=Ct(`${_} { ${l} }`,_)+`
5
- `}else d+=`${p.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(o+=Ct(`${e} { ${d} }`,e)+`
6
- `),u&&(o+=u)}}o&&(f.textContent+=o)}function no(t){let s=t.subscribeTo;if(typeof s=="function")try{s=s(t,t.state,t.context)}catch{s=null}if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let c=0;c<s.length;c++){const f=s[c];if(typeof f!="string"||f.length===0)continue;const o=f.split("."),r=o[0],i=o.slice(1),e={value:!1},a=k(()=>{const d=t.state&&(K(t.state)?t.state.root:null);if(!d||!K(d))return;let u=d;u=u[r];for(let y=0;y<i.length&&!(u==null||typeof u!="object");y++)if(K(u))u=u[i[y]];else break;if(!e.value)return;let p=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&O(y);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(p=!0)}catch(_){t.context?.plugins?.length&&V("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&L()}}if(!p&&t.node&&n.__effects)for(let y=0;y<n.__effects.length;y++){const _=n.__effects[y];_&&_!==a&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!p&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&O(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&V("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&L()}}},{depth:n.path.length});e.value=!0,a._isSubscribeToEffect=!0,n.__effects.push(a)}}function lt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}const Dt=new Set;function co(t,s){const n=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",c=n+"::"+t;Dt.has(c)||(Dt.add(c),console.warn(`[smbls/css] "${t}" at ${n} 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 G(t,s,n){const c={},f=new Set,o=(r,i,e)=>{const a=e?new Set(Object.keys(c)):null;if(P[r]){const d=P[r](i,s,s.state,s.context);if(d){const u=Array.isArray(d)?d:[d];for(const p of u)p&&Object.assign(c,p)}}else c[r]=i;if(e)for(const d in c)a.has(d)||f.add(d)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let p=i[u];if(typeof p=="function"&&(p=p(s,s.state,s.context)),p==null||typeof p=="function")continue;const y=typeof s[u]=="function"&&(P[u]||w&&w.has(u));o(u,p,y)}continue}if(lt(r,s)){const u=G(i,s,!0);Object.keys(u).length&&(c[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){vt()&&co(r,s);continue}let a=r;if(r.charCodeAt(0)===64&&!r.startsWith("@media")&&!r.startsWith("@keyframes")){const u=s.context?.designSystem?.media?.[r.slice(1)];u&&(a=`@media ${u}`)}const d=G(i,s,!1);Object.keys(d).length&&(c[a]=d);continue}const e=typeof s[r]=="function"&&(P[r]||w&&w.has(r));o(r,i,e)}if(n)for(const r in c)f.add(r);for(const r of f){const i=c[r];typeof i=="string"&&!i.includes("!important")&&(c[r]=i+" !important")}return c}function ro(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;const f=c.charAt(0);if(f!=="."&&f!=="!")continue;const o=c.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const u=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${c}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${f}\` is read as one prop name. Nest the selector inside instead: \`${f}${u}: { '${o.slice(u.length)}': {...} }\`.`)}continue}const r=t[c];if(!r||typeof r!="object")continue;const i=f==="!",e={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{if(!t.node)return;let u;const p=t[o];if(p===void 0)if(t.state&&o in t.state)u=t.state[o];else{const l=t.context?.cases?.[o];if(l===void 0)return;try{u=typeof l=="function"?l.call(t,t):l}catch(h){u=!1,s.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof p=="function")try{u=p(t,t.state,t.context)}catch(l){u=!1,s.__conditionalError=l,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,l?.message||l)}else u=p;const y=i?!u:!!u;if(y===e.lastMatch)return;e.lastMatch=y;const _=t.context?.designSystem;_&&O(_);try{if(y){const l={},h={};let g=!1;for(const b in r){if(!Object.prototype.hasOwnProperty.call(r,b))continue;const x=r[b],S=b.charAt(0);if((S===":"||S==="@"||S==="&")&&x&&typeof x=="object"&&!Array.isArray(x)){if(lt(b,t)){const $=G(x,t,!0);Object.keys($).length&&(h[`[data-theme="${b.slice(1)}"] &`]=$,g=!0)}else{let $=b;if(S==="@"&&!b.startsWith("@media")&&!b.startsWith("@keyframes")){const T=t.context?.designSystem?.media?.[b.slice(1)];T&&($=`@media ${T}`)}const W=G(x,t,!1);Object.keys(W).length&&(h[$]=W,g=!0)}continue}const N=typeof x=="function"?x(t,t.state,t.context):x;if(N!=null)if(P[b]){const $=P[b](N,t,t.state,t.context);if($){const W=Array.isArray($)?$:[$];for(const T of W)T&&Object.assign(l,T)}}else w&&w.has(b)&&(l[b]=N)}const C=Object.keys(l);if(C.length){Y(t.node,l);for(const b of C)n.set(b,c);e.appliedKeys=C}else e.appliedKeys=null;if(g){const b=et(h,null,t.context?.cssPrefix),x=b?b.split(" ").filter(Boolean):[];if(x.length&&t.node.classList){for(const S of x)t.node.classList.add(S);e.appliedClasses=x}else e.appliedClasses=null}else if(e.appliedClasses){for(const b of e.appliedClasses)t.node.classList.remove(b);e.appliedClasses=null}}else{if(e.appliedKeys){for(const l of e.appliedKeys)n.get(l)===c&&(t.node.style[l]="",n.delete(l));e.appliedKeys=null}if(e.appliedClasses){for(const l of e.appliedClasses)t.node.classList.remove(l);e.appliedClasses=null}}}finally{_&&L()}};s.__conditionalRunners.push(a);const d=k(a,{depth:s.path.length});s.__effects.push(d)}}const yt=new WeakSet;function io(t){const s=t.ownerDocument;!s||yt.has(s)||(yt.add(s),queueMicrotask(()=>{yt.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const ht=new WeakSet;let Tt=!1;function eo(t){const{node:s}=t;if(!s)return;if(Tt||(Tt=!0,et({display:"none"})),ht.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}ht.add(t);const n=t.context?.designSystem;n&&O(n);try{const c={};let f=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||U.has(o))continue;const r=o.charCodeAt(0);if(!(r>=65&&r<=90)&&!H(o)){if(P[o]){const i=t[o],e=P[o](i,t,t.state,t.context);if(e){if(Array.isArray(e))for(const a of e)a&&Object.assign(c,a);else Object.assign(c,e);f=!0}}else if(w&&w.has(o)){const i=t[o];i!=null&&typeof i!="object"&&(c[o]=i,f=!0)}else if(o.charCodeAt(0)===45){const i=t[o];i!=null&&typeof i!="object"&&(c[o]=i,f=!0)}else if(o.charAt(0)==="&"){const i=t[o];i&&typeof i=="object"&&(c[o]=i,f=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const i=t[o];if(i&&typeof i=="object"){if(lt(o,t)){const e=G(i,t,!0);Object.keys(e).length&&(c[`[data-theme="${o.slice(1)}"] &`]=e,f=!0)}else{let e=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const d=t.context?.designSystem?.media?.[o.slice(1)];d&&(e=`@media ${d}`)}const a=G(i,t,!1);Object.keys(a).length&&(c[e]=a,f=!0)}f=!0}}}}if(f){c.display&&String(c.display).includes("!important")&&(s.style.setProperty("display",String(c.display).replace(/\s*!important\s*$/,""),"important"),delete c.display);const o=et(c,null,t.context?.cssPrefix);if(o&&s.classList){const i=o.split(" ").filter(Boolean);let e=!1;for(const a of i)s.classList.add(a),e||(a.charCodeAt(0)===95&&a.charCodeAt(1)===99||a.charCodeAt(0)===95&&a.indexOf("_c",1)!==-1)&&(e=!0);e&&io(s)}const r=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(r!=null){const i=c.display;if(i&&i!==r)if(r==="none"){const e=[];for(const a of s.classList)a.startsWith("_d-")&&a!=="_d-none"&&e.push(a);for(const a of e)s.classList.remove(a);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&L(),ht.delete(t)}}function Rt(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const f in t.aria){const o=t.aria[f];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const r="aria-"+f.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.setAttribute(r,o===!0?"":o)}const n=zt(t);for(const f in n){const o=n[f];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(f,o===!0?"":o)}const c=t.tag||"div";for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f)||typeof t[f]=="function"||U.has(f)||f==="on"||n[f]!==void 0)continue;const o=f.charCodeAt(0);if(!(o>=65&&o<=90)&&!H(f)&&!(P[f]||w&&w.has(f))&&ft(c,f)){let r=t[f];if(r==null||(typeof r=="string"&&r.includes("{{")&&(r=it(r,t,t.state,t.context),t[f]=r),r==null||typeof r=="function"||typeof r=="object")||r===!1&&!Gt(at(f)||f))continue;const i=at(f)||f;s.setAttribute(i,Yt(i,r))}}}function fo(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,c=n&&typeof n=="object"&&n.max?String(n.max):null;c&&(s.style.maxHeight=c);const f=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};f(),s.addEventListener("input",f),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",f)}catch{}})}const Nt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ft(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!H(n)||Nt.has(n))continue;let c=t[n];if(typeof c=="string"&&/^[A-Za-z_$][\w$]*$/.test(c)){const o=c;c=function(i){return t.call(o,i)}}if(typeof c!="function")continue;const f=Qt(n);Vt.has(f)||Wt(Xt(f),t,c)}ao(t)}function ao(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let c=!1;for(const p of Nt){const y=t[p];typeof y=="function"&&(n[p]=y,c=!0)}if(!c)return;const f=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,i=0,e=0,a=!1;const d=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,i=y.clientY,e=Date.now(),a=!0)},u=p=>{if(!a)return;a=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const _=y.clientX-r,l=y.clientY-i,h=Date.now()-e;if(h>o)return;const g=Math.abs(_),C=Math.abs(l);if(Math.max(g,C)<f)return;let b;if(g>C*1.2)b=_<0?"left":"right";else if(C>g*1.2)b=l<0?"up":"down";else return;const x="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),S=n[x],N=n.onSwipe;S&&S.call(t,p,t,t.state,t.context),N&&N.call(t,{direction:b,dx:_,dy:l,dt:h,event:p},t,t.state,t.context)};s.addEventListener("touchstart",d,{passive:!0}),s.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",d)}catch{}try{s.removeEventListener("touchend",u)}catch{}})}function tt(t,s){const n={...t};for(const c in s){const f=n[c],o=s[c];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[c]=tt(f,o):n[c]=o}return n}function _t(t,s,n){if(!s||!t.node)return;const c=t.childExtends;if(Array.isArray(s)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,r=f?null:o?.createDocumentFragment();if(!f&&!r)return;const i=t.childProps,e=t.childrenAs;for(let a=0;a<s.length;a++){let d=s[a];const u=d;(typeof d=="string"||typeof d=="number")&&(d={text:d});let p=i;if(typeof i=="function")try{p=i(t,d)}catch{p=null}if(e==="state"){let l=u;(typeof u=="string"||typeof u=="number")&&(l={value:u,text:u}),d=p?{...p,state:l}:{state:l}}else p&&(d=tt(p,d));if(c&&!d.ignoreChildExtends)if(d.extends){const l=Array.isArray(d.extends)?d.extends:[d.extends],h=Array.isArray(c)?c:[c];d={...d,extends:[...h,...l]}}else d={...d,extends:c};const y=d?.key||u&&typeof u=="object"&&u.key||`${a}`;let _;try{_=z(d,t,y,n)}catch(l){if(typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y}" failed to construct at ${h} (initial render, skipping this row):`,l?.message||l)}continue}!f&&_?.node&&r.appendChild(_.node)}f||t.node.appendChild(r);return}if(typeof s=="string"){const f=Et(s,t);if(Array.isArray(f)){_t(t,f,n);return}}if(typeof s=="object")for(const f in s){if(U.has(f))continue;let o=s[f];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=tt(t.childProps,o)),c&&!o.ignoreChildExtends)if(o.extends){const r=Array.isArray(o.extends)?o.extends:[o.extends],i=Array.isArray(c)?c:[c];o={...o,extends:[...i,...r]}}else o={...o,extends:c};z(o,t,f,n)}}}function gt(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const c=n.options;if(!c||!c.length)return;const f=t.__ref,o=f&&f.__exec&&f.__exec.value,r=typeof o=="function",i=t.value!=null&&typeof t.value!="function";if(r||i){let d;if(r)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const u=d==null?"":String(d);n.value!==u&&(n.value=u);return}const e=s||!(f&&f.__selectSynced);if(f&&(f.__selectSynced=!0),!e)return;let a=-1;for(let d=0;d<c.length;d++)c[d].defaultSelected&&(a=d);a>=0&&n.selectedIndex!==a&&(n.selectedIndex=a)}function Mt(t,s){let{children:n,content:c}=t;const f=t.childExtends;if(typeof n=="function"){const r=n;try{n=r(t,t.state,t.context)}catch(u){if(n=void 0,typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,u?.message||u)}}t.children=n;const i=t.__ref;let e=!1;const a=E(t,t.childrenDeps,r),d=k(()=>{const u=e;e=!0;let p;try{p=a(t,t.state,t.context)}catch(x){if(typeof console<"u"&&console.error){const S=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${S}${u?"":" (initial tracking run)"}:`,x?.message||x)}return}if(!u||p===t.children)return;t.children=p;const y=typeof t.onContentUpdate=="function",_=y?[]:null,l=y?[]:null,h=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const x=t.childProps,S=[],N=new Map;for(let A=0;A<p.length;A++){const D=p[A];let v=x;if(typeof x=="function")try{v=x(t,D)}catch{v=null}const F=v&&v.key||D&&D.key||`${A}`;S.push(F),N.set(F,{rawChild:D,childProps:v})}const $=new Set(S),W=i.__children.slice();for(const A of W)if(!$.has(A)){const D=t[A];D?.remove&&D.remove(),delete t[A],l&&l.push(A)}const T=t.childExtends,J=t.tag==="fragment",Kt=t.context?.document||globalThis.document,Z=J?null:Kt?.createDocumentFragment(),ot=new Set;for(const A of S){const D=N.get(A),v=D.rawChild,F=t[A];if(F&&F.state){if(v&&typeof v=="object"){const j=F.state,B=j.$replace||j.replace,xt=j.$update||j.update;if(typeof B=="function")B.call(j,v);else if(typeof xt=="function"){for(const M in j)if(!(M==="__element"||M==="root"||M==="parent"||M==="update")&&!Object.prototype.hasOwnProperty.call(v,M))try{j[M]=void 0}catch{}xt.call(j,v)}else for(const M in v)j[M]=v[M]}h&&h.push(A);continue}let st=v;(typeof v=="string"||typeof v=="number")&&(st={value:v,text:v});const bt=D.childProps;let R=bt?{...bt,state:st}:{state:st};if(T&&!R.ignoreChildExtends)if(R.extends){const j=Array.isArray(R.extends)?R.extends:[R.extends],B=Array.isArray(T)?T:[T];R={...R,extends:[...B,...j]}}else R={...R,extends:T};let nt;try{nt=z(R,t,A,s)}catch(j){if(typeof console<"u"&&console.error){const B=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to construct at ${B} (reconcile, skipping this row):`,j?.message||j)}ot.add(A);continue}!J&&nt?.node&&Z&&Z.appendChild(nt.node),_&&_.push(A)}if(!J&&Z&&Z.childNodes.length&&t.node&&t.node.appendChild(Z),!J&&t.node){let A=null;for(const D of S){const v=t[D]?.node;if(!v)continue;const F=A?A.nextSibling:t.node.firstChild;v!==F&&t.node.insertBefore(v,F),A=v}}i.__children=ot.size?S.filter(A=>!ot.has(A)):S,y&&(_.length||l.length)&&wt(t,{added:_,removed:l,kept:h}),gt(t,!1);return}const b=y?[...i.__children]:null;for(const x of[...i.__children]){const S=t[x];S?.remove&&S.remove(),delete t[x]}i.__children=[],_t(t,p,s),gt(t,!1),y&&wt(t,{added:[...i.__children],removed:b,kept:[]})},{depth:i.path.length});i.__effects.push(d)}if(_t(t,n||c,s),n||c)return;const o=t.context?.components||{};{const r=Object.keys(t);for(let i=0;i<r.length;i++){const e=r[i];if(!e.endsWith("Extends")||typeof t[e]!="string")continue;const a=e.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const d={extends:t[e]};delete t[e];for(let u=i+1;u<r.length;u++){const p=r[u],y=p.charCodeAt(0);if(y>=65&&y<=90||U.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const _=t[p];_!==void 0&&(d[p]=_,delete t[p])}t[a]&&typeof t[a]=="object"?t[a]={...d,...t[a]}:t[a]=d}}for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||U.has(r)||typeof t[r]!="object"||t[r]===null)continue;const i=r.charCodeAt(0);if(i<65||i>90)continue;let e=t[r];if(!e.__ref){if(!e.extends&&!e.extend){const a=o[r]||o[`smbls.${r}`];a&&(e={...e,extends:a})}if(t.childProps&&(e=tt(t.childProps,e)),f&&!e.ignoreChildExtends)if(e.extends){const a=Array.isArray(e.extends)?e.extends:[e.extends],d=Array.isArray(f)?f:[f];e={...e,extends:[...d,...a]}}else e={...e,extends:f};z(e,t,r,s)}}}function It(t,s,n){const{node:c}=t;if(!c)return;c.ref=t;const f=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(f){const r=f.parentNode;if(r){if(n?.position==="before"&&n.node)r.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;r.insertBefore(c,i||f)}else r.insertBefore(c,f);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const r=n.node.nextSibling;r?o.insertBefore(c,r):o.appendChild(c)}else o.appendChild(c)}function I(t,s,n){const c=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&V(c,s,n);const f="on"+t,o=s[f];if(typeof o=="function"){const r=t==="Render"||t==="RenderRouter";if(r){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const i=s.context?.designSystem;i&&O(i);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(e){if(s.context?.plugins?.length&&V("error",s,{hook:f,error:e})||console.error(`[DOMQL] Lifecycle "${f}" error:`,e),s.context?.strictMode)throw e}finally{i&&L(),r&&(s.__ref.__inRender=!1)}}return!0}var $o=z;export{z as create,$o as default,St as flushMounts};
4
+ `):"")}}if(bt(o,!0),Kt(o,s,a),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const u=o.context?.designSystem;u&&$(u);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{u&&D()}}if(M("Create",o,c),M("Complete",o,c),M("Render",o,c),M("RenderRouter",o,c),wt(o,c),typeof o.onFrame=="function"){const u=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&$(h);try{u(o,o.state,o.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{h&&D()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function mt(t,s,n){const c=!s,a=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=c&&a&&t.context?.state,i=n.state!==void 0&&!o?n.state:t.state&&!I(t.state)?t.state:void 0;if(i==null){if(s?.state)t.state=s.state,Q(t,t.state);else if(t.context?.state){const r=t.context.state,e={...r},f=t.context?.polyglot;if(f?.translations){const d=r.lang||f.defaultLang||"en",p=f.translations[d];if(p&&typeof p=="object")for(const l in p)e[l]===void 0&&(e[l]=p[l]);const y=new Set(f.languages||[]);for(const l in f.translations)!y.has(l)&&e[l]===void 0&&(e[l]=f.translations[l])}t.state=I(e)?e:rt(e),t.state.__element=t,t.state.root=t.state,Q(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Q(t,t.state);return}if(typeof i=="string"){if(t.state=Pt(i,s),t.state&&typeof t.state=="object"&&!I(t.state)){const r=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:r,enumerable:!1,configurable:!0,writable:!0})}Q(t,t.state);return}if(typeof i=="function"){const r=i(t,s?.state);t.state=I(r)?r:rt(r||{})}else I(i)?t.state=i:t.state=rt({...i});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,Q(t,t.state)}function pt(t,s){if(!s)return t;const n=s.split("/");let c=t;for(const a of n){if(c==null)return{};c=c[a]}return c??{}}function Pt(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const a=t.slice(3);return a?pt(s.state,a):s.state??{}}if(t.startsWith("~/")){const a=s.state?.root||s.state,o=t.slice(2);return o?pt(a,o):a??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=pt(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const c=s.context?.polyglot;if(c?.translations){const a=s.state?.root?.lang||c.defaultLang||"en",o=c.translations[a];if(o?.[t]!==void 0)return o[t];if(c.translations[t]!==void 0)return c.translations[t]}return{}}function to(t){const s=t.__ref,n=t.tag||"div",c=t.context?.designSystem,a=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const r=o[i];if(typeof t[r]!="function"||K.has(r))continue;const e=r.charCodeAt(0);e>=65&&e<=90||H(r)||E[r]||j&&j.has(r)||ft(n,r)||a.push({prop:r,fn:t[r]})}for(let i=0;i<a.length;i++){const{prop:r,fn:e}=a[i];s.__exec[r]=e,Object.defineProperty(t,r,{get(){c&&$(c);try{return e(t,t.state,t.context)}catch{return}finally{c&&D()}},set(f){delete s.__exec[r],Object.defineProperty(t,r,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function oo(t,s){if(!(!Array.isArray(s)||s.length===0))for(let n=0;n<s.length;n++){const c=s[n];try{typeof c=="function"?c(t,t.state,t.context):typeof c=="string"&&t.state?.[c]}catch{}}}function O(t,s,n){return!Array.isArray(s)||s.length===0?n:function(...c){return oo(t,s),n.apply(this,c)}}function J(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function Ot(t,s){const n=t.__ref,c=!!(s&&s.skipIfEffect);if(to(t),typeof t.text=="function"){const o=t.text,i=O(t,t.textDeps,o),r=k(()=>{if(!n.contentManaged)try{let e=i(t,t.state,t.context);t.node&&e!=null&&typeof e!="function"&&typeof e!="object"&&(typeof e=="string"&&e.includes("{{")&&(e=et.call(t,e,t.state)),t.tag==="string"?t.node.nodeValue=e:t.node.textContent=e)}catch{}},{depth:n.path.length});n.__effects.push(r),n.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,i=k(()=>{if(n.contentManaged)return;const r=et.call(t,o,t.state);r!=null&&(t.text=r),t.node&&(t.tag==="string"?t.node.nodeValue=r??"":t.node.textContent=r??"")},{depth:n.path.length});n.__effects.push(i),n.__exec.text=o}for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!K.has(o)&&!H(o)&&!n.__exec[o]){if(E[o]){const i=t[o],r=O(t,t[o+"Deps"],i),e=o;let f;const d=k(()=>{const p=t.context?.designSystem;p&&$(p);try{const y=r(t,t.state,t.context),l=E[e](y,t,t.state,t.context);if(l&&t.node){const _=Dt(l);(_===null||_!==f)&&(f=_,Y(t.node,l))}else t.node&&(e==="show"||e==="hide")&&(f=void 0,t.node.style.display="")}finally{p&&D()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=i}else if(j&&j.has(o)){const i=t[o],r=O(t,t[o+"Deps"],i),e=o;let f;const d=k(()=>{const p=t.context?.designSystem;p&&$(p);try{const y=r(t,t.state,t.context);if(t.node)if(y!=null){const l=e+":"+String(y);l!==f&&(f=l,Y(t.node,{[e]:y}))}else f=void 0,t.node.style[e]=""}finally{p&&D()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=O(t,t.htmlDeps,o),r=k(()=>{const e=t.context?.designSystem;e&&$(e);try{const f=i(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&(t.node.innerHTML=f)}finally{e&&D()}},{depth:n.path.length});n.__effects.push(r),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=O(t,t.valueDeps,o),r=k(()=>{try{const e=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const f=e==null?"":String(e);if(t.node.value===f)return;const d=typeof document<"u"&&document.activeElement===t.node,p=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,y=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=f,d&&p!=null&&y!=null)try{t.node.setSelectionRange(p,y)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(r),n.__exec.value=o}if(typeof t.style=="function"){const o=t.style,i=O(t,t.styleDeps,o);let r;const e=k(()=>{const f=i(t,t.state,t.context),d=Dt(f);(d===null||d!==r)&&(r=d,Y(t.node,f))},{depth:n.path.length});n.__effects.push(e),n.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const i=t.style[o];if(typeof i!="function")continue;const r=O(t,J(t.styleDeps,o),i);let e;const f=k(()=>{try{const d=r(t,t.state,t.context);if(t.node){const p=o+":"+String(d);p!==e&&(e=p,Y(t.node,{[o]:d}))}}catch{}},{depth:n.path.length});n.__effects.push(f)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=O(t,J(t.attrDeps,o),t.attr[o]),r=o,e=k(()=>{try{const f=i(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1?t.node.removeAttribute(r):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(r,f===!0?"":f))}catch{}},{depth:n.path.length});n.__effects.push(e)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const i=O(t,J(t.ariaDeps,o),t.aria[o]),r="aria-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),e=k(()=>{try{const f=i(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(r):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(r,f===!0?"":f)}catch{}},{depth:n.path.length});n.__effects.push(e)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const i=O(t,J(t.dataDeps,o),t.data[o]),e="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),f=k(()=>{try{const d=i(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(e):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(e,d===!0?"":d)}catch{}},{depth:n.path.length});n.__effects.push(f)}const a=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(a)for(const o in a){if(typeof a[o]!="function")continue;const i=O(t,J(t.classDeps,o),a[o]),r=k(()=>{try{const e=i(t,t.state,t.context);if(!t.node?.classList)return;typeof e=="string"?t.node.classList.add(e):e?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:n.path.length});n.__effects.push(r)}!c&&typeof t.if=="function"&&$t(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||K.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||H(o))continue;const r=t[o];n.__exec[o]=r;const e=t.tag||"div";if(ft(e,o)&&!E[o]&&!(j&&j.has(o))){const f=dt(o)||o,d=O(t,t[o+"Deps"],r),p=k(()=>{try{const y=d(t,t.state,t.context);t.node?.setAttribute&&(y==null||y===!1?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&(f==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(f,y===!0?"":y)))}catch{}},{depth:n.path.length});n.__effects.push(p)}}if(co(t),io(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let r=!1,e=[];const f=k(()=>{const d=[];for(let _=0;_<i.length;_++){const u=i[_];try{d[_]=typeof u=="function"?u(t,t.state,t.context):t.state?.[u]}catch{d[_]=void 0}}if(!r){r=!0,e=d;return}let p=d.length!==e.length;for(let _=0;!p&&_<d.length;_++)d[_]!==e[_]&&(p=!0);const y=e;if(e=d,!p)return;const l=t.context?.designSystem;l&&$(l);try{o(t,t.state,t.context,{prev:y,next:d})}catch(_){if(t.context?.plugins?.length&&V("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{l&&D()}},{depth:n.path.length});n.__effects.push(f)}}function Lt(t){const s=t.parent,n=s?.node;if(!n||!t.node){Kt(t,t.parent);return}let c=null;const a=Object.keys(s),o=a.indexOf(t.key);for(let i=o+1;i<a.length;i++){const r=s[a[i]];if(r?.node?.parentNode===n){c=r.node;break}}c?n.insertBefore(t.node,c):n.appendChild(t.node)}function $t(t,s,n){const c=O(t,t.ifDeps,n),a=k(()=>{let o;try{o=c(t,t.state,t.context)}catch(r){if(o=!1,s.__ifError=r,typeof console<"u"&&console.warn){const e=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${e} \u2014 treating as false:`,r?.message||r)}return}const i=s.__if;if(s.__if=!!o,i&&!s.__if&&t.node)t.node.remove();else if(!i&&s.__if)if(s.__ifInitialized)t.node||(t.node=it(t)),t.node&&(t.node.ref=t),Lt(t),lt(t);else{if(s.__ifInitialized=!0,t.tag||(t.tag=vt(t)),M("Init",t,{}),t.node||(t.node=it(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"&&!s.__fragmentAnchor){const e=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(e),s.__fragmentAnchor=e}M("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Mt(t,{}),Ot(t,{skipIfEffect:!0}),lt(t),Nt(t),It(t,{}),Lt(t),wt(t,{})}},{depth:s.path.length});s.__effects.push(a)}function lt(t){const{node:s}=t;if(s){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?s.nodeValue=t.text:s.textContent=t.text:typeof t.text=="number"&&(s.textContent=t.text),ao(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in s){const n=String(t.value);s.value!==n&&(s.value=n)}if(t.style&&typeof t.style=="object"&&Y(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const c=t.attr[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.setAttribute&&s.setAttribute(n,c===!0?"":c)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.dataset&&(s.dataset[n]=c===!0?"":c)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(c=>c&&s.classList.add(c));else if(typeof n=="object")for(const c in n){const a=typeof n[c]=="function"?n[c](t,t.state,t.context):n[c];a&&s.classList.add(typeof a=="string"?a:c)}}}}function Dt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Y(t,s){if(!t||!s||!t.style)return;let n=null;for(const c in s){const a=s[c];if(a!=null){if(c.charAt(0)==="&"&&typeof a=="object"){n||(n={}),n[c]=a;continue}try{const o=String(a),i=c.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),r=o.trim(),e=/\s*!important\s*$/.test(r),f=r.replace(/\s*!important\s*$/,"");t.style.setProperty(i,f,e?"important":"")}catch{}}}n&&no(t,n)}let so=0;function no(t,s){const n=`_ds${so++}`;t.classList.add(n);const c=t.ownerDocument;let a=c.querySelector("style[data-smbls-scoped]");a||(a=c.createElement("style"),a.setAttribute("data-smbls-scoped",""),c.head.appendChild(a));let o="";for(const i in s){const r="."+n,e=i.replace(/&/g,r).split(",").map(d=>{const p=d.trim();return p.includes(r)?p:r+p}).join(", "),f=s[i];if(typeof f=="object"){let d="",p="";for(const y in f){const l=f[y];if(typeof l=="object"){const _=y.includes("&")?e.split(", ").map(h=>y.replace(/&/g,h)).join(", "):e.split(", ").map(h=>`${h} ${y}`).join(", ");let u="";for(const h in l)u+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${l[h]};`;p+=St(`${_} { ${u} }`,_)+`
5
+ `}else d+=`${y.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${l};`}d&&(o+=St(`${e} { ${d} }`,e)+`
6
+ `),p&&(o+=p)}}o&&(a.textContent+=o)}function co(t){let s=t.subscribeTo;if(typeof s=="function")try{s=s(t,t.state,t.context)}catch{s=null}if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let c=0;c<s.length;c++){const a=s[c];if(typeof a!="string"||a.length===0)continue;const o=a.split("."),i=o[0],r=o.slice(1),e={value:!1},f=k(()=>{const d=t.state&&(I(t.state)?t.state.root:null);if(!d||!I(d))return;let p=d;p=p[i];for(let l=0;l<r.length&&!(p==null||typeof p!="object");l++)if(I(p))p=p[r[l]];else break;if(!e.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const l=t.context?.designSystem;l&&$(l);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(y=!0)}catch(_){t.context?.plugins?.length&&V("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{l&&D()}}if(!y&&t.node&&n.__effects)for(let l=0;l<n.__effects.length;l++){const _=n.__effects[l];_&&_!==f&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!y&&typeof t.onUpdate=="function"){const l=t.context?.designSystem;l&&$(l);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&V("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{l&&D()}}},{depth:n.path.length});e.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function yt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}const Tt=new Set;function ro(t,s){const n=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",c=n+"::"+t;Tt.has(c)||(Tt.add(c),console.warn(`[smbls/css] "${t}" at ${n} 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 G(t,s,n){const c={},a=new Set,o=(i,r,e)=>{const f=e?new Set(Object.keys(c)):null;if(E[i]){const d=E[i](r,s,s.state,s.context);if(d){const p=Array.isArray(d)?d:[d];for(const y of p)y&&Object.assign(c,y)}}else c[i]=r;if(e)for(const d in c)f.has(d)||a.add(d)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let r=t[i];if(typeof r=="function"&&(r=r(s,s.state,s.context)),r==null||typeof r=="function")continue;if(typeof r=="object"&&!Array.isArray(r)){if(i==="style"){for(const p in r){let y=r[p];if(typeof y=="function"&&(y=y(s,s.state,s.context)),y==null||typeof y=="function")continue;const l=typeof s[p]=="function"&&(E[p]||j&&j.has(p));o(p,y,l)}continue}if(yt(i,s)){const p=G(r,s,!0);Object.keys(p).length&&(c[`[data-theme="${i.slice(1)}"] &`]=p);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){Ct()&&ro(i,s);continue}let f=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){const p=s.context?.designSystem?.media?.[i.slice(1)];p&&(f=`@media ${p}`)}const d=G(r,s,!1);Object.keys(d).length&&(c[f]=d);continue}const e=typeof s[i]=="function"&&(E[i]||j&&j.has(i));o(i,r,e)}if(n)for(const i in c)a.add(i);for(const i of a){const r=c[i];typeof r=="string"&&!r.includes("!important")&&(c[i]=r+" !important")}return c}function io(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;const a=c.charAt(0);if(a!=="."&&a!=="!")continue;const o=c.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const p=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${c}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${a}\` is read as one prop name. Nest the selector inside instead: \`${a}${p}: { '${o.slice(p.length)}': {...} }\`.`)}continue}const i=t[c];if(!i||typeof i!="object")continue;const r=a==="!",e={lastMatch:!1,appliedKeys:null,appliedClasses:null},f=()=>{let p;const y=t[o];if(y===void 0){const u=!!t.state&&o in t.state,h=t.state?t.state[o]:void 0;if(u||h!==void 0)p=h;else{const g=t.context?.cases?.[o];if(g===void 0)return;try{p=typeof g=="function"?g.call(t,t):g}catch(x){p=!1,s.__conditionalError=x,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,x?.message||x)}}}else if(typeof y=="function")try{p=y(t,t.state,t.context)}catch(u){p=!1,s.__conditionalError=u,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,u?.message||u)}else p=y;const l=r?!p:!!p;if(!t.node||l===e.lastMatch)return;e.lastMatch=l;const _=t.context?.designSystem;_&&$(_);try{if(l){const u={},h={};let g=!1;for(const b in i){if(!Object.prototype.hasOwnProperty.call(i,b))continue;const w=i[b],C=b.charAt(0);if((C===":"||C==="@"||C==="&")&&w&&typeof w=="object"&&!Array.isArray(w)){if(yt(b,t)){const L=G(w,t,!0);Object.keys(L).length&&(h[`[data-theme="${b.slice(1)}"] &`]=L,g=!0)}else{let L=b;if(C==="@"&&!b.startsWith("@media")&&!b.startsWith("@keyframes")){const U=t.context?.designSystem?.media?.[b.slice(1)];U&&(L=`@media ${U}`)}const W=G(w,t,!1);Object.keys(W).length&&(h[L]=W,g=!0)}continue}const S=typeof w=="function"?w(t,t.state,t.context):w;if(S!=null)if(E[b]){const L=E[b](S,t,t.state,t.context);if(L){const W=Array.isArray(L)?L:[L];for(const U of W)U&&Object.assign(u,U)}}else j&&j.has(b)&&(u[b]=S)}const x=Object.keys(u);if(x.length){Y(t.node,u);for(const b of x)n.set(b,c);e.appliedKeys=x}else e.appliedKeys=null;if(g){const b=at(h,null,t.context?.cssPrefix),w=b?b.split(" ").filter(Boolean):[];if(w.length&&t.node.classList){for(const C of w)t.node.classList.add(C);e.appliedClasses=w}else e.appliedClasses=null}else if(e.appliedClasses){for(const b of e.appliedClasses)t.node.classList.remove(b);e.appliedClasses=null}}else{if(e.appliedKeys){for(const u of e.appliedKeys)n.get(u)===c&&(t.node.style[u]="",n.delete(u));e.appliedKeys=null}if(e.appliedClasses){for(const u of e.appliedClasses)t.node.classList.remove(u);e.appliedClasses=null}}}finally{_&&D()}};s.__conditionalRunners.push(f);const d=k(f,{depth:s.path.length});s.__effects.push(d)}}const ht=new WeakSet;function eo(t){const s=t.ownerDocument;!s||ht.has(s)||(ht.add(s),queueMicrotask(()=>{ht.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const _t=new WeakSet;let Rt=!1;function ao(t){const{node:s}=t;if(!s)return;if(Rt||(Rt=!0,at({display:"none"})),_t.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}_t.add(t);const n=t.context?.designSystem;n&&$(n);try{const c={};let a=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&E.theme){const o=E.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(const i of o)i&&Object.assign(c,i);else Object.assign(c,o);a=!0}}for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||K.has(o)||o==="theme")continue;const i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!H(o)){if(E[o]){const r=t[o],e=E[o](r,t,t.state,t.context);if(e){if(Array.isArray(e))for(const f of e)f&&Object.assign(c,f);else Object.assign(c,e);a=!0}}else if(j&&j.has(o)){const r=t[o];r!=null&&typeof r!="object"&&(c[o]=r,a=!0)}else if(o.charCodeAt(0)===45){const r=t[o];r!=null&&typeof r!="object"&&(c[o]=r,a=!0)}else if(o.charAt(0)==="&"){const r=t[o];r&&typeof r=="object"&&(c[o]=r,a=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const r=t[o];if(r&&typeof r=="object"){if(yt(o,t)){const e=G(r,t,!0);Object.keys(e).length&&(c[`[data-theme="${o.slice(1)}"] &`]=e,a=!0)}else{let e=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const d=t.context?.designSystem?.media?.[o.slice(1)];d&&(e=`@media ${d}`)}const f=G(r,t,!1);Object.keys(f).length&&(c[e]=f,a=!0)}a=!0}}}}if(a){c.display&&String(c.display).includes("!important")&&(s.style.setProperty("display",String(c.display).replace(/\s*!important\s*$/,""),"important"),delete c.display);const o=at(c,null,t.context?.cssPrefix);if(o&&s.classList){const r=o.split(" ").filter(Boolean);let e=!1;for(const f of r)s.classList.add(f),e||(f.charCodeAt(0)===95&&f.charCodeAt(1)===99||f.charCodeAt(0)===95&&f.indexOf("_c",1)!==-1)&&(e=!0);e&&eo(s)}const i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){const r=c.display;if(r&&r!==i)if(i==="none"){const e=[];for(const f of s.classList)f.startsWith("_d-")&&f!=="_d-none"&&e.push(f);for(const f of e)s.classList.remove(f);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&D(),_t.delete(t)}}function Nt(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const a in t.aria){const o=t.aria[a];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const i="aria-"+a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());s.setAttribute(i,o===!0?"":o)}const n=Yt(t);for(const a in n){const o=n[a];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(a,o===!0?"":o)}const c=t.tag||"div";for(const a in t){if(!Object.prototype.hasOwnProperty.call(t,a)||typeof t[a]=="function"||K.has(a)||a==="on"||n[a]!==void 0)continue;const o=a.charCodeAt(0);if(!(o>=65&&o<=90)&&!H(a)&&!(E[a]||j&&j.has(a))&&ft(c,a)){let i=t[a];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=et(i,t,t.state,t.context),t[a]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!Zt(dt(a)||a))continue;const r=dt(a)||a;s.setAttribute(r,Gt(r,i))}}}function fo(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,c=n&&typeof n=="object"&&n.max?String(n.max):null;c&&(s.style.maxHeight=c);const a=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};a(),s.addEventListener("input",a),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",a)}catch{}})}const Ft=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Mt(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!H(n)||Ft.has(n))continue;let c=t[n];if(typeof c=="string"&&/^[A-Za-z_$][\w$]*$/.test(c)){const o=c;c=function(r){return t.call(o,r)}}if(typeof c!="function")continue;const a=Xt(n);Wt.has(a)||Bt(Jt(a),t,c)}uo(t)}function uo(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let c=!1;for(const y of Ft){const l=t[y];typeof l=="function"&&(n[y]=l,c=!0)}if(!c)return;const a=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,r=0,e=0,f=!1;const d=y=>{const l=y.touches&&y.touches[0]||y.changedTouches&&y.changedTouches[0];l&&(i=l.clientX,r=l.clientY,e=Date.now(),f=!0)},p=y=>{if(!f)return;f=!1;const l=y.changedTouches&&y.changedTouches[0]||y.touches&&y.touches[0];if(!l)return;const _=l.clientX-i,u=l.clientY-r,h=Date.now()-e;if(h>o)return;const g=Math.abs(_),x=Math.abs(u);if(Math.max(g,x)<a)return;let b;if(g>x*1.2)b=_<0?"left":"right";else if(x>g*1.2)b=u<0?"up":"down";else return;const w="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),C=n[w],S=n.onSwipe;C&&C.call(t,y,t,t.state,t.context),S&&S.call(t,{direction:b,dx:_,dy:u,dt:h,event:y},t,t.state,t.context)};s.addEventListener("touchstart",d,{passive:!0}),s.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",d)}catch{}try{s.removeEventListener("touchend",p)}catch{}})}function ot(t,s){const n={...t};for(const c in s){const a=n[c],o=s[c];a&&o&&typeof a=="object"&&typeof o=="object"&&!Array.isArray(a)&&!Array.isArray(o)&&typeof a!="function"&&typeof o!="function"?n[c]=ot(a,o):n[c]=o}return n}function gt(t,s,n){if(!s||!t.node)return;const c=t.childExtends;if(Array.isArray(s)){const a=t.tag==="fragment",o=t.context?.document||globalThis.document,i=a?null:o?.createDocumentFragment();if(!a&&!i)return;const r=t.childProps,e=t.childrenAs;for(let f=0;f<s.length;f++){let d=s[f];const p=d;(typeof d=="string"||typeof d=="number")&&(d={text:d});let y=r;if(typeof r=="function")try{y=r(t,d)}catch{y=null}if(e==="state"){let u=p;(typeof p=="string"||typeof p=="number")&&(u={value:p,text:p}),d=y?{...y,state:u}:{state:u}}else y&&(d=ot(y,d));if(c&&!d.ignoreChildExtends)if(d.extends){const u=Array.isArray(d.extends)?d.extends:[d.extends],h=Array.isArray(c)?c:[c];d={...d,extends:[...h,...u]}}else d={...d,extends:c};const l=d?.key||p&&typeof p=="object"&&p.key||`${f}`;let _;try{_=z(d,t,l,n)}catch(u){if(typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${l}" failed to construct at ${h} (initial render, skipping this row):`,u?.message||u)}continue}!a&&_?.node&&i.appendChild(_.node)}return a||t.node.appendChild(i),!0}if(typeof s=="string"){const a=Pt(s,t);if(Array.isArray(a))return gt(t,a,n)}if(typeof s=="object")for(const a in s){if(K.has(a))continue;let o=s[a];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=ot(t.childProps,o)),c&&!o.ignoreChildExtends)if(o.extends){const i=Array.isArray(o.extends)?o.extends:[o.extends],r=Array.isArray(c)?c:[c];o={...o,extends:[...r,...i]}}else o={...o,extends:c};z(o,t,a,n)}}}function bt(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const c=n.options;if(!c||!c.length)return;const a=t.__ref,o=a&&a.__exec&&a.__exec.value,i=typeof o=="function",r=t.value!=null&&typeof t.value!="function";if(i||r){let d;if(i)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const p=d==null?"":String(d);n.value!==p&&(n.value=p);return}const e=s||!(a&&a.__selectSynced);if(a&&(a.__selectSynced=!0),!e)return;let f=-1;for(let d=0;d<c.length;d++)c[d].defaultSelected&&(f=d);f>=0&&n.selectedIndex!==f&&(n.selectedIndex=f)}function It(t,s){let{children:n,content:c}=t;const a=t.childExtends;if(typeof n=="function"){const r=n;try{n=r(t,t.state,t.context)}catch(y){if(n=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,y?.message||y)}}t.children=n;const e=t.__ref;let f=!1;const d=O(t,t.childrenDeps,r),p=k(()=>{const y=f;f=!0;let l;try{l=d(t,t.state,t.context)}catch(C){if(typeof console<"u"&&console.error){const S=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${S}${y?"":" (initial tracking run)"}:`,C?.message||C)}return}if(!y||l===t.children)return;t.children=l;const _=typeof t.onContentUpdate=="function",u=_?[]:null,h=_?[]:null,g=_?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const C=t.childProps,S=[],L=new Map;for(let A=0;A<l.length;A++){const T=l[A];let v=C;if(typeof C=="function")try{v=C(t,T)}catch{v=null}const N=v&&v.key||T&&T.key||`${A}`;S.push(N),L.set(N,{rawChild:T,childProps:v})}const W=new Set(S),U=e.__children.slice();for(const A of U)if(!W.has(A)){const T=t[A];T?.remove&&T.remove(),delete t[A],h&&h.push(A)}const Z=t.childExtends,m=t.tag==="fragment",Ut=t.context?.document||globalThis.document,q=m?null:Ut?.createDocumentFragment(),st=new Set;for(const A of S){const T=L.get(A),v=T.rawChild,N=t[A];if(N&&N.state){if(v&&typeof v=="object"){const P=N.state,B=P.$replace||P.replace,At=P.$update||P.update;if(typeof B=="function")B.call(P,v);else if(typeof At=="function"){for(const F in P)if(!(F==="__element"||F==="root"||F==="parent"||F==="update")&&!Object.prototype.hasOwnProperty.call(v,F))try{P[F]=void 0}catch{}At.call(P,v)}else for(const F in v)P[F]=v[F]}g&&g.push(A);continue}let nt=v;(typeof v=="string"||typeof v=="number")&&(nt={value:v,text:v});const xt=T.childProps;let R=xt?{...xt,state:nt}:{state:nt};if(Z&&!R.ignoreChildExtends)if(R.extends){const P=Array.isArray(R.extends)?R.extends:[R.extends],B=Array.isArray(Z)?Z:[Z];R={...R,extends:[...B,...P]}}else R={...R,extends:Z};let ct;try{ct=z(R,t,A,s)}catch(P){if(typeof console<"u"&&console.error){const B=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to construct at ${B} (reconcile, skipping this row):`,P?.message||P)}st.add(A);continue}!m&&ct?.node&&q&&q.appendChild(ct.node),u&&u.push(A)}if(!m&&q&&q.childNodes.length&&t.node&&t.node.appendChild(q),!m&&t.node){let A=null;for(const T of S){const v=t[T]?.node;if(!v)continue;const N=A?A.nextSibling:t.node.firstChild;v!==N&&t.node.insertBefore(v,N),A=v}}e.__children=st.size?S.filter(A=>!st.has(A)):S,_&&(u.length||h.length)&&jt(t,{added:u,removed:h,kept:g}),bt(t,!1);return}const w=_?[...e.__children]:null;for(const C of[...e.__children]){const S=t[C];S?.remove&&S.remove(),delete t[C]}e.__children=[],gt(t,l,s),bt(t,!1),_&&jt(t,{added:[...e.__children],removed:w,kept:[]})},{depth:e.path.length});e.__effects.push(p)}const o=gt(t,n||c,s);if((n||c)&&!o)return;const i=t.context?.components||{};{const r=Object.keys(t);for(let e=0;e<r.length;e++){const f=r[e];if(!f.endsWith("Extends")||typeof t[f]!="string")continue;const d=f.slice(0,-7);if(!d||d.charCodeAt(0)<65||d.charCodeAt(0)>90)continue;const p={extends:t[f]};delete t[f];for(let y=e+1;y<r.length;y++){const l=r[y],_=l.charCodeAt(0);if(_>=65&&_<=90||K.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const u=t[l];u!==void 0&&(p[l]=u,delete t[l])}t[d]&&typeof t[d]=="object"?t[d]={...p,...t[d]}:t[d]=p}}for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||K.has(r)||typeof t[r]!="object"||t[r]===null)continue;const e=r.charCodeAt(0);if(e<65||e>90)continue;let f=t[r];if(!f.__ref){if(!f.extends&&!f.extend){const d=i[r]||i[`smbls.${r}`];d&&(f={...f,extends:d})}if(t.childProps&&(f=ot(t.childProps,f)),a&&!f.ignoreChildExtends)if(f.extends){const d=Array.isArray(f.extends)?f.extends:[f.extends],p=Array.isArray(a)?a:[a];f={...f,extends:[...p,...d]}}else f={...f,extends:a};z(f,t,r,s)}}}function Kt(t,s,n){const{node:c}=t;if(!c)return;c.ref=t;const a=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(a){const i=a.parentNode;if(i){if(n?.position==="before"&&n.node)i.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const r=n.node.nextSibling;i.insertBefore(c,r||a)}else i.insertBefore(c,a);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;i?o.insertBefore(c,i):o.appendChild(c)}else o.appendChild(c)}function M(t,s,n){const c=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&V(c,s,n);const a="on"+t,o=s[a];if(typeof o=="function"){const i=t==="Render"||t==="RenderRouter";if(i){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const r=s.context?.designSystem;r&&$(r);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(e){if(s.context?.plugins?.length&&V("error",s,{hook:a,error:e})||console.error(`[DOMQL] Lifecycle "${a}" error:`,e),s.context?.strictMode)throw e}finally{r&&D(),i&&(s.__ref.__inRender=!1)}}return!0}var Do=z;export{z as create,Do as default,kt as flushMounts};
@@ -1 +1 @@
1
- import{create as t,default as r,flushMounts as E}from"./create.js";import{update as a}from"./update.js";import{dispose as f,remove as m}from"./dispose.js";import{REGISTRY as s,LIFECYCLE_EVENTS as x,DELEGATED_EVENTS as N,NON_BUBBLING_EVENTS as S,MIXINS as g}from"./registry.js";import{addDelegatedEvent as v,removeDelegatedEvent as c,registerEvent as i}from"./delegate.js";import{cacheNode as G,detectTag as I,createHTMLNode as L,isValidTag as V,isSvgTag as _,SVG_TAGS as u}from"./cache.js";import{applyExtends as M}from"./extends.js";import{addMethods as B}from"./methods.js";export{N as DELEGATED_EVENTS,x as LIFECYCLE_EVENTS,g as MIXINS,S as NON_BUBBLING_EVENTS,s as REGISTRY,u as SVG_TAGS,v as addDelegatedEvent,B as addMethods,M as applyExtends,G as cacheNode,t as create,L as createHTMLNode,r as default,I as detectTag,f as dispose,E as flushMounts,_ as isSvgTag,V as isValidTag,i as registerEvent,m as remove,c as removeDelegatedEvent,a as update};
1
+ import{create as t,default as r,flushMounts as E}from"./create.js";import{update as a}from"./update.js";import{dispose as f,remove as m}from"./dispose.js";import{REGISTRY as x,LIFECYCLE_EVENTS as T,DELEGATED_EVENTS as N,NON_BUBBLING_EVENTS as S,MIXINS as g}from"./registry.js";import{addDelegatedEvent as n,removeDelegatedEvent as v,registerEvent as c}from"./delegate.js";import{cacheNode as G,detectTag as I,createHTMLNode as L,isValidTag as V,isSvgTag as _,SVG_TAGS as h}from"./cache.js";import{applyExtends as D}from"./extends.js";import{addMethods as B,refreshContextProto as C}from"./methods.js";export{N as DELEGATED_EVENTS,T as LIFECYCLE_EVENTS,g as MIXINS,S as NON_BUBBLING_EVENTS,x as REGISTRY,h as SVG_TAGS,n as addDelegatedEvent,B as addMethods,D as applyExtends,G as cacheNode,t as create,L as createHTMLNode,r as default,I as detectTag,f as dispose,E as flushMounts,_ as isSvgTag,V as isValidTag,C as refreshContextProto,c as registerEvent,m as remove,v as removeDelegatedEvent,a as update};
@@ -1 +1 @@
1
- import{update as h}from"./update.js";import{remove as _}from"./dispose.js";import{isLoudDevRuntime as d}from"./devRuntime.js";import"css-in-props";import{getDB as g,getQuery as p,getRootData as y,getRootState as k,getRoot as m,getRootContext as w,getContext as x,getChildren as C,getPath as S,nextElement as R,previousElement as v,verbose as b,warn as P,error as D,variables as $,spotByPath as j}from"@symbo.ls/utils";function i(t,e,o){const n=t?.context?.analyze;if(!n||!n.emit||e==="warn"&&!n.shouldCapture("warnings")||e==="error"&&!n.shouldCapture("errors"))return;const r=o.map(s=>s?.message||(typeof s=="string"?s:null)).filter(Boolean).join(" ");n.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:r||null,args:o})}const u=new Set;function A(t,e,o){const n=String(e);if(u.has(n))return;u.add(n);const r=t?.__ref?.path,s=Array.isArray(r)&&r.length?r.join("."):t?.key!=null?String(t.key):"(unknown element)",a=o!=null?`resolves to a non-function (${typeof o}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",c=`[smbls] el.call('${n}') at <${s}>: "${n}" ${a}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;i(t,"error",[c]),console.error(c)}function O(...t){return i(this,"warn",t),P.apply(this,t)}function L(...t){return i(this,"error",t),D.apply(this,t)}const f={update:h,remove:_,getDB:g,getQuery:p,getRootData:y,getChildren:C,getPath:S,nextElement:R,previousElement:v,verbose:b,warn:O,error:L,variables:$,spotByPath:j,set(t,e){const o=this.__ref;if(o){if(o.__setLocked){o.__setQueued={content:t,options:e};return}o.__setLocked=!0}try{if(this.removeContent(),t!=null){const n=this.context?.__create;n&&n(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(o){o.__setLocked=!1;const n=o.__setQueued;n&&(o.__setQueued=null,this.set(n.content,n.options))}}},reset(t){const e=this.context?.__create;if(!e)return this;const o=this.parent,n=this.key,r=this.parse();return this.remove(),e(r,o,n,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){const e=this.__ref;if(!e?.__children)return null;for(const o of e.__children){const n=this[o];if(!n)continue;if(typeof t=="function"){if(t(n))return n}else if(typeof t=="string"&&n.key===t)return n;const r=n.lookdown?.(t);if(r)return r}return null},lookdownAll(t,e=[]){const o=this.__ref;if(!o?.__children)return e;for(const n of o.__children){const r=this[n];r&&(typeof t=="function"?t(r)&&e.push(r):typeof t=="string"&&r.key===t&&e.push(r),r.lookdownAll?.(t,e))}return e},getRef(){return this.__ref},getRoot:m,getRootState:k,getRootContext:w,getContext:x,parse(t){const e={},o=t?new Set(t):null,n=this.__ref?.__exec;for(const r in this)if(!(r==="parent"||r==="node"||r==="__ref")&&!o?.has(r)){if(n&&n[r]!==void 0){e[r]=n[r];continue}typeof this[r]!="function"&&(e[r]=this[r])}return e},parseDeep(t){const e=this.parse(t),o=this.__ref;if(o?.__children)for(const n of o.__children)this[n]?.parseDeep&&(e[n]=this[n].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){const e={};for(const o of t)e[o]=this[o];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(const e in t){const o=t[e];if(o==null)continue;const n=e.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()),r=String(o).replace(/\s*!important\s*$/,"");this.node.style.setProperty(n,r,"important")}},call(t,...e){const o=this.context,n=o?.methods?.[t]||o?.functions?.[t]||o?.utils?.[t]||this[t];if(typeof n=="function")return n.call(this,...e);d()&&A(this,t,n)},removeContent(){const t=this.__ref;if(!t?.__children)return;const e=this.content;if(e?.remove){e.remove(),delete this.content;const o=t.__children.indexOf("content");o!==-1&&t.__children.splice(o,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},l=new WeakMap;function E(t){if(!t)return f;let e=l.get(t);if(e)return e;e=Object.create(f);const o=t.methods;if(o)for(const n in o)e[n]=o[n];return l.set(t,e),e}function T(t){const e=E(t.context);Object.setPrototypeOf(t,e)}export{T as addMethods,f as elementProto};
1
+ import{update as h}from"./update.js";import{remove as _}from"./dispose.js";import{isLoudDevRuntime as d}from"./devRuntime.js";import"css-in-props";import{getDB as g,getQuery as p,getRootData as y,getRootState as m,getRoot as k,getRootContext as w,getContext as x,getChildren as C,getPath as S,nextElement as R,previousElement as v,verbose as b,warn as P,error as D,variables as $,spotByPath as j}from"@symbo.ls/utils";function i(t,e,n){const o=t?.context?.analyze;if(!o||!o.emit||e==="warn"&&!o.shouldCapture("warnings")||e==="error"&&!o.shouldCapture("errors"))return;const r=n.map(s=>s?.message||(typeof s=="string"?s:null)).filter(Boolean).join(" ");o.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:r||null,args:n})}const l=new Set;function A(t,e,n){const o=String(e);if(l.has(o))return;l.add(o);const r=t?.__ref?.path,s=Array.isArray(r)&&r.length?r.join("."):t?.key!=null?String(t.key):"(unknown element)",a=n!=null?`resolves to a non-function (${typeof n}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",u=`[smbls] el.call('${o}') at <${s}>: "${o}" ${a}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;i(t,"error",[u]),console.error(u)}function O(...t){return i(this,"warn",t),P.apply(this,t)}function L(...t){return i(this,"error",t),D.apply(this,t)}const f={update:h,remove:_,getDB:g,getQuery:p,getRootData:y,getChildren:C,getPath:S,nextElement:R,previousElement:v,verbose:b,warn:O,error:L,variables:$,spotByPath:j,set(t,e){const n=this.__ref;if(n){if(n.__setLocked){n.__setQueued={content:t,options:e};return}n.__setLocked=!0}try{if(this.removeContent(),t!=null){const o=this.context?.__create;o&&o(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(n){n.__setLocked=!1;const o=n.__setQueued;o&&(n.__setQueued=null,this.set(o.content,o.options))}}},reset(t){const e=this.context?.__create;if(!e)return this;const n=this.parent,o=this.key,r=this.parse();return this.remove(),e(r,n,o,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){const e=this.__ref;if(!e?.__children)return null;for(const n of e.__children){const o=this[n];if(!o)continue;if(typeof t=="function"){if(t(o))return o}else if(typeof t=="string"&&o.key===t)return o;const r=o.lookdown?.(t);if(r)return r}return null},lookdownAll(t,e=[]){const n=this.__ref;if(!n?.__children)return e;for(const o of n.__children){const r=this[o];r&&(typeof t=="function"?t(r)&&e.push(r):typeof t=="string"&&r.key===t&&e.push(r),r.lookdownAll?.(t,e))}return e},getRef(){return this.__ref},getRoot:k,getRootState:m,getRootContext:w,getContext:x,parse(t){const e={},n=t?new Set(t):null,o=this.__ref?.__exec;for(const r in this)if(!(r==="parent"||r==="node"||r==="__ref")&&!n?.has(r)){if(o&&o[r]!==void 0){e[r]=o[r];continue}typeof this[r]!="function"&&(e[r]=this[r])}return e},parseDeep(t){const e=this.parse(t),n=this.__ref;if(n?.__children)for(const o of n.__children)this[o]?.parseDeep&&(e[o]=this[o].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){const e={};for(const n of t)e[n]=this[n];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(const e in t){const n=t[e];if(n==null)continue;const o=e.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()),r=String(n).replace(/\s*!important\s*$/,"");this.node.style.setProperty(o,r,"important")}},call(t,...e){const n=this.context,o=n?.methods?.[t]||n?.functions?.[t]||n?.utils?.[t]||this[t];if(typeof o=="function")return o.call(this,...e);d()&&A(this,t,o)},removeContent(){const t=this.__ref;if(!t?.__children)return;const e=this.content;if(e?.remove){e.remove(),delete this.content;const n=t.__children.indexOf("content");n!==-1&&t.__children.splice(n,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},c=new WeakMap;function E(t){if(!t)return f;let e=c.get(t);if(e)return e;e=Object.create(f);const n=t.methods;if(n)for(const o in n)e[o]=n[o];return c.set(t,e),e}function T(t){const e=E(t.context);Object.setPrototypeOf(t,e)}function q(t){if(!t)return!1;const e=c.get(t);if(!e)return!1;const n=t.methods;if(!n)return!1;for(const o in n)e[o]=n[o];return!0}export{T as addMethods,f as elementProto,q as refreshContextProto};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.702",
3
+ "version": "3.14.717",
4
4
  "description": "Core element creation, update, and disposal engine for smbls v3.14",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -23,8 +23,8 @@
23
23
  "dependencies": {
24
24
  "@symbo.ls/signal": "^3.14.628",
25
25
  "@symbo.ls/state": "^3.14.678",
26
- "@symbo.ls/utils": "^3.14.702",
27
- "css-in-props": "^3.14.612",
26
+ "@symbo.ls/utils": "^3.14.707",
27
+ "css-in-props": "^3.14.707",
28
28
  "attrs-in-props": "^3.14.692"
29
29
  },
30
30
  "files": [