@symbo.ls/element 3.14.804 → 3.14.806
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 +32 -0
- package/README.md +197 -0
- package/dist/cjs/src/cache.js +1 -1
- package/dist/cjs/src/connected.js +1 -0
- package/dist/cjs/src/core.js +6 -0
- package/dist/cjs/src/create.js +1 -6
- package/dist/cjs/src/cssLonghands.js +1 -1
- package/dist/cjs/src/delegate.js +1 -1
- package/dist/cjs/src/dispose.js +1 -1
- package/dist/cjs/src/extends.js +1 -1
- package/dist/cjs/src/features.js +1 -0
- package/dist/cjs/src/handlerChain.js +1 -0
- package/dist/cjs/src/hydration.js +1 -0
- package/dist/cjs/src/index.js +1 -1
- package/dist/cjs/src/install.js +1 -0
- package/dist/cjs/src/lean.js +1 -0
- package/dist/cjs/src/methods.js +1 -1
- package/dist/cjs/src/mountRecord.js +1 -0
- package/dist/cjs/src/mountScheduler.js +1 -1
- package/dist/cjs/src/mountYield.js +1 -0
- package/dist/cjs/src/plainRows.js +1 -0
- package/dist/cjs/src/update.js +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/cjs/src/viewEvents.js +1 -0
- package/dist/esm/src/cache.js +1 -1
- package/dist/esm/src/connected.js +1 -0
- package/dist/esm/src/core.js +6 -0
- package/dist/esm/src/create.js +1 -6
- package/dist/esm/src/cssLonghands.js +1 -1
- package/dist/esm/src/delegate.js +1 -1
- package/dist/esm/src/dispose.js +1 -1
- package/dist/esm/src/extends.js +1 -1
- package/dist/esm/src/features.js +1 -0
- package/dist/esm/src/handlerChain.js +1 -0
- package/dist/esm/src/hydration.js +1 -0
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/install.js +1 -0
- package/dist/esm/src/lean.js +1 -0
- package/dist/esm/src/methods.js +1 -1
- package/dist/esm/src/mountRecord.js +1 -0
- package/dist/esm/src/mountScheduler.js +1 -1
- package/dist/esm/src/mountYield.js +1 -0
- package/dist/esm/src/plainRows.js +1 -0
- package/dist/esm/src/update.js +1 -1
- package/dist/esm/src/version.js +1 -1
- package/dist/esm/src/viewEvents.js +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @symbo.ls/element
|
|
2
2
|
|
|
3
|
+
## 3.14.806
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @symbo.ls/css@3.14.780
|
|
10
|
+
- @symbo.ls/scratch@3.14.790
|
|
11
|
+
- @symbo.ls/utils@3.14.789
|
|
12
|
+
|
|
13
|
+
## 3.14.805
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- xma.info report round (FW-XMA-EXCEPTIONS-UPSTREAM-1), its /simplify pass and the follow-ups.
|
|
18
|
+
|
|
19
|
+
- element: optional features (view events, `always` handler chains, plain-row diff, hydration, yielding mount) are feature slots — `create.js` installs all of them, `src/lean.js` none (the smbls embed); one chunked mount driver and one meter per task; the chunked first render costs about a third of what it did (a resumed row goes after the previous row, one `__ref` shape, the budget is read once); `whenConnected`; `onWindowLoad` after load reaches an element built off-document; a null/false row item under `childExtends` builds nothing; building an n-row list no longer scans the parent's keys per row.
|
|
20
|
+
- smbls: the embed is back under its 72 KiB cap and the iife is 2.6 % smaller (terser renames locals after esbuild in the two classic-script builds; maps chained); kits stay lazy in `smbls/core`, fetch is one chunk; live sync loads only when `wantsLiveSync`; a URL-loaded dependency registers in parcel builds.
|
|
21
|
+
- router: the newest navigation wins over one waiting on an async guard; no lazy chunk rides along a resumed route.
|
|
22
|
+
- default-config: accessible Dropdown writes its attributes straight to the nodes, one tab stop per list, an `active` write re-runs only the rows that change, a key-opened menu focuses its item during the reveal; Dialog and Icon clean-ups.
|
|
23
|
+
- styling (scratch, css, css-in-props): one compound-value resolver; CSS colour functions (`oklch()`, `color()`, `color-mix()`, `light-dark()`, `lab()`, `lch()`, `hwb()`) pass through compound values; border props read the scheme only in literal mode.
|
|
24
|
+
- fetch / brender: every server render starts from an empty query cache (seeds carry every request a page makes); the local adapter stays lazy; shared route loop for `smbls build` and `smbls brender`, `smbls brender --strict`.
|
|
25
|
+
- cli: every command that writes to the platform prints its target and needs a typed "production" or `--yes` for production; `smbls deploy --save` saves the provider, `-y/--yes` is consent; `deploy --dry-run` no longer pushes.
|
|
26
|
+
- frank-audit: FA205 reports only factory calls that run at module load.
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
- @symbo.ls/css@3.14.779
|
|
30
|
+
- css-in-props@3.14.763
|
|
31
|
+
- @symbo.ls/scratch@3.14.789
|
|
32
|
+
- @symbo.ls/signal@3.14.789
|
|
33
|
+
- @symbo.ls/utils@3.14.787
|
|
34
|
+
|
|
3
35
|
## 3.14.804
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# @symbo.ls/element
|
|
2
|
+
|
|
3
|
+
The DOMQL v3.14 element engine: `create()`, `el.update()`, `dispose()`, the
|
|
4
|
+
reactive effects, events and lifecycle hooks. Apps reach it through `smbls`;
|
|
5
|
+
the authoring guide is `USAGE.md` at the repository root. This file covers the
|
|
6
|
+
contracts of the engine's hooks and events.
|
|
7
|
+
|
|
8
|
+
## Lifecycle hooks
|
|
9
|
+
|
|
10
|
+
Every lifecycle handler takes the element first: `(el, s, ctx, options?)`.
|
|
11
|
+
|
|
12
|
+
| Hook | Runs |
|
|
13
|
+
| -- | -- |
|
|
14
|
+
| `onStateInit`, `onStateCreated` | while the element builds its own state, before `onInit` |
|
|
15
|
+
| `onInit` | before the DOM node exists |
|
|
16
|
+
| `onAttachNode` | the node exists, not attached yet |
|
|
17
|
+
| `onCreate`, `onComplete`, `onRender`, `onRenderRouter` | in that order, once the subtree is built and attached to its parent |
|
|
18
|
+
| `onMounted` | next frame, once the element is connected to its document |
|
|
19
|
+
| `onFrame` | every animation frame while connected |
|
|
20
|
+
| `onBeforeUpdate` / `onUpdate` | around `el.update()` (`false` from `onBeforeUpdate` cancels) |
|
|
21
|
+
| `onBeforeRemove` / `onRemove` | around `dispose()` |
|
|
22
|
+
|
|
23
|
+
## Yielding mounts
|
|
24
|
+
|
|
25
|
+
`create()` builds a subtree in one synchronous run unless the mount is allowed
|
|
26
|
+
to yield: `mountYield` in the create options (the whole tree) or
|
|
27
|
+
`yieldChildren` on an element (its own children). `true` means a 50 ms budget;
|
|
28
|
+
a number is the budget in ms. A children loop that runs out of budget stops,
|
|
29
|
+
queues the rest, and continues in a later task (`scheduler.yield()`, else a
|
|
30
|
+
MessageChannel, else `setTimeout`). smbls turns this on for an app's first
|
|
31
|
+
render with a 10 ms budget (its `firstRender` option).
|
|
32
|
+
|
|
33
|
+
An element whose children were deferred is incomplete until the last of them
|
|
34
|
+
is built. It is attached in its place at once, so later chunks land in DOM
|
|
35
|
+
order, but `onCreate`, `onComplete`, `onRender`, `onRenderRouter` and the
|
|
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
|
|
43
|
+
mount an incomplete child holds its parent the same way, so every `onRender`
|
|
44
|
+
sees all of its children. The queue runs depth-first: a subtree finishes
|
|
45
|
+
before the siblings declared after it are built, so elements are built, and
|
|
46
|
+
their hooks fire, in exactly the order of a synchronous build — only spread
|
|
47
|
+
over several tasks — and nothing is placed below content that is still
|
|
48
|
+
growing. A child that comes back incomplete holds back what its parent builds
|
|
49
|
+
after it, like the budget does: the next row or named child, `content` and
|
|
50
|
+
the named children after the last row, the named children after `content`.
|
|
51
|
+
Rows from an array and from an object `children` are built in chunks alike.
|
|
52
|
+
A rebuild, a reconcile, an `if:` coming back and a create without the options
|
|
53
|
+
stay synchronous at the list level; a row a reconcile creates while the
|
|
54
|
+
options carry `mountYield` builds its own children in chunks.
|
|
55
|
+
|
|
56
|
+
The budget is checked after each child, never inside one, by one meter per
|
|
57
|
+
task: it counts the children built and reads the clock only when its estimate
|
|
58
|
+
says the budget may be near (with uniform costs, the same decisions as a read
|
|
59
|
+
per child).
|
|
60
|
+
|
|
61
|
+
`el.set(content, options, attachOptions)` passes the attach options to the
|
|
62
|
+
content's create() and returns the content it created. smbls builds an app's
|
|
63
|
+
first view with `deferAttach` (the root) and `holdTail` (the first page).
|
|
64
|
+
|
|
65
|
+
| Export | Use |
|
|
66
|
+
| -- | -- |
|
|
67
|
+
| `whenMounted(el)` | promise: resolves once `el`'s create() has finished (at once when nothing was deferred) |
|
|
68
|
+
| `attachElement(el)` | attaches an element created with `{ deferAttach: true }` (create()'s attach options) — one insertion of its whole subtree |
|
|
69
|
+
| `releaseMount(el)` | releases an element created with `{ holdTail: true }`: its `onCreate` … `onRender` run once nothing else holds them |
|
|
70
|
+
| `mountPending(el)` | `true` while `el` waits for deferred children |
|
|
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) |
|
|
73
|
+
| `yieldToMain()` | promise: resolves in a later task, through the same `scheduler.yield()` ladder |
|
|
74
|
+
| `holdMountFlush()` | holds the `onMounted` flush until the returned `release()` is called |
|
|
75
|
+
| `mountYieldBudget(value)` | the budget in ms a `mountYield` / `yieldChildren` value means (0 = no yielding) |
|
|
76
|
+
|
|
77
|
+
## A base that owns a lifecycle step: `always`
|
|
78
|
+
|
|
79
|
+
A merge gives every key one value, so an element's own `onRender` replaces the
|
|
80
|
+
one its base declares. That default does not change. A base marks a handler
|
|
81
|
+
`always` when every component that extends it must run it:
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
export const Tracked = {
|
|
85
|
+
onRender: { always: true, handler: (el) => el.call('trackImpression', el.key) }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Card = {
|
|
89
|
+
extends: 'Tracked',
|
|
90
|
+
onRender: (el, s) => {} // runs after Tracked's handler, never instead of it
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- An `always` handler survives every merge that would replace it: an `extends`
|
|
95
|
+
chain or array, `childExtends`, the key auto-extend, a nested child
|
|
96
|
+
override, `childProps`, `props`. It runs before the handler that replaced it.
|
|
97
|
+
- Down a chain, `always` handlers accumulate (the deepest base first, an
|
|
98
|
+
`extends` array in order). One plain handler, the last one merged, runs
|
|
99
|
+
after them; a plain handler between them is still replaced:
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
Rise: { onRender: { always: true, handler: r } }
|
|
103
|
+
Card: { extends: 'Rise', onRender: c } // r, c
|
|
104
|
+
el: { extends: 'Card', onRender: o } // r, o (c replaced, as before)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- The merged `el.onRender` is one function (shared by every instance of the
|
|
108
|
+
component). Calling it runs every handler with the caller's `this` and
|
|
109
|
+
arguments. A handler that throws does not stop the rest; the first error is
|
|
110
|
+
rethrown after them and reported like any hook error. `false` from any
|
|
111
|
+
handler is returned (a veto, e.g. `onBeforeUpdate`). A pending promise is
|
|
112
|
+
returned while any handler is async, so the hook stays guarded until it
|
|
113
|
+
settles.
|
|
114
|
+
- It composes the lifecycle hooks above, `onStateUpdate`, `onContentUpdate`
|
|
115
|
+
and the view events below (each entry with its own options). The bridge
|
|
116
|
+
hooks do not compose (`onBridgeMount` returns the host's one library
|
|
117
|
+
instance), nor do DOM events (their delegated listener holds one handler per
|
|
118
|
+
node). `always` on any other key warns in development and the default merge
|
|
119
|
+
applies.
|
|
120
|
+
|
|
121
|
+
## View events: `onInView` / `onLeaveView`
|
|
122
|
+
|
|
123
|
+
```js
|
|
124
|
+
export const Rise = {
|
|
125
|
+
data: { rise: 'wait' },
|
|
126
|
+
onInView: {
|
|
127
|
+
always: true, // every component that extends Rise keeps this step
|
|
128
|
+
once: true, // run the first time only, then stop watching
|
|
129
|
+
threshold: 0.1, // the share of the element that must be visible (0–1, default 0)
|
|
130
|
+
rootMargin: '0px', // grow or shrink the viewport, as IntersectionObserver's
|
|
131
|
+
handler: (entry, el, s, ctx) => el.update({ data: { rise: 'in' } })
|
|
132
|
+
},
|
|
133
|
+
onLeaveView: (entry, el, s, ctx) => {}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- `onInView` runs when the element crosses into its threshold; `onLeaveView`
|
|
138
|
+
runs on the way out, never for an element that starts out of view. An
|
|
139
|
+
element that leaves its document while alive (`if:` hiding it) leaves the
|
|
140
|
+
view.
|
|
141
|
+
- `entry` is the `IntersectionObserverEntry`. `this` is the element and its
|
|
142
|
+
design system is active, as in every `onXxx` handler. A string handler calls
|
|
143
|
+
a project function: `onInView: 'reveal'` → `el.call('reveal', entry)`.
|
|
144
|
+
- One shared IntersectionObserver per document, threshold and `rootMargin`.
|
|
145
|
+
The first element that declares one of the events creates it; the last one
|
|
146
|
+
removed disconnects it. An app that declares neither creates no observer.
|
|
147
|
+
- The element is observed when it gets its node (create, or an `if:`
|
|
148
|
+
element's first appearance), unobserved on removal and once its `once`
|
|
149
|
+
handlers have run.
|
|
150
|
+
- Entries the browser delivers together run in delivery order and share
|
|
151
|
+
`entry.time`, so a stagger can count them.
|
|
152
|
+
- The element's own document is observed (an iframe app observes in the
|
|
153
|
+
frame). Without an IntersectionObserver (SSR, jsdom) nothing is observed and
|
|
154
|
+
nothing runs.
|
|
155
|
+
|
|
156
|
+
## Conditional blocks and their dependencies
|
|
157
|
+
|
|
158
|
+
A `'.isX'` / `'!isX'` block follows what its `isX` predicate reads. A state
|
|
159
|
+
read re-applies the block on the next state change. A predicate that reads
|
|
160
|
+
only the element (`isQuiet: (el) => !!el.quiet`, directly or through
|
|
161
|
+
`el.call`) re-runs on `el.update()`.
|
|
162
|
+
|
|
163
|
+
In development, a predicate whose first run read state WITHOUT subscribing to
|
|
164
|
+
it — the `in` operator, `Object.keys` / spread / JSON, a `__` key,
|
|
165
|
+
`s.parse()` / `keys()` / `values()` — and so tracked nothing warns once: no
|
|
166
|
+
state write will ever re-run it. The decision is made at run time
|
|
167
|
+
(`countUntrackedReads` in `@symbo.ls/signal`); the predicate's source is never
|
|
168
|
+
read.
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
isShown: (el, s) => ('openId' in s.root) && s.root.openId === el.tipId,
|
|
172
|
+
isShownDeps: [(el, s) => s.root.openId], // read first, always: subscribed while undeclared
|
|
173
|
+
'.isShown': { opacity: '1' }
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`isXDeps: []` declares the predicate static on purpose: it is never warned
|
|
177
|
+
about.
|
|
178
|
+
|
|
179
|
+
## Optional features and the lean entry
|
|
180
|
+
|
|
181
|
+
Five features are slots of the engine, each consulted with one null test:
|
|
182
|
+
view events (`onInView` / `onLeaveView`), `always` handler chains, the
|
|
183
|
+
plain-row re-run diff of a `children` factory, hydration adoption, and the
|
|
184
|
+
yielding mount (`mountYield`, `yieldChildren`, `holdTail`, the deferred
|
|
185
|
+
create() tail). `@symbo.ls/element` installs all of them when it is loaded
|
|
186
|
+
(`src/create.js`), so an app — and every module that imports `create.js` —
|
|
187
|
+
behaves the same with them.
|
|
188
|
+
|
|
189
|
+
`@symbo.ls/element/src/lean` is the engine without them (`create`,
|
|
190
|
+
`applyExtends`, `registerEvent`, `REGISTRY`). The smbls embed
|
|
191
|
+
(`smbls/embed`, `SymbolsEmbed`, whose IIFE has a byte budget —
|
|
192
|
+
`packages/smbls/__tests__/embed-bundle.contract.test.js`) builds on it.
|
|
193
|
+
There, an `{ always: true, handler }` value is not a handler (an extender's
|
|
194
|
+
plain handler replaces the base's, as before `always`), the view events never
|
|
195
|
+
fire, a plain `children` factory rebuilds its rows on every re-run, nodes are
|
|
196
|
+
never adopted from a pre-rendered page, and every children loop builds in one
|
|
197
|
+
go (`mountYield` and `holdTail` are ignored).
|
package/dist/cjs/src/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!b.call(e,o)&&o!==r&&c(e,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return e};var v=e=>y(c({},"__esModule",{value:!0}),e);var w={};x(w,{SVG_NS:()=>i,SVG_TAGS:()=>s,cacheNode:()=>T,createHTMLNode:()=>f,detectTag:()=>g,firstSlotAfterText:()=>k,isSvgTag:()=>d,isValidTag:()=>l});module.exports=v(w);const i="http://www.w3.org/2000/svg",s=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),S=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function l(e){return S.has(e)||s.has(e)}function d(e){return s.has(e)}function g(e){let{tag:t,key:r}=e;if(typeof t=="function")try{t=t(e,e.state,e.context)}catch(a){t=void 0,typeof console<"u"&&console.error&&console.error(`[smbls] \`tag:\` factory threw on "${r||"<anon>"}" \u2014 falling back to key-based tag detection:`,a?.message||a)}if(t===!0&&(t=r),typeof t=="string"&&l(t))return t;if(!r||typeof r!="string")return"div";const n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]);let o=r.toLowerCase();return o.includes(".")&&(o=o.split(".")[0]),o.includes("_")&&(o=o.split("_")[0]),l(o)&&!n.has(o)?o:"div"}const p={};function f(e,t){const r=t?.context?.document||globalThis.document;if(!r)return null;if(e==="string")return r.createTextNode(t?.text||"");if(e==="fragment")return r.createDocumentFragment();if(d(e)){const n=t?.parent;if(e==="svg"||n?.node?.namespaceURI===i)return r.createElementNS(i,e);if(e!=="svg")return r.createElement("div")}return r.createElement(e)}function T(e){const t=e.tag=g(e),n=d(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,o=e?.context?.document||globalThis.document;let a=p[n];if(a||(a=p[n]=f(t,e)),!a)return null;const u=o&&a.ownerDocument!==o?f(t,e):a.cloneNode(!0);return t==="string"&&(u.nodeValue=e.text||""),u}function k(e,t){return t&&t.parentNode===e?t.nextSibling:e.firstChild}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var f=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var a=(n,e)=>{for(var o in e)f(n,o,{get:e[o],enumerable:!0})},l=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of _(e))!u.call(n,r)&&r!==o&&f(n,r,{get:()=>e[r],enumerable:!(t=d(e,r))||t.enumerable});return n};var C=n=>l(f({},"__esModule",{value:!0}),n);var w={};a(w,{flushConnected:()=>h,forgetConnected:()=>g,isElementConnected:()=>i,whenConnected:()=>p});module.exports=C(w);const c=new Set;function i(n){const e=n&&n.node;if(!e)return!1;const o=e.nodeType===11?n.__ref?.__fragmentAnchor:e;return o?o.isConnected!==!1:!1}function p(n,e){const o=n&&n.node,t=n&&n.__ref;if(!(!o||!t||typeof e!="function")){if(i(n)){e(n);return}(t.__onConnected||(t.__onConnected=[])).push(e),c.add(n)}}function h(){if(c.size)for(const n of c){const e=n.__ref,o=n.node;if(!e||!o){c.delete(n);continue}if(!i(n))continue;c.delete(n);const t=e.__onConnected;if(e.__onConnected=null,!!t)for(let r=0;r<t.length;r++)try{t[r](n)}catch(s){typeof console<"u"&&console.error&&console.error("[smbls] whenConnected callback failed:",s?.message||s)}}}function g(n){c.size&&c.delete(n)&&n.__ref&&(n.__ref.__onConnected=null)}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
`+o.stack.split(`
|
|
3
|
+
`).slice(0,6).join(`
|
|
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;
|