@adia-ai/web-modules 0.7.24 → 0.7.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog — @adia-ai/web-modules
2
2
 
3
+ ## [0.7.26] — 2026-07-04
4
+
5
+ ### Maintenance
6
+ - **Lockstep version bump only.** No source changes in this package; bumped to maintain the 9-package version coherence enforced by `scripts/release/check-lockstep.mjs`. Substantive v0.7.26 work shipped in variant="outline" retired as the reach-for-secondary generation-time habit. See `packages/a2ui/compose/CHANGELOG.md#unreleased` for details.
7
+
8
+ ## [0.7.25] — 2026-07-03
9
+
10
+ ### Changed
11
+ - **Kitchen-sink bundle regenerated to carry the accordion `variant="flat|contained"` posture.** `dist/everything.min.js` was rebuilt so the CDN / `@adia-ai/web-modules/everything` path reflects `@adia-ai/web-components`' new `accordion-ui`/`accordion-item-ui` `variant` attribute + body-surface tokens, the caret/label footnote fixes, and the default-header keyboard a11y improvement. Bundle-only — no `web-modules` source change. See `packages/web-components/CHANGELOG.md#0725--2026-07-03`.
12
+
13
+ ### Maintenance
14
+ - **Doc-comment path references corrected** (`docs/specs/...` → `.claude/docs/specs/...`) in a handful of module `.yaml`/`.class.js`/`.a2ui.json` sidecars across `billing/`, `dashboard/`, `feedback/`, `settings/`, and `theme/` — propagated from the repo-wide `docs/` → `.claude/docs/` migration (2026-07-01) on the first full `components.mjs` regen since; no functional change.
15
+
3
16
  ## [0.7.24] — 2026-07-01
4
17
 
5
18
  ### Changed
@@ -597,7 +610,7 @@
597
610
  ## [0.6.15] — 2026-05-21
598
611
 
599
612
  ### Maintenance
600
- - **Lockstep version bump only.** No source changes in this package; bumped to maintain the 9-package version coherence enforced by `scripts/release/check-lockstep.mjs`. Substantive v0.6.15 work shipped in `@adia-ai/web-components` — `installIconLoaders` shape-detects malformed flat globs (FB-07 auto-promote + warn), `icons-phosphor.js` surfaces silent-fail diagnostics (FB-08), and docs/skill examples corrected (FB-09). See `packages/web-components/CHANGELOG.md#0615--2026-05-21` for details.
613
+ - **Lockstep version bump only.** No source changes in this package; bumped to maintain the 9-package version coherence enforced by `scripts/release/check-lockstep.mjs`. Substantive v0.6.15 work shipped in `@adia-ai/web-components` — `installIconLoaders` shape-detects malformed flat globs (FB-07 auto-promote + warn), `icons-phosphor.js` surfaces silent-fail diagnostics (FB-08), and .claude/docs/skill examples corrected (FB-09). See `packages/web-components/CHANGELOG.md#0615--2026-05-21` for details.
601
614
 
602
615
  ## [0.6.14] — 2026-05-21
603
616
 
@@ -1058,7 +1071,7 @@ Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4
1058
1071
 
1059
1072
  ### Added
1060
1073
 
1061
- - **`<theme-panel>` module — new `theme/` cluster.** Module-tier appearance-preferences control surface. Owns the three knobs of the AdiaUI theming contract: `[theme]` named themes (8 built-in slugs + tolerant for custom), `--a-density` / `--a-radius-k` parametric overrides, and `color-scheme` light/dark switching, plus optional `localStorage` persistence behind a small attribute API ([`packages/web-modules/theme/theme-panel/`](./theme/theme-panel/)). Reflected state — `[active-theme]`, `[active-scheme]`, `[active-density]`, `[active-radius]` — lets external CSS / JS react via `:has(theme-panel[active-scheme="dark"])` patterns without listening to events. One `theme-change` event per user-visible change (source ∈ `theme | slider | preset | scheme | reset | programmatic`). Attribute API: `[themes="slug1 slug2…"]` (override default 8), `[parametric]` (renders density + radius sliders), `[presets]` (renders compact / reset / spacious preset row), `[scheme-toggle]` (renders inline light/dark toggle — absorbs the legacy standalone `#theme-toggle` button per OD-002=A). 23 unit tests. Promoted from the ~30-line inline `#theme-panel` block + ~90 LOC of controller wiring previously duplicated in `site/index.html` and `playgrounds/admin-shell/`. Spec: [`docs/specs/theme-panel-module.md`](../../docs/specs/theme-panel-module.md). Plan: [`docs/plans/theme-panel-module-2026-05-11.md`](../../docs/plans/theme-panel-module-2026-05-11.md). Commits `63d9deb4` (module Phase 1) + `a35d3131` (site consumer migration Phase 2; site.js −90 LOC + index.html −27 inline lines) + `c844aef4` (admin-shell playground consumer migration Phase 3; contents.html −25 lines + contents.js −48 LOC).
1074
+ - **`<theme-panel>` module — new `theme/` cluster.** Module-tier appearance-preferences control surface. Owns the three knobs of the AdiaUI theming contract: `[theme]` named themes (8 built-in slugs + tolerant for custom), `--a-density` / `--a-radius-k` parametric overrides, and `color-scheme` light/dark switching, plus optional `localStorage` persistence behind a small attribute API ([`packages/web-modules/theme/theme-panel/`](./theme/theme-panel/)). Reflected state — `[active-theme]`, `[active-scheme]`, `[active-density]`, `[active-radius]` — lets external CSS / JS react via `:has(theme-panel[active-scheme="dark"])` patterns without listening to events. One `theme-change` event per user-visible change (source ∈ `theme | slider | preset | scheme | reset | programmatic`). Attribute API: `[themes="slug1 slug2…"]` (override default 8), `[parametric]` (renders density + radius sliders), `[presets]` (renders compact / reset / spacious preset row), `[scheme-toggle]` (renders inline light/dark toggle — absorbs the legacy standalone `#theme-toggle` button per OD-002=A). 23 unit tests. Promoted from the ~30-line inline `#theme-panel` block + ~90 LOC of controller wiring previously duplicated in `site/index.html` and `playgrounds/admin-shell/`. Spec: [`.claude/docs/specs/theme-panel-module.md`](../../.claude/docs/specs/theme-panel-module.md). Plan: [`.claude/docs/plans/theme-panel-module-2026-05-11.md`](../../.claude/docs/plans/theme-panel-module-2026-05-11.md). Commits `63d9deb4` (module Phase 1) + `a35d3131` (site consumer migration Phase 2; site.js −90 LOC + index.html −27 inline lines) + `c844aef4` (admin-shell playground consumer migration Phase 3; contents.html −25 lines + contents.js −48 LOC).
1062
1075
  - **New subpath export `@adia-ai/web-modules/theme`** — consumers wanting just this cluster can `import '@adia-ai/web-modules/theme'` instead of the full barrel. `package.json` `exports` / `files` / `sideEffects` updated.
1063
1076
 
1064
1077
  ### Fixed
@@ -1067,7 +1080,7 @@ Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4
1067
1080
 
1068
1081
  ### Lockstep
1069
1082
 
1070
- 9-package coordinated PATCH cut to v0.4.2 (per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy)). Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4.0` covers `0.4.x` under semver). Source change scoped to one file (`editor/editor-sidebar/editor-sidebar.js`); rides alongside the `@adia-ai/web-components` v0.4.2 `<input-ui type="number">` rewrite. See root [CHANGELOG.md `## [0.4.2]`](../../CHANGELOG.md) for the cut narrative.
1083
+ 9-package coordinated PATCH cut to v0.4.2 (per [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy)). Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4.0` covers `0.4.x` under semver). Source change scoped to one file (`editor/editor-sidebar/editor-sidebar.js`); rides alongside the `@adia-ai/web-components` v0.4.2 `<input-ui type="number">` rewrite. See root [CHANGELOG.md `## [0.4.2]`](../../CHANGELOG.md) for the cut narrative.
1071
1084
  ## [0.4.1] - 2026-05-10
1072
1085
 
1073
1086
  ### Added
