@brucesantos/design-space 0.9.0 → 0.9.1

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/dist/index.js CHANGED
@@ -1,359 +1,369 @@
1
- import { jsx as n, jsxs as b, Fragment as G } from "react/jsx-runtime";
2
- import { useState as D, useRef as q, useEffect as V, useMemo as A, useCallback as B, useContext as it, createContext as ct, useLayoutEffect as Ke } from "react";
3
- import { r as Se, h as oe, v as lt, a as we, b as Ve, p as dt, P as _, c as Ue, C as Ie, d as Me, e as ae, t as de, f as Ne, g as ut, N as We, i as He, s as he, j as xe, k as ht, l as _e, F as pt, m as mt, n as ft, o as wt } from "./index-DxIx4GAk.js";
4
- import { q as wn, H as gn, u as vn, w as bn, x as kn, y as Cn, z as Sn, A as Nn, B as xn, D as yn } from "./index-DxIx4GAk.js";
5
- function gt(e) {
6
- const t = e.scenarios ?? [], s = e.routes ?? [], o = e.components ?? [], r = new Map(t.map((a) => [a.id, a])), l = new Map(o.map((a) => [a.id, a])), c = new Map((e.personas ?? []).map((a) => [a.id, a])), i = new Map((e.fixtures ?? []).map((a) => [a.id, a])), h = new Map((e.rules ?? []).map((a) => [a.id, a])), m = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
7
- for (const a of t) {
8
- const g = Se(s, a.route ?? "");
1
+ import { jsx as n, jsxs as C, Fragment as q } from "react/jsx-runtime";
2
+ import { useState as K, useRef as G, useCallback as U, useEffect as I, useMemo as D, useContext as ct, createContext as lt, useLayoutEffect as Ue } from "react";
3
+ import { r as Ne, s as dt, h as oe, v as ut, a as ve, b as Ie, p as ht, P as M, c as We, C as we, d as Te, e as ae, t as de, f as xe, N as He, g as Be, i as pt, j as he, k as ye, l as mt, m as _e, F as ft, n as vt, o as wt, q as gt } from "./index-Bj69Oe2X.js";
4
+ import { u as gn, H as bn, w as kn, x as Cn, y as Sn, z as Nn, A as xn, B as yn, D as $n, E as Mn } from "./index-Bj69Oe2X.js";
5
+ function bt(e) {
6
+ const t = e.scenarios ?? [], s = e.routes ?? [], o = e.components ?? [], r = new Map(t.map((c) => [c.id, c])), i = new Map(o.map((c) => [c.id, c])), l = new Map((e.personas ?? []).map((c) => [c.id, c])), a = new Map((e.fixtures ?? []).map((c) => [c.id, c])), h = new Map((e.rules ?? []).map((c) => [c.id, c])), m = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
7
+ for (const c of t) {
8
+ const g = Ne(s, c.route ?? "");
9
9
  if (!g) continue;
10
- const S = g.definition.path;
11
- d.set(a.id, S);
12
- const R = m.get(S) ?? [];
13
- R.push(a), m.set(S, R);
10
+ const y = g.definition.path;
11
+ p.set(c.id, y);
12
+ const L = m.get(y) ?? [];
13
+ L.push(c), m.set(y, L);
14
14
  }
15
- const u = /* @__PURE__ */ new Set(), f = [];
16
- for (const a of s) {
17
- if (u.has(a.path)) continue;
18
- u.add(a.path);
19
- const g = m.get(a.path) ?? [];
20
- f.push({
21
- id: a.path,
22
- name: a.name?.trim() || g[0]?.title || a.path,
23
- description: a.description,
24
- route: a,
25
- href: kt(a.path),
15
+ const d = /* @__PURE__ */ new Set(), v = [];
16
+ for (const c of s) {
17
+ if (d.has(c.path)) continue;
18
+ d.add(c.path);
19
+ const g = m.get(c.path) ?? [];
20
+ v.push({
21
+ id: c.path,
22
+ name: c.name?.trim() || g[0]?.title || c.path,
23
+ description: c.description,
24
+ route: c,
25
+ href: dt(c.path, c.params),
26
26
  variations: g,
27
- group: a.group?.trim() || void 0,
28
- controls: Array.isArray(a.controls) ? a.controls : []
27
+ group: c.group?.trim() || void 0,
28
+ controls: Array.isArray(c.controls) ? c.controls : []
29
29
  });
30
30
  }
31
- const v = new Map(f.map((a) => [a.id, a])), k = (a) => a ? r.get(a) : void 0, C = (a) => a ? c.get(a) : void 0, N = (a, g) => {
32
- if (!(!a || !g))
33
- return l.get(a)?.fixtures?.find((S) => S.id === g);
34
- }, w = (a = {}) => t.filter((g) => oe(a.handoff, g.id)), x = (a) => {
35
- const g = Se(s, a);
36
- return g ? v.get(g.definition.path) : void 0;
37
- }, $ = (a = {}) => {
38
- const { handoff: g } = a;
39
- return g ? f.map((S) => ({
40
- ...S,
41
- variations: S.variations.filter((R) => oe(g, R.id))
31
+ const f = new Map(v.map((c) => [c.id, c])), k = (c) => c ? r.get(c) : void 0, T = (c) => c ? l.get(c) : void 0, E = T(e.defaultPersona)?.id, x = (c, g) => {
32
+ if (!(!c || !g))
33
+ return i.get(c)?.fixtures?.find((y) => y.id === g);
34
+ }, w = (c = {}) => t.filter((g) => oe(c.handoff, g.id)), b = (c) => {
35
+ const g = Ne(s, c);
36
+ return g ? f.get(g.definition.path) : void 0;
37
+ }, N = (c = {}) => {
38
+ const { handoff: g } = c;
39
+ return g ? v.map((y) => ({
40
+ ...y,
41
+ variations: y.variations.filter((L) => oe(g, L.id))
42
42
  })).filter(
43
- (S) => S.variations.length > 0 || (g.routes ?? []).length > 0 && Ve(g, S.href)
44
- ) : f;
45
- }, y = (a) => a ? a.permissions ? a.permissions : C(a.persona)?.permissions ?? [] : [], L = (a = {}) => Be($(a)), p = (a, g) => {
46
- const S = new Set(a?.route.components ?? []), R = g ? [g] : a?.variations ?? [];
47
- for (const M of R)
48
- for (const W of M.components ?? []) S.add(W);
49
- return [...S];
50
- }, E = (a) => o.filter((g) => we(a, g.id));
43
+ (y) => y.variations.length > 0 || (g.routes ?? []).length > 0 && Ie(g, y.href)
44
+ ) : v;
45
+ }, S = (c) => c ? c.permissions ? c.permissions : T(c.persona ?? E)?.permissions ?? [] : [], u = (c = {}) => je(N(c)), $ = (c, g) => {
46
+ const y = new Set(c?.route.components ?? []), L = g ? [g] : c?.variations ?? [];
47
+ for (const O of L)
48
+ for (const R of O.components ?? []) y.add(R);
49
+ return [...y];
50
+ }, F = (c) => o.filter((g) => ve(c, g.id));
51
51
  return {
52
52
  product: e,
53
- screens: f,
54
- issues: lt(e),
53
+ screens: v,
54
+ issues: ut(e),
55
+ defaultPersona: E,
55
56
  scenario: k,
56
- component: (a) => a ? l.get(a) : void 0,
57
- componentFixture: N,
58
- resolveComponentFixture: (a, g) => {
59
- const S = a ? l.get(a) : void 0, R = N(a, g), M = N(a, S?.defaultFixture) ?? S?.fixtures?.[0];
57
+ component: (c) => c ? i.get(c) : void 0,
58
+ componentFixture: x,
59
+ resolveComponentFixture: (c, g) => {
60
+ const y = c ? i.get(c) : void 0, L = x(c, g), O = x(c, y?.defaultFixture) ?? y?.fixtures?.[0];
60
61
  return {
61
- fixture: R ?? M,
62
+ fixture: L ?? O,
62
63
  requestedId: g,
63
- didFallback: !!(g && !R)
64
+ didFallback: !!(g && !L)
64
65
  };
65
66
  },
66
- persona: C,
67
- fixture: (a) => a ? i.get(a) : void 0,
68
- rule: (a) => a ? h.get(a) : void 0,
69
- screen: (a) => a ? v.get(a) : void 0,
70
- screenForPath: x,
71
- screenOf: (a) => {
72
- const g = a ? d.get(a.id) : void 0;
73
- return g ? v.get(g) : void 0;
67
+ persona: T,
68
+ fixture: (c) => c ? a.get(c) : void 0,
69
+ rule: (c) => c ? h.get(c) : void 0,
70
+ screen: (c) => c ? f.get(c) : void 0,
71
+ screenForPath: b,
72
+ screenOf: (c) => {
73
+ const g = c ? p.get(c.id) : void 0;
74
+ return g ? f.get(g) : void 0;
74
75
  },
75
- screensFor: $,
76
- flows: L,
77
- flowOf: (a, g) => {
78
- if (a)
79
- return L(g).find((S) => S.name === a.group);
76
+ screensFor: N,
77
+ flows: u,
78
+ flowOf: (c, g) => {
79
+ if (c)
80
+ return u(g).find((y) => y.name === c.group);
80
81
  },
81
- controlsOf: (a) => (a?.controls ?? []).flatMap((g) => g.controls ?? []),
82
- resolveControls: (a, g = {}) => vt(a?.controls ?? [], g),
83
- rulesOf: (a) => (a?.rules ?? []).map((g) => h.get(g)).filter((g) => !!g),
84
- permissionsOf: y,
85
- scenariosForRoute: (a, g) => {
86
- const S = x(a);
87
- return S ? S.variations.filter((R) => oe(g?.handoff, R.id)) : [];
82
+ controlsOf: (c) => (c?.controls ?? []).flatMap((g) => g.controls ?? []),
83
+ resolveControls: (c, g = {}) => kt(c?.controls ?? [], g),
84
+ rulesOf: (c) => (c?.rules ?? []).map((g) => h.get(g)).filter((g) => !!g),
85
+ permissionsOf: S,
86
+ scenariosForRoute: (c, g) => {
87
+ const y = b(c);
88
+ return y ? y.variations.filter((L) => oe(g?.handoff, L.id)) : [];
88
89
  },
89
90
  activeScenarios: w,
90
- search: (a, g) => {
91
- const S = X(a), R = w(g);
92
- return S ? R.filter(
93
- (M) => X(
91
+ search: (c, g) => {
92
+ const y = X(c), L = w(g);
93
+ return y ? L.filter(
94
+ (O) => X(
94
95
  [
95
- M.title,
96
- M.id,
97
- M.intent ?? "",
98
- M.route,
99
- C(M.persona)?.name ?? "",
100
- (M.tags ?? []).join(" "),
101
- (M.expected ?? []).join(" ")
96
+ O.title,
97
+ O.id,
98
+ O.intent ?? "",
99
+ O.route,
100
+ T(O.persona)?.name ?? "",
101
+ (O.tags ?? []).join(" "),
102
+ (O.expected ?? []).join(" ")
102
103
  ].join(" ")
103
- ).includes(S)
104
- ) : R;
104
+ ).includes(y)
105
+ ) : L;
105
106
  },
106
- searchScreens: (a, g) => {
107
- const S = X(a), R = $(g);
108
- return S ? R.filter(
109
- (M) => X(
107
+ searchScreens: (c, g) => {
108
+ const y = X(c), L = N(g);
109
+ return y ? L.filter(
110
+ (O) => X(
110
111
  [
111
- M.name,
112
- M.description ?? "",
113
- M.id,
114
- M.group ?? "",
115
- ...M.variations.flatMap((W) => [
116
- W.title,
117
- W.id,
118
- (W.tags ?? []).join(" ")
112
+ O.name,
113
+ O.description ?? "",
114
+ O.id,
115
+ O.group ?? "",
116
+ ...O.variations.flatMap((R) => [
117
+ R.title,
118
+ R.id,
119
+ (R.tags ?? []).join(" ")
119
120
  ])
120
121
  ].join(" ")
121
- ).includes(S)
122
- ) : R;
122
+ ).includes(y)
123
+ ) : L;
123
124
  },
124
- searchComponents: (a, g) => {
125
- const S = X(a), R = E(g);
126
- return S ? R.filter(
127
- (M) => X(
125
+ searchComponents: (c, g) => {
126
+ const y = X(c), L = F(g);
127
+ return y ? L.filter(
128
+ (O) => X(
128
129
  [
129
- M.name,
130
- M.description ?? "",
131
- M.group ?? "",
132
- M.id,
133
- M.source ?? ""
130
+ O.name,
131
+ O.description ?? "",
132
+ O.group ?? "",
133
+ O.id,
134
+ O.source ?? ""
134
135
  ].join(" ")
135
- ).includes(S)
136
- ) : R;
136
+ ).includes(y)
137
+ ) : L;
137
138
  },
138
- componentsFor: E,
139
- componentsOfScreen: (a, g) => p(a, g).map((S) => l.get(S)).filter((S) => !!S),
140
- usagesOf: (a, g) => a ? $(g).filter(
141
- (S) => S.route.components?.includes(a) || S.variations.some((R) => R.components?.includes(a))
139
+ componentsFor: F,
140
+ componentsOfScreen: (c, g) => $(c, g).map((y) => i.get(y)).filter((y) => !!y),
141
+ usagesOf: (c, g) => c ? N(g).filter(
142
+ (y) => y.route.components?.includes(c) || y.variations.some((L) => L.components?.includes(c))
142
143
  ) : []
143
144
  };
144
145
  }
145
146
  function X(e) {
146
147
  return e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g, "").trim();
147
148
  }
148
- function Be(e) {
149
+ function je(e) {
149
150
  const t = [], s = /* @__PURE__ */ new Map();
150
151
  for (const r of e) {
151
152
  if (!r.group) {
152
153
  t.push(r);
153
154
  continue;
154
155
  }
155
- const l = s.get(r.group) ?? [];
156
- l.push(r), s.set(r.group, l);
156
+ const i = s.get(r.group) ?? [];
157
+ i.push(r), s.set(r.group, i);
157
158
  }
158
- const o = [...s].map(([r, l]) => ({ name: r, screens: l }));
159
+ const o = [...s].map(([r, i]) => ({ name: r, screens: i }));
159
160
  return t.length > 0 ? [{ name: void 0, screens: t }, ...o] : o;
160
161
  }
161
162
  function ge(e) {
162
163
  const t = e.options ?? [];
163
164
  return e.default !== void 0 && t.some((s) => s.value === e.default) ? e.default : t[0]?.value ?? "";
164
165
  }
165
- function vt(e, t = {}) {
166
- const s = {}, o = [], r = /* @__PURE__ */ new Set(), l = t.requested ?? {};
167
- for (const c of e)
168
- for (const i of c.controls ?? []) {
169
- if (r.has(i.id)) continue;
170
- r.add(i.id);
171
- const h = (f) => f !== void 0 && (i.options ?? []).some((v) => v.value === f);
172
- let m = ge(i);
173
- const d = t.scenario?.controls?.[i.id];
174
- h(d) && (m = d);
175
- const u = l[i.id];
176
- u !== void 0 && (h(u) ? m = u : o.push({ id: i.id, value: u, reason: "invalid-value", fallback: m })), s[i.id] = m;
166
+ function kt(e, t = {}) {
167
+ const s = {}, o = [], r = /* @__PURE__ */ new Set(), i = t.requested ?? {};
168
+ for (const l of e)
169
+ for (const a of l.controls ?? []) {
170
+ if (r.has(a.id)) continue;
171
+ r.add(a.id);
172
+ const h = (v) => v !== void 0 && (a.options ?? []).some((f) => f.value === v);
173
+ let m = ge(a);
174
+ const p = t.scenario?.controls?.[a.id];
175
+ h(p) && (m = p);
176
+ const d = i[a.id];
177
+ d !== void 0 && (h(d) ? m = d : o.push({ id: a.id, value: d, reason: "invalid-value", fallback: m })), s[a.id] = m;
177
178
  }
178
- for (const [c, i] of Object.entries(l))
179
- r.has(c) || o.push({ id: c, value: i, reason: "unknown-control" });
179
+ for (const [l, a] of Object.entries(i))
180
+ r.has(l) || o.push({ id: l, value: a, reason: "unknown-control" });
180
181
  return { values: s, invalid: o };
181
182
  }
182
- function bt(e, t) {
183
+ function Ct(e, t) {
183
184
  return e ? Object.entries(e.controls ?? {}).every(([s, o]) => t?.[s] === o) : !1;
184
185
  }
185
- function kt(e) {
186
- const t = e.split("/").filter(Boolean);
187
- return t[t.length - 1] === "*" && t.pop(), `/${t.join("/")}`;
188
- }
189
- const Ct = [
186
+ const St = [
190
187
  { id: "mobile", label: "Celular", width: 375, height: 812 },
191
188
  { id: "tablet", label: "Tablet", width: 768, height: 1024 },
192
189
  { id: "desktop", label: "Desktop", width: 1280, height: 800 },
193
190
  { id: "fit", label: "Ajustar" },
194
191
  { id: "custom", label: "Personalizado" }
195
- ], Le = 25, Te = 150, pe = 100;
196
- function je(e, t, s) {
192
+ ], Pe = 25, Ee = 150, pe = 100;
193
+ function qe(e, t, s) {
197
194
  const o = s !== void 0 ? e.screenForPath(s) : e.screenOf(t), r = t && o && e.screenOf(t)?.id === o.id ? t : void 0;
198
195
  return { screen: o, scenario: r };
199
196
  }
200
- function St(e, t, s) {
201
- const o = new URLSearchParams(e), r = dt(o), l = o.get(_.component) ?? void 0, c = we(r, l) ? t.component(l) : void 0, i = o.get(_.scenario) ?? void 0, h = c || !oe(r, i) ? void 0 : t.scenario(i), m = o.get(_.fixture) ?? void 0, d = c ? m ?? t.componentFixture(c.id, c.defaultFixture)?.id ?? c.fixtures?.[0]?.id : void 0, u = o.get(_.network), f = c ? void 0 : je(t, h, s), v = f?.screen && f.screen.controls.length > 0 ? t.resolveControls(f.screen, {
202
- scenario: f.scenario,
203
- requested: Ue(o)
197
+ function $e(e, t, s) {
198
+ const o = new URLSearchParams(e), r = ht(o), i = o.get(M.component) ?? void 0, l = ve(r, i) ? t.component(i) : void 0, a = o.get(M.scenario) ?? void 0, h = l || !oe(r, a) ? void 0 : t.scenario(a), m = o.get(M.fixture) ?? void 0, p = l ? m ?? t.componentFixture(l.id, l.defaultFixture)?.id ?? l.fixtures?.[0]?.id : void 0, d = o.get(M.network), v = l ? void 0 : qe(t, h, s), f = v?.screen && v.screen.controls.length > 0 ? t.resolveControls(v.screen, {
199
+ scenario: v.scenario,
200
+ requested: We(o)
204
201
  }).values : void 0;
205
202
  return {
206
203
  scenario: h?.id,
207
204
  handoff: r,
208
- component: c?.id,
209
- persona: o.get(_.persona) ?? h?.persona,
210
- fixture: c ? d : m ?? h?.fixture,
211
- network: xt(u) ? u : h?.network ?? "success",
212
- viewport: o.get(_.viewport) ?? "fit",
213
- customWidth: Mt(o.get(_.customWidth)),
214
- themeMode: o.get(_.themeMode) ?? t.product.theme?.modes?.[0],
215
- locale: o.get(_.locale) ?? t.product.theme?.locales?.[0],
216
- dataSource: o.get(_.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
205
+ component: l?.id,
206
+ // Precedência: URL, cenário, padrão do produto. O preview de componente não
207
+ // tem persona, então o padrão não se aplica a ele.
208
+ persona: o.get(M.persona) ?? h?.persona ?? (l ? void 0 : t.defaultPersona),
209
+ fixture: l ? p : m ?? h?.fixture,
210
+ network: $t(d) ? d : h?.network ?? "success",
211
+ viewport: o.get(M.viewport) ?? "fit",
212
+ customWidth: Tt(o.get(M.customWidth)),
213
+ themeMode: o.get(M.themeMode) ?? t.product.theme?.modes?.[0],
214
+ locale: o.get(M.locale) ?? t.product.theme?.locales?.[0],
215
+ dataSource: o.get(M.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
217
216
  // Sem parâmetro, o tema do chrome fica em aberto: o shell resolve pela
218
217
  // última escolha da pessoa e, na falta dela, pelo sistema.
219
- chromeTheme: yt(o.get(_.chromeTheme)) ? o.get(_.chromeTheme) : void 0,
218
+ chromeTheme: Mt(o.get(M.chromeTheme)) ? o.get(M.chromeTheme) : void 0,
220
219
  // Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
221
220
  // de tela, então precisa ser explícito para não sumir sem pedido.
222
- chrome: o.get(_.chrome) !== "0",
223
- inspector: o.get(_.inspector) !== "0",
224
- panelTab: $t(o.get(_.panelTab)) ? o.get(_.panelTab) : "variations",
225
- zoom: qe(o.get(_.zoom)),
226
- rotated: o.get(_.rotated) === "1",
227
- screenControls: v
221
+ chrome: o.get(M.chrome) !== "0",
222
+ inspector: o.get(M.inspector) !== "0",
223
+ panelTab: Lt(o.get(M.panelTab)) ? o.get(M.panelTab) : "variations",
224
+ zoom: Ze(o.get(M.zoom)),
225
+ rotated: o.get(M.rotated) === "1",
226
+ screenControls: f
228
227
  };
229
228
  }
230
229
  function se(e, t, s) {
231
230
  const o = new URLSearchParams(), r = t.scenario(e.scenario);
232
- if (e.component ? o.set(_.component, e.component) : e.scenario && o.set(_.scenario, e.scenario), e.persona && e.persona !== r?.persona && o.set(_.persona, e.persona), e.component && e.fixture ? o.set(_.fixture, e.fixture) : e.fixture && e.fixture !== r?.fixture && o.set(_.fixture, e.fixture), e.network !== (r?.network ?? "success") && o.set(_.network, e.network), e.screenControls && !e.component) {
233
- const d = je(t, r, s), u = d.screen ? t.resolveControls(d.screen, { scenario: d.scenario }).values : {}, f = d.screen ? t.controlsOf(d.screen).map((v) => v.id) : Object.keys(e.screenControls);
234
- for (const v of f) {
235
- const k = e.screenControls[v];
236
- k !== void 0 && k !== u[v] && o.set(`${Ie}${v}`, k);
231
+ if (e.component ? o.set(M.component, e.component) : e.scenario && o.set(M.scenario, e.scenario), e.persona && e.persona !== (r?.persona ?? t.defaultPersona) && o.set(M.persona, e.persona), e.component && e.fixture ? o.set(M.fixture, e.fixture) : e.fixture && e.fixture !== r?.fixture && o.set(M.fixture, e.fixture), e.network !== (r?.network ?? "success") && o.set(M.network, e.network), e.screenControls && !e.component) {
232
+ const p = qe(t, r, s), d = p.screen ? t.resolveControls(p.screen, { scenario: p.scenario }).values : {}, v = p.screen ? t.controlsOf(p.screen).map((f) => f.id) : Object.keys(e.screenControls);
233
+ for (const f of v) {
234
+ const k = e.screenControls[f];
235
+ k !== void 0 && k !== d[f] && o.set(`${we}${f}`, k);
237
236
  }
238
237
  }
239
- e.viewport !== "fit" && o.set(_.viewport, e.viewport), e.viewport === "custom" && e.customWidth && o.set(_.customWidth, String(e.customWidth));
240
- const l = t.product.theme?.modes?.[0];
241
- e.themeMode && e.themeMode !== l && o.set(_.themeMode, e.themeMode);
242
- const c = t.product.theme?.locales?.[0];
243
- e.locale && e.locale !== c && o.set(_.locale, e.locale);
244
- const i = t.product.dataSources?.default ?? "fixtures";
245
- e.dataSource && e.dataSource !== i && o.set(_.dataSource, e.dataSource), e.chromeTheme && o.set(_.chromeTheme, e.chromeTheme), e.chrome || o.set(_.chrome, "0"), e.inspector || o.set(_.inspector, "0"), e.panelTab === "info" && o.set(_.panelTab, "info");
246
- const h = qe(e.zoom === void 0 ? null : String(e.zoom));
247
- h !== pe && o.set(_.zoom, String(h)), e.rotated && o.set(_.rotated, "1"), Me(o, e.handoff);
238
+ e.viewport !== "fit" && o.set(M.viewport, e.viewport), e.viewport === "custom" && e.customWidth && o.set(M.customWidth, String(e.customWidth));
239
+ const i = t.product.theme?.modes?.[0];
240
+ e.themeMode && e.themeMode !== i && o.set(M.themeMode, e.themeMode);
241
+ const l = t.product.theme?.locales?.[0];
242
+ e.locale && e.locale !== l && o.set(M.locale, e.locale);
243
+ const a = t.product.dataSources?.default ?? "fixtures";
244
+ e.dataSource && e.dataSource !== a && o.set(M.dataSource, e.dataSource), e.chromeTheme && o.set(M.chromeTheme, e.chromeTheme), e.chrome || o.set(M.chrome, "0"), e.inspector || o.set(M.inspector, "0"), e.panelTab === "info" && o.set(M.panelTab, "info");
245
+ const h = Ze(e.zoom === void 0 ? null : String(e.zoom));
246
+ h !== pe && o.set(M.zoom, String(h)), e.rotated && o.set(M.rotated, "1"), Te(o, e.handoff);
248
247
  const m = o.toString();
249
248
  return m ? `?${m}` : "";
250
249
  }
251
250
  function Ge(e, t = {}) {
252
- const s = !!t.frame, [o, r] = D(() => ve()), l = q(o);
253
- l.current = o, V(() => {
254
- const C = () => r(ve());
255
- return window.addEventListener("popstate", C), () => window.removeEventListener("popstate", C);
256
- }, []), V(() => {
251
+ const s = !!t.frame, [o, r] = K(() => be()), i = G(o), l = U((w) => {
252
+ i.current = w, r(w);
253
+ }, []);
254
+ I(() => {
255
+ const w = () => l(be());
256
+ return window.addEventListener("popstate", w), () => window.removeEventListener("popstate", w);
257
+ }, [l]), I(() => {
257
258
  if (!s || window.parent === window) return;
258
- const C = window.location.origin, N = (x) => {
259
- const $ = He(x, { origin: C, source: window.parent });
260
- if ($?.type !== "location") return;
261
- const { path: y, search: L } = Ne($.url);
262
- window.history.replaceState(null, "", de(y, L)), r({ path: y, search: L });
259
+ const w = window.location.origin, b = (S) => {
260
+ const u = Be(S, { origin: w, source: window.parent });
261
+ if (u?.type !== "location") return;
262
+ const { path: $, search: F } = xe(u.url);
263
+ window.history.replaceState(null, "", de($, F)), l({ path: $, search: F });
263
264
  };
264
- window.addEventListener("message", N);
265
- const w = ve();
265
+ window.addEventListener("message", b);
266
+ const N = be();
266
267
  return ae(
267
268
  window.parent,
268
- { ds: 1, type: "ready", url: de(w.path, w.search) },
269
- C
270
- ), () => window.removeEventListener("message", N);
271
- }, [s]);
272
- const c = A(
273
- () => St(o.search, e, o.path),
269
+ { ds: 1, type: "ready", url: de(N.path, N.search) },
270
+ w
271
+ ), () => window.removeEventListener("message", b);
272
+ }, [s, l]);
273
+ const a = D(
274
+ () => $e(o.search, e, o.path),
274
275
  [o.path, o.search, e]
275
- ), i = B(
276
- (C, N, w = !1) => {
276
+ ), h = U(
277
+ (w, b, N = !1) => {
277
278
  if (s) {
278
- const $ = de(C, N), y = Ne($);
279
- window.history.replaceState(null, "", $), r(y), ae(
279
+ const u = de(w, b), $ = xe(u);
280
+ window.history.replaceState(null, "", u), l($), ae(
280
281
  window.parent === window ? void 0 : window.parent,
281
- { ds: 1, type: "navigate", url: $, replace: w },
282
+ { ds: 1, type: "navigate", url: u, replace: N },
282
283
  window.location.origin
283
284
  );
284
285
  return;
285
286
  }
286
- const x = `${C}${N}`;
287
- w ? window.history.replaceState(null, "", x) : window.history.pushState(null, "", x), r({ path: C, search: N });
287
+ const S = `${w}${b}`;
288
+ N ? window.history.replaceState(null, "", S) : window.history.pushState(null, "", S), l({ path: w, search: b });
288
289
  },
289
- [s]
290
- ), h = B(
291
- (C) => {
292
- const N = { ...c, ...C };
293
- i(o.path, se(N, e, o.path), !0);
290
+ [s, l]
291
+ ), m = U(() => {
292
+ const w = i.current;
293
+ return w === o ? a : $e(w.search, e, w.path);
294
+ }, [a, o, e]), p = U(
295
+ (w) => {
296
+ const b = i.current, N = { ...m(), ...w }, S = se(N, e, b.path);
297
+ S !== b.search && h(b.path, S, !0);
294
298
  },
295
- [c, o.path, i, e]
296
- ), m = B(
297
- (C, N) => {
298
- const [w, x] = C.split("?"), $ = w || "/", y = new URLSearchParams(x ?? o.search);
299
- x === void 0 && e.screenForPath($)?.id !== e.screenForPath(o.path)?.id && ut(y), c.handoff && Me(y, c.handoff);
300
- const L = y.toString(), p = L ? `?${L}` : "";
301
- i($, p, N?.replace ?? !1);
299
+ [m, h, e]
300
+ ), d = U(
301
+ (w) => {
302
+ const b = m().screenControls ?? {};
303
+ Object.entries(w).some(([S, u]) => b[S] !== u) && p({ screenControls: { ...b, ...w } });
302
304
  },
303
- [c.handoff, o.path, o.search, i, e]
304
- ), d = B(
305
- (C) => {
306
- const N = e.scenario(C);
307
- if (!N || !oe(c.handoff, C)) return;
308
- const w = {
309
- ...c,
310
- scenario: N.id,
305
+ [m, p]
306
+ ), v = U(
307
+ (w, b) => {
308
+ const N = Nt(w, i.current, e, {
309
+ controls: b?.controls
310
+ });
311
+ h(N.path, N.search, b?.replace ?? !1);
312
+ },
313
+ [h, e]
314
+ ), f = U(
315
+ (w) => {
316
+ const b = e.scenario(w);
317
+ if (!b || !oe(a.handoff, w)) return;
318
+ const N = {
319
+ ...a,
320
+ scenario: b.id,
311
321
  component: void 0,
312
- persona: N.persona,
313
- fixture: N.fixture,
314
- network: N.network ?? "success",
322
+ persona: b.persona,
323
+ fixture: b.fixture,
324
+ network: b.network ?? "success",
315
325
  // Os controles voltam ao que o cenário fixa, sobre os padrões da tela.
316
326
  screenControls: void 0
317
327
  };
318
- i(N.route, se(w, e, N.route), !1);
328
+ h(b.route, se(N, e, b.route), !1);
319
329
  },
320
- [c, i, e]
321
- ), u = B(
322
- (C, N) => {
323
- const w = e.component(C);
324
- if (!w || !we(c.handoff, C)) return;
325
- const x = {
326
- ...c,
330
+ [a, h, e]
331
+ ), k = U(
332
+ (w, b) => {
333
+ const N = e.component(w);
334
+ if (!N || !ve(a.handoff, w)) return;
335
+ const S = {
336
+ ...a,
327
337
  scenario: void 0,
328
- component: w.id,
338
+ component: N.id,
329
339
  persona: void 0,
330
340
  fixture: void 0,
331
341
  network: "success",
332
342
  screenControls: void 0
333
343
  };
334
- x.fixture = e.componentFixture(w.id, w.defaultFixture)?.id ?? w.fixtures?.[0]?.id, i("/", se(x, e), N?.replace ?? !1);
344
+ S.fixture = e.componentFixture(N.id, N.defaultFixture)?.id ?? N.fixtures?.[0]?.id, h("/", se(S, e), b?.replace ?? !1);
335
345
  },
336
- [c, i, e]
337
- ), f = B(
338
- (C, N) => {
339
- const w = e.screensFor({ handoff: c.handoff }).find((y) => y.id === C);
340
- if (!w) return;
341
- const x = w.variations[0];
342
- if (x) {
343
- const y = {
344
- ...c,
345
- scenario: x.id,
346
+ [a, h, e]
347
+ ), T = U(
348
+ (w, b) => {
349
+ const N = e.screensFor({ handoff: a.handoff }).find(($) => $.id === w);
350
+ if (!N) return;
351
+ const S = N.variations[0];
352
+ if (S) {
353
+ const $ = {
354
+ ...a,
355
+ scenario: S.id,
346
356
  component: void 0,
347
- persona: x.persona,
348
- fixture: x.fixture,
349
- network: x.network ?? "success",
357
+ persona: S.persona,
358
+ fixture: S.fixture,
359
+ network: S.network ?? "success",
350
360
  screenControls: void 0
351
361
  };
352
- i(x.route, se(y, e, x.route), N?.replace ?? !1);
362
+ h(S.route, se($, e, S.route), b?.replace ?? !1);
353
363
  return;
354
364
  }
355
- const $ = {
356
- ...c,
365
+ const u = {
366
+ ...a,
357
367
  scenario: void 0,
358
368
  component: void 0,
359
369
  persona: void 0,
@@ -361,106 +371,134 @@ function Ge(e, t = {}) {
361
371
  network: "success",
362
372
  screenControls: void 0
363
373
  };
364
- i(w.href, se($, e, w.href), N?.replace ?? !1);
374
+ h(N.href, se(u, e, N.href), b?.replace ?? !1);
365
375
  },
366
- [c, i, e]
367
- ), v = B(
368
- (C, N, w) => i(C || "/", N, w?.replace ?? !1),
369
- [i]
370
- ), k = A(() => Nt(c), [c]);
376
+ [a, h, e]
377
+ ), E = U(
378
+ (w, b, N) => h(w || "/", b, N?.replace ?? !1),
379
+ [h]
380
+ ), x = D(() => yt(a), [a]);
371
381
  return {
372
382
  location: o,
373
- controls: c,
374
- viewport: k,
375
- setControls: h,
376
- navigate: m,
377
- openScenario: d,
378
- openComponent: u,
379
- openScreen: f,
380
- go: v
383
+ controls: a,
384
+ viewport: x,
385
+ setControls: p,
386
+ setScreenControls: d,
387
+ navigate: v,
388
+ openScenario: f,
389
+ openComponent: k,
390
+ openScreen: T,
391
+ go: E
381
392
  };
382
393
  }
383
- function Nt(e) {
394
+ function Nt(e, t, s, o = {}) {
395
+ const r = e.split("#")[0] ?? e, i = r.indexOf("?"), l = (i === -1 ? r : r.slice(0, i)) || "/", a = i === -1 ? void 0 : r.slice(i + 1), h = new URLSearchParams(t.search), m = $e(t.search, s, t.path);
396
+ let p;
397
+ if (a === void 0 && o.controls === void 0)
398
+ p = new URLSearchParams(t.search), s.screenForPath(l)?.id !== s.screenForPath(t.path)?.id && pt(p);
399
+ else {
400
+ const v = new URLSearchParams(a ?? "");
401
+ p = new URLSearchParams();
402
+ for (const [f, k] of h)
403
+ !xt(f) || v.has(f) || p.append(f, k);
404
+ m.scenario && !v.has(M.scenario) && m.persona && m.persona !== s.defaultPersona && !p.has(M.persona) && !v.has(M.persona) && p.set(M.persona, m.persona);
405
+ for (const [f, k] of v) p.append(f, k);
406
+ if (o.controls) {
407
+ const f = s.screenForPath(l), k = s.scenario(p.get(M.scenario) ?? void 0), T = k && f && s.screenOf(k)?.id === f.id ? k : void 0, E = f ? s.resolveControls(f, { scenario: T }).values : {};
408
+ for (const [x, w] of Object.entries(o.controls)) {
409
+ const b = `${we}${x}`;
410
+ E[x] === w ? p.delete(b) : p.set(b, w);
411
+ }
412
+ }
413
+ }
414
+ m.handoff && Te(p, m.handoff);
415
+ const d = p.toString();
416
+ return { path: l, search: d ? `?${d}` : "" };
417
+ }
418
+ function xt(e) {
419
+ return e.startsWith(we) ? !1 : e !== M.scenario && e !== M.fixture && e !== M.component;
420
+ }
421
+ function yt(e) {
384
422
  if (e.viewport === "custom")
385
423
  return { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 };
386
- const t = Ct.find((s) => s.id === e.viewport) ?? {
424
+ const t = St.find((s) => s.id === e.viewport) ?? {
387
425
  id: "fit",
388
426
  label: "Ajustar"
389
427
  };
390
428
  return e.rotated && t.width && t.height ? { ...t, width: t.height, height: t.width } : { ...t };
391
429
  }
392
- function qe(e) {
430
+ function Ze(e) {
393
431
  if (e === null) return pe;
394
432
  const t = Number.parseInt(e, 10);
395
- return Number.isFinite(t) ? Math.min(Te, Math.max(Le, t)) : pe;
433
+ return Number.isFinite(t) ? Math.min(Ee, Math.max(Pe, t)) : pe;
396
434
  }
397
- function ve() {
435
+ function be() {
398
436
  return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
399
437
  }
400
- function xt(e) {
401
- return e !== null && We.includes(e);
438
+ function $t(e) {
439
+ return e !== null && He.includes(e);
402
440
  }
403
- function yt(e) {
441
+ function Mt(e) {
404
442
  return e === "dark" || e === "light";
405
443
  }
406
- function $t(e) {
444
+ function Lt(e) {
407
445
  return e === "variations" || e === "info";
408
446
  }
409
- function Mt(e) {
447
+ function Tt(e) {
410
448
  if (!e) return;
411
449
  const t = Number.parseInt(e, 10);
412
450
  return Number.isFinite(t) && t > 0 ? t : void 0;
413
451
  }
414
- const Lt = "@brucesantos/design-space", Re = "0.9.0", Tt = {
415
- mobile: /* @__PURE__ */ b(G, { children: [
452
+ const Pt = "@brucesantos/design-space", Fe = "0.9.1", Et = {
453
+ mobile: /* @__PURE__ */ C(q, { children: [
416
454
  /* @__PURE__ */ n("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
417
455
  /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
418
456
  ] }),
419
- tablet: /* @__PURE__ */ b(G, { children: [
457
+ tablet: /* @__PURE__ */ C(q, { children: [
420
458
  /* @__PURE__ */ n("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
421
459
  /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
422
460
  ] }),
423
- desktop: /* @__PURE__ */ b(G, { children: [
461
+ desktop: /* @__PURE__ */ C(q, { children: [
424
462
  /* @__PURE__ */ n("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
425
463
  /* @__PURE__ */ n("path", { d: "M8.5 20.5h7M12 16.5v4" })
426
464
  ] }),
427
465
  fit: /* @__PURE__ */ n("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
428
- rotate: /* @__PURE__ */ b(G, { children: [
466
+ rotate: /* @__PURE__ */ C(q, { children: [
429
467
  /* @__PURE__ */ n("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
430
468
  /* @__PURE__ */ n("path", { d: "M20 4v4.5h-4.5" })
431
469
  ] }),
432
470
  minus: /* @__PURE__ */ n("path", { d: "M5 12h14" }),
433
471
  plus: /* @__PURE__ */ n("path", { d: "M5 12h14M12 5v14" }),
434
- link: /* @__PURE__ */ b(G, { children: [
472
+ link: /* @__PURE__ */ C(q, { children: [
435
473
  /* @__PURE__ */ n("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
436
474
  /* @__PURE__ */ n("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
437
475
  ] }),
438
476
  check: /* @__PURE__ */ n("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
439
477
  fullscreen: /* @__PURE__ */ n("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
440
- sun: /* @__PURE__ */ b(G, { children: [
478
+ sun: /* @__PURE__ */ C(q, { children: [
441
479
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
442
480
  /* @__PURE__ */ n("path", { d: "M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4" })
443
481
  ] }),
444
482
  moon: /* @__PURE__ */ n("path", { d: "M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" }),
445
- panel: /* @__PURE__ */ b(G, { children: [
483
+ panel: /* @__PURE__ */ C(q, { children: [
446
484
  /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
447
485
  /* @__PURE__ */ n("path", { d: "M15 4v16" })
448
486
  ] }),
449
- alert: /* @__PURE__ */ b(G, { children: [
487
+ alert: /* @__PURE__ */ C(q, { children: [
450
488
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
451
489
  /* @__PURE__ */ n("path", { d: "M12 7.5v5.5M12 16.2v.3" })
452
490
  ] }),
453
491
  chevron: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6" }),
454
- search: /* @__PURE__ */ b(G, { children: [
492
+ search: /* @__PURE__ */ C(q, { children: [
455
493
  /* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "6.5" }),
456
494
  /* @__PURE__ */ n("path", { d: "M20 20l-4.2-4.2" })
457
495
  ] }),
458
- copy: /* @__PURE__ */ b(G, { children: [
496
+ copy: /* @__PURE__ */ C(q, { children: [
459
497
  /* @__PURE__ */ n("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
460
498
  /* @__PURE__ */ n("path", { d: "M15.5 8.5V5.5a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3" })
461
499
  ] })
462
500
  };
463
- function I({ name: e, size: t = 16 }) {
501
+ function H({ name: e, size: t = 16 }) {
464
502
  return /* @__PURE__ */ n(
465
503
  "svg",
466
504
  {
@@ -475,7 +513,7 @@ function I({ name: e, size: t = 16 }) {
475
513
  strokeLinejoin: "round",
476
514
  "aria-hidden": "true",
477
515
  focusable: "false",
478
- children: Tt[e]
516
+ children: Et[e]
479
517
  }
480
518
  );
481
519
  }
@@ -619,7 +657,7 @@ const ne = {
619
657
  empty: "Nada para mostrar ainda",
620
658
  emptyHint: "O produto ainda não registrou telas nem componentes."
621
659
  }
622
- }, cn = {
660
+ }, dn = {
623
661
  network: {
624
662
  success: "Success",
625
663
  loading: "Loading",
@@ -760,7 +798,7 @@ const ne = {
760
798
  emptyHint: "The product has not registered any screens or components yet."
761
799
  }
762
800
  };
763
- function Et(e) {
801
+ function Rt(e) {
764
802
  if (!e) return ne;
765
803
  const t = { ...ne };
766
804
  for (const s of Object.keys(ne)) {
@@ -769,72 +807,72 @@ function Et(e) {
769
807
  }
770
808
  return t;
771
809
  }
772
- const Ze = ct(ne);
810
+ const Ye = lt(ne);
773
811
  function Q() {
774
- return it(Ze);
812
+ return ct(Ye);
775
813
  }
776
- const ln = ne.network, _t = [
814
+ const un = ne.network, _t = [
777
815
  { id: "mobile", icon: "mobile" },
778
816
  { id: "tablet", icon: "tablet" },
779
817
  { id: "desktop", icon: "desktop" },
780
818
  { id: "fit", icon: "fit" }
781
- ], Pe = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
782
- function Fe(e, t) {
783
- return t > 0 ? Pe.find((s) => s > e) ?? Te : [...Pe].reverse().find((s) => s < e) ?? Le;
819
+ ], Oe = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
820
+ function ze(e, t) {
821
+ return t > 0 ? Oe.find((s) => s > e) ?? Ee : [...Oe].reverse().find((s) => s < e) ?? Pe;
784
822
  }
785
- function Rt({
823
+ function Ft({
786
824
  productName: e,
787
825
  viewportId: t,
788
826
  viewport: s,
789
827
  zoom: o,
790
828
  rotated: r,
791
- theme: l,
792
- issues: c,
793
- linkUrl: i,
829
+ theme: i,
830
+ issues: l,
831
+ linkUrl: a,
794
832
  onViewport: h,
795
833
  onRotate: m,
796
- onZoom: d,
797
- onCleanReview: u,
798
- onToggleTheme: f
834
+ onZoom: p,
835
+ onCleanReview: d,
836
+ onToggleTheme: v
799
837
  }) {
800
- const v = Q(), k = v.topbar, [C, N] = D(!1), w = (t === "mobile" || t === "tablet") && !!(s.width && s.height), x = async () => {
838
+ const f = Q(), k = f.topbar, [T, E] = K(!1), x = (t === "mobile" || t === "tablet") && !!(s.width && s.height), w = async () => {
801
839
  try {
802
- await navigator.clipboard.writeText(i);
840
+ await navigator.clipboard.writeText(a);
803
841
  } catch {
804
- window.prompt(k.copyPrompt, i);
842
+ window.prompt(k.copyPrompt, a);
805
843
  }
806
- N(!0), window.setTimeout(() => N(!1), 1600);
844
+ E(!0), window.setTimeout(() => E(!1), 1600);
807
845
  };
808
- return /* @__PURE__ */ b("header", { className: "ds-topbar", "aria-label": k.region, children: [
809
- /* @__PURE__ */ b("div", { className: "ds-topbar__product", children: [
846
+ return /* @__PURE__ */ C("header", { className: "ds-topbar", "aria-label": k.region, children: [
847
+ /* @__PURE__ */ C("div", { className: "ds-topbar__product", children: [
810
848
  /* @__PURE__ */ n("span", { className: "ds-topbar__name", children: e }),
811
849
  /* @__PURE__ */ n(
812
850
  "a",
813
851
  {
814
852
  className: "ds-topbar__version",
815
- href: `https://www.npmjs.com/package/${Lt}/v/${Re}`,
853
+ href: `https://www.npmjs.com/package/${Pt}/v/${Fe}`,
816
854
  target: "_blank",
817
855
  rel: "noreferrer",
818
- children: k.engineVersion(Re)
856
+ children: k.engineVersion(Fe)
819
857
  }
820
858
  )
821
859
  ] }),
822
- /* @__PURE__ */ b("div", { className: "ds-topbar__view", children: [
823
- /* @__PURE__ */ b("div", { className: "ds-group", role: "group", "aria-label": k.viewportGroup, children: [
824
- _t.map(($) => {
825
- const y = v.viewport[$.id] ?? $.id;
860
+ /* @__PURE__ */ C("div", { className: "ds-topbar__view", children: [
861
+ /* @__PURE__ */ C("div", { className: "ds-group", role: "group", "aria-label": k.viewportGroup, children: [
862
+ _t.map((b) => {
863
+ const N = f.viewport[b.id] ?? b.id;
826
864
  return /* @__PURE__ */ n(
827
865
  "button",
828
866
  {
829
867
  type: "button",
830
868
  className: "ds-btn ds-btn--icon",
831
- "aria-pressed": t === $.id,
832
- "aria-label": y,
833
- title: y,
834
- onClick: () => h($.id),
835
- children: /* @__PURE__ */ n(I, { name: $.icon })
869
+ "aria-pressed": t === b.id,
870
+ "aria-label": N,
871
+ title: N,
872
+ onClick: () => h(b.id),
873
+ children: /* @__PURE__ */ n(H, { name: b.icon })
836
874
  },
837
- $.id
875
+ b.id
838
876
  );
839
877
  }),
840
878
  /* @__PURE__ */ n(
@@ -845,13 +883,13 @@ function Rt({
845
883
  "aria-pressed": r,
846
884
  "aria-label": k.rotate,
847
885
  title: k.rotate,
848
- disabled: !w,
886
+ disabled: !x,
849
887
  onClick: m,
850
- children: /* @__PURE__ */ n(I, { name: "rotate" })
888
+ children: /* @__PURE__ */ n(H, { name: "rotate" })
851
889
  }
852
890
  )
853
891
  ] }),
854
- /* @__PURE__ */ b("div", { className: "ds-group", role: "group", children: [
892
+ /* @__PURE__ */ C("div", { className: "ds-group", role: "group", children: [
855
893
  /* @__PURE__ */ n(
856
894
  "button",
857
895
  {
@@ -859,9 +897,9 @@ function Rt({
859
897
  className: "ds-btn ds-btn--icon",
860
898
  "aria-label": k.zoomOut,
861
899
  title: k.zoomOut,
862
- disabled: o <= Le,
863
- onClick: () => d(Fe(o, -1)),
864
- children: /* @__PURE__ */ n(I, { name: "minus" })
900
+ disabled: o <= Pe,
901
+ onClick: () => p(ze(o, -1)),
902
+ children: /* @__PURE__ */ n(H, { name: "minus" })
865
903
  }
866
904
  ),
867
905
  /* @__PURE__ */ n(
@@ -871,7 +909,7 @@ function Rt({
871
909
  className: "ds-btn ds-btn--zoom",
872
910
  "aria-label": k.zoomReset,
873
911
  title: k.zoomReset,
874
- onClick: () => d(pe),
912
+ onClick: () => p(pe),
875
913
  children: k.zoomValue(o)
876
914
  }
877
915
  ),
@@ -882,9 +920,9 @@ function Rt({
882
920
  className: "ds-btn ds-btn--icon",
883
921
  "aria-label": k.zoomIn,
884
922
  title: k.zoomIn,
885
- disabled: o >= Te,
886
- onClick: () => d(Fe(o, 1)),
887
- children: /* @__PURE__ */ n(I, { name: "plus" })
923
+ disabled: o >= Ee,
924
+ onClick: () => p(ze(o, 1)),
925
+ children: /* @__PURE__ */ n(H, { name: "plus" })
888
926
  }
889
927
  )
890
928
  ] }),
@@ -895,21 +933,21 @@ function Rt({
895
933
  className: "ds-btn ds-btn--icon",
896
934
  "aria-label": k.cleanReview,
897
935
  title: k.cleanReview,
898
- onClick: u,
899
- children: /* @__PURE__ */ n(I, { name: "fullscreen" })
936
+ onClick: d,
937
+ children: /* @__PURE__ */ n(H, { name: "fullscreen" })
900
938
  }
901
939
  )
902
940
  ] }),
903
- /* @__PURE__ */ b("div", { className: "ds-topbar__tools", children: [
941
+ /* @__PURE__ */ C("div", { className: "ds-topbar__tools", children: [
904
942
  /* @__PURE__ */ n(
905
943
  "button",
906
944
  {
907
945
  type: "button",
908
946
  className: "ds-btn ds-btn--icon",
909
- "aria-label": C ? k.copied : k.copyLink,
910
- title: C ? k.copied : k.copyLink,
911
- onClick: x,
912
- children: /* @__PURE__ */ n(I, { name: C ? "check" : "link" })
947
+ "aria-label": T ? k.copied : k.copyLink,
948
+ title: T ? k.copied : k.copyLink,
949
+ onClick: w,
950
+ children: /* @__PURE__ */ n(H, { name: T ? "check" : "link" })
913
951
  }
914
952
  ),
915
953
  /* @__PURE__ */ n(
@@ -917,51 +955,51 @@ function Rt({
917
955
  {
918
956
  type: "button",
919
957
  className: "ds-btn ds-btn--icon",
920
- "aria-label": l === "dark" ? k.lightMode : k.darkMode,
921
- title: l === "dark" ? k.lightMode : k.darkMode,
922
- onClick: f,
923
- children: /* @__PURE__ */ n(I, { name: l === "dark" ? "sun" : "moon" })
958
+ "aria-label": i === "dark" ? k.lightMode : k.darkMode,
959
+ title: i === "dark" ? k.lightMode : k.darkMode,
960
+ onClick: v,
961
+ children: /* @__PURE__ */ n(H, { name: i === "dark" ? "sun" : "moon" })
924
962
  }
925
963
  ),
926
- c.length > 0 && /* @__PURE__ */ n(Pt, { issues: c })
964
+ l.length > 0 && /* @__PURE__ */ n(Ot, { issues: l })
927
965
  ] })
928
966
  ] });
929
967
  }
930
- function Pt({ issues: e }) {
931
- const t = Q(), [s, o] = D(!1), r = q(null), l = e.filter((h) => h.level === "error").length, c = e.length - l, i = t.topbar.diagnostics(l, c);
932
- return V(() => {
968
+ function Ot({ issues: e }) {
969
+ const t = Q(), [s, o] = K(!1), r = G(null), i = e.filter((h) => h.level === "error").length, l = e.length - i, a = t.topbar.diagnostics(i, l);
970
+ return I(() => {
933
971
  if (!s) return;
934
- const h = (d) => {
935
- r.current?.contains(d.target) || o(!1);
936
- }, m = (d) => {
937
- d.key === "Escape" && o(!1);
972
+ const h = (p) => {
973
+ r.current?.contains(p.target) || o(!1);
974
+ }, m = (p) => {
975
+ p.key === "Escape" && o(!1);
938
976
  };
939
977
  return window.addEventListener("pointerdown", h), window.addEventListener("keydown", m), () => {
940
978
  window.removeEventListener("pointerdown", h), window.removeEventListener("keydown", m);
941
979
  };
942
- }, [s]), /* @__PURE__ */ b("div", { className: "ds-diagnostics", ref: r, children: [
943
- /* @__PURE__ */ b(
980
+ }, [s]), /* @__PURE__ */ C("div", { className: "ds-diagnostics", ref: r, children: [
981
+ /* @__PURE__ */ C(
944
982
  "button",
945
983
  {
946
984
  type: "button",
947
985
  className: "ds-btn ds-diagnostics__trigger",
948
- "data-level": l > 0 ? "error" : "warning",
986
+ "data-level": i > 0 ? "error" : "warning",
949
987
  "aria-expanded": s,
950
- "aria-label": i,
951
- title: i,
988
+ "aria-label": a,
989
+ title: a,
952
990
  onClick: () => o((h) => !h),
953
991
  children: [
954
- /* @__PURE__ */ n(I, { name: "alert" }),
955
- /* @__PURE__ */ n("span", { children: l > 0 ? l : c })
992
+ /* @__PURE__ */ n(H, { name: "alert" }),
993
+ /* @__PURE__ */ n("span", { children: i > 0 ? i : l })
956
994
  ]
957
995
  }
958
996
  ),
959
- s && /* @__PURE__ */ b("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
960
- /* @__PURE__ */ b("div", { className: "ds-diagnostics__head", children: [
997
+ s && /* @__PURE__ */ C("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
998
+ /* @__PURE__ */ C("div", { className: "ds-diagnostics__head", children: [
961
999
  /* @__PURE__ */ n("strong", { children: t.diagnostics.title }),
962
- /* @__PURE__ */ n("span", { className: "ds-muted", children: i })
1000
+ /* @__PURE__ */ n("span", { className: "ds-muted", children: a })
963
1001
  ] }),
964
- /* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((h, m) => /* @__PURE__ */ b("li", { className: "ds-diagnostics__item", "data-level": h.level, children: [
1002
+ /* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((h, m) => /* @__PURE__ */ C("li", { className: "ds-diagnostics__item", "data-level": h.level, children: [
965
1003
  /* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children: h.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
966
1004
  /* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children: h.where }),
967
1005
  /* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children: h.message })
@@ -969,21 +1007,21 @@ function Pt({ issues: e }) {
969
1007
  ] })
970
1008
  ] });
971
1009
  }
972
- const Ft = 16;
973
- function Ye({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: l }) {
974
- const c = q(void 0), i = e === "left" ? 1 : -1, h = (f) => {
975
- if (f.button === 0) {
976
- f.preventDefault(), c.current = { x: f.clientX, width: s };
1010
+ const zt = 16;
1011
+ function Xe({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: i }) {
1012
+ const l = G(void 0), a = e === "left" ? 1 : -1, h = (v) => {
1013
+ if (v.button === 0) {
1014
+ v.preventDefault(), l.current = { x: v.clientX, width: s };
977
1015
  try {
978
- f.currentTarget.setPointerCapture(f.pointerId);
1016
+ v.currentTarget.setPointerCapture(v.pointerId);
979
1017
  } catch {
980
1018
  }
981
1019
  r?.();
982
1020
  }
983
- }, m = (f) => {
984
- c.current && o(c.current.width + (f.clientX - c.current.x) * i);
985
- }, d = () => {
986
- c.current && (c.current = void 0, l?.());
1021
+ }, m = (v) => {
1022
+ l.current && o(l.current.width + (v.clientX - l.current.x) * a);
1023
+ }, p = () => {
1024
+ l.current && (l.current = void 0, i?.());
987
1025
  };
988
1026
  return /* @__PURE__ */ n(
989
1027
  "div",
@@ -997,173 +1035,173 @@ function Ye({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: l })
997
1035
  tabIndex: 0,
998
1036
  onPointerDown: h,
999
1037
  onPointerMove: m,
1000
- onPointerUp: d,
1001
- onPointerCancel: d,
1002
- onLostPointerCapture: d,
1003
- onKeyDown: (f) => {
1004
- if (f.key !== "ArrowLeft" && f.key !== "ArrowRight") return;
1005
- f.preventDefault();
1006
- const v = f.key === "ArrowRight" ? 1 : -1;
1007
- o(s + v * i * Ft);
1038
+ onPointerUp: p,
1039
+ onPointerCancel: p,
1040
+ onLostPointerCapture: p,
1041
+ onKeyDown: (v) => {
1042
+ if (v.key !== "ArrowLeft" && v.key !== "ArrowRight") return;
1043
+ v.preventDefault();
1044
+ const f = v.key === "ArrowRight" ? 1 : -1;
1045
+ o(s + f * a * zt);
1008
1046
  }
1009
1047
  }
1010
1048
  );
1011
1049
  }
1012
- function Ot({
1050
+ function At({
1013
1051
  registry: e,
1014
1052
  handoff: t,
1015
1053
  activeScreen: s,
1016
1054
  activeComponent: o,
1017
1055
  onOpenScreen: r,
1018
- onOpenComponent: l,
1019
- width: c,
1020
- onResize: i,
1056
+ onOpenComponent: i,
1057
+ width: l,
1058
+ onResize: a,
1021
1059
  onResizeStart: h,
1022
1060
  onResizeEnd: m
1023
1061
  }) {
1024
- const u = Q().sidebar, [f, v] = D(""), [k, C] = D(() => /* @__PURE__ */ new Set()), N = q(null), w = e.screensFor({ handoff: t }), x = e.componentsFor(t), $ = w.length > 0, y = x.length > 0, [L, p] = D(
1025
- () => o || !$ ? "components" : "screens"
1062
+ const d = Q().sidebar, [v, f] = K(""), [k, T] = K(() => /* @__PURE__ */ new Set()), E = G(null), x = e.screensFor({ handoff: t }), w = e.componentsFor(t), b = x.length > 0, N = w.length > 0, [S, u] = K(
1063
+ () => o || !b ? "components" : "screens"
1026
1064
  );
1027
- V(() => {
1028
- o && y ? p("components") : s && $ && p("screens");
1029
- }, [o, s, y, $]);
1030
- const E = L;
1031
- V(() => {
1032
- const F = (K) => {
1033
- Dt(K) && (K.preventDefault(), N.current?.focus(), N.current?.select());
1065
+ I(() => {
1066
+ o && N ? u("components") : s && b && u("screens");
1067
+ }, [o, s, N, b]);
1068
+ const $ = S;
1069
+ I(() => {
1070
+ const R = (V) => {
1071
+ Vt(V) && (V.preventDefault(), E.current?.focus(), E.current?.select());
1034
1072
  };
1035
- return window.addEventListener("keydown", F), () => window.removeEventListener("keydown", F);
1073
+ return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
1036
1074
  }, []);
1037
- const a = A(
1038
- () => e.searchScreens(f, { handoff: t }),
1039
- [t, f, e]
1040
- ), g = A(
1041
- () => e.searchComponents(f, t),
1042
- [t, f, e]
1043
- ), S = A(() => At(g, u.ungrouped), [g, u.ungrouped]), R = A(() => Be(a), [a]), M = f.trim().length > 0, W = (F) => C((K) => {
1044
- const T = new Set(K);
1045
- return T.has(F) ? T.delete(F) : T.add(F), T;
1075
+ const F = D(
1076
+ () => e.searchScreens(v, { handoff: t }),
1077
+ [t, v, e]
1078
+ ), c = D(
1079
+ () => e.searchComponents(v, t),
1080
+ [t, v, e]
1081
+ ), g = D(() => Kt(c, d.ungrouped), [c, d.ungrouped]), y = D(() => je(F), [F]), L = v.trim().length > 0, O = (R) => T((V) => {
1082
+ const P = new Set(V);
1083
+ return P.has(R) ? P.delete(R) : P.add(R), P;
1046
1084
  });
1047
- return /* @__PURE__ */ b("nav", { className: "ds-sidebar", "aria-label": u.region, style: { width: c }, children: [
1048
- /* @__PURE__ */ b("div", { className: "ds-search", children: [
1049
- /* @__PURE__ */ n(I, { name: "search", size: 14 }),
1085
+ return /* @__PURE__ */ C("nav", { className: "ds-sidebar", "aria-label": d.region, style: { width: l }, children: [
1086
+ /* @__PURE__ */ C("div", { className: "ds-search", children: [
1087
+ /* @__PURE__ */ n(H, { name: "search", size: 14 }),
1050
1088
  /* @__PURE__ */ n(
1051
1089
  "input",
1052
1090
  {
1053
- ref: N,
1091
+ ref: E,
1054
1092
  className: "ds-input ds-search__input",
1055
1093
  type: "search",
1056
- value: f,
1057
- placeholder: u.searchPlaceholder,
1058
- "aria-label": u.searchLabel,
1059
- onChange: (F) => v(F.target.value),
1060
- onKeyDown: (F) => {
1061
- F.key === "Escape" && v("");
1094
+ value: v,
1095
+ placeholder: d.searchPlaceholder,
1096
+ "aria-label": d.searchLabel,
1097
+ onChange: (R) => f(R.target.value),
1098
+ onKeyDown: (R) => {
1099
+ R.key === "Escape" && f("");
1062
1100
  }
1063
1101
  }
1064
1102
  ),
1065
- /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: u.searchShortcut })
1103
+ /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: d.searchShortcut })
1066
1104
  ] }),
1067
- /* @__PURE__ */ b("div", { className: "ds-tabs", role: "tablist", "aria-label": u.tabs, children: [
1105
+ /* @__PURE__ */ C("div", { className: "ds-tabs", role: "tablist", "aria-label": d.tabs, children: [
1068
1106
  /* @__PURE__ */ n(
1069
- Oe,
1107
+ Ae,
1070
1108
  {
1071
- selected: E === "screens",
1072
- label: u.screensTab,
1073
- count: M ? a.length : void 0,
1074
- onSelect: () => p("screens")
1109
+ selected: $ === "screens",
1110
+ label: d.screensTab,
1111
+ count: L ? F.length : void 0,
1112
+ onSelect: () => u("screens")
1075
1113
  }
1076
1114
  ),
1077
1115
  /* @__PURE__ */ n(
1078
- Oe,
1116
+ Ae,
1079
1117
  {
1080
- selected: E === "components",
1081
- label: u.componentsTab,
1082
- count: M ? g.length : void 0,
1083
- onSelect: () => p("components")
1118
+ selected: $ === "components",
1119
+ label: d.componentsTab,
1120
+ count: L ? c.length : void 0,
1121
+ onSelect: () => u("components")
1084
1122
  }
1085
1123
  )
1086
1124
  ] }),
1087
- /* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: E === "screens" ? $ ? a.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noMatch(f) }) : R.map((F) => {
1088
- const K = /* @__PURE__ */ n("ul", { className: "ds-items", children: F.screens.map((z) => /* @__PURE__ */ n(
1089
- zt,
1125
+ /* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: $ === "screens" ? b ? F.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: d.noMatch(v) }) : y.map((R) => {
1126
+ const V = /* @__PURE__ */ n("ul", { className: "ds-items", children: R.screens.map((A) => /* @__PURE__ */ n(
1127
+ Dt,
1090
1128
  {
1091
- screen: z,
1092
- active: z.id === s && !o,
1129
+ screen: A,
1130
+ active: A.id === s && !o,
1093
1131
  onOpen: r
1094
1132
  },
1095
- z.id
1133
+ A.id
1096
1134
  )) });
1097
- if (F.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: K }, "");
1098
- const T = `screens:${F.name}`, O = k.has(T) && !M;
1099
- return /* @__PURE__ */ b("section", { className: "ds-group-section", children: [
1100
- /* @__PURE__ */ b(
1135
+ if (R.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: V }, "");
1136
+ const P = `screens:${R.name}`, z = k.has(P) && !L;
1137
+ return /* @__PURE__ */ C("section", { className: "ds-group-section", children: [
1138
+ /* @__PURE__ */ C(
1101
1139
  "button",
1102
1140
  {
1103
1141
  type: "button",
1104
1142
  className: "ds-group-section__head",
1105
- "aria-expanded": !O,
1106
- "aria-label": u.toggleGroup(F.name),
1107
- onClick: () => W(T),
1143
+ "aria-expanded": !z,
1144
+ "aria-label": d.toggleGroup(R.name),
1145
+ onClick: () => O(P),
1108
1146
  children: [
1109
- /* @__PURE__ */ n(I, { name: "chevron", size: 12 }),
1110
- /* @__PURE__ */ n("span", { children: F.name }),
1111
- /* @__PURE__ */ n("span", { className: "ds-count", children: F.screens.length })
1147
+ /* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
1148
+ /* @__PURE__ */ n("span", { children: R.name }),
1149
+ /* @__PURE__ */ n("span", { className: "ds-count", children: R.screens.length })
1112
1150
  ]
1113
1151
  }
1114
1152
  ),
1115
- !O && K
1116
- ] }, T);
1117
- }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: u.emptyScreens }) : y ? g.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noMatch(f) }) : S.map(({ group: F, items: K }) => {
1118
- const T = k.has(F) && !M;
1119
- return /* @__PURE__ */ b("section", { className: "ds-group-section", children: [
1120
- /* @__PURE__ */ b(
1153
+ !z && V
1154
+ ] }, P);
1155
+ }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: d.emptyScreens }) : N ? c.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: d.noMatch(v) }) : g.map(({ group: R, items: V }) => {
1156
+ const P = k.has(R) && !L;
1157
+ return /* @__PURE__ */ C("section", { className: "ds-group-section", children: [
1158
+ /* @__PURE__ */ C(
1121
1159
  "button",
1122
1160
  {
1123
1161
  type: "button",
1124
1162
  className: "ds-group-section__head",
1125
- "aria-expanded": !T,
1126
- "aria-label": u.toggleGroup(F),
1127
- onClick: () => W(F),
1163
+ "aria-expanded": !P,
1164
+ "aria-label": d.toggleGroup(R),
1165
+ onClick: () => O(R),
1128
1166
  children: [
1129
- /* @__PURE__ */ n(I, { name: "chevron", size: 12 }),
1130
- /* @__PURE__ */ n("span", { children: F }),
1131
- /* @__PURE__ */ n("span", { className: "ds-count", children: K.length })
1167
+ /* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
1168
+ /* @__PURE__ */ n("span", { children: R }),
1169
+ /* @__PURE__ */ n("span", { className: "ds-count", children: V.length })
1132
1170
  ]
1133
1171
  }
1134
1172
  ),
1135
- !T && /* @__PURE__ */ n("ul", { className: "ds-items", children: K.map((O) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1173
+ !P && /* @__PURE__ */ n("ul", { className: "ds-items", children: V.map((z) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1136
1174
  "button",
1137
1175
  {
1138
1176
  type: "button",
1139
1177
  className: "ds-item",
1140
- "aria-current": O.id === o ? "true" : void 0,
1141
- onClick: () => l(O.id),
1142
- children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: O.name })
1178
+ "aria-current": z.id === o ? "true" : void 0,
1179
+ onClick: () => i(z.id),
1180
+ children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: z.name })
1143
1181
  }
1144
- ) }, O.id)) })
1145
- ] }, F);
1146
- }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: u.emptyComponents }) }),
1182
+ ) }, z.id)) })
1183
+ ] }, R);
1184
+ }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: d.emptyComponents }) }),
1147
1185
  /* @__PURE__ */ n(
1148
- Ye,
1186
+ Xe,
1149
1187
  {
1150
1188
  side: "left",
1151
- label: u.resize,
1152
- value: c,
1153
- onChange: i,
1189
+ label: d.resize,
1190
+ value: l,
1191
+ onChange: a,
1154
1192
  onStart: h,
1155
1193
  onEnd: m
1156
1194
  }
1157
1195
  )
1158
1196
  ] });
1159
1197
  }
1160
- function Oe({
1198
+ function Ae({
1161
1199
  selected: e,
1162
1200
  label: t,
1163
1201
  count: s,
1164
1202
  onSelect: o
1165
1203
  }) {
1166
- return /* @__PURE__ */ b(
1204
+ return /* @__PURE__ */ C(
1167
1205
  "button",
1168
1206
  {
1169
1207
  type: "button",
@@ -1179,12 +1217,12 @@ function Oe({
1179
1217
  }
1180
1218
  );
1181
1219
  }
1182
- function zt({
1220
+ function Dt({
1183
1221
  screen: e,
1184
1222
  active: t,
1185
1223
  onOpen: s
1186
1224
  }) {
1187
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ b(
1225
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ C(
1188
1226
  "button",
1189
1227
  {
1190
1228
  type: "button",
@@ -1198,185 +1236,185 @@ function zt({
1198
1236
  }
1199
1237
  ) });
1200
1238
  }
1201
- function At(e, t) {
1239
+ function Kt(e, t) {
1202
1240
  const s = /* @__PURE__ */ new Map();
1203
1241
  for (const o of e) {
1204
- const r = o.group?.trim() || t, l = s.get(r) ?? [];
1205
- l.push(o), s.set(r, l);
1242
+ const r = o.group?.trim() || t, i = s.get(r) ?? [];
1243
+ i.push(o), s.set(r, i);
1206
1244
  }
1207
1245
  return [...s].map(([o, r]) => ({ group: o, items: r }));
1208
1246
  }
1209
- function Dt(e) {
1247
+ function Vt(e) {
1210
1248
  return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "k";
1211
1249
  }
1212
- function Kt({
1250
+ function Ut({
1213
1251
  screen: e,
1214
1252
  variations: t,
1215
1253
  components: s,
1216
1254
  deploy: o,
1217
1255
  labels: r,
1218
- overrides: l
1256
+ overrides: i
1219
1257
  }) {
1220
- const c = r.pr, i = [`## ${e.name}`, ""];
1221
- e.description && i.push(e.description, ""), i.push(`\`${e.route.path}\``, "");
1222
- const h = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? c.commit(o.shortCommit) : void 0;
1223
- if (i.push(`### ${c.variations}`, ""), t.length === 0) {
1224
- const d = new URL(e.href, o.origin);
1225
- xe(d.searchParams, l), i.push(`- [${r.panel.defaultVariation}](${d.toString()})`);
1258
+ const l = r.pr, a = [`## ${e.name}`, ""];
1259
+ e.description && a.push(e.description, ""), a.push(`\`${e.route.path}\``, "");
1260
+ const h = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? l.commit(o.shortCommit) : void 0;
1261
+ if (a.push(`### ${l.variations}`, ""), t.length === 0) {
1262
+ const p = new URL(e.href, o.origin);
1263
+ ye(p.searchParams, i), a.push(`- [${r.panel.defaultVariation}](${p.toString()})`);
1226
1264
  }
1227
- for (const d of t) {
1228
- const u = he(d, { origin: o.origin, overrides: l });
1229
- let f = `- [${Xe(d.title)}](${u})`;
1265
+ for (const p of t) {
1266
+ const d = he(p, { origin: o.origin, overrides: i });
1267
+ let v = `- [${Qe(p.title)}](${d})`;
1230
1268
  if (h) {
1231
- const v = he(d, { origin: h, overrides: l });
1232
- f += ` · [${m ?? c.immutableLink}](${v})`;
1233
- } else m && (f += ` · ${m}`);
1234
- i.push(f);
1269
+ const f = he(p, { origin: h, overrides: i });
1270
+ v += ` · [${m ?? l.immutableLink}](${f})`;
1271
+ } else m && (v += ` · ${m}`);
1272
+ a.push(v);
1235
1273
  }
1236
- if (i.push(""), s.length > 0) {
1237
- i.push(`### ${c.components}`, ""), i.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
1238
- for (const d of s) {
1239
- const u = d.source ? `\`${me(d.source)}\`` : c.empty;
1240
- i.push(`| ${me(d.name)} (\`${d.id}\`) | ${u} |`);
1274
+ if (a.push(""), s.length > 0) {
1275
+ a.push(`### ${l.components}`, ""), a.push(`| ${l.component} | ${l.source} |`, "| --- | --- |");
1276
+ for (const p of s) {
1277
+ const d = p.source ? `\`${me(p.source)}\`` : l.empty;
1278
+ a.push(`| ${me(p.name)} (\`${p.id}\`) | ${d} |`);
1241
1279
  }
1242
- i.push("");
1280
+ a.push("");
1243
1281
  }
1244
- i.push(`### ${c.expected}`, ""), t.length === 0 && i.push(`**${r.panel.defaultVariation}**`, "", c.noExpected, "");
1245
- for (const d of t) {
1246
- if (i.push(`**${d.title}**`, ""), d.expected?.length)
1247
- for (const u of d.expected) i.push(`- ${u}`);
1282
+ a.push(`### ${l.expected}`, ""), t.length === 0 && a.push(`**${r.panel.defaultVariation}**`, "", l.noExpected, "");
1283
+ for (const p of t) {
1284
+ if (a.push(`**${p.title}**`, ""), p.expected?.length)
1285
+ for (const d of p.expected) a.push(`- ${d}`);
1248
1286
  else
1249
- i.push(c.noExpected);
1250
- i.push("");
1287
+ a.push(l.noExpected);
1288
+ a.push("");
1251
1289
  }
1252
- return `${i.join(`
1290
+ return `${a.join(`
1253
1291
  `).trimEnd()}
1254
1292
  `;
1255
1293
  }
1256
1294
  function me(e) {
1257
1295
  return e.replace(/\|/g, "\\|").replace(/\n/g, " ");
1258
1296
  }
1259
- function Xe(e) {
1297
+ function Qe(e) {
1260
1298
  return e.replace(/([[\]])/g, "\\$1");
1261
1299
  }
1262
- function Vt({
1300
+ function It({
1263
1301
  flow: e,
1264
1302
  registry: t,
1265
1303
  open: s,
1266
1304
  deploy: o,
1267
1305
  labels: r,
1268
- overrides: l
1306
+ overrides: i
1269
1307
  }) {
1270
- const c = r.pr, i = [`## ${e.name}`, ""], h = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? c.commit(o.shortCommit) : void 0, d = (u, f) => {
1271
- if (s && s.screen.id === u.id) {
1272
- const C = new URL(s.location.path || "/", f), N = new URLSearchParams(s.location.search);
1273
- for (const w of ht) N.delete(w);
1274
- for (const [w, x] of N) C.searchParams.append(w, x);
1275
- return xe(C.searchParams, l), C.toString();
1308
+ const l = r.pr, a = [`## ${e.name}`, ""], h = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? l.commit(o.shortCommit) : void 0, p = (d, v) => {
1309
+ if (s && s.screen.id === d.id) {
1310
+ const T = new URL(s.location.path || "/", v), E = new URLSearchParams(s.location.search);
1311
+ for (const x of mt) E.delete(x);
1312
+ for (const [x, w] of E) T.searchParams.append(x, w);
1313
+ return ye(T.searchParams, i), T.toString();
1276
1314
  }
1277
- const v = u.variations[0];
1278
- if (v) return he(v, { origin: f, overrides: l });
1279
- const k = new URL(u.href, f);
1280
- return xe(k.searchParams, l), k.toString();
1315
+ const f = d.variations[0];
1316
+ if (f) return he(f, { origin: v, overrides: i });
1317
+ const k = new URL(d.href, v);
1318
+ return ye(k.searchParams, i), k.toString();
1281
1319
  };
1282
- for (const u of e.screens) {
1283
- i.push(`### ${u.name}`, ""), u.description && i.push(u.description, "");
1284
- let f = `\`${u.route.path}\` · [${c.open}](${d(u, o.origin)})`;
1285
- if (h ? f += ` · [${m ?? c.immutableLink}](${d(u, h)})` : m && (f += ` · ${m}`), i.push(f, ""), u.controls.length > 0) {
1286
- i.push(`**${c.controls}**`, "");
1287
- for (const w of u.controls) {
1288
- i.push(`- ${ce(w.title)} (\`${w.id}\`)`);
1289
- for (const x of w.controls) {
1290
- const $ = ge(x), y = x.options.map(
1291
- (L) => L.value === $ ? `${ce(L.label)} (\`${L.value}\`, ${c.defaultOption})` : `${ce(L.label)} (\`${L.value}\`)`
1320
+ for (const d of e.screens) {
1321
+ a.push(`### ${d.name}`, ""), d.description && a.push(d.description, "");
1322
+ let v = `\`${d.route.path}\` · [${l.open}](${p(d, o.origin)})`;
1323
+ if (h ? v += ` · [${m ?? l.immutableLink}](${p(d, h)})` : m && (v += ` · ${m}`), a.push(v, ""), d.controls.length > 0) {
1324
+ a.push(`**${l.controls}**`, "");
1325
+ for (const x of d.controls) {
1326
+ a.push(`- ${ce(x.title)} (\`${x.id}\`)`);
1327
+ for (const w of x.controls) {
1328
+ const b = ge(w), N = w.options.map(
1329
+ (S) => S.value === b ? `${ce(S.label)} (\`${S.value}\`, ${l.defaultOption})` : `${ce(S.label)} (\`${S.value}\`)`
1292
1330
  ).join(" · ");
1293
- i.push(` - ${ce(x.label)} (\`c.${x.id}\`): ${y}`);
1331
+ a.push(` - ${ce(w.label)} (\`c.${w.id}\`): ${N}`);
1294
1332
  }
1295
1333
  }
1296
- i.push("");
1334
+ a.push("");
1297
1335
  }
1298
- if (u.variations.length > 0) {
1299
- i.push(`**${c.shortcuts}**`, "");
1300
- for (const w of u.variations)
1301
- i.push(
1302
- `- [${Xe(w.title)}](${he(w, { origin: o.origin, overrides: l })})`
1336
+ if (d.variations.length > 0) {
1337
+ a.push(`**${l.shortcuts}**`, "");
1338
+ for (const x of d.variations)
1339
+ a.push(
1340
+ `- [${Qe(x.title)}](${he(x, { origin: o.origin, overrides: i })})`
1303
1341
  );
1304
- i.push("");
1342
+ a.push("");
1305
1343
  }
1306
- i.push(`**${c.expected}**`, "");
1307
- const v = s?.screen.id === u.id ? s.variation : void 0, k = v?.expected?.length ? v.expected : u.route.expected, C = u.variations.filter(
1308
- (w) => w.expected?.length && w.id !== v?.id
1344
+ a.push(`**${l.expected}**`, "");
1345
+ const f = s?.screen.id === d.id ? s.variation : void 0, k = f?.expected?.length ? f.expected : d.route.expected, T = d.variations.filter(
1346
+ (x) => x.expected?.length && x.id !== f?.id
1309
1347
  );
1310
- if (!k?.length && C.length === 0 && i.push(c.noExpected, ""), k?.length) {
1311
- for (const w of k) i.push(`- ${w}`);
1312
- i.push("");
1348
+ if (!k?.length && T.length === 0 && a.push(l.noExpected, ""), k?.length) {
1349
+ for (const x of k) a.push(`- ${x}`);
1350
+ a.push("");
1313
1351
  }
1314
- for (const w of C) {
1315
- i.push(`*${w.title}*`, "");
1316
- for (const x of w.expected ?? []) i.push(`- ${x}`);
1317
- i.push("");
1352
+ for (const x of T) {
1353
+ a.push(`*${x.title}*`, "");
1354
+ for (const w of x.expected ?? []) a.push(`- ${w}`);
1355
+ a.push("");
1318
1356
  }
1319
- const N = t.componentsOfScreen(u);
1320
- if (N.length > 0) {
1321
- i.push(`**${c.components}**`, ""), i.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
1322
- for (const w of N) {
1323
- const x = w.source ? `\`${me(w.source)}\`` : c.empty;
1324
- i.push(`| ${me(w.name)} (\`${w.id}\`) | ${x} |`);
1357
+ const E = t.componentsOfScreen(d);
1358
+ if (E.length > 0) {
1359
+ a.push(`**${l.components}**`, ""), a.push(`| ${l.component} | ${l.source} |`, "| --- | --- |");
1360
+ for (const x of E) {
1361
+ const w = x.source ? `\`${me(x.source)}\`` : l.empty;
1362
+ a.push(`| ${me(x.name)} (\`${x.id}\`) | ${w} |`);
1325
1363
  }
1326
- i.push("");
1364
+ a.push("");
1327
1365
  }
1328
1366
  }
1329
- return `${i.join(`
1367
+ return `${a.join(`
1330
1368
  `).trimEnd()}
1331
1369
  `;
1332
1370
  }
1333
1371
  function ce(e) {
1334
1372
  return e.replace(/([*_[\]`])/g, "\\$1");
1335
1373
  }
1336
- function Ut(e) {
1337
- const { tab: t, onTab: s, width: o, onResize: r, onResizeStart: l, onResizeEnd: c } = e, i = Q().panel, [h, m] = D(""), d = q(null), u = q(null), [f, v] = D(!1), [k, C] = D(() => /* @__PURE__ */ new Set()), N = (x) => C(($) => {
1338
- const y = new Set($);
1339
- return y.has(x) ? y.delete(x) : y.add(x), y;
1340
- }), w = h.trim().length > 0;
1341
- return V(() => {
1342
- const x = ($) => {
1343
- jt($) && ($.preventDefault(), d.current?.focus(), d.current?.select());
1374
+ function Wt(e) {
1375
+ const { tab: t, onTab: s, width: o, onResize: r, onResizeStart: i, onResizeEnd: l } = e, a = Q().panel, [h, m] = K(""), p = G(null), d = G(null), [v, f] = K(!1), [k, T] = K(() => /* @__PURE__ */ new Set()), E = (w) => T((b) => {
1376
+ const N = new Set(b);
1377
+ return N.has(w) ? N.delete(w) : N.add(w), N;
1378
+ }), x = h.trim().length > 0;
1379
+ return I(() => {
1380
+ const w = (b) => {
1381
+ Gt(b) && (b.preventDefault(), p.current?.focus(), p.current?.select());
1344
1382
  };
1345
- return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
1346
- }, []), Ke(() => {
1347
- v(Gt(u.current, h));
1348
- }), /* @__PURE__ */ b("aside", { className: "ds-panel", "aria-label": i.region, style: { width: o }, children: [
1383
+ return window.addEventListener("keydown", w), () => window.removeEventListener("keydown", w);
1384
+ }, []), Ue(() => {
1385
+ f(Zt(d.current, h));
1386
+ }), /* @__PURE__ */ C("aside", { className: "ds-panel", "aria-label": a.region, style: { width: o }, children: [
1349
1387
  /* @__PURE__ */ n(
1350
- Ye,
1388
+ Xe,
1351
1389
  {
1352
1390
  side: "right",
1353
- label: i.resize,
1391
+ label: a.resize,
1354
1392
  value: o,
1355
1393
  onChange: r,
1356
- onStart: l,
1357
- onEnd: c
1394
+ onStart: i,
1395
+ onEnd: l
1358
1396
  }
1359
1397
  ),
1360
- /* @__PURE__ */ b("div", { className: "ds-search", children: [
1361
- /* @__PURE__ */ n(I, { name: "search", size: 14 }),
1398
+ /* @__PURE__ */ C("div", { className: "ds-search", children: [
1399
+ /* @__PURE__ */ n(H, { name: "search", size: 14 }),
1362
1400
  /* @__PURE__ */ n(
1363
1401
  "input",
1364
1402
  {
1365
- ref: d,
1403
+ ref: p,
1366
1404
  className: "ds-input ds-search__input",
1367
1405
  type: "search",
1368
1406
  value: h,
1369
- placeholder: i.searchPlaceholder,
1370
- "aria-label": i.searchLabel,
1371
- onChange: (x) => m(x.target.value),
1372
- onKeyDown: (x) => {
1373
- x.key === "Escape" && m("");
1407
+ placeholder: a.searchPlaceholder,
1408
+ "aria-label": a.searchLabel,
1409
+ onChange: (w) => m(w.target.value),
1410
+ onKeyDown: (w) => {
1411
+ w.key === "Escape" && m("");
1374
1412
  }
1375
1413
  }
1376
1414
  ),
1377
- /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: i.searchShortcut })
1415
+ /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: a.searchShortcut })
1378
1416
  ] }),
1379
- /* @__PURE__ */ b("div", { className: "ds-tabs", role: "tablist", "aria-label": i.tabs, children: [
1417
+ /* @__PURE__ */ C("div", { className: "ds-tabs", role: "tablist", "aria-label": a.tabs, children: [
1380
1418
  /* @__PURE__ */ n(
1381
1419
  "button",
1382
1420
  {
@@ -1386,7 +1424,7 @@ function Ut(e) {
1386
1424
  "aria-selected": t === "variations",
1387
1425
  tabIndex: t === "variations" ? 0 : -1,
1388
1426
  onClick: () => s("variations"),
1389
- children: i.variationsTab
1427
+ children: a.variationsTab
1390
1428
  }
1391
1429
  ),
1392
1430
  /* @__PURE__ */ n(
@@ -1398,203 +1436,203 @@ function Ut(e) {
1398
1436
  "aria-selected": t === "info",
1399
1437
  tabIndex: t === "info" ? 0 : -1,
1400
1438
  onClick: () => s("info"),
1401
- children: i.infoTab
1439
+ children: a.infoTab
1402
1440
  }
1403
1441
  )
1404
1442
  ] }),
1405
- /* @__PURE__ */ b("div", { className: "ds-panel__body", role: "tabpanel", ref: u, children: [
1406
- t === "variations" ? /* @__PURE__ */ n(It, { ...e, collapsed: k, onToggle: N, filtering: w }) : /* @__PURE__ */ n(Bt, { ...e }),
1407
- f && /* @__PURE__ */ n("p", { className: "ds-empty", children: i.noMatch(h) })
1443
+ /* @__PURE__ */ C("div", { className: "ds-panel__body", role: "tabpanel", ref: d, children: [
1444
+ t === "variations" ? /* @__PURE__ */ n(Ht, { ...e, collapsed: k, onToggle: E, filtering: x }) : /* @__PURE__ */ n(qt, { ...e }),
1445
+ v && /* @__PURE__ */ n("p", { className: "ds-empty", children: a.noMatch(h) })
1408
1446
  ] })
1409
1447
  ] });
1410
1448
  }
1411
- function It({
1449
+ function Ht({
1412
1450
  registry: e,
1413
1451
  controls: t,
1414
1452
  screen: s,
1415
1453
  variation: o,
1416
1454
  component: r,
1417
- componentFixture: l,
1418
- onOpenScenario: c,
1419
- onOpenComponent: i,
1455
+ componentFixture: i,
1456
+ onOpenScenario: l,
1457
+ onOpenComponent: a,
1420
1458
  onChange: h,
1421
1459
  collapsed: m,
1422
- onToggle: d,
1423
- filtering: u
1460
+ onToggle: p,
1461
+ filtering: d
1424
1462
  }) {
1425
- const f = Q(), v = f.panel;
1463
+ const v = Q(), f = v.panel;
1426
1464
  if (r) {
1427
- const p = r.fixtures ?? [];
1428
- return p.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: v.noComponentVariations }) : /* @__PURE__ */ b(G, { children: [
1429
- l.didFallback && l.requestedId && l.fixture && /* @__PURE__ */ n("p", { className: "ds-notice", children: v.fixtureFallback(l.requestedId, l.fixture.id) }),
1430
- /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": v.variationsList, children: p.map((E) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ b(
1465
+ const u = r.fixtures ?? [];
1466
+ return u.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: f.noComponentVariations }) : /* @__PURE__ */ C(q, { children: [
1467
+ i.didFallback && i.requestedId && i.fixture && /* @__PURE__ */ n("p", { className: "ds-notice", children: f.fixtureFallback(i.requestedId, i.fixture.id) }),
1468
+ /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": f.variationsList, children: u.map(($) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ C(
1431
1469
  "button",
1432
1470
  {
1433
1471
  type: "button",
1434
1472
  className: "ds-item ds-item--stacked",
1435
- "aria-current": l.fixture?.id === E.id ? "true" : void 0,
1436
- onClick: () => h({ fixture: E.id }),
1473
+ "aria-current": i.fixture?.id === $.id ? "true" : void 0,
1474
+ onClick: () => h({ fixture: $.id }),
1437
1475
  children: [
1438
- /* @__PURE__ */ n("span", { className: "ds-item__title", children: E.label }),
1439
- E.description && /* @__PURE__ */ n("span", { className: "ds-item__hint", children: E.description })
1476
+ /* @__PURE__ */ n("span", { className: "ds-item__title", children: $.label }),
1477
+ $.description && /* @__PURE__ */ n("span", { className: "ds-item__hint", children: $.description })
1440
1478
  ]
1441
1479
  }
1442
- ) }, E.id)) })
1480
+ ) }, $.id)) })
1443
1481
  ] });
1444
1482
  }
1445
- if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children: v.nothingSelected });
1446
- const k = s.variations, C = e.product, N = C.theme?.modes ?? [], w = C.theme?.locales ?? [], x = C.dataSources?.adapters ?? [], $ = t.screenControls ?? {}, y = o && bt(o, $) ? o : void 0, L = (p, E) => h({ screenControls: { ...$, [p]: E } });
1447
- return /* @__PURE__ */ b(G, { children: [
1448
- /* @__PURE__ */ n(be, { id: "context", title: v.context, collapsed: m, onToggle: d, filtering: u, children: /* @__PURE__ */ b("div", { className: "ds-fields ds-fields--flush", children: [
1449
- /* @__PURE__ */ n(te, { label: v.persona, children: /* @__PURE__ */ b(
1483
+ if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children: f.nothingSelected });
1484
+ const k = s.variations, T = e.product, E = T.theme?.modes ?? [], x = T.theme?.locales ?? [], w = T.dataSources?.adapters ?? [], b = t.screenControls ?? {}, N = o && Ct(o, b) ? o : void 0, S = (u, $) => h({ screenControls: { ...b, [u]: $ } });
1485
+ return /* @__PURE__ */ C(q, { children: [
1486
+ /* @__PURE__ */ n(ke, { id: "context", title: f.context, collapsed: m, onToggle: p, filtering: d, children: /* @__PURE__ */ C("div", { className: "ds-fields ds-fields--flush", children: [
1487
+ /* @__PURE__ */ n(te, { label: f.persona, children: /* @__PURE__ */ C(
1450
1488
  "select",
1451
1489
  {
1452
1490
  className: "ds-select",
1453
1491
  value: t.persona ?? "",
1454
- onChange: (p) => h({ persona: p.target.value || void 0 }),
1492
+ onChange: (u) => h({ persona: u.target.value || void 0 }),
1455
1493
  children: [
1456
- /* @__PURE__ */ n("option", { value: "", children: v.none }),
1457
- C.personas.map((p) => /* @__PURE__ */ n("option", { value: p.id, children: p.name }, p.id))
1494
+ !e.defaultPersona && /* @__PURE__ */ n("option", { value: "", children: f.none }),
1495
+ T.personas.map((u) => /* @__PURE__ */ n("option", { value: u.id, children: u.name }, u.id))
1458
1496
  ]
1459
1497
  }
1460
1498
  ) }),
1461
- /* @__PURE__ */ n(te, { label: v.network, children: /* @__PURE__ */ n(
1499
+ /* @__PURE__ */ n(te, { label: f.network, children: /* @__PURE__ */ n(
1462
1500
  "select",
1463
1501
  {
1464
1502
  className: "ds-select",
1465
1503
  value: t.network,
1466
- onChange: (p) => h({ network: p.target.value }),
1467
- children: We.map((p) => /* @__PURE__ */ n("option", { value: p, children: f.network[p] }, p))
1504
+ onChange: (u) => h({ network: u.target.value }),
1505
+ children: He.map((u) => /* @__PURE__ */ n("option", { value: u, children: v.network[u] }, u))
1468
1506
  }
1469
1507
  ) }),
1470
- N.length > 1 && /* @__PURE__ */ n(te, { label: v.theme, children: /* @__PURE__ */ n(
1508
+ E.length > 1 && /* @__PURE__ */ n(te, { label: f.theme, children: /* @__PURE__ */ n(
1471
1509
  "select",
1472
1510
  {
1473
1511
  className: "ds-select",
1474
- value: t.themeMode ?? N[0],
1475
- onChange: (p) => h({ themeMode: p.target.value }),
1476
- children: N.map((p) => /* @__PURE__ */ n("option", { value: p, children: p }, p))
1512
+ value: t.themeMode ?? E[0],
1513
+ onChange: (u) => h({ themeMode: u.target.value }),
1514
+ children: E.map((u) => /* @__PURE__ */ n("option", { value: u, children: u }, u))
1477
1515
  }
1478
1516
  ) }),
1479
- w.length > 1 && /* @__PURE__ */ n(te, { label: v.locale, children: /* @__PURE__ */ n(
1517
+ x.length > 1 && /* @__PURE__ */ n(te, { label: f.locale, children: /* @__PURE__ */ n(
1480
1518
  "select",
1481
1519
  {
1482
1520
  className: "ds-select",
1483
- value: t.locale ?? w[0],
1484
- onChange: (p) => h({ locale: p.target.value }),
1485
- children: w.map((p) => /* @__PURE__ */ n("option", { value: p, children: p }, p))
1521
+ value: t.locale ?? x[0],
1522
+ onChange: (u) => h({ locale: u.target.value }),
1523
+ children: x.map((u) => /* @__PURE__ */ n("option", { value: u, children: u }, u))
1486
1524
  }
1487
1525
  ) }),
1488
- x.length > 0 && /* @__PURE__ */ n(te, { label: v.dataSource, children: /* @__PURE__ */ b(
1526
+ w.length > 0 && /* @__PURE__ */ n(te, { label: f.dataSource, children: /* @__PURE__ */ C(
1489
1527
  "select",
1490
1528
  {
1491
1529
  className: "ds-select",
1492
1530
  value: t.dataSource ?? "fixtures",
1493
- onChange: (p) => h({ dataSource: p.target.value }),
1531
+ onChange: (u) => h({ dataSource: u.target.value }),
1494
1532
  children: [
1495
- /* @__PURE__ */ n("option", { value: "fixtures", children: v.fixturesOption }),
1496
- x.map((p) => /* @__PURE__ */ n("option", { value: p.id, children: p.label }, p.id))
1533
+ /* @__PURE__ */ n("option", { value: "fixtures", children: f.fixturesOption }),
1534
+ w.map((u) => /* @__PURE__ */ n("option", { value: u.id, children: u.label }, u.id))
1497
1535
  ]
1498
1536
  }
1499
1537
  ) })
1500
1538
  ] }) }),
1501
- s.controls.map((p) => {
1502
- const E = e.component(p.component);
1503
- return /* @__PURE__ */ b(
1504
- be,
1539
+ s.controls.map((u) => {
1540
+ const $ = e.component(u.component);
1541
+ return /* @__PURE__ */ C(
1542
+ ke,
1505
1543
  {
1506
- id: `group:${p.id}`,
1507
- title: p.title,
1508
- count: p.controls.length,
1544
+ id: `group:${u.id}`,
1545
+ title: u.title,
1546
+ count: u.controls.length,
1509
1547
  collapsed: m,
1510
- onToggle: d,
1511
- filtering: u,
1548
+ onToggle: p,
1549
+ filtering: d,
1512
1550
  children: [
1513
- (p.note || E) && /* @__PURE__ */ b("div", { className: "ds-group-section__note", "data-ds-filter": !0, children: [
1514
- p.note && /* @__PURE__ */ n("span", { children: p.note }),
1515
- E && /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => i(E.id), children: v.openComponent(E.name) })
1551
+ (u.note || $) && /* @__PURE__ */ C("div", { className: "ds-group-section__note", "data-ds-filter": !0, children: [
1552
+ u.note && /* @__PURE__ */ n("span", { children: u.note }),
1553
+ $ && /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => a($.id), children: f.openComponent($.name) })
1516
1554
  ] }),
1517
- /* @__PURE__ */ n("div", { className: "ds-fields ds-fields--flush", children: p.controls.map((a) => /* @__PURE__ */ n(
1518
- Ht,
1555
+ /* @__PURE__ */ n("div", { className: "ds-fields ds-fields--flush", children: u.controls.map((F) => /* @__PURE__ */ n(
1556
+ jt,
1519
1557
  {
1520
- control: a,
1521
- value: $[a.id] ?? ge(a),
1522
- onChange: (g) => L(a.id, g)
1558
+ control: F,
1559
+ value: b[F.id] ?? ge(F),
1560
+ onChange: (c) => S(F.id, c)
1523
1561
  },
1524
- a.id
1562
+ F.id
1525
1563
  )) })
1526
1564
  ]
1527
1565
  },
1528
- p.id
1566
+ u.id
1529
1567
  );
1530
1568
  }),
1531
1569
  (k.length > 0 || s.controls.length === 0) && /* @__PURE__ */ n(
1532
- be,
1570
+ ke,
1533
1571
  {
1534
1572
  id: "shortcuts",
1535
- title: v.shortcuts,
1573
+ title: f.shortcuts,
1536
1574
  count: k.length || void 0,
1537
1575
  collapsed: m,
1538
- onToggle: d,
1539
- filtering: u,
1540
- children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": v.variationsList, children: k.length === 0 ? /* @__PURE__ */ n("li", { children: /* @__PURE__ */ b("div", { className: "ds-item ds-item--stacked", "aria-current": "true", children: [
1541
- /* @__PURE__ */ n("span", { className: "ds-item__title", children: v.defaultVariation }),
1542
- /* @__PURE__ */ n("span", { className: "ds-item__hint", children: v.defaultVariationHint })
1543
- ] }) }) : k.map((p) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
1576
+ onToggle: p,
1577
+ filtering: d,
1578
+ children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": f.variationsList, children: k.length === 0 ? /* @__PURE__ */ n("li", { children: /* @__PURE__ */ C("div", { className: "ds-item ds-item--stacked", "aria-current": "true", children: [
1579
+ /* @__PURE__ */ n("span", { className: "ds-item__title", children: f.defaultVariation }),
1580
+ /* @__PURE__ */ n("span", { className: "ds-item__hint", children: f.defaultVariationHint })
1581
+ ] }) }) : k.map((u) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
1544
1582
  "button",
1545
1583
  {
1546
1584
  type: "button",
1547
1585
  className: "ds-item",
1548
- title: p.intent,
1549
- "aria-current": y?.id === p.id ? "true" : void 0,
1550
- onClick: () => c(p.id),
1551
- children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: p.title })
1586
+ title: u.intent,
1587
+ "aria-current": N?.id === u.id ? "true" : void 0,
1588
+ onClick: () => l(u.id),
1589
+ children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: u.title })
1552
1590
  }
1553
- ) }, p.id)) })
1591
+ ) }, u.id)) })
1554
1592
  }
1555
1593
  )
1556
1594
  ] });
1557
1595
  }
1558
- function be({
1596
+ function ke({
1559
1597
  id: e,
1560
1598
  title: t,
1561
1599
  count: s,
1562
1600
  collapsed: o,
1563
1601
  onToggle: r,
1564
- filtering: l,
1565
- children: c
1602
+ filtering: i,
1603
+ children: l
1566
1604
  }) {
1567
- const i = Q().panel, h = o.has(e) && !l;
1568
- return /* @__PURE__ */ b("section", { className: "ds-group-section", "data-ds-filter-group": !0, children: [
1569
- /* @__PURE__ */ b(
1605
+ const a = Q().panel, h = o.has(e) && !i;
1606
+ return /* @__PURE__ */ C("section", { className: "ds-group-section", "data-ds-filter-group": !0, children: [
1607
+ /* @__PURE__ */ C(
1570
1608
  "button",
1571
1609
  {
1572
1610
  type: "button",
1573
1611
  className: "ds-group-section__head",
1574
1612
  "aria-expanded": !h,
1575
- "aria-label": i.toggleGroup(t),
1613
+ "aria-label": a.toggleGroup(t),
1576
1614
  onClick: () => r(e),
1577
1615
  children: [
1578
- /* @__PURE__ */ n(I, { name: "chevron", size: 12 }),
1616
+ /* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
1579
1617
  /* @__PURE__ */ n("span", { "data-ds-filter-title": !0, children: t }),
1580
1618
  s !== void 0 && /* @__PURE__ */ n("span", { className: "ds-count", children: s })
1581
1619
  ]
1582
1620
  }
1583
1621
  ),
1584
- !h && c
1622
+ !h && l
1585
1623
  ] });
1586
1624
  }
1587
- function Wt(e) {
1625
+ function Bt(e) {
1588
1626
  const t = e.options ?? [], s = t.reduce((o, r) => o + r.label.length, 0);
1589
1627
  return t.length > 0 && t.length <= 4 && s <= 24;
1590
1628
  }
1591
- function Ht({
1629
+ function jt({
1592
1630
  control: e,
1593
1631
  value: t,
1594
1632
  onChange: s
1595
1633
  }) {
1596
1634
  const o = e.options ?? [];
1597
- return Wt(e) ? /* @__PURE__ */ b("div", { className: "ds-field", "data-ds-filter": !0, children: [
1635
+ return Bt(e) ? /* @__PURE__ */ C("div", { className: "ds-field", "data-ds-filter": !0, children: [
1598
1636
  /* @__PURE__ */ n("span", { className: "ds-field__label", id: `ds-control-${e.id}`, children: e.label }),
1599
1637
  /* @__PURE__ */ n("div", { className: "ds-tabs ds-tabs--segmented", role: "radiogroup", "aria-labelledby": `ds-control-${e.id}`, children: o.map((r) => /* @__PURE__ */ n(
1600
1638
  "button",
@@ -1613,234 +1651,235 @@ function Ht({
1613
1651
  ] }) : /* @__PURE__ */ n(te, { label: e.label, hint: e.description, children: /* @__PURE__ */ n("select", { className: "ds-select", value: t, onChange: (r) => s(r.target.value), children: o.map((r) => /* @__PURE__ */ n("option", { value: r.value, children: r.label }, r.value)) }) });
1614
1652
  }
1615
1653
  function te({ label: e, hint: t, children: s }) {
1616
- return /* @__PURE__ */ b("label", { className: "ds-field", "data-ds-filter": !0, children: [
1654
+ return /* @__PURE__ */ C("label", { className: "ds-field", "data-ds-filter": !0, children: [
1617
1655
  /* @__PURE__ */ n("span", { className: "ds-field__label", children: e }),
1618
1656
  s,
1619
1657
  t && /* @__PURE__ */ n("span", { className: "ds-field__hint", children: t })
1620
1658
  ] });
1621
1659
  }
1622
- function Bt({
1660
+ function qt({
1623
1661
  registry: e,
1624
1662
  controls: t,
1625
1663
  deploy: s,
1626
1664
  location: o,
1627
1665
  screen: r,
1628
- variation: l,
1629
- component: c,
1630
- onOpenScenario: i,
1631
- onOpenComponent: h
1666
+ variation: i,
1667
+ component: l,
1668
+ onOpenScenario: a,
1669
+ onOpenComponent: h,
1670
+ onOpenScreen: m
1632
1671
  }) {
1633
- const m = Q(), d = m.info, [u, f] = D(!1);
1634
- if (c) {
1635
- const y = e.usagesOf(c.id, { handoff: t.handoff });
1636
- return /* @__PURE__ */ b("div", { className: "ds-info", children: [
1637
- /* @__PURE__ */ b(ee, { title: d.component, children: [
1638
- /* @__PURE__ */ n(U, { term: d.name, children: c.name }),
1639
- /* @__PURE__ */ n(U, { term: d.id, children: /* @__PURE__ */ n("code", { children: c.id }) }),
1640
- c.group && /* @__PURE__ */ n(U, { term: d.group, children: c.group }),
1641
- c.description && /* @__PURE__ */ n(U, { term: d.description, children: c.description }),
1642
- c.source && /* @__PURE__ */ n(U, { term: d.source, children: /* @__PURE__ */ n("code", { children: c.source }) })
1672
+ const p = Q(), d = p.info, [v, f] = K(!1);
1673
+ if (l) {
1674
+ const S = e.usagesOf(l.id, { handoff: t.handoff });
1675
+ return /* @__PURE__ */ C("div", { className: "ds-info", children: [
1676
+ /* @__PURE__ */ C(ee, { title: d.component, children: [
1677
+ /* @__PURE__ */ n(W, { term: d.name, children: l.name }),
1678
+ /* @__PURE__ */ n(W, { term: d.id, children: /* @__PURE__ */ n("code", { children: l.id }) }),
1679
+ l.group && /* @__PURE__ */ n(W, { term: d.group, children: l.group }),
1680
+ l.description && /* @__PURE__ */ n(W, { term: d.description, children: l.description }),
1681
+ l.source && /* @__PURE__ */ n(W, { term: d.source, children: /* @__PURE__ */ n("code", { children: l.source }) })
1643
1682
  ] }),
1644
- /* @__PURE__ */ n(ee, { title: d.usedIn, children: y.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: d.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: y.map((L) => {
1645
- const p = L.variations.find((E) => E.components?.includes(c.id)) ?? L.variations[0];
1646
- return /* @__PURE__ */ b("li", { "data-ds-filter": !0, children: [
1683
+ /* @__PURE__ */ n(ee, { title: d.usedIn, children: S.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: d.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: S.map((u) => {
1684
+ const $ = u.variations.find((F) => F.components?.includes(l.id)) ?? u.variations[0];
1685
+ return /* @__PURE__ */ C("li", { "data-ds-filter": !0, children: [
1647
1686
  /* @__PURE__ */ n(
1648
1687
  "button",
1649
1688
  {
1650
1689
  type: "button",
1651
1690
  className: "ds-link",
1652
- onClick: () => p && i(p.id),
1653
- children: L.name
1691
+ onClick: () => $ ? a($.id) : m?.(u.id),
1692
+ children: u.name
1654
1693
  }
1655
1694
  ),
1656
- /* @__PURE__ */ n("code", { className: "ds-muted", children: L.id })
1657
- ] }, L.id);
1695
+ /* @__PURE__ */ n("code", { className: "ds-muted", children: u.id })
1696
+ ] }, u.id);
1658
1697
  }) }) })
1659
1698
  ] });
1660
1699
  }
1661
- if (!r) return /* @__PURE__ */ n("p", { className: "ds-empty", children: m.panel.nothingSelected });
1662
- const v = l ? e.componentsOfScreen(r, l) : e.componentsOfScreen(r), k = e.persona(t.persona ?? l?.persona), C = e.rulesOf(l), N = t.screenControls ?? {}, w = l?.expected?.length ? l.expected : r.route.expected, x = t.handoff ? { handoff: t.handoff } : void 0, $ = async () => {
1663
- const y = r.group ? e.flowOf(r, { handoff: t.handoff }) : void 0, L = y?.name ? Vt({
1664
- flow: { name: y.name, screens: y.screens },
1700
+ if (!r) return /* @__PURE__ */ n("p", { className: "ds-empty", children: p.panel.nothingSelected });
1701
+ const k = i ? e.componentsOfScreen(r, i) : e.componentsOfScreen(r), T = e.persona(t.persona ?? i?.persona), E = e.rulesOf(i), x = t.screenControls ?? {}, w = i?.expected?.length ? i.expected : r.route.expected, b = t.handoff ? { handoff: t.handoff } : void 0, N = async () => {
1702
+ const S = r.group ? e.flowOf(r, { handoff: t.handoff }) : void 0, u = S?.name ? It({
1703
+ flow: { name: S.name, screens: S.screens },
1665
1704
  registry: e,
1666
- open: { screen: r, location: o, variation: l },
1705
+ open: { screen: r, location: o, variation: i },
1667
1706
  deploy: s,
1668
- labels: m,
1669
- overrides: x
1670
- }) : Kt({
1707
+ labels: p,
1708
+ overrides: b
1709
+ }) : Ut({
1671
1710
  screen: r,
1672
1711
  variations: r.variations,
1673
1712
  components: e.componentsOfScreen(r),
1674
1713
  deploy: s,
1675
- labels: m,
1676
- overrides: x
1714
+ labels: p,
1715
+ overrides: b
1677
1716
  });
1678
1717
  try {
1679
- await navigator.clipboard.writeText(L);
1718
+ await navigator.clipboard.writeText(u);
1680
1719
  } catch {
1681
- window.prompt(d.copyPrompt, L);
1720
+ window.prompt(d.copyPrompt, u);
1682
1721
  }
1683
1722
  f(!0), window.setTimeout(() => f(!1), 1600);
1684
1723
  };
1685
- return /* @__PURE__ */ b("div", { className: "ds-info", children: [
1686
- /* @__PURE__ */ b(ee, { title: d.screen, children: [
1687
- /* @__PURE__ */ n(U, { term: d.name, children: r.name }),
1688
- /* @__PURE__ */ n(U, { term: d.route, children: /* @__PURE__ */ n("code", { children: r.route.path }) }),
1689
- r.group && /* @__PURE__ */ n(U, { term: d.flow, children: r.group }),
1690
- r.description && /* @__PURE__ */ n(U, { term: d.description, children: r.description }),
1724
+ return /* @__PURE__ */ C("div", { className: "ds-info", children: [
1725
+ /* @__PURE__ */ C(ee, { title: d.screen, children: [
1726
+ /* @__PURE__ */ n(W, { term: d.name, children: r.name }),
1727
+ /* @__PURE__ */ n(W, { term: d.route, children: /* @__PURE__ */ n("code", { children: r.route.path }) }),
1728
+ r.group && /* @__PURE__ */ n(W, { term: d.flow, children: r.group }),
1729
+ r.description && /* @__PURE__ */ n(W, { term: d.description, children: r.description }),
1691
1730
  /* @__PURE__ */ n(le, { term: d.expected, items: w })
1692
1731
  ] }),
1693
1732
  r.controls.length > 0 && /* @__PURE__ */ n(ee, { title: d.controls, children: r.controls.flatMap(
1694
- (y) => y.controls.map((L) => {
1695
- const p = N[L.id] ?? ge(L), E = L.options.find((a) => a.value === p);
1696
- return /* @__PURE__ */ b(U, { term: L.label, children: [
1697
- E?.label ?? p,
1733
+ (S) => S.controls.map((u) => {
1734
+ const $ = x[u.id] ?? ge(u), F = u.options.find((c) => c.value === $);
1735
+ return /* @__PURE__ */ C(W, { term: u.label, children: [
1736
+ F?.label ?? $,
1698
1737
  " ",
1699
- /* @__PURE__ */ n("code", { children: `c.${L.id}=${p}` })
1700
- ] }, `${y.id}/${L.id}`);
1738
+ /* @__PURE__ */ n("code", { children: `c.${u.id}=${$}` })
1739
+ ] }, `${S.id}/${u.id}`);
1701
1740
  })
1702
1741
  ) }),
1703
- l && /* @__PURE__ */ b(ee, { title: d.variation, children: [
1704
- /* @__PURE__ */ n(U, { term: d.name, children: l.title }),
1705
- /* @__PURE__ */ n(U, { term: d.id, children: /* @__PURE__ */ n("code", { children: l.id }) }),
1706
- k && /* @__PURE__ */ n(U, { term: d.persona, children: k.name }),
1707
- l.intent && /* @__PURE__ */ n(U, { term: d.intent, children: l.intent }),
1708
- /* @__PURE__ */ n(le, { term: d.preconditions, items: l.preconditions }),
1709
- /* @__PURE__ */ n(le, { term: d.actions, items: l.actions }),
1710
- /* @__PURE__ */ n(le, { term: d.rules, items: C.map((y) => y.statement) }),
1711
- l.ticket && /* @__PURE__ */ n(U, { term: d.ticket, children: /* @__PURE__ */ n("code", { children: l.ticket }) })
1742
+ i && /* @__PURE__ */ C(ee, { title: d.variation, children: [
1743
+ /* @__PURE__ */ n(W, { term: d.name, children: i.title }),
1744
+ /* @__PURE__ */ n(W, { term: d.id, children: /* @__PURE__ */ n("code", { children: i.id }) }),
1745
+ T && /* @__PURE__ */ n(W, { term: d.persona, children: T.name }),
1746
+ i.intent && /* @__PURE__ */ n(W, { term: d.intent, children: i.intent }),
1747
+ /* @__PURE__ */ n(le, { term: d.preconditions, items: i.preconditions }),
1748
+ /* @__PURE__ */ n(le, { term: d.actions, items: i.actions }),
1749
+ /* @__PURE__ */ n(le, { term: d.rules, items: E.map((S) => S.statement) }),
1750
+ i.ticket && /* @__PURE__ */ n(W, { term: d.ticket, children: /* @__PURE__ */ n("code", { children: i.ticket }) })
1712
1751
  ] }),
1713
- v.length > 0 && /* @__PURE__ */ n(ee, { title: d.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: v.map((y) => /* @__PURE__ */ b("li", { "data-ds-filter": !0, children: [
1714
- /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => h(y.id), children: y.name }),
1715
- y.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: y.source })
1716
- ] }, y.id)) }) }),
1717
- /* @__PURE__ */ b("button", { type: "button", className: "ds-btn ds-btn--block", onClick: $, children: [
1718
- /* @__PURE__ */ n(I, { name: u ? "check" : "copy", size: 14 }),
1719
- /* @__PURE__ */ n("span", { children: u ? d.copiedForPr : d.copyForPr })
1752
+ k.length > 0 && /* @__PURE__ */ n(ee, { title: d.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: k.map((S) => /* @__PURE__ */ C("li", { "data-ds-filter": !0, children: [
1753
+ /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => h(S.id), children: S.name }),
1754
+ S.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: S.source })
1755
+ ] }, S.id)) }) }),
1756
+ /* @__PURE__ */ C("button", { type: "button", className: "ds-btn ds-btn--block", onClick: N, children: [
1757
+ /* @__PURE__ */ n(H, { name: v ? "check" : "copy", size: 14 }),
1758
+ /* @__PURE__ */ n("span", { children: v ? d.copiedForPr : d.copyForPr })
1720
1759
  ] })
1721
1760
  ] });
1722
1761
  }
1723
1762
  function ee({ title: e, children: t }) {
1724
- return /* @__PURE__ */ b("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
1763
+ return /* @__PURE__ */ C("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
1725
1764
  /* @__PURE__ */ n("h2", { className: "ds-section__title", children: e }),
1726
1765
  /* @__PURE__ */ n("div", { className: "ds-defs", children: t })
1727
1766
  ] });
1728
1767
  }
1729
- function U({ term: e, children: t }) {
1730
- return /* @__PURE__ */ b("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1768
+ function W({ term: e, children: t }) {
1769
+ return /* @__PURE__ */ C("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1731
1770
  /* @__PURE__ */ n("dt", { children: e }),
1732
1771
  /* @__PURE__ */ n("dd", { children: t })
1733
1772
  ] });
1734
1773
  }
1735
1774
  function le({ term: e, items: t }) {
1736
- return t?.length ? /* @__PURE__ */ b("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1775
+ return t?.length ? /* @__PURE__ */ C("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1737
1776
  /* @__PURE__ */ n("dt", { children: e }),
1738
1777
  /* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("ul", { className: "ds-list", children: t.map((s) => /* @__PURE__ */ n("li", { children: s }, s)) }) })
1739
1778
  ] }) : null;
1740
1779
  }
1741
- function jt(e) {
1780
+ function Gt(e) {
1742
1781
  return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f";
1743
1782
  }
1744
- function Gt(e, t) {
1783
+ function Zt(e, t) {
1745
1784
  if (!e) return !1;
1746
1785
  const s = X(t), o = [...e.querySelectorAll("[data-ds-filter]")];
1747
1786
  for (const r of o)
1748
1787
  r.hidden = s.length > 0 && !X(r.textContent ?? "").includes(s);
1749
1788
  for (const r of e.querySelectorAll("[data-ds-filter-group]")) {
1750
- const l = [...r.querySelectorAll("[data-ds-filter]")], c = X(
1789
+ const i = [...r.querySelectorAll("[data-ds-filter]")], l = X(
1751
1790
  r.querySelector("[data-ds-filter-title], .ds-section__title")?.textContent ?? ""
1752
1791
  );
1753
- if (s.length > 0 && c.includes(s)) {
1792
+ if (s.length > 0 && l.includes(s)) {
1754
1793
  r.hidden = !1;
1755
- for (const i of l) i.hidden = !1;
1794
+ for (const a of i) a.hidden = !1;
1756
1795
  continue;
1757
1796
  }
1758
- r.hidden = s.length > 0 && l.every((i) => i.hidden);
1797
+ r.hidden = s.length > 0 && i.every((a) => a.hidden);
1759
1798
  }
1760
1799
  return s.length > 0 && o.length > 0 && o.every((r) => r.hidden);
1761
1800
  }
1762
- const qt = 24;
1763
- function Zt({
1801
+ const Yt = 24;
1802
+ function Xt({
1764
1803
  location: e,
1765
1804
  viewport: t,
1766
1805
  zoom: s,
1767
1806
  title: o,
1768
1807
  resizing: r,
1769
- onFrameNavigate: l,
1770
- onShortcut: c,
1771
- onEffectiveZoom: i
1808
+ onFrameNavigate: i,
1809
+ onShortcut: l,
1810
+ onEffectiveZoom: a
1772
1811
  }) {
1773
- const h = q(null), m = q(null), d = Yt(h), u = de(e.path, e.search), [f] = D(u), v = q(u), k = q(u), C = typeof window > "u" ? "" : window.location.origin, N = B(
1774
- (S) => {
1775
- k.current = S;
1776
- const R = m.current?.contentWindow;
1812
+ const h = G(null), m = G(null), p = Qt(h), d = de(e.path, e.search), [v] = K(d), f = G(d), k = G(d), T = typeof window > "u" ? "" : window.location.origin, E = U(
1813
+ (g) => {
1814
+ k.current = g;
1815
+ const y = m.current?.contentWindow;
1777
1816
  try {
1778
- R?.location.replace(new URL(S, C).toString());
1817
+ y?.location.replace(new URL(g, T).toString());
1779
1818
  } catch {
1780
- m.current && (m.current.src = S);
1819
+ m.current && (m.current.src = g);
1781
1820
  }
1782
1821
  },
1783
- [C]
1822
+ [T]
1784
1823
  );
1785
- V(() => {
1786
- if (u === v.current) return;
1787
- const S = v.current;
1788
- v.current = u, _e(S) !== _e(u) ? N(u) : ae(m.current?.contentWindow, { ds: 1, type: "location", url: u }, C);
1789
- }, [u, N, C]), V(() => {
1790
- const S = (R) => {
1791
- const M = He(R, {
1792
- origin: C,
1824
+ I(() => {
1825
+ if (d === f.current) return;
1826
+ const g = f.current;
1827
+ f.current = d, _e(g) !== _e(d) ? E(d) : ae(m.current?.contentWindow, { ds: 1, type: "location", url: d }, T);
1828
+ }, [d, E, T]), I(() => {
1829
+ const g = (y) => {
1830
+ const L = Be(y, {
1831
+ origin: T,
1793
1832
  source: m.current?.contentWindow
1794
1833
  });
1795
- if (M)
1796
- switch (M.type) {
1834
+ if (L)
1835
+ switch (L.type) {
1797
1836
  case "ready": {
1798
- if (M.url === v.current) return;
1799
- if (M.url === k.current) {
1837
+ if (L.url === f.current) return;
1838
+ if (L.url === k.current) {
1800
1839
  ae(
1801
1840
  m.current?.contentWindow,
1802
- { ds: 1, type: "location", url: v.current },
1803
- C
1841
+ { ds: 1, type: "location", url: f.current },
1842
+ T
1804
1843
  );
1805
1844
  return;
1806
1845
  }
1807
- v.current = M.url, k.current = M.url, l(M.url, !0);
1846
+ f.current = L.url, k.current = L.url, i(L.url, !0);
1808
1847
  return;
1809
1848
  }
1810
1849
  case "navigate":
1811
- v.current = M.url, l(M.url, M.replace);
1850
+ f.current = L.url, i(L.url, L.replace);
1812
1851
  return;
1813
1852
  case "shortcut":
1814
- c(M.key);
1853
+ l(L.key);
1815
1854
  return;
1816
1855
  default:
1817
1856
  return;
1818
1857
  }
1819
1858
  };
1820
- return window.addEventListener("message", S), () => window.removeEventListener("message", S);
1821
- }, [l, c, C]);
1822
- const w = !!t.width, x = w ? qt : 0, $ = Math.max(0, d.width - x * 2), y = Math.max(0, d.height - x * 2), L = !t.width || $ === 0 || t.width <= $, p = s === 100 && !L ? Math.max(10, Math.floor($ / t.width * 100)) : s, E = p / 100;
1823
- V(() => {
1824
- i?.(p);
1825
- }, [p, i]);
1826
- const a = t.width ?? $ / E, g = t.height ?? y / E;
1827
- return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: h, "data-fit": w ? void 0 : "true", children: /* @__PURE__ */ n(
1859
+ return window.addEventListener("message", g), () => window.removeEventListener("message", g);
1860
+ }, [i, l, T]);
1861
+ const x = !!t.width, w = x ? Yt : 0, b = Math.max(0, p.width - w * 2), N = Math.max(0, p.height - w * 2), S = !t.width || b === 0 || t.width <= b, u = s === 100 && !S ? Math.max(10, Math.floor(b / t.width * 100)) : s, $ = u / 100;
1862
+ I(() => {
1863
+ a?.(u);
1864
+ }, [u, a]);
1865
+ const F = t.width ?? b / $, c = t.height ?? N / $;
1866
+ return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: h, "data-fit": x ? void 0 : "true", children: /* @__PURE__ */ n(
1828
1867
  "div",
1829
1868
  {
1830
1869
  className: "ds-canvas__box",
1831
- style: { width: Math.floor(a * E), height: Math.floor(g * E) },
1870
+ style: { width: Math.floor(F * $), height: Math.floor(c * $) },
1832
1871
  children: /* @__PURE__ */ n(
1833
1872
  "iframe",
1834
1873
  {
1835
1874
  ref: m,
1836
- [pt]: "",
1875
+ [ft]: "",
1837
1876
  className: "ds-frame",
1838
- src: f,
1877
+ src: v,
1839
1878
  title: o,
1840
1879
  style: {
1841
- width: Math.floor(a),
1842
- height: Math.floor(g),
1843
- transform: E === 1 ? void 0 : `scale(${E})`,
1880
+ width: Math.floor(F),
1881
+ height: Math.floor(c),
1882
+ transform: $ === 1 ? void 0 : `scale(${$})`,
1844
1883
  pointerEvents: r ? "none" : void 0
1845
1884
  }
1846
1885
  }
@@ -1848,34 +1887,34 @@ function Zt({
1848
1887
  }
1849
1888
  ) });
1850
1889
  }
1851
- function Yt(e) {
1852
- const [t, s] = D({ width: 0, height: 0 });
1853
- return Ke(() => {
1890
+ function Qt(e) {
1891
+ const [t, s] = K({ width: 0, height: 0 });
1892
+ return Ue(() => {
1854
1893
  const o = e.current;
1855
1894
  if (!o) return;
1856
1895
  const r = () => {
1857
- const c = o.clientWidth, i = o.clientHeight;
1896
+ const l = o.clientWidth, a = o.clientHeight;
1858
1897
  s(
1859
- (h) => h.width === c && h.height === i ? h : { width: c, height: i }
1898
+ (h) => h.width === l && h.height === a ? h : { width: l, height: a }
1860
1899
  );
1861
1900
  };
1862
1901
  if (r(), typeof ResizeObserver > "u")
1863
1902
  return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
1864
- const l = new ResizeObserver(r);
1865
- return l.observe(o), () => l.disconnect();
1903
+ const i = new ResizeObserver(r);
1904
+ return i.observe(o), () => i.disconnect();
1866
1905
  }, [e]), t;
1867
1906
  }
1868
- const Qe = 2500;
1869
- class Je extends Error {
1907
+ const Je = 2500;
1908
+ class et extends Error {
1870
1909
  constructor(t) {
1871
1910
  super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
1872
1911
  }
1873
1912
  }
1874
- function ye(e) {
1913
+ function Me(e) {
1875
1914
  if (e)
1876
1915
  return typeof e.data == "function" ? e.data() : e.data;
1877
1916
  }
1878
- const $e = {
1917
+ const Le = {
1879
1918
  id: "fixtures",
1880
1919
  label: "Fixtures",
1881
1920
  load: async ({ scenario: e, fixture: t, network: s }) => {
@@ -1883,221 +1922,221 @@ const $e = {
1883
1922
  case "empty":
1884
1923
  return null;
1885
1924
  case "error":
1886
- throw new Je(e.id);
1925
+ throw new et(e.id);
1887
1926
  case "loading":
1888
1927
  return new Promise(() => {
1889
1928
  });
1890
1929
  case "slow":
1891
- return await Xt(Qe), ye(t);
1930
+ return await Jt(Je), Me(t);
1892
1931
  default:
1893
- return ye(t);
1932
+ return Me(t);
1894
1933
  }
1895
1934
  }
1896
1935
  };
1897
- function dn(e) {
1898
- const { id: t, label: s, baseUrl: o, path: r, init: l, fallbackToFixture: c = !0 } = e;
1936
+ function hn(e) {
1937
+ const { id: t, label: s, baseUrl: o, path: r, init: i, fallbackToFixture: l = !0 } = e;
1899
1938
  return {
1900
1939
  id: t,
1901
1940
  label: s,
1902
- load: async (i) => {
1903
- const h = new URL(r ? r(i) : i.scenario.route, o);
1941
+ load: async (a) => {
1942
+ const h = new URL(r ? r(a) : a.scenario.route, o);
1904
1943
  try {
1905
- const m = await fetch(h, l);
1944
+ const m = await fetch(h, i);
1906
1945
  if (!m.ok) throw new Error(`${m.status} ${m.statusText}`);
1907
1946
  return await m.json();
1908
1947
  } catch (m) {
1909
- if (c) return ye(i.fixture);
1948
+ if (l) return Me(a.fixture);
1910
1949
  throw new Error(`Adapter "${t}" falhou em ${h.toString()}`, { cause: m });
1911
1950
  }
1912
1951
  }
1913
1952
  };
1914
1953
  }
1915
- function Xt(e) {
1954
+ function Jt(e) {
1916
1955
  return new Promise((t) => setTimeout(t, e));
1917
1956
  }
1918
- function Qt(e) {
1919
- const { scenario: t, fixture: s, network: o, adapter: r } = e, [l, c] = D({
1957
+ function en(e) {
1958
+ const { scenario: t, fixture: s, network: o, adapter: r } = e, [i, l] = K({
1920
1959
  data: void 0,
1921
1960
  isLoading: !!t || o === "loading" || o === "slow",
1922
1961
  error: void 0
1923
1962
  });
1924
- return V(() => {
1963
+ return I(() => {
1925
1964
  if (!t)
1926
1965
  switch (o) {
1927
1966
  case "loading":
1928
- c({ data: void 0, isLoading: !0, error: void 0 });
1967
+ l({ data: void 0, isLoading: !0, error: void 0 });
1929
1968
  return;
1930
1969
  case "empty":
1931
- c({ data: null, isLoading: !1, error: void 0 });
1970
+ l({ data: null, isLoading: !1, error: void 0 });
1932
1971
  return;
1933
1972
  case "error":
1934
- c({
1973
+ l({
1935
1974
  data: void 0,
1936
1975
  isLoading: !1,
1937
- error: new Je(e.screen ?? "—")
1976
+ error: new et(e.screen ?? "—")
1938
1977
  });
1939
1978
  return;
1940
1979
  case "slow": {
1941
- c({ data: void 0, isLoading: !0, error: void 0 });
1980
+ l({ data: void 0, isLoading: !0, error: void 0 });
1942
1981
  const m = setTimeout(
1943
- () => c({ data: void 0, isLoading: !1, error: void 0 }),
1944
- Qe
1982
+ () => l({ data: void 0, isLoading: !1, error: void 0 }),
1983
+ Je
1945
1984
  );
1946
1985
  return () => clearTimeout(m);
1947
1986
  }
1948
1987
  default:
1949
- c({ data: void 0, isLoading: !1, error: void 0 });
1988
+ l({ data: void 0, isLoading: !1, error: void 0 });
1950
1989
  return;
1951
1990
  }
1952
- let i = !0;
1953
- c({ data: void 0, isLoading: !0, error: void 0 });
1954
- const h = r ?? $e;
1991
+ let a = !0;
1992
+ l({ data: void 0, isLoading: !0, error: void 0 });
1993
+ const h = r ?? Le;
1955
1994
  return Promise.resolve(h.load({ scenario: t, fixture: s, network: o })).then((m) => {
1956
- i && c({ data: m, isLoading: !1, error: void 0 });
1995
+ a && l({ data: m, isLoading: !1, error: void 0 });
1957
1996
  }).catch((m) => {
1958
- i && c({
1997
+ a && l({
1959
1998
  data: void 0,
1960
1999
  isLoading: !1,
1961
2000
  error: m instanceof Error ? m : new Error(String(m))
1962
2001
  });
1963
2002
  }), () => {
1964
- i = !1;
2003
+ a = !1;
1965
2004
  };
1966
- }, [t, s, o, r, e.screen]), l;
2005
+ }, [t, s, o, r, e.screen]), i;
1967
2006
  }
1968
- function ze({ title: e, children: t }) {
1969
- return /* @__PURE__ */ b("div", { className: "ds-stage-empty", children: [
2007
+ function De({ title: e, children: t }) {
2008
+ return /* @__PURE__ */ C("div", { className: "ds-stage-empty", children: [
1970
2009
  /* @__PURE__ */ n("h2", { className: "ds-stage-empty__title", children: e }),
1971
2010
  t
1972
2011
  ] });
1973
2012
  }
1974
- function Jt({ product: e, registry: t }) {
1975
- const s = Q(), { location: o, controls: r, viewport: l, navigate: c, openScenario: i, setControls: h } = Ge(
2013
+ function tn({ product: e, registry: t }) {
2014
+ const s = Q(), { location: o, controls: r, viewport: i, navigate: l, openScenario: a, setScreenControls: h } = Ge(
1976
2015
  t,
1977
2016
  { frame: !0 }
1978
- ), m = q(null);
1979
- V(() => {
1980
- const T = (O) => {
1981
- if (O.defaultPrevented || O.button !== 0 || O.metaKey || O.ctrlKey || O.shiftKey || O.altKey) return;
1982
- const z = O.target?.closest?.("a[href]");
1983
- if (!(z instanceof HTMLAnchorElement) || z.target && z.target !== "_self" || z.hasAttribute("download")) return;
1984
- const j = z.getAttribute("href") ?? "";
2017
+ ), m = G(null);
2018
+ I(() => {
2019
+ const P = (z) => {
2020
+ if (z.defaultPrevented || z.button !== 0 || z.metaKey || z.ctrlKey || z.shiftKey || z.altKey) return;
2021
+ const A = z.target?.closest?.("a[href]");
2022
+ if (!(A instanceof HTMLAnchorElement) || A.target && A.target !== "_self" || A.hasAttribute("download")) return;
2023
+ const j = A.getAttribute("href") ?? "";
1985
2024
  if (j.startsWith("#")) return;
1986
- let H;
2025
+ let B;
1987
2026
  try {
1988
- H = new URL(j, window.location.href);
2027
+ B = new URL(j, window.location.href);
1989
2028
  } catch {
1990
2029
  return;
1991
2030
  }
1992
- H.origin === window.location.origin && (O.preventDefault(), c(`${H.pathname}${H.search}`));
2031
+ B.origin === window.location.origin && (z.preventDefault(), l(`${B.pathname}${B.search}`));
1993
2032
  };
1994
- return document.addEventListener("click", T), () => document.removeEventListener("click", T);
1995
- }, [c]), V(() => {
1996
- const T = (O) => {
2033
+ return document.addEventListener("click", P), () => document.removeEventListener("click", P);
2034
+ }, [l]), I(() => {
2035
+ const P = (z) => {
1997
2036
  if (window.parent === window) return;
1998
- const z = en(O);
1999
- if (!z) return;
2000
- const j = O.target;
2001
- z === "C" && j?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (O.preventDefault(), ae(window.parent, { ds: 1, type: "shortcut", key: z }, window.location.origin));
2037
+ const A = nn(z);
2038
+ if (!A) return;
2039
+ const j = z.target;
2040
+ A === "C" && j?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (z.preventDefault(), ae(window.parent, { ds: 1, type: "shortcut", key: A }, window.location.origin));
2002
2041
  };
2003
- return window.addEventListener("keydown", T), () => window.removeEventListener("keydown", T);
2004
- }, []), V(() => {
2005
- const T = m.current;
2006
- if (!T || !r.handoff) return;
2007
- const O = () => {
2008
- for (const j of T.querySelectorAll("a[href]")) {
2009
- const H = j.getAttribute("href");
2010
- if (!H || H.startsWith("#")) continue;
2042
+ return window.addEventListener("keydown", P), () => window.removeEventListener("keydown", P);
2043
+ }, []), I(() => {
2044
+ const P = m.current;
2045
+ if (!P || !r.handoff) return;
2046
+ const z = () => {
2047
+ for (const j of P.querySelectorAll("a[href]")) {
2048
+ const B = j.getAttribute("href");
2049
+ if (!B || B.startsWith("#")) continue;
2011
2050
  let J;
2012
2051
  try {
2013
- J = new URL(H, window.location.href);
2052
+ J = new URL(B, window.location.href);
2014
2053
  } catch {
2015
2054
  continue;
2016
2055
  }
2017
2056
  if (J.origin !== window.location.origin) continue;
2018
- Me(J.searchParams, r.handoff);
2057
+ Te(J.searchParams, r.handoff);
2019
2058
  const ie = `${J.pathname}${J.search}${J.hash}`;
2020
- H !== ie && j.setAttribute("href", ie);
2059
+ B !== ie && j.setAttribute("href", ie);
2021
2060
  }
2022
2061
  };
2023
- O();
2024
- const z = new MutationObserver(O);
2025
- return z.observe(T, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => z.disconnect();
2062
+ z();
2063
+ const A = new MutationObserver(z);
2064
+ return A.observe(P, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => A.disconnect();
2026
2065
  }, [r.handoff]);
2027
- const d = t.scenario(r.scenario), u = t.component(r.component), f = A(() => {
2028
- const T = new URLSearchParams(o.search);
2066
+ const p = t.scenario(r.scenario), d = t.component(r.component), v = D(() => {
2067
+ const P = new URLSearchParams(o.search);
2029
2068
  return {
2030
- scenario: T.get(_.scenario) ?? void 0,
2031
- component: T.get(_.component) ?? void 0
2069
+ scenario: P.get(M.scenario) ?? void 0,
2070
+ component: P.get(M.component) ?? void 0
2032
2071
  };
2033
- }, [o.search]), v = !!(r.handoff && (f.scenario && !oe(r.handoff, f.scenario) || f.component && !we(r.handoff, f.component) || !f.component && !Ve(r.handoff, o.path, e.scenarios))), k = A(
2034
- () => t.resolveComponentFixture(u?.id, u ? r.fixture : void 0),
2035
- [u, r.fixture, t]
2036
- ), C = A(() => {
2037
- const T = k.fixture?.data;
2038
- return typeof T == "function" ? T() : T;
2039
- }, [k.fixture]), N = t.persona(r.persona ?? d?.persona), w = t.fixture(r.fixture ?? d?.fixture), x = A(() => {
2040
- const T = r.dataSource ?? "fixtures";
2041
- return T === "fixtures" ? $e : e.dataSources?.adapters?.find((O) => O.id === T) ?? $e;
2042
- }, [r.dataSource, e.dataSources?.adapters]), { data: $, isLoading: y, error: L } = Qt({
2043
- scenario: d,
2044
- fixture: w,
2072
+ }, [o.search]), f = !!(r.handoff && (v.scenario && !oe(r.handoff, v.scenario) || v.component && !ve(r.handoff, v.component) || !v.component && !Ie(r.handoff, o.path, e.scenarios))), k = D(
2073
+ () => t.resolveComponentFixture(d?.id, d ? r.fixture : void 0),
2074
+ [d, r.fixture, t]
2075
+ ), T = D(() => {
2076
+ const P = k.fixture?.data;
2077
+ return typeof P == "function" ? P() : P;
2078
+ }, [k.fixture]), E = t.persona(r.persona ?? p?.persona), x = t.fixture(r.fixture ?? p?.fixture), w = D(() => {
2079
+ const P = r.dataSource ?? "fixtures";
2080
+ return P === "fixtures" ? Le : e.dataSources?.adapters?.find((z) => z.id === P) ?? Le;
2081
+ }, [r.dataSource, e.dataSources?.adapters]), { data: b, isLoading: N, error: S } = en({
2082
+ scenario: p,
2083
+ fixture: x,
2045
2084
  network: r.network,
2046
- adapter: x,
2085
+ adapter: w,
2047
2086
  screen: o.path
2048
- }), p = A(() => r.persona && r.persona !== d?.persona ? t.persona(r.persona)?.permissions ?? [] : t.permissionsOf(d), [r.persona, t, d]), E = r.screenControls, a = A(() => E ?? {}, [E]), g = B(
2049
- (T, O) => {
2050
- a[T] !== O && h({ screenControls: { ...a, [T]: O } });
2051
- },
2052
- [h, a]
2053
- ), S = A(
2087
+ }), u = D(() => p ? r.persona && r.persona !== (p.persona ?? t.defaultPersona) ? t.persona(r.persona)?.permissions ?? [] : t.permissionsOf(p) : t.persona(r.persona)?.permissions ?? [], [r.persona, t, p]), $ = r.screenControls, F = D(() => $ ?? {}, [$]), c = U(
2088
+ (P, z) => h({ [P]: z }),
2089
+ [h]
2090
+ ), g = D(
2054
2091
  () => ({
2055
- scenario: d,
2056
- persona: N,
2057
- permissions: p,
2058
- can: (T) => p.includes(T),
2059
- data: $,
2060
- fixture: w,
2092
+ scenario: p,
2093
+ persona: E,
2094
+ permissions: u,
2095
+ can: (P) => u.includes(P),
2096
+ data: b,
2097
+ fixture: x,
2061
2098
  network: r.network,
2062
- isLoading: y,
2063
- error: L,
2064
- rules: t.rulesOf(d),
2065
- viewport: l,
2099
+ isLoading: N,
2100
+ error: S,
2101
+ rules: t.rulesOf(p),
2102
+ viewport: i,
2066
2103
  themeMode: r.themeMode,
2067
2104
  locale: r.locale,
2068
- navigate: (T) => c(T),
2069
- openScenario: i,
2070
- controls: a,
2071
- setControl: g
2105
+ navigate: l,
2106
+ openScenario: a,
2107
+ controls: F,
2108
+ setControl: c,
2109
+ setControls: h
2072
2110
  }),
2073
2111
  [
2074
- d,
2075
- N,
2076
2112
  p,
2077
- $,
2078
- w,
2113
+ E,
2114
+ u,
2115
+ b,
2116
+ x,
2079
2117
  r.network,
2080
2118
  r.themeMode,
2081
2119
  r.locale,
2082
- y,
2083
- L,
2120
+ N,
2121
+ S,
2084
2122
  t,
2085
- l,
2086
- c,
2087
2123
  i,
2124
+ l,
2088
2125
  a,
2089
- g
2126
+ F,
2127
+ c,
2128
+ h
2090
2129
  ]
2091
- ), R = Se(e.routes ?? [], o.path), M = e.wrapper, W = e.notFound, F = u?.preview, K = v ? /* @__PURE__ */ n(ze, { title: s.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: s.shell.outsideHandoffHint }) }) : F ? /* @__PURE__ */ n(
2092
- F,
2130
+ ), y = Ne(e.routes ?? [], o.path), L = e.wrapper, O = e.notFound, R = d?.preview, V = f ? /* @__PURE__ */ n(De, { title: s.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: s.shell.outsideHandoffHint }) }) : R ? /* @__PURE__ */ n(
2131
+ R,
2093
2132
  {
2094
2133
  fixture: k.fixture,
2095
- data: C,
2096
- viewport: l,
2134
+ data: T,
2135
+ viewport: i,
2097
2136
  themeMode: r.themeMode ?? "default",
2098
2137
  locale: r.locale ?? "default"
2099
2138
  }
2100
- ) : R ? /* @__PURE__ */ n(R.definition.screen, { params: R.params, context: S }) : W ? /* @__PURE__ */ n(W, { path: o.path }) : /* @__PURE__ */ n(ze, { title: s.shell.noRoute, children: /* @__PURE__ */ b("p", { children: [
2139
+ ) : y ? /* @__PURE__ */ n(y.definition.screen, { params: y.params, context: g }) : O ? /* @__PURE__ */ n(O, { path: o.path }) : /* @__PURE__ */ n(De, { title: s.shell.noRoute, children: /* @__PURE__ */ C("p", { children: [
2101
2140
  /* @__PURE__ */ n("code", { children: o.path }),
2102
2141
  " ",
2103
2142
  s.shell.noRouteHint
@@ -2105,10 +2144,10 @@ function Jt({ product: e, registry: t }) {
2105
2144
  return (
2106
2145
  // `display: contents` deixa o layout do produto como se este nó não
2107
2146
  // existisse: ele só serve de raiz para observar os links.
2108
- /* @__PURE__ */ n("div", { ref: m, style: { display: "contents" }, children: M && !v ? /* @__PURE__ */ n(M, { context: S, children: K }) : K })
2147
+ /* @__PURE__ */ n("div", { ref: m, style: { display: "contents" }, children: L && !f ? /* @__PURE__ */ n(L, { context: g, children: V }) : V })
2109
2148
  );
2110
2149
  }
2111
- function en(e) {
2150
+ function nn(e) {
2112
2151
  if (!e.altKey) {
2113
2152
  if (e.shiftKey && !e.metaKey && !e.ctrlKey && e.key === "C") return "C";
2114
2153
  if ((e.metaKey || e.ctrlKey) && !e.shiftKey) {
@@ -2123,210 +2162,211 @@ const ue = {
2123
2162
  rightWidth: "ds:right-width",
2124
2163
  appearance: "ds:appearance"
2125
2164
  };
2126
- function et(e) {
2165
+ function tt(e) {
2127
2166
  try {
2128
2167
  return window.localStorage.getItem(e) ?? void 0;
2129
2168
  } catch {
2130
2169
  return;
2131
2170
  }
2132
2171
  }
2133
- function tt(e, t) {
2172
+ function nt(e, t) {
2134
2173
  try {
2135
2174
  window.localStorage.setItem(e, t);
2136
2175
  } catch {
2137
2176
  }
2138
2177
  }
2139
- function Ae(e, t, s) {
2178
+ function Ke(e, t, s) {
2140
2179
  return Math.round(Math.min(s, Math.max(t, e)));
2141
2180
  }
2142
- function De(e, t, s, o) {
2143
- const [r, l] = D(() => {
2144
- const i = Number.parseInt(et(e) ?? "", 10);
2145
- return Number.isFinite(i) ? Ae(i, s, o) : t;
2146
- }), c = B(
2147
- (i) => {
2148
- const h = Ae(i, s, o);
2149
- l(h), tt(e, String(h));
2181
+ function Ve(e, t, s, o) {
2182
+ const [r, i] = K(() => {
2183
+ const a = Number.parseInt(tt(e) ?? "", 10);
2184
+ return Number.isFinite(a) ? Ke(a, s, o) : t;
2185
+ }), l = U(
2186
+ (a) => {
2187
+ const h = Ke(a, s, o);
2188
+ i(h), nt(e, String(h));
2150
2189
  },
2151
2190
  [e, o, s]
2152
2191
  );
2153
- return [r, c];
2192
+ return [r, l];
2154
2193
  }
2155
- function tn() {
2194
+ function on() {
2156
2195
  const e = "(prefers-color-scheme: dark)", t = () => {
2157
2196
  try {
2158
2197
  return window.matchMedia(e).matches ? "dark" : "light";
2159
2198
  } catch {
2160
2199
  return "light";
2161
2200
  }
2162
- }, [s, o] = D(t);
2163
- return V(() => {
2201
+ }, [s, o] = K(t);
2202
+ return I(() => {
2164
2203
  let r;
2165
2204
  try {
2166
2205
  r = window.matchMedia(e);
2167
2206
  } catch {
2168
2207
  return;
2169
2208
  }
2170
- const l = () => o(r?.matches ? "dark" : "light");
2171
- return r.addEventListener?.("change", l), () => r?.removeEventListener?.("change", l);
2209
+ const i = () => o(r?.matches ? "dark" : "light");
2210
+ return r.addEventListener?.("change", i), () => r?.removeEventListener?.("change", i);
2172
2211
  }, []), s;
2173
2212
  }
2174
- function nn() {
2175
- const e = et(ue.appearance);
2213
+ function rn() {
2214
+ const e = tt(ue.appearance);
2176
2215
  return e === "dark" || e === "light" ? e : void 0;
2177
2216
  }
2178
- function un({ product: e }) {
2179
- const t = A(() => gt(e), [e]), s = A(() => Et(e.theme?.labels), [e.theme?.labels]), [o] = D(() => mt());
2180
- return /* @__PURE__ */ n(Ze.Provider, { value: s, children: o ? /* @__PURE__ */ n(Jt, { product: e, registry: t }) : /* @__PURE__ */ n(on, { product: e, registry: t }) });
2217
+ function pn({ product: e }) {
2218
+ const t = D(() => bt(e), [e]), s = D(() => Rt(e.theme?.labels), [e.theme?.labels]), [o] = K(() => vt());
2219
+ return /* @__PURE__ */ n(Ye.Provider, { value: s, children: o ? /* @__PURE__ */ n(tn, { product: e, registry: t }) : /* @__PURE__ */ n(sn, { product: e, registry: t }) });
2181
2220
  }
2182
- const ke = { initial: 290, min: 200, max: 480 }, Ce = { initial: 320, min: 260, max: 560 };
2183
- function on({ product: e, registry: t }) {
2184
- const s = Q(), o = A(() => ft(e.deploy), [e.deploy]), { location: r, controls: l, viewport: c, setControls: i, openScenario: h, openComponent: m, openScreen: d, go: u } = Ge(t), f = q(r);
2185
- f.current = r;
2186
- const v = tn(), [k, C] = D(() => nn()), N = l.chromeTheme ?? k ?? v, [w, x] = De(
2221
+ const Ce = { initial: 290, min: 200, max: 480 }, Se = { initial: 320, min: 260, max: 560 };
2222
+ function sn({ product: e, registry: t }) {
2223
+ const s = Q(), o = D(() => wt(e.deploy), [e.deploy]), { location: r, controls: i, viewport: l, setControls: a, openScenario: h, openComponent: m, openScreen: p, go: d } = Ge(t), v = G(r);
2224
+ v.current = r;
2225
+ const f = on(), [k, T] = K(() => rn()), E = i.chromeTheme ?? k ?? f, [x, w] = Ve(
2187
2226
  ue.leftWidth,
2188
- ke.initial,
2189
- ke.min,
2190
- ke.max
2191
- ), [$, y] = De(
2192
- ue.rightWidth,
2193
2227
  Ce.initial,
2194
2228
  Ce.min,
2195
2229
  Ce.max
2196
- ), [L, p] = D(!1), E = l.handoff, a = t.component(l.component), g = t.scenario(l.scenario), S = a ? void 0 : t.screensFor({ handoff: E }).find((P) => P.id === t.screenForPath(r.path)?.id), R = S && g && S.variations.some((P) => P.id === g.id) ? g : void 0, M = A(
2197
- () => t.resolveComponentFixture(a?.id, a ? l.fixture : void 0),
2198
- [a, l.fixture, t]
2199
- ), W = A(() => {
2200
- if (!S || S.controls.length === 0) return t.issues;
2201
- const { invalid: P } = t.resolveControls(S, {
2202
- scenario: R,
2203
- requested: Ue(r.search)
2230
+ ), [b, N] = Ve(
2231
+ ue.rightWidth,
2232
+ Se.initial,
2233
+ Se.min,
2234
+ Se.max
2235
+ ), [S, u] = K(!1), $ = i.handoff, F = t.component(i.component), c = t.scenario(i.scenario), g = F ? void 0 : t.screensFor({ handoff: $ }).find((_) => _.id === t.screenForPath(r.path)?.id), y = g && c && g.variations.some((_) => _.id === c.id) ? c : void 0, L = D(
2236
+ () => t.resolveComponentFixture(F?.id, F ? i.fixture : void 0),
2237
+ [F, i.fixture, t]
2238
+ ), O = D(() => {
2239
+ if (!g || g.controls.length === 0) return t.issues;
2240
+ const { invalid: _ } = t.resolveControls(g, {
2241
+ scenario: y,
2242
+ requested: We(r.search)
2204
2243
  });
2205
- return P.length === 0 ? t.issues : [...P.map((Y) => ({
2244
+ return _.length === 0 ? t.issues : [..._.map((Y) => ({
2206
2245
  level: "warning",
2207
- where: `url:${Ie}${Y.id}`,
2246
+ where: `url:${we}${Y.id}`,
2208
2247
  message: Y.reason === "invalid-value" ? s.diagnostics.invalidControl(Y.id, Y.value, Y.fallback ?? "") : s.diagnostics.unknownControl(Y.id, Y.value)
2209
2248
  })), ...t.issues];
2210
- }, [s, r.search, t, S, R]), F = t.screensFor({ handoff: E })[0], K = t.componentsFor(E)[0], T = !F && !K, O = A(() => {
2211
- const P = new URLSearchParams(r.search);
2212
- return P.has(_.scenario) || P.has(_.component);
2213
- }, [r.search]), z = r.path === "/" && !O && !t.screenForPath("/") && !T;
2214
- V(() => {
2215
- z && (F ? d(F.id, { replace: !0 }) : K && m(K.id, { replace: !0 }));
2216
- }, [K, F, m, d, z]);
2217
- const j = B(
2218
- () => i({ chrome: !l.chrome }),
2219
- [l.chrome, i]
2220
- ), H = B(
2221
- (P) => {
2222
- if (P === "C") {
2249
+ }, [s, r.search, t, g, y]), R = t.screensFor({ handoff: $ })[0], V = t.componentsFor($)[0], P = !R && !V, z = D(() => {
2250
+ const _ = new URLSearchParams(r.search);
2251
+ return _.has(M.scenario) || _.has(M.component);
2252
+ }, [r.search]), A = r.path === "/" && !z && !t.screenForPath("/") && !P;
2253
+ I(() => {
2254
+ A && (R ? p(R.id, { replace: !0 }) : V && m(V.id, { replace: !0 }));
2255
+ }, [V, R, m, p, A]);
2256
+ const j = U(
2257
+ () => a({ chrome: !i.chrome }),
2258
+ [i.chrome, a]
2259
+ ), B = U(
2260
+ (_) => {
2261
+ if (_ === "C") {
2223
2262
  j();
2224
2263
  return;
2225
2264
  }
2226
- window.dispatchEvent(new KeyboardEvent("keydown", { key: P.toLowerCase(), metaKey: !0 }));
2265
+ window.dispatchEvent(new KeyboardEvent("keydown", { key: _.toLowerCase(), metaKey: !0 }));
2227
2266
  },
2228
2267
  [j]
2229
2268
  );
2230
- V(() => {
2231
- const P = (Z) => {
2232
- !Z.shiftKey || Z.metaKey || Z.ctrlKey || Z.altKey || Z.key !== "C" || Z.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (Z.preventDefault(), H(Z.key));
2269
+ I(() => {
2270
+ const _ = (Z) => {
2271
+ !Z.shiftKey || Z.metaKey || Z.ctrlKey || Z.altKey || Z.key !== "C" || Z.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (Z.preventDefault(), B(Z.key));
2233
2272
  };
2234
- return window.addEventListener("keydown", P), () => window.removeEventListener("keydown", P);
2235
- }, [H]);
2236
- const J = B(
2237
- (P, Z) => {
2238
- const { path: Y, search: at } = Ne(P);
2239
- u(Y, wt(at, f.current.search), { replace: Z });
2273
+ return window.addEventListener("keydown", _), () => window.removeEventListener("keydown", _);
2274
+ }, [B]);
2275
+ const J = U(
2276
+ (_, Z) => {
2277
+ const { path: Y, search: it } = xe(_);
2278
+ d(Y, gt(it, v.current.search), { replace: Z });
2240
2279
  },
2241
- [u]
2280
+ [d]
2242
2281
  ), ie = () => {
2243
- const P = N === "dark" ? "light" : "dark";
2244
- tt(ue.appearance, P), C(P), i({ chromeTheme: P });
2245
- }, re = (P) => i(P), nt = `${o.origin}${r.path}${r.search}`, ot = l.panelTab ?? "variations", Ee = l.zoom ?? 100, [rt, st] = D(Ee);
2246
- return /* @__PURE__ */ b(
2282
+ const _ = E === "dark" ? "light" : "dark";
2283
+ nt(ue.appearance, _), T(_), a({ chromeTheme: _ });
2284
+ }, re = (_) => a(_), ot = `${o.origin}${r.path}${r.search}`, rt = i.panelTab ?? "variations", Re = i.zoom ?? 100, [st, at] = K(Re);
2285
+ return /* @__PURE__ */ C(
2247
2286
  "div",
2248
2287
  {
2249
2288
  className: "ds-root",
2250
- "data-appearance": N,
2251
- "data-chrome": l.chrome ? "visible" : "hidden",
2252
- "data-resizing": L ? "true" : void 0,
2253
- "data-viewport": c.id,
2289
+ "data-appearance": E,
2290
+ "data-chrome": i.chrome ? "visible" : "hidden",
2291
+ "data-resizing": S ? "true" : void 0,
2292
+ "data-viewport": l.id,
2254
2293
  children: [
2255
- l.chrome && /* @__PURE__ */ n(
2256
- Rt,
2294
+ i.chrome && /* @__PURE__ */ n(
2295
+ Ft,
2257
2296
  {
2258
2297
  productName: e.name,
2259
2298
  deploy: o,
2260
- viewportId: l.viewport,
2261
- viewport: c,
2262
- zoom: rt,
2263
- rotated: !!l.rotated,
2264
- theme: N,
2265
- issues: W,
2266
- linkUrl: nt,
2267
- onViewport: (P) => re({ viewport: P }),
2268
- onRotate: () => re({ rotated: !l.rotated }),
2269
- onZoom: (P) => re({ zoom: P }),
2299
+ viewportId: i.viewport,
2300
+ viewport: l,
2301
+ zoom: st,
2302
+ rotated: !!i.rotated,
2303
+ theme: E,
2304
+ issues: O,
2305
+ linkUrl: ot,
2306
+ onViewport: (_) => re({ viewport: _ }),
2307
+ onRotate: () => re({ rotated: !i.rotated }),
2308
+ onZoom: (_) => re({ zoom: _ }),
2270
2309
  onCleanReview: j,
2271
2310
  onToggleTheme: ie
2272
2311
  }
2273
2312
  ),
2274
- /* @__PURE__ */ b("div", { className: "ds-body", children: [
2275
- l.chrome && /* @__PURE__ */ n(
2276
- Ot,
2313
+ /* @__PURE__ */ C("div", { className: "ds-body", children: [
2314
+ i.chrome && /* @__PURE__ */ n(
2315
+ At,
2277
2316
  {
2278
2317
  registry: t,
2279
- handoff: E,
2280
- activeScreen: S?.id,
2281
- activeComponent: a?.id,
2282
- onOpenScreen: (P) => d(P),
2283
- onOpenComponent: (P) => m(P),
2284
- width: w,
2285
- onResize: x,
2286
- onResizeStart: () => p(!0),
2287
- onResizeEnd: () => p(!1)
2318
+ handoff: $,
2319
+ activeScreen: g?.id,
2320
+ activeComponent: F?.id,
2321
+ onOpenScreen: (_) => p(_),
2322
+ onOpenComponent: (_) => m(_),
2323
+ width: x,
2324
+ onResize: w,
2325
+ onResizeStart: () => u(!0),
2326
+ onResizeEnd: () => u(!1)
2288
2327
  }
2289
2328
  ),
2290
- /* @__PURE__ */ n("main", { className: "ds-main", children: T ? /* @__PURE__ */ b("div", { className: "ds-chrome-empty", children: [
2329
+ /* @__PURE__ */ n("main", { className: "ds-main", children: P ? /* @__PURE__ */ C("div", { className: "ds-chrome-empty", children: [
2291
2330
  /* @__PURE__ */ n("h1", { className: "ds-chrome-empty__title", children: s.shell.empty }),
2292
2331
  /* @__PURE__ */ n("p", { className: "ds-muted", children: s.shell.emptyHint })
2293
- ] }) : z ? null : /* @__PURE__ */ n(
2294
- Zt,
2332
+ ] }) : A ? null : /* @__PURE__ */ n(
2333
+ Xt,
2295
2334
  {
2296
2335
  location: r,
2297
- viewport: c,
2298
- zoom: Ee,
2299
- onEffectiveZoom: st,
2336
+ viewport: l,
2337
+ zoom: Re,
2338
+ onEffectiveZoom: at,
2300
2339
  title: s.shell.frameTitle(e.name),
2301
- resizing: L,
2340
+ resizing: S,
2302
2341
  onFrameNavigate: J,
2303
- onShortcut: H
2342
+ onShortcut: B
2304
2343
  }
2305
2344
  ) }),
2306
- l.chrome && /* @__PURE__ */ n(
2307
- Ut,
2345
+ i.chrome && /* @__PURE__ */ n(
2346
+ Wt,
2308
2347
  {
2309
2348
  registry: t,
2310
- controls: l,
2349
+ controls: i,
2311
2350
  deploy: o,
2312
2351
  location: r,
2313
- screen: S,
2314
- variation: R,
2315
- component: a,
2316
- componentFixture: M,
2317
- tab: ot,
2318
- onTab: (P) => re({ panelTab: P }),
2352
+ screen: g,
2353
+ variation: y,
2354
+ component: F,
2355
+ componentFixture: L,
2356
+ tab: rt,
2357
+ onTab: (_) => re({ panelTab: _ }),
2319
2358
  onOpenScenario: h,
2320
- onOpenComponent: (P) => m(P),
2359
+ onOpenComponent: (_) => m(_),
2360
+ onOpenScreen: (_) => p(_),
2321
2361
  onChange: re,
2322
- width: $,
2323
- onResize: y,
2324
- onResizeStart: () => p(!0),
2325
- onResizeEnd: () => p(!1)
2362
+ width: b,
2363
+ onResize: N,
2364
+ onResizeStart: () => u(!0),
2365
+ onResizeEnd: () => u(!1)
2326
2366
  }
2327
2367
  )
2328
2368
  ] }),
2329
- !l.chrome && /* @__PURE__ */ n(
2369
+ !i.chrome && /* @__PURE__ */ n(
2330
2370
  "button",
2331
2371
  {
2332
2372
  type: "button",
@@ -2344,67 +2384,67 @@ function on({ product: e, registry: t }) {
2344
2384
  function fe(e) {
2345
2385
  return new Date(e.length === 10 ? `${e}T00:00:00` : e);
2346
2386
  }
2347
- function hn(e, t) {
2387
+ function mn(e, t) {
2348
2388
  const s = fe(e), o = fe(t);
2349
2389
  let r = o.getFullYear() - s.getFullYear();
2350
- const l = o.getMonth() - s.getMonth();
2351
- return (l < 0 || l === 0 && o.getDate() < s.getDate()) && (r -= 1), r;
2390
+ const i = o.getMonth() - s.getMonth();
2391
+ return (i < 0 || i === 0 && o.getDate() < s.getDate()) && (r -= 1), r;
2352
2392
  }
2353
- function pn(e, t) {
2393
+ function fn(e, t) {
2354
2394
  const s = fe(e), o = fe(t);
2355
2395
  return Math.floor((o.getTime() - s.getTime()) / 864e5);
2356
2396
  }
2357
2397
  export {
2358
- Ie as CONTROL_PARAM_PREFIX,
2398
+ we as CONTROL_PARAM_PREFIX,
2359
2399
  ne as DEFAULT_LABELS,
2360
- un as DesignSpace,
2361
- cn as EN_US_LABELS,
2362
- pt as FRAME_ATTRIBUTE,
2363
- wn as FRAME_PARAM,
2364
- gn as HANDOFF_PARAM,
2365
- ln as NETWORK_LABELS,
2366
- We as NETWORK_STATES,
2367
- _ as PARAM,
2368
- Qe as SLOW_NETWORK_DELAY_MS,
2369
- Je as SimulatedNetworkError,
2370
- ze as StageEmpty,
2371
- Ct as VIEWPORTS,
2400
+ pn as DesignSpace,
2401
+ dn as EN_US_LABELS,
2402
+ ft as FRAME_ATTRIBUTE,
2403
+ gn as FRAME_PARAM,
2404
+ bn as HANDOFF_PARAM,
2405
+ un as NETWORK_LABELS,
2406
+ He as NETWORK_STATES,
2407
+ M as PARAM,
2408
+ Je as SLOW_NETWORK_DELAY_MS,
2409
+ et as SimulatedNetworkError,
2410
+ De as StageEmpty,
2411
+ St as VIEWPORTS,
2372
2412
  pe as ZOOM_DEFAULT,
2373
- Te as ZOOM_MAX,
2374
- Le as ZOOM_MIN,
2375
- hn as ageInYears,
2376
- Me as applyHandoffScope,
2377
- xe as applyOverrides,
2378
- qe as clampZoom,
2379
- vn as commitUrl,
2380
- bn as componentUrl,
2381
- dn as createHttpAdapter,
2382
- gt as createRegistry,
2383
- pn as daysBetween,
2384
- $e as fixtureAdapter,
2385
- kn as formatIssues,
2386
- ft as getDeployContext,
2387
- we as handoffAllowsComponent,
2388
- Ve as handoffAllowsPath,
2413
+ Ee as ZOOM_MAX,
2414
+ Pe as ZOOM_MIN,
2415
+ mn as ageInYears,
2416
+ Te as applyHandoffScope,
2417
+ ye as applyOverrides,
2418
+ Ze as clampZoom,
2419
+ kn as commitUrl,
2420
+ Cn as componentUrl,
2421
+ hn as createHttpAdapter,
2422
+ bt as createRegistry,
2423
+ fn as daysBetween,
2424
+ Le as fixtureAdapter,
2425
+ Sn as formatIssues,
2426
+ wt as getDeployContext,
2427
+ ve as handoffAllowsComponent,
2428
+ Ie as handoffAllowsPath,
2389
2429
  oe as handoffAllowsScenario,
2390
- Cn as hasErrors,
2391
- Sn as matchPath,
2392
- Nn as normalizeHandoffScope,
2430
+ Nn as hasErrors,
2431
+ xn as matchPath,
2432
+ yn as normalizeHandoffScope,
2393
2433
  X as normalizeSearch,
2394
- St as parseControls,
2395
- dt as parseHandoffScope,
2434
+ $e as parseControls,
2435
+ ht as parseHandoffScope,
2396
2436
  fe as parseIsoDate,
2397
- ye as resolveFixture,
2398
- Et as resolveLabels,
2399
- Se as resolveRoute,
2400
- Nt as resolveViewport,
2437
+ Me as resolveFixture,
2438
+ Rt as resolveLabels,
2439
+ Ne as resolveRoute,
2440
+ yt as resolveViewport,
2401
2441
  he as scenarioUrl,
2402
2442
  se as serializeControls,
2403
- xn as serializeValue,
2443
+ $n as serializeValue,
2404
2444
  Ge as useDesignSpaceState,
2405
2445
  Q as useLabels,
2406
- Qt as useScenarioData,
2407
- lt as validateProduct,
2408
- yn as validateScenario
2446
+ en as useScenarioData,
2447
+ ut as validateProduct,
2448
+ Mn as validateScenario
2409
2449
  };
2410
2450
  //# sourceMappingURL=index.js.map