@symbo.ls/element 3.14.805 → 3.14.807

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @symbo.ls/element
2
2
 
3
+ ## 3.14.807
4
+
5
+ ### Patch Changes
6
+
7
+ - Regressions of 3.14.840 found by the workspace bump: a `<style>` without a sheet drops its rules instead of throwing a WeakMap error (an iframe app whose frame is removed); a boot whose document goes away during the first-render yield resolves unmounted; the iife and embed bundles end with a newline again (code appended after the source-map comment ran as a comment); an `inertOutside` layer opened at boot is modal at once.
8
+ - Updated dependencies
9
+ - @symbo.ls/css@3.14.781
10
+
11
+ ## 3.14.806
12
+
13
+ ### Patch Changes
14
+
15
+ - XMA round 3 (performance): a pre-rendered page is adopted in short tasks; the first render puts rows on screen whole; the design system is prepared at build time and adopted by the page; `smbls build` adds V8 compile hints and (opt-in, `build.modulePreload`) lazy-module preloads; brender's preload goes after the import map; pre-built pages can be flagged stale (`fetch.seed.isStale` / `maxAge` / `onRefresh`, `<html data-smbls-stale>`); routes without their own page answer with 200.html on every deploy target; the app starts in the address's language (`addressLang`) and adopts the seeded answers; `DropdownDisclosure` and Dialog `locked`; frank-audit accepts DOM work on a bridged library's and a parsed document's own nodes; a server render waits for its own labels (label loads in flight are per app); mermaid renderProjectHtml takes a caller-resolved head (`options.metadata`) and `metadata.source` is never a tag.
16
+ - Updated dependencies
17
+ - @symbo.ls/css@3.14.780
18
+ - @symbo.ls/scratch@3.14.790
19
+ - @symbo.ls/utils@3.14.789
20
+
3
21
  ## 3.14.805
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -33,7 +33,13 @@ render with a 10 ms budget (its `firstRender` option).
33
33
  An element whose children were deferred is incomplete until the last of them
34
34
  is built. It is attached in its place at once, so later chunks land in DOM
35
35
  order, but `onCreate`, `onComplete`, `onRender`, `onRenderRouter` and the
36
- `onMounted` queueing run after its last deferred child. Inside a yielding
36
+ `onMounted` queueing run after its last deferred child. With `mountWhole:
37
+ true` in the create options it is not attached yet: it is built outside its
38
+ parent's node and goes in with one insertion when its last chunk is in (right
39
+ after the nearest earlier sibling already in place), before its `onCreate`. A
40
+ row is then never on screen with only its first children. smbls sets
41
+ `mountWhole` for an app's first render and for the adoption of a pre-rendered
42
+ page. Inside a yielding
37
43
  mount an incomplete child holds its parent the same way, so every `onRender`
38
44
  sees all of its children. The queue runs depth-first: a subtree finishes
39
45
  before the siblings declared after it are built, so elements are built, and
@@ -44,7 +50,8 @@ after it, like the budget does: the next row or named child, `content` and
44
50
  the named children after the last row, the named children after `content`.
45
51
  Rows from an array and from an object `children` are built in chunks alike.
46
52
  A rebuild, a reconcile, an `if:` coming back and a create without the options
47
- stay synchronous.
53
+ stay synchronous at the list level; a row a reconcile creates while the
54
+ options carry `mountYield` builds its own children in chunks.
48
55
 
49
56
  The budget is checked after each child, never inside one, by one meter per
50
57
  task: it counts the children built and reads the clock only when its estimate
@@ -62,6 +69,7 @@ first view with `deferAttach` (the root) and `holdTail` (the first page).
62
69
  | `releaseMount(el)` | releases an element created with `{ holdTail: true }`: its `onCreate` … `onRender` run once nothing else holds them |
63
70
  | `mountPending(el)` | `true` while `el` waits for deferred children |
64
71
  | `whenMountIdle()` | promise: resolves when no deferred mount work is queued |
72
+ | `mountIdle()` | `true` when no deferred mount work is queued now (a promise settling as the queue drains can queue more before a `whenMountIdle()` caller resumes) |
65
73
  | `yieldToMain()` | promise: resolves in a later task, through the same `scheduler.yield()` ladder |
66
74
  | `holdMountFlush()` | holds the `onMounted` flush until the returned `release()` is called |
67
75
  | `mountYieldBudget(value)` | the budget in ms a `mountYield` / `yieldChildren` value means (0 = no yielding) |