@@ -1195,7 +1208,7 @@ Legacy authoring shapes (`<section data-chat-messages>`, `<chat-input-ui data-ch
1195
1208
  Legacy authoring shapes (`<aside data-sidebar="leading">`, `<dialog data-command>`, `<div data-resize>`, `[data-sidebar-toggle]`, `<aside-ui slot="leading">`) all still work identically. Mixed markup (some bespoke, some legacy) renders the same. Migration is opt-in.
1196
1209
  ## [0.3.3] - 2026-05-07
1197
1210
 
1198
- **Lockstep cut.** All 9 published `@adia-ai/*` packages now share version `0.3.3`, governed by [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy).
1211
+ **Lockstep cut.** All 9 published `@adia-ai/*` packages now share version `0.3.3`, governed by [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy).
1199
1212
 
1200
1213
  ### Changed
1201
1214
 
@@ -1208,7 +1221,7 @@ Legacy authoring shapes (`<aside data-sidebar="leading">`, `<dialog data-command
1208
1221
  ## [0.3.2] - 2026-05-06
1209
1222
 
1210
1223
  **9-package lockstep patch cut to v0.3.2.** All lockstep members share
1211
- one version per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy).
1224
+ one version per [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy).
1212
1225
  Internal `@adia-ai/*` dep ranges unchanged at `^0.3.0`.
1213
1226
 
1214
1227
  ### No source changes
@@ -1221,7 +1234,7 @@ version only.
1221
1234
  - `version`: `0.3.1` → `0.3.2`.
1222
1235
  ## [0.3.1] - 2026-05-06
1223
1236
 
1224
- **9-package lockstep patch cut.** All 9 published `@adia-ai/*` packages bump 0.3.0 → 0.3.1 per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges remain at `^0.3.0` (covers `0.3.1` under semver — patch-cut asymmetry).
1237
+ **9-package lockstep patch cut.** All 9 published `@adia-ai/*` packages bump 0.3.0 → 0.3.1 per [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges remain at `^0.3.0` (covers `0.3.1` under semver — patch-cut asymmetry).
1225
1238
 
1226
1239
  This package itself ships **no source changes** in v0.3.1. The cut bumps version only — substantive content lives in [`@adia-ai/web-components`](https://github.com/adiahealth/gen-ui-kit/releases/tag/web-components-v0.3.1) (folder-per-trait restructure; barrel API unchanged).
1227
1240
 
@@ -1231,7 +1244,7 @@ This package itself ships **no source changes** in v0.3.1. The cut bumps version
1231
1244
  - Internal `@adia-ai/*` dep ranges: unchanged at `^0.3.0` (covers `0.3.1` under semver — patch-cut asymmetry).
1232
1245
  ## [0.3.0] - 2026-05-05
1233
1246
 
1234
- **9-package lockstep cut + chat-shell now uses `@adia-ai/llm`.** All 9 published `@adia-ai/*` packages bump 0.2.5 → 0.3.0 per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges bump `^0.2.0` → `^0.3.0`.
1247
+ **9-package lockstep cut + chat-shell now uses `@adia-ai/llm`.** All 9 published `@adia-ai/*` packages bump 0.2.5 → 0.3.0 per [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges bump `^0.2.0` → `^0.3.0`.
1235
1248
 
1236
1249
  This is a **minor cut on top of v0.2.5 with one BREAKING install change**: `@adia-ai/web-modules` now declares `@adia-ai/llm` as a peer dependency. Consumers using `<chat-shell>` (or any LLM-capable composite from this package) must install `@adia-ai/llm` alongside this package.
1237
1250
 
@@ -1262,9 +1275,9 @@ Update `package.json`:
1262
1275
  Then `npm install` (or pnpm). Imports of `<chat-shell>` itself don't change. Direct imports of `streamChat` from this package were never a public surface — they remain available indirectly via `@adia-ai/llm`.
1263
1276
  ## [0.2.5] - 2026-05-04
1264
1277
 
1265
- **8-package lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.4 → 0.2.5 per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges remain at `^0.2.0` (covers 0.2.5 under semver — patch-cut asymmetry).
1278
+ **8-package lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.4 → 0.2.5 per [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges remain at `^0.2.0` (covers 0.2.5 under semver — patch-cut asymmetry).
1266
1279
 
1267
- This is a **patch cut on top of v0.2.4, no BREAKING changes.** Substantive content lives in `web-components` (new `<fields-ui>` form-grid primitive + `draggable-list-item` last-item drop-zone fix, both surfaced by the Tasks UI Playground at `docs/projects/tasks-playground/`); `a2ui-corpus` ships a catalog regen for the new `<fields-ui>` yaml. `web-modules` rides along at version bump only — no source change.
1280
+ This is a **patch cut on top of v0.2.4, no BREAKING changes.** Substantive content lives in `web-components` (new `<fields-ui>` form-grid primitive + `draggable-list-item` last-item drop-zone fix, both surfaced by the Tasks UI Playground at `.claude/docs/projects/tasks-playground/`); `a2ui-corpus` ships a catalog regen for the new `<fields-ui>` yaml. `web-modules` rides along at version bump only — no source change.
1268
1281
 
1269
1282
  ### Changed
1270
1283
 
@@ -1272,7 +1285,7 @@ This is a **patch cut on top of v0.2.4, no BREAKING changes.** Substantive conte
1272
1285
  - Internal `@adia-ai/*` dep ranges: unchanged at `^0.2.0` (covers `0.2.5` under semver — patch-cut asymmetry).
1273
1286
  ## [0.2.4] - 2026-05-04
1274
1287
 
1275
- **8-package lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.3 → 0.2.4 per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges remain at `^0.2.0` (covers 0.2.4 under semver — patch-cut asymmetry).
1288
+ **8-package lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.3 → 0.2.4 per [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy). Internal `@adia-ai/*` dep ranges remain at `^0.2.0` (covers 0.2.4 under semver — patch-cut asymmetry).
1276
1289
 
1277
1290
  This is a **patch cut on top of v0.2.3, no BREAKING changes.** Substantive content lives in `web-components` (Tier 4 trait library lift, 11 new traits + 2 architectural rewrites, plus accumulated bug fixes); `a2ui-corpus` ships a catalog regen for the new `<demo-toggle-ui>` primitive. Six packages ride along at version + dep-range bump.
1278
1291
 
@@ -1292,7 +1305,7 @@ _Nothing yet._
1292
1305
 
1293
1306
  **Lockstep cut.** All 8 published `@adia-ai/*` packages bump
1294
1307
  0.2.2 → 0.2.3 per
1295
- [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy).
1308
+ [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy).
1296
1309
  Patch cut — no breaking changes.
1297
1310
 
1298
1311
  ### Changed
@@ -1306,7 +1319,7 @@ Patch cut — no breaking changes.
1306
1319
  `@adia-ai/web-modules` source is byte-identical to `0.2.2`. The cut bumps version + the internal dep range entries only.
1307
1320
  ## [0.2.2] — 2026-05-02
1308
1321
 
1309
- **Lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.1 → 0.2.2 per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy). Patch cut — no breaking changes.
1322
+ **Lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.1 → 0.2.2 per [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy). Patch cut — no breaking changes.
1310
1323
 
1311
1324
  ### Changed
1312
1325
 
@@ -1321,7 +1334,7 @@ Patch cut — no breaking changes.
1321
1334
  ---
1322
1335
  ## [0.2.1] — 2026-05-02
1323
1336
 
1324
- **Lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.0 → 0.2.1 per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy). Patch cut — no breaking changes.
1337
+ **Lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.0 → 0.2.1 per [`.claude/docs/specs/package-architecture.md` § 15](../../.claude/docs/specs/package-architecture.md#15-versioning-policy). Patch cut — no breaking changes.
1325
1338
 
1326
1339
  ### Changed
1327
1340
 
@@ -1337,8 +1350,8 @@ Patch cut — no breaking changes.
1337
1350
  ## [0.2.0] — 2026-05-02
1338
1351
 
1339
1352
  **Lockstep cut.** All 8 published `@adia-ai/*` packages now share one
1340
- version, governed by [`docs/specs/package-architecture.md` § 15
1341
- (Versioning Policy)](../../docs/specs/package-architecture.md#15-versioning-policy).
1353
+ version, governed by [`.claude/docs/specs/package-architecture.md` § 15
1354
+ (Versioning Policy)](../../.claude/docs/specs/package-architecture.md#15-versioning-policy).
1342
1355
 
1343
1356
  ### Changed
1344
1357
 
package/README.md CHANGED
@@ -207,7 +207,7 @@ elements with state-as-attribute semantics) per [ADR-0023](../../.brain/adrs/002
207
207
  | `chat` | `<chat-shell>` | `<chat-thread>`, `<chat-composer>`, `<chat-sidebar>` (JS-bearing); `<chat-empty>`, `<chat-header>`, `<chat-status>` (CSS-only); 6 children total | Conversational surface — streaming messages, composer with `[disabled]` propagation, scroll-to-bottom thread, `[streaming]` reflected. |
208
208
  | `editor` | `<editor-shell>` | `<editor-toolbar>`, `<editor-canvas>`, `<editor-sidebar>` (JS-bearing); `<editor-statusbar>`, `<editor-canvas-empty>` (CSS-only); 5 children total | Design-tool surface — toolbar with `[full-screen]`, central canvas with `[focused]`/`[empty]`, sidebar wraps `<pane-ui resizable>` for delegation. |
209
209
  | `runtime` | `<gen-root>`, `<a2ui-root>` | — | Render roots that turn JSON or gen-UI intents into live DOM. |
210
- | `theme` | — (controls-only) | `<theme-panel>` (JS-bearing); 1 child total | Appearance-preferences control surface — `[theme]` named themes, `--a-density` / `--a-radius-k` parametric overrides, `color-scheme` light/dark, opt-in `[persist]`. Drops into any consumer's `<popover-ui slot="content">` topbar. Spec: [`docs/specs/theme-panel-module.md`](../../docs/specs/theme-panel-module.md). |
210
+ | `theme` | — (controls-only) | `<theme-panel>` (JS-bearing); 1 child total | Appearance-preferences control surface — `[theme]` named themes, `--a-density` / `--a-radius-k` parametric overrides, `color-scheme` light/dark, opt-in `[persist]`. Drops into any consumer's `<popover-ui slot="content">` topbar. Spec: [`.claude/docs/specs/theme-panel-module.md`](../../.claude/docs/specs/theme-panel-module.md). |
211
211
 
212
212
  ### Cross-package convenience subpaths
213
213
 
@@ -195,7 +195,7 @@ parent-template-re-read pattern that works across frameworks.`);return}if(this.d
195
195
  <div data-filelist></div>
196
196
  `),this.#e=this.querySelector("[data-dropzone]"),this.#e&&(this.#e.addEventListener("click",this.#i),this.#e.addEventListener("keydown",this.#s),this.#e.addEventListener("dragover",this.#o),this.#e.addEventListener("dragleave",this.#l),this.#e.addEventListener("drop",this.#c))}render(){let t=this.querySelector("[data-filelist]");if(!this.#e||!t)return;let e=this.querySelector("span[hint]");e&&this.hint&&e.setAttribute("hint",this.hint),t.innerHTML="";for(let i of this.#t){let r=document.createElement("span");r.textContent=i.name,t.appendChild(r)}}get files(){return this.#t}#i=()=>{this.disabled||this.#r()};#s=t=>{this.disabled||(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.#r())};async#r(){try{if(window.showOpenFilePicker){let t=this.#a(),e={multiple:this.multiple};t.length&&(e.types=t);let i=await window.showOpenFilePicker(e);if(!this.isConnected)return;let r=await Promise.all(i.map(n=>n.getFile()));if(!this.isConnected)return;this.#h(r)}else this.#n()}catch(t){if(t.name!=="AbortError")throw t}}#n(){let t=document.createElement("input");t.type="file",this.accept&&(t.accept=this.accept),this.multiple&&(t.multiple=!0),t.style.display="none",document.body.appendChild(t),t.addEventListener("change",()=>{t.files?.length&&this.#h([...t.files]),t.remove()},{once:!0}),t.addEventListener("cancel",()=>t.remove(),{once:!0}),t.click()}#a(){if(!this.accept)return[];let t={};for(let e of this.accept.split(",")){let i=e.trim();i&&(i.startsWith(".")?(t["application/octet-stream"]=t["application/octet-stream"]||[],t["application/octet-stream"].push(i)):t[i]=t[i]||[])}return Object.keys(t).length?[{accept:t}]:[]}#o=t=>{t.preventDefault(),this.querySelector("[data-dropzone]")?.setAttribute("data-dragover","")};#l=()=>{this.querySelector("[data-dropzone]")?.removeAttribute("data-dragover")};#c=t=>{if(t.preventDefault(),this.querySelector("[data-dropzone]")?.removeAttribute("data-dragover"),this.disabled)return;let e=t.dataTransfer;e?.files?.length&&this.#h([...e.files])};#h(t){this.#t=t;let e=new FormData;for(let i of this.#t)e.append(this.name||"file",i);this.internals.setFormValue(e),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value,files:this.files}})),this.render()}disconnected(){super.disconnected(),this.#e&&(this.#e.removeEventListener("click",this.#i),this.#e.removeEventListener("keydown",this.#s),this.#e.removeEventListener("dragover",this.#o),this.#e.removeEventListener("dragleave",this.#l),this.#e.removeEventListener("drop",this.#c)),this.#e=null}};S("upload-ui",Vr);Nd();var Wr=GO({name:"draggable",category:"motion-positioning",description:"Pointer drag to reposition",attributes:["data-draggable-dragging"],events:["drag-end"],config:[],setup({host:s}){let t=!1,e=0,i=0,r=0,n=0;function o(){return s.hasAttribute("disabled")}function a(c){if(o())return;t=!0,e=c.clientX,i=c.clientY;let u=getComputedStyle(s),d=u.translate;if(d&&d!=="none"){let f=d.split(/\s+/).map(parseFloat);r=f[0]||0,n=f[1]||0}else{let f=new DOMMatrixReadOnly(u.transform);r=f.m41,n=f.m42}s.setPointerCapture(c.pointerId),s.setAttribute("data-draggable-dragging",""),s.style.touchAction="none"}function l(c){if(!t)return;let u=c.clientX-e,d=c.clientY-i,f=r+u,p=n+d;s.style.translate=`${f}px ${p}px`}function h(c){if(!t)return;t=!1,s.removeAttribute("data-draggable-dragging");let u=c.clientX-e,d=c.clientY-i,f=r+u,p=n+d;s.dispatchEvent(new CustomEvent("drag-end",{bubbles:!0,detail:{x:f,y:p}}))}return s.addEventListener("pointerdown",a),s.addEventListener("pointermove",l),s.addEventListener("pointerup",h),()=>{s.removeEventListener("pointerdown",a),s.removeEventListener("pointermove",l),s.removeEventListener("pointerup",h),s.removeAttribute("data-draggable-dragging"),s.style.touchAction=""}}});C();var Ur=class extends x{static properties={variant:{type:String,default:"default",reflect:!0},size:{type:String,default:"",reflect:!0},elevation:{type:Number,default:1,reflect:!0},raw:{type:Boolean,default:!1,reflect:!0},draggable:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=!1;connected(){this.draggable&&!this.#t&&(this.addTrait(Wr),this.#t=!0)}updated(t){t.has("draggable")&&this.draggable&&!this.#t&&(this.addTrait(Wr),this.#t=!0)}};S("card-ui",Ur);C();var Fr=class extends x{static properties={src:{type:String,default:"",reflect:!0},text:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},size:{type:String,default:"md",reflect:!0},shape:{type:String,default:"circle",reflect:!0}};get displayName(){return this.text}static template=()=>null;#t=null;#e=null;#i=null;connected(){this.setAttribute("role","img")}render(){!this.src&&!this.displayName&&!this.icon||(this.src?(this.#t||(this.#t=document.createElement("img"),this.#t.setAttribute("slot","img"),this.#t.onerror=()=>{this.#t.remove(),this.#t=null,this.#s()}),this.#t.src=this.src,this.#t.alt=this.displayName||"",this.#t.parentElement||this.appendChild(this.#t),this.#e&&(this.#e.remove(),this.#e=null)):this.icon?(this.#t&&(this.#t.remove(),this.#t=null),this.#e&&(this.#e.remove(),this.#e=null),this.#i||(this.#i=document.createElement("icon-ui"),this.#i.setAttribute("slot","icon"),this.appendChild(this.#i)),this.#i.setAttribute("name",this.icon)):(this.#t&&(this.#t.remove(),this.#t=null),this.#i&&(this.#i.remove(),this.#i=null),this.#s()),this.setAttribute("aria-label",this.displayName||this.icon||""))}#s(){if(!this.displayName)return;let t=this.displayName.split(/\s+/).map(e=>e[0]).join("").slice(0,2).toUpperCase();this.#e||(this.#e=document.createElement("span"),this.#e.setAttribute("slot","initials"),this.appendChild(this.#e)),this.#e.textContent=t}},Yr=class extends x{static properties={max:{type:Number,default:5,reflect:!0},size:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Avatar group")}render(){let t=[...this.querySelectorAll("avatar-ui")],e=this.max,i=t.length-e;if(this.size)for(let n of t)n.setAttribute("size",this.size);t.forEach((n,o)=>{n.style.display=o<e?"":"none",n.style.zIndex=String(t.length-o)});let r=this.querySelector('[slot="overflow"]');i>0?(r||(r=document.createElement("span"),r.setAttribute("slot","overflow"),this.appendChild(r)),r.textContent=`+${i}`,r.setAttribute("aria-label",`${i} more`),r.style.zIndex="0"):r&&r.remove()}};S("avatar-ui",Fr),S("avatar-group-ui",Yr);C();var Hr=class extends x{static properties={value:{type:Number,default:null,reflect:!0},variant:{type:String,default:"bar",reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","100"),this.variant==="bar"&&(this.#t=document.createElement("div"),this.#t.setAttribute("slot","track"),this.#e=document.createElement("div"),this.#e.setAttribute("slot","fill"),this.#t.appendChild(this.#e),this.appendChild(this.#t))}render(){let t=this.value==null||this.value<0,e=Math.max(0,Math.min(100,this.value));this.setAttribute("aria-busy",String(t)),t?this.removeAttribute("aria-valuenow"):this.setAttribute("aria-valuenow",String(e)),this.#e&&(this.#e.style.width=t?"100%":`${e}%`)}disconnected(){this.#t?.remove(),this.#t=null,this.#e=null}};S("progress-ui",Hr);C();var Gr=class extends x{static properties={value:{type:Number,default:0,reflect:!0},total:{type:Number,default:0,reflect:!0},caption:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),!at(this,"caption").length&&!at(this,"track").length?(this.#t=document.createElement("span"),this.#t.setAttribute("slot","caption"),this.appendChild(this.#t),this.#e=document.createElement("div"),this.#e.setAttribute("slot","track"),this.appendChild(this.#e)):(this.#t=at(this,"caption")[0],this.#e=at(this,"track")[0])}render(){let t=Math.max(0,this.total|0),e=Math.max(0,Math.min(t,this.value|0));if(this.setAttribute("aria-valuemax",String(t)),this.setAttribute("aria-valuenow",String(e)),this.#t&&!this.#t.dataset.custom&&(this.#t.textContent=this.caption||"",this.#t.toggleAttribute("hidden",!this.caption)),this.#e){let i=this.#e.children.length;for(;this.#e.children.length<t;)this.#e.appendChild(document.createElement("span"));for(;this.#e.children.length>t;)this.#e.lastElementChild.remove();for(let r=0;r<this.#e.children.length;r++)this.#e.children[r].toggleAttribute("data-active",r<e)}}disconnected(){this.#t=null,this.#e=null}};S("step-progress-ui",Gr);C();var Kr=class extends x{static properties={width:{type:String,default:"100%",reflect:!0},height:{type:String,default:"1.2em",reflect:!0},radius:{type:String,default:"sm",reflect:!0},static:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.setAttribute("aria-hidden","true"),this.#t()}render(){this.#t()}#t(){this.style.width=this.width,this.style.height=this.height}};S("skeleton-ui",Kr);C();var Jr=class extends x{static properties={size:{type:String,default:"md",reflect:!0},variant:{type:String,default:"arc",reflect:!0},tone:{type:String,default:"current",reflect:!0},paused:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"Loading",reflect:!1}};static template=()=>null;connected(){this.hasAttribute("role")||this.setAttribute("role","progressbar"),this.hasAttribute("aria-busy")||this.setAttribute("aria-busy","true"),this.setAttribute("aria-valuetext",this.label||"Loading"),this.#t()}render(){this.setAttribute("aria-valuetext",this.label||"Loading"),this.#t()}#t(){let t=this.variant==="dots",e=this.querySelectorAll(":scope > [data-spinner-dot]");if(t){if(e.length===3)return;e.forEach(r=>r.remove());let i=document.createDocumentFragment();for(let r=1;r<=3;r++){let n=document.createElement("span");n.setAttribute("data-spinner-dot",String(r)),n.setAttribute("aria-hidden","true"),i.appendChild(n)}this.appendChild(i)}else e.length&&e.forEach(i=>i.remove())}};S("spinner-ui",Jr);C();var tn=class extends x{static properties={active:{type:Boolean,default:!1,reflect:!0},delay:{type:Number,default:200,reflect:!0},label:{type:String,default:"Loading\u2026",reflect:!0},variant:{type:String,default:"default",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=!1;constructor(){super();let t=Object.getOwnPropertyDescriptor(this,"active");if(t?.set){let e=t.set;Object.defineProperty(this,"active",{get:t.get,set:i=>{let r=!!t.get.call(this);e.call(this,i),!!i!==r&&this.#s(!!i)},configurable:!0})}}connected(){this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.setAttribute("aria-label",this.label||"Loading"),this.#t=this.parentElement,this.active&&this.#s(!0)}disconnected(){this.#a(),this.#i&&this.#n(),this.#t=null}render(){let t=this.label||"Loading";this.setAttribute("aria-label",t);let e=this.querySelector(":scope > spinner-ui[data-loading-overlay-auto]");e&&e.getAttribute("label")!==t&&e.setAttribute("label",t),this.children.length===0&&this.#o()}#s(t){if(this.#a(),t){let e=Math.max(0,Number(this.delay)||0);e===0?this.#r():this.#e=setTimeout(()=>{this.#e=null,this.active&&this.#r()},e)}else this.#i&&this.#n()}#r(){let t=this.#t||this.parentElement;t&&!t.hasAttribute("aria-busy")&&t.setAttribute("aria-busy","true"),this.#i=!0}#n(){let t=this.#t||this.parentElement;t&&t.getAttribute("aria-busy")==="true"&&t.removeAttribute("aria-busy"),this.#i=!1}#a(){this.#e!==null&&(clearTimeout(this.#e),this.#e=null)}#o(){let t=document.createElement("spinner-ui");t.setAttribute("size","lg"),t.setAttribute("tone","subtle"),t.setAttribute("label",this.label||"Loading"),t.setAttribute("data-loading-overlay-auto",""),this.appendChild(t)}};S("loading-overlay-ui",tn);C();var dy=new Set;function fy(s,t){dy.has(s)||(dy.add(s),console.warn(`[alert-ui] ${t}`))}var en=class s extends x{static properties={text:{type:String,default:"",reflect:!0},title:{type:String,default:"",reflect:!0},description:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},closable:{type:Boolean,default:!1,reflect:!0},dismissible:{type:Boolean,default:!1,reflect:!0},icon:{type:String,default:"",reflect:!0},pattern:{type:String,default:"",reflect:!0},amount:{type:Number,default:0,reflect:!0},currency:{type:String,default:"USD",reflect:!0},dueAt:{type:String,default:"",reflect:!0,attribute:"due-at"},cardLast4:{type:String,default:"",reflect:!0,attribute:"card-last4"},reason:{type:String,default:"",reflect:!0}};static parts={leading:'<icon-ui slot="leading"></icon-ui>',content:'<span slot="content"></span>',close:'<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Close"></button-ui>'};static#t={declined:"x-circle",expired:"clock",insufficient:"wallet",network:"wifi-slash"};static template=()=>null;#e(){this.getAttribute("variant")==="error"&&(fy("variant-error",'variant="error" is not in the canonical enum [default, info, success, warning, danger, muted, neutral]. Mapping to "danger". Fix the source (LLM prompt / corpus pattern) to emit "danger" directly.'),this.setAttribute("variant","danger")),this.hasAttribute("closeable")&&!this.hasAttribute("closable")&&!this.hasAttribute("dismissible")&&(fy("alias-closeable","attribute [closeable] is a misspelled alias of canonical [closable]. Mapping. Fix the source to use [closable] or [dismissible]."),this.setAttribute("closable",""),this.removeAttribute("closeable")),this.hasAttribute("dismissible")&&!this.hasAttribute("closable")&&this.setAttribute("closable","")}#i=t=>{if(t.target.closest('[slot="close"]')){this.#h();return}if(this.pattern==="dunning"){let e=t.target.closest("[data-dunning-action]");if(e&&this.contains(e)){let i=e.getAttribute("data-dunning-action")||"";this.dispatchEvent(new CustomEvent("dunning-action",{bubbles:!0,composed:!0,detail:{action:i,amount:this.amount,currency:this.currency,dueAt:this.dueAt}}))}}};connected(){this.#e(),this.#c(),(this.icon||this.pattern==="dunning"&&this.reason)&&this.ensure("leading"),this.ensure("content"),this.closable&&this.ensure("close"),this.addEventListener("press",this.#i)}disconnected(){this.removeEventListener("press",this.#i)}render(){if(this.pattern==="dunning"){this.#s(),this.#c();return}if(this.icon){let e=this.ensure("leading");e&&e.setAttribute("name",this.icon)}else this.drop("leading");let t=this.ensure("content");if(t){let e=t.hasAttribute("data-alert-auto"),i=t.childNodes.length>0;if(!e&&i){if(this.title||this.description){let r=[this.title,this.description].filter(Boolean).join(". ");this.setAttribute("aria-label",r)}}else if(this.title||this.description){if(t.setAttribute("data-alert-auto","title-desc"),t.replaceChildren(),this.title){let n=document.createElement("strong");n.textContent=this.title,t.appendChild(n),this.description&&t.appendChild(document.createTextNode(" "))}this.description&&t.appendChild(document.createTextNode(this.description));let r=[this.title,this.description].filter(Boolean).join(". ");this.setAttribute("aria-label",r)}else this.text&&(t.setAttribute("data-alert-auto","text"),t.textContent=this.text)}this.closable||this.dismissible?this.ensure("close"):this.drop("close"),this.#c()}#s(){let t=this.icon||s.#t[this.reason]||"x-circle",e=this.ensure("leading");e&&e.setAttribute("name",t);let i=this.ensure("content");if(!i)return;i.setAttribute("data-alert-auto","dunning"),i.replaceChildren();let r=this.title||this.#r();if(r){let l=document.createElement("strong");l.setAttribute("data-dunning-title",""),l.textContent=r,i.appendChild(l)}let n=this.#n(),o=this.#o();if(n||o){if(i.appendChild(document.createTextNode(" ")),n){let l=document.createElement("span");l.setAttribute("data-dunning-amount",""),l.textContent=n,i.appendChild(l)}if(n&&o&&i.appendChild(document.createTextNode(" ")),o){let l=document.createElement("span");l.setAttribute("data-dunning-meta",""),l.textContent=o,i.appendChild(l)}}let a=[r,n,o].filter(Boolean).join(". ");a&&this.setAttribute("aria-label",a),this.closable||this.dismissible?this.ensure("close"):this.drop("close")}#r(){switch(this.reason){case"expired":return"Card expired";case"insufficient":return"Insufficient funds";case"network":return"Network error";case"declined":return"Payment failed";default:return this.variant==="warning"?"Payment due soon":"Payment failed"}}#n(){if(!this.amount&&this.amount!==0||this.amount===0)return"";try{let t=this.getAttribute("lang")||this.lang||void 0;return new Intl.NumberFormat(t,{style:"currency",currency:this.currency||"USD"}).format(this.amount)}catch{return`${this.currency||""} ${this.amount}`.trim()}}#a(){if(!this.dueAt)return"";let t=/^\d{4}-\d{2}-\d{2}$/.test(this.dueAt)?new Date(`${this.dueAt}T00:00:00`):new Date(this.dueAt);if(Number.isNaN(t.getTime()))return"";try{let e=this.getAttribute("lang")||this.lang||void 0;return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}catch{return t.toDateString()}}#o(){let t=[];this.cardLast4&&t.push(`Card ending ${this.cardLast4}`),this.reason&&this.reason!=="declined"&&t.push(this.#l());let e=this.#a();if(e){let i=this.variant==="warning"?"due":"failed";t.push(`${i} ${e}`)}return t.join(" \xB7 ")}#l(){switch(this.reason){case"expired":return"expired";case"insufficient":return"insufficient funds";case"network":return"network error";case"declined":return"declined";default:return""}}#c(){let t=this.variant==="danger"||this.variant==="warning"?"alert":"status";this.setAttribute("role",t)}#h(){this.dispatchEvent(new Event("close",{bubbles:!0})),this.remove()}};S("alert-ui",en);C();var TC={info:"info",success:"check-circle",warning:"warning",danger:"x-circle"},sn=class extends x{static properties={text:{type:String,default:"",reflect:!1},variant:{type:String,default:"default",reflect:!0},icon:{type:String,default:"",reflect:!0},live:{type:String,default:"",reflect:!0}};static parts={leading:'<icon-ui slot="leading"></icon-ui>'};static requiredIcons=["info","check-circle","warning","x-circle"];static template=()=>null;#t(t){return!!(t&&(t._uiPart||t.hasAttribute("data-im-auto")))}connected(){}render(){this.live?this.setAttribute("aria-live",this.live):this.hasAttribute("aria-live")&&this.removeAttribute("aria-live"),this.#e();let t=this.icon||TC[this.variant]||"",e=this.querySelector(':scope > [slot="leading"]');if(!(e&&!this.#t(e)))if(t){let i=this.ensure("leading");i&&(i.setAttribute("data-im-auto",""),i.getAttribute("name")!==t&&i.setAttribute("name",t))}else this.drop("leading")}#e(){let t=this.querySelector(":scope > [data-im-text]");if(Array.from(this.childNodes).some(i=>i===t?!1:i.nodeType===Node.ELEMENT_NODE?!(i.getAttribute&&i.getAttribute("slot")==="leading"):!!(i.nodeType===Node.TEXT_NODE&&i.textContent.trim()))){t&&t.remove();return}this.text?(t||(t=document.createElement("span"),t.setAttribute("data-im-text",""),this.appendChild(t)),t.textContent!==this.text&&(t.textContent=this.text)):t&&t.remove()}};S("inline-message-ui",sn);C();var rn=class extends x{static properties={size:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","presentation")}};S("kbd-ui",rn);C();var nn=class extends x{static requiredIcons=["x"];static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},size:{type:String,default:"md",reflect:!0},removable:{type:Boolean,default:!1,reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0}};static parts={dismiss:'<button slot="dismiss" type="button" aria-label="Remove"><icon-ui name="x" weight="bold"></icon-ui></button>'};static template=()=>null;#t=t=>{this.disabled||t.target.closest('[slot="dismiss"]')&&(this.dispatchEvent(new CustomEvent("remove",{bubbles:!0,detail:{text:this.text,value:this.text}})),this.remove())};#e=t=>{this.disabled||t.target.closest('[slot="dismiss"]')&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("remove",{bubbles:!0,detail:{text:this.text,value:this.text}})),this.remove())};connected(){this.setAttribute("role","status"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}disconnected(){this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}render(){if(this.text&&this.setAttribute("aria-label",this.text),this.disabled?(this.setAttribute("aria-disabled","true"),this.setAttribute("tabindex","-1")):(this.removeAttribute("aria-disabled"),this.setAttribute("tabindex","0")),this.removable&&!this.disabled){let t=this.ensure("dismiss");t&&t.parentElement!==this&&this.appendChild(t)}else this.drop("dismiss")}};S("tag-ui",nn);C();var LC=new Set(["block","dot","square","line","dashed"]),MC=new Set(["sm","md","lg"]),RC=new Set(["out-of-gamut","p3-only","apca-pass","apca-fail"]),IC={"out-of-gamut":"\u25B3","p3-only":"\u2726","apca-pass":"\u2713","apca-fail":"\u2717"},DC={"out-of-gamut":"Outside sRGB gamut","p3-only":"Display-P3 only","apca-pass":"Contrast passes APCA","apca-fail":"Contrast fails APCA"};function qC(s){return s?s.split(/[\s,]+/).map(t=>t.trim()).filter(t=>t&&RC.has(t)):[]}var cs=null;function XC(s){if(!s||typeof s!="string"||typeof document>"u")return null;try{if(!cs){let u=document.createElement("canvas");u.width=1,u.height=1,cs=u.getContext("2d")}cs.fillStyle="#000",cs.clearRect(0,0,1,1),cs.fillStyle=s,cs.fillRect(0,0,1,1);let[t,e,i]=cs.getImageData(0,0,1,1).data;if(t===0&&e===0&&i===0&&s!=="#000"&&s!=="black"&&s!=="#000000")return null;let r=u=>{let d=u/255;return d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4)},n=r(t),o=r(e),a=r(i),l=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*a),h=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*a),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*a);return .2104542553*l+.793617785*h-.0040720468*c}catch{return null}}var on=class extends x{static properties={shape:{type:String,default:"square",reflect:!0},size:{type:String,default:"md",reflect:!0},color:{type:String,default:"",reflect:!0},label:{type:String,default:"",reflect:!0},detail:{type:String,default:"",reflect:!0},badge:{type:String,default:"",reflect:!0},copyable:{type:Boolean,default:!1,reflect:!0},copyValue:{type:String,default:""},selectable:{type:Boolean,default:!1,reflect:!0},selected:{type:Boolean,default:!1,reflect:!0},autoContrast:{type:Boolean,default:!1,reflect:!0},labelPosition:{type:String,default:"below",reflect:!0,attribute:"label-position"}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=!1;#a=null;#o=null;#l=null;#c=null;#h=null;#u=null;connected(){this.#d(),this.#x(),this.#u=new MutationObserver(t=>{let e=!1;for(let i of t){for(let r of i.addedNodes)if(r.nodeType===1){if(r.getAttribute?.("slot")==="chrome"){e=!0;break}if(r.tagName==="SPAN"&&r.style?.display==="contents"&&r.querySelector?.('[slot="chrome"]')){e=!0;break}}if(e)break}e&&(this.#f(),this.#u.takeRecords())}),this.#u.observe(this,{childList:!0})}render(){this.#d(),this.#p(),this.#m(),this.#y(),this.#O(),this.#b(),this.#g()}#d(){if(this.#n)return;let t=Array.from(this.children).filter(n=>n.getAttribute&&n.getAttribute("slot")==="chrome");for(let n of t)n.remove();let e=Array.from(this.children).filter(n=>n.tagName==="SPAN"&&n.style?.display==="contents"&&n.querySelector?.('[slot="chrome"]'));for(let n of e)n.remove();let i=[];for(let n of Array.from(this.childNodes))(n.nodeType===3&&!n.data||n.nodeType===8)&&i.push(n);for(let n of i)n.remove();let r=Array.from(this.childNodes).filter(n=>!(n.nodeType===1&&n.dataset&&(n.dataset.tile!==void 0||n.dataset.label!==void 0||n.dataset.detail!==void 0||n.dataset.badge!==void 0||n.dataset.copy!==void 0))&&!(n.nodeType===3&&!n.textContent.trim()));this.innerHTML="",this.#t=document.createElement("span"),this.#t.setAttribute("data-tile",""),this.#t.setAttribute("aria-hidden","true"),this.appendChild(this.#t);for(let n of t)this.appendChild(n);for(let n of e)this.appendChild(n);for(let n of i)this.appendChild(n);if(this.#s=document.createElement("span"),this.#s.setAttribute("data-badge",""),this.#s.setAttribute("hidden",""),this.appendChild(this.#s),this.#e=document.createElement("span"),this.#e.setAttribute("data-label",""),r.length)for(let n of r)this.#e.appendChild(n);this.appendChild(this.#e),this.#i=document.createElement("span"),this.#i.setAttribute("data-detail",""),this.#i.setAttribute("hidden",""),this.appendChild(this.#i),this.#r=document.createElement("button"),this.#r.setAttribute("data-copy",""),this.#r.setAttribute("type","button"),this.#r.setAttribute("aria-label","Copy value"),this.#r.setAttribute("hidden",""),this.#r.textContent="\u29C9",this.appendChild(this.#r),this.#n=!0}#f(){if(!this.#t||!this.#s)return;let t=[];for(let e of this.children)if(e!==this.#t){if(e===this.#s)break;e.getAttribute?.("slot")==="chrome"&&t.push(e)}for(let e of Array.from(this.children))e!==this.#t&&e!==this.#s&&e!==this.#e&&e!==this.#i&&e!==this.#r&&e.getAttribute?.("slot")==="chrome"&&this.insertBefore(e,this.#s);for(let e of Array.from(this.children))e===this.#t||e===this.#s||e===this.#e||e===this.#i||e===this.#r||!(e.tagName==="SPAN"&&e.style?.display==="contents")||!e.querySelector?.('[slot="chrome"]')||this.insertBefore(e,this.#s)}#p(){if(!this.#t||!this.#e)return;this.#f();let t=LC.has(this.shape)?this.shape:"square",e=MC.has(this.size)?this.size:"md";t!==this.shape&&this.setAttribute("shape",t),e!==this.size&&this.setAttribute("size",e),this.color&&this.style.setProperty("--swatch-color",this.color),!this.#e.firstChild&&this.label?this.#e.textContent=this.label:this.#e.firstChild?.nodeType===3&&this.label&&(this.#e.textContent=this.label);let i=this.#e.textContent.trim().length>0||this.#e.firstElementChild!=null;this.#e.toggleAttribute("hidden",!i)}#m(){if(!this.#s)return;let t=qC(this.badge);if(t.length===0){this.#s.setAttribute("hidden",""),this.#s.replaceChildren();return}this.#s.removeAttribute("hidden");let e=Array.from(this.#s.children).map(n=>n.dataset.badgeVariant);if(e.length===t.length&&e.every((n,o)=>n===t[o]))return;let r=document.createDocumentFragment();for(let n of t){let o=document.createElement("span");o.setAttribute("data-badge-variant",n),o.setAttribute("role","img"),o.setAttribute("aria-label",DC[n]),o.textContent=IC[n],r.appendChild(o)}this.#s.replaceChildren(r)}#g(){if(!this.#e)return;if(!this.autoContrast){this.#e.removeAttribute("data-on-light"),this.#e.removeAttribute("data-on-dark"),this.#a=null;return}let t=this.color||getComputedStyle(this).getPropertyValue("--swatch-color").trim();if(t===this.#a)return;this.#a=t;let e=XC(t);if(e==null){this.#e.removeAttribute("data-on-light"),this.#e.removeAttribute("data-on-dark");return}let i=e<.62;this.#e.toggleAttribute("data-on-dark",i),this.#e.toggleAttribute("data-on-light",!i)}#y(){if(!this.#i)return;let t=(this.detail||"").trim();if(!t){this.#i.setAttribute("hidden",""),this.#i.textContent="";return}this.#i.removeAttribute("hidden"),this.#i.textContent!==t&&(this.#i.textContent=t)}#O(){if(!this.#r)return;if(!this.copyable){this.#r.setAttribute("hidden","");return}this.#r.removeAttribute("hidden");let t=this.#S();t?this.#r.setAttribute("aria-label",`Copy ${t}`):this.#r.setAttribute("aria-label","Copy value")}#b(){this.selectable?(this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.setAttribute("aria-pressed",this.selected?"true":"false")):(this.getAttribute("role")==="button"&&this.removeAttribute("role"),this.getAttribute("tabindex")==="0"&&this.removeAttribute("tabindex"),this.removeAttribute("aria-pressed"))}#x(){this.#o=t=>{!this.selectable||(t.composedPath?t.composedPath():[]).includes(this.#r)||this.#v()},this.#l=t=>{this.selectable&&(t.key!=="Enter"&&t.key!==" "||t.target!==this.#r&&(t.preventDefault(),this.#v()))},this.addEventListener("click",this.#o),this.addEventListener("keydown",this.#l),this.#c=t=>{if(t.stopPropagation(),!this.copyable)return;let e=this.#S();e&&this.#w(e)},this.#r.addEventListener("click",this.#c)}#v(){this.dispatchEvent(new CustomEvent("select",{bubbles:!0,detail:{value:this.color||this.label,color:this.color,label:this.label}}))}#S(){return this.copyValue?this.copyValue:this.color?this.color:""}async#w(t){let e=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(t),e=!0)}catch{}this.#k(e)}#k(t){this.#r&&(this.#h!=null&&clearTimeout(this.#h),this.#r.setAttribute("data-copy-state",t?"ok":"fail"),this.#r.textContent=t?"\u2713":"\u26A0",this.#h=setTimeout(()=>{this.#r&&(this.#r.removeAttribute("data-copy-state"),this.#r.textContent="\u29C9",this.#h=null)},1200))}disconnected(){this.#h!=null&&(clearTimeout(this.#h),this.#h=null),this.#u&&(this.#u.disconnect(),this.#u=null),this.#o&&this.removeEventListener("click",this.#o),this.#l&&this.removeEventListener("keydown",this.#l),this.#r&&this.#c&&this.#r.removeEventListener("click",this.#c),this.#t=null,this.#e=null,this.#i=null,this.#s=null,this.#r=null,this.#n=!1}};S("swatch-ui",on);$t();var py={xs:0,sm:480,md:768,lg:1024,xl:1280},us=Object.keys(py),Gd=Object.values(py);function my(){if(typeof window>"u")return"lg";let s=window.innerWidth;for(let t=us.length-1;t>=0;t--)if(s>=Gd[t])return us[t];return"xs"}var $e=Ni(my());if(typeof window<"u")for(let s=1;s<Gd.length;s++)window.matchMedia(`(min-width: ${Gd[s]}px)`).addEventListener("change",()=>{$e.value=my()});function Bt(s,t=$e.value){if(!s)return null;if(!s.includes("@"))return s;let e=null,i=new Map;for(let a of s.trim().split(/\s+/)){let l=a.lastIndexOf("@");l===-1?e=a:i.set(a.slice(l+1),a.slice(0,l))}let r=us.indexOf(t),n=null,o=-1;for(let[a,l]of i){let h=us.indexOf(a);h!==-1&&h<=r&&h>o&&(n=l,o=h)}return n??e}C();var an=class extends x{static properties={justify:{type:String,default:"start",reflect:!0},align:{type:String,default:"stretch",reflect:!0},gap:{type:String,default:"md",reflect:!0},grow:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;render(){let t=this.gap,e=this.align,i=this.justify,n=t?.includes("@")||e?.includes("@")||i?.includes("@")?$e.value:"";if(t?.includes("@")?this.style.setProperty("--col-gap",ZC(Bt(t,n))):this.style.removeProperty("--col-gap"),e?.includes("@")){let o=Bt(e,n);this.style.setProperty("--col-align",zC(o)),this.style.textAlign=_C(o)}else this.style.removeProperty("--col-align"),this.style.textAlign="";i?.includes("@")?this.style.setProperty("--col-justify",jC(Bt(i,n))):this.style.removeProperty("--col-justify")}},NC={start:"flex-start",end:"flex-end",center:"center",stretch:"stretch",baseline:"baseline"},BC={start:"flex-start",end:"flex-end",center:"center",between:"space-between","space-between":"space-between","space-around":"space-around"};function ZC(s){return!s||s==="0"?"0":/^\d+$/.test(s)?`var(--a-space-${s})`:`var(--a-gap-${s})`}function zC(s){return NC[s]??s}function _C(s){return{start:"start",center:"center",end:"end"}[s]??""}function jC(s){return BC[s]??s}S("col-ui",an);C();var ln=class s extends x{static properties={label:{type:String,default:"",reflect:!0},hint:{type:String,default:"",reflect:!0},required:{type:Boolean,default:!1,reflect:!0},inline:{type:Boolean,default:!1,reflect:!0},align:{type:String,default:"start",reflect:!0}};get error(){return this.#g()?.error??""}static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=t=>{let e=this.#g();if(!e)return;let i=this.#O(e);i&&(t.preventDefault(),i.focus())};connected(){this.#u(),this.#d(),this.#f(),this.#p(),this.#c(),this.#t?.addEventListener("click",this.#n),this.#r=new MutationObserver(()=>{this.#p(),this.#c(),this.#m(),this.#a()}),this.#r.observe(this,{childList:!0}),this.#a()}disconnected(){this.#r?.disconnect(),this.#r=null,this.#h(),this.#t?.removeEventListener("click",this.#n),this.#t=null,this.#e=null,this.#i=null,this.#s=null}render(){this.#t&&this.#t.childNodes[0]&&(this.#t.childNodes[0].nodeValue=this.label||""),this.#e&&(this.#e.hidden=!this.required),this.#i&&(this.#i.textContent=this.hint||"",this.#i.hidden=!this.hint||!!this.error),this.#a(),this.#m()}#a(){if(!this.#s)return;let t=this.error;this.#s.textContent=t||"",this.#s.hidden=!t}#o=()=>{this.#a(),this.#m()};#l=null;#c(){let t=this.#g();t!==this.#l&&(this.#h(),t&&(this.#l=t,t.addEventListener("invalid",this.#o,!0),t.addEventListener("change",this.#o),t.addEventListener("input",this.#o)))}#h(){let t=this.#l;t&&(t.removeEventListener("invalid",this.#o,!0),t.removeEventListener("change",this.#o),t.removeEventListener("input",this.#o),this.#l=null)}#u(){if(this.#t=this.querySelector(":scope > [data-field-label]"),!this.#t){let t=document.createElement("label");t.setAttribute("slot","label"),t.setAttribute("data-field-label",""),t.appendChild(document.createTextNode(this.label||"")),this.prepend(t),this.#t=t}if(this.#e=this.#t.querySelector("[data-field-required]"),!this.#e){let t=document.createElement("span");t.setAttribute("data-field-required",""),t.setAttribute("aria-hidden","true"),t.textContent="*",t.hidden=!0,this.#t.appendChild(t),this.#e=t}}#d(){if(this.#i=this.querySelector(":scope > [data-field-hint]"),this.#i)return;let t=document.createElement("div");t.setAttribute("slot","hint"),t.setAttribute("data-field-hint",""),t.setAttribute("id",s.#S("hint")),t.hidden=!0,this.appendChild(t),this.#i=t}#f(){if(this.#s=this.querySelector(":scope > [data-field-error]"),this.#s)return;let t=document.createElement("div");t.setAttribute("slot","error"),t.setAttribute("data-field-error",""),t.setAttribute("id",s.#S("err")),t.setAttribute("role","alert"),t.hidden=!0,this.appendChild(t),this.#s=t}#p(){if(!this.#t)return;let t=this.#g();if(!t){this.#t.removeAttribute("for");return}t.id||(t.id=s.#x()),this.#t.setAttribute("for",t.id)}#m(){let t=this.#g();if(!t)return;let e=new Set;this.#i&&!this.#i.hidden&&e.add(this.#i.id),this.#s&&!this.#s.hidden&&e.add(this.#s.id);let r=[...(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(n=>n&&!n.startsWith("field-hint-")&&!n.startsWith("field-err-")),...e].join(" ").trim();r?t.setAttribute("aria-describedby",r):t.removeAttribute("aria-describedby")}#g(){let t=null,e=null;for(let i of this.children)if(!i.hasAttribute("slot")){if(t===null&&(t=i),s.#y.has(i.localName))return i;e===null&&this.#O(i)&&(e=i)}return e??t}static#y=new Set(["input-ui","textarea-ui","select-ui","combobox-ui","search-ui","check-ui","radio-ui","switch-ui","slider-ui","range-ui","otp-input-ui","tags-input-ui","chat-input-ui","autocomplete-input-ui","datetime-picker-ui","date-range-picker-ui","calendar-picker-ui","color-picker-ui","upload-ui","rating-ui","segmented-ui","input","textarea","select"]);#O(t){let e='input, textarea, select, button, [contenteditable], [tabindex]:not([tabindex="-1"])';return t.matches?.(e)?t:t.querySelector?.(e)??null}static#b=0;static#x(){return`field-ctl-${++s.#b}`}static#v=0;static#S(t){return`field-${t}-${++s.#v}`}};S("field-ui",ln);C();var hn=class extends x{static properties={inline:{type:Boolean,default:!1,reflect:!0},columns:{type:Number,default:6,reflect:!0}};static template=()=>null;#t=null;connected(){this.#e(),this.#t=new MutationObserver(t=>{for(let e of t)if(e.type==="childList"&&(this.#i(e.addedNodes)||this.#i(e.removedNodes))){this.#e();return}}),this.#t.observe(this,{childList:!0})}disconnected(){this.#t?.disconnect(),this.#t=null}render(){this.#e()}#e(){let t=this.hasAttribute("inline");for(let e of this.children)e.localName==="field-ui"&&(t?e.hasAttribute("inline")||e.setAttribute("inline",""):e.hasAttribute("inline")&&e.removeAttribute("inline"))}#i(t){for(let e of t)if(e.nodeType===1&&e.localName==="field-ui")return!0;return!1}};S("fields-ui",hn);C();var gy=0,La=class extends x{static properties={label:{type:String,default:"",reflect:!0},value:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},hint:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;connected(){this.setAttribute("role","group"),this.#t=this.querySelector(':scope > [slot="label"]'),this.#t||(this.#t=document.createElement("span"),this.#t.setAttribute("slot","label"),this.insertBefore(this.#t,this.firstChild)),this.#t.id||(this.#t.id=`display-field-label-${++gy}`),this.#e=this.querySelector(':scope > [slot="value"]'),this.#i=this.querySelector(':scope > [slot="hint"]'),this.#s=this.querySelector(':scope > icon-ui[slot="icon"]')}render(){if(!this.#t)return;this.label?(this.#t.textContent=this.label,this.#t.hidden=!1,this.setAttribute("aria-labelledby",this.#t.id)):(this.#t.hidden=!0,this.removeAttribute("aria-labelledby")),this.querySelector(":scope > :not([slot])")?this.#e&&(this.#e.remove(),this.#e=null):(this.#e||(this.#e=document.createElement("span"),this.#e.setAttribute("slot","value"),this.appendChild(this.#e)),this.#e.textContent=this.value),this.hint?(this.#i||(this.#i=document.createElement("span"),this.#i.setAttribute("slot","hint"),this.#i.id=`display-field-hint-${++gy}`,this.appendChild(this.#i)),this.#i.textContent=this.hint,this.setAttribute("aria-describedby",this.#i.id)):this.#i&&(this.#i.remove(),this.#i=null,this.removeAttribute("aria-describedby")),this.icon?(this.#s||(this.#s=document.createElement("icon-ui"),this.#s.setAttribute("slot","icon"),this.#s.setAttribute("aria-hidden","true"),this.appendChild(this.#s)),this.#s.setAttribute("name",this.icon)):this.#s&&(this.#s.remove(),this.#s=null)}disconnected(){this.#t=null,this.#e=null,this.#i=null,this.#s=null}};S("display-field-ui",La);C();var cn=class extends x{static properties={justify:{type:String,default:"start",reflect:!0},align:{type:String,default:"center",reflect:!0},gap:{type:String,default:"md",reflect:!0},grow:{type:Boolean,default:!1,reflect:!0},wrap:{type:Boolean,default:!1,reflect:!0},wrapAt:{type:String,default:"",reflect:!0,attribute:"wrap-at"},draggable:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=!1;connected(){this.draggable&&!this.#t&&(this.addTrait(Wr),this.#t=!0)}updated(t){t.has("draggable")&&this.draggable&&!this.#t&&(this.addTrait(Wr),this.#t=!0)}render(){let t=this.gap,e=this.align,i=this.justify,r=this.wrapAt,o=t?.includes("@")||e?.includes("@")||i?.includes("@")||!!r?$e.value:"";if(t?.includes("@")?this.style.setProperty("--row-gap",UC(Bt(t,o))):this.style.removeProperty("--row-gap"),e?.includes("@")?this.style.setProperty("--row-align",FC(Bt(e,o))):this.style.removeProperty("--row-align"),i?.includes("@")?this.style.setProperty("--row-justify",YC(Bt(i,o))):this.style.removeProperty("--row-justify"),r){let a=us.indexOf(o),l=us.indexOf(r);this.style.flexWrap=l!==-1&&a>=l?"wrap":""}else this.style.flexWrap=""}},VC={start:"flex-start",end:"flex-end",center:"center",stretch:"stretch",baseline:"baseline"},WC={start:"flex-start",end:"flex-end",center:"center",between:"space-between","space-between":"space-between","space-around":"space-around"};function UC(s){return!s||s==="0"?"0":/^\d+$/.test(s)?`var(--a-space-${s})`:`var(--a-gap-${s})`}function FC(s){return VC[s]??s}function YC(s){return WC[s]??s}S("row-ui",cn);C();var un=class extends x{static properties={columns:{type:String,default:"3",reflect:!0},gap:{type:String,default:"md",reflect:!0},columnGap:{type:String,default:"",reflect:!0,attribute:"column-gap"},rowGap:{type:String,default:"",reflect:!0,attribute:"row-gap"},minColumnWidth:{type:String,default:"",reflect:!0,attribute:"min-column-width"}};static template=()=>null;render(){let t=$e.value,e=this.columns;if(e?.includes("@")){let r=Bt(e,t);this.style.gridTemplateColumns=this.#t(r),this.style.gridAutoFlow=r?"row":"",this.style.gridAutoColumns=r?"auto":""}else this.style.gridTemplateColumns="",this.style.gridAutoFlow="",this.style.gridAutoColumns="";this.minColumnWidth?this.style.setProperty("--grid-min-col",this.minColumnWidth):this.style.removeProperty("--grid-min-col");let i=this.gap;if(i?.includes("@")){let r=Bt(i,t),n=this.#e(r);this.style.columnGap=n,this.style.rowGap=n}else this.style.columnGap="",this.style.rowGap=""}#t(t){return t?/^\d+$/.test(t)?`repeat(${t}, 1fr)`:t==="auto-fill"?"repeat(auto-fill, minmax(var(--grid-min-col, 12rem), 1fr))":t==="auto-fit"?"repeat(auto-fit, minmax(var(--grid-min-col, 12rem), 1fr))":t:""}#e(t){return!t||t==="0"?"0":/^\d+$/.test(t)?`var(--a-space-${t})`:`var(--a-gap-${t})`}};S("grid-ui",un);C();var dn=class extends x{static properties={align:{type:String,default:"center",reflect:!0}};static template=()=>null};S("stack-ui",dn);C();var fn=class extends x{static properties={};static template=()=>null};S("frame-ui",fn);C();function ds(s,t,e=5){let r=(t-s||1)/e,n=Math.pow(10,Math.floor(Math.log10(r))),o=r/n,l=(o<=1.5?1:o<=3?2:o<=7?5:10)*n,h=Math.floor(s/l)*l,c=Math.ceil(t/l)*l,u=[];for(let d=h;d<=c+l*.5;d+=l)u.push(+d.toFixed(10));return u}function by(s){if(s==null)return"";let t=+s;return Number.isNaN(t)?String(s):Math.abs(t)>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":Math.abs(t)>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":Number.isInteger(t)?String(t):t.toFixed(1)}function ne(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function wt({label:s,value:t,pct:e,series:i}){let r="";return s!=null&&(r+=` data-tip-label="${ne(String(s))}"`),t!=null&&(r+=` data-tip-value="${t}"`),e!=null&&(r+=` data-tip-pct="${e}"`),i!=null&&(r+=` data-tip-series="${ne(String(i))}"`),r}function oe(s,t,e){return s+t*Math.cos(e)}function ae(s,t,e){return s+t*Math.sin(e)}function HC(s,t,e,i,r){let n=oe(s,e,i),o=ae(t,e,i),a=oe(s,e,r),l=ae(t,e,r),h=r-i>Math.PI?1:0;return`M ${s} ${t} L ${n} ${o} A ${e} ${e} 0 ${h} 1 ${a} ${l} Z`}function Kd(s,t,e,i,r,n,o=0){let a=(e-i)/2,l=n-r,h=Math.max(0,Math.min(o,a)),c=()=>{let dt=oe(s,e,r),ot=ae(t,e,r),Ot=oe(s,e,n),St=ae(t,e,n),yt=oe(s,i,n),Ct=ae(t,i,n),Lt=oe(s,i,r),Yt=ae(t,i,r),os=l>Math.PI?1:0;return`M ${dt} ${ot} A ${e} ${e} 0 ${os} 1 ${Ot} ${St} L ${yt} ${Ct} A ${i} ${i} 0 ${os} 0 ${Lt} ${Yt} Z`};if(h<=0)return c();let u=h/e,d=h/i;if(l<=(u+d)*1.05)return c();let f=r+u,p=n-u,m=r+d,b=n-d,g=p-f>Math.PI?1:0,y=oe(s,e,f),v=ae(t,e,f),w=oe(s,e,p),k=ae(t,e,p),E=oe(s,i,b),A=ae(t,i,b),$=oe(s,i,m),T=ae(t,i,m),Q=oe(s,e-h,r),D=ae(t,e-h,r),R=oe(s,i+h,r),_=ae(t,i+h,r),V=oe(s,e-h,n),U=ae(t,e-h,n),J=oe(s,i+h,n),rt=ae(t,i+h,n);return`M ${y} ${v} A ${e} ${e} 0 ${g} 1 ${w} ${k} A ${h} ${h} 0 0 1 ${V} ${U} L ${J} ${rt} A ${h} ${h} 0 0 1 ${E} ${A} A ${i} ${i} 0 ${g} 0 ${$} ${T} A ${h} ${h} 0 0 1 ${R} ${_} L ${Q} ${D} A ${h} ${h} 0 0 1 ${y} ${v} Z`}function Ma(s,t=.4){if(s.length<2)return"";if(t<=0)return"M"+s.map(r=>`${r.x},${r.y}`).join(" L");let e=s.length,i=`M${s[0].x},${s[0].y}`;for(let r=0;r<e-1;r++){let n=s[Math.max(r-1,0)],o=s[r],a=s[r+1],l=s[Math.min(r+2,e-1)],h=o.x+(a.x-n.x)*t/3,c=o.y+(a.y-n.y)*t/3,u=a.x-(l.x-o.x)*t/3,d=a.y-(l.y-o.y)*t/3;i+=` C${h},${c} ${u},${d} ${a.x},${a.y}`}return i}function Jd(s,t,e=.4){let i=Ma(s,e),r=s[s.length-1],n=s[0];return`${i} L${r.x},${t} L${n.x},${t} Z`}function $h(s,t,e,i,r=0){if(i<=0||e<=0)return"";let n=Math.max(0,Math.min(r,e/2,i));return n===0?`M${s},${t} H${s+e} V${t+i} H${s} Z`:`M${s},${t+i} V${t+n} Q${s},${t} ${s+n},${t} H${s+e-n} Q${s+e},${t} ${s+e},${t+n} V${t+i} Z`}var GC={std:{ratio:4/3}},pn=class extends x{static properties={type:{type:String,default:"bar",reflect:!0},x:{type:String,default:"",reflect:!0},y:{type:String,default:"",reflect:!0},hideAverage:{type:Boolean,default:!1,reflect:!0,attribute:"hide-average"},color:{type:String,default:"",reflect:!0},hideGrid:{type:Boolean,default:!1,reflect:!0,attribute:"hide-grid"},hideValues:{type:Boolean,default:!1,reflect:!0,attribute:"hide-values"},radius:{type:Number,default:null,reflect:!0},smooth:{type:Number,default:.4,reflect:!0},size:{type:String,default:"",reflect:!0},format:{type:String,default:"abbr",reflect:!0},loading:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=[];#e=!1;#i=null;#s=null;#r=0;#n=0;#a=new Set;#o(){if(this.radius!=null)return this.radius;let t=getComputedStyle(this).getPropertyValue("--a-radius").trim(),e=parseFloat(t);return Number.isFinite(e)&&e>0?e:6}set data(t){!Array.isArray(t)&&!this.#e&&(this.#e=!0,console.warn(`[chart-ui] .data must be an array of plain objects \u2014 received ${t===null?"null":typeof t}. The {labels, datasets} envelope is the Chart.js API, not the chart-ui API.
197
197
  Correct shape for <chart-ui x="label" y="value">:
198
- [{ label: "Jan", value: 100 }, { label: "Feb", value: 200 }]`)),this.#t=Array.isArray(t)?t:[],this.#c(),this.#f()}get data(){return this.#t}#l=!1;#c(){if(this.#l)return;let t=this.#h();this.#t.length>t&&(console.warn(`[chart-ui] .data has ${this.#t.length} rows which exceeds the recommended perf budget of ${t}. Consider downsampling at the data layer (e.g., LTTB, bucket aggregation). Override the budget via CSS: chart-ui { --chart-perf-budget: 10000 }.`),this.#l=!0)}#h(){let t=getComputedStyle(this).getPropertyValue("--chart-perf-budget").trim(),e=parseInt(t,10);return Number.isFinite(e)&&e>0?e:5e3}connected(){if(this.hasAttribute("role")||this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",`${this.type} chart`),this.#t.length===0&&this.hasAttribute("data"))try{let t=JSON.parse(this.getAttribute("data"));Array.isArray(t)&&(this.data=t)}catch{}document.addEventListener("toggle",this.#x),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("keydown",this.#Q),this.addEventListener("focus",this.#P),this.addEventListener("blur",this.#D),this.addEventListener("pointerover",this.#I),this.addEventListener("pointermove",this.#T),this.addEventListener("pointerleave",this.#X),this.addEventListener("pointerdown",this.#q),this.addEventListener("click",this.#j),this.#i=new ResizeObserver(t=>{let{inlineSize:e,blockSize:i}=t[0].contentBoxSize[0];if(!this.#t.length)return;let r=Math.round(e),n=Math.round(i);r===this.#r&&(!this.hasAttribute("resize")||n===this.#n)||(this.#r=r,this.#n=n,!this.#s&&(this.#s=requestAnimationFrame(()=>{this.#s=null,this.#f()})))}),this.#i.observe(this)}render(){if(this.loading){let e=this.querySelector("skeleton-ui[data-chart-skel]");e||(e=document.createElement("skeleton-ui"),e.setAttribute("data-chart-skel",""),e.style.cssText="display:block;width:100%;height:100%;min-height:4rem;border-radius:var(--a-radius-md)"),this.innerHTML="",this.appendChild(e);return}let t=this.querySelector("skeleton-ui[data-chart-skel]");t&&t.remove(),this.#f()}#u(){let t=this.clientWidth||300,e=this.clientHeight||0,i=GC.std,r=this.#t.length||1,n=Math.max(t,120),a=(this.hasAttribute("resize")||this.style.height)&&e>40?e:Math.round(n/i.ratio),l=parseFloat(getComputedStyle(this).maxHeight);isFinite(l)&&l>0&&a>l&&(a=Math.round(l));let h=Math.min(n,a),c=this.size||(h<150?"sm":h<300?"md":"lg"),u=c==="sm"?9:c==="md"?10:11,d=u,f=c==="sm"?8:c==="md"?9:10,p=this.hideGrid,m=p?0:u*3.2,b=!!this.x,g={top:p?2:u*1.6,right:p?2:u*1.2,bottom:!b||p?2:u*2.2,left:m},y=n-g.left-g.right,v=Math.max(4,y/r*.6);return{width:n,height:a,pad:g,fontSize:u,labelSize:d,valueSize:f,barMinW:v,plotW:y,n:r,sizeClass:c}}#d=null;#f(){if(!this.isConnected)return;let t=this.querySelector(':scope > [slot="empty"]');if(t&&!this.#d&&(this.#d=t.cloneNode(!0)),this.innerHTML="",this.#d&&this.appendChild(this.#d.cloneNode(!0)),!this.#t.length){this.removeAttribute("data-has-data");return}this.setAttribute("data-has-data",""),this.#p();let e=document.createElement("div");this.type==="sparkline"&&e.setAttribute("data-sparkline",""),this.appendChild(e);let i=document.createElementNS("http://www.w3.org/2000/svg","svg");e.appendChild(i);let r="",n="";switch(this.type){case"bar":({svg:r,viewBox:n}=this.#H());break;case"line":({svg:r,viewBox:n}=this.#K());break;case"pie":({svg:r,viewBox:n}=this.#tt());break;case"donut":({svg:r,viewBox:n}=this.#J());break;case"radar":({svg:r,viewBox:n}=this.#et());break;case"sparkline":({svg:r,viewBox:n}=this.#it());break;case"segments":({svg:r,viewBox:n}=this.#ht());break;case"area":({svg:r,viewBox:n}=this.#st());break;case"scatter":({svg:r,viewBox:n}=this.#rt());break;case"radial-bar":({svg:r,viewBox:n}=this.#G());break;case"gauge":({svg:r,viewBox:n}=this.#U());break;case"funnel":({svg:r,viewBox:n}=this.#nt());break;case"treemap":({svg:r,viewBox:n}=this.#ot());break;case"sankey":({svg:r,viewBox:n}=this.#at());break;case"composed":({svg:r,viewBox:n}=this.#lt());break;case"stacked-bar":({svg:r,viewBox:n}=this.#ct());break;case"grouped-bar":({svg:r,viewBox:n}=this.#ut());break;case"multi-line":({svg:r,viewBox:n}=this.#dt());break;default:({svg:r,viewBox:n}=this.#H());break}if(i.setAttribute("viewBox",n),i.setAttribute("preserveAspectRatio","xMidYMid meet"),i.innerHTML=r,["pie","donut","stacked-bar","grouped-bar","multi-line","radial-bar"].includes(this.type)&&!this.#O()){let o=this.#ft();o&&this.appendChild(o)}this.dispatchEvent(new CustomEvent("legend-update",{bubbles:!0}))}#p(){let t=this.#N();for(let e=0;e<t.length;e++){let i=e%10;this.style.setProperty(`--color-${t[e]}`,`var(--chart-${i})`)}}#m(t,e){return e?` data-slice="${t}" data-series-key="${ne(e)}" style="fill: var(--color-${e}, var(--chart-${t}))"`:` data-slice="${t}"`}#g(t,e){return e?` data-slice="${t}" data-series-key="${ne(e)}" style="stroke: var(--color-${e}, var(--chart-${t}))"`:` data-slice="${t}"`}#y=null;disconnected(){this.#i?.disconnect(),this.#i=null,this.#s&&(cancelAnimationFrame(this.#s),this.#s=null),document.removeEventListener("toggle",this.#x),document.removeEventListener("pointerdown",this.#M),this.removeEventListener("keydown",this.#Q),this.removeEventListener("focus",this.#P),this.removeEventListener("blur",this.#D),this.removeEventListener("pointerover",this.#I),this.removeEventListener("pointermove",this.#T),this.removeEventListener("pointerleave",this.#X),this.removeEventListener("pointerdown",this.#q),this.removeEventListener("click",this.#j),this.#W()}#O(){return this.id?!!document.querySelector(`chart-legend-ui[for="${CSS.escape(this.id)}"]`):!1}#b(){return this.id?!!document.querySelector(`tooltip-ui[follows="pointer"][for="${CSS.escape(this.id)}"]`):!1}#x=t=>{let e=t.target?.closest?.("chart-legend-ui[for]");if(!e||e.getAttribute("for")!==this.id)return;let{key:i,active:r}=t.detail||{};i&&(r?this.#a.delete(i):this.#a.add(i),this.#f())};#v(t){return!!t&&this.#a.has(t)}#S(t){if(t==null||t==="")return"";let e=+t;if(!Number.isFinite(e))return String(t);switch(this.format||"abbr"){case"decimal":return e.toFixed(2);case"percent":return`${(e*100).toFixed(1)}%`;case"currency":{let r=getComputedStyle(this).getPropertyValue("--chart-currency-prefix").trim();return(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),`${r||"$"}${by(e)}`}default:return by(e)}}#w=-1;#k(){return Array.from(this.querySelectorAll("[data-tip-label], [data-tip-value]"))}#A(t){let e=this.#k();if(!e.length){this.#$();return}this.#w=Math.max(0,Math.min(t,e.length-1)),this.#E(),this.#R()}#E(){let t=this.#k();for(let i of t)i.removeAttribute("data-a11y-focus");let e=t[this.#w];if(!e)return this.removeAttribute("data-a11y-focused");e.setAttribute("data-a11y-focus",""),this.setAttribute("data-a11y-focused","")}#$(){this.#w=-1;for(let t of this.#k())t.removeAttribute("data-a11y-focus");this.removeAttribute("data-a11y-focused")}#R(){let t=this.#k()[this.#w];if(!t)return;let e=t.getBoundingClientRect(),i={clientX:e.left+e.width/2,clientY:e.top+e.height/2};this.#Z(t,i)}#C(){let t=this.#k()[this.#w];if(!t)return;let e=t.getBoundingClientRect(),i={clientX:e.left+e.width/2,clientY:e.top+e.height/2};this.dispatchEvent(new CustomEvent("chart-select",{bubbles:!0,detail:this.#_(t,i)}))}#P=()=>{this.#w===-1&&this.#A(0)};#D=()=>{this.#$(),this.#L&&this.#B()};#Q=t=>{let e=this.#k();if(e.length)switch(t.key){case"ArrowRight":case"ArrowDown":t.preventDefault(),this.#A(this.#w+1);break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.#A(Math.max(0,this.#w-1));break;case"Home":t.preventDefault(),this.#A(0);break;case"End":t.preventDefault(),this.#A(e.length-1);break;case"Enter":case" ":t.preventDefault(),this.#C();break;case"Escape":t.preventDefault(),this.#$(),this.#L&&this.#B();break}};#L=null;#I=t=>{if(t.pointerType==="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");e&&(this.#Y(e,t),this.#Z(e,t))};#T=t=>{if(t.pointerType==="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");if(!e)return this.#L&&this.#B(),this.#W();this.#Y(e,t),e!==this.#L&&this.#Z(e,t)};#X=t=>{t&&t.pointerType==="touch"||(this.#W(),this.#L&&this.#B())};#q=t=>{if(t.pointerType!=="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");if(!e)return this.#L&&this.#B(),this.#W();this.#Y(e,t),e!==this.#L&&this.#Z(e,t),document.addEventListener("pointerdown",this.#M)};#M=t=>{t.pointerType==="touch"&&(this.contains(t.target)||(this.#W(),this.#L&&this.#B(),document.removeEventListener("pointerdown",this.#M)))};#j=t=>{let e=t.target.closest("[data-tip-label], [data-tip-value]");e&&this.dispatchEvent(new CustomEvent("chart-select",{bubbles:!0,detail:this.#_(e,t)}))};#Z(t,e){this.#L=t,this.dispatchEvent(new CustomEvent("chart-hover",{bubbles:!0,detail:this.#_(t,e)}))}#B(){this.#L=null,this.dispatchEvent(new CustomEvent("chart-leave",{bubbles:!0}))}#_(t,e){let{tipLabel:i,tipValue:r,tipPct:n,tipSeries:o}=t.dataset,a=t.dataset.slice!=null?Number(t.dataset.slice):null,l=r!=null?Number(r):null,h=n!=null?Number(n):null,c=i??null,u=o??null,d=this.#V(c,u)??[{series:u,label:c,value:Number.isFinite(l)?l:r??null,pct:Number.isFinite(h)?h:null,slot:a}];return{label:c,value:Number.isFinite(l)?l:r??null,pct:Number.isFinite(h)?h:null,series:u,slot:a,payload:d,pointerX:e?.clientX??null,pointerY:e?.clientY??null}}#V(t,e){if(t==null)return null;let i=this.x,r=this.#N();if(!i||r.length===0)return null;let n=this.#t.find(l=>String(l[i]??"")===String(t));if(!n)return null;let o=r.filter(l=>!this.#v(l)),a=e||(o.length===1?o[0]:null);return o.map((l,h)=>{let c=+(n[l]??0);return{series:l,label:t,value:Number.isFinite(c)?c:null,pct:null,slot:h%10,hovered:l===a}})}#Y(t,e){if(this.#b())return;let{tipLabel:i,tipValue:r,tipPct:n,tipSeries:o}=t.dataset;if(!this.#y){let b=document.createElement("div");b.setAttribute("popover","manual"),b.setAttribute("role","tooltip"),b.classList.add("chart-tooltip-popup"),document.body.appendChild(b),this.#y=b}let a=[];if(o&&a.push(`<span data-tip-role="series">${ne(o)}</span>`),i&&a.push(`<span data-tip-role="label">${ne(i)}</span>`),r!==void 0){let b=n!==void 0?` <span data-tip-role="pct">(${n}%)</span>`:"";a.push(`<span data-tip-role="value">${this.#S(r)}${b}</span>`)}this.#y.innerHTML=a.join("");try{this.#y.showPopover()}catch{}let l=12,h=8,{clientX:c,clientY:u}=e,d=this.#y.offsetWidth||0,f=this.#y.offsetHeight||0,p=c-d/2,m=u-f-l;p<h&&(p=h),p+d>window.innerWidth-h&&(p=window.innerWidth-d-h),m<h&&(m=u+l),this.#y.style.left=`${p}px`,this.#y.style.top=`${m}px`}#W(){if(this.#y){try{this.#y.hidePopover()}catch{}this.#y.remove(),this.#y=null}}#N(){return this.y?this.y.split(",").map(t=>t.trim()).filter(Boolean):[]}#F(t,e,i,r,n,o){let a=n,l=o?.fontSize||10,h=o?.labelSize||l,c="",u=i;if(o?.sizeClass==="sm"&&i.length>4&&(u=i.filter((d,f)=>f%2===0||f===i.length-1)),!this.hideGrid){let f=i[i.length-1]-i[0]||1;for(let p of u){let m=a.top+(e-a.top-a.bottom)*(1-(p-i[0])/f);c+=`<line data-grid x1="${a.left}" y1="${m}" x2="${t-a.right}" y2="${m}"/>`}for(let p of u){let m=a.top+(e-a.top-a.bottom)*(1-(p-i[0])/f);c+=`<text data-y-label x="${a.left-4}" y="${m+l*.35}" text-anchor="end" font-size="${l}">${this.#S(p)}</text>`}if(r){let m=(t-a.left-a.right)/r.length,g=r.reduce((w,k)=>Math.max(w,String(k).length),1)*h*.6+h*.75,y=Math.max(1,Math.ceil(g/m)),v=r.length-1;for(let w=0;w<r.length;w++){if(w%y!==0&&w!==v||w!==v&&v-w<y)continue;let k=a.left+m*w+m/2;c+=`<text data-x-label x="${k}" y="${e-l*.5}" text-anchor="middle" font-size="${h}">${ne(r[w])}</text>`}}}return c}#H(){let t=this.#u(),e=this.#t,i=this.#N()[0]||this.y,r=e.map(v=>+(v[i]??0)),n=e.map(v=>v[this.x]??""),o=ds(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/e.length,p=f*.6,m=(f-p)/2,b=this.#F(l,h,o,n,c,t),g=!this.hideValues&&t.sizeClass!=="sm",y=!this.hideAverage&&r.length>1&&t.sizeClass!=="sm"&&!this.hideGrid;for(let v=0;v<e.length;v++){let w=r[v],k=a?w/a*u:0,E=c.left+f*v+m,A=c.top+u-k;b+=`<path data-bar${wt({label:n[v],value:w})} d="${$h(E,A,p,k,this.#o())}"/>`,g&&(b+=`<text data-value x="${E+p/2}" y="${A-4}" text-anchor="middle" font-size="${t.valueSize}">${this.#S(w)}</text>`)}if(y){let v=r.reduce((k,E)=>k+E,0)/r.length,w=c.top+u-(a?v/a*u:0);b+=`<line data-avg x1="${c.left}" y1="${w}" x2="${l-c.right}" y2="${w}"/>`,b+=`<text data-avg-label x="${l-c.right+2}" y="${w+3}" text-anchor="start" font-size="${t.valueSize}">${this.#S(v)}</text>`,b+=`<line data-hit${wt({label:"Average",value:v})} x1="${c.left}" y1="${w}" x2="${l-c.right}" y2="${w}" stroke="transparent" stroke-width="12"/>`}return{svg:b,viewBox:`0 0 ${l} ${h}`}}#K(){let t=this.#u(),e=this.#t,i=this.#N()[0]||this.y,r=e.map(A=>+(A[i]??0)),n=e.map(A=>A[this.x]??""),o=ds(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(e.length-1,1),p=this.#F(l,h,o,n,c,t),m=r.map((A,$)=>{let T=c.left+f*$,Q=c.top+u-(a?A/a*u:0);return{x:T,y:Q,v:A,label:n[$]}}),b=c.top+u,g=Math.max(0,Math.min(1,this.smooth));p+=`<path data-area d="${Jd(m,b,g)}"/>`,p+=`<path data-line d="${Ma(m,g)}"/>`;let y=t.sizeClass==="sm",v=y?1.5:3,w=Math.max(v,10),k=!this.hideValues&&!y,E=!this.hideAverage&&r.length>1&&!y&&!this.hideGrid;for(let A of m)p+=`<circle data-dot cx="${A.x}" cy="${A.y}" r="${v}"/>`,p+=`<circle data-hit${wt({label:A.label,value:A.v})} cx="${A.x}" cy="${A.y}" r="${w}" fill="transparent"/>`,k&&(p+=`<text data-value x="${A.x}" y="${A.y-8}" text-anchor="middle" font-size="${t.valueSize}">${this.#S(A.v)}</text>`);if(E){let A=r.reduce((T,Q)=>T+Q,0)/r.length,$=c.top+u-(a?A/a*u:0);p+=`<line data-avg x1="${c.left}" y1="${$}" x2="${l-c.right}" y2="${$}"/>`,p+=`<text data-avg-label x="${l-c.right+2}" y="${$+3}" text-anchor="start" font-size="${t.valueSize}">${this.#S(A)}</text>`,p+=`<line data-hit${wt({label:"Average",value:A})} x1="${c.left}" y1="${$}" x2="${l-c.right}" y2="${$}" stroke="transparent" stroke-width="12"/>`}return{svg:p,viewBox:`0 0 ${l} ${h}`}}#tt(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(p=>+(p[e]??0)),r=i.reduce((p,m)=>p+m,0)||1,n=t.map(p=>p[this.x]??""),o=this.#u(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.42),d="",f=-Math.PI/2;for(let p=0;p<i.length;p++){let m=i[p]/r*Math.PI*2;if(m===0)continue;let b=f+m,g=(i[p]/r*100).toFixed(1),y=` data-slice="${p%10}"${wt({label:n[p],value:i[p],pct:g})}`;Math.abs(m-Math.PI*2)<.001?d+=`<circle${y} cx="${h}" cy="${c}" r="${u}"/>`:d+=`<path${y} d="${HC(h,c,u,f,b)}"/>`,f=b}return this.#z=t.map((p,m)=>({label:n[m],value:i[m],pct:(i[m]/r*100).toFixed(1),slot:m%10})),{svg:d,viewBox:`0 0 ${a} ${l}`}}#J(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(g=>+(g[e]??0)),r=i.reduce((g,y)=>g+y,0)||1,n=t.map(g=>g[this.x]??""),o=this.#u(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.42),d=u*.72,f="",p=-Math.PI/2;for(let g=0;g<i.length;g++){let y=i[g]/r*Math.PI*2;if(y===0)continue;let v=p+y,w=(i[g]/r*100).toFixed(1),k=` data-slice="${g%10}"${wt({label:n[g],value:i[g],pct:w})}`;Math.abs(y-Math.PI*2)<.001?(f+=`<circle${k} cx="${h}" cy="${c}" r="${(u+d)/2}" fill="none" stroke-width="${u-d}" style="fill:none"/>`,f+=`<path${k} d="M ${h-u} ${c} A ${u} ${u} 0 1 1 ${h+u} ${c} A ${u} ${u} 0 1 1 ${h-u} ${c} Z M ${h-d} ${c} A ${d} ${d} 0 1 0 ${h+d} ${c} A ${d} ${d} 0 1 0 ${h-d} ${c} Z" fill-rule="evenodd"/>`):f+=`<path${k} d="${Kd(h,c,u,d,p,v,this.#o())}"/>`,p=v}let m=Math.max(14,Math.round(u*.32)),b=Math.max(9,Math.round(u*.16));return f+=`<text data-donut-total x="${h}" y="${c}" text-anchor="middle" dominant-baseline="central" font-size="${m}">${this.#S(r)}</text>`,f+=`<text data-donut-label x="${h}" y="${c+m}" text-anchor="middle" dominant-baseline="central" font-size="${b}">Total</text>`,this.#z=t.map((g,y)=>({label:n[y],value:i[y],pct:(i[y]/r*100).toFixed(1),slot:y%10})),{svg:f,viewBox:`0 0 ${a} ${l}`}}#et(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(k=>+(k[e]??0)),r=t.map(k=>k[this.x]??""),n=Math.max(...i)||1,o=t.length,a=this.#u(),{width:l,height:h,fontSize:c}=a,u=l/2,d=h/2,f=c*3.5,p=Math.max(40,Math.min(l,h)/2-f),m="",b=Math.PI*2/o;for(let k=1;k<=3;k++){let E=p*k/3,A="";for(let $=0;$<o;$++){let T=-Math.PI/2+b*$,Q=u+E*Math.cos(T),D=d+E*Math.sin(T);A+=($===0?"M":"L")+` ${Q} ${D}`}A+=" Z",m+=`<path data-grid d="${A}"/>`}for(let k=0;k<o;k++){let E=-Math.PI/2+b*k,A=u+p*Math.cos(E),$=d+p*Math.sin(E);m+=`<line data-grid x1="${u}" y1="${d}" x2="${A}" y2="${$}"/>`}let g="",y=[];for(let k=0;k<o;k++){let E=-Math.PI/2+b*k,A=i[k]/n*p,$=u+A*Math.cos(E),T=d+A*Math.sin(E);g+=(k===0?"M":"L")+` ${$} ${T}`,y.push({px:$,py:T})}g+=" Z",m+=`<path data-radar-fill d="${g}"/>`,m+=`<path data-radar-line d="${g}"/>`;let v=Math.max(c,10);for(let k=0;k<o;k++){let{px:E,py:A}=y[k];m+=`<circle data-hit${wt({label:r[k],value:i[k]})} cx="${E}" cy="${A}" r="${v}" fill="transparent"/>`}let w=c*1.3;for(let k=0;k<o;k++){let E=-Math.PI/2+b*k,A=u+(p+w)*Math.cos(E),$=d+(p+w)*Math.sin(E),T=Math.abs(Math.cos(E))<.1?"middle":Math.cos(E)>0?"start":"end";m+=`<text data-x-label x="${A}" y="${$}" text-anchor="${T}" dominant-baseline="central" font-size="${c}">${ne(r[k])}</text>`}return{svg:m,viewBox:`0 0 ${l} ${h}`}}#it(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(y=>+(y[e]??0)),r=Math.max(...i)||1,n=Math.min(...i),o=r-n||1,a=this.clientWidth||120,l=this.clientHeight||32,h=Math.max(40,a),c=Math.max(16,l),u=h/Math.max(i.length-1,1),d=Math.max(2,Math.min(6,c*.1)),f=t.map(y=>y[this.x]??""),p=i.map((y,v)=>({x:u*v,y:c-(y-n)/o*(c-d*2)-d,v:y,label:f[v]})),m=Math.max(0,Math.min(1,this.smooth)),b="";b+=`<path data-area d="${Jd(p,c,m)}"/>`,b+=`<path data-line d="${Ma(p,m)}"/>`;let g=Math.max(u/2,6);for(let y of p)b+=`<circle data-hit${wt({label:y.label,value:y.v})} cx="${y.x}" cy="${y.y}" r="${g}" fill="transparent"/>`;return{svg:b,viewBox:`0 0 ${h} ${c}`}}#st(){return this.#K()}#rt(){let t=this.#u(),e=this.#t,i=this.#N()[0]||this.y,r=e.map(g=>+(g[i]??0)),n=e.map(g=>g[this.x]??""),o=ds(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(e.length-1,1),p=this.#F(l,h,o,n,c,t),m=t.sizeClass==="sm"?2.5:4,b=Math.max(m*2,10);for(let g=0;g<r.length;g++){let y=c.left+f*g,v=c.top+u-(a?r[g]/a*u:0);p+=`<circle data-dot data-scatter cx="${y}" cy="${v}" r="${m}"/>`,p+=`<circle data-hit${wt({label:n[g],value:r[g]})} cx="${y}" cy="${v}" r="${b}" fill="transparent"/>`}return{svg:p,viewBox:`0 0 ${l} ${h}`}}#G(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(g=>+(g[e]??0)),r=t.map(g=>g[this.x]??""),n=Math.max(...i)||1,o=this.#u(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.45),d=u*.3,f=i.length||1,p=(u-d)/f,m=Math.min(2,p*.15),b="";for(let g=0;g<i.length;g++){let y=d+p*g+m/2,v=d+p*(g+1)-m/2,w=(y+v)/2,k=v-y,E=2*Math.PI*w,A=Math.max(0,Math.min(1,i[g]/n))*E;if(b+=`<circle data-radial-track cx="${h}" cy="${c}" r="${w}" fill="none" stroke-width="${k}"/>`,A<=0)continue;let $=(i[g]/n*100).toFixed(1),T=wt({label:r[g],value:i[g],pct:$}),Q=Math.abs(A-E)<.5,D=Q?"butt":"round",R=Q?`${E} 0`:`${A} ${E-A}`;b+=`<circle data-slice="${g%10}"${T} data-radial-bar cx="${h}" cy="${c}" r="${w}" fill="none" stroke-width="${k}" stroke-linecap="${D}" stroke-dasharray="${R}" transform="rotate(-90 ${h} ${c})"/>`}return this.#z=t.map((g,y)=>({label:r[y],key:r[y],value:i[y],pct:(i[y]/n*100).toFixed(1),slot:y%10})),{svg:b,viewBox:`0 0 ${a} ${l}`}}#U(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(w=>+(w[e]??0)),r=i.reduce((w,k)=>w+k,0)||1,n=i[0]??0,o=t[0]?.max!=null?+t[0].max:i.length===1?Math.max(n,1):r,a=Math.max(0,Math.min(1,n/o)),l=this.#u(),{width:h,height:c}=l,u=h/2,d=c*.68,f=Math.max(40,Math.min(h*.45,c*.6)),p=f*.72,m=(f-p)/2,b="";if(b+=`<path data-radial-track d="${Kd(u,d,f,p,Math.PI,2*Math.PI,m)}"/>`,a>0){let w=Math.PI+Math.PI*a,k=wt({label:t[0]?.[this.x]??"Value",value:n,pct:(a*100).toFixed(1)});b+=`<path data-slice="0"${k} data-gauge-fill d="${Kd(u,d,f,p,Math.PI,w,m)}"/>`}let g=Math.max(18,Math.round(f*.42)),y=Math.max(10,Math.round(f*.2)),v=d-f*.15;return b+=`<text data-gauge-value x="${u}" y="${v}" text-anchor="middle" dominant-baseline="central" font-size="${g}">${this.#S(n)}</text>`,o!==n&&(b+=`<text data-gauge-max x="${u}" y="${v+g*.8}" text-anchor="middle" dominant-baseline="central" font-size="${y}">of ${this.#S(o)}</text>`),{svg:b,viewBox:`0 0 ${h} ${c}`}}#nt(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(v=>+(v[e]??0)),r=t.map(v=>v[this.x]??""),n=i.length;if(n===0)return{svg:"",viewBox:"0 0 100 100"};let o=Math.max(...i)||1,a=this.#u(),{width:l,height:h}=a,c=a.fontSize,u=Math.max(l*.18,80),d=c*.8,f=l-u*2,m=(h-d*2)/n,b=Math.max(2,m*.08),g=l/2,y="";for(let v=0;v<n;v++){let w=i[v],k=v<n-1?i[v+1]:i[v],E=w/o*(f/2),A=k/o*(f/2),$=d+m*v+b/2,T=d+m*(v+1)-b/2,Q=(w/o*100).toFixed(1),D=wt({label:r[v],value:w,pct:Q}),R=`M ${g-E} ${$} L ${g+E} ${$} L ${g+A} ${T} L ${g-A} ${T} Z`;if(y+=`<path data-slice="${v%10}" data-funnel-stage${D} d="${R}"/>`,y+=`<text data-funnel-label x="${u-8}" y="${$+m/2}" text-anchor="end" dominant-baseline="central" font-size="${c}">${ne(r[v])}</text>`,y+=`<text data-funnel-value x="${l-u+8}" y="${$+m/2}" text-anchor="start" dominant-baseline="central" font-size="${c}">${this.#S(w)}</text>`,v>0){let _=(i[v]/i[0]*100).toFixed(0);y+=`<text data-funnel-drop x="${l-u+8}" y="${$+m/2+c*1.1}" text-anchor="start" dominant-baseline="central" font-size="${c*.85}">${_}%</text>`}}return this.#z=t.map((v,w)=>({label:r[w],value:i[w],pct:(i[w]/o*100).toFixed(1),slot:w%10})),{svg:y,viewBox:`0 0 ${l} ${h}`}}#ot(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(Q=>+(Q[e]??0)),r=t.map(Q=>Q[this.x]??""),n=i.length;if(n===0)return{svg:"",viewBox:"0 0 100 100"};let o=this.#u(),{width:a,height:l,fontSize:h}=o,c=i.reduce((Q,D)=>Q+D,0)||1,u=Array.from({length:n},(Q,D)=>D).sort((Q,D)=>i[D]-i[Q]),d=[],f=a*l,p=u.map(Q=>i[Q]/c*f),m=0,b=0,g=a,y=l,v=[],w=0,k=(Q,D)=>{if(Q.length===0)return 1/0;let R=Q.reduce((rt,dt)=>rt+dt,0),_=Math.max(...Q),V=Math.min(...Q),U=D*D,J=R*R;return Math.max(U*_/J,J/(U*V))},E=(Q,D,R,_,V,U)=>{let J=Q.reduce((St,yt)=>St+yt,0),rt=V>=U,dt=rt?J/V:U,ot=rt?V:J/U,Ot=0;for(let St=0;St<Q.length;St++){let yt=Q[St]/J,Ct=u[D+St];if(rt){let Lt=yt*V;d.push({i:Ct,x:R+Ot,y:_,w:Lt,h:dt}),Ot+=Lt}else{let Lt=yt*U;d.push({i:Ct,x:R,y:_+Ot,w:ot,h:Lt}),Ot+=Lt}}return rt?{x:R,y:_+dt,w:V,h:U-dt}:{x:R+ot,y:_,w:V-ot,h:U}},A=p.slice();for(;A.length>0;){v=[A[0]],w=p.length-A.length;let Q=Math.min(g,y),D=1;for(;D<A.length;){let _=v.concat(A[D]);if(k(_,Q)>k(v,Q))break;v=_,D++}let R=E(v,w,m,b,g,y);m=R.x,b=R.y,g=R.w,y=R.h,A=A.slice(v.length)}let $="",T=2;for(let Q of d){let D=(i[Q.i]/c*100).toFixed(1),R=wt({label:r[Q.i],value:i[Q.i],pct:D});$+=`<rect data-slice="${Q.i%10}" data-treemap-tile${R} x="${Q.x+T}" y="${Q.y+T}" width="${Math.max(0,Q.w-T*2)}" height="${Math.max(0,Q.h-T*2)}" rx="${this.#o()}"/>`;let _=Q.x+8,V=Q.w>h*4,U=V&&Q.h>h*2.5,J=V&&!U&&Q.h>h*1.2;if(U)$+=`<text data-treemap-label x="${_}" y="${Q.y+h+4}" font-size="${h}" dominant-baseline="hanging">${ne(r[Q.i])}</text>`,$+=`<text data-treemap-value x="${_}" y="${Q.y+h*2+6}" font-size="${h*.9}" dominant-baseline="hanging">${this.#S(i[Q.i])}</text>`;else if(J){let rt=Q.y+Q.h/2;$+=`<text data-treemap-label x="${_}" y="${rt}" font-size="${h}" dominant-baseline="central">${ne(r[Q.i])}</text>`}}return this.#z=t.map((Q,D)=>({label:r[D],value:i[D],pct:(i[D]/c*100).toFixed(1),slot:D%10})),{svg:$,viewBox:`0 0 ${a} ${l}`}}#at(){let t=this.#t;if(!t.length)return{svg:"",viewBox:"0 0 100 100"};let e=new Map,i=new Map;for(let w of t){let k=w.source??w.from??"",E=w.target??w.to??"",A=+(w.value??w.v??0);e.has(k)||e.set(k,{name:k,flow:0}),i.has(E)||i.set(E,{name:E,flow:0}),e.get(k).flow+=A,i.get(E).flow+=A}let r=this.#u(),{width:n,height:o,fontSize:a}=r,l=Math.max(8,n*.03),h=l+a*5,c=[...e.values()].reduce((w,k)=>w+k.flow,0)||1,u=[...i.values()].reduce((w,k)=>w+k.flow,0)||1,d=a*.6,f=[...e.values()],p=[...i.values()],m=o-d*(f.length-1),b=o-d*(p.length-1),g=0;for(let w of f){let k=w.flow/c*m;w.y0=g,w.y1=g+k,w.cursor=g,g+=k+d}g=0;for(let w of p){let k=w.flow/u*b;w.y0=g,w.y1=g+k,w.cursor=g,g+=k+d}let y="",v=Math.min(this.#o(),l/2);f.forEach((w,k)=>{y+=`<rect data-sankey-node data-slice="${k%10}" x="${h-l}" y="${w.y0}" width="${l}" height="${w.y1-w.y0}" rx="${v}"/>`,y+=`<text data-sankey-label x="${h-l-6}" y="${(w.y0+w.y1)/2}" text-anchor="end" dominant-baseline="central" font-size="${a}">${ne(w.name)}</text>`}),p.forEach((w,k)=>{y+=`<rect data-sankey-node data-slice="${(f.length+k)%10}" x="${n-h}" y="${w.y0}" width="${l}" height="${w.y1-w.y0}" rx="${v}"/>`,y+=`<text data-sankey-label x="${n-h+l+6}" y="${(w.y0+w.y1)/2}" text-anchor="start" dominant-baseline="central" font-size="${a}">${ne(w.name)}</text>`});for(let w of t){let k=e.get(w.source??w.from??""),E=i.get(w.target??w.to??"");if(!k||!E)continue;let A=+(w.value??w.v??0);if(A<=0)continue;let $=A/c*m,T=A/u*b,Q=k.cursor,D=Q+$,R=E.cursor,_=R+T;k.cursor+=$,E.cursor+=T;let V=h,U=n-h,J=(V+U)/2,rt=wt({label:`${k.name} \u2192 ${E.name}`,value:A}),dt=`M ${V} ${Q} C ${J} ${Q}, ${J} ${R}, ${U} ${R} L ${U} ${_} C ${J} ${_}, ${J} ${D}, ${V} ${D} Z`;y+=`<path data-sankey-link${rt} d="${dt}"/>`}return{svg:y,viewBox:`0 0 ${n} ${o}`}}#lt(){let t=this.#u(),e=this.#t,i=this.#N(),r=i[0]||"bar",n=i[1]||"line",o=e.map(E=>E[this.x]??""),a=e.map(E=>+(E[r]??0)),l=e.map(E=>+(E[n]??0)),h=[...a,...l],c=ds(0,Math.max(...h),5),u=c[c.length-1],{width:d,height:f,pad:p}=t,m=f-p.top-p.bottom,b=d-p.left-p.right,g=b/e.length,y=g*.6,v=(g-y)/2,w=b/Math.max(e.length-1,1),k=this.#F(d,f,c,o,p,t);if(!this.#v(r))for(let E=0;E<e.length;E++){let A=a[E],$=u?A/u*m:0,T=p.left+g*E+v,Q=p.top+m-$;k+=`<path${this.#m(0,r)}${wt({label:o[E],value:A,series:r})} d="${$h(T,Q,y,$,this.#o())}"/>`}if(!this.#v(n)){let E=l.map(($,T)=>({x:p.left+g*T+g/2,y:p.top+m-(u?$/u*m:0),v:$,label:o[T]})),A=Math.max(0,Math.min(1,this.smooth));k+=`<path data-line${this.#g(1,n)} d="${Ma(E,A)}"/>`;for(let $ of E)k+=`<circle data-dot${this.#m(1,n)} cx="${$.x}" cy="${$.y}" r="3"/>`,k+=`<circle data-hit${wt({label:$.label,value:$.v,series:n})} cx="${$.x}" cy="${$.y}" r="10" fill="transparent"/>`}return this.#z=[{label:r,key:r,slot:0},{label:n,key:n,slot:1}],{svg:k,viewBox:`0 0 ${d} ${f}`}}#ht(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(p=>+(p[e]??0)),r=i.reduce((p,m)=>p+m,0)||1,n=t.map(p=>p[this.x]??""),o=getComputedStyle(this),a=Math.max(40,this.clientWidth||200),l=24,h=Math.min(this.#o(),l/2),c=Math.max(0,parseFloat(o.getPropertyValue("--chart-segments-gap"))||2),u=[],d=0;for(let p=0;p<i.length;p++){let m=p===i.length-1?a:Math.round((d*r+i[p]*a)/r),b=p===i.length-1?a:i.slice(0,p+1).reduce((y,v)=>y+v,0)/r*a,g=p===0?0:i.slice(0,p).reduce((y,v)=>y+v,0)/r*a;u.push({x:g,w:Math.max(0,b-g)}),d=m}let f="";for(let p=0;p<u.length;p++){let{x:m,w:b}=u[p];if(b<=0)continue;let g=p===0,y=p===u.length-1,v=Math.max(0,b-(y?0:c)),w=(i[p]/r*100).toFixed(1),k=wt({label:n[p],value:i[p],pct:w}),E=`<title>${ne(n[p])}: ${i[p]} (${w}%)</title>`;if(g&&y||!g&&!y||h===0)f+=`<rect data-slice="${p%10}"${k} x="${m}" y="0" width="${v}" height="${l}"${(g||y)&&h?` rx="${h}"`:""}>${E}</rect>`;else{let A=h,$=m+v,T;g?T=`M ${m+A} 0 H ${$} V ${l} H ${m+A} A ${A} ${A} 0 0 1 ${m} ${l-A} V ${A} A ${A} ${A} 0 0 1 ${m+A} 0 Z`:T=`M ${m} 0 H ${$-A} A ${A} ${A} 0 0 1 ${$} ${A} V ${l-A} A ${A} ${A} 0 0 1 ${$-A} ${l} H ${m} Z`,f+=`<path data-slice="${p%10}"${k} d="${T}">${E}</path>`}}return this.#z=t.map((p,m)=>({label:n[m],value:i[m],pct:(i[m]/r*100).toFixed(1),slot:m%10})),{svg:f,viewBox:`0 0 ${a} ${l}`}}#ct(){let t=this.#t,e=this.#N(),i=t.map(g=>g[this.x]??""),r=t.map(g=>e.reduce((y,v)=>y+ +(g[v]??0),0)),n=ds(0,Math.max(...r),5),o=n[n.length-1],a=this.#u(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/t.length,p=f*.6,m=(f-p)/2,b=this.#F(l,h,n,i,c,a);for(let g=0;g<t.length;g++){let y=c.top+u,v=e.length;for(let w=0;w<v;w++){if(this.#v(e[w]))continue;let k=+(t[g][e[w]]??0),E=o?k/o*u:0;if(E<=0){y-=E;continue}y-=E;let A=c.left+f*g+m,$=y,T=E,Q=w===v-1,D=this.#o(),R=`${this.#m(w%10,e[w])}${wt({label:i[g],value:k,series:e[w]})}`;Q?b+=`<path${R} d="${$h(A,$,p,T,D)}"/>`:b+=`<rect${R} x="${A}" y="${$}" width="${p}" height="${T}"/>`}}return this.#z=e.map((g,y)=>({label:g,key:g,slot:y%10})),{svg:b,viewBox:`0 0 ${l} ${h}`}}#ut(){let t=this.#t,e=this.#N(),i=t.map(v=>v[this.x]??""),r=t.flatMap(v=>e.map(w=>+(v[w]??0))),n=ds(0,Math.max(...r),5),o=n[n.length-1],a=this.#u(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/t.length,p=3,m=f*.7,b=(m-p*(e.length-1))/e.length,g=(f-m)/2,y=this.#F(l,h,n,i,c,a);for(let v=0;v<t.length;v++)for(let w=0;w<e.length;w++){if(this.#v(e[w]))continue;let k=+(t[v][e[w]]??0),E=o?k/o*u:0,A=c.left+f*v+g+(b+p)*w,$=c.top+u-E;y+=`<path${this.#m(w%10,e[w])}${wt({label:i[v],value:k,series:e[w]})} d="${$h(A,$,b,E,this.#o())}"/>`,this.hideValues||(y+=`<text data-value x="${A+b/2}" y="${$-4}" text-anchor="middle" font-size="${a.valueSize}">${this.#S(k)}</text>`)}return this.#z=e.map((v,w)=>({label:v,key:v,slot:w%10})),{svg:y,viewBox:`0 0 ${l} ${h}`}}#dt(){let t=this.#t,e=this.#N(),i=t.map(m=>m[this.x]??""),r=t.flatMap(m=>e.map(b=>+(m[b]??0))),n=ds(0,Math.max(...r),5),o=n[n.length-1],a=this.#u(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(t.length-1,1),p=this.#F(l,h,n,i,c,a);for(let m=0;m<e.length;m++){if(this.#v(e[m]))continue;let g=t.map(w=>+(w[e[m]]??0)).map((w,k)=>{let E=c.left+f*k,A=c.top+u-(o?w/o*u:0);return{x:E,y:A,v:w,label:i[k]}}),y=c.top+u,v=Math.max(0,Math.min(1,this.smooth));p+=`<path data-area${this.#m(m%10,e[m])} d="${Jd(g,y,v)}"/>`,p+=`<path data-line${this.#g(m%10,e[m])} d="${Ma(g,v)}"/>`;for(let w of g)p+=`<circle data-dot${this.#m(m%10,e[m])} cx="${w.x}" cy="${w.y}" r="3"/>`,p+=`<circle data-hit${wt({label:w.label,value:w.v,series:e[m]})} cx="${w.x}" cy="${w.y}" r="10" fill="transparent"/>`}return this.#z=e.map((m,b)=>({label:m,key:m,slot:b%10})),{svg:p,viewBox:`0 0 ${l} ${h}`}}#z=null;get legendData(){return this.#z?this.#z.map(t=>({...t})):null}#ft(){if(!this.#z||!this.#z.length)return null;let t=document.createElement("div");t.setAttribute("data-legend","");for(let e of this.#z){let i=document.createElement("span");i.setAttribute("data-legend-item",""),e.key&&i.setAttribute("data-series-key",e.key);let r=document.createElement("span");r.setAttribute("data-legend-dot",""),r.setAttribute("data-slice",String(e.slot)),e.key&&(r.style.background=`var(--color-${e.key}, var(--chart-${e.slot}))`),i.appendChild(r);let n=document.createElement("span");n.textContent=e.pct?`${e.label} (${e.pct}%)`:e.label,i.appendChild(n),t.appendChild(i)}return t}};S("chart-ui",pn);C();var mn=class s extends x{static properties={for:{type:String,default:"",reflect:!0},items:{type:String,default:"",reflect:!1},shape:{type:String,default:"dot",reflect:!0},position:{type:String,default:"bottom",reflect:!0},static:{type:Boolean,default:!1,reflect:!0},onToggle:{type:String,default:"hide",reflect:!0,attribute:"on-toggle"}};static template=()=>null;#t=null;#e=null;#i=new Set;connected(){this.setAttribute("role","list"),this.#s(),this.#a()}disconnected(){this.#r()}render(){this.#s(),this.#a()}#s(){if(this.#r(),!this.for)return;let t=this.getRootNode()?.getElementById?.(this.for)||document.getElementById(this.for);if(!t){s._warned||(s._warned=new WeakSet);let e={el:this,id:this.for};s._warned.has(this)||(console.warn(`[chart-legend-ui] [for="${this.for}"] did not resolve to an element.`),s._warned.add(this));return}this.#t=t,this.#e=()=>this.#a(),t.addEventListener("legend-update",this.#e)}#r(){this.#t&&this.#e&&this.#t.removeEventListener("legend-update",this.#e),this.#t=null,this.#e=null}#n(){if(this.items)try{let t=JSON.parse(this.items);if(Array.isArray(t))return t}catch{}return this.#t&&Array.isArray(this.#t.legendData)?this.#t.legendData:[]}#a(){let t=this.#n();if(this.innerHTML="",!!t.length)for(let e of t){let i=e.key??e.label??"",r=e.label??i,n=e.slot!=null?e.slot:0,o=!this.#i.has(i),a=document.createElement("badge-ui");a.setAttribute("data-row",""),a.setAttribute("role",this.static?"listitem":"button"),a.setAttribute("text",r),i&&a.setAttribute("data-key",i),o&&a.setAttribute("data-active",""),this.static||(a.setAttribute("tabindex","0"),a.setAttribute("aria-pressed",o?"true":"false"));let l=this.shape||"dot",h=document.createElement("swatch-ui");h.setAttribute("shape",l),h.setAttribute("size","sm");let c=i?`var(--color-${i}, var(--a-data-${n}))`:`var(--a-data-${n})`;h.style.setProperty("--swatch-color",c),a.appendChild(h),this.static||(a.addEventListener("click",u=>this.#o(u,i)),a.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),this.#o(u,i))})),this.appendChild(a)}}#o(t,e){if(!e)return;let r=!!this.#i.has(e);r?this.#i.delete(e):this.#i.add(e);let n=t.currentTarget;r?n.setAttribute("data-active",""):n.removeAttribute("data-active"),n.setAttribute("aria-pressed",r?"true":"false"),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,detail:{key:e,active:r,mode:this.onToggle||"hide"}}))}};S("chart-legend-ui",mn);C();var KC=120,gn=class extends x{static properties={placement:{type:String,default:"bottom",reflect:!0},gap:{type:Number,default:4,reflect:!0},open:{type:Boolean,default:!1,reflect:!0},trigger:{type:String,default:"click",reflect:!0}};static template=()=>null;#t=null;#e=!1;#i=null;#s=null;#r=null;connected(){let t=this.querySelector('[slot="content"]');t&&(t.hasAttribute("popover")||t.setAttribute("popover","manual"),t.addEventListener("toggle",this.#d),this.#s=t),this.#e||(this.#e=!0,this.trigger==="click"&&this.addEventListener("click",this.#o),this.trigger==="hover"&&(this.addEventListener("pointerenter",this.#h),this.addEventListener("pointerleave",this.#u),t&&(t.addEventListener("pointerenter",this.#h),t.addEventListener("pointerleave",this.#u))))}render(){this.open?this.#n():this.#a()}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}#n(){let t=this.querySelector('[slot="trigger"]'),e=this.#s??this.querySelector('[slot="content"]');if(!(!t||!e)){if(!e.matches(":popover-open"))try{e.showPopover()}catch{}this.#t?.(),this.#t=ut(t,e,{placement:this.placement,gap:this.gap}),(this.trigger==="click"||this.trigger==="manual")&&(this.#r=requestAnimationFrame(()=>{this.#r=null,document.addEventListener("pointerdown",this.#l),document.addEventListener("keydown",this.#c)}))}}#a(){this.#t?.(),this.#t=null;let t=this.#s??this.querySelector('[slot="content"]');if(t?.matches(":popover-open"))try{t.hidePopover()}catch{}this.#r!=null&&(cancelAnimationFrame(this.#r),this.#r=null),document.removeEventListener("pointerdown",this.#l),document.removeEventListener("keydown",this.#c)}#o=t=>{let e=this.querySelector('[slot="trigger"]');e&&(t.target===e||e.contains(t.target))&&(this.open=!this.open)};#l=t=>{if(!this.open)return;let e=this.#s;this.contains(t.target)||e?.contains(t.target)||(this.open=!1)};#c=t=>{t.key==="Escape"&&this.open&&(t.stopPropagation(),this.open=!1)};#h=()=>{clearTimeout(this.#i),this.open=!0};#u=()=>{clearTimeout(this.#i),this.#i=setTimeout(()=>{this.open=!1},KC)};#d=t=>{let e=t.newState==="open";e!==this.open&&(this.open=e)};disconnected(){clearTimeout(this.#i),this.#a(),this.trigger==="click"&&this.removeEventListener("click",this.#o),this.trigger==="hover"&&(this.removeEventListener("pointerenter",this.#h),this.removeEventListener("pointerleave",this.#u),this.#s&&(this.#s.removeEventListener("pointerenter",this.#h),this.#s.removeEventListener("pointerleave",this.#u))),this.#s?.removeEventListener("toggle",this.#d),this.#s=null,this.#e=!1}};S("popover-ui",gn);C();var bn=class extends x{static requiredIcons=["caret-down"];static properties={multiple:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.addEventListener("toggle",this.#t)}disconnected(){this.removeEventListener("toggle",this.#t)}#t=t=>{if(this.multiple)return;let e=t.target;if(!e.open)return;let i=this.querySelectorAll("accordion-item-ui");for(let r of i)r!==e&&r.open&&(r.open=!1)}},On=class extends x{static properties={text:{type:String,default:"",reflect:!0},open:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=!1;connected(){if(!this.querySelector('[slot="header"]')){let t=document.createElement("div");t.setAttribute("slot","header");let e=document.createElement("span");e.setAttribute("slot","header-text"),t.appendChild(e);let i=document.createElement("icon-ui");i.setAttribute("name","caret-down"),i.setAttribute("slot","caret"),t.appendChild(i),this.prepend(t)}if(!this.querySelector('[slot="body"]')){let t=document.createElement("div");t.setAttribute("slot","body");let e=[...this.childNodes].filter(i=>i.nodeType===1?!i.hasAttribute("slot"):i.nodeType===3&&i.textContent.trim());for(let i of e)t.appendChild(i);this.appendChild(t)}this.#t||(this.#t=!0,this.addEventListener("click",this.#e))}disconnected(){this.removeEventListener("click",this.#e),this.#t=!1}render(){let t=this.querySelector('[slot="header-text"]');t&&(t.textContent=this.text)}#e=t=>{let e=this.querySelector('[slot="header"]');!e||!e.contains(t.target)||t.target.closest('[slot="action"], [slot="actions"], [data-no-toggle]')||(this.open=!this.open,this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,detail:{open:this.open}})))}};S("accordion-ui",bn),S("accordion-item-ui",On);C();var yn=class extends x{static properties={label:{type:String,default:"",reflect:!0},vertical:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","separator")}render(){if(this.vertical?this.setAttribute("aria-orientation","vertical"):this.removeAttribute("aria-orientation"),this.label){let t=this.querySelector('[slot="label"]');t||(t=document.createElement("span"),t.setAttribute("slot","label"),this.appendChild(t)),t.textContent=this.label}else{let t=this.querySelector('[slot="label"]');t&&t.remove()}}};S("divider-ui",yn);C();var vn=class extends x{static properties={cite:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.hasAttribute("role")||this.setAttribute("role","blockquote")}render(){let t=this.querySelector('[slot="cite"]:not([data-cite-stamped])'),e=this.querySelector('[slot="cite"][data-cite-stamped]');if(t){e?.remove();return}if(this.cite)if(e)e.textContent=this.cite;else{let i=document.createElement("span");i.setAttribute("slot","cite"),i.setAttribute("data-cite-stamped",""),i.textContent=this.cite,this.appendChild(i)}else e&&e.remove()}};S("blockquote-ui",vn);C();var tf=[{limit:60,unit:"second",divisor:1},{limit:3600,unit:"minute",divisor:60},{limit:3600*24,unit:"hour",divisor:3600},{limit:3600*24*7,unit:"day",divisor:3600*24},{limit:3600*24*30,unit:"week",divisor:3600*24*7},{limit:3600*24*365,unit:"month",divisor:3600*24*30},{limit:1/0,unit:"year",divisor:3600*24*365}],xn=class extends x{static properties={datetime:{type:String,default:"",reflect:!0},timeStyle:{type:String,default:"long",reflect:!0,attribute:"time-style"},numeric:{type:String,default:"auto",reflect:!0},locale:{type:String,default:"",reflect:!0},updateInterval:{type:Number,default:60,reflect:!0,attribute:"update-interval"}};static template=()=>null;#t=null;#e(){return this.locale?this.locale:this.ownerDocument?.documentElement?.lang||void 0}#i(){if(!this.datetime)return"";let t=new Date(this.datetime);if(Number.isNaN(t.getTime()))return"";let e=(t.getTime()-Date.now())/1e3,i=Math.abs(e),r=tf.find(o=>i<=o.limit)||tf[tf.length-1],n=Math.round(e/r.divisor);try{return new Intl.RelativeTimeFormat(this.#e(),{style:this.timeStyle,numeric:this.numeric}).format(n,r.unit)}catch{let o=e<0,a=Math.abs(n);return o?`${a} ${r.unit}${a===1?"":"s"} ago`:`in ${a} ${r.unit}${a===1?"":"s"}`}}#s(){if(!this.datetime)return"";let t=new Date(this.datetime);if(Number.isNaN(t.getTime()))return"";try{return new Intl.DateTimeFormat(this.#e(),{dateStyle:"full",timeStyle:"long"}).format(t)}catch{return t.toString()}}connected(){super.connected(),this.hasAttribute("role")||this.setAttribute("role","time"),this.#r()}render(){let t=this.#i();this.textContent=t,t&&!this.hasAttribute("data-suppress-title")&&this.setAttribute("title",this.#s()),this.datetime&&this.setAttribute("datetime",this.datetime),this.#r()}#r(){this.#n();let t=Number(this.updateInterval);!Number.isFinite(t)||t<=0||(this.#t=setInterval(()=>{this.textContent=this.#i()},t*1e3))}#n(){this.#t!=null&&(clearInterval(this.#t),this.#t=null)}disconnected(){super.disconnected(),this.#n()}};S("relative-time-ui",xn);C();var Sn=class extends x{static properties={value:{type:Number,default:0,reflect:!0},numberStyle:{type:String,default:"decimal",reflect:!0,attribute:"number-style"},currency:{type:String,default:"",reflect:!0},unit:{type:String,default:"",reflect:!0},notation:{type:String,default:"standard",reflect:!0},compactDisplay:{type:String,default:"short",reflect:!0,attribute:"compact-display"},minimumFractionDigits:{type:Number,default:0,reflect:!0,attribute:"minimum-fraction-digits"},maximumFractionDigits:{type:Number,default:2,reflect:!0,attribute:"maximum-fraction-digits"},locale:{type:String,default:"",reflect:!0},signDisplay:{type:String,default:"auto",reflect:!0,attribute:"sign-display"}};static template=()=>null;#t(){return this.locale?this.locale:this.ownerDocument?.documentElement?.lang||void 0}#e(){let t=Number(this.value);if(!Number.isFinite(t)||this.numberStyle==="currency"&&!this.currency||this.numberStyle==="unit"&&!this.unit)return"";let e={style:this.numberStyle,notation:this.notation,signDisplay:this.signDisplay};this.numberStyle==="currency"&&(e.currency=this.currency),this.numberStyle==="unit"&&(e.unit=this.unit),this.notation==="compact"&&(e.compactDisplay=this.compactDisplay),Number.isFinite(this.minimumFractionDigits)&&(e.minimumFractionDigits=this.minimumFractionDigits),Number.isFinite(this.maximumFractionDigits)&&(e.maximumFractionDigits=this.maximumFractionDigits);try{return new Intl.NumberFormat(this.#t(),e).format(t)}catch{return String(t)}}connected(){super.connected()}render(){let t=this.#e();this.textContent=t,t&&Number.isFinite(Number(this.value))?this.setAttribute("aria-label",`${t} (raw: ${this.value})`):this.removeAttribute("aria-label")}};S("number-format-ui",Sn);C();var ef=["Weak","Fair","Good","Strong"];function JC(s){if(!s)return-1;let t=0;s.length>=8&&t++,s.length>=12&&t++,s.length>=16&&t++;let e=[/[a-z]/.test(s),/[A-Z]/.test(s),/[0-9]/.test(s),/[^a-zA-Z0-9]/.test(s)].filter(Boolean).length;return e>=2&&t++,e>=3&&t++,e===4&&t++,/(.)\1{2,}/.test(s)&&t--,s.length<8&&(t=Math.min(t,0)),Math.max(0,Math.min(3,t))}var wn=class extends x{static properties={value:{type:String,default:""},minScore:{type:Number,default:2,reflect:!0,attribute:"min-score"},showLabel:{type:Boolean,default:!0,reflect:!0,attribute:"show-label"}};static template=()=>null;#t=-2;connected(){super.connected(),this.querySelector('[slot="bar"]')||(this.innerHTML=`
198
+ [{ label: "Jan", value: 100 }, { label: "Feb", value: 200 }]`)),this.#t=Array.isArray(t)?t:[],this.#c(),this.#f()}get data(){return this.#t}#l=!1;#c(){if(this.#l)return;let t=this.#h();this.#t.length>t&&(console.warn(`[chart-ui] .data has ${this.#t.length} rows which exceeds the recommended perf budget of ${t}. Consider downsampling at the data layer (e.g., LTTB, bucket aggregation). Override the budget via CSS: chart-ui { --chart-perf-budget: 10000 }.`),this.#l=!0)}#h(){let t=getComputedStyle(this).getPropertyValue("--chart-perf-budget").trim(),e=parseInt(t,10);return Number.isFinite(e)&&e>0?e:5e3}connected(){if(this.hasAttribute("role")||this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",`${this.type} chart`),this.#t.length===0&&this.hasAttribute("data"))try{let t=JSON.parse(this.getAttribute("data"));Array.isArray(t)&&(this.data=t)}catch{}document.addEventListener("toggle",this.#x),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("keydown",this.#Q),this.addEventListener("focus",this.#P),this.addEventListener("blur",this.#D),this.addEventListener("pointerover",this.#I),this.addEventListener("pointermove",this.#T),this.addEventListener("pointerleave",this.#X),this.addEventListener("pointerdown",this.#q),this.addEventListener("click",this.#j),this.#i=new ResizeObserver(t=>{let{inlineSize:e,blockSize:i}=t[0].contentBoxSize[0];if(!this.#t.length)return;let r=Math.round(e),n=Math.round(i);r===this.#r&&(!this.hasAttribute("resize")||n===this.#n)||(this.#r=r,this.#n=n,!this.#s&&(this.#s=requestAnimationFrame(()=>{this.#s=null,this.#f()})))}),this.#i.observe(this)}render(){if(this.loading){let e=this.querySelector("skeleton-ui[data-chart-skel]");e||(e=document.createElement("skeleton-ui"),e.setAttribute("data-chart-skel",""),e.style.cssText="display:block;width:100%;height:100%;min-height:4rem;border-radius:var(--a-radius-md)"),this.innerHTML="",this.appendChild(e);return}let t=this.querySelector("skeleton-ui[data-chart-skel]");t&&t.remove(),this.#f()}#u(){let t=this.clientWidth||300,e=this.clientHeight||0,i=GC.std,r=this.#t.length||1,n=Math.max(t,120),a=(this.hasAttribute("resize")||this.style.height)&&e>40?e:Math.round(n/i.ratio),l=parseFloat(getComputedStyle(this).maxHeight);isFinite(l)&&l>0&&a>l&&(a=Math.round(l));let h=Math.min(n,a),c=this.size||(h<150?"sm":h<300?"md":"lg"),u=c==="sm"?9:c==="md"?10:11,d=u,f=c==="sm"?8:c==="md"?9:10,p=this.hideGrid,m=p?0:u*3.2,b=!!this.x,g={top:p?2:u*1.6,right:p?2:u*1.2,bottom:!b||p?2:u*2.2,left:m},y=n-g.left-g.right,v=Math.max(4,y/r*.6);return{width:n,height:a,pad:g,fontSize:u,labelSize:d,valueSize:f,barMinW:v,plotW:y,n:r,sizeClass:c}}#d=null;#f(){if(!this.isConnected)return;let t=this.querySelector(':scope > [slot="empty"]');if(t&&!this.#d&&(this.#d=t.cloneNode(!0)),this.innerHTML="",this.#d&&this.appendChild(this.#d.cloneNode(!0)),!this.#t.length){this.removeAttribute("data-has-data");return}this.setAttribute("data-has-data",""),this.#p();let e=document.createElement("div");this.type==="sparkline"&&e.setAttribute("data-sparkline",""),this.appendChild(e);let i=document.createElementNS("http://www.w3.org/2000/svg","svg");e.appendChild(i);let r="",n="";switch(this.type){case"bar":({svg:r,viewBox:n}=this.#H());break;case"line":({svg:r,viewBox:n}=this.#K());break;case"pie":({svg:r,viewBox:n}=this.#tt());break;case"donut":({svg:r,viewBox:n}=this.#J());break;case"radar":({svg:r,viewBox:n}=this.#et());break;case"sparkline":({svg:r,viewBox:n}=this.#it());break;case"segments":({svg:r,viewBox:n}=this.#ht());break;case"area":({svg:r,viewBox:n}=this.#st());break;case"scatter":({svg:r,viewBox:n}=this.#rt());break;case"radial-bar":({svg:r,viewBox:n}=this.#G());break;case"gauge":({svg:r,viewBox:n}=this.#U());break;case"funnel":({svg:r,viewBox:n}=this.#nt());break;case"treemap":({svg:r,viewBox:n}=this.#ot());break;case"sankey":({svg:r,viewBox:n}=this.#at());break;case"composed":({svg:r,viewBox:n}=this.#lt());break;case"stacked-bar":({svg:r,viewBox:n}=this.#ct());break;case"grouped-bar":({svg:r,viewBox:n}=this.#ut());break;case"multi-line":({svg:r,viewBox:n}=this.#dt());break;default:({svg:r,viewBox:n}=this.#H());break}if(i.setAttribute("viewBox",n),i.setAttribute("preserveAspectRatio","xMidYMid meet"),i.innerHTML=r,["pie","donut","stacked-bar","grouped-bar","multi-line","radial-bar"].includes(this.type)&&!this.#O()){let o=this.#ft();o&&this.appendChild(o)}this.dispatchEvent(new CustomEvent("legend-update",{bubbles:!0}))}#p(){let t=this.#N();for(let e=0;e<t.length;e++){let i=e%10;this.style.setProperty(`--color-${t[e]}`,`var(--chart-${i})`)}}#m(t,e){return e?` data-slice="${t}" data-series-key="${ne(e)}" style="fill: var(--color-${e}, var(--chart-${t}))"`:` data-slice="${t}"`}#g(t,e){return e?` data-slice="${t}" data-series-key="${ne(e)}" style="stroke: var(--color-${e}, var(--chart-${t}))"`:` data-slice="${t}"`}#y=null;disconnected(){this.#i?.disconnect(),this.#i=null,this.#s&&(cancelAnimationFrame(this.#s),this.#s=null),document.removeEventListener("toggle",this.#x),document.removeEventListener("pointerdown",this.#M),this.removeEventListener("keydown",this.#Q),this.removeEventListener("focus",this.#P),this.removeEventListener("blur",this.#D),this.removeEventListener("pointerover",this.#I),this.removeEventListener("pointermove",this.#T),this.removeEventListener("pointerleave",this.#X),this.removeEventListener("pointerdown",this.#q),this.removeEventListener("click",this.#j),this.#W()}#O(){return this.id?!!document.querySelector(`chart-legend-ui[for="${CSS.escape(this.id)}"]`):!1}#b(){return this.id?!!document.querySelector(`tooltip-ui[follows="pointer"][for="${CSS.escape(this.id)}"]`):!1}#x=t=>{let e=t.target?.closest?.("chart-legend-ui[for]");if(!e||e.getAttribute("for")!==this.id)return;let{key:i,active:r}=t.detail||{};i&&(r?this.#a.delete(i):this.#a.add(i),this.#f())};#v(t){return!!t&&this.#a.has(t)}#S(t){if(t==null||t==="")return"";let e=+t;if(!Number.isFinite(e))return String(t);switch(this.format||"abbr"){case"decimal":return e.toFixed(2);case"percent":return`${(e*100).toFixed(1)}%`;case"currency":{let r=getComputedStyle(this).getPropertyValue("--chart-currency-prefix").trim();return(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),`${r||"$"}${by(e)}`}default:return by(e)}}#w=-1;#k(){return Array.from(this.querySelectorAll("[data-tip-label], [data-tip-value]"))}#A(t){let e=this.#k();if(!e.length){this.#$();return}this.#w=Math.max(0,Math.min(t,e.length-1)),this.#E(),this.#R()}#E(){let t=this.#k();for(let i of t)i.removeAttribute("data-a11y-focus");let e=t[this.#w];if(!e)return this.removeAttribute("data-a11y-focused");e.setAttribute("data-a11y-focus",""),this.setAttribute("data-a11y-focused","")}#$(){this.#w=-1;for(let t of this.#k())t.removeAttribute("data-a11y-focus");this.removeAttribute("data-a11y-focused")}#R(){let t=this.#k()[this.#w];if(!t)return;let e=t.getBoundingClientRect(),i={clientX:e.left+e.width/2,clientY:e.top+e.height/2};this.#Z(t,i)}#C(){let t=this.#k()[this.#w];if(!t)return;let e=t.getBoundingClientRect(),i={clientX:e.left+e.width/2,clientY:e.top+e.height/2};this.dispatchEvent(new CustomEvent("chart-select",{bubbles:!0,detail:this.#_(t,i)}))}#P=()=>{this.#w===-1&&this.#A(0)};#D=()=>{this.#$(),this.#L&&this.#B()};#Q=t=>{let e=this.#k();if(e.length)switch(t.key){case"ArrowRight":case"ArrowDown":t.preventDefault(),this.#A(this.#w+1);break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.#A(Math.max(0,this.#w-1));break;case"Home":t.preventDefault(),this.#A(0);break;case"End":t.preventDefault(),this.#A(e.length-1);break;case"Enter":case" ":t.preventDefault(),this.#C();break;case"Escape":t.preventDefault(),this.#$(),this.#L&&this.#B();break}};#L=null;#I=t=>{if(t.pointerType==="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");e&&(this.#Y(e,t),this.#Z(e,t))};#T=t=>{if(t.pointerType==="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");if(!e)return this.#L&&this.#B(),this.#W();this.#Y(e,t),e!==this.#L&&this.#Z(e,t)};#X=t=>{t&&t.pointerType==="touch"||(this.#W(),this.#L&&this.#B())};#q=t=>{if(t.pointerType!=="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");if(!e)return this.#L&&this.#B(),this.#W();this.#Y(e,t),e!==this.#L&&this.#Z(e,t),document.addEventListener("pointerdown",this.#M)};#M=t=>{t.pointerType==="touch"&&(this.contains(t.target)||(this.#W(),this.#L&&this.#B(),document.removeEventListener("pointerdown",this.#M)))};#j=t=>{let e=t.target.closest("[data-tip-label], [data-tip-value]");e&&this.dispatchEvent(new CustomEvent("chart-select",{bubbles:!0,detail:this.#_(e,t)}))};#Z(t,e){this.#L=t,this.dispatchEvent(new CustomEvent("chart-hover",{bubbles:!0,detail:this.#_(t,e)}))}#B(){this.#L=null,this.dispatchEvent(new CustomEvent("chart-leave",{bubbles:!0}))}#_(t,e){let{tipLabel:i,tipValue:r,tipPct:n,tipSeries:o}=t.dataset,a=t.dataset.slice!=null?Number(t.dataset.slice):null,l=r!=null?Number(r):null,h=n!=null?Number(n):null,c=i??null,u=o??null,d=this.#V(c,u)??[{series:u,label:c,value:Number.isFinite(l)?l:r??null,pct:Number.isFinite(h)?h:null,slot:a}];return{label:c,value:Number.isFinite(l)?l:r??null,pct:Number.isFinite(h)?h:null,series:u,slot:a,payload:d,pointerX:e?.clientX??null,pointerY:e?.clientY??null}}#V(t,e){if(t==null)return null;let i=this.x,r=this.#N();if(!i||r.length===0)return null;let n=this.#t.find(l=>String(l[i]??"")===String(t));if(!n)return null;let o=r.filter(l=>!this.#v(l)),a=e||(o.length===1?o[0]:null);return o.map((l,h)=>{let c=+(n[l]??0);return{series:l,label:t,value:Number.isFinite(c)?c:null,pct:null,slot:h%10,hovered:l===a}})}#Y(t,e){if(this.#b())return;let{tipLabel:i,tipValue:r,tipPct:n,tipSeries:o}=t.dataset;if(!this.#y){let b=document.createElement("div");b.setAttribute("popover","manual"),b.setAttribute("role","tooltip"),b.classList.add("chart-tooltip-popup"),document.body.appendChild(b),this.#y=b}let a=[];if(o&&a.push(`<span data-tip-role="series">${ne(o)}</span>`),i&&a.push(`<span data-tip-role="label">${ne(i)}</span>`),r!==void 0){let b=n!==void 0?` <span data-tip-role="pct">(${n}%)</span>`:"";a.push(`<span data-tip-role="value">${this.#S(r)}${b}</span>`)}this.#y.innerHTML=a.join("");try{this.#y.showPopover()}catch{}let l=12,h=8,{clientX:c,clientY:u}=e,d=this.#y.offsetWidth||0,f=this.#y.offsetHeight||0,p=c-d/2,m=u-f-l;p<h&&(p=h),p+d>window.innerWidth-h&&(p=window.innerWidth-d-h),m<h&&(m=u+l),this.#y.style.left=`${p}px`,this.#y.style.top=`${m}px`}#W(){if(this.#y){try{this.#y.hidePopover()}catch{}this.#y.remove(),this.#y=null}}#N(){return this.y?this.y.split(",").map(t=>t.trim()).filter(Boolean):[]}#F(t,e,i,r,n,o){let a=n,l=o?.fontSize||10,h=o?.labelSize||l,c="",u=i;if(o?.sizeClass==="sm"&&i.length>4&&(u=i.filter((d,f)=>f%2===0||f===i.length-1)),!this.hideGrid){let f=i[i.length-1]-i[0]||1;for(let p of u){let m=a.top+(e-a.top-a.bottom)*(1-(p-i[0])/f);c+=`<line data-grid x1="${a.left}" y1="${m}" x2="${t-a.right}" y2="${m}"/>`}for(let p of u){let m=a.top+(e-a.top-a.bottom)*(1-(p-i[0])/f);c+=`<text data-y-label x="${a.left-4}" y="${m+l*.35}" text-anchor="end" font-size="${l}">${this.#S(p)}</text>`}if(r){let m=(t-a.left-a.right)/r.length,g=r.reduce((w,k)=>Math.max(w,String(k).length),1)*h*.6+h*.75,y=Math.max(1,Math.ceil(g/m)),v=r.length-1;for(let w=0;w<r.length;w++){if(w%y!==0&&w!==v||w!==v&&v-w<y)continue;let k=a.left+m*w+m/2;c+=`<text data-x-label x="${k}" y="${e-l*.5}" text-anchor="middle" font-size="${h}">${ne(r[w])}</text>`}}}return c}#H(){let t=this.#u(),e=this.#t,i=this.#N()[0]||this.y,r=e.map(v=>+(v[i]??0)),n=e.map(v=>v[this.x]??""),o=ds(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/e.length,p=f*.6,m=(f-p)/2,b=this.#F(l,h,o,n,c,t),g=!this.hideValues&&t.sizeClass!=="sm",y=!this.hideAverage&&r.length>1&&t.sizeClass!=="sm"&&!this.hideGrid;for(let v=0;v<e.length;v++){let w=r[v],k=a?w/a*u:0,E=c.left+f*v+m,A=c.top+u-k;b+=`<path data-bar${wt({label:n[v],value:w})} d="${$h(E,A,p,k,this.#o())}"/>`,g&&(b+=`<text data-value x="${E+p/2}" y="${A-4}" text-anchor="middle" font-size="${t.valueSize}">${this.#S(w)}</text>`)}if(y){let v=r.reduce((k,E)=>k+E,0)/r.length,w=c.top+u-(a?v/a*u:0);b+=`<line data-avg x1="${c.left}" y1="${w}" x2="${l-c.right}" y2="${w}"/>`,b+=`<text data-avg-label x="${l-c.right+2}" y="${w+3}" text-anchor="start" font-size="${t.valueSize}">${this.#S(v)}</text>`,b+=`<line data-hit${wt({label:"Average",value:v})} x1="${c.left}" y1="${w}" x2="${l-c.right}" y2="${w}" stroke="transparent" stroke-width="12"/>`}return{svg:b,viewBox:`0 0 ${l} ${h}`}}#K(){let t=this.#u(),e=this.#t,i=this.#N()[0]||this.y,r=e.map(A=>+(A[i]??0)),n=e.map(A=>A[this.x]??""),o=ds(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(e.length-1,1),p=this.#F(l,h,o,n,c,t),m=r.map((A,$)=>{let T=c.left+f*$,Q=c.top+u-(a?A/a*u:0);return{x:T,y:Q,v:A,label:n[$]}}),b=c.top+u,g=Math.max(0,Math.min(1,this.smooth));p+=`<path data-area d="${Jd(m,b,g)}"/>`,p+=`<path data-line d="${Ma(m,g)}"/>`;let y=t.sizeClass==="sm",v=y?1.5:3,w=Math.max(v,10),k=!this.hideValues&&!y,E=!this.hideAverage&&r.length>1&&!y&&!this.hideGrid;for(let A of m)p+=`<circle data-dot cx="${A.x}" cy="${A.y}" r="${v}"/>`,p+=`<circle data-hit${wt({label:A.label,value:A.v})} cx="${A.x}" cy="${A.y}" r="${w}" fill="transparent"/>`,k&&(p+=`<text data-value x="${A.x}" y="${A.y-8}" text-anchor="middle" font-size="${t.valueSize}">${this.#S(A.v)}</text>`);if(E){let A=r.reduce((T,Q)=>T+Q,0)/r.length,$=c.top+u-(a?A/a*u:0);p+=`<line data-avg x1="${c.left}" y1="${$}" x2="${l-c.right}" y2="${$}"/>`,p+=`<text data-avg-label x="${l-c.right+2}" y="${$+3}" text-anchor="start" font-size="${t.valueSize}">${this.#S(A)}</text>`,p+=`<line data-hit${wt({label:"Average",value:A})} x1="${c.left}" y1="${$}" x2="${l-c.right}" y2="${$}" stroke="transparent" stroke-width="12"/>`}return{svg:p,viewBox:`0 0 ${l} ${h}`}}#tt(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(p=>+(p[e]??0)),r=i.reduce((p,m)=>p+m,0)||1,n=t.map(p=>p[this.x]??""),o=this.#u(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.42),d="",f=-Math.PI/2;for(let p=0;p<i.length;p++){let m=i[p]/r*Math.PI*2;if(m===0)continue;let b=f+m,g=(i[p]/r*100).toFixed(1),y=` data-slice="${p%10}"${wt({label:n[p],value:i[p],pct:g})}`;Math.abs(m-Math.PI*2)<.001?d+=`<circle${y} cx="${h}" cy="${c}" r="${u}"/>`:d+=`<path${y} d="${HC(h,c,u,f,b)}"/>`,f=b}return this.#z=t.map((p,m)=>({label:n[m],value:i[m],pct:(i[m]/r*100).toFixed(1),slot:m%10})),{svg:d,viewBox:`0 0 ${a} ${l}`}}#J(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(g=>+(g[e]??0)),r=i.reduce((g,y)=>g+y,0)||1,n=t.map(g=>g[this.x]??""),o=this.#u(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.42),d=u*.72,f="",p=-Math.PI/2;for(let g=0;g<i.length;g++){let y=i[g]/r*Math.PI*2;if(y===0)continue;let v=p+y,w=(i[g]/r*100).toFixed(1),k=` data-slice="${g%10}"${wt({label:n[g],value:i[g],pct:w})}`;Math.abs(y-Math.PI*2)<.001?(f+=`<circle${k} cx="${h}" cy="${c}" r="${(u+d)/2}" fill="none" stroke-width="${u-d}" style="fill:none"/>`,f+=`<path${k} d="M ${h-u} ${c} A ${u} ${u} 0 1 1 ${h+u} ${c} A ${u} ${u} 0 1 1 ${h-u} ${c} Z M ${h-d} ${c} A ${d} ${d} 0 1 0 ${h+d} ${c} A ${d} ${d} 0 1 0 ${h-d} ${c} Z" fill-rule="evenodd"/>`):f+=`<path${k} d="${Kd(h,c,u,d,p,v,this.#o())}"/>`,p=v}let m=Math.max(14,Math.round(u*.32)),b=Math.max(9,Math.round(u*.16));return f+=`<text data-donut-total x="${h}" y="${c}" text-anchor="middle" dominant-baseline="central" font-size="${m}">${this.#S(r)}</text>`,f+=`<text data-donut-label x="${h}" y="${c+m}" text-anchor="middle" dominant-baseline="central" font-size="${b}">Total</text>`,this.#z=t.map((g,y)=>({label:n[y],value:i[y],pct:(i[y]/r*100).toFixed(1),slot:y%10})),{svg:f,viewBox:`0 0 ${a} ${l}`}}#et(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(k=>+(k[e]??0)),r=t.map(k=>k[this.x]??""),n=Math.max(...i)||1,o=t.length,a=this.#u(),{width:l,height:h,fontSize:c}=a,u=l/2,d=h/2,f=c*3.5,p=Math.max(40,Math.min(l,h)/2-f),m="",b=Math.PI*2/o;for(let k=1;k<=3;k++){let E=p*k/3,A="";for(let $=0;$<o;$++){let T=-Math.PI/2+b*$,Q=u+E*Math.cos(T),D=d+E*Math.sin(T);A+=($===0?"M":"L")+` ${Q} ${D}`}A+=" Z",m+=`<path data-grid d="${A}"/>`}for(let k=0;k<o;k++){let E=-Math.PI/2+b*k,A=u+p*Math.cos(E),$=d+p*Math.sin(E);m+=`<line data-grid x1="${u}" y1="${d}" x2="${A}" y2="${$}"/>`}let g="",y=[];for(let k=0;k<o;k++){let E=-Math.PI/2+b*k,A=i[k]/n*p,$=u+A*Math.cos(E),T=d+A*Math.sin(E);g+=(k===0?"M":"L")+` ${$} ${T}`,y.push({px:$,py:T})}g+=" Z",m+=`<path data-radar-fill d="${g}"/>`,m+=`<path data-radar-line d="${g}"/>`;let v=Math.max(c,10);for(let k=0;k<o;k++){let{px:E,py:A}=y[k];m+=`<circle data-hit${wt({label:r[k],value:i[k]})} cx="${E}" cy="${A}" r="${v}" fill="transparent"/>`}let w=c*1.3;for(let k=0;k<o;k++){let E=-Math.PI/2+b*k,A=u+(p+w)*Math.cos(E),$=d+(p+w)*Math.sin(E),T=Math.abs(Math.cos(E))<.1?"middle":Math.cos(E)>0?"start":"end";m+=`<text data-x-label x="${A}" y="${$}" text-anchor="${T}" dominant-baseline="central" font-size="${c}">${ne(r[k])}</text>`}return{svg:m,viewBox:`0 0 ${l} ${h}`}}#it(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(y=>+(y[e]??0)),r=Math.max(...i)||1,n=Math.min(...i),o=r-n||1,a=this.clientWidth||120,l=this.clientHeight||32,h=Math.max(40,a),c=Math.max(16,l),u=h/Math.max(i.length-1,1),d=Math.max(2,Math.min(6,c*.1)),f=t.map(y=>y[this.x]??""),p=i.map((y,v)=>({x:u*v,y:c-(y-n)/o*(c-d*2)-d,v:y,label:f[v]})),m=Math.max(0,Math.min(1,this.smooth)),b="";b+=`<path data-area d="${Jd(p,c,m)}"/>`,b+=`<path data-line d="${Ma(p,m)}"/>`;let g=Math.max(u/2,6);for(let y of p)b+=`<circle data-hit${wt({label:y.label,value:y.v})} cx="${y.x}" cy="${y.y}" r="${g}" fill="transparent"/>`;return{svg:b,viewBox:`0 0 ${h} ${c}`}}#st(){return this.#K()}#rt(){let t=this.#u(),e=this.#t,i=this.#N()[0]||this.y,r=e.map(g=>+(g[i]??0)),n=e.map(g=>g[this.x]??""),o=ds(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(e.length-1,1),p=this.#F(l,h,o,n,c,t),m=t.sizeClass==="sm"?2.5:4,b=Math.max(m*2,10);for(let g=0;g<r.length;g++){let y=c.left+f*g,v=c.top+u-(a?r[g]/a*u:0);p+=`<circle data-dot data-scatter cx="${y}" cy="${v}" r="${m}"/>`,p+=`<circle data-hit${wt({label:n[g],value:r[g]})} cx="${y}" cy="${v}" r="${b}" fill="transparent"/>`}return{svg:p,viewBox:`0 0 ${l} ${h}`}}#G(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(g=>+(g[e]??0)),r=t.map(g=>g[this.x]??""),n=Math.max(...i)||1,o=this.#u(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.45),d=u*.3,f=i.length||1,p=(u-d)/f,m=Math.min(2,p*.15),b="";for(let g=0;g<i.length;g++){let y=d+p*g+m/2,v=d+p*(g+1)-m/2,w=(y+v)/2,k=v-y,E=2*Math.PI*w,A=Math.max(0,Math.min(1,i[g]/n))*E;if(b+=`<circle data-radial-track cx="${h}" cy="${c}" r="${w}" fill="none" stroke-width="${k}"/>`,A<=0)continue;let $=(i[g]/n*100).toFixed(1),T=wt({label:r[g],value:i[g],pct:$}),Q=Math.abs(A-E)<.5,D=Q?"butt":"round",R=Q?`${E} 0`:`${A} ${E-A}`;b+=`<circle data-slice="${g%10}"${T} data-radial-bar cx="${h}" cy="${c}" r="${w}" fill="none" stroke-width="${k}" stroke-linecap="${D}" stroke-dasharray="${R}" transform="rotate(-90 ${h} ${c})"/>`}return this.#z=t.map((g,y)=>({label:r[y],key:r[y],value:i[y],pct:(i[y]/n*100).toFixed(1),slot:y%10})),{svg:b,viewBox:`0 0 ${a} ${l}`}}#U(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(w=>+(w[e]??0)),r=i.reduce((w,k)=>w+k,0)||1,n=i[0]??0,o=t[0]?.max!=null?+t[0].max:i.length===1?Math.max(n,1):r,a=Math.max(0,Math.min(1,n/o)),l=this.#u(),{width:h,height:c}=l,u=h/2,d=c*.68,f=Math.max(40,Math.min(h*.45,c*.6)),p=f*.72,m=(f-p)/2,b="";if(b+=`<path data-radial-track d="${Kd(u,d,f,p,Math.PI,2*Math.PI,m)}"/>`,a>0){let w=Math.PI+Math.PI*a,k=wt({label:t[0]?.[this.x]??"Value",value:n,pct:(a*100).toFixed(1)});b+=`<path data-slice="0"${k} data-gauge-fill d="${Kd(u,d,f,p,Math.PI,w,m)}"/>`}let g=Math.max(18,Math.round(f*.42)),y=Math.max(10,Math.round(f*.2)),v=d-f*.15;return b+=`<text data-gauge-value x="${u}" y="${v}" text-anchor="middle" dominant-baseline="central" font-size="${g}">${this.#S(n)}</text>`,o!==n&&(b+=`<text data-gauge-max x="${u}" y="${v+g*.8}" text-anchor="middle" dominant-baseline="central" font-size="${y}">of ${this.#S(o)}</text>`),{svg:b,viewBox:`0 0 ${h} ${c}`}}#nt(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(v=>+(v[e]??0)),r=t.map(v=>v[this.x]??""),n=i.length;if(n===0)return{svg:"",viewBox:"0 0 100 100"};let o=Math.max(...i)||1,a=this.#u(),{width:l,height:h}=a,c=a.fontSize,u=Math.max(l*.18,80),d=c*.8,f=l-u*2,m=(h-d*2)/n,b=Math.max(2,m*.08),g=l/2,y="";for(let v=0;v<n;v++){let w=i[v],k=v<n-1?i[v+1]:i[v],E=w/o*(f/2),A=k/o*(f/2),$=d+m*v+b/2,T=d+m*(v+1)-b/2,Q=(w/o*100).toFixed(1),D=wt({label:r[v],value:w,pct:Q}),R=`M ${g-E} ${$} L ${g+E} ${$} L ${g+A} ${T} L ${g-A} ${T} Z`;if(y+=`<path data-slice="${v%10}" data-funnel-stage${D} d="${R}"/>`,y+=`<text data-funnel-label x="${u-8}" y="${$+m/2}" text-anchor="end" dominant-baseline="central" font-size="${c}">${ne(r[v])}</text>`,y+=`<text data-funnel-value x="${l-u+8}" y="${$+m/2}" text-anchor="start" dominant-baseline="central" font-size="${c}">${this.#S(w)}</text>`,v>0){let _=(i[v]/i[0]*100).toFixed(0);y+=`<text data-funnel-drop x="${l-u+8}" y="${$+m/2+c*1.1}" text-anchor="start" dominant-baseline="central" font-size="${c*.85}">${_}%</text>`}}return this.#z=t.map((v,w)=>({label:r[w],value:i[w],pct:(i[w]/o*100).toFixed(1),slot:w%10})),{svg:y,viewBox:`0 0 ${l} ${h}`}}#ot(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(Q=>+(Q[e]??0)),r=t.map(Q=>Q[this.x]??""),n=i.length;if(n===0)return{svg:"",viewBox:"0 0 100 100"};let o=this.#u(),{width:a,height:l,fontSize:h}=o,c=i.reduce((Q,D)=>Q+D,0)||1,u=Array.from({length:n},(Q,D)=>D).sort((Q,D)=>i[D]-i[Q]),d=[],f=a*l,p=u.map(Q=>i[Q]/c*f),m=0,b=0,g=a,y=l,v=[],w=0,k=(Q,D)=>{if(Q.length===0)return 1/0;let R=Q.reduce((rt,dt)=>rt+dt,0),_=Math.max(...Q),V=Math.min(...Q),U=D*D,J=R*R;return Math.max(U*_/J,J/(U*V))},E=(Q,D,R,_,V,U)=>{let J=Q.reduce((St,yt)=>St+yt,0),rt=V>=U,dt=rt?J/V:U,ot=rt?V:J/U,Ot=0;for(let St=0;St<Q.length;St++){let yt=Q[St]/J,Ct=u[D+St];if(rt){let Lt=yt*V;d.push({i:Ct,x:R+Ot,y:_,w:Lt,h:dt}),Ot+=Lt}else{let Lt=yt*U;d.push({i:Ct,x:R,y:_+Ot,w:ot,h:Lt}),Ot+=Lt}}return rt?{x:R,y:_+dt,w:V,h:U-dt}:{x:R+ot,y:_,w:V-ot,h:U}},A=p.slice();for(;A.length>0;){v=[A[0]],w=p.length-A.length;let Q=Math.min(g,y),D=1;for(;D<A.length;){let _=v.concat(A[D]);if(k(_,Q)>k(v,Q))break;v=_,D++}let R=E(v,w,m,b,g,y);m=R.x,b=R.y,g=R.w,y=R.h,A=A.slice(v.length)}let $="",T=2;for(let Q of d){let D=(i[Q.i]/c*100).toFixed(1),R=wt({label:r[Q.i],value:i[Q.i],pct:D});$+=`<rect data-slice="${Q.i%10}" data-treemap-tile${R} x="${Q.x+T}" y="${Q.y+T}" width="${Math.max(0,Q.w-T*2)}" height="${Math.max(0,Q.h-T*2)}" rx="${this.#o()}"/>`;let _=Q.x+8,V=Q.w>h*4,U=V&&Q.h>h*2.5,J=V&&!U&&Q.h>h*1.2;if(U)$+=`<text data-treemap-label x="${_}" y="${Q.y+h+4}" font-size="${h}" dominant-baseline="hanging">${ne(r[Q.i])}</text>`,$+=`<text data-treemap-value x="${_}" y="${Q.y+h*2+6}" font-size="${h*.9}" dominant-baseline="hanging">${this.#S(i[Q.i])}</text>`;else if(J){let rt=Q.y+Q.h/2;$+=`<text data-treemap-label x="${_}" y="${rt}" font-size="${h}" dominant-baseline="central">${ne(r[Q.i])}</text>`}}return this.#z=t.map((Q,D)=>({label:r[D],value:i[D],pct:(i[D]/c*100).toFixed(1),slot:D%10})),{svg:$,viewBox:`0 0 ${a} ${l}`}}#at(){let t=this.#t;if(!t.length)return{svg:"",viewBox:"0 0 100 100"};let e=new Map,i=new Map;for(let w of t){let k=w.source??w.from??"",E=w.target??w.to??"",A=+(w.value??w.v??0);e.has(k)||e.set(k,{name:k,flow:0}),i.has(E)||i.set(E,{name:E,flow:0}),e.get(k).flow+=A,i.get(E).flow+=A}let r=this.#u(),{width:n,height:o,fontSize:a}=r,l=Math.max(8,n*.03),h=l+a*5,c=[...e.values()].reduce((w,k)=>w+k.flow,0)||1,u=[...i.values()].reduce((w,k)=>w+k.flow,0)||1,d=a*.6,f=[...e.values()],p=[...i.values()],m=o-d*(f.length-1),b=o-d*(p.length-1),g=0;for(let w of f){let k=w.flow/c*m;w.y0=g,w.y1=g+k,w.cursor=g,g+=k+d}g=0;for(let w of p){let k=w.flow/u*b;w.y0=g,w.y1=g+k,w.cursor=g,g+=k+d}let y="",v=Math.min(this.#o(),l/2);f.forEach((w,k)=>{y+=`<rect data-sankey-node data-slice="${k%10}" x="${h-l}" y="${w.y0}" width="${l}" height="${w.y1-w.y0}" rx="${v}"/>`,y+=`<text data-sankey-label x="${h-l-6}" y="${(w.y0+w.y1)/2}" text-anchor="end" dominant-baseline="central" font-size="${a}">${ne(w.name)}</text>`}),p.forEach((w,k)=>{y+=`<rect data-sankey-node data-slice="${(f.length+k)%10}" x="${n-h}" y="${w.y0}" width="${l}" height="${w.y1-w.y0}" rx="${v}"/>`,y+=`<text data-sankey-label x="${n-h+l+6}" y="${(w.y0+w.y1)/2}" text-anchor="start" dominant-baseline="central" font-size="${a}">${ne(w.name)}</text>`});for(let w of t){let k=e.get(w.source??w.from??""),E=i.get(w.target??w.to??"");if(!k||!E)continue;let A=+(w.value??w.v??0);if(A<=0)continue;let $=A/c*m,T=A/u*b,Q=k.cursor,D=Q+$,R=E.cursor,_=R+T;k.cursor+=$,E.cursor+=T;let V=h,U=n-h,J=(V+U)/2,rt=wt({label:`${k.name} \u2192 ${E.name}`,value:A}),dt=`M ${V} ${Q} C ${J} ${Q}, ${J} ${R}, ${U} ${R} L ${U} ${_} C ${J} ${_}, ${J} ${D}, ${V} ${D} Z`;y+=`<path data-sankey-link${rt} d="${dt}"/>`}return{svg:y,viewBox:`0 0 ${n} ${o}`}}#lt(){let t=this.#u(),e=this.#t,i=this.#N(),r=i[0]||"bar",n=i[1]||"line",o=e.map(E=>E[this.x]??""),a=e.map(E=>+(E[r]??0)),l=e.map(E=>+(E[n]??0)),h=[...a,...l],c=ds(0,Math.max(...h),5),u=c[c.length-1],{width:d,height:f,pad:p}=t,m=f-p.top-p.bottom,b=d-p.left-p.right,g=b/e.length,y=g*.6,v=(g-y)/2,w=b/Math.max(e.length-1,1),k=this.#F(d,f,c,o,p,t);if(!this.#v(r))for(let E=0;E<e.length;E++){let A=a[E],$=u?A/u*m:0,T=p.left+g*E+v,Q=p.top+m-$;k+=`<path${this.#m(0,r)}${wt({label:o[E],value:A,series:r})} d="${$h(T,Q,y,$,this.#o())}"/>`}if(!this.#v(n)){let E=l.map(($,T)=>({x:p.left+g*T+g/2,y:p.top+m-(u?$/u*m:0),v:$,label:o[T]})),A=Math.max(0,Math.min(1,this.smooth));k+=`<path data-line${this.#g(1,n)} d="${Ma(E,A)}"/>`;for(let $ of E)k+=`<circle data-dot${this.#m(1,n)} cx="${$.x}" cy="${$.y}" r="3"/>`,k+=`<circle data-hit${wt({label:$.label,value:$.v,series:n})} cx="${$.x}" cy="${$.y}" r="10" fill="transparent"/>`}return this.#z=[{label:r,key:r,slot:0},{label:n,key:n,slot:1}],{svg:k,viewBox:`0 0 ${d} ${f}`}}#ht(){let t=this.#t,e=this.#N()[0]||this.y,i=t.map(p=>+(p[e]??0)),r=i.reduce((p,m)=>p+m,0)||1,n=t.map(p=>p[this.x]??""),o=getComputedStyle(this),a=Math.max(40,this.clientWidth||200),l=24,h=Math.min(this.#o(),l/2),c=Math.max(0,parseFloat(o.getPropertyValue("--chart-segments-gap"))||2),u=[],d=0;for(let p=0;p<i.length;p++){let m=p===i.length-1?a:Math.round((d*r+i[p]*a)/r),b=p===i.length-1?a:i.slice(0,p+1).reduce((y,v)=>y+v,0)/r*a,g=p===0?0:i.slice(0,p).reduce((y,v)=>y+v,0)/r*a;u.push({x:g,w:Math.max(0,b-g)}),d=m}let f="";for(let p=0;p<u.length;p++){let{x:m,w:b}=u[p];if(b<=0)continue;let g=p===0,y=p===u.length-1,v=Math.max(0,b-(y?0:c)),w=(i[p]/r*100).toFixed(1),k=wt({label:n[p],value:i[p],pct:w}),E=`<title>${ne(n[p])}: ${i[p]} (${w}%)</title>`;if(g&&y||!g&&!y||h===0)f+=`<rect data-slice="${p%10}"${k} x="${m}" y="0" width="${v}" height="${l}"${(g||y)&&h?` rx="${h}"`:""}>${E}</rect>`;else{let A=h,$=m+v,T;g?T=`M ${m+A} 0 H ${$} V ${l} H ${m+A} A ${A} ${A} 0 0 1 ${m} ${l-A} V ${A} A ${A} ${A} 0 0 1 ${m+A} 0 Z`:T=`M ${m} 0 H ${$-A} A ${A} ${A} 0 0 1 ${$} ${A} V ${l-A} A ${A} ${A} 0 0 1 ${$-A} ${l} H ${m} Z`,f+=`<path data-slice="${p%10}"${k} d="${T}">${E}</path>`}}return this.#z=t.map((p,m)=>({label:n[m],value:i[m],pct:(i[m]/r*100).toFixed(1),slot:m%10})),{svg:f,viewBox:`0 0 ${a} ${l}`}}#ct(){let t=this.#t,e=this.#N(),i=t.map(g=>g[this.x]??""),r=t.map(g=>e.reduce((y,v)=>y+ +(g[v]??0),0)),n=ds(0,Math.max(...r),5),o=n[n.length-1],a=this.#u(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/t.length,p=f*.6,m=(f-p)/2,b=this.#F(l,h,n,i,c,a);for(let g=0;g<t.length;g++){let y=c.top+u,v=e.length;for(let w=0;w<v;w++){if(this.#v(e[w]))continue;let k=+(t[g][e[w]]??0),E=o?k/o*u:0;if(E<=0){y-=E;continue}y-=E;let A=c.left+f*g+m,$=y,T=E,Q=w===v-1,D=this.#o(),R=`${this.#m(w%10,e[w])}${wt({label:i[g],value:k,series:e[w]})}`;Q?b+=`<path${R} d="${$h(A,$,p,T,D)}"/>`:b+=`<rect${R} x="${A}" y="${$}" width="${p}" height="${T}"/>`}}return this.#z=e.map((g,y)=>({label:g,key:g,slot:y%10})),{svg:b,viewBox:`0 0 ${l} ${h}`}}#ut(){let t=this.#t,e=this.#N(),i=t.map(v=>v[this.x]??""),r=t.flatMap(v=>e.map(w=>+(v[w]??0))),n=ds(0,Math.max(...r),5),o=n[n.length-1],a=this.#u(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/t.length,p=3,m=f*.7,b=(m-p*(e.length-1))/e.length,g=(f-m)/2,y=this.#F(l,h,n,i,c,a);for(let v=0;v<t.length;v++)for(let w=0;w<e.length;w++){if(this.#v(e[w]))continue;let k=+(t[v][e[w]]??0),E=o?k/o*u:0,A=c.left+f*v+g+(b+p)*w,$=c.top+u-E;y+=`<path${this.#m(w%10,e[w])}${wt({label:i[v],value:k,series:e[w]})} d="${$h(A,$,b,E,this.#o())}"/>`,this.hideValues||(y+=`<text data-value x="${A+b/2}" y="${$-4}" text-anchor="middle" font-size="${a.valueSize}">${this.#S(k)}</text>`)}return this.#z=e.map((v,w)=>({label:v,key:v,slot:w%10})),{svg:y,viewBox:`0 0 ${l} ${h}`}}#dt(){let t=this.#t,e=this.#N(),i=t.map(m=>m[this.x]??""),r=t.flatMap(m=>e.map(b=>+(m[b]??0))),n=ds(0,Math.max(...r),5),o=n[n.length-1],a=this.#u(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(t.length-1,1),p=this.#F(l,h,n,i,c,a);for(let m=0;m<e.length;m++){if(this.#v(e[m]))continue;let g=t.map(w=>+(w[e[m]]??0)).map((w,k)=>{let E=c.left+f*k,A=c.top+u-(o?w/o*u:0);return{x:E,y:A,v:w,label:i[k]}}),y=c.top+u,v=Math.max(0,Math.min(1,this.smooth));p+=`<path data-area${this.#m(m%10,e[m])} d="${Jd(g,y,v)}"/>`,p+=`<path data-line${this.#g(m%10,e[m])} d="${Ma(g,v)}"/>`;for(let w of g)p+=`<circle data-dot${this.#m(m%10,e[m])} cx="${w.x}" cy="${w.y}" r="3"/>`,p+=`<circle data-hit${wt({label:w.label,value:w.v,series:e[m]})} cx="${w.x}" cy="${w.y}" r="10" fill="transparent"/>`}return this.#z=e.map((m,b)=>({label:m,key:m,slot:b%10})),{svg:p,viewBox:`0 0 ${l} ${h}`}}#z=null;get legendData(){return this.#z?this.#z.map(t=>({...t})):null}#ft(){if(!this.#z||!this.#z.length)return null;let t=document.createElement("div");t.setAttribute("data-legend","");for(let e of this.#z){let i=document.createElement("span");i.setAttribute("data-legend-item",""),e.key&&i.setAttribute("data-series-key",e.key);let r=document.createElement("span");r.setAttribute("data-legend-dot",""),r.setAttribute("data-slice",String(e.slot)),e.key&&(r.style.background=`var(--color-${e.key}, var(--chart-${e.slot}))`),i.appendChild(r);let n=document.createElement("span");n.textContent=e.pct?`${e.label} (${e.pct}%)`:e.label,i.appendChild(n),t.appendChild(i)}return t}};S("chart-ui",pn);C();var mn=class s extends x{static properties={for:{type:String,default:"",reflect:!0},items:{type:String,default:"",reflect:!1},shape:{type:String,default:"dot",reflect:!0},position:{type:String,default:"bottom",reflect:!0},static:{type:Boolean,default:!1,reflect:!0},onToggle:{type:String,default:"hide",reflect:!0,attribute:"on-toggle"}};static template=()=>null;#t=null;#e=null;#i=new Set;connected(){this.setAttribute("role","list"),this.#s(),this.#a()}disconnected(){this.#r()}render(){this.#s(),this.#a()}#s(){if(this.#r(),!this.for)return;let t=this.getRootNode()?.getElementById?.(this.for)||document.getElementById(this.for);if(!t){s._warned||(s._warned=new WeakSet);let e={el:this,id:this.for};s._warned.has(this)||(console.warn(`[chart-legend-ui] [for="${this.for}"] did not resolve to an element.`),s._warned.add(this));return}this.#t=t,this.#e=()=>this.#a(),t.addEventListener("legend-update",this.#e)}#r(){this.#t&&this.#e&&this.#t.removeEventListener("legend-update",this.#e),this.#t=null,this.#e=null}#n(){if(this.items)try{let t=JSON.parse(this.items);if(Array.isArray(t))return t}catch{}return this.#t&&Array.isArray(this.#t.legendData)?this.#t.legendData:[]}#a(){let t=this.#n();if(this.innerHTML="",!!t.length)for(let e of t){let i=e.key??e.label??"",r=e.label??i,n=e.slot!=null?e.slot:0,o=!this.#i.has(i),a=document.createElement("badge-ui");a.setAttribute("data-row",""),a.setAttribute("role",this.static?"listitem":"button"),a.setAttribute("text",r),i&&a.setAttribute("data-key",i),o&&a.setAttribute("data-active",""),this.static||(a.setAttribute("tabindex","0"),a.setAttribute("aria-pressed",o?"true":"false"));let l=this.shape||"dot",h=document.createElement("swatch-ui");h.setAttribute("shape",l),h.setAttribute("size","sm");let c=i?`var(--color-${i}, var(--a-data-${n}))`:`var(--a-data-${n})`;h.style.setProperty("--swatch-color",c),a.appendChild(h),this.static||(a.addEventListener("click",u=>this.#o(u,i)),a.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),this.#o(u,i))})),this.appendChild(a)}}#o(t,e){if(!e)return;let r=!!this.#i.has(e);r?this.#i.delete(e):this.#i.add(e);let n=t.currentTarget;r?n.setAttribute("data-active",""):n.removeAttribute("data-active"),n.setAttribute("aria-pressed",r?"true":"false"),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,detail:{key:e,active:r,mode:this.onToggle||"hide"}}))}};S("chart-legend-ui",mn);C();var KC=120,gn=class extends x{static properties={placement:{type:String,default:"bottom",reflect:!0},gap:{type:Number,default:4,reflect:!0},open:{type:Boolean,default:!1,reflect:!0},trigger:{type:String,default:"click",reflect:!0}};static template=()=>null;#t=null;#e=!1;#i=null;#s=null;#r=null;connected(){let t=this.querySelector('[slot="content"]');t&&(t.hasAttribute("popover")||t.setAttribute("popover","manual"),t.addEventListener("toggle",this.#d),this.#s=t),this.#e||(this.#e=!0,this.trigger==="click"&&this.addEventListener("click",this.#o),this.trigger==="hover"&&(this.addEventListener("pointerenter",this.#h),this.addEventListener("pointerleave",this.#u),t&&(t.addEventListener("pointerenter",this.#h),t.addEventListener("pointerleave",this.#u))))}render(){this.open?this.#n():this.#a()}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}#n(){let t=this.querySelector('[slot="trigger"]'),e=this.#s??this.querySelector('[slot="content"]');if(!(!t||!e)){if(!e.matches(":popover-open"))try{e.showPopover()}catch{}this.#t?.(),this.#t=ut(t,e,{placement:this.placement,gap:this.gap}),(this.trigger==="click"||this.trigger==="manual")&&(this.#r=requestAnimationFrame(()=>{this.#r=null,document.addEventListener("pointerdown",this.#l),document.addEventListener("keydown",this.#c)}))}}#a(){this.#t?.(),this.#t=null;let t=this.#s??this.querySelector('[slot="content"]');if(t?.matches(":popover-open"))try{t.hidePopover()}catch{}this.#r!=null&&(cancelAnimationFrame(this.#r),this.#r=null),document.removeEventListener("pointerdown",this.#l),document.removeEventListener("keydown",this.#c)}#o=t=>{let e=this.querySelector('[slot="trigger"]');e&&(t.target===e||e.contains(t.target))&&(this.open=!this.open)};#l=t=>{if(!this.open)return;let e=this.#s;this.contains(t.target)||e?.contains(t.target)||(this.open=!1)};#c=t=>{t.key==="Escape"&&this.open&&(t.stopPropagation(),this.open=!1)};#h=()=>{clearTimeout(this.#i),this.open=!0};#u=()=>{clearTimeout(this.#i),this.#i=setTimeout(()=>{this.open=!1},KC)};#d=t=>{let e=t.newState==="open";e!==this.open&&(this.open=e)};disconnected(){clearTimeout(this.#i),this.#a(),this.trigger==="click"&&this.removeEventListener("click",this.#o),this.trigger==="hover"&&(this.removeEventListener("pointerenter",this.#h),this.removeEventListener("pointerleave",this.#u),this.#s&&(this.#s.removeEventListener("pointerenter",this.#h),this.#s.removeEventListener("pointerleave",this.#u))),this.#s?.removeEventListener("toggle",this.#d),this.#s=null,this.#e=!1}};S("popover-ui",gn);C();var bn=class extends x{static requiredIcons=["caret-down"];static properties={multiple:{type:Boolean,default:!1,reflect:!0},variant:{type:String,default:"flat",reflect:!0}};static template=()=>null;connected(){this.addEventListener("toggle",this.#t)}disconnected(){this.removeEventListener("toggle",this.#t)}#t=t=>{if(this.multiple)return;let e=t.target;if(!e.open)return;let i=this.querySelectorAll("accordion-item-ui");for(let r of i)r!==e&&r.open&&(r.open=!1)}},On=class extends x{static properties={text:{type:String,default:"",reflect:!0},open:{type:Boolean,default:!1,reflect:!0},variant:{type:String,default:"flat",reflect:!0}};static template=()=>null;#t=!1;connected(){let t=this.querySelector('[slot="header"]');if(t){if(!t.querySelector('[slot="caret"]')){let e=document.createElement("icon-ui");e.setAttribute("name","caret-down"),e.setAttribute("slot","caret"),t.appendChild(e)}}else{let e=document.createElement("div");e.setAttribute("slot","header"),e.setAttribute("tabindex","0"),e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),e.dataset.autofocusable="";let i=document.createElement("span");i.setAttribute("slot","header-text"),i.dataset.autolabel="",e.appendChild(i);let r=document.createElement("icon-ui");r.setAttribute("name","caret-down"),r.setAttribute("slot","caret"),e.appendChild(r),this.prepend(e)}if(!this.querySelector('[slot="body"]')){let e=document.createElement("div");e.setAttribute("slot","body");let i=[...this.childNodes].filter(r=>r.nodeType===1?!r.hasAttribute("slot"):r.nodeType===3&&r.textContent.trim());for(let r of i)e.appendChild(r);this.appendChild(e)}this.#t||(this.#t=!0,this.addEventListener("click",this.#e),this.addEventListener("keydown",this.#i))}disconnected(){this.removeEventListener("click",this.#e),this.removeEventListener("keydown",this.#i),this.#t=!1}render(){let t=this.querySelector('[slot="header-text"][data-autolabel]');t&&(t.textContent=this.text);let e=this.querySelector('[slot="header"][data-autofocusable]');e&&e.setAttribute("aria-expanded",String(this.open))}#e=t=>{let e=this.querySelector('[slot="header"]');!e||!e.contains(t.target)||t.target.closest('[slot="action"], [slot="actions"], [data-no-toggle]')||(this.open=!this.open,this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,detail:{open:this.open}})))};#i=t=>{let e=this.querySelector('[slot="header"][data-autofocusable]');!e||t.target!==e||(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e.click())}};S("accordion-ui",bn),S("accordion-item-ui",On);C();var yn=class extends x{static properties={label:{type:String,default:"",reflect:!0},vertical:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","separator")}render(){if(this.vertical?this.setAttribute("aria-orientation","vertical"):this.removeAttribute("aria-orientation"),this.label){let t=this.querySelector('[slot="label"]');t||(t=document.createElement("span"),t.setAttribute("slot","label"),this.appendChild(t)),t.textContent=this.label}else{let t=this.querySelector('[slot="label"]');t&&t.remove()}}};S("divider-ui",yn);C();var vn=class extends x{static properties={cite:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.hasAttribute("role")||this.setAttribute("role","blockquote")}render(){let t=this.querySelector('[slot="cite"]:not([data-cite-stamped])'),e=this.querySelector('[slot="cite"][data-cite-stamped]');if(t){e?.remove();return}if(this.cite)if(e)e.textContent=this.cite;else{let i=document.createElement("span");i.setAttribute("slot","cite"),i.setAttribute("data-cite-stamped",""),i.textContent=this.cite,this.appendChild(i)}else e&&e.remove()}};S("blockquote-ui",vn);C();var tf=[{limit:60,unit:"second",divisor:1},{limit:3600,unit:"minute",divisor:60},{limit:3600*24,unit:"hour",divisor:3600},{limit:3600*24*7,unit:"day",divisor:3600*24},{limit:3600*24*30,unit:"week",divisor:3600*24*7},{limit:3600*24*365,unit:"month",divisor:3600*24*30},{limit:1/0,unit:"year",divisor:3600*24*365}],xn=class extends x{static properties={datetime:{type:String,default:"",reflect:!0},timeStyle:{type:String,default:"long",reflect:!0,attribute:"time-style"},numeric:{type:String,default:"auto",reflect:!0},locale:{type:String,default:"",reflect:!0},updateInterval:{type:Number,default:60,reflect:!0,attribute:"update-interval"}};static template=()=>null;#t=null;#e(){return this.locale?this.locale:this.ownerDocument?.documentElement?.lang||void 0}#i(){if(!this.datetime)return"";let t=new Date(this.datetime);if(Number.isNaN(t.getTime()))return"";let e=(t.getTime()-Date.now())/1e3,i=Math.abs(e),r=tf.find(o=>i<=o.limit)||tf[tf.length-1],n=Math.round(e/r.divisor);try{return new Intl.RelativeTimeFormat(this.#e(),{style:this.timeStyle,numeric:this.numeric}).format(n,r.unit)}catch{let o=e<0,a=Math.abs(n);return o?`${a} ${r.unit}${a===1?"":"s"} ago`:`in ${a} ${r.unit}${a===1?"":"s"}`}}#s(){if(!this.datetime)return"";let t=new Date(this.datetime);if(Number.isNaN(t.getTime()))return"";try{return new Intl.DateTimeFormat(this.#e(),{dateStyle:"full",timeStyle:"long"}).format(t)}catch{return t.toString()}}connected(){super.connected(),this.hasAttribute("role")||this.setAttribute("role","time"),this.#r()}render(){let t=this.#i();this.textContent=t,t&&!this.hasAttribute("data-suppress-title")&&this.setAttribute("title",this.#s()),this.datetime&&this.setAttribute("datetime",this.datetime),this.#r()}#r(){this.#n();let t=Number(this.updateInterval);!Number.isFinite(t)||t<=0||(this.#t=setInterval(()=>{this.textContent=this.#i()},t*1e3))}#n(){this.#t!=null&&(clearInterval(this.#t),this.#t=null)}disconnected(){super.disconnected(),this.#n()}};S("relative-time-ui",xn);C();var Sn=class extends x{static properties={value:{type:Number,default:0,reflect:!0},numberStyle:{type:String,default:"decimal",reflect:!0,attribute:"number-style"},currency:{type:String,default:"",reflect:!0},unit:{type:String,default:"",reflect:!0},notation:{type:String,default:"standard",reflect:!0},compactDisplay:{type:String,default:"short",reflect:!0,attribute:"compact-display"},minimumFractionDigits:{type:Number,default:0,reflect:!0,attribute:"minimum-fraction-digits"},maximumFractionDigits:{type:Number,default:2,reflect:!0,attribute:"maximum-fraction-digits"},locale:{type:String,default:"",reflect:!0},signDisplay:{type:String,default:"auto",reflect:!0,attribute:"sign-display"}};static template=()=>null;#t(){return this.locale?this.locale:this.ownerDocument?.documentElement?.lang||void 0}#e(){let t=Number(this.value);if(!Number.isFinite(t)||this.numberStyle==="currency"&&!this.currency||this.numberStyle==="unit"&&!this.unit)return"";let e={style:this.numberStyle,notation:this.notation,signDisplay:this.signDisplay};this.numberStyle==="currency"&&(e.currency=this.currency),this.numberStyle==="unit"&&(e.unit=this.unit),this.notation==="compact"&&(e.compactDisplay=this.compactDisplay),Number.isFinite(this.minimumFractionDigits)&&(e.minimumFractionDigits=this.minimumFractionDigits),Number.isFinite(this.maximumFractionDigits)&&(e.maximumFractionDigits=this.maximumFractionDigits);try{return new Intl.NumberFormat(this.#t(),e).format(t)}catch{return String(t)}}connected(){super.connected()}render(){let t=this.#e();this.textContent=t,t&&Number.isFinite(Number(this.value))?this.setAttribute("aria-label",`${t} (raw: ${this.value})`):this.removeAttribute("aria-label")}};S("number-format-ui",Sn);C();var ef=["Weak","Fair","Good","Strong"];function JC(s){if(!s)return-1;let t=0;s.length>=8&&t++,s.length>=12&&t++,s.length>=16&&t++;let e=[/[a-z]/.test(s),/[A-Z]/.test(s),/[0-9]/.test(s),/[^a-zA-Z0-9]/.test(s)].filter(Boolean).length;return e>=2&&t++,e>=3&&t++,e===4&&t++,/(.)\1{2,}/.test(s)&&t--,s.length<8&&(t=Math.min(t,0)),Math.max(0,Math.min(3,t))}var wn=class extends x{static properties={value:{type:String,default:""},minScore:{type:Number,default:2,reflect:!0,attribute:"min-score"},showLabel:{type:Boolean,default:!0,reflect:!0,attribute:"show-label"}};static template=()=>null;#t=-2;connected(){super.connected(),this.querySelector('[slot="bar"]')||(this.innerHTML=`
199
199
  <div slot="bar" aria-hidden="true">
200
200
  <div slot="segment" data-i="0"></div>
201
201
  <div slot="segment" data-i="1"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-modules",
3
- "version": "0.7.24",
3
+ "version": "0.7.26",
4
4
  "description": "AdiaUI composite custom elements \u2014 shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://adiaui.dev/a2ui/v0_9/components/ThemePanel.json",
4
4
  "title": "ThemePanel",
5
- "description": "Module-tier appearance-preferences control surface. Owns the three knobs\nof the AdiaUI theming contract: [theme=<slug>] named themes,\n--a-density / --a-radius-k parametric overrides, and color-scheme\nlight/dark switching, plus optional localStorage persistence behind a\nsmall attribute API.\n\nDrops into any consumer's <popover-ui slot=\"content\"> (the canonical\ncomposition) or directly into a sidebar section. Eight named themes\nship by default; section visibility flips on/off via boolean attributes\n([parametric], [presets], [scheme-toggle]).\n\nPromoted from the duplicated <div id=\"theme-panel\"> block in site/ and\nplaygrounds/admin-shell/ — see docs/specs/theme-panel-module.md.\n",
5
+ "description": "Module-tier appearance-preferences control surface. Owns the three knobs\nof the AdiaUI theming contract: [theme=<slug>] named themes,\n--a-density / --a-radius-k parametric overrides, and color-scheme\nlight/dark switching, plus optional localStorage persistence behind a\nsmall attribute API.\n\nDrops into any consumer's <popover-ui slot=\"content\"> (the canonical\ncomposition) or directly into a sidebar section. Eight named themes\nship by default; section visibility flips on/off via boolean attributes\n([parametric], [presets], [scheme-toggle]).\n\nPromoted from the duplicated <div id=\"theme-panel\"> block in site/ and\nplaygrounds/admin-shell/ — see .claude/docs/specs/theme-panel-module.md.\n",
6
6
  "type": "object",
7
7
  "allOf": [
8
8
  {
@@ -11,7 +11,7 @@ ship by default; section visibility flips on/off via boolean attributes
11
11
  ([parametric], [presets], [scheme-toggle]).
12
12
 
13
13
  Promoted from the duplicated <div id="theme-panel"> block in site/ and
14
- playgrounds/admin-shell/ — see docs/specs/theme-panel-module.md.
14
+ playgrounds/admin-shell/ — see .claude/docs/specs/theme-panel-module.md.
15
15
 
16
16
  *
17
17
  * @see https://ui-kit.exe.xyz/site/components/theme-panel
@@ -19,7 +19,7 @@ description: |
19
19
  ([parametric], [presets], [scheme-toggle]).
20
20
 
21
21
  Promoted from the duplicated <div id="theme-panel"> block in site/ and
22
- playgrounds/admin-shell/ — see docs/specs/theme-panel-module.md.
22
+ playgrounds/admin-shell/ — see .claude/docs/specs/theme-panel-module.md.
23
23
 
24
24
  # Per ADR-0027 — primitives that programmatically create other primitives
25
25
  # do NOT auto-import them. Consumer (or demo shell) must explicitly import.