@brucesantos/design-space 0.11.0 → 0.12.0

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