@mt-gloss/ui 0.1.117 → 0.1.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +1,55 @@
1
- import { u as U, h as me, g as Ne, S as Se, b as we, j as I, d as M } from "./COMMITS-CeuMPpjt.js";
2
- import { C as It, c as Mt, P as $t, f as Rt, i as Ft, r as Ut, e as zt } from "./COMMITS-CeuMPpjt.js";
3
- import { jsx as a, jsxs as f, Fragment as z } from "react/jsx-runtime";
4
- import $, { useState as E, useRef as H, createContext as he, useContext as fe, useMemo as le, useEffect as L, useCallback as x, useLayoutEffect as Ee } from "react";
5
- import { useSensors as Pe, useSensor as oe, PointerSensor as xe, KeyboardSensor as Ae, DndContext as ke, closestCenter as De } from "@dnd-kit/core";
6
- import { sortableKeyboardCoordinates as Oe, SortableContext as Le, horizontalListSortingStrategy as Ie, arrayMove as Me, useSortable as $e } from "@dnd-kit/sortable";
7
- import { CSS as Re } from "@dnd-kit/utilities";
8
- import { M as ie } from "./MetricCard-Cyoxhb_S.js";
9
- function Nt() {
10
- const e = U();
1
+ import { u as I, h as fe, j as K, g as we, S as Ee, b as Pe, k as xe } from "./COMMITS-BkM1Urzh.js";
2
+ import { C as zt, N as Ht, o as Vt, d as Bt, p as Kt, l as Yt, c as Wt, n as Gt, P as Qt, m as qt, f as jt, i as Zt, r as Xt, e as Jt } from "./COMMITS-BkM1Urzh.js";
3
+ import { jsx as n, jsxs as f, Fragment as L } from "react/jsx-runtime";
4
+ import H, { useState as x, useRef as Y, createContext as ge, useContext as be, useMemo as ie, useEffect as U, useCallback as D, useLayoutEffect as Ae } from "react";
5
+ import { useSensors as ke, useSensor as ce, PointerSensor as De, KeyboardSensor as Le, DndContext as Oe, closestCenter as Me } from "@dnd-kit/core";
6
+ import { sortableKeyboardCoordinates as Ie, SortableContext as $e, horizontalListSortingStrategy as Re, arrayMove as Fe, useSortable as Ue } from "@dnd-kit/sortable";
7
+ import { CSS as ze } from "@dnd-kit/utilities";
8
+ import { M as de } from "./MetricCard-Cyoxhb_S.js";
9
+ function Et() {
10
+ const e = I();
11
11
  if (e?.state.activePanelId !== "settings") return null;
12
12
  const t = e.state.activeTrigger;
13
13
  return t?.kind === "card-overflow" ? t.cardId : null;
14
14
  }
15
- function Fe({ children: e }) {
16
- return /* @__PURE__ */ a("div", { className: "clone-stage", children: e });
15
+ function He({ span: e, rotating: t = !0, children: r }) {
16
+ const o = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" "), a = r != null ? "full" : "fallback";
17
+ return /* @__PURE__ */ n("div", { className: o, "data-clone-fidelity": a, children: r });
17
18
  }
18
- function Ue({ span: e, rotating: t = !0, children: l }) {
19
- const o = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" "), n = l != null ? "full" : "fallback";
20
- return /* @__PURE__ */ a("div", { className: o, "data-clone-fidelity": n, children: l });
19
+ function Pt({ primary: e, secondary: t }) {
20
+ return /* @__PURE__ */ f("div", { className: "gloss-panel-chrome-v2__footer-msg", children: [
21
+ /* @__PURE__ */ n("span", { className: "gloss-panel-chrome-v2__footer-msg-primary", children: e }),
22
+ t != null && /* @__PURE__ */ n("span", { className: "gloss-panel-chrome-v2__footer-msg-secondary", children: t })
23
+ ] });
21
24
  }
22
- function ze({
25
+ function Ve({
23
26
  value: e,
24
27
  onChange: t,
25
- enabled: l = !1,
28
+ enabled: r = !1,
26
29
  onToggleEnabled: o
27
30
  }) {
28
- const n = "settings-threshold-enabled";
31
+ const a = "settings-threshold-enabled";
29
32
  return /* @__PURE__ */ f("div", { className: "settings-shell__field settings-shell__field--threshold", children: [
30
33
  /* @__PURE__ */ f("div", { className: "settings-shell__toggle-row", children: [
31
- /* @__PURE__ */ a("label", { htmlFor: n, className: "settings-shell__toggle-label", children: "Show threshold indicator" }),
32
- /* @__PURE__ */ a(
34
+ /* @__PURE__ */ n("label", { htmlFor: a, className: "settings-shell__toggle-label", children: "Show threshold indicator" }),
35
+ /* @__PURE__ */ n(
33
36
  "input",
34
37
  {
35
- id: n,
38
+ id: a,
36
39
  type: "checkbox",
37
40
  role: "switch",
38
41
  "aria-label": "Enable threshold indicator",
39
- "aria-checked": l,
40
- checked: l,
42
+ "aria-checked": r,
43
+ checked: r,
41
44
  onChange: (i) => o?.(i.target.checked),
42
45
  className: "settings-shell__toggle"
43
46
  }
44
47
  )
45
48
  ] }),
46
- l ? /* @__PURE__ */ f(z, { children: [
47
- /* @__PURE__ */ a("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Alert level (%)" }),
49
+ r ? /* @__PURE__ */ f(L, { children: [
50
+ /* @__PURE__ */ n("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Alert level (%)" }),
48
51
  /* @__PURE__ */ f("div", { className: "settings-shell__slider-row", children: [
49
- /* @__PURE__ */ a(
52
+ /* @__PURE__ */ n(
50
53
  "input",
51
54
  {
52
55
  id: "settings-threshold-input",
@@ -67,14 +70,14 @@ function ze({
67
70
  "%"
68
71
  ] })
69
72
  ] })
70
- ] }) : /* @__PURE__ */ a("p", { className: "settings-shell__help", "aria-live": "polite", children: "Off — the card uses its default styling. Turn on to tint values below the threshold." })
73
+ ] }) : /* @__PURE__ */ n("p", { className: "settings-shell__help", "aria-live": "polite", children: "Off — the card uses its default styling. Turn on to tint values below the threshold." })
71
74
  ] });
72
75
  }
73
- function He({ value: e, onChange: t }) {
76
+ function Be({ value: e, onChange: t }) {
74
77
  return /* @__PURE__ */ f("div", { className: "settings-shell__field settings-shell__field--timeframe", children: [
75
- /* @__PURE__ */ a("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Rolling period (days)" }),
78
+ /* @__PURE__ */ n("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Rolling period (days)" }),
76
79
  /* @__PURE__ */ f("div", { className: "settings-shell__slider-row", children: [
77
- /* @__PURE__ */ a(
80
+ /* @__PURE__ */ n(
78
81
  "input",
79
82
  {
80
83
  id: "settings-timeframe-input",
@@ -97,32 +100,32 @@ function He({ value: e, onChange: t }) {
97
100
  ] })
98
101
  ] });
99
102
  }
100
- function Ve({ id: e, onRemove: t }) {
101
- const { attributes: l, listeners: o, setNodeRef: n, transform: i, transition: u, isDragging: r } = $e({ id: e }), s = {
102
- transform: Re.Transform.toString(i),
103
+ function Ke({ id: e, onRemove: t }) {
104
+ const { attributes: r, listeners: o, setNodeRef: a, transform: i, transition: u, isDragging: l } = Ue({ id: e }), s = {
105
+ transform: ze.Transform.toString(i),
103
106
  transition: u,
104
- opacity: r ? 0.6 : 1
107
+ opacity: l ? 0.6 : 1
105
108
  };
106
109
  return /* @__PURE__ */ f(
107
110
  "li",
108
111
  {
109
- ref: n,
112
+ ref: a,
110
113
  style: s,
111
- className: `settings-shell__slot-pill${r ? " settings-shell__slot-pill--dragging" : ""}`,
114
+ className: `settings-shell__slot-pill${l ? " settings-shell__slot-pill--dragging" : ""}`,
112
115
  children: [
113
- /* @__PURE__ */ a(
116
+ /* @__PURE__ */ n(
114
117
  "button",
115
118
  {
116
119
  type: "button",
117
120
  className: "settings-shell__slot-pill__handle",
118
121
  "aria-label": `Reorder ${e}`,
119
- ...l,
122
+ ...r,
120
123
  ...o,
121
- children: /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "settings-shell__slot-pill__grip", children: "⋮⋮" })
124
+ children: /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "settings-shell__slot-pill__grip", children: "⋮⋮" })
122
125
  }
123
126
  ),
124
- /* @__PURE__ */ a("span", { className: "settings-shell__slot-pill__label", children: e }),
125
- /* @__PURE__ */ a(
127
+ /* @__PURE__ */ n("span", { className: "settings-shell__slot-pill__label", children: e }),
128
+ /* @__PURE__ */ n(
126
129
  "button",
127
130
  {
128
131
  type: "button",
@@ -136,55 +139,55 @@ function Ve({ id: e, onRemove: t }) {
136
139
  }
137
140
  );
138
141
  }
139
- function Ke({ value: e, onChange: t }) {
140
- const l = Pe(
141
- oe(xe, { activationConstraint: { distance: 4 } }),
142
- oe(Ae, { coordinateGetter: Oe })
143
- ), o = $.useRef(!1), [n, i] = $.useState(!1), u = (s) => {
142
+ function Ye({ value: e, onChange: t }) {
143
+ const r = ke(
144
+ ce(De, { activationConstraint: { distance: 4 } }),
145
+ ce(Le, { coordinateGetter: Ie })
146
+ ), o = H.useRef(!1), [a, i] = H.useState(!1), u = (s) => {
144
147
  const { active: c, over: d } = s;
145
148
  if (!d || c.id === d.id) return;
146
- const p = e.findIndex((b) => b === c.id), h = e.findIndex((b) => b === d.id);
147
- p === -1 || h === -1 || t(Me([...e], p, h));
148
- }, r = (s) => {
149
+ const m = e.findIndex((b) => b === c.id), h = e.findIndex((b) => b === d.id);
150
+ m === -1 || h === -1 || t(Fe([...e], m, h));
151
+ }, l = (s) => {
149
152
  o.current || (o.current = !0, i(!0)), t(e.filter((c) => c !== s));
150
153
  };
151
154
  return /* @__PURE__ */ f("div", { className: "settings-shell__field settings-shell__field--slots", "aria-label": "Stack slots", children: [
152
- /* @__PURE__ */ a("span", { className: "settings-shell__label", children: "Stack slots" }),
153
- /* @__PURE__ */ a(ke, { sensors: l, collisionDetection: De, onDragEnd: u, children: /* @__PURE__ */ a(Le, { items: [...e], strategy: Ie, children: /* @__PURE__ */ a("ul", { className: "settings-shell__slots-list", role: "list", children: e.map((s) => /* @__PURE__ */ a(Ve, { id: s, onRemove: () => r(s) }, s)) }) }) }),
154
- e.length === 0 && n && /* @__PURE__ */ a("p", { className: "settings-shell__help", children: "All slots removed. Apply to commit, or Reset to restore." }),
155
- /* @__PURE__ */ a("p", { className: "settings-shell__help settings-shell__help--small", children: "Drag to reorder · click × to remove" })
155
+ /* @__PURE__ */ n("span", { className: "settings-shell__label", children: "Stack slots" }),
156
+ /* @__PURE__ */ n(Oe, { sensors: r, collisionDetection: Me, onDragEnd: u, children: /* @__PURE__ */ n($e, { items: [...e], strategy: Re, children: /* @__PURE__ */ n("ul", { className: "settings-shell__slots-list", role: "list", children: e.map((s) => /* @__PURE__ */ n(Ke, { id: s, onRemove: () => l(s) }, s)) }) }) }),
157
+ e.length === 0 && a && /* @__PURE__ */ n("p", { className: "settings-shell__help", children: "All slots removed. Apply to commit, or Reset to restore." }),
158
+ /* @__PURE__ */ n("p", { className: "settings-shell__help settings-shell__help--small", children: "Drag to reorder · click × to remove" })
156
159
  ] });
157
160
  }
158
- const Ye = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
159
- function Be({
161
+ const We = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
162
+ function Ge({
160
163
  value: e,
161
164
  onSelect: t,
162
- enabled: l = !1,
165
+ enabled: r = !1,
163
166
  onToggleEnabled: o
164
167
  }) {
165
- const n = "settings-accent-enabled";
168
+ const a = "settings-accent-enabled";
166
169
  return /* @__PURE__ */ f("div", { className: "settings-shell__field settings-shell__field--color", role: "group", "aria-label": "Accent color", children: [
167
170
  /* @__PURE__ */ f("div", { className: "settings-shell__toggle-row", children: [
168
- /* @__PURE__ */ a("label", { htmlFor: n, className: "settings-shell__toggle-label", children: "Override default accent" }),
169
- /* @__PURE__ */ a(
171
+ /* @__PURE__ */ n("label", { htmlFor: a, className: "settings-shell__toggle-label", children: "Override default accent" }),
172
+ /* @__PURE__ */ n(
170
173
  "input",
171
174
  {
172
- id: n,
175
+ id: a,
173
176
  type: "checkbox",
174
177
  role: "switch",
175
178
  "aria-label": "Enable accent override",
176
- "aria-checked": l,
177
- checked: l,
179
+ "aria-checked": r,
180
+ checked: r,
178
181
  onChange: (i) => o?.(i.target.checked),
179
182
  className: "settings-shell__toggle"
180
183
  }
181
184
  )
182
185
  ] }),
183
- l ? /* @__PURE__ */ f(z, { children: [
184
- /* @__PURE__ */ a("span", { className: "settings-shell__label", children: "Accent color" }),
185
- /* @__PURE__ */ a("div", { className: "settings-shell__swatch-row", children: Ye.map((i) => {
186
+ r ? /* @__PURE__ */ f(L, { children: [
187
+ /* @__PURE__ */ n("span", { className: "settings-shell__label", children: "Accent color" }),
188
+ /* @__PURE__ */ n("div", { className: "settings-shell__swatch-row", children: We.map((i) => {
186
189
  const u = e === i;
187
- return /* @__PURE__ */ a(
190
+ return /* @__PURE__ */ n(
188
191
  "button",
189
192
  {
190
193
  type: "button",
@@ -197,86 +200,130 @@ function Be({
197
200
  i
198
201
  );
199
202
  }) })
200
- ] }) : /* @__PURE__ */ a("p", { className: "settings-shell__help", "aria-live": "polite", children: "Off — the card uses its default accent. Turn on to override." })
203
+ ] }) : /* @__PURE__ */ n("p", { className: "settings-shell__help", "aria-live": "polite", children: "Off — the card uses its default accent. Turn on to override." })
201
204
  ] });
202
205
  }
203
- const We = ["Orders", "Quota", "Unassigned"], Ge = ["threshold", "timeframe", "color"];
204
- function St({
206
+ const Qe = ["Orders", "Quota", "Unassigned"], qe = ["threshold", "timeframe", "color"];
207
+ function xt({
205
208
  isOpen: e,
206
209
  cardSpan: t,
207
- cardLabel: l = "Metric",
210
+ cardLabel: r = "Metric",
208
211
  cardValue: o = "—",
209
- previewSlot: n,
210
- dimensions: i = Ge,
212
+ previewSlot: a,
213
+ dimensions: i = qe,
211
214
  initialTab: u,
212
- initialValues: r
215
+ initialValues: l
213
216
  }) {
214
- const s = U(), c = s?.state.activeTrigger, d = c?.kind === "card-overflow" ? c.cardId : null, p = me(), h = c?.span, b = t ?? h ?? 1, m = i[0] ?? "threshold", [v, w] = $.useState(u ?? m);
215
- $.useEffect(() => {
216
- i.includes(v) || w(m);
217
- }, [i, v, m]);
218
- const T = d != null ? s?.state?.bufferByCard?.[d]?.changes ?? {} : {}, y = typeof T.threshold == "number" ? T.threshold : typeof r?.threshold == "number" ? r.threshold : 80, A = typeof T.timeframe == "number" ? T.timeframe : typeof r?.timeframe == "number" ? r.timeframe : 30, V = typeof T.accent == "string" ? T.accent : typeof r?.accent == "string" ? r.accent : null, K = Array.isArray(T.slots) ? T.slots : Array.isArray(r?.slots) ? r.slots : We, D = typeof T.thresholdEnabled == "boolean" ? T.thresholdEnabled : typeof r?.thresholdEnabled == "boolean" ? r.thresholdEnabled : !1, Y = typeof T.accentEnabled == "boolean" ? T.accentEnabled : typeof r?.accentEnabled == "boolean" ? r.accentEnabled : !1, B = (C) => {
219
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "threshold", value: Number(C.target.value) });
220
- }, W = (C) => {
221
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "timeframe", value: Number(C.target.value) });
222
- }, re = (C) => {
223
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accent", value: C });
224
- }, G = (C) => {
225
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "slots", value: C });
226
- }, g = (C) => {
227
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "thresholdEnabled", value: C });
228
- }, N = (C) => {
229
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accentEnabled", value: C });
230
- };
231
- return /* @__PURE__ */ f("div", { className: "settings-shell", "data-shell": "settings", "aria-hidden": !e, children: [
232
- /* @__PURE__ */ a("div", { "aria-hidden": "true", children: /* @__PURE__ */ a(Fe, { children: /* @__PURE__ */ a(Ue, { span: b, rotating: !p, children: n ?? /* @__PURE__ */ f(z, { children: [
233
- /* @__PURE__ */ a("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: l }),
234
- /* @__PURE__ */ a("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: o })
235
- ] }) }) }) }),
236
- /* @__PURE__ */ a(
237
- Ne,
238
- {
239
- dimensions: i,
240
- activeTab: v,
241
- onSelect: w,
242
- reduced: p
243
- }
244
- ),
245
- /* @__PURE__ */ f(
246
- "div",
247
- {
248
- role: "tabpanel",
249
- id: `settings-tabpanel-${v}`,
250
- "aria-label": "Settings dimension controls",
251
- tabIndex: 0,
252
- className: "settings-shell__tabpanel",
253
- children: [
254
- v === "threshold" && /* @__PURE__ */ a(
255
- ze,
217
+ const s = I(), c = s?.state.activeTrigger, d = c?.kind === "card-overflow" ? c.cardId : null, m = fe(), h = c?.span, b = t ?? h ?? 1, p = i[0] ?? "threshold", [v, E] = H.useState(u ?? p);
218
+ H.useEffect(() => {
219
+ i.includes(v) || E(p);
220
+ }, [i, v, p]);
221
+ const y = d != null ? s?.state?.bufferByCard?.[d]?.changes ?? {} : {}, N = typeof y.threshold == "number" ? y.threshold : typeof l?.threshold == "number" ? l.threshold : 80, O = typeof y.timeframe == "number" ? y.timeframe : typeof l?.timeframe == "number" ? l.timeframe : 30, R = typeof y.accent == "string" ? y.accent : typeof l?.accent == "string" ? l.accent : null, F = Array.isArray(y.slots) ? y.slots : Array.isArray(l?.slots) ? l.slots : Qe, T = typeof y.thresholdEnabled == "boolean" ? y.thresholdEnabled : typeof l?.thresholdEnabled == "boolean" ? l.thresholdEnabled : !1, M = typeof y.accentEnabled == "boolean" ? y.accentEnabled : typeof l?.accentEnabled == "boolean" ? l.accentEnabled : !1, W = (P) => {
222
+ d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "threshold", value: Number(P.target.value) });
223
+ }, G = (P) => {
224
+ d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "timeframe", value: Number(P.target.value) });
225
+ }, oe = (P) => {
226
+ d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accent", value: P });
227
+ }, Q = (P) => {
228
+ d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "slots", value: P });
229
+ }, q = (P) => {
230
+ d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "thresholdEnabled", value: P });
231
+ }, g = (P) => {
232
+ d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accentEnabled", value: P });
233
+ }, C = s?.state.isDirty ?? !1, w = d;
234
+ return /* @__PURE__ */ n(
235
+ K,
236
+ {
237
+ variant: "with-stage",
238
+ title: "Configure metric",
239
+ onClose: () => s?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }),
240
+ stage: /* @__PURE__ */ n(He, { span: b, rotating: !m, children: a ?? /* @__PURE__ */ f(L, { children: [
241
+ /* @__PURE__ */ n("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: r }),
242
+ /* @__PURE__ */ n("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: o })
243
+ ] }) }),
244
+ navigation: /* @__PURE__ */ n(
245
+ we,
246
+ {
247
+ dimensions: i,
248
+ activeTab: v,
249
+ onSelect: E,
250
+ reduced: m
251
+ }
252
+ ),
253
+ footer: {
254
+ left: /* @__PURE__ */ n(
255
+ "button",
256
+ {
257
+ id: "btn-reset",
258
+ type: "button",
259
+ className: "gloss-panel-chrome-v2__footer-btn",
260
+ disabled: !C,
261
+ onClick: () => {
262
+ w != null && s?.dispatch({ type: "CLEAR_BUFFER", cardId: w });
263
+ },
264
+ children: "Reset"
265
+ }
266
+ ),
267
+ right: /* @__PURE__ */ f(L, { children: [
268
+ /* @__PURE__ */ n(
269
+ "button",
256
270
  {
257
- value: y,
258
- onChange: B,
259
- enabled: D,
260
- onToggleEnabled: g
271
+ id: "settings-cancel",
272
+ type: "button",
273
+ className: "gloss-panel-chrome-v2__footer-btn",
274
+ onClick: () => s?.dispatch({ type: "CLOSE_PANEL", reason: "cancel-button" }),
275
+ children: "Cancel"
261
276
  }
262
277
  ),
263
- v === "timeframe" && /* @__PURE__ */ a(He, { value: A, onChange: W }),
264
- v === "slots" && /* @__PURE__ */ a(Ke, { value: K, onChange: G }),
265
- v === "color" && /* @__PURE__ */ a(
266
- Be,
278
+ /* @__PURE__ */ n(
279
+ "button",
267
280
  {
268
- value: V,
269
- onSelect: re,
270
- enabled: Y,
271
- onToggleEnabled: N
281
+ id: "settings-apply",
282
+ type: "button",
283
+ className: "gloss-panel-chrome-v2__footer-btn gloss-panel-chrome-v2__footer-btn--primary",
284
+ disabled: !C,
285
+ onClick: () => s?.dispatch({ type: "CLOSE_PANEL", reason: "apply-button" }),
286
+ children: "Apply"
272
287
  }
273
288
  )
274
- ]
275
- }
276
- )
277
- ] });
289
+ ] })
290
+ },
291
+ children: /* @__PURE__ */ n("div", { className: "settings-shell", "data-shell": "settings", "aria-hidden": !e, children: /* @__PURE__ */ f(
292
+ "div",
293
+ {
294
+ role: "tabpanel",
295
+ id: `settings-tabpanel-${v}`,
296
+ "aria-label": "Settings dimension controls",
297
+ tabIndex: 0,
298
+ className: "settings-shell__tabpanel",
299
+ children: [
300
+ v === "threshold" && /* @__PURE__ */ n(
301
+ Ve,
302
+ {
303
+ value: N,
304
+ onChange: W,
305
+ enabled: T,
306
+ onToggleEnabled: q
307
+ }
308
+ ),
309
+ v === "timeframe" && /* @__PURE__ */ n(Be, { value: O, onChange: G }),
310
+ v === "slots" && /* @__PURE__ */ n(Ye, { value: F, onChange: Q }),
311
+ v === "color" && /* @__PURE__ */ n(
312
+ Ge,
313
+ {
314
+ value: R,
315
+ onSelect: oe,
316
+ enabled: M,
317
+ onToggleEnabled: g
318
+ }
319
+ )
320
+ ]
321
+ }
322
+ ) })
323
+ }
324
+ );
278
325
  }
279
- const ge = [
326
+ const ve = [
280
327
  "Overbought",
281
328
  "What's selling",
282
329
  "On track vs plan",
@@ -284,7 +331,7 @@ const ge = [
284
331
  "Vendor performance",
285
332
  "Assortment mix",
286
333
  "Customer retention"
287
- ], be = "Overbought", ne = {
334
+ ], ye = "Overbought", ae = {
288
335
  Overbought: {
289
336
  headline: "Am I overbought?",
290
337
  helper: "Find slow-moving inventory before discount cycles eat margin."
@@ -314,8 +361,8 @@ const ge = [
314
361
  helper: "Repeat-rate and lapsed-account signals from the buyer file."
315
362
  }
316
363
  };
317
- ne["Customer retention"].beta = !0;
318
- const ve = {
364
+ ae["Customer retention"].beta = !0;
365
+ const _e = {
319
366
  Overbought: {
320
367
  primary: [
321
368
  {
@@ -780,15 +827,15 @@ const ve = {
780
827
  ]
781
828
  }
782
829
  };
783
- function ye({
830
+ function Ce({
784
831
  lenses: e,
785
832
  activeLens: t,
786
- onLensChange: l,
833
+ onLensChange: r,
787
834
  variant: o = "pills",
788
- lensMeta: n = ne
835
+ lensMeta: a = ae
789
836
  }) {
790
- return o === "pills" ? /* @__PURE__ */ a("div", { className: "cat-pills-wrap", children: /* @__PURE__ */ a("div", { className: "cat-pills", role: "tablist", "aria-label": "Metric lenses", children: e.map((i) => {
791
- const u = i === t, r = n[i], s = ["cat-pill"];
837
+ return o === "pills" ? /* @__PURE__ */ n("div", { className: "cat-pills-wrap", children: /* @__PURE__ */ n("div", { className: "cat-pills", role: "tablist", "aria-label": "Metric lenses", children: e.map((i) => {
838
+ const u = i === t, l = a[i], s = ["cat-pill"];
792
839
  return u && s.push("active"), /* @__PURE__ */ f(
793
840
  "button",
794
841
  {
@@ -798,29 +845,29 @@ function ye({
798
845
  className: s.join(" "),
799
846
  "data-lens": i,
800
847
  onClick: () => {
801
- u || l(i);
848
+ u || r(i);
802
849
  },
803
850
  children: [
804
851
  i,
805
- r?.beta && /* @__PURE__ */ a("span", { className: "cat-pill-beta", "aria-label": "Beta", children: "BETA" })
852
+ l?.beta && /* @__PURE__ */ n("span", { className: "cat-pill-beta", "aria-label": "Beta", children: "BETA" })
806
853
  ]
807
854
  },
808
855
  i
809
856
  );
810
- }) }) }) : /* @__PURE__ */ a(Qe, { lenses: e, activeLens: t, onLensChange: l });
857
+ }) }) }) : /* @__PURE__ */ n(je, { lenses: e, activeLens: t, onLensChange: r });
811
858
  }
812
- function Qe({
859
+ function je({
813
860
  lenses: e,
814
861
  activeLens: t,
815
- onLensChange: l
862
+ onLensChange: r
816
863
  }) {
817
- const [o, n] = E(!1), i = H(null), u = () => {
864
+ const [o, a] = x(!1), i = Y(null), u = () => {
818
865
  i.current != null && (window.clearTimeout(i.current), i.current = null);
819
- }, r = () => {
820
- u(), i.current = window.setTimeout(() => n(!1), 100);
866
+ }, l = () => {
867
+ u(), i.current = window.setTimeout(() => a(!1), 100);
821
868
  }, s = e.filter((c) => c !== t);
822
- return /* @__PURE__ */ a("div", { className: "cat-segmented-wrap", children: /* @__PURE__ */ f("div", { className: "cat-segmented", children: [
823
- /* @__PURE__ */ a(
869
+ return /* @__PURE__ */ n("div", { className: "cat-segmented-wrap", children: /* @__PURE__ */ f("div", { className: "cat-segmented", children: [
870
+ /* @__PURE__ */ n(
824
871
  "button",
825
872
  {
826
873
  type: "button",
@@ -835,26 +882,26 @@ function Qe({
835
882
  {
836
883
  className: "cat-seg-more",
837
884
  onMouseEnter: () => {
838
- u(), n(!0);
885
+ u(), a(!0);
839
886
  },
840
- onMouseLeave: r,
887
+ onMouseLeave: l,
841
888
  children: [
842
- /* @__PURE__ */ a("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": o, children: "More ▾" }),
843
- o && /* @__PURE__ */ a(
889
+ /* @__PURE__ */ n("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": o, children: "More ▾" }),
890
+ o && /* @__PURE__ */ n(
844
891
  "div",
845
892
  {
846
893
  className: "cat-seg-overflow",
847
894
  role: "menu",
848
895
  onMouseEnter: u,
849
- onMouseLeave: r,
850
- children: s.map((c) => /* @__PURE__ */ a(
896
+ onMouseLeave: l,
897
+ children: s.map((c) => /* @__PURE__ */ n(
851
898
  "button",
852
899
  {
853
900
  type: "button",
854
901
  "data-lens": c,
855
902
  role: "menuitem",
856
903
  onClick: () => {
857
- l(c), n(!1);
904
+ r(c), a(!1);
858
905
  },
859
906
  children: c
860
907
  },
@@ -867,19 +914,19 @@ function Qe({
867
914
  )
868
915
  ] }) });
869
916
  }
870
- function ee({ tiles: e, selectedTileId: t, onSelectTile: l, renderTile: o }) {
871
- return /* @__PURE__ */ a("div", { className: "cat-tiles", children: e.map((n) => {
872
- const i = n.id === t, u = n.subStats != null && n.subStats.length > 0;
873
- let r = null;
874
- u ? n.subStats.length === 5 ? r = "span-5" : n.subStats.length === 3 ? r = "span-3" : r = "span-2" : n.stack === !0 && (r = "span-2");
917
+ function te({ tiles: e, selectedTileId: t, onSelectTile: r, renderTile: o }) {
918
+ return /* @__PURE__ */ n("div", { className: "cat-tiles", children: e.map((a) => {
919
+ const i = a.id === t, u = a.subStats != null && a.subStats.length > 0;
920
+ let l = null;
921
+ u ? a.subStats.length === 5 ? l = "span-5" : a.subStats.length === 3 ? l = "span-3" : l = "span-2" : a.stack === !0 && (l = "span-2");
875
922
  const s = ["cat-tile"];
876
- r && s.push(r), i && s.push("selected"), n.isNew && s.push("is-new"), n.startHere && s.push("start-here"), n.donut && s.push("has-donut");
923
+ l && s.push(l), i && s.push("selected"), a.isNew && s.push("is-new"), a.startHere && s.push("start-here"), a.donut && s.push("has-donut");
877
924
  const c = 1;
878
925
  let d = 0.7;
879
- if (n.donut) {
880
- const p = /([\d.]+)\s*%/.exec(n.value);
881
- if (p) {
882
- const h = parseFloat(p[1]);
926
+ if (a.donut) {
927
+ const m = /([\d.]+)\s*%/.exec(a.value);
928
+ if (m) {
929
+ const h = parseFloat(m[1]);
883
930
  Number.isFinite(h) && (d = Math.max(0, Math.min(1, h / 100)));
884
931
  }
885
932
  }
@@ -888,66 +935,66 @@ function ee({ tiles: e, selectedTileId: t, onSelectTile: l, renderTile: o }) {
888
935
  {
889
936
  type: "button",
890
937
  className: s.join(" "),
891
- "data-metric": n.id,
892
- "data-desc": n.desc,
938
+ "data-metric": a.id,
939
+ "data-desc": a.desc,
893
940
  "data-col-span": String(c),
894
- "data-donut": n.donut ? "true" : void 0,
895
- "data-accent": n.accent,
941
+ "data-donut": a.donut ? "true" : void 0,
942
+ "data-accent": a.accent,
896
943
  "aria-pressed": i,
897
- onClick: () => l(n.id, n.desc),
898
- style: n.accent ? { "--cat-tile-accent": n.accent } : void 0,
944
+ onClick: () => r(a.id, a.desc),
945
+ style: a.accent ? { "--cat-tile-accent": a.accent } : void 0,
899
946
  children: [
900
- n.startHere && /* @__PURE__ */ a("span", { className: "cat-tile-start-here", "aria-hidden": "true", children: "START HERE" }),
901
- o ? o(n) : /* @__PURE__ */ a(
947
+ a.startHere && /* @__PURE__ */ n("span", { className: "cat-tile-start-here", "aria-hidden": "true", children: "START HERE" }),
948
+ o ? o(a) : /* @__PURE__ */ n(
902
949
  "div",
903
950
  {
904
951
  className: "cat-tile-primitive-wrapper gloss-metric-card",
905
952
  "data-col-span": "1",
906
953
  style: { pointerEvents: "none", width: "100%", height: "100%" },
907
954
  "aria-hidden": "true",
908
- children: n.donut ? /* @__PURE__ */ a(
909
- ie,
955
+ children: a.donut ? /* @__PURE__ */ n(
956
+ de,
910
957
  {
911
958
  variant: "donut",
912
- label: n.label,
913
- value: n.value,
959
+ label: a.label,
960
+ value: a.value,
914
961
  donutValue: d,
915
962
  donutMax: 1,
916
- accentColor: n.accent,
963
+ accentColor: a.accent,
917
964
  colSpan: c
918
965
  }
919
- ) : /* @__PURE__ */ a(
920
- ie,
966
+ ) : /* @__PURE__ */ n(
967
+ de,
921
968
  {
922
969
  variant: "standard",
923
- label: n.label,
924
- value: n.value,
970
+ label: a.label,
971
+ value: a.value,
925
972
  colSpan: c
926
973
  }
927
974
  )
928
975
  }
929
976
  ),
930
- n.variants && n.variants.length > 0 && /* @__PURE__ */ a("span", { className: "cat-tile-variants", "aria-hidden": "true", children: n.variants.map((p) => /* @__PURE__ */ a("span", { children: p }, p)) }),
931
- n.isNew && /* @__PURE__ */ a("span", { className: "cat-tile-new-dot", "aria-hidden": "true" })
977
+ a.variants && a.variants.length > 0 && /* @__PURE__ */ n("span", { className: "cat-tile-variants", "aria-hidden": "true", children: a.variants.map((m) => /* @__PURE__ */ n("span", { children: m }, m)) }),
978
+ a.isNew && /* @__PURE__ */ n("span", { className: "cat-tile-new-dot", "aria-hidden": "true" })
932
979
  ]
933
980
  },
934
- n.id
981
+ a.id
935
982
  );
936
983
  }) });
937
984
  }
938
- const ae = he(null);
939
- function qe() {
940
- return fe(ae);
985
+ const se = ge(null);
986
+ function re() {
987
+ return be(se);
941
988
  }
942
- function je({ mode: e, dispatch: t }) {
943
- const l = qe();
944
- if (l == null && e == null) return null;
945
- const o = l?.mode ?? e ?? "add", n = l?.selectedTileId ?? null, i = l?.description ?? null, u = n == null;
989
+ function At({ mode: e, dispatch: t }) {
990
+ const r = re();
991
+ if (r == null && e == null) return null;
992
+ const o = r?.mode ?? e ?? "add", a = r?.selectedTileId ?? null, i = r?.description ?? null, u = a == null;
946
993
  return /* @__PURE__ */ f("div", { className: "panel-footer catalog", children: [
947
- /* @__PURE__ */ a("div", { className: "cat-description", id: "cat-desc", children: i ?? /* @__PURE__ */ a("em", { children: "Tap a metric to see its description" }) }),
994
+ /* @__PURE__ */ n("div", { className: "cat-description", id: "cat-desc", children: i ?? /* @__PURE__ */ n("em", { children: "Tap a metric to see its description" }) }),
948
995
  /* @__PURE__ */ f("div", { style: { display: "flex", padding: "10px 14px", gap: 8 }, children: [
949
- /* @__PURE__ */ a("div", { className: "spacer", style: { flex: 1 } }),
950
- /* @__PURE__ */ a(
996
+ /* @__PURE__ */ n("div", { className: "spacer", style: { flex: 1 } }),
997
+ /* @__PURE__ */ n(
951
998
  "button",
952
999
  {
953
1000
  id: "btn-cat-cancel",
@@ -957,7 +1004,7 @@ function je({ mode: e, dispatch: t }) {
957
1004
  children: "Cancel"
958
1005
  }
959
1006
  ),
960
- o === "add" && /* @__PURE__ */ a(
1007
+ o === "add" && /* @__PURE__ */ n(
961
1008
  "button",
962
1009
  {
963
1010
  id: "btn-cat-add",
@@ -968,7 +1015,7 @@ function je({ mode: e, dispatch: t }) {
968
1015
  children: "Add metric"
969
1016
  }
970
1017
  ),
971
- o === "replace" && /* @__PURE__ */ a(
1018
+ o === "replace" && /* @__PURE__ */ n(
972
1019
  "button",
973
1020
  {
974
1021
  id: "btn-cat-replace",
@@ -982,174 +1029,242 @@ function je({ mode: e, dispatch: t }) {
982
1029
  ] })
983
1030
  ] });
984
1031
  }
985
- function ce(e, t) {
1032
+ function ue(e, t) {
986
1033
  if (t.length === 0) return !0;
987
- const l = t.toLowerCase();
988
- if (e.label.toLowerCase().includes(l) || e.value.toLowerCase().includes(l)) return !0;
1034
+ const r = t.toLowerCase();
1035
+ if (e.label.toLowerCase().includes(r) || e.value.toLowerCase().includes(r)) return !0;
989
1036
  if (e.subStats) {
990
1037
  for (const o of e.subStats)
991
- if (o.label.toLowerCase().includes(l) || o.value.toLowerCase().includes(l)) return !0;
1038
+ if (o.label.toLowerCase().includes(r) || o.value.toLowerCase().includes(r)) return !0;
992
1039
  }
993
1040
  return !1;
994
1041
  }
995
- function wt({
1042
+ function Ze() {
1043
+ const t = re()?.description ?? null;
1044
+ return t == null ? /* @__PURE__ */ n("em", { children: "Tap a metric to see its description" }) : /* @__PURE__ */ n(L, { children: t });
1045
+ }
1046
+ function kt({
996
1047
  isOpen: e,
997
- lenses: t = ge,
998
- defaultLens: l = be,
999
- tilesByLens: o = ve,
1000
- lensMeta: n = ne,
1001
- footerSlot: i,
1002
- renderTile: u
1048
+ lenses: t = ve,
1049
+ defaultLens: r = ye,
1050
+ tilesByLens: o = _e,
1051
+ lensMeta: a = ae,
1052
+ renderTile: i
1003
1053
  }) {
1004
- const [r, s] = E(l), [c, d] = E(null), [p, h] = E(null), [b, m] = E(""), v = o[r] ?? { primary: [] }, w = n[r], S = le(
1005
- () => v.primary.filter((y) => ce(y, b)),
1054
+ const u = I(), [l, s] = x(r), [c, d] = x(null), [m, h] = x(null), [b, p] = x(""), v = o[l] ?? { primary: [] }, E = a[l], S = ie(
1055
+ () => v.primary.filter((T) => ue(T, b)),
1006
1056
  [v.primary, b]
1007
- ), T = le(
1008
- () => (v.secondary ?? []).filter((y) => ce(y, b)),
1057
+ ), y = ie(
1058
+ () => (v.secondary ?? []).filter((T) => ue(T, b)),
1009
1059
  [v.secondary, b]
1010
- );
1011
- return /* @__PURE__ */ f(
1012
- ae.Provider,
1060
+ ), N = () => u?.dispatch({ type: "CLOSE_PANEL", reason: "cancel-button" }), O = () => u?.dispatch({ type: "CLOSE_PANEL", reason: "apply-button" }), R = () => u?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }), F = c == null;
1061
+ return /* @__PURE__ */ n(
1062
+ se.Provider,
1013
1063
  {
1014
- value: { mode: "add", selectedTileId: c, description: p },
1015
- children: [
1016
- /* @__PURE__ */ f("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
1017
- /* @__PURE__ */ a("div", { className: "cat-search", children: /* @__PURE__ */ a(
1018
- "input",
1019
- {
1020
- type: "search",
1021
- className: "cat-search-input",
1022
- placeholder: "Search metrics",
1023
- "aria-label": "Search metrics",
1024
- value: b,
1025
- onChange: (y) => m(y.target.value)
1026
- }
1027
- ) }),
1028
- /* @__PURE__ */ a(
1029
- ye,
1030
- {
1031
- lenses: t,
1032
- activeLens: r,
1033
- lensMeta: n,
1034
- variant: "pills",
1035
- onLensChange: (y) => {
1036
- s(y), d(null), h(null), m("");
1064
+ value: { mode: "add", selectedTileId: c, description: m },
1065
+ children: /* @__PURE__ */ n(
1066
+ K,
1067
+ {
1068
+ variant: "no-stage",
1069
+ title: "Add a metric",
1070
+ onClose: R,
1071
+ footer: {
1072
+ left: /* @__PURE__ */ n(Ze, {}),
1073
+ right: /* @__PURE__ */ f(L, { children: [
1074
+ /* @__PURE__ */ n(
1075
+ "button",
1076
+ {
1077
+ id: "btn-cat-cancel",
1078
+ type: "button",
1079
+ className: "gloss-panel-chrome-v2__footer-btn",
1080
+ onClick: N,
1081
+ children: "Cancel"
1082
+ }
1083
+ ),
1084
+ /* @__PURE__ */ n(
1085
+ "button",
1086
+ {
1087
+ id: "btn-cat-add",
1088
+ type: "button",
1089
+ className: "gloss-panel-chrome-v2__footer-btn gloss-panel-chrome-v2__footer-btn--primary",
1090
+ disabled: F,
1091
+ onClick: O,
1092
+ children: "Add metric"
1093
+ }
1094
+ )
1095
+ ] })
1096
+ },
1097
+ children: /* @__PURE__ */ f("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
1098
+ /* @__PURE__ */ n("div", { className: "cat-search", children: /* @__PURE__ */ n(
1099
+ "input",
1100
+ {
1101
+ type: "search",
1102
+ className: "cat-search-input",
1103
+ placeholder: "Search metrics",
1104
+ "aria-label": "Search metrics",
1105
+ value: b,
1106
+ onChange: (T) => p(T.target.value)
1037
1107
  }
1038
- }
1039
- ),
1040
- w && /* @__PURE__ */ f("div", { className: "cat-lens-meta", children: [
1041
- /* @__PURE__ */ a("h3", { className: "cat-lens-headline", children: w.headline }),
1042
- /* @__PURE__ */ a("p", { className: "cat-lens-helper", children: w.helper })
1043
- ] }),
1044
- /* @__PURE__ */ a(
1045
- ee,
1046
- {
1047
- tiles: S,
1048
- selectedTileId: c,
1049
- onSelectTile: (y, A) => {
1050
- d(y), h(A);
1051
- },
1052
- renderTile: u
1053
- }
1054
- ),
1055
- T.length > 0 && /* @__PURE__ */ f("div", { className: "cat-more-in-lens", children: [
1056
- /* @__PURE__ */ a("div", { className: "cat-more-in-lens__heading", children: "MORE IN THIS LENS" }),
1057
- /* @__PURE__ */ a(
1058
- ee,
1108
+ ) }),
1109
+ /* @__PURE__ */ n(
1110
+ Ce,
1111
+ {
1112
+ lenses: t,
1113
+ activeLens: l,
1114
+ lensMeta: a,
1115
+ variant: "pills",
1116
+ onLensChange: (T) => {
1117
+ s(T), d(null), h(null), p("");
1118
+ }
1119
+ }
1120
+ ),
1121
+ E && /* @__PURE__ */ f("div", { className: "cat-lens-meta", children: [
1122
+ /* @__PURE__ */ n("h3", { className: "cat-lens-headline", children: E.headline }),
1123
+ /* @__PURE__ */ n("p", { className: "cat-lens-helper", children: E.helper })
1124
+ ] }),
1125
+ /* @__PURE__ */ n(
1126
+ te,
1059
1127
  {
1060
- tiles: T,
1128
+ tiles: S,
1061
1129
  selectedTileId: c,
1062
- onSelectTile: (y, A) => {
1063
- d(y), h(A);
1130
+ onSelectTile: (T, M) => {
1131
+ d(T), h(M);
1064
1132
  },
1065
- renderTile: u
1133
+ renderTile: i
1066
1134
  }
1067
- )
1068
- ] }),
1069
- S.length === 0 && T.length === 0 && b.length > 0 && /* @__PURE__ */ f("div", { className: "cat-empty", children: [
1070
- 'No metrics match "',
1071
- b,
1072
- '".'
1135
+ ),
1136
+ y.length > 0 && /* @__PURE__ */ f("div", { className: "cat-more-in-lens", children: [
1137
+ /* @__PURE__ */ n("div", { className: "cat-more-in-lens__heading", children: "MORE IN THIS LENS" }),
1138
+ /* @__PURE__ */ n(
1139
+ te,
1140
+ {
1141
+ tiles: y,
1142
+ selectedTileId: c,
1143
+ onSelectTile: (T, M) => {
1144
+ d(T), h(M);
1145
+ },
1146
+ renderTile: i
1147
+ }
1148
+ )
1149
+ ] }),
1150
+ S.length === 0 && y.length === 0 && b.length > 0 && /* @__PURE__ */ f("div", { className: "cat-empty", children: [
1151
+ 'No metrics match "',
1152
+ b,
1153
+ '".'
1154
+ ] })
1073
1155
  ] })
1074
- ] }),
1075
- i
1076
- ]
1156
+ }
1157
+ )
1077
1158
  }
1078
1159
  );
1079
1160
  }
1080
- function Et({
1161
+ function Xe() {
1162
+ const t = re()?.description ?? null;
1163
+ return t == null ? /* @__PURE__ */ n("em", { children: "Tap a metric to see its description" }) : /* @__PURE__ */ n(L, { children: t });
1164
+ }
1165
+ function Dt({
1081
1166
  isOpen: e,
1082
1167
  replacingLabel: t,
1083
- lenses: l = ge,
1084
- defaultLens: o = be,
1085
- tilesByLens: n = ve,
1086
- footerSlot: i,
1087
- renderTile: u
1168
+ lenses: r = ve,
1169
+ defaultLens: o = ye,
1170
+ tilesByLens: a = _e,
1171
+ renderTile: i
1088
1172
  }) {
1089
- const [r, s] = E(o), [c, d] = E(null), [p, h] = E(null), b = n[r] ?? { primary: [] }, m = [...b.primary, ...b.secondary ?? []];
1090
- return /* @__PURE__ */ f(
1091
- ae.Provider,
1173
+ const u = I(), [l, s] = x(o), [c, d] = x(null), [m, h] = x(null), b = a[l] ?? { primary: [] }, p = [...b.primary, ...b.secondary ?? []], v = () => u?.dispatch({ type: "CLOSE_PANEL", reason: "cancel-button" }), E = () => u?.dispatch({ type: "CLOSE_PANEL", reason: "apply-button" }), S = () => u?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }), y = c == null;
1174
+ return /* @__PURE__ */ n(
1175
+ se.Provider,
1092
1176
  {
1093
- value: { mode: "replace", selectedTileId: c, description: p },
1094
- children: [
1095
- /* @__PURE__ */ f("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
1096
- t && /* @__PURE__ */ f("p", { className: "cat-subtitle", children: [
1097
- "replacing ",
1098
- t
1099
- ] }),
1100
- /* @__PURE__ */ a(
1101
- ye,
1102
- {
1103
- lenses: l,
1104
- activeLens: r,
1105
- onLensChange: (v) => {
1106
- s(v), d(null), h(null);
1177
+ value: { mode: "replace", selectedTileId: c, description: m },
1178
+ children: /* @__PURE__ */ n(
1179
+ K,
1180
+ {
1181
+ variant: "no-stage",
1182
+ title: "Replace metric",
1183
+ onClose: S,
1184
+ footer: {
1185
+ left: /* @__PURE__ */ n(Xe, {}),
1186
+ right: /* @__PURE__ */ f(L, { children: [
1187
+ /* @__PURE__ */ n(
1188
+ "button",
1189
+ {
1190
+ id: "btn-cat-cancel",
1191
+ type: "button",
1192
+ className: "gloss-panel-chrome-v2__footer-btn",
1193
+ onClick: v,
1194
+ children: "Cancel"
1195
+ }
1196
+ ),
1197
+ /* @__PURE__ */ n(
1198
+ "button",
1199
+ {
1200
+ id: "btn-cat-replace",
1201
+ type: "button",
1202
+ className: "gloss-panel-chrome-v2__footer-btn gloss-panel-chrome-v2__footer-btn--primary",
1203
+ disabled: y,
1204
+ onClick: E,
1205
+ children: "Replace metric"
1206
+ }
1207
+ )
1208
+ ] })
1209
+ },
1210
+ children: /* @__PURE__ */ f("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
1211
+ t && /* @__PURE__ */ f("p", { className: "cat-subtitle", children: [
1212
+ "replacing ",
1213
+ t
1214
+ ] }),
1215
+ /* @__PURE__ */ n(
1216
+ Ce,
1217
+ {
1218
+ lenses: r,
1219
+ activeLens: l,
1220
+ onLensChange: (N) => {
1221
+ s(N), d(null), h(null);
1222
+ }
1107
1223
  }
1108
- }
1109
- ),
1110
- /* @__PURE__ */ a(
1111
- ee,
1112
- {
1113
- tiles: m,
1114
- selectedTileId: c,
1115
- onSelectTile: (v, w) => {
1116
- d(v), h(w);
1117
- },
1118
- renderTile: u
1119
- }
1120
- )
1121
- ] }),
1122
- i
1123
- ]
1224
+ ),
1225
+ /* @__PURE__ */ n(
1226
+ te,
1227
+ {
1228
+ tiles: p,
1229
+ selectedTileId: c,
1230
+ onSelectTile: (N, O) => {
1231
+ d(N), h(O);
1232
+ },
1233
+ renderTile: i
1234
+ }
1235
+ )
1236
+ ] })
1237
+ }
1238
+ )
1124
1239
  }
1125
1240
  );
1126
1241
  }
1127
- const Ce = he(null);
1128
- function _e() {
1129
- return fe(Ce);
1242
+ const Ne = ge(null);
1243
+ function Te() {
1244
+ return be(Ne);
1130
1245
  }
1131
- function Ze(e = {}) {
1132
- const t = _e(), l = t?.createPage, o = t?.setPages;
1246
+ function Je(e = {}) {
1247
+ const t = Te(), r = t?.createPage, o = t?.setPages;
1133
1248
  return /* @__PURE__ */ f(
1134
1249
  "div",
1135
1250
  {
1136
1251
  className: "panel-footer pm",
1137
1252
  style: { display: "flex", justifyContent: "flex-end", padding: "10px 14px" },
1138
1253
  children: [
1139
- /* @__PURE__ */ a("div", { className: "spacer", style: { flex: 1 } }),
1140
- /* @__PURE__ */ a(
1254
+ /* @__PURE__ */ n("div", { className: "spacer", style: { flex: 1 } }),
1255
+ /* @__PURE__ */ n(
1141
1256
  "button",
1142
1257
  {
1143
1258
  id: "btn-new-page",
1144
1259
  type: "button",
1145
1260
  className: "btn btn-primary",
1146
1261
  onClick: () => {
1147
- if (l) {
1148
- l();
1262
+ if (r) {
1263
+ r();
1149
1264
  return;
1150
1265
  }
1151
- o && o((n) => [
1152
- ...n,
1266
+ o && o((a) => [
1267
+ ...a,
1153
1268
  { id: `new-${Date.now()}`, name: "Untitled", active: !1 }
1154
1269
  ]);
1155
1270
  },
@@ -1160,29 +1275,29 @@ function Ze(e = {}) {
1160
1275
  }
1161
1276
  );
1162
1277
  }
1163
- function de({ page: e, onRename: t, onKebab: l, onDragStart: o, onSwitchPage: n }) {
1164
- const i = _e(), [u, r] = E(!1), s = H(null);
1165
- L(() => {
1278
+ function pe({ page: e, onRename: t, onKebab: r, onDragStart: o, onSwitchPage: a }) {
1279
+ const i = Te(), [u, l] = x(!1), s = Y(null);
1280
+ U(() => {
1166
1281
  if (!u) return;
1167
- const m = (v) => {
1168
- s.current && (s.current.contains(v.target) || r(!1));
1282
+ const p = (v) => {
1283
+ s.current && (s.current.contains(v.target) || l(!1));
1169
1284
  };
1170
- return document.addEventListener("mousedown", m, !0), () => document.removeEventListener("mousedown", m, !0);
1285
+ return document.addEventListener("mousedown", p, !0), () => document.removeEventListener("mousedown", p, !0);
1171
1286
  }, [u]);
1172
1287
  const c = () => {
1173
- if (r(!1), t) return t(e.id);
1288
+ if (l(!1), t) return t(e.id);
1174
1289
  if (!i?.renamePage) return;
1175
- const m = window.prompt("Rename page", e.name);
1176
- m != null && m.trim().length > 0 && i.renamePage(e.id, m.trim());
1290
+ const p = window.prompt("Rename page", e.name);
1291
+ p != null && p.trim().length > 0 && i.renamePage(e.id, p.trim());
1177
1292
  }, d = () => {
1178
- r(!1), i?.duplicatePage?.(e.id);
1179
- }, p = () => {
1180
- r(!1), i?.deletePage?.(e.id);
1181
- }, h = (m) => {
1182
- m.stopPropagation(), n && !e.active && n(e.id);
1293
+ l(!1), i?.duplicatePage?.(e.id);
1294
+ }, m = () => {
1295
+ l(!1), i?.deletePage?.(e.id);
1296
+ }, h = (p) => {
1297
+ p.stopPropagation(), a && !e.active && a(e.id);
1183
1298
  }, b = ["pm-row"];
1184
1299
  return e.active && b.push("active"), /* @__PURE__ */ f("div", { ref: s, className: b.join(" "), "data-page-id": e.id, role: "listitem", children: [
1185
- /* @__PURE__ */ a(
1300
+ /* @__PURE__ */ n(
1186
1301
  "div",
1187
1302
  {
1188
1303
  className: "pm-handle",
@@ -1191,21 +1306,21 @@ function de({ page: e, onRename: t, onKebab: l, onDragStart: o, onSwitchPage: n
1191
1306
  children: "⋮⋮"
1192
1307
  }
1193
1308
  ),
1194
- /* @__PURE__ */ a(
1309
+ /* @__PURE__ */ n(
1195
1310
  "div",
1196
1311
  {
1197
1312
  className: "pm-name",
1198
- role: n && !e.active ? "button" : void 0,
1199
- tabIndex: n && !e.active ? 0 : void 0,
1200
- onClick: n ? h : void 0,
1201
- onKeyDown: (m) => {
1202
- !n || e.active || (m.key === "Enter" || m.key === " ") && (m.preventDefault(), m.stopPropagation(), n(e.id));
1313
+ role: a && !e.active ? "button" : void 0,
1314
+ tabIndex: a && !e.active ? 0 : void 0,
1315
+ onClick: a ? h : void 0,
1316
+ onKeyDown: (p) => {
1317
+ !a || e.active || (p.key === "Enter" || p.key === " ") && (p.preventDefault(), p.stopPropagation(), a(e.id));
1203
1318
  },
1204
- "aria-label": n && !e.active ? `Switch to ${e.name}` : void 0,
1319
+ "aria-label": a && !e.active ? `Switch to ${e.name}` : void 0,
1205
1320
  children: e.name
1206
1321
  }
1207
1322
  ),
1208
- /* @__PURE__ */ a(
1323
+ /* @__PURE__ */ n(
1209
1324
  "button",
1210
1325
  {
1211
1326
  type: "button",
@@ -1213,11 +1328,11 @@ function de({ page: e, onRename: t, onKebab: l, onDragStart: o, onSwitchPage: n
1213
1328
  "aria-label": "Page options",
1214
1329
  "aria-haspopup": "menu",
1215
1330
  "aria-expanded": u,
1216
- onPointerDown: (m) => m.stopPropagation(),
1217
- onMouseDown: (m) => m.stopPropagation(),
1218
- onClick: (m) => {
1219
- if (m.stopPropagation(), l) return l(e.id);
1220
- r((v) => !v);
1331
+ onPointerDown: (p) => p.stopPropagation(),
1332
+ onMouseDown: (p) => p.stopPropagation(),
1333
+ onClick: (p) => {
1334
+ if (p.stopPropagation(), r) return r(e.id);
1335
+ l((v) => !v);
1221
1336
  },
1222
1337
  children: "⋯"
1223
1338
  }
@@ -1228,18 +1343,18 @@ function de({ page: e, onRename: t, onKebab: l, onDragStart: o, onSwitchPage: n
1228
1343
  className: "pm-kebab-menu",
1229
1344
  role: "menu",
1230
1345
  "data-page-id": e.id,
1231
- onPointerDown: (m) => m.stopPropagation(),
1232
- onMouseDown: (m) => m.stopPropagation(),
1346
+ onPointerDown: (p) => p.stopPropagation(),
1347
+ onMouseDown: (p) => p.stopPropagation(),
1233
1348
  children: [
1234
- /* @__PURE__ */ a("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: c, children: "Rename" }),
1235
- /* @__PURE__ */ a("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: d, children: "Duplicate" }),
1236
- /* @__PURE__ */ a(
1349
+ /* @__PURE__ */ n("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: c, children: "Rename" }),
1350
+ /* @__PURE__ */ n("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: d, children: "Duplicate" }),
1351
+ /* @__PURE__ */ n(
1237
1352
  "button",
1238
1353
  {
1239
1354
  type: "button",
1240
1355
  role: "menuitem",
1241
1356
  className: "pm-kebab-menu__item pm-kebab-menu__item--danger",
1242
- onClick: p,
1357
+ onClick: m,
1243
1358
  children: "Delete"
1244
1359
  }
1245
1360
  )
@@ -1248,116 +1363,121 @@ function de({ page: e, onRename: t, onKebab: l, onDragStart: o, onSwitchPage: n
1248
1363
  )
1249
1364
  ] });
1250
1365
  }
1251
- const Xe = [
1366
+ const et = [
1252
1367
  { id: "p-pipeline", name: "My Pipeline", active: !0 },
1253
1368
  { id: "p-numbers", name: "My Numbers", active: !1 },
1254
1369
  { id: "p-morning", name: "My Morning", active: !1 },
1255
1370
  { id: "p-accounts", name: "My Accounts", active: !1 }
1256
1371
  ];
1257
- function Pt({
1372
+ function Lt({
1258
1373
  isOpen: e,
1259
- pages: t = Xe,
1260
- footerSlot: l,
1261
- externalPages: o,
1262
- activePageId: n,
1263
- onRename: i,
1264
- onDuplicate: u,
1265
- onDelete: r,
1266
- onReorder: s,
1267
- onCreatePage: c,
1268
- onSwitchPage: d
1374
+ pages: t = et,
1375
+ externalPages: r,
1376
+ activePageId: o,
1377
+ onRename: a,
1378
+ onDuplicate: i,
1379
+ onDelete: u,
1380
+ onReorder: l,
1381
+ onCreatePage: s,
1382
+ onSwitchPage: c
1269
1383
  }) {
1270
- const [p, h] = E(() => [...t]), b = x((g, N) => {
1271
- h((C) => C.map((P) => P.id === g ? { ...P, name: N } : P));
1272
- }, []), m = x((g) => {
1273
- h((N) => {
1274
- const C = N.find((Q) => Q.id === g);
1275
- if (!C) return N;
1276
- const P = {
1277
- id: `${C.id}-copy-${Date.now()}`,
1278
- name: `${C.name} copy`,
1384
+ const d = I(), [m, h] = x(() => [...t]), b = D((g, C) => {
1385
+ h((w) => w.map((A) => A.id === g ? { ...A, name: C } : A));
1386
+ }, []), p = D((g) => {
1387
+ h((C) => {
1388
+ const w = C.find((z) => z.id === g);
1389
+ if (!w) return C;
1390
+ const A = {
1391
+ id: `${w.id}-copy-${Date.now()}`,
1392
+ name: `${w.name} copy`,
1279
1393
  active: !1
1280
- }, k = N.findIndex((Q) => Q.id === g);
1281
- return [...N.slice(0, k + 1), P, ...N.slice(k + 1)];
1394
+ }, k = C.findIndex((z) => z.id === g);
1395
+ return [...C.slice(0, k + 1), A, ...C.slice(k + 1)];
1282
1396
  });
1283
- }, []), v = x((g) => {
1284
- h((N) => N.filter((C) => C.id !== g));
1285
- }, []), w = x((g) => {
1286
- h((N) => {
1287
- const C = new Map(N.map((k) => [k.id, k])), P = g.map((k) => C.get(k)).filter(Boolean);
1288
- return P.length === N.length ? P : N;
1397
+ }, []), v = D((g) => {
1398
+ h((C) => C.filter((w) => w.id !== g));
1399
+ }, []), E = D((g) => {
1400
+ h((C) => {
1401
+ const w = new Map(C.map((k) => [k.id, k])), A = g.map((k) => w.get(k)).filter(Boolean);
1402
+ return A.length === C.length ? A : C;
1289
1403
  });
1290
- }, []), S = o != null, T = S ? o : p, y = n != null ? T.map((g) => ({ ...g, active: g.id === n })) : [...T], A = i ?? (S ? void 0 : b), V = u ?? (S ? void 0 : m), K = r ?? (S ? void 0 : v), D = s ?? (S ? void 0 : w), Y = x(
1404
+ }, []), S = r != null, y = S ? r : m, N = o != null ? y.map((g) => ({ ...g, active: g.id === o })) : [...y], O = a ?? (S ? void 0 : b), R = i ?? (S ? void 0 : p), F = u ?? (S ? void 0 : v), T = l ?? (S ? void 0 : E), M = D(
1291
1405
  (g) => {
1292
1406
  S || h(g);
1293
1407
  },
1294
1408
  [S]
1295
- ), B = x(
1409
+ ), W = D(
1296
1410
  (g) => {
1297
- const N = g[0]?.items.map((C) => C.id) ?? [];
1298
- N.length > 0 && D && D(N);
1411
+ const C = g[0]?.items.map((w) => w.id) ?? [];
1412
+ C.length > 0 && T && T(C);
1299
1413
  },
1300
- [D]
1301
- ), W = y.map((g) => `${g.id}:${g.name}`).join("|"), G = D != null && y.length > 1 ? /* @__PURE__ */ a(
1302
- Se,
1414
+ [T]
1415
+ ), G = N.map((g) => `${g.id}:${g.name}`).join("|"), Q = T != null && N.length > 1 ? /* @__PURE__ */ n(
1416
+ Ee,
1303
1417
  {
1304
1418
  zones: [
1305
1419
  {
1306
1420
  zoneKey: "pm-pages",
1307
- items: y.map((g) => ({ ...g, id: g.id }))
1421
+ items: N.map((g) => ({ ...g, id: g.id }))
1308
1422
  }
1309
1423
  ],
1310
- onZoneChange: B,
1311
- renderZone: (g, N, C) => /* @__PURE__ */ a("div", { className: "pm-list", role: "list", children: C }),
1312
- renderItem: (g) => /* @__PURE__ */ a(
1313
- de,
1424
+ onZoneChange: W,
1425
+ renderZone: (g, C, w) => /* @__PURE__ */ n("div", { className: "pm-list", role: "list", children: w }),
1426
+ renderItem: (g) => /* @__PURE__ */ n(
1427
+ pe,
1314
1428
  {
1315
1429
  page: g,
1316
- onSwitchPage: d
1430
+ onSwitchPage: c
1317
1431
  },
1318
1432
  g.id
1319
1433
  )
1320
1434
  },
1321
- W
1322
- ) : /* @__PURE__ */ a("div", { className: "pm-list", role: "list", children: y.map((g) => /* @__PURE__ */ a(
1323
- de,
1435
+ G
1436
+ ) : /* @__PURE__ */ n("div", { className: "pm-list", role: "list", children: N.map((g) => /* @__PURE__ */ n(
1437
+ pe,
1324
1438
  {
1325
1439
  page: g,
1326
- onSwitchPage: d
1440
+ onSwitchPage: c
1327
1441
  },
1328
1442
  g.id
1329
- )) });
1330
- return /* @__PURE__ */ a(
1331
- Ce.Provider,
1443
+ )) }), q = () => d?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" });
1444
+ return /* @__PURE__ */ n(
1445
+ Ne.Provider,
1332
1446
  {
1333
1447
  value: {
1334
- pages: y,
1335
- setPages: Y,
1336
- renamePage: A,
1337
- duplicatePage: V,
1338
- deletePage: K,
1448
+ pages: N,
1449
+ setPages: M,
1450
+ renamePage: O,
1451
+ duplicatePage: R,
1452
+ deletePage: F,
1339
1453
  // Sprint 2026-05-20 — propagate live create binding for footer.
1340
- createPage: c
1454
+ createPage: s
1341
1455
  },
1342
- children: /* @__PURE__ */ f("div", { "data-shell": "page-management", "aria-hidden": !e, children: [
1343
- G,
1344
- l != null && /* @__PURE__ */ a("div", { className: "pm-footer-pin", children: l })
1345
- ] })
1456
+ children: /* @__PURE__ */ n(
1457
+ K,
1458
+ {
1459
+ variant: "no-stage",
1460
+ title: "Manage pages",
1461
+ onClose: q,
1462
+ footer: { right: /* @__PURE__ */ n(Je, {}) },
1463
+ children: /* @__PURE__ */ n("div", { "data-shell": "page-management", "aria-hidden": !e, children: Q })
1464
+ }
1465
+ )
1346
1466
  }
1347
1467
  );
1348
1468
  }
1349
- const xt = {
1469
+ const Ot = {
1350
1470
  SETTINGS: "settings",
1351
1471
  CATALOG_ADD: "catalog-add",
1352
1472
  CATALOG_REPLACE: "catalog-replace",
1353
1473
  PAGE_MGMT: "page-management",
1354
1474
  NOTIFICATION_CENTER: "notification-center"
1355
- }, Je = {
1475
+ }, tt = {
1356
1476
  position: "fixed",
1357
1477
  inset: 0,
1358
1478
  pointerEvents: "none",
1359
1479
  zIndex: 55
1360
- }, et = {
1480
+ }, nt = {
1361
1481
  position: "absolute",
1362
1482
  inset: 0,
1363
1483
  zIndex: 1,
@@ -1366,300 +1486,212 @@ const xt = {
1366
1486
  pointerEvents: "none",
1367
1487
  background: "rgba(0, 0, 0, 0.04)"
1368
1488
  };
1369
- function At() {
1370
- const { state: e, dispatch: t, getCloseLog: l } = we();
1371
- L(() => {
1489
+ function Mt() {
1490
+ const { state: e, dispatch: t, getCloseLog: r } = Pe();
1491
+ U(() => {
1372
1492
  if (e.activePanelId == null) return;
1373
1493
  function i(u) {
1374
1494
  u.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
1375
1495
  }
1376
1496
  return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
1377
1497
  }, [e.activePanelId, t]);
1378
- const o = H(e);
1379
- Ee(() => {
1498
+ const o = Y(e);
1499
+ Ae(() => {
1380
1500
  o.current = e;
1381
- }), L(() => {
1501
+ }), U(() => {
1382
1502
  if (process.env.NODE_ENV === "production") return;
1383
1503
  const i = window;
1384
1504
  return i.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), i.__panelsHostHandle = {
1385
1505
  dispatch: t,
1386
1506
  getState: () => o.current,
1387
- getCloseLog: l
1507
+ getCloseLog: r
1388
1508
  }, () => {
1389
1509
  i.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
1390
1510
  };
1391
- }, [t, l]);
1392
- const n = x(() => {
1511
+ }, [t, r]);
1512
+ const a = D(() => {
1393
1513
  t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
1394
1514
  }, [t]);
1395
- return /* @__PURE__ */ a("div", { "data-panel-host": "true", style: Je, children: e.activePanelId != null && /* @__PURE__ */ a(
1515
+ return /* @__PURE__ */ n("div", { "data-panel-host": "true", style: tt, children: e.activePanelId != null && /* @__PURE__ */ n(
1396
1516
  "div",
1397
1517
  {
1398
1518
  "data-panel-scrim": "true",
1399
- style: et,
1400
- onClick: n
1519
+ style: nt,
1520
+ onClick: a
1401
1521
  }
1402
1522
  ) });
1403
1523
  }
1404
- const tt = 700;
1405
- function nt(e) {
1406
- const [t, l] = E(null), o = H(null);
1407
- return L(() => {
1524
+ const at = 700;
1525
+ function st(e) {
1526
+ const [t, r] = x(null), o = Y(null);
1527
+ return U(() => {
1408
1528
  if (e != null) {
1409
- o.current != null && (clearTimeout(o.current), o.current = null), l(null);
1529
+ o.current != null && (clearTimeout(o.current), o.current = null), r(null);
1410
1530
  return;
1411
1531
  }
1412
- return l((n) => n), o.current = setTimeout(() => {
1413
- l(null), o.current = null;
1414
- }, tt), () => {
1532
+ return r((a) => a), o.current = setTimeout(() => {
1533
+ r(null), o.current = null;
1534
+ }, at), () => {
1415
1535
  o.current != null && (clearTimeout(o.current), o.current = null);
1416
1536
  };
1417
- }, [e]), L(() => {
1418
- e != null && l(e);
1537
+ }, [e]), U(() => {
1538
+ e != null && r(e);
1419
1539
  }, [e]), e != null ? { panelId: e, isOpen: !0 } : t != null ? { panelId: t, isOpen: !1 } : { panelId: null, isOpen: !1 };
1420
1540
  }
1421
- function kt({ panelComponents: e, children: t }) {
1422
- const l = U();
1423
- if (l == null) return null;
1424
- const { state: o, dispatch: n } = l, i = nt(o.activePanelId);
1425
- if (i.panelId == null) return null;
1426
- const u = i.panelId, r = i.isOpen, s = e?.[u];
1427
- if (s == null && t == null)
1428
- return process.env.NODE_ENV !== "production" && console.error(
1429
- "[panels] No panel component registered for activePanelId:",
1430
- u
1431
- ), null;
1432
- if (u === "settings") {
1433
- const c = o.isDirty, d = o.activeTrigger, p = d?.kind === "card-overflow" ? d.cardId : null;
1434
- return /* @__PURE__ */ a(I, { isOpen: r, children: /* @__PURE__ */ a(
1435
- M,
1436
- {
1437
- isOpen: r,
1438
- title: "Configure metric",
1439
- variant: "merged-stage",
1440
- onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
1441
- footer: /* @__PURE__ */ f(z, { children: [
1442
- /* @__PURE__ */ a(
1443
- "button",
1444
- {
1445
- id: "btn-reset",
1446
- type: "button",
1447
- className: "gloss-panel-chrome__footer-btn",
1448
- disabled: !c,
1449
- onClick: () => {
1450
- p != null && n({ type: "CLEAR_BUFFER", cardId: p });
1451
- },
1452
- children: "Reset"
1453
- }
1454
- ),
1455
- /* @__PURE__ */ a("span", { style: { flex: 1 } }),
1456
- /* @__PURE__ */ a(
1457
- "button",
1458
- {
1459
- id: "settings-cancel",
1460
- type: "button",
1461
- className: "gloss-panel-chrome__footer-btn",
1462
- onClick: () => n({ type: "CLOSE_PANEL", reason: "cancel-button" }),
1463
- children: "Cancel"
1464
- }
1465
- ),
1466
- /* @__PURE__ */ a(
1467
- "button",
1468
- {
1469
- id: "settings-apply",
1470
- type: "button",
1471
- className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
1472
- disabled: !c,
1473
- onClick: () => n({ type: "CLOSE_PANEL", reason: "apply-button" }),
1474
- children: "Apply"
1475
- }
1476
- )
1477
- ] }),
1478
- children: s != null ? /* @__PURE__ */ a(s, { isOpen: r }) : t
1479
- }
1480
- ) });
1481
- }
1482
- if (u === "catalog-add" || u === "catalog-replace") {
1483
- if (s == null) return null;
1484
- const c = u === "catalog-replace" ? "replace" : "add";
1485
- return /* @__PURE__ */ a(I, { isOpen: r, children: /* @__PURE__ */ a(
1486
- M,
1487
- {
1488
- isOpen: r,
1489
- onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
1490
- footer: null,
1491
- title: c === "replace" ? "Replace metric" : "Add a metric",
1492
- children: /* @__PURE__ */ a(
1493
- s,
1494
- {
1495
- isOpen: r,
1496
- footerSlot: /* @__PURE__ */ a(je, { mode: c, dispatch: n })
1497
- }
1498
- )
1499
- }
1500
- ) });
1501
- }
1502
- return u === "page-management" ? s == null ? null : /* @__PURE__ */ a(I, { isOpen: r, children: /* @__PURE__ */ a(
1503
- M,
1504
- {
1505
- isOpen: r,
1506
- onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
1507
- footer: null,
1508
- title: "Manage pages",
1509
- children: /* @__PURE__ */ a(s, { isOpen: r, footerSlot: /* @__PURE__ */ a(Ze, {}) })
1510
- }
1511
- ) }) : /* @__PURE__ */ a(I, { isOpen: r, children: /* @__PURE__ */ a(
1512
- M,
1513
- {
1514
- isOpen: !0,
1515
- onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
1516
- footer: null,
1517
- children: s != null ? /* @__PURE__ */ a(s, { isOpen: r }) : t
1518
- }
1519
- ) });
1541
+ function It({ panelComponents: e, children: t }) {
1542
+ const r = I(), o = st(r?.state.activePanelId ?? null);
1543
+ if (r == null || o.panelId == null) return null;
1544
+ const a = o.panelId, i = o.isOpen, u = e?.[a];
1545
+ return u == null && t == null ? (process.env.NODE_ENV !== "production" && console.error(
1546
+ "[panels] No panel component registered for activePanelId:",
1547
+ a
1548
+ ), null) : /* @__PURE__ */ n(xe, { isOpen: i, children: u != null ? /* @__PURE__ */ n(u, { isOpen: i }) : t });
1520
1549
  }
1521
- function ue(e) {
1550
+ function me(e) {
1522
1551
  return e === null ? null : e.kind === "manage-pages-action" ? `global-${e.align ?? "left"}` : e.kind === "card-overflow" || e.kind === "empty-cell" ? `section-${e.sectionIndex}` : null;
1523
1552
  }
1524
- const at = 685, pe = 627, st = "cubic-bezier(0.22, 1, 0.36, 1)", rt = 200;
1525
- function Te(e, t) {
1553
+ const rt = 685, he = 627, lt = "cubic-bezier(0.22, 1, 0.36, 1)", ot = 200;
1554
+ function Se(e, t) {
1526
1555
  if (typeof window > "u") return t;
1527
- const l = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
1528
- if (!l) return t;
1529
- const o = parseFloat(l);
1530
- return Number.isNaN(o) ? t : l.endsWith("s") && !l.endsWith("ms") ? o * 1e3 : o;
1556
+ const r = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
1557
+ if (!r) return t;
1558
+ const o = parseFloat(r);
1559
+ return Number.isNaN(o) ? t : r.endsWith("s") && !r.endsWith("ms") ? o * 1e3 : o;
1531
1560
  }
1532
- function lt(e, t) {
1561
+ function it(e, t) {
1533
1562
  return typeof window > "u" ? t : window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
1534
1563
  }
1535
- function R(e) {
1564
+ function V(e) {
1536
1565
  e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
1537
1566
  }
1538
- function ot(e) {
1539
- const { mountEl: t, chromeEl: l, reducedMotion: o, onAssert: n } = e;
1540
- if (t == null || l == null) {
1541
- R(e), n?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
1567
+ function ct(e) {
1568
+ const { mountEl: t, chromeEl: r, reducedMotion: o, onAssert: a } = e;
1569
+ if (t == null || r == null) {
1570
+ V(e), a?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
1542
1571
  return;
1543
1572
  }
1544
1573
  if (o) {
1545
- e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), n?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
1574
+ e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), a?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
1546
1575
  return;
1547
1576
  }
1548
- if (typeof l.animate != "function") {
1549
- R(e), n?.({ branch: "slide-no-waapi", timestamp: Date.now() });
1577
+ if (typeof r.animate != "function") {
1578
+ V(e), a?.({ branch: "slide-no-waapi", timestamp: Date.now() });
1550
1579
  return;
1551
1580
  }
1552
- const i = l.cloneNode(!0);
1553
- i.id = "panel-chrome-frozen", i.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", t.appendChild(i), l.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
1554
- const u = Te("--panel-open-dur", at), r = lt("--panel-easing", st), s = l.animate(
1581
+ const i = r.cloneNode(!0);
1582
+ i.id = "panel-chrome-frozen", i.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", t.appendChild(i), r.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
1583
+ const u = Se("--panel-open-dur", rt), l = it("--panel-easing", lt), s = r.animate(
1555
1584
  [{ transform: "translateY(100%)" }, { transform: "translateY(0)" }],
1556
- { duration: u, easing: r, fill: "forwards" }
1585
+ { duration: u, easing: l, fill: "forwards" }
1557
1586
  );
1558
1587
  s.addEventListener(
1559
1588
  "finish",
1560
1589
  () => {
1561
- i.remove(), l.style.zIndex = "", s.cancel(), n?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
1590
+ i.remove(), r.style.zIndex = "", s.cancel(), a?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
1562
1591
  },
1563
1592
  { once: !0 }
1564
1593
  );
1565
1594
  }
1566
- function it(e) {
1567
- const { mountEl: t, onAssert: l } = e;
1595
+ function dt(e) {
1596
+ const { mountEl: t, onAssert: r } = e;
1568
1597
  if (t == null) {
1569
- e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => R(e), pe), l?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
1598
+ e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => V(e), he), r?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
1570
1599
  return;
1571
1600
  }
1572
- const o = Te("--panel-close-dur", pe);
1573
- let n = !1, i = null;
1601
+ const o = Se("--panel-close-dur", he);
1602
+ let a = !1, i = null;
1574
1603
  const u = (s) => {
1575
- s.target !== t || s.propertyName !== "max-height" || n || (n = !0, i != null && clearTimeout(i), t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), l?.({ branch: "handoff-complete", timestamp: Date.now() }));
1576
- }, r = () => {
1577
- n || (n = !0, t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), l?.({ branch: "handoff-forced", timestamp: Date.now() }));
1604
+ s.target !== t || s.propertyName !== "max-height" || a || (a = !0, i != null && clearTimeout(i), t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-complete", timestamp: Date.now() }));
1605
+ }, l = () => {
1606
+ a || (a = !0, t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-forced", timestamp: Date.now() }));
1578
1607
  };
1579
- t.addEventListener("transitionend", u), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), i = setTimeout(r, o + rt);
1608
+ t.addEventListener("transitionend", u), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), i = setTimeout(l, o + ot);
1580
1609
  }
1581
- function ct(e) {
1582
- const { state: t, onAssert: l } = e;
1610
+ function ut(e) {
1611
+ const { state: t, onAssert: r } = e;
1583
1612
  if (t.activePanelId && t.isDirty) {
1584
- e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), l?.({ branch: "blocked-dirty", timestamp: Date.now() });
1613
+ e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "blocked-dirty", timestamp: Date.now() });
1585
1614
  return;
1586
1615
  }
1587
- const o = ue(t.activeTrigger), n = ue(e.trigger);
1588
- if (!!t.activePanelId && o != null && o === n) {
1589
- ot(e);
1616
+ const o = me(t.activeTrigger), a = me(e.trigger);
1617
+ if (!!t.activePanelId && o != null && o === a) {
1618
+ ct(e);
1590
1619
  return;
1591
1620
  }
1592
1621
  if (t.activePanelId) {
1593
- it(e);
1622
+ dt(e);
1594
1623
  return;
1595
1624
  }
1596
- R(e), l?.({ branch: "fresh-open", timestamp: Date.now() });
1625
+ V(e), r?.({ branch: "fresh-open", timestamp: Date.now() });
1597
1626
  }
1598
- function dt() {
1627
+ function pt() {
1599
1628
  if (!(typeof window > "u"))
1600
1629
  return window.__panelsAsserter;
1601
1630
  }
1602
- function Dt() {
1603
- const e = U(), t = me();
1604
- return x(
1605
- (l, o) => {
1631
+ function $t() {
1632
+ const e = I(), t = fe();
1633
+ return D(
1634
+ (r, o) => {
1606
1635
  if (!e)
1607
1636
  return;
1608
- const n = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, i = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, u = {
1609
- panelId: l,
1637
+ const a = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, i = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, u = {
1638
+ panelId: r,
1610
1639
  trigger: o,
1611
1640
  state: e.state,
1612
1641
  dispatch: e.dispatch,
1613
- mountEl: n,
1642
+ mountEl: a,
1614
1643
  chromeEl: i,
1615
1644
  reducedMotion: t,
1616
- onAssert: (r) => {
1617
- dt()?.recordTransition?.(r);
1645
+ onAssert: (l) => {
1646
+ pt()?.recordTransition?.(l);
1618
1647
  }
1619
1648
  };
1620
- ct(u);
1649
+ ut(u);
1621
1650
  },
1622
1651
  [e, t]
1623
1652
  );
1624
1653
  }
1625
- let F = !1, q = null;
1626
- function te() {
1654
+ function Rt({ children: e }) {
1655
+ return /* @__PURE__ */ n("div", { className: "clone-stage", children: e });
1656
+ }
1657
+ let B = !1, j = null;
1658
+ function ne() {
1627
1659
  const e = [];
1628
1660
  let t = "cleaned";
1629
1661
  document.querySelectorAll("#panel-chrome-frozen").length > 0 && (e.push("#panel-chrome-frozen"), t = "lingering");
1630
1662
  const o = document.querySelectorAll(".gloss-panel-mount");
1631
1663
  o.length > 1 && e.push(`mount-count=${o.length}`);
1632
- const n = o[0] ?? null, i = n ? n.querySelectorAll(".gloss-panel-chrome") : [];
1664
+ const a = o[0] ?? null, i = a ? a.querySelectorAll(".gloss-panel-chrome") : [];
1633
1665
  i.length > 1 && e.push(`chrome-count=${i.length}`);
1634
1666
  const u = i[0] ?? null;
1635
1667
  if (u) {
1636
1668
  const d = u.style.zIndex;
1637
1669
  d !== "" && d !== "2" && e.push(`chrome-zindex=${d}`);
1638
1670
  }
1639
- const r = n ? "present" : "absent", s = u ? "present" : "absent";
1671
+ const l = a ? "present" : "absent", s = u ? "present" : "absent";
1640
1672
  return {
1641
1673
  valid: e.length === 0,
1642
- mount: r,
1674
+ mount: l,
1643
1675
  chrome: s,
1644
1676
  frozen: t,
1645
1677
  orphans: e,
1646
1678
  timestamp: Date.now()
1647
1679
  };
1648
1680
  }
1649
- const j = "8px 8px 0px", Z = "64px", X = "inset(0px 0px 60px 0px)", J = "inset(0px -40px -40px -40px)";
1650
- function _(e, t, l, o, n) {
1651
- return { id: e, constraint: t, expected: l, actual: o, pass: n };
1681
+ const Z = "8px 8px 0px", X = "64px", J = "inset(0px 0px 60px 0px)", ee = "inset(0px -40px -40px -40px)";
1682
+ function _(e, t, r, o, a) {
1683
+ return { id: e, constraint: t, expected: r, actual: o, pass: a };
1652
1684
  }
1653
- function O(e) {
1685
+ function $(e) {
1654
1686
  const t = parseInt(e, 10);
1655
1687
  return Number.isFinite(t) ? t : NaN;
1656
1688
  }
1657
- function se() {
1658
- const e = [], t = document.querySelector(".gloss-panel-mount"), l = t?.querySelector(".gloss-panel-chrome") ?? null, o = document.querySelector(".gloss-panel-coordinator") ?? document.querySelector("[data-panel-coordinator]"), n = document.querySelector(".bell-cutout"), i = document.querySelector(".bell-popover"), u = document.querySelector(".gloss-bottom-toolbar");
1689
+ function le() {
1690
+ const e = [], t = document.querySelector(".gloss-panel-mount"), r = t?.querySelector(".gloss-panel-chrome") ?? null, o = document.querySelector(".gloss-panel-coordinator") ?? document.querySelector("[data-panel-coordinator]"), a = document.querySelector(".bell-cutout"), i = document.querySelector(".bell-popover"), u = document.querySelector(".gloss-bottom-toolbar");
1659
1691
  if (!t)
1660
1692
  e.push(_("C1", "mount --reveal-y matches clip-path inset-bottom Npx", "mount present", "absent", !1));
1661
1693
  else {
1662
- const r = getComputedStyle(t), s = r.getPropertyValue("--reveal-y").trim() || t.style.getPropertyValue("--reveal-y").trim(), c = r.clipPath || t.style.clipPath || "", d = c.match(/inset\(\s*0(?:px)?\s+0(?:px)?\s+(\d+)px\s+0(?:px)?\s*\)/), p = d ? parseInt(d[1], 10) : NaN, h = O(s), b = Number.isFinite(p) && Number.isFinite(h) && p === h;
1694
+ const l = getComputedStyle(t), s = l.getPropertyValue("--reveal-y").trim() || t.style.getPropertyValue("--reveal-y").trim(), c = l.clipPath || t.style.clipPath || "", d = c.match(/inset\(\s*0(?:px)?\s+0(?:px)?\s+(\d+)px\s+0(?:px)?\s*\)/), m = d ? parseInt(d[1], 10) : NaN, h = $(s), b = Number.isFinite(m) && Number.isFinite(h) && m === h;
1663
1695
  e.push(
1664
1696
  _(
1665
1697
  "C1",
@@ -1671,59 +1703,59 @@ function se() {
1671
1703
  );
1672
1704
  }
1673
1705
  if (!t)
1674
- e.push(_("C2", "mount padding constant", j, "absent", !1));
1706
+ e.push(_("C2", "mount padding constant", Z, "absent", !1));
1675
1707
  else {
1676
- const r = t.style.padding, s = getComputedStyle(t), c = r || s.padding || "", d = c === j || c === "8px 8px 0px 8px";
1677
- e.push(_("C2", "mount padding constant", j, c || "n/a", d));
1708
+ const l = t.style.padding, s = getComputedStyle(t), c = l || s.padding || "", d = c === Z || c === "8px 8px 0px 8px";
1709
+ e.push(_("C2", "mount padding constant", Z, c || "n/a", d));
1678
1710
  }
1679
1711
  if (!t)
1680
- e.push(_("C3", "mount.bottom resolves to var(--tb-h)=64px", Z, "absent", !1));
1712
+ e.push(_("C3", "mount.bottom resolves to var(--tb-h)=64px", X, "absent", !1));
1681
1713
  else {
1682
- const s = getComputedStyle(t).bottom || t.style.bottom || "", c = s === Z;
1683
- e.push(_("C3", "mount.bottom resolves to var(--tb-h)=64px", Z, s || "n/a", c));
1714
+ const s = getComputedStyle(t).bottom || t.style.bottom || "", c = s === X;
1715
+ e.push(_("C3", "mount.bottom resolves to var(--tb-h)=64px", X, s || "n/a", c));
1684
1716
  }
1685
- if (!l)
1717
+ if (!r)
1686
1718
  e.push(_("C4", "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px", "formula match", "absent", !1));
1687
1719
  else {
1688
- const r = getComputedStyle(l), s = O(
1689
- r.getPropertyValue("--row-h").trim() || l.style.getPropertyValue("--row-h").trim() || "0"
1690
- ), c = O(
1691
- r.getPropertyValue("--row-gap").trim() || l.style.getPropertyValue("--row-gap").trim() || "0"
1692
- ), d = s * 3 + c * 3 - 8, p = O(r.height || l.style.height || ""), h = Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(p) && Number.isFinite(d) && p === d;
1720
+ const l = getComputedStyle(r), s = $(
1721
+ l.getPropertyValue("--row-h").trim() || r.style.getPropertyValue("--row-h").trim() || "0"
1722
+ ), c = $(
1723
+ l.getPropertyValue("--row-gap").trim() || r.style.getPropertyValue("--row-gap").trim() || "0"
1724
+ ), d = s * 3 + c * 3 - 8, m = $(l.height || r.style.height || ""), h = Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(m) && Number.isFinite(d) && m === d;
1693
1725
  e.push(
1694
1726
  _(
1695
1727
  "C4",
1696
1728
  "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px",
1697
1729
  `${d}px (rh=${s} rg=${c})`,
1698
- `${p}px`,
1730
+ `${m}px`,
1699
1731
  h
1700
1732
  )
1701
1733
  );
1702
1734
  }
1703
- if (!o || !l)
1735
+ if (!o || !r)
1704
1736
  e.push(
1705
1737
  _(
1706
1738
  "C5",
1707
1739
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
1708
1740
  "present",
1709
- `coordinator=${o ? "present" : "absent"} chrome=${l ? "present" : "absent"}`,
1741
+ `coordinator=${o ? "present" : "absent"} chrome=${r ? "present" : "absent"}`,
1710
1742
  !1
1711
1743
  )
1712
1744
  );
1713
1745
  else {
1714
- const r = getComputedStyle(o), s = getComputedStyle(l), c = r.perspective || o.style.perspective || "", d = (r.perspectiveOrigin || o.style.perspectiveOrigin || "").trim(), p = s.perspectiveStyle || l.style.perspectiveStyle || "", v = c !== "" && c !== "none" && (d === "center bottom" || d === "50% 100%") && p === "flat";
1746
+ const l = getComputedStyle(o), s = getComputedStyle(r), c = l.perspective || o.style.perspective || "", d = (l.perspectiveOrigin || o.style.perspectiveOrigin || "").trim(), m = s.perspectiveStyle || r.style.perspectiveStyle || "", v = c !== "" && c !== "none" && (d === "center bottom" || d === "50% 100%") && m === "flat";
1715
1747
  e.push(
1716
1748
  _(
1717
1749
  "C5",
1718
1750
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
1719
1751
  "perspective:not-none, origin:center bottom, chrome-style:flat",
1720
- `perspective=${c} origin=${d} chrome-style=${p}`,
1752
+ `perspective=${c} origin=${d} chrome-style=${m}`,
1721
1753
  v
1722
1754
  )
1723
1755
  );
1724
1756
  }
1725
1757
  {
1726
- let r = !1, s = "absent";
1758
+ let l = !1, s = "absent";
1727
1759
  try {
1728
1760
  for (const c of Array.from(document.styleSheets)) {
1729
1761
  let d = [];
@@ -1732,10 +1764,10 @@ function se() {
1732
1764
  } catch {
1733
1765
  continue;
1734
1766
  }
1735
- for (const p of d)
1736
- if (p.name === "stage-spin") {
1737
- const b = Array.from(p.cssRules), m = b.find((y) => y.keyText === "0%" || y.keyText === "from"), v = b.find((y) => y.keyText === "100%" || y.keyText === "to"), w = m?.style.transform ?? "", S = v?.style.transform ?? "", T = /rotateY\(\s*0(?:deg)?\s*\)/;
1738
- r = T.test(w) && T.test(S), s = `0%=${w || "n/a"} 100%=${S || "n/a"}`;
1767
+ for (const m of d)
1768
+ if (m.name === "stage-spin") {
1769
+ const b = Array.from(m.cssRules), p = b.find((N) => N.keyText === "0%" || N.keyText === "from"), v = b.find((N) => N.keyText === "100%" || N.keyText === "to"), E = p?.style.transform ?? "", S = v?.style.transform ?? "", y = /rotateY\(\s*0(?:deg)?\s*\)/;
1770
+ l = y.test(E) && y.test(S), s = `0%=${E || "n/a"} 100%=${S || "n/a"}`;
1739
1771
  break;
1740
1772
  }
1741
1773
  if (s !== "absent") break;
@@ -1749,20 +1781,20 @@ function se() {
1749
1781
  "@keyframes stage-spin 0% AND 100% anchor at rotateY(0)",
1750
1782
  "both frames rotateY(0)",
1751
1783
  s,
1752
- r
1784
+ l
1753
1785
  )
1754
1786
  );
1755
1787
  }
1756
1788
  {
1757
- const r = document.documentElement, s = getComputedStyle(r), c = s.getPropertyValue("--panel-open-dur").trim() || r.style.getPropertyValue("--panel-open-dur").trim(), d = s.getPropertyValue("--panel-close-dur").trim() || r.style.getPropertyValue("--panel-close-dur").trim(), p = O(c) || parseFloat(c) * (c.endsWith("s") && !c.endsWith("ms") ? 1e3 : 1), h = O(d) || parseFloat(d) * (d.endsWith("s") && !d.endsWith("ms") ? 1e3 : 1), b = Number.isFinite(p) && Number.isFinite(h) && p > h;
1789
+ const l = document.documentElement, s = getComputedStyle(l), c = s.getPropertyValue("--panel-open-dur").trim() || l.style.getPropertyValue("--panel-open-dur").trim(), d = s.getPropertyValue("--panel-close-dur").trim() || l.style.getPropertyValue("--panel-close-dur").trim(), m = $(c) || parseFloat(c) * (c.endsWith("s") && !c.endsWith("ms") ? 1e3 : 1), h = $(d) || parseFloat(d) * (d.endsWith("s") && !d.endsWith("ms") ? 1e3 : 1), b = Number.isFinite(m) && Number.isFinite(h) && m > h;
1758
1790
  e.push(
1759
1791
  _("C7", "--panel-open-dur > --panel-close-dur", "open > close", `open=${c || "n/a"} close=${d || "n/a"}`, b)
1760
1792
  );
1761
1793
  }
1762
- if (!n)
1794
+ if (!a)
1763
1795
  e.push(_("C8", "BellCutout zero computed animation/transition", "no inline timing", "absent", !1));
1764
1796
  else {
1765
- const r = getComputedStyle(n), s = r.animationName || "", c = r.transitionProperty || "", d = (s === "" || s === "none") && (c === "" || c === "none" || c === "all");
1797
+ const l = getComputedStyle(a), s = l.animationName || "", c = l.transitionProperty || "", d = (s === "" || s === "none") && (c === "" || c === "none" || c === "all");
1766
1798
  e.push(
1767
1799
  _(
1768
1800
  "C8",
@@ -1774,21 +1806,21 @@ function se() {
1774
1806
  );
1775
1807
  }
1776
1808
  if (!t)
1777
- e.push(_("C9", "mount closed-state clipPath", X, "absent", !1));
1809
+ e.push(_("C9", "mount closed-state clipPath", J, "absent", !1));
1778
1810
  else {
1779
- const r = t.style.clipPath, s = getComputedStyle(t), c = r || s.clipPath || "", d = c === X;
1780
- e.push(_("C9", "mount closed-state clipPath", X, c || "n/a", d));
1811
+ const l = t.style.clipPath, s = getComputedStyle(t), c = l || s.clipPath || "", d = c === J;
1812
+ e.push(_("C9", "mount closed-state clipPath", J, c || "n/a", d));
1781
1813
  }
1782
1814
  if (!i)
1783
1815
  e.push(_("C10", "bell-popover parentElement === document.body (open)", "body", "absent", !1));
1784
1816
  else {
1785
- const r = i.parentElement, s = r === document.body;
1817
+ const l = i.parentElement, s = l === document.body;
1786
1818
  e.push(
1787
1819
  _(
1788
1820
  "C10",
1789
1821
  "bell-popover parentElement === document.body (open)",
1790
1822
  "body",
1791
- r === document.body ? "body" : r?.tagName ?? "n/a",
1823
+ l === document.body ? "body" : l?.tagName ?? "n/a",
1792
1824
  s
1793
1825
  )
1794
1826
  );
@@ -1800,10 +1832,10 @@ function se() {
1800
1832
  e.push(_("C11", "coordinator overflow === visible", "visible", s || "n/a", c));
1801
1833
  }
1802
1834
  if (!u)
1803
- e.push(_("C12", "toolbar clipPath = inset(0 -40 -40 -40)", J, "absent", !1));
1835
+ e.push(_("C12", "toolbar clipPath = inset(0 -40 -40 -40)", ee, "absent", !1));
1804
1836
  else {
1805
- const r = u.style.clipPath, s = getComputedStyle(u), c = r || s.clipPath || "", d = c === J;
1806
- e.push(_("C12", "toolbar clipPath = inset(0 -40 -40 -40)", J, c || "n/a", d));
1837
+ const l = u.style.clipPath, s = getComputedStyle(u), c = l || s.clipPath || "", d = c === ee;
1838
+ e.push(_("C12", "toolbar clipPath = inset(0 -40 -40 -40)", ee, c || "n/a", d));
1807
1839
  }
1808
1840
  return e.push(
1809
1841
  _(
@@ -1823,11 +1855,11 @@ function se() {
1823
1855
  )
1824
1856
  ), e;
1825
1857
  }
1826
- function ut(e) {
1827
- return se().find((t) => t.id === e);
1858
+ function mt(e) {
1859
+ return le().find((t) => t.id === e);
1828
1860
  }
1829
- function pt() {
1830
- const e = te();
1861
+ function ht() {
1862
+ const e = ne();
1831
1863
  return { q12: [
1832
1864
  {
1833
1865
  id: "Q12-12",
@@ -1836,76 +1868,84 @@ function pt() {
1836
1868
  actual: `valid=${e.valid} mount=${e.mount} chrome=${e.chrome} frozen=${e.frozen} orphans=[${e.orphans.join(",")}]`,
1837
1869
  pass: e.valid
1838
1870
  }
1839
- ], cc: se() };
1871
+ ], cc: le() };
1840
1872
  }
1841
- function mt() {
1873
+ function ft() {
1842
1874
  return {
1843
- enable: ht,
1844
- disable: ft,
1845
- isEnabled: () => F,
1846
- getLastReport: () => q,
1875
+ enable: gt,
1876
+ disable: bt,
1877
+ isEnabled: () => B,
1878
+ getLastReport: () => j,
1847
1879
  recordTransition: (e) => {
1848
- F && (q = { ...e, ...te() });
1880
+ B && (j = { ...e, ...ne() });
1849
1881
  },
1850
1882
  assertOnce: () => {
1851
- const e = te();
1852
- return q = e, e;
1883
+ const e = ne();
1884
+ return j = e, e;
1853
1885
  },
1854
- assertCcOnly: se,
1855
- getCcRowById: ut,
1856
- assertPanelTruths: pt
1886
+ assertCcOnly: le,
1887
+ getCcRowById: mt,
1888
+ assertPanelTruths: ht
1857
1889
  };
1858
1890
  }
1859
- function ht() {
1860
- if (F = !0, typeof window > "u") return;
1861
- window.__panelsAsserter || (window.__panelsAsserter = mt(), console.info(
1891
+ function gt() {
1892
+ if (B = !0, typeof window > "u") return;
1893
+ window.__panelsAsserter || (window.__panelsAsserter = ft(), console.info(
1862
1894
  "[panels] asserter enabled (P3b Q12-12 + P6 W5 cc:C1..C14). Inspect via window.__panelsAsserter."
1863
1895
  ));
1864
1896
  }
1865
- function ft() {
1866
- F = !1;
1897
+ function bt() {
1898
+ B = !1;
1867
1899
  }
1868
1900
  export {
1869
- It as COMMITS,
1870
- wt as CatalogAddShell,
1871
- je as CatalogFooter,
1872
- Et as CatalogReplaceShell,
1873
- ae as CatalogStateContext,
1874
- Ue as CloneCard,
1875
- Fe as CloneStage,
1876
- be as MOCK_DEFAULT_LENS,
1877
- ge as MOCK_LENSES,
1878
- ne as MOCK_LENS_META,
1879
- Xe as MOCK_PAGES,
1880
- ve as MOCK_TILES_BY_LENS,
1881
- xt as PANEL_IDS,
1882
- Ze as PageMgmtFooter,
1883
- Pt as PageMgmtShell,
1884
- Ce as PageMgmtStateContext,
1885
- M as PanelChrome,
1886
- Mt as PanelHost,
1887
- At as PanelHostShell,
1888
- I as PanelMount,
1889
- $t as PanelProvider,
1890
- kt as PanelSlot,
1891
- St as SettingsShell,
1892
- se as assertCcOnly,
1893
- te as assertPanelDomShape,
1894
- pt as assertPanelTruths,
1895
- Rt as deriveSurfaceState,
1896
- ft as disablePanelAsserter,
1897
- ht as enablePanelAsserter,
1898
- ut as getCcRowById,
1899
- Ft as initialState,
1900
- ue as positionKey,
1901
- Ut as reducer,
1902
- ct as transitionToPanel,
1903
- qe as useCatalogState,
1904
- Nt as useEditingCardId,
1905
- _e as usePageMgmtState,
1906
- we as usePanelContext,
1907
- U as usePanelContextOptional,
1908
- zt as usePanelCoordinator,
1909
- me as useReducedMotionPanel,
1910
- Dt as useTransitionToPanel
1901
+ zt as COMMITS,
1902
+ kt as CatalogAddShell,
1903
+ At as CatalogFooter,
1904
+ Dt as CatalogReplaceShell,
1905
+ se as CatalogStateContext,
1906
+ He as CloneCard,
1907
+ Rt as CloneStage,
1908
+ ye as MOCK_DEFAULT_LENS,
1909
+ ve as MOCK_LENSES,
1910
+ ae as MOCK_LENS_META,
1911
+ et as MOCK_PAGES,
1912
+ _e as MOCK_TILES_BY_LENS,
1913
+ Ht as NotificationCenterShell,
1914
+ Ot as PANEL_IDS,
1915
+ Je as PageMgmtFooter,
1916
+ Lt as PageMgmtShell,
1917
+ Ne as PageMgmtStateContext,
1918
+ Vt as PanelBody,
1919
+ Bt as PanelChrome,
1920
+ K as PanelChromeV2,
1921
+ Kt as PanelFooter,
1922
+ Pt as PanelFooterMessage,
1923
+ Yt as PanelHeader,
1924
+ Wt as PanelHost,
1925
+ Mt as PanelHostShell,
1926
+ xe as PanelMount,
1927
+ Gt as PanelNavigation,
1928
+ Qt as PanelProvider,
1929
+ It as PanelSlot,
1930
+ qt as PanelStage,
1931
+ xt as SettingsShell,
1932
+ le as assertCcOnly,
1933
+ ne as assertPanelDomShape,
1934
+ ht as assertPanelTruths,
1935
+ jt as deriveSurfaceState,
1936
+ bt as disablePanelAsserter,
1937
+ gt as enablePanelAsserter,
1938
+ mt as getCcRowById,
1939
+ Zt as initialState,
1940
+ me as positionKey,
1941
+ Xt as reducer,
1942
+ ut as transitionToPanel,
1943
+ re as useCatalogState,
1944
+ Et as useEditingCardId,
1945
+ Te as usePageMgmtState,
1946
+ Pe as usePanelContext,
1947
+ I as usePanelContextOptional,
1948
+ Jt as usePanelCoordinator,
1949
+ fe as useReducedMotionPanel,
1950
+ $t as useTransitionToPanel
1911
1951
  };