@symbo.ls/element 3.14.789 → 3.14.791

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.
@@ -0,0 +1 @@
1
+ "use strict";var T=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var E=(o,t)=>{for(var S in t)T(o,S,{get:t[S],enumerable:!0})},m=(o,t,S,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _(t))!a.call(o,r)&&r!==S&&T(o,r,{get:()=>t[r],enumerable:!(e=R(t,r))||e.enumerable});return o};var n=o=>m(T({},"__esModule",{value:!0}),o);var P={};E(P,{ATTRIBUTE_FIRST_KEYS:()=>c,isAttributeFirst:()=>p,isCssProp:()=>I});module.exports=n(P);var i=require("attrs-in-props"),s=require("css-in-props");const c=new Set(["rows","cols","wrap"]),p=(o,t)=>c.has(t)&&(0,i.checkAttributeByTagName)(o,t),I=(o,t)=>!!(s.CSS_PROPS_REGISTRY[t]||s.DEFAULT_CSS_PROPERTIES_LIST&&s.DEFAULT_CSS_PROPERTIES_LIST.has(t))&&!p(o,t);
@@ -1,6 +1,6 @@
1
- "use strict";var vo=Object.create;var pt=Object.defineProperty;var So=Object.getOwnPropertyDescriptor;var wo=Object.getOwnPropertyNames;var ko=Object.getPrototypeOf,jo=Object.prototype.hasOwnProperty;var Eo=(t,e)=>{for(var s in e)pt(t,s,{get:e[s],enumerable:!0})},Ut=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wo(e))!jo.call(t,r)&&r!==s&&pt(t,r,{get:()=>e[r],enumerable:!(n=So(e,r))||n.enumerable});return t};var Po=(t,e,s)=>(s=t!=null?vo(ko(t)):{},Ut(e||!t||!t.__esModule?pt(s,"default",{value:t,enumerable:!0}):s,t)),To=t=>Ut(pt({},"__esModule",{value:!0}),t);var ss={};Eo(ss,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>At,acquireBeforeUpdateGuard:()=>go,create:()=>Y,default:()=>os,flushMounts:()=>xt,reconcileAttrProp:()=>Xo,releaseBeforeUpdateGuard:()=>dt,writeElementText:()=>ut});module.exports=To(ss);var R=require("@symbo.ls/signal"),j=require("@symbo.ls/signal"),Q=require("./cache.js"),U=require("./registry.js"),st=require("./delegate.js"),po=require("./extends.js"),yo=require("./methods.js"),is=require("./dispose.js"),q=require("./devRuntime.js"),B=require("./mountScheduler.js"),D=require("@symbo.ls/utils"),Bt=Po(require("@symbo.ls/utils"),1),G=require("@symbo.ls/utils/function.js"),ot=require("@symbo.ls/state"),A=require("css-in-props"),W=require("@symbo.ls/css"),w=require("@symbo.ls/scratch"),S=require("attrs-in-props"),ho=require("./engineRegistry.js"),_o=require("./version.js");const Kt=(0,ho.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},_o.VERSION),it=[];let wt=!1;function Vt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Lo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Do=250;function Gt(){if(!wt){if(wt=!0,typeof requestAnimationFrame!="function"){setTimeout(xt,0);return}Lo()?setTimeout(xt,Do):requestAnimationFrame(xt)}}const Oo=300,No=15e4;function xt(){if(wt=!1,!it.length)return;const t=it.splice(0,it.length);for(let e=0;e<t.length;e++){const s=t[e];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=Vt());const r=Vt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Oo&&r<No?(it.push(s),Gt()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}$("Mounted",s,s.__ref?.__mountOptions||{})}}}function kt(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,it.push(t),Gt())}function Ht(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,G.runPluginHook)("contentUpdate",t,e);const s=t.context?.designSystem;s&&(0,w.pushConfig)(s);try{t.onContentUpdate(t,t.state,t.context,e)}catch(n){if(t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&(0,w.popConfig)()}}function z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Ro(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Mo(t){return t.toLowerCase()}function jt(t){const e=t.charCodeAt(0);return e===58||e===64||e===38||e===91}function ct(t,e){const s={...t};for(const n in e){const r=s[n],f=e[n];r&&f&&typeof r=="object"&&typeof f=="object"&&!Array.isArray(r)&&!Array.isArray(f)&&typeof r!="function"&&typeof f!="function"?s[n]=ct(r,f):s[n]=f}return s}function yt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Wt(t,e,s){return yt(t)||(e&&typeof e=="object"?yt(e.key):void 0)||String(s)}function Y(t,e,s,n={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=yt(s);const f=yt(t.key),o=Object.create(null);o.key=s||f||`_${Kt.uniqId++}`,o.parent=e||null,o.context=t.context||e?.context||n.context||{},o.context.__create||(o.context.__create=Y);const c=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:e?.__ref?.root||o,path:e?.__ref?.path?[...e.__ref.path,o.key]:[o.key],origin:t};if(s&&!t.extends&&!t.extend){const h=s.indexOf("_"),p=s.indexOf(".");let x=h>0?h:-1;if(p>0&&(x<0||p<x)&&(x=p),x>0){const b=s.substring(0,x),v=o.context?.components;v&&(v[b]||v["smbls."+b])?t={...t,extends:b}:v&&(0,q.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${b}" but neither "${b}" nor "smbls.${b}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,po.applyExtends)(o,t,n);const u=new Set(["childProps","attr","style","scope","data"]),a=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;if(h==="key"){f&&(o.key=f);continue}const p=t[h],x=o[h],b=x&&p&&typeof x=="object"&&typeof p=="object"&&!Array.isArray(x)&&!Array.isArray(p)&&typeof x!="function"&&typeof p!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=ct(x,p):b&&u.has(h)?o[h]={...x,...p}:b&&jt(h)?o[h]=ct(x,p):o[h]=p}function d(h){for(const p in h){const x=h[p],b=o[p],v=b&&x&&typeof b=="object"&&typeof x=="object"&&!Array.isArray(b)&&!Array.isArray(x)&&typeof b!="function"&&typeof x!="function";v&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?o[p]=ct(b,x):v&&u.has(p)?o[p]={...b,...x}:v&&jt(p)?o[p]=ct(b,x):o[p]=x}}a&&d(a),t.props&&typeof t.props=="object"&&d(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 i=o.scope&&typeof o.scope=="object"?o.scope:null,l=e?.scope,y=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,_=l||y||null;if(t.scope!==void 0||i){const h={};i&&Object.assign(h,i),t.scope!==void 0&&Object.assign(h,t.scope),o.scope=(0,R.createScopeStore)(h,_)}else _&&(o.scope=_);if(t.if!==void 0&&(o.if=t.if),(0,yo.addMethods)(o),$o(o,e,t),o.if!=null){let h;if(typeof o.if=="function")try{h=o.if(o,o.state,o.context)}catch(p){if(h=!1,c.__ifError=p,typeof console<"u"&&console.warn){const x=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${x} \u2014 treating as false:`,p?.message||p)}}else h=o.if;c.__if=!!h}if(c.__if)typeof o.if=="function"&&(c.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&Qt(o,c,o.if),o;o.tag||(o.tag=(0,Q.detectTag)(o)),$("Init",o,n);const g=o.node=(0,Q.cacheNode)(o);if(!g)return o;if(o.tag==="fragment"){const p=(o.context?.document||globalThis.document).createComment("");g.appendChild(p),c.__fragmentAnchor=p}$("AttachNode",o,n),g.setAttribute&&o.key&&g.setAttribute("data-key",o.key),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),g.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&g.setAttribute("data-smbls-app",o.context.key),o.id&&g.setAttribute&&(g.id=o.id),ao(o,n),Zt(o),Pt(o),co(o),mo(o);try{uo(o,n)}catch(h){if(typeof console<"u"&&console.error){const p=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${p}:`,h?.message||h,h?.stack?`
2
- `+h.stack.split(`
1
+ "use strict";var Fo=Object.create;var gt=Object.defineProperty;var $o=Object.getOwnPropertyDescriptor;var Io=Object.getOwnPropertyNames;var Uo=Object.getPrototypeOf,Bo=Object.prototype.hasOwnProperty;var Ko=(t,s)=>{for(var o in s)gt(t,o,{get:s[o],enumerable:!0})},Zt=(t,s,o,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of Io(s))!Bo.call(t,r)&&r!==o&&gt(t,r,{get:()=>s[r],enumerable:!(n=$o(s,r))||n.enumerable});return t};var Ho=(t,s,o)=>(o=t!=null?Fo(Uo(t)):{},Zt(s||!t||!t.__esModule?gt(o,"default",{value:t,enumerable:!0}):o,t)),Vo=t=>Zt(gt({},"__esModule",{value:!0}),t);var Ps={};Ko(Ps,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>Pt,acquireBeforeUpdateGuard:()=>Do,create:()=>Q,default:()=>Ts,flushMounts:()=>Tt,isStaticCssProp:()=>Ss,recompileStaticCss:()=>ws,reconcileAttrProp:()=>vs,releaseBeforeUpdateGuard:()=>ht,writeElementText:()=>pt});module.exports=Vo(Ps);var N=require("@symbo.ls/signal"),E=require("@symbo.ls/signal"),tt=require("./cache.js"),K=require("./registry.js"),rt=require("./delegate.js"),To=require("./extends.js"),Po=require("./methods.js"),Rs=require("./dispose.js"),m=require("./devRuntime.js"),H=require("./mountScheduler.js"),D=require("@symbo.ls/utils"),bt=Ho(require("@symbo.ls/utils"),1),W=require("@symbo.ls/utils/function.js"),et=require("@symbo.ls/state"),C=require("css-in-props"),q=require("@symbo.ls/css"),v=require("@symbo.ls/scratch"),w=require("attrs-in-props"),Lo=require("./engineRegistry.js"),zt=require("./cssLonghands.js"),Z=require("./attributeFirst.js"),Oo=require("./version.js");const Qt=(0,Lo.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},Oo.VERSION),ft=[];let Rt=!1,Xt=0,st=null,at=null;function xt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Jt(){return typeof document<"u"&&document.visibilityState==="hidden"}const Go=250,Wo=1e3;function zo(){return at&&(at!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Jt())?!0:xt()-Xt>=Wo}function Yo(){if(Rt=!0,Xt=xt(),at=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Tt,0);st=t?()=>t(s):null;return}if(Jt()){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Tt,Go);st=t?()=>t(s):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;at=requestAnimationFrame;const s=requestAnimationFrame(Tt);st=t?()=>t(s):null}}function mt(){if(Rt){if(!zo())return;const t=st;if(st=null,t)try{t()}catch{}}Yo()}const qo=300,Zo=15e4;function Tt(){if(Rt=!1,st=null,at=null,!ft.length)return;const t=ft.splice(0,ft.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.node){if(!o.node.isConnected){const n=o.__ref||(o.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=xt());const r=xt()-n.__mountFirstAttemptAt;n.__mountAttempts<=qo&&r<Zo?(ft.push(o),mt()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",o.key||o.tag||o);continue}$("Mounted",o,o.__ref?.__mountOptions||{})}}}function Nt(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,ft.push(t),mt())}function to(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,W.runPluginHook)("contentUpdate",t,s);const o=t.context?.designSystem;o&&(0,v.pushConfig)(o);try{t.onContentUpdate(t,t.state,t.context,s)}catch(n){if(t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{o&&(0,v.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Qo(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Xo(t){return t.toLowerCase()}function Mt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38||s===91}function ut(t,s){const o={...t};for(const n in s){const r=o[n],c=s[n];r&&c&&typeof r=="object"&&typeof c=="object"&&!Array.isArray(r)&&!Array.isArray(c)&&typeof r!="function"&&typeof c!="function"?o[n]=ut(r,c):o[n]=c}return o}function At(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function oo(t,s,o){return At(t)||(s&&typeof s=="object"?At(s.key):void 0)||String(o)}function Q(t,s,o,n={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),o=At(o);const c=At(t.key),e=Object.create(null);e.key=o||c||`_${Qt.uniqId++}`,e.parent=s||null,e.context=t.context||s?.context||n.context||{},e.context.__create||(e.context.__create=Q);const p=e.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||e,path:s?.__ref?.path?[...s.__ref.path,e.key]:[e.key],origin:t};if(o&&!t.extends&&!t.extend){const u=o.indexOf("_"),l=o.indexOf(".");let b=u>0?u:-1;if(l>0&&(b<0||l<b)&&(b=l),b>0){const x=o.substring(0,b),k=e.context?.components;k&&(k[x]||k["smbls."+x])?t={...t,extends:x}:k&&(0,m.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(o)||/^[A-Z]\w*\.\w+$/.test(o))&&console.warn(`[smbls] auto-extend: key "${o}" looks like an instance of "${x}" but neither "${x}" nor "smbls.${x}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,To.applyExtends)(e,t,n);const i=new Set(["childProps","attr","style","scope","data"]),g=e.props&&typeof e.props=="object"?e.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;if(u==="key"){c&&(e.key=c);continue}const l=t[u],b=e[u],x=b&&l&&typeof b=="object"&&typeof l=="object"&&!Array.isArray(b)&&!Array.isArray(l)&&typeof b!="function"&&typeof l!="function";x&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?e[u]=ut(b,l):x&&i.has(u)?e[u]={...b,...l}:x&&Mt(u)?e[u]=ut(b,l):e[u]=l}function _(u){for(const l in u){const b=u[l],x=e[l],k=x&&b&&typeof x=="object"&&typeof b=="object"&&!Array.isArray(x)&&!Array.isArray(b)&&typeof x!="function"&&typeof b!="function";k&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?e[l]=ut(x,b):k&&i.has(l)?e[l]={...x,...b}:k&&Mt(l)?e[l]=ut(x,b):e[l]=b}}g&&_(g),t.props&&typeof t.props=="object"&&_(t.props),t.classlist!==void 0&&(e.classlist=t.classlist),t.text!==void 0&&(e.text=t.text),t.html!==void 0&&(e.html=t.html);const f=e.scope&&typeof e.scope=="object"?e.scope:null,d=s?.scope,y=e.context&&typeof e.context.globalScope=="object"&&e.context.globalScope||null,a=d||y||null;if(t.scope!==void 0||f){const u={};f&&Object.assign(u,f),t.scope!==void 0&&Object.assign(u,t.scope),e.scope=(0,N.createScopeStore)(u,a)}else a&&(e.scope=a);if(t.if!==void 0&&(e.if=t.if),(0,Po.addMethods)(e),Jo(e,s,t),e.if!=null){let u;if(typeof e.if=="function")try{u=e.if(e,e.state,e.context)}catch(l){if(u=!1,p.__ifError=l,typeof console<"u"&&console.warn){const b=e.key||e.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${b} \u2014 treating as false:`,l?.message||l)}}else u=e.if;p.__if=!!u}if(p.__if)typeof e.if=="function"&&(p.__ifInitialized=!0);else return s&&(s[e.key]=e),typeof e.if=="function"&&fo(e,p,e.if),e;e.tag||(e.tag=(0,tt.detectTag)(e)),$("Init",e,n);const h=e.node=(0,tt.cacheNode)(e);if(!h)return e;if(e.tag==="fragment"){const l=(e.context?.document||globalThis.document).createComment("");h.appendChild(l),p.__fragmentAnchor=l}$("AttachNode",e,n),h.setAttribute&&e.key&&h.setAttribute("data-key",e.key),s&&(s[e.key]=e,s.__ref?.__children&&(s.__ref.__children.includes(e.key)||s.__ref.__children.push(e.key))),h.setAttribute&&e.context?.scopeSelector&&e.context.scopeSelector!==":root"&&e.context.key&&e.key===e.context.key&&h.setAttribute("data-smbls-app",e.context.key),e.id&&h.setAttribute&&(h.id=e.id),ko(e,n),io(e),$t(e),wo(e),js(e);try{jo(e,n)}catch(u){if(typeof console<"u"&&console.error){const l=e.__ref?.path?.join(".")||e.key||"<root>";console.error(`[smbls] createChildren failed at ${l}:`,u?.message||u,u?.stack?`
2
+ `+u.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(bt(o,!0),lo(o,e,r),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const h=o.context?.designSystem;h&&(0,w.pushConfig)(h);try{const p=o.html(o,o.state,o.context);p!=null&&typeof p!="function"&&(o.node.innerHTML=p)}catch{}finally{h&&(0,w.popConfig)()}}if($("Create",o,n),$("Complete",o,n),$("Render",o,n),$("RenderRouter",o,n),kt(o,n),typeof o.onFrame=="function"){const h=o.onFrame,p=o.context?.designSystem,x=()=>{if(o.node){if(o.node.isConnected){p&&(0,w.pushConfig)(p);try{h(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{p&&(0,w.popConfig)()}}requestAnimationFrame(x)}};requestAnimationFrame(x)}return o}function $o(t,e,s){const n=!e,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,f=n&&r&&t.context?.state,o=s.state!==void 0&&!f?s.state:t.state&&!(0,R.isStore)(t.state)?t.state:void 0;if(o==null){if(e?.state)t.state=e.state,(0,ot.applyStateMethods)(t,t.state);else if(t.context?.state){const c=t.context.state,u={...c},a=t.context?.polyglot;if(a?.translations){const d=t.context,i=c.lang||a.defaultLang||"en",l=new Set,y=(h,p)=>{l.has(h)||(0,D.isPolyglotWritableKey)(d,h,u)&&(u[h]=p,l.add(h),(0,D.markPolyglotSeeded)(d,h))},_=a.translations[i];if(_&&typeof _=="object")for(const h in _)y(h,_[h]);const g=new Set(a.languages||[]);for(const h in a.translations)g.has(h)||y(h,a.translations[h])}t.state=(0,R.isStore)(u)?u:(0,R.createStore)(u),t.state.__element=t,t.state.root=t.state,(0,ot.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,ot.applyStateMethods)(t,t.state);return}if(typeof o=="string"){if(t.state=zt(o,e),t.state&&typeof t.state=="object"&&!(0,R.isStore)(t.state)){const c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}(0,ot.applyStateMethods)(t,t.state);return}if(typeof o=="function"){const c=o(t,e?.state);t.state=(0,R.isStore)(c)?c:(0,R.createStore)(c||{})}else(0,R.isStore)(o)?t.state=o:t.state=(0,R.createStore)({...o});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,(0,ot.applyStateMethods)(t,t.state)}function Et(t,e){if(!e)return t;const s=e.split("/");let n=t;for(const r of s){if(n==null)return{};n=n[r]}return n??{}}function zt(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?Et(e.state,r):e.state??{}}if(t.startsWith("~/")){const r=e.state?.root||e.state,f=t.slice(2);return f?Et(r,f):r??{}}if(e.state?.[t]!==void 0)return e.state[t];const s=Et(e.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=e.context?.polyglot;if(n?.translations){const r=e.state?.root?.lang||n.defaultLang||"en",f=n.translations[r];if(f?.[t]!==void 0)return f[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const Fo=new Set(["s","state","ctx","context"]);function Io(t){try{const s=(typeof Bt.getFunctionSource=="function"?Bt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function Uo(t){if(typeof t!="function"||t.length!==2)return!1;const e=Io(t);if(e.length<2)return!1;const s=e[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!Fo.has(s)}function Bo(t){const e=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],f=Object.keys(t);for(let o=0;o<f.length;o++){const c=f[o];if(typeof t[c]!="function"||U.REGISTRY.has(c))continue;const u=c.charCodeAt(0);u>=65&&u<=90||z(c)||A.CSS_PROPS_REGISTRY[c]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(c)||(0,S.checkAttributeByTagName)(s,c)||((0,q.isLoudDevRuntime)()&&Uo(t[c])&&console.warn(`[smbls] custom prop "${c}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${c}', \u2026) instead of reading el.${c}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:c,fn:t[c]}))}for(let o=0;o<r.length;o++){const{prop:c,fn:u}=r[o];e.__exec[c]=u,Object.defineProperty(t,c,{get(){n&&(0,w.pushConfig)(n);try{return u(t,t.state,t.context)}catch{return}finally{n&&(0,w.popConfig)()}},set(a){delete e.__exec[c],Object.defineProperty(t,c,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Ko(t,e){if(!(!Array.isArray(e)||e.length===0))for(let s=0;s<e.length;s++){const n=e[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function N(t,e,s){return!Array.isArray(e)||e.length===0?s:function(...n){return Ko(t,e),s.apply(this,n)}}function ft(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function k(t,e){return()=>t.path.join(".")+"::"+e}const Yt=new Set;function F(t,e,s){if(!(0,q.isLoudDevRuntime)())return;const n=k(t,e)();Yt.has(n)||(Yt.add(n),console.warn(`[smbls] "${e}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}function Zt(t,e){const s=t.__ref,n=!!(e&&e.skipIfEffect);if(Bo(t),typeof t.text=="function"){const o=t.text,c=N(t,t.textDeps,o),u=(0,j.createEffect)(()=>{if(!s.contentManaged)try{let a=c(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=D.replaceLiteralsWithObjectFields.call(t,a,t.state)),ut(t,a))}catch(a){F(s,"text",a)}},{depth:s.path.length,label:k(s,"text")});s.__effects.push(u),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,c=(0,j.createEffect)(()=>{if(s.contentManaged)return;const u=D.replaceLiteralsWithObjectFields.call(t,o,t.state);u!=null&&(t.text=u),t.node&&ut(t,u??"")},{depth:s.path.length,label:k(s,"text")});s.__effects.push(c),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!U.REGISTRY.has(o)&&!z(o)&&!s.__exec[o]){if(A.CSS_PROPS_REGISTRY[o]){const c=t[o],u=N(t,t[o+"Deps"],c),a=o;let d,i=null,l=null,y;const _=(0,j.createEffect)(()=>{const g=t.context?.designSystem;g&&(0,w.pushConfig)(g);try{const h=u(t,t.state,t.context);(0,A.pushStaticCssPass)();let p;try{p=A.CSS_PROPS_REGISTRY[a](h,t,t.state,t.context)}finally{(0,A.popStaticCssPass)()}if(Array.isArray(p)){const b={};for(const v of p)if(v)for(const C in v)b[C]=v[C];p=b}const x=a==="show"||a==="hide";if(p&&t.node&&Vo(p)){const b=ht(p);if(b===null||b!==y){y=b;const v=(0,W.css)(p,null,t.context?.cssPrefix),C=v?v.split(" ").filter(Boolean):null;if(t.node.classList){if(l)for(const E of l)t.node.classList.remove(E);if(C&&C.length)for(const E of C)t.node.classList.add(E);l=C}}d=void 0,i=null}else if(p&&t.node){if(l){for(const v of l)t.node.classList.remove(v);l=null,y=void 0}const b=ht(p);(b===null||b!==d||!gt(t.node,i))&&(d=b,m(t.node,p),i=_t(t.node,p))}else if(t.node&&x){d=void 0,i=null;const b=s.__explicitDisplay;t.node.style.display=typeof b=="string"?b:""}}finally{g&&(0,w.popConfig)()}},{depth:s.path.length,label:k(s,a)});s.__effects.push(_),s.__exec[o]=c}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const c=t[o],u=N(t,t[o+"Deps"],c),a=o;let d,i=null;const l=(0,j.createEffect)(()=>{const y=t.context?.designSystem;y&&(0,w.pushConfig)(y);try{const _=u(t,t.state,t.context);if(t.node)if(_!=null){const g=a+":"+String(_);if(g!==d||!gt(t.node,i)){d=g;const h={[a]:_};m(t.node,h),i=_t(t.node,h)}}else d=void 0,i=null,t.node.style[a]=""}finally{y&&(0,w.popConfig)()}},{depth:s.path.length,label:k(s,a)});s.__effects.push(l),s.__exec[o]=c}}if(typeof t.html=="function"){const o=t.html,c=N(t,t.htmlDeps,o),u=(0,j.createEffect)(()=>{const a=t.context?.designSystem;a&&(0,w.pushConfig)(a);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{a&&(0,w.popConfig)()}},{depth:s.path.length,label:k(s,"html")});s.__effects.push(u),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,c=N(t,t.valueDeps,o),u=(0,j.createEffect)(()=>{try{let a=c(t,t.state,t.context);typeof a=="string"&&a.includes("{{")&&(a=D.replaceLiteralsWithObjectFields.call(t,a,t.state)),Xt(t,a)}catch(a){F(s,"value",a)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(u),s.__exec.value=o}else if(typeof t.value=="string"&&t.value.includes("{{")){const o=t.value,c=(0,j.createEffect)(()=>{try{Xt(t,D.replaceLiteralsWithObjectFields.call(t,o,t.state))}catch(u){F(s,"value",u)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(c),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,c=N(t,t.styleDeps,o);let u,a=null;const d=(0,j.createEffect)(()=>{const i=c(t,t.state,t.context),l=ht(i);(l===null||l!==u||!gt(t.node,a))&&(u=l,m(t.node,i),a=_t(t.node,i))},{depth:s.path.length,label:k(s,"style")});s.__effects.push(d),s.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const c=t.style[o];if(typeof c!="function")continue;const u=N(t,ft(t.styleDeps,o),c);let a,d=null;const i=(0,j.createEffect)(()=>{try{const l=u(t,t.state,t.context);if(t.node){const y=o+":"+String(l);if(y!==a||!gt(t.node,d)){a=y;const _={[o]:l};m(t.node,_),d=_t(t.node,_)}}}catch(l){F(s,"style."+o,l)}},{depth:s.path.length,label:k(s,"style."+o)});s.__effects.push(i)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const c=N(t,ft(t.attrDeps,o),t.attr[o]),u=o,a=(0,j.createEffect)(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=D.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!(0,S.isEnumeratedTrueFalseAttr)(u)?t.node.removeAttribute(u):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(u,(0,S.serializeAttrValue)(u,d)))}catch(d){F(s,"attr."+u,d)}},{depth:s.path.length,label:k(s,"attr."+u)});a._attrName=u.toLowerCase(),s.__effects.push(a)}else if(typeof t.attr[o]=="string"&&t.attr[o].includes("{{")){const c=t.attr[o],u=o,a=(0,j.createEffect)(()=>{try{const d=D.replaceLiteralsWithObjectFields.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,S.serializeAttrValue)(u,d??""))}catch(d){F(s,"attr."+u,d)}},{depth:s.path.length,label:k(s,"attr."+u)});a._attrName=u.toLowerCase(),s.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){const c=t.aria[o];if(typeof c=="string"&&c.includes("{{")){const i=c,l="aria-"+o.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),y=(0,j.createEffect)(()=>{try{const _=D.replaceLiteralsWithObjectFields.call(t,i,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,(0,S.serializeAttrValue)(l,_??""))}catch(_){F(s,"aria."+o,_)}},{depth:s.path.length,label:k(s,"aria."+o)});y._attrName=l,s.__effects.push(y);continue}if(typeof c!="function")continue;const u=N(t,ft(t.ariaDeps,o),t.aria[o]),a="aria-"+o.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),d=(0,j.createEffect)(()=>{try{const i=u(t,t.state,t.context);if(!t.node?.setAttribute)return;i==null?t.node.removeAttribute(a):typeof i!="function"&&typeof i!="object"&&t.node.setAttribute(a,(0,S.serializeAttrValue)(a,i))}catch(i){F(s,"aria."+o,i)}},{depth:s.path.length,label:k(s,"aria."+o)});d._attrName=a,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const o in t.data){const c=t.data[o];if(typeof c=="string"&&c.includes("{{")){const l=c,y="data-"+o.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),_=(0,j.createEffect)(()=>{try{const g=D.replaceLiteralsWithObjectFields.call(t,l,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,g??"")}catch(g){F(s,"data."+o,g)}},{depth:s.path.length,label:k(s,"data."+o)});_._attrName=y,s.__effects.push(_);continue}if(typeof c!="function")continue;const u=N(t,ft(t.dataDeps,o),t.data[o]),d="data-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),i=(0,j.createEffect)(()=>{try{const l=u(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(d):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(d,l===!0?"":l)}catch(l){F(s,"data."+o,l)}},{depth:s.path.length,label:k(s,"data."+o)});i._attrName=d,s.__effects.push(i)}const r=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(r)for(const o in r){if(typeof r[o]!="function")continue;const c=N(t,ft(t.classDeps,o),r[o]),u=(0,j.createEffect)(()=>{try{const a=c(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch(a){F(s,"class."+o,a)}},{depth:s.path.length,label:k(s,"class."+o)});s.__effects.push(u)}!n&&typeof t.if=="function"&&Qt(t,s,t.if);for(const o of Object.keys(t)){if(U.REGISTRY.has(o)||typeof t[o]!="function")continue;const c=o.charCodeAt(0);if(c>=65&&c<=90||z(o))continue;const u=t[o];s.__exec[o]=u;const a=t.tag||"div";if((0,S.checkAttributeByTagName)(a,o)&&!A.CSS_PROPS_REGISTRY[o]&&!(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const d=(0,S.camelToAttr)(o)||o,i=N(t,t[o+"Deps"],u),l=(0,j.createEffect)(()=>{try{let y=i(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=D.replaceLiteralsWithObjectFields.call(t,y,t.state)),t.node?.setAttribute&&(y==null||y===!1&&!(0,S.isEnumeratedTrueFalseAttr)(d)?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&(d==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(d,(0,S.serializeAttrValue)(d,y))))}catch(y){F(s,o,y)}},{depth:s.path.length,label:k(s,o)});l._attrName=d.toLowerCase(),s.__effects.push(l)}}const f=t.tag||"div";for(const o of Object.keys(t)){if(U.REGISTRY.has(o))continue;const c=t[o];if(typeof c!="string"||!c.includes("{{"))continue;const u=o.charCodeAt(0);if(u>=65&&u<=90||z(o)||A.CSS_PROPS_REGISTRY[o]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)||S.ATTR_TRANSFORMS[o]||!(0,S.checkAttributeByTagName)(f,o))continue;const a=(0,S.camelToAttr)(o)||o,d=(0,j.createEffect)(()=>{try{const i=D.replaceLiteralsWithObjectFields.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,(0,S.serializeAttrValue)(a,i??""))}catch(i){F(s,o,i)}},{depth:s.path.length,label:k(s,o)});d._attrName=a.toLowerCase(),s.__effects.push(d)}if(Wo(t),Zo(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,c=t.stateDeps;let u=!1,a=[];const d=(0,j.createEffect)(()=>{const i=[];for(let g=0;g<c.length;g++){const h=c[g];try{i[g]=typeof h=="function"?h(t,t.state,t.context):t.state?.[h]}catch{i[g]=void 0}}if(!u){u=!0,a=i;return}let l=i.length!==a.length;for(let g=0;!l&&g<i.length;g++)i[g]!==a[g]&&(l=!0);const y=a;if(a=i,!l)return;const _=t.context?.designSystem;_&&(0,w.pushConfig)(_);try{o(t,t.state,t.context,{prev:y,next:i})}catch(g){if(t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{_&&(0,w.popConfig)()}},{depth:s.path.length,label:k(s,"onStateUpdate")});s.__effects.push(d)}Yo(t)}function qt(t){const e=t.parent,s=e?.node;if(!s||!t.node){lo(t,t.parent);return}let n=null;const r=Object.keys(e),f=r.indexOf(t.key);for(let o=f+1;o<r.length;o++){const c=e[r[o]];if(c?.node?.parentNode===s){n=c.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Qt(t,e,s){const n=N(t,t.ifDeps,s),r=(0,j.createEffect)(()=>{let f;try{f=n(t,t.state,t.context)}catch(c){if(f=!1,e.__ifError=c,typeof console<"u"&&console.warn){const u=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${u} \u2014 treating as false:`,c?.message||c)}return}const o=e.__if;if(e.__if=!!f,o&&!e.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(c){console.error("[smbls] onRemove error:",c)}}else if(!o&&e.__if)if(e.__ifInitialized)t.node||(t.node=(0,Q.cacheNode)(t)),t.node&&(t.node.ref=t),qt(t),Pt(t),$("Render",t,{}),kt(t,{});else{if(e.__ifInitialized=!0,t.tag||(t.tag=(0,Q.detectTag)(t)),$("Init",t,{}),t.node||(t.node=(0,Q.cacheNode)(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!e.__fragmentAnchor){const u=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(u),e.__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),ao(t,{}),Zt(t,{skipIfEffect:!0}),Pt(t),co(t),uo(t,{}),qt(t),$("Create",t,{}),$("Complete",t,{}),$("Render",t,{}),$("RenderRouter",t,{}),kt(t,{})}},{depth:e.path.length,label:k(e,"if")});e.__effects.push(r)}function ut(t,e){const s=t.node;if(!s)return;const n=e==null||typeof e=="object"?"":String(e);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const r=t.__ref;let f=r?r.__textNode:null;if(f&&f.parentNode!==s&&(f=null),!f){const o=s.firstChild;o&&o.nodeType===3&&(f=o)}f?f.nodeValue!==n&&(f.nodeValue=n):s.firstChild?(f=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(f,s.firstChild)):(s.textContent=n,f=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=f||null)}function Xt(t,e){const s=t.node;if(!s||!("value"in s))return;const n=e==null?"":String(e);if(s.value===n)return;const r=typeof document<"u"&&document.activeElement===s,f=r&&typeof s.selectionStart=="number"?s.selectionStart:null,o=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,r&&f!=null&&o!=null)try{s.setSelectionRange(f,o)}catch{}}function Pt(t){const{node:e}=t;if(e){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&ut(t,t.text),Qo(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in e){const s=String(t.value);e.value!==s&&(e.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}m(e,s)}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const n=t.attr[s];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!(0,S.isEnumeratedTrueFalseAttr)(s)||e.setAttribute&&e.setAttribute(s,(0,S.serializeAttrValue)(s,n)))}if(t.data&&typeof t.data=="object")for(const s in t.data){const n=t.data[s];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||e.dataset&&(e.dataset[s]=n===!0?"":n)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof s=="object")for(const n in s){const r=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];r&&e.classList.add(typeof r=="string"?r:n)}}}}function ht(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Vo(t){if(!t||typeof t!="object")return!1;for(const e in t){const s=t[e];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function _t(t,e){if(!t||!t.style||!e)return null;const s=t.style,n=[];for(const r in e){if(e[r]==null||r.charAt(0)==="&")continue;const o=r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());n.push(o,Jt(s,o),mt(s,o))}return n}function Jt(t,e){return typeof t.getPropertyValue=="function"?t.getPropertyValue(e):""}function mt(t,e){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(e):""}function gt(t,e){if(!e||!t||!t.style)return!1;const s=t.style;for(let n=0;n<e.length;n+=3)if(Jt(s,e[n])!==e[n+1]||mt(s,e[n])!==e[n+2])return!1;return!0}const Tt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function m(t,e){if(!t||!e||!t.style)return;let s=null;for(const n in e){const r=e[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[n]=r;continue}try{const f=String(r),o=Tt(n)?n:n.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),c=f.trim(),u=/\s*!important\s*$/.test(c),a=c.replace(/\s*!important\s*$/,"");t.style.setProperty(o,a,u?"important":"")}catch{}}}s&&Go(t,s)}function Go(t,e){const s=`_ds${Kt.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let f="";for(const o in e){const c="."+s,u=o.replace(/&/g,c).split(",").map(d=>{const i=d.trim();return i.includes(c)?i:c+i}).join(", "),a=e[o];if(typeof a=="object"){let d="",i="";for(const l in a){const y=a[l];if(typeof y=="object"){const _=l.includes("&")?u.split(", ").map(h=>l.replace(/&/g,h)).join(", "):u.split(", ").map(h=>`${h} ${l}`).join(", ");let g="";for(const h in y)g+=`${h.replace(/[A-Z]/g,p=>"-"+p.toLowerCase())}: ${y[h]};`;i+=(0,W.wrapHoverRule)(`${_} { ${g} }`,_)+`
5
- `}else d+=`${l.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(f+=(0,W.wrapHoverRule)(`${u} { ${d} }`,u)+`
6
- `),i&&(f+=i)}}f&&(r.textContent+=f)}const to=new Set;function oo(t){if(!Array.isArray(t))return"";const e=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&e.push(t[s]);return e.sort(),e.join("|")}function Ho(t,e,s){const n=oo(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=e(t,t.state,t.context)}catch{return}if(oo(r)===n)return;const f=t.__ref.path?t.__ref.path.join("."):t.key||"?";to.has(f)||(to.add(f),console.warn(`[smbls] subscribeTo function at "${f}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Wo(t){const e=t.subscribeTo,s=typeof e=="function";let n=e;if(s)try{n=e(t,t.state,t.context)}catch{n=null}if(s&&(0,q.isLoudDevRuntime)()&&Ho(t,e,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let f=0;f<n.length;f++){const o=n[f];if(typeof o!="string"||o.length===0)continue;const c=o.split("."),u=c[0],a=c.slice(1),d={value:!1},i=(0,j.createEffect)(()=>{const l=t.state&&((0,R.isStore)(t.state)?t.state.root:null);if(!l||!(0,R.isStore)(l))return;let y=l;y=y[u];for(let g=0;g<a.length&&!(y==null||typeof y!="object");g++)if((0,R.isStore)(y))y=y[a[g]];else break;if(!d.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"){const g=t.context?.designSystem;g&&(0,w.pushConfig)(g);try{if(go(r)){const h=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});h&&typeof h.then=="function"?h.then(()=>dt(r,!1),p=>{dt(r,!0),t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}):(dt(r,!1),h===!1&&(_=!0))}}catch(h){dt(r,!0),t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:h})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",h)}finally{g&&(0,w.popConfig)()}}if(!_&&t.node&&r.__effects)for(let g=0;g<r.__effects.length;g++){const h=r.__effects[g];h&&h!==i&&!h._disposed&&!h._isSubscribeToEffect&&typeof h._execute=="function"&&h._execute()}if(!_&&typeof t.onUpdate=="function"){const g=t.context?.designSystem;g&&(0,w.pushConfig)(g);try{t.onUpdate(t,t.state,t.context)}catch(h){t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onUpdate",error:h})||console.error("[DOMQL] subscribeTo onUpdate error:",h)}finally{g&&(0,w.popConfig)()}}},{depth:r.path.length,label:k(r,"subscribeTo("+o+")")});d.value=!0,i._isSubscribeToEffect=!0,r.__effects.push(i)}}function Lt(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}function Dt(t,e){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=e.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const so=new Set;function zo(t,e){const s=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=s+"::"+t;so.has(n)||(so.add(n),console.warn(`[smbls/css] "${t}" at ${s} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function tt(t,e,s){const n={},r=new Set,f=(o,c,u)=>{const a=u?new Set(Object.keys(n)):null;if(A.CSS_PROPS_REGISTRY[o]){const d=A.CSS_PROPS_REGISTRY[o](c,e,e.state,e.context);if(d){const i=Array.isArray(d)?d:[d];for(const l of i)l&&Object.assign(n,l)}}else n[o]=c;if(u)for(const d in n)a.has(d)||r.add(d)};for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let c=t[o];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(o==="style"){for(const i in c){let l=c[i];if(typeof l=="function"&&(l=l(e,e.state,e.context)),l==null||typeof l=="function")continue;const y=typeof e[i]=="function"&&(A.CSS_PROPS_REGISTRY[i]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i));f(i,l,y)}continue}if(Lt(o,e)){const i=tt(c,e,!1);Object.keys(i).length&&(n[`[data-theme="${o.slice(1)}"] &`]=i);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(o)){(0,q.isLoudDevRuntime)()&&zo(o,e);continue}const a=Dt(o,e),d=tt(c,e,!1);Object.keys(d).length&&(n[a]=d);continue}const u=typeof e[o]=="function"&&(A.CSS_PROPS_REGISTRY[o]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o));f(o,c,u)}if(s)for(const o in n)r.add(o);for(const o of r){const c=n[o];typeof c=="string"&&!c.includes("!important")&&(n[o]=c+" !important")}return n}function Ot(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&Ot(t[s],e+1))return!0}return!1}function eo(t,e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Lt(t,s)){const f=tt(e,s,!1);return Object.keys(f).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:f}:null}const n=Dt(t,s),r=tt(e,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function Yo(t){const e=t.__ref;for(const s of Object.keys(t)){if(!jt(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!Ot(n))continue;let r=null,f;const o=(0,j.createEffect)(()=>{if(!t.node)return;const c=t.context?.designSystem;c&&(0,w.pushConfig)(c);let u,a=!1;try{const d=eo(s,n,t),i=d?ht(d.block)+"::"+d.cssProp:null;if(i!==null&&i===f)a=!0;else if(f=i,d){const l=(0,W.css)({[d.cssProp]:d.block},null,t.context?.cssPrefix);u=l?l.split(" ").filter(Boolean):null}else u=null}finally{c&&(0,w.popConfig)()}if(!(a||!t.node.classList)){if(r)for(const d of r)t.node.classList.remove(d);if(u&&u.length)for(const d of u)t.node.classList.add(d);r=u}},{depth:e.path.length,label:k(e,"cssBlock("+s+")")});e.__effects.push(o)}}function Zo(t){const e=t.__ref;e.__conditionalRunners=[];const s=new Map;for(const n of Object.keys(t)){const r=n.charAt(0);if(r!=="."&&r!=="!")continue;const f=n.slice(1);if(!f)continue;if(/[:@\s>~+[\]]/.test(f)){if(typeof console<"u"&&console.warn){const y=f.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${y}: { '${f.slice(y.length)}': {...} }\`.`)}continue}const o=t[n];if(!o||typeof o!="object")continue;const c=r==="!",u={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{let y;const _=t[f];if(_===void 0){const p=!!t.state&&f in t.state,x=t.state?t.state[f]:void 0;if(p||x!==void 0)y=x;else{const b=t.context?.cases?.[f];if(b===void 0)return;try{y=typeof b=="function"?b.call(t,t):b}catch(v){y=!1,e.__conditionalError=v,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,v?.message||v)}}}else if(typeof _=="function")try{y=_(t,t.state,t.context)}catch(p){y=!1,e.__conditionalError=p,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,p?.message||p)}else y=_;const g=c?!y:!!y;if(!t.node||g===u.lastMatch)return;u.lastMatch=g;const h=t.context?.designSystem;h&&(0,w.pushConfig)(h);try{if(g){const p={},x={};let b=!1;for(const C in o){if(!Object.prototype.hasOwnProperty.call(o,C))continue;const E=o[C],Z=C.charAt(0);if((Z===":"||Z==="@"||Z==="&"||Z==="[")&&E&&typeof E=="object"&&!Array.isArray(E)){if(Lt(C,t)){const L=tt(E,t,!1);Object.keys(L).length&&(x[`[data-theme="${C.slice(1)}"] &`]=L,b=!0)}else{const L=Dt(C,t),O=tt(E,t,!1);Object.keys(O).length&&(x[L]=O,b=!0)}continue}const X=typeof E=="function"?E(t,t.state,t.context):E;if(X!=null)if(A.CSS_PROPS_REGISTRY[C]){const L=A.CSS_PROPS_REGISTRY[C](X,t,t.state,t.context);if(L){const O=Array.isArray(L)?L:[L];for(const et of O)et&&Object.assign(p,et)}}else(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(C)||Tt(C))&&(p[C]=X)}const v=Object.keys(p);if(v.length){m(t.node,p);for(const C of v)s.set(C,n);u.appliedKeys=v}else u.appliedKeys=null;if(b){const C=(0,W.css)(x,null,t.context?.cssPrefix),E=C?C.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const Z of E)t.node.classList.add(Z);u.appliedClasses=E}else u.appliedClasses=null}else if(u.appliedClasses){for(const C of u.appliedClasses)t.node.classList.remove(C);u.appliedClasses=null}}else{if(u.appliedKeys){for(const p of u.appliedKeys)s.get(p)===n&&(Tt(p)?t.node.style.removeProperty(p):t.node.style[p]="",s.delete(p));u.appliedKeys=null}if(u.appliedClasses){for(const p of u.appliedClasses)t.node.classList.remove(p);u.appliedClasses=null}}}finally{h&&(0,w.popConfig)()}};e.__conditionalRunners.push(a);const d=N(t,t[f+"Deps"],a),i=(0,j.createEffect)(d,{depth:e.path.length,label:k(e,"conditional("+n+")")}),l=e.__exec&&e.__exec[f]||t[f];i._sources.size===0&&typeof l=="function"&&(0,q.isLoudDevRuntime)()&&console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${f}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),e.__effects.push(i)}}const Nt=new WeakSet;function qo(t){const e=t.ownerDocument;!e||Nt.has(e)||(Nt.add(e),queueMicrotask(()=>{Nt.delete(e);const s=e.body||e.documentElement;s&&s.offsetWidth}))}const Rt=new WeakSet;let no=!1;function ro(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Mt(t,e){const s={...t};for(const n in e){const r=e[n],f=s[n];s[n]=r&&typeof r=="object"&&f&&typeof f=="object"?Mt(f,r):r}return s}function io(t,e){const s={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const f=io(r,e);Object.keys(f).length&&(s[n]=f)}else e.has(n)||(s[n]=r)}return s}function Qo(t){const{node:e}=t;if(!e)return;if(no||(no=!0,(0,W.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 s=t.context?.designSystem;s&&(0,w.pushConfig)(s),(0,A.pushStaticCssPass)();try{const n={};let r=!1,f=null,o=null,c=null;const u=(a,d)=>{if(d&&typeof d=="object"&&ro(a)){o||(o={});const i=o[a];i&&(d=Mt(i,d)),o[a]=d}else(d===null||typeof d!="object")&&(c||(c=new Set),c.add(a));n[a]=d};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&A.CSS_PROPS_REGISTRY.theme){const a=A.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(a){const d=i=>{for(const l in i){const y=i[l];y&&typeof y=="object"&&ro(l)&&(f||(f={}),f[l]=y),n[l]=y}};if(Array.isArray(a))for(const i of a)i&&d(i);else d(a);r=!0}}for(const a of Object.keys(t)){if(typeof t[a]=="function"||U.REGISTRY.has(a)||a==="theme")continue;const d=a.charCodeAt(0);if(!(d>=65&&d<=90)&&!z(a)){if(A.CSS_PROPS_REGISTRY[a]){const i=t[a],l=A.CSS_PROPS_REGISTRY[a](i,t,t.state,t.context);if(l){if(Array.isArray(l)){for(const y of l)if(y)for(const _ in y)u(_,y[_])}else for(const y in l)u(y,l[y]);r=!0}}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(a)){const i=t[a];i!=null&&typeof i!="object"&&(u(a,i),r=!0)}else if(a.charCodeAt(0)===45){const i=t[a];i!=null&&typeof i!="object"&&(u(a,i),r=!0)}else if(a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="["){const i=t[a];if(i&&typeof i=="object"&&!Array.isArray(i)){if(Ot(i))continue;const l=eo(a,i,t);l&&(u(l.cssProp,l.block),r=!0)}}}}if(f)for(const a in f){let d=c?io(f[a],c):f[a];o&&o[a]&&(d=Mt(d,o[a])),Object.keys(d).length?n[a]=d:delete n[a]}if(r){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const a=(0,W.css)(n,null,t.context?.cssPrefix);if(a&&e.classList){const i=a.split(" ").filter(Boolean);let l=!1;for(const y of i)e.classList.add(y),l||(y.charCodeAt(0)===95&&y.charCodeAt(1)===99||y.charCodeAt(0)===95&&y.indexOf("_c",1)!==-1)&&(l=!0);l&&qo(e)}const d=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(d!=null){const i=n.display;if(i&&i!==d)if(d==="none"){const l=[];for(const y of e.classList)y.startsWith("_d-")&&y!=="_d-none"&&l.push(y);for(const y of l)e.classList.remove(y);e.classList.add("_d-none")}else e.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(e.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}}finally{(0,A.popStaticCssPass)(),s&&(0,w.popConfig)(),Rt.delete(t)}}function co(t){const{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const f=t.aria[r];if(typeof f=="function"||typeof f=="object"||f==null||typeof f=="string"&&f.includes("{{"))continue;const o="aria-"+r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(o,(0,S.serializeAttrValue)(o,f))}const s=(0,S.applyAttrTransforms)(t);for(const r in s){const f=s[r];f!=null&&f!==!1&&typeof f!="function"&&typeof f!="object"&&e.setAttribute(r,f===!0?"":f)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||U.REGISTRY.has(r)||r==="on"||s[r]!==void 0)continue;const f=r.charCodeAt(0);if(!(f>=65&&f<=90)&&!z(r)&&!(A.CSS_PROPS_REGISTRY[r]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(r))&&(0,S.checkAttributeByTagName)(n,r)){let o=t[r];if(o==null)continue;if(typeof o=="string"&&o.includes("{{")){if(!S.ATTR_TRANSFORMS[r])continue;o=D.replaceLiteralsWithObjectFields.call(t,o,t.state)}if(o==null||typeof o=="function"||typeof o=="object"||o===!1&&!(0,S.isEnumeratedTrueFalseAttr)((0,S.camelToAttr)(r)||r))continue;const c=(0,S.camelToAttr)(r)||r;e.setAttribute(c,(0,S.serializeAttrValue)(c,o))}}}function Xo(t,e){const{node:s}=t;if(!s||!s.setAttribute)return;const n=e.charCodeAt(0);if(n>=65&&n<=90||z(e)||A.CSS_PROPS_REGISTRY[e]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(e)||!(0,S.checkAttributeByTagName)(t.tag||"div",e))return;const r=(0,S.camelToAttr)(e)||e,f=r.toLowerCase(),o=t.__ref&&t.__ref.__effects;let c=!1;if(o)for(let d=0;d<o.length;d++){const i=o[d];i&&i._attrName===f&&!i._disposed&&typeof i._execute=="function"&&(c=!0,i._execute())}if(c)return;let u=t[e];const a=S.ATTR_TRANSFORMS[e];if(a&&u!=null){const d=a(t);d!==void 0&&(u=d)}typeof u=="string"&&u.includes("{{")&&(u=D.replaceLiteralsWithObjectFields.call(t,u,t.state)),u==null||u===!1&&!(0,S.isEnumeratedTrueFalseAttr)(r)?s.removeAttribute(r):typeof u!="function"&&typeof u!="object"&&s.setAttribute(r,(0,S.serializeAttrValue)(r,u))}function Jo(t,e){const s=t.node,n=t.__ref;let r=n.__autoGrow;if(!e){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(s.scrollHeight===0&&r.lastMeasure>0)return;s.style.height="auto";const o=s.scrollHeight;s.style.height=o+"px",o>0&&(r.lastMeasure=o)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}})),r.active||(s.addEventListener("input",r.resize),r.active=!0);const f=typeof e=="object"&&e.max!=null?String(e.max):null;f!==r.appliedMax&&(f==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=f,r.appliedMax=f),r.resize()}function mo(t){if(!t.autoGrow)return;const e=t.node;if(!e||e.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,r=typeof n=="function"?N(t,t.autoGrowDeps,n):null,f=(0,j.createEffect)(()=>{const o=t.autoGrow;let c=o;if(typeof o=="function")try{c=(o===n&&r?r:o)(t,t.state,t.context)}catch{c=null}Jo(t,c)},{depth:s.path.length,label:k(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(f),r&&(s.__exec.autoGrow=n)}const fo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function ao(t,e){for(const s of Object.keys(t)){if(!z(s)||fo.has(s))continue;const n=(0,st.globalEventKeyInfo)(s);if(n){(0,st.registerGlobalEvent)(n,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const o=r;r=function(u){return t.call(o,u)}}if(typeof r!="function")continue;const f=Ro(s);U.LIFECYCLE_EVENTS.has(f)||(0,st.registerEvent)(Mo(f),t,r)}ts(t)}function ts(t){const e=t.node;if(!e||!e.addEventListener)return;const s={};let n=!1;for(const l of fo){const y=t[l];typeof y=="function"&&(s[l]=y,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,f=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let o=0,c=0,u=0,a=!1;const d=l=>{const y=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];y&&(o=y.clientX,c=y.clientY,u=Date.now(),a=!0)},i=l=>{if(!a)return;a=!1;const y=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!y)return;const _=y.clientX-o,g=y.clientY-c,h=Date.now()-u;if(h>f)return;const p=Math.abs(_),x=Math.abs(g);if(Math.max(p,x)<r)return;let b;if(p>x*1.2)b=_<0?"left":"right";else if(x>p*1.2)b=g<0?"up":"down";else return;const v="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),C=s[v],E=s.onSwipe;C&&C.call(t,l,t,t.state,t.context),E&&E.call(t,{direction:b,dx:_,dy:g,dt:h,event:l},t,t.state,t.context)};e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",i,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",d)}catch{}try{e.removeEventListener("touchend",i)}catch{}})}function at(t,e){const s={...t};for(const n in e){const r=s[n],f=e[n];r&&f&&typeof r=="object"&&typeof f=="object"&&!Array.isArray(r)&&!Array.isArray(f)&&typeof r!="function"&&typeof f!="function"?s[n]=at(r,f):s[n]=f}return s}function $t(t,e,s,n){if(!e||!t.node)return;const r=t.childExtends;if(Array.isArray(e)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,c=f?null:o?.createDocumentFragment();if(!f&&!c)return;const u=t.childProps,a=t.childrenAs,d=h=>{let p=e[h];const x=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let b=u;if(typeof u=="function")try{b=u(t,p)}catch{b=null}if(a==="state"){let C=x;(typeof x=="string"||typeof x=="number")&&(C={value:x,text:x}),p=b?{...b,state:C}:{state:C}}else b&&(p=at(b,p));if(r&&!p.ignoreChildExtends)if(p.extends){const C=Array.isArray(p.extends)?p.extends:[p.extends],E=Array.isArray(r)?r:[r];p={...p,extends:[...E,...C]}}else p={...p,extends:r};const v=Wt(p?.key,x,h);try{return Y(p,t,v,s)}catch(C){if(typeof console<"u"&&console.error){const E=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to construct at ${E} (initial render, skipping this row):`,C?.message||C)}return null}},i=t.__ref;if(!(n===!0&&!f&&!!i&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let h=0;h<e.length;h++){const p=d(h);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const y=i.__childrenChunkGen=(i.__childrenChunkGen||0)+1;(0,B.openMountBudget)();let _=null;const g=h=>{if(i.__disposed||i.__childrenChunkGen!==y){_&&_.parentNode&&_.remove();return}for(let p=h;p<e.length;p++){const x=d(p);if(x?.node&&(_?t.node.insertBefore(x.node,_):c.appendChild(x.node)),p+1<e.length&&(0,B.mountBudgetExhausted)()){_||(_=o.createComment("smbls-mount"),c.appendChild(_),t.node.appendChild(c));const b=p+1;(0,B.enqueueMountWork)(()=>g(b));return}}_?(_.remove(),t.node.tagName==="SELECT"&&bt(t,!0)):t.node.appendChild(c)};return g(0),(0,B.closeMountBudget)(),!0}if(typeof e=="string"){const f=zt(e,t);if(Array.isArray(f))return $t(t,f,s,n)}if(typeof e=="object")for(const f in e){if(U.REGISTRY.has(f))continue;let o=e[f];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=at(t.childProps,o)),r&&!o.ignoreChildExtends)if(o.extends){const c=Array.isArray(o.extends)?o.extends:[o.extends],u=Array.isArray(r)?r:[r];o={...o,extends:[...u,...c]}}else o={...o,extends:r};Y(o,t,f,s)}}}function bt(t,e){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const r=t.__ref,f=r&&r.__exec&&r.__exec.value,o=typeof f=="function",c=t.value!=null&&typeof t.value!="function";if(o||c){let d;if(o)try{d=f(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=D.replaceLiteralsWithObjectFields.call(t,d,t.state));const i=d==null?"":String(d);s.value!==i&&(s.value=i);return}const u=e||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!u)return;let a=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(a=d);a>=0&&s.selectedIndex!==a&&(s.selectedIndex=a)}function uo(t,e){let{children:s,content:n}=t;const r=t.childExtends;if(typeof s=="function"){const i=s;try{s=i(t,t.state,t.context)}catch(h){if(s=void 0,typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,h?.message||h)}}t.children=s;const l=t.__ref;let y=!1;const _=N(t,t.childrenDeps,i),g=(0,j.createEffect)(()=>{const h=y;y=!0;let p;try{p=_(t,t.state,t.context)}catch(L){if(typeof console<"u"&&console.error){const O=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${O}${h?"":" (initial tracking run)"}:`,L?.message||L)}return}if(!h||p===t.children)return;t.children=p,l.__childrenChunkGen!=null&&l.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",b=x?[]:null,v=x?[]:null,C=x?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const L=t.childProps,O=[],et=new Map;for(let P=0;P<p.length;P++){const K=p[P];let T=L;if(typeof L=="function")try{T=L(t,K)}catch{T=null}const H=Wt(T&&T.key,K,P);O.push(H),et.set(H,{rawChild:K,childProps:T})}const bo=new Set(O),xo=l.__children.slice();for(const P of xo)if(!bo.has(P)){const K=t[P];K?.remove&&K.remove(),delete t[P],v&&v.push(P)}const nt=t.childExtends,lt=t.tag==="fragment",Ao=t.context?.document||globalThis.document,rt=lt?null:Ao?.createDocumentFragment(),Ct=new Set;for(const P of O){const K=et.get(P),T=K.rawChild,H=t[P];if(H&&H.state){if(T&&typeof T=="object"){const M=H.state,J=M.$replace||M.replace,It=M.$update||M.update;try{if(typeof J=="function")J.call(M,T);else if(typeof It=="function"){for(const I in M)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(T,I))try{M[I]=void 0}catch{}It.call(M,T)}else for(const I in T)M[I]=T[I]}catch(I){if(typeof console<"u"&&console.error){const Co=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${P}" failed to patch at ${Co} (reconcile, keeping its previous data for this pass):`,I?.message||I)}}}C&&C.push(P);continue}let vt=T;(typeof T=="string"||typeof T=="number")&&(vt={value:T,text:T});const Ft=K.childProps;let V=Ft?{...Ft,state:vt}:{state:vt};if(nt&&!V.ignoreChildExtends)if(V.extends){const M=Array.isArray(V.extends)?V.extends:[V.extends],J=Array.isArray(nt)?nt:[nt];V={...V,extends:[...J,...M]}}else V={...V,extends:nt};let St;try{St=Y(V,t,P,e)}catch(M){if(typeof console<"u"&&console.error){const J=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${P}" failed to construct at ${J} (reconcile, skipping this row):`,M?.message||M)}Ct.add(P);continue}!lt&&St?.node&&rt&&rt.appendChild(St.node),b&&b.push(P)}if(!lt&&rt&&rt.childNodes.length&&t.node&&t.node.appendChild(rt),!lt&&t.node){let P=null;for(const K of O){const T=t[K]?.node;if(!T)continue;const H=P?P.nextSibling:t.node.firstChild;T!==H&&t.node.insertBefore(T,H),P=T}}l.__children=Ct.size?O.filter(P=>!Ct.has(P)):O,x&&(b.length||v.length)&&Ht(t,{added:b,removed:v,kept:C}),bt(t,!1);return}const X=x?[...l.__children]:null;for(const L of[...l.__children]){const O=t[L];O?.remove&&O.remove(),delete t[L]}l.__children=[],$t(t,p,e),bt(t,!1),x&&Ht(t,{added:[...l.__children],removed:X,kept:[]})},{depth:l.path.length,label:k(l,"children")});l.__effects.push(g)}const f=$t(t,s,e,!0);if(n!=null&&!(n&&n.__ref)){let i=n;if(typeof i=="string"||typeof i=="number"?i={text:i}:typeof i!="object"&&(i={}),t.childProps&&(i=at(t.childProps,i)),r&&!i.ignoreChildExtends)if(i.extends){const l=Array.isArray(i.extends)?i.extends:[i.extends],y=Array.isArray(r)?r:[r];i={...i,extends:[...y,...l]}}else i={...i,extends:r};Y(i,t,"content",e)}if(s&&!f)return;const o=t.context?.components||{};{const i=Object.keys(t);for(let l=0;l<i.length;l++){const y=i[l];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const _=y.slice(0,-7);if(!_||_.charCodeAt(0)<65||_.charCodeAt(0)>90)continue;const g={extends:t[y]};delete t[y];for(let h=l+1;h<i.length;h++){const p=i[h],x=p.charCodeAt(0);if(x>=65&&x<=90||U.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const b=t[p];b!==void 0&&(g[p]=b,delete t[p])}t[_]&&typeof t[_]=="object"?t[_]={...g,...t[_]}:t[_]=g}}const c=e?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),a=i=>{if(U.REGISTRY.has(i)||typeof t[i]!="object"||t[i]===null)return;const l=i.charCodeAt(0);if(l<65||l>90)return;let y=t[i];if(!y.__ref){if(!y.extends&&!y.extend){const _=o[i]||o[`smbls.${i}`];_&&(y={...y,extends:_})}if(t.childProps&&(y=at(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const _=Array.isArray(y.extends)?y.extends:[y.extends],g=Array.isArray(r)?r:[r];y={...y,extends:[...g,..._]}}else y={...y,extends:r};Y(y,t,i,e)}};if(!c){for(const i of u)a(i);return}(0,B.openMountBudget)();const d=i=>{for(let l=i;l<u.length;l++)if(a(u[l]),l+1<u.length&&(0,B.mountBudgetExhausted)()){const y=l+1;(0,B.enqueueMountWork)(()=>d(y));return}};d(0),(0,B.closeMountBudget)()}function lo(t,e,s){const{node:n}=t;if(!n)return;n.ref=t;const r=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(r){const o=r.parentNode;if(o){if(s?.position==="before"&&s.node)o.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;o.insertBefore(n,c||r)}else o.insertBefore(n,r);return}}const f=e?.node||(e?.nodeType?e:null);if(f)if(s?.position==="before"&&s.node)f.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const o=s.node.nextSibling;o?f.insertBefore(n,o):f.appendChild(n)}else f.appendChild(n)}const At=3;function go(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=At?!1:(t.__inBeforeUpdate=!0,!0)}function dt(t,e){t&&(t.__inBeforeUpdate=!1,e?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===At&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${At}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function $(t,e,s){const n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&(0,G.runPluginHook)(n,e,s);const r="on"+t,f=e[r];if(typeof f=="function"){const u=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(u){if(e.__ref[u])return!0;e.__ref[u]=!0}const a=e.context?.designSystem;a&&(0,w.pushConfig)(a);let d=!!u;try{const i=f(e,e.state,e.context,s);if(i&&typeof i.then=="function"){const l=e.__ref;return i.catch(y=>{e.context?.plugins?.length&&(0,G.runPluginHook)("error",e,{hook:r,error:y})||console.error(`[DOMQL] Lifecycle "${r}" error:`,y)}).finally(()=>{u&&l&&(l[u]=!1)}),d=!1,!0}if(i===!1)return!1}catch(i){if(e.context?.plugins?.length&&(0,G.runPluginHook)("error",e,{hook:r,error:i})||console.error(`[DOMQL] Lifecycle "${r}" error:`,i),e.context?.strictMode)throw i}finally{a&&(0,w.popConfig)(),d&&e.__ref&&(e.__ref[u]=!1)}}return!0}var os=Y;
4
+ `):"")}}if(Et(e,!0),Eo(e,s,r),typeof e.html=="function"&&e.node&&!e.node.innerHTML){const u=e.context?.designSystem;u&&(0,v.pushConfig)(u);try{const l=e.html(e,e.state,e.context);l!=null&&typeof l!="function"&&(e.node.innerHTML=l)}catch{}finally{u&&(0,v.popConfig)()}}if($("Create",e,n),$("Complete",e,n),$("Render",e,n),$("RenderRouter",e,n),Nt(e,n),typeof e.onFrame=="function"){const u=e.onFrame,l=e.context?.designSystem,b=()=>{if(e.node){if(e.node.isConnected){l&&(0,v.pushConfig)(l);try{u(e,e.state,e.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{l&&(0,v.popConfig)()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return e}function Jo(t,s,o){const n=!s,r=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=n&&r&&t.context?.state,e=o.state!==void 0&&!c?o.state:t.state&&!(0,N.isStore)(t.state)?t.state:void 0;if(e==null){if(s?.state)t.state=s.state,(0,et.applyStateMethods)(t,t.state);else if(t.context?.state){const p=t.context.state,i={...p},g=t.context?.polyglot;if(g?.translations){const _=t.context,f=p.lang||g.defaultLang||"en",d=new Set,y=(u,l)=>{d.has(u)||(0,D.isPolyglotWritableKey)(_,u,i)&&(i[u]=l,d.add(u),(0,D.markPolyglotSeeded)(_,u))},a=g.translations[f];if(a&&typeof a=="object")for(const u in a)y(u,a[u]);const h=new Set(g.languages||[]);for(const u in g.translations)h.has(u)||y(u,g.translations[u])}t.state=(0,N.isStore)(i)?i:(0,N.createStore)(i),t.state.__element=t,t.state.root=t.state,(0,et.applyStateMethods)(t,t.state),bt.promoteActiveRootState?.(p,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,et.applyStateMethods)(t,t.state);return}if(typeof e=="string"){if(t.state=so(e,s),t.state&&typeof t.state=="object"&&!(0,N.isStore)(t.state)){const p=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:p,enumerable:!1,configurable:!0,writable:!0})}(0,et.applyStateMethods)(t,t.state);return}if(typeof e=="function"){const p=e(t,s?.state);t.state=(0,N.isStore)(p)?p:(0,N.createStore)(p||{})}else(0,N.isStore)(e)?t.state=e:t.state=(0,N.createStore)({...e});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,et.applyStateMethods)(t,t.state),bt.promoteActiveRootState?.(e,t.state)}function Ft(t,s){if(!s)return t;const o=s.split("/");let n=t;for(const r of o){if(n==null)return{};n=n[r]}return n??{}}function so(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?Ft(s.state,r):s.state??{}}if(t.startsWith("~/")){const r=s.state?.root||s.state,c=t.slice(2);return c?Ft(r,c):r??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Ft(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const n=s.context?.polyglot;if(n?.translations){const r=s.state?.root?.lang||n.defaultLang||"en",c=n.translations[r];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const mo=new Set(["s","state","ctx","context"]);function ts(t){try{const o=(typeof bt.getFunctionSource=="function"?bt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function os(t){if(typeof t!="function"||t.length!==2)return!1;const s=ts(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!mo.has(o)}function ss(t){const s=t.__ref,o=t.tag||"div",n=t.context?.designSystem,r=[],c=Object.keys(t);for(let e=0;e<c.length;e++){const p=c[e];if(typeof t[p]!="function"||K.REGISTRY.has(p))continue;const i=p.charCodeAt(0);i>=65&&i<=90||Y(p)||C.CSS_PROPS_REGISTRY[p]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(p)||(0,w.checkAttributeByTagName)(o,p)||((0,m.isLoudDevRuntime)()&&os(t[p])&&console.warn(`[smbls] custom prop "${p}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${p}', \u2026) instead of reading el.${p}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:p,fn:t[p]}))}for(let e=0;e<r.length;e++){const{prop:p,fn:i}=r[e];s.__exec[p]=i,Object.defineProperty(t,p,{get(){n&&(0,v.pushConfig)(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&(0,v.popConfig)()}},set(g){delete s.__exec[p],Object.defineProperty(t,p,{value:g,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function ns(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const n=s[o];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function R(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...n){return ns(t,s),o.apply(this,n)}}function lt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function j(t,s){return()=>t.path.join(".")+"::"+s}const no=new Set;function I(t,s,o){if(!(0,m.isLoudDevRuntime)())return;const n=j(t,s)();no.has(n)||(no.add(n),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const eo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,es=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;eo.lastIndex=0;let n;for(;(n=eo.exec(o))!==null;)n[2].includes("{{")&&s.add(n[2])},rs=(t,s)=>!Y(t)&&!(0,Z.isCssProp)(s,t),ro=(t,s,o,n)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&rs(t,n)&&es(s,o)},is=["attr","aria","data"],cs=t=>{if(is.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},fs=t=>{const s=new Set,o=t.tag||"div";for(const n of Object.keys(t)){const r=Object.getOwnPropertyDescriptor(t,n),c=r&&r.value;if(c&&typeof c=="object"&&!Array.isArray(c)){if(!cs(n))continue;for(const e in c)ro(e,c[e],s,o);continue}ro(n,c,s,o)}return s};function io(t,s){const o=t.__ref,n=!!(s&&s.skipIfEffect),r=fs(t);if(o.__authoredTemplates)for(const i of r)o.__authoredTemplates.add(i);else o.__authoredTemplates=r;if(ss(t),typeof t.text=="function"){const i=t.text,g=R(t,t.textDeps,i),_=(0,E.createEffect)(()=>{if(!o.contentManaged)try{let f=g(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&typeof f!="object"&&(typeof f=="string"&&f.includes("{{")&&(f=D.replaceLiteralsWithObjectFields.call(t,f,t.state)),pt(t,f))}catch(f){I(o,"text",f)}},{depth:o.path.length,label:j(o,"text")});o.__effects.push(_),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,g=(0,E.createEffect)(()=>{if(o.contentManaged)return;const _=D.replaceLiteralsWithObjectFields.call(t,i,t.state);_!=null&&(t.text=_),t.node&&pt(t,_??"")},{depth:o.path.length,label:j(o,"text")});o.__effects.push(g),o.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!K.REGISTRY.has(i)&&!Y(i)&&!o.__exec[i]&&!(0,Z.isAttributeFirst)(c,i)){if(C.CSS_PROPS_REGISTRY[i]){const g=t[i],_=R(t,t[i+"Deps"],g),f=i;let d,y=null,a=null,h;const u=(0,E.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,v.pushConfig)(l);try{const b=_(t,t.state,t.context);(0,C.pushStaticCssPass)();let x;try{x=C.CSS_PROPS_REGISTRY[f](b,t,t.state,t.context)}finally{(0,C.popStaticCssPass)()}if(Array.isArray(x)){const S={};for(const A of x)if(A)for(const L in A)S[L]=A[L];x=S}const k=f==="show"||f==="hide";if(x&&t.node&&as(x)){const S=Ct(x);if(S===null||S!==h){h=S;const A=(0,q.css)(x,null,t.context?.cssPrefix),L=A?A.split(" ").filter(Boolean):null;if(t.node.classList){if(a)for(const U of a)t.node.classList.remove(U);if(L&&L.length)for(const U of L)t.node.classList.add(U);a=L}}d=void 0,y=null}else if(x&&t.node){if(a){for(const A of a)t.node.classList.remove(A);a=null,h=void 0}const S=Ct(x);if(S===null||S!==d||!vt(t.node,y)){d=S;const A=po(t,x);y=St(t.node,A)}}else t.node&&k&&(d=void 0,y=null,t.node.style.display="")}finally{l&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,f)});o.__effects.push(u),o.__exec[i]=g}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(i)){const g=t[i],_=R(t,t[i+"Deps"],g),f=i;let d,y=null;const a=(0,E.createEffect)(()=>{const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{const u=_(t,t.state,t.context);if(t.node)if(u!=null){const l=f+":"+String(u);if(l!==d||!vt(t.node,y)){d=l;const b={[f]:u},x=po(t,b);y=St(t.node,x)}}else d=void 0,y=null,t.node.style[f]=""}finally{h&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,f)});o.__effects.push(a),o.__exec[i]=g}}if(typeof t.html=="function"){const i=t.html,g=R(t,t.htmlDeps,i),_=(0,E.createEffect)(()=>{const f=t.context?.designSystem;f&&(0,v.pushConfig)(f);try{const d=g(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{f&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,"html")});o.__effects.push(_),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,g=R(t,t.valueDeps,i),_=(0,E.createEffect)(()=>{try{let f=g(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=D.replaceLiteralsWithObjectFields.call(t,f,t.state)),ao(t,f)}catch(f){I(o,"value",f)}},{depth:o.path.length,label:j(o,"value")});o.__effects.push(_),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,g=(0,E.createEffect)(()=>{try{ao(t,D.replaceLiteralsWithObjectFields.call(t,i,t.state))}catch(_){I(o,"value",_)}},{depth:o.path.length,label:j(o,"value")});o.__effects.push(g),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,g=R(t,t.styleDeps,i);let _,f=null;const d=(0,E.createEffect)(()=>{const y=g(t,t.state,t.context),a=Ct(y);(a===null||a!==_||!vt(t.node,f))&&(_=a,us(t.node,f,y),J(t.node,y),f=St(t.node,y))},{depth:o.path.length,label:j(o,"style")});o.__effects.push(d),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const g=t.style[i];if(typeof g!="function")continue;const _=R(t,lt(t.styleDeps,i),g);let f,d=null;const y=(0,E.createEffect)(()=>{try{const a=_(t,t.state,t.context);if(t.node){const h=i+":"+String(a);if(h!==f||!vt(t.node,d)){f=h;const u={[i]:a};J(t.node,u),d=St(t.node,u)}}}catch(a){I(o,"style."+i,a)}},{depth:o.path.length,label:j(o,"style."+i)});o.__effects.push(y)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const g=R(t,lt(t.attrDeps,i),t.attr[i]),_=i,f=(0,E.createEffect)(()=>{try{let d=g(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=D.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!(0,w.isEnumeratedTrueFalseAttr)(_)?t.node.removeAttribute(_):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(_,(0,w.serializeAttrValue)(_,d)))}catch(d){I(o,"attr."+_,d)}},{depth:o.path.length,label:j(o,"attr."+_)});f._attrName=_.toLowerCase(),o.__effects.push(f)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const g=t.attr[i],_=i,f=(0,E.createEffect)(()=>{try{const d=D.replaceLiteralsWithObjectFields.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(_,(0,w.serializeAttrValue)(_,d??""))}catch(d){I(o,"attr."+_,d)}},{depth:o.path.length,label:j(o,"attr."+_)});f._attrName=_.toLowerCase(),o.__effects.push(f)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const g=t.aria[i];if(typeof g=="string"&&g.includes("{{")){const y=g,a="aria-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),h=(0,E.createEffect)(()=>{try{const u=D.replaceLiteralsWithObjectFields.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,(0,w.serializeAttrValue)(a,u??""))}catch(u){I(o,"aria."+i,u)}},{depth:o.path.length,label:j(o,"aria."+i)});h._attrName=a,o.__effects.push(h);continue}if(typeof g!="function")continue;const _=R(t,lt(t.ariaDeps,i),t.aria[i]),f="aria-"+i.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),d=(0,E.createEffect)(()=>{try{const y=_(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(f,(0,w.serializeAttrValue)(f,y))}catch(y){I(o,"aria."+i,y)}},{depth:o.path.length,label:j(o,"aria."+i)});d._attrName=f,o.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const i in t.data){const g=t.data[i];if(typeof g=="string"&&g.includes("{{")){const a=g,h="data-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),u=(0,E.createEffect)(()=>{try{const l=D.replaceLiteralsWithObjectFields.call(t,a,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(h,l??"")}catch(l){I(o,"data."+i,l)}},{depth:o.path.length,label:j(o,"data."+i)});u._attrName=h,o.__effects.push(u);continue}if(typeof g!="function")continue;const _=R(t,lt(t.dataDeps,i),t.data[i]),d="data-"+i.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),y=(0,E.createEffect)(()=>{try{const a=_(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(d):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(d,a===!0?"":a)}catch(a){I(o,"data."+i,a)}},{depth:o.path.length,label:j(o,"data."+i)});y._attrName=d,o.__effects.push(y)}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 i in e){if(typeof e[i]!="function")continue;const g=R(t,lt(t.classDeps,i),e[i]),_=(0,E.createEffect)(()=>{try{const f=g(t,t.state,t.context);if(!t.node?.classList)return;typeof f=="string"?t.node.classList.add(f):f?t.node.classList.add(i):t.node.classList.remove(i)}catch(f){I(o,"class."+i,f)}},{depth:o.path.length,label:j(o,"class."+i)});o.__effects.push(_)}!n&&typeof t.if=="function"&&fo(t,o,t.if);for(const i of Object.keys(t)){if(K.REGISTRY.has(i)||typeof t[i]!="function")continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||Y(i))continue;const _=t[i];o.__exec[i]=_;const f=t.tag||"div";if((0,w.checkAttributeByTagName)(f,i)&&!(0,Z.isCssProp)(f,i)){const d=(0,w.camelToAttr)(i)||i,y=R(t,t[i+"Deps"],_),a=(0,E.createEffect)(()=>{try{let h=y(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=D.replaceLiteralsWithObjectFields.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!(0,w.isEnumeratedTrueFalseAttr)(d)?t.node.removeAttribute(d):typeof h!="function"&&typeof h!="object"&&(d==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(d,(0,w.serializeAttrValue)(d,h))))}catch(h){I(o,i,h)}},{depth:o.path.length,label:j(o,i)});a._attrName=d.toLowerCase(),o.__effects.push(a)}}const p=t.tag||"div";for(const i of Object.keys(t)){if(K.REGISTRY.has(i))continue;const g=t[i];if(typeof g!="string"||!g.includes("{{"))continue;const _=i.charCodeAt(0);if(_>=65&&_<=90||Y(i)||(0,Z.isCssProp)(p,i)||w.ATTR_TRANSFORMS[i]||!(0,w.checkAttributeByTagName)(p,i))continue;const f=(0,w.camelToAttr)(i)||i,d=(0,E.createEffect)(()=>{try{const y=D.replaceLiteralsWithObjectFields.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(f,(0,w.serializeAttrValue)(f,y??""))}catch(y){I(o,i,y)}},{depth:o.path.length,label:j(o,i)});d._attrName=f.toLowerCase(),o.__effects.push(d)}if(_s(t),As(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,g=t.stateDeps;let _=!1,f=[];const d=(0,E.createEffect)(()=>{const y=[];for(let l=0;l<g.length;l++){const b=g[l];try{y[l]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{y[l]=void 0}}if(!_){_=!0,f=y;return}let a=y.length!==f.length;for(let l=0;!a&&l<y.length;l++)y[l]!==f[l]&&(a=!0);const h=f;if(f=y,!a)return;const u=t.context?.designSystem;u&&(0,v.pushConfig)(u);try{i(t,t.state,t.context,{prev:h,next:y})}catch(l){if(t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onStateUpdate",error:l})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',l),t.context?.strictMode)throw l}finally{u&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,"onStateUpdate")});o.__effects.push(d)}xs(t)}function co(t){const s=t.parent,o=s?.node;if(!o||!t.node){Eo(t,t.parent);return}let n=null;const r=Object.keys(s),c=r.indexOf(t.key);for(let e=c+1;e<r.length;e++){const p=s[r[e]];if(p?.node?.parentNode===o){n=p.node;break}}n?o.insertBefore(t.node,n):o.appendChild(t.node)}function fo(t,s,o){const n=R(t,t.ifDeps,o),r=(0,E.createEffect)(()=>{let c;try{c=n(t,t.state,t.context)}catch(p){if(c=!1,s.__ifError=p,typeof console<"u"&&console.warn){const i=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${i} \u2014 treating as false:`,p?.message||p)}return}const e=s.__if;if(s.__if=!!c,e&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(p){console.error("[smbls] onRemove error:",p)}}else if(!e&&s.__if)if(s.__ifInitialized)t.node||(t.node=(0,tt.cacheNode)(t)),t.node&&(t.node.ref=t),co(t),$t(t),$("Render",t,{}),Nt(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,tt.detectTag)(t)),$("Init",t,{}),t.node||(t.node=(0,tt.cacheNode)(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const i=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(i),s.__fragmentAnchor=i}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),ko(t,{}),io(t,{skipIfEffect:!0}),$t(t),wo(t),jo(t,{}),co(t),$("Create",t,{}),$("Complete",t,{}),$("Render",t,{}),$("RenderRouter",t,{}),Nt(t,{})}},{depth:s.path.length,label:j(s,"if")});s.__effects.push(r)}function pt(t,s){const o=t.node;if(!o)return;const n=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==n&&(o.nodeValue=n);return}const r=t.__ref;let c=r?r.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const e=o.firstChild;e&&e.nodeType===3&&(c=e)}c?c.nodeValue!==n&&(c.nodeValue=n):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),o.insertBefore(c,o.firstChild)):(o.textContent=n,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),r&&(r.__textNode=c||null)}function ao(t,s){const o=t.node;if(!o||!("value"in o))return;const n=s==null?"":String(s);if(o.value===n)return;const r=typeof document<"u"&&document.activeElement===o,c=r&&typeof o.selectionStart=="number"?o.selectionStart:null,e=r&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=n,r&&c!=null&&e!=null)try{o.setSelectionRange(c,e)}catch{}}function $t(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&pt(t,t.text),So(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){o={};for(const r in t.style)typeof t.style[r]!="function"&&(o[r]=t.style[r]);break}J(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const n=t.attr[o];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!(0,w.isEnumeratedTrueFalseAttr)(o)||s.setAttribute&&s.setAttribute(o,(0,w.serializeAttrValue)(o,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&s.setAttribute&&s.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const o in t.data){const n=t.data[o];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||s.dataset&&(s.dataset[o]=n===!0?"":n)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(n=>n&&s.classList.add(n));else if(typeof o=="object")for(const n in o){const r=typeof o[n]=="function"?o[n](t,t.state,t.context):o[n];r&&s.classList.add(typeof r=="string"?r:n)}}}}function Ct(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function as(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function St(t,s){if(!t||!t.style||!s)return null;const o=t.style,n=[];for(const r in s){if(s[r]==null||r.charAt(0)==="&")continue;const e=wt(r);n.push(e,It(o,e),uo(o,e))}return n}function It(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function uo(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function wt(t){return kt(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function us(t,s,o){if(!t||!t.style||!s||!s.length)return;const n=t.style,r=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||r.add(wt(c));for(let c=0;c<s.length;c+=3){const e=s[c];r.has(e)||It(n,e)===s[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(e)}}function vt(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let n=0;n<s.length;n+=3)if(It(o,s[n])!==s[n+1]||uo(o,s[n])!==s[n+2])return!1;return!0}const kt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function ls(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(wt(o)));return s}function ds(t,s,o,n){const r=t.__ref;if(!r)return;let c=null;if(o)for(const e of o){if(n&&n.has(e))continue;const p=s[e];if(p==null||typeof p=="object")continue;const i=wt(e);zt.CSS_LONGHAND_SHORTHANDS[i]&&(c||(c={}),c[i]=p)}r.__declaredLonghands=c}function lo(t,s){const o=t.__ref,n=o&&o.__declaredLonghands;if(!n||!s)return null;let r=null;for(const c in n){if(s.has(c))continue;const e=zt.CSS_LONGHAND_SHORTHANDS[c];let p=!1;for(let i=0;i<e.length;i++)if(s.has(e[i])){p=!0;break}p&&(r||(r={}),r[c]=n[c])}return r}function po(t,s){const o=t.node;J(o,s);const n=ls(s);if(!n)return s;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const e of n)r.__inlineCssKeys.add(e);else r.__inlineCssKeys=new Set(n);const c=lo(t,n);return c?(J(o,c),Object.assign({},s,c)):s}function ps(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=lo(t,s.__inlineCssKeys);o&&J(t.node,o)}function J(t,s){if(!t||!s||!t.style)return;let o=null;for(const n in s){const r=s[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){o||(o={}),o[n]=r;continue}try{const c=String(r),e=kt(n)?n:n.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),p=c.trim(),i=/\s*!important\s*$/.test(p),g=p.replace(/\s*!important\s*$/,"");t.style.setProperty(e,g,i?"important":"")}catch{}}}o&&hs(t,o)}function hs(t,s){const o=`_ds${Qt.scopedStyleId++}`;t.classList.add(o);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let c="";for(const e in s){const p="."+o,i=e.replace(/&/g,p).split(",").map(_=>{const f=_.trim();return f.includes(p)?f:p+f}).join(", "),g=s[e];if(typeof g=="object"){let _="",f="";for(const d in g){const y=g[d];if(typeof y=="object"){const a=d.includes("&")?i.split(", ").map(u=>d.replace(/&/g,u)).join(", "):i.split(", ").map(u=>`${u} ${d}`).join(", ");let h="";for(const u in y)h+=`${u.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${y[u]};`;f+=(0,q.wrapHoverRule)(`${a} { ${h} }`,a)+`
5
+ `}else _+=`${d.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())}: ${y};`}_&&(c+=(0,q.wrapHoverRule)(`${i} { ${_} }`,i)+`
6
+ `),f&&(c+=f)}}c&&(r.textContent+=c)}const ho=new Set;function yo(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function ys(t,s,o){const n=yo(o);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=s(t,t.state,t.context)}catch{return}if(yo(r)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";ho.has(c)||(ho.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function _s(t){const s=t.subscribeTo,o=typeof s=="function";let n=s;if(o)try{n=s(t,t.state,t.context)}catch{n=null}if(o&&(0,m.isLoudDevRuntime)()&&ys(t,s,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let c=0;c<n.length;c++){const e=n[c];if(typeof e!="string"||e.length===0)continue;const p=e.split("."),i=p[0],g=p.slice(1),_={value:!1},f=(0,E.createEffect)(()=>{const d=t.state&&((0,N.isStore)(t.state)?t.state.root:null);if(!d||!(0,N.isStore)(d))return;let y=d;y=y[i];for(let h=0;h<g.length&&!(y==null||typeof y!="object");h++)if((0,N.isStore)(y))y=y[g[h]];else break;if(!_.value)return;let a=!1;if(typeof t.onBeforeUpdate=="function"){const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{if(Do(r)){const u=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});u&&typeof u.then=="function"?u.then(()=>ht(r,!1),l=>{ht(r,!0),t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}):(ht(r,!1),u===!1&&(a=!0))}}catch(u){ht(r,!0),t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:u})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",u)}finally{h&&(0,v.popConfig)()}}if(!a&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){const u=r.__effects[h];u&&u!==f&&!u._disposed&&!u._isSubscribeToEffect&&typeof u._execute=="function"&&u._execute()}if(!a&&typeof t.onUpdate=="function"){const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{t.onUpdate(t,t.state,t.context)}catch(u){t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onUpdate",error:u})||console.error("[DOMQL] subscribeTo onUpdate error:",u)}finally{h&&(0,v.popConfig)()}}},{depth:r.path.length,label:j(r,"subscribeTo("+e+")")});_.value=!0,f._isSubscribeToEffect=!0,r.__effects.push(f)}}function Ut(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function Bt(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const _o=new Set;function gs(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",n=o+"::"+t;_o.has(n)||(_o.add(n),console.warn(`[smbls/css] "${t}" at ${o} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function nt(t,s,o,n){const r={},c=new Set,e=(p,i,g)=>{const _=g?new Set(Object.keys(r)):null;if(C.CSS_PROPS_REGISTRY[p]){const f=C.CSS_PROPS_REGISTRY[p](i,s,s.state,s.context);if(f){const d=Array.isArray(f)?f:[f];for(const y of d)y&&Object.assign(r,y)}}else r[p]=i;if(g)for(const f in r)_.has(f)||c.add(f)};for(const p in t){if(!Object.prototype.hasOwnProperty.call(t,p))continue;let i=t[p];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(p==="style"){for(const y in i){let a=i[y];if(typeof a=="function"&&(a=a(s,s.state,s.context)),a==null||typeof a=="function")continue;const h=typeof s[y]=="function"&&(C.CSS_PROPS_REGISTRY[y]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(y))||!!(n&&n.has(y));e(y,a,h)}continue}if(Ut(p,s)){const y=nt(i,s,!1,n);Object.keys(y).length&&(r[`[data-theme="${p.slice(1)}"] &`]=y);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(p)){(0,m.isLoudDevRuntime)()&&gs(p,s);continue}const f=Bt(p,s),d=nt(i,s,!1,n);Object.keys(d).length&&(r[f]=d);continue}const g=typeof s[p]=="function"&&(C.CSS_PROPS_REGISTRY[p]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(p)),_=!!(n&&n.has(p));e(p,i,g||_)}if(o)for(const p in r)c.add(p);for(const p of c){const i=r[p];typeof i=="string"&&!i.includes("!important")&&(r[p]=i+" !important")}return r}const jt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function go(t,s){for(const o in s){const n=s[o];t[o]=jt(n)?go(jt(t[o])?t[o]:{},n):n}return t}function bs(t,s){if(!jt(s))return;let o;for(const n of t.split(" ")){const r=n?s[n]:null;jt(r)&&(o=go(o||{},r))}return o}function Kt(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Kt(t[o],s+1))return!0}return!1}function bo(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Ut(t,o)){const c=nt(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=Bt(t,o),r=nt(s,o,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function xs(t){const s=t.__ref;for(const o of Object.keys(t)){if(!Mt(o))continue;const n=t[o];if(!n||typeof n!="object"||Array.isArray(n)||!Kt(n))continue;let r=null,c;const e=(0,E.createEffect)(()=>{if(!t.node)return;const p=t.context?.designSystem;p&&(0,v.pushConfig)(p);let i,g=!1;try{const _=bo(o,n,t),f=_?Ct(_.block)+"::"+_.cssProp:null;if(f!==null&&f===c)g=!0;else if(c=f,_){const d=(0,q.css)({[_.cssProp]:_.block},null,t.context?.cssPrefix);i=d?d.split(" ").filter(Boolean):null}else i=null}finally{p&&(0,v.popConfig)()}if(!(g||!t.node.classList)){if(r)for(const _ of r)t.node.classList.remove(_);if(i&&i.length)for(const _ of i)t.node.classList.add(_);r=i}},{depth:s.path.length,label:j(s,"cssBlock("+o+")")});s.__effects.push(e)}}function As(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const n of Object.keys(t)){const r=n.charAt(0);if(r!=="."&&r!=="!")continue;const c=n.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const a=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${a}: { '${c.slice(a.length)}': {...} }\`.`)}continue}const e=t[n];if(!e||typeof e!="object")continue;const p=r==="!",i={lastMatch:!1,appliedKeys:null,appliedClasses:null},g=new Set;for(const a in e){if(!Object.prototype.hasOwnProperty.call(e,a))continue;const h=a.charAt(0),u=e[a];(h===":"||h==="@"||h==="&"||h==="[")&&u&&typeof u=="object"&&!Array.isArray(u)||g.add(a)}const _=()=>{let a;const h=t[c];if(h===void 0){const b=!!t.state&&c in t.state,x=t.state?t.state[c]:void 0;if(b||x!==void 0)a=x;else{const k=t.context?.cases?.[c];if(k===void 0)return;try{a=typeof k=="function"?k.call(t,t):k}catch(S){a=!1,s.__conditionalError=S,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,S?.message||S)}}}else if(typeof h=="function")try{a=h(t,t.state,t.context)}catch(b){a=!1,s.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else a=h;const u=p?!a:!!a;if(!t.node||u===i.lastMatch)return;i.lastMatch=u;const l=t.context?.designSystem;l&&(0,v.pushConfig)(l);try{if(u){const b={},x={};let k=!1;for(const A in e){if(!Object.prototype.hasOwnProperty.call(e,A))continue;const L=e[A],U=A.charAt(0);if((U===":"||U==="@"||U==="&"||U==="[")&&L&&typeof L=="object"&&!Array.isArray(L)){if(Ut(A,t)){const O=nt(L,t,!1,g);Object.keys(O).length&&(x[`[data-theme="${A.slice(1)}"] &`]=O,k=!0)}else{const O=Bt(A,t),X=nt(L,t,!1,g);Object.keys(X).length&&(x[O]=X,k=!0)}continue}const M=typeof L=="function"?L(t,t.state,t.context):L;if(M!=null)if(C.CSS_PROPS_REGISTRY[A]){const O=C.CSS_PROPS_REGISTRY[A](M,t,t.state,t.context);if(O){const X=Array.isArray(O)?O:[O];for(const yt of X)yt&&Object.assign(b,yt)}}else(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(A)||kt(A))&&(b[A]=M)}const S=Object.keys(b);if(S.length){J(t.node,b);for(const A of S)o.set(A,n);i.appliedKeys=S}else i.appliedKeys=null;if(k){const A=(0,q.css)(x,null,t.context?.cssPrefix,{state:!0}),L=A?A.split(" ").filter(Boolean):[];if(L.length&&t.node.classList){for(const U of L)t.node.classList.add(U);i.appliedClasses=L}else i.appliedClasses=null}else if(i.appliedClasses){for(const A of i.appliedClasses)t.node.classList.remove(A);i.appliedClasses=null}}else{if(i.appliedKeys){for(const b of i.appliedKeys)o.get(b)===n&&(kt(b)?t.node.style.removeProperty(b):t.node.style[b]="",o.delete(b));i.appliedKeys=null}if(i.appliedClasses){for(const b of i.appliedClasses)t.node.classList.remove(b);i.appliedClasses=null}}}finally{l&&(0,v.popConfig)()}};s.__conditionalRunners.push(_);const f=R(t,t[c+"Deps"],_),d=(0,E.createEffect)(f,{depth:s.path.length,label:j(s,"conditional("+n+")")}),y=s.__exec&&s.__exec[c]||t[c];d._sources.size===0&&typeof y=="function"&&(0,m.isLoudDevRuntime)()&&console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(d)}}const Ht=new WeakSet;function Cs(t){const s=t.ownerDocument;!s||Ht.has(s)||(Ht.add(s),queueMicrotask(()=>{Ht.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const Vt=new WeakSet;let xo=!1;function Ao(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Gt(t,s){const o={...t};for(const n in s){const r=s[n],c=o[n];o[n]=r&&typeof r=="object"&&c&&typeof c=="object"?Gt(c,r):r}return o}function Co(t,s){const o={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const c=Co(r,s);Object.keys(c).length&&(o[n]=c)}else s.has(n)||(o[n]=r)}return o}function So(t){const{node:s}=t;if(!s)return;if(xo||(xo=!0,(0,q.css)({display:"none"})),Vt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Vt.add(t);const o=t.context?.designSystem;o&&(0,v.pushConfig)(o),(0,C.pushStaticCssPass)();try{const n={};let r=!1,c=[],e=null,p=null,i=null;const g=(a,h)=>{if(h&&typeof h=="object"&&Ao(a)){p||(p={});const u=p[a];u&&(h=Gt(u,h)),p[a]=h}else(h===null||typeof h!="object")&&(i||(i=new Set),i.add(a));n[a]=h};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&C.CSS_PROPS_REGISTRY.theme){const a=C.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(a){const h=u=>{for(const l in u){const b=u[l];b&&typeof b=="object"&&Ao(l)&&(e||(e={}),e[l]=b),n[l]=b}};if(Array.isArray(a))for(const u of a)u&&h(u);else h(a);r=!0}}const _=(a,h)=>{if(C.CSS_PROPS_REGISTRY[a]){const u=C.CSS_PROPS_REGISTRY[a](h,t,t.state,t.context);if(u){if(Array.isArray(u)){for(const l of u)if(l)for(const b in l)g(b,l[b])}else for(const l in u)g(l,u[l]);r=!0}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(a))h!=null&&typeof h!="object"&&(g(a,h),r=!0);else if(a.charCodeAt(0)===45)h!=null&&typeof h!="object"&&(g(a,h),r=!0);else if((a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="[")&&h&&typeof h=="object"&&!Array.isArray(h)){if(Kt(h))return;const u=bo(a,h,t);u&&(g(u.cssProp,u.block),r=!0)}};if(typeof t.class=="string"){const a=bs(t.class,t.context?.designSystem?.class);if(a)for(const h in a)_(h,a[h])}const f=i?new Set(i):null,d=t.tag||"div";for(const a of Object.keys(t)){if(typeof t[a]=="function"||K.REGISTRY.has(a)||a==="theme")continue;const h=a.charCodeAt(0);h>=65&&h<=90||Y(a)||(0,Z.isAttributeFirst)(d,a)||_(a,t[a])}if(e)for(const a in e){let h=i?Co(e[a],i):e[a];p&&p[a]&&(h=Gt(h,p[a])),Object.keys(h).length?n[a]=h:delete n[a]}if(ds(t,n,i,f),r){n.display&&String(n.display).includes("!important")&&(s.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const a=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof a=="string"&&a!==""&&n.display&&n.display!==a&&(n.display=a);const h=(0,q.css)(n,null,t.context?.cssPrefix);if(c=h?h.split(" ").filter(Boolean):[],h&&s.classList){const u=c;let l=!1;for(const b of u)s.classList.add(b),l||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(l=!0);l&&Cs(s)}}const y=t.__ref;if(y){const a=y.__staticCssClasses;if(a&&s.classList){const h=new Set(c);for(const u of a)h.has(u)||s.classList.remove(u)}y.__staticCssClasses=c}ps(t)}finally{(0,C.popStaticCssPass)(),o&&(0,v.popConfig)(),Vt.delete(t)}}const Ss=t=>!!C.CSS_PROPS_REGISTRY[t]||!!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function ws(t){t&&t.node&&So(t)}function wo(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const e="aria-"+r.replace(/[A-Z]/g,p=>"-"+p.toLowerCase());s.setAttribute(e,(0,w.serializeAttrValue)(e,c))}const o=(0,w.applyAttrTransforms)(t);for(const r in o){const c=o[r];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(r,c===!0?"":c)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||K.REGISTRY.has(r)||r==="on"||o[r]!==void 0)continue;const c=r.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(r)&&!(0,Z.isCssProp)(n,r)&&(0,w.checkAttributeByTagName)(n,r)){let e=t[r];if(e==null)continue;if(typeof e=="string"&&e.includes("{{")){if(!w.ATTR_TRANSFORMS[r])continue;e=D.replaceLiteralsWithObjectFields.call(t,e,t.state)}if(e==null||typeof e=="function"||typeof e=="object"||e===!1&&!(0,w.isEnumeratedTrueFalseAttr)((0,w.camelToAttr)(r)||r))continue;const p=(0,w.camelToAttr)(r)||r;s.setAttribute(p,(0,w.serializeAttrValue)(p,e))}}}function vs(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const n=s.charCodeAt(0);if(n>=65&&n<=90||Y(s))return;const r=t.tag||"div";if((0,Z.isCssProp)(r,s)||!(0,w.checkAttributeByTagName)(r,s))return;const c=(0,w.camelToAttr)(s)||s,e=c.toLowerCase(),p=t.__ref&&t.__ref.__effects;let i=!1;if(p)for(let f=0;f<p.length;f++){const d=p[f];d&&d._attrName===e&&!d._disposed&&typeof d._execute=="function"&&(i=!0,d._execute())}if(i)return;let g=t[s];const _=w.ATTR_TRANSFORMS[s];if(_&&g!=null){const f=_(t);f!==void 0&&(g=f)}typeof g=="string"&&g.includes("{{")&&(g=D.replaceLiteralsWithObjectFields.call(t,g,t.state)),g==null||g===!1&&!(0,w.isEnumeratedTrueFalseAttr)(c)?o.removeAttribute(c):typeof g!="function"&&typeof g!="object"&&o.setAttribute(c,(0,w.serializeAttrValue)(c,g))}function ks(t,s){const o=t.node,n=t.__ref;let r=n.__autoGrow;if(!s){if(r&&r.active){try{o.removeEventListener("input",r.resize)}catch{}o.style.height="",r.appliedMax!=null&&o.style.maxHeight===r.appliedMax&&(o.style.maxHeight=""),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(o.scrollHeight===0&&r.lastMeasure>0)return;o.style.height="auto";const e=o.scrollHeight;o.style.height=e+"px",e>0&&(r.lastMeasure=e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{o.removeEventListener("input",r.resize)}catch{}})),r.active||(o.addEventListener("input",r.resize),r.active=!0);const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==r.appliedMax&&(c==null?r.appliedMax!=null&&o.style.maxHeight===r.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,r.appliedMax=c),r.resize()}function js(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,n=t.autoGrow,r=typeof n=="function"?R(t,t.autoGrowDeps,n):null,c=(0,E.createEffect)(()=>{const e=t.autoGrow;let p=e;if(typeof e=="function")try{p=(e===n&&r?r:e)(t,t.state,t.context)}catch{p=null}ks(t,p)},{depth:o.path.length,label:j(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),r&&(o.__exec.autoGrow=n)}const vo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function ko(t,s){for(const o of Object.keys(t)){if(!Y(o)||vo.has(o))continue;const n=(0,rt.globalEventKeyInfo)(o);if(n){(0,rt.registerGlobalEvent)(n,t,t[o]);continue}let r=t[o];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const e=r;r=function(i){return t.call(e,i)}}if(typeof r!="function")continue;const c=Qo(o);K.LIFECYCLE_EVENTS.has(c)||(0,rt.registerEvent)(Xo(c),t,r)}Es(t)}function Es(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let n=!1;for(const d of vo){const y=t[d];typeof y=="function"&&(o[d]=y,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let e=0,p=0,i=0,g=!1;const _=d=>{const y=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];y&&(e=y.clientX,p=y.clientY,i=Date.now(),g=!0)},f=d=>{if(!g)return;g=!1;const y=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!y)return;const a=y.clientX-e,h=y.clientY-p,u=Date.now()-i;if(u>c)return;const l=Math.abs(a),b=Math.abs(h);if(Math.max(l,b)<r)return;let x;if(l>b*1.2)x=a<0?"left":"right";else if(b>l*1.2)x=h<0?"up":"down";else return;const k="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),S=o[k],A=o.onSwipe;S&&S.call(t,d,t,t.state,t.context),A&&A.call(t,{direction:x,dx:a,dy:h,dt:u,event:d},t,t.state,t.context)};s.addEventListener("touchstart",_,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",_)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function dt(t,s){const o={...t};for(const n in s){const r=o[n],c=s[n];r&&c&&typeof r=="object"&&typeof c=="object"&&!Array.isArray(r)&&!Array.isArray(c)&&typeof r!="function"&&typeof c!="function"?o[n]=dt(r,c):o[n]=c}return o}function Wt(t,s,o,n){if(!s||!t.node)return;const r=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",e=t.context?.document||globalThis.document,p=c?null:e?.createDocumentFragment();if(!c&&!p)return;const i=t.childProps,g=t.childrenAs,_=u=>{let l=s[u];const b=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let x=i;if(typeof i=="function")try{x=i(t,l)}catch{x=null}if(g==="state"){let S=b;(typeof b=="string"||typeof b=="number")&&(S={value:b,text:b}),l=x?{...x,state:S}:{state:S}}else x&&(l=dt(x,l));if(r&&!l.ignoreChildExtends)if(l.extends){const S=Array.isArray(l.extends)?l.extends:[l.extends],A=Array.isArray(r)?r:[r];l={...l,extends:[...A,...S]}}else l={...l,extends:r};const k=oo(l?.key,b,u);try{return Q(l,t,k,o)}catch(S){if(typeof console<"u"&&console.error){const A=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${A} (initial render, skipping this row):`,S?.message||S)}return null}},f=t.__ref;if(!(n===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let u=0;u<s.length;u++){const l=_(u);!c&&l?.node&&p.appendChild(l.node)}return c||t.node.appendChild(p),!0}const y=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;(0,H.openMountBudget)();let a=null;const h=u=>{if(f.__disposed||f.__childrenChunkGen!==y){a&&a.parentNode&&a.remove();return}for(let l=u;l<s.length;l++){const b=_(l);if(b?.node&&(a?t.node.insertBefore(b.node,a):p.appendChild(b.node)),l+1<s.length&&(0,H.mountBudgetExhausted)()){a||(a=e.createComment("smbls-mount"),p.appendChild(a),t.node.appendChild(p));const x=l+1;(0,H.enqueueMountWork)(()=>h(x));return}}a?(a.remove(),t.node.tagName==="SELECT"&&Et(t,!0)):t.node.appendChild(p)};return h(0),(0,H.closeMountBudget)(),!0}if(typeof s=="string"){const c=so(s,t);if(Array.isArray(c))return Wt(t,c,o,n)}if(typeof s=="object")for(const c in s){if(K.REGISTRY.has(c))continue;let e=s[c];if(!(e==null||e===!1)){if((typeof e=="string"||typeof e=="number")&&(e={text:e}),t.childProps&&(e=dt(t.childProps,e)),r&&!e.ignoreChildExtends)if(e.extends){const p=Array.isArray(e.extends)?e.extends:[e.extends],i=Array.isArray(r)?r:[r];e={...e,extends:[...i,...p]}}else e={...e,extends:r};Q(e,t,c,o)}}}function Et(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const n=o.options;if(!n||!n.length)return;const r=t.__ref,c=r&&r.__exec&&r.__exec.value,e=typeof c=="function",p=t.value!=null&&typeof t.value!="function";if(e||p){let _;if(e)try{_=c(t,t.state,t.context)}catch{return}else _=t.value,typeof _=="string"&&_.includes("{{")&&(_=D.replaceLiteralsWithObjectFields.call(t,_,t.state));const f=_==null?"":String(_);o.value!==f&&(o.value=f);return}const i=s||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!i)return;let g=-1;for(let _=0;_<n.length;_++)n[_].defaultSelected&&(g=_);g>=0&&o.selectedIndex!==g&&(o.selectedIndex=g)}function jo(t,s){let{children:o,content:n}=t;const r=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(u){if(o=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,u?.message||u)}}t.children=o;const d=t.__ref;let y=!1;const a=R(t,t.childrenDeps,f),h=(0,E.createEffect)(()=>{const u=y;y=!0;let l;try{l=a(t,t.state,t.context)}catch(M){if(typeof console<"u"&&console.error){const O=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${O}${u?"":" (initial tracking run)"}:`,M?.message||M)}return}if(!u||l===t.children)return;t.children=l,d.__childrenChunkGen!=null&&d.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",x=b?[]:null,k=b?[]:null,S=b?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const M=t.childProps,O=[],X=new Map;for(let T=0;T<l.length;T++){const V=l[T];let P=M;if(typeof M=="function")try{P=M(t,V)}catch{P=null}const z=oo(P&&P.key,V,T);O.push(z),X.set(z,{rawChild:V,childProps:P})}const yt=new Set(O),Ro=d.__children.slice();for(const T of Ro)if(!yt.has(T)){const V=t[T];V?.remove&&V.remove(),delete t[T],k&&k.push(T)}const it=t.childExtends,_t=t.tag==="fragment",No=t.context?.document||globalThis.document,ct=_t?null:No?.createDocumentFragment(),Lt=new Set;for(const T of O){const V=X.get(T),P=V.rawChild,z=t[T];if(z&&z.state){if(P&&typeof P=="object"){const F=z.state,ot=F.$replace||F.replace,qt=F.$update||F.update;try{if(typeof ot=="function")ot.call(F,P);else if(typeof qt=="function"){for(const B in F)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(P,B))try{F[B]=void 0}catch{}qt.call(F,P)}else for(const B in P)F[B]=P[B]}catch(B){if(typeof console<"u"&&console.error){const Mo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Mo} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}S&&S.push(T);continue}let Ot=P;(typeof P=="string"||typeof P=="number")&&(Ot={value:P,text:P});const Yt=V.childProps;let G=Yt?{...Yt,state:Ot}:{state:Ot};if(it&&!G.ignoreChildExtends)if(G.extends){const F=Array.isArray(G.extends)?G.extends:[G.extends],ot=Array.isArray(it)?it:[it];G={...G,extends:[...ot,...F]}}else G={...G,extends:it};let Dt;try{Dt=Q(G,t,T,s)}catch(F){if(typeof console<"u"&&console.error){const ot=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${ot} (reconcile, skipping this row):`,F?.message||F)}Lt.add(T);continue}!_t&&Dt?.node&&ct&&ct.appendChild(Dt.node),x&&x.push(T)}if(!_t&&ct&&ct.childNodes.length&&t.node&&t.node.appendChild(ct),!_t&&t.node){let T=null;for(const V of O){const P=t[V]?.node;if(!P)continue;const z=T?T.nextSibling:t.node.firstChild;P!==z&&t.node.insertBefore(P,z),T=P}}d.__children=Lt.size?O.filter(T=>!Lt.has(T)):O,b&&(x.length||k.length)&&to(t,{added:x,removed:k,kept:S}),Et(t,!1);return}const U=b?[...d.__children]:null;for(const M of[...d.__children]){const O=t[M];O?.remove&&O.remove(),delete t[M]}d.__children=[],Wt(t,l,s),Et(t,!1),b&&to(t,{added:[...d.__children],removed:U,kept:[]})},{depth:d.path.length,label:j(d,"children")});d.__effects.push(h)}const c=Wt(t,o,s,!0);if(n!=null&&!(n&&n.__ref)){let f=n;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=dt(t.childProps,f)),r&&!f.ignoreChildExtends)if(f.extends){const d=Array.isArray(f.extends)?f.extends:[f.extends],y=Array.isArray(r)?r:[r];f={...f,extends:[...y,...d]}}else f={...f,extends:r};Q(f,t,"content",s)}if(o&&!c)return;const e=t.context?.components||{};{const f=Object.keys(t);for(let d=0;d<f.length;d++){const y=f[d];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const a=y.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const h={extends:t[y]};delete t[y];for(let u=d+1;u<f.length;u++){const l=f[u],b=l.charCodeAt(0);if(b>=65&&b<=90||K.REGISTRY.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const x=t[l];x!==void 0&&(h[l]=x,delete t[l])}t[a]&&typeof t[a]=="object"?t[a]={...h,...t[a]}:t[a]=h}}const p=s?.mountYield===!0||t.yieldChildren===!0,i=Object.keys(t),g=f=>{if(K.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return;const d=f.charCodeAt(0);if(d<65||d>90)return;let y=t[f];if(!y.__ref){if(!y.extends&&!y.extend){const a=e[f]||e[`smbls.${f}`];a&&(y={...y,extends:a})}if(t.childProps&&(y=dt(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const a=Array.isArray(y.extends)?y.extends:[y.extends],h=Array.isArray(r)?r:[r];y={...y,extends:[...h,...a]}}else y={...y,extends:r};Q(y,t,f,s)}};if(!p){for(const f of i)g(f);return}(0,H.openMountBudget)();const _=f=>{for(let d=f;d<i.length;d++)if(g(i[d]),d+1<i.length&&(0,H.mountBudgetExhausted)()){const y=d+1;(0,H.enqueueMountWork)(()=>_(y));return}};_(0),(0,H.closeMountBudget)()}function Eo(t,s,o){const{node:n}=t;if(!n)return;n.ref=t;const r=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(r){const e=r.parentNode;if(e){if(o?.position==="before"&&o.node)e.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const p=o.node.nextSibling;e.insertBefore(n,p||r)}else e.insertBefore(n,r);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const e=o.node.nextSibling;e?c.insertBefore(n,e):c.appendChild(n)}else c.appendChild(n)}const Pt=3;function Do(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Pt?!1:(t.__inBeforeUpdate=!0,!0)}function ht(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Pt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Pt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function $(t,s,o){const n=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,W.runPluginHook)(n,s,o);const r="on"+t,c=s[r];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(s.__ref[i])return!0;s.__ref[i]=!0}const g=s.context?.designSystem;g&&(0,v.pushConfig)(g);let _=!!i;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const d=s.__ref;return f.catch(y=>{s.context?.plugins?.length&&(0,W.runPluginHook)("error",s,{hook:r,error:y})||console.error(`[DOMQL] Lifecycle "${r}" error:`,y)}).finally(()=>{i&&d&&(d[i]=!1)}),_=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&(0,W.runPluginHook)("error",s,{hook:r,error:f})||console.error(`[DOMQL] Lifecycle "${r}" error:`,f),s.context?.strictMode)throw f}finally{g&&(0,v.popConfig)(),_&&s.__ref&&(s.__ref[i]=!1)}}return!0}var Ts=Q;
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var w=(o,i)=>{for(var s in i)c(o,s,{get:i[s],enumerable:!0})},k=(o,i,s,m)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of f(i))!h.call(o,a)&&a!==s&&c(o,a,{get:()=>i[a],enumerable:!(m=u(i,a))||m.enumerable});return o};var y=o=>k(c({},"__esModule",{value:!0}),o);var x={};w(x,{CSS_LONGHAND_SHORTHANDS:()=>p,CSS_SHORTHAND_LONGHANDS:()=>n});module.exports=y(x);const t=(o,i)=>i.split(" ").map(s=>o+"-"+s),d="top right bottom left",g=d+" block block-start block-end inline inline-start inline-end",e="start end",r="width style color",l=o=>t(o,g),S=(()=>{const o=t("border","width style color image");for(const i of g.split(" "))o.push("border-"+i,...t("border-"+i,r));return o})(),b=o=>[...t("border-"+o,r+" start end"),...t("border-"+o+"-start",r),...t("border-"+o+"-end",r)],n={animation:t("animation","name duration timing-function delay iteration-count direction fill-mode play-state timeline range range-start range-end"),background:t("background","image position position-x position-y size repeat origin clip attachment color"),border:S};for(const o of["width","style","color"])n["border-"+o]=g.split(" ").map(i=>"border-"+i+"-"+o);for(const o of d.split(" "))n["border-"+o]=t("border-"+o,r);n["border-block"]=b("block"),n["border-inline"]=b("inline"),Object.assign(n,{"border-image":t("border-image","source slice width outset repeat"),"border-radius":"top-left top-right bottom-right bottom-left start-start start-end end-start end-end".split(" ").map(o=>"border-"+o+"-radius"),columns:t("column","width count"),"column-rule":t("column-rule",r),container:t("container","name type"),"contain-intrinsic-size":t("contain-intrinsic","width height"),flex:t("flex","grow shrink basis"),"flex-flow":t("flex","direction wrap"),font:[...t("font","style variant weight stretch size"),"line-height",...t("font","family size-adjust kerning feature-settings variation-settings optical-sizing")],gap:["row-gap","column-gap"],grid:t("grid","template template-rows template-columns template-areas auto-rows auto-columns auto-flow"),"grid-template":t("grid-template","rows columns areas"),"grid-area":t("grid","row column row-start row-end column-start column-end"),"grid-row":t("grid-row",e),"grid-column":t("grid-column",e),inset:[...d.split(" "),...t("inset","block block-start block-end inline inline-start inline-end")],"inset-block":t("inset-block",e),"inset-inline":t("inset-inline",e),"list-style":t("list-style","type position image"),margin:l("margin"),"margin-block":t("margin-block",e),"margin-inline":t("margin-inline",e),mask:t("mask","image mode repeat position clip origin size composite"),offset:t("offset","position path distance rotate anchor"),outline:t("outline",r),overflow:t("overflow","x y"),"overscroll-behavior":t("overscroll-behavior","x y"),padding:l("padding"),"padding-block":t("padding-block",e),"padding-inline":t("padding-inline",e)});for(const o of["content","items","self"])n["place-"+o]=["align-"+o,"justify-"+o];Object.assign(n,{"scroll-margin":l("scroll-margin"),"scroll-padding":l("scroll-padding"),"text-decoration":t("text-decoration","line style color thickness"),"text-emphasis":t("text-emphasis","style color"),transition:t("transition","property duration timing-function delay behavior")});const p={};for(const o in n)for(const i of n[o])(p[i]||(p[i]=[])).push(o);
@@ -1 +1 @@
1
- "use strict";var w=Object.create;var f=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var v=(t,e)=>{for(var n in e)f(t,n,{get:e[n],enumerable:!0})},_=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of C(e))!R.call(t,r)&&r!==n&&f(t,r,{get:()=>e[r],enumerable:!(o=x(e,r))||o.enumerable});return t};var b=(t,e,n)=>(n=t!=null?w(S(t)):{},_(e||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t)),P=t=>_(f({},"__esModule",{value:!0}),t);var L={};v(L,{addMethods:()=>j,elementProto:()=>c,refreshContextProto:()=>O});module.exports=P(L);var y=require("./update.js"),m=require("./dispose.js"),a=require("./devRuntime.js"),F=require("css-in-props"),s=require("@symbo.ls/utils"),d=b(require("@symbo.ls/utils"),1);function u(t,e,n){const o=t?.context?.analyze;if(!o||!o.emit||e==="warn"&&!o.shouldCapture("warnings")||e==="error"&&!o.shouldCapture("errors"))return;const r=n.map(i=>i?.message||(typeof i=="string"?i:null)).filter(Boolean).join(" ");o.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:r||null,args:n})}const p=new Set;function g(t,e,n){const o=String(e);if(p.has(o))return;p.add(o);const r=t?.__ref?.path,i=Array.isArray(r)&&r.length?r.join("."):t?.key!=null?String(t.key):"(unknown element)",k=n!=null?`resolves to a non-function (${typeof n}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",h=`[smbls] el.call('${o}') at <${i}>: "${o}" ${k}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;u(t,"error",[h]),console.error(h)}function A(...t){return u(this,"warn",t),s.warn.apply(this,t)}function D(...t){return u(this,"error",t),s.error.apply(this,t)}const c={update:y.update,remove:m.remove,getDB:s.getDB,getQuery:s.getQuery,getRootData:s.getRootData,getPath:s.getPath,nextElement:s.nextElement,previousElement:s.previousElement,verbose:s.verbose,warn:A,error:D,variables:s.variables,spotByPath:s.spotByPath,set(t,e){const n=this.__ref;if(n){if(n.__setLocked){n.__setQueued={content:t,options:e};return}n.__setLocked=!0}try{if(this.removeContent(),t!=null){const o=this.context?.__create;o&&o(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(n){n.__setLocked=!1;const o=n.__setQueued;o&&(n.__setQueued=null,this.set(o.content,o.options))}}},reset(t){const e=this.context?.__create;if(!e)return this;const n=this.parent,o=this.key,r=this.parse();return this.remove(),e(r,n,o,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){const e=this.__ref;if(!e?.__children)return null;for(const n of e.__children){const o=this[n];if(!o)continue;if(typeof t=="function"){if(t(o))return o}else if(typeof t=="string"&&o.key===t)return o;const r=o.lookdown?.(t);if(r)return r}return null},lookdownAll(t,e=[]){const n=this.__ref;if(!n?.__children)return e;for(const o of n.__children){const r=this[o];r&&(typeof t=="function"?t(r)&&e.push(r):typeof t=="string"&&r.key===t&&e.push(r),r.lookdownAll?.(t,e))}return e},getRef(t){return t?this.__ref&&this.__ref[t]:this.__ref},getChildren(){const t=this.__ref&&this.__ref.__children;return Array.isArray(t)?t.map(e=>this[e]):[]},getRoot:s.getRoot,getRootState:s.getRootState,getRootContext:s.getRootContext,getContext:s.getContext,parse(t){const e={},n=t?new Set(t):null,o=this.__ref?.__exec;for(const r in this)if(!(r==="parent"||r==="node"||r==="__ref")&&!n?.has(r)){if(o&&o[r]!==void 0){e[r]=o[r];continue}typeof this[r]!="function"&&(e[r]=this[r])}return e},parseDeep(t){const e=this.parse(t),n=this.__ref;if(n?.__children)for(const o of n.__children)this[o]?.parseDeep&&(e[o]=this[o].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){const e={};for(const n of t)e[n]=this[n];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(const e in t){const n=t[e];if(n==null)continue;const o=e.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),r=String(n).replace(/\s*!important\s*$/,"");this.node.style.setProperty(o,r,"important")}},call(t,...e){const n=this.context,o=n?.methods?.[t]||n?.functions?.[t]||n?.utils?.[t]||this[t];if(typeof o=="function"){const r=d.isFailedRevival;if(!r||!r(o))return o.call(this,...e);(0,a.isLoudDevRuntime)()&&g(this,t,d.getFunctionSource(o));return}(0,a.isLoudDevRuntime)()&&g(this,t,o)},removeContent(){const t=this.__ref;if(!t?.__children)return;const e=this.content;if(e?.remove){e.remove(),delete this.content;const n=t.__children.indexOf("content");n!==-1&&t.__children.splice(n,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},l=new WeakMap;function $(t){if(!t)return c;let e=l.get(t);if(e)return e;e=Object.create(c);const n=t.methods;if(n)for(const o in n)e[o]=n[o];return l.set(t,e),e}function j(t){const e=$(t.context);Object.setPrototypeOf(t,e)}function O(t){if(!t)return!1;const e=l.get(t);if(!e)return!1;const n=t.methods;if(!n)return!1;for(const o in n)e[o]=n[o];return!0}
1
+ "use strict";var R=Object.create;var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var n in e)c(t,n,{get:e[n],enumerable:!0})},p=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of v(e))!O.call(t,r)&&r!==n&&c(t,r,{get:()=>e[r],enumerable:!(o=b(e,r))||o.enumerable});return t};var E=(t,e,n)=>(n=t!=null?R(P(t)):{},p(e||!t||!t.__esModule?c(n,"default",{value:t,enumerable:!0}):n,t)),$=t=>p(c({},"__esModule",{value:!0}),t);var F={};D(F,{__resetFoldShadowWarnings:()=>j,addMethods:()=>T,elementProto:()=>f,refreshContextProto:()=>B});module.exports=$(F);var S=require("./update.js"),x=require("./dispose.js"),l=require("./devRuntime.js"),Q=require("css-in-props"),s=require("@symbo.ls/utils"),u=E(require("@symbo.ls/utils"),1);function a(t,e,n){const o=t?.context?.analyze;if(!o||!o.emit||e==="warn"&&!o.shouldCapture("warnings")||e==="error"&&!o.shouldCapture("errors"))return;const r=n.map(i=>i?.message||(typeof i=="string"?i:null)).filter(Boolean).join(" ");o.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:r||null,args:n})}const g=new Set;function y(t,e,n){const o=String(e);if(g.has(o))return;g.add(o);const r=t?.__ref?.path,i=Array.isArray(r)&&r.length?r.join("."):t?.key!=null?String(t.key):"(unknown element)",C=n!=null?`resolves to a non-function (${typeof n}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",d=`[smbls] el.call('${o}') at <${i}>: "${o}" ${C}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;a(t,"error",[d]),console.error(d)}const w=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),A=new Set,k=t=>w(f,t)&&!(u.ELEMENT_METHOD_OVERRIDE_POINTS||A).has(t),h=new Set,j=()=>{h.clear()};function m(t,e){h.has(t)||(h.add(t),(0,l.isLoudDevRuntime)()&&console.warn(`[smbls] ${e}: context.methods.${t} is named like a built-in element method and is not the app's own override (it was not on the element prototype when it was built) \u2014 ignored; the built-in keeps winning. Declare an intentional override in the app's OWN methods.`))}function W(...t){return a(this,"warn",t),s.warn.apply(this,t)}function L(...t){return a(this,"error",t),s.error.apply(this,t)}const f={update:S.update,remove:x.remove,getDB:s.getDB,getQuery:s.getQuery,getRootData:s.getRootData,getPath:s.getPath,nextElement:s.nextElement,previousElement:s.previousElement,verbose:s.verbose,warn:W,error:L,variables:s.variables,spotByPath:s.spotByPath,set(t,e){const n=this.__ref;if(n){if(n.__setLocked){n.__setQueued={content:t,options:e};return}n.__setLocked=!0}try{if(this.removeContent(),t!=null){const o=this.context?.__create;o&&o(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(n){n.__setLocked=!1;const o=n.__setQueued;o&&(n.__setQueued=null,this.set(o.content,o.options))}}},reset(t){const e=this.context?.__create;if(!e)return this;const n=this.parent,o=this.key,r=this.parse();return this.remove(),e(r,n,o,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){const e=this.__ref;if(!e?.__children)return null;for(const n of e.__children){const o=this[n];if(!o)continue;if(typeof t=="function"){if(t(o))return o}else if(typeof t=="string"&&o.key===t)return o;const r=o.lookdown?.(t);if(r)return r}return null},lookdownAll(t,e=[]){const n=this.__ref;if(!n?.__children)return e;for(const o of n.__children){const r=this[o];r&&(typeof t=="function"?t(r)&&e.push(r):typeof t=="string"&&r.key===t&&e.push(r),r.lookdownAll?.(t,e))}return e},getRef(t){return t?this.__ref&&this.__ref[t]:this.__ref},getChildren(){const t=this.__ref&&this.__ref.__children;return Array.isArray(t)?t.map(e=>this[e]):[]},getRoot:s.getRoot,getRootState:s.getRootState,getRootContext:s.getRootContext,getContext:s.getContext,parse(t){const e={},n=t?new Set(t):null,o=this.__ref?.__exec;for(const r in this)if(!(r==="parent"||r==="node"||r==="__ref")&&!n?.has(r)){if(o&&o[r]!==void 0){e[r]=o[r];continue}typeof this[r]!="function"&&(e[r]=this[r])}return e},parseDeep(t){const e=this.parse(t),n=this.__ref;if(n?.__children)for(const o of n.__children)this[o]?.parseDeep&&(e[o]=this[o].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){const e={};for(const n of t)e[n]=this[n];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(const e in t){const n=t[e];if(n==null)continue;const o=e.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),r=String(n).replace(/\s*!important\s*$/,"");this.node.style.setProperty(o,r,"important")}},call(t,...e){const n=this.context,o=k(t);o&&n?.methods?.[t]&&n.methods[t]!==this[t]&&m(t,"el.call");const r=o?this[t]:n?.methods?.[t]||n?.functions?.[t]||n?.utils?.[t]||this[t];if(typeof r=="function"){const i=u.isFailedRevival;if(!i||!i(r))return r.call(this,...e);(0,l.isLoudDevRuntime)()&&y(this,t,u.getFunctionSource(r));return}(0,l.isLoudDevRuntime)()&&y(this,t,r)},removeContent(){const t=this.__ref;if(!t?.__children)return;const e=this.content;if(e?.remove){e.remove(),delete this.content;const n=t.__children.indexOf("content");n!==-1&&t.__children.splice(n,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},_=new WeakMap;function M(t){if(!t)return f;let e=_.get(t);if(e)return e;e=Object.create(f);const n=t.methods;if(n)for(const o in n)e[o]=n[o];return _.set(t,e),e}function T(t){const e=M(t.context);Object.setPrototypeOf(t,e)}function B(t){if(!t)return!1;const e=_.get(t);if(!e)return!1;const n=t.methods;if(!n)return!1;for(const o in n){if(k(o)&&!w(e,o)){m(o,"refreshContextProto");continue}e[o]=n[o]}return!0}
@@ -1 +1 @@
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
+ "use strict";var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var a in e)r(t,a,{get:e[a],enumerable:!0})},p=(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=>p(r({},"__esModule",{value:!0}),t);var x={};l(x,{DELEGATED_EVENTS:()=>E,LIFECYCLE_EVENTS:()=>h,MIXINS:()=>m,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","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),m={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},h=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
- "use strict";var h=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var U=(n,f)=>{for(var e in f)h(n,e,{get:f[e],enumerable:!0})},v=(n,f,e,i)=>{if(f&&typeof f=="object"||typeof f=="function")for(let c of g(f))!A.call(n,c)&&c!==e&&h(n,c,{get:()=>f[c],enumerable:!(i=b(f,c))||i.enumerable});return n};var P=n=>v(h({},"__esModule",{value:!0}),n);var B={};U(B,{default:()=>j,update:()=>x});module.exports=P(B);var d=require("@symbo.ls/signal"),_=require("./registry.js"),r=require("./create.js"),y=require("@symbo.ls/utils/function.js"),u=require("attrs-in-props");function x(n={},f={}){const e=this,i=e.__ref;if(!i)return;if((typeof n=="string"||typeof n=="number")&&(n={text:n}),!f.preventListeners&&typeof e.onBeforeUpdate=="function"&&(0,r.acquireBeforeUpdateGuard)(i))try{const t=e.onBeforeUpdate(e,e.state,e.context,f);if(t&&typeof t.then=="function")t.then(()=>(0,r.releaseBeforeUpdateGuard)(i,!1),o=>{(0,r.releaseBeforeUpdateGuard)(i,!0),e.context?.plugins?.length&&(0,y.runPluginHook)("error",e,{hook:"onBeforeUpdate",error:o})||console.error("[DOMQL] onBeforeUpdate error:",o)});else if((0,r.releaseBeforeUpdateGuard)(i,!1),t===!1)return e}catch(t){throw(0,r.releaseBeforeUpdateGuard)(i,!0),t}const c=!n||Object.keys(n).length===0,a=[];(0,d.batch)(()=>{if(n.state&&(0,d.isStore)(e.state)&&e.state.$update(n.state),n.text!==void 0&&(e.text=n.text,!i.__exec.text&&e.node&&(0,r.writeElementText)(e,n.text??"")),n.html!==void 0&&(e.html=n.html,!i.__exec.html&&e.node&&(e.node.innerHTML=n.html)),n.style&&e.node?.style){if(!i.__exec.style)for(const t in n.style){const o=n.style[t];if(o==null)continue;const s=t.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),l=String(o).replace(/\s*!important\s*$/,"");e.node.style.setProperty(s,l,"important")}e.style||(e.style={}),Object.assign(e.style,n.style)}if(n.attr&&e.node?.setAttribute){for(const t in n.attr){const o=n.attr[t];o==null||o===!1&&!(0,u.isEnumeratedTrueFalseAttr)(t)?e.node.removeAttribute(t):typeof o!="function"&&typeof o!="object"&&e.node.setAttribute(t,(0,u.serializeAttrValue)(t,o))}e.attr||(e.attr={}),Object.assign(e.attr,n.attr)}if(n.data&&e.node?.dataset){for(const t in n.data)e.node.dataset[t]=n.data[t];e.data||(e.data={}),Object.assign(e.data,n.data)}for(const t in n){if(_.REGISTRY.has(t)||t==="state")continue;const o=n[t],s=e[t];if(s&&s.__ref&&typeof s.update=="function")s.update(o,f);else if(typeof o=="object"&&o!==null){const l=t.charCodeAt(0);l>=65&&l<=90&&(0,r.create)(o,e,t,f)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=o,typeof o!="function"&&a.push(t))}});for(let t=0;t<a.length;t++)(0,r.reconcileAttrProp)(e,a[t]);if(e.node&&c&&i.__effects&&i.__effects.length)for(let t=0;t<i.__effects.length;t++){const o=i.__effects[t];o&&!o._disposed&&!o._isSubscribeToEffect&&typeof o._execute=="function"&&o._execute()}else if(e.node&&i.__conditionalRunners)for(const t of i.__conditionalRunners)t();return(0,y.runPluginHook)("update",e),!f.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,f),e}var j=x;
1
+ "use strict";var h=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var P=(o,r)=>{for(var e in r)h(o,e,{get:r[e],enumerable:!0})},U=(o,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of g(r))!A.call(o,c)&&c!==e&&h(o,c,{get:()=>r[c],enumerable:!(i=b(r,c))||i.enumerable});return o};var v=o=>U(h({},"__esModule",{value:!0}),o);var k={};P(k,{default:()=>j,update:()=>p});module.exports=v(k);var u=require("@symbo.ls/signal"),_=require("./registry.js"),f=require("./create.js"),y=require("@symbo.ls/utils/function.js"),a=require("attrs-in-props");function p(o={},r={}){const e=this,i=e.__ref;if(!i)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!r.preventListeners&&typeof e.onBeforeUpdate=="function"&&(0,f.acquireBeforeUpdateGuard)(i))try{const t=e.onBeforeUpdate(e,e.state,e.context,r);if(t&&typeof t.then=="function")t.then(()=>(0,f.releaseBeforeUpdateGuard)(i,!1),n=>{(0,f.releaseBeforeUpdateGuard)(i,!0),e.context?.plugins?.length&&(0,y.runPluginHook)("error",e,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if((0,f.releaseBeforeUpdateGuard)(i,!1),t===!1)return e}catch(t){throw(0,f.releaseBeforeUpdateGuard)(i,!0),t}const c=!o||Object.keys(o).length===0,l=[];(0,u.batch)(()=>{if(o.state&&(0,u.isStore)(e.state)&&e.state.$update(o.state),o.text!==void 0&&(e.text=o.text,!i.__exec.text&&e.node&&(0,f.writeElementText)(e,o.text??"")),o.html!==void 0&&(e.html=o.html,!i.__exec.html&&e.node&&(e.node.innerHTML=o.html)),o.style&&e.node?.style){if(!i.__exec.style)for(const t in o.style){const n=o.style[t];if(n==null)continue;const s=t.replace(/[A-Z]/g,x=>"-"+x.toLowerCase()),d=String(n).replace(/\s*!important\s*$/,"");e.node.style.setProperty(s,d,"important")}e.style||(e.style={}),Object.assign(e.style,o.style)}if(o.attr&&e.node?.setAttribute){for(const t in o.attr){const n=o.attr[t];n==null||n===!1&&!(0,a.isEnumeratedTrueFalseAttr)(t)?e.node.removeAttribute(t):typeof n!="function"&&typeof n!="object"&&e.node.setAttribute(t,(0,a.serializeAttrValue)(t,n))}e.attr||(e.attr={}),Object.assign(e.attr,o.attr)}if(o.data&&e.node?.dataset){for(const t in o.data)e.node.dataset[t]=o.data[t];e.data||(e.data={}),Object.assign(e.data,o.data)}for(const t in o){if(_.REGISTRY.has(t)||t==="state")continue;const n=o[t],s=e[t];if(s&&s.__ref&&typeof s.update=="function")s.update(n,r);else if(typeof n=="object"&&n!==null){const d=t.charCodeAt(0);d>=65&&d<=90&&(0,f.create)(n,e,t,r)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=n,typeof n!="function"&&l.push(t))}});for(let t=0;t<l.length;t++)(0,f.reconcileAttrProp)(e,l[t]);if(e.node){for(let t=0;t<l.length;t++)if((0,f.isStaticCssProp)(l[t])){(0,f.recompileStaticCss)(e);break}}if(e.node&&c&&i.__effects&&i.__effects.length)for(let t=0;t<i.__effects.length;t++){const n=i.__effects[t];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(e.node&&i.__conditionalRunners)for(const t of i.__conditionalRunners)t();return(0,y.runPluginHook)("update",e),!r.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,r),e}var j=p;
@@ -1 +1 @@
1
- var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},I=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of s(o))!x.call(t,c)&&c!==e&&n(t,c,{get:()=>o[c],enumerable:!(p=r(o,c))||p.enumerable});return t};var N=t=>I(n({},"__esModule",{value:!0}),t);var R={};E(R,{VERSION:()=>O});module.exports=N(R);const O="3.14.789";
1
+ var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},I=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of s(o))!x.call(t,c)&&c!==e&&n(t,c,{get:()=>o[c],enumerable:!(p=r(o,c))||p.enumerable});return t};var N=t=>I(n({},"__esModule",{value:!0}),t);var R={};E(R,{VERSION:()=>O});module.exports=N(R);const O="3.14.791";
@@ -0,0 +1 @@
1
+ import{checkAttributeByTagName as s}from"attrs-in-props";import{CSS_PROPS_REGISTRY as S,DEFAULT_CSS_PROPERTIES_LIST as r}from"css-in-props";const T=new Set(["rows","cols","wrap"]),e=(o,t)=>T.has(t)&&s(o,t),p=(o,t)=>!!(S[t]||r&&r.has(t))&&!e(o,t);export{T as ATTRIBUTE_FIRST_KEYS,e as isAttributeFirst,p as isCssProp};
@@ -1,6 +1,6 @@
1
- import{createStore as St,createScopeStore as Po,isStore as W}from"@symbo.ls/signal";import{createEffect as S}from"@symbo.ls/signal";import{cacheNode as wt,detectTag as Gt}from"./cache.js";import{REGISTRY as G,LIFECYCLE_EVENTS as To}from"./registry.js";import{registerEvent as Lo,registerGlobalEvent as Do,globalEventKeyInfo as Oo}from"./delegate.js";import{applyExtends as No}from"./extends.js";import{addMethods as Ro}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as X}from"./devRuntime.js";import{mountBudgetExhausted as Ht,openMountBudget as Wt,closeMountBudget as zt,enqueueMountWork as Yt}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as $,isPolyglotWritableKey as Mo,markPolyglotSeeded as $o}from"@symbo.ls/utils";import*as Zt from"@symbo.ls/utils";import{runPluginHook as H}from"@symbo.ls/utils/function.js";import{applyStateMethods as et}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as T,DEFAULT_CSS_PROPERTIES_LIST as E,pushStaticCssPass as qt,popStaticCssPass as Qt}from"css-in-props";import{css as nt,wrapHoverRule as Xt}from"@symbo.ls/css";import{pushConfig as N,popConfig as R}from"@symbo.ls/scratch";import{checkAttributeByTagName as rt,applyAttrTransforms as Fo,ATTR_TRANSFORMS as kt,camelToAttr as it,serializeAttrValue as K,isEnumeratedTrueFalseAttr as ct}from"attrs-in-props";import{resolveElementIdEngine as Io}from"./engineRegistry.js";import{VERSION as Uo}from"./version.js";const Jt=Io({uniqId:1,scopedStyleId:0},Uo),ft=[];let jt=!1;function mt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Bo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Ko=250;function to(){if(!jt){if(jt=!0,typeof requestAnimationFrame!="function"){setTimeout(Et,0);return}Bo()?setTimeout(Et,Ko):requestAnimationFrame(Et)}}const Vo=300,Go=15e4;function Et(){if(jt=!1,!ft.length)return;const t=ft.splice(0,ft.length);for(let e=0;e<t.length;e++){const s=t[e];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=mt());const r=mt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Vo&&r<Go?(ft.push(s),to()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}M("Mounted",s,s.__ref?.__mountOptions||{})}}}function Pt(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,ft.push(t),to())}function oo(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&H("contentUpdate",t,e);const s=t.context?.designSystem;s&&N(s);try{t.onContentUpdate(t,t.state,t.context,e)}catch(n){if(t.context?.plugins?.length&&H("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&R()}}function z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Ho(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Wo(t){return t.toLowerCase()}function Tt(t){const e=t.charCodeAt(0);return e===58||e===64||e===38||e===91}function at(t,e){const s={...t};for(const n in e){const r=s[n],f=e[n];r&&f&&typeof r=="object"&&typeof f=="object"&&!Array.isArray(r)&&!Array.isArray(f)&&typeof r!="function"&&typeof f!="function"?s[n]=at(r,f):s[n]=f}return s}function pt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function so(t,e,s){return pt(t)||(e&&typeof e=="object"?pt(e.key):void 0)||String(s)}function Z(t,e,s,n={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=pt(s);const f=pt(t.key),o=Object.create(null);o.key=s||f||`_${Jt.uniqId++}`,o.parent=e||null,o.context=t.context||e?.context||n.context||{},o.context.__create||(o.context.__create=Z);const c=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:e?.__ref?.root||o,path:e?.__ref?.path?[...e.__ref.path,o.key]:[o.key],origin:t};if(s&&!t.extends&&!t.extend){const h=s.indexOf("_"),p=s.indexOf(".");let x=h>0?h:-1;if(p>0&&(x<0||p<x)&&(x=p),x>0){const b=s.substring(0,x),C=o.context?.components;C&&(C[b]||C["smbls."+b])?t={...t,extends:b}:C&&X()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${b}" but neither "${b}" nor "smbls.${b}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}No(o,t,n);const u=new Set(["childProps","attr","style","scope","data"]),a=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;if(h==="key"){f&&(o.key=f);continue}const p=t[h],x=o[h],b=x&&p&&typeof x=="object"&&typeof p=="object"&&!Array.isArray(x)&&!Array.isArray(p)&&typeof x!="function"&&typeof p!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=at(x,p):b&&u.has(h)?o[h]={...x,...p}:b&&Tt(h)?o[h]=at(x,p):o[h]=p}function d(h){for(const p in h){const x=h[p],b=o[p],C=b&&x&&typeof b=="object"&&typeof x=="object"&&!Array.isArray(b)&&!Array.isArray(x)&&typeof b!="function"&&typeof x!="function";C&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?o[p]=at(b,x):C&&u.has(p)?o[p]={...b,...x}:C&&Tt(p)?o[p]=at(b,x):o[p]=x}}a&&d(a),t.props&&typeof t.props=="object"&&d(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 i=o.scope&&typeof o.scope=="object"?o.scope:null,l=e?.scope,y=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,_=l||y||null;if(t.scope!==void 0||i){const h={};i&&Object.assign(h,i),t.scope!==void 0&&Object.assign(h,t.scope),o.scope=Po(h,_)}else _&&(o.scope=_);if(t.if!==void 0&&(o.if=t.if),Ro(o),zo(o,e,t),o.if!=null){let h;if(typeof o.if=="function")try{h=o.if(o,o.state,o.context)}catch(p){if(h=!1,c.__ifError=p,typeof console<"u"&&console.warn){const x=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${x} \u2014 treating as false:`,p?.message||p)}}else h=o.if;c.__if=!!h}if(c.__if)typeof o.if=="function"&&(c.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&co(o,c,o.if),o;o.tag||(o.tag=Gt(o)),M("Init",o,n);const g=o.node=wt(o);if(!g)return o;if(o.tag==="fragment"){const p=(o.context?.document||globalThis.document).createComment("");g.appendChild(p),c.__fragmentAnchor=p}M("AttachNode",o,n),g.setAttribute&&o.key&&g.setAttribute("data-key",o.key),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),g.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&g.setAttribute("data-smbls-app",o.context.key),o.id&&g.setAttribute&&(g.id=o.id),Co(o,n),ro(o),Dt(o),xo(o),fs(o);try{vo(o,n)}catch(h){if(typeof console<"u"&&console.error){const p=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${p}:`,h?.message||h,h?.stack?`
2
- `+h.stack.split(`
1
+ import{createStore as Dt,createScopeStore as Vo,isStore as q}from"@symbo.ls/signal";import{createEffect as v}from"@symbo.ls/signal";import{cacheNode as Rt,detectTag as Jt}from"./cache.js";import{REGISTRY as W,LIFECYCLE_EVENTS as Go}from"./registry.js";import{registerEvent as Wo,registerGlobalEvent as zo,globalEventKeyInfo as Yo}from"./delegate.js";import{applyExtends as qo}from"./extends.js";import{addMethods as Zo}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as m}from"./devRuntime.js";import{mountBudgetExhausted as mt,openMountBudget as to,closeMountBudget as oo,enqueueMountWork as so}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as $,isPolyglotWritableKey as Qo,markPolyglotSeeded as Xo}from"@symbo.ls/utils";import*as gt from"@symbo.ls/utils";import{runPluginHook as z}from"@symbo.ls/utils/function.js";import{applyStateMethods as et}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as D,DEFAULT_CSS_PROPERTIES_LIST as R,pushStaticCssPass as no,popStaticCssPass as eo}from"css-in-props";import{css as rt,wrapHoverRule as ro}from"@symbo.ls/css";import{pushConfig as N,popConfig as M}from"@symbo.ls/scratch";import{checkAttributeByTagName as it,applyAttrTransforms as Jo,ATTR_TRANSFORMS as Nt,camelToAttr as ct,serializeAttrValue as V,isEnumeratedTrueFalseAttr as ft}from"attrs-in-props";import{resolveElementIdEngine as mo}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as io}from"./cssLonghands.js";import{isAttributeFirst as co,isCssProp as at}from"./attributeFirst.js";import{VERSION as ts}from"./version.js";const fo=mo({uniqId:1,scopedStyleId:0},ts),ut=[];let Mt=!1,ao=0,tt=null,lt=null;function bt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function uo(){return typeof document<"u"&&document.visibilityState==="hidden"}const os=250,ss=1e3;function ns(){return lt&&(lt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||uo())?!0:bt()-ao>=ss}function es(){if(Mt=!0,ao=bt(),lt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ft,0);tt=t?()=>t(s):null;return}if(uo()){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ft,os);tt=t?()=>t(s):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;lt=requestAnimationFrame;const s=requestAnimationFrame(Ft);tt=t?()=>t(s):null}}function lo(){if(Mt){if(!ns())return;const t=tt;if(tt=null,t)try{t()}catch{}}es()}const rs=300,is=15e4;function Ft(){if(Mt=!1,tt=null,lt=null,!ut.length)return;const t=ut.splice(0,ut.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.node){if(!o.node.isConnected){const n=o.__ref||(o.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=bt());const r=bt()-n.__mountFirstAttemptAt;n.__mountAttempts<=rs&&r<is?(ut.push(o),lo()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",o.key||o.tag||o);continue}F("Mounted",o,o.__ref?.__mountOptions||{})}}}function $t(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,ut.push(t),lo())}function po(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&z("contentUpdate",t,s);const o=t.context?.designSystem;o&&N(o);try{t.onContentUpdate(t,t.state,t.context,s)}catch(n){if(t.context?.plugins?.length&&z("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{o&&M()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function cs(t){return t.charAt(2).toLowerCase()+t.slice(3)}function fs(t){return t.toLowerCase()}function It(t){const s=t.charCodeAt(0);return s===58||s===64||s===38||s===91}function dt(t,s){const o={...t};for(const n in s){const r=o[n],c=s[n];r&&c&&typeof r=="object"&&typeof c=="object"&&!Array.isArray(r)&&!Array.isArray(c)&&typeof r!="function"&&typeof c!="function"?o[n]=dt(r,c):o[n]=c}return o}function xt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function ho(t,s,o){return xt(t)||(s&&typeof s=="object"?xt(s.key):void 0)||String(o)}function Q(t,s,o,n={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),o=xt(o);const c=xt(t.key),e=Object.create(null);e.key=o||c||`_${fo.uniqId++}`,e.parent=s||null,e.context=t.context||s?.context||n.context||{},e.context.__create||(e.context.__create=Q);const p=e.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||e,path:s?.__ref?.path?[...s.__ref.path,e.key]:[e.key],origin:t};if(o&&!t.extends&&!t.extend){const u=o.indexOf("_"),l=o.indexOf(".");let b=u>0?u:-1;if(l>0&&(b<0||l<b)&&(b=l),b>0){const x=o.substring(0,b),S=e.context?.components;S&&(S[x]||S["smbls."+x])?t={...t,extends:x}:S&&m()&&(/^[A-Z]\w*_\d+$/.test(o)||/^[A-Z]\w*\.\w+$/.test(o))&&console.warn(`[smbls] auto-extend: key "${o}" looks like an instance of "${x}" but neither "${x}" nor "smbls.${x}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}qo(e,t,n);const i=new Set(["childProps","attr","style","scope","data"]),g=e.props&&typeof e.props=="object"?e.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;if(u==="key"){c&&(e.key=c);continue}const l=t[u],b=e[u],x=b&&l&&typeof b=="object"&&typeof l=="object"&&!Array.isArray(b)&&!Array.isArray(l)&&typeof b!="function"&&typeof l!="function";x&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?e[u]=dt(b,l):x&&i.has(u)?e[u]={...b,...l}:x&&It(u)?e[u]=dt(b,l):e[u]=l}function _(u){for(const l in u){const b=u[l],x=e[l],S=x&&b&&typeof x=="object"&&typeof b=="object"&&!Array.isArray(x)&&!Array.isArray(b)&&typeof x!="function"&&typeof b!="function";S&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?e[l]=dt(x,b):S&&i.has(l)?e[l]={...x,...b}:S&&It(l)?e[l]=dt(x,b):e[l]=b}}g&&_(g),t.props&&typeof t.props=="object"&&_(t.props),t.classlist!==void 0&&(e.classlist=t.classlist),t.text!==void 0&&(e.text=t.text),t.html!==void 0&&(e.html=t.html);const f=e.scope&&typeof e.scope=="object"?e.scope:null,d=s?.scope,y=e.context&&typeof e.context.globalScope=="object"&&e.context.globalScope||null,a=d||y||null;if(t.scope!==void 0||f){const u={};f&&Object.assign(u,f),t.scope!==void 0&&Object.assign(u,t.scope),e.scope=Vo(u,a)}else a&&(e.scope=a);if(t.if!==void 0&&(e.if=t.if),Zo(e),as(e,s,t),e.if!=null){let u;if(typeof e.if=="function")try{u=e.if(e,e.state,e.context)}catch(l){if(u=!1,p.__ifError=l,typeof console<"u"&&console.warn){const b=e.key||e.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${b} \u2014 treating as false:`,l?.message||l)}}else u=e.if;p.__if=!!u}if(p.__if)typeof e.if=="function"&&(p.__ifInitialized=!0);else return s&&(s[e.key]=e),typeof e.if=="function"&&Co(e,p,e.if),e;e.tag||(e.tag=Jt(e)),F("Init",e,n);const h=e.node=Rt(e);if(!h)return e;if(e.tag==="fragment"){const l=(e.context?.document||globalThis.document).createComment("");h.appendChild(l),p.__fragmentAnchor=l}F("AttachNode",e,n),h.setAttribute&&e.key&&h.setAttribute("data-key",e.key),s&&(s[e.key]=e,s.__ref?.__children&&(s.__ref.__children.includes(e.key)||s.__ref.__children.push(e.key))),h.setAttribute&&e.context?.scopeSelector&&e.context.scopeSelector!==":root"&&e.context.key&&e.key===e.context.key&&h.setAttribute("data-smbls-app",e.context.key),e.id&&h.setAttribute&&(h.id=e.id),$o(e,n),xo(e),Bt(e),Mo(e),Ns(e);try{Io(e,n)}catch(u){if(typeof console<"u"&&console.error){const l=e.__ref?.path?.join(".")||e.key||"<root>";console.error(`[smbls] createChildren failed at ${l}:`,u?.message||u,u?.stack?`
2
+ `+u.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(bt(o,!0),So(o,e,r),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const h=o.context?.designSystem;h&&N(h);try{const p=o.html(o,o.state,o.context);p!=null&&typeof p!="function"&&(o.node.innerHTML=p)}catch{}finally{h&&R()}}if(M("Create",o,n),M("Complete",o,n),M("Render",o,n),M("RenderRouter",o,n),Pt(o,n),typeof o.onFrame=="function"){const h=o.onFrame,p=o.context?.designSystem,x=()=>{if(o.node){if(o.node.isConnected){p&&N(p);try{h(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{p&&R()}}requestAnimationFrame(x)}};requestAnimationFrame(x)}return o}function zo(t,e,s){const n=!e,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,f=n&&r&&t.context?.state,o=s.state!==void 0&&!f?s.state:t.state&&!W(t.state)?t.state:void 0;if(o==null){if(e?.state)t.state=e.state,et(t,t.state);else if(t.context?.state){const c=t.context.state,u={...c},a=t.context?.polyglot;if(a?.translations){const d=t.context,i=c.lang||a.defaultLang||"en",l=new Set,y=(h,p)=>{l.has(h)||Mo(d,h,u)&&(u[h]=p,l.add(h),$o(d,h))},_=a.translations[i];if(_&&typeof _=="object")for(const h in _)y(h,_[h]);const g=new Set(a.languages||[]);for(const h in a.translations)g.has(h)||y(h,a.translations[h])}t.state=W(u)?u:St(u),t.state.__element=t,t.state.root=t.state,et(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),et(t,t.state);return}if(typeof o=="string"){if(t.state=eo(o,e),t.state&&typeof t.state=="object"&&!W(t.state)){const c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}et(t,t.state);return}if(typeof o=="function"){const c=o(t,e?.state);t.state=W(c)?c:St(c||{})}else W(o)?t.state=o:t.state=St({...o});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,et(t,t.state)}function Lt(t,e){if(!e)return t;const s=e.split("/");let n=t;for(const r of s){if(n==null)return{};n=n[r]}return n??{}}function eo(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?Lt(e.state,r):e.state??{}}if(t.startsWith("~/")){const r=e.state?.root||e.state,f=t.slice(2);return f?Lt(r,f):r??{}}if(e.state?.[t]!==void 0)return e.state[t];const s=Lt(e.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=e.context?.polyglot;if(n?.translations){const r=e.state?.root?.lang||n.defaultLang||"en",f=n.translations[r];if(f?.[t]!==void 0)return f[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const Yo=new Set(["s","state","ctx","context"]);function Zo(t){try{const s=(typeof Zt.getFunctionSource=="function"?Zt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function qo(t){if(typeof t!="function"||t.length!==2)return!1;const e=Zo(t);if(e.length<2)return!1;const s=e[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!Yo.has(s)}function Qo(t){const e=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],f=Object.keys(t);for(let o=0;o<f.length;o++){const c=f[o];if(typeof t[c]!="function"||G.has(c))continue;const u=c.charCodeAt(0);u>=65&&u<=90||z(c)||T[c]||E&&E.has(c)||rt(s,c)||(X()&&qo(t[c])&&console.warn(`[smbls] custom prop "${c}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${c}', \u2026) instead of reading el.${c}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:c,fn:t[c]}))}for(let o=0;o<r.length;o++){const{prop:c,fn:u}=r[o];e.__exec[c]=u,Object.defineProperty(t,c,{get(){n&&N(n);try{return u(t,t.state,t.context)}catch{return}finally{n&&R()}},set(a){delete e.__exec[c],Object.defineProperty(t,c,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Xo(t,e){if(!(!Array.isArray(e)||e.length===0))for(let s=0;s<e.length;s++){const n=e[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function D(t,e,s){return!Array.isArray(e)||e.length===0?s:function(...n){return Xo(t,e),s.apply(this,n)}}function ut(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function v(t,e){return()=>t.path.join(".")+"::"+e}const no=new Set;function F(t,e,s){if(!X())return;const n=v(t,e)();no.has(n)||(no.add(n),console.warn(`[smbls] "${e}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}function ro(t,e){const s=t.__ref,n=!!(e&&e.skipIfEffect);if(Qo(t),typeof t.text=="function"){const o=t.text,c=D(t,t.textDeps,o),u=S(()=>{if(!s.contentManaged)try{let a=c(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=$.call(t,a,t.state)),yt(t,a))}catch(a){F(s,"text",a)}},{depth:s.path.length,label:v(s,"text")});s.__effects.push(u),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,c=S(()=>{if(s.contentManaged)return;const u=$.call(t,o,t.state);u!=null&&(t.text=u),t.node&&yt(t,u??"")},{depth:s.path.length,label:v(s,"text")});s.__effects.push(c),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!G.has(o)&&!z(o)&&!s.__exec[o]){if(T[o]){const c=t[o],u=D(t,t[o+"Deps"],c),a=o;let d,i=null,l=null,y;const _=S(()=>{const g=t.context?.designSystem;g&&N(g);try{const h=u(t,t.state,t.context);qt();let p;try{p=T[a](h,t,t.state,t.context)}finally{Qt()}if(Array.isArray(p)){const b={};for(const C of p)if(C)for(const A in C)b[A]=C[A];p=b}const x=a==="show"||a==="hide";if(p&&t.node&&Jo(p)){const b=ht(p);if(b===null||b!==y){y=b;const C=nt(p,null,t.context?.cssPrefix),A=C?C.split(" ").filter(Boolean):null;if(t.node.classList){if(l)for(const w of l)t.node.classList.remove(w);if(A&&A.length)for(const w of A)t.node.classList.add(w);l=A}}d=void 0,i=null}else if(p&&t.node){if(l){for(const C of l)t.node.classList.remove(C);l=null,y=void 0}const b=ht(p);(b===null||b!==d||!gt(t.node,i))&&(d=b,J(t.node,p),i=_t(t.node,p))}else if(t.node&&x){d=void 0,i=null;const b=s.__explicitDisplay;t.node.style.display=typeof b=="string"?b:""}}finally{g&&R()}},{depth:s.path.length,label:v(s,a)});s.__effects.push(_),s.__exec[o]=c}else if(E&&E.has(o)){const c=t[o],u=D(t,t[o+"Deps"],c),a=o;let d,i=null;const l=S(()=>{const y=t.context?.designSystem;y&&N(y);try{const _=u(t,t.state,t.context);if(t.node)if(_!=null){const g=a+":"+String(_);if(g!==d||!gt(t.node,i)){d=g;const h={[a]:_};J(t.node,h),i=_t(t.node,h)}}else d=void 0,i=null,t.node.style[a]=""}finally{y&&R()}},{depth:s.path.length,label:v(s,a)});s.__effects.push(l),s.__exec[o]=c}}if(typeof t.html=="function"){const o=t.html,c=D(t,t.htmlDeps,o),u=S(()=>{const a=t.context?.designSystem;a&&N(a);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{a&&R()}},{depth:s.path.length,label:v(s,"html")});s.__effects.push(u),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,c=D(t,t.valueDeps,o),u=S(()=>{try{let a=c(t,t.state,t.context);typeof a=="string"&&a.includes("{{")&&(a=$.call(t,a,t.state)),fo(t,a)}catch(a){F(s,"value",a)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(u),s.__exec.value=o}else if(typeof t.value=="string"&&t.value.includes("{{")){const o=t.value,c=S(()=>{try{fo(t,$.call(t,o,t.state))}catch(u){F(s,"value",u)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(c),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,c=D(t,t.styleDeps,o);let u,a=null;const d=S(()=>{const i=c(t,t.state,t.context),l=ht(i);(l===null||l!==u||!gt(t.node,a))&&(u=l,J(t.node,i),a=_t(t.node,i))},{depth:s.path.length,label:v(s,"style")});s.__effects.push(d),s.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const c=t.style[o];if(typeof c!="function")continue;const u=D(t,ut(t.styleDeps,o),c);let a,d=null;const i=S(()=>{try{const l=u(t,t.state,t.context);if(t.node){const y=o+":"+String(l);if(y!==a||!gt(t.node,d)){a=y;const _={[o]:l};J(t.node,_),d=_t(t.node,_)}}}catch(l){F(s,"style."+o,l)}},{depth:s.path.length,label:v(s,"style."+o)});s.__effects.push(i)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const c=D(t,ut(t.attrDeps,o),t.attr[o]),u=o,a=S(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=$.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!ct(u)?t.node.removeAttribute(u):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(u,K(u,d)))}catch(d){F(s,"attr."+u,d)}},{depth:s.path.length,label:v(s,"attr."+u)});a._attrName=u.toLowerCase(),s.__effects.push(a)}else if(typeof t.attr[o]=="string"&&t.attr[o].includes("{{")){const c=t.attr[o],u=o,a=S(()=>{try{const d=$.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,K(u,d??""))}catch(d){F(s,"attr."+u,d)}},{depth:s.path.length,label:v(s,"attr."+u)});a._attrName=u.toLowerCase(),s.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){const c=t.aria[o];if(typeof c=="string"&&c.includes("{{")){const i=c,l="aria-"+o.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),y=S(()=>{try{const _=$.call(t,i,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,K(l,_??""))}catch(_){F(s,"aria."+o,_)}},{depth:s.path.length,label:v(s,"aria."+o)});y._attrName=l,s.__effects.push(y);continue}if(typeof c!="function")continue;const u=D(t,ut(t.ariaDeps,o),t.aria[o]),a="aria-"+o.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),d=S(()=>{try{const i=u(t,t.state,t.context);if(!t.node?.setAttribute)return;i==null?t.node.removeAttribute(a):typeof i!="function"&&typeof i!="object"&&t.node.setAttribute(a,K(a,i))}catch(i){F(s,"aria."+o,i)}},{depth:s.path.length,label:v(s,"aria."+o)});d._attrName=a,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const o in t.data){const c=t.data[o];if(typeof c=="string"&&c.includes("{{")){const l=c,y="data-"+o.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),_=S(()=>{try{const g=$.call(t,l,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,g??"")}catch(g){F(s,"data."+o,g)}},{depth:s.path.length,label:v(s,"data."+o)});_._attrName=y,s.__effects.push(_);continue}if(typeof c!="function")continue;const u=D(t,ut(t.dataDeps,o),t.data[o]),d="data-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),i=S(()=>{try{const l=u(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(d):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(d,l===!0?"":l)}catch(l){F(s,"data."+o,l)}},{depth:s.path.length,label:v(s,"data."+o)});i._attrName=d,s.__effects.push(i)}const r=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(r)for(const o in r){if(typeof r[o]!="function")continue;const c=D(t,ut(t.classDeps,o),r[o]),u=S(()=>{try{const a=c(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch(a){F(s,"class."+o,a)}},{depth:s.path.length,label:v(s,"class."+o)});s.__effects.push(u)}!n&&typeof t.if=="function"&&co(t,s,t.if);for(const o of Object.keys(t)){if(G.has(o)||typeof t[o]!="function")continue;const c=o.charCodeAt(0);if(c>=65&&c<=90||z(o))continue;const u=t[o];s.__exec[o]=u;const a=t.tag||"div";if(rt(a,o)&&!T[o]&&!(E&&E.has(o))){const d=it(o)||o,i=D(t,t[o+"Deps"],u),l=S(()=>{try{let y=i(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=$.call(t,y,t.state)),t.node?.setAttribute&&(y==null||y===!1&&!ct(d)?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&(d==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(d,K(d,y))))}catch(y){F(s,o,y)}},{depth:s.path.length,label:v(s,o)});l._attrName=d.toLowerCase(),s.__effects.push(l)}}const f=t.tag||"div";for(const o of Object.keys(t)){if(G.has(o))continue;const c=t[o];if(typeof c!="string"||!c.includes("{{"))continue;const u=o.charCodeAt(0);if(u>=65&&u<=90||z(o)||T[o]||E&&E.has(o)||kt[o]||!rt(f,o))continue;const a=it(o)||o,d=S(()=>{try{const i=$.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,K(a,i??""))}catch(i){F(s,o,i)}},{depth:s.path.length,label:v(s,o)});d._attrName=a.toLowerCase(),s.__effects.push(d)}if(os(t),ns(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,c=t.stateDeps;let u=!1,a=[];const d=S(()=>{const i=[];for(let g=0;g<c.length;g++){const h=c[g];try{i[g]=typeof h=="function"?h(t,t.state,t.context):t.state?.[h]}catch{i[g]=void 0}}if(!u){u=!0,a=i;return}let l=i.length!==a.length;for(let g=0;!l&&g<i.length;g++)i[g]!==a[g]&&(l=!0);const y=a;if(a=i,!l)return;const _=t.context?.designSystem;_&&N(_);try{o(t,t.state,t.context,{prev:y,next:i})}catch(g){if(t.context?.plugins?.length&&H("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{_&&R()}},{depth:s.path.length,label:v(s,"onStateUpdate")});s.__effects.push(d)}es(t)}function io(t){const e=t.parent,s=e?.node;if(!s||!t.node){So(t,t.parent);return}let n=null;const r=Object.keys(e),f=r.indexOf(t.key);for(let o=f+1;o<r.length;o++){const c=e[r[o]];if(c?.node?.parentNode===s){n=c.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function co(t,e,s){const n=D(t,t.ifDeps,s),r=S(()=>{let f;try{f=n(t,t.state,t.context)}catch(c){if(f=!1,e.__ifError=c,typeof console<"u"&&console.warn){const u=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${u} \u2014 treating as false:`,c?.message||c)}return}const o=e.__if;if(e.__if=!!f,o&&!e.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(c){console.error("[smbls] onRemove error:",c)}}else if(!o&&e.__if)if(e.__ifInitialized)t.node||(t.node=wt(t)),t.node&&(t.node.ref=t),io(t),Dt(t),M("Render",t,{}),Pt(t,{});else{if(e.__ifInitialized=!0,t.tag||(t.tag=Gt(t)),M("Init",t,{}),t.node||(t.node=wt(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!e.__fragmentAnchor){const u=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(u),e.__fragmentAnchor=u}M("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Co(t,{}),ro(t,{skipIfEffect:!0}),Dt(t),xo(t),vo(t,{}),io(t),M("Create",t,{}),M("Complete",t,{}),M("Render",t,{}),M("RenderRouter",t,{}),Pt(t,{})}},{depth:e.path.length,label:v(e,"if")});e.__effects.push(r)}function yt(t,e){const s=t.node;if(!s)return;const n=e==null||typeof e=="object"?"":String(e);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const r=t.__ref;let f=r?r.__textNode:null;if(f&&f.parentNode!==s&&(f=null),!f){const o=s.firstChild;o&&o.nodeType===3&&(f=o)}f?f.nodeValue!==n&&(f.nodeValue=n):s.firstChild?(f=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(f,s.firstChild)):(s.textContent=n,f=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=f||null)}function fo(t,e){const s=t.node;if(!s||!("value"in s))return;const n=e==null?"":String(e);if(s.value===n)return;const r=typeof document<"u"&&document.activeElement===s,f=r&&typeof s.selectionStart=="number"?s.selectionStart:null,o=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,r&&f!=null&&o!=null)try{s.setSelectionRange(f,o)}catch{}}function Dt(t){const{node:e}=t;if(e){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&yt(t,t.text),is(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in e){const s=String(t.value);e.value!==s&&(e.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}J(e,s)}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const n=t.attr[s];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!ct(s)||e.setAttribute&&e.setAttribute(s,K(s,n)))}if(t.data&&typeof t.data=="object")for(const s in t.data){const n=t.data[s];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||e.dataset&&(e.dataset[s]=n===!0?"":n)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof s=="object")for(const n in s){const r=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];r&&e.classList.add(typeof r=="string"?r:n)}}}}function ht(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Jo(t){if(!t||typeof t!="object")return!1;for(const e in t){const s=t[e];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function _t(t,e){if(!t||!t.style||!e)return null;const s=t.style,n=[];for(const r in e){if(e[r]==null||r.charAt(0)==="&")continue;const o=r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());n.push(o,ao(s,o),uo(s,o))}return n}function ao(t,e){return typeof t.getPropertyValue=="function"?t.getPropertyValue(e):""}function uo(t,e){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(e):""}function gt(t,e){if(!e||!t||!t.style)return!1;const s=t.style;for(let n=0;n<e.length;n+=3)if(ao(s,e[n])!==e[n+1]||uo(s,e[n])!==e[n+2])return!1;return!0}const Ot=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function J(t,e){if(!t||!e||!t.style)return;let s=null;for(const n in e){const r=e[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[n]=r;continue}try{const f=String(r),o=Ot(n)?n:n.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),c=f.trim(),u=/\s*!important\s*$/.test(c),a=c.replace(/\s*!important\s*$/,"");t.style.setProperty(o,a,u?"important":"")}catch{}}}s&&mo(t,s)}function mo(t,e){const s=`_ds${Jt.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let f="";for(const o in e){const c="."+s,u=o.replace(/&/g,c).split(",").map(d=>{const i=d.trim();return i.includes(c)?i:c+i}).join(", "),a=e[o];if(typeof a=="object"){let d="",i="";for(const l in a){const y=a[l];if(typeof y=="object"){const _=l.includes("&")?u.split(", ").map(h=>l.replace(/&/g,h)).join(", "):u.split(", ").map(h=>`${h} ${l}`).join(", ");let g="";for(const h in y)g+=`${h.replace(/[A-Z]/g,p=>"-"+p.toLowerCase())}: ${y[h]};`;i+=Xt(`${_} { ${g} }`,_)+`
5
- `}else d+=`${l.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(f+=Xt(`${u} { ${d} }`,u)+`
6
- `),i&&(f+=i)}}f&&(r.textContent+=f)}const lo=new Set;function po(t){if(!Array.isArray(t))return"";const e=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&e.push(t[s]);return e.sort(),e.join("|")}function ts(t,e,s){const n=po(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=e(t,t.state,t.context)}catch{return}if(po(r)===n)return;const f=t.__ref.path?t.__ref.path.join("."):t.key||"?";lo.has(f)||(lo.add(f),console.warn(`[smbls] subscribeTo function at "${f}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function os(t){const e=t.subscribeTo,s=typeof e=="function";let n=e;if(s)try{n=e(t,t.state,t.context)}catch{n=null}if(s&&X()&&ts(t,e,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let f=0;f<n.length;f++){const o=n[f];if(typeof o!="string"||o.length===0)continue;const c=o.split("."),u=c[0],a=c.slice(1),d={value:!1},i=S(()=>{const l=t.state&&(W(t.state)?t.state.root:null);if(!l||!W(l))return;let y=l;y=y[u];for(let g=0;g<a.length&&!(y==null||typeof y!="object");g++)if(W(y))y=y[a[g]];else break;if(!d.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"){const g=t.context?.designSystem;g&&N(g);try{if(us(r)){const h=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});h&&typeof h.then=="function"?h.then(()=>xt(r,!1),p=>{xt(r,!0),t.context?.plugins?.length&&H("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}):(xt(r,!1),h===!1&&(_=!0))}}catch(h){xt(r,!0),t.context?.plugins?.length&&H("error",t,{hook:"onBeforeUpdate",error:h})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",h)}finally{g&&R()}}if(!_&&t.node&&r.__effects)for(let g=0;g<r.__effects.length;g++){const h=r.__effects[g];h&&h!==i&&!h._disposed&&!h._isSubscribeToEffect&&typeof h._execute=="function"&&h._execute()}if(!_&&typeof t.onUpdate=="function"){const g=t.context?.designSystem;g&&N(g);try{t.onUpdate(t,t.state,t.context)}catch(h){t.context?.plugins?.length&&H("error",t,{hook:"onUpdate",error:h})||console.error("[DOMQL] subscribeTo onUpdate error:",h)}finally{g&&R()}}},{depth:r.path.length,label:v(r,"subscribeTo("+o+")")});d.value=!0,i._isSubscribeToEffect=!0,r.__effects.push(i)}}function Nt(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}function Rt(t,e){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=e.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const yo=new Set;function ss(t,e){const s=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=s+"::"+t;yo.has(n)||(yo.add(n),console.warn(`[smbls/css] "${t}" at ${s} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function m(t,e,s){const n={},r=new Set,f=(o,c,u)=>{const a=u?new Set(Object.keys(n)):null;if(T[o]){const d=T[o](c,e,e.state,e.context);if(d){const i=Array.isArray(d)?d:[d];for(const l of i)l&&Object.assign(n,l)}}else n[o]=c;if(u)for(const d in n)a.has(d)||r.add(d)};for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let c=t[o];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(o==="style"){for(const i in c){let l=c[i];if(typeof l=="function"&&(l=l(e,e.state,e.context)),l==null||typeof l=="function")continue;const y=typeof e[i]=="function"&&(T[i]||E&&E.has(i));f(i,l,y)}continue}if(Nt(o,e)){const i=m(c,e,!1);Object.keys(i).length&&(n[`[data-theme="${o.slice(1)}"] &`]=i);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(o)){X()&&ss(o,e);continue}const a=Rt(o,e),d=m(c,e,!1);Object.keys(d).length&&(n[a]=d);continue}const u=typeof e[o]=="function"&&(T[o]||E&&E.has(o));f(o,c,u)}if(s)for(const o in n)r.add(o);for(const o of r){const c=n[o];typeof c=="string"&&!c.includes("!important")&&(n[o]=c+" !important")}return n}function Mt(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&Mt(t[s],e+1))return!0}return!1}function ho(t,e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Nt(t,s)){const f=m(e,s,!1);return Object.keys(f).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:f}:null}const n=Rt(t,s),r=m(e,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function es(t){const e=t.__ref;for(const s of Object.keys(t)){if(!Tt(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!Mt(n))continue;let r=null,f;const o=S(()=>{if(!t.node)return;const c=t.context?.designSystem;c&&N(c);let u,a=!1;try{const d=ho(s,n,t),i=d?ht(d.block)+"::"+d.cssProp:null;if(i!==null&&i===f)a=!0;else if(f=i,d){const l=nt({[d.cssProp]:d.block},null,t.context?.cssPrefix);u=l?l.split(" ").filter(Boolean):null}else u=null}finally{c&&R()}if(!(a||!t.node.classList)){if(r)for(const d of r)t.node.classList.remove(d);if(u&&u.length)for(const d of u)t.node.classList.add(d);r=u}},{depth:e.path.length,label:v(e,"cssBlock("+s+")")});e.__effects.push(o)}}function ns(t){const e=t.__ref;e.__conditionalRunners=[];const s=new Map;for(const n of Object.keys(t)){const r=n.charAt(0);if(r!=="."&&r!=="!")continue;const f=n.slice(1);if(!f)continue;if(/[:@\s>~+[\]]/.test(f)){if(typeof console<"u"&&console.warn){const y=f.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${y}: { '${f.slice(y.length)}': {...} }\`.`)}continue}const o=t[n];if(!o||typeof o!="object")continue;const c=r==="!",u={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{let y;const _=t[f];if(_===void 0){const p=!!t.state&&f in t.state,x=t.state?t.state[f]:void 0;if(p||x!==void 0)y=x;else{const b=t.context?.cases?.[f];if(b===void 0)return;try{y=typeof b=="function"?b.call(t,t):b}catch(C){y=!1,e.__conditionalError=C,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,C?.message||C)}}}else if(typeof _=="function")try{y=_(t,t.state,t.context)}catch(p){y=!1,e.__conditionalError=p,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,p?.message||p)}else y=_;const g=c?!y:!!y;if(!t.node||g===u.lastMatch)return;u.lastMatch=g;const h=t.context?.designSystem;h&&N(h);try{if(g){const p={},x={};let b=!1;for(const A in o){if(!Object.prototype.hasOwnProperty.call(o,A))continue;const w=o[A],Y=A.charAt(0);if((Y===":"||Y==="@"||Y==="&"||Y==="[")&&w&&typeof w=="object"&&!Array.isArray(w)){if(Nt(A,t)){const P=m(w,t,!1);Object.keys(P).length&&(x[`[data-theme="${A.slice(1)}"] &`]=P,b=!0)}else{const P=Rt(A,t),L=m(w,t,!1);Object.keys(L).length&&(x[P]=L,b=!0)}continue}const q=typeof w=="function"?w(t,t.state,t.context):w;if(q!=null)if(T[A]){const P=T[A](q,t,t.state,t.context);if(P){const L=Array.isArray(P)?P:[P];for(const tt of L)tt&&Object.assign(p,tt)}}else(E&&E.has(A)||Ot(A))&&(p[A]=q)}const C=Object.keys(p);if(C.length){J(t.node,p);for(const A of C)s.set(A,n);u.appliedKeys=C}else u.appliedKeys=null;if(b){const A=nt(x,null,t.context?.cssPrefix),w=A?A.split(" ").filter(Boolean):[];if(w.length&&t.node.classList){for(const Y of w)t.node.classList.add(Y);u.appliedClasses=w}else u.appliedClasses=null}else if(u.appliedClasses){for(const A of u.appliedClasses)t.node.classList.remove(A);u.appliedClasses=null}}else{if(u.appliedKeys){for(const p of u.appliedKeys)s.get(p)===n&&(Ot(p)?t.node.style.removeProperty(p):t.node.style[p]="",s.delete(p));u.appliedKeys=null}if(u.appliedClasses){for(const p of u.appliedClasses)t.node.classList.remove(p);u.appliedClasses=null}}}finally{h&&R()}};e.__conditionalRunners.push(a);const d=D(t,t[f+"Deps"],a),i=S(d,{depth:e.path.length,label:v(e,"conditional("+n+")")}),l=e.__exec&&e.__exec[f]||t[f];i._sources.size===0&&typeof l=="function"&&X()&&console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${f}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),e.__effects.push(i)}}const $t=new WeakSet;function rs(t){const e=t.ownerDocument;!e||$t.has(e)||($t.add(e),queueMicrotask(()=>{$t.delete(e);const s=e.body||e.documentElement;s&&s.offsetWidth}))}const Ft=new WeakSet;let _o=!1;function go(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function It(t,e){const s={...t};for(const n in e){const r=e[n],f=s[n];s[n]=r&&typeof r=="object"&&f&&typeof f=="object"?It(f,r):r}return s}function bo(t,e){const s={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const f=bo(r,e);Object.keys(f).length&&(s[n]=f)}else e.has(n)||(s[n]=r)}return s}function is(t){const{node:e}=t;if(!e)return;if(_o||(_o=!0,nt({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 s=t.context?.designSystem;s&&N(s),qt();try{const n={};let r=!1,f=null,o=null,c=null;const u=(a,d)=>{if(d&&typeof d=="object"&&go(a)){o||(o={});const i=o[a];i&&(d=It(i,d)),o[a]=d}else(d===null||typeof d!="object")&&(c||(c=new Set),c.add(a));n[a]=d};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&T.theme){const a=T.theme(t.theme,t,t.state,t.context);if(a){const d=i=>{for(const l in i){const y=i[l];y&&typeof y=="object"&&go(l)&&(f||(f={}),f[l]=y),n[l]=y}};if(Array.isArray(a))for(const i of a)i&&d(i);else d(a);r=!0}}for(const a of Object.keys(t)){if(typeof t[a]=="function"||G.has(a)||a==="theme")continue;const d=a.charCodeAt(0);if(!(d>=65&&d<=90)&&!z(a)){if(T[a]){const i=t[a],l=T[a](i,t,t.state,t.context);if(l){if(Array.isArray(l)){for(const y of l)if(y)for(const _ in y)u(_,y[_])}else for(const y in l)u(y,l[y]);r=!0}}else if(E&&E.has(a)){const i=t[a];i!=null&&typeof i!="object"&&(u(a,i),r=!0)}else if(a.charCodeAt(0)===45){const i=t[a];i!=null&&typeof i!="object"&&(u(a,i),r=!0)}else if(a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="["){const i=t[a];if(i&&typeof i=="object"&&!Array.isArray(i)){if(Mt(i))continue;const l=ho(a,i,t);l&&(u(l.cssProp,l.block),r=!0)}}}}if(f)for(const a in f){let d=c?bo(f[a],c):f[a];o&&o[a]&&(d=It(d,o[a])),Object.keys(d).length?n[a]=d:delete n[a]}if(r){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const a=nt(n,null,t.context?.cssPrefix);if(a&&e.classList){const i=a.split(" ").filter(Boolean);let l=!1;for(const y of i)e.classList.add(y),l||(y.charCodeAt(0)===95&&y.charCodeAt(1)===99||y.charCodeAt(0)===95&&y.indexOf("_c",1)!==-1)&&(l=!0);l&&rs(e)}const d=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(d!=null){const i=n.display;if(i&&i!==d)if(d==="none"){const l=[];for(const y of e.classList)y.startsWith("_d-")&&y!=="_d-none"&&l.push(y);for(const y of l)e.classList.remove(y);e.classList.add("_d-none")}else e.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(e.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}}finally{Qt(),s&&R(),Ft.delete(t)}}function xo(t){const{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const f=t.aria[r];if(typeof f=="function"||typeof f=="object"||f==null||typeof f=="string"&&f.includes("{{"))continue;const o="aria-"+r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(o,K(o,f))}const s=Fo(t);for(const r in s){const f=s[r];f!=null&&f!==!1&&typeof f!="function"&&typeof f!="object"&&e.setAttribute(r,f===!0?"":f)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.has(r)||r==="on"||s[r]!==void 0)continue;const f=r.charCodeAt(0);if(!(f>=65&&f<=90)&&!z(r)&&!(T[r]||E&&E.has(r))&&rt(n,r)){let o=t[r];if(o==null)continue;if(typeof o=="string"&&o.includes("{{")){if(!kt[r])continue;o=$.call(t,o,t.state)}if(o==null||typeof o=="function"||typeof o=="object"||o===!1&&!ct(it(r)||r))continue;const c=it(r)||r;e.setAttribute(c,K(c,o))}}}function Rs(t,e){const{node:s}=t;if(!s||!s.setAttribute)return;const n=e.charCodeAt(0);if(n>=65&&n<=90||z(e)||T[e]||E&&E.has(e)||!rt(t.tag||"div",e))return;const r=it(e)||e,f=r.toLowerCase(),o=t.__ref&&t.__ref.__effects;let c=!1;if(o)for(let d=0;d<o.length;d++){const i=o[d];i&&i._attrName===f&&!i._disposed&&typeof i._execute=="function"&&(c=!0,i._execute())}if(c)return;let u=t[e];const a=kt[e];if(a&&u!=null){const d=a(t);d!==void 0&&(u=d)}typeof u=="string"&&u.includes("{{")&&(u=$.call(t,u,t.state)),u==null||u===!1&&!ct(r)?s.removeAttribute(r):typeof u!="function"&&typeof u!="object"&&s.setAttribute(r,K(r,u))}function cs(t,e){const s=t.node,n=t.__ref;let r=n.__autoGrow;if(!e){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(s.scrollHeight===0&&r.lastMeasure>0)return;s.style.height="auto";const o=s.scrollHeight;s.style.height=o+"px",o>0&&(r.lastMeasure=o)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}})),r.active||(s.addEventListener("input",r.resize),r.active=!0);const f=typeof e=="object"&&e.max!=null?String(e.max):null;f!==r.appliedMax&&(f==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=f,r.appliedMax=f),r.resize()}function fs(t){if(!t.autoGrow)return;const e=t.node;if(!e||e.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,r=typeof n=="function"?D(t,t.autoGrowDeps,n):null,f=S(()=>{const o=t.autoGrow;let c=o;if(typeof o=="function")try{c=(o===n&&r?r:o)(t,t.state,t.context)}catch{c=null}cs(t,c)},{depth:s.path.length,label:v(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(f),r&&(s.__exec.autoGrow=n)}const Ao=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Co(t,e){for(const s of Object.keys(t)){if(!z(s)||Ao.has(s))continue;const n=Oo(s);if(n){Do(n,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const o=r;r=function(u){return t.call(o,u)}}if(typeof r!="function")continue;const f=Ho(s);To.has(f)||Lo(Wo(f),t,r)}as(t)}function as(t){const e=t.node;if(!e||!e.addEventListener)return;const s={};let n=!1;for(const l of Ao){const y=t[l];typeof y=="function"&&(s[l]=y,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,f=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let o=0,c=0,u=0,a=!1;const d=l=>{const y=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];y&&(o=y.clientX,c=y.clientY,u=Date.now(),a=!0)},i=l=>{if(!a)return;a=!1;const y=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!y)return;const _=y.clientX-o,g=y.clientY-c,h=Date.now()-u;if(h>f)return;const p=Math.abs(_),x=Math.abs(g);if(Math.max(p,x)<r)return;let b;if(p>x*1.2)b=_<0?"left":"right";else if(x>p*1.2)b=g<0?"up":"down";else return;const C="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),A=s[C],w=s.onSwipe;A&&A.call(t,l,t,t.state,t.context),w&&w.call(t,{direction:b,dx:_,dy:g,dt:h,event:l},t,t.state,t.context)};e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",i,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",d)}catch{}try{e.removeEventListener("touchend",i)}catch{}})}function dt(t,e){const s={...t};for(const n in e){const r=s[n],f=e[n];r&&f&&typeof r=="object"&&typeof f=="object"&&!Array.isArray(r)&&!Array.isArray(f)&&typeof r!="function"&&typeof f!="function"?s[n]=dt(r,f):s[n]=f}return s}function Ut(t,e,s,n){if(!e||!t.node)return;const r=t.childExtends;if(Array.isArray(e)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,c=f?null:o?.createDocumentFragment();if(!f&&!c)return;const u=t.childProps,a=t.childrenAs,d=h=>{let p=e[h];const x=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let b=u;if(typeof u=="function")try{b=u(t,p)}catch{b=null}if(a==="state"){let A=x;(typeof x=="string"||typeof x=="number")&&(A={value:x,text:x}),p=b?{...b,state:A}:{state:A}}else b&&(p=dt(b,p));if(r&&!p.ignoreChildExtends)if(p.extends){const A=Array.isArray(p.extends)?p.extends:[p.extends],w=Array.isArray(r)?r:[r];p={...p,extends:[...w,...A]}}else p={...p,extends:r};const C=so(p?.key,x,h);try{return Z(p,t,C,s)}catch(A){if(typeof console<"u"&&console.error){const w=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${w} (initial render, skipping this row):`,A?.message||A)}return null}},i=t.__ref;if(!(n===!0&&!f&&!!i&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let h=0;h<e.length;h++){const p=d(h);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const y=i.__childrenChunkGen=(i.__childrenChunkGen||0)+1;Wt();let _=null;const g=h=>{if(i.__disposed||i.__childrenChunkGen!==y){_&&_.parentNode&&_.remove();return}for(let p=h;p<e.length;p++){const x=d(p);if(x?.node&&(_?t.node.insertBefore(x.node,_):c.appendChild(x.node)),p+1<e.length&&Ht()){_||(_=o.createComment("smbls-mount"),c.appendChild(_),t.node.appendChild(c));const b=p+1;Yt(()=>g(b));return}}_?(_.remove(),t.node.tagName==="SELECT"&&bt(t,!0)):t.node.appendChild(c)};return g(0),zt(),!0}if(typeof e=="string"){const f=eo(e,t);if(Array.isArray(f))return Ut(t,f,s,n)}if(typeof e=="object")for(const f in e){if(G.has(f))continue;let o=e[f];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=dt(t.childProps,o)),r&&!o.ignoreChildExtends)if(o.extends){const c=Array.isArray(o.extends)?o.extends:[o.extends],u=Array.isArray(r)?r:[r];o={...o,extends:[...u,...c]}}else o={...o,extends:r};Z(o,t,f,s)}}}function bt(t,e){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const r=t.__ref,f=r&&r.__exec&&r.__exec.value,o=typeof f=="function",c=t.value!=null&&typeof t.value!="function";if(o||c){let d;if(o)try{d=f(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=$.call(t,d,t.state));const i=d==null?"":String(d);s.value!==i&&(s.value=i);return}const u=e||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!u)return;let a=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(a=d);a>=0&&s.selectedIndex!==a&&(s.selectedIndex=a)}function vo(t,e){let{children:s,content:n}=t;const r=t.childExtends;if(typeof s=="function"){const i=s;try{s=i(t,t.state,t.context)}catch(h){if(s=void 0,typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,h?.message||h)}}t.children=s;const l=t.__ref;let y=!1;const _=D(t,t.childrenDeps,i),g=S(()=>{const h=y;y=!0;let p;try{p=_(t,t.state,t.context)}catch(P){if(typeof console<"u"&&console.error){const L=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${L}${h?"":" (initial tracking run)"}:`,P?.message||P)}return}if(!h||p===t.children)return;t.children=p,l.__childrenChunkGen!=null&&l.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",b=x?[]:null,C=x?[]:null,A=x?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const P=t.childProps,L=[],tt=new Map;for(let k=0;k<p.length;k++){const U=p[k];let j=P;if(typeof P=="function")try{j=P(t,U)}catch{j=null}const V=so(j&&j.key,U,k);L.push(V),tt.set(V,{rawChild:U,childProps:j})}const wo=new Set(L),ko=l.__children.slice();for(const k of ko)if(!wo.has(k)){const U=t[k];U?.remove&&U.remove(),delete t[k],C&&C.push(k)}const ot=t.childExtends,lt=t.tag==="fragment",jo=t.context?.document||globalThis.document,st=lt?null:jo?.createDocumentFragment(),At=new Set;for(const k of L){const U=tt.get(k),j=U.rawChild,V=t[k];if(V&&V.state){if(j&&typeof j=="object"){const O=V.state,Q=O.$replace||O.replace,Vt=O.$update||O.update;try{if(typeof Q=="function")Q.call(O,j);else if(typeof Vt=="function"){for(const I in O)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(j,I))try{O[I]=void 0}catch{}Vt.call(O,j)}else for(const I in j)O[I]=j[I]}catch(I){if(typeof console<"u"&&console.error){const Eo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to patch at ${Eo} (reconcile, keeping its previous data for this pass):`,I?.message||I)}}}A&&A.push(k);continue}let Ct=j;(typeof j=="string"||typeof j=="number")&&(Ct={value:j,text:j});const Kt=U.childProps;let B=Kt?{...Kt,state:Ct}:{state:Ct};if(ot&&!B.ignoreChildExtends)if(B.extends){const O=Array.isArray(B.extends)?B.extends:[B.extends],Q=Array.isArray(ot)?ot:[ot];B={...B,extends:[...Q,...O]}}else B={...B,extends:ot};let vt;try{vt=Z(B,t,k,e)}catch(O){if(typeof console<"u"&&console.error){const Q=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${Q} (reconcile, skipping this row):`,O?.message||O)}At.add(k);continue}!lt&&vt?.node&&st&&st.appendChild(vt.node),b&&b.push(k)}if(!lt&&st&&st.childNodes.length&&t.node&&t.node.appendChild(st),!lt&&t.node){let k=null;for(const U of L){const j=t[U]?.node;if(!j)continue;const V=k?k.nextSibling:t.node.firstChild;j!==V&&t.node.insertBefore(j,V),k=j}}l.__children=At.size?L.filter(k=>!At.has(k)):L,x&&(b.length||C.length)&&oo(t,{added:b,removed:C,kept:A}),bt(t,!1);return}const q=x?[...l.__children]:null;for(const P of[...l.__children]){const L=t[P];L?.remove&&L.remove(),delete t[P]}l.__children=[],Ut(t,p,e),bt(t,!1),x&&oo(t,{added:[...l.__children],removed:q,kept:[]})},{depth:l.path.length,label:v(l,"children")});l.__effects.push(g)}const f=Ut(t,s,e,!0);if(n!=null&&!(n&&n.__ref)){let i=n;if(typeof i=="string"||typeof i=="number"?i={text:i}:typeof i!="object"&&(i={}),t.childProps&&(i=dt(t.childProps,i)),r&&!i.ignoreChildExtends)if(i.extends){const l=Array.isArray(i.extends)?i.extends:[i.extends],y=Array.isArray(r)?r:[r];i={...i,extends:[...y,...l]}}else i={...i,extends:r};Z(i,t,"content",e)}if(s&&!f)return;const o=t.context?.components||{};{const i=Object.keys(t);for(let l=0;l<i.length;l++){const y=i[l];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const _=y.slice(0,-7);if(!_||_.charCodeAt(0)<65||_.charCodeAt(0)>90)continue;const g={extends:t[y]};delete t[y];for(let h=l+1;h<i.length;h++){const p=i[h],x=p.charCodeAt(0);if(x>=65&&x<=90||G.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const b=t[p];b!==void 0&&(g[p]=b,delete t[p])}t[_]&&typeof t[_]=="object"?t[_]={...g,...t[_]}:t[_]=g}}const c=e?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),a=i=>{if(G.has(i)||typeof t[i]!="object"||t[i]===null)return;const l=i.charCodeAt(0);if(l<65||l>90)return;let y=t[i];if(!y.__ref){if(!y.extends&&!y.extend){const _=o[i]||o[`smbls.${i}`];_&&(y={...y,extends:_})}if(t.childProps&&(y=dt(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const _=Array.isArray(y.extends)?y.extends:[y.extends],g=Array.isArray(r)?r:[r];y={...y,extends:[...g,..._]}}else y={...y,extends:r};Z(y,t,i,e)}};if(!c){for(const i of u)a(i);return}Wt();const d=i=>{for(let l=i;l<u.length;l++)if(a(u[l]),l+1<u.length&&Ht()){const y=l+1;Yt(()=>d(y));return}};d(0),zt()}function So(t,e,s){const{node:n}=t;if(!n)return;n.ref=t;const r=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(r){const o=r.parentNode;if(o){if(s?.position==="before"&&s.node)o.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;o.insertBefore(n,c||r)}else o.insertBefore(n,r);return}}const f=e?.node||(e?.nodeType?e:null);if(f)if(s?.position==="before"&&s.node)f.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const o=s.node.nextSibling;o?f.insertBefore(n,o):f.appendChild(n)}else f.appendChild(n)}const Bt=3;function us(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Bt?!1:(t.__inBeforeUpdate=!0,!0)}function xt(t,e){t&&(t.__inBeforeUpdate=!1,e?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Bt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Bt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function M(t,e,s){const n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&H(n,e,s);const r="on"+t,f=e[r];if(typeof f=="function"){const u=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(u){if(e.__ref[u])return!0;e.__ref[u]=!0}const a=e.context?.designSystem;a&&N(a);let d=!!u;try{const i=f(e,e.state,e.context,s);if(i&&typeof i.then=="function"){const l=e.__ref;return i.catch(y=>{e.context?.plugins?.length&&H("error",e,{hook:r,error:y})||console.error(`[DOMQL] Lifecycle "${r}" error:`,y)}).finally(()=>{u&&l&&(l[u]=!1)}),d=!1,!0}if(i===!1)return!1}catch(i){if(e.context?.plugins?.length&&H("error",e,{hook:r,error:i})||console.error(`[DOMQL] Lifecycle "${r}" error:`,i),e.context?.strictMode)throw i}finally{a&&R(),d&&e.__ref&&(e.__ref[u]=!1)}}return!0}var Ms=Z;export{Bt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,us as acquireBeforeUpdateGuard,Z as create,Ms as default,Et as flushMounts,Rs as reconcileAttrProp,xt as releaseBeforeUpdateGuard,yt as writeElementText};
4
+ `):"")}}if(Et(e,!0),Uo(e,s,r),typeof e.html=="function"&&e.node&&!e.node.innerHTML){const u=e.context?.designSystem;u&&N(u);try{const l=e.html(e,e.state,e.context);l!=null&&typeof l!="function"&&(e.node.innerHTML=l)}catch{}finally{u&&M()}}if(F("Create",e,n),F("Complete",e,n),F("Render",e,n),F("RenderRouter",e,n),$t(e,n),typeof e.onFrame=="function"){const u=e.onFrame,l=e.context?.designSystem,b=()=>{if(e.node){if(e.node.isConnected){l&&N(l);try{u(e,e.state,e.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{l&&M()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return e}function as(t,s,o){const n=!s,r=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=n&&r&&t.context?.state,e=o.state!==void 0&&!c?o.state:t.state&&!q(t.state)?t.state:void 0;if(e==null){if(s?.state)t.state=s.state,et(t,t.state);else if(t.context?.state){const p=t.context.state,i={...p},g=t.context?.polyglot;if(g?.translations){const _=t.context,f=p.lang||g.defaultLang||"en",d=new Set,y=(u,l)=>{d.has(u)||Qo(_,u,i)&&(i[u]=l,d.add(u),Xo(_,u))},a=g.translations[f];if(a&&typeof a=="object")for(const u in a)y(u,a[u]);const h=new Set(g.languages||[]);for(const u in g.translations)h.has(u)||y(u,g.translations[u])}t.state=q(i)?i:Dt(i),t.state.__element=t,t.state.root=t.state,et(t,t.state),gt.promoteActiveRootState?.(p,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),et(t,t.state);return}if(typeof e=="string"){if(t.state=yo(e,s),t.state&&typeof t.state=="object"&&!q(t.state)){const p=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:p,enumerable:!1,configurable:!0,writable:!0})}et(t,t.state);return}if(typeof e=="function"){const p=e(t,s?.state);t.state=q(p)?p:Dt(p||{})}else q(e)?t.state=e:t.state=Dt({...e});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,et(t,t.state),gt.promoteActiveRootState?.(e,t.state)}function Ut(t,s){if(!s)return t;const o=s.split("/");let n=t;for(const r of o){if(n==null)return{};n=n[r]}return n??{}}function yo(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?Ut(s.state,r):s.state??{}}if(t.startsWith("~/")){const r=s.state?.root||s.state,c=t.slice(2);return c?Ut(r,c):r??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Ut(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const n=s.context?.polyglot;if(n?.translations){const r=s.state?.root?.lang||n.defaultLang||"en",c=n.translations[r];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const us=new Set(["s","state","ctx","context"]);function ls(t){try{const o=(typeof gt.getFunctionSource=="function"?gt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function ds(t){if(typeof t!="function"||t.length!==2)return!1;const s=ls(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!us.has(o)}function ps(t){const s=t.__ref,o=t.tag||"div",n=t.context?.designSystem,r=[],c=Object.keys(t);for(let e=0;e<c.length;e++){const p=c[e];if(typeof t[p]!="function"||W.has(p))continue;const i=p.charCodeAt(0);i>=65&&i<=90||Y(p)||D[p]||R&&R.has(p)||it(o,p)||(m()&&ds(t[p])&&console.warn(`[smbls] custom prop "${p}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${p}', \u2026) instead of reading el.${p}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:p,fn:t[p]}))}for(let e=0;e<r.length;e++){const{prop:p,fn:i}=r[e];s.__exec[p]=i,Object.defineProperty(t,p,{get(){n&&N(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&M()}},set(g){delete s.__exec[p],Object.defineProperty(t,p,{value:g,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function hs(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const n=s[o];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function P(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...n){return hs(t,s),o.apply(this,n)}}function pt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function w(t,s){return()=>t.path.join(".")+"::"+s}const _o=new Set;function I(t,s,o){if(!m())return;const n=w(t,s)();_o.has(n)||(_o.add(n),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const go=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,ys=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;go.lastIndex=0;let n;for(;(n=go.exec(o))!==null;)n[2].includes("{{")&&s.add(n[2])},_s=(t,s)=>!Y(t)&&!at(s,t),bo=(t,s,o,n)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&_s(t,n)&&ys(s,o)},gs=["attr","aria","data"],bs=t=>{if(gs.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},xs=t=>{const s=new Set,o=t.tag||"div";for(const n of Object.keys(t)){const r=Object.getOwnPropertyDescriptor(t,n),c=r&&r.value;if(c&&typeof c=="object"&&!Array.isArray(c)){if(!bs(n))continue;for(const e in c)bo(e,c[e],s,o);continue}bo(n,c,s,o)}return s};function xo(t,s){const o=t.__ref,n=!!(s&&s.skipIfEffect),r=xs(t);if(o.__authoredTemplates)for(const i of r)o.__authoredTemplates.add(i);else o.__authoredTemplates=r;if(ps(t),typeof t.text=="function"){const i=t.text,g=P(t,t.textDeps,i),_=v(()=>{if(!o.contentManaged)try{let f=g(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&typeof f!="object"&&(typeof f=="string"&&f.includes("{{")&&(f=$.call(t,f,t.state)),At(t,f))}catch(f){I(o,"text",f)}},{depth:o.path.length,label:w(o,"text")});o.__effects.push(_),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,g=v(()=>{if(o.contentManaged)return;const _=$.call(t,i,t.state);_!=null&&(t.text=_),t.node&&At(t,_??"")},{depth:o.path.length,label:w(o,"text")});o.__effects.push(g),o.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!W.has(i)&&!Y(i)&&!o.__exec[i]&&!co(c,i)){if(D[i]){const g=t[i],_=P(t,t[i+"Deps"],g),f=i;let d,y=null,a=null,h;const u=v(()=>{const l=t.context?.designSystem;l&&N(l);try{const b=_(t,t.state,t.context);no();let x;try{x=D[f](b,t,t.state,t.context)}finally{eo()}if(Array.isArray(x)){const C={};for(const A of x)if(A)for(const E in A)C[E]=A[E];x=C}const S=f==="show"||f==="hide";if(x&&t.node&&As(x)){const C=Ct(x);if(C===null||C!==h){h=C;const A=rt(x,null,t.context?.cssPrefix),E=A?A.split(" ").filter(Boolean):null;if(t.node.classList){if(a)for(const U of a)t.node.classList.remove(U);if(E&&E.length)for(const U of E)t.node.classList.add(U);a=E}}d=void 0,y=null}else if(x&&t.node){if(a){for(const A of a)t.node.classList.remove(A);a=null,h=void 0}const C=Ct(x);if(C===null||C!==d||!vt(t.node,y)){d=C;const A=ko(t,x);y=St(t.node,A)}}else t.node&&S&&(d=void 0,y=null,t.node.style.display="")}finally{l&&M()}},{depth:o.path.length,label:w(o,f)});o.__effects.push(u),o.__exec[i]=g}else if(R&&R.has(i)){const g=t[i],_=P(t,t[i+"Deps"],g),f=i;let d,y=null;const a=v(()=>{const h=t.context?.designSystem;h&&N(h);try{const u=_(t,t.state,t.context);if(t.node)if(u!=null){const l=f+":"+String(u);if(l!==d||!vt(t.node,y)){d=l;const b={[f]:u},x=ko(t,b);y=St(t.node,x)}}else d=void 0,y=null,t.node.style[f]=""}finally{h&&M()}},{depth:o.path.length,label:w(o,f)});o.__effects.push(a),o.__exec[i]=g}}if(typeof t.html=="function"){const i=t.html,g=P(t,t.htmlDeps,i),_=v(()=>{const f=t.context?.designSystem;f&&N(f);try{const d=g(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{f&&M()}},{depth:o.path.length,label:w(o,"html")});o.__effects.push(_),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,g=P(t,t.valueDeps,i),_=v(()=>{try{let f=g(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=$.call(t,f,t.state)),So(t,f)}catch(f){I(o,"value",f)}},{depth:o.path.length,label:w(o,"value")});o.__effects.push(_),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,g=v(()=>{try{So(t,$.call(t,i,t.state))}catch(_){I(o,"value",_)}},{depth:o.path.length,label:w(o,"value")});o.__effects.push(g),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,g=P(t,t.styleDeps,i);let _,f=null;const d=v(()=>{const y=g(t,t.state,t.context),a=Ct(y);(a===null||a!==_||!vt(t.node,f))&&(_=a,Cs(t.node,f,y),X(t.node,y),f=St(t.node,y))},{depth:o.path.length,label:w(o,"style")});o.__effects.push(d),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const g=t.style[i];if(typeof g!="function")continue;const _=P(t,pt(t.styleDeps,i),g);let f,d=null;const y=v(()=>{try{const a=_(t,t.state,t.context);if(t.node){const h=i+":"+String(a);if(h!==f||!vt(t.node,d)){f=h;const u={[i]:a};X(t.node,u),d=St(t.node,u)}}}catch(a){I(o,"style."+i,a)}},{depth:o.path.length,label:w(o,"style."+i)});o.__effects.push(y)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const g=P(t,pt(t.attrDeps,i),t.attr[i]),_=i,f=v(()=>{try{let d=g(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=$.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!ft(_)?t.node.removeAttribute(_):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(_,V(_,d)))}catch(d){I(o,"attr."+_,d)}},{depth:o.path.length,label:w(o,"attr."+_)});f._attrName=_.toLowerCase(),o.__effects.push(f)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const g=t.attr[i],_=i,f=v(()=>{try{const d=$.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(_,V(_,d??""))}catch(d){I(o,"attr."+_,d)}},{depth:o.path.length,label:w(o,"attr."+_)});f._attrName=_.toLowerCase(),o.__effects.push(f)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const g=t.aria[i];if(typeof g=="string"&&g.includes("{{")){const y=g,a="aria-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),h=v(()=>{try{const u=$.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,V(a,u??""))}catch(u){I(o,"aria."+i,u)}},{depth:o.path.length,label:w(o,"aria."+i)});h._attrName=a,o.__effects.push(h);continue}if(typeof g!="function")continue;const _=P(t,pt(t.ariaDeps,i),t.aria[i]),f="aria-"+i.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),d=v(()=>{try{const y=_(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(f,V(f,y))}catch(y){I(o,"aria."+i,y)}},{depth:o.path.length,label:w(o,"aria."+i)});d._attrName=f,o.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const i in t.data){const g=t.data[i];if(typeof g=="string"&&g.includes("{{")){const a=g,h="data-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),u=v(()=>{try{const l=$.call(t,a,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(h,l??"")}catch(l){I(o,"data."+i,l)}},{depth:o.path.length,label:w(o,"data."+i)});u._attrName=h,o.__effects.push(u);continue}if(typeof g!="function")continue;const _=P(t,pt(t.dataDeps,i),t.data[i]),d="data-"+i.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),y=v(()=>{try{const a=_(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(d):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(d,a===!0?"":a)}catch(a){I(o,"data."+i,a)}},{depth:o.path.length,label:w(o,"data."+i)});y._attrName=d,o.__effects.push(y)}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 i in e){if(typeof e[i]!="function")continue;const g=P(t,pt(t.classDeps,i),e[i]),_=v(()=>{try{const f=g(t,t.state,t.context);if(!t.node?.classList)return;typeof f=="string"?t.node.classList.add(f):f?t.node.classList.add(i):t.node.classList.remove(i)}catch(f){I(o,"class."+i,f)}},{depth:o.path.length,label:w(o,"class."+i)});o.__effects.push(_)}!n&&typeof t.if=="function"&&Co(t,o,t.if);for(const i of Object.keys(t)){if(W.has(i)||typeof t[i]!="function")continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||Y(i))continue;const _=t[i];o.__exec[i]=_;const f=t.tag||"div";if(it(f,i)&&!at(f,i)){const d=ct(i)||i,y=P(t,t[i+"Deps"],_),a=v(()=>{try{let h=y(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=$.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!ft(d)?t.node.removeAttribute(d):typeof h!="function"&&typeof h!="object"&&(d==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(d,V(d,h))))}catch(h){I(o,i,h)}},{depth:o.path.length,label:w(o,i)});a._attrName=d.toLowerCase(),o.__effects.push(a)}}const p=t.tag||"div";for(const i of Object.keys(t)){if(W.has(i))continue;const g=t[i];if(typeof g!="string"||!g.includes("{{"))continue;const _=i.charCodeAt(0);if(_>=65&&_<=90||Y(i)||at(p,i)||Nt[i]||!it(p,i))continue;const f=ct(i)||i,d=v(()=>{try{const y=$.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(f,V(f,y??""))}catch(y){I(o,i,y)}},{depth:o.path.length,label:w(o,i)});d._attrName=f.toLowerCase(),o.__effects.push(d)}if(Es(t),Os(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,g=t.stateDeps;let _=!1,f=[];const d=v(()=>{const y=[];for(let l=0;l<g.length;l++){const b=g[l];try{y[l]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{y[l]=void 0}}if(!_){_=!0,f=y;return}let a=y.length!==f.length;for(let l=0;!a&&l<y.length;l++)y[l]!==f[l]&&(a=!0);const h=f;if(f=y,!a)return;const u=t.context?.designSystem;u&&N(u);try{i(t,t.state,t.context,{prev:h,next:y})}catch(l){if(t.context?.plugins?.length&&z("error",t,{hook:"onStateUpdate",error:l})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',l),t.context?.strictMode)throw l}finally{u&&M()}},{depth:o.path.length,label:w(o,"onStateUpdate")});o.__effects.push(d)}Ls(t)}function Ao(t){const s=t.parent,o=s?.node;if(!o||!t.node){Uo(t,t.parent);return}let n=null;const r=Object.keys(s),c=r.indexOf(t.key);for(let e=c+1;e<r.length;e++){const p=s[r[e]];if(p?.node?.parentNode===o){n=p.node;break}}n?o.insertBefore(t.node,n):o.appendChild(t.node)}function Co(t,s,o){const n=P(t,t.ifDeps,o),r=v(()=>{let c;try{c=n(t,t.state,t.context)}catch(p){if(c=!1,s.__ifError=p,typeof console<"u"&&console.warn){const i=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${i} \u2014 treating as false:`,p?.message||p)}return}const e=s.__if;if(s.__if=!!c,e&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(p){console.error("[smbls] onRemove error:",p)}}else if(!e&&s.__if)if(s.__ifInitialized)t.node||(t.node=Rt(t)),t.node&&(t.node.ref=t),Ao(t),Bt(t),F("Render",t,{}),$t(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=Jt(t)),F("Init",t,{}),t.node||(t.node=Rt(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const i=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(i),s.__fragmentAnchor=i}F("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),$o(t,{}),xo(t,{skipIfEffect:!0}),Bt(t),Mo(t),Io(t,{}),Ao(t),F("Create",t,{}),F("Complete",t,{}),F("Render",t,{}),F("RenderRouter",t,{}),$t(t,{})}},{depth:s.path.length,label:w(s,"if")});s.__effects.push(r)}function At(t,s){const o=t.node;if(!o)return;const n=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==n&&(o.nodeValue=n);return}const r=t.__ref;let c=r?r.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const e=o.firstChild;e&&e.nodeType===3&&(c=e)}c?c.nodeValue!==n&&(c.nodeValue=n):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),o.insertBefore(c,o.firstChild)):(o.textContent=n,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),r&&(r.__textNode=c||null)}function So(t,s){const o=t.node;if(!o||!("value"in o))return;const n=s==null?"":String(s);if(o.value===n)return;const r=typeof document<"u"&&document.activeElement===o,c=r&&typeof o.selectionStart=="number"?o.selectionStart:null,e=r&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=n,r&&c!=null&&e!=null)try{o.setSelectionRange(c,e)}catch{}}function Bt(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&At(t,t.text),No(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){o={};for(const r in t.style)typeof t.style[r]!="function"&&(o[r]=t.style[r]);break}X(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const n=t.attr[o];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!ft(o)||s.setAttribute&&s.setAttribute(o,V(o,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&s.setAttribute&&s.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const o in t.data){const n=t.data[o];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||s.dataset&&(s.dataset[o]=n===!0?"":n)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(n=>n&&s.classList.add(n));else if(typeof o=="object")for(const n in o){const r=typeof o[n]=="function"?o[n](t,t.state,t.context):o[n];r&&s.classList.add(typeof r=="string"?r:n)}}}}function Ct(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function As(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function St(t,s){if(!t||!t.style||!s)return null;const o=t.style,n=[];for(const r in s){if(s[r]==null||r.charAt(0)==="&")continue;const e=wt(r);n.push(e,Kt(o,e),wo(o,e))}return n}function Kt(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function wo(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function wt(t){return kt(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function Cs(t,s,o){if(!t||!t.style||!s||!s.length)return;const n=t.style,r=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||r.add(wt(c));for(let c=0;c<s.length;c+=3){const e=s[c];r.has(e)||Kt(n,e)===s[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(e)}}function vt(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let n=0;n<s.length;n+=3)if(Kt(o,s[n])!==s[n+1]||wo(o,s[n])!==s[n+2])return!1;return!0}const kt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function Ss(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(wt(o)));return s}function ws(t,s,o,n){const r=t.__ref;if(!r)return;let c=null;if(o)for(const e of o){if(n&&n.has(e))continue;const p=s[e];if(p==null||typeof p=="object")continue;const i=wt(e);io[i]&&(c||(c={}),c[i]=p)}r.__declaredLonghands=c}function vo(t,s){const o=t.__ref,n=o&&o.__declaredLonghands;if(!n||!s)return null;let r=null;for(const c in n){if(s.has(c))continue;const e=io[c];let p=!1;for(let i=0;i<e.length;i++)if(s.has(e[i])){p=!0;break}p&&(r||(r={}),r[c]=n[c])}return r}function ko(t,s){const o=t.node;X(o,s);const n=Ss(s);if(!n)return s;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const e of n)r.__inlineCssKeys.add(e);else r.__inlineCssKeys=new Set(n);const c=vo(t,n);return c?(X(o,c),Object.assign({},s,c)):s}function vs(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=vo(t,s.__inlineCssKeys);o&&X(t.node,o)}function X(t,s){if(!t||!s||!t.style)return;let o=null;for(const n in s){const r=s[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){o||(o={}),o[n]=r;continue}try{const c=String(r),e=kt(n)?n:n.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),p=c.trim(),i=/\s*!important\s*$/.test(p),g=p.replace(/\s*!important\s*$/,"");t.style.setProperty(e,g,i?"important":"")}catch{}}}o&&ks(t,o)}function ks(t,s){const o=`_ds${fo.scopedStyleId++}`;t.classList.add(o);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let c="";for(const e in s){const p="."+o,i=e.replace(/&/g,p).split(",").map(_=>{const f=_.trim();return f.includes(p)?f:p+f}).join(", "),g=s[e];if(typeof g=="object"){let _="",f="";for(const d in g){const y=g[d];if(typeof y=="object"){const a=d.includes("&")?i.split(", ").map(u=>d.replace(/&/g,u)).join(", "):i.split(", ").map(u=>`${u} ${d}`).join(", ");let h="";for(const u in y)h+=`${u.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${y[u]};`;f+=ro(`${a} { ${h} }`,a)+`
5
+ `}else _+=`${d.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())}: ${y};`}_&&(c+=ro(`${i} { ${_} }`,i)+`
6
+ `),f&&(c+=f)}}c&&(r.textContent+=c)}const jo=new Set;function Eo(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function js(t,s,o){const n=Eo(o);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=s(t,t.state,t.context)}catch{return}if(Eo(r)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";jo.has(c)||(jo.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Es(t){const s=t.subscribeTo,o=typeof s=="function";let n=s;if(o)try{n=s(t,t.state,t.context)}catch{n=null}if(o&&m()&&js(t,s,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let c=0;c<n.length;c++){const e=n[c];if(typeof e!="string"||e.length===0)continue;const p=e.split("."),i=p[0],g=p.slice(1),_={value:!1},f=v(()=>{const d=t.state&&(q(t.state)?t.state.root:null);if(!d||!q(d))return;let y=d;y=y[i];for(let h=0;h<g.length&&!(y==null||typeof y!="object");h++)if(q(y))y=y[g[h]];else break;if(!_.value)return;let a=!1;if(typeof t.onBeforeUpdate=="function"){const h=t.context?.designSystem;h&&N(h);try{if(Fs(r)){const u=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});u&&typeof u.then=="function"?u.then(()=>Tt(r,!1),l=>{Tt(r,!0),t.context?.plugins?.length&&z("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}):(Tt(r,!1),u===!1&&(a=!0))}}catch(u){Tt(r,!0),t.context?.plugins?.length&&z("error",t,{hook:"onBeforeUpdate",error:u})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",u)}finally{h&&M()}}if(!a&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){const u=r.__effects[h];u&&u!==f&&!u._disposed&&!u._isSubscribeToEffect&&typeof u._execute=="function"&&u._execute()}if(!a&&typeof t.onUpdate=="function"){const h=t.context?.designSystem;h&&N(h);try{t.onUpdate(t,t.state,t.context)}catch(u){t.context?.plugins?.length&&z("error",t,{hook:"onUpdate",error:u})||console.error("[DOMQL] subscribeTo onUpdate error:",u)}finally{h&&M()}}},{depth:r.path.length,label:w(r,"subscribeTo("+e+")")});_.value=!0,f._isSubscribeToEffect=!0,r.__effects.push(f)}}function Ht(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function Vt(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const To=new Set;function Ts(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",n=o+"::"+t;To.has(n)||(To.add(n),console.warn(`[smbls/css] "${t}" at ${o} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function ot(t,s,o,n){const r={},c=new Set,e=(p,i,g)=>{const _=g?new Set(Object.keys(r)):null;if(D[p]){const f=D[p](i,s,s.state,s.context);if(f){const d=Array.isArray(f)?f:[f];for(const y of d)y&&Object.assign(r,y)}}else r[p]=i;if(g)for(const f in r)_.has(f)||c.add(f)};for(const p in t){if(!Object.prototype.hasOwnProperty.call(t,p))continue;let i=t[p];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(p==="style"){for(const y in i){let a=i[y];if(typeof a=="function"&&(a=a(s,s.state,s.context)),a==null||typeof a=="function")continue;const h=typeof s[y]=="function"&&(D[y]||R&&R.has(y))||!!(n&&n.has(y));e(y,a,h)}continue}if(Ht(p,s)){const y=ot(i,s,!1,n);Object.keys(y).length&&(r[`[data-theme="${p.slice(1)}"] &`]=y);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(p)){m()&&Ts(p,s);continue}const f=Vt(p,s),d=ot(i,s,!1,n);Object.keys(d).length&&(r[f]=d);continue}const g=typeof s[p]=="function"&&(D[p]||R&&R.has(p)),_=!!(n&&n.has(p));e(p,i,g||_)}if(o)for(const p in r)c.add(p);for(const p of c){const i=r[p];typeof i=="string"&&!i.includes("!important")&&(r[p]=i+" !important")}return r}const jt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Po(t,s){for(const o in s){const n=s[o];t[o]=jt(n)?Po(jt(t[o])?t[o]:{},n):n}return t}function Ps(t,s){if(!jt(s))return;let o;for(const n of t.split(" ")){const r=n?s[n]:null;jt(r)&&(o=Po(o||{},r))}return o}function Gt(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Gt(t[o],s+1))return!0}return!1}function Lo(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Ht(t,o)){const c=ot(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=Vt(t,o),r=ot(s,o,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function Ls(t){const s=t.__ref;for(const o of Object.keys(t)){if(!It(o))continue;const n=t[o];if(!n||typeof n!="object"||Array.isArray(n)||!Gt(n))continue;let r=null,c;const e=v(()=>{if(!t.node)return;const p=t.context?.designSystem;p&&N(p);let i,g=!1;try{const _=Lo(o,n,t),f=_?Ct(_.block)+"::"+_.cssProp:null;if(f!==null&&f===c)g=!0;else if(c=f,_){const d=rt({[_.cssProp]:_.block},null,t.context?.cssPrefix);i=d?d.split(" ").filter(Boolean):null}else i=null}finally{p&&M()}if(!(g||!t.node.classList)){if(r)for(const _ of r)t.node.classList.remove(_);if(i&&i.length)for(const _ of i)t.node.classList.add(_);r=i}},{depth:s.path.length,label:w(s,"cssBlock("+o+")")});s.__effects.push(e)}}function Os(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const n of Object.keys(t)){const r=n.charAt(0);if(r!=="."&&r!=="!")continue;const c=n.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const a=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${a}: { '${c.slice(a.length)}': {...} }\`.`)}continue}const e=t[n];if(!e||typeof e!="object")continue;const p=r==="!",i={lastMatch:!1,appliedKeys:null,appliedClasses:null},g=new Set;for(const a in e){if(!Object.prototype.hasOwnProperty.call(e,a))continue;const h=a.charAt(0),u=e[a];(h===":"||h==="@"||h==="&"||h==="[")&&u&&typeof u=="object"&&!Array.isArray(u)||g.add(a)}const _=()=>{let a;const h=t[c];if(h===void 0){const b=!!t.state&&c in t.state,x=t.state?t.state[c]:void 0;if(b||x!==void 0)a=x;else{const S=t.context?.cases?.[c];if(S===void 0)return;try{a=typeof S=="function"?S.call(t,t):S}catch(C){a=!1,s.__conditionalError=C,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,C?.message||C)}}}else if(typeof h=="function")try{a=h(t,t.state,t.context)}catch(b){a=!1,s.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else a=h;const u=p?!a:!!a;if(!t.node||u===i.lastMatch)return;i.lastMatch=u;const l=t.context?.designSystem;l&&N(l);try{if(u){const b={},x={};let S=!1;for(const A in e){if(!Object.prototype.hasOwnProperty.call(e,A))continue;const E=e[A],U=A.charAt(0);if((U===":"||U==="@"||U==="&"||U==="[")&&E&&typeof E=="object"&&!Array.isArray(E)){if(Ht(A,t)){const T=ot(E,t,!1,g);Object.keys(T).length&&(x[`[data-theme="${A.slice(1)}"] &`]=T,S=!0)}else{const T=Vt(A,t),Z=ot(E,t,!1,g);Object.keys(Z).length&&(x[T]=Z,S=!0)}continue}const L=typeof E=="function"?E(t,t.state,t.context):E;if(L!=null)if(D[A]){const T=D[A](L,t,t.state,t.context);if(T){const Z=Array.isArray(T)?T:[T];for(const yt of Z)yt&&Object.assign(b,yt)}}else(R&&R.has(A)||kt(A))&&(b[A]=L)}const C=Object.keys(b);if(C.length){X(t.node,b);for(const A of C)o.set(A,n);i.appliedKeys=C}else i.appliedKeys=null;if(S){const A=rt(x,null,t.context?.cssPrefix,{state:!0}),E=A?A.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const U of E)t.node.classList.add(U);i.appliedClasses=E}else i.appliedClasses=null}else if(i.appliedClasses){for(const A of i.appliedClasses)t.node.classList.remove(A);i.appliedClasses=null}}else{if(i.appliedKeys){for(const b of i.appliedKeys)o.get(b)===n&&(kt(b)?t.node.style.removeProperty(b):t.node.style[b]="",o.delete(b));i.appliedKeys=null}if(i.appliedClasses){for(const b of i.appliedClasses)t.node.classList.remove(b);i.appliedClasses=null}}}finally{l&&M()}};s.__conditionalRunners.push(_);const f=P(t,t[c+"Deps"],_),d=v(f,{depth:s.path.length,label:w(s,"conditional("+n+")")}),y=s.__exec&&s.__exec[c]||t[c];d._sources.size===0&&typeof y=="function"&&m()&&console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(d)}}const Wt=new WeakSet;function Ds(t){const s=t.ownerDocument;!s||Wt.has(s)||(Wt.add(s),queueMicrotask(()=>{Wt.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const zt=new WeakSet;let Oo=!1;function Do(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Yt(t,s){const o={...t};for(const n in s){const r=s[n],c=o[n];o[n]=r&&typeof r=="object"&&c&&typeof c=="object"?Yt(c,r):r}return o}function Ro(t,s){const o={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const c=Ro(r,s);Object.keys(c).length&&(o[n]=c)}else s.has(n)||(o[n]=r)}return o}function No(t){const{node:s}=t;if(!s)return;if(Oo||(Oo=!0,rt({display:"none"})),zt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}zt.add(t);const o=t.context?.designSystem;o&&N(o),no();try{const n={};let r=!1,c=[],e=null,p=null,i=null;const g=(a,h)=>{if(h&&typeof h=="object"&&Do(a)){p||(p={});const u=p[a];u&&(h=Yt(u,h)),p[a]=h}else(h===null||typeof h!="object")&&(i||(i=new Set),i.add(a));n[a]=h};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&D.theme){const a=D.theme(t.theme,t,t.state,t.context);if(a){const h=u=>{for(const l in u){const b=u[l];b&&typeof b=="object"&&Do(l)&&(e||(e={}),e[l]=b),n[l]=b}};if(Array.isArray(a))for(const u of a)u&&h(u);else h(a);r=!0}}const _=(a,h)=>{if(D[a]){const u=D[a](h,t,t.state,t.context);if(u){if(Array.isArray(u)){for(const l of u)if(l)for(const b in l)g(b,l[b])}else for(const l in u)g(l,u[l]);r=!0}}else if(R&&R.has(a))h!=null&&typeof h!="object"&&(g(a,h),r=!0);else if(a.charCodeAt(0)===45)h!=null&&typeof h!="object"&&(g(a,h),r=!0);else if((a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="[")&&h&&typeof h=="object"&&!Array.isArray(h)){if(Gt(h))return;const u=Lo(a,h,t);u&&(g(u.cssProp,u.block),r=!0)}};if(typeof t.class=="string"){const a=Ps(t.class,t.context?.designSystem?.class);if(a)for(const h in a)_(h,a[h])}const f=i?new Set(i):null,d=t.tag||"div";for(const a of Object.keys(t)){if(typeof t[a]=="function"||W.has(a)||a==="theme")continue;const h=a.charCodeAt(0);h>=65&&h<=90||Y(a)||co(d,a)||_(a,t[a])}if(e)for(const a in e){let h=i?Ro(e[a],i):e[a];p&&p[a]&&(h=Yt(h,p[a])),Object.keys(h).length?n[a]=h:delete n[a]}if(ws(t,n,i,f),r){n.display&&String(n.display).includes("!important")&&(s.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const a=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof a=="string"&&a!==""&&n.display&&n.display!==a&&(n.display=a);const h=rt(n,null,t.context?.cssPrefix);if(c=h?h.split(" ").filter(Boolean):[],h&&s.classList){const u=c;let l=!1;for(const b of u)s.classList.add(b),l||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(l=!0);l&&Ds(s)}}const y=t.__ref;if(y){const a=y.__staticCssClasses;if(a&&s.classList){const h=new Set(c);for(const u of a)h.has(u)||s.classList.remove(u)}y.__staticCssClasses=c}vs(t)}finally{eo(),o&&M(),zt.delete(t)}}const an=t=>!!D[t]||!!(R&&R.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function un(t){t&&t.node&&No(t)}function Mo(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const e="aria-"+r.replace(/[A-Z]/g,p=>"-"+p.toLowerCase());s.setAttribute(e,V(e,c))}const o=Jo(t);for(const r in o){const c=o[r];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(r,c===!0?"":c)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||W.has(r)||r==="on"||o[r]!==void 0)continue;const c=r.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(r)&&!at(n,r)&&it(n,r)){let e=t[r];if(e==null)continue;if(typeof e=="string"&&e.includes("{{")){if(!Nt[r])continue;e=$.call(t,e,t.state)}if(e==null||typeof e=="function"||typeof e=="object"||e===!1&&!ft(ct(r)||r))continue;const p=ct(r)||r;s.setAttribute(p,V(p,e))}}}function ln(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const n=s.charCodeAt(0);if(n>=65&&n<=90||Y(s))return;const r=t.tag||"div";if(at(r,s)||!it(r,s))return;const c=ct(s)||s,e=c.toLowerCase(),p=t.__ref&&t.__ref.__effects;let i=!1;if(p)for(let f=0;f<p.length;f++){const d=p[f];d&&d._attrName===e&&!d._disposed&&typeof d._execute=="function"&&(i=!0,d._execute())}if(i)return;let g=t[s];const _=Nt[s];if(_&&g!=null){const f=_(t);f!==void 0&&(g=f)}typeof g=="string"&&g.includes("{{")&&(g=$.call(t,g,t.state)),g==null||g===!1&&!ft(c)?o.removeAttribute(c):typeof g!="function"&&typeof g!="object"&&o.setAttribute(c,V(c,g))}function Rs(t,s){const o=t.node,n=t.__ref;let r=n.__autoGrow;if(!s){if(r&&r.active){try{o.removeEventListener("input",r.resize)}catch{}o.style.height="",r.appliedMax!=null&&o.style.maxHeight===r.appliedMax&&(o.style.maxHeight=""),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(o.scrollHeight===0&&r.lastMeasure>0)return;o.style.height="auto";const e=o.scrollHeight;o.style.height=e+"px",e>0&&(r.lastMeasure=e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{o.removeEventListener("input",r.resize)}catch{}})),r.active||(o.addEventListener("input",r.resize),r.active=!0);const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==r.appliedMax&&(c==null?r.appliedMax!=null&&o.style.maxHeight===r.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,r.appliedMax=c),r.resize()}function Ns(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,n=t.autoGrow,r=typeof n=="function"?P(t,t.autoGrowDeps,n):null,c=v(()=>{const e=t.autoGrow;let p=e;if(typeof e=="function")try{p=(e===n&&r?r:e)(t,t.state,t.context)}catch{p=null}Rs(t,p)},{depth:o.path.length,label:w(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),r&&(o.__exec.autoGrow=n)}const Fo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function $o(t,s){for(const o of Object.keys(t)){if(!Y(o)||Fo.has(o))continue;const n=Yo(o);if(n){zo(n,t,t[o]);continue}let r=t[o];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const e=r;r=function(i){return t.call(e,i)}}if(typeof r!="function")continue;const c=cs(o);Go.has(c)||Wo(fs(c),t,r)}Ms(t)}function Ms(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let n=!1;for(const d of Fo){const y=t[d];typeof y=="function"&&(o[d]=y,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let e=0,p=0,i=0,g=!1;const _=d=>{const y=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];y&&(e=y.clientX,p=y.clientY,i=Date.now(),g=!0)},f=d=>{if(!g)return;g=!1;const y=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!y)return;const a=y.clientX-e,h=y.clientY-p,u=Date.now()-i;if(u>c)return;const l=Math.abs(a),b=Math.abs(h);if(Math.max(l,b)<r)return;let x;if(l>b*1.2)x=a<0?"left":"right";else if(b>l*1.2)x=h<0?"up":"down";else return;const S="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),C=o[S],A=o.onSwipe;C&&C.call(t,d,t,t.state,t.context),A&&A.call(t,{direction:x,dx:a,dy:h,dt:u,event:d},t,t.state,t.context)};s.addEventListener("touchstart",_,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",_)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function ht(t,s){const o={...t};for(const n in s){const r=o[n],c=s[n];r&&c&&typeof r=="object"&&typeof c=="object"&&!Array.isArray(r)&&!Array.isArray(c)&&typeof r!="function"&&typeof c!="function"?o[n]=ht(r,c):o[n]=c}return o}function qt(t,s,o,n){if(!s||!t.node)return;const r=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",e=t.context?.document||globalThis.document,p=c?null:e?.createDocumentFragment();if(!c&&!p)return;const i=t.childProps,g=t.childrenAs,_=u=>{let l=s[u];const b=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let x=i;if(typeof i=="function")try{x=i(t,l)}catch{x=null}if(g==="state"){let C=b;(typeof b=="string"||typeof b=="number")&&(C={value:b,text:b}),l=x?{...x,state:C}:{state:C}}else x&&(l=ht(x,l));if(r&&!l.ignoreChildExtends)if(l.extends){const C=Array.isArray(l.extends)?l.extends:[l.extends],A=Array.isArray(r)?r:[r];l={...l,extends:[...A,...C]}}else l={...l,extends:r};const S=ho(l?.key,b,u);try{return Q(l,t,S,o)}catch(C){if(typeof console<"u"&&console.error){const A=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${S}" failed to construct at ${A} (initial render, skipping this row):`,C?.message||C)}return null}},f=t.__ref;if(!(n===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let u=0;u<s.length;u++){const l=_(u);!c&&l?.node&&p.appendChild(l.node)}return c||t.node.appendChild(p),!0}const y=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;to();let a=null;const h=u=>{if(f.__disposed||f.__childrenChunkGen!==y){a&&a.parentNode&&a.remove();return}for(let l=u;l<s.length;l++){const b=_(l);if(b?.node&&(a?t.node.insertBefore(b.node,a):p.appendChild(b.node)),l+1<s.length&&mt()){a||(a=e.createComment("smbls-mount"),p.appendChild(a),t.node.appendChild(p));const x=l+1;so(()=>h(x));return}}a?(a.remove(),t.node.tagName==="SELECT"&&Et(t,!0)):t.node.appendChild(p)};return h(0),oo(),!0}if(typeof s=="string"){const c=yo(s,t);if(Array.isArray(c))return qt(t,c,o,n)}if(typeof s=="object")for(const c in s){if(W.has(c))continue;let e=s[c];if(!(e==null||e===!1)){if((typeof e=="string"||typeof e=="number")&&(e={text:e}),t.childProps&&(e=ht(t.childProps,e)),r&&!e.ignoreChildExtends)if(e.extends){const p=Array.isArray(e.extends)?e.extends:[e.extends],i=Array.isArray(r)?r:[r];e={...e,extends:[...i,...p]}}else e={...e,extends:r};Q(e,t,c,o)}}}function Et(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const n=o.options;if(!n||!n.length)return;const r=t.__ref,c=r&&r.__exec&&r.__exec.value,e=typeof c=="function",p=t.value!=null&&typeof t.value!="function";if(e||p){let _;if(e)try{_=c(t,t.state,t.context)}catch{return}else _=t.value,typeof _=="string"&&_.includes("{{")&&(_=$.call(t,_,t.state));const f=_==null?"":String(_);o.value!==f&&(o.value=f);return}const i=s||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!i)return;let g=-1;for(let _=0;_<n.length;_++)n[_].defaultSelected&&(g=_);g>=0&&o.selectedIndex!==g&&(o.selectedIndex=g)}function Io(t,s){let{children:o,content:n}=t;const r=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(u){if(o=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,u?.message||u)}}t.children=o;const d=t.__ref;let y=!1;const a=P(t,t.childrenDeps,f),h=v(()=>{const u=y;y=!0;let l;try{l=a(t,t.state,t.context)}catch(L){if(typeof console<"u"&&console.error){const T=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${T}${u?"":" (initial tracking run)"}:`,L?.message||L)}return}if(!u||l===t.children)return;t.children=l,d.__childrenChunkGen!=null&&d.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",x=b?[]:null,S=b?[]:null,C=b?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const L=t.childProps,T=[],Z=new Map;for(let k=0;k<l.length;k++){const K=l[k];let j=L;if(typeof L=="function")try{j=L(t,K)}catch{j=null}const G=ho(j&&j.key,K,k);T.push(G),Z.set(G,{rawChild:K,childProps:j})}const yt=new Set(T),Bo=d.__children.slice();for(const k of Bo)if(!yt.has(k)){const K=t[k];K?.remove&&K.remove(),delete t[k],S&&S.push(k)}const st=t.childExtends,_t=t.tag==="fragment",Ko=t.context?.document||globalThis.document,nt=_t?null:Ko?.createDocumentFragment(),Pt=new Set;for(const k of T){const K=Z.get(k),j=K.rawChild,G=t[k];if(G&&G.state){if(j&&typeof j=="object"){const O=G.state,J=O.$replace||O.replace,Xt=O.$update||O.update;try{if(typeof J=="function")J.call(O,j);else if(typeof Xt=="function"){for(const B in O)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(j,B))try{O[B]=void 0}catch{}Xt.call(O,j)}else for(const B in j)O[B]=j[B]}catch(B){if(typeof console<"u"&&console.error){const Ho=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to patch at ${Ho} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}C&&C.push(k);continue}let Lt=j;(typeof j=="string"||typeof j=="number")&&(Lt={value:j,text:j});const Qt=K.childProps;let H=Qt?{...Qt,state:Lt}:{state:Lt};if(st&&!H.ignoreChildExtends)if(H.extends){const O=Array.isArray(H.extends)?H.extends:[H.extends],J=Array.isArray(st)?st:[st];H={...H,extends:[...J,...O]}}else H={...H,extends:st};let Ot;try{Ot=Q(H,t,k,s)}catch(O){if(typeof console<"u"&&console.error){const J=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${J} (reconcile, skipping this row):`,O?.message||O)}Pt.add(k);continue}!_t&&Ot?.node&&nt&&nt.appendChild(Ot.node),x&&x.push(k)}if(!_t&&nt&&nt.childNodes.length&&t.node&&t.node.appendChild(nt),!_t&&t.node){let k=null;for(const K of T){const j=t[K]?.node;if(!j)continue;const G=k?k.nextSibling:t.node.firstChild;j!==G&&t.node.insertBefore(j,G),k=j}}d.__children=Pt.size?T.filter(k=>!Pt.has(k)):T,b&&(x.length||S.length)&&po(t,{added:x,removed:S,kept:C}),Et(t,!1);return}const U=b?[...d.__children]:null;for(const L of[...d.__children]){const T=t[L];T?.remove&&T.remove(),delete t[L]}d.__children=[],qt(t,l,s),Et(t,!1),b&&po(t,{added:[...d.__children],removed:U,kept:[]})},{depth:d.path.length,label:w(d,"children")});d.__effects.push(h)}const c=qt(t,o,s,!0);if(n!=null&&!(n&&n.__ref)){let f=n;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=ht(t.childProps,f)),r&&!f.ignoreChildExtends)if(f.extends){const d=Array.isArray(f.extends)?f.extends:[f.extends],y=Array.isArray(r)?r:[r];f={...f,extends:[...y,...d]}}else f={...f,extends:r};Q(f,t,"content",s)}if(o&&!c)return;const e=t.context?.components||{};{const f=Object.keys(t);for(let d=0;d<f.length;d++){const y=f[d];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const a=y.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const h={extends:t[y]};delete t[y];for(let u=d+1;u<f.length;u++){const l=f[u],b=l.charCodeAt(0);if(b>=65&&b<=90||W.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const x=t[l];x!==void 0&&(h[l]=x,delete t[l])}t[a]&&typeof t[a]=="object"?t[a]={...h,...t[a]}:t[a]=h}}const p=s?.mountYield===!0||t.yieldChildren===!0,i=Object.keys(t),g=f=>{if(W.has(f)||typeof t[f]!="object"||t[f]===null)return;const d=f.charCodeAt(0);if(d<65||d>90)return;let y=t[f];if(!y.__ref){if(!y.extends&&!y.extend){const a=e[f]||e[`smbls.${f}`];a&&(y={...y,extends:a})}if(t.childProps&&(y=ht(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const a=Array.isArray(y.extends)?y.extends:[y.extends],h=Array.isArray(r)?r:[r];y={...y,extends:[...h,...a]}}else y={...y,extends:r};Q(y,t,f,s)}};if(!p){for(const f of i)g(f);return}to();const _=f=>{for(let d=f;d<i.length;d++)if(g(i[d]),d+1<i.length&&mt()){const y=d+1;so(()=>_(y));return}};_(0),oo()}function Uo(t,s,o){const{node:n}=t;if(!n)return;n.ref=t;const r=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(r){const e=r.parentNode;if(e){if(o?.position==="before"&&o.node)e.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const p=o.node.nextSibling;e.insertBefore(n,p||r)}else e.insertBefore(n,r);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const e=o.node.nextSibling;e?c.insertBefore(n,e):c.appendChild(n)}else c.appendChild(n)}const Zt=3;function Fs(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Zt?!1:(t.__inBeforeUpdate=!0,!0)}function Tt(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Zt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Zt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function F(t,s,o){const n=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&z(n,s,o);const r="on"+t,c=s[r];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(s.__ref[i])return!0;s.__ref[i]=!0}const g=s.context?.designSystem;g&&N(g);let _=!!i;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const d=s.__ref;return f.catch(y=>{s.context?.plugins?.length&&z("error",s,{hook:r,error:y})||console.error(`[DOMQL] Lifecycle "${r}" error:`,y)}).finally(()=>{i&&d&&(d[i]=!1)}),_=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&z("error",s,{hook:r,error:f})||console.error(`[DOMQL] Lifecycle "${r}" error:`,f),s.context?.strictMode)throw f}finally{g&&M(),_&&s.__ref&&(s.__ref[i]=!1)}}return!0}var dn=Q;export{Zt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Fs as acquireBeforeUpdateGuard,Q as create,dn as default,Ft as flushMounts,an as isStaticCssProp,un as recompileStaticCss,ln as reconcileAttrProp,Tt as releaseBeforeUpdateGuard,At as writeElementText};
@@ -0,0 +1 @@
1
+ const t=(o,i)=>i.split(" ").map(g=>o+"-"+g),a="top right bottom left",l=a+" block block-start block-end inline inline-start inline-end",e="start end",r="width style color",s=o=>t(o,l),p=(()=>{const o=t("border","width style color image");for(const i of l.split(" "))o.push("border-"+i,...t("border-"+i,r));return o})(),c=o=>[...t("border-"+o,r+" start end"),...t("border-"+o+"-start",r),...t("border-"+o+"-end",r)],n={animation:t("animation","name duration timing-function delay iteration-count direction fill-mode play-state timeline range range-start range-end"),background:t("background","image position position-x position-y size repeat origin clip attachment color"),border:p};for(const o of["width","style","color"])n["border-"+o]=l.split(" ").map(i=>"border-"+i+"-"+o);for(const o of a.split(" "))n["border-"+o]=t("border-"+o,r);n["border-block"]=c("block"),n["border-inline"]=c("inline"),Object.assign(n,{"border-image":t("border-image","source slice width outset repeat"),"border-radius":"top-left top-right bottom-right bottom-left start-start start-end end-start end-end".split(" ").map(o=>"border-"+o+"-radius"),columns:t("column","width count"),"column-rule":t("column-rule",r),container:t("container","name type"),"contain-intrinsic-size":t("contain-intrinsic","width height"),flex:t("flex","grow shrink basis"),"flex-flow":t("flex","direction wrap"),font:[...t("font","style variant weight stretch size"),"line-height",...t("font","family size-adjust kerning feature-settings variation-settings optical-sizing")],gap:["row-gap","column-gap"],grid:t("grid","template template-rows template-columns template-areas auto-rows auto-columns auto-flow"),"grid-template":t("grid-template","rows columns areas"),"grid-area":t("grid","row column row-start row-end column-start column-end"),"grid-row":t("grid-row",e),"grid-column":t("grid-column",e),inset:[...a.split(" "),...t("inset","block block-start block-end inline inline-start inline-end")],"inset-block":t("inset-block",e),"inset-inline":t("inset-inline",e),"list-style":t("list-style","type position image"),margin:s("margin"),"margin-block":t("margin-block",e),"margin-inline":t("margin-inline",e),mask:t("mask","image mode repeat position clip origin size composite"),offset:t("offset","position path distance rotate anchor"),outline:t("outline",r),overflow:t("overflow","x y"),"overscroll-behavior":t("overscroll-behavior","x y"),padding:s("padding"),"padding-block":t("padding-block",e),"padding-inline":t("padding-inline",e)});for(const o of["content","items","self"])n["place-"+o]=["align-"+o,"justify-"+o];Object.assign(n,{"scroll-margin":s("scroll-margin"),"scroll-padding":s("scroll-padding"),"text-decoration":t("text-decoration","line style color thickness"),"text-emphasis":t("text-emphasis","style color"),transition:t("transition","property duration timing-function delay behavior")});const d={};for(const o in n)for(const i of n[o])(d[i]||(d[i]=[])).push(o);export{d as CSS_LONGHAND_SHORTHANDS,n as CSS_SHORTHAND_LONGHANDS};
@@ -1 +1 @@
1
- import{update as p}from"./update.js";import{remove as g}from"./dispose.js";import{isLoudDevRuntime as l}from"./devRuntime.js";import"css-in-props";import{getDB as y,getQuery as m,getRootData as k,getRootState as w,getRoot as x,getRootContext as C,getContext as S,getPath as R,nextElement as v,previousElement as b,verbose as P,warn as A,error as D,variables as $,spotByPath as j}from"@symbo.ls/utils";import*as a from"@symbo.ls/utils";function i(t,e,o){const n=t?.context?.analyze;if(!n||!n.emit||e==="warn"&&!n.shouldCapture("warnings")||e==="error"&&!n.shouldCapture("errors"))return;const r=o.map(s=>s?.message||(typeof s=="string"?s:null)).filter(Boolean).join(" ");n.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:r||null,args:o})}const h=new Set;function _(t,e,o){const n=String(e);if(h.has(n))return;h.add(n);const r=t?.__ref?.path,s=Array.isArray(r)&&r.length?r.join("."):t?.key!=null?String(t.key):"(unknown element)",d=o!=null?`resolves to a non-function (${typeof o}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",u=`[smbls] el.call('${n}') at <${s}>: "${n}" ${d}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;i(t,"error",[u]),console.error(u)}function O(...t){return i(this,"warn",t),A.apply(this,t)}function L(...t){return i(this,"error",t),D.apply(this,t)}const f={update:p,remove:g,getDB:y,getQuery:m,getRootData:k,getPath:R,nextElement:v,previousElement:b,verbose:P,warn:O,error:L,variables:$,spotByPath:j,set(t,e){const o=this.__ref;if(o){if(o.__setLocked){o.__setQueued={content:t,options:e};return}o.__setLocked=!0}try{if(this.removeContent(),t!=null){const n=this.context?.__create;n&&n(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(o){o.__setLocked=!1;const n=o.__setQueued;n&&(o.__setQueued=null,this.set(n.content,n.options))}}},reset(t){const e=this.context?.__create;if(!e)return this;const o=this.parent,n=this.key,r=this.parse();return this.remove(),e(r,o,n,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){const e=this.__ref;if(!e?.__children)return null;for(const o of e.__children){const n=this[o];if(!n)continue;if(typeof t=="function"){if(t(n))return n}else if(typeof t=="string"&&n.key===t)return n;const r=n.lookdown?.(t);if(r)return r}return null},lookdownAll(t,e=[]){const o=this.__ref;if(!o?.__children)return e;for(const n of o.__children){const r=this[n];r&&(typeof t=="function"?t(r)&&e.push(r):typeof t=="string"&&r.key===t&&e.push(r),r.lookdownAll?.(t,e))}return e},getRef(t){return t?this.__ref&&this.__ref[t]:this.__ref},getChildren(){const t=this.__ref&&this.__ref.__children;return Array.isArray(t)?t.map(e=>this[e]):[]},getRoot:x,getRootState:w,getRootContext:C,getContext:S,parse(t){const e={},o=t?new Set(t):null,n=this.__ref?.__exec;for(const r in this)if(!(r==="parent"||r==="node"||r==="__ref")&&!o?.has(r)){if(n&&n[r]!==void 0){e[r]=n[r];continue}typeof this[r]!="function"&&(e[r]=this[r])}return e},parseDeep(t){const e=this.parse(t),o=this.__ref;if(o?.__children)for(const n of o.__children)this[n]?.parseDeep&&(e[n]=this[n].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){const e={};for(const o of t)e[o]=this[o];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(const e in t){const o=t[e];if(o==null)continue;const n=e.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()),r=String(o).replace(/\s*!important\s*$/,"");this.node.style.setProperty(n,r,"important")}},call(t,...e){const o=this.context,n=o?.methods?.[t]||o?.functions?.[t]||o?.utils?.[t]||this[t];if(typeof n=="function"){const r=a.isFailedRevival;if(!r||!r(n))return n.call(this,...e);l()&&_(this,t,a.getFunctionSource(n));return}l()&&_(this,t,n)},removeContent(){const t=this.__ref;if(!t?.__children)return;const e=this.content;if(e?.remove){e.remove(),delete this.content;const o=t.__children.indexOf("content");o!==-1&&t.__children.splice(o,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},c=new WeakMap;function E(t){if(!t)return f;let e=c.get(t);if(e)return e;e=Object.create(f);const o=t.methods;if(o)for(const n in o)e[n]=o[n];return c.set(t,e),e}function T(t){const e=E(t.context);Object.setPrototypeOf(t,e)}function q(t){if(!t)return!1;const e=c.get(t);if(!e)return!1;const o=t.methods;if(!o)return!1;for(const n in o)e[n]=o[n];return!0}export{T as addMethods,f as elementProto,q as refreshContextProto};
1
+ import{update as k}from"./update.js";import{remove as m}from"./dispose.js";import{isLoudDevRuntime as f}from"./devRuntime.js";import"css-in-props";import{getDB as S,getQuery as x,getRootData as C,getRootState as R,getRoot as b,getRootContext as v,getContext as P,getPath as O,nextElement as D,previousElement as E,verbose as $,warn as A,error as j,variables as W,spotByPath as L}from"@symbo.ls/utils";import*as c from"@symbo.ls/utils";function l(t,e,n){const o=t?.context?.analyze;if(!o||!o.emit||e==="warn"&&!o.shouldCapture("warnings")||e==="error"&&!o.shouldCapture("errors"))return;const r=n.map(s=>s?.message||(typeof s=="string"?s:null)).filter(Boolean).join(" ");o.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:r||null,args:n})}const _=new Set;function d(t,e,n){const o=String(e);if(_.has(o))return;_.add(o);const r=t?.__ref?.path,s=Array.isArray(r)&&r.length?r.join("."):t?.key!=null?String(t.key):"(unknown element)",w=n!=null?`resolves to a non-function (${typeof n}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",h=`[smbls] el.call('${o}') at <${s}>: "${o}" ${w}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;l(t,"error",[h]),console.error(h)}const p=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),M=new Set,g=t=>p(i,t)&&!(c.ELEMENT_METHOD_OVERRIDE_POINTS||M).has(t),u=new Set,H=()=>{u.clear()};function y(t,e){u.has(t)||(u.add(t),f()&&console.warn(`[smbls] ${e}: context.methods.${t} is named like a built-in element method and is not the app's own override (it was not on the element prototype when it was built) \u2014 ignored; the built-in keeps winning. Declare an intentional override in the app's OWN methods.`))}function T(...t){return l(this,"warn",t),A.apply(this,t)}function B(...t){return l(this,"error",t),j.apply(this,t)}const i={update:k,remove:m,getDB:S,getQuery:x,getRootData:C,getPath:O,nextElement:D,previousElement:E,verbose:$,warn:T,error:B,variables:W,spotByPath:L,set(t,e){const n=this.__ref;if(n){if(n.__setLocked){n.__setQueued={content:t,options:e};return}n.__setLocked=!0}try{if(this.removeContent(),t!=null){const o=this.context?.__create;o&&o(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(n){n.__setLocked=!1;const o=n.__setQueued;o&&(n.__setQueued=null,this.set(o.content,o.options))}}},reset(t){const e=this.context?.__create;if(!e)return this;const n=this.parent,o=this.key,r=this.parse();return this.remove(),e(r,n,o,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){const e=this.__ref;if(!e?.__children)return null;for(const n of e.__children){const o=this[n];if(!o)continue;if(typeof t=="function"){if(t(o))return o}else if(typeof t=="string"&&o.key===t)return o;const r=o.lookdown?.(t);if(r)return r}return null},lookdownAll(t,e=[]){const n=this.__ref;if(!n?.__children)return e;for(const o of n.__children){const r=this[o];r&&(typeof t=="function"?t(r)&&e.push(r):typeof t=="string"&&r.key===t&&e.push(r),r.lookdownAll?.(t,e))}return e},getRef(t){return t?this.__ref&&this.__ref[t]:this.__ref},getChildren(){const t=this.__ref&&this.__ref.__children;return Array.isArray(t)?t.map(e=>this[e]):[]},getRoot:b,getRootState:R,getRootContext:v,getContext:P,parse(t){const e={},n=t?new Set(t):null,o=this.__ref?.__exec;for(const r in this)if(!(r==="parent"||r==="node"||r==="__ref")&&!n?.has(r)){if(o&&o[r]!==void 0){e[r]=o[r];continue}typeof this[r]!="function"&&(e[r]=this[r])}return e},parseDeep(t){const e=this.parse(t),n=this.__ref;if(n?.__children)for(const o of n.__children)this[o]?.parseDeep&&(e[o]=this[o].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){const e={};for(const n of t)e[n]=this[n];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(const e in t){const n=t[e];if(n==null)continue;const o=e.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()),r=String(n).replace(/\s*!important\s*$/,"");this.node.style.setProperty(o,r,"important")}},call(t,...e){const n=this.context,o=g(t);o&&n?.methods?.[t]&&n.methods[t]!==this[t]&&y(t,"el.call");const r=o?this[t]:n?.methods?.[t]||n?.functions?.[t]||n?.utils?.[t]||this[t];if(typeof r=="function"){const s=c.isFailedRevival;if(!s||!s(r))return r.call(this,...e);f()&&d(this,t,c.getFunctionSource(r));return}f()&&d(this,t,r)},removeContent(){const t=this.__ref;if(!t?.__children)return;const e=this.content;if(e?.remove){e.remove(),delete this.content;const n=t.__children.indexOf("content");n!==-1&&t.__children.splice(n,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},a=new WeakMap;function F(t){if(!t)return i;let e=a.get(t);if(e)return e;e=Object.create(i);const n=t.methods;if(n)for(const o in n)e[o]=n[o];return a.set(t,e),e}function U(t){const e=F(t.context);Object.setPrototypeOf(t,e)}function Y(t){if(!t)return!1;const e=a.get(t);if(!e)return!1;const n=t.methods;if(!n)return!1;for(const o in n){if(g(o)&&!p(e,o)){y(o,"refreshContextProto");continue}e[o]=n[o]}return!0}export{H as __resetFoldShadowWarnings,U as addMethods,i as elementProto,Y as refreshContextProto};
@@ -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","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};
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","allowRuntimeTemplates","__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};
@@ -1 +1 @@
1
- import{batch as h,isStore as y}from"@symbo.ls/signal";import{REGISTRY as _}from"./registry.js";import{create as x,acquireBeforeUpdateGuard as p,releaseBeforeUpdateGuard as s,writeElementText as b,reconcileAttrProp as g}from"./create.js";import{runPluginHook as d}from"@symbo.ls/utils/function.js";import{serializeAttrValue as A,isEnumeratedTrueFalseAttr as U}from"attrs-in-props";function v(n={},r={}){const e=this,i=e.__ref;if(!i)return;if((typeof n=="string"||typeof n=="number")&&(n={text:n}),!r.preventListeners&&typeof e.onBeforeUpdate=="function"&&p(i))try{const t=e.onBeforeUpdate(e,e.state,e.context,r);if(t&&typeof t.then=="function")t.then(()=>s(i,!1),o=>{s(i,!0),e.context?.plugins?.length&&d("error",e,{hook:"onBeforeUpdate",error:o})||console.error("[DOMQL] onBeforeUpdate error:",o)});else if(s(i,!1),t===!1)return e}catch(t){throw s(i,!0),t}const u=!n||Object.keys(n).length===0,l=[];h(()=>{if(n.state&&y(e.state)&&e.state.$update(n.state),n.text!==void 0&&(e.text=n.text,!i.__exec.text&&e.node&&b(e,n.text??"")),n.html!==void 0&&(e.html=n.html,!i.__exec.html&&e.node&&(e.node.innerHTML=n.html)),n.style&&e.node?.style){if(!i.__exec.style)for(const t in n.style){const o=n.style[t];if(o==null)continue;const f=t.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),c=String(o).replace(/\s*!important\s*$/,"");e.node.style.setProperty(f,c,"important")}e.style||(e.style={}),Object.assign(e.style,n.style)}if(n.attr&&e.node?.setAttribute){for(const t in n.attr){const o=n.attr[t];o==null||o===!1&&!U(t)?e.node.removeAttribute(t):typeof o!="function"&&typeof o!="object"&&e.node.setAttribute(t,A(t,o))}e.attr||(e.attr={}),Object.assign(e.attr,n.attr)}if(n.data&&e.node?.dataset){for(const t in n.data)e.node.dataset[t]=n.data[t];e.data||(e.data={}),Object.assign(e.data,n.data)}for(const t in n){if(_.has(t)||t==="state")continue;const o=n[t],f=e[t];if(f&&f.__ref&&typeof f.update=="function")f.update(o,r);else if(typeof o=="object"&&o!==null){const c=t.charCodeAt(0);c>=65&&c<=90&&x(o,e,t,r)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=o,typeof o!="function"&&l.push(t))}});for(let t=0;t<l.length;t++)g(e,l[t]);if(e.node&&u&&i.__effects&&i.__effects.length)for(let t=0;t<i.__effects.length;t++){const o=i.__effects[t];o&&!o._disposed&&!o._isSubscribeToEffect&&typeof o._execute=="function"&&o._execute()}else if(e.node&&i.__conditionalRunners)for(const t of i.__conditionalRunners)t();return d("update",e),!r.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,r),e}var L=v;export{L as default,v as update};
1
+ import{batch as h,isStore as y}from"@symbo.ls/signal";import{REGISTRY as _}from"./registry.js";import{create as p,acquireBeforeUpdateGuard as x,releaseBeforeUpdateGuard as l,writeElementText as b,reconcileAttrProp as g,isStaticCssProp as A,recompileStaticCss as P}from"./create.js";import{runPluginHook as d}from"@symbo.ls/utils/function.js";import{serializeAttrValue as U,isEnumeratedTrueFalseAttr as v}from"attrs-in-props";function j(o={},r={}){const e=this,i=e.__ref;if(!i)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!r.preventListeners&&typeof e.onBeforeUpdate=="function"&&x(i))try{const t=e.onBeforeUpdate(e,e.state,e.context,r);if(t&&typeof t.then=="function")t.then(()=>l(i,!1),n=>{l(i,!0),e.context?.plugins?.length&&d("error",e,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if(l(i,!1),t===!1)return e}catch(t){throw l(i,!0),t}const u=!o||Object.keys(o).length===0,c=[];h(()=>{if(o.state&&y(e.state)&&e.state.$update(o.state),o.text!==void 0&&(e.text=o.text,!i.__exec.text&&e.node&&b(e,o.text??"")),o.html!==void 0&&(e.html=o.html,!i.__exec.html&&e.node&&(e.node.innerHTML=o.html)),o.style&&e.node?.style){if(!i.__exec.style)for(const t in o.style){const n=o.style[t];if(n==null)continue;const f=t.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),s=String(n).replace(/\s*!important\s*$/,"");e.node.style.setProperty(f,s,"important")}e.style||(e.style={}),Object.assign(e.style,o.style)}if(o.attr&&e.node?.setAttribute){for(const t in o.attr){const n=o.attr[t];n==null||n===!1&&!v(t)?e.node.removeAttribute(t):typeof n!="function"&&typeof n!="object"&&e.node.setAttribute(t,U(t,n))}e.attr||(e.attr={}),Object.assign(e.attr,o.attr)}if(o.data&&e.node?.dataset){for(const t in o.data)e.node.dataset[t]=o.data[t];e.data||(e.data={}),Object.assign(e.data,o.data)}for(const t in o){if(_.has(t)||t==="state")continue;const n=o[t],f=e[t];if(f&&f.__ref&&typeof f.update=="function")f.update(n,r);else if(typeof n=="object"&&n!==null){const s=t.charCodeAt(0);s>=65&&s<=90&&p(n,e,t,r)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=n,typeof n!="function"&&c.push(t))}});for(let t=0;t<c.length;t++)g(e,c[t]);if(e.node){for(let t=0;t<c.length;t++)if(A(c[t])){P(e);break}}if(e.node&&u&&i.__effects&&i.__effects.length)for(let t=0;t<i.__effects.length;t++){const n=i.__effects[t];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(e.node&&i.__conditionalRunners)for(const t of i.__conditionalRunners)t();return d("update",e),!r.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,r),e}var L=j;export{L as default,j as update};
@@ -1 +1 @@
1
- const o="3.14.789";export{o as VERSION};
1
+ const o="3.14.791";export{o as VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.789",
3
+ "version": "3.14.791",
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",