@@ -1,6 +1,6 @@
1
- "use strict";var nn=Object.create;var Bt=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var en=Object.getOwnPropertyNames;var cn=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var an=(t,o)=>{for(var s in o)Bt(t,s,{get:o[s],enumerable:!0})},Do=(t,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of en(o))!fn.call(t,r)&&r!==s&&Bt(t,r,{get:()=>o[r],enumerable:!(n=rn(o,r))||n.enumerable});return t};var Lo=(t,o,s)=>(s=t!=null?nn(cn(t)):{},Do(o||!t||!t.__esModule?Bt(s,"default",{value:t,enumerable:!0}):s,t)),un=t=>Do(Bt({},"__esModule",{value:!0}),t);var Dr={};an(Dr,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>mt,acquireBeforeUpdateGuard:()=>ms,arrayRowDefinition:()=>Qs,attachElement:()=>xn,completeCreate:()=>Zs,create:()=>m,default:()=>Rr,flushMounts:()=>Xt,holdMountFlush:()=>_n,isStaticCssProp:()=>hr,markRuntimeSupplied:()=>At,placeAfter:()=>To,placeRows:()=>Js,placedRowNode:()=>Jt,recompileStaticCss:()=>yr,reconcileAttrProp:()=>gr,releaseBeforeUpdateGuard:()=>Ft,reportCreateChildrenError:()=>Ys,resolveStyleBlock:()=>Nt,rowAttach:()=>Xs,runtimeViewOf:()=>ut,syncSelectValue:()=>Mt,triggerContentUpdate:()=>Eo,writeAttr:()=>Lt,writeElementText:()=>Dt});module.exports=un(Dr);var K=require("@symbo.ls/signal"),j=require("@symbo.ls/signal"),dn=Lo(require("@symbo.ls/signal"),1),q=require("./runContext.js"),ot=require("./cache.js"),G=require("./registry.js"),N=require("./delegate.js"),H=require("./features.js"),Gs=require("./bridge.js"),W=require("./extends.js"),Qt=require("./connected.js"),dt=require("./mountRecord.js"),Ws=require("./methods.js"),Ir=require("./dispose.js"),it=require("./devRuntime.js"),R=require("@symbo.ls/utils"),Vt=Lo(require("@symbo.ls/utils"),1),Y=require("./pluginHooks.js"),at=require("@symbo.ls/state"),C=require("css-in-props"),tt=require("@symbo.ls/css"),M=require("@symbo.ls/scratch"),v=require("attrs-in-props"),zs=require("./engineRegistry.js"),B=require("./cssLonghands.js"),Q=require("./attributeFirst.js"),qs=require("./version.js");const No=(0,zs.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},qs.VERSION),pt=[],nt=new Set;let so=!1,Mo=0,ht=null,wt=null;function yt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Fo(){return typeof document<"u"&&document.visibilityState==="hidden"}const ln=250,pn=1e3;function hn(){return wt&&(wt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Fo())?!0:yt()-Mo>=pn}function yn(){if(so=!0,Mo=yt(),wt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Xt,0);ht=t?()=>t(o):null;return}if(Fo()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Xt,ln);ht=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;wt=requestAnimationFrame;const o=requestAnimationFrame(Xt);ht=t?()=>t(o):null}}function St(){if(so){if(!hn())return;const t=ht;if(ht=null,t)try{t()}catch{}}yn()}const Io=300,$o=15e4;let no=0;function _n(){no++;let t=!1;return()=>{t||(t=!0,!(--no>0)&&(pt.length||nt.size)&&St())}}function Xt(){if(so=!1,ht=null,wt=null,no>0||(nt.size&&Ar(),!pt.length))return;const t=pt.splice(0,pt.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=yt());const r=yt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Io&&r<$o?(pt.push(s),St()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&(0,Gs.mountBridge)(s),typeof s.onMounted=="function"&&U("Mounted",s,s.__ref?.__mountOptions||{})}}}function ro(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Tt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,pt.push(t),St())}function Eo(t,o){typeof t.onContentUpdate=="function"&&((0,Y.dispatchPluginHook)("contentUpdate",t,o),(0,q.withDesignSystem)(t,()=>{try{t.onContentUpdate(t,t.state,t.context,o)}catch(s){if((0,Y.reportLifecycleError)(t,"onContentUpdate",s),t.context?.strictMode)throw s}}))}function gn(t){return t.toLowerCase()}function Uo(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function Kt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Ho(t,o,s,n){return Gt(n,Kt(t)||(o&&typeof o=="object"?Kt(o.key):void 0)||String(s))}function Gt(t,o){if(!t||typeof o!="string")return o;let s=o;for(;bn(t,s);)s="$"+s;return s!==o&&An(t,o,s),s}function bn(t,o){if(G.REGISTRY.has(o)&&o!=="content")return!0;if(!(o in t))return!1;const s=t[o];return!(s&&typeof s=="object"&&s.__ref&&s.parent===t)}const Bo=new Set;function An(t,o,s){if(!(0,it.isLoudDevRuntime)())return;const n=t.__ref&&t.__ref.path&&t.__ref.path.join(".")||t.key||"<root>",r=n+"::"+o;Bo.has(r)||(Bo.add(r),console.warn(`[smbls] a child keyed "${o}" at ${n} names a property of its parent; it lives at el["${s}"] (data-key="${s}") so the parent keeps its own "${o}". Prefix the data keys to keep plain el.<key> access.`))}function m(t,o,s,n={},r){if((0,j.getObserver)())return(0,q.untrack)(()=>m(t,o,s,n,r));if(t==null||t===!1)return null;const c=Hn(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Kt(s);const a=Kt(t.key),i=Object.create(null);i.key=s||(a&&o?Gt(o,a):a)||`_${No.uniqId++}`,i.parent=o||null,i.context=t.context||o?.context||n.context||{},i.context.__create||(i.context.__create=m);const e=i.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||i,path:o?.__ref?.path?[...o.__ref.path,i.key]:[i.key],origin:t,__mount:null,__plainRows:null,__ifParked:null};c&&(e.__runtimeSource=c);let f=r;r&&(r.holdTail||r.deferAttach)&&(r.holdTail&&H.FEATURES.mount!==null&&H.FEATURES.mount.hold(i),r.deferAttach&&((0,dt.mountRecord)(e).attachLater=!0),f=void 0);const l=t;if(t=Vo(i,t,s,a,o,n),i.if!=null){let _;if(typeof i.if=="function")try{_=i.if(i,i.state,i.context)}catch(p){if(_=!1,e.__ifError=p,typeof console<"u"&&console.warn){const y=i.key||i.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,p?.message||p)}}else _=i.if;e.__if=!!_}if(e.__if)typeof i.if=="function"&&(e.__ifInitialized=!0);else{if(o){o[i.key]=i;const p=o.__ref;p&&(p.__ifParked||(p.__ifParked=new Set)).add(i.key)}const _=Cn(t,s,i.context?.components);return _.length&&(e.__ifLateMerge={definition:l,key:s,ownKey:a,names:_,options:n}),typeof i.if=="function"&&es(i,e,i.if),i}i.tag||(i.tag=(0,ot.detectTag)(i)),U("Init",i,n);const u=H.FEATURES.hydration,d=i.node=u!==null&&u.adopt(i)||(0,ot.cacheNode)(i);if(!d)return i;if(i.tag==="fragment"){const p=(i.context?.document||globalThis.document).createComment("");d.appendChild(p),e.__fragmentAnchor=p}if(U("AttachNode",i,n),d.setAttribute&&i.key&&d.setAttribute("data-key",i.key),o){const _=o[i.key];o[i.key]=i;const p=o.__ref?.__children;p&&(_===void 0||!p.includes(i.key))&&p.push(i.key)}d.setAttribute&&i.context?.scopeSelector&&i.context.scopeSelector!==":root"&&i.context.key&&i.key===i.context.key&&d.setAttribute("data-smbls-app",i.context.key),i.id&&d.setAttribute&&(d.id=i.id),$s(i,n),ss(i),rs(i);try{Bs(i,n)}catch(_){Ys(i,_)}const h=e.__mount;return h!==null&&h.pending>0?(h.attachLater||Zt(i,o,f),h.tail=()=>H.FEATURES.mount.finish(i,n),i):(Mt(i,!0),(h===null||!h.attachLater)&&Zt(i,o,f),Zs(i,n),i)}function xn(t){const o=t&&t.__ref&&t.__ref.__mount;return!o||!o.attachLater||(o.attachLater=!1,!t.node)?!1:(Zt(t,t.parent),!0)}function Ys(t,o){if(typeof console<"u"&&console.error){const s=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] createChildren failed at ${s}:`,o?.message||o,o?.stack?`
1
+ "use strict";var rs=Object.create;var Kt=Object.defineProperty;var es=Object.getOwnPropertyDescriptor;var is=Object.getOwnPropertyNames;var cs=Object.getPrototypeOf,fs=Object.prototype.hasOwnProperty;var as=(t,o)=>{for(var n in o)Kt(t,n,{get:o[n],enumerable:!0})},Do=(t,o,n,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of is(o))!fs.call(t,r)&&r!==n&&Kt(t,r,{get:()=>o[r],enumerable:!(s=es(o,r))||s.enumerable});return t};var Lo=(t,o,n)=>(n=t!=null?rs(cs(t)):{},Do(o||!t||!t.__esModule?Kt(n,"default",{value:t,enumerable:!0}):n,t)),us=t=>Do(Kt({},"__esModule",{value:!0}),t);var Nr={};as(Nr,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>mt,acquireBeforeUpdateGuard:()=>ts,arrayRowDefinition:()=>Xn,attachElement:()=>xs,attachWhole:()=>Ss,completeCreate:()=>Qn,create:()=>tt,default:()=>Lr,flushMounts:()=>Jt,holdMountFlush:()=>_s,isStaticCssProp:()=>_r,markRuntimeSupplied:()=>xt,placeAfter:()=>To,placeRows:()=>mn,placedRowNode:()=>Ft,recompileStaticCss:()=>gr,reconcileAttrProp:()=>Ar,releaseBeforeUpdateGuard:()=>$t,reportCreateChildrenError:()=>Zn,resolveStyleBlock:()=>Mt,rowAttach:()=>Jn,runtimeViewOf:()=>ut,syncSelectValue:()=>It,triggerContentUpdate:()=>Eo,writeAttr:()=>Nt,writeElementText:()=>Lt});module.exports=us(Nr);var K=require("@symbo.ls/signal"),j=require("@symbo.ls/signal"),ds=Lo(require("@symbo.ls/signal"),1),q=require("./runContext.js"),X=require("./cache.js"),G=require("./registry.js"),N=require("./delegate.js"),U=require("./features.js"),Wn=require("./bridge.js"),W=require("./extends.js"),Xt=require("./connected.js"),dt=require("./mountRecord.js"),zn=require("./methods.js"),Hr=require("./dispose.js"),it=require("./devRuntime.js"),R=require("@symbo.ls/utils"),Gt=Lo(require("@symbo.ls/utils"),1),Y=require("./pluginHooks.js"),at=require("@symbo.ls/state"),C=require("css-in-props"),ot=require("@symbo.ls/css"),M=require("@symbo.ls/scratch"),v=require("attrs-in-props"),qn=require("./engineRegistry.js"),B=require("./cssLonghands.js"),Q=require("./attributeFirst.js"),Yn=require("./version.js");const No=(0,qn.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},Yn.VERSION),pt=[],st=new Set;let no=!1,Mo=0,ht=null,St=null;function yt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Fo(){return typeof document<"u"&&document.visibilityState==="hidden"}const ls=250,ps=1e3;function hs(){return St&&(St!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Fo())?!0:yt()-Mo>=ps}function ys(){if(no=!0,Mo=yt(),St=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Jt,0);ht=t?()=>t(o):null;return}if(Fo()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Jt,ls);ht=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;St=requestAnimationFrame;const o=requestAnimationFrame(Jt);ht=t?()=>t(o):null}}function kt(){if(no){if(!hs())return;const t=ht;if(ht=null,t)try{t()}catch{}}ys()}const Io=300,$o=15e4;let so=0;function _s(){so++;let t=!1;return()=>{t||(t=!0,!(--so>0)&&(pt.length||st.size)&&kt())}}function Jt(){if(no=!1,ht=null,St=null,so>0||(st.size&&wr(),!pt.length))return;const t=pt.splice(0,pt.length);for(let o=0;o<t.length;o++){const n=t[o];if(n.node){if(!n.node.isConnected){const s=n.__ref||(n.__ref={});s.__mountAttempts=(s.__mountAttempts||0)+1,s.__mountFirstAttemptAt==null&&(s.__mountFirstAttemptAt=yt());const r=yt()-s.__mountFirstAttemptAt;s.__mountAttempts<=Io&&r<$o?(pt.push(n),kt()):console.warn("[DOMQL] onMounted dropped after",s.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",n.key||n.tag||n);continue}typeof n.onBridgeMount=="function"&&(0,Wn.mountBridge)(n),typeof n.onMounted=="function"&&H("Mounted",n,n.__ref?.__mountOptions||{})}}}function ro(t,o){const n=t.__ref?.__autoGrow;n&&n.active&&Ot(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,pt.push(t),kt())}function Eo(t,o){typeof t.onContentUpdate=="function"&&((0,Y.dispatchPluginHook)("contentUpdate",t,o),(0,q.withDesignSystem)(t,()=>{try{t.onContentUpdate(t,t.state,t.context,o)}catch(n){if((0,Y.reportLifecycleError)(t,"onContentUpdate",n),t.context?.strictMode)throw n}}))}function gs(t){return t.toLowerCase()}function Ho(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function Wt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Uo(t,o,n,s){return zt(s,Wt(t)||(o&&typeof o=="object"?Wt(o.key):void 0)||String(n))}function zt(t,o){if(!t||typeof o!="string")return o;let n=o;for(;bs(t,n);)n="$"+n;return n!==o&&As(t,o,n),n}function bs(t,o){if(G.REGISTRY.has(o)&&o!=="content")return!0;if(!(o in t))return!1;const n=t[o];return!(n&&typeof n=="object"&&n.__ref&&n.parent===t)}const Bo=new Set;function As(t,o,n){if(!(0,it.isLoudDevRuntime)())return;const s=t.__ref&&t.__ref.path&&t.__ref.path.join(".")||t.key||"<root>",r=s+"::"+o;Bo.has(r)||(Bo.add(r),console.warn(`[smbls] a child keyed "${o}" at ${s} names a property of its parent; it lives at el["${n}"] (data-key="${n}") so the parent keeps its own "${o}". Prefix the data keys to keep plain el.<key> access.`))}function tt(t,o,n,s={},r){if((0,j.getObserver)())return(0,q.untrack)(()=>tt(t,o,n,s,r));if(t==null||t===!1)return null;const c=Vs(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),n=Wt(n);const a=Wt(t.key),i=Object.create(null);i.key=n||(a&&o?zt(o,a):a)||`_${No.uniqId++}`,i.parent=o||null,i.context=t.context||o?.context||s.context||{},i.context.__create||(i.context.__create=tt);const e=i.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||i,path:o?.__ref?.path?[...o.__ref.path,i.key]:[i.key],origin:t,__mount:null,__plainRows:null,__ifParked:null};c&&(e.__runtimeSource=c);let f=r;r&&(r.holdTail||r.deferAttach)&&(r.holdTail&&U.FEATURES.mount!==null&&U.FEATURES.mount.hold(i),r.deferAttach&&((0,dt.mountRecord)(e).attachLater=!0),f=void 0);const l=t;if(t=Vo(i,t,n,a,o,s),i.if!=null){let _;if(typeof i.if=="function")try{_=i.if(i,i.state,i.context)}catch(p){if(_=!1,e.__ifError=p,typeof console<"u"&&console.warn){const y=i.key||i.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,p?.message||p)}}else _=i.if;e.__if=!!_}if(e.__if)typeof i.if=="function"&&(e.__ifInitialized=!0);else{if(o){o[i.key]=i;const p=o.__ref;p&&(p.__ifParked||(p.__ifParked=new Set)).add(i.key)}const _=js(t,n,i.context?.components);return _.length&&(e.__ifLateMerge={definition:l,key:n,ownKey:a,names:_,options:s}),typeof i.if=="function"&&en(i,e,i.if),i}i.tag||(i.tag=(0,X.detectTag)(i)),H("Init",i,s);const u=U.FEATURES.hydration,d=i.node=u!==null&&u.adopt(i)||(0,X.cacheNode)(i);if(!d)return i;if(i.tag==="fragment"){const p=(i.context?.document||globalThis.document).createComment("");d.appendChild(p),e.__fragmentAnchor=p}if(H("AttachNode",i,s),d.setAttribute&&i.key&&d.setAttribute("data-key",i.key),o){const _=o[i.key];o[i.key]=i;const p=o.__ref?.__children;p&&(_===void 0||!p.includes(i.key))&&p.push(i.key)}d.setAttribute&&i.context?.scopeSelector&&i.context.scopeSelector!==":root"&&i.context.key&&i.key===i.context.key&&d.setAttribute("data-smbls-app",i.context.key),i.id&&d.setAttribute&&(d.id=i.id),Hn(i,s),nn(i),rn(i);try{Vn(i,s)}catch(_){Zn(i,_)}const h=e.__mount;return h!==null&&h.pending>0?(h.attachLater||(s.mountWhole===!0&&!(r&&r.holdTail)&&ws(i,o)?h.held=!0:At(i,o,f)),h.tail=()=>U.FEATURES.mount.finish(i,s),i):(It(i,!0),(h===null||!h.attachLater)&&At(i,o,f),Qn(i,s),i)}function xs(t){const o=t&&t.__ref&&t.__ref.__mount;return!o||!o.attachLater||(o.attachLater=!1,!t.node)?!1:(At(t,t.parent),!0)}function ws(t,o){if(!o||o.tag==="fragment")return!1;const n=t.node;if(!n||n.nodeType===11)return!1;const s=o.node||(o.nodeType?o:null);return!!s&&n.parentNode!==s}function Ss(t){const o=t.__ref,n=o&&o.__mount;if(!n||!n.held)return;n.held=!1;const s=t.node,r=t.parent;if(!s||!r)return;const c=r.__ref;if(!c){At(t,r);return}const a=r.node;if(!a)return;const i=c.__children,e=i?i.lastIndexOf(t.key):-1;let f;for(let l=e-1;l>=0;l--){const u=r[i[l]],d=u&&(Ft(u)||(u.tag==="fragment"&&u.__ref?u.__ref.__fragmentAnchor:null));if(d&&d.parentNode===a){f=d.nextSibling;break}}f===void 0&&(f=(0,X.firstSlotAfterText)(a,c.__textNode)),At(t,r,f?{position:"before",node:f}:void 0)}function Zn(t,o){if(typeof console<"u"&&console.error){const n=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] createChildren failed at ${n}:`,o?.message||o,o?.stack?`
2
2
  `+o.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}function Zs(t,o){if(typeof t.html=="function"&&t.node&&!t.node.innerHTML&&(0,q.withDesignSystem)(t,()=>{try{const s=t.html(t,t.state,t.context);s!=null&&typeof s!="function"&&(t.node.innerHTML=s)}catch{}}),U("Create",t,o),U("Complete",t,o),U("Render",t,o),U("RenderRouter",t,o),ro(t,o),typeof t.onFrame=="function"){const s=t.onFrame,n=t.context?.designSystem,r=()=>{if(t.node){if(t.node.isConnected){n&&(0,M.pushConfig)(n);try{s(t,t.state,t.context)}catch(c){console.error("[DOMQL] onFrame error:",c)}finally{n&&(0,M.popConfig)()}}requestAnimationFrame(r)}};requestAnimationFrame(r)}}function Wt(t,o){const s=o&&o.__ref&&o.__ref.__mount;!s||!s.tail||s.holder||(s.holder=t,H.FEATURES.mount.hold(t))}const wn=new Set(["childProps","attr","style","scope","data","vars"]);function Vo(t,o,s,n,r,c){if(s&&!o.extends&&!o.extend){const p=s.indexOf("_"),y=s.indexOf(".");let A=p>0?p:-1;if(y>0&&(A<0||y<A)&&(A=y),A>0){const S=s.substring(0,A),w=t.context?.components;w&&(w[S]||w["smbls."+S])?o={...o,extends:S}:w&&(0,it.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 "${S}" but neither "${S}" nor "smbls.${S}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),(0,W.applyExtends)(t,o,c);const a=(0,W.openMergeLayer)(t),i=t.props&&typeof t.props=="object"?t.props:null;for(const p in o)if(!(p==="parent"||p==="node"||p==="__ref"||p==="extends"||p==="context"||p==="props")){if(p==="key"){n&&(t.key=r?Gt(r,n):n);continue}a&&a.mark(p),eo(t,p,o[p])}if(i)for(const p in i)eo(t,p,i[p]);const e=o.props;if(e&&typeof e=="object"){for(const p in e)eo(t,p,e[p]);if(a)for(const p in e)a.mark(p)}(0,W.closeMergeLayer)(t),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const f=t.scope&&typeof t.scope=="object"?t.scope:null,l=r?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,d=l||u||null;if(o.scope!==void 0||f){const p={};f&&Object.assign(p,f),o.scope!==void 0&&Object.assign(p,o.scope),t.scope=(0,K.createScopeStore)(p,d)}else d&&(t.scope=d);o.if!==void 0&&(t.if=o.if);const h=t.__ref,_=Bn(t,h&&h.__runtimeSource);return h&&(h.__declaredArrays=_||void 0),(0,Ws.addMethods)(t),vn(t,r,o,c),o}function eo(t,o,s){const n=t[o],r=H.FEATURES.chains;if(r!==null&&r(t,o,n,s))return;const c=n&&s&&typeof n=="object"&&typeof s=="object"&&!Array.isArray(n)&&!Array.isArray(s);c&&o.charCodeAt(0)>=65&&o.charCodeAt(0)<=90?t[o]=(0,W.deepMergeChild)(n,s):c&&wn.has(o)?t[o]={...n,...s}:c&&Uo(o)?t[o]=(0,W.deepMergeChild)(n,s):t[o]=s}const Sn=new Set(["key","parent","context","__ref"]);function kn(t,o){for(const n of Object.keys(t))Sn.has(n)||delete t[n];let s=o.definition;if(!s.extends&&!s.extend&&typeof o.key=="string"){const n=t.context?.components||{},r=n[o.key]||n["smbls."+o.key];r&&(s={...s,extends:r})}(0,q.untrack)(()=>Vo(t,s,o.key,o.ownKey,t.parent,o.options))}function Cn(t,o,s){const n=s||{},r=i=>!!(n[i]||n["smbls."+i]),c=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const i of a){if(typeof i!="string")continue;const e=i.includes(">")?i.split(">")[0].trim():i;r(e)||c.push(e)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let i=-1;const e=o.indexOf("_"),f=o.indexOf(".");e>0&&(i=e),f>0&&(i<0||f<i)&&(i=f);const l=i>0?o.substring(0,i):o;r(l)||c.push(l)}return c}function io(t,o,s){if(typeof t.onStateInit!="function"&&!(0,Y.hasPluginHook)(t,"stateInit"))return;const n=t.state;t.state=o;try{U("StateInit",t,s)}finally{t.state=n}}const co=t=>({isDataOnlyKey:o=>(0,R.polyglotSeededKeys)(t).has(o)});function vn(t,o,s,n){const r=!o,c=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=r&&c&&t.context?.state,i=s.state!==void 0&&!a?s.state:t.state&&!(0,K.isStore)(t.state)?t.state:void 0;if(i==null){if(o?.state)t.state=o.state,(0,at.applyStateMethods)(t,t.state);else if(t.context?.state){const e=t.context.state,f={...e},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=e.lang||l.defaultLang||"en",h=new Set,_=(A,S)=>{h.has(A)||(0,R.isPolyglotWritableKey)(u,A,f)&&(f[A]=S,h.add(A),(0,R.markPolyglotSeeded)(u,A,S))},p=l.translations[d];if(p&&typeof p=="object")for(const A in p)_(A,p[A]);const y=new Set(l.languages||[]);for(const A in l.translations)y.has(A)||_(A,l.translations[A])}(0,K.isStore)(f)||io(t,f,n),t.state=(0,K.isStore)(f)?f:(0,K.createStore)(f,co(t.context)),t.state.__element=t,t.state.root=t.state,(0,at.applyStateMethods)(t,t.state),Vt.promoteActiveRootState?.(e,t.state),U("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,at.applyStateMethods)(t,t.state);return}if(typeof i=="string"){if(t.state=Wo(i,o),t.state&&typeof t.state=="object"&&!(0,K.isStore)(t.state)){const e=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:e,enumerable:!1,configurable:!0,writable:!0})}(0,at.applyStateMethods)(t,t.state),Pn(t,i,o),U("StateCreated",t,n);return}if(typeof i=="function"){const e=i(t,o?.state);if((0,K.isStore)(e))t.state=e;else{const f=e||{};io(t,f,n),t.state=(0,K.createStore)(f,o?.state?void 0:co(t.context))}}else if((0,K.isStore)(i))t.state=i;else{const e={...i};io(t,e,n),t.state=(0,K.createStore)(e,o?.state?void 0:co(t.context))}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,(0,at.applyStateMethods)(t,t.state),Vt.promoteActiveRootState?.(i,t.state),U("StateCreated",t,n)}function Ko(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const r of s){if(n==null)return{};n=n[r]}return n??{}}function Go(t,o){const s=o.state;return t.startsWith("~/")?[s&&(s.root||s),t.slice(2)]:t.startsWith("../")?[s,t.slice(3)]:[s,t]}function Wo(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[r,c]=Go(t,o);return c?Ko(r,c):r??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=Ko(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const r=o.state?.root?.lang||n.defaultLang||"en",c=n.translations[r];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function jn(t,o){const[s,n]=Go(t,o);if(!n||!s||typeof s!="object")return;const r=s[n];if(r!==void 0||n.indexOf("/")===-1)return r;let c=s;for(const a of n.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function Pn(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!(0,K.isStore)(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const r=(0,q.untrack)(()=>(0,j.createEffect)(()=>{const c=jn(o,s);!c||typeof c!="object"||c===t.state||(0,q.untrack)(()=>zo(t,t.state,c,!0))},{depth:n.path?n.path.length:0,label:P(n,"state")}));r._isStateBinding=!0,n.__stateBinding=r,n.__effects&&n.__effects.push(r)}function zo(t,o,s,n){const r=t.__ref;if(!r)return;if(n||t.state===o){t.state=s,n&&(0,at.applyStateMethods)(t,s),Yo(r);const a=r.__children;if(a)for(let i=0;i<a.length;i++){const e=t[a[i]];e&&e.__ref&&e.parent===t&&zo(e,o,s,!1)}return}if(r.__stateBinding){r.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=s,Yo(r))}function qo(t,o){const s=t.__ifParked;if(!s||!s.size)return o;for(const n of s)o.includes(n)||o.push(n);return o}function Yo(t){const o=t.__effects;if(o)for(let s=0;s<o.length;s++){const n=o[s];n&&!n._disposed&&!n._isStateBinding&&!n._isSubscribeToEffect&&typeof n._notify=="function"&&n._notify()}}const En=new Set(["s","state","ctx","context"]),fo=new WeakMap;function Tn(t){if(fo.has(t))return fo.get(t);let o=null;try{const s=typeof Vt.getFunctionSource=="function"?Vt.getFunctionSource(t):Function.prototype.toString.call(t);if(typeof s=="string"){const n=s.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||s.match(/^[^(]*\(([^)]*)\)/);n&&(o={params:n[1].split(",").map(r=>r.trim())})}}catch{}return fo.set(t,o),o}function On(t){const o=Tn(t);return o?o.params.map(s=>s.split("=")[0].trim()).filter(Boolean):[]}const Rn=3,Dn=/^(is|has)[A-Z0-9_$]/,Ln=new Set(["routerOptions"]),Zo=new WeakSet;function Nn(t,o){if(typeof t!="function"||t.length!==2||o&&(Dn.test(o)||Ln.has(o))||Zo.has(t))return!1;const s=On(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<Rn||En.has(n)?!1:(Zo.add(t),!0)}function Mn(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const i=c[a];if(typeof t[i]!="function"||G.REGISTRY.has(i))continue;const e=i.charCodeAt(0);e>=65&&e<=90||(0,N.isHandlerKey)(i)||C.CSS_PROPS_REGISTRY[i]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(i)||e!==45&&((0,v.checkAttributeByTagName)(s,i)||((0,it.isLoudDevRuntime)()&&Nn(t[i],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 a=0;a<r.length;a++){const{prop:i,fn:e}=r[a];o.__exec[i]=e,Object.defineProperty(t,i,{get(){n&&(0,M.pushConfig)(n);try{return e(t,t.state,t.context)}catch{return}finally{n&&(0,M.popConfig)()}},set(f){delete o.__exec[i],Object.defineProperty(t,i,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Fn(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const n=o[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function L(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return Fn(t,o),s.apply(this,n)}}function _t(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function P(t,o){return()=>t.path.join(".")+"::"+o}const Qo=new Set;function V(t,o,s){if(!(0,it.isLoudDevRuntime)())return;const n=P(t,o)();Qo.has(n)||(Qo.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Xo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,Jo=new WeakMap,In=t=>{let o=Jo.get(t);if(o!==void 0)return o;o=null;let s;try{s=String(t)}catch{s=""}if(s.includes("{{")){Xo.lastIndex=0;let n;for(;(n=Xo.exec(s))!==null;)n[2].includes("{{")&&(o||(o=[])).push(n[2])}return Jo.set(t,o),o},$n=(t,o)=>{const s=In(t);if(s)for(let n=0;n<s.length;n++)o.add(s[n])},Un=(t,o)=>!(0,N.isHandlerKey)(t)&&!(0,Q.isCssProp)(o,t),ao=(t,o,s,n,r)=>{if(typeof o=="string"){!r&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Un(t,n)&&$n(o,s)},uo=new WeakMap,kt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Ct=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?(0,W.deepMergeChild)(t,o):t},vt=(t,o)=>t&&o?(0,W.deepMergeChild)(t,o):t||o||null,mo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&kt(s,o)},ut=(t,o)=>mo(t,o)?Ct(t.__ref.__runtimeSource[o]):null,At=(t,o)=>(o&&t&&typeof t=="object"&&uo.set(t,o),t),Hn=t=>{if(!t||typeof t!="object")return;const o=uo.get(t);return o&&uo.delete(t),o},lo=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let n=0;n<t.length;n++)lo(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const r=Object.getOwnPropertyDescriptor(t,n);r&&"value"in r&&lo(r.value,o,s)}}},Bn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(G.REGISTRY.has(n)||o&&kt(o,n))continue;const r=Object.getOwnPropertyDescriptor(t,n),c=r&&r.value;if(!Array.isArray(c))continue;const a=new Set;lo(c,a,new Set),a.size&&(s||(s=new Map),s.set(c,a))}return s},ts=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,r=n&&n.get(o);if(!r)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of r)c.__authoredTemplates.add(a);return}},os=["attr","aria","data","metadata"],Vn=t=>{if(os.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},Kn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const r of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,r),a=c&&c.value,i=!!o&&kt(o,r);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!Vn(r))continue;const e=i?o[r]:null,f=e&&typeof e=="object"?e:null,l=r.charCodeAt(0)===46||r.charCodeAt(0)===33;for(const u in a){const d=i&&(!f||kt(f,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&os.includes(u)){for(const _ in h)ao(_,h[_],s,n,d);continue}ao(u,h,s,n,d)}continue}ao(r,a,s,n,i)}return s};function ss(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),r=Kn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const e of r)s.__authoredTemplates.add(e);else s.__authoredTemplates=r;if(Mn(t),typeof t.text=="function"){const e=t.text,f=L(t,t.textDeps,e),l=(0,j.createEffect)(()=>{if(!s.contentManaged)try{let u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),Dt(t,u))}catch(u){V(s,"text",u)}},{depth:s.path.length,label:P(s,"text")});s.__effects.push(l),s.__exec.text=e}else if(typeof t.text=="string"&&t.text.includes("{{")){const e=t.text,f=(0,j.createEffect)(()=>{if(s.contentManaged)return;const l=R.replaceLiteralsWithObjectFields.call(t,e,t.state);l!=null&&(t.text=l),t.node&&Dt(t,l??"")},{depth:s.path.length,label:P(s,"text")});s.__effects.push(f),s.__exec.text=e}const c=t.tag||"div";for(const e of Object.keys(t))if(typeof t[e]=="function"&&!G.REGISTRY.has(e)&&!(0,N.isHandlerKey)(e)&&!s.__exec[e]&&!(0,Q.isAttributeFirst)(c,e)){if(C.CSS_PROPS_REGISTRY[e]){const f=t[e],l=L(t,t[e+"Deps"],f),u=e;let d,h=null,_=null,p;const y=(0,j.createEffect)(()=>{const A=t.context?.designSystem;A&&(0,M.pushConfig)(A);try{const S=l(t,t.state,t.context);(0,C.pushStaticCssPass)();let w;try{w=C.CSS_PROPS_REGISTRY[u](S,t,t.state,t.context)}finally{(0,C.popStaticCssPass)()}if(Array.isArray(w)){const g={};for(const x of w)if(x)for(const k in x)g[k]=x[k];w=g}const b=u==="show"||u==="hide";if(w&&t.node&&zn(w)){const g=gt(w);if(g===null||g!==p){p=g;const x=(0,tt.css)(w,null,t.context?.cssPrefix),k=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(_)for(const E of _)t.node.classList.remove(E);if(k&&k.length)for(const E of k)t.node.classList.add(E);_=k}}d=void 0,h=null}else if(w&&t.node){if(_){for(const x of _)t.node.classList.remove(x);_=null,p=void 0}const g=gt(w);if(g===null||g!==d||!Pt(t.node,h)){d=g;const x=ps(t,w);h=jt(t.node,x)}}else t.node&&b&&(d=void 0,h=null,t.node.style.display="")}finally{A&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(y),s.__exec[e]=f}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(e)){const f=t[e],l=L(t,t[e+"Deps"],f),u=e;let d,h=null;const _=(0,j.createEffect)(()=>{const p=t.context?.designSystem;p&&(0,M.pushConfig)(p);try{const y=l(t,t.state,t.context);if(t.node)if(y!=null){const A=u+":"+String(y);if(A!==d||!Pt(t.node,h)){d=A;const S={[u]:y},w=ps(t,S);h=jt(t.node,w)}}else d=void 0,h=null,t.node.style[u]=""}finally{p&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(_),s.__exec[e]=f}else if(e.charCodeAt(0)===45){const f=t[e];us(t,e,f,t[e+"Deps"],e),s.__exec[e]=f}}if(qn(t),typeof t.html=="function"){const e=t.html,f=L(t,t.htmlDeps,e),l=(0,j.createEffect)(()=>{(0,q.withDesignSystem)(t,()=>{const u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)})},{depth:s.path.length,label:P(s,"html")});s.__effects.push(l),s.__exec.html=e}if(typeof t.value=="function"){const e=t.value,f=L(t,t.valueDeps,e),l=(0,j.createEffect)(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),is(t,u)}catch(u){V(s,"value",u)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(l),s.__exec.value=e}else if(typeof t.value=="string"&&t.value.includes("{{")){const e=t.value,f=(0,j.createEffect)(()=>{try{is(t,R.replaceLiteralsWithObjectFields.call(t,e,t.state))}catch(l){V(s,"value",l)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(f),s.__exec.value=e}if(typeof t.style=="function"){const e=t.style,f=L(t,t.styleDeps,e);let l,u=null,d,h,_,p;const y=(0,j.createEffect)(()=>{const A=f(t,t.state,t.context),S=t.context&&t.context.designSystem;let w;if(A&&typeof A=="object"&&A===d&&S===_){const g=gt(A);w=g!==null&&g===h?p:Nt(t,A),h=g}else w=Nt(t,A),h=void 0;d=A,_=S,p=w;const b=gt(w);(b===null||b!==l||!Pt(t.node,u))&&(l=b,ho(t.node,u,w),rt(t.node,w),u=jt(t.node,w))},{depth:s.path.length,label:P(s,"style")});s.__effects.push(y),s.__exec.style=e}else if(t.style&&typeof t.style=="object")for(const e in t.style){const f=t.style[e];if(typeof f!="function")continue;const l=L(t,_t(t.styleDeps,e),f);let u,d=null;const h=(0,j.createEffect)(()=>{try{const _=l(t,t.state,t.context);if(t.node){const p=e+":"+String(_);if(p!==u||!Pt(t.node,d)){u=p;const y=Nt(t,{[e]:_});ho(t.node,d,Object.assign({},y,{[e]:""})),rt(t.node,y),d=jt(t.node,y)}}}catch(_){V(s,"style."+e,_)}},{depth:s.path.length,label:P(s,"style."+e)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const e in t.attr)if(typeof t.attr[e]=="function"){const f=L(t,_t(t.attrDeps,e),t.attr[e]),l=e,u=(0,j.createEffect)(()=>{try{let d=f(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&Lt(t.node,l,d)}catch(d){V(s,"attr."+l,d)}},{depth:s.path.length,label:P(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[e]=="string"&&t.attr[e].includes("{{")){const f=t.attr[e],l=e,u=(0,j.createEffect)(()=>{try{const d=R.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,(0,v.serializeAttrValue)(l,d??""))}catch(d){V(s,"attr."+l,d)}},{depth:s.path.length,label:P(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const f=t.aria[e];if(typeof f=="string"&&f.includes("{{")){const h=f,_="aria-"+e.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),p=(0,j.createEffect)(()=>{try{const y=R.replaceLiteralsWithObjectFields.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(_,(0,v.serializeAttrValue)(_,y??""))}catch(y){V(s,"aria."+e,y)}},{depth:s.path.length,label:P(s,"aria."+e)});p._attrName=_,s.__effects.push(p);continue}if(typeof f!="function")continue;const l=L(t,_t(t.ariaDeps,e),t.aria[e]),u="aria-"+e.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=(0,j.createEffect)(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;Lt(t.node,u,h)}catch(h){V(s,"aria."+e,h)}},{depth:s.path.length,label:P(s,"aria."+e)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const e in t.data){const f=t.data[e];if(typeof f=="string"&&f.includes("{{")){const _=f,p="data-"+e.replace(/[A-Z]/g,A=>"-"+A.toLowerCase()),y=(0,j.createEffect)(()=>{try{const A=R.replaceLiteralsWithObjectFields.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(p,A??"")}catch(A){V(s,"data."+e,A)}},{depth:s.path.length,label:P(s,"data."+e)});y._attrName=p,s.__effects.push(y);continue}if(typeof f!="function")continue;const l=L(t,_t(t.dataDeps,e),t.data[e]),d="data-"+e.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),h=(0,j.createEffect)(()=>{try{const _=l(t,t.state,t.context);if(!t.node?.setAttribute)return;_==null||_===!1?t.node.removeAttribute(d):typeof _!="function"&&typeof _!="object"&&t.node.setAttribute(d,_===!0?"":_)}catch(_){V(s,"data."+e,_)}},{depth:s.path.length,label:P(s,"data."+e)});h._attrName=d,s.__effects.push(h)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const e in a){if(typeof a[e]!="function")continue;const f=L(t,_t(t.classDeps,e),a[e]),l=(0,j.createEffect)(()=>{try{const u=f(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(e):t.node.classList.remove(e)}catch(u){V(s,"class."+e,u)}},{depth:s.path.length,label:P(s,"class."+e)});s.__effects.push(l)}!n&&typeof t.if=="function"&&es(t,s,t.if);for(const e of Object.keys(t)){if(G.REGISTRY.has(e)||typeof t[e]!="function")continue;const f=e.charCodeAt(0);if(f>=65&&f<=90||(0,N.isHandlerKey)(e))continue;const l=t[e];s.__exec[e]=l;const u=t.tag||"div";if((0,v.checkAttributeByTagName)(u,e)&&!(0,Q.isCssProp)(u,e)){const d=(0,v.camelToAttr)(e)||e,h=L(t,t[e+"Deps"],l),_=(0,j.createEffect)(()=>{try{let p=h(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=R.replaceLiteralsWithObjectFields.call(t,p,t.state)),t.node?.setAttribute&&Lt(t.node,d,p,!0)}catch(p){V(s,e,p)}},{depth:s.path.length,label:P(s,e)});_._attrName=d.toLowerCase(),s.__effects.push(_)}}const i=t.tag||"div";for(const e of Object.keys(t)){if(G.REGISTRY.has(e))continue;const f=t[e];if(typeof f!="string"||!f.includes("{{"))continue;const l=e.charCodeAt(0);if(l>=65&&l<=90||(0,N.isHandlerKey)(e)||(0,Q.isCssProp)(i,e)||v.ATTR_TRANSFORMS[e]||!(0,v.checkAttributeByTagName)(i,e))continue;const u=(0,v.camelToAttr)(e)||e,d=(0,j.createEffect)(()=>{try{const h=R.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,v.serializeAttrValue)(u,h??""))}catch(h){V(s,e,h)}},{depth:s.path.length,label:P(s,e)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(tr(t),ur(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const e=t.onStateUpdate,f=t.stateDeps;let l=!1,u=[];const d=(0,j.createEffect)(()=>{const h=[];for(let y=0;y<f.length;y++){const A=f[y];try{h[y]=typeof A=="function"?A(t,t.state,t.context):t.state?.[A]}catch{h[y]=void 0}}if(!l){l=!0,u=h;return}let _=h.length!==u.length;for(let y=0;!_&&y<h.length;y++)h[y]!==u[y]&&(_=!0);const p=u;u=h,_&&(0,q.withDesignSystem)(t,()=>{try{e(t,t.state,t.context,{prev:p,next:h})}catch(y){if((0,Y.reportLifecycleError)(t,"onStateUpdate",y),t.context?.strictMode)throw y}})},{depth:s.path.length,label:P(s,"onStateUpdate")});s.__effects.push(d)}rr(t)}function ns(t){const o=t.parent,s=o?.node;if(!s||!t.node){Zt(t,t.parent);return}let n=null;const r=Object.keys(o),c=r.indexOf(t.key);for(let a=c+1;a<r.length;a++){const i=o[r[a]];if(i?.node?.parentNode===s){n=i.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node),(0,Qt.flushConnected)()}function rs(t){cs(t),_r(t),ks(t),Tr(t),Er(t)}function es(t,o,s){let n=L(t,t.ifDeps,s);const r=(0,j.createEffect)(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const e=t.context?.components||{};c.names.some(f=>e[f]||e["smbls."+f])&&(o.__ifLateMerge=null,kn(t,c),n=L(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(e){if(a=!1,o.__ifError=e,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,e?.message||e)}return}const i=o.__if;if(o.__if=!!a,i&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(e){console.error("[smbls] onRemove error:",e)}}else if(!i&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),ns(t),cs(t),ks(t),U("Render",t,{}),ro(t,{});else{o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,ot.detectTag)(t)),U("Init",t,{});const e=H.FEATURES.hydration;if(t.node||(t.node=e!==null&&e.adopt(t)||(0,ot.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.parent?.__ref?.__ifParked&&t.parent.__ref.__ifParked.delete(t.key),t.tag==="fragment"&&!o.__fragmentAnchor){const l=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(l),o.__fragmentAnchor=l}U("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),$s(t,{}),ss(t,{skipIfEffect:!0}),rs(t),Bs(t,{}),ns(t),U("Create",t,{}),U("Complete",t,{}),U("Render",t,{}),U("RenderRouter",t,{}),ro(t,{})}},{depth:o.path.length,label:P(o,"if")});o.__effects.push(r)}function Dt(t,o){const s=t.node;if(!s)return;const n=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const r=t.__ref;let c=r?r.__textNode:null;if(c&&c.parentNode!==s&&(c=null),!c){const a=s.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):s.firstChild?(c=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(c,s.firstChild)):(s.textContent=n,c=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=c||null)}function Gn(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function Wn(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function Lt(t,o,s,n){s==null||s===!1&&!(0,v.isEnumeratedTrueFalseAttr)(o)?zt(t,o,null):typeof s=="function"||typeof s=="object"||(n&&o==="src"&&"src"in t?t.src=s:zt(t,o,(0,v.serializeAttrValue)(o,s)))}function zt(t,o,s){const n=Gn(t,o);s==null?t.removeAttribute(o):t.setAttribute(o,s),Wn(t,n)}function is(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const r=typeof document<"u"&&document.activeElement===s,c=r&&typeof s.selectionStart=="number"?s.selectionStart:null,a=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,r&&c!=null&&a!=null)try{s.setSelectionRange(c,a)}catch{}const i=t.__ref&&t.__ref.__autoGrow;i&&i.active&&i.resize()}function cs(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Dt(t,t.text),Os(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}rt(o,Nt(t,s))}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const n=t.attr[s];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!(0,v.isEnumeratedTrueFalseAttr)(s)||o.setAttribute&&o.setAttribute(s,(0,v.serializeAttrValue)(s,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const s in t.data){const n=t.data[s];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||o.dataset&&(o.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&&o.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&&o.classList.add(typeof r=="string"?r:n)}}}}function gt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function zn(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function jt(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const r in o){if(o[r]==null||r.charAt(0)==="&")continue;const a=J(r);n.push(a,po(s,a),fs(s,a))}return n}function po(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function fs(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function J(t){return(0,B.cssPropName)(t)}function ho(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,r=new Set;if(s&&typeof s=="object")for(const c in s)s[c]==null||c.charAt(0)==="&"||r.add(J(c));for(let c=0;c<o.length;c+=3){const a=o[c];r.has(a)||po(n,a)===o[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Pt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(po(s,o[n])!==o[n+1]||fs(s,o[n])!==o[n+2])return!1;return!0}const Et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,as=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",qt=t=>Et(t)?t:"--"+t;function Yt(t,o){if(!et(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let r=t[n];if(typeof r=="function"){if(!o)continue;r=r(o,o.state,o.context)}as(r)&&(s||(s={}),s[qt(n)]=r)}return s}function us(t,o,s,n,r){ds(t,r,L(t,n,s),c=>as(c)?{[o]:c}:null)}function ds(t,o,s,n,r){const c=t.__ref;let a,i=null;const e=(0,j.createEffect)(()=>{(0,q.withDesignSystem)(t,()=>{try{const f=n(s(t,t.state,t.context)),l=t.node;if(!l||!l.style)return;const u=gt(f);(u===null||u!==a||!Pt(l,i))&&(a=u,ho(l,i,f),f&&rt(l,f),i=f?jt(l,f):null,r&&r(f))}catch(f){V(c,o,f)}})},{depth:c.path.length,label:P(c,o)});c.__effects.push(e)}function qn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){Yn(t,s),o.__exec.vars=s;return}if(et(s))for(const n of Object.keys(s)){const r=s[n];!n||typeof r!="function"||us(t,qt(n),r,_t(t.varsDeps,n),"vars."+n)}}function Yn(t,o){const s=t.__ref;ds(t,"vars",L(t,t.varsDeps,o),n=>Yt(n),n=>{s.__varsInline=n?new Set(Object.keys(n)):null})}function yo(t,o){if(typeof t[o]=="function"&&((0,Q.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Et(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!et(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&qt(n)===o)return!0;return!1}function Zn(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(J(s)));return o}function Qn(t,o,s,n){const r=t.__ref;if(!r)return;let c=null;if(s)for(const a of s){if(n&&n.has(a))continue;const i=o[a];if(i==null||typeof i=="object")continue;const e=J(a);B.CSS_LONGHAND_SHORTHANDS[e]&&(c||(c={}),c[e]=i)}r.__declaredLonghands=c}function ls(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let r=null;for(const c in n){if(o.has(c))continue;const a=B.CSS_LONGHAND_SHORTHANDS[c];let i=!1;for(let e=0;e<a.length;e++)if(o.has(a[e])){i=!0;break}i&&(r||(r={}),r[c]=n[c])}return r}function ps(t,o){const s=t.node;rt(s,o);const n=Zn(o);if(!n)return o;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const a of n)r.__inlineCssKeys.add(a);else r.__inlineCssKeys=new Set(n);const c=ls(t,n);return c?(rt(s,c),Object.assign({},o,c)):o}function Xn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=ls(t,o.__inlineCssKeys);s&&rt(t.node,s)}function Nt(t,o){return!o||typeof o!="object"?o:(0,q.withDesignSystem)(t,()=>{try{return(0,C.resolveStyleBlockTokens)(o,t)}catch{return o}})}function rt(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const r=o[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[n]=r;continue}try{const c=String(r);if(typeof r=="object"&&c==="[object Object]")continue;const a=(0,B.cssPropName)(n),i=c.trim(),e=/\s*!important\s*$/.test(i),f=i.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,e?"important":"")}catch{}}}s&&Jn(t,s)}function Jn(t,o){const s=`_ds${No.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 c="";for(const a in o){const i="."+s,e=a.replace(/&/g,i).split(",").map(l=>{const u=l.trim();return u.includes(i)?u:i+u}).join(", "),f=o[a];if(typeof f=="object"){let l="",u="";for(const d in f){const h=f[d];if(typeof h=="object"){const _=d.includes("&")?e.split(", ").map(y=>d.replace(/&/g,y)).join(", "):e.split(", ").map(y=>`${y} ${d}`).join(", ");let p="";for(const y in h)p+=`${J(y)}: ${h[y]};`;u+=(0,tt.wrapHoverRule)(`${_} { ${p} }`,_)+`
5
- `}else l+=`${J(d)}: ${h};`}l&&(c+=(0,tt.wrapHoverRule)(`${e} { ${l} }`,e)+`
6
- `),u&&(c+=u)}}c&&(r.textContent+=c)}const hs=new Set;function ys(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function mn(t,o,s){const n=ys(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=o(t,t.state,t.context)}catch{return}if(ys(r)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";hs.has(c)||(hs.add(c),console.warn(`[smbls] subscribeTo function at "${c}" 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 core.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 tr(t){const o=t.subscribeTo,s=typeof o=="function";let n=o;if(s)try{n=o(t,t.state,t.context)}catch{n=null}if(s&&(0,it.isLoudDevRuntime)()&&mn(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let c=0;c<n.length;c++){const a=n[c];if(typeof a!="string"||a.length===0)continue;const i=a.split("."),e=i[0],f=i.slice(1),l={value:!1},u=(0,j.createEffect)(()=>{const d=t.state&&((0,K.isStore)(t.state)?t.state.root:null);if(!d||!(0,K.isStore)(d))return;let h=d;h=h[e];for(let p=0;p<f.length&&!(h==null||typeof h!="object");p++)if((0,K.isStore)(h))h=h[f[p]];else break;if(!l.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"&&(0,q.withDesignSystem)(t,()=>{try{if(ms(r)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>Ft(r,!1),y=>{Ft(r,!0),(0,Y.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}):(Ft(r,!1),p===!1&&(_=!0))}}catch(p){Ft(r,!0),(0,Y.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}}),!_&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){const y=r.__effects[p];y&&y!==u&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}!_&&typeof t.onUpdate=="function"&&(0,q.withDesignSystem)(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(p){(0,Y.dispatchPluginHook)("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}})},{depth:r.path.length,label:P(r,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,r.__effects.push(u)}}function _o(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function go(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const _s=new Set;function or(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;_s.has(n)||(_s.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.`))}const gs=new Map;function sr(t){let o=gs.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const r of n)o.push((0,B.cssCamelName)(r))};return s(B.CSS_LONGHAND_SHORTHANDS[t]),s(B.CSS_SHORTHAND_LONGHANDS[t]),gs.set(t,o),o}function bs(t,o,s){if(yo(t,o)||s&&s.has(o))return!0;const n=sr(J(o));for(let r=0;r<n.length;r++){const c=n[r];if(yo(t,c)||s&&s.has(c))return!0}return!1}function bt(t,o,s,n){const r={},c=new Set,a=(i,e,f)=>{const l=f?new Set(Object.keys(r)):null;if(C.CSS_PROPS_REGISTRY[i]){const u=C.CSS_PROPS_REGISTRY[i](e,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(r,h)}}else r[i]=e;if(f)for(const u in r)l.has(u)||c.add(u)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let e=t[i];if(typeof e=="function"&&(e=e(o,o.state,o.context)),!(e==null||typeof e=="function")){if(typeof e=="object"&&!Array.isArray(e)){if(i==="style"){for(const u in e){let d=e[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,bs(o,u,n))}continue}if(i==="vars"){const u=Yt(e,o);if(u)for(const d in u)a(d,u[d],yo(o,d)||!!(n&&n.has(d)));continue}if(_o(i,o)){const u=bt(e,o,!1,n);Object.keys(u).length&&(r[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){(0,it.isLoudDevRuntime)()&&or(i,o);continue}const f=go(i,o),l=bt(e,o,!1,n);Object.keys(l).length&&(r[f]=l);continue}a(i,e,bs(o,i,n))}}if(s)for(const i in r)c.add(i);for(const i of c){const e=r[i];typeof e=="string"&&!e.includes("!important")&&(r[i]=e+" !important")}return r}const et=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function As(t,o){for(const s in o){const n=o[s];t[s]=et(n)?As(et(t[s])?t[s]:{},n):n}return t}function nr(t,o){if(!et(o))return;let s;for(const n of t.split(" ")){const r=n?o[n]:null;et(r)&&(s=As(s||{},r))}return s}function bo(t,o){if(o===void 0&&(o=0),o>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)&&bo(t[s],o+1))return!0}return!1}function xs(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(_o(t,s)){const c=bt(o,s,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=go(t,s),r=bt(o,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function rr(t){const o=t.__ref;for(const s of Object.keys(t)){if(!Uo(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!bo(n))continue;let r=null,c;const a=(0,j.createEffect)(()=>{if(!t.node)return;const i=t.context?.designSystem;i&&(0,M.pushConfig)(i);let e,f=!1;try{const l=xs(s,n,t),u=l?gt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,l){const d=(0,tt.css)({[l.cssProp]:l.block},null,t.context?.cssPrefix);e=d?d.split(" ").filter(Boolean):null}else e=null}finally{i&&(0,M.popConfig)()}if(!(f||!t.node.classList)){if(r)for(const l of r)t.node.classList.remove(l);if(e&&e.length)for(const l of e)t.node.classList.add(l);r=e}},{depth:o.path.length,label:P(o,"cssBlock("+s+")")});o.__effects.push(a)}}const er=()=>!0,ir=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!C.CSS_PROPS_REGISTRY[t]||!!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(t))||Et(t)||t==="vars"};function cr(t,o,s){const n={};let r=!1;for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(i!=="data"&&i!=="aria"&&(ir(i,s[i])||G.REGISTRY.has(i))?n[i]=!0:r=!0);if(!r)return null;const c=(0,v.extractConditionalAttrs)({[o]:s},t.tag||"div",n,er);let a=null;for(const i in c)/^on/i.test(i)||(a||(a={}),a[i]=c[i]);return a}function ws(t,o,s,n,r,c){const a=t.node;let i=null;const e=f=>{(i||(i=[])).push(f)};for(const f in n){const l=o.owners.get(f),u=l===s;if(!c&&l!==void 0&&!u)continue;let d;try{d=n[f](t)}catch(_){V(t.__ref,"conditional("+s+")."+f,_),u&&e(f);continue}if(typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){e(f);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&Ss(a,o,f);continue}const h=d===!1&&!(0,v.isEnumeratedTrueFalseAttr)(f)?null:String((0,v.serializeAttrValue)(f,d));e(f),!(u&&h===o.written.get(f))&&(l===void 0&&o.base.set(f,a.getAttribute(f)),zt(a,f,h),o.owners.set(f,s),o.written.set(f,h))}r.appliedAttrs=i}function Ss(t,o,s){t.getAttribute(s)===o.written.get(s)&&zt(t,s,o.base.get(s)),o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function fr(t,o,s,n){const r=n.appliedAttrs;if(n.appliedAttrs=null,!!r)for(const c of r)o.owners.get(c)===s&&Ss(t.node,o,c)}function ks(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const n of o.owners.keys()){const r=o.written.get(n),c=s.getAttribute(n);c!==r&&(o.base.set(n,c),r==null?s.removeAttribute(n):s.setAttribute(n,r))}}let Ao;const ar=()=>Ao===void 0?Ao=(0,it.isLoudDevRuntime)():Ao;function Cs(t,o){const s=dn.countUntrackedReads;typeof s=="function"?t.untrackedReads+=s(o):o()}function ur(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const r of Object.keys(t)){const c=r.charAt(0);if(c!=="."&&c!=="!")continue;const a=r.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const y=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${y}: { '${a.slice(y.length)}': {...} }\`.`)}continue}const i=t[r];if(!i||typeof i!="object")continue;const e=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null,probe:!1,untrackedReads:0},l=cr(t,r,i);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;const A=y.charAt(0),S=i[y];if(!((A===":"||A==="@"||A==="&"||A==="[")&&S&&typeof S=="object"&&!Array.isArray(S))){if(y==="vars"&&et(S)){for(const w of Object.keys(S))w&&u.add(qt(w));continue}u.add(y)}}const d=()=>{let y;const A=f.probe;let S;if(A?Cs(f,()=>{S=t[a]}):S=t[a],S===void 0){const g=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(g||x!==void 0)y=x;else{const k=t.context?.cases?.[a];if(k===void 0)return;try{y=typeof k=="function"?k.call(t,t):k}catch(E){y=!1,o.__conditionalError=E,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,E?.message||E)}}}else if(typeof S=="function")try{A?Cs(f,()=>{y=S(t,t.state,t.context)}):y=S(t,t.state,t.context)}catch(g){y=!1,o.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}else y=S;A&&(f.probe=!1);const w=e?!y:!!y;if(!t.node)return;const b=t.context?.designSystem;if(w===f.lastMatch){if(w&&l&&t.node.setAttribute){b&&(0,M.pushConfig)(b);try{ws(t,s,r,l,f,!1)}finally{b&&(0,M.popConfig)()}}return}f.lastMatch=w,b&&(0,M.pushConfig)(b);try{if(w){const g={},x={};let k=!1;for(const O in i){if(!Object.prototype.hasOwnProperty.call(i,O))continue;const T=i[O],F=O.charAt(0);if((F===":"||F==="@"||F==="&"||F==="[")&&T&&typeof T=="object"&&!Array.isArray(T)){if(_o(O,t)){const z=bt(T,t,!1,u);Object.keys(z).length&&(x[`[data-theme="${O.slice(1)}"] &`]=z,k=!0)}else{const z=go(O,t),lt=bt(T,t,!1,u);Object.keys(lt).length&&(x[z]=lt,k=!0)}continue}const st=typeof T=="function"?T(t,t.state,t.context):T;if(st!=null){if(C.CSS_PROPS_REGISTRY[O]){const z=C.CSS_PROPS_REGISTRY[O](st,t,t.state,t.context);if(z){const lt=Array.isArray(z)?z:[z];for(const It of lt)It&&Object.assign(g,It)}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(O))g[O]=st;else if(Et(O))g[O]=st;else if(O==="vars"){const z=Yt(st,t);z&&Object.assign(g,z)}}}const E=Object.keys(g);if(E.length){rt(t.node,g);for(const O of E)n.set(O,r);f.appliedKeys=E}else f.appliedKeys=null;if(k){const O=(0,tt.css)(x,null,t.context?.cssPrefix,{state:!0}),T=O?O.split(" ").filter(Boolean):[];if(T.length&&t.node.classList){for(const F of T)t.node.classList.add(F);f.appliedClasses=T}else f.appliedClasses=null}else if(f.appliedClasses){for(const O of f.appliedClasses)t.node.classList.remove(O);f.appliedClasses=null}l&&t.node.setAttribute&&ws(t,s,r,l,f,!0)}else{if(f.appliedAttrs&&fr(t,s,r,f),f.appliedKeys){for(const g of f.appliedKeys)n.get(g)===r&&(Et(g)?t.node.style.removeProperty(g):t.node.style[g]="",n.delete(g));f.appliedKeys=null}if(f.appliedClasses){for(const g of f.appliedClasses)t.node.classList.remove(g);f.appliedClasses=null}}}finally{b&&(0,M.popConfig)()}};o.__conditionalRunners.push(d);const h=t[a+"Deps"],_=L(t,h,d);ar()&&typeof(o.__exec&&o.__exec[a]||t[a])=="function"&&!(Array.isArray(h)&&h.length===0)&&(f.probe=!0);const p=(0,j.createEffect)(_,{depth:o.path.length,label:P(o,"conditional("+r+")")});f.probe&&(f.probe=!1),f.untrackedReads>0&&p._sources.size===0&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate read state on its first run without subscribing to it (\`in\`, Object.keys, a \`__\` key, parse()), so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). Declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally, or \`${a}Deps: []\` when it is static on purpose.`),o.__effects.push(p)}}const xo=new WeakSet,wo=new WeakMap;function dr(t){const o=wo.get(t);if(o==="painted")return!1;if(o===void 0){wo.set(t,"open");const s=t.defaultView,n=()=>{wo.set(t,"painted")};s&&typeof s.requestAnimationFrame=="function"?s.requestAnimationFrame(n):setTimeout(n,0)}return!0}function lr(t){const o=t.ownerDocument;!o||xo.has(o)||dr(o)||(xo.add(o),queueMicrotask(()=>{xo.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const So=new WeakSet;let vs=!1;function js(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function ko(t,o){const s={...t};for(const n in o){const r=o[n],c=s[n];s[n]=r&&typeof r=="object"&&c&&typeof c=="object"?ko(c,r):r}return s}function Ps(t,o){const s={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const c=Ps(r,o);Object.keys(c).length&&(s[n]=c)}else o(n)||(s[n]=r)}return s}function Es(t,o,s){const n=Co(t);if(!n)return!1;for(let r=0;r<n.length;r+=3){const c=n[r+1];if(!s.has(c))continue;const a=o[c];if(!(a==null||typeof a=="object")&&(0,B.cssShorthandStatesThemeLonghand)(n[r],a,n[r+2]))return!0}return!1}function pr(t,o,s){let n=1/0,r=-1/0;for(const a of o.values())a<n&&(n=a),a>r&&(r=a);if(s)for(const a of s.values())a>r&&(r=a);if(r<=n)return null;let c=null;for(const[a,i]of o){if(i===r)continue;const e=Co(a);if(e)for(let f=0;f<e.length;f+=3){const l=e[f],u=e[f+1],d=e[f+2],h=t[u]!=null?o.get(u):void 0,_=s&&s.get(l),p=h!==void 0&&h>i&&(0,B.cssShorthandStatesLonghand)(l,t[u],d),y=!p&&_!==void 0&&_>i&&(0,B.cssShorthandStatesLonghand)(l,void 0,d);if(p||y){p&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const Ts=new Map;function Co(t){let o=Ts.get(t);if(o!==void 0)return o;const s=J(t),n=B.CSS_LONGHAND_SHORTHANDS[s];if(o=null,Array.isArray(n)){o=[];for(const r of n)o.push(r,(0,B.cssCamelName)(r),s)}return Ts.set(t,o),o}function Os(t){const{node:o}=t;if(!o)return;if(vs||(vs=!0,(0,tt.css)({display:"none"})),So.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}So.add(t);const s=t.context?.designSystem;s&&(0,M.pushConfig)(s),(0,C.pushStaticCssPass)();try{const n={};let r=!1,c=[],a=null,i=null,e=null,f=null;const l=t.__ref&&t.__ref.__mergeLayer;let u,d=null,h=null;const _=(b,g)=>{if(g&&typeof g=="object"&&js(b)){e||(e={});const x=e[b];x&&(g=ko(x,g)),e[b]=g}else(g===null||typeof g!="object")&&(f||(f=new Set),f.add(b),u!==void 0&&(d||(d=new Map),d.set(b,u)));n[b]=g};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&C.CSS_PROPS_REGISTRY.theme){const b=C.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(b){const g=x=>{for(const k in x){const E=x[k];E&&typeof E=="object"?js(k)&&(a||(a={}),a[k]=E):Co(k)&&(i||(i=[])).push(k),n[k]=E}};if(Array.isArray(b))for(const x of b)x&&g(x);else g(b);r=!0}}const p=(b,g)=>{if(b==="vars"){const x=Yt(g);if(x){for(const k in x)_(k,x[k]);r=!0}return}if(C.CSS_PROPS_REGISTRY[b]){const x=C.CSS_PROPS_REGISTRY[b](g,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const k of x)if(k)for(const E in k)_(E,k[E])}else for(const k in x)_(k,x[k]);r=!0}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(b))g!=null&&typeof g!="object"&&(_(b,g),r=!0);else if(b.charCodeAt(0)===45)g!=null&&typeof g!="object"&&(_(b,g),r=!0);else if((b.charAt(0)==="&"||b.charAt(0)==="@"||b.charAt(0)===":"||b.charAt(0)==="[")&&g&&typeof g=="object"&&!Array.isArray(g)){if(bo(g))return;const x=xs(b,g,t);x&&(_(x.cssProp,x.block),r=!0)}};if(typeof t.class=="string"){const b=nr(t.class,t.context?.designSystem?.class);if(b)for(const g in b)p(g,b[g])}const y=f?new Set(f):null,A=t.tag||"div";for(const b of Object.keys(t)){if(typeof t[b]=="function"){const x=l&&l.get(b);x!==void 0&&(0,Q.isCssProp)(A,b)&&(h||(h=new Map),h.set(J(b),x));continue}if(u=l?l.get(b):void 0,b==="vars"){p(b,t[b]);continue}if(G.REGISTRY.has(b)||b==="theme")continue;const g=b.charCodeAt(0);g>=65&&g<=90||(0,N.isHandlerKey)(b)||(0,Q.isAttributeFirst)(A,b)||p(b,t[b])}u=void 0;const S=d?pr(n,d,h):null;if(i&&f)for(const b of i)f.has(b)||!(b in n)||Es(b,n,f)&&delete n[b];if(a){const b=f?g=>f.has(g)||Es(g,n,f):null;for(const g in a){let x=b?Ps(a[g],b):a[g];e&&e[g]&&(x=ko(x,e[g])),Object.keys(x).length?n[g]=x:delete n[g]}}if(Qn(t,n,f,S?new Set([...y||[],...S]):y),r){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const b=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof b=="string"&&b!==""&&n.display&&n.display!==b&&(n.display=b);const g=(0,tt.css)(n,null,t.context?.cssPrefix);if(c=g?g.split(" ").filter(Boolean):[],g&&o.classList){const x=c;let k=!1;for(const E of x)o.classList.add(E),k||(E.charCodeAt(0)===95&&E.charCodeAt(1)===99||E.charCodeAt(0)===95&&E.indexOf("_c",1)!==-1)&&(k=!0);k&&lr(o)}}const w=t.__ref;if(w){const b=w.__staticCssClasses;if(b&&o.classList){const g=new Set(c);for(const x of b)g.has(x)||o.classList.remove(x)}w.__staticCssClasses=c}Xn(t)}finally{(0,C.popStaticCssPass)(),s&&(0,M.popConfig)(),So.delete(t)}}const hr=t=>!!C.CSS_PROPS_REGISTRY[t]||!!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function yr(t){t&&t.node&&Os(t)}function _r(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());o.setAttribute(a,(0,v.serializeAttrValue)(a,c))}const s=(0,v.applyAttrTransforms)(t);for(const r in s){const c=s[r];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(r,c===!0?"":c)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.REGISTRY.has(r)||r==="on"||s[r]!==void 0)continue;const c=r.charCodeAt(0);if(!(c>=65&&c<=90)&&!(0,N.isHandlerKey)(r)&&!(0,Q.isCssProp)(n,r)&&(0,v.checkAttributeByTagName)(n,r)){let a=t[r];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!v.ATTR_TRANSFORMS[r])continue;a=R.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,v.isEnumeratedTrueFalseAttr)((0,v.camelToAttr)(r)||r))continue;const i=(0,v.camelToAttr)(r)||r;o.setAttribute(i,(0,v.serializeAttrValue)(i,a))}}}function gr(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||(0,N.isHandlerKey)(o))return;const r=t.tag||"div";if((0,Q.isCssProp)(r,o)||!(0,v.checkAttributeByTagName)(r,o))return;const c=(0,v.camelToAttr)(o)||o,a=c.toLowerCase(),i=t.__ref&&t.__ref.__effects;let e=!1;if(i)for(let u=0;u<i.length;u++){const d=i[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(e=!0,d._execute())}if(e)return;let f=t[o];const l=v.ATTR_TRANSFORMS[o];if(l&&f!=null){const u=l(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=R.replaceLiteralsWithObjectFields.call(t,f,t.state)),Lt(s,c,f)}function br(t,o){const s=t.node,n=t.__ref;let r=n.__autoGrow;if(!o){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}Ds(r),nt.delete(t),s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),Ms(s,r,!1),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Tt(t,!0);return}if(!(s.scrollHeight>0)){r.awaitingLayout=!0,Rs(t,r);return}r.awaitingLayout=!1;const a=wr(s),i=Sr(a),e=s.style.height;s.style.height="0px",i&&jo(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=e,i&&jo(s);return}const l=kr(s,a),u=l!=null&&f<l?l:f,d=jr(a),h=d!=null&&u>d;s.style.height=vr(h?d:u,a)+"px",i&&jo(s),Ms(s,r,h),r.lastMeasure=f,r.lastWidth=s.clientWidth,Rs(t,r)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}Ds(r),nt.delete(t)})),r.active||(s.addEventListener("input",r.resize),r.active=!0,xr(t,r));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==r.appliedMax&&(c==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=c,r.appliedMax=c),r.resize()}function Tt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),nt.add(t),St())}function Ar(){const t=Array.from(nt);nt.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,r=s.__ref?.__autoGrow;if(!(!n||!r||!r.active)){if(!n.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=yt()),r.attachAttempts+=1,r.attachAttempts<=Io&&yt()-r.firstAttemptAt<$o&&(nt.add(s),St());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function Rs(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,r=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const c=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Tt(t,!0);return}const i=s.clientWidth;o.lastWidth!=null&&Math.abs(i-o.lastWidth)<.5||(o.lastWidth=i,Tt(t,!0))};let a;try{a=new r(c),a.observe(s)}catch{return}o.watch=a}function Ds(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function xr(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,n=s&&s.fonts&&s.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{o.active&&t.node&&Tt(t,!0)},()=>{})}function wr(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const ft=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,vo=t=>(ft(t.paddingTop)||0)+(ft(t.paddingBottom)||0),Ls=t=>(ft(t.borderTopWidth)||0)+(ft(t.borderBottomWidth)||0);function Sr(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let n=0;n<o.length;n++){const r=o[n].trim();if(!(r!=="all"&&r!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function jo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const n=o[s];if(n&&n.transitionProperty==="height")try{n.cancel()}catch{}}}function kr(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const n=ft(o.lineHeight)||Cr(t,o);return n>0?s*n+vo(o):null}const Ot=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],Ns=new WeakMap;function Cr(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let r=Ns.get(s);r||(r=new Map,Ns.set(s,r));const c=Ot.map(f=>o[f]||"").join("|");if(r.has(c))return r.get(c);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const i=a.style;i.position="absolute",i.visibility="hidden",i.top="0",i.left="-9999px",i.height="auto",i.minHeight="0",i.maxHeight="none",i.padding="0",i.border="0",i.boxSizing="content-box",i.overflow="hidden";for(let f=0;f<Ot.length;f++)o[Ot[f]]&&(i[Ot[f]]=o[Ot[f]]);let e=0;try{n.appendChild(a),e=a.clientHeight}catch{e=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return e>0?(r.set(c,e),e):null}function vr(t,o){return o?o.boxSizing==="border-box"?t+Ls(o):o.boxSizing==="content-box"?Math.max(0,t-vo(o)):t:t}function jr(t){if(!t)return null;const o=ft(t.maxHeight);if(o==null||!(o>0))return null;const s=vo(t),n=Ls(t),r=t.boxSizing==="border-box"?o-n:o+s,c=ft(t.lineHeight);if(!(c>0))return r;const a=Math.floor((r-s)/c+1e-6);return a>=1?a*c+s:r}function Ms(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const Fs=["srcObject","muted"],Pr=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function Er(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Fs.length;n++){const r=Fs[n],c=t[r];if(c===void 0||!(r in o))continue;const a=i=>{const e=Pr(r,i);if(o[r]!==e)try{o[r]=e}catch(f){V(s,r,f)}};if(typeof c=="function"){const i=L(t,t[r+"Deps"],c),e=(0,j.createEffect)(()=>{try{a(i(t,t.state,t.context))}catch(f){V(s,r,f)}},{depth:s.path.length,label:P(s,r)});s.__effects.push(e),s.__exec[r]=c}else a(c);r==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Tr(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,r=typeof n=="function"?L(t,t.autoGrowDeps,n):null,c=(0,j.createEffect)(()=>{const a=t.autoGrow;let i=a;if(typeof a=="function")try{i=(a===n&&r?r:a)(t,t.state,t.context)}catch{i=null}br(t,i)},{depth:s.path.length,label:P(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(c),r&&(s.__exec.autoGrow=n)}const Is=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function $s(t,o){let s=!1;for(const n of Object.keys(t)){if(!(0,N.isHandlerKey)(n)||Is.has(n))continue;if(n==="onInView"||n==="onLeaveView"){s=!0;continue}const r=(0,N.globalEventKeyInfo)(n);if(r){(0,N.registerGlobalEvent)(r,t,t[n]);continue}let c=t[n],a=null;if(c&&typeof c=="object"&&!Array.isArray(c)&&(a=c,c=a.handler),c=(0,N.stringHandler)(t,c),typeof c!="function")continue;const i=(0,N.eventNameFrom)(n);G.LIFECYCLE_EVENTS.has(i)||(0,N.registerEvent)(gn(i),t,c,a)}Or(t),s&&H.FEATURES.viewEvents&&H.FEATURES.viewEvents(t)}function Or(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const d of Is){const h=t[d];typeof h=="function"&&(s[d]=h,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,i=0,e=0,f=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,i=h.clientY,e=Date.now(),f=!0)},u=d=>{if(!f)return;f=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const _=h.clientX-a,p=h.clientY-i,y=Date.now()-e;if(y>c)return;const A=Math.abs(_),S=Math.abs(p);if(Math.max(A,S)<r)return;let w;if(A>S*1.2)w=_<0?"left":"right";else if(S>A*1.2)w=p<0?"up":"down";else return;const b="onSwipe"+w.charAt(0).toUpperCase()+w.slice(1),g=s[b],x=s.onSwipe;g&&g.call(t,d,t,t.state,t.context),x&&x.call(t,{direction:w,dx:_,dy:p,dt:y,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function Qs(t,o,s,n,r,c,a,i){let e=o;(typeof e=="string"||typeof e=="number")&&(e={text:e});let f=n;if(typeof n=="function")try{f=n(t,e)}catch{f=null}let l=typeof n=="function"?Ct(f):r;if(i&&!a&&(l=vt(l,Ct(o))),a){let u=o;(typeof o=="string"||typeof o=="number")&&(u={value:o,text:o}),e=f?{...f,state:u}:{state:u}}else f&&(e=(0,W.deepMergeChild)(f,e));return e=Rt(e,c),{def:e,key:Ho(e?.key,o,s,t),supplied:l,props:f}}function Rt(t,o){if(!o||!t||t.ignoreChildExtends)return t;if(!t.extends)return{...t,extends:o};const s=Array.isArray(t.extends)?t.extends:[t.extends],n=Array.isArray(o)?o:[o];return{...t,extends:[...n,...s]}}const Jt=t=>{const o=t&&t.__ref;if(!o||o.__if===!1)return null;const s=t.node;return s&&s.nodeType!==11?s:null},Us=(t,o)=>o?o.nextSibling:(0,ot.firstSlotAfterText)(t.node,t.__ref.__textNode),To=(t,o,s)=>{const n=Us(t,s);return o!==n&&t.node.insertBefore(o,n),o},Xs=(t,o)=>{const s=Us(t,o);return s?{position:"before",node:s}:void 0};function Js(t,o,s){let n=null;for(let r=0;r<o.length;r++){if(s&&s.has(o[r]))continue;const c=Jt(t[o[r]]);c&&(n=To(t,c,n))}}function Hs(t,o,s,n){const r=H.FEATURES.rows,c=r!==null&&t.childrenAs!=="state"&&t.tag!=="fragment"?r.track(t):null,a=Po(t,o,s,n,!0,c);return t.__ref.__plainRows=c&&(a||o==null||o===!1)?c:null,a}function Po(t,o,s,n,r,c){if(!o||!t.node)return;const a=t.childExtends,i=ut(t,"childProps"),e=t.__ref,f=H.FEATURES.mount,l=n>0&&t.tag!=="fragment"&&e?n:0;if(Array.isArray(o)){const u=t.childProps,d=t.childrenAs==="state",h=(_,p)=>{const y=Qs(t,o[_],_,u,i,a,d,r);c&&c.add(y.key,o[_],y,u,a);try{const A=m(At(y.def,y.supplied),t,y.key,s,p);return!A&&c&&c.none(y.key),Wt(t,A),A}catch(A){if(c&&c.failed(y.key),typeof console<"u"&&console.error){const S=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y.key}" failed to construct at ${S} (initial render, skipping this row):`,A?.message||A)}return null}};if(!l){for(let _=0;_<o.length&&!(e&&e.__disposed);_++)h(_);return!0}return f.rows(t,o.length,h,l),!0}if(typeof o=="string"){const u=Wo(o,t);if(Array.isArray(u))return Po(t,u,s,n,!0,c)}if(typeof o=="object"){const u=(h,_)=>{if(G.REGISTRY.has(h))return!1;let p=o[h];if(p==null||p===!1)return!1;const y=r?vt(i,Ct(p)):i;(typeof p=="string"||typeof p=="number")&&(p={text:p}),t.childProps&&(p=(0,W.deepMergeChild)(t.childProps,p)),p=Rt(p,a);const A=m(At(p,y),t,Gt(t,h),s,_);return Wt(t,A),A};if(!l){for(const h in o)u(h);return}const d=[];for(const h in o)d.push(h);f.rows(t,d.length,(h,_)=>u(d[h],_),l)}}function Mt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const r=t.__ref,c=r&&r.__exec&&r.__exec.value,a=typeof c=="function",i=t.value!=null&&typeof t.value!="function";if(a||i){let l;if(a)try{l=c(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=R.replaceLiteralsWithObjectFields.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const e=o||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!e)return;let f=-1;for(let l=0;l<n.length;l++)n[l].defaultSelected&&(f=l);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function Bs(t,o){let{children:s,content:n}=t;const r=t.childExtends,c=typeof s=="function",a=c||mo(t,"children");if(typeof s=="function"){const u=s,d=t.__ref;let h=!1,_;const p=L(t,t.childrenDeps,u),y=(0,j.createEffect)(()=>{const A=h;h=!0;let S;try{S=p(t,t.state,t.context)}catch(T){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${F}${A?"":" (initial run, treating as empty)"}:`,T?.message||T)}return}if(!A){_=S;return}if(S===t.children)return;ts(t,S),t.children=S,d.__mount&&d.__mount.chunkGen++;const w=typeof t.onContentUpdate=="function",b=w?[]:null,g=w?[]:null,x=w?[]:null;if(Array.isArray(S)&&t.childrenAs==="state"){const T=t.childProps,F=[],st=new Map;for(let D=0;D<S.length;D++){const X=S[D];let I=T;if(typeof T=="function")try{I=T(t,X)}catch{I=null}const ct=Ho(I&&I.key,X,D,t);F.push(ct),st.set(ct,{rawChild:X,childProps:I})}const z=new Set(F),lt=qo(d,d.__children.slice());for(const D of lt)if(!z.has(D)){const X=t[D];X?.remove&&X.remove(),delete t[D],g&&g.push(D)}const It=t.childExtends,$t=!(t.tag==="fragment")&&!!t.node;let Ut=null;const xt=new Set;for(const D of F){const X=st.get(D),I=X.rawChild,ct=t[D];if(ct&&ct.state){if(I&&typeof I=="object"){const $=ct.state,Ht=$.$replace||$.replace,Ro=$.$update||$.update;try{if(typeof Ht=="function")Ht.call($,I);else if(typeof Ro=="function"){for(const Z in $)if(!(Z==="__element"||Z==="root"||Z==="parent"||Z==="update")&&!Object.prototype.hasOwnProperty.call(I,Z))try{$[Z]=void 0}catch{}Ro.call($,I)}else for(const Z in I)$[Z]=I[Z]}catch(Z){if(typeof console<"u"&&console.error){const sn=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${D}" failed to patch at ${sn} (reconcile, keeping its previous data for this pass):`,Z?.message||Z)}}}if(x&&x.push(D),$t){const $=Jt(ct);$&&(Ut=To(t,$,Ut))}continue}let to=I;(typeof I=="string"||typeof I=="number")&&(to={value:I,text:I});const oo=X.childProps,tn=Rt(oo?{...oo,state:to}:{state:to},It),on=typeof T=="function"?Ct(oo):ut(t,"childProps");let Oo;try{Oo=m(At(tn,on),t,D,o,$t?Xs(t,Ut):void 0)}catch($){if(typeof console<"u"&&console.error){const Ht=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${D}" failed to construct at ${Ht} (reconcile, skipping this row):`,$?.message||$)}xt.add(D);continue}if(d.__disposed)return;if($t){const $=Jt(Oo);$&&(Ut=$)}b&&b.push(D)}$t&&Js(t,F,xt.size?xt:null),d.__children=xt.size?F.filter(D=>!xt.has(D)):F,w&&(b.length||g.length)&&Eo(t,{added:b,removed:g,kept:x}),Mt(t,!1);return}if(t.childrenAs!=="state"&&d.__plainRows&&H.FEATURES.rows.reconcile(t,d,S,o,w)){Mt(t,!1);return}const O=w?[...d.__children]:null;for(const T of qo(d,[...d.__children])){const F=t[T];F?.remove&&F.remove(),delete t[T]}d.__children=[],Hs(t,S,o,0),Mt(t,!1),w&&Eo(t,{added:[...d.__children],removed:O,kept:[]})},{depth:d.path.length,label:P(d,"children")});d.__effects.push(y),s=_,ts(t,s),t.children=s}const i=H.FEATURES.mount,e=i!==null?i.budgetOf(t,o):0,f=(0,dt.mountPendingOf)(t.__ref),l=c?Hs(t,s,o,e):Po(t,s,o,e,a);if(e&&(0,dt.mountPendingOf)(t.__ref)>f){i.defer(t,e,()=>Vs(t,o,s,n,r,l,e));return}Vs(t,o,s,n,r,l,e)}function Vs(t,o,s,n,r,c,a){const i=(0,dt.mountPendingOf)(t.__ref);if(n!=null&&!(n&&n.__ref)){let e=n;typeof e=="string"||typeof e=="number"?e={text:e}:typeof e!="object"&&(e={}),t.childProps&&(e=(0,W.deepMergeChild)(t.childProps,e)),e=Rt(e,r);const f=vt(ut(t,"childProps"),ut(t,"content"));Wt(t,m(At(e,f),t,"content",o))}if(!(s&&!c)){if(a&&(0,dt.mountPendingOf)(t.__ref)>i){H.FEATURES.mount.defer(t,a,()=>Ks(t,o,r,a));return}Ks(t,o,r,a)}}function Ks(t,o,s,n){const r=t.context?.components||{},c=t.__ref&&t.__ref.__runtimeSource,a=c?{}:null;{const f=Object.keys(t);for(let l=0;l<f.length;l++){const u=f[l];if(!u.endsWith("Extends")||typeof t[u]!="string")continue;const d=u.slice(0,-7);if(!d||d.charCodeAt(0)<65||d.charCodeAt(0)>90)continue;const h={extends:t[u]};delete t[u];for(let _=l+1;_<f.length;_++){const p=f[_],y=p.charCodeAt(0);if(y>=65&&y<=90||G.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const A=t[p];A!==void 0&&(h[p]=A,delete t[p],a&&kt(c,p)&&(a[d]||(a[d]={}),a[d][p]=c[p]))}t[d]&&typeof t[d]=="object"?t[d]={...h,...t[d]}:t[d]=h}}const i=Object.keys(t),e=f=>{if(G.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return!1;const l=f.charCodeAt(0);if(l<65||l>90)return!1;let u=t[f];if(u.__ref)return!1;if(!u.extends&&!u.extend){const h=r[f]||r[`smbls.${f}`];h&&(u={...u,extends:h})}t.childProps&&(u=(0,W.deepMergeChild)(t.childProps,u)),u=Rt(u,s);const d=c?vt(ut(t,"childProps"),vt(a[f]||null,ut(t,f))):null;Wt(t,m(At(u,d),t,f,o))};if(!n){for(const f of i)e(f);return}H.FEATURES.mount.run(t,i.length,f=>e(i[f]),n)}function Zt(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const r=o?.tag==="fragment"?o.__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 e=s.node.nextSibling;i.insertBefore(n,e||r)}else i.insertBefore(n,r);(0,Qt.flushConnected)();return}}const c=o?.node||(o?.nodeType?o:null);if(!c)return;if(!s&&H.FEATURES.hydration!==null){const i=t.context&&t.context.__hydration;if(i&&H.FEATURES.hydration.place(i,t,o,c,n))return}const a=s?.node;if(a&&a.parentNode!==c)c.appendChild(n);else if(s?.position==="before"&&a)c.insertBefore(n,a);else if(s?.position==="after"&&s.node){const i=s.node.nextSibling;i?c.insertBefore(n,i):c.appendChild(n)}else c.appendChild(n);(0,Qt.flushConnected)()}const mt=3;function ms(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=mt?!1:(t.__inBeforeUpdate=!0,!0)}function Ft(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===mt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${mt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function U(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);(0,Y.dispatchPluginHook)(n,o,s);const r="on"+t,c=o[r];if(typeof c=="function"){const e=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(e){if(o.__ref[e])return!0;o.__ref[e]=!0}const f=o.context?.designSystem;f&&(0,M.pushConfig)(f);let l=!!e;try{const u=c(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{(0,Y.reportLifecycleError)(o,r,h)}).finally(()=>{e&&d&&(d[e]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if((0,Y.reportLifecycleError)(o,r,u),o.context?.strictMode)throw u}finally{f&&(0,M.popConfig)(),l&&o.__ref&&(o.__ref[e]=!1)}}return!0}var Rr=m;
4
+ `):"")}}function Qn(t,o){if(typeof t.html=="function"&&t.node&&!t.node.innerHTML&&(0,q.withDesignSystem)(t,()=>{try{const n=t.html(t,t.state,t.context);n!=null&&typeof n!="function"&&(t.node.innerHTML=n)}catch{}}),H("Create",t,o),H("Complete",t,o),H("Render",t,o),H("RenderRouter",t,o),ro(t,o),typeof t.onFrame=="function"){const n=t.onFrame,s=t.context?.designSystem,r=()=>{if(t.node){if(t.node.isConnected){s&&(0,M.pushConfig)(s);try{n(t,t.state,t.context)}catch(c){console.error("[DOMQL] onFrame error:",c)}finally{s&&(0,M.popConfig)()}}requestAnimationFrame(r)}};requestAnimationFrame(r)}}function qt(t,o){const n=o&&o.__ref&&o.__ref.__mount;!n||!n.tail||n.holder||(n.holder=t,U.FEATURES.mount.hold(t))}const ks=new Set(["childProps","attr","style","scope","data","vars"]);function Vo(t,o,n,s,r,c){if(n&&!o.extends&&!o.extend){const p=n.indexOf("_"),y=n.indexOf(".");let A=p>0?p:-1;if(y>0&&(A<0||y<A)&&(A=y),A>0){const S=n.substring(0,A),w=t.context?.components;w&&(w[S]||w["smbls."+S])?o={...o,extends:S}:w&&(0,it.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(n)||/^[A-Z]\w*\.\w+$/.test(n))&&console.warn(`[smbls] auto-extend: key "${n}" looks like an instance of "${S}" but neither "${S}" nor "smbls.${S}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),(0,W.applyExtends)(t,o,c);const a=(0,W.openMergeLayer)(t),i=t.props&&typeof t.props=="object"?t.props:null;for(const p in o)if(!(p==="parent"||p==="node"||p==="__ref"||p==="extends"||p==="context"||p==="props")){if(p==="key"){s&&(t.key=r?zt(r,s):s);continue}a&&a.mark(p),eo(t,p,o[p])}if(i)for(const p in i)eo(t,p,i[p]);const e=o.props;if(e&&typeof e=="object"){for(const p in e)eo(t,p,e[p]);if(a)for(const p in e)a.mark(p)}(0,W.closeMergeLayer)(t),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const f=t.scope&&typeof t.scope=="object"?t.scope:null,l=r?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,d=l||u||null;if(o.scope!==void 0||f){const p={};f&&Object.assign(p,f),o.scope!==void 0&&Object.assign(p,o.scope),t.scope=(0,K.createScopeStore)(p,d)}else d&&(t.scope=d);o.if!==void 0&&(t.if=o.if);const h=t.__ref,_=Ks(t,h&&h.__runtimeSource);return h&&(h.__declaredArrays=_||void 0),(0,zn.addMethods)(t),Ps(t,r,o,c),o}function eo(t,o,n){const s=t[o],r=U.FEATURES.chains;if(r!==null&&r(t,o,s,n))return;const c=s&&n&&typeof s=="object"&&typeof n=="object"&&!Array.isArray(s)&&!Array.isArray(n);c&&o.charCodeAt(0)>=65&&o.charCodeAt(0)<=90?t[o]=(0,W.deepMergeChild)(s,n):c&&ks.has(o)?t[o]={...s,...n}:c&&Ho(o)?t[o]=(0,W.deepMergeChild)(s,n):t[o]=n}const Cs=new Set(["key","parent","context","__ref"]);function vs(t,o){for(const s of Object.keys(t))Cs.has(s)||delete t[s];let n=o.definition;if(!n.extends&&!n.extend&&typeof o.key=="string"){const s=t.context?.components||{},r=s[o.key]||s["smbls."+o.key];r&&(n={...n,extends:r})}(0,q.untrack)(()=>Vo(t,n,o.key,o.ownKey,t.parent,o.options))}function js(t,o,n){const s=n||{},r=i=>!!(s[i]||s["smbls."+i]),c=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const i of a){if(typeof i!="string")continue;const e=i.includes(">")?i.split(">")[0].trim():i;r(e)||c.push(e)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let i=-1;const e=o.indexOf("_"),f=o.indexOf(".");e>0&&(i=e),f>0&&(i<0||f<i)&&(i=f);const l=i>0?o.substring(0,i):o;r(l)||c.push(l)}return c}function io(t,o,n){if(typeof t.onStateInit!="function"&&!(0,Y.hasPluginHook)(t,"stateInit"))return;const s=t.state;t.state=o;try{H("StateInit",t,n)}finally{t.state=s}}const co=t=>({isDataOnlyKey:o=>(0,R.polyglotSeededKeys)(t).has(o)});function Ps(t,o,n,s){const r=!o,c=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,a=r&&c&&t.context?.state,i=n.state!==void 0&&!a?n.state:t.state&&!(0,K.isStore)(t.state)?t.state:void 0;if(i==null){if(o?.state)t.state=o.state,(0,at.applyStateMethods)(t,t.state);else if(t.context?.state){const e=t.context.state,f={...e},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=e.lang||l.defaultLang||"en",h=new Set,_=(A,S)=>{h.has(A)||(0,R.isPolyglotWritableKey)(u,A,f)&&(f[A]=S,h.add(A),(0,R.markPolyglotSeeded)(u,A,S))},p=l.translations[d];if(p&&typeof p=="object")for(const A in p)_(A,p[A]);const y=new Set(l.languages||[]);for(const A in l.translations)y.has(A)||_(A,l.translations[A])}(0,K.isStore)(f)||io(t,f,s),t.state=(0,K.isStore)(f)?f:(0,K.createStore)(f,co(t.context)),t.state.__element=t,t.state.root=t.state,(0,at.applyStateMethods)(t,t.state),Gt.promoteActiveRootState?.(e,t.state),H("StateCreated",t,s)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,at.applyStateMethods)(t,t.state);return}if(typeof i=="string"){if(t.state=Wo(i,o),t.state&&typeof t.state=="object"&&!(0,K.isStore)(t.state)){const e=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:e,enumerable:!1,configurable:!0,writable:!0})}(0,at.applyStateMethods)(t,t.state),Ts(t,i,o),H("StateCreated",t,s);return}if(typeof i=="function"){const e=i(t,o?.state);if((0,K.isStore)(e))t.state=e;else{const f=e||{};io(t,f,s),t.state=(0,K.createStore)(f,o?.state?void 0:co(t.context))}}else if((0,K.isStore)(i))t.state=i;else{const e={...i};io(t,e,s),t.state=(0,K.createStore)(e,o?.state?void 0:co(t.context))}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,(0,at.applyStateMethods)(t,t.state),Gt.promoteActiveRootState?.(i,t.state),H("StateCreated",t,s)}function Ko(t,o){if(!o)return t;const n=o.split("/");let s=t;for(const r of n){if(s==null)return{};s=s[r]}return s??{}}function Go(t,o){const n=o.state;return t.startsWith("~/")?[n&&(n.root||n),t.slice(2)]:t.startsWith("../")?[n,t.slice(3)]:[n,t]}function Wo(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[r,c]=Go(t,o);return c?Ko(r,c):r??{}}if(o.state?.[t]!==void 0)return o.state[t];const n=Ko(o.state,t);if(n!=null&&Object.keys(n).length>0)return n;const s=o.context?.polyglot;if(s?.translations){const r=o.state?.root?.lang||s.defaultLang||"en",c=s.translations[r];if(c?.[t]!==void 0)return c[t];if(s.translations[t]!==void 0)return s.translations[t]}return{}}function Es(t,o){const[n,s]=Go(t,o);if(!s||!n||typeof n!="object")return;const r=n[s];if(r!==void 0||s.indexOf("/")===-1)return r;let c=n;for(const a of s.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function Ts(t,o,n){const s=t.__ref;if(!s||!n||o==="."||!(0,K.isStore)(n.state))return;s.__stateBinding&&s.__stateBinding.dispose();const r=(0,q.untrack)(()=>(0,j.createEffect)(()=>{const c=Es(o,n);!c||typeof c!="object"||c===t.state||(0,q.untrack)(()=>zo(t,t.state,c,!0))},{depth:s.path?s.path.length:0,label:P(s,"state")}));r._isStateBinding=!0,s.__stateBinding=r,s.__effects&&s.__effects.push(r)}function zo(t,o,n,s){const r=t.__ref;if(!r)return;if(s||t.state===o){t.state=n,s&&(0,at.applyStateMethods)(t,n),Yo(r);const a=r.__children;if(a)for(let i=0;i<a.length;i++){const e=t[a[i]];e&&e.__ref&&e.parent===t&&zo(e,o,n,!1)}return}if(r.__stateBinding){r.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=n,Yo(r))}function qo(t,o){const n=t.__ifParked;if(!n||!n.size)return o;for(const s of n)o.includes(s)||o.push(s);return o}function Yo(t){const o=t.__effects;if(o)for(let n=0;n<o.length;n++){const s=o[n];s&&!s._disposed&&!s._isStateBinding&&!s._isSubscribeToEffect&&typeof s._notify=="function"&&s._notify()}}const Os=new Set(["s","state","ctx","context"]),fo=new WeakMap;function Rs(t){if(fo.has(t))return fo.get(t);let o=null;try{const n=typeof Gt.getFunctionSource=="function"?Gt.getFunctionSource(t):Function.prototype.toString.call(t);if(typeof n=="string"){const s=n.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||n.match(/^[^(]*\(([^)]*)\)/);s&&(o={params:s[1].split(",").map(r=>r.trim())})}}catch{}return fo.set(t,o),o}function Ds(t){const o=Rs(t);return o?o.params.map(n=>n.split("=")[0].trim()).filter(Boolean):[]}const Ls=3,Ns=/^(is|has)[A-Z0-9_$]/,Ms=new Set(["routerOptions"]),Zo=new WeakSet;function Fs(t,o){if(typeof t!="function"||t.length!==2||o&&(Ns.test(o)||Ms.has(o))||Zo.has(t))return!1;const n=Ds(t);if(n.length<2)return!1;const s=n[1].replace(/[{}[\]]/g,"").trim();return s.length<Ls||Os.has(s)?!1:(Zo.add(t),!0)}function Is(t){const o=t.__ref,n=t.tag||"div",s=t.context?.designSystem,r=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const i=c[a];if(typeof t[i]!="function"||G.REGISTRY.has(i))continue;const e=i.charCodeAt(0);e>=65&&e<=90||(0,N.isHandlerKey)(i)||C.CSS_PROPS_REGISTRY[i]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(i)||e!==45&&((0,v.checkAttributeByTagName)(n,i)||((0,it.isLoudDevRuntime)()&&Fs(t[i],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 a=0;a<r.length;a++){const{prop:i,fn:e}=r[a];o.__exec[i]=e,Object.defineProperty(t,i,{get(){s&&(0,M.pushConfig)(s);try{return e(t,t.state,t.context)}catch{return}finally{s&&(0,M.popConfig)()}},set(f){delete o.__exec[i],Object.defineProperty(t,i,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function $s(t,o){if(!(!Array.isArray(o)||o.length===0))for(let n=0;n<o.length;n++){const s=o[n];try{typeof s=="function"?s(t,t.state,t.context):typeof s=="string"&&t.state?.[s]}catch{}}}function L(t,o,n){return!Array.isArray(o)||o.length===0?n:function(...s){return $s(t,o),n.apply(this,s)}}function _t(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function P(t,o){return()=>t.path.join(".")+"::"+o}const Qo=new Set;function V(t,o,n){if(!(0,it.isLoudDevRuntime)())return;const s=P(t,o)();Qo.has(s)||(Qo.add(s),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,n?.message||n))}const Xo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,Jo=new WeakMap,Hs=t=>{let o=Jo.get(t);if(o!==void 0)return o;o=null;let n;try{n=String(t)}catch{n=""}if(n.includes("{{")){Xo.lastIndex=0;let s;for(;(s=Xo.exec(n))!==null;)s[2].includes("{{")&&(o||(o=[])).push(s[2])}return Jo.set(t,o),o},Us=(t,o)=>{const n=Hs(t);if(n)for(let s=0;s<n.length;s++)o.add(n[s])},Bs=(t,o)=>!(0,N.isHandlerKey)(t)&&!(0,Q.isCssProp)(o,t),ao=(t,o,n,s,r)=>{if(typeof o=="string"){!r&&o.includes("{{")&&n.add(o);return}typeof o=="function"&&Bs(t,s)&&Us(o,n)},uo=new WeakMap,Ct=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),vt=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?(0,W.deepMergeChild)(t,o):t},jt=(t,o)=>t&&o?(0,W.deepMergeChild)(t,o):t||o||null,mo=(t,o)=>{const n=t.__ref&&t.__ref.__runtimeSource;return!!n&&Ct(n,o)},ut=(t,o)=>mo(t,o)?vt(t.__ref.__runtimeSource[o]):null,xt=(t,o)=>(o&&t&&typeof t=="object"&&uo.set(t,o),t),Vs=t=>{if(!t||typeof t!="object")return;const o=uo.get(t);return o&&uo.delete(t),o},lo=(t,o,n)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||n.has(t))){if(n.add(t),Array.isArray(t)){for(let s=0;s<t.length;s++)lo(t[s],o,n);return}if(!t.__ref)for(const s of Object.keys(t)){if(s==="state")continue;const r=Object.getOwnPropertyDescriptor(t,s);r&&"value"in r&&lo(r.value,o,n)}}},Ks=(t,o)=>{let n=null;for(const s of Object.keys(t)){if(G.REGISTRY.has(s)||o&&Ct(o,s))continue;const r=Object.getOwnPropertyDescriptor(t,s),c=r&&r.value;if(!Array.isArray(c))continue;const a=new Set;lo(c,a,new Set),a.size&&(n||(n=new Map),n.set(c,a))}return n},tn=(t,o)=>{if(Array.isArray(o))for(let n=t;n;n=n.parent){const s=n.__ref&&n.__ref.__declaredArrays,r=s&&s.get(o);if(!r)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of r)c.__authoredTemplates.add(a);return}},on=["attr","aria","data","metadata"],Gs=t=>{if(on.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},Ws=(t,o)=>{const n=new Set,s=t.tag||"div";for(const r of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,r),a=c&&c.value,i=!!o&&Ct(o,r);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!Gs(r))continue;const e=i?o[r]:null,f=e&&typeof e=="object"?e:null,l=r.charCodeAt(0)===46||r.charCodeAt(0)===33;for(const u in a){const d=i&&(!f||Ct(f,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&on.includes(u)){for(const _ in h)ao(_,h[_],n,s,d);continue}ao(u,h,n,s,d)}continue}ao(r,a,n,s,i)}return n};function nn(t,o){const n=t.__ref,s=!!(o&&o.skipIfEffect),r=Ws(t,n.__runtimeSource);if(n.__authoredTemplates)for(const e of r)n.__authoredTemplates.add(e);else n.__authoredTemplates=r;if(Is(t),typeof t.text=="function"){const e=t.text,f=L(t,t.textDeps,e),l=(0,j.createEffect)(()=>{if(!n.contentManaged)try{let u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),Lt(t,u))}catch(u){V(n,"text",u)}},{depth:n.path.length,label:P(n,"text")});n.__effects.push(l),n.__exec.text=e}else if(typeof t.text=="string"&&t.text.includes("{{")){const e=t.text,f=(0,j.createEffect)(()=>{if(n.contentManaged)return;const l=R.replaceLiteralsWithObjectFields.call(t,e,t.state);l!=null&&(t.text=l),t.node&&Lt(t,l??"")},{depth:n.path.length,label:P(n,"text")});n.__effects.push(f),n.__exec.text=e}const c=t.tag||"div";for(const e of Object.keys(t))if(typeof t[e]=="function"&&!G.REGISTRY.has(e)&&!(0,N.isHandlerKey)(e)&&!n.__exec[e]&&!(0,Q.isAttributeFirst)(c,e)){if(C.CSS_PROPS_REGISTRY[e]){const f=t[e],l=L(t,t[e+"Deps"],f),u=e;let d,h=null,_=null,p;const y=(0,j.createEffect)(()=>{const A=t.context?.designSystem;A&&(0,M.pushConfig)(A);try{const S=l(t,t.state,t.context);(0,C.pushStaticCssPass)();let w;try{w=C.CSS_PROPS_REGISTRY[u](S,t,t.state,t.context)}finally{(0,C.popStaticCssPass)()}if(Array.isArray(w)){const g={};for(const x of w)if(x)for(const k in x)g[k]=x[k];w=g}const b=u==="show"||u==="hide";if(w&&t.node&&Ys(w)){const g=gt(w);if(g===null||g!==p){p=g;const x=(0,ot.css)(w,null,t.context?.cssPrefix),k=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(_)for(const E of _)t.node.classList.remove(E);if(k&&k.length)for(const E of k)t.node.classList.add(E);_=k}}d=void 0,h=null}else if(w&&t.node){if(_){for(const x of _)t.node.classList.remove(x);_=null,p=void 0}const g=gt(w);if(g===null||g!==d||!Et(t.node,h)){d=g;const x=hn(t,w);h=Pt(t.node,x)}}else t.node&&b&&(d=void 0,h=null,t.node.style.display="")}finally{A&&(0,M.popConfig)()}},{depth:n.path.length,label:P(n,u)});n.__effects.push(y),n.__exec[e]=f}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(e)){const f=t[e],l=L(t,t[e+"Deps"],f),u=e;let d,h=null;const _=(0,j.createEffect)(()=>{const p=t.context?.designSystem;p&&(0,M.pushConfig)(p);try{const y=l(t,t.state,t.context);if(t.node)if(y!=null){const A=u+":"+String(y);if(A!==d||!Et(t.node,h)){d=A;const S={[u]:y},w=hn(t,S);h=Pt(t.node,w)}}else d=void 0,h=null,t.node.style[u]=""}finally{p&&(0,M.popConfig)()}},{depth:n.path.length,label:P(n,u)});n.__effects.push(_),n.__exec[e]=f}else if(e.charCodeAt(0)===45){const f=t[e];dn(t,e,f,t[e+"Deps"],e),n.__exec[e]=f}}if(Zs(t),typeof t.html=="function"){const e=t.html,f=L(t,t.htmlDeps,e),l=(0,j.createEffect)(()=>{(0,q.withDesignSystem)(t,()=>{const u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)})},{depth:n.path.length,label:P(n,"html")});n.__effects.push(l),n.__exec.html=e}if(typeof t.value=="function"){const e=t.value,f=L(t,t.valueDeps,e),l=(0,j.createEffect)(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),cn(t,u)}catch(u){V(n,"value",u)}},{depth:n.path.length,label:P(n,"value")});n.__effects.push(l),n.__exec.value=e}else if(typeof t.value=="string"&&t.value.includes("{{")){const e=t.value,f=(0,j.createEffect)(()=>{try{cn(t,R.replaceLiteralsWithObjectFields.call(t,e,t.state))}catch(l){V(n,"value",l)}},{depth:n.path.length,label:P(n,"value")});n.__effects.push(f),n.__exec.value=e}if(typeof t.style=="function"){const e=t.style,f=L(t,t.styleDeps,e);let l,u=null,d,h,_,p;const y=(0,j.createEffect)(()=>{const A=f(t,t.state,t.context),S=t.context&&t.context.designSystem;let w;if(A&&typeof A=="object"&&A===d&&S===_){const g=gt(A);w=g!==null&&g===h?p:Mt(t,A),h=g}else w=Mt(t,A),h=void 0;d=A,_=S,p=w;const b=gt(w);(b===null||b!==l||!Et(t.node,u))&&(l=b,ho(t.node,u,w),rt(t.node,w),u=Pt(t.node,w))},{depth:n.path.length,label:P(n,"style")});n.__effects.push(y),n.__exec.style=e}else if(t.style&&typeof t.style=="object")for(const e in t.style){const f=t.style[e];if(typeof f!="function")continue;const l=L(t,_t(t.styleDeps,e),f);let u,d=null;const h=(0,j.createEffect)(()=>{try{const _=l(t,t.state,t.context);if(t.node){const p=e+":"+String(_);if(p!==u||!Et(t.node,d)){u=p;const y=Mt(t,{[e]:_});ho(t.node,d,Object.assign({},y,{[e]:""})),rt(t.node,y),d=Pt(t.node,y)}}}catch(_){V(n,"style."+e,_)}},{depth:n.path.length,label:P(n,"style."+e)});n.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const e in t.attr)if(typeof t.attr[e]=="function"){const f=L(t,_t(t.attrDeps,e),t.attr[e]),l=e,u=(0,j.createEffect)(()=>{try{let d=f(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&Nt(t.node,l,d)}catch(d){V(n,"attr."+l,d)}},{depth:n.path.length,label:P(n,"attr."+l)});u._attrName=l.toLowerCase(),n.__effects.push(u)}else if(typeof t.attr[e]=="string"&&t.attr[e].includes("{{")){const f=t.attr[e],l=e,u=(0,j.createEffect)(()=>{try{const d=R.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,(0,v.serializeAttrValue)(l,d??""))}catch(d){V(n,"attr."+l,d)}},{depth:n.path.length,label:P(n,"attr."+l)});u._attrName=l.toLowerCase(),n.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const f=t.aria[e];if(typeof f=="string"&&f.includes("{{")){const h=f,_="aria-"+e.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),p=(0,j.createEffect)(()=>{try{const y=R.replaceLiteralsWithObjectFields.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(_,(0,v.serializeAttrValue)(_,y??""))}catch(y){V(n,"aria."+e,y)}},{depth:n.path.length,label:P(n,"aria."+e)});p._attrName=_,n.__effects.push(p);continue}if(typeof f!="function")continue;const l=L(t,_t(t.ariaDeps,e),t.aria[e]),u="aria-"+e.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=(0,j.createEffect)(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;Nt(t.node,u,h)}catch(h){V(n,"aria."+e,h)}},{depth:n.path.length,label:P(n,"aria."+e)});d._attrName=u,n.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const e in t.data){const f=t.data[e];if(typeof f=="string"&&f.includes("{{")){const _=f,p="data-"+e.replace(/[A-Z]/g,A=>"-"+A.toLowerCase()),y=(0,j.createEffect)(()=>{try{const A=R.replaceLiteralsWithObjectFields.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(p,A??"")}catch(A){V(n,"data."+e,A)}},{depth:n.path.length,label:P(n,"data."+e)});y._attrName=p,n.__effects.push(y);continue}if(typeof f!="function")continue;const l=L(t,_t(t.dataDeps,e),t.data[e]),d="data-"+e.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),h=(0,j.createEffect)(()=>{try{const _=l(t,t.state,t.context);if(!t.node?.setAttribute)return;_==null||_===!1?t.node.removeAttribute(d):typeof _!="function"&&typeof _!="object"&&t.node.setAttribute(d,_===!0?"":_)}catch(_){V(n,"data."+e,_)}},{depth:n.path.length,label:P(n,"data."+e)});h._attrName=d,n.__effects.push(h)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const e in a){if(typeof a[e]!="function")continue;const f=L(t,_t(t.classDeps,e),a[e]),l=(0,j.createEffect)(()=>{try{const u=f(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(e):t.node.classList.remove(e)}catch(u){V(n,"class."+e,u)}},{depth:n.path.length,label:P(n,"class."+e)});n.__effects.push(l)}!s&&typeof t.if=="function"&&en(t,n,t.if);for(const e of Object.keys(t)){if(G.REGISTRY.has(e)||typeof t[e]!="function")continue;const f=e.charCodeAt(0);if(f>=65&&f<=90||(0,N.isHandlerKey)(e))continue;const l=t[e];n.__exec[e]=l;const u=t.tag||"div";if((0,v.checkAttributeByTagName)(u,e)&&!(0,Q.isCssProp)(u,e)){const d=(0,v.camelToAttr)(e)||e,h=L(t,t[e+"Deps"],l),_=(0,j.createEffect)(()=>{try{let p=h(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=R.replaceLiteralsWithObjectFields.call(t,p,t.state)),t.node?.setAttribute&&Nt(t.node,d,p,!0)}catch(p){V(n,e,p)}},{depth:n.path.length,label:P(n,e)});_._attrName=d.toLowerCase(),n.__effects.push(_)}}const i=t.tag||"div";for(const e of Object.keys(t)){if(G.REGISTRY.has(e))continue;const f=t[e];if(typeof f!="string"||!f.includes("{{"))continue;const l=e.charCodeAt(0);if(l>=65&&l<=90||(0,N.isHandlerKey)(e)||(0,Q.isCssProp)(i,e)||v.ATTR_TRANSFORMS[e]||!(0,v.checkAttributeByTagName)(i,e))continue;const u=(0,v.camelToAttr)(e)||e,d=(0,j.createEffect)(()=>{try{const h=R.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,v.serializeAttrValue)(u,h??""))}catch(h){V(n,e,h)}},{depth:n.path.length,label:P(n,e)});d._attrName=u.toLowerCase(),n.__effects.push(d)}if(nr(t),lr(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const e=t.onStateUpdate,f=t.stateDeps;let l=!1,u=[];const d=(0,j.createEffect)(()=>{const h=[];for(let y=0;y<f.length;y++){const A=f[y];try{h[y]=typeof A=="function"?A(t,t.state,t.context):t.state?.[A]}catch{h[y]=void 0}}if(!l){l=!0,u=h;return}let _=h.length!==u.length;for(let y=0;!_&&y<h.length;y++)h[y]!==u[y]&&(_=!0);const p=u;u=h,_&&(0,q.withDesignSystem)(t,()=>{try{e(t,t.state,t.context,{prev:p,next:h})}catch(y){if((0,Y.reportLifecycleError)(t,"onStateUpdate",y),t.context?.strictMode)throw y}})},{depth:n.path.length,label:P(n,"onStateUpdate")});n.__effects.push(d)}ir(t)}function sn(t){const o=t.parent,n=o?.node;if(!n||!t.node){At(t,t.parent);return}let s=null;const r=Object.keys(o),c=r.indexOf(t.key);for(let a=c+1;a<r.length;a++){const i=o[r[a]];if(i?.node?.parentNode===n){s=i.node;break}}s?n.insertBefore(t.node,s):n.appendChild(t.node),(0,Xt.flushConnected)()}function rn(t){fn(t),br(t),Cn(t),Rr(t),Or(t)}function en(t,o,n){let s=L(t,t.ifDeps,n);const r=(0,j.createEffect)(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const e=t.context?.components||{};c.names.some(f=>e[f]||e["smbls."+f])&&(o.__ifLateMerge=null,vs(t,c),s=L(t,t.ifDeps,typeof t.if=="function"?t.if:n))}let a;try{a=s(t,t.state,t.context)}catch(e){if(a=!1,o.__ifError=e,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,e?.message||e)}return}const i=o.__if;if(o.__if=!!a,i&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(e){console.error("[smbls] onRemove error:",e)}}else if(!i&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,X.cacheNode)(t)),t.node&&(t.node.ref=t),sn(t),fn(t),Cn(t),H("Render",t,{}),ro(t,{});else{o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,X.detectTag)(t)),H("Init",t,{});const e=U.FEATURES.hydration;if(t.node||(t.node=e!==null&&e.adopt(t)||(0,X.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.parent?.__ref?.__ifParked&&t.parent.__ref.__ifParked.delete(t.key),t.tag==="fragment"&&!o.__fragmentAnchor){const l=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(l),o.__fragmentAnchor=l}H("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Hn(t,{}),nn(t,{skipIfEffect:!0}),rn(t),Vn(t,{}),sn(t),H("Create",t,{}),H("Complete",t,{}),H("Render",t,{}),H("RenderRouter",t,{}),ro(t,{})}},{depth:o.path.length,label:P(o,"if")});o.__effects.push(r)}function Lt(t,o){const n=t.node;if(!n)return;const s=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){n.nodeValue!==s&&(n.nodeValue=s);return}const r=t.__ref;let c=r?r.__textNode:null;if(c&&c.parentNode!==n&&(c=null),!c){const a=n.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==s&&(c.nodeValue=s):n.firstChild?(c=(n.ownerDocument||t.context?.document||globalThis.document).createTextNode(s),n.insertBefore(c,n.firstChild)):(n.textContent=s,c=n.firstChild&&n.firstChild.nodeType===3?n.firstChild:null),r&&(r.__textNode=c||null)}function zs(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function qs(t,o){if(o===null)return;const n=t.hasAttribute("checked");n!==o&&t.checked!==n&&(t.checked=n)}function Nt(t,o,n,s){n==null||n===!1&&!(0,v.isEnumeratedTrueFalseAttr)(o)?Yt(t,o,null):typeof n=="function"||typeof n=="object"||(s&&o==="src"&&"src"in t?t.src=n:Yt(t,o,(0,v.serializeAttrValue)(o,n)))}function Yt(t,o,n){const s=zs(t,o);n==null?t.removeAttribute(o):t.setAttribute(o,n),qs(t,s)}function cn(t,o){const n=t.node;if(!n||!("value"in n))return;const s=o==null?"":String(o);if(n.value===s)return;const r=typeof document<"u"&&document.activeElement===n,c=r&&typeof n.selectionStart=="number"?n.selectionStart:null,a=r&&typeof n.selectionEnd=="number"?n.selectionEnd:null;if(n.value=s,r&&c!=null&&a!=null)try{n.setSelectionRange(c,a)}catch{}const i=t.__ref&&t.__ref.__autoGrow;i&&i.active&&i.resize()}function fn(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Lt(t,t.text),Rn(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const n=String(t.value);o.value!==n&&(o.value=n)}if(t.style&&typeof t.style=="object"){let n=t.style;for(const s in t.style)if(typeof t.style[s]=="function"){n={};for(const r in t.style)typeof t.style[r]!="function"&&(n[r]=t.style[r]);break}rt(o,Mt(t,n))}if(t.attr&&typeof t.attr=="object")for(const n in t.attr){const s=t.attr[n];typeof s=="function"||typeof s=="object"||s!=null&&(typeof s=="string"&&s.includes("{{")||s===!1&&!(0,v.isEnumeratedTrueFalseAttr)(n)||o.setAttribute&&o.setAttribute(n,(0,v.serializeAttrValue)(n,s)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const n in t.data){const s=t.data[n];typeof s=="function"||typeof s=="object"||s==null||s===!1||typeof s=="string"&&s.includes("{{")||o.dataset&&(o.dataset[n]=s===!0?"":s)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(s=>s&&o.classList.add(s));else if(typeof n=="object")for(const s in n){const r=typeof n[s]=="function"?n[s](t,t.state,t.context):n[s];r&&o.classList.add(typeof r=="string"?r:s)}}}}function gt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Ys(t){if(!t||typeof t!="object")return!1;for(const o in t){const n=t[o];if(n&&typeof n=="object"&&!Array.isArray(n))return!0}return!1}function Pt(t,o){if(!t||!t.style||!o)return null;const n=t.style,s=[];for(const r in o){if(o[r]==null||r.charAt(0)==="&")continue;const a=m(r);s.push(a,po(n,a),an(n,a))}return s}function po(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function an(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function m(t){return(0,B.cssPropName)(t)}function ho(t,o,n){if(!t||!t.style||!o||!o.length)return;const s=t.style,r=new Set;if(n&&typeof n=="object")for(const c in n)n[c]==null||c.charAt(0)==="&"||r.add(m(c));for(let c=0;c<o.length;c+=3){const a=o[c];r.has(a)||po(s,a)===o[c+1]&&typeof s.removeProperty=="function"&&s.removeProperty(a)}}function Et(t,o){if(!o||!t||!t.style)return!1;const n=t.style;for(let s=0;s<o.length;s+=3)if(po(n,o[s])!==o[s+1]||an(n,o[s])!==o[s+2])return!1;return!0}const Tt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,un=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",Zt=t=>Tt(t)?t:"--"+t;function Qt(t,o){if(!et(t))return null;let n=null;for(const s of Object.keys(t)){if(!s)continue;let r=t[s];if(typeof r=="function"){if(!o)continue;r=r(o,o.state,o.context)}un(r)&&(n||(n={}),n[Zt(s)]=r)}return n}function dn(t,o,n,s,r){ln(t,r,L(t,s,n),c=>un(c)?{[o]:c}:null)}function ln(t,o,n,s,r){const c=t.__ref;let a,i=null;const e=(0,j.createEffect)(()=>{(0,q.withDesignSystem)(t,()=>{try{const f=s(n(t,t.state,t.context)),l=t.node;if(!l||!l.style)return;const u=gt(f);(u===null||u!==a||!Et(l,i))&&(a=u,ho(l,i,f),f&&rt(l,f),i=f?Pt(l,f):null,r&&r(f))}catch(f){V(c,o,f)}})},{depth:c.path.length,label:P(c,o)});c.__effects.push(e)}function Zs(t){const o=t.__ref,n=t.vars;if(typeof n=="function"){Qs(t,n),o.__exec.vars=n;return}if(et(n))for(const s of Object.keys(n)){const r=n[s];!s||typeof r!="function"||dn(t,Zt(s),r,_t(t.varsDeps,s),"vars."+s)}}function Qs(t,o){const n=t.__ref;ln(t,"vars",L(t,t.varsDeps,o),s=>Qt(s),s=>{n.__varsInline=s?new Set(Object.keys(s)):null})}function yo(t,o){if(typeof t[o]=="function"&&((0,Q.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Tt(o))return!1;const n=t.vars;if(typeof n=="function"){const s=t.__ref&&t.__ref.__varsInline;return!!(s&&s.has(o))}if(!et(n))return!1;for(const s of Object.keys(n))if(typeof n[s]=="function"&&Zt(s)===o)return!0;return!1}function Xs(t){let o=null;for(const n in t)t[n]!=null&&n.charAt(0)!=="&"&&(o||(o=new Set),o.add(m(n)));return o}function Js(t,o,n,s){const r=t.__ref;if(!r)return;let c=null;if(n)for(const a of n){if(s&&s.has(a))continue;const i=o[a];if(i==null||typeof i=="object")continue;const e=m(a);B.CSS_LONGHAND_SHORTHANDS[e]&&(c||(c={}),c[e]=i)}r.__declaredLonghands=c}function pn(t,o){const n=t.__ref,s=n&&n.__declaredLonghands;if(!s||!o)return null;let r=null;for(const c in s){if(o.has(c))continue;const a=B.CSS_LONGHAND_SHORTHANDS[c];let i=!1;for(let e=0;e<a.length;e++)if(o.has(a[e])){i=!0;break}i&&(r||(r={}),r[c]=s[c])}return r}function hn(t,o){const n=t.node;rt(n,o);const s=Xs(o);if(!s)return o;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const a of s)r.__inlineCssKeys.add(a);else r.__inlineCssKeys=new Set(s);const c=pn(t,s);return c?(rt(n,c),Object.assign({},o,c)):o}function ms(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const n=pn(t,o.__inlineCssKeys);n&&rt(t.node,n)}function Mt(t,o){return!o||typeof o!="object"?o:(0,q.withDesignSystem)(t,()=>{try{return(0,C.resolveStyleBlockTokens)(o,t)}catch{return o}})}function rt(t,o){if(!t||!o||!t.style)return;let n=null;for(const s in o){const r=o[s];if(r!=null){if(s.charAt(0)==="&"&&typeof r=="object"){n||(n={}),n[s]=r;continue}try{const c=String(r);if(typeof r=="object"&&c==="[object Object]")continue;const a=(0,B.cssPropName)(s),i=c.trim(),e=/\s*!important\s*$/.test(i),f=i.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,e?"important":"")}catch{}}}n&&tr(t,n)}function tr(t,o){const n=`_ds${No.scopedStyleId++}`;t.classList.add(n);const s=t.ownerDocument;let r=s.querySelector("style[data-smbls-scoped]");r||(r=s.createElement("style"),r.setAttribute("data-smbls-scoped",""),s.head.appendChild(r));let c="";for(const a in o){const i="."+n,e=a.replace(/&/g,i).split(",").map(l=>{const u=l.trim();return u.includes(i)?u:i+u}).join(", "),f=o[a];if(typeof f=="object"){let l="",u="";for(const d in f){const h=f[d];if(typeof h=="object"){const _=d.includes("&")?e.split(", ").map(y=>d.replace(/&/g,y)).join(", "):e.split(", ").map(y=>`${y} ${d}`).join(", ");let p="";for(const y in h)p+=`${m(y)}: ${h[y]};`;u+=(0,ot.wrapHoverRule)(`${_} { ${p} }`,_)+`
5
+ `}else l+=`${m(d)}: ${h};`}l&&(c+=(0,ot.wrapHoverRule)(`${e} { ${l} }`,e)+`
6
+ `),u&&(c+=u)}}c&&(r.textContent+=c)}const yn=new Set;function _n(t){if(!Array.isArray(t))return"";const o=[];for(let n=0;n<t.length;n++)typeof t[n]=="string"&&t[n].length&&o.push(t[n]);return o.sort(),o.join("|")}function or(t,o,n){const s=_n(n);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=o(t,t.state,t.context)}catch{return}if(_n(r)===s)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";yn.has(c)||(yn.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${n.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 core.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 nr(t){const o=t.subscribeTo,n=typeof o=="function";let s=o;if(n)try{s=o(t,t.state,t.context)}catch{s=null}if(n&&(0,it.isLoudDevRuntime)()&&or(t,o,Array.isArray(s)?s:[]),!Array.isArray(s)||s.length===0)return;const r=t.__ref;for(let c=0;c<s.length;c++){const a=s[c];if(typeof a!="string"||a.length===0)continue;const i=a.split("."),e=i[0],f=i.slice(1),l={value:!1},u=(0,j.createEffect)(()=>{const d=t.state&&((0,K.isStore)(t.state)?t.state.root:null);if(!d||!(0,K.isStore)(d))return;let h=d;h=h[e];for(let p=0;p<f.length&&!(h==null||typeof h!="object");p++)if((0,K.isStore)(h))h=h[f[p]];else break;if(!l.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"&&(0,q.withDesignSystem)(t,()=>{try{if(ts(r)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>$t(r,!1),y=>{$t(r,!0),(0,Y.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}):($t(r,!1),p===!1&&(_=!0))}}catch(p){$t(r,!0),(0,Y.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}}),!_&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){const y=r.__effects[p];y&&y!==u&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}!_&&typeof t.onUpdate=="function"&&(0,q.withDesignSystem)(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(p){(0,Y.dispatchPluginHook)("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}})},{depth:r.path.length,label:P(r,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,r.__effects.push(u)}}function _o(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function go(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const n=o.context?.designSystem?.media?.[t.slice(1)];return n?/^@(media|supports|container)\b/.test(n)?n:`@media ${n}`:t}const gn=new Set;function sr(t,o){const n=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",s=n+"::"+t;gn.has(s)||(gn.add(s),console.warn(`[smbls/css] "${t}" at ${n} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}const bn=new Map;function rr(t){let o=bn.get(t);if(o)return o;o=[];const n=s=>{if(s)for(const r of s)o.push((0,B.cssCamelName)(r))};return n(B.CSS_LONGHAND_SHORTHANDS[t]),n(B.CSS_SHORTHAND_LONGHANDS[t]),bn.set(t,o),o}function An(t,o,n){if(yo(t,o)||n&&n.has(o))return!0;const s=rr(m(o));for(let r=0;r<s.length;r++){const c=s[r];if(yo(t,c)||n&&n.has(c))return!0}return!1}function bt(t,o,n,s){const r={},c=new Set,a=(i,e,f)=>{const l=f?new Set(Object.keys(r)):null;if(C.CSS_PROPS_REGISTRY[i]){const u=C.CSS_PROPS_REGISTRY[i](e,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(r,h)}}else r[i]=e;if(f)for(const u in r)l.has(u)||c.add(u)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let e=t[i];if(typeof e=="function"&&(e=e(o,o.state,o.context)),!(e==null||typeof e=="function")){if(typeof e=="object"&&!Array.isArray(e)){if(i==="style"){for(const u in e){let d=e[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,An(o,u,s))}continue}if(i==="vars"){const u=Qt(e,o);if(u)for(const d in u)a(d,u[d],yo(o,d)||!!(s&&s.has(d)));continue}if(_o(i,o)){const u=bt(e,o,!1,s);Object.keys(u).length&&(r[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){(0,it.isLoudDevRuntime)()&&sr(i,o);continue}const f=go(i,o),l=bt(e,o,!1,s);Object.keys(l).length&&(r[f]=l);continue}a(i,e,An(o,i,s))}}if(n)for(const i in r)c.add(i);for(const i of c){const e=r[i];typeof e=="string"&&!e.includes("!important")&&(r[i]=e+" !important")}return r}const et=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function xn(t,o){for(const n in o){const s=o[n];t[n]=et(s)?xn(et(t[n])?t[n]:{},s):s}return t}function er(t,o){if(!et(o))return;let n;for(const s of t.split(" ")){const r=s?o[s]:null;et(r)&&(n=xn(n||{},r))}return n}function bo(t,o){if(o===void 0&&(o=0),o>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&bo(t[n],o+1))return!0}return!1}function wn(t,o,n){if(!o||typeof o!="object"||Array.isArray(o))return null;if(_o(t,n)){const c=bt(o,n,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const s=go(t,n),r=bt(o,n,!1);return Object.keys(r).length?{cssProp:s,block:r}:null}function ir(t){const o=t.__ref;for(const n of Object.keys(t)){if(!Ho(n))continue;const s=t[n];if(!s||typeof s!="object"||Array.isArray(s)||!bo(s))continue;let r=null,c;const a=(0,j.createEffect)(()=>{if(!t.node)return;const i=t.context?.designSystem;i&&(0,M.pushConfig)(i);let e,f=!1;try{const l=wn(n,s,t),u=l?gt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,l){const d=(0,ot.css)({[l.cssProp]:l.block},null,t.context?.cssPrefix);e=d?d.split(" ").filter(Boolean):null}else e=null}finally{i&&(0,M.popConfig)()}if(!(f||!t.node.classList)){if(r)for(const l of r)t.node.classList.remove(l);if(e&&e.length)for(const l of e)t.node.classList.add(l);r=e}},{depth:o.path.length,label:P(o,"cssBlock("+n+")")});o.__effects.push(a)}}const cr=()=>!0,fr=(t,o)=>{const n=t.charAt(0);return(n===":"||n==="@"||n==="&"||n==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!C.CSS_PROPS_REGISTRY[t]||!!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(t))||Tt(t)||t==="vars"};function ar(t,o,n){const s={};let r=!1;for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(i!=="data"&&i!=="aria"&&(fr(i,n[i])||G.REGISTRY.has(i))?s[i]=!0:r=!0);if(!r)return null;const c=(0,v.extractConditionalAttrs)({[o]:n},t.tag||"div",s,cr);let a=null;for(const i in c)/^on/i.test(i)||(a||(a={}),a[i]=c[i]);return a}function Sn(t,o,n,s,r,c){const a=t.node;let i=null;const e=f=>{(i||(i=[])).push(f)};for(const f in s){const l=o.owners.get(f),u=l===n;if(!c&&l!==void 0&&!u)continue;let d;try{d=s[f](t)}catch(_){V(t.__ref,"conditional("+n+")."+f,_),u&&e(f);continue}if(typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){e(f);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&kn(a,o,f);continue}const h=d===!1&&!(0,v.isEnumeratedTrueFalseAttr)(f)?null:String((0,v.serializeAttrValue)(f,d));e(f),!(u&&h===o.written.get(f))&&(l===void 0&&o.base.set(f,a.getAttribute(f)),Yt(a,f,h),o.owners.set(f,n),o.written.set(f,h))}r.appliedAttrs=i}function kn(t,o,n){t.getAttribute(n)===o.written.get(n)&&Yt(t,n,o.base.get(n)),o.owners.delete(n),o.base.delete(n),o.written.delete(n)}function ur(t,o,n,s){const r=s.appliedAttrs;if(s.appliedAttrs=null,!!r)for(const c of r)o.owners.get(c)===n&&kn(t.node,o,c)}function Cn(t){const o=t.__ref&&t.__ref.__conditionalAttrs,n=t.node;if(!(!o||!o.owners.size||!n||!n.getAttribute))for(const s of o.owners.keys()){const r=o.written.get(s),c=n.getAttribute(s);c!==r&&(o.base.set(s,c),r==null?n.removeAttribute(s):n.setAttribute(s,r))}}let Ao;const dr=()=>Ao===void 0?Ao=(0,it.isLoudDevRuntime)():Ao;function vn(t,o){const n=ds.countUntrackedReads;typeof n=="function"?t.untrackedReads+=n(o):o()}function lr(t){const o=t.__ref;o.__conditionalRunners=[];let n=null;const s=new Map;for(const r of Object.keys(t)){const c=r.charAt(0);if(c!=="."&&c!=="!")continue;const a=r.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const y=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${y}: { '${a.slice(y.length)}': {...} }\`.`)}continue}const i=t[r];if(!i||typeof i!="object")continue;const e=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null,probe:!1,untrackedReads:0},l=ar(t,r,i);l&&!n&&(n=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;const A=y.charAt(0),S=i[y];if(!((A===":"||A==="@"||A==="&"||A==="[")&&S&&typeof S=="object"&&!Array.isArray(S))){if(y==="vars"&&et(S)){for(const w of Object.keys(S))w&&u.add(Zt(w));continue}u.add(y)}}const d=()=>{let y;const A=f.probe;let S;if(A?vn(f,()=>{S=t[a]}):S=t[a],S===void 0){const g=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(g||x!==void 0)y=x;else{const k=t.context?.cases?.[a];if(k===void 0)return;try{y=typeof k=="function"?k.call(t,t):k}catch(E){y=!1,o.__conditionalError=E,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,E?.message||E)}}}else if(typeof S=="function")try{A?vn(f,()=>{y=S(t,t.state,t.context)}):y=S(t,t.state,t.context)}catch(g){y=!1,o.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}else y=S;A&&(f.probe=!1);const w=e?!y:!!y;if(!t.node)return;const b=t.context?.designSystem;if(w===f.lastMatch){if(w&&l&&t.node.setAttribute){b&&(0,M.pushConfig)(b);try{Sn(t,n,r,l,f,!1)}finally{b&&(0,M.popConfig)()}}return}f.lastMatch=w,b&&(0,M.pushConfig)(b);try{if(w){const g={},x={};let k=!1;for(const O in i){if(!Object.prototype.hasOwnProperty.call(i,O))continue;const T=i[O],F=O.charAt(0);if((F===":"||F==="@"||F==="&"||F==="[")&&T&&typeof T=="object"&&!Array.isArray(T)){if(_o(O,t)){const z=bt(T,t,!1,u);Object.keys(z).length&&(x[`[data-theme="${O.slice(1)}"] &`]=z,k=!0)}else{const z=go(O,t),lt=bt(T,t,!1,u);Object.keys(lt).length&&(x[z]=lt,k=!0)}continue}const nt=typeof T=="function"?T(t,t.state,t.context):T;if(nt!=null){if(C.CSS_PROPS_REGISTRY[O]){const z=C.CSS_PROPS_REGISTRY[O](nt,t,t.state,t.context);if(z){const lt=Array.isArray(z)?z:[z];for(const Ht of lt)Ht&&Object.assign(g,Ht)}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(O))g[O]=nt;else if(Tt(O))g[O]=nt;else if(O==="vars"){const z=Qt(nt,t);z&&Object.assign(g,z)}}}const E=Object.keys(g);if(E.length){rt(t.node,g);for(const O of E)s.set(O,r);f.appliedKeys=E}else f.appliedKeys=null;if(k){const O=(0,ot.css)(x,null,t.context?.cssPrefix,{state:!0}),T=O?O.split(" ").filter(Boolean):[];if(T.length&&t.node.classList){for(const F of T)t.node.classList.add(F);f.appliedClasses=T}else f.appliedClasses=null}else if(f.appliedClasses){for(const O of f.appliedClasses)t.node.classList.remove(O);f.appliedClasses=null}l&&t.node.setAttribute&&Sn(t,n,r,l,f,!0)}else{if(f.appliedAttrs&&ur(t,n,r,f),f.appliedKeys){for(const g of f.appliedKeys)s.get(g)===r&&(Tt(g)?t.node.style.removeProperty(g):t.node.style[g]="",s.delete(g));f.appliedKeys=null}if(f.appliedClasses){for(const g of f.appliedClasses)t.node.classList.remove(g);f.appliedClasses=null}}}finally{b&&(0,M.popConfig)()}};o.__conditionalRunners.push(d);const h=t[a+"Deps"],_=L(t,h,d);dr()&&typeof(o.__exec&&o.__exec[a]||t[a])=="function"&&!(Array.isArray(h)&&h.length===0)&&(f.probe=!0);const p=(0,j.createEffect)(_,{depth:o.path.length,label:P(o,"conditional("+r+")")});f.probe&&(f.probe=!1),f.untrackedReads>0&&p._sources.size===0&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate read state on its first run without subscribing to it (\`in\`, Object.keys, a \`__\` key, parse()), so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). Declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally, or \`${a}Deps: []\` when it is static on purpose.`),o.__effects.push(p)}}const xo=new WeakSet,wo=new WeakMap;function pr(t){const o=wo.get(t);if(o==="painted")return!1;if(o===void 0){wo.set(t,"open");const n=t.defaultView,s=()=>{wo.set(t,"painted")};n&&typeof n.requestAnimationFrame=="function"?n.requestAnimationFrame(s):setTimeout(s,0)}return!0}function hr(t){const o=t.ownerDocument;!o||xo.has(o)||pr(o)||(xo.add(o),queueMicrotask(()=>{xo.delete(o);const n=o.body||o.documentElement;n&&n.offsetWidth}))}const So=new WeakSet;let jn=!1;function Pn(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function ko(t,o){const n={...t};for(const s in o){const r=o[s],c=n[s];n[s]=r&&typeof r=="object"&&c&&typeof c=="object"?ko(c,r):r}return n}function En(t,o){const n={};for(const s in t){const r=t[s];if(r&&typeof r=="object"){const c=En(r,o);Object.keys(c).length&&(n[s]=c)}else o(s)||(n[s]=r)}return n}function Tn(t,o,n){const s=Co(t);if(!s)return!1;for(let r=0;r<s.length;r+=3){const c=s[r+1];if(!n.has(c))continue;const a=o[c];if(!(a==null||typeof a=="object")&&(0,B.cssShorthandStatesThemeLonghand)(s[r],a,s[r+2]))return!0}return!1}function yr(t,o,n){let s=1/0,r=-1/0;for(const a of o.values())a<s&&(s=a),a>r&&(r=a);if(n)for(const a of n.values())a>r&&(r=a);if(r<=s)return null;let c=null;for(const[a,i]of o){if(i===r)continue;const e=Co(a);if(e)for(let f=0;f<e.length;f+=3){const l=e[f],u=e[f+1],d=e[f+2],h=t[u]!=null?o.get(u):void 0,_=n&&n.get(l),p=h!==void 0&&h>i&&(0,B.cssShorthandStatesLonghand)(l,t[u],d),y=!p&&_!==void 0&&_>i&&(0,B.cssShorthandStatesLonghand)(l,void 0,d);if(p||y){p&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const On=new Map;function Co(t){let o=On.get(t);if(o!==void 0)return o;const n=m(t),s=B.CSS_LONGHAND_SHORTHANDS[n];if(o=null,Array.isArray(s)){o=[];for(const r of s)o.push(r,(0,B.cssCamelName)(r),n)}return On.set(t,o),o}function Rn(t){const{node:o}=t;if(!o)return;if(jn||(jn=!0,(0,ot.css)({display:"none"})),So.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}So.add(t);const n=t.context?.designSystem;n&&(0,M.pushConfig)(n),(0,C.pushStaticCssPass)();try{const s={};let r=!1,c=[],a=null,i=null,e=null,f=null;const l=t.__ref&&t.__ref.__mergeLayer;let u,d=null,h=null;const _=(b,g)=>{if(g&&typeof g=="object"&&Pn(b)){e||(e={});const x=e[b];x&&(g=ko(x,g)),e[b]=g}else(g===null||typeof g!="object")&&(f||(f=new Set),f.add(b),u!==void 0&&(d||(d=new Map),d.set(b,u)));s[b]=g};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&C.CSS_PROPS_REGISTRY.theme){const b=C.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(b){const g=x=>{for(const k in x){const E=x[k];E&&typeof E=="object"?Pn(k)&&(a||(a={}),a[k]=E):Co(k)&&(i||(i=[])).push(k),s[k]=E}};if(Array.isArray(b))for(const x of b)x&&g(x);else g(b);r=!0}}const p=(b,g)=>{if(b==="vars"){const x=Qt(g);if(x){for(const k in x)_(k,x[k]);r=!0}return}if(C.CSS_PROPS_REGISTRY[b]){const x=C.CSS_PROPS_REGISTRY[b](g,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const k of x)if(k)for(const E in k)_(E,k[E])}else for(const k in x)_(k,x[k]);r=!0}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(b))g!=null&&typeof g!="object"&&(_(b,g),r=!0);else if(b.charCodeAt(0)===45)g!=null&&typeof g!="object"&&(_(b,g),r=!0);else if((b.charAt(0)==="&"||b.charAt(0)==="@"||b.charAt(0)===":"||b.charAt(0)==="[")&&g&&typeof g=="object"&&!Array.isArray(g)){if(bo(g))return;const x=wn(b,g,t);x&&(_(x.cssProp,x.block),r=!0)}};if(typeof t.class=="string"){const b=er(t.class,t.context?.designSystem?.class);if(b)for(const g in b)p(g,b[g])}const y=f?new Set(f):null,A=t.tag||"div";for(const b of Object.keys(t)){if(typeof t[b]=="function"){const x=l&&l.get(b);x!==void 0&&(0,Q.isCssProp)(A,b)&&(h||(h=new Map),h.set(m(b),x));continue}if(u=l?l.get(b):void 0,b==="vars"){p(b,t[b]);continue}if(G.REGISTRY.has(b)||b==="theme")continue;const g=b.charCodeAt(0);g>=65&&g<=90||(0,N.isHandlerKey)(b)||(0,Q.isAttributeFirst)(A,b)||p(b,t[b])}u=void 0;const S=d?yr(s,d,h):null;if(i&&f)for(const b of i)f.has(b)||!(b in s)||Tn(b,s,f)&&delete s[b];if(a){const b=f?g=>f.has(g)||Tn(g,s,f):null;for(const g in a){let x=b?En(a[g],b):a[g];e&&e[g]&&(x=ko(x,e[g])),Object.keys(x).length?s[g]=x:delete s[g]}}if(Js(t,s,f,S?new Set([...y||[],...S]):y),r){s.display&&String(s.display).includes("!important")&&(o.style.setProperty("display",String(s.display).replace(/\s*!important\s*$/,""),"important"),delete s.display);const b=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof b=="string"&&b!==""&&s.display&&s.display!==b&&(s.display=b);const g=(0,ot.css)(s,null,t.context?.cssPrefix);if(c=g?g.split(" ").filter(Boolean):[],g&&o.classList){const x=c;let k=!1;for(const E of x)o.classList.add(E),k||(E.charCodeAt(0)===95&&E.charCodeAt(1)===99||E.charCodeAt(0)===95&&E.indexOf("_c",1)!==-1)&&(k=!0);k&&hr(o)}}const w=t.__ref;if(w){const b=w.__staticCssClasses;if(b&&o.classList){const g=new Set(c);for(const x of b)g.has(x)||o.classList.remove(x)}w.__staticCssClasses=c}ms(t)}finally{(0,C.popStaticCssPass)(),n&&(0,M.popConfig)(),So.delete(t)}}const _r=t=>!!C.CSS_PROPS_REGISTRY[t]||!!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function gr(t){t&&t.node&&Rn(t)}function br(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());o.setAttribute(a,(0,v.serializeAttrValue)(a,c))}const n=(0,v.applyAttrTransforms)(t);for(const r in n){const c=n[r];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(r,c===!0?"":c)}const s=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.REGISTRY.has(r)||r==="on"||n[r]!==void 0)continue;const c=r.charCodeAt(0);if(!(c>=65&&c<=90)&&!(0,N.isHandlerKey)(r)&&!(0,Q.isCssProp)(s,r)&&(0,v.checkAttributeByTagName)(s,r)){let a=t[r];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!v.ATTR_TRANSFORMS[r])continue;a=R.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,v.isEnumeratedTrueFalseAttr)((0,v.camelToAttr)(r)||r))continue;const i=(0,v.camelToAttr)(r)||r;o.setAttribute(i,(0,v.serializeAttrValue)(i,a))}}}function Ar(t,o){const{node:n}=t;if(!n||!n.setAttribute)return;const s=o.charCodeAt(0);if(s>=65&&s<=90||(0,N.isHandlerKey)(o))return;const r=t.tag||"div";if((0,Q.isCssProp)(r,o)||!(0,v.checkAttributeByTagName)(r,o))return;const c=(0,v.camelToAttr)(o)||o,a=c.toLowerCase(),i=t.__ref&&t.__ref.__effects;let e=!1;if(i)for(let u=0;u<i.length;u++){const d=i[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(e=!0,d._execute())}if(e)return;let f=t[o];const l=v.ATTR_TRANSFORMS[o];if(l&&f!=null){const u=l(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=R.replaceLiteralsWithObjectFields.call(t,f,t.state)),Nt(n,c,f)}function xr(t,o){const n=t.node,s=t.__ref;let r=s.__autoGrow;if(!o){if(r&&r.active){try{n.removeEventListener("input",r.resize)}catch{}Ln(r),st.delete(t),n.style.height="",r.appliedMax!=null&&n.style.maxHeight===r.appliedMax&&(n.style.maxHeight=""),Fn(n,r,!1),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=s.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!n.isConnected){Ot(t,!0);return}if(!(n.scrollHeight>0)){r.awaitingLayout=!0,Dn(t,r);return}r.awaitingLayout=!1;const a=kr(n),i=Cr(a),e=n.style.height;n.style.height="0px",i&&jo(n);const f=n.scrollHeight;if(!(f>0)){n.style.height=e,i&&jo(n);return}const l=vr(n,a),u=l!=null&&f<l?l:f,d=Er(a),h=d!=null&&u>d;n.style.height=Pr(h?d:u,a)+"px",i&&jo(n),Fn(n,r,h),r.lastMeasure=f,r.lastWidth=n.clientWidth,Dn(t,r)}},s.__eventCleanup||(s.__eventCleanup=[]),s.__eventCleanup.push(()=>{try{n.removeEventListener("input",r.resize)}catch{}Ln(r),st.delete(t)})),r.active||(n.addEventListener("input",r.resize),r.active=!0,Sr(t,r));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==r.appliedMax&&(c==null?r.appliedMax!=null&&n.style.maxHeight===r.appliedMax&&(n.style.maxHeight=""):n.style.maxHeight=c,r.appliedMax=c),r.resize()}function Ot(t,o){const n=t.__ref?.__autoGrow;n&&(o&&(n.attachAttempts=0,n.firstAttemptAt=null),st.add(t),kt())}function wr(){const t=Array.from(st);st.clear();for(let o=0;o<t.length;o++){const n=t[o],s=n.node,r=n.__ref?.__autoGrow;if(!(!s||!r||!r.active)){if(!s.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=yt()),r.attachAttempts+=1,r.attachAttempts<=Io&&yt()-r.firstAttemptAt<$o&&(st.add(n),kt());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function Dn(t,o){if(o.watch)return;const n=t.node;if(!n)return;const s=n.ownerDocument&&n.ownerDocument.defaultView,r=s&&s.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const c=()=>{if(!o.active||!n.isConnected||!(n.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Ot(t,!0);return}const i=n.clientWidth;o.lastWidth!=null&&Math.abs(i-o.lastWidth)<.5||(o.lastWidth=i,Ot(t,!0))};let a;try{a=new r(c),a.observe(n)}catch{return}o.watch=a}function Ln(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function Sr(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const n=t.node&&t.node.ownerDocument,s=n&&n.fonts&&n.fonts.ready;!s||typeof s.then!="function"||s.then(()=>{o.active&&t.node&&Ot(t,!0)},()=>{})}function kr(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const ft=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,vo=t=>(ft(t.paddingTop)||0)+(ft(t.paddingBottom)||0),Nn=t=>(ft(t.borderTopWidth)||0)+(ft(t.borderBottomWidth)||0);function Cr(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),n=String(t.transitionDuration||"0s").split(",");for(let s=0;s<o.length;s++){const r=o[s].trim();if(!(r!=="all"&&r!=="height")&&parseFloat(n[s%n.length])>0)return!0}return!1}function jo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let n=0;n<o.length;n++){const s=o[n];if(s&&s.transitionProperty==="height")try{s.cancel()}catch{}}}function vr(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const n=parseInt(t.getAttribute("rows"),10);if(!(n>0))return null;const s=ft(o.lineHeight)||jr(t,o);return s>0?n*s+vo(o):null}const Rt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],Mn=new WeakMap;function jr(t,o){const n=t.ownerDocument,s=n&&(n.body||n.documentElement);if(!s||!n.createElement)return null;let r=Mn.get(n);r||(r=new Map,Mn.set(n,r));const c=Rt.map(f=>o[f]||"").join("|");if(r.has(c))return r.get(c);const a=n.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const i=a.style;i.position="absolute",i.visibility="hidden",i.top="0",i.left="-9999px",i.height="auto",i.minHeight="0",i.maxHeight="none",i.padding="0",i.border="0",i.boxSizing="content-box",i.overflow="hidden";for(let f=0;f<Rt.length;f++)o[Rt[f]]&&(i[Rt[f]]=o[Rt[f]]);let e=0;try{s.appendChild(a),e=a.clientHeight}catch{e=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return e>0?(r.set(c,e),e):null}function Pr(t,o){return o?o.boxSizing==="border-box"?t+Nn(o):o.boxSizing==="content-box"?Math.max(0,t-vo(o)):t:t}function Er(t){if(!t)return null;const o=ft(t.maxHeight);if(o==null||!(o>0))return null;const n=vo(t),s=Nn(t),r=t.boxSizing==="border-box"?o-s:o+n,c=ft(t.lineHeight);if(!(c>0))return r;const a=Math.floor((r-n)/c+1e-6);return a>=1?a*c+n:r}function Fn(t,o,n){n?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const In=["srcObject","muted"],Tr=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function Or(t){const o=t.node,n=t.__ref;if(!(!o||!n))for(let s=0;s<In.length;s++){const r=In[s],c=t[r];if(c===void 0||!(r in o))continue;const a=i=>{const e=Tr(r,i);if(o[r]!==e)try{o[r]=e}catch(f){V(n,r,f)}};if(typeof c=="function"){const i=L(t,t[r+"Deps"],c),e=(0,j.createEffect)(()=>{try{a(i(t,t.state,t.context))}catch(f){V(n,r,f)}},{depth:n.path.length,label:P(n,r)});n.__effects.push(e),n.__exec[r]=c}else a(c);r==="srcObject"&&(n.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Rr(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const n=t.__ref,s=t.autoGrow,r=typeof s=="function"?L(t,t.autoGrowDeps,s):null,c=(0,j.createEffect)(()=>{const a=t.autoGrow;let i=a;if(typeof a=="function")try{i=(a===s&&r?r:a)(t,t.state,t.context)}catch{i=null}xr(t,i)},{depth:n.path.length,label:P(n,"autoGrow")});n.__effects||(n.__effects=[]),n.__effects.push(c),r&&(n.__exec.autoGrow=s)}const $n=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Hn(t,o){let n=!1;for(const s of Object.keys(t)){if(!(0,N.isHandlerKey)(s)||$n.has(s))continue;if(s==="onInView"||s==="onLeaveView"){n=!0;continue}const r=(0,N.globalEventKeyInfo)(s);if(r){(0,N.registerGlobalEvent)(r,t,t[s]);continue}let c=t[s],a=null;if(c&&typeof c=="object"&&!Array.isArray(c)&&(a=c,c=a.handler),c=(0,N.stringHandler)(t,c),typeof c!="function")continue;const i=(0,N.eventNameFrom)(s);G.LIFECYCLE_EVENTS.has(i)||(0,N.registerEvent)(gs(i),t,c,a)}Dr(t),n&&U.FEATURES.viewEvents&&U.FEATURES.viewEvents(t)}function Dr(t){const o=t.node;if(!o||!o.addEventListener)return;const n={};let s=!1;for(const d of $n){const h=t[d];typeof h=="function"&&(n[d]=h,s=!0)}if(!s)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,i=0,e=0,f=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,i=h.clientY,e=Date.now(),f=!0)},u=d=>{if(!f)return;f=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const _=h.clientX-a,p=h.clientY-i,y=Date.now()-e;if(y>c)return;const A=Math.abs(_),S=Math.abs(p);if(Math.max(A,S)<r)return;let w;if(A>S*1.2)w=_<0?"left":"right";else if(S>A*1.2)w=p<0?"up":"down";else return;const b="onSwipe"+w.charAt(0).toUpperCase()+w.slice(1),g=n[b],x=n.onSwipe;g&&g.call(t,d,t,t.state,t.context),x&&x.call(t,{direction:w,dx:_,dy:p,dt:y,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function Xn(t,o,n,s,r,c,a,i){let e=o;(typeof e=="string"||typeof e=="number")&&(e={text:e});let f=s;if(typeof s=="function")try{f=s(t,e)}catch{f=null}let l=typeof s=="function"?vt(f):r;if(i&&!a&&(l=jt(l,vt(o))),a){let u=o;(typeof o=="string"||typeof o=="number")&&(u={value:o,text:o}),e=f?{...f,state:u}:{state:u}}else f&&(e=(0,W.deepMergeChild)(f,e));return e=Dt(e,c),{def:e,key:Uo(e?.key,o,n,t),supplied:l,props:f}}function Dt(t,o){if(!o||!t||t.ignoreChildExtends)return t;if(!t.extends)return{...t,extends:o};const n=Array.isArray(t.extends)?t.extends:[t.extends],s=Array.isArray(o)?o:[o];return{...t,extends:[...s,...n]}}const Ft=t=>{const o=t&&t.__ref;if(!o||o.__if===!1||o.__mount&&o.__mount.held)return null;const n=t.node;return n&&n.nodeType!==11?n:null},Un=(t,o)=>o?o.nextSibling:(0,X.firstSlotAfterText)(t.node,t.__ref.__textNode),To=(t,o,n)=>{const s=Un(t,n);return o!==s&&t.node.insertBefore(o,s),o},Jn=(t,o)=>{const n=Un(t,o);return n?{position:"before",node:n}:void 0};function mn(t,o,n){let s=null;for(let r=0;r<o.length;r++){if(n&&n.has(o[r]))continue;const c=Ft(t[o[r]]);c&&(s=To(t,c,s))}}function Bn(t,o,n,s){const r=U.FEATURES.rows,c=r!==null&&t.childrenAs!=="state"&&t.tag!=="fragment"?r.track(t):null,a=Po(t,o,n,s,!0,c);return t.__ref.__plainRows=c&&(a||o==null||o===!1)?c:null,a}function Po(t,o,n,s,r,c){if(!o||!t.node)return;const a=t.childExtends,i=ut(t,"childProps"),e=t.__ref,f=U.FEATURES.mount,l=s>0&&t.tag!=="fragment"&&e?s:0;if(Array.isArray(o)){const u=t.childProps,d=t.childrenAs==="state",h=(_,p)=>{const y=Xn(t,o[_],_,u,i,a,d,r);c&&c.add(y.key,o[_],y,u,a);try{const A=tt(xt(y.def,y.supplied),t,y.key,n,p);return!A&&c&&c.none(y.key),qt(t,A),A}catch(A){if(c&&c.failed(y.key),typeof console<"u"&&console.error){const S=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y.key}" failed to construct at ${S} (initial render, skipping this row):`,A?.message||A)}return null}};if(!l){for(let _=0;_<o.length&&!(e&&e.__disposed);_++)h(_);return!0}return f.rows(t,o.length,h,l),!0}if(typeof o=="string"){const u=Wo(o,t);if(Array.isArray(u))return Po(t,u,n,s,!0,c)}if(typeof o=="object"){const u=(h,_)=>{if(G.REGISTRY.has(h))return!1;let p=o[h];if(p==null||p===!1)return!1;const y=r?jt(i,vt(p)):i;(typeof p=="string"||typeof p=="number")&&(p={text:p}),t.childProps&&(p=(0,W.deepMergeChild)(t.childProps,p)),p=Dt(p,a);const A=tt(xt(p,y),t,zt(t,h),n,_);return qt(t,A),A};if(!l){for(const h in o)u(h);return}const d=[];for(const h in o)d.push(h);f.rows(t,d.length,(h,_)=>u(d[h],_),l)}}function It(t,o){const n=t.node;if(!n||n.tagName!=="SELECT")return;const s=n.options;if(!s||!s.length)return;const r=t.__ref,c=r&&r.__exec&&r.__exec.value,a=typeof c=="function",i=t.value!=null&&typeof t.value!="function";if(a||i){let l;if(a)try{l=c(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=R.replaceLiteralsWithObjectFields.call(t,l,t.state));const u=l==null?"":String(l);n.value!==u&&(n.value=u);return}const e=o||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!e)return;let f=-1;for(let l=0;l<s.length;l++)s[l].defaultSelected&&(f=l);f>=0&&n.selectedIndex!==f&&(n.selectedIndex=f)}function Vn(t,o){let{children:n,content:s}=t;const r=t.childExtends,c=typeof n=="function",a=c||mo(t,"children");if(typeof n=="function"){const u=n,d=t.__ref;let h=!1,_;const p=L(t,t.childrenDeps,u),y=(0,j.createEffect)(()=>{const A=h;h=!0;let S;try{S=p(t,t.state,t.context)}catch(T){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${F}${A?"":" (initial run, treating as empty)"}:`,T?.message||T)}return}if(!A){_=S;return}if(S===t.children)return;tn(t,S),t.children=S,d.__mount&&d.__mount.chunkGen++;const w=typeof t.onContentUpdate=="function",b=w?[]:null,g=w?[]:null,x=w?[]:null;if(Array.isArray(S)&&t.childrenAs==="state"){const T=t.childProps,F=[],nt=new Map;for(let D=0;D<S.length;D++){const J=S[D];let I=T;if(typeof T=="function")try{I=T(t,J)}catch{I=null}const ct=Uo(I&&I.key,J,D,t);F.push(ct),nt.set(ct,{rawChild:J,childProps:I})}const z=new Set(F),lt=qo(d,d.__children.slice());for(const D of lt)if(!z.has(D)){const J=t[D];J?.remove&&J.remove(),delete t[D],g&&g.push(D)}const Ht=t.childExtends,Ut=!(t.tag==="fragment")&&!!t.node;let Bt=null;const wt=new Set;for(const D of F){const J=nt.get(D),I=J.rawChild,ct=t[D];if(ct&&ct.state){if(I&&typeof I=="object"){const $=ct.state,Vt=$.$replace||$.replace,Ro=$.$update||$.update;try{if(typeof Vt=="function")Vt.call($,I);else if(typeof Ro=="function"){for(const Z in $)if(!(Z==="__element"||Z==="root"||Z==="parent"||Z==="update")&&!Object.prototype.hasOwnProperty.call(I,Z))try{$[Z]=void 0}catch{}Ro.call($,I)}else for(const Z in I)$[Z]=I[Z]}catch(Z){if(typeof console<"u"&&console.error){const ss=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${D}" failed to patch at ${ss} (reconcile, keeping its previous data for this pass):`,Z?.message||Z)}}}if(x&&x.push(D),Ut){const $=Ft(ct);$&&(Bt=To(t,$,Bt))}continue}let to=I;(typeof I=="string"||typeof I=="number")&&(to={value:I,text:I});const oo=J.childProps,os=Dt(oo?{...oo,state:to}:{state:to},Ht),ns=typeof T=="function"?vt(oo):ut(t,"childProps");let Oo;try{Oo=tt(xt(os,ns),t,D,o,Ut?Jn(t,Bt):void 0)}catch($){if(typeof console<"u"&&console.error){const Vt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${D}" failed to construct at ${Vt} (reconcile, skipping this row):`,$?.message||$)}wt.add(D);continue}if(d.__disposed)return;if(Ut){const $=Ft(Oo);$&&(Bt=$)}b&&b.push(D)}Ut&&mn(t,F,wt.size?wt:null),d.__children=wt.size?F.filter(D=>!wt.has(D)):F,w&&(b.length||g.length)&&Eo(t,{added:b,removed:g,kept:x}),It(t,!1);return}if(t.childrenAs!=="state"&&d.__plainRows&&U.FEATURES.rows.reconcile(t,d,S,o,w)){It(t,!1);return}const O=w?[...d.__children]:null;for(const T of qo(d,[...d.__children])){const F=t[T];F?.remove&&F.remove(),delete t[T]}d.__children=[],Bn(t,S,o,0),It(t,!1),w&&Eo(t,{added:[...d.__children],removed:O,kept:[]})},{depth:d.path.length,label:P(d,"children")});d.__effects.push(y),n=_,tn(t,n),t.children=n}const i=U.FEATURES.mount,e=i!==null?i.budgetOf(t,o):0,f=(0,dt.mountPendingOf)(t.__ref),l=c?Bn(t,n,o,e):Po(t,n,o,e,a);if(e&&(0,dt.mountPendingOf)(t.__ref)>f){i.defer(t,e,()=>Kn(t,o,n,s,r,l,e));return}Kn(t,o,n,s,r,l,e)}function Kn(t,o,n,s,r,c,a){const i=(0,dt.mountPendingOf)(t.__ref);if(s!=null&&!(s&&s.__ref)){let e=s;typeof e=="string"||typeof e=="number"?e={text:e}:typeof e!="object"&&(e={}),t.childProps&&(e=(0,W.deepMergeChild)(t.childProps,e)),e=Dt(e,r);const f=jt(ut(t,"childProps"),ut(t,"content"));qt(t,tt(xt(e,f),t,"content",o))}if(!(n&&!c)){if(a&&(0,dt.mountPendingOf)(t.__ref)>i){U.FEATURES.mount.defer(t,a,()=>Gn(t,o,r,a));return}Gn(t,o,r,a)}}function Gn(t,o,n,s){const r=t.context?.components||{},c=t.__ref&&t.__ref.__runtimeSource,a=c?{}:null;{const f=Object.keys(t);for(let l=0;l<f.length;l++){const u=f[l];if(!u.endsWith("Extends")||typeof t[u]!="string")continue;const d=u.slice(0,-7);if(!d||d.charCodeAt(0)<65||d.charCodeAt(0)>90)continue;const h={extends:t[u]};delete t[u];for(let _=l+1;_<f.length;_++){const p=f[_],y=p.charCodeAt(0);if(y>=65&&y<=90||G.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const A=t[p];A!==void 0&&(h[p]=A,delete t[p],a&&Ct(c,p)&&(a[d]||(a[d]={}),a[d][p]=c[p]))}t[d]&&typeof t[d]=="object"?t[d]={...h,...t[d]}:t[d]=h}}const i=Object.keys(t),e=f=>{if(G.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return!1;const l=f.charCodeAt(0);if(l<65||l>90)return!1;let u=t[f];if(u.__ref)return!1;if(!u.extends&&!u.extend){const h=r[f]||r[`smbls.${f}`];h&&(u={...u,extends:h})}t.childProps&&(u=(0,W.deepMergeChild)(t.childProps,u)),u=Dt(u,n);const d=c?jt(ut(t,"childProps"),jt(a[f]||null,ut(t,f))):null;qt(t,tt(xt(u,d),t,f,o))};if(!s){for(const f of i)e(f);return}U.FEATURES.mount.run(t,i.length,f=>e(i[f]),s)}function At(t,o,n){const{node:s}=t;if(!s)return;s.ref=t;const r=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(r){const i=r.parentNode;if(i){if(n?.position==="before"&&n.node)i.insertBefore(s,n.node);else if(n?.position==="after"&&n.node){const e=n.node.nextSibling;i.insertBefore(s,e||r)}else i.insertBefore(s,r);(0,Xt.flushConnected)();return}}const c=o?.node||(o?.nodeType?o:null);if(!c)return;if(!n&&U.FEATURES.hydration!==null){const i=t.context&&t.context.__hydration;if(i&&U.FEATURES.hydration.place(i,t,o,c,s))return}const a=n?.node;if(a&&a.parentNode!==c)c.appendChild(s);else if(n?.position==="before"&&a)c.insertBefore(s,a);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;i?c.insertBefore(s,i):c.appendChild(s)}else c.appendChild(s);(0,Xt.flushConnected)()}const mt=3;function ts(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=mt?!1:(t.__inBeforeUpdate=!0,!0)}function $t(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===mt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${mt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function H(t,o,n){const s=t.charAt(0).toLowerCase()+t.slice(1);(0,Y.dispatchPluginHook)(s,o,n);const r="on"+t,c=o[r];if(typeof c=="function"){const e=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(e){if(o.__ref[e])return!0;o.__ref[e]=!0}const f=o.context?.designSystem;f&&(0,M.pushConfig)(f);let l=!!e;try{const u=c(o,o.state,o.context,n);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{(0,Y.reportLifecycleError)(o,r,h)}).finally(()=>{e&&d&&(d[e]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if((0,Y.reportLifecycleError)(o,r,u),o.context?.strictMode)throw u}finally{f&&(0,M.popConfig)(),l&&o.__ref&&(o.__ref[e]=!1)}}return!0}var Lr=tt;
@@ -1 +1 @@
1
- "use strict";var g=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var I=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},b=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of v(e))!x.call(t,i)&&i!==r&&g(t,i,{get:()=>e[i],enumerable:!(s=y(e,i))||s.enumerable});return t};var E=t=>b(g({},"__esModule",{value:!0}),t);var T={};I(T,{adoptHydrationNode:()=>_,elementPath:()=>h,hydrationFeature:()=>A,placeDuringHydration:()=>m});module.exports=E(T);var a=require("./cache.js");const h=t=>{const e=t.__ref;if(e&&e.__hydrationPath!==void 0)return e.__hydrationPath;const r=t.parent,s=r&&r.__ref?h(r):null,i=s===null?"":s?s+"."+t.key:String(t.key);return e&&(e.__hydrationPath=i),i},N=new Set(["src","srcset"]);function _(t){const e=t?.context?.__hydration;if(!e)return null;const r=t.tag=(0,a.detectTag)(t);if(r==="string"||r==="fragment")return null;const s=h(t),i=e.registry[s===""?"__root":s],n=i!==void 0?e.nodes[i]:null;if(!n||n.nodeType!==1||e.claimed.has(n))return i!==void 0&&e.misses++,null;const d=(0,a.isSvgTag)(r)&&(r==="svg"||t.parent?.node?.namespaceURI===a.SVG_NS),f=(0,a.isSvgTag)(r)&&!d&&r!=="svg"?"div":r,u=d?n.namespaceURI===a.SVG_NS:n.namespaceURI!==a.SVG_NS;if(n.localName!==f||!u)return e.misses++,null;e.claimed.add(n),e.adopted++;const c=e.pending;if(c&&c.delete(n)){const o=n.parentNode,l=o?(e.pendingIn.get(o)||1)-1:0;l>0?e.pendingIn.set(o,l):o&&e.pendingIn.delete(o)}for(const o of Array.from(n.getAttributeNames?n.getAttributeNames():[]))N.has(o)||n.removeAttribute(o);if(c)for(let o=n.firstChild;o;){const l=o.nextSibling;c.has(o)||n.removeChild(o),o=l}else for(;n.firstChild;)n.removeChild(n.firstChild);return n.localName==="img"&&n.complete&&n.naturalWidth>0&&S(n),n}const P=500;function S(t){let e=!1,r=!1;const s=i=>{i.isTrusted&&(r?i.stopImmediatePropagation():e=!0,t.removeEventListener("load",s,!0))};t.addEventListener("load",s,!0),setTimeout(()=>{if(!e){if(!(t.complete&&t.naturalWidth>0)){t.removeEventListener("load",s,!0);return}r=!0,t.dispatchEvent(new Event("load")),setTimeout(()=>t.removeEventListener("load",s,!0),P)}},0)}function m(t,e,r,s,i){const n=t.pendingIn;if(!n||!n.has(s))return!1;if(i.parentNode===s&&t.claimed.has(i))return!0;let d;const f=r&&r.__ref,u=f&&f.__children,c=u?u.lastIndexOf(e.key):-1;for(let o=c-1;o>=0;o--){const l=r[u[o]],p=l&&l.node;if(p&&p!==i&&p.parentNode===s){d=p.nextSibling;break}}return d===void 0&&(d=(0,a.firstSlotAfterText)(s,f&&f.__textNode)),d===i||s.insertBefore(i,d),!0}const A={adopt:_,place:m};
1
+ "use strict";var h=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var E=(t,e)=>{for(var n in e)h(t,n,{get:e[n],enumerable:!0})},N=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of I(e))!b.call(t,s)&&s!==n&&h(t,s,{get:()=>e[s],enumerable:!(i=x(e,s))||i.enumerable});return t};var S=t=>N(h({},"__esModule",{value:!0}),t);var L={};E(L,{adoptHydrationNode:()=>_,adoptsWhole:()=>y,elementPath:()=>g,hydrationFeature:()=>A,placeDuringHydration:()=>m});module.exports=S(L);var d=require("./cache.js");const g=t=>{const e=t.__ref;if(e&&e.__hydrationPath!==void 0)return e.__hydrationPath;const n=t.parent,i=n&&n.__ref?g(n):null,s=i===null?"":i?i+"."+t.key:String(t.key);return e&&(e.__hydrationPath=s),s},T=new Set(["src","srcset"]);function _(t){const e=t?.context?.__hydration;if(!e)return null;const n=t.tag=(0,d.detectTag)(t);if(n==="string"||n==="fragment")return null;const i=g(t),s=e.registry[i===""?"__root":i],r=s!==void 0?e.nodes[s]:null;if(!r||r.nodeType!==1||e.claimed.has(r))return s!==void 0&&e.misses++,null;const l=(0,d.isSvgTag)(n)&&(n==="svg"||t.parent?.node?.namespaceURI===d.SVG_NS),u=(0,d.isSvgTag)(n)&&!l&&n!=="svg"?"div":n,p=l?r.namespaceURI===d.SVG_NS:r.namespaceURI!==d.SVG_NS;if(r.localName!==u||!p)return e.misses++,null;e.claimed.add(r),e.adopted++;const c=e.pending;if(c&&c.delete(r)){const o=r.parentNode,f=o?(e.pendingIn.get(o)||1)-1:0;f>0?e.pendingIn.set(o,f):o&&e.pendingIn.delete(o)}for(const o of Array.from(r.getAttributeNames?r.getAttributeNames():[]))T.has(o)||r.removeAttribute(o);if(c){let o=0,f=0;for(let a=r.firstChild;a;){const v=a.nextSibling;c.has(a)||(a.nodeType===3?o++:a.nodeType!==8&&f++,r.removeChild(a)),a=v}(f||o>(t.text!=null?1:0))&&(e.whole||(e.whole=new Set)).add(t)}else for(;r.firstChild;)r.removeChild(r.firstChild);return r.localName==="img"&&r.complete&&r.naturalWidth>0&&P(r),r}const w=500;function P(t){let e=!1,n=!1;const i=s=>{s.isTrusted&&(n?s.stopImmediatePropagation():e=!0,t.removeEventListener("load",i,!0))};t.addEventListener("load",i,!0),setTimeout(()=>{if(!e){if(!(t.complete&&t.naturalWidth>0)){t.removeEventListener("load",i,!0);return}n=!0,t.dispatchEvent(new Event("load")),setTimeout(()=>t.removeEventListener("load",i,!0),w)}},0)}function m(t,e,n,i,s){const r=t.pendingIn;if(!r||!r.has(i))return!1;if(s.parentNode===i&&t.claimed.has(s))return!0;let l;const u=n&&n.__ref,p=u&&u.__children,c=p?p.lastIndexOf(e.key):-1;for(let o=c-1;o>=0;o--){const f=n[p[o]],a=f&&f.node;if(a&&a!==s&&a.parentNode===i){l=a.nextSibling;break}}return l===void 0&&(l=(0,d.firstSlotAfterText)(i,u&&u.__textNode)),l===s||i.insertBefore(s,l),!0}function y(t,e){const n=t.whole;if(!n)return!1;if(n.has(e))return!0;const i=e.parent;return!i||!n.has(i)?!1:(n.add(e),!0)}const A={adopt:_,place:m,whole:y};
@@ -1 +1 @@
1
- var M=Object.create;var m=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var _=(e,r)=>{for(var E in r)m(e,E,{get:r[E],enumerable:!0})},u=(e,r,E,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of S(r))!I.call(e,l)&&l!==E&&m(e,l,{get:()=>r[l],enumerable:!(s=N(r,l))||s.enumerable});return e};var c=(e,r,E)=>(E=e!=null?M(v(e)):{},u(r||!e||!e.__esModule?m(E,"default",{value:e,enumerable:!0}):E,e)),G=e=>u(m({},"__esModule",{value:!0}),e);var D={};_(D,{DELEGATED_EVENTS:()=>d.DELEGATED_EVENTS,LIFECYCLE_EVENTS:()=>d.LIFECYCLE_EVENTS,MIXINS:()=>d.MIXINS,MOUNT_YIELD_BUDGET_MS:()=>t.MOUNT_YIELD_BUDGET_MS,NON_BUBBLING_EVENTS:()=>d.NON_BUBBLING_EVENTS,REGISTRY:()=>d.REGISTRY,SVG_TAGS:()=>o.SVG_TAGS,addDelegatedEvent:()=>a.addDelegatedEvent,addMethods:()=>i.addMethods,adoptHydrationNode:()=>f.adoptHydrationNode,applyExtends:()=>g.applyExtends,attachElement:()=>n.attachElement,cacheNode:()=>o.cacheNode,create:()=>n.create,createHTMLNode:()=>o.createHTMLNode,default:()=>n.default,detectTag:()=>o.detectTag,dispose:()=>p.dispose,elementPath:()=>f.elementPath,flushMounts:()=>n.flushMounts,globalEventKeyInfo:()=>a.globalEventKeyInfo,holdMountFlush:()=>n.holdMountFlush,inertOutsidePlugin:()=>h.inertOutsidePlugin,isSvgTag:()=>o.isSvgTag,isValidTag:()=>o.isValidTag,mountPending:()=>t.mountPending,mountYieldBudget:()=>t.mountYieldBudget,refreshContextProto:()=>i.refreshContextProto,registerEvent:()=>a.registerEvent,registerGlobalEvent:()=>a.registerGlobalEvent,releaseMount:()=>t.releaseMount,remove:()=>p.remove,removeDelegatedEvent:()=>a.removeDelegatedEvent,update:()=>x.update,whenConnected:()=>T.whenConnected,whenMountIdle:()=>t.whenMountIdle,whenMounted:()=>t.whenMounted,yieldToMain:()=>t.yieldToMain});module.exports=G(D);var n=c(require("./create.js"),1),t=require("./mountScheduler.js"),x=require("./update.js"),p=require("./dispose.js"),T=require("./connected.js"),d=require("./registry.js"),a=require("./delegate.js"),o=require("./cache.js"),f=require("./hydration.js"),g=require("./extends.js"),i=require("./methods.js"),h=require("./inertOutside.js");
1
+ var M=Object.create;var m=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var _=(t,r)=>{for(var E in r)m(t,E,{get:r[E],enumerable:!0})},s=(t,r,E,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of I(r))!v.call(t,l)&&l!==E&&m(t,l,{get:()=>r[l],enumerable:!(i=N(r,l))||i.enumerable});return t};var c=(t,r,E)=>(E=t!=null?M(S(t)):{},s(r||!t||!t.__esModule?m(E,"default",{value:t,enumerable:!0}):E,t)),G=t=>s(m({},"__esModule",{value:!0}),t);var D={};_(D,{DELEGATED_EVENTS:()=>d.DELEGATED_EVENTS,LIFECYCLE_EVENTS:()=>d.LIFECYCLE_EVENTS,MIXINS:()=>d.MIXINS,MOUNT_YIELD_BUDGET_MS:()=>e.MOUNT_YIELD_BUDGET_MS,NON_BUBBLING_EVENTS:()=>d.NON_BUBBLING_EVENTS,REGISTRY:()=>d.REGISTRY,SVG_TAGS:()=>o.SVG_TAGS,addDelegatedEvent:()=>a.addDelegatedEvent,addMethods:()=>u.addMethods,adoptHydrationNode:()=>f.adoptHydrationNode,applyExtends:()=>g.applyExtends,attachElement:()=>n.attachElement,cacheNode:()=>o.cacheNode,create:()=>n.create,createHTMLNode:()=>o.createHTMLNode,default:()=>n.default,detectTag:()=>o.detectTag,dispose:()=>p.dispose,elementPath:()=>f.elementPath,flushMounts:()=>n.flushMounts,globalEventKeyInfo:()=>a.globalEventKeyInfo,holdMountFlush:()=>n.holdMountFlush,inertOutsidePlugin:()=>h.inertOutsidePlugin,isSvgTag:()=>o.isSvgTag,isValidTag:()=>o.isValidTag,mountIdle:()=>e.mountIdle,mountPending:()=>e.mountPending,mountYieldBudget:()=>e.mountYieldBudget,refreshContextProto:()=>u.refreshContextProto,registerEvent:()=>a.registerEvent,registerGlobalEvent:()=>a.registerGlobalEvent,releaseMount:()=>e.releaseMount,remove:()=>p.remove,removeDelegatedEvent:()=>a.removeDelegatedEvent,update:()=>x.update,whenConnected:()=>T.whenConnected,whenMountIdle:()=>e.whenMountIdle,whenMounted:()=>e.whenMounted,yieldToMain:()=>e.yieldToMain});module.exports=G(D);var n=c(require("./create.js"),1),e=require("./mountScheduler.js"),x=require("./update.js"),p=require("./dispose.js"),T=require("./connected.js"),d=require("./registry.js"),a=require("./delegate.js"),o=require("./cache.js"),f=require("./hydration.js"),g=require("./extends.js"),u=require("./methods.js"),h=require("./inertOutside.js");
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of R(t))!x.call(e,o)&&o!==n&&h(e,o,{get:()=>t[o],enumerable:!(r=N(t,o))||r.enumerable});return e};var L=e=>k(h({},"__esModule",{value:!0}),e);var Y={};P(Y,{inertOutsidePlugin:()=>U});module.exports=L(Y);var F=require("@symbo.ls/signal"),M=require("./runContext.js");const a="inertOutside",D=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT","BASE","TITLE"]),q='a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable="false"])',W={attributes:!0,attributeFilter:["inert"]},w=new WeakMap,g=new WeakMap,d=new Set,O=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function f(e){try{return(0,M.untrack)(e)}catch(t){console.error("[smbls] inertOutside:",t)}}function _(e){const t=()=>f(e);typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function B(e){if(!e||!e.defaultView||!("activeElement"in e))return null;let t=w.get(e);if(t)return t;const n=e.defaultView.MutationObserver||globalThis.MutationObserver;return typeof n!="function"?null:(t={doc:e,layers:[],held:new Map,top:null,observer:null},t.observer=new n(r=>f(()=>b(t,r))),w.set(e,t),t)}function S(e,t){const n=e.element.node;return!!n&&n.nodeType===1&&n.isConnected&&n.ownerDocument===t}function V(e){const t=e.activeElement;return t&&t!==e.body&&t!==e.documentElement?t:null}const T=e=>!!(e.closest&&e.closest("[inert]"));function j(e){const t=e.ownerDocument,n=new Set,r=[];for(let o=e;o!==t.body;o=o.parentNode){const c=o.parentNode;if(!c||c.nodeType!==1||c===t.documentElement)break;r.push(c);for(let u=c.firstElementChild;u;u=u.nextElementSibling)u!==o&&!D.has(u.tagName)&&n.add(u)}return{outside:n,parents:r}}function m(e,t){for(let n=0;n<t.length;n++){const{type:r,target:o}=t[n];r==="attributes"&&e.held.has(o)&&e.held.set(o,!o.hasAttribute("inert"))}}function b(e,t){const{doc:n,held:r,observer:o}=e;t&&m(e,t),m(e,o.takeRecords());const c=e.top,u=[];for(const s of e.layers){const y=S(s,n);y&&!s.live&&(u.push(s),s.returnFocus=V(n)),s.live=y}u.length&&(e.layers=e.layers.filter(s=>!u.includes(s)).concat(u));let i=null;for(let s=e.layers.length-1;s>=0&&!i;s--)e.layers[s].live&&(i=e.layers[s]);e.top=i;const{outside:p,parents:v}=i?j(i.element.node):{outside:new Set,parents:[]};for(const[s,y]of r)p.has(s)||(y&&s.removeAttribute("inert"),r.delete(s));for(const s of p)r.has(s)||r.set(s,!1),s.hasAttribute("inert")||(s.setAttribute("inert",""),r.set(s,!0));o.takeRecords(),o.disconnect();for(const s of v)o.observe(s,{childList:!0});for(const s of r.keys())o.observe(s,W);if(e.layers.some(s=>!s.live)?d.add(e):d.delete(e),i===c)return;const l=c&&!(c.declared&&c.live)?c:null;if(i&&u.includes(i))l&&l.returnFocus&&(i.returnFocus=l.returnFocus),_(()=>A(e,i));else if(l){const s=l.returnFocus;_(()=>z(e,l,s))}l&&(l.returnFocus=null)}function A(e,t){const n=t.element.node;if(e.top!==t||!n||!n.isConnected)return;const r=e.doc,o=r.activeElement;if(o&&n.contains(o))return;const c=new Set,u=(i,p)=>{if(c.has(i)||(c.add(i),i.matches(":disabled")))return!1;const v=p&&i.getAttribute("tabindex");return v&&parseInt(v,10)<0?!1:(i.focus(),r.activeElement===i)};for(const i of n.querySelectorAll("[autofocus]"))if(u(i,!1))return;for(const i of n.querySelectorAll(q))if(u(i,!0))return;o&&o!==r.body&&typeof o.blur=="function"&&o.blur()}function z(e,t,n){if(t.declared&&t.live)return;const r=e.doc,o=r.activeElement,c=t.element.node;(!o||o===r.body||c&&c.contains(o)||T(o))&&(n&&n.isConnected&&n.ownerDocument===r&&!T(n)&&(n.focus({preventScroll:!0}),r.activeElement===n)||e.top&&A(e,e.top))}function E(e,t){if(e.declared===t)return;const n=e.manager;if(e.declared=t,e.live=!1,t)n.layers.push(e);else{const r=n.layers.indexOf(e);r!==-1&&n.layers.splice(r,1)}b(n)}function C(e){let t=e[a];if(typeof t=="function")try{t=t(e,e.state,e.context)}catch{t=!1}return!!t}function I(e){let t=g.get(e);if(t)return t;const n=e.__ref,r=e.node;if(!n||!r||r.nodeType!==1)return null;const o=B(r.ownerDocument);if(!o)return null;t={element:e,manager:o,declared:!1,live:!1,returnFocus:null},g.set(e,t);const c=(0,F.createEffect)(()=>{const u=C(e);f(()=>E(t,u))},{depth:n.path.length,label:()=>n.path.join(".")+"::"+a});return n.__effects||(n.__effects=[]),n.__effects.push(c),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>f(()=>E(t,!1))),t}function K(){for(const e of d){if(!e.doc.defaultView){d.delete(e);continue}e.layers.some(t=>!t.live&&S(t,e.doc))&&b(e)}}const U={name:a,create(e){O(e,a)&&f(()=>I(e))},render(){d.size&&f(K)},update(e){O(e,a)&&f(()=>{const t=I(e);t&&E(t,C(e))})}};
1
+ "use strict";var E=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var k=(e,t)=>{for(var n in t)E(e,n,{get:t[n],enumerable:!0})},L=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of x(t))!P.call(e,r)&&r!==n&&E(e,r,{get:()=>t[r],enumerable:!(s=R(t,r))||s.enumerable});return e};var D=e=>L(E({},"__esModule",{value:!0}),e);var G={};k(G,{inertOutsidePlugin:()=>Y});module.exports=D(G);var M=require("@symbo.ls/signal"),N=require("./runContext.js"),b=require("./connected.js");const a="inertOutside",q=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT","BASE","TITLE"]),W='a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable="false"])',B={attributes:!0,attributeFilter:["inert"]},O=new WeakMap,_=new WeakMap,d=new Set,S=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function u(e){try{return(0,N.untrack)(e)}catch(t){console.error("[smbls] inertOutside:",t)}}function T(e){const t=()=>u(e);typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function V(e){if(!e||!e.defaultView||!("activeElement"in e))return null;let t=O.get(e);if(t)return t;const n=e.defaultView.MutationObserver||globalThis.MutationObserver;return typeof n!="function"?null:(t={doc:e,layers:[],held:new Map,top:null,observer:null},t.observer=new n(s=>u(()=>h(t,s))),O.set(e,t),t)}function g(e,t){const n=e.element.node;return!!n&&n.nodeType===1&&n.isConnected&&n.ownerDocument===t}function j(e){const t=e.activeElement;return t&&t!==e.body&&t!==e.documentElement?t:null}const m=e=>!!(e.closest&&e.closest("[inert]"));function z(e){const t=e.ownerDocument,n=new Set,s=[];for(let r=e;r!==t.body;r=r.parentNode){const c=r.parentNode;if(!c||c.nodeType!==1||c===t.documentElement)break;s.push(c);for(let l=c.firstElementChild;l;l=l.nextElementSibling)l!==r&&!q.has(l.tagName)&&n.add(l)}return{outside:n,parents:s}}function C(e,t){for(let n=0;n<t.length;n++){const{type:s,target:r}=t[n];s==="attributes"&&e.held.has(r)&&e.held.set(r,!r.hasAttribute("inert"))}}function h(e,t){const{doc:n,held:s,observer:r}=e;t&&C(e,t),C(e,r.takeRecords());const c=e.top,l=[];for(const o of e.layers){const y=g(o,n);y&&!o.live&&(l.push(o),o.returnFocus=j(n)),o.live=y}l.length&&(e.layers=e.layers.filter(o=>!l.includes(o)).concat(l));let i=null;for(let o=e.layers.length-1;o>=0&&!i;o--)e.layers[o].live&&(i=e.layers[o]);e.top=i;const{outside:p,parents:v}=i?z(i.element.node):{outside:new Set,parents:[]};for(const[o,y]of s)p.has(o)||(y&&o.removeAttribute("inert"),s.delete(o));for(const o of p)s.has(o)||s.set(o,!1),o.hasAttribute("inert")||(o.setAttribute("inert",""),s.set(o,!0));r.takeRecords(),r.disconnect();for(const o of v)r.observe(o,{childList:!0});for(const o of s.keys())r.observe(o,B);e.layers.some(o=>!o.live)?d.add(e):d.delete(e);for(const o of e.layers)!o.live&&!o.connecting&&!(0,b.isElementConnected)(o.element)&&(o.connecting=!0,(0,b.whenConnected)(o.element,()=>u(()=>{o.connecting=!1,o.declared&&!o.live&&g(o,e.doc)&&h(e)})));if(i===c)return;const f=c&&!(c.declared&&c.live)?c:null;if(i&&l.includes(i))f&&f.returnFocus&&(i.returnFocus=f.returnFocus),T(()=>A(e,i));else if(f){const o=f.returnFocus;T(()=>K(e,f,o))}f&&(f.returnFocus=null)}function A(e,t){const n=t.element.node;if(e.top!==t||!n||!n.isConnected)return;const s=e.doc,r=s.activeElement;if(r&&n.contains(r))return;const c=new Set,l=(i,p)=>{if(c.has(i)||(c.add(i),i.matches(":disabled")))return!1;const v=p&&i.getAttribute("tabindex");return v&&parseInt(v,10)<0?!1:(i.focus(),s.activeElement===i)};for(const i of n.querySelectorAll("[autofocus]"))if(l(i,!1))return;for(const i of n.querySelectorAll(W))if(l(i,!0))return;r&&r!==s.body&&typeof r.blur=="function"&&r.blur()}function K(e,t,n){if(t.declared&&t.live)return;const s=e.doc,r=s.activeElement,c=t.element.node;(!r||r===s.body||c&&c.contains(r)||m(r))&&(n&&n.isConnected&&n.ownerDocument===s&&!m(n)&&(n.focus({preventScroll:!0}),s.activeElement===n)||e.top&&A(e,e.top))}function w(e,t){if(e.declared===t)return;const n=e.manager;if(e.declared=t,e.live=!1,t)n.layers.push(e);else{const s=n.layers.indexOf(e);s!==-1&&n.layers.splice(s,1)}h(n)}function I(e){let t=e[a];if(typeof t=="function")try{t=t(e,e.state,e.context)}catch{t=!1}return!!t}function F(e){let t=_.get(e);if(t)return t;const n=e.__ref,s=e.node;if(!n||!s||s.nodeType!==1)return null;const r=V(s.ownerDocument);if(!r)return null;t={element:e,manager:r,declared:!1,live:!1,connecting:!1,returnFocus:null},_.set(e,t);const c=(0,M.createEffect)(()=>{const l=I(e);u(()=>w(t,l))},{depth:n.path.length,label:()=>n.path.join(".")+"::"+a});return n.__effects||(n.__effects=[]),n.__effects.push(c),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>u(()=>w(t,!1))),t}function U(){for(const e of d){if(!e.doc.defaultView){d.delete(e);continue}e.layers.some(t=>!t.live&&g(t,e.doc))&&h(e)}}const Y={name:a,create(e){S(e,a)&&u(()=>F(e))},render(){d.size&&u(U)},update(e){S(e,a)&&u(()=>{const t=F(e);t&&w(t,I(e))})}};