@symbo.ls/element 3.14.780 → 3.14.782

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.
@@ -1,6 +1,6 @@
1
- "use strict";var yt=Object.defineProperty;var Xt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var to=(t,n)=>{for(var s in n)yt(t,s,{get:n[s],enumerable:!0})},oo=(t,n,s,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Jt(n))!mt.call(t,r)&&r!==s&&yt(t,r,{get:()=>n[r],enumerable:!(e=Xt(n,r))||e.enumerable});return t};var so=t=>oo(yt({},"__esModule",{value:!0}),t);var Do={};to(Do,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>ut,acquireBeforeUpdateGuard:()=>qt,create:()=>K,default:()=>Po,flushMounts:()=>ft,releaseBeforeUpdateGuard:()=>it,writeElementText:()=>rt});module.exports=so(Do);var L=require("@symbo.ls/signal"),w=require("@symbo.ls/signal"),G=require("./cache.js"),N=require("./registry.js"),X=require("./delegate.js"),zt=require("./extends.js"),Yt=require("./methods.js"),Mo=require("./dispose.js"),et=require("./devRuntime.js"),at=require("@symbo.ls/utils"),U=require("@symbo.ls/utils/function.js"),Z=require("@symbo.ls/state"),b=require("css-in-props"),V=require("@symbo.ls/css"),A=require("@symbo.ls/scratch"),v=require("attrs-in-props");let no=1;const tt=[];let ht=!1;function Tt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function eo(){return typeof document<"u"&&document.visibilityState==="hidden"}const ro=250;function Pt(){if(!ht){if(ht=!0,typeof requestAnimationFrame!="function"){setTimeout(ft,0);return}eo()?setTimeout(ft,ro):requestAnimationFrame(ft)}}const io=300,co=15e4;function ft(){if(ht=!1,!tt.length)return;const t=tt.splice(0,tt.length);for(let n=0;n<t.length;n++){const s=t[n];if(s.node){if(!s.node.isConnected){const e=s.__ref||(s.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=Tt());const r=Tt()-e.__mountFirstAttemptAt;e.__mountAttempts<=io&&r<co?(tt.push(s),Pt()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}B("Mounted",s,s.__ref?.__mountOptions||{})}}}function Dt(t,n){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=n,tt.push(t),Pt())}function Lt(t,n){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,U.runPluginHook)("contentUpdate",t,n);const s=t.context?.designSystem;s&&(0,A.pushConfig)(s);try{t.onContentUpdate(t,t.state,t.context,n)}catch(e){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{s&&(0,A.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function ao(t){return t.charAt(2).toLowerCase()+t.slice(3)}function fo(t){return t.toLowerCase()}function _t(t){const n=t.charCodeAt(0);return n===58||n===64||n===38}function ot(t,n){const s={...t};for(const e in n){const r=s[e],o=n[e];r&&o&&typeof r=="object"&&typeof o=="object"&&!Array.isArray(r)&&!Array.isArray(o)&&typeof r!="function"&&typeof o!="function"?s[e]=ot(r,o):s[e]=o}return s}function K(t,n,s,e={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=s||t.key||`_${no++}`,o.parent=n||null,o.context=t.context||n?.context||e.context||{},o.context.__create||(o.context.__create=K);const c=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:n?.__ref?.root||o,path:n?.__ref?.path?[...n.__ref.path,o.key]:[o.key],origin:t};if(s&&!t.extends&&!t.extend){const d=s.indexOf("_");if(d>0){const p=s.substring(0,d),g=o.context?.components;g&&(g[p]||g["smbls."+p])?t={...t,extends:p}:g&&(0,et.isLoudDevRuntime)()&&/^[A-Z]\w*_\d+$/.test(s)&&console.warn(`[smbls] auto-extend: key "${s}" looks like a multi-instance (${p}_N) but neither "${p}" nor "smbls.${p}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,zt.applyExtends)(o,t,e);const i=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(const d in t){if(d==="parent"||d==="node"||d==="__ref"||d==="extends"||d==="context"||d==="props")continue;const p=t[d],g=o[d],k=g&&p&&typeof g=="object"&&typeof p=="object"&&!Array.isArray(g)&&!Array.isArray(p)&&typeof g!="function"&&typeof p!="function";k&&d.charCodeAt(0)>=65&&d.charCodeAt(0)<=90?o[d]=ot(g,p):k&&i.has(d)?o[d]={...g,...p}:k&&_t(d)?o[d]=ot(g,p):o[d]=p}function f(d){for(const p in d){const g=d[p],k=o[p],x=k&&g&&typeof k=="object"&&typeof g=="object"&&!Array.isArray(k)&&!Array.isArray(g)&&typeof k!="function"&&typeof g!="function";x&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?o[p]=ot(k,g):x&&i.has(p)?o[p]={...k,...g}:x&&_t(p)?o[p]=ot(k,g):o[p]=g}}a&&f(a),t.props&&typeof t.props=="object"&&f(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const u=o.scope&&typeof o.scope=="object"?o.scope:null,l=n?.scope,y=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,h=l||y||null;if(t.scope!==void 0||u){const d={};u&&Object.assign(d,u),t.scope!==void 0&&Object.assign(d,t.scope),o.scope=(0,L.createScopeStore)(d,h)}else h&&(o.scope=h);if(t.if!==void 0&&(o.if=t.if),(0,Yt.addMethods)(o),uo(o,n,t),o.if!=null){let d;if(typeof o.if=="function")try{d=o.if(o,o.state,o.context)}catch(p){if(d=!1,c.__ifError=p,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,p?.message||p)}}else d=o.if;c.__if=!!d}if(c.__if)typeof o.if=="function"&&(c.__ifInitialized=!0);else return n&&(n[o.key]=o),typeof o.if=="function"&&Rt(o,c,o.if),o;o.tag||(o.tag=(0,G.detectTag)(o)),B("Init",o,e);const _=o.node=(0,G.cacheNode)(o);if(!_)return o;if(o.tag==="fragment"){const p=(o.context?.document||globalThis.document).createComment("");_.appendChild(p),c.__fragmentAnchor=p}B("AttachNode",o,e),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),n&&(n[o.key]=o,n.__ref?.__children&&(n.__ref.__children.includes(o.key)||n.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Ht(o,e),$t(o),bt(o),Kt(o),Eo(o);try{Gt(o,e)}catch(d){if(typeof console<"u"&&console.error){const p=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${p}:`,d?.message||d,d?.stack?`
1
+ "use strict";var _t=Object.defineProperty;var ro=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames;var co=Object.prototype.hasOwnProperty;var ao=(t,e)=>{for(var s in e)_t(t,s,{get:e[s],enumerable:!0})},fo=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of io(e))!co.call(t,r)&&r!==s&&_t(t,r,{get:()=>e[r],enumerable:!(n=ro(e,r))||n.enumerable});return t};var uo=t=>fo(_t({},"__esModule",{value:!0}),t);var No={};ao(No,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>lt,acquireBeforeUpdateGuard:()=>to,create:()=>V,default:()=>Ro,flushMounts:()=>dt,releaseBeforeUpdateGuard:()=>ft,writeElementText:()=>at});module.exports=uo(No);var D=require("@symbo.ls/signal"),w=require("@symbo.ls/signal"),Y=require("./cache.js"),F=require("./registry.js"),tt=require("./delegate.js"),Qt=require("./extends.js"),Xt=require("./methods.js"),Bo=require("./dispose.js"),ct=require("./devRuntime.js"),W=require("./mountScheduler.js"),G=require("@symbo.ls/utils"),U=require("@symbo.ls/utils/function.js"),m=require("@symbo.ls/state"),A=require("css-in-props"),H=require("@symbo.ls/css"),k=require("@symbo.ls/scratch"),v=require("attrs-in-props"),Jt=require("./engineRegistry.js"),mt=require("./version.js");const Ot=(0,Jt.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},mt.VERSION),et=[];let gt=!1;function Lt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function lo(){return typeof document<"u"&&document.visibilityState==="hidden"}const po=250;function $t(){if(!gt){if(gt=!0,typeof requestAnimationFrame!="function"){setTimeout(dt,0);return}lo()?setTimeout(dt,po):requestAnimationFrame(dt)}}const yo=300,ho=15e4;function dt(){if(gt=!1,!et.length)return;const t=et.splice(0,et.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=Lt());const r=Lt()-n.__mountFirstAttemptAt;n.__mountAttempts<=yo&&r<ho?(et.push(s),$t()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}K("Mounted",s,s.__ref?.__mountOptions||{})}}}function Mt(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,et.push(t),$t())}function Rt(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,U.runPluginHook)("contentUpdate",t,e);const s=t.context?.designSystem;s&&(0,k.pushConfig)(s);try{t.onContentUpdate(t,t.state,t.context,e)}catch(n){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&(0,k.popConfig)()}}function Q(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function _o(t){return t.charAt(2).toLowerCase()+t.slice(3)}function go(t){return t.toLowerCase()}function bt(t){const e=t.charCodeAt(0);return e===58||e===64||e===38}function nt(t,e){const s={...t};for(const n in e){const r=s[n],o=e[n];r&&o&&typeof r=="object"&&typeof o=="object"&&!Array.isArray(r)&&!Array.isArray(o)&&typeof r!="function"&&typeof o!="function"?s[n]=nt(r,o):s[n]=o}return s}function V(t,e,s,n={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=s||t.key||`_${Ot.uniqId++}`,o.parent=e||null,o.context=t.context||e?.context||n.context||{},o.context.__create||(o.context.__create=V);const i=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 d=s.indexOf("_"),y=s.indexOf(".");let g=d>0?d:-1;if(y>0&&(g<0||y<g)&&(g=y),g>0){const b=s.substring(0,g),x=o.context?.components;x&&(x[b]||x["smbls."+b])?t={...t,extends:b}:x&&(0,ct.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,Qt.applyExtends)(o,t,n);const c=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(const d in t){if(d==="parent"||d==="node"||d==="__ref"||d==="extends"||d==="context"||d==="props")continue;const y=t[d],g=o[d],b=g&&y&&typeof g=="object"&&typeof y=="object"&&!Array.isArray(g)&&!Array.isArray(y)&&typeof g!="function"&&typeof y!="function";b&&d.charCodeAt(0)>=65&&d.charCodeAt(0)<=90?o[d]=nt(g,y):b&&c.has(d)?o[d]={...g,...y}:b&&bt(d)?o[d]=nt(g,y):o[d]=y}function l(d){for(const y in d){const g=d[y],b=o[y],x=b&&g&&typeof b=="object"&&typeof g=="object"&&!Array.isArray(b)&&!Array.isArray(g)&&typeof b!="function"&&typeof g!="function";x&&y.charCodeAt(0)>=65&&y.charCodeAt(0)<=90?o[y]=nt(b,g):x&&c.has(y)?o[y]={...b,...g}:x&&bt(y)?o[y]=nt(b,g):o[y]=g}}a&&l(a),t.props&&typeof t.props=="object"&&l(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const u=o.scope&&typeof o.scope=="object"?o.scope:null,f=e?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,h=f||p||null;if(t.scope!==void 0||u){const d={};u&&Object.assign(d,u),t.scope!==void 0&&Object.assign(d,t.scope),o.scope=(0,D.createScopeStore)(d,h)}else h&&(o.scope=h);if(t.if!==void 0&&(o.if=t.if),(0,Xt.addMethods)(o),bo(o,e,t),o.if!=null){let d;if(typeof o.if=="function")try{d=o.if(o,o.state,o.context)}catch(y){if(d=!1,i.__ifError=y,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,y?.message||y)}}else d=o.if;i.__if=!!d}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&Ut(o,i,o.if),o;o.tag||(o.tag=(0,Y.detectTag)(o)),K("Init",o,n);const _=o.node=(0,Y.cacheNode)(o);if(!_)return o;if(o.tag==="fragment"){const y=(o.context?.document||globalThis.document).createComment("");_.appendChild(y),i.__fragmentAnchor=y}K("AttachNode",o,n),_.setAttribute&&o.key&&_.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))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Yt(o,n),Ft(o),At(o),Wt(o),$o(o);try{qt(o,n)}catch(d){if(typeof console<"u"&&console.error){const y=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${y}:`,d?.message||d,d?.stack?`
2
2
  `+d.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(wt(o,!0),Wt(o,n,r),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const d=o.context?.designSystem;d&&(0,A.pushConfig)(d);try{const p=o.html(o,o.state,o.context);p!=null&&typeof p!="function"&&(o.node.innerHTML=p)}catch{}finally{d&&(0,A.popConfig)()}}if(B("Create",o,e),B("Complete",o,e),B("Render",o,e),B("RenderRouter",o,e),Dt(o,e),typeof o.onFrame=="function"){const d=o.onFrame,p=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){p&&(0,A.pushConfig)(p);try{d(o,o.state,o.context)}catch(k){console.error("[DOMQL] onFrame error:",k)}finally{p&&(0,A.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function uo(t,n,s){const e=!n,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,o=e&&r&&t.context?.state,c=s.state!==void 0&&!o?s.state:t.state&&!(0,L.isStore)(t.state)?t.state:void 0;if(c==null){if(n?.state)t.state=n.state,(0,Z.applyStateMethods)(t,t.state);else if(t.context?.state){const i=t.context.state,a={...i},f=t.context?.polyglot;if(f?.translations){const u=i.lang||f.defaultLang||"en",l=f.translations[u];if(l&&typeof l=="object")for(const h in l)a[h]===void 0&&(a[h]=l[h]);const y=new Set(f.languages||[]);for(const h in f.translations)!y.has(h)&&a[h]===void 0&&(a[h]=f.translations[h])}t.state=(0,L.isStore)(a)?a:(0,L.createStore)(a),t.state.__element=t,t.state.root=t.state,(0,Z.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,Z.applyStateMethods)(t,t.state);return}if(typeof c=="string"){if(t.state=Ot(c,n),t.state&&typeof t.state=="object"&&!(0,L.isStore)(t.state)){const i=n?.state?.root||n?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}(0,Z.applyStateMethods)(t,t.state);return}if(typeof c=="function"){const i=c(t,n?.state);t.state=(0,L.isStore)(i)?i:(0,L.createStore)(i||{})}else(0,L.isStore)(c)?t.state=c:t.state=(0,L.createStore)({...c});t.state.__element=t,n?.state?(t.state.parent=n.state,t.state.root=n.state.root||n.state):t.state.root=t.state,(0,Z.applyStateMethods)(t,t.state)}function gt(t,n){if(!n)return t;const s=n.split("/");let e=t;for(const r of s){if(e==null)return{};e=e[r]}return e??{}}function Ot(t,n){if(!n)return{};if(t===".")return n.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?gt(n.state,r):n.state??{}}if(t.startsWith("~/")){const r=n.state?.root||n.state,o=t.slice(2);return o?gt(r,o):r??{}}if(n.state?.[t]!==void 0)return n.state[t];const s=gt(n.state,t);if(s!=null&&Object.keys(s).length>0)return s;const e=n.context?.polyglot;if(e?.translations){const r=n.state?.root?.lang||e.defaultLang||"en",o=e.translations[r];if(o?.[t]!==void 0)return o[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const lo=new Set(["s","state","ctx","context"]);function po(t){try{const s=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function yo(t){if(typeof t!="function"||t.length!==2)return!1;const n=po(t);if(n.length<2)return!1;const s=n[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!lo.has(s)}function ho(t){const n=t.__ref,s=t.tag||"div",e=t.context?.designSystem,r=[],o=Object.keys(t);for(let c=0;c<o.length;c++){const i=o[c];if(typeof t[i]!="function"||N.REGISTRY.has(i))continue;const a=i.charCodeAt(0);a>=65&&a<=90||Y(i)||b.CSS_PROPS_REGISTRY[i]||b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(i)||(0,v.checkAttributeByTagName)(s,i)||((0,et.isLoudDevRuntime)()&&yo(t[i])&&console.warn(`[smbls] custom prop "${i}"${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('${i}', \u2026) instead of reading el.${i}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:i,fn:t[i]}))}for(let c=0;c<r.length;c++){const{prop:i,fn:a}=r[c];n.__exec[i]=a,Object.defineProperty(t,i,{get(){e&&(0,A.pushConfig)(e);try{return a(t,t.state,t.context)}catch{return}finally{e&&(0,A.popConfig)()}},set(f){delete n.__exec[i],Object.defineProperty(t,i,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function _o(t,n){if(!(!Array.isArray(n)||n.length===0))for(let s=0;s<n.length;s++){const e=n[s];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function D(t,n,s){return!Array.isArray(n)||n.length===0?s:function(...e){return _o(t,n),s.apply(this,e)}}function st(t,n){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[n]}function j(t,n){return()=>t.path.join(".")+"::"+n}function $t(t,n){const s=t.__ref,e=!!(n&&n.skipIfEffect);if(ho(t),typeof t.text=="function"){const o=t.text,c=D(t,t.textDeps,o),i=(0,w.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=at.replaceLiteralsWithObjectFields.call(t,a,t.state)),rt(t,a))}catch{}},{depth:s.path.length,label:j(s,"text")});s.__effects.push(i),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,c=(0,w.createEffect)(()=>{if(s.contentManaged)return;const i=at.replaceLiteralsWithObjectFields.call(t,o,t.state);i!=null&&(t.text=i),t.node&&rt(t,i??"")},{depth:s.path.length,label:j(s,"text")});s.__effects.push(c),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!N.REGISTRY.has(o)&&!Y(o)&&!s.__exec[o]){if(b.CSS_PROPS_REGISTRY[o]){const c=t[o],i=D(t,t[o+"Deps"],c),a=o;let f;const u=(0,w.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,A.pushConfig)(l);try{const y=i(t,t.state,t.context),h=b.CSS_PROPS_REGISTRY[a](y,t,t.state,t.context),_=a==="show"||a==="hide";if(h&&t.node){const d=xt(h),p=_&&t.node.style.display!=="none";(d===null||d!==f||p)&&(f=d,q(t.node,h))}else if(t.node&&_){f=void 0;const d=s.__explicitDisplay;t.node.style.display=typeof d=="string"?d:""}}finally{l&&(0,A.popConfig)()}},{depth:s.path.length,label:j(s,a)});s.__effects.push(u),s.__exec[o]=c}else if(b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const c=t[o],i=D(t,t[o+"Deps"],c),a=o;let f;const u=(0,w.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,A.pushConfig)(l);try{const y=i(t,t.state,t.context);if(t.node)if(y!=null){const h=a+":"+String(y);h!==f&&(f=h,q(t.node,{[a]:y}))}else f=void 0,t.node.style[a]=""}finally{l&&(0,A.popConfig)()}},{depth:s.path.length,label:j(s,a)});s.__effects.push(u),s.__exec[o]=c}}if(typeof t.html=="function"){const o=t.html,c=D(t,t.htmlDeps,o),i=(0,w.createEffect)(()=>{const a=t.context?.designSystem;a&&(0,A.pushConfig)(a);try{const f=c(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&(t.node.innerHTML=f)}finally{a&&(0,A.popConfig)()}},{depth:s.path.length,label:j(s,"html")});s.__effects.push(i),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,c=D(t,t.valueDeps,o),i=(0,w.createEffect)(()=>{try{const a=c(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const f=a==null?"":String(a);if(t.node.value===f)return;const u=typeof document<"u"&&document.activeElement===t.node,l=u&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,y=u&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=f,u&&l!=null&&y!=null)try{t.node.setSelectionRange(l,y)}catch{}}catch{}},{depth:s.path.length,label:j(s,"value")});s.__effects.push(i),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,c=D(t,t.styleDeps,o);let i;const a=(0,w.createEffect)(()=>{const f=c(t,t.state,t.context),u=xt(f);(u===null||u!==i)&&(i=u,q(t.node,f))},{depth:s.path.length,label:j(s,"style")});s.__effects.push(a),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 i=D(t,st(t.styleDeps,o),c);let a;const f=(0,w.createEffect)(()=>{try{const u=i(t,t.state,t.context);if(t.node){const l=o+":"+String(u);l!==a&&(a=l,q(t.node,{[o]:u}))}}catch{}},{depth:s.path.length,label:j(s,"style."+o)});s.__effects.push(f)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const c=D(t,st(t.attrDeps,o),t.attr[o]),i=o,a=(0,w.createEffect)(()=>{try{const f=c(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1&&!(0,v.isEnumeratedTrueFalseAttr)(i)?t.node.removeAttribute(i):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(i,(0,v.serializeAttrValue)(i,f)))}catch{}},{depth:s.path.length,label:j(s,"attr."+i)});s.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const c=D(t,st(t.ariaDeps,o),t.aria[o]),i="aria-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),a=(0,w.createEffect)(()=>{try{const f=c(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null?t.node.removeAttribute(i):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(i,(0,v.serializeAttrValue)(i,f))}catch{}},{depth:s.path.length,label:j(s,"aria."+o)});s.__effects.push(a)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const c=D(t,st(t.dataDeps,o),t.data[o]),a="data-"+o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),f=(0,w.createEffect)(()=>{try{const u=c(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(a):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(a,u===!0?"":u)}catch{}},{depth:s.path.length,label:j(s,"data."+o)});s.__effects.push(f)}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,st(t.classDeps,o),r[o]),i=(0,w.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{}},{depth:s.path.length,label:j(s,"class."+o)});s.__effects.push(i)}!e&&typeof t.if=="function"&&Rt(t,s,t.if);for(const o of Object.keys(t)){if(N.REGISTRY.has(o)||typeof t[o]!="function")continue;const c=o.charCodeAt(0);if(c>=65&&c<=90||Y(o))continue;const i=t[o];s.__exec[o]=i;const a=t.tag||"div";if((0,v.checkAttributeByTagName)(a,o)&&!b.CSS_PROPS_REGISTRY[o]&&!(b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const f=(0,v.camelToAttr)(o)||o,u=D(t,t[o+"Deps"],i),l=(0,w.createEffect)(()=>{try{const y=u(t,t.state,t.context);t.node?.setAttribute&&(y==null||y===!1&&!(0,v.isEnumeratedTrueFalseAttr)(f)?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&(f==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(f,(0,v.serializeAttrValue)(f,y))))}catch{}},{depth:s.path.length,label:j(s,o)});s.__effects.push(l)}}if(Ao(t),So(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,c=t.stateDeps;let i=!1,a=[];const f=(0,w.createEffect)(()=>{const u=[];for(let _=0;_<c.length;_++){const d=c[_];try{u[_]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{u[_]=void 0}}if(!i){i=!0,a=u;return}let l=u.length!==a.length;for(let _=0;!l&&_<u.length;_++)u[_]!==a[_]&&(l=!0);const y=a;if(a=u,!l)return;const h=t.context?.designSystem;h&&(0,A.pushConfig)(h);try{o(t,t.state,t.context,{prev:y,next:u})}catch(_){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{h&&(0,A.popConfig)()}},{depth:s.path.length,label:j(s,"onStateUpdate")});s.__effects.push(f)}Co(t)}function Mt(t){const n=t.parent,s=n?.node;if(!s||!t.node){Wt(t,t.parent);return}let e=null;const r=Object.keys(n),o=r.indexOf(t.key);for(let c=o+1;c<r.length;c++){const i=n[r[c]];if(i?.node?.parentNode===s){e=i.node;break}}e?s.insertBefore(t.node,e):s.appendChild(t.node)}function Rt(t,n,s){const e=D(t,t.ifDeps,s),r=(0,w.createEffect)(()=>{let o;try{o=e(t,t.state,t.context)}catch(i){if(o=!1,n.__ifError=i,typeof console<"u"&&console.warn){const a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,i?.message||i)}return}const c=n.__if;if(n.__if=!!o,c&&!n.__if&&t.node)t.node.remove();else if(!c&&n.__if)if(n.__ifInitialized)t.node||(t.node=(0,G.cacheNode)(t)),t.node&&(t.node.ref=t),Mt(t),bt(t);else{if(n.__ifInitialized=!0,t.tag||(t.tag=(0,G.detectTag)(t)),B("Init",t,{}),t.node||(t.node=(0,G.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"&&!n.__fragmentAnchor){const a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),n.__fragmentAnchor=a}B("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ht(t,{}),$t(t,{skipIfEffect:!0}),bt(t),Kt(t),Gt(t,{}),Mt(t),Dt(t,{})}},{depth:n.path.length,label:j(n,"if")});n.__effects.push(r)}function rt(t,n){const s=t.node;if(!s)return;const e=n==null?"":String(n);if(t.tag==="string"){s.nodeValue!==e&&(s.nodeValue=e);return}const r=t.__ref;let o=r?r.__textNode:null;if(o&&o.parentNode!==s&&(o=null),!o){const c=s.firstChild;c&&c.nodeType===3&&(o=c)}o?o.nodeValue!==e&&(o.nodeValue=e):s.firstChild?(o=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),s.insertBefore(o,s.firstChild)):(s.textContent=e,o=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=o||null)}function bt(t){const{node:n}=t;if(n){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&rt(t,t.text),wo(t),typeof t.html=="string"&&(n.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in n){const s=String(t.value);n.value!==s&&(n.value=s)}if(t.style&&typeof t.style=="object"&&q(n,t.style),t.attr&&typeof t.attr=="object")for(const s in t.attr){const e=t.attr[s];typeof e=="function"||typeof e=="object"||e!=null&&(e===!1&&!(0,v.isEnumeratedTrueFalseAttr)(s)||n.setAttribute&&n.setAttribute(s,(0,v.serializeAttrValue)(s,e)))}if(t.data&&typeof t.data=="object")for(const s in t.data){const e=t.data[s];typeof e=="function"||typeof e=="object"||e==null||e===!1||n.dataset&&(n.dataset[s]=e===!0?"":e)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(e=>e&&n.classList.add(e));else if(typeof s=="object")for(const e in s){const r=typeof s[e]=="function"?s[e](t,t.state,t.context):s[e];r&&n.classList.add(typeof r=="string"?r:e)}}}}function xt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function q(t,n){if(!t||!n||!t.style)return;let s=null;for(const e in n){const r=n[e];if(r!=null){if(e.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[e]=r;continue}try{const o=String(r),c=e.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),i=o.trim(),a=/\s*!important\s*$/.test(i),f=i.replace(/\s*!important\s*$/,"");t.style.setProperty(c,f,a?"important":"")}catch{}}}s&&bo(t,s)}let go=0;function bo(t,n){const s=`_ds${go++}`;t.classList.add(s);const e=t.ownerDocument;let r=e.querySelector("style[data-smbls-scoped]");r||(r=e.createElement("style"),r.setAttribute("data-smbls-scoped",""),e.head.appendChild(r));let o="";for(const c in n){const i="."+s,a=c.replace(/&/g,i).split(",").map(u=>{const l=u.trim();return l.includes(i)?l:i+l}).join(", "),f=n[c];if(typeof f=="object"){let u="",l="";for(const y in f){const h=f[y];if(typeof h=="object"){const _=y.includes("&")?a.split(", ").map(p=>y.replace(/&/g,p)).join(", "):a.split(", ").map(p=>`${p} ${y}`).join(", ");let d="";for(const p in h)d+=`${p.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${h[p]};`;l+=(0,V.wrapHoverRule)(`${_} { ${d} }`,_)+`
5
- `}else u+=`${y.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${h};`}u&&(o+=(0,V.wrapHoverRule)(`${a} { ${u} }`,a)+`
6
- `),l&&(o+=l)}}o&&(r.textContent+=o)}const Nt=new Set;function Ft(t){if(!Array.isArray(t))return"";const n=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&n.push(t[s]);return n.sort(),n.join("|")}function xo(t,n,s){const e=Ft(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=n(t,t.state,t.context)}catch{return}if(Ft(r)===e)return;const o=t.__ref.path?t.__ref.path.join("."):t.key||"?";Nt.has(o)||(Nt.add(o),console.warn(`[smbls] subscribeTo function at "${o}" 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 Ao(t){const n=t.subscribeTo,s=typeof n=="function";let e=n;if(s)try{e=n(t,t.state,t.context)}catch{e=null}if(s&&(0,et.isLoudDevRuntime)()&&xo(t,n,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const r=t.__ref;for(let o=0;o<e.length;o++){const c=e[o];if(typeof c!="string"||c.length===0)continue;const i=c.split("."),a=i[0],f=i.slice(1),u={value:!1},l=(0,w.createEffect)(()=>{const y=t.state&&((0,L.isStore)(t.state)?t.state.root:null);if(!y||!(0,L.isStore)(y))return;let h=y;h=h[a];for(let d=0;d<f.length&&!(h==null||typeof h!="object");d++)if((0,L.isStore)(h))h=h[f[d]];else break;if(!u.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"){const d=t.context?.designSystem;d&&(0,A.pushConfig)(d);try{if(qt(r)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>it(r,!1),g=>{it(r,!0),t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}):(it(r,!1),p===!1&&(_=!0))}}catch(p){it(r,!0),t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}finally{d&&(0,A.popConfig)()}}if(!_&&t.node&&r.__effects)for(let d=0;d<r.__effects.length;d++){const p=r.__effects[d];p&&p!==l&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}if(!_&&typeof t.onUpdate=="function"){const d=t.context?.designSystem;d&&(0,A.pushConfig)(d);try{t.onUpdate(t,t.state,t.context)}catch(p){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}finally{d&&(0,A.popConfig)()}}},{depth:r.path.length,label:j(r,"subscribeTo("+c+")")});u.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function At(t,n){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!n.context?.designSystem?.media?.[t.slice(1)])}const Ut=new Set;function ko(t,n){const s=n?.__ref?.path?n.__ref.path.join("."):n?.key||"?",e=s+"::"+t;Ut.has(e)||(Ut.add(e),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 Q(t,n,s){const e={},r=new Set,o=(c,i,a)=>{const f=a?new Set(Object.keys(e)):null;if(b.CSS_PROPS_REGISTRY[c]){const u=b.CSS_PROPS_REGISTRY[c](i,n,n.state,n.context);if(u){const l=Array.isArray(u)?u:[u];for(const y of l)y&&Object.assign(e,y)}}else e[c]=i;if(a)for(const u in e)f.has(u)||r.add(u)};for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;let i=t[c];if(typeof i=="function"&&(i=i(n,n.state,n.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(c==="style"){for(const l in i){let y=i[l];if(typeof y=="function"&&(y=y(n,n.state,n.context)),y==null||typeof y=="function")continue;const h=typeof n[l]=="function"&&(b.CSS_PROPS_REGISTRY[l]||b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(l));o(l,y,h)}continue}if(At(c,n)){const l=Q(i,n,!1);Object.keys(l).length&&(e[`[data-theme="${c.slice(1)}"] &`]=l);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(c)){(0,et.isLoudDevRuntime)()&&ko(c,n);continue}let f=c;if(c.charCodeAt(0)===64&&!c.startsWith("@media")&&!c.startsWith("@keyframes")){const l=n.context?.designSystem?.media?.[c.slice(1)];l&&(f=`@media ${l}`)}const u=Q(i,n,!1);Object.keys(u).length&&(e[f]=u);continue}const a=typeof n[c]=="function"&&(b.CSS_PROPS_REGISTRY[c]||b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(c));o(c,i,a)}if(s)for(const c in e)r.add(c);for(const c of r){const i=e[c];typeof i=="string"&&!i.includes("!important")&&(e[c]=i+" !important")}return e}function kt(t,n){if(n===void 0&&(n=0),n>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)&&kt(t[s],n+1))return!0}return!1}function It(t,n,s){if(!n||typeof n!="object"||Array.isArray(n))return null;if(At(t,s)){const o=Q(n,s,!1);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}let e=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){const o=s.context?.designSystem?.media?.[t.slice(1)];o&&(e=`@media ${o}`)}const r=Q(n,s,!1);return Object.keys(r).length?{cssProp:e,block:r}:null}function Co(t){const n=t.__ref;for(const s of Object.keys(t)){if(!_t(s))continue;const e=t[s];if(!e||typeof e!="object"||Array.isArray(e)||!kt(e))continue;let r=null,o;const c=(0,w.createEffect)(()=>{if(!t.node)return;const i=t.context?.designSystem;i&&(0,A.pushConfig)(i);let a,f=!1;try{const u=It(s,e,t),l=u?xt(u.block)+"::"+u.cssProp:null;if(l!==null&&l===o)f=!0;else if(o=l,u){const y=(0,V.css)({[u.cssProp]:u.block},null,t.context?.cssPrefix);a=y?y.split(" ").filter(Boolean):null}else a=null}finally{i&&(0,A.popConfig)()}if(!(f||!t.node.classList)){if(r)for(const u of r)t.node.classList.remove(u);if(a&&a.length)for(const u of a)t.node.classList.add(u);r=a}},{depth:n.path.length,label:j(n,"cssBlock("+s+")")});n.__effects.push(c)}}function So(t){const n=t.__ref;n.__conditionalRunners=[];const s=new Map;for(const e of Object.keys(t)){const r=e.charAt(0);if(r!=="."&&r!=="!")continue;const o=e.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const l=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${l}: { '${o.slice(l.length)}': {...} }\`.`)}continue}const c=t[e];if(!c||typeof c!="object")continue;const i=r==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},f=()=>{let l;const y=t[o];if(y===void 0){const d=!!t.state&&o in t.state,p=t.state?t.state[o]:void 0;if(d||p!==void 0)l=p;else{const g=t.context?.cases?.[o];if(g===void 0)return;try{l=typeof g=="function"?g.call(t,t):g}catch(k){l=!1,n.__conditionalError=k,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,k?.message||k)}}}else if(typeof y=="function")try{l=y(t,t.state,t.context)}catch(d){l=!1,n.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else l=y;const h=i?!l:!!l;if(!t.node||h===a.lastMatch)return;a.lastMatch=h;const _=t.context?.designSystem;_&&(0,A.pushConfig)(_);try{if(h){const d={},p={};let g=!1;for(const x in c){if(!Object.prototype.hasOwnProperty.call(c,x))continue;const P=c[x],E=x.charAt(0);if((E===":"||E==="@"||E==="&")&&P&&typeof P=="object"&&!Array.isArray(P)){if(At(x,t)){const $=Q(P,t,!1);Object.keys($).length&&(p[`[data-theme="${x.slice(1)}"] &`]=$,g=!0)}else{let $=x;if(E==="@"&&!x.startsWith("@media")&&!x.startsWith("@keyframes")){const H=t.context?.designSystem?.media?.[x.slice(1)];H&&($=`@media ${H}`)}const W=Q(P,t,!1);Object.keys(W).length&&(p[$]=W,g=!0)}continue}const T=typeof P=="function"?P(t,t.state,t.context):P;if(T!=null)if(b.CSS_PROPS_REGISTRY[x]){const $=b.CSS_PROPS_REGISTRY[x](T,t,t.state,t.context);if($){const W=Array.isArray($)?$:[$];for(const H of W)H&&Object.assign(d,H)}}else b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(x)&&(d[x]=T)}const k=Object.keys(d);if(k.length){q(t.node,d);for(const x of k)s.set(x,e);a.appliedKeys=k}else a.appliedKeys=null;if(g){const x=(0,V.css)(p,null,t.context?.cssPrefix),P=x?x.split(" ").filter(Boolean):[];if(P.length&&t.node.classList){for(const E of P)t.node.classList.add(E);a.appliedClasses=P}else a.appliedClasses=null}else if(a.appliedClasses){for(const x of a.appliedClasses)t.node.classList.remove(x);a.appliedClasses=null}}else{if(a.appliedKeys){for(const d of a.appliedKeys)s.get(d)===e&&(t.node.style[d]="",s.delete(d));a.appliedKeys=null}if(a.appliedClasses){for(const d of a.appliedClasses)t.node.classList.remove(d);a.appliedClasses=null}}}finally{_&&(0,A.popConfig)()}};n.__conditionalRunners.push(f);const u=(0,w.createEffect)(f,{depth:n.path.length,label:j(n,"conditional("+e+")")});n.__effects.push(u)}}const Ct=new WeakSet;function vo(t){const n=t.ownerDocument;!n||Ct.has(n)||(Ct.add(n),queueMicrotask(()=>{Ct.delete(n);const s=n.body||n.documentElement;s&&s.offsetWidth}))}const St=new WeakSet;let Bt=!1;function wo(t){const{node:n}=t;if(!n)return;if(Bt||(Bt=!0,(0,V.css)({display:"none"})),St.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}St.add(t);const s=t.context?.designSystem;s&&(0,A.pushConfig)(s),(0,b.pushStaticCssPass)();try{const e={};let r=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&b.CSS_PROPS_REGISTRY.theme){const o=b.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(const c of o)c&&Object.assign(e,c);else Object.assign(e,o);r=!0}}for(const o of Object.keys(t)){if(typeof t[o]=="function"||N.REGISTRY.has(o)||o==="theme")continue;const c=o.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(o)){if(b.CSS_PROPS_REGISTRY[o]){const i=t[o],a=b.CSS_PROPS_REGISTRY[o](i,t,t.state,t.context);if(a){if(Array.isArray(a))for(const f of a)f&&Object.assign(e,f);else Object.assign(e,a);r=!0}}else if(b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const i=t[o];i!=null&&typeof i!="object"&&(e[o]=i,r=!0)}else if(o.charCodeAt(0)===45){const i=t[o];i!=null&&typeof i!="object"&&(e[o]=i,r=!0)}else if(o.charAt(0)==="&"||o.charAt(0)==="@"||o.charAt(0)===":"){const i=t[o];if(i&&typeof i=="object"&&!Array.isArray(i)){if(kt(i))continue;const a=It(o,i,t);a&&(e[a.cssProp]=a.block,r=!0)}}}}if(r){e.display&&String(e.display).includes("!important")&&(n.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const o=(0,V.css)(e,null,t.context?.cssPrefix);if(o&&n.classList){const i=o.split(" ").filter(Boolean);let a=!1;for(const f of i)n.classList.add(f),a||(f.charCodeAt(0)===95&&f.charCodeAt(1)===99||f.charCodeAt(0)===95&&f.indexOf("_c",1)!==-1)&&(a=!0);a&&vo(n)}const c=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(c!=null){const i=e.display;if(i&&i!==c)if(c==="none"){const a=[];for(const f of n.classList)f.startsWith("_d-")&&f!=="_d-none"&&a.push(f);for(const f of a)n.classList.remove(f);n.classList.add("_d-none")}else n.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(n.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}}finally{(0,b.popStaticCssPass)(),s&&(0,A.popConfig)(),St.delete(t)}}function Kt(t){const{node:n}=t;if(!n||!n.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const o=t.aria[r];if(typeof o=="function"||typeof o=="object"||o==null)continue;const c="aria-"+r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());n.setAttribute(c,(0,v.serializeAttrValue)(c,o))}const s=(0,v.applyAttrTransforms)(t);for(const r in s){const o=s[r];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&n.setAttribute(r,o===!0?"":o)}const e=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||N.REGISTRY.has(r)||r==="on"||s[r]!==void 0)continue;const o=r.charCodeAt(0);if(!(o>=65&&o<=90)&&!Y(r)&&!(b.CSS_PROPS_REGISTRY[r]||b.DEFAULT_CSS_PROPERTIES_LIST&&b.DEFAULT_CSS_PROPERTIES_LIST.has(r))&&(0,v.checkAttributeByTagName)(e,r)){let c=t[r];if(c==null||(typeof c=="string"&&c.includes("{{")&&(c=(0,at.replaceLiteralsWithObjectFields)(c,t,t.state,t.context),t[r]=c),c==null||typeof c=="function"||typeof c=="object")||c===!1&&!(0,v.isEnumeratedTrueFalseAttr)((0,v.camelToAttr)(r)||r))continue;const i=(0,v.camelToAttr)(r)||r;n.setAttribute(i,(0,v.serializeAttrValue)(i,c))}}}function jo(t,n){const s=t.node,e=t.__ref;let r=e.__autoGrow;if(!n){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=e.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(s.scrollHeight===0&&r.lastMeasure>0)return;s.style.height="auto";const c=s.scrollHeight;s.style.height=c+"px",c>0&&(r.lastMeasure=c)}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}})),r.active||(s.addEventListener("input",r.resize),r.active=!0);const o=typeof n=="object"&&n.max!=null?String(n.max):null;o!==r.appliedMax&&(o==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=o,r.appliedMax=o),r.resize()}function Eo(t){if(!t.autoGrow)return;const n=t.node;if(!n||n.tagName!=="TEXTAREA")return;const s=t.__ref,e=t.autoGrow,r=typeof e=="function"?D(t,t.autoGrowDeps,e):null,o=(0,w.createEffect)(()=>{const c=t.autoGrow;let i=c;if(typeof c=="function")try{i=(c===e&&r?r:c)(t,t.state,t.context)}catch{i=null}jo(t,i)},{depth:s.path.length,label:j(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(o),r&&(s.__exec.autoGrow=e)}const Vt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ht(t,n){for(const s of Object.keys(t)){if(!Y(s)||Vt.has(s))continue;const e=(0,X.globalEventKeyInfo)(s);if(e){(0,X.registerGlobalEvent)(e,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const c=r;r=function(a){return t.call(c,a)}}if(typeof r!="function")continue;const o=ao(s);N.LIFECYCLE_EVENTS.has(o)||(0,X.registerEvent)(fo(o),t,r)}To(t)}function To(t){const n=t.node;if(!n||!n.addEventListener)return;const s={};let e=!1;for(const y of Vt){const h=t[y];typeof h=="function"&&(s[y]=h,e=!0)}if(!e)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let c=0,i=0,a=0,f=!1;const u=y=>{const h=y.touches&&y.touches[0]||y.changedTouches&&y.changedTouches[0];h&&(c=h.clientX,i=h.clientY,a=Date.now(),f=!0)},l=y=>{if(!f)return;f=!1;const h=y.changedTouches&&y.changedTouches[0]||y.touches&&y.touches[0];if(!h)return;const _=h.clientX-c,d=h.clientY-i,p=Date.now()-a;if(p>o)return;const g=Math.abs(_),k=Math.abs(d);if(Math.max(g,k)<r)return;let x;if(g>k*1.2)x=_<0?"left":"right";else if(k>g*1.2)x=d<0?"up":"down";else return;const P="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),E=s[P],T=s.onSwipe;E&&E.call(t,y,t,t.state,t.context),T&&T.call(t,{direction:x,dx:_,dy:d,dt:p,event:y},t,t.state,t.context)};n.addEventListener("touchstart",u,{passive:!0}),n.addEventListener("touchend",l,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{n.removeEventListener("touchstart",u)}catch{}try{n.removeEventListener("touchend",l)}catch{}})}function nt(t,n){const s={...t};for(const e in n){const r=s[e],o=n[e];r&&o&&typeof r=="object"&&typeof o=="object"&&!Array.isArray(r)&&!Array.isArray(o)&&typeof r!="function"&&typeof o!="function"?s[e]=nt(r,o):s[e]=o}return s}function vt(t,n,s){if(!n||!t.node)return;const e=t.childExtends;if(Array.isArray(n)){const r=t.tag==="fragment",o=t.context?.document||globalThis.document,c=r?null:o?.createDocumentFragment();if(!r&&!c)return;const i=t.childProps,a=t.childrenAs;for(let f=0;f<n.length;f++){let u=n[f];const l=u;(typeof u=="string"||typeof u=="number")&&(u={text:u});let y=i;if(typeof i=="function")try{y=i(t,u)}catch{y=null}if(a==="state"){let d=l;(typeof l=="string"||typeof l=="number")&&(d={value:l,text:l}),u=y?{...y,state:d}:{state:d}}else y&&(u=nt(y,u));if(e&&!u.ignoreChildExtends)if(u.extends){const d=Array.isArray(u.extends)?u.extends:[u.extends],p=Array.isArray(e)?e:[e];u={...u,extends:[...p,...d]}}else u={...u,extends:e};const h=u?.key||l&&typeof l=="object"&&l.key||`${f}`;let _;try{_=K(u,t,h,s)}catch(d){if(typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${h}" failed to construct at ${p} (initial render, skipping this row):`,d?.message||d)}continue}!r&&_?.node&&c.appendChild(_.node)}return r||t.node.appendChild(c),!0}if(typeof n=="string"){const r=Ot(n,t);if(Array.isArray(r))return vt(t,r,s)}if(typeof n=="object")for(const r in n){if(N.REGISTRY.has(r))continue;let o=n[r];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=nt(t.childProps,o)),e&&!o.ignoreChildExtends)if(o.extends){const c=Array.isArray(o.extends)?o.extends:[o.extends],i=Array.isArray(e)?e:[e];o={...o,extends:[...i,...c]}}else o={...o,extends:e};K(o,t,r,s)}}}function wt(t,n){const s=t.node;if(!s||s.tagName!=="SELECT")return;const e=s.options;if(!e||!e.length)return;const r=t.__ref,o=r&&r.__exec&&r.__exec.value,c=typeof o=="function",i=t.value!=null&&typeof t.value!="function";if(c||i){let u;if(c)try{u=o(t,t.state,t.context)}catch{return}else u=t.value;const l=u==null?"":String(u);s.value!==l&&(s.value=l);return}const a=n||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!a)return;let f=-1;for(let u=0;u<e.length;u++)e[u].defaultSelected&&(f=u);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function Gt(t,n){let{children:s,content:e}=t;const r=t.childExtends;if(typeof s=="function"){const i=s;try{s=i(t,t.state,t.context)}catch(y){if(s=void 0,typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${h} (initial run, treating as empty):`,y?.message||y)}}t.children=s;const a=t.__ref;let f=!1;const u=D(t,t.childrenDeps,i),l=(0,w.createEffect)(()=>{const y=f;f=!0;let h;try{h=u(t,t.state,t.context)}catch(E){if(typeof console<"u"&&console.error){const T=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${T}${y?"":" (initial tracking run)"}:`,E?.message||E)}return}if(!y||h===t.children)return;t.children=h;const _=typeof t.onContentUpdate=="function",d=_?[]:null,p=_?[]:null,g=_?[]:null;if(Array.isArray(h)&&t.childrenAs==="state"){const E=t.childProps,T=[],$=new Map;for(let C=0;C<h.length;C++){const M=h[C];let S=E;if(typeof E=="function")try{S=E(t,M)}catch{S=null}const I=S&&S.key||M&&M.key||`${C}`;T.push(I),$.set(I,{rawChild:M,childProps:S})}const W=new Set(T),H=a.__children.slice();for(const C of H)if(!W.has(C)){const M=t[C];M?.remove&&M.remove(),delete t[C],p&&p.push(C)}const J=t.childExtends,ct=t.tag==="fragment",Qt=t.context?.document||globalThis.document,m=ct?null:Qt?.createDocumentFragment(),dt=new Set;for(const C of T){const M=$.get(C),S=M.rawChild,I=t[C];if(I&&I.state){if(S&&typeof S=="object"){const O=I.state,z=O.$replace||O.replace,Et=O.$update||O.update;try{if(typeof z=="function")z.call(O,S);else if(typeof Et=="function"){for(const R in O)if(!(R==="__element"||R==="root"||R==="parent"||R==="update")&&!Object.prototype.hasOwnProperty.call(S,R))try{O[R]=void 0}catch{}Et.call(O,S)}else for(const R in S)O[R]=S[R]}catch(R){if(typeof console<"u"&&console.error){const Zt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to patch at ${Zt} (reconcile, keeping its previous data for this pass):`,R?.message||R)}}}g&&g.push(C);continue}let lt=S;(typeof S=="string"||typeof S=="number")&&(lt={value:S,text:S});const jt=M.childProps;let F=jt?{...jt,state:lt}:{state:lt};if(J&&!F.ignoreChildExtends)if(F.extends){const O=Array.isArray(F.extends)?F.extends:[F.extends],z=Array.isArray(J)?J:[J];F={...F,extends:[...z,...O]}}else F={...F,extends:J};let pt;try{pt=K(F,t,C,n)}catch(O){if(typeof console<"u"&&console.error){const z=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${z} (reconcile, skipping this row):`,O?.message||O)}dt.add(C);continue}!ct&&pt?.node&&m&&m.appendChild(pt.node),d&&d.push(C)}if(!ct&&m&&m.childNodes.length&&t.node&&t.node.appendChild(m),!ct&&t.node){let C=null;for(const M of T){const S=t[M]?.node;if(!S)continue;const I=C?C.nextSibling:t.node.firstChild;S!==I&&t.node.insertBefore(S,I),C=S}}a.__children=dt.size?T.filter(C=>!dt.has(C)):T,_&&(d.length||p.length)&&Lt(t,{added:d,removed:p,kept:g}),wt(t,!1);return}const P=_?[...a.__children]:null;for(const E of[...a.__children]){const T=t[E];T?.remove&&T.remove(),delete t[E]}a.__children=[],vt(t,h,n),wt(t,!1),_&&Lt(t,{added:[...a.__children],removed:P,kept:[]})},{depth:a.path.length,label:j(a,"children")});a.__effects.push(l)}const o=vt(t,s,n);if(e!=null&&!(e&&e.__ref)){let i=e;if(typeof i=="string"||typeof i=="number"?i={text:i}:typeof i!="object"&&(i={}),t.childProps&&(i=nt(t.childProps,i)),r&&!i.ignoreChildExtends)if(i.extends){const a=Array.isArray(i.extends)?i.extends:[i.extends],f=Array.isArray(r)?r:[r];i={...i,extends:[...f,...a]}}else i={...i,extends:r};K(i,t,"content",n)}if(s&&!o)return;const c=t.context?.components||{};{const i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(!f.endsWith("Extends")||typeof t[f]!="string")continue;const u=f.slice(0,-7);if(!u||u.charCodeAt(0)<65||u.charCodeAt(0)>90)continue;const l={extends:t[f]};delete t[f];for(let y=a+1;y<i.length;y++){const h=i[y],_=h.charCodeAt(0);if(_>=65&&_<=90||N.REGISTRY.has(h)||typeof t[h]=="function"&&(h.startsWith("on")||h.startsWith(".")))break;const d=t[h];d!==void 0&&(l[h]=d,delete t[h])}t[u]&&typeof t[u]=="object"?t[u]={...l,...t[u]}:t[u]=l}}for(const i of Object.keys(t)){if(N.REGISTRY.has(i)||typeof t[i]!="object"||t[i]===null)continue;const a=i.charCodeAt(0);if(a<65||a>90)continue;let f=t[i];if(!f.__ref){if(!f.extends&&!f.extend){const u=c[i]||c[`smbls.${i}`];u&&(f={...f,extends:u})}if(t.childProps&&(f=nt(t.childProps,f)),r&&!f.ignoreChildExtends)if(f.extends){const u=Array.isArray(f.extends)?f.extends:[f.extends],l=Array.isArray(r)?r:[r];f={...f,extends:[...l,...u]}}else f={...f,extends:r};K(f,t,i,n)}}}function Wt(t,n,s){const{node:e}=t;if(!e)return;e.ref=t;const r=n?.tag==="fragment"?n.__ref?.__fragmentAnchor:null;if(r){const c=r.parentNode;if(c){if(s?.position==="before"&&s.node)c.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const i=s.node.nextSibling;c.insertBefore(e,i||r)}else c.insertBefore(e,r);return}}const o=n?.node||(n?.nodeType?n:null);if(o)if(s?.position==="before"&&s.node)o.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;c?o.insertBefore(e,c):o.appendChild(e)}else o.appendChild(e)}const ut=3;function qt(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=ut?!1:(t.__inBeforeUpdate=!0,!0)}function it(t,n){t&&(t.__inBeforeUpdate=!1,n?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===ut&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${ut}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function B(t,n,s){const e=t.charAt(0).toLowerCase()+t.slice(1);n.context?.plugins?.length&&(0,U.runPluginHook)(e,n,s);const r="on"+t,o=n[r];if(typeof o=="function"){const a=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(a){if(n.__ref[a])return!0;n.__ref[a]=!0}const f=n.context?.designSystem;f&&(0,A.pushConfig)(f);let u=!!a;try{const l=o(n,n.state,n.context,s);if(l&&typeof l.then=="function"){const y=n.__ref;return l.catch(h=>{n.context?.plugins?.length&&(0,U.runPluginHook)("error",n,{hook:r,error:h})||console.error(`[DOMQL] Lifecycle "${r}" error:`,h)}).finally(()=>{a&&y&&(y[a]=!1)}),u=!1,!0}if(l===!1)return!1}catch(l){if(n.context?.plugins?.length&&(0,U.runPluginHook)("error",n,{hook:r,error:l})||console.error(`[DOMQL] Lifecycle "${r}" error:`,l),n.context?.strictMode)throw l}finally{f&&(0,A.popConfig)(),u&&n.__ref&&(n.__ref[a]=!1)}}return!0}var Po=K;
4
+ `):"")}}if(Et(o,!0),Zt(o,e,r),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const d=o.context?.designSystem;d&&(0,k.pushConfig)(d);try{const y=o.html(o,o.state,o.context);y!=null&&typeof y!="function"&&(o.node.innerHTML=y)}catch{}finally{d&&(0,k.popConfig)()}}if(K("Create",o,n),K("Complete",o,n),K("Render",o,n),K("RenderRouter",o,n),Mt(o,n),typeof o.onFrame=="function"){const d=o.onFrame,y=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){y&&(0,k.pushConfig)(y);try{d(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{y&&(0,k.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function bo(t,e,s){const n=!e,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,o=n&&r&&t.context?.state,i=s.state!==void 0&&!o?s.state:t.state&&!(0,D.isStore)(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,(0,m.applyStateMethods)(t,t.state);else if(t.context?.state){const c=t.context.state,a={...c},l=t.context?.polyglot;if(l?.translations){const u=t.context,f=c.lang||l.defaultLang||"en",p=new Set,h=(y,g)=>{p.has(y)||(0,G.isPolyglotWritableKey)(u,y,a)&&(a[y]=g,p.add(y),(0,G.markPolyglotSeeded)(u,y))},_=l.translations[f];if(_&&typeof _=="object")for(const y in _)h(y,_[y]);const d=new Set(l.languages||[]);for(const y in l.translations)d.has(y)||h(y,l.translations[y])}t.state=(0,D.isStore)(a)?a:(0,D.createStore)(a),t.state.__element=t,t.state.root=t.state,(0,m.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,m.applyStateMethods)(t,t.state);return}if(typeof i=="string"){if(t.state=Nt(i,e),t.state&&typeof t.state=="object"&&!(0,D.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,m.applyStateMethods)(t,t.state);return}if(typeof i=="function"){const c=i(t,e?.state);t.state=(0,D.isStore)(c)?c:(0,D.createStore)(c||{})}else(0,D.isStore)(i)?t.state=i:t.state=(0,D.createStore)({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,(0,m.applyStateMethods)(t,t.state)}function xt(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 Nt(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?xt(e.state,r):e.state??{}}if(t.startsWith("~/")){const r=e.state?.root||e.state,o=t.slice(2);return o?xt(r,o):r??{}}if(e.state?.[t]!==void 0)return e.state[t];const s=xt(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",o=n.translations[r];if(o?.[t]!==void 0)return o[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const xo=new Set(["s","state","ctx","context"]);function Ao(t){try{const s=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function ko(t){if(typeof t!="function"||t.length!==2)return!1;const e=Ao(t);if(e.length<2)return!1;const s=e[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!xo.has(s)}function So(t){const e=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const c=o[i];if(typeof t[c]!="function"||F.REGISTRY.has(c))continue;const a=c.charCodeAt(0);a>=65&&a<=90||Q(c)||A.CSS_PROPS_REGISTRY[c]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(c)||(0,v.checkAttributeByTagName)(s,c)||((0,ct.isLoudDevRuntime)()&&ko(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 i=0;i<r.length;i++){const{prop:c,fn:a}=r[i];e.__exec[c]=a,Object.defineProperty(t,c,{get(){n&&(0,k.pushConfig)(n);try{return a(t,t.state,t.context)}catch{return}finally{n&&(0,k.popConfig)()}},set(l){delete e.__exec[c],Object.defineProperty(t,c,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Co(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 P(t,e,s){return!Array.isArray(e)||e.length===0?s:function(...n){return Co(t,e),s.apply(this,n)}}function rt(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function j(t,e){return()=>t.path.join(".")+"::"+e}function Ft(t,e){const s=t.__ref,n=!!(e&&e.skipIfEffect);if(So(t),typeof t.text=="function"){const o=t.text,i=P(t,t.textDeps,o),c=(0,w.createEffect)(()=>{if(!s.contentManaged)try{let a=i(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=G.replaceLiteralsWithObjectFields.call(t,a,t.state)),at(t,a))}catch{}},{depth:s.path.length,label:j(s,"text")});s.__effects.push(c),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,i=(0,w.createEffect)(()=>{if(s.contentManaged)return;const c=G.replaceLiteralsWithObjectFields.call(t,o,t.state);c!=null&&(t.text=c),t.node&&at(t,c??"")},{depth:s.path.length,label:j(s,"text")});s.__effects.push(i),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!F.REGISTRY.has(o)&&!Q(o)&&!s.__exec[o]){if(A.CSS_PROPS_REGISTRY[o]){const i=t[o],c=P(t,t[o+"Deps"],i),a=o;let l;const u=(0,w.createEffect)(()=>{const f=t.context?.designSystem;f&&(0,k.pushConfig)(f);try{const p=c(t,t.state,t.context),h=A.CSS_PROPS_REGISTRY[a](p,t,t.state,t.context),_=a==="show"||a==="hide";if(h&&t.node){const d=kt(h),y=_&&t.node.style.display!=="none";(d===null||d!==l||y)&&(l=d,X(t.node,h))}else if(t.node&&_){l=void 0;const d=s.__explicitDisplay;t.node.style.display=typeof d=="string"?d:""}}finally{f&&(0,k.popConfig)()}},{depth:s.path.length,label:j(s,a)});s.__effects.push(u),s.__exec[o]=i}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const i=t[o],c=P(t,t[o+"Deps"],i),a=o;let l;const u=(0,w.createEffect)(()=>{const f=t.context?.designSystem;f&&(0,k.pushConfig)(f);try{const p=c(t,t.state,t.context);if(t.node)if(p!=null){const h=a+":"+String(p);h!==l&&(l=h,X(t.node,{[a]:p}))}else l=void 0,t.node.style[a]=""}finally{f&&(0,k.popConfig)()}},{depth:s.path.length,label:j(s,a)});s.__effects.push(u),s.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=P(t,t.htmlDeps,o),c=(0,w.createEffect)(()=>{const a=t.context?.designSystem;a&&(0,k.pushConfig)(a);try{const l=i(t,t.state,t.context);t.node&&l!=null&&typeof l!="function"&&(t.node.innerHTML=l)}finally{a&&(0,k.popConfig)()}},{depth:s.path.length,label:j(s,"html")});s.__effects.push(c),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=P(t,t.valueDeps,o),c=(0,w.createEffect)(()=>{try{const a=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const l=a==null?"":String(a);if(t.node.value===l)return;const u=typeof document<"u"&&document.activeElement===t.node,f=u&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=u&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=l,u&&f!=null&&p!=null)try{t.node.setSelectionRange(f,p)}catch{}}catch{}},{depth:s.path.length,label:j(s,"value")});s.__effects.push(c),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,i=P(t,t.styleDeps,o);let c;const a=(0,w.createEffect)(()=>{const l=i(t,t.state,t.context),u=kt(l);(u===null||u!==c)&&(c=u,X(t.node,l))},{depth:s.path.length,label:j(s,"style")});s.__effects.push(a),s.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const i=t.style[o];if(typeof i!="function")continue;const c=P(t,rt(t.styleDeps,o),i);let a;const l=(0,w.createEffect)(()=>{try{const u=c(t,t.state,t.context);if(t.node){const f=o+":"+String(u);f!==a&&(a=f,X(t.node,{[o]:u}))}}catch{}},{depth:s.path.length,label:j(s,"style."+o)});s.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=P(t,rt(t.attrDeps,o),t.attr[o]),c=o,a=(0,w.createEffect)(()=>{try{const l=i(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1&&!(0,v.isEnumeratedTrueFalseAttr)(c)?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,(0,v.serializeAttrValue)(c,l)))}catch{}},{depth:s.path.length,label:j(s,"attr."+c)});s.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const i=P(t,rt(t.ariaDeps,o),t.aria[o]),c="aria-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=(0,w.createEffect)(()=>{try{const l=i(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,(0,v.serializeAttrValue)(c,l))}catch{}},{depth:s.path.length,label:j(s,"aria."+o)});s.__effects.push(a)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const i=P(t,rt(t.dataDeps,o),t.data[o]),a="data-"+o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),l=(0,w.createEffect)(()=>{try{const u=i(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(a):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(a,u===!0?"":u)}catch{}},{depth:s.path.length,label:j(s,"data."+o)});s.__effects.push(l)}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 i=P(t,rt(t.classDeps,o),r[o]),c=(0,w.createEffect)(()=>{try{const a=i(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:s.path.length,label:j(s,"class."+o)});s.__effects.push(c)}!n&&typeof t.if=="function"&&Ut(t,s,t.if);for(const o of Object.keys(t)){if(F.REGISTRY.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||Q(o))continue;const c=t[o];s.__exec[o]=c;const a=t.tag||"div";if((0,v.checkAttributeByTagName)(a,o)&&!A.CSS_PROPS_REGISTRY[o]&&!(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const l=(0,v.camelToAttr)(o)||o,u=P(t,t[o+"Deps"],c),f=(0,w.createEffect)(()=>{try{const p=u(t,t.state,t.context);t.node?.setAttribute&&(p==null||p===!1&&!(0,v.isEnumeratedTrueFalseAttr)(l)?t.node.removeAttribute(l):typeof p!="function"&&typeof p!="object"&&(l==="src"&&"src"in t.node?t.node.src=p:t.node.setAttribute(l,(0,v.serializeAttrValue)(l,p))))}catch{}},{depth:s.path.length,label:j(s,o)});s.__effects.push(f)}}if(jo(t),Po(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let c=!1,a=[];const l=(0,w.createEffect)(()=>{const u=[];for(let _=0;_<i.length;_++){const d=i[_];try{u[_]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{u[_]=void 0}}if(!c){c=!0,a=u;return}let f=u.length!==a.length;for(let _=0;!f&&_<u.length;_++)u[_]!==a[_]&&(f=!0);const p=a;if(a=u,!f)return;const h=t.context?.designSystem;h&&(0,k.pushConfig)(h);try{o(t,t.state,t.context,{prev:p,next:u})}catch(_){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{h&&(0,k.popConfig)()}},{depth:s.path.length,label:j(s,"onStateUpdate")});s.__effects.push(l)}To(t)}function It(t){const e=t.parent,s=e?.node;if(!s||!t.node){Zt(t,t.parent);return}let n=null;const r=Object.keys(e),o=r.indexOf(t.key);for(let i=o+1;i<r.length;i++){const c=e[r[i]];if(c?.node?.parentNode===s){n=c.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Ut(t,e,s){const n=P(t,t.ifDeps,s),r=(0,w.createEffect)(()=>{let o;try{o=n(t,t.state,t.context)}catch(c){if(o=!1,e.__ifError=c,typeof console<"u"&&console.warn){const a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,c?.message||c)}return}const i=e.__if;if(e.__if=!!o,i&&!e.__if&&t.node)t.node.remove();else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=(0,Y.cacheNode)(t)),t.node&&(t.node.ref=t),It(t),At(t);else{if(e.__ifInitialized=!0,t.tag||(t.tag=(0,Y.detectTag)(t)),K("Init",t,{}),t.node||(t.node=(0,Y.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 a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),e.__fragmentAnchor=a}K("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Yt(t,{}),Ft(t,{skipIfEffect:!0}),At(t),Wt(t),qt(t,{}),It(t),Mt(t,{})}},{depth:e.path.length,label:j(e,"if")});e.__effects.push(r)}function at(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 o=r?r.__textNode:null;if(o&&o.parentNode!==s&&(o=null),!o){const i=s.firstChild;i&&i.nodeType===3&&(o=i)}o?o.nodeValue!==n&&(o.nodeValue=n):s.firstChild?(o=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(o,s.firstChild)):(s.textContent=n,o=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=o||null)}function At(t){const{node:e}=t;if(e){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&at(t,t.text),Oo(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){const s=String(t.value);e.value!==s&&(e.value=s)}if(t.style&&typeof t.style=="object"&&X(e,t.style),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&&(n===!1&&!(0,v.isEnumeratedTrueFalseAttr)(s)||e.setAttribute&&e.setAttribute(s,(0,v.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||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 kt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function X(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 o=String(r),i=n.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),c=o.trim(),a=/\s*!important\s*$/.test(c),l=c.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,a?"important":"")}catch{}}}s&&vo(t,s)}function vo(t,e){const s=`_ds${Ot.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 o="";for(const i in e){const c="."+s,a=i.replace(/&/g,c).split(",").map(u=>{const f=u.trim();return f.includes(c)?f:c+f}).join(", "),l=e[i];if(typeof l=="object"){let u="",f="";for(const p in l){const h=l[p];if(typeof h=="object"){const _=p.includes("&")?a.split(", ").map(y=>p.replace(/&/g,y)).join(", "):a.split(", ").map(y=>`${y} ${p}`).join(", ");let d="";for(const y in h)d+=`${y.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${h[y]};`;f+=(0,H.wrapHoverRule)(`${_} { ${d} }`,_)+`
5
+ `}else u+=`${p.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${h};`}u&&(o+=(0,H.wrapHoverRule)(`${a} { ${u} }`,a)+`
6
+ `),f&&(o+=f)}}o&&(r.textContent+=o)}const Bt=new Set;function Kt(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 wo(t,e,s){const n=Kt(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=e(t,t.state,t.context)}catch{return}if(Kt(r)===n)return;const o=t.__ref.path?t.__ref.path.join("."):t.key||"?";Bt.has(o)||(Bt.add(o),console.warn(`[smbls] subscribeTo function at "${o}" 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 jo(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,ct.isLoudDevRuntime)()&&wo(t,e,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let o=0;o<n.length;o++){const i=n[o];if(typeof i!="string"||i.length===0)continue;const c=i.split("."),a=c[0],l=c.slice(1),u={value:!1},f=(0,w.createEffect)(()=>{const p=t.state&&((0,D.isStore)(t.state)?t.state.root:null);if(!p||!(0,D.isStore)(p))return;let h=p;h=h[a];for(let d=0;d<l.length&&!(h==null||typeof h!="object");d++)if((0,D.isStore)(h))h=h[l[d]];else break;if(!u.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"){const d=t.context?.designSystem;d&&(0,k.pushConfig)(d);try{if(to(r)){const y=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});y&&typeof y.then=="function"?y.then(()=>ft(r,!1),g=>{ft(r,!0),t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}):(ft(r,!1),y===!1&&(_=!0))}}catch(y){ft(r,!0),t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}finally{d&&(0,k.popConfig)()}}if(!_&&t.node&&r.__effects)for(let d=0;d<r.__effects.length;d++){const y=r.__effects[d];y&&y!==f&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}if(!_&&typeof t.onUpdate=="function"){const d=t.context?.designSystem;d&&(0,k.pushConfig)(d);try{t.onUpdate(t,t.state,t.context)}catch(y){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}finally{d&&(0,k.popConfig)()}}},{depth:r.path.length,label:j(r,"subscribeTo("+i+")")});u.value=!0,f._isSubscribeToEffect=!0,r.__effects.push(f)}}function St(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}const Vt=new Set;function Eo(t,e){const s=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=s+"::"+t;Vt.has(n)||(Vt.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 J(t,e,s){const n={},r=new Set,o=(i,c,a)=>{const l=a?new Set(Object.keys(n)):null;if(A.CSS_PROPS_REGISTRY[i]){const u=A.CSS_PROPS_REGISTRY[i](c,e,e.state,e.context);if(u){const f=Array.isArray(u)?u:[u];for(const p of f)p&&Object.assign(n,p)}}else n[i]=c;if(a)for(const u in n)l.has(u)||r.add(u)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let c=t[i];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(i==="style"){for(const f in c){let p=c[f];if(typeof p=="function"&&(p=p(e,e.state,e.context)),p==null||typeof p=="function")continue;const h=typeof e[f]=="function"&&(A.CSS_PROPS_REGISTRY[f]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(f));o(f,p,h)}continue}if(St(i,e)){const f=J(c,e,!1);Object.keys(f).length&&(n[`[data-theme="${i.slice(1)}"] &`]=f);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){(0,ct.isLoudDevRuntime)()&&Eo(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){const f=e.context?.designSystem?.media?.[i.slice(1)];f&&(l=`@media ${f}`)}const u=J(c,e,!1);Object.keys(u).length&&(n[l]=u);continue}const a=typeof e[i]=="function"&&(A.CSS_PROPS_REGISTRY[i]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i));o(i,c,a)}if(s)for(const i in n)r.add(i);for(const i of r){const c=n[i];typeof c=="string"&&!c.includes("!important")&&(n[i]=c+" !important")}return n}function Ct(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)&&Ct(t[s],e+1))return!0}return!1}function Ht(t,e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;if(St(t,s)){const o=J(e,s,!1);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){const o=s.context?.designSystem?.media?.[t.slice(1)];o&&(n=`@media ${o}`)}const r=J(e,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function To(t){const e=t.__ref;for(const s of Object.keys(t)){if(!bt(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!Ct(n))continue;let r=null,o;const i=(0,w.createEffect)(()=>{if(!t.node)return;const c=t.context?.designSystem;c&&(0,k.pushConfig)(c);let a,l=!1;try{const u=Ht(s,n,t),f=u?kt(u.block)+"::"+u.cssProp:null;if(f!==null&&f===o)l=!0;else if(o=f,u){const p=(0,H.css)({[u.cssProp]:u.block},null,t.context?.cssPrefix);a=p?p.split(" ").filter(Boolean):null}else a=null}finally{c&&(0,k.popConfig)()}if(!(l||!t.node.classList)){if(r)for(const u of r)t.node.classList.remove(u);if(a&&a.length)for(const u of a)t.node.classList.add(u);r=a}},{depth:e.path.length,label:j(e,"cssBlock("+s+")")});e.__effects.push(i)}}function Po(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 o=n.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const f=o.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}${f}: { '${o.slice(f.length)}': {...} }\`.`)}continue}const i=t[n];if(!i||typeof i!="object")continue;const c=r==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let f;const p=t[o];if(p===void 0){const d=!!t.state&&o in t.state,y=t.state?t.state[o]:void 0;if(d||y!==void 0)f=y;else{const g=t.context?.cases?.[o];if(g===void 0)return;try{f=typeof g=="function"?g.call(t,t):g}catch(b){f=!1,e.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}}}else if(typeof p=="function")try{f=p(t,t.state,t.context)}catch(d){f=!1,e.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else f=p;const h=c?!f:!!f;if(!t.node||h===a.lastMatch)return;a.lastMatch=h;const _=t.context?.designSystem;_&&(0,k.pushConfig)(_);try{if(h){const d={},y={};let g=!1;for(const x in i){if(!Object.prototype.hasOwnProperty.call(i,x))continue;const E=i[x],L=x.charAt(0);if((L===":"||L==="@"||L==="&")&&E&&typeof E=="object"&&!Array.isArray(E)){if(St(x,t)){const R=J(E,t,!1);Object.keys(R).length&&(y[`[data-theme="${x.slice(1)}"] &`]=R,g=!0)}else{let R=x;if(L==="@"&&!x.startsWith("@media")&&!x.startsWith("@keyframes")){const T=t.context?.designSystem?.media?.[x.slice(1)];T&&(R=`@media ${T}`)}const q=J(E,t,!1);Object.keys(q).length&&(y[R]=q,g=!0)}continue}const z=typeof E=="function"?E(t,t.state,t.context):E;if(z!=null)if(A.CSS_PROPS_REGISTRY[x]){const R=A.CSS_PROPS_REGISTRY[x](z,t,t.state,t.context);if(R){const q=Array.isArray(R)?R:[R];for(const T of q)T&&Object.assign(d,T)}}else A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(x)&&(d[x]=z)}const b=Object.keys(d);if(b.length){X(t.node,d);for(const x of b)s.set(x,n);a.appliedKeys=b}else a.appliedKeys=null;if(g){const x=(0,H.css)(y,null,t.context?.cssPrefix),E=x?x.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const L of E)t.node.classList.add(L);a.appliedClasses=E}else a.appliedClasses=null}else if(a.appliedClasses){for(const x of a.appliedClasses)t.node.classList.remove(x);a.appliedClasses=null}}else{if(a.appliedKeys){for(const d of a.appliedKeys)s.get(d)===n&&(t.node.style[d]="",s.delete(d));a.appliedKeys=null}if(a.appliedClasses){for(const d of a.appliedClasses)t.node.classList.remove(d);a.appliedClasses=null}}}finally{_&&(0,k.popConfig)()}};e.__conditionalRunners.push(l);const u=(0,w.createEffect)(l,{depth:e.path.length,label:j(e,"conditional("+n+")")});e.__effects.push(u)}}const vt=new WeakSet;function Do(t){const e=t.ownerDocument;!e||vt.has(e)||(vt.add(e),queueMicrotask(()=>{vt.delete(e);const s=e.body||e.documentElement;s&&s.offsetWidth}))}const wt=new WeakSet;let Gt=!1;function Oo(t){const{node:e}=t;if(!e)return;if(Gt||(Gt=!0,(0,H.css)({display:"none"})),wt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}wt.add(t);const s=t.context?.designSystem;s&&(0,k.pushConfig)(s),(0,A.pushStaticCssPass)();try{const n={};let r=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&A.CSS_PROPS_REGISTRY.theme){const o=A.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(const i of o)i&&Object.assign(n,i);else Object.assign(n,o);r=!0}}for(const o of Object.keys(t)){if(typeof t[o]=="function"||F.REGISTRY.has(o)||o==="theme")continue;const i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!Q(o)){if(A.CSS_PROPS_REGISTRY[o]){const c=t[o],a=A.CSS_PROPS_REGISTRY[o](c,t,t.state,t.context);if(a){if(Array.isArray(a))for(const l of a)l&&Object.assign(n,l);else Object.assign(n,a);r=!0}}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,r=!0)}else if(o.charCodeAt(0)===45){const c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,r=!0)}else if(o.charAt(0)==="&"||o.charAt(0)==="@"||o.charAt(0)===":"){const c=t[o];if(c&&typeof c=="object"&&!Array.isArray(c)){if(Ct(c))continue;const a=Ht(o,c,t);a&&(n[a.cssProp]=a.block,r=!0)}}}}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 o=(0,H.css)(n,null,t.context?.cssPrefix);if(o&&e.classList){const c=o.split(" ").filter(Boolean);let a=!1;for(const l of c)e.classList.add(l),a||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(a=!0);a&&Do(e)}const i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){const c=n.display;if(c&&c!==i)if(i==="none"){const a=[];for(const l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&a.push(l);for(const l of a)e.classList.remove(l);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,k.popConfig)(),wt.delete(t)}}function Wt(t){const{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const o=t.aria[r];if(typeof o=="function"||typeof o=="object"||o==null)continue;const i="aria-"+r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(i,(0,v.serializeAttrValue)(i,o))}const s=(0,v.applyAttrTransforms)(t);for(const r in s){const o=s[r];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&e.setAttribute(r,o===!0?"":o)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||F.REGISTRY.has(r)||r==="on"||s[r]!==void 0)continue;const o=r.charCodeAt(0);if(!(o>=65&&o<=90)&&!Q(r)&&!(A.CSS_PROPS_REGISTRY[r]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(r))&&(0,v.checkAttributeByTagName)(n,r)){let i=t[r];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=(0,G.replaceLiteralsWithObjectFields)(i,t,t.state,t.context),t[r]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!(0,v.isEnumeratedTrueFalseAttr)((0,v.camelToAttr)(r)||r))continue;const c=(0,v.camelToAttr)(r)||r;e.setAttribute(c,(0,v.serializeAttrValue)(c,i))}}}function Lo(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 i=s.scrollHeight;s.style.height=i+"px",i>0&&(r.lastMeasure=i)}},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 o=typeof e=="object"&&e.max!=null?String(e.max):null;o!==r.appliedMax&&(o==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=o,r.appliedMax=o),r.resize()}function $o(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"?P(t,t.autoGrowDeps,n):null,o=(0,w.createEffect)(()=>{const i=t.autoGrow;let c=i;if(typeof i=="function")try{c=(i===n&&r?r:i)(t,t.state,t.context)}catch{c=null}Lo(t,c)},{depth:s.path.length,label:j(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(o),r&&(s.__exec.autoGrow=n)}const zt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Yt(t,e){for(const s of Object.keys(t)){if(!Q(s)||zt.has(s))continue;const n=(0,tt.globalEventKeyInfo)(s);if(n){(0,tt.registerGlobalEvent)(n,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const i=r;r=function(a){return t.call(i,a)}}if(typeof r!="function")continue;const o=_o(s);F.LIFECYCLE_EVENTS.has(o)||(0,tt.registerEvent)(go(o),t,r)}Mo(t)}function Mo(t){const e=t.node;if(!e||!e.addEventListener)return;const s={};let n=!1;for(const p of zt){const h=t[p];typeof h=="function"&&(s[p]=h,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,c=0,a=0,l=!1;const u=p=>{const h=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];h&&(i=h.clientX,c=h.clientY,a=Date.now(),l=!0)},f=p=>{if(!l)return;l=!1;const h=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!h)return;const _=h.clientX-i,d=h.clientY-c,y=Date.now()-a;if(y>o)return;const g=Math.abs(_),b=Math.abs(d);if(Math.max(g,b)<r)return;let x;if(g>b*1.2)x=_<0?"left":"right";else if(b>g*1.2)x=d<0?"up":"down";else return;const E="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),L=s[E],z=s.onSwipe;L&&L.call(t,p,t,t.state,t.context),z&&z.call(t,{direction:x,dx:_,dy:d,dt:y,event:p},t,t.state,t.context)};e.addEventListener("touchstart",u,{passive:!0}),e.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",u)}catch{}try{e.removeEventListener("touchend",f)}catch{}})}function it(t,e){const s={...t};for(const n in e){const r=s[n],o=e[n];r&&o&&typeof r=="object"&&typeof o=="object"&&!Array.isArray(r)&&!Array.isArray(o)&&typeof r!="function"&&typeof o!="function"?s[n]=it(r,o):s[n]=o}return s}function jt(t,e,s){if(!e||!t.node)return;const n=t.childExtends;if(Array.isArray(e)){const r=t.tag==="fragment",o=t.context?.document||globalThis.document,i=r?null:o?.createDocumentFragment();if(!r&&!i)return;const c=t.childProps,a=t.childrenAs;for(let l=0;l<e.length;l++){let u=e[l];const f=u;(typeof u=="string"||typeof u=="number")&&(u={text:u});let p=c;if(typeof c=="function")try{p=c(t,u)}catch{p=null}if(a==="state"){let d=f;(typeof f=="string"||typeof f=="number")&&(d={value:f,text:f}),u=p?{...p,state:d}:{state:d}}else p&&(u=it(p,u));if(n&&!u.ignoreChildExtends)if(u.extends){const d=Array.isArray(u.extends)?u.extends:[u.extends],y=Array.isArray(n)?n:[n];u={...u,extends:[...y,...d]}}else u={...u,extends:n};const h=u?.key||f&&typeof f=="object"&&f.key||`${l}`;let _;try{_=V(u,t,h,s)}catch(d){if(typeof console<"u"&&console.error){const y=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${h}" failed to construct at ${y} (initial render, skipping this row):`,d?.message||d)}continue}!r&&_?.node&&i.appendChild(_.node)}return r||t.node.appendChild(i),!0}if(typeof e=="string"){const r=Nt(e,t);if(Array.isArray(r))return jt(t,r,s)}if(typeof e=="object")for(const r in e){if(F.REGISTRY.has(r))continue;let o=e[r];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=it(t.childProps,o)),n&&!o.ignoreChildExtends)if(o.extends){const i=Array.isArray(o.extends)?o.extends:[o.extends],c=Array.isArray(n)?n:[n];o={...o,extends:[...c,...i]}}else o={...o,extends:n};V(o,t,r,s)}}}function Et(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,o=r&&r.__exec&&r.__exec.value,i=typeof o=="function",c=t.value!=null&&typeof t.value!="function";if(i||c){let u;if(i)try{u=o(t,t.state,t.context)}catch{return}else u=t.value;const f=u==null?"":String(u);s.value!==f&&(s.value=f);return}const a=e||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!a)return;let l=-1;for(let u=0;u<n.length;u++)n[u].defaultSelected&&(l=u);l>=0&&s.selectedIndex!==l&&(s.selectedIndex=l)}function qt(t,e){let{children:s,content:n}=t;const r=t.childExtends;if(typeof s=="function"){const f=s;try{s=f(t,t.state,t.context)}catch(y){if(s=void 0,typeof console<"u"&&console.error){const g=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${g} (initial run, treating as empty):`,y?.message||y)}}t.children=s;const p=t.__ref;let h=!1;const _=P(t,t.childrenDeps,f),d=(0,w.createEffect)(()=>{const y=h;h=!0;let g;try{g=_(t,t.state,t.context)}catch(T){if(typeof console<"u"&&console.error){const N=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${N}${y?"":" (initial tracking run)"}:`,T?.message||T)}return}if(!y||g===t.children)return;t.children=g;const b=typeof t.onContentUpdate=="function",x=b?[]:null,E=b?[]:null,L=b?[]:null;if(Array.isArray(g)&&t.childrenAs==="state"){const T=t.childProps,N=[],Tt=new Map;for(let S=0;S<g.length;S++){const $=g[S];let C=T;if(typeof T=="function")try{C=T(t,$)}catch{C=null}const B=C&&C.key||$&&$.key||`${S}`;N.push(B),Tt.set(B,{rawChild:$,childProps:C})}const oo=new Set(N),so=p.__children.slice();for(const S of so)if(!oo.has(S)){const $=t[S];$?.remove&&$.remove(),delete t[S],E&&E.push(S)}const ot=t.childExtends,ut=t.tag==="fragment",eo=t.context?.document||globalThis.document,st=ut?null:eo?.createDocumentFragment(),pt=new Set;for(const S of N){const $=Tt.get(S),C=$.rawChild,B=t[S];if(B&&B.state){if(C&&typeof C=="object"){const O=B.state,Z=O.$replace||O.replace,Dt=O.$update||O.update;try{if(typeof Z=="function")Z.call(O,C);else if(typeof Dt=="function"){for(const M in O)if(!(M==="__element"||M==="root"||M==="parent"||M==="update")&&!Object.prototype.hasOwnProperty.call(C,M))try{O[M]=void 0}catch{}Dt.call(O,C)}else for(const M in C)O[M]=C[M]}catch(M){if(typeof console<"u"&&console.error){const no=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${S}" failed to patch at ${no} (reconcile, keeping its previous data for this pass):`,M?.message||M)}}}L&&L.push(S);continue}let yt=C;(typeof C=="string"||typeof C=="number")&&(yt={value:C,text:C});const Pt=$.childProps;let I=Pt?{...Pt,state:yt}:{state:yt};if(ot&&!I.ignoreChildExtends)if(I.extends){const O=Array.isArray(I.extends)?I.extends:[I.extends],Z=Array.isArray(ot)?ot:[ot];I={...I,extends:[...Z,...O]}}else I={...I,extends:ot};let ht;try{ht=V(I,t,S,e)}catch(O){if(typeof console<"u"&&console.error){const Z=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${S}" failed to construct at ${Z} (reconcile, skipping this row):`,O?.message||O)}pt.add(S);continue}!ut&&ht?.node&&st&&st.appendChild(ht.node),x&&x.push(S)}if(!ut&&st&&st.childNodes.length&&t.node&&t.node.appendChild(st),!ut&&t.node){let S=null;for(const $ of N){const C=t[$]?.node;if(!C)continue;const B=S?S.nextSibling:t.node.firstChild;C!==B&&t.node.insertBefore(C,B),S=C}}p.__children=pt.size?N.filter(S=>!pt.has(S)):N,b&&(x.length||E.length)&&Rt(t,{added:x,removed:E,kept:L}),Et(t,!1);return}const q=b?[...p.__children]:null;for(const T of[...p.__children]){const N=t[T];N?.remove&&N.remove(),delete t[T]}p.__children=[],jt(t,g,e),Et(t,!1),b&&Rt(t,{added:[...p.__children],removed:q,kept:[]})},{depth:p.path.length,label:j(p,"children")});p.__effects.push(d)}const o=jt(t,s,e);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=it(t.childProps,f)),r&&!f.ignoreChildExtends)if(f.extends){const p=Array.isArray(f.extends)?f.extends:[f.extends],h=Array.isArray(r)?r:[r];f={...f,extends:[...h,...p]}}else f={...f,extends:r};V(f,t,"content",e)}if(s&&!o)return;const i=t.context?.components||{};{const f=Object.keys(t);for(let p=0;p<f.length;p++){const h=f[p];if(!h.endsWith("Extends")||typeof t[h]!="string")continue;const _=h.slice(0,-7);if(!_||_.charCodeAt(0)<65||_.charCodeAt(0)>90)continue;const d={extends:t[h]};delete t[h];for(let y=p+1;y<f.length;y++){const g=f[y],b=g.charCodeAt(0);if(b>=65&&b<=90||F.REGISTRY.has(g)||typeof t[g]=="function"&&(g.startsWith("on")||g.startsWith(".")))break;const x=t[g];x!==void 0&&(d[g]=x,delete t[g])}t[_]&&typeof t[_]=="object"?t[_]={...d,...t[_]}:t[_]=d}}const c=e?.mountYield===!0||t.yieldChildren===!0,a=Object.keys(t),l=f=>{if(F.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return;const p=f.charCodeAt(0);if(p<65||p>90)return;let h=t[f];if(!h.__ref){if(!h.extends&&!h.extend){const _=i[f]||i[`smbls.${f}`];_&&(h={...h,extends:_})}if(t.childProps&&(h=it(t.childProps,h)),r&&!h.ignoreChildExtends)if(h.extends){const _=Array.isArray(h.extends)?h.extends:[h.extends],d=Array.isArray(r)?r:[r];h={...h,extends:[...d,..._]}}else h={...h,extends:r};V(h,t,f,e)}};if(!c){for(const f of a)l(f);return}(0,W.openMountBudget)();const u=f=>{for(let p=f;p<a.length;p++)if(l(a[p]),p+1<a.length&&(0,W.mountBudgetExhausted)()){const h=p+1;(0,W.enqueueMountWork)(()=>u(h));return}};u(0),(0,W.closeMountBudget)()}function Zt(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 i=r.parentNode;if(i){if(s?.position==="before"&&s.node)i.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;i.insertBefore(n,c||r)}else i.insertBefore(n,r);return}}const o=e?.node||(e?.nodeType?e:null);if(o)if(s?.position==="before"&&s.node)o.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const i=s.node.nextSibling;i?o.insertBefore(n,i):o.appendChild(n)}else o.appendChild(n)}const lt=3;function to(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=lt?!1:(t.__inBeforeUpdate=!0,!0)}function ft(t,e){t&&(t.__inBeforeUpdate=!1,e?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===lt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${lt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function K(t,e,s){const n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&(0,U.runPluginHook)(n,e,s);const r="on"+t,o=e[r];if(typeof o=="function"){const a=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(a){if(e.__ref[a])return!0;e.__ref[a]=!0}const l=e.context?.designSystem;l&&(0,k.pushConfig)(l);let u=!!a;try{const f=o(e,e.state,e.context,s);if(f&&typeof f.then=="function"){const p=e.__ref;return f.catch(h=>{e.context?.plugins?.length&&(0,U.runPluginHook)("error",e,{hook:r,error:h})||console.error(`[DOMQL] Lifecycle "${r}" error:`,h)}).finally(()=>{a&&p&&(p[a]=!1)}),u=!1,!0}if(f===!1)return!1}catch(f){if(e.context?.plugins?.length&&(0,U.runPluginHook)("error",e,{hook:r,error:f})||console.error(`[DOMQL] Lifecycle "${r}" error:`,f),e.context?.strictMode)throw f}finally{l&&(0,k.popConfig)(),u&&e.__ref&&(e.__ref[a]=!1)}}return!0}var Ro=V;
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(n,e)=>{for(var t in e)s(n,t,{get:e[t],enumerable:!0})},u=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f(e))!g.call(n,o)&&o!==t&&s(n,o,{get:()=>e[o],enumerable:!(i=_(e,o))||i.enumerable});return n};var c=n=>u(s({},"__esModule",{value:!0}),n);var N={};d(N,{ELEMENT_ID_ENGINE_KEY:()=>r,__resetElementIdEngine:()=>I,resolveElementIdEngine:()=>p});module.exports=c(N);var E=require("./version.js");const r="__SMBLS_ELEMENT_ID_ENGINE__",p=(n,e,t)=>{const i=e||E.VERSION,o=t||(typeof globalThis<"u"?globalThis:null);if(!o)return n;const l=o[r];return l&&l.engine&&l.version===i?l.engine:(l||(o[r]={version:i,engine:n}),n)},I=n=>{const e=n||(typeof globalThis<"u"?globalThis:null);e&&delete e[r]};
@@ -0,0 +1 @@
1
+ "use strict";var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var g=(n,e)=>{for(var o in e)l(n,o,{get:e[o],enumerable:!0})},M=(n,e,o,f)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of h(e))!_.call(n,i)&&i!==o&&l(n,i,{get:()=>e[i],enumerable:!(f=p(e,i))||f.enumerable});return n};var y=n=>M(l({},"__esModule",{value:!0}),n);var U={};g(U,{MOUNT_YIELD_BUDGET_MS:()=>m,__flushMountQueueSync:()=>E,__pendingMountChunks:()=>k,__resetMountQueue:()=>B,closeMountBudget:()=>w,enqueueMountWork:()=>D,mountBudgetExhausted:()=>x,openMountBudget:()=>T});module.exports=y(U);const m=50,r=[];let s=!1,t=0;function c(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function a(n){const e=typeof globalThis<"u"?globalThis.scheduler:null;if(e&&typeof e.yield=="function"){e.yield().then(n,n);return}if(typeof MessageChannel=="function"){const o=new MessageChannel;o.port1.onmessage=()=>{o.port1.close(),n()},o.port2.postMessage(0);return}setTimeout(n,0)}function x(){return t?c()-t>=50:!1}let u=0;function T(){u===0&&!t&&(t=c()),u++}function w(){u>0&&u--,u===0&&!s&&(t=0)}function D(n){r.push(n),s||(s=!0,a(d))}function d(){for(t=c();r.length;){const n=r.shift();try{n()}catch(e){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",e?.message||e)}if(c()-t>=50)break}if(r.length){a(d);return}s=!1,t=0,u=0}function E(){let e=0;for(t=0;r.length&&e++<1e5;){const o=r.shift();try{o()}catch(f){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",f?.message||f)}}s=!1,t=0,u=0}function k(){return r.length}function B(){r.length=0,s=!1,t=0,u=0}
@@ -0,0 +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.781";
@@ -1,6 +1,6 @@
1
- import{createStore as lt,createScopeStore as to,isStore as B}from"@symbo.ls/signal";import{createEffect as C}from"@symbo.ls/signal";import{cacheNode as pt,detectTag as Ot}from"./cache.js";import{REGISTRY as K,LIFECYCLE_EVENTS as oo}from"./registry.js";import{registerEvent as so,registerGlobalEvent as no,globalEventKeyInfo as eo}from"./delegate.js";import{applyExtends as ro}from"./extends.js";import{addMethods as io}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as et}from"./devRuntime.js";import{replaceLiteralsWithObjectFields as yt}from"@symbo.ls/utils";import{runPluginHook as U}from"@symbo.ls/utils/function.js";import{applyStateMethods as J}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as T,DEFAULT_CSS_PROPERTIES_LIST as E,pushStaticCssPass as co,popStaticCssPass as ao}from"css-in-props";import{css as rt,wrapHoverRule as $t}from"@symbo.ls/css";import{pushConfig as L,popConfig as O}from"@symbo.ls/scratch";import{checkAttributeByTagName as ht,applyAttrTransforms as fo,camelToAttr as _t,serializeAttrValue as z,isEnumeratedTrueFalseAttr as it}from"attrs-in-props";let uo=1;const m=[];let gt=!1;function Mt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function lo(){return typeof document<"u"&&document.visibilityState==="hidden"}const po=250;function Rt(){if(!gt){if(gt=!0,typeof requestAnimationFrame!="function"){setTimeout(bt,0);return}lo()?setTimeout(bt,po):requestAnimationFrame(bt)}}const yo=300,ho=15e4;function bt(){if(gt=!1,!m.length)return;const t=m.splice(0,m.length);for(let n=0;n<t.length;n++){const s=t[n];if(s.node){if(!s.node.isConnected){const e=s.__ref||(s.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=Mt());const r=Mt()-e.__mountFirstAttemptAt;e.__mountAttempts<=yo&&r<ho?(m.push(s),Rt()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}I("Mounted",s,s.__ref?.__mountOptions||{})}}}function Nt(t,n){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=n,m.push(t),Rt())}function Ft(t,n){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&U("contentUpdate",t,n);const s=t.context?.designSystem;s&&L(s);try{t.onContentUpdate(t,t.state,t.context,n)}catch(e){if(t.context?.plugins?.length&&U("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{s&&O()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function _o(t){return t.charAt(2).toLowerCase()+t.slice(3)}function go(t){return t.toLowerCase()}function xt(t){const n=t.charCodeAt(0);return n===58||n===64||n===38}function tt(t,n){const s={...t};for(const e in n){const r=s[e],o=n[e];r&&o&&typeof r=="object"&&typeof o=="object"&&!Array.isArray(r)&&!Array.isArray(o)&&typeof r!="function"&&typeof o!="function"?s[e]=tt(r,o):s[e]=o}return s}function H(t,n,s,e={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=s||t.key||`_${uo++}`,o.parent=n||null,o.context=t.context||n?.context||e.context||{},o.context.__create||(o.context.__create=H);const c=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:n?.__ref?.root||o,path:n?.__ref?.path?[...n.__ref.path,o.key]:[o.key],origin:t};if(s&&!t.extends&&!t.extend){const d=s.indexOf("_");if(d>0){const p=s.substring(0,d),g=o.context?.components;g&&(g[p]||g["smbls."+p])?t={...t,extends:p}:g&&et()&&/^[A-Z]\w*_\d+$/.test(s)&&console.warn(`[smbls] auto-extend: key "${s}" looks like a multi-instance (${p}_N) but neither "${p}" nor "smbls.${p}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}ro(o,t,e);const i=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(const d in t){if(d==="parent"||d==="node"||d==="__ref"||d==="extends"||d==="context"||d==="props")continue;const p=t[d],g=o[d],x=g&&p&&typeof g=="object"&&typeof p=="object"&&!Array.isArray(g)&&!Array.isArray(p)&&typeof g!="function"&&typeof p!="function";x&&d.charCodeAt(0)>=65&&d.charCodeAt(0)<=90?o[d]=tt(g,p):x&&i.has(d)?o[d]={...g,...p}:x&&xt(d)?o[d]=tt(g,p):o[d]=p}function f(d){for(const p in d){const g=d[p],x=o[p],b=x&&g&&typeof x=="object"&&typeof g=="object"&&!Array.isArray(x)&&!Array.isArray(g)&&typeof x!="function"&&typeof g!="function";b&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?o[p]=tt(x,g):b&&i.has(p)?o[p]={...x,...g}:b&&xt(p)?o[p]=tt(x,g):o[p]=g}}a&&f(a),t.props&&typeof t.props=="object"&&f(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const u=o.scope&&typeof o.scope=="object"?o.scope:null,l=n?.scope,y=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,h=l||y||null;if(t.scope!==void 0||u){const d={};u&&Object.assign(d,u),t.scope!==void 0&&Object.assign(d,t.scope),o.scope=to(d,h)}else h&&(o.scope=h);if(t.if!==void 0&&(o.if=t.if),io(o),bo(o,n,t),o.if!=null){let d;if(typeof o.if=="function")try{d=o.if(o,o.state,o.context)}catch(p){if(d=!1,c.__ifError=p,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,p?.message||p)}}else d=o.if;c.__if=!!d}if(c.__if)typeof o.if=="function"&&(c.__ifInitialized=!0);else return n&&(n[o.key]=o),typeof o.if=="function"&&Kt(o,c,o.if),o;o.tag||(o.tag=Ot(o)),I("Init",o,e);const _=o.node=pt(o);if(!_)return o;if(o.tag==="fragment"){const p=(o.context?.document||globalThis.document).createComment("");_.appendChild(p),c.__fragmentAnchor=p}I("AttachNode",o,e),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),n&&(n[o.key]=o,n.__ref?.__children&&(n.__ref.__children.includes(o.key)||n.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Qt(o,e),It(o),kt(o),Yt(o),Mo(o);try{Zt(o,e)}catch(d){if(typeof console<"u"&&console.error){const p=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${p}:`,d?.message||d,d?.stack?`
1
+ import{createStore as pt,createScopeStore as ro,isStore as K}from"@symbo.ls/signal";import{createEffect as S}from"@symbo.ls/signal";import{cacheNode as yt,detectTag as Mt}from"./cache.js";import{REGISTRY as V,LIFECYCLE_EVENTS as io}from"./registry.js";import{registerEvent as co,registerGlobalEvent as ao,globalEventKeyInfo as fo}from"./delegate.js";import{applyExtends as uo}from"./extends.js";import{addMethods as lo}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as rt}from"./devRuntime.js";import{mountBudgetExhausted as po,openMountBudget as yo,closeMountBudget as ho,enqueueMountWork as _o}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as ht,isPolyglotWritableKey as go,markPolyglotSeeded as bo}from"@symbo.ls/utils";import{runPluginHook as U}from"@symbo.ls/utils/function.js";import{applyStateMethods as m}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as E,DEFAULT_CSS_PROPERTIES_LIST as w,pushStaticCssPass as xo,popStaticCssPass as Ao}from"css-in-props";import{css as it,wrapHoverRule as Rt}from"@symbo.ls/css";import{pushConfig as D,popConfig as O}from"@symbo.ls/scratch";import{checkAttributeByTagName as _t,applyAttrTransforms as ko,camelToAttr as gt,serializeAttrValue as Y,isEnumeratedTrueFalseAttr as ct}from"attrs-in-props";import{resolveElementIdEngine as So}from"./engineRegistry.js";import{VERSION as Co}from"./version.js";const Nt=So({uniqId:1,scopedStyleId:0},Co),tt=[];let bt=!1;function Ft(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function vo(){return typeof document<"u"&&document.visibilityState==="hidden"}const wo=250;function It(){if(!bt){if(bt=!0,typeof requestAnimationFrame!="function"){setTimeout(xt,0);return}vo()?setTimeout(xt,wo):requestAnimationFrame(xt)}}const jo=300,Eo=15e4;function xt(){if(bt=!1,!tt.length)return;const t=tt.splice(0,tt.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=Ft());const r=Ft()-n.__mountFirstAttemptAt;n.__mountAttempts<=jo&&r<Eo?(tt.push(s),It()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}B("Mounted",s,s.__ref?.__mountOptions||{})}}}function Ut(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,tt.push(t),It())}function Bt(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&U("contentUpdate",t,e);const s=t.context?.designSystem;s&&D(s);try{t.onContentUpdate(t,t.state,t.context,e)}catch(n){if(t.context?.plugins?.length&&U("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&O()}}function q(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function To(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Po(t){return t.toLowerCase()}function At(t){const e=t.charCodeAt(0);return e===58||e===64||e===38}function ot(t,e){const s={...t};for(const n in e){const r=s[n],o=e[n];r&&o&&typeof r=="object"&&typeof o=="object"&&!Array.isArray(r)&&!Array.isArray(o)&&typeof r!="function"&&typeof o!="function"?s[n]=ot(r,o):s[n]=o}return s}function G(t,e,s,n={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=s||t.key||`_${Nt.uniqId++}`,o.parent=e||null,o.context=t.context||e?.context||n.context||{},o.context.__create||(o.context.__create=G);const i=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 d=s.indexOf("_"),y=s.indexOf(".");let g=d>0?d:-1;if(y>0&&(g<0||y<g)&&(g=y),g>0){const b=s.substring(0,g),x=o.context?.components;x&&(x[b]||x["smbls."+b])?t={...t,extends:b}:x&&rt()&&(/^[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.`)}}uo(o,t,n);const c=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(const d in t){if(d==="parent"||d==="node"||d==="__ref"||d==="extends"||d==="context"||d==="props")continue;const y=t[d],g=o[d],b=g&&y&&typeof g=="object"&&typeof y=="object"&&!Array.isArray(g)&&!Array.isArray(y)&&typeof g!="function"&&typeof y!="function";b&&d.charCodeAt(0)>=65&&d.charCodeAt(0)<=90?o[d]=ot(g,y):b&&c.has(d)?o[d]={...g,...y}:b&&At(d)?o[d]=ot(g,y):o[d]=y}function l(d){for(const y in d){const g=d[y],b=o[y],x=b&&g&&typeof b=="object"&&typeof g=="object"&&!Array.isArray(b)&&!Array.isArray(g)&&typeof b!="function"&&typeof g!="function";x&&y.charCodeAt(0)>=65&&y.charCodeAt(0)<=90?o[y]=ot(b,g):x&&c.has(y)?o[y]={...b,...g}:x&&At(y)?o[y]=ot(b,g):o[y]=g}}a&&l(a),t.props&&typeof t.props=="object"&&l(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const u=o.scope&&typeof o.scope=="object"?o.scope:null,f=e?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,h=f||p||null;if(t.scope!==void 0||u){const d={};u&&Object.assign(d,u),t.scope!==void 0&&Object.assign(d,t.scope),o.scope=ro(d,h)}else h&&(o.scope=h);if(t.if!==void 0&&(o.if=t.if),lo(o),Do(o,e,t),o.if!=null){let d;if(typeof o.if=="function")try{d=o.if(o,o.state,o.context)}catch(y){if(d=!1,i.__ifError=y,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,y?.message||y)}}else d=o.if;i.__if=!!d}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&Gt(o,i,o.if),o;o.tag||(o.tag=Mt(o)),B("Init",o,n);const _=o.node=yt(o);if(!_)return o;if(o.tag==="fragment"){const y=(o.context?.document||globalThis.document).createComment("");_.appendChild(y),i.__fragmentAnchor=y}B("AttachNode",o,n),_.setAttribute&&o.key&&_.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))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Jt(o,n),Vt(o),St(o),Qt(o),Wo(o);try{mt(o,n)}catch(d){if(typeof console<"u"&&console.error){const y=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${y}:`,d?.message||d,d?.stack?`
2
2
  `+d.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(Tt(o,!0),Xt(o,n,r),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const d=o.context?.designSystem;d&&L(d);try{const p=o.html(o,o.state,o.context);p!=null&&typeof p!="function"&&(o.node.innerHTML=p)}catch{}finally{d&&O()}}if(I("Create",o,e),I("Complete",o,e),I("Render",o,e),I("RenderRouter",o,e),Nt(o,e),typeof o.onFrame=="function"){const d=o.onFrame,p=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){p&&L(p);try{d(o,o.state,o.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{p&&O()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function bo(t,n,s){const e=!n,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,o=e&&r&&t.context?.state,c=s.state!==void 0&&!o?s.state:t.state&&!B(t.state)?t.state:void 0;if(c==null){if(n?.state)t.state=n.state,J(t,t.state);else if(t.context?.state){const i=t.context.state,a={...i},f=t.context?.polyglot;if(f?.translations){const u=i.lang||f.defaultLang||"en",l=f.translations[u];if(l&&typeof l=="object")for(const h in l)a[h]===void 0&&(a[h]=l[h]);const y=new Set(f.languages||[]);for(const h in f.translations)!y.has(h)&&a[h]===void 0&&(a[h]=f.translations[h])}t.state=B(a)?a:lt(a),t.state.__element=t,t.state.root=t.state,J(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),J(t,t.state);return}if(typeof c=="string"){if(t.state=Ut(c,n),t.state&&typeof t.state=="object"&&!B(t.state)){const i=n?.state?.root||n?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}J(t,t.state);return}if(typeof c=="function"){const i=c(t,n?.state);t.state=B(i)?i:lt(i||{})}else B(c)?t.state=c:t.state=lt({...c});t.state.__element=t,n?.state?(t.state.parent=n.state,t.state.root=n.state.root||n.state):t.state.root=t.state,J(t,t.state)}function At(t,n){if(!n)return t;const s=n.split("/");let e=t;for(const r of s){if(e==null)return{};e=e[r]}return e??{}}function Ut(t,n){if(!n)return{};if(t===".")return n.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?At(n.state,r):n.state??{}}if(t.startsWith("~/")){const r=n.state?.root||n.state,o=t.slice(2);return o?At(r,o):r??{}}if(n.state?.[t]!==void 0)return n.state[t];const s=At(n.state,t);if(s!=null&&Object.keys(s).length>0)return s;const e=n.context?.polyglot;if(e?.translations){const r=n.state?.root?.lang||e.defaultLang||"en",o=e.translations[r];if(o?.[t]!==void 0)return o[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const xo=new Set(["s","state","ctx","context"]);function Ao(t){try{const s=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function ko(t){if(typeof t!="function"||t.length!==2)return!1;const n=Ao(t);if(n.length<2)return!1;const s=n[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!xo.has(s)}function Co(t){const n=t.__ref,s=t.tag||"div",e=t.context?.designSystem,r=[],o=Object.keys(t);for(let c=0;c<o.length;c++){const i=o[c];if(typeof t[i]!="function"||K.has(i))continue;const a=i.charCodeAt(0);a>=65&&a<=90||Y(i)||T[i]||E&&E.has(i)||ht(s,i)||(et()&&ko(t[i])&&console.warn(`[smbls] custom prop "${i}"${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('${i}', \u2026) instead of reading el.${i}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:i,fn:t[i]}))}for(let c=0;c<r.length;c++){const{prop:i,fn:a}=r[c];n.__exec[i]=a,Object.defineProperty(t,i,{get(){e&&L(e);try{return a(t,t.state,t.context)}catch{return}finally{e&&O()}},set(f){delete n.__exec[i],Object.defineProperty(t,i,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function So(t,n){if(!(!Array.isArray(n)||n.length===0))for(let s=0;s<n.length;s++){const e=n[s];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function P(t,n,s){return!Array.isArray(n)||n.length===0?s:function(...e){return So(t,n),s.apply(this,e)}}function ot(t,n){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[n]}function S(t,n){return()=>t.path.join(".")+"::"+n}function It(t,n){const s=t.__ref,e=!!(n&&n.skipIfEffect);if(Co(t),typeof t.text=="function"){const o=t.text,c=P(t,t.textDeps,o),i=C(()=>{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=yt.call(t,a,t.state)),ct(t,a))}catch{}},{depth:s.path.length,label:S(s,"text")});s.__effects.push(i),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,c=C(()=>{if(s.contentManaged)return;const i=yt.call(t,o,t.state);i!=null&&(t.text=i),t.node&&ct(t,i??"")},{depth:s.path.length,label:S(s,"text")});s.__effects.push(c),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!K.has(o)&&!Y(o)&&!s.__exec[o]){if(T[o]){const c=t[o],i=P(t,t[o+"Deps"],c),a=o;let f;const u=C(()=>{const l=t.context?.designSystem;l&&L(l);try{const y=i(t,t.state,t.context),h=T[a](y,t,t.state,t.context),_=a==="show"||a==="hide";if(h&&t.node){const d=Ct(h),p=_&&t.node.style.display!=="none";(d===null||d!==f||p)&&(f=d,q(t.node,h))}else if(t.node&&_){f=void 0;const d=s.__explicitDisplay;t.node.style.display=typeof d=="string"?d:""}}finally{l&&O()}},{depth:s.path.length,label:S(s,a)});s.__effects.push(u),s.__exec[o]=c}else if(E&&E.has(o)){const c=t[o],i=P(t,t[o+"Deps"],c),a=o;let f;const u=C(()=>{const l=t.context?.designSystem;l&&L(l);try{const y=i(t,t.state,t.context);if(t.node)if(y!=null){const h=a+":"+String(y);h!==f&&(f=h,q(t.node,{[a]:y}))}else f=void 0,t.node.style[a]=""}finally{l&&O()}},{depth:s.path.length,label:S(s,a)});s.__effects.push(u),s.__exec[o]=c}}if(typeof t.html=="function"){const o=t.html,c=P(t,t.htmlDeps,o),i=C(()=>{const a=t.context?.designSystem;a&&L(a);try{const f=c(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&(t.node.innerHTML=f)}finally{a&&O()}},{depth:s.path.length,label:S(s,"html")});s.__effects.push(i),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,c=P(t,t.valueDeps,o),i=C(()=>{try{const a=c(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const f=a==null?"":String(a);if(t.node.value===f)return;const u=typeof document<"u"&&document.activeElement===t.node,l=u&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,y=u&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=f,u&&l!=null&&y!=null)try{t.node.setSelectionRange(l,y)}catch{}}catch{}},{depth:s.path.length,label:S(s,"value")});s.__effects.push(i),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,c=P(t,t.styleDeps,o);let i;const a=C(()=>{const f=c(t,t.state,t.context),u=Ct(f);(u===null||u!==i)&&(i=u,q(t.node,f))},{depth:s.path.length,label:S(s,"style")});s.__effects.push(a),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 i=P(t,ot(t.styleDeps,o),c);let a;const f=C(()=>{try{const u=i(t,t.state,t.context);if(t.node){const l=o+":"+String(u);l!==a&&(a=l,q(t.node,{[o]:u}))}}catch{}},{depth:s.path.length,label:S(s,"style."+o)});s.__effects.push(f)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const c=P(t,ot(t.attrDeps,o),t.attr[o]),i=o,a=C(()=>{try{const f=c(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1&&!it(i)?t.node.removeAttribute(i):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(i,z(i,f)))}catch{}},{depth:s.path.length,label:S(s,"attr."+i)});s.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const c=P(t,ot(t.ariaDeps,o),t.aria[o]),i="aria-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),a=C(()=>{try{const f=c(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null?t.node.removeAttribute(i):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(i,z(i,f))}catch{}},{depth:s.path.length,label:S(s,"aria."+o)});s.__effects.push(a)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const c=P(t,ot(t.dataDeps,o),t.data[o]),a="data-"+o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),f=C(()=>{try{const u=c(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(a):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(a,u===!0?"":u)}catch{}},{depth:s.path.length,label:S(s,"data."+o)});s.__effects.push(f)}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=P(t,ot(t.classDeps,o),r[o]),i=C(()=>{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{}},{depth:s.path.length,label:S(s,"class."+o)});s.__effects.push(i)}!e&&typeof t.if=="function"&&Kt(t,s,t.if);for(const o of Object.keys(t)){if(K.has(o)||typeof t[o]!="function")continue;const c=o.charCodeAt(0);if(c>=65&&c<=90||Y(o))continue;const i=t[o];s.__exec[o]=i;const a=t.tag||"div";if(ht(a,o)&&!T[o]&&!(E&&E.has(o))){const f=_t(o)||o,u=P(t,t[o+"Deps"],i),l=C(()=>{try{const y=u(t,t.state,t.context);t.node?.setAttribute&&(y==null||y===!1&&!it(f)?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&(f==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(f,z(f,y))))}catch{}},{depth:s.path.length,label:S(s,o)});s.__effects.push(l)}}if(Eo(t),Do(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,c=t.stateDeps;let i=!1,a=[];const f=C(()=>{const u=[];for(let _=0;_<c.length;_++){const d=c[_];try{u[_]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{u[_]=void 0}}if(!i){i=!0,a=u;return}let l=u.length!==a.length;for(let _=0;!l&&_<u.length;_++)u[_]!==a[_]&&(l=!0);const y=a;if(a=u,!l)return;const h=t.context?.designSystem;h&&L(h);try{o(t,t.state,t.context,{prev:y,next:u})}catch(_){if(t.context?.plugins?.length&&U("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{h&&O()}},{depth:s.path.length,label:S(s,"onStateUpdate")});s.__effects.push(f)}Po(t)}function Bt(t){const n=t.parent,s=n?.node;if(!s||!t.node){Xt(t,t.parent);return}let e=null;const r=Object.keys(n),o=r.indexOf(t.key);for(let c=o+1;c<r.length;c++){const i=n[r[c]];if(i?.node?.parentNode===s){e=i.node;break}}e?s.insertBefore(t.node,e):s.appendChild(t.node)}function Kt(t,n,s){const e=P(t,t.ifDeps,s),r=C(()=>{let o;try{o=e(t,t.state,t.context)}catch(i){if(o=!1,n.__ifError=i,typeof console<"u"&&console.warn){const a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,i?.message||i)}return}const c=n.__if;if(n.__if=!!o,c&&!n.__if&&t.node)t.node.remove();else if(!c&&n.__if)if(n.__ifInitialized)t.node||(t.node=pt(t)),t.node&&(t.node.ref=t),Bt(t),kt(t);else{if(n.__ifInitialized=!0,t.tag||(t.tag=Ot(t)),I("Init",t,{}),t.node||(t.node=pt(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"&&!n.__fragmentAnchor){const a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),n.__fragmentAnchor=a}I("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Qt(t,{}),It(t,{skipIfEffect:!0}),kt(t),Yt(t),Zt(t,{}),Bt(t),Nt(t,{})}},{depth:n.path.length,label:S(n,"if")});n.__effects.push(r)}function ct(t,n){const s=t.node;if(!s)return;const e=n==null?"":String(n);if(t.tag==="string"){s.nodeValue!==e&&(s.nodeValue=e);return}const r=t.__ref;let o=r?r.__textNode:null;if(o&&o.parentNode!==s&&(o=null),!o){const c=s.firstChild;c&&c.nodeType===3&&(o=c)}o?o.nodeValue!==e&&(o.nodeValue=e):s.firstChild?(o=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),s.insertBefore(o,s.firstChild)):(s.textContent=e,o=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=o||null)}function kt(t){const{node:n}=t;if(n){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&ct(t,t.text),Oo(t),typeof t.html=="string"&&(n.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in n){const s=String(t.value);n.value!==s&&(n.value=s)}if(t.style&&typeof t.style=="object"&&q(n,t.style),t.attr&&typeof t.attr=="object")for(const s in t.attr){const e=t.attr[s];typeof e=="function"||typeof e=="object"||e!=null&&(e===!1&&!it(s)||n.setAttribute&&n.setAttribute(s,z(s,e)))}if(t.data&&typeof t.data=="object")for(const s in t.data){const e=t.data[s];typeof e=="function"||typeof e=="object"||e==null||e===!1||n.dataset&&(n.dataset[s]=e===!0?"":e)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(e=>e&&n.classList.add(e));else if(typeof s=="object")for(const e in s){const r=typeof s[e]=="function"?s[e](t,t.state,t.context):s[e];r&&n.classList.add(typeof r=="string"?r:e)}}}}function Ct(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function q(t,n){if(!t||!n||!t.style)return;let s=null;for(const e in n){const r=n[e];if(r!=null){if(e.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[e]=r;continue}try{const o=String(r),c=e.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),i=o.trim(),a=/\s*!important\s*$/.test(i),f=i.replace(/\s*!important\s*$/,"");t.style.setProperty(c,f,a?"important":"")}catch{}}}s&&wo(t,s)}let vo=0;function wo(t,n){const s=`_ds${vo++}`;t.classList.add(s);const e=t.ownerDocument;let r=e.querySelector("style[data-smbls-scoped]");r||(r=e.createElement("style"),r.setAttribute("data-smbls-scoped",""),e.head.appendChild(r));let o="";for(const c in n){const i="."+s,a=c.replace(/&/g,i).split(",").map(u=>{const l=u.trim();return l.includes(i)?l:i+l}).join(", "),f=n[c];if(typeof f=="object"){let u="",l="";for(const y in f){const h=f[y];if(typeof h=="object"){const _=y.includes("&")?a.split(", ").map(p=>y.replace(/&/g,p)).join(", "):a.split(", ").map(p=>`${p} ${y}`).join(", ");let d="";for(const p in h)d+=`${p.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${h[p]};`;l+=$t(`${_} { ${d} }`,_)+`
5
- `}else u+=`${y.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${h};`}u&&(o+=$t(`${a} { ${u} }`,a)+`
6
- `),l&&(o+=l)}}o&&(r.textContent+=o)}const Vt=new Set;function Ht(t){if(!Array.isArray(t))return"";const n=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&n.push(t[s]);return n.sort(),n.join("|")}function jo(t,n,s){const e=Ht(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=n(t,t.state,t.context)}catch{return}if(Ht(r)===e)return;const o=t.__ref.path?t.__ref.path.join("."):t.key||"?";Vt.has(o)||(Vt.add(o),console.warn(`[smbls] subscribeTo function at "${o}" 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 Eo(t){const n=t.subscribeTo,s=typeof n=="function";let e=n;if(s)try{e=n(t,t.state,t.context)}catch{e=null}if(s&&et()&&jo(t,n,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const r=t.__ref;for(let o=0;o<e.length;o++){const c=e[o];if(typeof c!="string"||c.length===0)continue;const i=c.split("."),a=i[0],f=i.slice(1),u={value:!1},l=C(()=>{const y=t.state&&(B(t.state)?t.state.root:null);if(!y||!B(y))return;let h=y;h=h[a];for(let d=0;d<f.length&&!(h==null||typeof h!="object");d++)if(B(h))h=h[f[d]];else break;if(!u.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"){const d=t.context?.designSystem;d&&L(d);try{if(No(r)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>at(r,!1),g=>{at(r,!0),t.context?.plugins?.length&&U("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}):(at(r,!1),p===!1&&(_=!0))}}catch(p){at(r,!0),t.context?.plugins?.length&&U("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}finally{d&&O()}}if(!_&&t.node&&r.__effects)for(let d=0;d<r.__effects.length;d++){const p=r.__effects[d];p&&p!==l&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}if(!_&&typeof t.onUpdate=="function"){const d=t.context?.designSystem;d&&L(d);try{t.onUpdate(t,t.state,t.context)}catch(p){t.context?.plugins?.length&&U("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}finally{d&&O()}}},{depth:r.path.length,label:S(r,"subscribeTo("+c+")")});u.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function St(t,n){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!n.context?.designSystem?.media?.[t.slice(1)])}const Gt=new Set;function To(t,n){const s=n?.__ref?.path?n.__ref.path.join("."):n?.key||"?",e=s+"::"+t;Gt.has(e)||(Gt.add(e),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 Q(t,n,s){const e={},r=new Set,o=(c,i,a)=>{const f=a?new Set(Object.keys(e)):null;if(T[c]){const u=T[c](i,n,n.state,n.context);if(u){const l=Array.isArray(u)?u:[u];for(const y of l)y&&Object.assign(e,y)}}else e[c]=i;if(a)for(const u in e)f.has(u)||r.add(u)};for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;let i=t[c];if(typeof i=="function"&&(i=i(n,n.state,n.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(c==="style"){for(const l in i){let y=i[l];if(typeof y=="function"&&(y=y(n,n.state,n.context)),y==null||typeof y=="function")continue;const h=typeof n[l]=="function"&&(T[l]||E&&E.has(l));o(l,y,h)}continue}if(St(c,n)){const l=Q(i,n,!1);Object.keys(l).length&&(e[`[data-theme="${c.slice(1)}"] &`]=l);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(c)){et()&&To(c,n);continue}let f=c;if(c.charCodeAt(0)===64&&!c.startsWith("@media")&&!c.startsWith("@keyframes")){const l=n.context?.designSystem?.media?.[c.slice(1)];l&&(f=`@media ${l}`)}const u=Q(i,n,!1);Object.keys(u).length&&(e[f]=u);continue}const a=typeof n[c]=="function"&&(T[c]||E&&E.has(c));o(c,i,a)}if(s)for(const c in e)r.add(c);for(const c of r){const i=e[c];typeof i=="string"&&!i.includes("!important")&&(e[c]=i+" !important")}return e}function vt(t,n){if(n===void 0&&(n=0),n>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)&&vt(t[s],n+1))return!0}return!1}function Wt(t,n,s){if(!n||typeof n!="object"||Array.isArray(n))return null;if(St(t,s)){const o=Q(n,s,!1);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}let e=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){const o=s.context?.designSystem?.media?.[t.slice(1)];o&&(e=`@media ${o}`)}const r=Q(n,s,!1);return Object.keys(r).length?{cssProp:e,block:r}:null}function Po(t){const n=t.__ref;for(const s of Object.keys(t)){if(!xt(s))continue;const e=t[s];if(!e||typeof e!="object"||Array.isArray(e)||!vt(e))continue;let r=null,o;const c=C(()=>{if(!t.node)return;const i=t.context?.designSystem;i&&L(i);let a,f=!1;try{const u=Wt(s,e,t),l=u?Ct(u.block)+"::"+u.cssProp:null;if(l!==null&&l===o)f=!0;else if(o=l,u){const y=rt({[u.cssProp]:u.block},null,t.context?.cssPrefix);a=y?y.split(" ").filter(Boolean):null}else a=null}finally{i&&O()}if(!(f||!t.node.classList)){if(r)for(const u of r)t.node.classList.remove(u);if(a&&a.length)for(const u of a)t.node.classList.add(u);r=a}},{depth:n.path.length,label:S(n,"cssBlock("+s+")")});n.__effects.push(c)}}function Do(t){const n=t.__ref;n.__conditionalRunners=[];const s=new Map;for(const e of Object.keys(t)){const r=e.charAt(0);if(r!=="."&&r!=="!")continue;const o=e.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const l=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${l}: { '${o.slice(l.length)}': {...} }\`.`)}continue}const c=t[e];if(!c||typeof c!="object")continue;const i=r==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},f=()=>{let l;const y=t[o];if(y===void 0){const d=!!t.state&&o in t.state,p=t.state?t.state[o]:void 0;if(d||p!==void 0)l=p;else{const g=t.context?.cases?.[o];if(g===void 0)return;try{l=typeof g=="function"?g.call(t,t):g}catch(x){l=!1,n.__conditionalError=x,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,x?.message||x)}}}else if(typeof y=="function")try{l=y(t,t.state,t.context)}catch(d){l=!1,n.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else l=y;const h=i?!l:!!l;if(!t.node||h===a.lastMatch)return;a.lastMatch=h;const _=t.context?.designSystem;_&&L(_);try{if(h){const d={},p={};let g=!1;for(const b in c){if(!Object.prototype.hasOwnProperty.call(c,b))continue;const j=c[b],v=b.charAt(0);if((v===":"||v==="@"||v==="&")&&j&&typeof j=="object"&&!Array.isArray(j)){if(St(b,t)){const $=Q(j,t,!1);Object.keys($).length&&(p[`[data-theme="${b.slice(1)}"] &`]=$,g=!0)}else{let $=b;if(v==="@"&&!b.startsWith("@media")&&!b.startsWith("@keyframes")){const V=t.context?.designSystem?.media?.[b.slice(1)];V&&($=`@media ${V}`)}const G=Q(j,t,!1);Object.keys(G).length&&(p[$]=G,g=!0)}continue}const w=typeof j=="function"?j(t,t.state,t.context):j;if(w!=null)if(T[b]){const $=T[b](w,t,t.state,t.context);if($){const G=Array.isArray($)?$:[$];for(const V of G)V&&Object.assign(d,V)}}else E&&E.has(b)&&(d[b]=w)}const x=Object.keys(d);if(x.length){q(t.node,d);for(const b of x)s.set(b,e);a.appliedKeys=x}else a.appliedKeys=null;if(g){const b=rt(p,null,t.context?.cssPrefix),j=b?b.split(" ").filter(Boolean):[];if(j.length&&t.node.classList){for(const v of j)t.node.classList.add(v);a.appliedClasses=j}else a.appliedClasses=null}else if(a.appliedClasses){for(const b of a.appliedClasses)t.node.classList.remove(b);a.appliedClasses=null}}else{if(a.appliedKeys){for(const d of a.appliedKeys)s.get(d)===e&&(t.node.style[d]="",s.delete(d));a.appliedKeys=null}if(a.appliedClasses){for(const d of a.appliedClasses)t.node.classList.remove(d);a.appliedClasses=null}}}finally{_&&O()}};n.__conditionalRunners.push(f);const u=C(f,{depth:n.path.length,label:S(n,"conditional("+e+")")});n.__effects.push(u)}}const wt=new WeakSet;function Lo(t){const n=t.ownerDocument;!n||wt.has(n)||(wt.add(n),queueMicrotask(()=>{wt.delete(n);const s=n.body||n.documentElement;s&&s.offsetWidth}))}const jt=new WeakSet;let zt=!1;function Oo(t){const{node:n}=t;if(!n)return;if(zt||(zt=!0,rt({display:"none"})),jt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}jt.add(t);const s=t.context?.designSystem;s&&L(s),co();try{const e={};let r=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&T.theme){const o=T.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(const c of o)c&&Object.assign(e,c);else Object.assign(e,o);r=!0}}for(const o of Object.keys(t)){if(typeof t[o]=="function"||K.has(o)||o==="theme")continue;const c=o.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(o)){if(T[o]){const i=t[o],a=T[o](i,t,t.state,t.context);if(a){if(Array.isArray(a))for(const f of a)f&&Object.assign(e,f);else Object.assign(e,a);r=!0}}else if(E&&E.has(o)){const i=t[o];i!=null&&typeof i!="object"&&(e[o]=i,r=!0)}else if(o.charCodeAt(0)===45){const i=t[o];i!=null&&typeof i!="object"&&(e[o]=i,r=!0)}else if(o.charAt(0)==="&"||o.charAt(0)==="@"||o.charAt(0)===":"){const i=t[o];if(i&&typeof i=="object"&&!Array.isArray(i)){if(vt(i))continue;const a=Wt(o,i,t);a&&(e[a.cssProp]=a.block,r=!0)}}}}if(r){e.display&&String(e.display).includes("!important")&&(n.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const o=rt(e,null,t.context?.cssPrefix);if(o&&n.classList){const i=o.split(" ").filter(Boolean);let a=!1;for(const f of i)n.classList.add(f),a||(f.charCodeAt(0)===95&&f.charCodeAt(1)===99||f.charCodeAt(0)===95&&f.indexOf("_c",1)!==-1)&&(a=!0);a&&Lo(n)}const c=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(c!=null){const i=e.display;if(i&&i!==c)if(c==="none"){const a=[];for(const f of n.classList)f.startsWith("_d-")&&f!=="_d-none"&&a.push(f);for(const f of a)n.classList.remove(f);n.classList.add("_d-none")}else n.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(n.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}}finally{ao(),s&&O(),jt.delete(t)}}function Yt(t){const{node:n}=t;if(!n||!n.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const o=t.aria[r];if(typeof o=="function"||typeof o=="object"||o==null)continue;const c="aria-"+r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());n.setAttribute(c,z(c,o))}const s=fo(t);for(const r in s){const o=s[r];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&n.setAttribute(r,o===!0?"":o)}const e=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||K.has(r)||r==="on"||s[r]!==void 0)continue;const o=r.charCodeAt(0);if(!(o>=65&&o<=90)&&!Y(r)&&!(T[r]||E&&E.has(r))&&ht(e,r)){let c=t[r];if(c==null||(typeof c=="string"&&c.includes("{{")&&(c=yt(c,t,t.state,t.context),t[r]=c),c==null||typeof c=="function"||typeof c=="object")||c===!1&&!it(_t(r)||r))continue;const i=_t(r)||r;n.setAttribute(i,z(i,c))}}}function $o(t,n){const s=t.node,e=t.__ref;let r=e.__autoGrow;if(!n){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=e.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(s.scrollHeight===0&&r.lastMeasure>0)return;s.style.height="auto";const c=s.scrollHeight;s.style.height=c+"px",c>0&&(r.lastMeasure=c)}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}})),r.active||(s.addEventListener("input",r.resize),r.active=!0);const o=typeof n=="object"&&n.max!=null?String(n.max):null;o!==r.appliedMax&&(o==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=o,r.appliedMax=o),r.resize()}function Mo(t){if(!t.autoGrow)return;const n=t.node;if(!n||n.tagName!=="TEXTAREA")return;const s=t.__ref,e=t.autoGrow,r=typeof e=="function"?P(t,t.autoGrowDeps,e):null,o=C(()=>{const c=t.autoGrow;let i=c;if(typeof c=="function")try{i=(c===e&&r?r:c)(t,t.state,t.context)}catch{i=null}$o(t,i)},{depth:s.path.length,label:S(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(o),r&&(s.__exec.autoGrow=e)}const qt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Qt(t,n){for(const s of Object.keys(t)){if(!Y(s)||qt.has(s))continue;const e=eo(s);if(e){no(e,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const c=r;r=function(a){return t.call(c,a)}}if(typeof r!="function")continue;const o=_o(s);oo.has(o)||so(go(o),t,r)}Ro(t)}function Ro(t){const n=t.node;if(!n||!n.addEventListener)return;const s={};let e=!1;for(const y of qt){const h=t[y];typeof h=="function"&&(s[y]=h,e=!0)}if(!e)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let c=0,i=0,a=0,f=!1;const u=y=>{const h=y.touches&&y.touches[0]||y.changedTouches&&y.changedTouches[0];h&&(c=h.clientX,i=h.clientY,a=Date.now(),f=!0)},l=y=>{if(!f)return;f=!1;const h=y.changedTouches&&y.changedTouches[0]||y.touches&&y.touches[0];if(!h)return;const _=h.clientX-c,d=h.clientY-i,p=Date.now()-a;if(p>o)return;const g=Math.abs(_),x=Math.abs(d);if(Math.max(g,x)<r)return;let b;if(g>x*1.2)b=_<0?"left":"right";else if(x>g*1.2)b=d<0?"up":"down";else return;const j="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),v=s[j],w=s.onSwipe;v&&v.call(t,y,t,t.state,t.context),w&&w.call(t,{direction:b,dx:_,dy:d,dt:p,event:y},t,t.state,t.context)};n.addEventListener("touchstart",u,{passive:!0}),n.addEventListener("touchend",l,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{n.removeEventListener("touchstart",u)}catch{}try{n.removeEventListener("touchend",l)}catch{}})}function st(t,n){const s={...t};for(const e in n){const r=s[e],o=n[e];r&&o&&typeof r=="object"&&typeof o=="object"&&!Array.isArray(r)&&!Array.isArray(o)&&typeof r!="function"&&typeof o!="function"?s[e]=st(r,o):s[e]=o}return s}function Et(t,n,s){if(!n||!t.node)return;const e=t.childExtends;if(Array.isArray(n)){const r=t.tag==="fragment",o=t.context?.document||globalThis.document,c=r?null:o?.createDocumentFragment();if(!r&&!c)return;const i=t.childProps,a=t.childrenAs;for(let f=0;f<n.length;f++){let u=n[f];const l=u;(typeof u=="string"||typeof u=="number")&&(u={text:u});let y=i;if(typeof i=="function")try{y=i(t,u)}catch{y=null}if(a==="state"){let d=l;(typeof l=="string"||typeof l=="number")&&(d={value:l,text:l}),u=y?{...y,state:d}:{state:d}}else y&&(u=st(y,u));if(e&&!u.ignoreChildExtends)if(u.extends){const d=Array.isArray(u.extends)?u.extends:[u.extends],p=Array.isArray(e)?e:[e];u={...u,extends:[...p,...d]}}else u={...u,extends:e};const h=u?.key||l&&typeof l=="object"&&l.key||`${f}`;let _;try{_=H(u,t,h,s)}catch(d){if(typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${h}" failed to construct at ${p} (initial render, skipping this row):`,d?.message||d)}continue}!r&&_?.node&&c.appendChild(_.node)}return r||t.node.appendChild(c),!0}if(typeof n=="string"){const r=Ut(n,t);if(Array.isArray(r))return Et(t,r,s)}if(typeof n=="object")for(const r in n){if(K.has(r))continue;let o=n[r];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=st(t.childProps,o)),e&&!o.ignoreChildExtends)if(o.extends){const c=Array.isArray(o.extends)?o.extends:[o.extends],i=Array.isArray(e)?e:[e];o={...o,extends:[...i,...c]}}else o={...o,extends:e};H(o,t,r,s)}}}function Tt(t,n){const s=t.node;if(!s||s.tagName!=="SELECT")return;const e=s.options;if(!e||!e.length)return;const r=t.__ref,o=r&&r.__exec&&r.__exec.value,c=typeof o=="function",i=t.value!=null&&typeof t.value!="function";if(c||i){let u;if(c)try{u=o(t,t.state,t.context)}catch{return}else u=t.value;const l=u==null?"":String(u);s.value!==l&&(s.value=l);return}const a=n||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!a)return;let f=-1;for(let u=0;u<e.length;u++)e[u].defaultSelected&&(f=u);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function Zt(t,n){let{children:s,content:e}=t;const r=t.childExtends;if(typeof s=="function"){const i=s;try{s=i(t,t.state,t.context)}catch(y){if(s=void 0,typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${h} (initial run, treating as empty):`,y?.message||y)}}t.children=s;const a=t.__ref;let f=!1;const u=P(t,t.childrenDeps,i),l=C(()=>{const y=f;f=!0;let h;try{h=u(t,t.state,t.context)}catch(v){if(typeof console<"u"&&console.error){const w=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${w}${y?"":" (initial tracking run)"}:`,v?.message||v)}return}if(!y||h===t.children)return;t.children=h;const _=typeof t.onContentUpdate=="function",d=_?[]:null,p=_?[]:null,g=_?[]:null;if(Array.isArray(h)&&t.childrenAs==="state"){const v=t.childProps,w=[],$=new Map;for(let A=0;A<h.length;A++){const M=h[A];let k=v;if(typeof v=="function")try{k=v(t,M)}catch{k=null}const F=k&&k.key||M&&M.key||`${A}`;w.push(F),$.set(F,{rawChild:M,childProps:k})}const G=new Set(w),V=a.__children.slice();for(const A of V)if(!G.has(A)){const M=t[A];M?.remove&&M.remove(),delete t[A],p&&p.push(A)}const Z=t.childExtends,nt=t.tag==="fragment",Jt=t.context?.document||globalThis.document,X=nt?null:Jt?.createDocumentFragment(),ft=new Set;for(const A of w){const M=$.get(A),k=M.rawChild,F=t[A];if(F&&F.state){if(k&&typeof k=="object"){const D=F.state,W=D.$replace||D.replace,Lt=D.$update||D.update;try{if(typeof W=="function")W.call(D,k);else if(typeof Lt=="function"){for(const R in D)if(!(R==="__element"||R==="root"||R==="parent"||R==="update")&&!Object.prototype.hasOwnProperty.call(k,R))try{D[R]=void 0}catch{}Lt.call(D,k)}else for(const R in k)D[R]=k[R]}catch(R){if(typeof console<"u"&&console.error){const mt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to patch at ${mt} (reconcile, keeping its previous data for this pass):`,R?.message||R)}}}g&&g.push(A);continue}let ut=k;(typeof k=="string"||typeof k=="number")&&(ut={value:k,text:k});const Dt=M.childProps;let N=Dt?{...Dt,state:ut}:{state:ut};if(Z&&!N.ignoreChildExtends)if(N.extends){const D=Array.isArray(N.extends)?N.extends:[N.extends],W=Array.isArray(Z)?Z:[Z];N={...N,extends:[...W,...D]}}else N={...N,extends:Z};let dt;try{dt=H(N,t,A,n)}catch(D){if(typeof console<"u"&&console.error){const W=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to construct at ${W} (reconcile, skipping this row):`,D?.message||D)}ft.add(A);continue}!nt&&dt?.node&&X&&X.appendChild(dt.node),d&&d.push(A)}if(!nt&&X&&X.childNodes.length&&t.node&&t.node.appendChild(X),!nt&&t.node){let A=null;for(const M of w){const k=t[M]?.node;if(!k)continue;const F=A?A.nextSibling:t.node.firstChild;k!==F&&t.node.insertBefore(k,F),A=k}}a.__children=ft.size?w.filter(A=>!ft.has(A)):w,_&&(d.length||p.length)&&Ft(t,{added:d,removed:p,kept:g}),Tt(t,!1);return}const j=_?[...a.__children]:null;for(const v of[...a.__children]){const w=t[v];w?.remove&&w.remove(),delete t[v]}a.__children=[],Et(t,h,n),Tt(t,!1),_&&Ft(t,{added:[...a.__children],removed:j,kept:[]})},{depth:a.path.length,label:S(a,"children")});a.__effects.push(l)}const o=Et(t,s,n);if(e!=null&&!(e&&e.__ref)){let i=e;if(typeof i=="string"||typeof i=="number"?i={text:i}:typeof i!="object"&&(i={}),t.childProps&&(i=st(t.childProps,i)),r&&!i.ignoreChildExtends)if(i.extends){const a=Array.isArray(i.extends)?i.extends:[i.extends],f=Array.isArray(r)?r:[r];i={...i,extends:[...f,...a]}}else i={...i,extends:r};H(i,t,"content",n)}if(s&&!o)return;const c=t.context?.components||{};{const i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(!f.endsWith("Extends")||typeof t[f]!="string")continue;const u=f.slice(0,-7);if(!u||u.charCodeAt(0)<65||u.charCodeAt(0)>90)continue;const l={extends:t[f]};delete t[f];for(let y=a+1;y<i.length;y++){const h=i[y],_=h.charCodeAt(0);if(_>=65&&_<=90||K.has(h)||typeof t[h]=="function"&&(h.startsWith("on")||h.startsWith(".")))break;const d=t[h];d!==void 0&&(l[h]=d,delete t[h])}t[u]&&typeof t[u]=="object"?t[u]={...l,...t[u]}:t[u]=l}}for(const i of Object.keys(t)){if(K.has(i)||typeof t[i]!="object"||t[i]===null)continue;const a=i.charCodeAt(0);if(a<65||a>90)continue;let f=t[i];if(!f.__ref){if(!f.extends&&!f.extend){const u=c[i]||c[`smbls.${i}`];u&&(f={...f,extends:u})}if(t.childProps&&(f=st(t.childProps,f)),r&&!f.ignoreChildExtends)if(f.extends){const u=Array.isArray(f.extends)?f.extends:[f.extends],l=Array.isArray(r)?r:[r];f={...f,extends:[...l,...u]}}else f={...f,extends:r};H(f,t,i,n)}}}function Xt(t,n,s){const{node:e}=t;if(!e)return;e.ref=t;const r=n?.tag==="fragment"?n.__ref?.__fragmentAnchor:null;if(r){const c=r.parentNode;if(c){if(s?.position==="before"&&s.node)c.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const i=s.node.nextSibling;c.insertBefore(e,i||r)}else c.insertBefore(e,r);return}}const o=n?.node||(n?.nodeType?n:null);if(o)if(s?.position==="before"&&s.node)o.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;c?o.insertBefore(e,c):o.appendChild(e)}else o.appendChild(e)}const Pt=3;function No(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Pt?!1:(t.__inBeforeUpdate=!0,!0)}function at(t,n){t&&(t.__inBeforeUpdate=!1,n?(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 I(t,n,s){const e=t.charAt(0).toLowerCase()+t.slice(1);n.context?.plugins?.length&&U(e,n,s);const r="on"+t,o=n[r];if(typeof o=="function"){const a=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(a){if(n.__ref[a])return!0;n.__ref[a]=!0}const f=n.context?.designSystem;f&&L(f);let u=!!a;try{const l=o(n,n.state,n.context,s);if(l&&typeof l.then=="function"){const y=n.__ref;return l.catch(h=>{n.context?.plugins?.length&&U("error",n,{hook:r,error:h})||console.error(`[DOMQL] Lifecycle "${r}" error:`,h)}).finally(()=>{a&&y&&(y[a]=!1)}),u=!1,!0}if(l===!1)return!1}catch(l){if(n.context?.plugins?.length&&U("error",n,{hook:r,error:l})||console.error(`[DOMQL] Lifecycle "${r}" error:`,l),n.context?.strictMode)throw l}finally{f&&O(),u&&n.__ref&&(n.__ref[a]=!1)}}return!0}var ns=H;export{Pt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,No as acquireBeforeUpdateGuard,H as create,ns as default,bt as flushMounts,at as releaseBeforeUpdateGuard,ct as writeElementText};
4
+ `):"")}}if(Pt(o,!0),to(o,e,r),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const d=o.context?.designSystem;d&&D(d);try{const y=o.html(o,o.state,o.context);y!=null&&typeof y!="function"&&(o.node.innerHTML=y)}catch{}finally{d&&O()}}if(B("Create",o,n),B("Complete",o,n),B("Render",o,n),B("RenderRouter",o,n),Ut(o,n),typeof o.onFrame=="function"){const d=o.onFrame,y=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){y&&D(y);try{d(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{y&&O()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Do(t,e,s){const n=!e,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,o=n&&r&&t.context?.state,i=s.state!==void 0&&!o?s.state:t.state&&!K(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,m(t,t.state);else if(t.context?.state){const c=t.context.state,a={...c},l=t.context?.polyglot;if(l?.translations){const u=t.context,f=c.lang||l.defaultLang||"en",p=new Set,h=(y,g)=>{p.has(y)||go(u,y,a)&&(a[y]=g,p.add(y),bo(u,y))},_=l.translations[f];if(_&&typeof _=="object")for(const y in _)h(y,_[y]);const d=new Set(l.languages||[]);for(const y in l.translations)d.has(y)||h(y,l.translations[y])}t.state=K(a)?a:pt(a),t.state.__element=t,t.state.root=t.state,m(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),m(t,t.state);return}if(typeof i=="string"){if(t.state=Kt(i,e),t.state&&typeof t.state=="object"&&!K(t.state)){const c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}m(t,t.state);return}if(typeof i=="function"){const c=i(t,e?.state);t.state=K(c)?c:pt(c||{})}else K(i)?t.state=i:t.state=pt({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,m(t,t.state)}function kt(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 Kt(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?kt(e.state,r):e.state??{}}if(t.startsWith("~/")){const r=e.state?.root||e.state,o=t.slice(2);return o?kt(r,o):r??{}}if(e.state?.[t]!==void 0)return e.state[t];const s=kt(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",o=n.translations[r];if(o?.[t]!==void 0)return o[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const Oo=new Set(["s","state","ctx","context"]);function Lo(t){try{const s=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function $o(t){if(typeof t!="function"||t.length!==2)return!1;const e=Lo(t);if(e.length<2)return!1;const s=e[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!Oo.has(s)}function Mo(t){const e=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const c=o[i];if(typeof t[c]!="function"||V.has(c))continue;const a=c.charCodeAt(0);a>=65&&a<=90||q(c)||E[c]||w&&w.has(c)||_t(s,c)||(rt()&&$o(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 i=0;i<r.length;i++){const{prop:c,fn:a}=r[i];e.__exec[c]=a,Object.defineProperty(t,c,{get(){n&&D(n);try{return a(t,t.state,t.context)}catch{return}finally{n&&O()}},set(l){delete e.__exec[c],Object.defineProperty(t,c,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Ro(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 T(t,e,s){return!Array.isArray(e)||e.length===0?s:function(...n){return Ro(t,e),s.apply(this,n)}}function st(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function C(t,e){return()=>t.path.join(".")+"::"+e}function Vt(t,e){const s=t.__ref,n=!!(e&&e.skipIfEffect);if(Mo(t),typeof t.text=="function"){const o=t.text,i=T(t,t.textDeps,o),c=S(()=>{if(!s.contentManaged)try{let a=i(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=ht.call(t,a,t.state)),at(t,a))}catch{}},{depth:s.path.length,label:C(s,"text")});s.__effects.push(c),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,i=S(()=>{if(s.contentManaged)return;const c=ht.call(t,o,t.state);c!=null&&(t.text=c),t.node&&at(t,c??"")},{depth:s.path.length,label:C(s,"text")});s.__effects.push(i),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!V.has(o)&&!q(o)&&!s.__exec[o]){if(E[o]){const i=t[o],c=T(t,t[o+"Deps"],i),a=o;let l;const u=S(()=>{const f=t.context?.designSystem;f&&D(f);try{const p=c(t,t.state,t.context),h=E[a](p,t,t.state,t.context),_=a==="show"||a==="hide";if(h&&t.node){const d=Ct(h),y=_&&t.node.style.display!=="none";(d===null||d!==l||y)&&(l=d,Z(t.node,h))}else if(t.node&&_){l=void 0;const d=s.__explicitDisplay;t.node.style.display=typeof d=="string"?d:""}}finally{f&&O()}},{depth:s.path.length,label:C(s,a)});s.__effects.push(u),s.__exec[o]=i}else if(w&&w.has(o)){const i=t[o],c=T(t,t[o+"Deps"],i),a=o;let l;const u=S(()=>{const f=t.context?.designSystem;f&&D(f);try{const p=c(t,t.state,t.context);if(t.node)if(p!=null){const h=a+":"+String(p);h!==l&&(l=h,Z(t.node,{[a]:p}))}else l=void 0,t.node.style[a]=""}finally{f&&O()}},{depth:s.path.length,label:C(s,a)});s.__effects.push(u),s.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=T(t,t.htmlDeps,o),c=S(()=>{const a=t.context?.designSystem;a&&D(a);try{const l=i(t,t.state,t.context);t.node&&l!=null&&typeof l!="function"&&(t.node.innerHTML=l)}finally{a&&O()}},{depth:s.path.length,label:C(s,"html")});s.__effects.push(c),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=T(t,t.valueDeps,o),c=S(()=>{try{const a=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const l=a==null?"":String(a);if(t.node.value===l)return;const u=typeof document<"u"&&document.activeElement===t.node,f=u&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=u&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=l,u&&f!=null&&p!=null)try{t.node.setSelectionRange(f,p)}catch{}}catch{}},{depth:s.path.length,label:C(s,"value")});s.__effects.push(c),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,i=T(t,t.styleDeps,o);let c;const a=S(()=>{const l=i(t,t.state,t.context),u=Ct(l);(u===null||u!==c)&&(c=u,Z(t.node,l))},{depth:s.path.length,label:C(s,"style")});s.__effects.push(a),s.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const i=t.style[o];if(typeof i!="function")continue;const c=T(t,st(t.styleDeps,o),i);let a;const l=S(()=>{try{const u=c(t,t.state,t.context);if(t.node){const f=o+":"+String(u);f!==a&&(a=f,Z(t.node,{[o]:u}))}}catch{}},{depth:s.path.length,label:C(s,"style."+o)});s.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=T(t,st(t.attrDeps,o),t.attr[o]),c=o,a=S(()=>{try{const l=i(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1&&!ct(c)?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,Y(c,l)))}catch{}},{depth:s.path.length,label:C(s,"attr."+c)});s.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const i=T(t,st(t.ariaDeps,o),t.aria[o]),c="aria-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=S(()=>{try{const l=i(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,Y(c,l))}catch{}},{depth:s.path.length,label:C(s,"aria."+o)});s.__effects.push(a)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const i=T(t,st(t.dataDeps,o),t.data[o]),a="data-"+o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),l=S(()=>{try{const u=i(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(a):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(a,u===!0?"":u)}catch{}},{depth:s.path.length,label:C(s,"data."+o)});s.__effects.push(l)}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 i=T(t,st(t.classDeps,o),r[o]),c=S(()=>{try{const a=i(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:s.path.length,label:C(s,"class."+o)});s.__effects.push(c)}!n&&typeof t.if=="function"&&Gt(t,s,t.if);for(const o of Object.keys(t)){if(V.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||q(o))continue;const c=t[o];s.__exec[o]=c;const a=t.tag||"div";if(_t(a,o)&&!E[o]&&!(w&&w.has(o))){const l=gt(o)||o,u=T(t,t[o+"Deps"],c),f=S(()=>{try{const p=u(t,t.state,t.context);t.node?.setAttribute&&(p==null||p===!1&&!ct(l)?t.node.removeAttribute(l):typeof p!="function"&&typeof p!="object"&&(l==="src"&&"src"in t.node?t.node.src=p:t.node.setAttribute(l,Y(l,p))))}catch{}},{depth:s.path.length,label:C(s,o)});s.__effects.push(f)}}if(Io(t),Ko(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let c=!1,a=[];const l=S(()=>{const u=[];for(let _=0;_<i.length;_++){const d=i[_];try{u[_]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{u[_]=void 0}}if(!c){c=!0,a=u;return}let f=u.length!==a.length;for(let _=0;!f&&_<u.length;_++)u[_]!==a[_]&&(f=!0);const p=a;if(a=u,!f)return;const h=t.context?.designSystem;h&&D(h);try{o(t,t.state,t.context,{prev:p,next:u})}catch(_){if(t.context?.plugins?.length&&U("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{h&&O()}},{depth:s.path.length,label:C(s,"onStateUpdate")});s.__effects.push(l)}Bo(t)}function Ht(t){const e=t.parent,s=e?.node;if(!s||!t.node){to(t,t.parent);return}let n=null;const r=Object.keys(e),o=r.indexOf(t.key);for(let i=o+1;i<r.length;i++){const c=e[r[i]];if(c?.node?.parentNode===s){n=c.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Gt(t,e,s){const n=T(t,t.ifDeps,s),r=S(()=>{let o;try{o=n(t,t.state,t.context)}catch(c){if(o=!1,e.__ifError=c,typeof console<"u"&&console.warn){const a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,c?.message||c)}return}const i=e.__if;if(e.__if=!!o,i&&!e.__if&&t.node)t.node.remove();else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=yt(t)),t.node&&(t.node.ref=t),Ht(t),St(t);else{if(e.__ifInitialized=!0,t.tag||(t.tag=Mt(t)),B("Init",t,{}),t.node||(t.node=yt(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 a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),e.__fragmentAnchor=a}B("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Jt(t,{}),Vt(t,{skipIfEffect:!0}),St(t),Qt(t),mt(t,{}),Ht(t),Ut(t,{})}},{depth:e.path.length,label:C(e,"if")});e.__effects.push(r)}function at(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 o=r?r.__textNode:null;if(o&&o.parentNode!==s&&(o=null),!o){const i=s.firstChild;i&&i.nodeType===3&&(o=i)}o?o.nodeValue!==n&&(o.nodeValue=n):s.firstChild?(o=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(o,s.firstChild)):(s.textContent=n,o=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=o||null)}function St(t){const{node:e}=t;if(e){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&at(t,t.text),Ho(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){const s=String(t.value);e.value!==s&&(e.value=s)}if(t.style&&typeof t.style=="object"&&Z(e,t.style),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&&(n===!1&&!ct(s)||e.setAttribute&&e.setAttribute(s,Y(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||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 Ct(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Z(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 o=String(r),i=n.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),c=o.trim(),a=/\s*!important\s*$/.test(c),l=c.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,a?"important":"")}catch{}}}s&&No(t,s)}function No(t,e){const s=`_ds${Nt.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 o="";for(const i in e){const c="."+s,a=i.replace(/&/g,c).split(",").map(u=>{const f=u.trim();return f.includes(c)?f:c+f}).join(", "),l=e[i];if(typeof l=="object"){let u="",f="";for(const p in l){const h=l[p];if(typeof h=="object"){const _=p.includes("&")?a.split(", ").map(y=>p.replace(/&/g,y)).join(", "):a.split(", ").map(y=>`${y} ${p}`).join(", ");let d="";for(const y in h)d+=`${y.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${h[y]};`;f+=Rt(`${_} { ${d} }`,_)+`
5
+ `}else u+=`${p.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${h};`}u&&(o+=Rt(`${a} { ${u} }`,a)+`
6
+ `),f&&(o+=f)}}o&&(r.textContent+=o)}const Wt=new Set;function zt(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 Fo(t,e,s){const n=zt(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=e(t,t.state,t.context)}catch{return}if(zt(r)===n)return;const o=t.__ref.path?t.__ref.path.join("."):t.key||"?";Wt.has(o)||(Wt.add(o),console.warn(`[smbls] subscribeTo function at "${o}" 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 Io(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&&rt()&&Fo(t,e,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let o=0;o<n.length;o++){const i=n[o];if(typeof i!="string"||i.length===0)continue;const c=i.split("."),a=c[0],l=c.slice(1),u={value:!1},f=S(()=>{const p=t.state&&(K(t.state)?t.state.root:null);if(!p||!K(p))return;let h=p;h=h[a];for(let d=0;d<l.length&&!(h==null||typeof h!="object");d++)if(K(h))h=h[l[d]];else break;if(!u.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"){const d=t.context?.designSystem;d&&D(d);try{if(Yo(r)){const y=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});y&&typeof y.then=="function"?y.then(()=>ft(r,!1),g=>{ft(r,!0),t.context?.plugins?.length&&U("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}):(ft(r,!1),y===!1&&(_=!0))}}catch(y){ft(r,!0),t.context?.plugins?.length&&U("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}finally{d&&O()}}if(!_&&t.node&&r.__effects)for(let d=0;d<r.__effects.length;d++){const y=r.__effects[d];y&&y!==f&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}if(!_&&typeof t.onUpdate=="function"){const d=t.context?.designSystem;d&&D(d);try{t.onUpdate(t,t.state,t.context)}catch(y){t.context?.plugins?.length&&U("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}finally{d&&O()}}},{depth:r.path.length,label:C(r,"subscribeTo("+i+")")});u.value=!0,f._isSubscribeToEffect=!0,r.__effects.push(f)}}function vt(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}const Yt=new Set;function Uo(t,e){const s=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=s+"::"+t;Yt.has(n)||(Yt.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 Q(t,e,s){const n={},r=new Set,o=(i,c,a)=>{const l=a?new Set(Object.keys(n)):null;if(E[i]){const u=E[i](c,e,e.state,e.context);if(u){const f=Array.isArray(u)?u:[u];for(const p of f)p&&Object.assign(n,p)}}else n[i]=c;if(a)for(const u in n)l.has(u)||r.add(u)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let c=t[i];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(i==="style"){for(const f in c){let p=c[f];if(typeof p=="function"&&(p=p(e,e.state,e.context)),p==null||typeof p=="function")continue;const h=typeof e[f]=="function"&&(E[f]||w&&w.has(f));o(f,p,h)}continue}if(vt(i,e)){const f=Q(c,e,!1);Object.keys(f).length&&(n[`[data-theme="${i.slice(1)}"] &`]=f);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){rt()&&Uo(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){const f=e.context?.designSystem?.media?.[i.slice(1)];f&&(l=`@media ${f}`)}const u=Q(c,e,!1);Object.keys(u).length&&(n[l]=u);continue}const a=typeof e[i]=="function"&&(E[i]||w&&w.has(i));o(i,c,a)}if(s)for(const i in n)r.add(i);for(const i of r){const c=n[i];typeof c=="string"&&!c.includes("!important")&&(n[i]=c+" !important")}return n}function wt(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)&&wt(t[s],e+1))return!0}return!1}function qt(t,e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;if(vt(t,s)){const o=Q(e,s,!1);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){const o=s.context?.designSystem?.media?.[t.slice(1)];o&&(n=`@media ${o}`)}const r=Q(e,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function Bo(t){const e=t.__ref;for(const s of Object.keys(t)){if(!At(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!wt(n))continue;let r=null,o;const i=S(()=>{if(!t.node)return;const c=t.context?.designSystem;c&&D(c);let a,l=!1;try{const u=qt(s,n,t),f=u?Ct(u.block)+"::"+u.cssProp:null;if(f!==null&&f===o)l=!0;else if(o=f,u){const p=it({[u.cssProp]:u.block},null,t.context?.cssPrefix);a=p?p.split(" ").filter(Boolean):null}else a=null}finally{c&&O()}if(!(l||!t.node.classList)){if(r)for(const u of r)t.node.classList.remove(u);if(a&&a.length)for(const u of a)t.node.classList.add(u);r=a}},{depth:e.path.length,label:C(e,"cssBlock("+s+")")});e.__effects.push(i)}}function Ko(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 o=n.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const f=o.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}${f}: { '${o.slice(f.length)}': {...} }\`.`)}continue}const i=t[n];if(!i||typeof i!="object")continue;const c=r==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let f;const p=t[o];if(p===void 0){const d=!!t.state&&o in t.state,y=t.state?t.state[o]:void 0;if(d||y!==void 0)f=y;else{const g=t.context?.cases?.[o];if(g===void 0)return;try{f=typeof g=="function"?g.call(t,t):g}catch(b){f=!1,e.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}}}else if(typeof p=="function")try{f=p(t,t.state,t.context)}catch(d){f=!1,e.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else f=p;const h=c?!f:!!f;if(!t.node||h===a.lastMatch)return;a.lastMatch=h;const _=t.context?.designSystem;_&&D(_);try{if(h){const d={},y={};let g=!1;for(const x in i){if(!Object.prototype.hasOwnProperty.call(i,x))continue;const v=i[x],L=x.charAt(0);if((L===":"||L==="@"||L==="&")&&v&&typeof v=="object"&&!Array.isArray(v)){if(vt(x,t)){const R=Q(v,t,!1);Object.keys(R).length&&(y[`[data-theme="${x.slice(1)}"] &`]=R,g=!0)}else{let R=x;if(L==="@"&&!x.startsWith("@media")&&!x.startsWith("@keyframes")){const j=t.context?.designSystem?.media?.[x.slice(1)];j&&(R=`@media ${j}`)}const W=Q(v,t,!1);Object.keys(W).length&&(y[R]=W,g=!0)}continue}const H=typeof v=="function"?v(t,t.state,t.context):v;if(H!=null)if(E[x]){const R=E[x](H,t,t.state,t.context);if(R){const W=Array.isArray(R)?R:[R];for(const j of W)j&&Object.assign(d,j)}}else w&&w.has(x)&&(d[x]=H)}const b=Object.keys(d);if(b.length){Z(t.node,d);for(const x of b)s.set(x,n);a.appliedKeys=b}else a.appliedKeys=null;if(g){const x=it(y,null,t.context?.cssPrefix),v=x?x.split(" ").filter(Boolean):[];if(v.length&&t.node.classList){for(const L of v)t.node.classList.add(L);a.appliedClasses=v}else a.appliedClasses=null}else if(a.appliedClasses){for(const x of a.appliedClasses)t.node.classList.remove(x);a.appliedClasses=null}}else{if(a.appliedKeys){for(const d of a.appliedKeys)s.get(d)===n&&(t.node.style[d]="",s.delete(d));a.appliedKeys=null}if(a.appliedClasses){for(const d of a.appliedClasses)t.node.classList.remove(d);a.appliedClasses=null}}}finally{_&&O()}};e.__conditionalRunners.push(l);const u=S(l,{depth:e.path.length,label:C(e,"conditional("+n+")")});e.__effects.push(u)}}const jt=new WeakSet;function Vo(t){const e=t.ownerDocument;!e||jt.has(e)||(jt.add(e),queueMicrotask(()=>{jt.delete(e);const s=e.body||e.documentElement;s&&s.offsetWidth}))}const Et=new WeakSet;let Zt=!1;function Ho(t){const{node:e}=t;if(!e)return;if(Zt||(Zt=!0,it({display:"none"})),Et.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Et.add(t);const s=t.context?.designSystem;s&&D(s),xo();try{const n={};let r=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&E.theme){const o=E.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(const i of o)i&&Object.assign(n,i);else Object.assign(n,o);r=!0}}for(const o of Object.keys(t)){if(typeof t[o]=="function"||V.has(o)||o==="theme")continue;const i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!q(o)){if(E[o]){const c=t[o],a=E[o](c,t,t.state,t.context);if(a){if(Array.isArray(a))for(const l of a)l&&Object.assign(n,l);else Object.assign(n,a);r=!0}}else if(w&&w.has(o)){const c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,r=!0)}else if(o.charCodeAt(0)===45){const c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,r=!0)}else if(o.charAt(0)==="&"||o.charAt(0)==="@"||o.charAt(0)===":"){const c=t[o];if(c&&typeof c=="object"&&!Array.isArray(c)){if(wt(c))continue;const a=qt(o,c,t);a&&(n[a.cssProp]=a.block,r=!0)}}}}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 o=it(n,null,t.context?.cssPrefix);if(o&&e.classList){const c=o.split(" ").filter(Boolean);let a=!1;for(const l of c)e.classList.add(l),a||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(a=!0);a&&Vo(e)}const i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){const c=n.display;if(c&&c!==i)if(i==="none"){const a=[];for(const l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&a.push(l);for(const l of a)e.classList.remove(l);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{Ao(),s&&O(),Et.delete(t)}}function Qt(t){const{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const o=t.aria[r];if(typeof o=="function"||typeof o=="object"||o==null)continue;const i="aria-"+r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(i,Y(i,o))}const s=ko(t);for(const r in s){const o=s[r];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&e.setAttribute(r,o===!0?"":o)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||V.has(r)||r==="on"||s[r]!==void 0)continue;const o=r.charCodeAt(0);if(!(o>=65&&o<=90)&&!q(r)&&!(E[r]||w&&w.has(r))&&_t(n,r)){let i=t[r];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=ht(i,t,t.state,t.context),t[r]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!ct(gt(r)||r))continue;const c=gt(r)||r;e.setAttribute(c,Y(c,i))}}}function Go(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 i=s.scrollHeight;s.style.height=i+"px",i>0&&(r.lastMeasure=i)}},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 o=typeof e=="object"&&e.max!=null?String(e.max):null;o!==r.appliedMax&&(o==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=o,r.appliedMax=o),r.resize()}function Wo(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"?T(t,t.autoGrowDeps,n):null,o=S(()=>{const i=t.autoGrow;let c=i;if(typeof i=="function")try{c=(i===n&&r?r:i)(t,t.state,t.context)}catch{c=null}Go(t,c)},{depth:s.path.length,label:C(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(o),r&&(s.__exec.autoGrow=n)}const Xt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Jt(t,e){for(const s of Object.keys(t)){if(!q(s)||Xt.has(s))continue;const n=fo(s);if(n){ao(n,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const i=r;r=function(a){return t.call(i,a)}}if(typeof r!="function")continue;const o=To(s);io.has(o)||co(Po(o),t,r)}zo(t)}function zo(t){const e=t.node;if(!e||!e.addEventListener)return;const s={};let n=!1;for(const p of Xt){const h=t[p];typeof h=="function"&&(s[p]=h,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,c=0,a=0,l=!1;const u=p=>{const h=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];h&&(i=h.clientX,c=h.clientY,a=Date.now(),l=!0)},f=p=>{if(!l)return;l=!1;const h=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!h)return;const _=h.clientX-i,d=h.clientY-c,y=Date.now()-a;if(y>o)return;const g=Math.abs(_),b=Math.abs(d);if(Math.max(g,b)<r)return;let x;if(g>b*1.2)x=_<0?"left":"right";else if(b>g*1.2)x=d<0?"up":"down";else return;const v="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),L=s[v],H=s.onSwipe;L&&L.call(t,p,t,t.state,t.context),H&&H.call(t,{direction:x,dx:_,dy:d,dt:y,event:p},t,t.state,t.context)};e.addEventListener("touchstart",u,{passive:!0}),e.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",u)}catch{}try{e.removeEventListener("touchend",f)}catch{}})}function et(t,e){const s={...t};for(const n in e){const r=s[n],o=e[n];r&&o&&typeof r=="object"&&typeof o=="object"&&!Array.isArray(r)&&!Array.isArray(o)&&typeof r!="function"&&typeof o!="function"?s[n]=et(r,o):s[n]=o}return s}function Tt(t,e,s){if(!e||!t.node)return;const n=t.childExtends;if(Array.isArray(e)){const r=t.tag==="fragment",o=t.context?.document||globalThis.document,i=r?null:o?.createDocumentFragment();if(!r&&!i)return;const c=t.childProps,a=t.childrenAs;for(let l=0;l<e.length;l++){let u=e[l];const f=u;(typeof u=="string"||typeof u=="number")&&(u={text:u});let p=c;if(typeof c=="function")try{p=c(t,u)}catch{p=null}if(a==="state"){let d=f;(typeof f=="string"||typeof f=="number")&&(d={value:f,text:f}),u=p?{...p,state:d}:{state:d}}else p&&(u=et(p,u));if(n&&!u.ignoreChildExtends)if(u.extends){const d=Array.isArray(u.extends)?u.extends:[u.extends],y=Array.isArray(n)?n:[n];u={...u,extends:[...y,...d]}}else u={...u,extends:n};const h=u?.key||f&&typeof f=="object"&&f.key||`${l}`;let _;try{_=G(u,t,h,s)}catch(d){if(typeof console<"u"&&console.error){const y=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${h}" failed to construct at ${y} (initial render, skipping this row):`,d?.message||d)}continue}!r&&_?.node&&i.appendChild(_.node)}return r||t.node.appendChild(i),!0}if(typeof e=="string"){const r=Kt(e,t);if(Array.isArray(r))return Tt(t,r,s)}if(typeof e=="object")for(const r in e){if(V.has(r))continue;let o=e[r];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=et(t.childProps,o)),n&&!o.ignoreChildExtends)if(o.extends){const i=Array.isArray(o.extends)?o.extends:[o.extends],c=Array.isArray(n)?n:[n];o={...o,extends:[...c,...i]}}else o={...o,extends:n};G(o,t,r,s)}}}function Pt(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,o=r&&r.__exec&&r.__exec.value,i=typeof o=="function",c=t.value!=null&&typeof t.value!="function";if(i||c){let u;if(i)try{u=o(t,t.state,t.context)}catch{return}else u=t.value;const f=u==null?"":String(u);s.value!==f&&(s.value=f);return}const a=e||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!a)return;let l=-1;for(let u=0;u<n.length;u++)n[u].defaultSelected&&(l=u);l>=0&&s.selectedIndex!==l&&(s.selectedIndex=l)}function mt(t,e){let{children:s,content:n}=t;const r=t.childExtends;if(typeof s=="function"){const f=s;try{s=f(t,t.state,t.context)}catch(y){if(s=void 0,typeof console<"u"&&console.error){const g=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${g} (initial run, treating as empty):`,y?.message||y)}}t.children=s;const p=t.__ref;let h=!1;const _=T(t,t.childrenDeps,f),d=S(()=>{const y=h;h=!0;let g;try{g=_(t,t.state,t.context)}catch(j){if(typeof console<"u"&&console.error){const N=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${N}${y?"":" (initial tracking run)"}:`,j?.message||j)}return}if(!y||g===t.children)return;t.children=g;const b=typeof t.onContentUpdate=="function",x=b?[]:null,v=b?[]:null,L=b?[]:null;if(Array.isArray(g)&&t.childrenAs==="state"){const j=t.childProps,N=[],Ot=new Map;for(let A=0;A<g.length;A++){const $=g[A];let k=j;if(typeof j=="function")try{k=j(t,$)}catch{k=null}const I=k&&k.key||$&&$.key||`${A}`;N.push(I),Ot.set(I,{rawChild:$,childProps:k})}const oo=new Set(N),so=p.__children.slice();for(const A of so)if(!oo.has(A)){const $=t[A];$?.remove&&$.remove(),delete t[A],v&&v.push(A)}const X=t.childExtends,nt=t.tag==="fragment",eo=t.context?.document||globalThis.document,J=nt?null:eo?.createDocumentFragment(),ut=new Set;for(const A of N){const $=Ot.get(A),k=$.rawChild,I=t[A];if(I&&I.state){if(k&&typeof k=="object"){const P=I.state,z=P.$replace||P.replace,$t=P.$update||P.update;try{if(typeof z=="function")z.call(P,k);else if(typeof $t=="function"){for(const M in P)if(!(M==="__element"||M==="root"||M==="parent"||M==="update")&&!Object.prototype.hasOwnProperty.call(k,M))try{P[M]=void 0}catch{}$t.call(P,k)}else for(const M in k)P[M]=k[M]}catch(M){if(typeof console<"u"&&console.error){const no=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to patch at ${no} (reconcile, keeping its previous data for this pass):`,M?.message||M)}}}L&&L.push(A);continue}let dt=k;(typeof k=="string"||typeof k=="number")&&(dt={value:k,text:k});const Lt=$.childProps;let F=Lt?{...Lt,state:dt}:{state:dt};if(X&&!F.ignoreChildExtends)if(F.extends){const P=Array.isArray(F.extends)?F.extends:[F.extends],z=Array.isArray(X)?X:[X];F={...F,extends:[...z,...P]}}else F={...F,extends:X};let lt;try{lt=G(F,t,A,e)}catch(P){if(typeof console<"u"&&console.error){const z=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to construct at ${z} (reconcile, skipping this row):`,P?.message||P)}ut.add(A);continue}!nt&&lt?.node&&J&&J.appendChild(lt.node),x&&x.push(A)}if(!nt&&J&&J.childNodes.length&&t.node&&t.node.appendChild(J),!nt&&t.node){let A=null;for(const $ of N){const k=t[$]?.node;if(!k)continue;const I=A?A.nextSibling:t.node.firstChild;k!==I&&t.node.insertBefore(k,I),A=k}}p.__children=ut.size?N.filter(A=>!ut.has(A)):N,b&&(x.length||v.length)&&Bt(t,{added:x,removed:v,kept:L}),Pt(t,!1);return}const W=b?[...p.__children]:null;for(const j of[...p.__children]){const N=t[j];N?.remove&&N.remove(),delete t[j]}p.__children=[],Tt(t,g,e),Pt(t,!1),b&&Bt(t,{added:[...p.__children],removed:W,kept:[]})},{depth:p.path.length,label:C(p,"children")});p.__effects.push(d)}const o=Tt(t,s,e);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=et(t.childProps,f)),r&&!f.ignoreChildExtends)if(f.extends){const p=Array.isArray(f.extends)?f.extends:[f.extends],h=Array.isArray(r)?r:[r];f={...f,extends:[...h,...p]}}else f={...f,extends:r};G(f,t,"content",e)}if(s&&!o)return;const i=t.context?.components||{};{const f=Object.keys(t);for(let p=0;p<f.length;p++){const h=f[p];if(!h.endsWith("Extends")||typeof t[h]!="string")continue;const _=h.slice(0,-7);if(!_||_.charCodeAt(0)<65||_.charCodeAt(0)>90)continue;const d={extends:t[h]};delete t[h];for(let y=p+1;y<f.length;y++){const g=f[y],b=g.charCodeAt(0);if(b>=65&&b<=90||V.has(g)||typeof t[g]=="function"&&(g.startsWith("on")||g.startsWith(".")))break;const x=t[g];x!==void 0&&(d[g]=x,delete t[g])}t[_]&&typeof t[_]=="object"?t[_]={...d,...t[_]}:t[_]=d}}const c=e?.mountYield===!0||t.yieldChildren===!0,a=Object.keys(t),l=f=>{if(V.has(f)||typeof t[f]!="object"||t[f]===null)return;const p=f.charCodeAt(0);if(p<65||p>90)return;let h=t[f];if(!h.__ref){if(!h.extends&&!h.extend){const _=i[f]||i[`smbls.${f}`];_&&(h={...h,extends:_})}if(t.childProps&&(h=et(t.childProps,h)),r&&!h.ignoreChildExtends)if(h.extends){const _=Array.isArray(h.extends)?h.extends:[h.extends],d=Array.isArray(r)?r:[r];h={...h,extends:[...d,..._]}}else h={...h,extends:r};G(h,t,f,e)}};if(!c){for(const f of a)l(f);return}yo();const u=f=>{for(let p=f;p<a.length;p++)if(l(a[p]),p+1<a.length&&po()){const h=p+1;_o(()=>u(h));return}};u(0),ho()}function to(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 i=r.parentNode;if(i){if(s?.position==="before"&&s.node)i.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;i.insertBefore(n,c||r)}else i.insertBefore(n,r);return}}const o=e?.node||(e?.nodeType?e:null);if(o)if(s?.position==="before"&&s.node)o.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const i=s.node.nextSibling;i?o.insertBefore(n,i):o.appendChild(n)}else o.appendChild(n)}const Dt=3;function Yo(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Dt?!1:(t.__inBeforeUpdate=!0,!0)}function ft(t,e){t&&(t.__inBeforeUpdate=!1,e?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Dt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Dt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function B(t,e,s){const n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&U(n,e,s);const r="on"+t,o=e[r];if(typeof o=="function"){const a=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(a){if(e.__ref[a])return!0;e.__ref[a]=!0}const l=e.context?.designSystem;l&&D(l);let u=!!a;try{const f=o(e,e.state,e.context,s);if(f&&typeof f.then=="function"){const p=e.__ref;return f.catch(h=>{e.context?.plugins?.length&&U("error",e,{hook:r,error:h})||console.error(`[DOMQL] Lifecycle "${r}" error:`,h)}).finally(()=>{a&&p&&(p[a]=!1)}),u=!1,!0}if(f===!1)return!1}catch(f){if(e.context?.plugins?.length&&U("error",e,{hook:r,error:f})||console.error(`[DOMQL] Lifecycle "${r}" error:`,f),e.context?.strictMode)throw f}finally{l&&O(),u&&e.__ref&&(e.__ref[a]=!1)}}return!0}var gs=G;export{Dt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Yo as acquireBeforeUpdateGuard,G as create,gs as default,xt as flushMounts,ft as releaseBeforeUpdateGuard,at as writeElementText};
@@ -0,0 +1 @@
1
+ import{VERSION as s}from"./version.js";const i="__SMBLS_ELEMENT_ID_ENGINE__",_=(e,o,r)=>{const l=o||s,t=r||(typeof globalThis<"u"?globalThis:null);if(!t)return e;const n=t[i];return n&&n.engine&&n.version===l?n.engine:(n||(t[i]={version:l,engine:e}),e)},f=e=>{const o=e||(typeof globalThis<"u"?globalThis:null);o&&delete o[i]};export{i as ELEMENT_ID_ENGINE_KEY,f as __resetElementIdEngine,_ as resolveElementIdEngine};
@@ -0,0 +1 @@
1
+ const a=50,o=[];let u=!1,e=0;function f(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function c(n){const t=typeof globalThis<"u"?globalThis.scheduler:null;if(t&&typeof t.yield=="function"){t.yield().then(n,n);return}if(typeof MessageChannel=="function"){const s=new MessageChannel;s.port1.onmessage=()=>{s.port1.close(),n()},s.port2.postMessage(0);return}setTimeout(n,0)}function d(){return e?f()-e>=50:!1}let r=0;function p(){r===0&&!e&&(e=f()),r++}function h(){r>0&&r--,r===0&&!u&&(e=0)}function _(n){o.push(n),u||(u=!0,c(l))}function l(){for(e=f();o.length;){const n=o.shift();try{n()}catch(t){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",t?.message||t)}if(f()-e>=50)break}if(o.length){c(l);return}u=!1,e=0,r=0}function g(){let t=0;for(e=0;o.length&&t++<1e5;){const s=o.shift();try{s()}catch(i){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",i?.message||i)}}u=!1,e=0,r=0}function M(){return o.length}function y(){o.length=0,u=!1,e=0,r=0}export{a as MOUNT_YIELD_BUDGET_MS,g as __flushMountQueueSync,M as __pendingMountChunks,y as __resetMountQueue,h as closeMountBudget,_ as enqueueMountWork,d as mountBudgetExhausted,p as openMountBudget};
@@ -0,0 +1 @@
1
+ const o="3.14.781";export{o as VERSION};
package/package.json CHANGED
@@ -1,20 +1,19 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.780",
3
+ "version": "3.14.782",
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",
7
7
  "module": "./dist/esm/index.js",
8
+ "source": "src/index.js",
8
9
  "exports": {
9
10
  ".": {
10
- "development": "./index.js",
11
11
  "import": "./dist/esm/index.js",
12
12
  "require": "./dist/cjs/index.js",
13
13
  "default": "./dist/esm/index.js"
14
14
  },
15
15
  "./package.json": "./package.json",
16
16
  "./src/*": {
17
- "development": "./src/*.js",
18
17
  "import": "./dist/esm/src/*.js",
19
18
  "require": "./dist/cjs/src/*.js",
20
19
  "default": "./dist/esm/src/*.js"
@@ -37,10 +36,11 @@
37
36
  "scripts": {
38
37
  "build:esm": "esbuild $(find . -type f -name \"*.js\" -not -path \"*/dist/*\" -not -path \"*/node_modules/*\" -not -path \"*/__tests__/*\" -not -path \"*/test/*\" -not -path \"*/demo/*\" -not -path \"*/demos/*\" -not -path \"*/examples/*\" -not -path \"*/fixtures/*\" -not -name \"*.test.js\") --target=es2022 --format=esm --outbase=. --outdir=dist/esm --minify --log-level=warning",
39
38
  "build:cjs": "esbuild $(find . -type f -name \"*.js\" -not -path \"*/dist/*\" -not -path \"*/node_modules/*\" -not -path \"*/__tests__/*\" -not -path \"*/test/*\" -not -path \"*/demo/*\" -not -path \"*/demos/*\" -not -path \"*/examples/*\" -not -path \"*/fixtures/*\" -not -name \"*.test.js\") --target=node20 --format=cjs --outbase=. --outdir=dist/cjs --minify --log-level=warning",
40
- "build": "rimraf dist && npm run build:esm && npm run build:cjs && node -e \"require('fs').writeFileSync('dist/cjs/package.json', '{\\\"type\\\": \\\"commonjs\\\"}')\"",
41
- "prepublishOnly": "npm run build"
39
+ "build": "npm run build:version && rimraf dist && npm run build:esm && npm run build:cjs && node -e \"require('fs').writeFileSync('dist/cjs/package.json', '{\\\"type\\\": \\\"commonjs\\\"}')\"",
40
+ "prepublishOnly": "npm run build",
41
+ "build:version": "node scripts/gen-version.mjs"
42
42
  },
43
43
  "publishConfig": {
44
- "access": "restricted"
44
+ "access": "public"
45
45
  }
46
46
  }