@symbo.ls/element 3.14.577 → 3.14.599

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,30 @@
1
1
  # @symbo.ls/element
2
2
 
3
+ ## 3.14.599
4
+
5
+ ### Patch Changes
6
+
7
+ - Manual patch bump triggered via workflow_dispatch (scope: all).
8
+ No source change behind this bump — released to refresh dist or
9
+ coordinate a cross-package version line.
10
+ - Updated dependencies
11
+ - @symbo.ls/signal@3.14.599
12
+ - @symbo.ls/state@3.14.599
13
+ - @symbo.ls/utils@3.14.599
14
+ - attrs-in-props@3.14.599
15
+ - css-in-props@3.14.599
16
+
17
+ ## 3.14.595
18
+
19
+ ### Patch Changes
20
+
21
+ - Auto-generated cross-repo patch release.
22
+ - Updated dependencies
23
+ - attrs-in-props@3.14.595
24
+ - css-in-props@3.14.595
25
+ - @symbo.ls/signal@3.14.595
26
+ - @symbo.ls/utils@3.14.595
27
+
3
28
  ## 3.14.577
4
29
 
5
30
  ### Patch Changes
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var v=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},x=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of h(t))!b.call(e,r)&&r!==o&&c(e,r,{get:()=>t[r],enumerable:!(n=m(t,r))||n.enumerable});return e};var T=e=>x(c({},"__esModule",{value:!0}),e);var w={};v(w,{SVG_NS:()=>i,SVG_TAGS:()=>s,cacheNode:()=>S,createHTMLNode:()=>f,detectTag:()=>g,isSvgTag:()=>d,isValidTag:()=>l});module.exports=T(w);const i="http://www.w3.org/2000/svg",s=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),y=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function l(e){return y.has(e)||s.has(e)}function d(e){return s.has(e)}function g(e){let{tag:t,key:o}=e;if(typeof t=="function"&&(t=t(e)),t===!0&&(t=o),typeof t=="string"&&l(t))return t;if(!o||typeof o!="string")return"div";const n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template"]);let r=o.toLowerCase();return r.includes(".")&&(r=r.split(".")[0]),r.includes("_")&&(r=r.split("_")[0]),l(r)&&!n.has(r)?r:"div"}const p={};function f(e,t){const o=t?.context?.document||globalThis.document;if(!o)return null;if(e==="string")return o.createTextNode(t?.text||"");if(e==="fragment")return o.createDocumentFragment();if(d(e)){const n=t?.parent;if(e==="svg"||n?.node?.namespaceURI===i)return o.createElementNS(i,e);if(e!=="svg")return o.createElement("div")}return o.createElement(e)}function S(e){const t=e.tag=g(e),n=d(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,r=e?.context?.document||globalThis.document;let a=p[n];if(a||(a=p[n]=f(t,e)),!a)return null;const u=r&&a.ownerDocument!==r?f(t,e):a.cloneNode(!0);return t==="string"&&(u.nodeValue=e.text||""),u}
1
+ "use strict";var c=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var v=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},x=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!b.call(e,o)&&o!==r&&c(e,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return e};var y=e=>x(c({},"__esModule",{value:!0}),e);var w={};v(w,{SVG_NS:()=>i,SVG_TAGS:()=>s,cacheNode:()=>S,createHTMLNode:()=>f,detectTag:()=>g,isSvgTag:()=>d,isValidTag:()=>l});module.exports=y(w);const i="http://www.w3.org/2000/svg",s=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),T=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function l(e){return T.has(e)||s.has(e)}function d(e){return s.has(e)}function g(e){let{tag:t,key:r}=e;if(typeof t=="function"&&(t=t(e)),t===!0&&(t=r),typeof t=="string"&&l(t))return t;if(!r||typeof r!="string")return"div";const n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]);let o=r.toLowerCase();return o.includes(".")&&(o=o.split(".")[0]),o.includes("_")&&(o=o.split("_")[0]),l(o)&&!n.has(o)?o:"div"}const p={};function f(e,t){const r=t?.context?.document||globalThis.document;if(!r)return null;if(e==="string")return r.createTextNode(t?.text||"");if(e==="fragment")return r.createDocumentFragment();if(d(e)){const n=t?.parent;if(e==="svg"||n?.node?.namespaceURI===i)return r.createElementNS(i,e);if(e!=="svg")return r.createElement("div")}return r.createElement(e)}function S(e){const t=e.tag=g(e),n=d(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,o=e?.context?.document||globalThis.document;let a=p[n];if(a||(a=p[n]=f(t,e)),!a)return null;const u=o&&a.ownerDocument!==o?f(t,e):a.cloneNode(!0);return t==="string"&&(u.nodeValue=e.text||""),u}
@@ -1,6 +1,6 @@
1
- "use strict";var G=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var gt=(t,s)=>{for(var n in s)G(t,n,{get:s[n],enumerable:!0})},bt=(t,s,n,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of ht(s))!_t.call(t,c)&&c!==n&&G(t,c,{get:()=>s[c],enumerable:!(i=lt(s,c))||i.enumerable});return t};var xt=t=>bt(G({},"__esModule",{value:!0}),t);var $t={};gt($t,{create:()=>N,default:()=>Nt});module.exports=xt($t);var k=require("@symbo.ls/signal"),S=require("@symbo.ls/signal"),$=require("./cache.js"),E=require("./registry.js"),dt=require("./delegate.js"),pt=require("./extends.js"),yt=require("./methods.js"),Kt=require("./dispose.js"),H=require("@symbo.ls/utils"),U=require("@symbo.ls/utils/function.js"),I=require("@symbo.ls/state"),x=require("css-in-props"),tt=require("@symbo.ls/css"),A=require("@symbo.ls/scratch"),V=require("attrs-in-props");let At=1;function F(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function vt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function St(t){return t.toLowerCase()}function ct(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function W(t,s){const n={...t};for(const i in s){const c=n[i],o=s[i];c&&o&&typeof c=="object"&&typeof o=="object"&&!Array.isArray(c)&&!Array.isArray(o)&&typeof c!="function"&&typeof o!="function"?n[i]=W(c,o):n[i]=o}return n}function N(t,s,n,i={},c){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||`_${At++}`,o.parent=s||null,o.context=t.context||s?.context||i.context||{},o.context.__create||(o.context.__create=N);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 h=n.indexOf("_");if(h>0){const _=n.substring(0,h),g=o.context?.components;g&&(g[_]||g["smbls."+_])&&(t={...t,extends:_})}}(0,pt.applyExtends)(o,t,i);const e=new Set(["childProps","attr","style","scope","data"]),f=o.props&&typeof o.props=="object"?o.props:null;for(const h in t){if(h==="parent"||h==="node"||h==="__ref"||h==="extends"||h==="context"||h==="props")continue;const _=t[h],g=o[h],b=g&&_&&typeof g=="object"&&typeof _=="object"&&!Array.isArray(g)&&!Array.isArray(_)&&typeof g!="function"&&typeof _!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=W(g,_):b&&e.has(h)?o[h]={...g,..._}:b&&ct(h)?o[h]=W(g,_):o[h]=_}function a(h){for(const _ in h){const g=h[_],b=o[_],C=b&&g&&typeof b=="object"&&typeof g=="object"&&!Array.isArray(b)&&!Array.isArray(g)&&typeof b!="function"&&typeof g!="function";C&&_.charCodeAt(0)>=65&&_.charCodeAt(0)<=90?o[_]=W(b,g):C&&e.has(_)?o[_]={...b,...g}:C&&ct(_)?o[_]=W(b,g):o[_]=g}}f&&a(f),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 u=o.scope&&typeof o.scope=="object"?o.scope:null,d=s?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=d||p||null;if(t.scope!==void 0||u){const h={};u&&Object.assign(h,u),t.scope!==void 0&&Object.assign(h,t.scope),o.scope=(0,k.createScopeStore)(h,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),(0,yt.addMethods)(o),Ct(o,s,t),o.if!=null){let h;if(typeof o.if=="function")try{h=o.if(o,o.state,o.context)}catch(_){if(h=!1,r.__ifError=_,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,_?.message||_)}}else h=o.if;r.__if=!!h}if(r.__if)typeof t.if=="function"&&(r.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof t.if=="function"&&z(o,{if:t.if}),o;o.tag||(o.tag=(0,$.detectTag)(o)),R("Init",o,i);const l=o.node=(0,$.cacheNode)(o);if(!l)return o;if(o.tag==="fragment"){const _=(o.context?.document||globalThis.document).createComment("");l.appendChild(_),r.__fragmentAnchor=_}R("AttachNode",o,i),l.setAttribute&&o.key&&l.setAttribute("data-key",o.key),l.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&l.setAttribute("data-smbls-app",o.context.key),o.id&&l.setAttribute&&(l.id=o.id),at(o,i),z(o,t),q(o),et(o),Tt(o);try{ut(o,i)}catch(h){if(typeof console<"u"&&console.error){const _=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${_}:`,h?.message||h,h?.stack?`
2
- `+h.stack.split(`
1
+ "use strict";var tt=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var Lt=Object.getOwnPropertyNames;var Ot=Object.prototype.hasOwnProperty;var Tt=(t,s)=>{for(var n in s)tt(t,n,{get:s[n],enumerable:!0})},Nt=(t,s,n,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let f of Lt(s))!Ot.call(t,f)&&f!==n&&tt(t,f,{get:()=>s[f],enumerable:!(r=Pt(s,f))||r.enumerable});return t};var Rt=t=>Nt(tt({},"__esModule",{value:!0}),t);var zt={};Tt(zt,{create:()=>K,default:()=>Zt,flushMounts:()=>ut});module.exports=Rt(zt);var E=require("@symbo.ls/signal"),v=require("@symbo.ls/signal"),U=require("./cache.js"),O=require("./registry.js"),jt=require("./delegate.js"),wt=require("./extends.js"),Et=require("./methods.js"),mt=require("./dispose.js"),X=require("@symbo.ls/utils"),F=require("@symbo.ls/utils/function.js"),Y=require("@symbo.ls/state"),C=require("css-in-props"),J=require("@symbo.ls/css"),A=require("@symbo.ls/scratch"),G=require("attrs-in-props");let $t=1;const z=[];let ot=!1;function Mt(){ot||(ot=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(ut):setTimeout(ut,0))}function ut(){if(ot=!1,!z.length)return;const t=z.splice(0,z.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||$("Mounted",n,n.__ref?.__mountOptions||{})}}function lt(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,z.push(t),Mt())}function yt(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,F.runPluginHook)("contentUpdate",t,s);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(r){if(t.context?.plugins?.length&&(0,F.runPluginHook)("error",t,{hook:"onContentUpdate",error:r})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',r),t.context?.strictMode)throw r}finally{n&&(0,A.popConfig)()}}function W(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Dt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Ft(t){return t.toLowerCase()}function ht(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function Z(t,s){const n={...t};for(const r in s){const f=n[r],o=s[r];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[r]=Z(f,o):n[r]=o}return n}function K(t,s,n,r={},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||`_${$t++}`,o.parent=s||null,o.context=t.context||s?.context||r.context||{},o.context.__create||(o.context.__create=K);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 d=n.indexOf("_");if(d>0){const h=n.substring(0,d),g=o.context?.components;g&&(g[h]||g["smbls."+h])&&(t={...t,extends:h})}}(0,wt.applyExtends)(o,t,r);const c=new Set(["childProps","attr","style","scope","data"]),e=o.props&&typeof o.props=="object"?o.props:null;for(const d in t){if(d==="parent"||d==="node"||d==="__ref"||d==="extends"||d==="context"||d==="props")continue;const h=t[d],g=o[d],b=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";b&&d.charCodeAt(0)>=65&&d.charCodeAt(0)<=90?o[d]=Z(g,h):b&&c.has(d)?o[d]={...g,...h}:b&&ht(d)?o[d]=Z(g,h):o[d]=h}function a(d){for(const h in d){const g=d[h],b=o[h],x=b&&g&&typeof b=="object"&&typeof g=="object"&&!Array.isArray(b)&&!Array.isArray(g)&&typeof b!="function"&&typeof g!="function";x&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=Z(b,g):x&&c.has(h)?o[h]={...b,...g}:x&&ht(h)?o[h]=Z(b,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 u=o.scope&&typeof o.scope=="object"?o.scope:null,p=s?.scope,l=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=p||l||null;if(t.scope!==void 0||u){const d={};u&&Object.assign(d,u),t.scope!==void 0&&Object.assign(d,t.scope),o.scope=(0,E.createScopeStore)(d,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),(0,Et.addMethods)(o),It(o,s,t),o.if!=null){let d;if(typeof o.if=="function")try{d=o.if(o,o.state,o.context)}catch(h){if(d=!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 d=o.if;i.__if=!!d}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&xt(o,i,o.if),o;o.tag||(o.tag=(0,U.detectTag)(o)),$("Init",o,r);const _=o.node=(0,U.cacheNode)(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),i.__fragmentAnchor=h}$("AttachNode",o,r),_.setAttribute&&o.key&&_.setAttribute("data-key",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),St(o,r),gt(o),nt(o),Ct(o),Gt(o);try{kt(o,r)}catch(d){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,d?.message||d,d?.stack?`
2
+ `+d.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(m(o,s,c),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const h=o.context?.designSystem;h&&(0,A.pushConfig)(h);try{const _=o.html(o,o.state,o.context);_!=null&&typeof _!="function"&&(o.node.innerHTML=_)}catch{}finally{h&&(0,A.popConfig)()}}if(R("Create",o,i),R("Complete",o,i),R("Render",o,i),R("RenderRouter",o,i),typeof o.onFrame=="function"){const h=o.onFrame,_=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){_&&(0,A.pushConfig)(_);try{h(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{_&&(0,A.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Ct(t,s,n){const i=!s,c=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=i&&c&&t.context?.state,r=n.state!==void 0&&!o?n.state:t.state&&!(0,k.isStore)(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,(0,I.applyStateMethods)(t,t.state);else if(t.context?.state){const e=t.context.state,f={...e},a=t.context?.polyglot;if(a?.translations){const u=e.lang||a.defaultLang||"en",d=a.translations[u];if(d&&typeof d=="object")for(const y in d)f[y]===void 0&&(f[y]=d[y]);const p=new Set(a.languages||[]);for(const y in a.translations)!p.has(y)&&f[y]===void 0&&(f[y]=a.translations[y])}t.state=(0,k.isStore)(f)?f:(0,k.createStore)(f),t.state.__element=t,t.state.root=t.state,(0,I.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,I.applyStateMethods)(t,t.state);return}if(typeof r=="string"){if(t.state=nt(r,s),t.state&&typeof t.state=="object"&&!(0,k.isStore)(t.state)){const e=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:e,enumerable:!1,configurable:!0,writable:!0})}(0,I.applyStateMethods)(t,t.state);return}if(typeof r=="function"){const e=r(t,s?.state);t.state=(0,k.isStore)(e)?e:(0,k.createStore)(e||{})}else(0,k.isStore)(r)?t.state=r:t.state=(0,k.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,I.applyStateMethods)(t,t.state)}function Z(t,s){if(!s)return t;const n=s.split("/");let i=t;for(const c of n){if(i==null)return{};i=i[c]}return i??{}}function nt(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const c=t.slice(3);return c?Z(s.state,c):s.state??{}}if(t.startsWith("~/")){const c=s.state?.root||s.state,o=t.slice(2);return o?Z(c,o):c??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=Z(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const i=s.context?.polyglot;if(i?.translations){const c=s.state?.root?.lang||i.defaultLang||"en",o=i.translations[c];if(o?.[t]!==void 0)return o[t];if(i.translations[t]!==void 0)return i.translations[t]}return{}}function jt(t){const s=t.__ref,n=t.tag||"div",i=t.context?.designSystem,c=[],o=Object.keys(t);for(let r=0;r<o.length;r++){const e=o[r];if(typeof t[e]!="function"||E.REGISTRY.has(e))continue;const f=e.charCodeAt(0);f>=65&&f<=90||F(e)||x.CSS_PROPS_REGISTRY[e]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(e)||(0,V.checkAttributeByTagName)(n,e)||c.push({prop:e,fn:t[e]})}for(let r=0;r<c.length;r++){const{prop:e,fn:f}=c[r];s.__exec[e]=f,Object.defineProperty(t,e,{get(){i&&(0,A.pushConfig)(i);try{return f(t,t.state,t.context)}catch{return}finally{i&&(0,A.popConfig)()}},set(a){delete s.__exec[e],Object.defineProperty(t,e,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function z(t,s){const n=t.__ref;if(jt(t),typeof t.text=="function"){const c=t.text,o=(0,S.createEffect)(()=>{if(!n.contentManaged)try{let r=c(t,t.state,t.context);t.node&&r!=null&&typeof r!="function"&&typeof r!="object"&&(typeof r=="string"&&r.includes("{{")&&(r=H.replaceLiteralsWithObjectFields.call(t,r,t.state)),t.tag==="string"?t.node.nodeValue=r:t.node.textContent=r)}catch{}},{depth:n.path.length});n.__effects.push(o),n.__exec.text=c}else if(typeof t.text=="string"&&t.text.includes("{{")){const c=t.text,o=(0,S.createEffect)(()=>{if(n.contentManaged)return;const r=H.replaceLiteralsWithObjectFields.call(t,c,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(o),n.__exec.text=c}for(const c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&typeof t[c]=="function"&&!E.REGISTRY.has(c)&&!F(c)&&!n.__exec[c]){if(x.CSS_PROPS_REGISTRY[c]){const o=t[c],r=c;let e;const f=(0,S.createEffect)(()=>{const a=t.context?.designSystem;a&&(0,A.pushConfig)(a);try{const u=o(t,t.state,t.context),d=x.CSS_PROPS_REGISTRY[r](u,t,t.state,t.context);if(d&&t.node){const p=rt(d);(p===null||p!==e)&&(e=p,K(t.node,d))}else t.node&&(r==="show"||r==="hide")&&(e=void 0,t.node.style.display="")}finally{a&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(f),n.__exec[c]=o}else if(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(c)){const o=t[c],r=c;let e;const f=(0,S.createEffect)(()=>{const a=t.context?.designSystem;a&&(0,A.pushConfig)(a);try{const u=o(t,t.state,t.context);if(t.node)if(u!=null){const d=r+":"+String(u);d!==e&&(e=d,K(t.node,{[r]:u}))}else e=void 0,t.node.style[r]=""}finally{a&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(f),n.__exec[c]=o}}if(typeof s.html=="function"){const c=s.html,o=(0,S.createEffect)(()=>{const r=t.context?.designSystem;r&&(0,A.pushConfig)(r);try{const e=c(t,t.state,t.context);t.node&&e!=null&&typeof e!="function"&&(t.node.innerHTML=e)}finally{r&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(o),n.__exec.html=c}if(typeof s.value=="function"){const c=s.value,o=(0,S.createEffect)(()=>{try{const r=c(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const e=r==null?"":String(r);if(t.node.value===e)return;const f=typeof document<"u"&&document.activeElement===t.node,a=f&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,u=f&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=e,f&&a!=null&&u!=null)try{t.node.setSelectionRange(a,u)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(o),n.__exec.value=c}if(typeof s.style=="function"){const c=s.style;let o;const r=(0,S.createEffect)(()=>{const e=c(t,t.state,t.context),f=rt(e);(f===null||f!==o)&&(o=f,K(t.node,e))},{depth:n.path.length});n.__effects.push(r),n.__exec.style=c}else if(t.style&&typeof t.style=="object")for(const c in t.style){const o=t.style[c];if(typeof o!="function")continue;let r;const e=(0,S.createEffect)(()=>{try{const f=o(t,t.state,t.context);if(t.node){const a=c+":"+String(f);a!==r&&(r=a,K(t.node,{[c]:f}))}}catch{}},{depth:n.path.length});n.__effects.push(e)}if(t.attr&&typeof t.attr=="object"){for(const c in t.attr)if(typeof t.attr[c]=="function"){const o=t.attr[c],r=c,e=(0,S.createEffect)(()=>{try{const f=o(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 c in t.aria){const o=t.aria[c];if(typeof o!="function")continue;const r="aria-"+c.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),e=(0,S.createEffect)(()=>{try{const f=o(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 c in t.data){const o=t.data[c];if(typeof o!="function")continue;const e="data-"+c.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),f=(0,S.createEffect)(()=>{try{const a=o(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(e):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(e,a===!0?"":a)}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 c in i){const o=i[c];if(typeof o!="function")continue;const r=(0,S.createEffect)(()=>{try{const e=o(t,t.state,t.context);if(!t.node?.classList)return;typeof e=="string"?t.node.classList.add(e):e?t.node.classList.add(c):t.node.classList.remove(c)}catch{}},{depth:n.path.length});n.__effects.push(r)}if(typeof s.if=="function"){const c=s.if,o=(0,S.createEffect)(()=>{let r;try{r=c(t,t.state,t.context)}catch(f){if(r=!1,n.__ifError=f,typeof console<"u"&&console.warn){const a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,f?.message||f)}return}const e=n.__if;if(n.__if=!!r,e&&!n.__if&&t.node)t.node.remove();else if(!e&&n.__if)if(n.__ifInitialized){t.node||(t.node=(0,$.cacheNode)(t)),t.node&&(t.node.ref=t);const f=t.parent,a=f?.node;if(a&&t.node){let u=null;const d=Object.keys(f),p=d.indexOf(t.key);for(let y=p+1;y<d.length;y++){const l=f[d[y]];if(l?.node?.parentNode===a){u=l.node;break}}u?a.insertBefore(t.node,u):a.appendChild(t.node)}else m(t,t.parent);q(t)}else{if(n.__ifInitialized=!0,t.tag||(t.tag=(0,$.detectTag)(t)),R("Init",t,{}),t.node||(t.node=(0,$.cacheNode)(t)),!t.node)return;if(t.tag==="fragment"&&!n.__fragmentAnchor){const u=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(u),n.__fragmentAnchor=u}R("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),at(t,{});const f=s.if;delete s.if;try{z(t,s)}finally{s.if=f}q(t),et(t),ut(t,{}),m(t,t.parent)}},{depth:n.path.length});n.__effects.push(o)}for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||E.REGISTRY.has(c)||typeof t[c]!="function")continue;const o=c.charCodeAt(0);if(o>=65&&o<=90||F(c))continue;const r=t[c];n.__exec[c]=r;const e=t.tag||"div";if((0,V.checkAttributeByTagName)(e,c)&&!x.CSS_PROPS_REGISTRY[c]&&!(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(c))){const f=c,a=(0,S.createEffect)(()=>{try{const u=r(t,t.state,t.context);t.node?.setAttribute&&(u==null||u===!1?t.node.removeAttribute(f):typeof u!="function"&&typeof u!="object"&&(f==="src"&&"src"in t.node?t.node.src=u:t.node.setAttribute(f,u===!0?"":u)))}catch{}},{depth:n.path.length});n.__effects.push(a)}}Et(t),Pt(t)}function q(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),Lt(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"&&K(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const i=t.attr[n];typeof i=="function"||typeof i=="object"||i==null||i===!1||s.setAttribute&&s.setAttribute(n,i===!0?"":i)}if(t.data&&typeof t.data=="object")for(const n in t.data){const i=t.data[n];typeof i=="function"||typeof i=="object"||i==null||i===!1||s.dataset&&(s.dataset[n]=i===!0?"":i)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(i=>i&&s.classList.add(i));else if(typeof n=="object")for(const i in n){const c=typeof n[i]=="function"?n[i](t,t.state,t.context):n[i];c&&s.classList.add(typeof c=="string"?c:i)}}}}function rt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function K(t,s){if(!t||!s||!t.style)return;let n=null;for(const i in s){const c=s[i];if(c!=null){if(i.charAt(0)==="&"&&typeof c=="object"){n||(n={}),n[i]=c;continue}try{const o=String(c),r=i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),e=o.trim(),f=/\s*!important\s*$/.test(e),a=e.replace(/\s*!important\s*$/,"");t.style.setProperty(r,a,f?"important":"")}catch{}}}n&&wt(t,n)}let kt=0;function wt(t,s){const n=`_ds${kt++}`;t.classList.add(n);const i=t.ownerDocument;let c=i.querySelector("style[data-smbls-scoped]");c||(c=i.createElement("style"),c.setAttribute("data-smbls-scoped",""),i.head.appendChild(c));let o="";for(const r in s){const e="."+n,f=r.replace(/&/g,e).split(",").map(u=>{const d=u.trim();return d.includes(e)?d:e+d}).join(", "),a=s[r];if(typeof a=="object"){let u="",d="";for(const p in a){const y=a[p];if(typeof y=="object"){const l=p.includes("&")?f.split(", ").map(_=>p.replace(/&/g,_)).join(", "):f.split(", ").map(_=>`${_} ${p}`).join(", ");let h="";for(const _ in y)h+=`${_.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[_]};`;d+=`${l} { ${h} }
5
- `}else u+=`${p.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${y};`}u&&(o+=`${f} { ${u} }
6
- `),d&&(o+=d)}}o&&(c.textContent+=o)}function Et(t){const s=t.subscribeTo;if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let i=0;i<s.length;i++){const c=s[i];if(typeof c!="string"||c.length===0)continue;const o=c.split("."),r=o[0],e=o.slice(1),f={value:!1},a=(0,S.createEffect)(()=>{const u=t.state&&((0,k.isStore)(t.state)?t.state.root:null);if(!u||!(0,k.isStore)(u))return;let d=u;d=d[r];for(let p=0;p<e.length&&!(d==null||typeof d!="object");p++)if((0,k.isStore)(d))d=d[e[p]];else break;if(f.value&&(typeof t.onBeforeUpdate=="function"||typeof t.onUpdate=="function")){const p=t.context?.designSystem;p&&(0,A.pushConfig)(p);let y="onBeforeUpdate";try{let l=!1;typeof t.onBeforeUpdate=="function"&&t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(l=!0),y="onUpdate",!l&&typeof t.onUpdate=="function"&&t.onUpdate(t,t.state,t.context)}catch(l){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:y,error:l})||console.error(`[DOMQL] subscribeTo ${y} error:`,l)}finally{p&&(0,A.popConfig)()}}},{depth:n.path.length});f.value=!0,a._isSubscribeToEffect=!0,n.__effects.push(a)}}function Pt(t){const s=t.__ref;s.__conditionalRunners=[];for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const i=n.charAt(0);if(i!=="."&&i!=="!")continue;const c=n.slice(1);if(!c)continue;const o=t[n];if(!o||typeof o!="object")continue;const r=i==="!",e={lastMatch:!1,appliedKeys:null},f=()=>{if(!t.node)return;let u;const d=t[c];if(d===void 0)if(t.state&&c in t.state)u=t.state[c];else{const l=t.context?.cases?.[c];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 \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(l){u=!1,s.__conditionalError=l,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,l?.message||l)}else u=d;const p=r?!u:!!u;if(p===e.lastMatch)return;e.lastMatch=p;const y=t.context?.designSystem;y&&(0,A.pushConfig)(y);try{if(p){const l={};for(const _ in o){if(!Object.prototype.hasOwnProperty.call(o,_))continue;const g=typeof o[_]=="function"?o[_](t,t.state,t.context):o[_];if(g!=null)if(x.CSS_PROPS_REGISTRY[_]){const b=x.CSS_PROPS_REGISTRY[_](g,t,t.state,t.context);if(b){const C=Array.isArray(b)?b:[b];for(const D of C)D&&Object.assign(l,D)}}else x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(_)&&(l[_]=g)}const h=Object.keys(l);h.length?(K(t.node,l),e.appliedKeys=h):e.appliedKeys=null}else if(e.appliedKeys){for(const l of e.appliedKeys)t.node.style[l]="";e.appliedKeys=null}}finally{y&&(0,A.popConfig)()}};s.__conditionalRunners.push(f);const a=(0,S.createEffect)(f,{depth:s.path.length});s.__effects.push(a)}}const X=new WeakSet;function Ot(t){const s=t.ownerDocument;!s||X.has(s)||(X.add(s),queueMicrotask(()=>{X.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const Q=new WeakSet;let it=!1;function Lt(t){const{node:s}=t;if(!s)return;if(it||(it=!0,(0,tt.css)({display:"none"})),Q.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Q.add(t);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{const i={};let c=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||E.REGISTRY.has(o))continue;const r=o.charCodeAt(0);if(!(r>=65&&r<=90)&&!F(o)){if(x.CSS_PROPS_REGISTRY[o]){const e=t[o],f=x.CSS_PROPS_REGISTRY[o](e,t,t.state,t.context);if(f){if(Array.isArray(f))for(const a of f)a&&Object.assign(i,a);else Object.assign(i,f);c=!0}}else if(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const e=t[o];e!=null&&typeof e!="object"&&(i[o]=e,c=!0)}else if(o.charCodeAt(0)===45){const e=t[o];e!=null&&typeof e!="object"&&(i[o]=e,c=!0)}else if(o.charAt(0)==="&"){const e=t[o];e&&typeof e=="object"&&(i[o]=e,c=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const e=t[o];if(e&&typeof e=="object"){const f={},a=(u,d,p)=>{if(x.CSS_PROPS_REGISTRY[d]){const y=x.CSS_PROPS_REGISTRY[d](p,t,t.state,t.context);if(y)if(Array.isArray(y))for(const l of y)l&&Object.assign(u,l);else Object.assign(u,y)}else u[d]=p};for(const u in e){let d=e[u];if(typeof d=="function"&&(d=d(t,t.state,t.context)),!(d==null||typeof d=="function")){if(u==="style"&&typeof d=="object"&&!Array.isArray(d)){for(const p in d){let y=d[p];typeof y=="function"&&(y=y(t,t.state,t.context)),!(y==null||typeof y=="function")&&a(f,p,y)}continue}a(f,u,d)}}if(Object.keys(f).length){if(o.length>1&&o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")&&!o.startsWith("@supports")&&(o==="@dark"||o==="@light"||!t.context?.designSystem?.media?.[o.slice(1)])){const d={};for(const y in f){const l=f[y];d[y]=typeof l=="string"&&!l.includes("!important")?l+" !important":l}const p=o.slice(1);i[`[data-theme="${p}"] &`]=d}else{let d=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const y=o.slice(1),l=t.context?.designSystem?.media?.[y]||t.context?.designSystem?.media?.[y];l&&(d=`@media ${l}`)}const p={};for(const y in f){const l=f[y];if(l&&typeof l=="object"&&!Array.isArray(l)){const h={};for(const _ in l)if(x.CSS_PROPS_REGISTRY[_]){const g=x.CSS_PROPS_REGISTRY[_](l[_],t,t.state,t.context);if(g)if(Array.isArray(g))for(const b of g)b&&Object.assign(h,b);else Object.assign(h,g)}else h[_]=l[_];p[y]=h}else p[y]=l}Object.keys(p).length&&(i[d]=p)}c=!0}c=!0}}}}if(c){i.display&&String(i.display).includes("!important")&&(s.style.setProperty("display",String(i.display).replace(/\s*!important\s*$/,""),"important"),delete i.display);const o=(0,tt.css)(i,null,t.context?.cssPrefix);if(o&&s.classList){const e=o.split(" ").filter(Boolean);let f=!1;for(const a of e)s.classList.add(a),f||(a.charCodeAt(0)===95&&a.charCodeAt(1)===99||a.charCodeAt(0)===95&&a.indexOf("_c",1)!==-1)&&(f=!0);f&&Ot(s)}const r=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(r!=null){const e=i.display;if(e&&e!==r)if(r==="none"){const f=[];for(const a of s.classList)a.startsWith("_d-")&&a!=="_d-none"&&f.push(a);for(const a of f)s.classList.remove(a);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&(0,A.popConfig)(),Q.delete(t)}}function et(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const c in t.aria){const o=t.aria[c];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const r="aria-"+c.replace(/[A-Z]/g,e=>"-"+e.toLowerCase());s.setAttribute(r,o===!0?"":o)}const n=(0,V.applyAttrTransforms)(t);for(const c in n){const o=n[c];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(c,o===!0?"":o)}const i=t.tag||"div";for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||typeof t[c]=="function"||E.REGISTRY.has(c)||c==="on"||n[c]!==void 0)continue;const o=c.charCodeAt(0);if(!(o>=65&&o<=90)&&!F(c)&&!(x.CSS_PROPS_REGISTRY[c]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(c))&&(0,V.checkAttributeByTagName)(i,c)){let r=t[c];if(r==null||r===!1||(typeof r=="string"&&r.includes("{{")&&(r=(0,H.replaceLiteralsWithObjectFields)(r,t,t.state,t.context),t[c]=r),r==null||r===!1||typeof r=="function"||typeof r=="object"))continue;s.setAttribute(c,r===!0?"":r)}}}function Tt(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,i=n&&typeof n=="object"&&n.max?String(n.max):null;i&&(s.style.maxHeight=i);const c=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};c(),s.addEventListener("input",c),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",c)}catch{}})}const ft=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function at(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!F(n)||ft.has(n))continue;let i=t[n];if(typeof i=="string"&&/^[A-Za-z_$][\w$]*$/.test(i)){const o=i;i=function(e){return t.call(o,e)}}if(typeof i!="function")continue;const c=vt(n);E.LIFECYCLE_EVENTS.has(c)||(0,dt.registerEvent)(St(c),t,i)}Rt(t)}function Rt(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let i=!1;for(const p of ft){const y=t[p];typeof y=="function"&&(n[p]=y,i=!0)}if(!i)return;const c=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,e=0,f=0,a=!1;const u=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,e=y.clientY,f=Date.now(),a=!0)},d=p=>{if(!a)return;a=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const l=y.clientX-r,h=y.clientY-e,_=Date.now()-f;if(_>o)return;const g=Math.abs(l),b=Math.abs(h);if(Math.max(g,b)<c)return;let C;if(g>b*1.2)C=l<0?"left":"right";else if(b>g*1.2)C=h<0?"up":"down";else return;const D="onSwipe"+C.charAt(0).toUpperCase()+C.slice(1),T=n[D],j=n.onSwipe;T&&T.call(t,p,t,t.state,t.context),j&&j.call(t,{direction:C,dx:l,dy:h,dt:_,event:p},t,t.state,t.context)};s.addEventListener("touchstart",u,{passive:!0}),s.addEventListener("touchend",d,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",u)}catch{}try{s.removeEventListener("touchend",d)}catch{}})}function B(t,s){const n={...t};for(const i in s){const c=n[i],o=s[i];c&&o&&typeof c=="object"&&typeof o=="object"&&!Array.isArray(c)&&!Array.isArray(o)&&typeof c!="function"&&typeof o!="function"?n[i]=B(c,o):n[i]=o}return n}function J(t,s,n){if(!s||!t.node)return;const i=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",o=t.context?.document||globalThis.document,r=c?null:o?.createDocumentFragment();if(!c&&!r)return;const e=t.childProps,f=t.childrenAs;for(let a=0;a<s.length;a++){let u=s[a];const d=u;(typeof u=="string"||typeof u=="number")&&(u={text:u});let p=e;if(typeof e=="function")try{p=e(t,u)}catch{p=null}if(f==="state"){let h=d;(typeof d=="string"||typeof d=="number")&&(h={value:d,text:d}),u=p?{...p,state:h}:{state:h}}else p&&(u=B(p,u));if(i&&!u.ignoreChildExtends)if(u.extends){const h=Array.isArray(u.extends)?u.extends:[u.extends],_=Array.isArray(i)?i:[i];u={...u,extends:[..._,...h]}}else u={...u,extends:i};const y=u?.key||d&&typeof d=="object"&&d.key||`${a}`,l=N(u,t,y,n);!c&&l?.node&&r.appendChild(l.node)}c||t.node.appendChild(r);return}if(typeof s=="string"){const c=nt(s,t);if(Array.isArray(c)){J(t,c,n);return}}if(typeof s=="object")for(const c in s){if(E.REGISTRY.has(c))continue;let o=s[c];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=B(t.childProps,o)),i&&!o.ignoreChildExtends)if(o.extends){const r=Array.isArray(o.extends)?o.extends:[o.extends],e=Array.isArray(i)?i:[i];o={...o,extends:[...e,...r]}}else o={...o,extends:i};N(o,t,c,n)}}}function ut(t,s){let{children:n,content:i}=t;const c=t.childExtends;if(typeof n=="function"){const r=n;n=r(t,t.state,t.context),t.children=n;const e=t.__ref;let f=!1;const a=(0,S.createEffect)(()=>{const u=r(t,t.state,t.context);if(!f){f=!0;return}if(u===t.children)return;if(t.children=u,Array.isArray(u)&&t.childrenAs==="state"){const y=t.childProps,l=[],h=new Map;for(let j=0;j<u.length;j++){const P=u[j];let v=y;if(typeof y=="function")try{v=y(t,P)}catch{v=null}const M=v&&v.key||P&&P.key||`${j}`;l.push(M),h.set(M,{rawChild:P,childProps:v})}const _=new Set(l),g=e.__children.slice();for(const j of g)if(!_.has(j)){const P=t[j];P?.remove&&P.remove(),delete t[j]}const b=t.childExtends,C=t.tag==="fragment",D=t.context?.document||globalThis.document,T=C?null:D?.createDocumentFragment();for(const j of l){const P=h.get(j),v=P.rawChild,M=t[j];if(M&&M.state){if(v&&typeof v=="object"){const L=M.state;if(typeof L.replace=="function")L.replace(v);else if(typeof L.update=="function"){for(const w in L)if(!(w==="__element"||w==="root"||w==="parent"||w==="update")&&!Object.prototype.hasOwnProperty.call(v,w))try{L[w]=void 0}catch{}L.update(v)}else for(const w in v)L[w]=v[w]}continue}let Y=v;(typeof v=="string"||typeof v=="number")&&(Y={value:v,text:v});const ot=P.childProps;let O=ot?{...ot,state:Y}:{state:Y};if(b&&!O.ignoreChildExtends)if(O.extends){const L=Array.isArray(O.extends)?O.extends:[O.extends],w=Array.isArray(b)?b:[b];O={...O,extends:[...w,...L]}}else O={...O,extends:b};const st=N(O,t,j,s);!C&&st?.node&&T&&T.appendChild(st.node)}!C&&T&&T.childNodes.length&&t.node&&t.node.appendChild(T),e.__children=l;return}for(const y of[...e.__children]){const l=t[y];l?.remove&&l.remove(),delete t[y]}e.__children=[],J(t,u,s)},{depth:e.path.length});e.__effects.push(a)}if(J(t,n||i,s),n||i)return;const o=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 a=f.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const u={extends:t[f]};delete t[f];for(let d=e+1;d<r.length;d++){const p=r[d],y=p.charCodeAt(0);if(y>=65&&y<=90||E.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const l=t[p];l!==void 0&&(u[p]=l,delete t[p])}t[a]&&typeof t[a]=="object"?t[a]={...u,...t[a]}:t[a]=u}}for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||E.REGISTRY.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 a=o[r]||o[`smbls.${r}`];a&&(f={...f,extends:a})}if(t.childProps&&(f=B(t.childProps,f)),c&&!f.ignoreChildExtends)if(f.extends){const a=Array.isArray(f.extends)?f.extends:[f.extends],u=Array.isArray(c)?c:[c];f={...f,extends:[...u,...a]}}else f={...f,extends:c};N(f,t,r,s)}}}function m(t,s,n){const{node:i}=t;if(!i)return;i.ref=t;const c=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(c){const r=c.parentNode;if(r){if(n?.position==="before"&&n.node)r.insertBefore(i,n.node);else if(n?.position==="after"&&n.node){const e=n.node.nextSibling;r.insertBefore(i,e||c)}else r.insertBefore(i,c);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(i,n.node);else if(n?.position==="after"&&n.node){const r=n.node.nextSibling;r?o.insertBefore(i,r):o.appendChild(i)}else o.appendChild(i)}function R(t,s,n){const i=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,U.runPluginHook)(i,s,n);const c="on"+t,o=s[c];if(typeof o=="function"){const r=t==="Render"||t==="RenderRouter";if(r){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const e=s.context?.designSystem;e&&(0,A.pushConfig)(e);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(f){if(s.context?.plugins?.length&&(0,U.runPluginHook)("error",s,{hook:c,error:f})||console.error(`[DOMQL] Lifecycle "${c}" error:`,f),s.context?.strictMode)throw f}finally{e&&(0,A.popConfig)(),r&&(s.__ref.__inRender=!1)}}return!0}var Nt=N;
4
+ `):"")}}if(ft(o,!0),at(o,s,f),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const d=o.context?.designSystem;d&&(0,A.pushConfig)(d);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{d&&(0,A.popConfig)()}}if($("Create",o,r),$("Complete",o,r),$("Render",o,r),$("RenderRouter",o,r),lt(o,r),typeof o.onFrame=="function"){const d=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&(0,A.pushConfig)(h);try{d(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{h&&(0,A.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function It(t,s,n){const r=!s,f=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=r&&f&&t.context?.state,i=n.state!==void 0&&!o?n.state:t.state&&!(0,E.isStore)(t.state)?t.state:void 0;if(i==null){if(s?.state)t.state=s.state,(0,Y.applyStateMethods)(t,t.state);else if(t.context?.state){const c=t.context.state,e={...c},a=t.context?.polyglot;if(a?.translations){const u=c.lang||a.defaultLang||"en",p=a.translations[u];if(p&&typeof p=="object")for(const y in p)e[y]===void 0&&(e[y]=p[y]);const l=new Set(a.languages||[]);for(const y in a.translations)!l.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,Y.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,Y.applyStateMethods)(t,t.state);return}if(typeof i=="string"){if(t.state=_t(i,s),t.state&&typeof t.state=="object"&&!(0,E.isStore)(t.state)){const c=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}(0,Y.applyStateMethods)(t,t.state);return}if(typeof i=="function"){const c=i(t,s?.state);t.state=(0,E.isStore)(c)?c:(0,E.createStore)(c||{})}else(0,E.isStore)(i)?t.state=i:t.state=(0,E.createStore)({...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,(0,Y.applyStateMethods)(t,t.state)}function st(t,s){if(!s)return t;const n=s.split("/");let r=t;for(const f of n){if(r==null)return{};r=r[f]}return r??{}}function _t(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const f=t.slice(3);return f?st(s.state,f):s.state??{}}if(t.startsWith("~/")){const f=s.state?.root||s.state,o=t.slice(2);return o?st(f,o):f??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=st(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const r=s.context?.polyglot;if(r?.translations){const f=s.state?.root?.lang||r.defaultLang||"en",o=r.translations[f];if(o?.[t]!==void 0)return o[t];if(r.translations[t]!==void 0)return r.translations[t]}return{}}function Kt(t){const s=t.__ref,n=t.tag||"div",r=t.context?.designSystem,f=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const c=o[i];if(typeof t[c]!="function"||O.REGISTRY.has(c))continue;const e=c.charCodeAt(0);e>=65&&e<=90||W(c)||C.CSS_PROPS_REGISTRY[c]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(c)||(0,G.checkAttributeByTagName)(n,c)||f.push({prop:c,fn:t[c]})}for(let i=0;i<f.length;i++){const{prop:c,fn:e}=f[i];s.__exec[c]=e,Object.defineProperty(t,c,{get(){r&&(0,A.pushConfig)(r);try{return e(t,t.state,t.context)}catch{return}finally{r&&(0,A.popConfig)()}},set(a){delete s.__exec[c],Object.defineProperty(t,c,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function gt(t,s){const n=t.__ref,r=!!(s&&s.skipIfEffect);if(Kt(t),typeof t.text=="function"){const o=t.text,i=(0,v.createEffect)(()=>{if(!n.contentManaged)try{let c=o(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&typeof c!="object"&&(typeof c=="string"&&c.includes("{{")&&(c=X.replaceLiteralsWithObjectFields.call(t,c,t.state)),t.tag==="string"?t.node.nodeValue=c:t.node.textContent=c)}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,i=(0,v.createEffect)(()=>{if(n.contentManaged)return;const c=X.replaceLiteralsWithObjectFields.call(t,o,t.state);c!=null&&(t.text=c),t.node&&(t.tag==="string"?t.node.nodeValue=c??"":t.node.textContent=c??"")},{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"&&!O.REGISTRY.has(o)&&!W(o)&&!n.__exec[o]){if(C.CSS_PROPS_REGISTRY[o]){const i=t[o],c=o;let e;const a=(0,v.createEffect)(()=>{const u=t.context?.designSystem;u&&(0,A.pushConfig)(u);try{const p=i(t,t.state,t.context),l=C.CSS_PROPS_REGISTRY[c](p,t,t.state,t.context);if(l&&t.node){const y=bt(l);(y===null||y!==e)&&(e=y,B(t.node,l))}else t.node&&(c==="show"||c==="hide")&&(e=void 0,t.node.style.display="")}finally{u&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(a),n.__exec[o]=i}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const i=t[o],c=o;let e;const a=(0,v.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 l=c+":"+String(p);l!==e&&(e=l,B(t.node,{[c]:p}))}else e=void 0,t.node.style[c]=""}finally{u&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(a),n.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=(0,v.createEffect)(()=>{const c=t.context?.designSystem;c&&(0,A.pushConfig)(c);try{const e=o(t,t.state,t.context);t.node&&e!=null&&typeof e!="function"&&(t.node.innerHTML=e)}finally{c&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(i),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=(0,v.createEffect)(()=>{try{const c=o(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const e=c==null?"":String(c);if(t.node.value===e)return;const a=typeof document<"u"&&document.activeElement===t.node,u=a&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=a&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=e,a&&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;let i;const c=(0,v.createEffect)(()=>{const e=o(t,t.state,t.context),a=bt(e);(a===null||a!==i)&&(i=a,B(t.node,e))},{depth:n.path.length});n.__effects.push(c),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;let c;const e=(0,v.createEffect)(()=>{try{const a=i(t,t.state,t.context);if(t.node){const u=o+":"+String(a);u!==c&&(c=u,B(t.node,{[o]:a}))}}catch{}},{depth:n.path.length});n.__effects.push(e)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=t.attr[o],c=o,e=(0,v.createEffect)(()=>{try{const a=i(t,t.state,t.context);t.node?.setAttribute&&(a==null||a===!1?t.node.removeAttribute(c):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(c,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){const i=t.aria[o];if(typeof i!="function")continue;const c="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),e=(0,v.createEffect)(()=>{try{const a=i(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(c):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(c,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){const i=t.data[o];if(typeof i!="function")continue;const e="data-"+o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),a=(0,v.createEffect)(()=>{try{const u=i(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(e):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(e,u===!0?"":u)}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){const i=f[o];if(typeof i!="function")continue;const c=(0,v.createEffect)(()=>{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(c)}!r&&typeof t.if=="function"&&xt(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||O.REGISTRY.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||W(o))continue;const c=t[o];n.__exec[o]=c;const e=t.tag||"div";if((0,G.checkAttributeByTagName)(e,o)&&!C.CSS_PROPS_REGISTRY[o]&&!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const a=o,u=(0,v.createEffect)(()=>{try{const p=c(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(Wt(t),Bt(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let c=!1,e=[];const a=(0,v.createEffect)(()=>{const u=[];for(let _=0;_<i.length;_++){const d=i[_];try{u[_]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{u[_]=void 0}}if(!c){c=!0,e=u;return}let p=u.length!==e.length;for(let _=0;!p&&_<u.length;_++)u[_]!==e[_]&&(p=!0);const l=e;if(e=u,!p)return;const y=t.context?.designSystem;y&&(0,A.pushConfig)(y);try{o(t,t.state,t.context,{prev:l,next:u})}catch(_){if(t.context?.plugins?.length&&(0,F.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 xt(t,s,n){const r=(0,v.createEffect)(()=>{let f;try{f=n(t,t.state,t.context)}catch(i){if(f=!1,s.__ifError=i,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,i?.message||i)}return}const o=s.__if;if(s.__if=!!f,o&&!s.__if&&t.node)t.node.remove();else if(!o&&s.__if)if(s.__ifInitialized){t.node||(t.node=(0,U.cacheNode)(t)),t.node&&(t.node.ref=t);const i=t.parent,c=i?.node;if(c&&t.node){let e=null;const a=Object.keys(i),u=a.indexOf(t.key);for(let p=u+1;p<a.length;p++){const l=i[a[p]];if(l?.node?.parentNode===c){e=l.node;break}}e?c.insertBefore(t.node,e):c.appendChild(t.node)}else at(t,t.parent);nt(t)}else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,U.detectTag)(t)),$("Init",t,{}),t.node||(t.node=(0,U.cacheNode)(t)),!t.node)return;if(t.tag==="fragment"&&!s.__fragmentAnchor){const c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),s.__fragmentAnchor=c}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),St(t,{}),gt(t,{skipIfEffect:!0}),nt(t),Ct(t),kt(t,{}),at(t,t.parent),lt(t,{})}},{depth:s.path.length});s.__effects.push(r)}function nt(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),Yt(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"&&B(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const r=t.attr[n];typeof r=="function"||typeof r=="object"||r==null||r===!1||s.setAttribute&&s.setAttribute(n,r===!0?"":r)}if(t.data&&typeof t.data=="object")for(const n in t.data){const r=t.data[n];typeof r=="function"||typeof r=="object"||r==null||r===!1||s.dataset&&(s.dataset[n]=r===!0?"":r)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(r=>r&&s.classList.add(r));else if(typeof n=="object")for(const r in n){const f=typeof n[r]=="function"?n[r](t,t.state,t.context):n[r];f&&s.classList.add(typeof f=="string"?f:r)}}}}function bt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function B(t,s){if(!t||!s||!t.style)return;let n=null;for(const r in s){const f=s[r];if(f!=null){if(r.charAt(0)==="&"&&typeof f=="object"){n||(n={}),n[r]=f;continue}try{const o=String(f),i=r.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),c=o.trim(),e=/\s*!important\s*$/.test(c),a=c.replace(/\s*!important\s*$/,"");t.style.setProperty(i,a,e?"important":"")}catch{}}}n&&Vt(t,n)}let Ut=0;function Vt(t,s){const n=`_ds${Ut++}`;t.classList.add(n);const r=t.ownerDocument;let f=r.querySelector("style[data-smbls-scoped]");f||(f=r.createElement("style"),f.setAttribute("data-smbls-scoped",""),r.head.appendChild(f));let o="";for(const i in s){const c="."+n,e=i.replace(/&/g,c).split(",").map(u=>{const p=u.trim();return p.includes(c)?p:c+p}).join(", "),a=s[i];if(typeof a=="object"){let u="",p="";for(const l in a){const y=a[l];if(typeof y=="object"){const _=l.includes("&")?e.split(", ").map(h=>l.replace(/&/g,h)).join(", "):e.split(", ").map(h=>`${h} ${l}`).join(", ");let d="";for(const h in y)d+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[h]};`;p+=`${_} { ${d} }
5
+ `}else u+=`${l.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}u&&(o+=`${e} { ${u} }
6
+ `),p&&(o+=p)}}o&&(f.textContent+=o)}function Wt(t){const s=t.subscribeTo;if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let r=0;r<s.length;r++){const f=s[r];if(typeof f!="string"||f.length===0)continue;const o=f.split("."),i=o[0],c=o.slice(1),e={value:!1},a=(0,v.createEffect)(()=>{const u=t.state&&((0,E.isStore)(t.state)?t.state.root:null);if(!u||!(0,E.isStore)(u))return;let p=u;p=p[i];for(let y=0;y<c.length&&!(p==null||typeof p!="object");y++)if((0,E.isStore)(p))p=p[c[y]];else break;if(!e.value)return;let l=!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&&(l=!0)}catch(_){t.context?.plugins?.length&&(0,F.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&(0,A.popConfig)()}}if(!l&&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(!l&&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,F.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 ct(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)])}function H(t,s,n){const r={},f=(o,i)=>{if(C.CSS_PROPS_REGISTRY[o]){const c=C.CSS_PROPS_REGISTRY[o](i,s,s.state,s.context);if(c){const e=Array.isArray(c)?c:[c];for(const a of e)a&&Object.assign(r,a)}}else r[o]=i};for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let i=t[o];if(typeof i=="function"&&(i=i(s,s.state,s.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(o==="style"){for(const a in i){let u=i[a];typeof u=="function"&&(u=u(s,s.state,s.context)),!(u==null||typeof u=="function")&&f(a,u)}continue}if(ct(o,s)){const a=H(i,s,!0);Object.keys(a).length&&(r[`[data-theme="${o.slice(1)}"] &`]=a);continue}let c=o;if(o.charCodeAt(0)===64&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const a=s.context?.designSystem?.media?.[o.slice(1)];a&&(c=`@media ${a}`)}const e=H(i,s,!1);Object.keys(e).length&&(r[c]=e);continue}f(o,i)}}if(n)for(const o in r){const i=r[o];typeof i=="string"&&!i.includes("!important")&&(r[o]=i+" !important")}return r}function Bt(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;const f=r.charAt(0);if(f!=="."&&f!=="!")continue;const o=r.slice(1);if(!o)continue;const i=t[r];if(!i||typeof i!="object")continue;const c=f==="!",e={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{if(!t.node)return;let p;const l=t[o];if(l===void 0)if(t.state&&o in t.state)p=t.state[o];else{const d=t.context?.cases?.[o];if(d===void 0)return;try{p=typeof d=="function"?d.call(t,t):d}catch(h){p=!1,s.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof l=="function")try{p=l(t,t.state,t.context)}catch(d){p=!1,s.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else p=l;const y=c?!p:!!p;if(y===e.lastMatch)return;e.lastMatch=y;const _=t.context?.designSystem;_&&(0,A.pushConfig)(_);try{if(y){const d={},h={};let g=!1;for(const x in i){if(!Object.prototype.hasOwnProperty.call(i,x))continue;const k=i[x],P=x.charAt(0);if((P===":"||P==="@"||P==="&")&&k&&typeof k=="object"&&!Array.isArray(k)){if(ct(x,t)){const j=H(k,t,!0);Object.keys(j).length&&(h[`[data-theme="${x.slice(1)}"] &`]=j,g=!0)}else{let j=x;if(P==="@"&&!x.startsWith("@media")&&!x.startsWith("@keyframes")){const I=t.context?.designSystem?.media?.[x.slice(1)];I&&(j=`@media ${I}`)}const D=H(k,t,!1);Object.keys(D).length&&(h[j]=D,g=!0)}continue}const M=typeof k=="function"?k(t,t.state,t.context):k;if(M!=null)if(C.CSS_PROPS_REGISTRY[x]){const j=C.CSS_PROPS_REGISTRY[x](M,t,t.state,t.context);if(j){const D=Array.isArray(j)?j:[j];for(const I of D)I&&Object.assign(d,I)}}else C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(x)&&(d[x]=M)}const b=Object.keys(d);if(b.length){B(t.node,d);for(const x of b)n.set(x,r);e.appliedKeys=b}else e.appliedKeys=null;if(g){const x=(0,J.css)(h,null,t.context?.cssPrefix),k=x?x.split(" ").filter(Boolean):[];if(k.length&&t.node.classList){for(const P of k)t.node.classList.add(P);e.appliedClasses=k}else e.appliedClasses=null}else if(e.appliedClasses){for(const x of e.appliedClasses)t.node.classList.remove(x);e.appliedClasses=null}}else{if(e.appliedKeys){for(const d of e.appliedKeys)n.get(d)===r&&(t.node.style[d]="",n.delete(d));e.appliedKeys=null}if(e.appliedClasses){for(const d of e.appliedClasses)t.node.classList.remove(d);e.appliedClasses=null}}}finally{_&&(0,A.popConfig)()}};s.__conditionalRunners.push(a);const u=(0,v.createEffect)(a,{depth:s.path.length});s.__effects.push(u)}}const it=new WeakSet;function Ht(t){const s=t.ownerDocument;!s||it.has(s)||(it.add(s),queueMicrotask(()=>{it.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const rt=new WeakSet;let At=!1;function Yt(t){const{node:s}=t;if(!s)return;if(At||(At=!0,(0,J.css)({display:"none"})),rt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}rt.add(t);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{const r={};let f=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||O.REGISTRY.has(o))continue;const i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!W(o)){if(C.CSS_PROPS_REGISTRY[o]){const c=t[o],e=C.CSS_PROPS_REGISTRY[o](c,t,t.state,t.context);if(e){if(Array.isArray(e))for(const a of e)a&&Object.assign(r,a);else Object.assign(r,e);f=!0}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const c=t[o];c!=null&&typeof c!="object"&&(r[o]=c,f=!0)}else if(o.charCodeAt(0)===45){const c=t[o];c!=null&&typeof c!="object"&&(r[o]=c,f=!0)}else if(o.charAt(0)==="&"){const c=t[o];c&&typeof c=="object"&&(r[o]=c,f=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const c=t[o];if(c&&typeof c=="object"){if(ct(o,t)){const e=H(c,t,!0);Object.keys(e).length&&(r[`[data-theme="${o.slice(1)}"] &`]=e,f=!0)}else{let e=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const u=t.context?.designSystem?.media?.[o.slice(1)];u&&(e=`@media ${u}`)}const a=H(c,t,!1);Object.keys(a).length&&(r[e]=a,f=!0)}f=!0}}}}if(f){r.display&&String(r.display).includes("!important")&&(s.style.setProperty("display",String(r.display).replace(/\s*!important\s*$/,""),"important"),delete r.display);const o=(0,J.css)(r,null,t.context?.cssPrefix);if(o&&s.classList){const c=o.split(" ").filter(Boolean);let e=!1;for(const a of c)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&&Ht(s)}const i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){const c=r.display;if(c&&c!==i)if(i==="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)(),rt.delete(t)}}function Ct(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 i="aria-"+f.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());s.setAttribute(i,o===!0?"":o)}const n=(0,G.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 r=t.tag||"div";for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f)||typeof t[f]=="function"||O.REGISTRY.has(f)||f==="on"||n[f]!==void 0)continue;const o=f.charCodeAt(0);if(!(o>=65&&o<=90)&&!W(f)&&!(C.CSS_PROPS_REGISTRY[f]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(f))&&(0,G.checkAttributeByTagName)(r,f)){let i=t[f];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=(0,X.replaceLiteralsWithObjectFields)(i,t,t.state,t.context),t[f]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;s.setAttribute(f,i===!0?"":i)}}}function Gt(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,r=n&&typeof n=="object"&&n.max?String(n.max):null;r&&(s.style.maxHeight=r);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 vt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function St(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!W(n)||vt.has(n))continue;let r=t[n];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const o=r;r=function(c){return t.call(o,c)}}if(typeof r!="function")continue;const f=Dt(n);O.LIFECYCLE_EVENTS.has(f)||(0,jt.registerEvent)(Ft(f),t,r)}qt(t)}function qt(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let r=!1;for(const l of vt){const y=t[l];typeof y=="function"&&(n[l]=y,r=!0)}if(!r)return;const f=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,c=0,e=0,a=!1;const u=l=>{const y=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];y&&(i=y.clientX,c=y.clientY,e=Date.now(),a=!0)},p=l=>{if(!a)return;a=!1;const y=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!y)return;const _=y.clientX-i,d=y.clientY-c,h=Date.now()-e;if(h>o)return;const g=Math.abs(_),b=Math.abs(d);if(Math.max(g,b)<f)return;let x;if(g>b*1.2)x=_<0?"left":"right";else if(b>g*1.2)x=d<0?"up":"down";else return;const k="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),P=n[k],M=n.onSwipe;P&&P.call(t,l,t,t.state,t.context),M&&M.call(t,{direction:x,dx:_,dy:d,dt:h,event:l},t,t.state,t.context)};s.addEventListener("touchstart",u,{passive:!0}),s.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",u)}catch{}try{s.removeEventListener("touchend",p)}catch{}})}function Q(t,s){const n={...t};for(const r in s){const f=n[r],o=s[r];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[r]=Q(f,o):n[r]=o}return n}function et(t,s,n){if(!s||!t.node)return;const r=t.childExtends;if(Array.isArray(s)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,i=f?null:o?.createDocumentFragment();if(!f&&!i)return;const c=t.childProps,e=t.childrenAs;for(let a=0;a<s.length;a++){let u=s[a];const p=u;(typeof u=="string"||typeof u=="number")&&(u={text:u});let l=c;if(typeof c=="function")try{l=c(t,u)}catch{l=null}if(e==="state"){let d=p;(typeof p=="string"||typeof p=="number")&&(d={value:p,text:p}),u=l?{...l,state:d}:{state:d}}else l&&(u=Q(l,u));if(r&&!u.ignoreChildExtends)if(u.extends){const d=Array.isArray(u.extends)?u.extends:[u.extends],h=Array.isArray(r)?r:[r];u={...u,extends:[...h,...d]}}else u={...u,extends:r};const y=u?.key||p&&typeof p=="object"&&p.key||`${a}`,_=K(u,t,y,n);!f&&_?.node&&i.appendChild(_.node)}f||t.node.appendChild(i);return}if(typeof s=="string"){const f=_t(s,t);if(Array.isArray(f)){et(t,f,n);return}}if(typeof s=="object")for(const f in s){if(O.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=Q(t.childProps,o)),r&&!o.ignoreChildExtends)if(o.extends){const i=Array.isArray(o.extends)?o.extends:[o.extends],c=Array.isArray(r)?r:[r];o={...o,extends:[...c,...i]}}else o={...o,extends:r};K(o,t,f,n)}}}function ft(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const r=n.options;if(!r||!r.length)return;const f=t.__ref,o=f&&f.__exec&&f.__exec.value,i=typeof o=="function",c=t.value!=null&&typeof t.value!="function";if(i||c){let u;if(i)try{u=o(t,t.state,t.context)}catch{return}else u=t.value;const p=u==null?"":String(u);n.value!==p&&(n.value=p);return}const e=s||!(f&&f.__selectSynced);if(f&&(f.__selectSynced=!0),!e)return;let a=-1;for(let u=0;u<r.length;u++)r[u].defaultSelected&&(a=u);a>=0&&n.selectedIndex!==a&&(n.selectedIndex=a)}function kt(t,s){let{children:n,content:r}=t;const f=t.childExtends;if(typeof n=="function"){const i=n;n=i(t,t.state,t.context),t.children=n;const c=t.__ref;let e=!1;const a=(0,v.createEffect)(()=>{const u=i(t,t.state,t.context);if(!e){e=!0;return}if(u===t.children)return;t.children=u;const p=typeof t.onContentUpdate=="function",l=p?[]:null,y=p?[]:null,_=p?[]:null;if(Array.isArray(u)&&t.childrenAs==="state"){const b=t.childProps,x=[],k=new Map;for(let w=0;w<u.length;w++){const T=u[w];let S=b;if(typeof b=="function")try{S=b(t,T)}catch{S=null}const V=S&&S.key||T&&T.key||`${w}`;x.push(V),k.set(V,{rawChild:T,childProps:S})}const P=new Set(x),M=c.__children.slice();for(const w of M)if(!P.has(w)){const T=t[w];T?.remove&&T.remove(),delete t[w],y&&y.push(w)}const j=t.childExtends,D=t.tag==="fragment",I=t.context?.document||globalThis.document,q=D?null:I?.createDocumentFragment();for(const w of x){const T=k.get(w),S=T.rawChild,V=t[w];if(V&&V.state){if(S&&typeof S=="object"){const R=V.state;if(typeof R.replace=="function")R.replace(S);else if(typeof R.update=="function"){for(const L in R)if(!(L==="__element"||L==="root"||L==="parent"||L==="update")&&!Object.prototype.hasOwnProperty.call(S,L))try{R[L]=void 0}catch{}R.update(S)}else for(const L in S)R[L]=S[L]}_&&_.push(w);continue}let m=S;(typeof S=="string"||typeof S=="number")&&(m={value:S,text:S});const dt=T.childProps;let N=dt?{...dt,state:m}:{state:m};if(j&&!N.ignoreChildExtends)if(N.extends){const R=Array.isArray(N.extends)?N.extends:[N.extends],L=Array.isArray(j)?j:[j];N={...N,extends:[...L,...R]}}else N={...N,extends:j};const pt=K(N,t,w,s);!D&&pt?.node&&q&&q.appendChild(pt.node),l&&l.push(w)}!D&&q&&q.childNodes.length&&t.node&&t.node.appendChild(q),c.__children=x,p&&(l.length||y.length)&&yt(t,{added:l,removed:y,kept:_}),ft(t,!1);return}const g=p?[...c.__children]:null;for(const b of[...c.__children]){const x=t[b];x?.remove&&x.remove(),delete t[b]}c.__children=[],et(t,u,s),ft(t,!1),p&&yt(t,{added:[...c.__children],removed:g,kept:[]})},{depth:c.path.length});c.__effects.push(a)}if(et(t,n||r,s),n||r)return;const o=t.context?.components||{};{const i=Object.keys(t);for(let c=0;c<i.length;c++){const e=i[c];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 u={extends:t[e]};delete t[e];for(let p=c+1;p<i.length;p++){const l=i[p],y=l.charCodeAt(0);if(y>=65&&y<=90||O.REGISTRY.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const _=t[l];_!==void 0&&(u[l]=_,delete t[l])}t[a]&&typeof t[a]=="object"?t[a]={...u,...t[a]}:t[a]=u}}for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||O.REGISTRY.has(i)||typeof t[i]!="object"||t[i]===null)continue;const c=i.charCodeAt(0);if(c<65||c>90)continue;let e=t[i];if(!e.__ref){if(!e.extends&&!e.extend){const a=o[i]||o[`smbls.${i}`];a&&(e={...e,extends:a})}if(t.childProps&&(e=Q(t.childProps,e)),f&&!e.ignoreChildExtends)if(e.extends){const a=Array.isArray(e.extends)?e.extends:[e.extends],u=Array.isArray(f)?f:[f];e={...e,extends:[...u,...a]}}else e={...e,extends:f};K(e,t,i,s)}}}function at(t,s,n){const{node:r}=t;if(!r)return;r.ref=t;const f=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(f){const i=f.parentNode;if(i){if(n?.position==="before"&&n.node)i.insertBefore(r,n.node);else if(n?.position==="after"&&n.node){const c=n.node.nextSibling;i.insertBefore(r,c||f)}else i.insertBefore(r,f);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(r,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;i?o.insertBefore(r,i):o.appendChild(r)}else o.appendChild(r)}function $(t,s,n){const r=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,F.runPluginHook)(r,s,n);const f="on"+t,o=s[f];if(typeof o=="function"){const i=t==="Render"||t==="RenderRouter";if(i){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const c=s.context?.designSystem;c&&(0,A.pushConfig)(c);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(e){if(s.context?.plugins?.length&&(0,F.runPluginHook)("error",s,{hook:f,error:e})||console.error(`[DOMQL] Lifecycle "${f}" error:`,e),s.context?.strictMode)throw e}finally{c&&(0,A.popConfig)(),i&&(s.__ref.__inRender=!1)}}return!0}var Zt=K;
@@ -1 +1 @@
1
- var s=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var i=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var G=(e,r)=>{for(var E in r)p(e,E,{get:r[E],enumerable:!0})},x=(e,r,E,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of c(r))!l.call(e,a)&&a!==E&&p(e,a,{get:()=>r[a],enumerable:!(f=v(r,a))||f.enumerable});return e};var I=(e,r,E)=>(E=e!=null?s(i(e)):{},x(r||!e||!e.__esModule?p(E,"default",{value:e,enumerable:!0}):E,e)),L=e=>x(p({},"__esModule",{value:!0}),e);var V={};G(V,{DELEGATED_EVENTS:()=>t.DELEGATED_EVENTS,LIFECYCLE_EVENTS:()=>t.LIFECYCLE_EVENTS,MIXINS:()=>t.MIXINS,NON_BUBBLING_EVENTS:()=>t.NON_BUBBLING_EVENTS,REGISTRY:()=>t.REGISTRY,SVG_TAGS:()=>o.SVG_TAGS,addDelegatedEvent:()=>d.addDelegatedEvent,addMethods:()=>g.addMethods,applyExtends:()=>S.applyExtends,cacheNode:()=>o.cacheNode,create:()=>m.create,createHTMLNode:()=>o.createHTMLNode,default:()=>m.default,detectTag:()=>o.detectTag,dispose:()=>T.dispose,isSvgTag:()=>o.isSvgTag,isValidTag:()=>o.isValidTag,registerEvent:()=>d.registerEvent,remove:()=>T.remove,removeDelegatedEvent:()=>d.removeDelegatedEvent,update:()=>N.update});module.exports=L(V);var m=I(require("./create.js"),1),N=require("./update.js"),T=require("./dispose.js"),t=require("./registry.js"),d=require("./delegate.js"),o=require("./cache.js"),S=require("./extends.js"),g=require("./methods.js");
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 +1 @@
1
- "use strict";var r=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var a in e)r(t,a,{get:e[a],enumerable:!0})},l=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!c.call(t,o)&&o!==a&&r(t,o,{get:()=>e[o],enumerable:!(s=n(e,o))||s.enumerable});return t};var i=t=>l(r({},"__esModule",{value:!0}),t);var x={};p(x,{DELEGATED_EVENTS:()=>E,LIFECYCLE_EVENTS:()=>m,MIXINS:()=>h,NON_BUBBLING_EVENTS:()=>v,PASSIVE_EVENTS:()=>g,REGISTRY:()=>u});module.exports=i(x);const u=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","__name","__ref","__hash","__text","parent","node"]),h={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},m=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),v=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),g=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),E=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);
1
+ "use strict";var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var a in e)r(t,a,{get:e[a],enumerable:!0})},l=(t,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!c.call(t,o)&&o!==a&&r(t,o,{get:()=>e[o],enumerable:!(n=s(e,o))||n.enumerable});return t};var u=t=>l(r({},"__esModule",{value:!0}),t);var x={};p(x,{DELEGATED_EVENTS:()=>E,LIFECYCLE_EVENTS:()=>m,MIXINS:()=>h,NON_BUBBLING_EVENTS:()=>v,PASSIVE_EVENTS:()=>g,REGISTRY:()=>i});module.exports=u(x);const i=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","__name","__ref","__hash","__text","parent","node"]),h={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},m=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),v=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),g=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),E=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);
@@ -1 +1 @@
1
- const i="http://www.w3.org/2000/svg",s=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),p=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function l(e){return p.has(e)||s.has(e)}function d(e){return s.has(e)}function g(e){let{tag:t,key:o}=e;if(typeof t=="function"&&(t=t(e)),t===!0&&(t=o),typeof t=="string"&&l(t))return t;if(!o||typeof o!="string")return"div";const n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template"]);let r=o.toLowerCase();return r.includes(".")&&(r=r.split(".")[0]),r.includes("_")&&(r=r.split("_")[0]),l(r)&&!n.has(r)?r:"div"}const f={};function u(e,t){const o=t?.context?.document||globalThis.document;if(!o)return null;if(e==="string")return o.createTextNode(t?.text||"");if(e==="fragment")return o.createDocumentFragment();if(d(e)){const n=t?.parent;if(e==="svg"||n?.node?.namespaceURI===i)return o.createElementNS(i,e);if(e!=="svg")return o.createElement("div")}return o.createElement(e)}function m(e){const t=e.tag=g(e),n=d(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,r=e?.context?.document||globalThis.document;let a=f[n];if(a||(a=f[n]=u(t,e)),!a)return null;const c=r&&a.ownerDocument!==r?u(t,e):a.cloneNode(!0);return t==="string"&&(c.nodeValue=e.text||""),c}export{i as SVG_NS,s as SVG_TAGS,m as cacheNode,u as createHTMLNode,g as detectTag,d as isSvgTag,l as isValidTag};
1
+ const i="http://www.w3.org/2000/svg",s=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),p=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function l(e){return p.has(e)||s.has(e)}function d(e){return s.has(e)}function g(e){let{tag:t,key:r}=e;if(typeof t=="function"&&(t=t(e)),t===!0&&(t=r),typeof t=="string"&&l(t))return t;if(!r||typeof r!="string")return"div";const n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]);let o=r.toLowerCase();return o.includes(".")&&(o=o.split(".")[0]),o.includes("_")&&(o=o.split("_")[0]),l(o)&&!n.has(o)?o:"div"}const f={};function u(e,t){const r=t?.context?.document||globalThis.document;if(!r)return null;if(e==="string")return r.createTextNode(t?.text||"");if(e==="fragment")return r.createDocumentFragment();if(d(e)){const n=t?.parent;if(e==="svg"||n?.node?.namespaceURI===i)return r.createElementNS(i,e);if(e!=="svg")return r.createElement("div")}return r.createElement(e)}function m(e){const t=e.tag=g(e),n=d(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,o=e?.context?.document||globalThis.document;let a=f[n];if(a||(a=f[n]=u(t,e)),!a)return null;const c=o&&a.ownerDocument!==o?u(t,e):a.cloneNode(!0);return t==="string"&&(c.nodeValue=e.text||""),c}export{i as SVG_NS,s as SVG_TAGS,m as cacheNode,u as createHTMLNode,g as detectTag,d as isSvgTag,l as isValidTag};
@@ -1,6 +1,6 @@
1
- import{createStore as U,createScopeStore as lt,isStore as R}from"@symbo.ls/signal";import{createEffect as A}from"@symbo.ls/signal";import{cacheNode as Y,detectTag as nt}from"./cache.js";import{REGISTRY as N,LIFECYCLE_EVENTS as ht}from"./registry.js";import{registerEvent as _t}from"./delegate.js";import{applyExtends as gt}from"./extends.js";import{addMethods as bt}from"./methods.js";import"./dispose.js";import{replaceLiteralsWithObjectFields as G}from"@symbo.ls/utils";import{runPluginHook as Z}from"@symbo.ls/utils/function.js";import{applyStateMethods as V}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as C,DEFAULT_CSS_PROPERTIES_LIST as j}from"css-in-props";import{css as rt}from"@symbo.ls/css";import{pushConfig as P,popConfig as O}from"@symbo.ls/scratch";import{checkAttributeByTagName as z,applyAttrTransforms as xt}from"attrs-in-props";let At=1;function F(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function vt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function St(t){return t.toLowerCase()}function it(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function W(t,s){const n={...t};for(const e in s){const c=n[e],o=s[e];c&&o&&typeof c=="object"&&typeof o=="object"&&!Array.isArray(c)&&!Array.isArray(o)&&typeof c!="function"&&typeof o!="function"?n[e]=W(c,o):n[e]=o}return n}function K(t,s,n,e={},c){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||`_${At++}`,o.parent=s||null,o.context=t.context||s?.context||e.context||{},o.context.__create||(o.context.__create=K);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 h=n.indexOf("_");if(h>0){const _=n.substring(0,h),g=o.context?.components;g&&(g[_]||g["smbls."+_])&&(t={...t,extends:_})}}gt(o,t,e);const i=new Set(["childProps","attr","style","scope","data"]),f=o.props&&typeof o.props=="object"?o.props:null;for(const h in t){if(h==="parent"||h==="node"||h==="__ref"||h==="extends"||h==="context"||h==="props")continue;const _=t[h],g=o[h],b=g&&_&&typeof g=="object"&&typeof _=="object"&&!Array.isArray(g)&&!Array.isArray(_)&&typeof g!="function"&&typeof _!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=W(g,_):b&&i.has(h)?o[h]={...g,..._}:b&&it(h)?o[h]=W(g,_):o[h]=_}function a(h){for(const _ in h){const g=h[_],b=o[_],v=b&&g&&typeof b=="object"&&typeof g=="object"&&!Array.isArray(b)&&!Array.isArray(g)&&typeof b!="function"&&typeof g!="function";v&&_.charCodeAt(0)>=65&&_.charCodeAt(0)<=90?o[_]=W(b,g):v&&i.has(_)?o[_]={...b,...g}:v&&it(_)?o[_]=W(b,g):o[_]=g}}f&&a(f),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 u=o.scope&&typeof o.scope=="object"?o.scope:null,d=s?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=d||p||null;if(t.scope!==void 0||u){const h={};u&&Object.assign(h,u),t.scope!==void 0&&Object.assign(h,t.scope),o.scope=lt(h,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),bt(o),Ct(o,s,t),o.if!=null){let h;if(typeof o.if=="function")try{h=o.if(o,o.state,o.context)}catch(_){if(h=!1,r.__ifError=_,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,_?.message||_)}}else h=o.if;r.__if=!!h}if(r.__if)typeof t.if=="function"&&(r.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof t.if=="function"&&X(o,{if:t.if}),o;o.tag||(o.tag=nt(o)),$("Init",o,e);const l=o.node=Y(o);if(!l)return o;if(o.tag==="fragment"){const _=(o.context?.document||globalThis.document).createComment("");l.appendChild(_),r.__fragmentAnchor=_}$("AttachNode",o,e),l.setAttribute&&o.key&&l.setAttribute("data-key",o.key),l.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&l.setAttribute("data-smbls-app",o.context.key),o.id&&l.setAttribute&&(l.id=o.id),pt(o,e),X(o,t),Q(o),ut(o),Tt(o);try{yt(o,e)}catch(h){if(typeof console<"u"&&console.error){const _=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${_}:`,h?.message||h,h?.stack?`
2
- `+h.stack.split(`
1
+ import{createStore as J,createScopeStore as Pt,isStore as F}from"@symbo.ls/signal";import{createEffect as C}from"@symbo.ls/signal";import{cacheNode as m,detectTag as yt}from"./cache.js";import{REGISTRY as I,LIFECYCLE_EVENTS as Lt}from"./registry.js";import{registerEvent as Ot}from"./delegate.js";import{applyExtends as Tt}from"./extends.js";import{addMethods as Nt}from"./methods.js";import"./dispose.js";import{replaceLiteralsWithObjectFields as tt}from"@symbo.ls/utils";import{runPluginHook as U}from"@symbo.ls/utils/function.js";import{applyStateMethods as q}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as O,DEFAULT_CSS_PROPERTIES_LIST as E}from"css-in-props";import{css as ot}from"@symbo.ls/css";import{pushConfig as j,popConfig as w}from"@symbo.ls/scratch";import{checkAttributeByTagName as st,applyAttrTransforms as Rt}from"attrs-in-props";let $t=1;const z=[];let nt=!1;function Mt(){nt||(nt=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(ht):setTimeout(ht,0))}function ht(){if(nt=!1,!z.length)return;const t=z.splice(0,z.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||$("Mounted",n,n.__ref?.__mountOptions||{})}}function _t(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,z.push(t),Mt())}function gt(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&U("contentUpdate",t,s);const n=t.context?.designSystem;n&&j(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(r){if(t.context?.plugins?.length&&U("error",t,{hook:"onContentUpdate",error:r})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',r),t.context?.strictMode)throw r}finally{n&&w()}}function W(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Dt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Ft(t){return t.toLowerCase()}function xt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function Z(t,s){const n={...t};for(const r in s){const f=n[r],o=s[r];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[r]=Z(f,o):n[r]=o}return n}function B(t,s,n,r={},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||`_${$t++}`,o.parent=s||null,o.context=t.context||s?.context||r.context||{},o.context.__create||(o.context.__create=B);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 d=n.indexOf("_");if(d>0){const h=n.substring(0,d),g=o.context?.components;g&&(g[h]||g["smbls."+h])&&(t={...t,extends:h})}}Tt(o,t,r);const c=new Set(["childProps","attr","style","scope","data"]),e=o.props&&typeof o.props=="object"?o.props:null;for(const d in t){if(d==="parent"||d==="node"||d==="__ref"||d==="extends"||d==="context"||d==="props")continue;const h=t[d],g=o[d],b=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";b&&d.charCodeAt(0)>=65&&d.charCodeAt(0)<=90?o[d]=Z(g,h):b&&c.has(d)?o[d]={...g,...h}:b&&xt(d)?o[d]=Z(g,h):o[d]=h}function a(d){for(const h in d){const g=d[h],b=o[h],x=b&&g&&typeof b=="object"&&typeof g=="object"&&!Array.isArray(b)&&!Array.isArray(g)&&typeof b!="function"&&typeof g!="function";x&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=Z(b,g):x&&c.has(h)?o[h]={...b,...g}:x&&xt(h)?o[h]=Z(b,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 u=o.scope&&typeof o.scope=="object"?o.scope:null,p=s?.scope,l=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=p||l||null;if(t.scope!==void 0||u){const d={};u&&Object.assign(d,u),t.scope!==void 0&&Object.assign(d,t.scope),o.scope=Pt(d,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),Nt(o),It(o,s,t),o.if!=null){let d;if(typeof o.if=="function")try{d=o.if(o,o.state,o.context)}catch(h){if(d=!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 d=o.if;i.__if=!!d}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&Ct(o,i,o.if),o;o.tag||(o.tag=yt(o)),$("Init",o,r);const _=o.node=m(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),i.__fragmentAnchor=h}$("AttachNode",o,r),_.setAttribute&&o.key&&_.setAttribute("data-key",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),wt(o,r),At(o),it(o),kt(o),Gt(o);try{Et(o,r)}catch(d){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,d?.message||d,d?.stack?`
2
+ `+d.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(ot(o,s,c),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const h=o.context?.designSystem;h&&P(h);try{const _=o.html(o,o.state,o.context);_!=null&&typeof _!="function"&&(o.node.innerHTML=_)}catch{}finally{h&&O()}}if($("Create",o,e),$("Complete",o,e),$("Render",o,e),$("RenderRouter",o,e),typeof o.onFrame=="function"){const h=o.onFrame,_=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){_&&P(_);try{h(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{_&&O()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Ct(t,s,n){const e=!s,c=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=e&&c&&t.context?.state,r=n.state!==void 0&&!o?n.state:t.state&&!R(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,V(t,t.state);else if(t.context?.state){const i=t.context.state,f={...i},a=t.context?.polyglot;if(a?.translations){const u=i.lang||a.defaultLang||"en",d=a.translations[u];if(d&&typeof d=="object")for(const y in d)f[y]===void 0&&(f[y]=d[y]);const p=new Set(a.languages||[]);for(const y in a.translations)!p.has(y)&&f[y]===void 0&&(f[y]=a.translations[y])}t.state=R(f)?f:U(f),t.state.__element=t,t.state.root=t.state,V(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),V(t,t.state);return}if(typeof r=="string"){if(t.state=et(r,s),t.state&&typeof t.state=="object"&&!R(t.state)){const i=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}V(t,t.state);return}if(typeof r=="function"){const i=r(t,s?.state);t.state=R(i)?i:U(i||{})}else R(r)?t.state=r:t.state=U({...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,V(t,t.state)}function q(t,s){if(!s)return t;const n=s.split("/");let e=t;for(const c of n){if(e==null)return{};e=e[c]}return e??{}}function et(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const c=t.slice(3);return c?q(s.state,c):s.state??{}}if(t.startsWith("~/")){const c=s.state?.root||s.state,o=t.slice(2);return o?q(c,o):c??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=q(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const e=s.context?.polyglot;if(e?.translations){const c=s.state?.root?.lang||e.defaultLang||"en",o=e.translations[c];if(o?.[t]!==void 0)return o[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}function jt(t){const s=t.__ref,n=t.tag||"div",e=t.context?.designSystem,c=[],o=Object.keys(t);for(let r=0;r<o.length;r++){const i=o[r];if(typeof t[i]!="function"||N.has(i))continue;const f=i.charCodeAt(0);f>=65&&f<=90||F(i)||C[i]||j&&j.has(i)||z(n,i)||c.push({prop:i,fn:t[i]})}for(let r=0;r<c.length;r++){const{prop:i,fn:f}=c[r];s.__exec[i]=f,Object.defineProperty(t,i,{get(){e&&P(e);try{return f(t,t.state,t.context)}catch{return}finally{e&&O()}},set(a){delete s.__exec[i],Object.defineProperty(t,i,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function X(t,s){const n=t.__ref;if(jt(t),typeof t.text=="function"){const c=t.text,o=A(()=>{if(!n.contentManaged)try{let r=c(t,t.state,t.context);t.node&&r!=null&&typeof r!="function"&&typeof r!="object"&&(typeof r=="string"&&r.includes("{{")&&(r=G.call(t,r,t.state)),t.tag==="string"?t.node.nodeValue=r:t.node.textContent=r)}catch{}},{depth:n.path.length});n.__effects.push(o),n.__exec.text=c}else if(typeof t.text=="string"&&t.text.includes("{{")){const c=t.text,o=A(()=>{if(n.contentManaged)return;const r=G.call(t,c,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(o),n.__exec.text=c}for(const c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&typeof t[c]=="function"&&!N.has(c)&&!F(c)&&!n.__exec[c]){if(C[c]){const o=t[c],r=c;let i;const f=A(()=>{const a=t.context?.designSystem;a&&P(a);try{const u=o(t,t.state,t.context),d=C[r](u,t,t.state,t.context);if(d&&t.node){const p=ft(d);(p===null||p!==i)&&(i=p,I(t.node,d))}else t.node&&(r==="show"||r==="hide")&&(i=void 0,t.node.style.display="")}finally{a&&O()}},{depth:n.path.length});n.__effects.push(f),n.__exec[c]=o}else if(j&&j.has(c)){const o=t[c],r=c;let i;const f=A(()=>{const a=t.context?.designSystem;a&&P(a);try{const u=o(t,t.state,t.context);if(t.node)if(u!=null){const d=r+":"+String(u);d!==i&&(i=d,I(t.node,{[r]:u}))}else i=void 0,t.node.style[r]=""}finally{a&&O()}},{depth:n.path.length});n.__effects.push(f),n.__exec[c]=o}}if(typeof s.html=="function"){const c=s.html,o=A(()=>{const r=t.context?.designSystem;r&&P(r);try{const i=c(t,t.state,t.context);t.node&&i!=null&&typeof i!="function"&&(t.node.innerHTML=i)}finally{r&&O()}},{depth:n.path.length});n.__effects.push(o),n.__exec.html=c}if(typeof s.value=="function"){const c=s.value,o=A(()=>{try{const r=c(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const i=r==null?"":String(r);if(t.node.value===i)return;const f=typeof document<"u"&&document.activeElement===t.node,a=f&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,u=f&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=i,f&&a!=null&&u!=null)try{t.node.setSelectionRange(a,u)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(o),n.__exec.value=c}if(typeof s.style=="function"){const c=s.style;let o;const r=A(()=>{const i=c(t,t.state,t.context),f=ft(i);(f===null||f!==o)&&(o=f,I(t.node,i))},{depth:n.path.length});n.__effects.push(r),n.__exec.style=c}else if(t.style&&typeof t.style=="object")for(const c in t.style){const o=t.style[c];if(typeof o!="function")continue;let r;const i=A(()=>{try{const f=o(t,t.state,t.context);if(t.node){const a=c+":"+String(f);a!==r&&(r=a,I(t.node,{[c]:f}))}}catch{}},{depth:n.path.length});n.__effects.push(i)}if(t.attr&&typeof t.attr=="object"){for(const c in t.attr)if(typeof t.attr[c]=="function"){const o=t.attr[c],r=c,i=A(()=>{try{const f=o(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(i)}}if(t.aria&&typeof t.aria=="object")for(const c in t.aria){const o=t.aria[c];if(typeof o!="function")continue;const r="aria-"+c.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),i=A(()=>{try{const f=o(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(i)}if(t.data&&typeof t.data=="object")for(const c in t.data){const o=t.data[c];if(typeof o!="function")continue;const i="data-"+c.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),f=A(()=>{try{const a=o(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(f)}const e=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(e)for(const c in e){const o=e[c];if(typeof o!="function")continue;const r=A(()=>{try{const i=o(t,t.state,t.context);if(!t.node?.classList)return;typeof i=="string"?t.node.classList.add(i):i?t.node.classList.add(c):t.node.classList.remove(c)}catch{}},{depth:n.path.length});n.__effects.push(r)}if(typeof s.if=="function"){const c=s.if,o=A(()=>{let r;try{r=c(t,t.state,t.context)}catch(f){if(r=!1,n.__ifError=f,typeof console<"u"&&console.warn){const a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,f?.message||f)}return}const i=n.__if;if(n.__if=!!r,i&&!n.__if&&t.node)t.node.remove();else if(!i&&n.__if)if(n.__ifInitialized){t.node||(t.node=Y(t)),t.node&&(t.node.ref=t);const f=t.parent,a=f?.node;if(a&&t.node){let u=null;const d=Object.keys(f),p=d.indexOf(t.key);for(let y=p+1;y<d.length;y++){const l=f[d[y]];if(l?.node?.parentNode===a){u=l.node;break}}u?a.insertBefore(t.node,u):a.appendChild(t.node)}else ot(t,t.parent);Q(t)}else{if(n.__ifInitialized=!0,t.tag||(t.tag=nt(t)),$("Init",t,{}),t.node||(t.node=Y(t)),!t.node)return;if(t.tag==="fragment"&&!n.__fragmentAnchor){const u=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(u),n.__fragmentAnchor=u}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),pt(t,{});const f=s.if;delete s.if;try{X(t,s)}finally{s.if=f}Q(t),ut(t),yt(t,{}),ot(t,t.parent)}},{depth:n.path.length});n.__effects.push(o)}for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||N.has(c)||typeof t[c]!="function")continue;const o=c.charCodeAt(0);if(o>=65&&o<=90||F(c))continue;const r=t[c];n.__exec[c]=r;const i=t.tag||"div";if(z(i,c)&&!C[c]&&!(j&&j.has(c))){const f=c,a=A(()=>{try{const u=r(t,t.state,t.context);t.node?.setAttribute&&(u==null||u===!1?t.node.removeAttribute(f):typeof u!="function"&&typeof u!="object"&&(f==="src"&&"src"in t.node?t.node.src=u:t.node.setAttribute(f,u===!0?"":u)))}catch{}},{depth:n.path.length});n.__effects.push(a)}}Et(t),Pt(t)}function Q(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),Lt(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"&&I(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const e=t.attr[n];typeof e=="function"||typeof e=="object"||e==null||e===!1||s.setAttribute&&s.setAttribute(n,e===!0?"":e)}if(t.data&&typeof t.data=="object")for(const n in t.data){const e=t.data[n];typeof e=="function"||typeof e=="object"||e==null||e===!1||s.dataset&&(s.dataset[n]=e===!0?"":e)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(e=>e&&s.classList.add(e));else if(typeof n=="object")for(const e in n){const c=typeof n[e]=="function"?n[e](t,t.state,t.context):n[e];c&&s.classList.add(typeof c=="string"?c:e)}}}}function ft(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function I(t,s){if(!t||!s||!t.style)return;let n=null;for(const e in s){const c=s[e];if(c!=null){if(e.charAt(0)==="&"&&typeof c=="object"){n||(n={}),n[e]=c;continue}try{const o=String(c),r=e.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),i=o.trim(),f=/\s*!important\s*$/.test(i),a=i.replace(/\s*!important\s*$/,"");t.style.setProperty(r,a,f?"important":"")}catch{}}}n&&wt(t,n)}let kt=0;function wt(t,s){const n=`_ds${kt++}`;t.classList.add(n);const e=t.ownerDocument;let c=e.querySelector("style[data-smbls-scoped]");c||(c=e.createElement("style"),c.setAttribute("data-smbls-scoped",""),e.head.appendChild(c));let o="";for(const r in s){const i="."+n,f=r.replace(/&/g,i).split(",").map(u=>{const d=u.trim();return d.includes(i)?d:i+d}).join(", "),a=s[r];if(typeof a=="object"){let u="",d="";for(const p in a){const y=a[p];if(typeof y=="object"){const l=p.includes("&")?f.split(", ").map(_=>p.replace(/&/g,_)).join(", "):f.split(", ").map(_=>`${_} ${p}`).join(", ");let h="";for(const _ in y)h+=`${_.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[_]};`;d+=`${l} { ${h} }
5
- `}else u+=`${p.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${y};`}u&&(o+=`${f} { ${u} }
6
- `),d&&(o+=d)}}o&&(c.textContent+=o)}function Et(t){const s=t.subscribeTo;if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let e=0;e<s.length;e++){const c=s[e];if(typeof c!="string"||c.length===0)continue;const o=c.split("."),r=o[0],i=o.slice(1),f={value:!1},a=A(()=>{const u=t.state&&(R(t.state)?t.state.root:null);if(!u||!R(u))return;let d=u;d=d[r];for(let p=0;p<i.length&&!(d==null||typeof d!="object");p++)if(R(d))d=d[i[p]];else break;if(f.value&&(typeof t.onBeforeUpdate=="function"||typeof t.onUpdate=="function")){const p=t.context?.designSystem;p&&P(p);let y="onBeforeUpdate";try{let l=!1;typeof t.onBeforeUpdate=="function"&&t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(l=!0),y="onUpdate",!l&&typeof t.onUpdate=="function"&&t.onUpdate(t,t.state,t.context)}catch(l){t.context?.plugins?.length&&Z("error",t,{hook:y,error:l})||console.error(`[DOMQL] subscribeTo ${y} error:`,l)}finally{p&&O()}}},{depth:n.path.length});f.value=!0,a._isSubscribeToEffect=!0,n.__effects.push(a)}}function Pt(t){const s=t.__ref;s.__conditionalRunners=[];for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const e=n.charAt(0);if(e!=="."&&e!=="!")continue;const c=n.slice(1);if(!c)continue;const o=t[n];if(!o||typeof o!="object")continue;const r=e==="!",i={lastMatch:!1,appliedKeys:null},f=()=>{if(!t.node)return;let u;const d=t[c];if(d===void 0)if(t.state&&c in t.state)u=t.state[c];else{const l=t.context?.cases?.[c];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 \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof d=="function")try{u=d(t,t.state,t.context)}catch(l){u=!1,s.__conditionalError=l,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,l?.message||l)}else u=d;const p=r?!u:!!u;if(p===i.lastMatch)return;i.lastMatch=p;const y=t.context?.designSystem;y&&P(y);try{if(p){const l={};for(const _ in o){if(!Object.prototype.hasOwnProperty.call(o,_))continue;const g=typeof o[_]=="function"?o[_](t,t.state,t.context):o[_];if(g!=null)if(C[_]){const b=C[_](g,t,t.state,t.context);if(b){const v=Array.isArray(b)?b:[b];for(const D of v)D&&Object.assign(l,D)}}else j&&j.has(_)&&(l[_]=g)}const h=Object.keys(l);h.length?(I(t.node,l),i.appliedKeys=h):i.appliedKeys=null}else if(i.appliedKeys){for(const l of i.appliedKeys)t.node.style[l]="";i.appliedKeys=null}}finally{y&&O()}};s.__conditionalRunners.push(f);const a=A(f,{depth:s.path.length});s.__effects.push(a)}}const J=new WeakSet;function Ot(t){const s=t.ownerDocument;!s||J.has(s)||(J.add(s),queueMicrotask(()=>{J.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const m=new WeakSet;let at=!1;function Lt(t){const{node:s}=t;if(!s)return;if(at||(at=!0,rt({display:"none"})),m.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}m.add(t);const n=t.context?.designSystem;n&&P(n);try{const e={};let c=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||N.has(o))continue;const r=o.charCodeAt(0);if(!(r>=65&&r<=90)&&!F(o)){if(C[o]){const i=t[o],f=C[o](i,t,t.state,t.context);if(f){if(Array.isArray(f))for(const a of f)a&&Object.assign(e,a);else Object.assign(e,f);c=!0}}else if(j&&j.has(o)){const i=t[o];i!=null&&typeof i!="object"&&(e[o]=i,c=!0)}else if(o.charCodeAt(0)===45){const i=t[o];i!=null&&typeof i!="object"&&(e[o]=i,c=!0)}else if(o.charAt(0)==="&"){const i=t[o];i&&typeof i=="object"&&(e[o]=i,c=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const i=t[o];if(i&&typeof i=="object"){const f={},a=(u,d,p)=>{if(C[d]){const y=C[d](p,t,t.state,t.context);if(y)if(Array.isArray(y))for(const l of y)l&&Object.assign(u,l);else Object.assign(u,y)}else u[d]=p};for(const u in i){let d=i[u];if(typeof d=="function"&&(d=d(t,t.state,t.context)),!(d==null||typeof d=="function")){if(u==="style"&&typeof d=="object"&&!Array.isArray(d)){for(const p in d){let y=d[p];typeof y=="function"&&(y=y(t,t.state,t.context)),!(y==null||typeof y=="function")&&a(f,p,y)}continue}a(f,u,d)}}if(Object.keys(f).length){if(o.length>1&&o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")&&!o.startsWith("@supports")&&(o==="@dark"||o==="@light"||!t.context?.designSystem?.media?.[o.slice(1)])){const d={};for(const y in f){const l=f[y];d[y]=typeof l=="string"&&!l.includes("!important")?l+" !important":l}const p=o.slice(1);e[`[data-theme="${p}"] &`]=d}else{let d=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const y=o.slice(1),l=t.context?.designSystem?.media?.[y]||t.context?.designSystem?.media?.[y];l&&(d=`@media ${l}`)}const p={};for(const y in f){const l=f[y];if(l&&typeof l=="object"&&!Array.isArray(l)){const h={};for(const _ in l)if(C[_]){const g=C[_](l[_],t,t.state,t.context);if(g)if(Array.isArray(g))for(const b of g)b&&Object.assign(h,b);else Object.assign(h,g)}else h[_]=l[_];p[y]=h}else p[y]=l}Object.keys(p).length&&(e[d]=p)}c=!0}c=!0}}}}if(c){e.display&&String(e.display).includes("!important")&&(s.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const o=rt(e,null,t.context?.cssPrefix);if(o&&s.classList){const i=o.split(" ").filter(Boolean);let f=!1;for(const a of i)s.classList.add(a),f||(a.charCodeAt(0)===95&&a.charCodeAt(1)===99||a.charCodeAt(0)===95&&a.indexOf("_c",1)!==-1)&&(f=!0);f&&Ot(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=e.display;if(i&&i!==r)if(r==="none"){const f=[];for(const a of s.classList)a.startsWith("_d-")&&a!=="_d-none"&&f.push(a);for(const a of f)s.classList.remove(a);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&O(),m.delete(t)}}function ut(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const c in t.aria){const o=t.aria[c];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const r="aria-"+c.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.setAttribute(r,o===!0?"":o)}const n=xt(t);for(const c in n){const o=n[c];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(c,o===!0?"":o)}const e=t.tag||"div";for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||typeof t[c]=="function"||N.has(c)||c==="on"||n[c]!==void 0)continue;const o=c.charCodeAt(0);if(!(o>=65&&o<=90)&&!F(c)&&!(C[c]||j&&j.has(c))&&z(e,c)){let r=t[c];if(r==null||r===!1||(typeof r=="string"&&r.includes("{{")&&(r=G(r,t,t.state,t.context),t[c]=r),r==null||r===!1||typeof r=="function"||typeof r=="object"))continue;s.setAttribute(c,r===!0?"":r)}}}function Tt(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,e=n&&typeof n=="object"&&n.max?String(n.max):null;e&&(s.style.maxHeight=e);const c=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};c(),s.addEventListener("input",c),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",c)}catch{}})}const dt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function pt(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!F(n)||dt.has(n))continue;let e=t[n];if(typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const o=e;e=function(i){return t.call(o,i)}}if(typeof e!="function")continue;const c=vt(n);ht.has(c)||_t(St(c),t,e)}Rt(t)}function Rt(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let e=!1;for(const p of dt){const y=t[p];typeof y=="function"&&(n[p]=y,e=!0)}if(!e)return;const c=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,i=0,f=0,a=!1;const u=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,i=y.clientY,f=Date.now(),a=!0)},d=p=>{if(!a)return;a=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const l=y.clientX-r,h=y.clientY-i,_=Date.now()-f;if(_>o)return;const g=Math.abs(l),b=Math.abs(h);if(Math.max(g,b)<c)return;let v;if(g>b*1.2)v=l<0?"left":"right";else if(b>g*1.2)v=h<0?"up":"down";else return;const D="onSwipe"+v.charAt(0).toUpperCase()+v.slice(1),T=n[D],S=n.onSwipe;T&&T.call(t,p,t,t.state,t.context),S&&S.call(t,{direction:v,dx:l,dy:h,dt:_,event:p},t,t.state,t.context)};s.addEventListener("touchstart",u,{passive:!0}),s.addEventListener("touchend",d,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",u)}catch{}try{s.removeEventListener("touchend",d)}catch{}})}function B(t,s){const n={...t};for(const e in s){const c=n[e],o=s[e];c&&o&&typeof c=="object"&&typeof o=="object"&&!Array.isArray(c)&&!Array.isArray(o)&&typeof c!="function"&&typeof o!="function"?n[e]=B(c,o):n[e]=o}return n}function tt(t,s,n){if(!s||!t.node)return;const e=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",o=t.context?.document||globalThis.document,r=c?null:o?.createDocumentFragment();if(!c&&!r)return;const i=t.childProps,f=t.childrenAs;for(let a=0;a<s.length;a++){let u=s[a];const d=u;(typeof u=="string"||typeof u=="number")&&(u={text:u});let p=i;if(typeof i=="function")try{p=i(t,u)}catch{p=null}if(f==="state"){let h=d;(typeof d=="string"||typeof d=="number")&&(h={value:d,text:d}),u=p?{...p,state:h}:{state:h}}else p&&(u=B(p,u));if(e&&!u.ignoreChildExtends)if(u.extends){const h=Array.isArray(u.extends)?u.extends:[u.extends],_=Array.isArray(e)?e:[e];u={...u,extends:[..._,...h]}}else u={...u,extends:e};const y=u?.key||d&&typeof d=="object"&&d.key||`${a}`,l=K(u,t,y,n);!c&&l?.node&&r.appendChild(l.node)}c||t.node.appendChild(r);return}if(typeof s=="string"){const c=et(s,t);if(Array.isArray(c)){tt(t,c,n);return}}if(typeof s=="object")for(const c in s){if(N.has(c))continue;let o=s[c];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=B(t.childProps,o)),e&&!o.ignoreChildExtends)if(o.extends){const r=Array.isArray(o.extends)?o.extends:[o.extends],i=Array.isArray(e)?e:[e];o={...o,extends:[...i,...r]}}else o={...o,extends:e};K(o,t,c,n)}}}function yt(t,s){let{children:n,content:e}=t;const c=t.childExtends;if(typeof n=="function"){const r=n;n=r(t,t.state,t.context),t.children=n;const i=t.__ref;let f=!1;const a=A(()=>{const u=r(t,t.state,t.context);if(!f){f=!0;return}if(u===t.children)return;if(t.children=u,Array.isArray(u)&&t.childrenAs==="state"){const y=t.childProps,l=[],h=new Map;for(let S=0;S<u.length;S++){const w=u[S];let x=y;if(typeof y=="function")try{x=y(t,w)}catch{x=null}const M=x&&x.key||w&&w.key||`${S}`;l.push(M),h.set(M,{rawChild:w,childProps:x})}const _=new Set(l),g=i.__children.slice();for(const S of g)if(!_.has(S)){const w=t[S];w?.remove&&w.remove(),delete t[S]}const b=t.childExtends,v=t.tag==="fragment",D=t.context?.document||globalThis.document,T=v?null:D?.createDocumentFragment();for(const S of l){const w=h.get(S),x=w.rawChild,M=t[S];if(M&&M.state){if(x&&typeof x=="object"){const L=M.state;if(typeof L.replace=="function")L.replace(x);else if(typeof L.update=="function"){for(const k in L)if(!(k==="__element"||k==="root"||k==="parent"||k==="update")&&!Object.prototype.hasOwnProperty.call(x,k))try{L[k]=void 0}catch{}L.update(x)}else for(const k in x)L[k]=x[k]}continue}let H=x;(typeof x=="string"||typeof x=="number")&&(H={value:x,text:x});const st=w.childProps;let E=st?{...st,state:H}:{state:H};if(b&&!E.ignoreChildExtends)if(E.extends){const L=Array.isArray(E.extends)?E.extends:[E.extends],k=Array.isArray(b)?b:[b];E={...E,extends:[...k,...L]}}else E={...E,extends:b};const ct=K(E,t,S,s);!v&&ct?.node&&T&&T.appendChild(ct.node)}!v&&T&&T.childNodes.length&&t.node&&t.node.appendChild(T),i.__children=l;return}for(const y of[...i.__children]){const l=t[y];l?.remove&&l.remove(),delete t[y]}i.__children=[],tt(t,u,s)},{depth:i.path.length});i.__effects.push(a)}if(tt(t,n||e,s),n||e)return;const o=t.context?.components||{};{const r=Object.keys(t);for(let i=0;i<r.length;i++){const f=r[i];if(!f.endsWith("Extends")||typeof t[f]!="string")continue;const a=f.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const u={extends:t[f]};delete t[f];for(let d=i+1;d<r.length;d++){const p=r[d],y=p.charCodeAt(0);if(y>=65&&y<=90||N.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const l=t[p];l!==void 0&&(u[p]=l,delete t[p])}t[a]&&typeof t[a]=="object"?t[a]={...u,...t[a]}:t[a]=u}}for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||N.has(r)||typeof t[r]!="object"||t[r]===null)continue;const i=r.charCodeAt(0);if(i<65||i>90)continue;let f=t[r];if(!f.__ref){if(!f.extends&&!f.extend){const a=o[r]||o[`smbls.${r}`];a&&(f={...f,extends:a})}if(t.childProps&&(f=B(t.childProps,f)),c&&!f.ignoreChildExtends)if(f.extends){const a=Array.isArray(f.extends)?f.extends:[f.extends],u=Array.isArray(c)?c:[c];f={...f,extends:[...u,...a]}}else f={...f,extends:c};K(f,t,r,s)}}}function ot(t,s,n){const{node:e}=t;if(!e)return;e.ref=t;const c=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(c){const r=c.parentNode;if(r){if(n?.position==="before"&&n.node)r.insertBefore(e,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;r.insertBefore(e,i||c)}else r.insertBefore(e,c);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(e,n.node);else if(n?.position==="after"&&n.node){const r=n.node.nextSibling;r?o.insertBefore(e,r):o.appendChild(e)}else o.appendChild(e)}function $(t,s,n){const e=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&Z(e,s,n);const c="on"+t,o=s[c];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&&P(i);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(f){if(s.context?.plugins?.length&&Z("error",s,{hook:c,error:f})||console.error(`[DOMQL] Lifecycle "${c}" error:`,f),s.context?.strictMode)throw f}finally{i&&O(),r&&(s.__ref.__inRender=!1)}}return!0}var Jt=K;export{K as create,Jt as default};
4
+ `):"")}}if(ut(o,!0),dt(o,s,f),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const d=o.context?.designSystem;d&&j(d);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{d&&w()}}if($("Create",o,r),$("Complete",o,r),$("Render",o,r),$("RenderRouter",o,r),_t(o,r),typeof o.onFrame=="function"){const d=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&j(h);try{d(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{h&&w()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function It(t,s,n){const r=!s,f=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=r&&f&&t.context?.state,i=n.state!==void 0&&!o?n.state:t.state&&!F(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 c=t.context.state,e={...c},a=t.context?.polyglot;if(a?.translations){const u=c.lang||a.defaultLang||"en",p=a.translations[u];if(p&&typeof p=="object")for(const y in p)e[y]===void 0&&(e[y]=p[y]);const l=new Set(a.languages||[]);for(const y in a.translations)!l.has(y)&&e[y]===void 0&&(e[y]=a.translations[y])}t.state=F(e)?e:J(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=bt(i,s),t.state&&typeof t.state=="object"&&!F(t.state)){const c=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}q(t,t.state);return}if(typeof i=="function"){const c=i(t,s?.state);t.state=F(c)?c:J(c||{})}else F(i)?t.state=i:t.state=J({...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 ct(t,s){if(!s)return t;const n=s.split("/");let r=t;for(const f of n){if(r==null)return{};r=r[f]}return r??{}}function bt(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const f=t.slice(3);return f?ct(s.state,f):s.state??{}}if(t.startsWith("~/")){const f=s.state?.root||s.state,o=t.slice(2);return o?ct(f,o):f??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=ct(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const r=s.context?.polyglot;if(r?.translations){const f=s.state?.root?.lang||r.defaultLang||"en",o=r.translations[f];if(o?.[t]!==void 0)return o[t];if(r.translations[t]!==void 0)return r.translations[t]}return{}}function Kt(t){const s=t.__ref,n=t.tag||"div",r=t.context?.designSystem,f=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const c=o[i];if(typeof t[c]!="function"||I.has(c))continue;const e=c.charCodeAt(0);e>=65&&e<=90||W(c)||O[c]||E&&E.has(c)||st(n,c)||f.push({prop:c,fn:t[c]})}for(let i=0;i<f.length;i++){const{prop:c,fn:e}=f[i];s.__exec[c]=e,Object.defineProperty(t,c,{get(){r&&j(r);try{return e(t,t.state,t.context)}catch{return}finally{r&&w()}},set(a){delete s.__exec[c],Object.defineProperty(t,c,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function At(t,s){const n=t.__ref,r=!!(s&&s.skipIfEffect);if(Kt(t),typeof t.text=="function"){const o=t.text,i=C(()=>{if(!n.contentManaged)try{let c=o(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&typeof c!="object"&&(typeof c=="string"&&c.includes("{{")&&(c=tt.call(t,c,t.state)),t.tag==="string"?t.node.nodeValue=c:t.node.textContent=c)}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,i=C(()=>{if(n.contentManaged)return;const c=tt.call(t,o,t.state);c!=null&&(t.text=c),t.node&&(t.tag==="string"?t.node.nodeValue=c??"":t.node.textContent=c??"")},{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"&&!I.has(o)&&!W(o)&&!n.__exec[o]){if(O[o]){const i=t[o],c=o;let e;const a=C(()=>{const u=t.context?.designSystem;u&&j(u);try{const p=i(t,t.state,t.context),l=O[c](p,t,t.state,t.context);if(l&&t.node){const y=vt(l);(y===null||y!==e)&&(e=y,H(t.node,l))}else t.node&&(c==="show"||c==="hide")&&(e=void 0,t.node.style.display="")}finally{u&&w()}},{depth:n.path.length});n.__effects.push(a),n.__exec[o]=i}else if(E&&E.has(o)){const i=t[o],c=o;let e;const a=C(()=>{const u=t.context?.designSystem;u&&j(u);try{const p=i(t,t.state,t.context);if(t.node)if(p!=null){const l=c+":"+String(p);l!==e&&(e=l,H(t.node,{[c]:p}))}else e=void 0,t.node.style[c]=""}finally{u&&w()}},{depth:n.path.length});n.__effects.push(a),n.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=C(()=>{const c=t.context?.designSystem;c&&j(c);try{const e=o(t,t.state,t.context);t.node&&e!=null&&typeof e!="function"&&(t.node.innerHTML=e)}finally{c&&w()}},{depth:n.path.length});n.__effects.push(i),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=C(()=>{try{const c=o(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const e=c==null?"":String(c);if(t.node.value===e)return;const a=typeof document<"u"&&document.activeElement===t.node,u=a&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=a&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=e,a&&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;let i;const c=C(()=>{const e=o(t,t.state,t.context),a=vt(e);(a===null||a!==i)&&(i=a,H(t.node,e))},{depth:n.path.length});n.__effects.push(c),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;let c;const e=C(()=>{try{const a=i(t,t.state,t.context);if(t.node){const u=o+":"+String(a);u!==c&&(c=u,H(t.node,{[o]:a}))}}catch{}},{depth:n.path.length});n.__effects.push(e)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=t.attr[o],c=o,e=C(()=>{try{const a=i(t,t.state,t.context);t.node?.setAttribute&&(a==null||a===!1?t.node.removeAttribute(c):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(c,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){const i=t.aria[o];if(typeof i!="function")continue;const c="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),e=C(()=>{try{const a=i(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(c):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(c,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){const i=t.data[o];if(typeof i!="function")continue;const e="data-"+o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),a=C(()=>{try{const u=i(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(e):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(e,u===!0?"":u)}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){const i=f[o];if(typeof i!="function")continue;const c=C(()=>{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(c)}!r&&typeof t.if=="function"&&Ct(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||I.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||W(o))continue;const c=t[o];n.__exec[o]=c;const e=t.tag||"div";if(st(e,o)&&!O[o]&&!(E&&E.has(o))){const a=o,u=C(()=>{try{const p=c(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(Wt(t),Bt(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let c=!1,e=[];const a=C(()=>{const u=[];for(let _=0;_<i.length;_++){const d=i[_];try{u[_]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{u[_]=void 0}}if(!c){c=!0,e=u;return}let p=u.length!==e.length;for(let _=0;!p&&_<u.length;_++)u[_]!==e[_]&&(p=!0);const l=e;if(e=u,!p)return;const y=t.context?.designSystem;y&&j(y);try{o(t,t.state,t.context,{prev:l,next:u})}catch(_){if(t.context?.plugins?.length&&U("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{y&&w()}},{depth:n.path.length});n.__effects.push(a)}}function Ct(t,s,n){const r=C(()=>{let f;try{f=n(t,t.state,t.context)}catch(i){if(f=!1,s.__ifError=i,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,i?.message||i)}return}const o=s.__if;if(s.__if=!!f,o&&!s.__if&&t.node)t.node.remove();else if(!o&&s.__if)if(s.__ifInitialized){t.node||(t.node=m(t)),t.node&&(t.node.ref=t);const i=t.parent,c=i?.node;if(c&&t.node){let e=null;const a=Object.keys(i),u=a.indexOf(t.key);for(let p=u+1;p<a.length;p++){const l=i[a[p]];if(l?.node?.parentNode===c){e=l.node;break}}e?c.insertBefore(t.node,e):c.appendChild(t.node)}else dt(t,t.parent);it(t)}else{if(s.__ifInitialized=!0,t.tag||(t.tag=yt(t)),$("Init",t,{}),t.node||(t.node=m(t)),!t.node)return;if(t.tag==="fragment"&&!s.__fragmentAnchor){const c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),s.__fragmentAnchor=c}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),wt(t,{}),At(t,{skipIfEffect:!0}),it(t),kt(t),Et(t,{}),dt(t,t.parent),_t(t,{})}},{depth:s.path.length});s.__effects.push(r)}function it(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),Yt(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"&&H(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const r=t.attr[n];typeof r=="function"||typeof r=="object"||r==null||r===!1||s.setAttribute&&s.setAttribute(n,r===!0?"":r)}if(t.data&&typeof t.data=="object")for(const n in t.data){const r=t.data[n];typeof r=="function"||typeof r=="object"||r==null||r===!1||s.dataset&&(s.dataset[n]=r===!0?"":r)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(r=>r&&s.classList.add(r));else if(typeof n=="object")for(const r in n){const f=typeof n[r]=="function"?n[r](t,t.state,t.context):n[r];f&&s.classList.add(typeof f=="string"?f:r)}}}}function vt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function H(t,s){if(!t||!s||!t.style)return;let n=null;for(const r in s){const f=s[r];if(f!=null){if(r.charAt(0)==="&"&&typeof f=="object"){n||(n={}),n[r]=f;continue}try{const o=String(f),i=r.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),c=o.trim(),e=/\s*!important\s*$/.test(c),a=c.replace(/\s*!important\s*$/,"");t.style.setProperty(i,a,e?"important":"")}catch{}}}n&&Vt(t,n)}let Ut=0;function Vt(t,s){const n=`_ds${Ut++}`;t.classList.add(n);const r=t.ownerDocument;let f=r.querySelector("style[data-smbls-scoped]");f||(f=r.createElement("style"),f.setAttribute("data-smbls-scoped",""),r.head.appendChild(f));let o="";for(const i in s){const c="."+n,e=i.replace(/&/g,c).split(",").map(u=>{const p=u.trim();return p.includes(c)?p:c+p}).join(", "),a=s[i];if(typeof a=="object"){let u="",p="";for(const l in a){const y=a[l];if(typeof y=="object"){const _=l.includes("&")?e.split(", ").map(h=>l.replace(/&/g,h)).join(", "):e.split(", ").map(h=>`${h} ${l}`).join(", ");let d="";for(const h in y)d+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[h]};`;p+=`${_} { ${d} }
5
+ `}else u+=`${l.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}u&&(o+=`${e} { ${u} }
6
+ `),p&&(o+=p)}}o&&(f.textContent+=o)}function Wt(t){const s=t.subscribeTo;if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let r=0;r<s.length;r++){const f=s[r];if(typeof f!="string"||f.length===0)continue;const o=f.split("."),i=o[0],c=o.slice(1),e={value:!1},a=C(()=>{const u=t.state&&(F(t.state)?t.state.root:null);if(!u||!F(u))return;let p=u;p=p[i];for(let y=0;y<c.length&&!(p==null||typeof p!="object");y++)if(F(p))p=p[c[y]];else break;if(!e.value)return;let l=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&j(y);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(l=!0)}catch(_){t.context?.plugins?.length&&U("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&w()}}if(!l&&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(!l&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&j(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&U("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&w()}}},{depth:n.path.length});e.value=!0,a._isSubscribeToEffect=!0,n.__effects.push(a)}}function rt(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)])}function Y(t,s,n){const r={},f=(o,i)=>{if(O[o]){const c=O[o](i,s,s.state,s.context);if(c){const e=Array.isArray(c)?c:[c];for(const a of e)a&&Object.assign(r,a)}}else r[o]=i};for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let i=t[o];if(typeof i=="function"&&(i=i(s,s.state,s.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(o==="style"){for(const a in i){let u=i[a];typeof u=="function"&&(u=u(s,s.state,s.context)),!(u==null||typeof u=="function")&&f(a,u)}continue}if(rt(o,s)){const a=Y(i,s,!0);Object.keys(a).length&&(r[`[data-theme="${o.slice(1)}"] &`]=a);continue}let c=o;if(o.charCodeAt(0)===64&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const a=s.context?.designSystem?.media?.[o.slice(1)];a&&(c=`@media ${a}`)}const e=Y(i,s,!1);Object.keys(e).length&&(r[c]=e);continue}f(o,i)}}if(n)for(const o in r){const i=r[o];typeof i=="string"&&!i.includes("!important")&&(r[o]=i+" !important")}return r}function Bt(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;const f=r.charAt(0);if(f!=="."&&f!=="!")continue;const o=r.slice(1);if(!o)continue;const i=t[r];if(!i||typeof i!="object")continue;const c=f==="!",e={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{if(!t.node)return;let p;const l=t[o];if(l===void 0)if(t.state&&o in t.state)p=t.state[o];else{const d=t.context?.cases?.[o];if(d===void 0)return;try{p=typeof d=="function"?d.call(t,t):d}catch(h){p=!1,s.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof l=="function")try{p=l(t,t.state,t.context)}catch(d){p=!1,s.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else p=l;const y=c?!p:!!p;if(y===e.lastMatch)return;e.lastMatch=y;const _=t.context?.designSystem;_&&j(_);try{if(y){const d={},h={};let g=!1;for(const x in i){if(!Object.prototype.hasOwnProperty.call(i,x))continue;const v=i[x],P=x.charAt(0);if((P===":"||P==="@"||P==="&")&&v&&typeof v=="object"&&!Array.isArray(v)){if(rt(x,t)){const S=Y(v,t,!0);Object.keys(S).length&&(h[`[data-theme="${x.slice(1)}"] &`]=S,g=!0)}else{let S=x;if(P==="@"&&!x.startsWith("@media")&&!x.startsWith("@keyframes")){const K=t.context?.designSystem?.media?.[x.slice(1)];K&&(S=`@media ${K}`)}const D=Y(v,t,!1);Object.keys(D).length&&(h[S]=D,g=!0)}continue}const M=typeof v=="function"?v(t,t.state,t.context):v;if(M!=null)if(O[x]){const S=O[x](M,t,t.state,t.context);if(S){const D=Array.isArray(S)?S:[S];for(const K of D)K&&Object.assign(d,K)}}else E&&E.has(x)&&(d[x]=M)}const b=Object.keys(d);if(b.length){H(t.node,d);for(const x of b)n.set(x,r);e.appliedKeys=b}else e.appliedKeys=null;if(g){const x=ot(h,null,t.context?.cssPrefix),v=x?x.split(" ").filter(Boolean):[];if(v.length&&t.node.classList){for(const P of v)t.node.classList.add(P);e.appliedClasses=v}else e.appliedClasses=null}else if(e.appliedClasses){for(const x of e.appliedClasses)t.node.classList.remove(x);e.appliedClasses=null}}else{if(e.appliedKeys){for(const d of e.appliedKeys)n.get(d)===r&&(t.node.style[d]="",n.delete(d));e.appliedKeys=null}if(e.appliedClasses){for(const d of e.appliedClasses)t.node.classList.remove(d);e.appliedClasses=null}}}finally{_&&w()}};s.__conditionalRunners.push(a);const u=C(a,{depth:s.path.length});s.__effects.push(u)}}const et=new WeakSet;function Ht(t){const s=t.ownerDocument;!s||et.has(s)||(et.add(s),queueMicrotask(()=>{et.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const ft=new WeakSet;let St=!1;function Yt(t){const{node:s}=t;if(!s)return;if(St||(St=!0,ot({display:"none"})),ft.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}ft.add(t);const n=t.context?.designSystem;n&&j(n);try{const r={};let f=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||I.has(o))continue;const i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!W(o)){if(O[o]){const c=t[o],e=O[o](c,t,t.state,t.context);if(e){if(Array.isArray(e))for(const a of e)a&&Object.assign(r,a);else Object.assign(r,e);f=!0}}else if(E&&E.has(o)){const c=t[o];c!=null&&typeof c!="object"&&(r[o]=c,f=!0)}else if(o.charCodeAt(0)===45){const c=t[o];c!=null&&typeof c!="object"&&(r[o]=c,f=!0)}else if(o.charAt(0)==="&"){const c=t[o];c&&typeof c=="object"&&(r[o]=c,f=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const c=t[o];if(c&&typeof c=="object"){if(rt(o,t)){const e=Y(c,t,!0);Object.keys(e).length&&(r[`[data-theme="${o.slice(1)}"] &`]=e,f=!0)}else{let e=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const u=t.context?.designSystem?.media?.[o.slice(1)];u&&(e=`@media ${u}`)}const a=Y(c,t,!1);Object.keys(a).length&&(r[e]=a,f=!0)}f=!0}}}}if(f){r.display&&String(r.display).includes("!important")&&(s.style.setProperty("display",String(r.display).replace(/\s*!important\s*$/,""),"important"),delete r.display);const o=ot(r,null,t.context?.cssPrefix);if(o&&s.classList){const c=o.split(" ").filter(Boolean);let e=!1;for(const a of c)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&&Ht(s)}const i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){const c=r.display;if(c&&c!==i)if(i==="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&&w(),ft.delete(t)}}function kt(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 i="aria-"+f.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());s.setAttribute(i,o===!0?"":o)}const n=Rt(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 r=t.tag||"div";for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f)||typeof t[f]=="function"||I.has(f)||f==="on"||n[f]!==void 0)continue;const o=f.charCodeAt(0);if(!(o>=65&&o<=90)&&!W(f)&&!(O[f]||E&&E.has(f))&&st(r,f)){let i=t[f];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=tt(i,t,t.state,t.context),t[f]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;s.setAttribute(f,i===!0?"":i)}}}function Gt(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,r=n&&typeof n=="object"&&n.max?String(n.max):null;r&&(s.style.maxHeight=r);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 jt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function wt(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!W(n)||jt.has(n))continue;let r=t[n];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const o=r;r=function(c){return t.call(o,c)}}if(typeof r!="function")continue;const f=Dt(n);Lt.has(f)||Ot(Ft(f),t,r)}qt(t)}function qt(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let r=!1;for(const l of jt){const y=t[l];typeof y=="function"&&(n[l]=y,r=!0)}if(!r)return;const f=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,c=0,e=0,a=!1;const u=l=>{const y=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];y&&(i=y.clientX,c=y.clientY,e=Date.now(),a=!0)},p=l=>{if(!a)return;a=!1;const y=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!y)return;const _=y.clientX-i,d=y.clientY-c,h=Date.now()-e;if(h>o)return;const g=Math.abs(_),b=Math.abs(d);if(Math.max(g,b)<f)return;let x;if(g>b*1.2)x=_<0?"left":"right";else if(b>g*1.2)x=d<0?"up":"down";else return;const v="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),P=n[v],M=n.onSwipe;P&&P.call(t,l,t,t.state,t.context),M&&M.call(t,{direction:x,dx:_,dy:d,dt:h,event:l},t,t.state,t.context)};s.addEventListener("touchstart",u,{passive:!0}),s.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",u)}catch{}try{s.removeEventListener("touchend",p)}catch{}})}function Q(t,s){const n={...t};for(const r in s){const f=n[r],o=s[r];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[r]=Q(f,o):n[r]=o}return n}function at(t,s,n){if(!s||!t.node)return;const r=t.childExtends;if(Array.isArray(s)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,i=f?null:o?.createDocumentFragment();if(!f&&!i)return;const c=t.childProps,e=t.childrenAs;for(let a=0;a<s.length;a++){let u=s[a];const p=u;(typeof u=="string"||typeof u=="number")&&(u={text:u});let l=c;if(typeof c=="function")try{l=c(t,u)}catch{l=null}if(e==="state"){let d=p;(typeof p=="string"||typeof p=="number")&&(d={value:p,text:p}),u=l?{...l,state:d}:{state:d}}else l&&(u=Q(l,u));if(r&&!u.ignoreChildExtends)if(u.extends){const d=Array.isArray(u.extends)?u.extends:[u.extends],h=Array.isArray(r)?r:[r];u={...u,extends:[...h,...d]}}else u={...u,extends:r};const y=u?.key||p&&typeof p=="object"&&p.key||`${a}`,_=B(u,t,y,n);!f&&_?.node&&i.appendChild(_.node)}f||t.node.appendChild(i);return}if(typeof s=="string"){const f=bt(s,t);if(Array.isArray(f)){at(t,f,n);return}}if(typeof s=="object")for(const f in s){if(I.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=Q(t.childProps,o)),r&&!o.ignoreChildExtends)if(o.extends){const i=Array.isArray(o.extends)?o.extends:[o.extends],c=Array.isArray(r)?r:[r];o={...o,extends:[...c,...i]}}else o={...o,extends:r};B(o,t,f,n)}}}function ut(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const r=n.options;if(!r||!r.length)return;const f=t.__ref,o=f&&f.__exec&&f.__exec.value,i=typeof o=="function",c=t.value!=null&&typeof t.value!="function";if(i||c){let u;if(i)try{u=o(t,t.state,t.context)}catch{return}else u=t.value;const p=u==null?"":String(u);n.value!==p&&(n.value=p);return}const e=s||!(f&&f.__selectSynced);if(f&&(f.__selectSynced=!0),!e)return;let a=-1;for(let u=0;u<r.length;u++)r[u].defaultSelected&&(a=u);a>=0&&n.selectedIndex!==a&&(n.selectedIndex=a)}function Et(t,s){let{children:n,content:r}=t;const f=t.childExtends;if(typeof n=="function"){const i=n;n=i(t,t.state,t.context),t.children=n;const c=t.__ref;let e=!1;const a=C(()=>{const u=i(t,t.state,t.context);if(!e){e=!0;return}if(u===t.children)return;t.children=u;const p=typeof t.onContentUpdate=="function",l=p?[]:null,y=p?[]:null,_=p?[]:null;if(Array.isArray(u)&&t.childrenAs==="state"){const b=t.childProps,x=[],v=new Map;for(let k=0;k<u.length;k++){const T=u[k];let A=b;if(typeof b=="function")try{A=b(t,T)}catch{A=null}const V=A&&A.key||T&&T.key||`${k}`;x.push(V),v.set(V,{rawChild:T,childProps:A})}const P=new Set(x),M=c.__children.slice();for(const k of M)if(!P.has(k)){const T=t[k];T?.remove&&T.remove(),delete t[k],y&&y.push(k)}const S=t.childExtends,D=t.tag==="fragment",K=t.context?.document||globalThis.document,G=D?null:K?.createDocumentFragment();for(const k of x){const T=v.get(k),A=T.rawChild,V=t[k];if(V&&V.state){if(A&&typeof A=="object"){const R=V.state;if(typeof R.replace=="function")R.replace(A);else if(typeof R.update=="function"){for(const L in R)if(!(L==="__element"||L==="root"||L==="parent"||L==="update")&&!Object.prototype.hasOwnProperty.call(A,L))try{R[L]=void 0}catch{}R.update(A)}else for(const L in A)R[L]=A[L]}_&&_.push(k);continue}let X=A;(typeof A=="string"||typeof A=="number")&&(X={value:A,text:A});const pt=T.childProps;let N=pt?{...pt,state:X}:{state:X};if(S&&!N.ignoreChildExtends)if(N.extends){const R=Array.isArray(N.extends)?N.extends:[N.extends],L=Array.isArray(S)?S:[S];N={...N,extends:[...L,...R]}}else N={...N,extends:S};const lt=B(N,t,k,s);!D&&lt?.node&&G&&G.appendChild(lt.node),l&&l.push(k)}!D&&G&&G.childNodes.length&&t.node&&t.node.appendChild(G),c.__children=x,p&&(l.length||y.length)&&gt(t,{added:l,removed:y,kept:_}),ut(t,!1);return}const g=p?[...c.__children]:null;for(const b of[...c.__children]){const x=t[b];x?.remove&&x.remove(),delete t[b]}c.__children=[],at(t,u,s),ut(t,!1),p&&gt(t,{added:[...c.__children],removed:g,kept:[]})},{depth:c.path.length});c.__effects.push(a)}if(at(t,n||r,s),n||r)return;const o=t.context?.components||{};{const i=Object.keys(t);for(let c=0;c<i.length;c++){const e=i[c];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 u={extends:t[e]};delete t[e];for(let p=c+1;p<i.length;p++){const l=i[p],y=l.charCodeAt(0);if(y>=65&&y<=90||I.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const _=t[l];_!==void 0&&(u[l]=_,delete t[l])}t[a]&&typeof t[a]=="object"?t[a]={...u,...t[a]}:t[a]=u}}for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||I.has(i)||typeof t[i]!="object"||t[i]===null)continue;const c=i.charCodeAt(0);if(c<65||c>90)continue;let e=t[i];if(!e.__ref){if(!e.extends&&!e.extend){const a=o[i]||o[`smbls.${i}`];a&&(e={...e,extends:a})}if(t.childProps&&(e=Q(t.childProps,e)),f&&!e.ignoreChildExtends)if(e.extends){const a=Array.isArray(e.extends)?e.extends:[e.extends],u=Array.isArray(f)?f:[f];e={...e,extends:[...u,...a]}}else e={...e,extends:f};B(e,t,i,s)}}}function dt(t,s,n){const{node:r}=t;if(!r)return;r.ref=t;const f=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(f){const i=f.parentNode;if(i){if(n?.position==="before"&&n.node)i.insertBefore(r,n.node);else if(n?.position==="after"&&n.node){const c=n.node.nextSibling;i.insertBefore(r,c||f)}else i.insertBefore(r,f);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(r,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;i?o.insertBefore(r,i):o.appendChild(r)}else o.appendChild(r)}function $(t,s,n){const r=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&U(r,s,n);const f="on"+t,o=s[f];if(typeof o=="function"){const i=t==="Render"||t==="RenderRouter";if(i){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const c=s.context?.designSystem;c&&j(c);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(e){if(s.context?.plugins?.length&&U("error",s,{hook:f,error:e})||console.error(`[DOMQL] Lifecycle "${f}" error:`,e),s.context?.strictMode)throw e}finally{c&&w(),i&&(s.__ref.__inRender=!1)}}return!0}var yo=B;export{B as create,yo as default,ht as flushMounts};
@@ -1 +1 @@
1
- import{create as r,default as t}from"./create.js";import{update as d}from"./update.js";import{dispose as p,remove as m}from"./dispose.js";import{REGISTRY as f,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 n}from"./cache.js";import{applyExtends as B}from"./extends.js";import{addMethods as h}from"./methods.js";export{N as DELEGATED_EVENTS,x as LIFECYCLE_EVENTS,g as MIXINS,S as NON_BUBBLING_EVENTS,f as REGISTRY,n as SVG_TAGS,v as addDelegatedEvent,h as addMethods,B as applyExtends,G as cacheNode,r as create,L as createHTMLNode,t as default,I as detectTag,p as dispose,_ as isSvgTag,V as isValidTag,i as registerEvent,m as remove,c as removeDelegatedEvent,d 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 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 +1 @@
1
- const e=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","__name","__ref","__hash","__text","parent","node"]),t={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},o=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),a=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),r=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),s=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);export{s as DELEGATED_EVENTS,o as LIFECYCLE_EVENTS,t as MIXINS,a as NON_BUBBLING_EVENTS,r as PASSIVE_EVENTS,e as REGISTRY};
1
+ const e=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","__name","__ref","__hash","__text","parent","node"]),t={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},o=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),a=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),r=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),n=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);export{n as DELEGATED_EVENTS,o as LIFECYCLE_EVENTS,t as MIXINS,a as NON_BUBBLING_EVENTS,r as PASSIVE_EVENTS,e as REGISTRY};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.577",
3
+ "version": "3.14.599",
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",
@@ -21,11 +21,11 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@symbo.ls/signal": "^3.14.343",
25
- "@symbo.ls/state": "^3.14.105",
26
- "@symbo.ls/utils": "^3.14.446",
27
- "css-in-props": "^3.14.336",
28
- "attrs-in-props": "^3.14.105"
24
+ "@symbo.ls/signal": "^3.14.599",
25
+ "@symbo.ls/state": "^3.14.599",
26
+ "@symbo.ls/utils": "^3.14.599",
27
+ "css-in-props": "^3.14.599",
28
+ "attrs-in-props": "^3.14.599"
29
29
  },
30
30
  "files": [
31
31
  "dist",