@brucesantos/design-space 0.9.1 → 0.9.2

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