@pygmalionjs/pygmalion 0.2.34 → 0.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,26 @@
1
- import { jsxs as $, jsx as v } from "react/jsx-runtime";
2
- import { b as ee, m as Le, i as Xe, g as Ye, e as J, c as Ze, a as et, d as tt, f as nt, h as rt, j as ot, k as st, l as it, n as at, o as ge, p as Re, q as Ne, r as ct, t as lt, u as dt, v as ut, w as ft, x as ht, y as Ae, z as ye, A as ae, B as ce, C as $e, S as mt, D as pt, E as Oe, G as gt, H as Me, I as yt, J as wt, K as bt, L as vt, M as St, O as ke } from "./App-DVnjCYV2.js";
3
- import { P as In, Q as xn, R as Pn, T as En, U as Cn, V as Rn, W as Nn, X as An, Y as $n, Z as On, _ as Mn, $ as kn, a0 as Fn, a1 as Tn, a2 as Dn, a3 as zn, a4 as jn, a5 as _n, a6 as Bn, a7 as Un, a8 as Hn, a9 as qn, aa as Kn, ab as Gn, ac as Jn, ad as Vn, ae as Wn, af as Qn, ag as Ln, ah as Xn, ai as Yn } from "./App-DVnjCYV2.js";
4
- import { createElement as Fe, useMemo as de, useState as re, useRef as ve, useCallback as Z, useEffect as oe } from "react";
5
- function Se(e, t = /* @__PURE__ */ new Set()) {
1
+ import { jsxs as N, jsx as b } from "react/jsx-runtime";
2
+ import { b as ne, m as Ze, i as et, g as tt, e as J, c as nt, a as rt, d as ot, f as st, h as it, j as at, k as ct, l as be, n as lt, o as dt, p as ut, q as ft, r as gt, t as mt, u as Oe, v as pt, w as ht, x as yt, y as $e, z as Se, A as de, B as ue, C as Me, S as wt, D as bt, E as De, G as St, H as ke, I as vt, J as It, K as xt, L as Pt, M as Et, O as Ct, P as Fe } from "./App-phpKmf_I.js";
3
+ import { Q as Rn, R as Nn, T as An, U as On, V as $n, W as Mn, X as Dn, Y as kn, Z as Fn, _ as Tn, $ as zn, a0 as _n, a1 as jn, a2 as Bn, a3 as Un, a4 as Hn, a5 as qn, a6 as Gn, a7 as Kn, a8 as Vn, a9 as Jn, aa as Wn, ab as Ln, ac as Qn, ad as Xn, ae as Yn, af as Zn, ag as er, ah as tr, ai as nr, aj as rr, ak as or, al as sr, am as ir, an as ar, ao as cr, ap as lr, aq as dr, ar as ur, as as fr, at as gr, au as mr, av as pr } from "./App-phpKmf_I.js";
4
+ import { createElement as Te, useMemo as ae, useState as se, useRef as xe, useCallback as te, useEffect as ie, useLayoutEffect as ze } from "react";
5
+ function Pe(e, t = /* @__PURE__ */ new Set()) {
6
6
  if (e == null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e))
7
7
  return e;
8
8
  if (Array.isArray(e))
9
- return e.map((n) => Se(n, t));
9
+ return e.map((n) => Pe(n, t));
10
10
  if (typeof e != "object") return null;
11
11
  if (t.has(e))
12
12
  throw new Error("A storyboard recipe cannot contain circular references.");
13
13
  t.add(e);
14
- const s = {};
14
+ const o = {};
15
15
  for (const n of Object.keys(e).sort()) {
16
16
  const r = e[n];
17
- r !== void 0 && (s[n] = Se(r, t));
17
+ r !== void 0 && (o[n] = Pe(r, t));
18
18
  }
19
- return t.delete(e), s;
19
+ return t.delete(e), o;
20
20
  }
21
- function It(e) {
21
+ function Rt(e) {
22
22
  return JSON.stringify(
23
- Se({
23
+ Pe({
24
24
  version: 1,
25
25
  route: e.route ?? null,
26
26
  componentName: e.componentName ?? null,
@@ -39,34 +39,34 @@ function It(e) {
39
39
  })
40
40
  );
41
41
  }
42
- function B(e) {
43
- return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, s) => t.localeCompare(s));
42
+ function _(e) {
43
+ return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, o) => t.localeCompare(o));
44
44
  }
45
- function xt(e, t) {
45
+ function Nt(e, t) {
46
46
  var n;
47
47
  return ((n = e.id) == null ? void 0 : n.trim()) || `edge:${t + 1}`;
48
48
  }
49
- function Pt(e) {
50
- const t = [...e.screens].sort((n, r) => n.id.localeCompare(r.id)), s = t[0].id;
49
+ function At(e) {
50
+ const t = [...e.screens].sort((n, r) => n.id.localeCompare(r.id)), o = t[0].id;
51
51
  return {
52
- id: `story:${s}`,
53
- canonicalScreenId: s,
52
+ id: `story:${o}`,
53
+ canonicalScreenId: o,
54
54
  screenIds: t.map((n) => n.id),
55
- names: B(t.map((n) => n.name)),
55
+ names: _(t.map((n) => n.name)),
56
56
  recipeKey: e.recipeKey,
57
- routes: B(t.map((n) => n.route)),
58
- scenarioIds: B(
57
+ routes: _(t.map((n) => n.route)),
58
+ scenarioIds: _(
59
59
  t.flatMap((n) => [
60
60
  n.scenarioId,
61
61
  ...n.scenarioIds ?? []
62
62
  ])
63
63
  ),
64
- sourceKeys: B(t.map((n) => n.sourcePath)),
65
- flows: B(t.map((n) => n.flow)),
66
- states: B(t.map((n) => n.state))
64
+ sourceKeys: _(t.map((n) => n.sourcePath)),
65
+ flows: _(t.map((n) => n.flow)),
66
+ states: _(t.map((n) => n.state))
67
67
  };
68
68
  }
69
- function Te(e) {
69
+ function _e(e) {
70
70
  return [
71
71
  e.code,
72
72
  e.edgeId,
@@ -75,421 +75,421 @@ function Te(e) {
75
75
  e.scenarioId
76
76
  ].join(":");
77
77
  }
78
- function Et(e) {
79
- var x, q;
80
- const t = [], s = [], n = /* @__PURE__ */ new Map();
81
- for (const i of e.screens) {
82
- const d = i.id.trim();
83
- if (!d || n.has(d)) {
78
+ function Ot(e) {
79
+ var X, z;
80
+ const t = [], o = [], n = /* @__PURE__ */ new Map();
81
+ for (const a of e.screens) {
82
+ const c = a.id.trim();
83
+ if (!c || n.has(c)) {
84
84
  t.push({
85
85
  code: "duplicate-screen-id",
86
86
  severity: "error",
87
- message: d ? `Multiple storyboard screens use the id "${d}".` : "A storyboard screen has an empty id.",
88
- screenId: d || void 0
87
+ message: c ? `Multiple storyboard screens use the id "${c}".` : "A storyboard screen has an empty id.",
88
+ screenId: c || void 0
89
89
  });
90
90
  continue;
91
91
  }
92
- const l = d === i.id ? i : { ...i, id: d };
93
- n.set(d, l), s.push(l);
92
+ const d = c === a.id ? a : { ...a, id: c };
93
+ n.set(c, d), o.push(d);
94
94
  }
95
- const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
96
- for (const i of s) {
97
- let d;
95
+ const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
96
+ for (const a of o) {
97
+ let c;
98
98
  try {
99
- if (d = (e.recipeKey ?? It)(i), !d.trim()) throw new Error("Recipe keys cannot be empty.");
100
- } catch (f) {
101
- o.add(i.id), t.push({
99
+ if (c = (e.recipeKey ?? Rt)(a), !c.trim()) throw new Error("Recipe keys cannot be empty.");
100
+ } catch (u) {
101
+ s.add(a.id), t.push({
102
102
  code: "invalid-recipe",
103
103
  severity: "error",
104
- message: f instanceof Error ? f.message : "Storyboard recipe identity could not be created.",
105
- screenId: i.id
106
- }), d = `invalid:${i.id}`;
104
+ message: u instanceof Error ? u.message : "Storyboard recipe identity could not be created.",
105
+ screenId: a.id
106
+ }), c = `invalid:${a.id}`;
107
107
  }
108
- const l = r.get(d);
109
- l ? l.screens.push(i) : r.set(d, { recipeKey: d, screens: [i] });
108
+ const d = r.get(c);
109
+ d ? d.screens.push(a) : r.set(c, { recipeKey: c, screens: [a] });
110
110
  }
111
- const a = [...r.values()].map(Pt).sort((i, d) => i.id.localeCompare(d.id)), c = {};
112
- for (const i of a)
113
- for (const d of i.screenIds) c[d] = i.id;
114
- const u = new Map(a.map((i) => [i.id, i])), g = /* @__PURE__ */ new Map();
115
- for (const i of e.assets ?? []) {
116
- const d = g.get(i.pageId);
117
- d ? d.push(i) : g.set(i.pageId, [i]);
111
+ const i = [...r.values()].map(At).sort((a, c) => a.id.localeCompare(c.id)), l = {};
112
+ for (const a of i)
113
+ for (const c of a.screenIds) l[c] = a.id;
114
+ const f = new Map(i.map((a) => [a.id, a])), p = /* @__PURE__ */ new Map();
115
+ for (const a of e.assets ?? []) {
116
+ const c = p.get(a.pageId);
117
+ c ? c.push(a) : p.set(a.pageId, [a]);
118
118
  }
119
- const h = a.map((i) => {
120
- const d = i.screenIds.flatMap(
121
- (l) => g.get(l) ?? []
119
+ const g = i.map((a) => {
120
+ const c = a.screenIds.flatMap(
121
+ (d) => p.get(d) ?? []
122
122
  );
123
123
  return {
124
- ...i,
125
- scenarioIds: B([
126
- ...i.scenarioIds,
127
- ...d.map((l) => l.scenarioId)
124
+ ...a,
125
+ scenarioIds: _([
126
+ ...a.scenarioIds,
127
+ ...c.map((d) => d.scenarioId)
128
128
  ]),
129
- sourceKeys: B([
130
- ...i.sourceKeys,
131
- ...d.map((l) => l.sourcePath)
129
+ sourceKeys: _([
130
+ ...a.sourceKeys,
131
+ ...c.map((d) => d.sourcePath)
132
132
  ])
133
133
  };
134
- }), w = /* @__PURE__ */ new Map();
135
- for (const i of h)
136
- for (const d of i.routes) {
137
- const l = w.get(d);
138
- l ? l.push(i.id) : w.set(d, [i.id]);
134
+ }), S = /* @__PURE__ */ new Map();
135
+ for (const a of g)
136
+ for (const c of a.routes) {
137
+ const d = S.get(c);
138
+ d ? d.push(a.id) : S.set(c, [a.id]);
139
139
  }
140
- const y = (i, d, l) => {
141
- const f = i.trim(), E = c[f] ?? (u.has(f) ? f : null);
142
- if (E) return E;
143
- const C = B(w.get(f) ?? []);
144
- return C.length === 1 ? C[0] : C.length > 1 ? (t.push({
145
- code: l === "source" ? "ambiguous-edge-source" : "ambiguous-edge-target",
140
+ const h = (a, c, d) => {
141
+ const u = a.trim(), P = l[u] ?? (f.has(u) ? u : null);
142
+ if (P) return P;
143
+ const I = _(S.get(u) ?? []);
144
+ return I.length === 1 ? I[0] : I.length > 1 ? (t.push({
145
+ code: d === "source" ? "ambiguous-edge-source" : "ambiguous-edge-target",
146
146
  severity: "error",
147
- message: `Storyboard edge "${d}" references an ambiguous ${l} route.`,
148
- edgeId: d,
149
- screenId: f || void 0
147
+ message: `Storyboard edge "${c}" references an ambiguous ${d} route.`,
148
+ edgeId: c,
149
+ screenId: u || void 0
150
150
  }), null) : (t.push({
151
- code: l === "source" ? "unknown-edge-source" : "unknown-edge-target",
151
+ code: d === "source" ? "unknown-edge-source" : "unknown-edge-target",
152
152
  severity: "error",
153
- message: `Storyboard edge "${d}" references an unknown ${l}.`,
154
- edgeId: d,
155
- screenId: f || void 0
153
+ message: `Storyboard edge "${c}" references an unknown ${d}.`,
154
+ edgeId: c,
155
+ screenId: u || void 0
156
156
  }), null);
157
- }, I = [], b = /* @__PURE__ */ new Map(), A = [
157
+ }, x = [], y = /* @__PURE__ */ new Map(), A = [
158
158
  ["explicit", e.explicitEdges ?? []],
159
159
  ["inferred", e.inferredEdges ?? []]
160
160
  ];
161
161
  let m = 0;
162
- for (const [i, d] of A)
163
- for (const l of d) {
164
- const f = xt(l, m);
162
+ for (const [a, c] of A)
163
+ for (const d of c) {
164
+ const u = Nt(d, m);
165
165
  m += 1;
166
- const E = y(l.from, f, "source"), C = y(l.to, f, "target");
167
- if (!E || !C || E === C) continue;
168
- const P = `${E}\0${C}`, p = b.get(P);
169
- if (p) {
170
- if (!p.sourceEdgeIds.includes(f)) {
171
- const O = {
172
- ...p,
173
- sourceEdgeIds: B([
174
- ...p.sourceEdgeIds,
175
- f
166
+ const P = h(d.from, u, "source"), I = h(d.to, u, "target");
167
+ if (!P || !I || P === I) continue;
168
+ const D = `${P}\0${I}`, R = y.get(D);
169
+ if (R) {
170
+ if (!R.sourceEdgeIds.includes(u)) {
171
+ const C = {
172
+ ...R,
173
+ sourceEdgeIds: _([
174
+ ...R.sourceEdgeIds,
175
+ u
176
176
  ])
177
177
  };
178
- b.set(P, O);
179
- const F = I.indexOf(p);
180
- F >= 0 && (I[F] = O);
178
+ y.set(D, C);
179
+ const w = x.indexOf(R);
180
+ w >= 0 && (x[w] = C);
181
181
  }
182
182
  continue;
183
183
  }
184
- const N = {
185
- id: f,
186
- from: E,
187
- to: C,
188
- kind: ((x = l.kind) == null ? void 0 : x.trim()) || void 0,
189
- label: ((q = l.label) == null ? void 0 : q.trim()) || void 0,
190
- origin: i,
191
- sourceEdgeIds: [f]
184
+ const K = {
185
+ id: u,
186
+ from: P,
187
+ to: I,
188
+ kind: ((X = d.kind) == null ? void 0 : X.trim()) || void 0,
189
+ label: ((z = d.label) == null ? void 0 : z.trim()) || void 0,
190
+ origin: a,
191
+ sourceEdgeIds: [u]
192
192
  };
193
- b.set(P, N), I.push(N);
193
+ y.set(D, K), x.push(K);
194
194
  }
195
- I.sort(
196
- (i, d) => `${i.from}:${i.to}:${i.id}`.localeCompare(`${d.from}:${d.to}:${d.id}`)
195
+ x.sort(
196
+ (a, c) => `${a.from}:${a.to}:${a.id}`.localeCompare(`${c.from}:${c.to}:${c.id}`)
197
197
  );
198
- const k = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
199
- for (const i of I) {
200
- const d = M.get(i.from);
201
- d ? d.push(i) : M.set(i.from, [i]);
202
- const l = k.get(i.to);
203
- l ? l.push(i) : k.set(i.to, [i]);
198
+ const k = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map();
199
+ for (const a of x) {
200
+ const c = $.get(a.from);
201
+ c ? c.push(a) : $.set(a.from, [a]);
202
+ const d = k.get(a.to);
203
+ d ? d.push(a) : k.set(a.to, [a]);
204
204
  }
205
- const D = [];
206
- for (const i of e.startScreenIds ?? []) {
207
- const d = i.trim(), l = c[d] ?? (u.has(d) ? d : null);
208
- if (!l) {
205
+ const F = [];
206
+ for (const a of e.startScreenIds ?? []) {
207
+ const c = a.trim(), d = l[c] ?? (f.has(c) ? c : null);
208
+ if (!d) {
209
209
  t.push({
210
210
  code: "unknown-start-screen",
211
211
  severity: "error",
212
- message: `Storyboard start references an unknown screen "${d}".`,
213
- screenId: d || void 0
212
+ message: `Storyboard start references an unknown screen "${c}".`,
213
+ screenId: c || void 0
214
214
  });
215
215
  continue;
216
216
  }
217
- D.push(l);
217
+ F.push(d);
218
218
  }
219
- const z = new Set(D);
220
- let j = B(D);
221
- j.length || (j = h.filter((i) => {
222
- var d;
223
- return (((d = k.get(i.id)) == null ? void 0 : d.length) ?? 0) === 0;
224
- }).map((i) => i.id).sort((i, d) => i.localeCompare(d))), !j.length && h.length && (j = [h[0].id]);
225
- const S = /* @__PURE__ */ new Set(), R = [...j];
226
- for (; R.length; ) {
227
- const i = R.shift();
228
- if (!S.has(i)) {
229
- S.add(i);
230
- for (const d of M.get(i) ?? []) R.push(d.to);
219
+ const T = new Set(F);
220
+ let j = _(F);
221
+ j.length || (j = g.filter((a) => {
222
+ var c;
223
+ return (((c = k.get(a.id)) == null ? void 0 : c.length) ?? 0) === 0;
224
+ }).map((a) => a.id).sort((a, c) => a.localeCompare(c))), !j.length && g.length && (j = [g[0].id]);
225
+ const v = /* @__PURE__ */ new Set(), E = [...j];
226
+ for (; E.length; ) {
227
+ const a = E.shift();
228
+ if (!v.has(a)) {
229
+ v.add(a);
230
+ for (const c of $.get(a) ?? []) E.push(c.to);
231
231
  }
232
232
  }
233
- const T = h.filter((i) => {
234
- var l, f;
235
- const d = (((l = k.get(i.id)) == null ? void 0 : l.length) ?? 0) === 0 && (((f = M.get(i.id)) == null ? void 0 : f.length) ?? 0) === 0 && !z.has(i.id);
236
- return !S.has(i.id) || d && h.length > 1;
233
+ const M = g.filter((a) => {
234
+ var d, u;
235
+ const c = (((d = k.get(a.id)) == null ? void 0 : d.length) ?? 0) === 0 && (((u = $.get(a.id)) == null ? void 0 : u.length) ?? 0) === 0 && !T.has(a.id);
236
+ return !v.has(a.id) || c && g.length > 1;
237
237
  });
238
- for (const i of T)
239
- for (const d of i.screenIds)
238
+ for (const a of M)
239
+ for (const c of a.screenIds)
240
240
  t.push({
241
241
  code: "disconnected-screen",
242
242
  severity: "warning",
243
- message: `Storyboard screen "${d}" is not connected to a graph branch.`,
244
- screenId: d,
245
- nodeId: i.id
243
+ message: `Storyboard screen "${c}" is not connected to a graph branch.`,
244
+ screenId: c,
245
+ nodeId: a.id
246
246
  });
247
- const H = /* @__PURE__ */ new Map();
248
- for (const i of h)
249
- for (const d of i.sourceKeys) {
250
- const l = H.get(d) ?? {
247
+ const B = /* @__PURE__ */ new Map();
248
+ for (const a of g)
249
+ for (const c of a.sourceKeys) {
250
+ const d = B.get(c) ?? {
251
251
  nodeIds: /* @__PURE__ */ new Set(),
252
252
  screenIds: /* @__PURE__ */ new Set()
253
253
  };
254
- l.nodeIds.add(i.id);
255
- for (const f of i.screenIds) l.screenIds.add(f);
256
- H.set(d, l);
254
+ d.nodeIds.add(a.id);
255
+ for (const u of a.screenIds) d.screenIds.add(u);
256
+ B.set(c, d);
257
257
  }
258
- const te = [...H.entries()].map(([i, d]) => ({
259
- sourceKey: i,
260
- nodeIds: [...d.nodeIds].sort((l, f) => l.localeCompare(f)),
261
- screenIds: [...d.screenIds].sort((l, f) => l.localeCompare(f)),
262
- shared: d.nodeIds.size > 1
263
- })).sort((i, d) => i.sourceKey.localeCompare(d.sourceKey)), ne = h.map((i) => {
264
- const d = [...M.get(i.id) ?? []].sort(
265
- (l, f) => l.id.localeCompare(f.id)
258
+ const Z = [...B.entries()].map(([a, c]) => ({
259
+ sourceKey: a,
260
+ nodeIds: [...c.nodeIds].sort((d, u) => d.localeCompare(u)),
261
+ screenIds: [...c.screenIds].sort((d, u) => d.localeCompare(u)),
262
+ shared: c.nodeIds.size > 1
263
+ })).sort((a, c) => a.sourceKey.localeCompare(c.sourceKey)), re = g.map((a) => {
264
+ const c = [...$.get(a.id) ?? []].sort(
265
+ (d, u) => d.id.localeCompare(u.id)
266
266
  );
267
267
  return {
268
- nodeId: i.id,
269
- edgeIds: d.map((l) => l.id),
270
- targetNodeIds: B(d.map((l) => l.to))
268
+ nodeId: a.id,
269
+ edgeIds: c.map((d) => d.id),
270
+ targetNodeIds: _(c.map((d) => d.to))
271
271
  };
272
- }).filter((i) => i.targetNodeIds.length > 1).sort((i, d) => i.nodeId.localeCompare(d.nodeId)), Y = new Set(
273
- h.flatMap((i) => i.scenarioIds)
274
- ), Q = new Set(
275
- (e.nonVisualScenarioIds ?? []).map((i) => i.trim())
276
- ), L = B(
277
- (e.scenarios ?? []).map((i) => i.id)
278
- ), V = L.filter(
279
- (i) => !Y.has(i) && !Q.has(i)
272
+ }).filter((a) => a.targetNodeIds.length > 1).sort((a, c) => a.nodeId.localeCompare(c.nodeId)), ee = new Set(
273
+ g.flatMap((a) => a.scenarioIds)
274
+ ), oe = new Set(
275
+ (e.nonVisualScenarioIds ?? []).map((a) => a.trim())
276
+ ), H = _(
277
+ (e.scenarios ?? []).map((a) => a.id)
278
+ ), W = H.filter(
279
+ (a) => !ee.has(a) && !oe.has(a)
280
280
  );
281
- for (const i of V)
281
+ for (const a of W)
282
282
  t.push({
283
283
  code: "missing-code-scenario",
284
284
  severity: "warning",
285
- message: `Code scenario "${i}" is not represented in the storyboard.`,
286
- scenarioId: i
285
+ message: `Code scenario "${a}" is not represented in the storyboard.`,
286
+ scenarioId: a
287
287
  });
288
288
  t.sort(
289
- (i, d) => Te(i).localeCompare(Te(d))
289
+ (a, c) => _e(a).localeCompare(_e(c))
290
290
  );
291
- const _ = B(
292
- T.flatMap((i) => i.screenIds)
293
- ), X = {
294
- screens: s.length,
295
- canonicalNodes: h.length,
296
- mergedScreens: Math.max(0, s.length - h.length),
297
- edges: I.length,
298
- connectedNodes: h.length - T.length,
299
- disconnectedScreens: _,
300
- codeScenarios: L.length,
301
- representedScenarios: L.filter(
302
- (i) => Y.has(i)
291
+ const G = _(
292
+ M.flatMap((a) => a.screenIds)
293
+ ), L = {
294
+ screens: o.length,
295
+ canonicalNodes: g.length,
296
+ mergedScreens: Math.max(0, o.length - g.length),
297
+ edges: x.length,
298
+ connectedNodes: g.length - M.length,
299
+ disconnectedScreens: G,
300
+ codeScenarios: H.length,
301
+ representedScenarios: H.filter(
302
+ (a) => ee.has(a)
303
303
  ).length,
304
- missingScenarios: V,
305
- complete: _.length === 0 && V.length === 0 && !t.some((i) => i.severity === "error") && o.size === 0
304
+ missingScenarios: W,
305
+ complete: G.length === 0 && W.length === 0 && !t.some((a) => a.severity === "error") && s.size === 0
306
306
  };
307
307
  return {
308
308
  version: 1,
309
- nodes: h,
310
- edges: I,
309
+ nodes: g,
310
+ edges: x,
311
311
  aliases: Object.fromEntries(
312
- Object.entries(c).sort(([i], [d]) => i.localeCompare(d))
312
+ Object.entries(l).sort(([a], [c]) => a.localeCompare(c))
313
313
  ),
314
- sourceGroups: te,
314
+ sourceGroups: Z,
315
315
  startNodeIds: j,
316
- branches: ne,
316
+ branches: re,
317
317
  warnings: t,
318
- coverage: X
318
+ coverage: L
319
319
  };
320
320
  }
321
- function Ct(e) {
321
+ function $t(e) {
322
322
  return e ? JSON.parse(JSON.stringify(e)) : void 0;
323
323
  }
324
- function ue(e) {
325
- if (Array.isArray(e)) return e.map(ue);
324
+ function me(e) {
325
+ if (Array.isArray(e)) return e.map(me);
326
326
  if (e && typeof e == "object") {
327
- const t = Object.entries(e).filter(([, s]) => s !== void 0).sort(([s], [n]) => s.localeCompare(n)).map(([s, n]) => [s, ue(n)]).filter(([, s]) => s !== void 0);
327
+ const t = Object.entries(e).filter(([, o]) => o !== void 0).sort(([o], [n]) => o.localeCompare(n)).map(([o, n]) => [o, me(n)]).filter(([, o]) => o !== void 0);
328
328
  return t.length ? Object.fromEntries(t) : void 0;
329
329
  }
330
330
  return e;
331
331
  }
332
- function De(e) {
333
- return JSON.stringify(ue(e ?? null));
332
+ function je(e) {
333
+ return JSON.stringify(me(e ?? null));
334
334
  }
335
- function Rt(e) {
335
+ function Mt(e) {
336
336
  return !!(e && typeof e == "object" && !Array.isArray(e));
337
337
  }
338
- function G(e) {
338
+ function V(e) {
339
339
  const t = e == null ? void 0 : e.trim();
340
340
  if (!t) return null;
341
- let s = t;
341
+ let o = t;
342
342
  try {
343
- /^[a-z][a-z\d+.-]*:\/\//i.test(t) && (s = new URL(t).pathname);
343
+ /^[a-z][a-z\d+.-]*:\/\//i.test(t) && (o = new URL(t).pathname);
344
344
  } catch {
345
345
  return null;
346
346
  }
347
- return s = s.split(/[?#]/, 1)[0].replace(/\/{2,}/g, "/"), s.startsWith("/") || (s = `/${s}`), s.length > 1 && (s = s.replace(/\/+$/, "")), s || "/";
347
+ return o = o.split(/[?#]/, 1)[0].replace(/\/{2,}/g, "/"), o.startsWith("/") || (o = `/${o}`), o.length > 1 && (o = o.replace(/\/+$/, "")), o || "/";
348
348
  }
349
- function qe(e) {
349
+ function Ve(e) {
350
350
  return `source-route:${encodeURIComponent(e)}`;
351
351
  }
352
- function Pe(e, t) {
353
- const s = e.split("/").filter(Boolean), n = t.split("/").filter(Boolean);
352
+ function Re(e, t) {
353
+ const o = e.split("/").filter(Boolean), n = t.split("/").filter(Boolean);
354
354
  let r = 0;
355
- for (let o = 0; o < s.length; o += 1) {
356
- const a = s[o];
357
- if (a === "*" || a.startsWith("*")) return !0;
358
- const c = n[r];
359
- if (!(a.endsWith("?") && c == null)) {
360
- if (c == null || !a.startsWith(":") && a !== c) return !1;
355
+ for (let s = 0; s < o.length; s += 1) {
356
+ const i = o[s];
357
+ if (i === "*" || i.startsWith("*")) return !0;
358
+ const l = n[r];
359
+ if (!(i.endsWith("?") && l == null)) {
360
+ if (l == null || !i.startsWith(":") && i !== l) return !1;
361
361
  r += 1;
362
362
  }
363
363
  }
364
364
  return r === n.length;
365
365
  }
366
- function ze(e, t) {
367
- const s = G(e);
368
- if (!s) return [];
369
- const n = t.get(s);
370
- return n && !/[:*]/.test(s) ? [n] : [
366
+ function Be(e, t) {
367
+ const o = V(e);
368
+ if (!o) return [];
369
+ const n = t.get(o);
370
+ return n && !/[:*]/.test(o) ? [n] : [
371
371
  ...new Set(
372
- [...t.entries()].filter(([r]) => Pe(s, r)).map(([, r]) => r)
372
+ [...t.entries()].filter(([r]) => Re(o, r)).map(([, r]) => r)
373
373
  )
374
- ].sort((r, o) => r.localeCompare(o));
374
+ ].sort((r, s) => r.localeCompare(s));
375
375
  }
376
- function Nt(e) {
377
- var s;
376
+ function Dt(e) {
377
+ var o;
378
378
  const t = /* @__PURE__ */ new Map();
379
379
  for (const n of e ?? []) {
380
- const r = G(n.path);
380
+ const r = V(n.path);
381
381
  !r || t.has(r) || t.set(r, {
382
- id: qe(r),
382
+ id: Ve(r),
383
383
  name: r,
384
384
  section: "Source routes",
385
- codeName: ((s = n.id) == null ? void 0 : s.trim()) || void 0
385
+ codeName: ((o = n.id) == null ? void 0 : o.trim()) || void 0
386
386
  });
387
387
  }
388
388
  return [...t.values()].sort((n, r) => n.id.localeCompare(r.id));
389
389
  }
390
- function At(e, t, s) {
390
+ function kt(e, t, o) {
391
391
  return (e ?? []).flatMap((n, r) => {
392
- var h, w, y;
393
- const o = (h = n.from) == null ? void 0 : h.trim(), a = (w = n.to) == null ? void 0 : w.trim();
394
- if (!o || !a || n.unresolvedTarget) return [];
395
- const c = s.has(o) ? [o] : ze(o, t), u = s.has(a) ? [a] : ze(a, t);
396
- if (!c.length || !u.length) return [];
397
- const g = ((y = n.id) == null ? void 0 : y.trim()) || `discovery-edge:${r + 1}`;
398
- return c.flatMap(
399
- (I, b) => u.map((A, m) => {
400
- var k, M;
392
+ var g, S, h;
393
+ const s = (g = n.from) == null ? void 0 : g.trim(), i = (S = n.to) == null ? void 0 : S.trim();
394
+ if (!s || !i || n.unresolvedTarget) return [];
395
+ const l = o.has(s) ? [s] : Be(s, t), f = o.has(i) ? [i] : Be(i, t);
396
+ if (!l.length || !f.length) return [];
397
+ const p = ((h = n.id) == null ? void 0 : h.trim()) || `discovery-edge:${r + 1}`;
398
+ return l.flatMap(
399
+ (x, y) => f.map((A, m) => {
400
+ var k, $;
401
401
  return {
402
- id: c.length === 1 && u.length === 1 ? g : `${g}:${b + 1}:${m + 1}`,
403
- from: I,
402
+ id: l.length === 1 && f.length === 1 ? p : `${p}:${y + 1}:${m + 1}`,
403
+ from: x,
404
404
  to: A,
405
405
  kind: ((k = n.kind) == null ? void 0 : k.trim()) || void 0,
406
- label: ((M = n.label) == null ? void 0 : M.trim()) || void 0
406
+ label: (($ = n.label) == null ? void 0 : $.trim()) || void 0
407
407
  };
408
408
  })
409
409
  );
410
410
  });
411
411
  }
412
- function $t(e, t, s) {
413
- const n = G(e.route);
412
+ function Ft(e, t, o) {
413
+ const n = V(e.route);
414
414
  if (!n) return [];
415
415
  const r = t.filter(
416
- (c) => {
417
- const u = G(c.route);
418
- return u ? Pe(u, n) : !1;
416
+ (l) => {
417
+ const f = V(l.route);
418
+ return f ? Re(f, n) : !1;
419
419
  }
420
420
  );
421
421
  if (!r.length) return [];
422
- const o = De(
423
- Le(s, e.environment)
424
- ), a = r.filter(
425
- (c) => De(c.environment) === o
422
+ const s = je(
423
+ Ze(o, e.environment)
424
+ ), i = r.filter(
425
+ (l) => je(l.environment) === s
426
426
  );
427
427
  return [
428
428
  ...new Set(
429
- a.map((c) => {
430
- var u;
431
- return (u = c.scenarioId) == null ? void 0 : u.trim();
432
- }).filter((c) => !!c)
429
+ i.map((l) => {
430
+ var f;
431
+ return (f = l.scenarioId) == null ? void 0 : f.trim();
432
+ }).filter((l) => !!l)
433
433
  )
434
- ].sort((c, u) => c.localeCompare(u));
434
+ ].sort((l, f) => l.localeCompare(f));
435
435
  }
436
- function Ot(e, t) {
437
- const s = e.some((o) => o.importKind != null), n = t.candidates ?? [], r = Ge(t);
436
+ function Tt(e, t) {
437
+ const o = e.some((s) => s.importKind != null), n = t.candidates ?? [], r = We(t);
438
438
  return e.filter(
439
- (o) => s ? o.importKind === "screens" : !!o.route
440
- ).map((o) => ({
441
- id: o.id,
442
- name: o.name,
443
- section: o.section ?? o.canvas ?? "Screens",
444
- componentName: o.componentName,
445
- gallery: o.gallery,
446
- route: o.route,
447
- path: o.path,
448
- publish: o.publish,
449
- width: o.width,
450
- height: o.height,
451
- frameSizeMode: o.frameSizeMode,
452
- heightMode: o.heightMode,
453
- maxHeight: o.maxHeight,
454
- flow: o.flow,
455
- scenario: o.scenario,
456
- state: o.state,
457
- scenarioId: o.scenarioId,
458
- scenarioIds: $t(o, n, r),
459
- interactions: o.interactions,
460
- environment: o.environment,
461
- preset: o.preset,
462
- assertions: o.assertions,
463
- sourcePath: [...o.sourcePaths ?? []].filter(Boolean).sort((a, c) => a.localeCompare(c))[0]
439
+ (s) => o ? s.importKind === "screens" : !!s.route
440
+ ).map((s) => ({
441
+ id: s.id,
442
+ name: s.name,
443
+ section: s.section ?? s.canvas ?? "Screens",
444
+ componentName: s.componentName,
445
+ gallery: s.gallery,
446
+ route: s.route,
447
+ path: s.path,
448
+ publish: s.publish,
449
+ width: s.width,
450
+ height: s.height,
451
+ frameSizeMode: s.frameSizeMode,
452
+ heightMode: s.heightMode,
453
+ maxHeight: s.maxHeight,
454
+ flow: s.flow,
455
+ scenario: s.scenario,
456
+ state: s.state,
457
+ scenarioId: s.scenarioId,
458
+ scenarioIds: Ft(s, n, r),
459
+ interactions: s.interactions,
460
+ environment: s.environment,
461
+ preset: s.preset,
462
+ assertions: s.assertions,
463
+ sourcePath: [...s.sourcePaths ?? []].filter(Boolean).sort((i, l) => i.localeCompare(l))[0]
464
464
  }));
465
465
  }
466
- function pe(e, t) {
467
- var c, u, g, h;
468
- const s = (((c = e.interactions) == null ? void 0 : c.length) ?? 0) - (((u = t.interactions) == null ? void 0 : u.length) ?? 0);
469
- if (s !== 0) return s;
470
- const n = (g = e.scenarioIds) != null && g.includes("environment:baseline") ? 0 : 1, r = (h = t.scenarioIds) != null && h.includes("environment:baseline") ? 0 : 1;
466
+ function we(e, t) {
467
+ var l, f, p, g;
468
+ const o = (((l = e.interactions) == null ? void 0 : l.length) ?? 0) - (((f = t.interactions) == null ? void 0 : f.length) ?? 0);
469
+ if (o !== 0) return o;
470
+ const n = (p = e.scenarioIds) != null && p.includes("environment:baseline") ? 0 : 1, r = (g = t.scenarioIds) != null && g.includes("environment:baseline") ? 0 : 1;
471
471
  if (n !== r) return n - r;
472
- const o = !e.environment && !e.preset ? 0 : 1, a = !t.environment && !t.preset ? 0 : 1;
473
- return o !== a ? o - a : e.id.localeCompare(t.id);
472
+ const s = !e.environment && !e.preset ? 0 : 1, i = !t.environment && !t.preset ? 0 : 1;
473
+ return s !== i ? s - i : e.id.localeCompare(t.id);
474
474
  }
475
- function Mt(e) {
475
+ function zt(e) {
476
476
  const t = /* @__PURE__ */ new Map();
477
- for (const s of e) {
478
- const n = G(s.route);
477
+ for (const o of e) {
478
+ const n = V(o.route);
479
479
  if (!n) continue;
480
480
  const r = t.get(n);
481
- r ? r.push(s) : t.set(n, [s]);
481
+ r ? r.push(o) : t.set(n, [o]);
482
482
  }
483
483
  return new Map(
484
- [...t.entries()].map(([s, n]) => {
485
- const r = [...n].sort(pe);
486
- return [s, r[0].id];
484
+ [...t.entries()].map(([o, n]) => {
485
+ const r = [...n].sort(we);
486
+ return [o, r[0].id];
487
487
  })
488
488
  );
489
489
  }
490
- function kt(e) {
490
+ function _t(e) {
491
491
  return e.action === "wait" ? null : JSON.stringify(
492
- ue({
492
+ me({
493
493
  action: e.action,
494
494
  selector: e.selector,
495
495
  text: e.text,
@@ -503,266 +503,266 @@ function kt(e) {
503
503
  })
504
504
  );
505
505
  }
506
- function Ke(e) {
507
- return (e.interactions ?? []).map(kt).filter((t) => t != null);
506
+ function Je(e) {
507
+ return (e.interactions ?? []).map(_t).filter((t) => t != null);
508
508
  }
509
- function Ft(e, t) {
510
- return e.length < t.length && e.every((s, n) => s === t[n]);
509
+ function jt(e, t) {
510
+ return e.length < t.length && e.every((o, n) => o === t[n]);
511
511
  }
512
- function Tt(e, t) {
513
- const s = /* @__PURE__ */ new Map();
512
+ function Bt(e, t) {
513
+ const o = /* @__PURE__ */ new Map();
514
514
  for (const n of e) {
515
- const r = G(n.route);
515
+ const r = V(n.route);
516
516
  if (!r) continue;
517
- const o = `${r}\0${Ke(n).join("")}`, a = s.get(o);
518
- a ? a.push(n) : s.set(o, [n]);
517
+ const s = `${r}\0${Je(n).join("")}`, i = o.get(s);
518
+ i ? i.push(n) : o.set(s, [n]);
519
519
  }
520
- return [...s.values()].flatMap((n) => {
520
+ return [...o.values()].flatMap((n) => {
521
521
  if (n.length < 2) return [];
522
- const r = G(n[0].route), o = t.get(r), a = n.find((c) => c.id === o) ?? [...n].sort(pe)[0];
523
- return n.filter((c) => c.id !== a.id).sort((c, u) => c.id.localeCompare(u.id)).map((c) => ({
524
- id: `discovery-variant:${encodeURIComponent(a.id)}:${encodeURIComponent(c.id)}`,
525
- from: a.id,
526
- to: c.id,
522
+ const r = V(n[0].route), s = t.get(r), i = n.find((l) => l.id === s) ?? [...n].sort(we)[0];
523
+ return n.filter((l) => l.id !== i.id).sort((l, f) => l.id.localeCompare(f.id)).map((l) => ({
524
+ id: `discovery-variant:${encodeURIComponent(i.id)}:${encodeURIComponent(l.id)}`,
525
+ from: i.id,
526
+ to: l.id,
527
527
  kind: "variant"
528
528
  }));
529
529
  });
530
530
  }
531
- function Dt(e, t) {
532
- const s = /* @__PURE__ */ new Map();
531
+ function Ut(e, t) {
532
+ const o = /* @__PURE__ */ new Map();
533
533
  for (const n of e) {
534
- const r = G(n.route);
534
+ const r = V(n.route);
535
535
  if (!r) continue;
536
- const o = s.get(r);
537
- o ? o.push(n) : s.set(r, [n]);
536
+ const s = o.get(r);
537
+ s ? s.push(n) : o.set(r, [n]);
538
538
  }
539
- return [...s.entries()].flatMap(([n, r]) => {
540
- const o = new Map(
541
- r.map((u) => [u.id, Ke(u)])
542
- ), a = t.get(n), c = r.find(
543
- (u) => u.id === a
539
+ return [...o.entries()].flatMap(([n, r]) => {
540
+ const s = new Map(
541
+ r.map((f) => [f.id, Je(f)])
542
+ ), i = t.get(n), l = r.find(
543
+ (f) => f.id === i
544
544
  );
545
- return r.flatMap((u) => {
546
- const g = o.get(u.id);
547
- if (!g.length) return [];
548
- const w = r.filter(
549
- (y) => Ft(
550
- o.get(y.id),
551
- g
545
+ return r.flatMap((f) => {
546
+ const p = s.get(f.id);
547
+ if (!p.length) return [];
548
+ const S = r.filter(
549
+ (h) => jt(
550
+ s.get(h.id),
551
+ p
552
552
  )
553
- ).sort((y, I) => {
554
- const b = o.get(I.id).length - o.get(y.id).length;
555
- if (b !== 0) return b;
556
- const A = y.flow && y.flow === u.flow ? 0 : 1, m = I.flow && I.flow === u.flow ? 0 : 1;
553
+ ).sort((h, x) => {
554
+ const y = s.get(x.id).length - s.get(h.id).length;
555
+ if (y !== 0) return y;
556
+ const A = h.flow && h.flow === f.flow ? 0 : 1, m = x.flow && x.flow === f.flow ? 0 : 1;
557
557
  if (A !== m) return A - m;
558
- const k = y.section && y.section === u.section ? 0 : 1, M = I.section && I.section === u.section ? 0 : 1;
559
- if (k !== M) return k - M;
560
- const D = y.id === a ? 0 : 1, z = I.id === a ? 0 : 1;
561
- return D !== z ? D - z : pe(y, I);
558
+ const k = h.section && h.section === f.section ? 0 : 1, $ = x.section && x.section === f.section ? 0 : 1;
559
+ if (k !== $) return k - $;
560
+ const F = h.id === i ? 0 : 1, T = x.id === i ? 0 : 1;
561
+ return F !== T ? F - T : we(h, x);
562
562
  })[0];
563
- return w ? [
563
+ return S ? [
564
564
  {
565
- id: `discovery-recipe:${encodeURIComponent(w.id)}:${encodeURIComponent(u.id)}`,
566
- from: w.id,
567
- to: u.id,
565
+ id: `discovery-recipe:${encodeURIComponent(S.id)}:${encodeURIComponent(f.id)}`,
566
+ from: S.id,
567
+ to: f.id,
568
568
  kind: "recipe-step"
569
569
  }
570
- ] : c && c.id !== u.id && o.get(c.id).join("") !== g.join("") ? [
570
+ ] : l && l.id !== f.id && s.get(l.id).join("") !== p.join("") ? [
571
571
  {
572
- id: `discovery-route-case:${encodeURIComponent(c.id)}:${encodeURIComponent(u.id)}`,
573
- from: c.id,
574
- to: u.id,
572
+ id: `discovery-route-case:${encodeURIComponent(l.id)}:${encodeURIComponent(f.id)}`,
573
+ from: l.id,
574
+ to: f.id,
575
575
  kind: "route-case"
576
576
  }
577
577
  ] : [];
578
578
  });
579
579
  });
580
580
  }
581
- function zt(e) {
582
- var s;
581
+ function Ht(e) {
582
+ var o;
583
583
  const t = /* @__PURE__ */ new Map();
584
584
  for (const n of e) {
585
- const r = (s = n.flow) == null ? void 0 : s.trim();
585
+ const r = (o = n.flow) == null ? void 0 : o.trim();
586
586
  if (!r) continue;
587
- const o = t.get(r);
588
- o ? o.push(n) : t.set(r, [n]);
587
+ const s = t.get(r);
588
+ s ? s.push(n) : t.set(r, [n]);
589
589
  }
590
590
  return [...t.values()].flatMap((n) => {
591
- const r = n[0], o = /* @__PURE__ */ new Map();
592
- for (const a of n) {
593
- const c = G(a.route);
594
- if (!c) continue;
595
- const u = o.get(c);
596
- u ? u.push(a) : o.set(c, [a]);
591
+ const r = n[0], s = /* @__PURE__ */ new Map();
592
+ for (const i of n) {
593
+ const l = V(i.route);
594
+ if (!l) continue;
595
+ const f = s.get(l);
596
+ f ? f.push(i) : s.set(l, [i]);
597
597
  }
598
- return o.size < 2 ? [] : [...o.values()].flatMap((a) => {
599
- const c = [...a].sort(
600
- pe
598
+ return s.size < 2 ? [] : [...s.values()].flatMap((i) => {
599
+ const l = [...i].sort(
600
+ we
601
601
  )[0];
602
- return c.id === r.id ? [] : [
602
+ return l.id === r.id ? [] : [
603
603
  {
604
- id: `discovery-flow-route:${encodeURIComponent(r.id)}:${encodeURIComponent(c.id)}`,
604
+ id: `discovery-flow-route:${encodeURIComponent(r.id)}:${encodeURIComponent(l.id)}`,
605
605
  from: r.id,
606
- to: c.id,
606
+ to: l.id,
607
607
  kind: "flow-route"
608
608
  }
609
609
  ];
610
610
  });
611
611
  });
612
612
  }
613
- function jt(e, t, s) {
613
+ function qt(e, t, o) {
614
614
  const n = new Set(
615
- (t.routes ?? []).map((r) => G(r.path)).filter((r) => !!r)
615
+ (t.routes ?? []).map((r) => V(r.path)).filter((r) => !!r)
616
616
  );
617
617
  return e.map((r) => {
618
- const o = G(r.route);
619
- if (!o || s.get(o) !== r.id)
618
+ const s = V(r.route);
619
+ if (!s || o.get(s) !== r.id)
620
620
  return r;
621
- const a = [...n].filter(
622
- (c) => Pe(c, o)
621
+ const i = [...n].filter(
622
+ (l) => Re(l, s)
623
623
  );
624
- return a.length ? {
624
+ return i.length ? {
625
625
  ...r,
626
626
  scenarioIds: [
627
627
  .../* @__PURE__ */ new Set([
628
628
  ...r.scenarioIds ?? [],
629
- ...a.map(qe)
629
+ ...i.map(Ve)
630
630
  ])
631
- ].sort((c, u) => c.localeCompare(u))
631
+ ].sort((l, f) => l.localeCompare(f))
632
632
  } : r;
633
633
  });
634
634
  }
635
- function _t(e, t) {
636
- var g, h, w, y, I;
637
- const s = new Set(e.map((b) => b.id)), n = new Map(
638
- e.map((b, A) => [b.id, A])
639
- ), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
640
- for (const b of s)
641
- r.set(b, /* @__PURE__ */ new Set()), o.set(b, /* @__PURE__ */ new Set()), a.set(b, /* @__PURE__ */ new Set());
642
- for (const b of t)
643
- !s.has(b.from) || !s.has(b.to) || ((g = r.get(b.to)) == null || g.add(b.from), (h = o.get(b.from)) == null || h.add(b.to), (w = a.get(b.from)) == null || w.add(b.to), (y = a.get(b.to)) == null || y.add(b.from));
644
- const c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
645
- for (const b of s) {
646
- if (u.has(b)) continue;
647
- const A = [], m = [b];
635
+ function Gt(e, t) {
636
+ var p, g, S, h, x;
637
+ const o = new Set(e.map((y) => y.id)), n = new Map(
638
+ e.map((y, A) => [y.id, A])
639
+ ), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
640
+ for (const y of o)
641
+ r.set(y, /* @__PURE__ */ new Set()), s.set(y, /* @__PURE__ */ new Set()), i.set(y, /* @__PURE__ */ new Set());
642
+ for (const y of t)
643
+ !o.has(y.from) || !o.has(y.to) || ((p = r.get(y.to)) == null || p.add(y.from), (g = s.get(y.from)) == null || g.add(y.to), (S = i.get(y.from)) == null || S.add(y.to), (h = i.get(y.to)) == null || h.add(y.from));
644
+ const l = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set();
645
+ for (const y of o) {
646
+ if (f.has(y)) continue;
647
+ const A = [], m = [y];
648
648
  for (; m.length; ) {
649
- const S = m.shift();
650
- if (!u.has(S)) {
651
- u.add(S), A.push(S);
652
- for (const R of a.get(S) ?? [])
653
- u.has(R) || m.push(R);
649
+ const v = m.shift();
650
+ if (!f.has(v)) {
651
+ f.add(v), A.push(v);
652
+ for (const E of i.get(v) ?? [])
653
+ f.has(E) || m.push(E);
654
654
  }
655
655
  }
656
- if (A.length === 1 && (((I = a.get(A[0])) == null ? void 0 : I.size) ?? 0) === 0)
656
+ if (A.length === 1 && (((x = i.get(A[0])) == null ? void 0 : x.size) ?? 0) === 0)
657
657
  continue;
658
- const k = A.filter((S) => {
659
- var R;
660
- return (((R = r.get(S)) == null ? void 0 : R.size) ?? 0) === 0;
658
+ const k = A.filter((v) => {
659
+ var E;
660
+ return (((E = r.get(v)) == null ? void 0 : E.size) ?? 0) === 0;
661
661
  }).sort(
662
- (S, R) => (n.get(S) ?? Number.MAX_SAFE_INTEGER) - (n.get(R) ?? Number.MAX_SAFE_INTEGER) || S.localeCompare(R)
663
- ), M = [...A].sort(
664
- (S, R) => (n.get(S) ?? Number.MAX_SAFE_INTEGER) - (n.get(R) ?? Number.MAX_SAFE_INTEGER) || S.localeCompare(R)
662
+ (v, E) => (n.get(v) ?? Number.MAX_SAFE_INTEGER) - (n.get(E) ?? Number.MAX_SAFE_INTEGER) || v.localeCompare(E)
663
+ ), $ = [...A].sort(
664
+ (v, E) => (n.get(v) ?? Number.MAX_SAFE_INTEGER) - (n.get(E) ?? Number.MAX_SAFE_INTEGER) || v.localeCompare(E)
665
665
  )[0];
666
- if (!M) continue;
667
- const D = [M], z = /* @__PURE__ */ new Set(), j = (S) => {
668
- const R = [S];
669
- for (; R.length; ) {
670
- const T = R.shift();
671
- if (!z.has(T)) {
672
- z.add(T);
673
- for (const H of o.get(T) ?? [])
674
- z.has(H) || R.push(H);
666
+ if (!$) continue;
667
+ const F = [$], T = /* @__PURE__ */ new Set(), j = (v) => {
668
+ const E = [v];
669
+ for (; E.length; ) {
670
+ const M = E.shift();
671
+ if (!T.has(M)) {
672
+ T.add(M);
673
+ for (const B of s.get(M) ?? [])
674
+ T.has(B) || E.push(B);
675
675
  }
676
676
  }
677
677
  };
678
- j(M);
679
- for (const S of k)
680
- z.has(S) || (D.push(S), j(S));
681
- for (const S of D)
682
- c.add(S);
678
+ j($);
679
+ for (const v of k)
680
+ T.has(v) || (F.push(v), j(v));
681
+ for (const v of F)
682
+ l.add(v);
683
683
  }
684
- return [...c].sort(
685
- (b, A) => (n.get(b) ?? Number.MAX_SAFE_INTEGER) - (n.get(A) ?? Number.MAX_SAFE_INTEGER) || b.localeCompare(A)
684
+ return [...l].sort(
685
+ (y, A) => (n.get(y) ?? Number.MAX_SAFE_INTEGER) - (n.get(A) ?? Number.MAX_SAFE_INTEGER) || y.localeCompare(A)
686
686
  );
687
687
  }
688
- function Ge(e) {
689
- var t, s;
690
- return Ct(
691
- (s = (t = e.scenarios) == null ? void 0 : t.find(
688
+ function We(e) {
689
+ var t, o;
690
+ return $t(
691
+ (o = (t = e.scenarios) == null ? void 0 : t.find(
692
692
  (n) => n.id === "environment:baseline"
693
- )) == null ? void 0 : s.environment
693
+ )) == null ? void 0 : o.environment
694
694
  );
695
695
  }
696
- function Bt(e) {
697
- const t = Ot(
696
+ function Kt(e) {
697
+ const t = Tt(
698
698
  e.pages,
699
699
  e.manifest
700
- ), s = Mt(t), n = jt(
700
+ ), o = zt(t), n = qt(
701
701
  t,
702
702
  e.manifest,
703
- s
704
- ), o = [
705
- ...At(
703
+ o
704
+ ), s = [
705
+ ...kt(
706
706
  e.manifest.edges,
707
- s,
708
- new Set(n.map((a) => a.id))
707
+ o,
708
+ new Set(n.map((i) => i.id))
709
709
  ),
710
- ...Tt(n, s),
711
- ...Dt(n, s),
712
- ...zt(n)
710
+ ...Bt(n, o),
711
+ ...Ut(n, o),
712
+ ...Ht(n)
713
713
  ];
714
- return Et({
714
+ return Ot({
715
715
  screens: n,
716
716
  assets: e.assets,
717
- scenarios: Nt(e.manifest.routes),
718
- inferredEdges: o,
719
- startScreenIds: _t(n, o)
717
+ scenarios: Dt(e.manifest.routes),
718
+ inferredEdges: s,
719
+ startScreenIds: Gt(n, s)
720
720
  });
721
721
  }
722
- async function Je(e) {
723
- const s = await (e.fetcher ?? ((r, o) => fetch(r, o)))(e.endpoint, {
722
+ async function Le(e) {
723
+ const o = await (e.fetcher ?? ((r, s) => fetch(r, s)))(e.endpoint, {
724
724
  headers: { accept: "application/json" },
725
725
  cache: "no-store",
726
726
  signal: e.signal
727
727
  });
728
- if (!s.ok)
729
- throw new Error(`Storyboard discovery failed (${s.status})`);
730
- const n = await s.json();
731
- if (!Rt(n))
728
+ if (!o.ok)
729
+ throw new Error(`Storyboard discovery failed (${o.status})`);
730
+ const n = await o.json();
731
+ if (!Mt(n))
732
732
  throw new Error("Storyboard discovery returned an invalid manifest.");
733
733
  return {
734
734
  manifest: n,
735
- baselineEnvironment: Ge(n),
736
- graph: Bt({
735
+ baselineEnvironment: We(n),
736
+ graph: Kt({
737
737
  manifest: n,
738
738
  pages: e.pages,
739
739
  assets: e.assets
740
740
  })
741
741
  };
742
742
  }
743
- async function an(e) {
744
- ee(null);
743
+ async function fn(e) {
744
+ ne(null);
745
745
  try {
746
- const t = await Je(e);
747
- return ee(t.graph), t;
746
+ const t = await Le(e);
747
+ return ne(t.graph), t;
748
748
  } catch (t) {
749
- throw ee(null), t;
749
+ throw ne(null), t;
750
750
  }
751
751
  }
752
- const fe = "var(--pygmalion-catalog-surface, #ffffff)", he = "var(--pygmalion-catalog-canvas, #f5f5f5)", Ie = "var(--pygmalion-catalog-border, #e5e7eb)", me = "var(--pygmalion-catalog-text, #202124)", U = "var(--pygmalion-catalog-muted, #6b7280)", Ut = "var(--pygmalion-catalog-header, #11182f)", Ht = "var(--pygmalion-catalog-accent, #7c6cf2)";
753
- function cn({
752
+ const pe = "var(--pygmalion-catalog-surface, #ffffff)", he = "var(--pygmalion-catalog-canvas, #f5f5f5)", Ee = "var(--pygmalion-catalog-border, #e5e7eb)", ye = "var(--pygmalion-catalog-text, #202124)", U = "var(--pygmalion-catalog-muted, #6b7280)", Vt = "var(--pygmalion-catalog-header, #11182f)", Jt = "var(--pygmalion-catalog-accent, #7c6cf2)";
753
+ function gn({
754
754
  title: e,
755
755
  eyebrow: t,
756
- description: s,
756
+ description: o,
757
757
  version: n,
758
758
  meta: r,
759
- children: o,
760
- headerBackground: a = Ut,
761
- headerColor: c = "#ffffff",
762
- bodyBackground: u = fe,
763
- bodyGap: g = 40
759
+ children: s,
760
+ headerBackground: i = Vt,
761
+ headerColor: l = "#ffffff",
762
+ bodyBackground: f = pe,
763
+ bodyGap: p = 40
764
764
  }) {
765
- return /* @__PURE__ */ $(
765
+ return /* @__PURE__ */ N(
766
766
  "section",
767
767
  {
768
768
  "data-pygmalion-catalog-document": "",
@@ -774,12 +774,12 @@ function cn({
774
774
  maxWidth: "none",
775
775
  flexDirection: "column",
776
776
  overflow: "visible",
777
- color: me,
778
- background: u,
777
+ color: ye,
778
+ background: f,
779
779
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
780
780
  },
781
781
  children: [
782
- /* @__PURE__ */ $(
782
+ /* @__PURE__ */ N(
783
783
  "header",
784
784
  {
785
785
  style: {
@@ -789,12 +789,12 @@ function cn({
789
789
  justifyContent: "space-between",
790
790
  gap: 48,
791
791
  padding: "44px 48px 48px",
792
- color: c,
793
- background: a
792
+ color: l,
793
+ background: i
794
794
  },
795
795
  children: [
796
- /* @__PURE__ */ $("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
797
- t ? /* @__PURE__ */ v(
796
+ /* @__PURE__ */ N("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
797
+ t ? /* @__PURE__ */ b(
798
798
  "div",
799
799
  {
800
800
  style: {
@@ -807,7 +807,7 @@ function cn({
807
807
  children: t
808
808
  }
809
809
  ) : null,
810
- /* @__PURE__ */ v(
810
+ /* @__PURE__ */ b(
811
811
  "h1",
812
812
  {
813
813
  style: {
@@ -821,7 +821,7 @@ function cn({
821
821
  children: e
822
822
  }
823
823
  ),
824
- s ? /* @__PURE__ */ v(
824
+ o ? /* @__PURE__ */ b(
825
825
  "div",
826
826
  {
827
827
  style: {
@@ -830,11 +830,11 @@ function cn({
830
830
  fontSize: 13,
831
831
  lineHeight: 1.55
832
832
  },
833
- children: s
833
+ children: o
834
834
  }
835
835
  ) : null
836
836
  ] }),
837
- n || r ? /* @__PURE__ */ $(
837
+ n || r ? /* @__PURE__ */ N(
838
838
  "div",
839
839
  {
840
840
  style: {
@@ -846,15 +846,15 @@ function cn({
846
846
  whiteSpace: "nowrap"
847
847
  },
848
848
  children: [
849
- n ? /* @__PURE__ */ v("span", { children: n }) : null,
850
- r ? /* @__PURE__ */ v("span", { children: r }) : null
849
+ n ? /* @__PURE__ */ b("span", { children: n }) : null,
850
+ r ? /* @__PURE__ */ b("span", { children: r }) : null
851
851
  ]
852
852
  }
853
853
  ) : null
854
854
  ]
855
855
  }
856
856
  ),
857
- /* @__PURE__ */ v(
857
+ /* @__PURE__ */ b(
858
858
  "div",
859
859
  {
860
860
  "data-pygmalion-catalog-document-body": "",
@@ -863,26 +863,26 @@ function cn({
863
863
  display: "inline-flex",
864
864
  flexDirection: "column",
865
865
  alignItems: "flex-start",
866
- gap: g,
866
+ gap: p,
867
867
  padding: 48,
868
- background: u
868
+ background: f
869
869
  },
870
- children: o
870
+ children: s
871
871
  }
872
872
  )
873
873
  ]
874
874
  }
875
875
  );
876
876
  }
877
- function ln({
877
+ function mn({
878
878
  title: e,
879
879
  itemId: t,
880
- count: s,
880
+ count: o,
881
881
  description: n,
882
882
  children: r,
883
- tone: o = "tinted"
883
+ tone: s = "tinted"
884
884
  }) {
885
- return /* @__PURE__ */ $(
885
+ return /* @__PURE__ */ N(
886
886
  "section",
887
887
  {
888
888
  "data-pygmalion-catalog-section": "",
@@ -894,12 +894,12 @@ function ln({
894
894
  flexDirection: "column",
895
895
  alignItems: "flex-start",
896
896
  gap: 18,
897
- padding: o === "tinted" ? 24 : 0,
898
- background: o === "tinted" ? he : "transparent"
897
+ padding: s === "tinted" ? 24 : 0,
898
+ background: s === "tinted" ? he : "transparent"
899
899
  },
900
900
  children: [
901
- /* @__PURE__ */ $("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
902
- /* @__PURE__ */ v(
901
+ /* @__PURE__ */ N("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
902
+ /* @__PURE__ */ b(
903
903
  "h2",
904
904
  {
905
905
  style: {
@@ -911,25 +911,25 @@ function ln({
911
911
  children: e
912
912
  }
913
913
  ),
914
- typeof s == "number" ? /* @__PURE__ */ v("span", { style: { color: U, fontSize: 11 }, children: s }) : null
914
+ typeof o == "number" ? /* @__PURE__ */ b("span", { style: { color: U, fontSize: 11 }, children: o }) : null
915
915
  ] }),
916
- n ? /* @__PURE__ */ v("div", { style: { marginTop: -10, color: U, fontSize: 11 }, children: n }) : null,
916
+ n ? /* @__PURE__ */ b("div", { style: { marginTop: -10, color: U, fontSize: 11 }, children: n }) : null,
917
917
  r
918
918
  ]
919
919
  }
920
920
  );
921
921
  }
922
- function dn({
922
+ function pn({
923
923
  rows: e,
924
924
  columns: t,
925
- cornerLabel: s,
925
+ cornerLabel: o,
926
926
  renderCell: n,
927
- renderRowLabel: r = (u) => u,
928
- renderColumnLabel: o = (u) => u,
929
- boundary: a = !0,
930
- cellStyle: c
927
+ renderRowLabel: r = (f) => f,
928
+ renderColumnLabel: s = (f) => f,
929
+ boundary: i = !0,
930
+ cellStyle: l
931
931
  }) {
932
- return /* @__PURE__ */ v(
932
+ return /* @__PURE__ */ b(
933
933
  "div",
934
934
  {
935
935
  "data-pygmalion-catalog-matrix": "",
@@ -937,11 +937,11 @@ function dn({
937
937
  boxSizing: "border-box",
938
938
  display: "inline-block",
939
939
  width: "max-content",
940
- padding: a ? 16 : 0,
941
- border: a ? `1px dashed ${Ht}` : void 0,
942
- borderRadius: a ? 4 : void 0
940
+ padding: i ? 16 : 0,
941
+ border: i ? `1px dashed ${Jt}` : void 0,
942
+ borderRadius: i ? 4 : void 0
943
943
  },
944
- children: /* @__PURE__ */ $(
944
+ children: /* @__PURE__ */ N(
945
945
  "table",
946
946
  {
947
947
  style: {
@@ -950,8 +950,8 @@ function dn({
950
950
  borderSpacing: 0
951
951
  },
952
952
  children: [
953
- /* @__PURE__ */ v("thead", { children: /* @__PURE__ */ $("tr", { children: [
954
- /* @__PURE__ */ v(
953
+ /* @__PURE__ */ b("thead", { children: /* @__PURE__ */ N("tr", { children: [
954
+ /* @__PURE__ */ b(
955
955
  "th",
956
956
  {
957
957
  style: {
@@ -962,10 +962,10 @@ function dn({
962
962
  textAlign: "left",
963
963
  whiteSpace: "nowrap"
964
964
  },
965
- children: s
965
+ children: o
966
966
  }
967
967
  ),
968
- t.map((u) => /* @__PURE__ */ v(
968
+ t.map((f) => /* @__PURE__ */ b(
969
969
  "th",
970
970
  {
971
971
  style: {
@@ -976,13 +976,13 @@ function dn({
976
976
  textAlign: "center",
977
977
  whiteSpace: "nowrap"
978
978
  },
979
- children: o(u)
979
+ children: s(f)
980
980
  },
981
- u
981
+ f
982
982
  ))
983
983
  ] }) }),
984
- /* @__PURE__ */ v("tbody", { children: e.map((u) => /* @__PURE__ */ $("tr", { children: [
985
- /* @__PURE__ */ v(
984
+ /* @__PURE__ */ b("tbody", { children: e.map((f) => /* @__PURE__ */ N("tr", { children: [
985
+ /* @__PURE__ */ b(
986
986
  "th",
987
987
  {
988
988
  style: {
@@ -993,37 +993,37 @@ function dn({
993
993
  textAlign: "left",
994
994
  whiteSpace: "nowrap"
995
995
  },
996
- children: r(u)
996
+ children: r(f)
997
997
  }
998
998
  ),
999
- t.map((g) => /* @__PURE__ */ v(
999
+ t.map((p) => /* @__PURE__ */ b(
1000
1000
  "td",
1001
1001
  {
1002
1002
  style: {
1003
1003
  padding: "12px 16px",
1004
1004
  textAlign: "center",
1005
1005
  verticalAlign: "middle",
1006
- ...c
1006
+ ...l
1007
1007
  },
1008
- children: n(u, g)
1008
+ children: n(f, p)
1009
1009
  },
1010
- g
1010
+ p
1011
1011
  ))
1012
- ] }, u)) })
1012
+ ] }, f)) })
1013
1013
  ]
1014
1014
  }
1015
1015
  )
1016
1016
  }
1017
1017
  );
1018
1018
  }
1019
- function qt(e) {
1019
+ function Wt(e) {
1020
1020
  return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
1021
1021
  }
1022
- function Ve(e, t, s = "PygmalionCatalog") {
1023
- const n = (r) => qt(r).replace(/-/g, "_");
1024
- return `${s}_${n(e)}_${n(t)}`;
1022
+ function Qe(e, t, o = "PygmalionCatalog") {
1023
+ const n = (r) => Wt(r).replace(/-/g, "_");
1024
+ return `${o}_${n(e)}_${n(t)}`;
1025
1025
  }
1026
- function We(e, t) {
1026
+ function Xe(e, t) {
1027
1027
  return {
1028
1028
  id: e.id,
1029
1029
  name: e.name,
@@ -1034,25 +1034,25 @@ function We(e, t) {
1034
1034
  description: e.description
1035
1035
  };
1036
1036
  }
1037
- function Qe(e) {
1037
+ function Ye(e) {
1038
1038
  const t = /* @__PURE__ */ new Set();
1039
- for (const s of e) {
1040
- if (t.has(s.id))
1041
- throw new Error(`Duplicate design catalog item id: ${s.id}`);
1042
- t.add(s.id);
1039
+ for (const o of e) {
1040
+ if (t.has(o.id))
1041
+ throw new Error(`Duplicate design catalog item id: ${o.id}`);
1042
+ t.add(o.id);
1043
1043
  }
1044
1044
  }
1045
- function Kt(e, t, s) {
1046
- return typeof e == "function" ? e(t, s) : e;
1045
+ function Lt(e, t, o) {
1046
+ return typeof e == "function" ? e(t, o) : e;
1047
1047
  }
1048
- function Gt({
1048
+ function Qt({
1049
1049
  page: e,
1050
1050
  items: t,
1051
- renderPreview: s,
1051
+ renderPreview: o,
1052
1052
  secondaryLabel: n,
1053
1053
  minimumColumnWidth: r
1054
1054
  }) {
1055
- return /* @__PURE__ */ $(
1055
+ return /* @__PURE__ */ N(
1056
1056
  "section",
1057
1057
  {
1058
1058
  "data-pygmalion-catalog-page": e.id,
@@ -1062,19 +1062,19 @@ function Gt({
1062
1062
  display: "inline-block",
1063
1063
  width: "max-content",
1064
1064
  padding: 32,
1065
- color: me,
1065
+ color: ye,
1066
1066
  background: he,
1067
1067
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
1068
1068
  },
1069
1069
  children: [
1070
- /* @__PURE__ */ $("header", { style: { marginBottom: 24 }, children: [
1071
- /* @__PURE__ */ v("h1", { style: { margin: 0, fontSize: 24, lineHeight: 1.35 }, children: e.name }),
1072
- /* @__PURE__ */ $("p", { style: { margin: "6px 0 0", color: U, fontSize: 13 }, children: [
1070
+ /* @__PURE__ */ N("header", { style: { marginBottom: 24 }, children: [
1071
+ /* @__PURE__ */ b("h1", { style: { margin: 0, fontSize: 24, lineHeight: 1.35 }, children: e.name }),
1072
+ /* @__PURE__ */ N("p", { style: { margin: "6px 0 0", color: U, fontSize: 13 }, children: [
1073
1073
  t.length,
1074
1074
  " assets"
1075
1075
  ] })
1076
1076
  ] }),
1077
- /* @__PURE__ */ v(
1077
+ /* @__PURE__ */ b(
1078
1078
  "div",
1079
1079
  {
1080
1080
  style: {
@@ -1082,20 +1082,20 @@ function Gt({
1082
1082
  gridTemplateColumns: "repeat(6, max-content)",
1083
1083
  gap: 16
1084
1084
  },
1085
- children: t.map((o) => /* @__PURE__ */ $(
1085
+ children: t.map((s) => /* @__PURE__ */ N(
1086
1086
  "article",
1087
1087
  {
1088
- "data-pygmalion-catalog-item": o.id,
1088
+ "data-pygmalion-catalog-item": s.id,
1089
1089
  style: {
1090
1090
  minWidth: r,
1091
1091
  width: r,
1092
1092
  padding: 16,
1093
- border: `1px solid ${Ie}`,
1093
+ border: `1px solid ${Ee}`,
1094
1094
  borderRadius: 12,
1095
- background: fe
1095
+ background: pe
1096
1096
  },
1097
1097
  children: [
1098
- /* @__PURE__ */ v(
1098
+ /* @__PURE__ */ b(
1099
1099
  "div",
1100
1100
  {
1101
1101
  style: {
@@ -1105,10 +1105,10 @@ function Gt({
1105
1105
  justifyContent: "center",
1106
1106
  overflow: "hidden"
1107
1107
  },
1108
- children: s(o)
1108
+ children: o(s)
1109
1109
  }
1110
1110
  ),
1111
- /* @__PURE__ */ v(
1111
+ /* @__PURE__ */ b(
1112
1112
  "div",
1113
1113
  {
1114
1114
  style: {
@@ -1119,11 +1119,11 @@ function Gt({
1119
1119
  textOverflow: "ellipsis",
1120
1120
  whiteSpace: "nowrap"
1121
1121
  },
1122
- title: o.name,
1123
- children: o.name
1122
+ title: s.name,
1123
+ children: s.name
1124
1124
  }
1125
1125
  ),
1126
- n ? /* @__PURE__ */ v("div", { style: { marginTop: 4, color: U, fontSize: 11, lineHeight: 1.45 }, children: n(o) }) : o.codeName ? /* @__PURE__ */ v(
1126
+ n ? /* @__PURE__ */ b("div", { style: { marginTop: 4, color: U, fontSize: 11, lineHeight: 1.45 }, children: n(s) }) : s.codeName ? /* @__PURE__ */ b(
1127
1127
  "div",
1128
1128
  {
1129
1129
  style: {
@@ -1135,13 +1135,13 @@ function Gt({
1135
1135
  textOverflow: "ellipsis",
1136
1136
  whiteSpace: "nowrap"
1137
1137
  },
1138
- title: o.codeName,
1139
- children: o.codeName
1138
+ title: s.codeName,
1139
+ children: s.codeName
1140
1140
  }
1141
1141
  ) : null
1142
1142
  ]
1143
1143
  },
1144
- o.id
1144
+ s.id
1145
1145
  ))
1146
1146
  }
1147
1147
  )
@@ -1149,31 +1149,31 @@ function Gt({
1149
1149
  }
1150
1150
  );
1151
1151
  }
1152
- function un(e) {
1153
- Qe(e.items);
1152
+ function hn(e) {
1153
+ Ye(e.items);
1154
1154
  const t = /* @__PURE__ */ new Map();
1155
1155
  for (const r of e.items) {
1156
- const o = e.pageFor(r), a = t.get(o.id);
1157
- if (a) {
1158
- if (a.page.name !== o.name || a.page.section !== o.section)
1159
- throw new Error(`Conflicting design catalog page descriptor: ${o.id}`);
1160
- a.items.push(r);
1156
+ const s = e.pageFor(r), i = t.get(s.id);
1157
+ if (i) {
1158
+ if (i.page.name !== s.name || i.page.section !== s.section)
1159
+ throw new Error(`Conflicting design catalog page descriptor: ${s.id}`);
1160
+ i.items.push(r);
1161
1161
  continue;
1162
1162
  }
1163
- t.set(o.id, {
1164
- page: o,
1163
+ t.set(s.id, {
1164
+ page: s,
1165
1165
  items: [r],
1166
- registryName: Ve(
1166
+ registryName: Qe(
1167
1167
  e.kind,
1168
- o.id,
1168
+ s.id,
1169
1169
  e.registryPrefix
1170
1170
  )
1171
1171
  });
1172
1172
  }
1173
- const s = {}, n = [];
1173
+ const o = {}, n = [];
1174
1174
  for (const r of t.values()) {
1175
- const o = () => /* @__PURE__ */ v(
1176
- Gt,
1175
+ const s = () => /* @__PURE__ */ b(
1176
+ Qt,
1177
1177
  {
1178
1178
  page: r.page,
1179
1179
  items: r.items,
@@ -1182,53 +1182,53 @@ function un(e) {
1182
1182
  minimumColumnWidth: e.minimumColumnWidth ?? 152
1183
1183
  }
1184
1184
  );
1185
- s[r.registryName] = {
1186
- component: o,
1185
+ o[r.registryName] = {
1186
+ component: s,
1187
1187
  children: "none"
1188
1188
  };
1189
- const a = Kt(e.frame, r.page, r.items);
1189
+ const i = Lt(e.frame, r.page, r.items);
1190
1190
  n.push({
1191
1191
  ...r.page,
1192
1192
  componentName: r.registryName,
1193
- width: (a == null ? void 0 : a.width) ?? 1,
1194
- height: (a == null ? void 0 : a.height) ?? 1,
1195
- frameSizeMode: a ? "fixed" : "content"
1193
+ width: (i == null ? void 0 : i.width) ?? 1,
1194
+ height: (i == null ? void 0 : i.height) ?? 1,
1195
+ frameSizeMode: i ? "fixed" : "content"
1196
1196
  });
1197
1197
  }
1198
1198
  return {
1199
- registry: s,
1199
+ registry: o,
1200
1200
  collection: {
1201
1201
  expectedCount: e.expectedCount ?? e.items.length,
1202
- assets: e.items.map((r) => We(r, e.pageFor(r).id)),
1202
+ assets: e.items.map((r) => Xe(r, e.pageFor(r).id)),
1203
1203
  pages: n
1204
1204
  }
1205
1205
  };
1206
1206
  }
1207
- function Jt(e, t = 60) {
1208
- const s = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, c]) => c.length > 0).sort(([c, u], [g, h]) => h.length - u.length || c.localeCompare(g)), n = s[0], r = s[1], o = Math.max(1, (n == null ? void 0 : n[1].length) ?? 1), a = r == null ? void 0 : r[1].slice(0, Math.max(1, Math.floor(t / o)));
1207
+ function Xt(e, t = 60) {
1208
+ const o = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, l]) => l.length > 0).sort(([l, f], [p, g]) => g.length - f.length || l.localeCompare(p)), n = o[0], r = o[1], s = Math.max(1, (n == null ? void 0 : n[1].length) ?? 1), i = r == null ? void 0 : r[1].slice(0, Math.max(1, Math.floor(t / s)));
1209
1209
  return {
1210
1210
  row: n,
1211
- column: r ? [r[0], a ?? []] : void 0,
1212
- fixed: s.slice(2).map(([c, u]) => [c, u[0]]),
1213
- additional: s.slice(2)
1211
+ column: r ? [r[0], i ?? []] : void 0,
1212
+ fixed: o.slice(2).map(([l, f]) => [l, f[0]]),
1213
+ additional: o.slice(2)
1214
1214
  };
1215
1215
  }
1216
- function Vt(e, t, s, n) {
1216
+ function Yt(e, t, o, n) {
1217
1217
  return {
1218
1218
  ...e.defaultProps,
1219
1219
  ...Object.fromEntries(t.fixed),
1220
- ...t.row && s ? { [t.row[0]]: s } : {},
1220
+ ...t.row && o ? { [t.row[0]]: o } : {},
1221
1221
  ...t.column && n ? { [t.column[0]]: n } : {}
1222
1222
  };
1223
1223
  }
1224
- function Wt({
1224
+ function Zt({
1225
1225
  item: e,
1226
1226
  entry: t,
1227
- maxVariantCells: s
1227
+ maxVariantCells: o
1228
1228
  }) {
1229
- var c, u;
1229
+ var l, f;
1230
1230
  if (!t)
1231
- return /* @__PURE__ */ $(
1231
+ return /* @__PURE__ */ N(
1232
1232
  "section",
1233
1233
  {
1234
1234
  "data-pygmalion-catalog-component": e.id,
@@ -1238,17 +1238,17 @@ function Wt({
1238
1238
  display: "inline-block",
1239
1239
  width: "max-content",
1240
1240
  padding: 32,
1241
- color: me,
1241
+ color: ye,
1242
1242
  background: he
1243
1243
  },
1244
1244
  children: [
1245
- /* @__PURE__ */ v("strong", { children: e.name }),
1246
- /* @__PURE__ */ v("p", { style: { color: U }, children: "The component is not registered." })
1245
+ /* @__PURE__ */ b("strong", { children: e.name }),
1246
+ /* @__PURE__ */ b("p", { style: { color: U }, children: "The component is not registered." })
1247
1247
  ]
1248
1248
  }
1249
1249
  );
1250
- const n = Jt(t, s), r = ((c = n.row) == null ? void 0 : c[1]) ?? [void 0], o = ((u = n.column) == null ? void 0 : u[1]) ?? [void 0], a = t.component;
1251
- return /* @__PURE__ */ $(
1250
+ const n = Xt(t, o), r = ((l = n.row) == null ? void 0 : l[1]) ?? [void 0], s = ((f = n.column) == null ? void 0 : f[1]) ?? [void 0], i = t.component;
1251
+ return /* @__PURE__ */ N(
1252
1252
  "section",
1253
1253
  {
1254
1254
  "data-pygmalion-catalog-component": e.id,
@@ -1258,150 +1258,150 @@ function Wt({
1258
1258
  display: "inline-block",
1259
1259
  width: "max-content",
1260
1260
  padding: 32,
1261
- color: me,
1261
+ color: ye,
1262
1262
  background: he,
1263
1263
  fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
1264
1264
  },
1265
1265
  children: [
1266
- /* @__PURE__ */ $("header", { style: { marginBottom: 24 }, children: [
1267
- /* @__PURE__ */ v("h1", { style: { margin: 0, fontSize: 24 }, children: e.name }),
1268
- e.sourcePath ? /* @__PURE__ */ v("p", { style: { margin: "6px 0 0", color: U, fontSize: 12 }, children: e.sourcePath }) : null
1266
+ /* @__PURE__ */ N("header", { style: { marginBottom: 24 }, children: [
1267
+ /* @__PURE__ */ b("h1", { style: { margin: 0, fontSize: 24 }, children: e.name }),
1268
+ e.sourcePath ? /* @__PURE__ */ b("p", { style: { margin: "6px 0 0", color: U, fontSize: 12 }, children: e.sourcePath }) : null
1269
1269
  ] }),
1270
- /* @__PURE__ */ v(
1270
+ /* @__PURE__ */ b(
1271
1271
  "div",
1272
1272
  {
1273
1273
  style: {
1274
1274
  display: "inline-grid",
1275
- gridTemplateColumns: `repeat(${o.length}, max-content)`,
1275
+ gridTemplateColumns: `repeat(${s.length}, max-content)`,
1276
1276
  gap: 12
1277
1277
  },
1278
1278
  children: r.flatMap(
1279
- (g) => o.map((h) => {
1280
- const w = Vt(t, n, g, h), y = [
1281
- n.row && g ? `${n.row[0]}=${g}` : "",
1282
- n.column && h ? `${n.column[0]}=${h}` : ""
1279
+ (p) => s.map((g) => {
1280
+ const S = Yt(t, n, p, g), h = [
1281
+ n.row && p ? `${n.row[0]}=${p}` : "",
1282
+ n.column && g ? `${n.column[0]}=${g}` : ""
1283
1283
  ].filter(Boolean).join(" · ");
1284
- return /* @__PURE__ */ $(
1284
+ return /* @__PURE__ */ N(
1285
1285
  "article",
1286
1286
  {
1287
1287
  style: {
1288
1288
  width: "max-content",
1289
1289
  padding: 16,
1290
- border: `1px solid ${Ie}`,
1290
+ border: `1px solid ${Ee}`,
1291
1291
  borderRadius: 10,
1292
- background: fe
1292
+ background: pe
1293
1293
  },
1294
1294
  children: [
1295
- y ? /* @__PURE__ */ v("div", { style: { marginBottom: 12, color: U, fontSize: 11 }, children: y }) : null,
1296
- /* @__PURE__ */ v("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: Fe(
1297
- a,
1298
- w,
1295
+ h ? /* @__PURE__ */ b("div", { style: { marginBottom: 12, color: U, fontSize: 11 }, children: h }) : null,
1296
+ /* @__PURE__ */ b("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: Te(
1297
+ i,
1298
+ S,
1299
1299
  t.children === "text" ? t.defaultChildren ?? e.name : void 0
1300
1300
  ) })
1301
1301
  ]
1302
1302
  },
1303
- `${g ?? "default"}:${h ?? "default"}`
1303
+ `${p ?? "default"}:${g ?? "default"}`
1304
1304
  );
1305
1305
  })
1306
1306
  )
1307
1307
  }
1308
1308
  ),
1309
- n.additional.map(([g, h]) => /* @__PURE__ */ $("section", { style: { marginTop: 20 }, children: [
1310
- /* @__PURE__ */ v("h2", { style: { margin: "0 0 10px", color: U, fontSize: 12 }, children: g }),
1311
- /* @__PURE__ */ v("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: h.map((w) => /* @__PURE__ */ $(
1309
+ n.additional.map(([p, g]) => /* @__PURE__ */ N("section", { style: { marginTop: 20 }, children: [
1310
+ /* @__PURE__ */ b("h2", { style: { margin: "0 0 10px", color: U, fontSize: 12 }, children: p }),
1311
+ /* @__PURE__ */ b("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: g.map((S) => /* @__PURE__ */ N(
1312
1312
  "article",
1313
1313
  {
1314
1314
  style: {
1315
1315
  padding: 16,
1316
- border: `1px solid ${Ie}`,
1316
+ border: `1px solid ${Ee}`,
1317
1317
  borderRadius: 10,
1318
- background: fe
1318
+ background: pe
1319
1319
  },
1320
1320
  children: [
1321
- /* @__PURE__ */ v("div", { style: { marginBottom: 12, color: U, fontSize: 11 }, children: w }),
1322
- Fe(
1323
- a,
1324
- { ...t.defaultProps, [g]: w },
1321
+ /* @__PURE__ */ b("div", { style: { marginBottom: 12, color: U, fontSize: 11 }, children: S }),
1322
+ Te(
1323
+ i,
1324
+ { ...t.defaultProps, [p]: S },
1325
1325
  t.children === "text" ? t.defaultChildren ?? e.name : void 0
1326
1326
  )
1327
1327
  ]
1328
1328
  },
1329
- w
1329
+ S
1330
1330
  )) })
1331
- ] }, g))
1331
+ ] }, p))
1332
1332
  ]
1333
1333
  }
1334
1334
  );
1335
1335
  }
1336
- function fn(e) {
1337
- Qe(e.items);
1338
- const t = {}, s = [], n = [], r = e.maxVariantCells ?? 60;
1339
- for (const o of e.items) {
1340
- const a = Ve(
1336
+ function yn(e) {
1337
+ Ye(e.items);
1338
+ const t = {}, o = [], n = [], r = e.maxVariantCells ?? 60;
1339
+ for (const s of e.items) {
1340
+ const i = Qe(
1341
1341
  e.kind,
1342
- o.id,
1342
+ s.id,
1343
1343
  e.registryPrefix
1344
- ), c = e.registry[o.name], u = () => /* @__PURE__ */ v(
1345
- Wt,
1344
+ ), l = e.registry[s.name], f = () => /* @__PURE__ */ b(
1345
+ Zt,
1346
1346
  {
1347
- item: o,
1348
- entry: c,
1347
+ item: s,
1348
+ entry: l,
1349
1349
  maxVariantCells: r
1350
1350
  }
1351
1351
  );
1352
- t[a] = { component: u, children: "none" }, s.push({
1353
- id: o.id,
1354
- name: o.name,
1355
- section: o.section,
1356
- componentName: a,
1352
+ t[i] = { component: f, children: "none" }, o.push({
1353
+ id: s.id,
1354
+ name: s.name,
1355
+ section: s.section,
1356
+ componentName: i,
1357
1357
  // The seed exists only long enough to mount the intrinsic max-content
1358
1358
  // catalog root. The editor replaces it with actual rendered DOM bounds.
1359
1359
  width: 1,
1360
1360
  height: 1,
1361
1361
  frameSizeMode: "content"
1362
- }), n.push(We(o, o.id));
1362
+ }), n.push(Xe(s, s.id));
1363
1363
  }
1364
1364
  return {
1365
1365
  registry: t,
1366
1366
  collection: {
1367
1367
  expectedCount: e.expectedCount ?? e.items.length,
1368
1368
  assets: n,
1369
- pages: s
1369
+ pages: o
1370
1370
  }
1371
1371
  };
1372
1372
  }
1373
- const je = /^[a-f0-9]{64}$/, Qt = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, Lt = /^p\d+$/;
1374
- function xe(e) {
1375
- return typeof e == "string" && Qt.test(e) ? e : void 0;
1373
+ const Ue = /^[a-f0-9]{64}$/, en = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, tn = /^p\d+$/;
1374
+ function Ce(e) {
1375
+ return typeof e == "string" && en.test(e) ? e : void 0;
1376
1376
  }
1377
- function _e(e, t) {
1378
- const s = new URL(e, t);
1379
- return s.search = "", s.hash = "", s.pathname.endsWith("/") || (s.pathname = `${s.pathname}/`), s.href;
1377
+ function He(e, t) {
1378
+ const o = new URL(e, t);
1379
+ return o.search = "", o.hash = "", o.pathname.endsWith("/") || (o.pathname = `${o.pathname}/`), o.href;
1380
1380
  }
1381
- function we(e) {
1381
+ function ve(e) {
1382
1382
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1383
1383
  const t = e;
1384
- return typeof t.domStructureHash != "string" || !je.test(t.domStructureHash) || typeof t.screenshotHash != "string" || !je.test(t.screenshotHash) ? null : {
1384
+ return typeof t.domStructureHash != "string" || !Ue.test(t.domStructureHash) || typeof t.screenshotHash != "string" || !Ue.test(t.screenshotHash) ? null : {
1385
1385
  domStructureHash: t.domStructureHash,
1386
1386
  screenshotHash: t.screenshotHash,
1387
- ...xe(t.screenshotUrl) ? { screenshotUrl: xe(t.screenshotUrl) } : {}
1387
+ ...Ce(t.screenshotUrl) ? { screenshotUrl: Ce(t.screenshotUrl) } : {}
1388
1388
  };
1389
1389
  }
1390
- function Be(e) {
1390
+ function qe(e) {
1391
1391
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1392
1392
  const t = e;
1393
1393
  return !Number.isSafeInteger(t.width) || !Number.isSafeInteger(t.height) || Number(t.width) < 1 || Number(t.height) < 1 || Number(t.width) > 65536 || Number(t.height) > 65536 ? null : { width: Number(t.width), height: Number(t.height) };
1394
1394
  }
1395
- function Xt(e) {
1395
+ function nn(e) {
1396
1396
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1397
- const t = e, s = Be(t.before), n = Be(t.after);
1398
- if (!s || !n || !Number.isSafeInteger(t.changedPixels) || !Number.isSafeInteger(t.totalPixels) || Number(t.changedPixels) < 0 || Number(t.totalPixels) < 1 || Number(t.changedPixels) > Number(t.totalPixels) || typeof t.threshold != "number" || !Number.isFinite(t.threshold) || t.threshold < 0 || t.threshold > 1)
1397
+ const t = e, o = qe(t.before), n = qe(t.after);
1398
+ if (!o || !n || !Number.isSafeInteger(t.changedPixels) || !Number.isSafeInteger(t.totalPixels) || Number(t.changedPixels) < 0 || Number(t.totalPixels) < 1 || Number(t.changedPixels) > Number(t.totalPixels) || typeof t.threshold != "number" || !Number.isFinite(t.threshold) || t.threshold < 0 || t.threshold > 1)
1399
1399
  return null;
1400
- const r = t.heatmapUrl == null ? null : xe(t.heatmapUrl) ?? null;
1400
+ const r = t.heatmapUrl == null ? null : Ce(t.heatmapUrl) ?? null;
1401
1401
  return {
1402
- before: s,
1402
+ before: o,
1403
1403
  after: n,
1404
- dimensionsMatch: s.width === n.width && s.height === n.height,
1404
+ dimensionsMatch: o.width === n.width && o.height === n.height,
1405
1405
  changedPixels: Number(t.changedPixels),
1406
1406
  totalPixels: Number(t.totalPixels),
1407
1407
  diffRatio: Number(t.changedPixels) / Number(t.totalPixels),
@@ -1409,47 +1409,47 @@ function Xt(e) {
1409
1409
  heatmapUrl: r
1410
1410
  };
1411
1411
  }
1412
- function Yt(e, t) {
1412
+ function rn(e, t) {
1413
1413
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1414
- const s = e;
1415
- if (typeof s.id != "string" || !s.id) return null;
1416
- const n = we(s), r = we(s.before) ?? n;
1414
+ const o = e;
1415
+ if (typeof o.id != "string" || !o.id) return null;
1416
+ const n = ve(o), r = ve(o.before) ?? n;
1417
1417
  if (!r) return null;
1418
- const o = we(s.after);
1419
- if (t === "changed" && !o) return null;
1420
- const a = o ? Xt(s.pixelDiff) : null;
1418
+ const s = ve(o.after);
1419
+ if (t === "changed" && !s) return null;
1420
+ const i = s ? nn(o.pixelDiff) : null;
1421
1421
  return {
1422
- id: s.id,
1422
+ id: o.id,
1423
1423
  before: r,
1424
- ...o ? { after: o } : {},
1425
- ...o ? {
1426
- domChanged: r.domStructureHash !== o.domStructureHash,
1427
- screenshotChanged: r.screenshotHash !== o.screenshotHash
1424
+ ...s ? { after: s } : {},
1425
+ ...s ? {
1426
+ domChanged: r.domStructureHash !== s.domStructureHash,
1427
+ screenshotChanged: r.screenshotHash !== s.screenshotHash
1428
1428
  } : {},
1429
- ...a ? { pixelDiff: a } : {}
1429
+ ...i ? { pixelDiff: i } : {}
1430
1430
  };
1431
1431
  }
1432
- function Zt(e, t = []) {
1433
- const s = new Set(t), n = s.size > 0, r = /* @__PURE__ */ new Set(), o = [
1434
- ...e.styles.map((a) => a.affectedFrames ?? []),
1435
- ...e.texts.map((a) => a.affectedFrames ?? []),
1436
- ...e.operations.map((a) => a.affectedFrames ?? [])
1432
+ function on(e, t = []) {
1433
+ const o = new Set(t), n = o.size > 0, r = /* @__PURE__ */ new Set(), s = [
1434
+ ...e.styles.map((i) => i.affectedFrames ?? []),
1435
+ ...e.texts.map((i) => i.affectedFrames ?? []),
1436
+ ...e.operations.map((i) => i.affectedFrames ?? [])
1437
1437
  ];
1438
- for (const a of o)
1439
- for (const c of a) {
1440
- if (n && Lt.test(c.id) && !s.has(c.id))
1438
+ for (const i of s)
1439
+ for (const l of i) {
1440
+ if (n && tn.test(l.id) && !o.has(l.id))
1441
1441
  throw new Error(
1442
- `"Impact Screen"${c.name}"This internal editor ID (${c.id}) is used. A canonical screen ID is required.`
1442
+ `"Impact Screen"${l.name}"This internal editor ID (${l.id}) is used. A canonical screen ID is required.`
1443
1443
  );
1444
- !c.id || n && !s.has(c.id) || r.add(c.id);
1444
+ !l.id || n && !o.has(l.id) || r.add(l.id);
1445
1445
  }
1446
1446
  return [...r].sort();
1447
1447
  }
1448
- async function Ue(e, t, s) {
1448
+ async function Ge(e, t, o) {
1449
1449
  const n = await e(`${t.replace(/\/$/, "")}/capture`, {
1450
1450
  method: "POST",
1451
1451
  headers: { "content-type": "application/json" },
1452
- body: JSON.stringify(s)
1452
+ body: JSON.stringify(o)
1453
1453
  }), r = await n.json();
1454
1454
  if (!n.ok || r.ok === !1)
1455
1455
  throw new Error(
@@ -1457,63 +1457,63 @@ async function Ue(e, t, s) {
1457
1457
  );
1458
1458
  if (typeof r.baselineId != "string" || !r.baselineId)
1459
1459
  throw new Error("Pygmalion visual QA response has no baselineId");
1460
- const o = Array.isArray(r.frames) ? r.frames.map((h) => Yt(h, s.phase)).filter((h) => h != null) : [], a = Array.isArray(r.failures) ? r.failures.map((h) => {
1461
- if (!h || typeof h != "object" || Array.isArray(h)) return null;
1462
- const w = h;
1463
- return typeof w.id == "string" && typeof w.error == "string" ? { id: w.id, error: w.error } : null;
1464
- }).filter((h) => h != null) : [], c = new Set(s.frameIds), g = new Set(o.map((h) => h.id)).size === o.length && o.every((h) => c.has(h.id)) && a.every((h) => c.has(h.id));
1460
+ const s = Array.isArray(r.frames) ? r.frames.map((g) => rn(g, o.phase)).filter((g) => g != null) : [], i = Array.isArray(r.failures) ? r.failures.map((g) => {
1461
+ if (!g || typeof g != "object" || Array.isArray(g)) return null;
1462
+ const S = g;
1463
+ return typeof S.id == "string" && typeof S.error == "string" ? { id: S.id, error: S.error } : null;
1464
+ }).filter((g) => g != null) : [], l = new Set(o.frameIds), p = new Set(s.map((g) => g.id)).size === s.length && s.every((g) => l.has(g.id)) && i.every((g) => l.has(g.id));
1465
1465
  return {
1466
- phase: s.phase,
1466
+ phase: o.phase,
1467
1467
  baselineId: r.baselineId,
1468
- complete: r.complete !== !1 && g && a.length === 0 && o.length === s.frameIds.length,
1469
- frames: o,
1470
- failures: a
1468
+ complete: r.complete !== !1 && p && i.length === 0 && s.length === o.frameIds.length,
1469
+ frames: s,
1470
+ failures: i
1471
1471
  };
1472
1472
  }
1473
- const be = {
1473
+ const Ie = {
1474
1474
  mirror: "/__pygmalion-dev-control",
1475
1475
  sessions: "/__pygmalion-design-session",
1476
1476
  inspect: "/__pygmalion-inspect"
1477
- }, en = "pygmalion.designSessionId", tn = "/__pygmalion-qa", le = /* @__PURE__ */ new Map();
1478
- function He() {
1477
+ }, sn = "pygmalion.designSessionId", an = "/__pygmalion-qa", ge = /* @__PURE__ */ new Map();
1478
+ function Ke() {
1479
1479
  var e;
1480
1480
  return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
1481
1481
  }
1482
- function nn(e, t) {
1482
+ function cn(e, t) {
1483
1483
  if (e) return e;
1484
- const s = le.get(t);
1485
- if (s) return s;
1484
+ const o = ge.get(t);
1485
+ if (o) return o;
1486
1486
  try {
1487
1487
  const n = window.localStorage.getItem(t);
1488
1488
  if (n)
1489
- return le.set(t, n), n;
1490
- const r = He();
1491
- return window.localStorage.setItem(t, r), le.set(t, r), r;
1489
+ return ge.set(t, n), n;
1490
+ const r = Ke();
1491
+ return window.localStorage.setItem(t, r), ge.set(t, r), r;
1492
1492
  } catch {
1493
- const n = He();
1494
- return le.set(t, n), n;
1493
+ const n = Ke();
1494
+ return ge.set(t, n), n;
1495
1495
  }
1496
1496
  }
1497
- async function W(e) {
1497
+ async function Q(e) {
1498
1498
  const t = await e.json();
1499
1499
  if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
1500
1500
  return t;
1501
1501
  }
1502
- function hn(e = {}) {
1503
- var X, x, q, i, d;
1502
+ function wn(e = {}) {
1503
+ var L, X, z, a, c;
1504
1504
  const {
1505
1505
  sessionId: t,
1506
- sessionStorageKey: s = en,
1506
+ sessionStorageKey: o = sn,
1507
1507
  autoStart: n = !0,
1508
1508
  fetcher: r = fetch,
1509
- formatApplyMessage: o
1510
- } = e, a = ((X = e.endpoints) == null ? void 0 : X.mirror) ?? be.mirror, c = ((x = e.endpoints) == null ? void 0 : x.sessions) ?? be.sessions, u = ((q = e.endpoints) == null ? void 0 : q.inspect) ?? be.inspect, g = e.visualQa != null, h = ((i = e.visualQa) == null ? void 0 : i.endpoint) ?? tn, w = JSON.stringify(((d = e.visualQa) == null ? void 0 : d.eligibleFrameIds) ?? []), y = de(
1511
- () => JSON.parse(w),
1512
- [w]
1513
- ), I = de(
1514
- () => nn(t, s),
1515
- [t, s]
1516
- ), [b, A] = re({
1509
+ formatApplyMessage: s
1510
+ } = e, i = ((L = e.endpoints) == null ? void 0 : L.mirror) ?? Ie.mirror, l = ((X = e.endpoints) == null ? void 0 : X.sessions) ?? Ie.sessions, f = ((z = e.endpoints) == null ? void 0 : z.inspect) ?? Ie.inspect, p = e.visualQa != null, g = ((a = e.visualQa) == null ? void 0 : a.endpoint) ?? an, S = JSON.stringify(((c = e.visualQa) == null ? void 0 : c.eligibleFrameIds) ?? []), h = ae(
1511
+ () => JSON.parse(S),
1512
+ [S]
1513
+ ), x = ae(
1514
+ () => cn(t, o),
1515
+ [t, o]
1516
+ ), [y, A] = se({
1517
1517
  state: "idle",
1518
1518
  commit: null,
1519
1519
  shortCommit: null,
@@ -1523,219 +1523,219 @@ function hn(e = {}) {
1523
1523
  warning: null,
1524
1524
  error: null,
1525
1525
  appOrigin: null
1526
- }), [m, k] = re(null), [M, D] = re(null), [z, j] = re({
1526
+ }), [m, k] = se(null), [$, F] = se(null), [T, j] = se({
1527
1527
  refs: [],
1528
1528
  defaultRef: null,
1529
1529
  worktreeRef: null
1530
- }), S = ve(null), R = ve(null), T = Z(
1531
- async (l = !0, f) => {
1532
- if (f != null && S.current && await S.current.catch(() => {
1533
- }), S.current) return S.current;
1534
- const E = (async () => {
1535
- A((C) => ({ ...C, state: "syncing", error: null }));
1530
+ }), v = xe(null), E = xe(null), M = te(
1531
+ async (d = !0, u) => {
1532
+ if (u != null && v.current && await v.current.catch(() => {
1533
+ }), v.current) return v.current;
1534
+ const P = (async () => {
1535
+ A((I) => ({ ...I, state: "syncing", error: null }));
1536
1536
  try {
1537
- const C = f != null;
1538
- let P = await r(`${a}/${l || C ? "refresh" : "status"}`, {
1539
- method: l || C ? "POST" : "GET",
1540
- ...C ? {
1537
+ const I = u != null;
1538
+ let D = await r(`${i}/${d || I ? "refresh" : "status"}`, {
1539
+ method: d || I ? "POST" : "GET",
1540
+ ...I ? {
1541
1541
  headers: { "content-type": "application/json" },
1542
- body: JSON.stringify({ ref: f })
1542
+ body: JSON.stringify({ ref: u })
1543
1543
  } : {}
1544
- }), p = await W(P);
1545
- const N = Date.now();
1546
- for (; !l && p.state === "syncing" && Date.now() - N < 12e4; )
1547
- await new Promise((K) => window.setTimeout(K, 500)), P = await r(`${a}/status`), p = await W(P);
1548
- if (p.state !== "ready" || !p.appOrigin || !p.commit)
1549
- throw new Error(p.error ?? "Pygmalion could not prepare the source preview");
1550
- const O = await W(
1551
- await r(`${c}/open`, {
1544
+ }), R = await Q(D);
1545
+ const K = Date.now();
1546
+ for (; !d && R.state === "syncing" && Date.now() - K < 12e4; )
1547
+ await new Promise((O) => window.setTimeout(O, 500)), D = await r(`${i}/status`), R = await Q(D);
1548
+ if (R.state !== "ready" || !R.appOrigin || !R.commit)
1549
+ throw new Error(R.error ?? "Pygmalion could not prepare the source preview");
1550
+ const C = await Q(
1551
+ await r(`${l}/open`, {
1552
1552
  method: "POST",
1553
1553
  headers: { "content-type": "application/json" },
1554
- body: JSON.stringify({ sessionId: I, baseDevSha: p.commit })
1554
+ body: JSON.stringify({ sessionId: x, baseDevSha: R.commit })
1555
1555
  })
1556
1556
  );
1557
- if (!O.ok || !O.session)
1558
- throw new Error(O.error ?? "Pygmalion could not open the design session");
1559
- let F = O.session;
1560
- if (F.branchName) {
1561
- const K = await W(
1562
- await r(`${c}/check`, {
1557
+ if (!C.ok || !C.session)
1558
+ throw new Error(C.error ?? "Pygmalion could not open the design session");
1559
+ let w = C.session;
1560
+ if (w.branchName) {
1561
+ const O = await Q(
1562
+ await r(`${l}/check`, {
1563
1563
  method: "POST",
1564
1564
  headers: { "content-type": "application/json" },
1565
- body: JSON.stringify({ sessionId: F.id })
1565
+ body: JSON.stringify({ sessionId: w.id })
1566
1566
  })
1567
1567
  );
1568
- if (!K.ok || !K.session)
1569
- throw new Error(K.error ?? "Pygmalion could not check the design session");
1570
- F = K.session;
1568
+ if (!O.ok || !O.session)
1569
+ throw new Error(O.error ?? "Pygmalion could not check the design session");
1570
+ w = O.session;
1571
1571
  }
1572
- A(p), k(F), D(F.appOrigin ?? p.appOrigin);
1573
- } catch (C) {
1574
- A((P) => ({
1575
- ...P,
1572
+ A(R), k(w), F(w.appOrigin ?? R.appOrigin);
1573
+ } catch (I) {
1574
+ A((D) => ({
1575
+ ...D,
1576
1576
  state: "error",
1577
- error: C instanceof Error ? C.message : String(C)
1577
+ error: I instanceof Error ? I.message : String(I)
1578
1578
  }));
1579
1579
  }
1580
1580
  })();
1581
- S.current = E;
1581
+ v.current = P;
1582
1582
  try {
1583
- await E;
1583
+ await P;
1584
1584
  } finally {
1585
- S.current === E && (S.current = null);
1585
+ v.current === P && (v.current = null);
1586
1586
  }
1587
1587
  },
1588
- [r, a, c, I]
1589
- ), H = Z(async () => {
1588
+ [r, i, l, x]
1589
+ ), B = te(async () => {
1590
1590
  try {
1591
- const l = await W(
1592
- await r(`${a}/refs`)
1593
- ), f = {
1594
- refs: l.refs ?? [],
1595
- defaultRef: l.defaultRef ?? null,
1596
- worktreeRef: l.worktreeRef ?? null
1591
+ const d = await Q(
1592
+ await r(`${i}/refs`)
1593
+ ), u = {
1594
+ refs: d.refs ?? [],
1595
+ defaultRef: d.defaultRef ?? null,
1596
+ worktreeRef: d.worktreeRef ?? null
1597
1597
  };
1598
- return j(f), f;
1598
+ return j(u), u;
1599
1599
  } catch {
1600
- return z;
1600
+ return T;
1601
1601
  }
1602
- }, [r, a, z]), te = Z(
1603
- async (l, f) => {
1604
- if (m != null && m.branchName && !(f != null && f.discardEdits))
1602
+ }, [r, i, T]), Z = te(
1603
+ async (d, u) => {
1604
+ if (m != null && m.branchName && !(u != null && u.discardEdits))
1605
1605
  throw new Error(
1606
1606
  "This design session has unapplied edits against the current source. Apply or revert them, or pass discardEdits to switch anyway."
1607
1607
  );
1608
- await T(!0, l);
1608
+ await M(!0, d);
1609
1609
  },
1610
- [T, m == null ? void 0 : m.branchName]
1611
- ), ne = Z(
1612
- async (l) => {
1613
- var p;
1610
+ [M, m == null ? void 0 : m.branchName]
1611
+ ), re = te(
1612
+ async (d) => {
1613
+ var R;
1614
1614
  if (!m) throw new Error("Pygmalion design session is not ready");
1615
- const f = R.current;
1616
- if (f && (f.sessionId !== m.id || f.baseDevSha !== m.baseDevSha || f.revision !== m.revision || f.fingerprint !== JSON.stringify(l)))
1615
+ const u = E.current;
1616
+ if (u && (u.sessionId !== m.id || u.baseDevSha !== m.baseDevSha || u.revision !== m.revision || u.fingerprint !== JSON.stringify(d)))
1617
1617
  throw new Error("The code diff you checked is out of date. Please check the diff for the current changes again.");
1618
- const E = await W(
1619
- await r(`${c}/apply-visual`, {
1618
+ const P = await Q(
1619
+ await r(`${l}/apply-visual`, {
1620
1620
  method: "POST",
1621
1621
  headers: { "content-type": "application/json" },
1622
1622
  body: JSON.stringify({
1623
1623
  sessionId: m.id,
1624
1624
  baseDevSha: m.baseDevSha,
1625
1625
  expectedRevision: m.revision,
1626
- ...f ? { previewRevision: f.revision } : {},
1627
- changes: l
1626
+ ...u ? { previewRevision: u.revision } : {},
1627
+ changes: d
1628
1628
  })
1629
1629
  })
1630
1630
  );
1631
- if (!E.ok || !E.session)
1632
- throw new Error(E.error ?? "Pygmalion could not apply the visual changes");
1633
- k(E.session), E.session.appOrigin && D(E.session.appOrigin);
1634
- const C = E.applied ?? l.styles.length + l.texts.length + l.operations.length;
1635
- let P;
1636
- if (f != null && f.qaBaselineId && ((p = f.qaFrameIds) != null && p.length) && E.session.appOrigin)
1631
+ if (!P.ok || !P.session)
1632
+ throw new Error(P.error ?? "Pygmalion could not apply the visual changes");
1633
+ k(P.session), P.session.appOrigin && F(P.session.appOrigin);
1634
+ const I = P.applied ?? d.styles.length + d.texts.length + d.operations.length;
1635
+ let D;
1636
+ if (u != null && u.qaBaselineId && ((R = u.qaFrameIds) != null && R.length) && P.session.appOrigin)
1637
1637
  try {
1638
- P = await Ue(r, h, {
1638
+ D = await Ge(r, g, {
1639
1639
  phase: "changed",
1640
- baselineId: f.qaBaselineId,
1641
- basePath: _e(E.session.appOrigin, window.location.origin),
1642
- frameIds: f.qaFrameIds
1640
+ baselineId: u.qaBaselineId,
1641
+ basePath: He(P.session.appOrigin, window.location.origin),
1642
+ frameIds: u.qaFrameIds
1643
1643
  });
1644
- } catch (N) {
1645
- const O = N instanceof Error ? N.message : String(N);
1646
- P = {
1644
+ } catch (K) {
1645
+ const C = K instanceof Error ? K.message : String(K);
1646
+ D = {
1647
1647
  phase: "changed",
1648
- baselineId: f.qaBaselineId,
1648
+ baselineId: u.qaBaselineId,
1649
1649
  complete: !1,
1650
1650
  frames: [],
1651
- failures: f.qaFrameIds.map((F) => ({ id: F, error: O }))
1651
+ failures: u.qaFrameIds.map((w) => ({ id: w, error: C }))
1652
1652
  };
1653
1653
  }
1654
- return R.current = null, {
1655
- applied: C,
1656
- branch: E.session.branchName ?? void 0,
1657
- integration: E.session.integration.state,
1658
- message: o == null ? void 0 : o(E.session, C),
1659
- ...P ? { qa: P } : {}
1654
+ return E.current = null, {
1655
+ applied: I,
1656
+ branch: P.session.branchName ?? void 0,
1657
+ integration: P.session.integration.state,
1658
+ message: s == null ? void 0 : s(P.session, I),
1659
+ ...D ? { qa: D } : {}
1660
1660
  };
1661
1661
  },
1662
- [r, o, h, m, c]
1663
- ), Y = Z(
1664
- async (l) => {
1665
- var p;
1662
+ [r, s, g, m, l]
1663
+ ), ee = te(
1664
+ async (d) => {
1665
+ var R;
1666
1666
  if (!m) throw new Error("Pygmalion design session is not ready");
1667
- R.current = null;
1668
- const f = await W(
1669
- await r(`${c}/preview-visual`, {
1667
+ E.current = null;
1668
+ const u = await Q(
1669
+ await r(`${l}/preview-visual`, {
1670
1670
  method: "POST",
1671
1671
  headers: { "content-type": "application/json" },
1672
1672
  body: JSON.stringify({
1673
1673
  sessionId: m.id,
1674
1674
  baseDevSha: m.baseDevSha,
1675
1675
  expectedRevision: m.revision,
1676
- changes: l
1676
+ changes: d
1677
1677
  })
1678
1678
  })
1679
1679
  );
1680
- if (!f.ok || !Number.isSafeInteger(f.revision))
1681
- throw new Error(f.error ?? "Pygmalion could not preview the visual changes");
1682
- const E = g ? Zt(l, y) : [];
1683
- let C;
1684
- const P = m.appOrigin ?? b.appOrigin;
1685
- if (E.length > 0) {
1686
- if (!P)
1680
+ if (!u.ok || !Number.isSafeInteger(u.revision))
1681
+ throw new Error(u.error ?? "Pygmalion could not preview the visual changes");
1682
+ const P = p ? on(d, h) : [];
1683
+ let I;
1684
+ const D = m.appOrigin ?? y.appOrigin;
1685
+ if (P.length > 0) {
1686
+ if (!D)
1687
1687
  throw new Error("Impact screen QA baseline preview not ready");
1688
- if (C = await Ue(r, h, {
1688
+ if (I = await Ge(r, g, {
1689
1689
  phase: "baseline",
1690
- basePath: _e(P, window.location.origin),
1691
- frameIds: E
1692
- }), !C.complete)
1690
+ basePath: He(D, window.location.origin),
1691
+ frameIds: P
1692
+ }), !I.complete)
1693
1693
  throw new Error(
1694
- ((p = C.failures[0]) == null ? void 0 : p.error) ?? `Failed to capture ${E.length - C.frames.length} affected frames`
1694
+ ((R = I.failures[0]) == null ? void 0 : R.error) ?? `Failed to capture ${P.length - I.frames.length} affected frames`
1695
1695
  );
1696
1696
  }
1697
- return R.current = {
1697
+ return E.current = {
1698
1698
  sessionId: m.id,
1699
1699
  baseDevSha: m.baseDevSha,
1700
- revision: f.revision,
1701
- fingerprint: JSON.stringify(l),
1702
- ...C ? { qaBaselineId: C.baselineId, qaFrameIds: E } : {}
1700
+ revision: u.revision,
1701
+ fingerprint: JSON.stringify(d),
1702
+ ...I ? { qaBaselineId: I.baselineId, qaFrameIds: P } : {}
1703
1703
  }, {
1704
- revision: f.revision,
1705
- files: Array.isArray(f.files) ? f.files : [],
1706
- affectedFiles: Array.isArray(f.affectedFiles) ? f.affectedFiles : [],
1707
- ...C ? { qa: C } : {}
1704
+ revision: u.revision,
1705
+ files: Array.isArray(u.files) ? u.files : [],
1706
+ affectedFiles: Array.isArray(u.affectedFiles) ? u.affectedFiles : [],
1707
+ ...I ? { qa: I } : {}
1708
1708
  };
1709
1709
  },
1710
1710
  [
1711
1711
  r,
1712
- b.appOrigin,
1713
- y,
1712
+ y.appOrigin,
1714
1713
  h,
1714
+ g,
1715
1715
  m,
1716
- c,
1717
- g
1716
+ l,
1717
+ p
1718
1718
  ]
1719
- ), Q = Z(
1720
- async (l) => {
1721
- if (l.length === 0) return { files: [] };
1722
- const f = await W(
1723
- await r(`${u}/impact`, {
1719
+ ), oe = te(
1720
+ async (d) => {
1721
+ if (d.length === 0) return { files: [] };
1722
+ const u = await Q(
1723
+ await r(`${f}/impact`, {
1724
1724
  method: "POST",
1725
1725
  headers: { "content-type": "application/json" },
1726
- body: JSON.stringify({ componentFiles: l })
1726
+ body: JSON.stringify({ componentFiles: d })
1727
1727
  })
1728
1728
  );
1729
- if (f.error || f.ok === !1)
1730
- throw new Error(f.error ?? "Pygmalion could not calculate source impact");
1731
- return { files: Array.isArray(f.files) ? f.files : [] };
1729
+ if (u.error || u.ok === !1)
1730
+ throw new Error(u.error ?? "Pygmalion could not calculate source impact");
1731
+ return { files: Array.isArray(u.files) ? u.files : [] };
1732
1732
  },
1733
- [r, u]
1734
- ), L = Z(async () => {
1733
+ [r, f]
1734
+ ), H = te(async () => {
1735
1735
  if (!(m != null && m.canRevert) || !m.headSha)
1736
1736
  throw new Error("There are no reversible changes applied");
1737
- const l = await W(
1738
- await r(`${c}/revert-visual`, {
1737
+ const d = await Q(
1738
+ await r(`${l}/revert-visual`, {
1739
1739
  method: "POST",
1740
1740
  headers: { "content-type": "application/json" },
1741
1741
  body: JSON.stringify({
@@ -1746,77 +1746,77 @@ function hn(e = {}) {
1746
1746
  })
1747
1747
  })
1748
1748
  );
1749
- if (!l.ok || l.reverted !== !0 || !l.operation || l.operation.kind !== "visual-revert" || !l.session)
1750
- throw new Error(l.error ?? "Pygmalion could not revert the last visual change");
1751
- return R.current = null, k(l.session), l.session.appOrigin && D(l.session.appOrigin), {
1749
+ if (!d.ok || d.reverted !== !0 || !d.operation || d.operation.kind !== "visual-revert" || !d.session)
1750
+ throw new Error(d.error ?? "Pygmalion could not revert the last visual change");
1751
+ return E.current = null, k(d.session), d.session.appOrigin && F(d.session.appOrigin), {
1752
1752
  reverted: !0,
1753
- operation: l.operation,
1754
- session: l.session
1753
+ operation: d.operation,
1754
+ session: d.session
1755
1755
  };
1756
- }, [r, m, c]);
1757
- oe(() => {
1758
- n && T(!1);
1759
- }, [n, T]), oe(() => {
1760
- n && H();
1756
+ }, [r, m, l]);
1757
+ ie(() => {
1758
+ n && M(!1);
1759
+ }, [n, M]), ie(() => {
1760
+ n && B();
1761
1761
  }, [n]);
1762
- const V = (m == null ? void 0 : m.appOrigin) ?? b.appOrigin ?? M, _ = (m == null ? void 0 : m.headSha) ?? (m == null ? void 0 : m.baseDevSha) ?? b.commit ?? "pending";
1762
+ const W = (m == null ? void 0 : m.appOrigin) ?? y.appOrigin ?? $, G = (m == null ? void 0 : m.headSha) ?? (m == null ? void 0 : m.baseDevSha) ?? y.commit ?? "pending";
1763
1763
  return {
1764
- mirror: b,
1764
+ mirror: y,
1765
1765
  session: m,
1766
- ready: M != null,
1767
- appOrigin: V,
1768
- previewRevision: `${_}:${(m == null ? void 0 : m.revision) ?? 0}`,
1769
- previewSourceRevision: _,
1770
- refresh: T,
1771
- switchSource: te,
1772
- sourceRefs: z,
1773
- loadSourceRefs: H,
1774
- previewVisual: Y,
1775
- inspectImpact: Q,
1776
- applyVisual: ne,
1777
- revertLastVisual: L
1766
+ ready: $ != null,
1767
+ appOrigin: W,
1768
+ previewRevision: `${G}:${(m == null ? void 0 : m.revision) ?? 0}`,
1769
+ previewSourceRevision: G,
1770
+ refresh: M,
1771
+ switchSource: Z,
1772
+ sourceRefs: T,
1773
+ loadSourceRefs: B,
1774
+ previewVisual: ee,
1775
+ inspectImpact: oe,
1776
+ applyVisual: re,
1777
+ revertLastVisual: H
1778
1778
  };
1779
1779
  }
1780
- function mn({
1780
+ function bn({
1781
1781
  value: e,
1782
1782
  refs: t,
1783
- onChange: s,
1783
+ onChange: o,
1784
1784
  busy: n = !1,
1785
1785
  defaultRef: r = null,
1786
- worktreeRef: o = null,
1787
- label: a = "Source revision",
1788
- children: c,
1789
- className: u
1786
+ worktreeRef: s = null,
1787
+ label: i = "Source revision",
1788
+ children: l,
1789
+ className: f
1790
1790
  }) {
1791
- const g = de(
1791
+ const p = ae(
1792
1792
  () => ({
1793
- local: t.filter((y) => y.kind === "local"),
1794
- remote: t.filter((y) => y.kind === "remote")
1793
+ local: t.filter((h) => h.kind === "local"),
1794
+ remote: t.filter((h) => h.kind === "remote")
1795
1795
  }),
1796
1796
  [t]
1797
- ), h = de(() => {
1798
- const y = new Set(t.map((I) => I.name));
1799
- return r && y.add(r), o && y.add(o), y;
1800
- }, [r, t, o]), w = e ?? r ?? "";
1801
- return /* @__PURE__ */ $(
1797
+ ), g = ae(() => {
1798
+ const h = new Set(t.map((x) => x.name));
1799
+ return r && h.add(r), s && h.add(s), h;
1800
+ }, [r, t, s]), S = e ?? r ?? "";
1801
+ return /* @__PURE__ */ N(
1802
1802
  "span",
1803
1803
  {
1804
- className: u,
1804
+ className: f,
1805
1805
  "data-pygmalion-source-ref": "",
1806
1806
  "data-busy": n ? "" : void 0,
1807
1807
  style: { position: "relative", display: "inline-flex", alignItems: "center" },
1808
1808
  children: [
1809
- c ?? /* @__PURE__ */ v("span", { "data-pygmalion-source-ref-value": "", children: w || a }),
1810
- /* @__PURE__ */ $(
1809
+ l ?? /* @__PURE__ */ b("span", { "data-pygmalion-source-ref-value": "", children: S || i }),
1810
+ /* @__PURE__ */ N(
1811
1811
  "select",
1812
1812
  {
1813
- value: w,
1813
+ value: S,
1814
1814
  disabled: n,
1815
- "aria-label": a,
1815
+ "aria-label": i,
1816
1816
  "data-pygmalion-source-ref-select": "",
1817
- onChange: (y) => {
1818
- const I = y.target.value;
1819
- I && I !== w && s(I);
1817
+ onChange: (h) => {
1818
+ const x = h.target.value;
1819
+ x && x !== S && o(x);
1820
1820
  },
1821
1821
  style: {
1822
1822
  position: "absolute",
@@ -1832,21 +1832,21 @@ function mn({
1832
1832
  margin: 0
1833
1833
  },
1834
1834
  children: [
1835
- w && !h.has(w) ? /* @__PURE__ */ v("option", { value: w, children: w }) : null,
1836
- o ? /* @__PURE__ */ $("option", { value: o, children: [
1837
- o,
1835
+ S && !g.has(S) ? /* @__PURE__ */ b("option", { value: S, children: S }) : null,
1836
+ s ? /* @__PURE__ */ N("option", { value: s, children: [
1837
+ s,
1838
1838
  " · uncommitted work"
1839
1839
  ] }) : null,
1840
- g.local.length > 0 ? /* @__PURE__ */ v("optgroup", { label: "local", children: g.local.map((y) => /* @__PURE__ */ $("option", { value: y.name, children: [
1841
- y.name,
1840
+ p.local.length > 0 ? /* @__PURE__ */ b("optgroup", { label: "local", children: p.local.map((h) => /* @__PURE__ */ N("option", { value: h.name, children: [
1841
+ h.name,
1842
1842
  " · ",
1843
- y.commit
1844
- ] }, y.fullName)) }) : null,
1845
- g.remote.length > 0 ? /* @__PURE__ */ v("optgroup", { label: "remote", children: g.remote.map((y) => /* @__PURE__ */ $("option", { value: y.name, children: [
1846
- y.name,
1843
+ h.commit
1844
+ ] }, h.fullName)) }) : null,
1845
+ p.remote.length > 0 ? /* @__PURE__ */ b("optgroup", { label: "remote", children: p.remote.map((h) => /* @__PURE__ */ N("option", { value: h.name, children: [
1846
+ h.name,
1847
1847
  " · ",
1848
- y.commit
1849
- ] }, y.fullName)) }) : null
1848
+ h.commit
1849
+ ] }, h.fullName)) }) : null
1850
1850
  ]
1851
1851
  }
1852
1852
  )
@@ -1854,264 +1854,286 @@ function mn({
1854
1854
  }
1855
1855
  );
1856
1856
  }
1857
- const pn = {
1857
+ const Sn = {
1858
1858
  editor: J,
1859
- getObserverTree: Ye,
1860
- isObservableProp: Xe
1859
+ getObserverTree: tt,
1860
+ isObservableProp: et
1861
1861
  };
1862
- function gn(e) {
1862
+ function vn(e) {
1863
1863
  J.navigateToPageByName(e);
1864
1864
  }
1865
- function yn() {
1865
+ function In() {
1866
1866
  J.openPreview();
1867
1867
  }
1868
- function wn() {
1869
- const e = Oe.entries.length > 0;
1870
- return e && Oe.discardPending(), J.resetCurrentEdits() || e;
1868
+ function xn() {
1869
+ const e = De.entries.length > 0;
1870
+ return e && De.discardPending(), J.resetCurrentEdits() || e;
1871
1871
  }
1872
- function bn({
1872
+ function Pn({
1873
1873
  registry: e,
1874
1874
  tokens: t,
1875
- initialPages: s,
1876
- viewportPresets: n,
1877
- previewEnvironmentControls: r,
1878
- designImport: o,
1879
- onTokensChange: a,
1880
- appOrigin: c,
1881
- previewRevision: u,
1875
+ initialPages: o,
1876
+ componentConnections: n,
1877
+ viewportPresets: r,
1878
+ previewEnvironmentControls: s,
1879
+ designImport: i,
1880
+ onTokensChange: l,
1881
+ appOrigin: f,
1882
+ previewRevision: p,
1882
1883
  previewCacheNamespace: g,
1883
- previewArtifacts: h,
1884
- previewArtifactEndpoint: w,
1885
- previewConcurrency: y,
1886
- previewOpen: I,
1887
- onPreviewOpenChange: b,
1888
- flowCanvas: A,
1889
- onApply: m,
1890
- onDesignChange: k,
1891
- onInspectApply: M,
1892
- onInspectPreview: D,
1893
- onInspectImpact: z,
1894
- storyboardDiscovery: j = !0,
1895
- storyboardDiscoveryEndpoint: S = mt
1884
+ previewArtifacts: S,
1885
+ previewArtifactEndpoint: h,
1886
+ previewConcurrency: x,
1887
+ previewOpen: y,
1888
+ onPreviewOpenChange: A,
1889
+ flowCanvas: m,
1890
+ onApply: k,
1891
+ onDesignChange: $,
1892
+ onInspectApply: F,
1893
+ onInspectPreview: T,
1894
+ onInspectImpact: j,
1895
+ storyboardDiscovery: v = !0,
1896
+ storyboardDiscoveryEndpoint: E = wt
1896
1897
  }) {
1897
- const [R, T] = re(!j), [H, te] = re();
1898
- o && (o.assertComplete(), Ze(o));
1899
- const ne = e ?? (o == null ? void 0 : o.getRegistry()), Y = t ?? (o == null ? void 0 : o.getTokens()), Q = s ?? (o == null ? void 0 : o.getInitialPages());
1900
- ne && et(ne), Y && tt(Y), n && nt(n), rt(r ?? []), yt(a ?? null), c != null && ot(c), u != null && st(u), it(g);
1901
- const L = H ?? h, V = (Q ?? []).flatMap(
1902
- (x) => x.route && x.importPageId ? [
1903
- {
1904
- canonicalId: x.importPageId,
1905
- route: x.route,
1906
- width: x.width,
1907
- height: x.height,
1908
- environment: x.environment,
1909
- preset: x.preset,
1910
- interactions: x.interactions,
1911
- assertions: x.assertions
1912
- }
1913
- ] : []
1914
- ), _ = ve([]), X = V.map((x) => ({
1915
- id: x.canonicalId,
1916
- fingerprint: at(
1917
- x,
1918
- Re(),
1919
- ge()
1920
- )
1921
- }));
1922
- return _.current = X, L && Q && R && Ne(L, {
1923
- namespace: g ?? "",
1924
- previewRevision: Re(),
1925
- appOrigin: Me(),
1926
- baselineEnvironment: ge(),
1927
- allowStaleIdentity: !!w,
1928
- allowMatchingFrameIdentity: H != null,
1929
- pages: V.map((x, q) => {
1930
- var i;
1931
- return {
1932
- ...x,
1933
- fingerprint: (i = X[q]) == null ? void 0 : i.fingerprint
1934
- };
1935
- })
1936
- }), y != null && ct(y), wt(b ?? null), A != null && lt(A), bt(m ?? null), vt(M ?? null), dt(D ?? null), St(z ?? null), Q && J.initPagesFromComponents(Q), oe(() => {
1937
- ke(k ?? null);
1938
- const x = ut(J);
1898
+ const [M, B] = se(!v), [Z, re] = se();
1899
+ i && (i.assertComplete(), nt(i));
1900
+ const ee = e ?? (i == null ? void 0 : i.getRegistry()), oe = t ?? (i == null ? void 0 : i.getTokens()), H = o ?? (i == null ? void 0 : i.getInitialPages());
1901
+ ee && rt(ee), ot(n ?? []), oe && st(oe), r && it(r), It(l ?? null), at(g);
1902
+ const W = Z ?? S, G = ae(
1903
+ () => (H ?? []).flatMap(
1904
+ (c) => c.route && c.importPageId ? [
1905
+ {
1906
+ canonicalId: c.importPageId,
1907
+ route: c.route,
1908
+ width: c.width,
1909
+ height: c.height,
1910
+ environment: c.environment,
1911
+ preset: c.preset,
1912
+ interactions: c.interactions,
1913
+ assertions: c.assertions
1914
+ }
1915
+ ] : []
1916
+ ),
1917
+ [H]
1918
+ ), L = p ?? St(), X = f ?? ke(), z = xe([]), a = ae(
1919
+ () => G.map((c) => ({
1920
+ id: c.canonicalId,
1921
+ fingerprint: ct(
1922
+ c,
1923
+ L,
1924
+ be()
1925
+ )
1926
+ })),
1927
+ [G, L, M]
1928
+ );
1929
+ return z.current = a, x != null && lt(x), xt(A ?? null), m != null && dt(m), Pt(k ?? null), Et(F ?? null), ut(T ?? null), Ct(j ?? null), H && J.initPagesFromComponents(H), ze(() => {
1930
+ f != null && ft(f), p != null && gt(p), mt(s ?? []);
1931
+ }, [f, s, p]), ze(() => {
1932
+ !W || !H || !M || Oe(W, {
1933
+ namespace: g ?? "",
1934
+ previewRevision: L,
1935
+ appOrigin: X,
1936
+ baselineEnvironment: be(),
1937
+ allowStaleIdentity: !!h,
1938
+ allowMatchingFrameIdentity: Z != null,
1939
+ pages: G.map((c, d) => {
1940
+ var u;
1941
+ return {
1942
+ ...c,
1943
+ fingerprint: (u = a[d]) == null ? void 0 : u.fingerprint
1944
+ };
1945
+ })
1946
+ });
1947
+ }, [
1948
+ W,
1949
+ a,
1950
+ G,
1951
+ h,
1952
+ g,
1953
+ Z,
1954
+ X,
1955
+ H,
1956
+ L,
1957
+ M
1958
+ ]), ie(() => {
1959
+ Fe($ ?? null);
1960
+ const c = pt(J);
1939
1961
  return () => {
1940
- x(), ke(null);
1962
+ c(), Fe(null);
1941
1963
  };
1942
- }, [k]), oe(() => {
1943
- if (te(void 0), !R || !w || !(g != null && g.trim()) || !(u != null && u.trim()))
1964
+ }, [$]), ie(() => {
1965
+ if (re(void 0), !M || !h || !(g != null && g.trim()) || !(p != null && p.trim()))
1944
1966
  return;
1945
- const x = new AbortController(), q = ft({
1946
- endpoint: w,
1947
- captureBaseUrl: c
1948
- }), i = ht(u), d = (P) => {
1949
- Ne(P, {
1967
+ const c = new AbortController(), d = ht({
1968
+ endpoint: h,
1969
+ captureBaseUrl: f
1970
+ }), u = yt(p), P = (C) => {
1971
+ Oe(C, {
1950
1972
  namespace: g,
1951
- previewRevision: u,
1952
- appOrigin: Me(),
1953
- baselineEnvironment: ge(),
1973
+ previewRevision: p,
1974
+ appOrigin: ke(),
1975
+ baselineEnvironment: be(),
1954
1976
  allowStaleIdentity: !0,
1955
1977
  allowMatchingFrameIdentity: !0,
1956
- pages: V.map((p, N) => {
1957
- var O;
1978
+ pages: G.map((w, O) => {
1979
+ var q;
1958
1980
  return {
1959
- ...p,
1960
- fingerprint: (O = X[N]) == null ? void 0 : O.fingerprint
1981
+ ...w,
1982
+ fingerprint: (q = a[O]) == null ? void 0 : q.fingerprint
1961
1983
  };
1962
1984
  })
1963
- }), te(P);
1964
- }, l = (P, p, N) => gt({
1985
+ }), re(C);
1986
+ }, I = (C, w, O) => vt({
1965
1987
  namespace: g,
1966
- sourceRevision: i,
1967
- transport: q,
1968
- signal: N,
1969
- ...P.length ? { frames: P } : {},
1970
- ...p ? {} : { generate: !1 }
1971
- }), f = (P, p) => {
1972
- const N = new Set(p);
1973
- return P.filter((O) => N.has(O.id));
1974
- }, E = (P, p) => P instanceof Error && P.message ? P.message : p, C = new AbortController();
1975
- if (Ae(async (P) => {
1976
- var N, O, F;
1977
- const p = await l(P, !0, C.signal);
1978
- if (p.status === "accepted") {
1979
- d(p.artifact);
1980
- const K = new Set(((N = p.frameResolution) == null ? void 0 : N.exact) ?? []);
1981
- if (P.every((ie) => K.has(ie.id)))
1988
+ sourceRevision: u,
1989
+ transport: d,
1990
+ signal: O,
1991
+ ...C.length ? { frames: C } : {},
1992
+ ...w ? {} : { generate: !1 }
1993
+ }), D = (C, w) => {
1994
+ const O = new Set(w);
1995
+ return C.filter((q) => O.has(q.id));
1996
+ }, R = (C, w) => C instanceof Error && C.message ? C.message : w, K = new AbortController();
1997
+ if ($e(async (C) => {
1998
+ var O, q, Y;
1999
+ const w = await I(C, !0, K.signal);
2000
+ if (w.status === "accepted") {
2001
+ P(w.artifact);
2002
+ const fe = new Set(((O = w.frameResolution) == null ? void 0 : O.exact) ?? []);
2003
+ if (C.every((le) => fe.has(le.id)))
1982
2004
  return { status: "accepted" };
1983
- const se = [
1984
- ...((O = p.frameResolution) == null ? void 0 : O.missing) ?? [],
1985
- ...((F = p.frameResolution) == null ? void 0 : F.stale) ?? []
2005
+ const ce = [
2006
+ ...((q = w.frameResolution) == null ? void 0 : q.missing) ?? [],
2007
+ ...((Y = w.frameResolution) == null ? void 0 : Y.stale) ?? []
1986
2008
  ];
1987
2009
  return {
1988
2010
  status: "unavailable",
1989
- message: se.length ? `The exact preview endpoint did not return a current capture for ${se.join(", ")}.` : "The exact preview endpoint returned no current capture."
2011
+ message: ce.length ? `The exact preview endpoint did not return a current capture for ${ce.join(", ")}.` : "The exact preview endpoint returned no current capture."
1990
2012
  };
1991
2013
  }
1992
- return p.status === "rejected" ? {
2014
+ return w.status === "rejected" ? {
1993
2015
  status: "rejected",
1994
- message: p.errors.join(" ") || "The preview artifact was rejected."
2016
+ message: w.errors.join(" ") || "The preview artifact was rejected."
1995
2017
  } : {
1996
2018
  status: "unavailable",
1997
- message: E(
1998
- p.error,
2019
+ message: R(
2020
+ w.error,
1999
2021
  "The exact preview endpoint is unavailable."
2000
2022
  )
2001
2023
  };
2002
- }), _.current.length) {
2003
- const P = _.current.filter((p) => {
2004
- const N = ye(
2005
- p.id,
2006
- p.fingerprint
2024
+ }), z.current.length) {
2025
+ const C = z.current.filter((w) => {
2026
+ const O = Se(
2027
+ w.id,
2028
+ w.fingerprint
2007
2029
  ).status;
2008
- return N !== "exact" && N !== "generating";
2030
+ return O !== "exact" && O !== "generating";
2009
2031
  });
2010
- ae(P, { status: "checking" }), l(
2011
- _.current,
2032
+ de(C, { status: "checking" }), I(
2033
+ z.current,
2012
2034
  !1,
2013
- x.signal
2014
- ).then((p) => {
2015
- var F, K, se;
2016
- if (x.signal.aborted) return;
2017
- const N = (ie) => ie.filter((Ee) => {
2018
- const Ce = ye(
2019
- Ee.id,
2020
- Ee.fingerprint
2035
+ c.signal
2036
+ ).then((w) => {
2037
+ var Y, fe, ce;
2038
+ if (c.signal.aborted) return;
2039
+ const O = (le) => le.filter((Ne) => {
2040
+ const Ae = Se(
2041
+ Ne.id,
2042
+ Ne.fingerprint
2021
2043
  ).status;
2022
- return Ce !== "generating" && Ce !== "exact";
2044
+ return Ae !== "generating" && Ae !== "exact";
2023
2045
  });
2024
- if (p.status === "accepted") {
2025
- d(p.artifact), ae(
2026
- f(
2027
- _.current,
2028
- ((F = p.frameResolution) == null ? void 0 : F.exact) ?? []
2046
+ if (w.status === "accepted") {
2047
+ P(w.artifact), de(
2048
+ D(
2049
+ z.current,
2050
+ ((Y = w.frameResolution) == null ? void 0 : Y.exact) ?? []
2029
2051
  ),
2030
2052
  { status: "exact" }
2031
2053
  );
2032
- const ie = f(_.current, [
2033
- ...((K = p.frameResolution) == null ? void 0 : K.missing) ?? [],
2034
- ...((se = p.frameResolution) == null ? void 0 : se.stale) ?? []
2054
+ const le = D(z.current, [
2055
+ ...((fe = w.frameResolution) == null ? void 0 : fe.missing) ?? [],
2056
+ ...((ce = w.frameResolution) == null ? void 0 : ce.stale) ?? []
2035
2057
  ]);
2036
- ae(N(ie), {
2058
+ de(O(le), {
2037
2059
  status: "outdated",
2038
2060
  message: "Select this frame to generate the exact preview."
2039
2061
  });
2040
2062
  return;
2041
2063
  }
2042
- const O = p.status === "rejected" ? p.errors.join(" ") || "The preview artifact was rejected." : E(
2043
- p.error,
2064
+ const q = w.status === "rejected" ? w.errors.join(" ") || "The preview artifact was rejected." : R(
2065
+ w.error,
2044
2066
  "The exact preview endpoint is unavailable."
2045
2067
  );
2046
- ae(
2047
- N(_.current),
2068
+ de(
2069
+ O(z.current),
2048
2070
  {
2049
2071
  status: "error",
2050
- reason: p.status === "rejected" ? "rejected" : "unavailable",
2051
- message: O
2072
+ reason: w.status === "rejected" ? "rejected" : "unavailable",
2073
+ message: q
2052
2074
  }
2053
2075
  );
2054
- }).catch((p) => {
2055
- if (x.signal.aborted) return;
2056
- const N = _.current.filter((O) => {
2057
- const F = ye(
2058
- O.id,
2059
- O.fingerprint
2076
+ }).catch((w) => {
2077
+ if (c.signal.aborted) return;
2078
+ const O = z.current.filter((q) => {
2079
+ const Y = Se(
2080
+ q.id,
2081
+ q.fingerprint
2060
2082
  ).status;
2061
- return F !== "generating" && F !== "exact";
2083
+ return Y !== "generating" && Y !== "exact";
2062
2084
  });
2063
- ae(N, {
2085
+ de(O, {
2064
2086
  status: "error",
2065
2087
  reason: "unavailable",
2066
- message: E(
2067
- p,
2088
+ message: R(
2089
+ w,
2068
2090
  "The exact preview endpoint is unavailable."
2069
2091
  )
2070
2092
  });
2071
2093
  });
2072
2094
  }
2073
2095
  return () => {
2074
- Ae(null), C.abort(), x.abort();
2096
+ $e(null), K.abort(), c.abort();
2075
2097
  };
2076
2098
  }, [
2077
- w,
2099
+ h,
2078
2100
  g,
2079
- u,
2080
- c,
2081
- R
2082
- ]), oe(() => {
2083
- let x = !0;
2084
- if (!j)
2085
- return ce(void 0), T(!0), () => {
2086
- x = !1;
2101
+ p,
2102
+ f,
2103
+ M
2104
+ ]), ie(() => {
2105
+ let c = !0;
2106
+ if (!v)
2107
+ return ue(void 0), B(!0), () => {
2108
+ c = !1;
2087
2109
  };
2088
- const q = new AbortController();
2089
- return T(!1), ce(void 0), ee(null), Je({
2090
- endpoint: S,
2091
- signal: q.signal,
2092
- pages: J.pages.map((i) => ({
2093
- ...i,
2094
- id: i.importPageId ?? i.id,
2095
- importKind: i.importKind
2110
+ const d = new AbortController();
2111
+ return B(!1), ue(void 0), ne(null), Le({
2112
+ endpoint: E,
2113
+ signal: d.signal,
2114
+ pages: J.pages.map((u) => ({
2115
+ ...u,
2116
+ id: u.importPageId ?? u.id,
2117
+ importKind: u.importKind
2096
2118
  })),
2097
- assets: (o == null ? void 0 : o.getAssets("screens")) ?? []
2098
- }).then((i) => {
2099
- x && (ce(i.baselineEnvironment), $e(i.manifest.routes ?? null), ee(i.graph));
2119
+ assets: (i == null ? void 0 : i.getAssets("screens")) ?? []
2120
+ }).then((u) => {
2121
+ c && (ue(u.baselineEnvironment), Me(u.manifest.routes ?? null), ne(u.graph));
2100
2122
  }).catch(() => {
2101
- x && (ce(void 0), $e(null), ee(null));
2123
+ c && (ue(void 0), Me(null), ne(null));
2102
2124
  }).finally(() => {
2103
- x && T(!0);
2125
+ c && B(!0);
2104
2126
  }), () => {
2105
- x = !1, q.abort(), ce(void 0), ee(null);
2127
+ c = !1, d.abort(), ue(void 0), ne(null);
2106
2128
  };
2107
2129
  }, [
2130
+ i,
2108
2131
  o,
2109
- s,
2110
- j,
2111
- S
2112
- ]), oe(() => {
2113
- I == null || I === J.previewOpen || (I ? J.openPreview({ notifyHost: !1 }) : J.closePreview({ notifyHost: !1 }));
2114
- }, [I]), R ? /* @__PURE__ */ v(pt, {}) : /* @__PURE__ */ v(
2132
+ v,
2133
+ E
2134
+ ]), ie(() => {
2135
+ y == null || y === J.previewOpen || (y ? J.openPreview({ notifyHost: !1 }) : J.closePreview({ notifyHost: !1 }));
2136
+ }, [y]), M ? /* @__PURE__ */ b(bt, {}) : /* @__PURE__ */ b(
2115
2137
  "div",
2116
2138
  {
2117
2139
  "data-pygmalion-storyboard-loading": "",
@@ -2130,71 +2152,84 @@ function bn({
2130
2152
  );
2131
2153
  }
2132
2154
  export {
2133
- In as DESIGN_IMPORT_KINDS,
2134
- cn as PygmalionCatalogDocument,
2135
- dn as PygmalionCatalogMatrix,
2136
- ln as PygmalionCatalogSection,
2137
- bn as PygmalionEditor,
2138
- mt as STORYBOARD_ENVIRONMENT_CONTROL,
2139
- xn as STORYBOARD_ENVIRONMENT_QUERY,
2140
- mn as SourceRefControl,
2141
- pn as __debug,
2142
- Pn as applyTokenOverride,
2143
- gt as bootstrapPreviewArtifact,
2144
- En as clearPreviewEnvironmentControlValues,
2145
- Cn as clearPygmalionPreviewCache,
2146
- fn as createDesignComponentCatalog,
2147
- Jt as createDesignComponentVariantMatrix,
2148
- un as createDesignGalleryCatalog,
2149
- Rn as createDesignImportController,
2150
- Nn as createDesignScreenCollection,
2151
- ft as createPreviewArtifactHttpTransport,
2152
- An as createPreviewCacheNamespace,
2153
- $n as createPreviewFrameFingerprint,
2154
- On as createPreviewRecipeFingerprint,
2155
- Mn as createStoryboardCaptureRecipeIdentity,
2156
- Et as createStoryboardGraph,
2157
- Bt as createStoryboardGraphFromDiscovery,
2158
- kn as createStoryboardGraphViewModel,
2159
- Fn as createStoryboardRouteUrl,
2160
- qt as designCatalogKey,
2161
- Ve as designCatalogRegistryName,
2162
- Tn as expandDesignScreenCasesViewports,
2163
- Dn as expandDesignScreenCollectionViewports,
2164
- zn as getPreviewEnvironmentControlValue,
2165
- jn as getPreviewEnvironmentControls,
2166
- _n as getPreviewEnvironmentOverride,
2167
- Bn as getRecommendedPygmalionPreviewConcurrency,
2168
- ge as getStoryboardBaselineEnvironment,
2169
- Ge as getStoryboardDiscoveryBaselineEnvironment,
2170
- Un as getStoryboardGraph,
2171
- Hn as getViewportPresets,
2172
- Je as loadStoryboardDiscovery,
2173
- qn as mergeScreenPresets,
2174
- Le as mergeStoryboardEnvironment,
2175
- an as publishStoryboardDiscovery,
2176
- gn as pygmalionNavigate,
2177
- yn as pygmalionOpenPreview,
2178
- wn as pygmalionResetCurrentEdits,
2179
- Kn as reconstructRoutePreviewArtifactScreenshotV3,
2180
- Gn as reconstructRoutePreviewArtifactSnapshotV3,
2181
- Jn as resetTokenOverrides,
2182
- Vn as resolvePreviewArtifactFrames,
2183
- Ot as resolveStoryboardScreenCases,
2184
- et as setComponentRegistry,
2185
- Wn as setPreviewEnvironmentControlValue,
2186
- rt as setPreviewEnvironmentControls,
2187
- ot as setPygmalionAppOrigin,
2188
- ct as setPygmalionPreviewConcurrency,
2189
- st as setPygmalionPreviewRevision,
2190
- ce as setStoryboardBaselineEnvironment,
2191
- ee as setStoryboardGraph,
2192
- tt as setTokens,
2193
- nt as setViewportPresets,
2194
- It as storyboardScreenRecipeKey,
2195
- Qn as subscribePreviewEnvironmentControls,
2196
- Ln as subscribeStoryboardGraph,
2197
- hn as usePygmalionProject,
2198
- Xn as validatePreviewArtifactBundle,
2199
- Yn as validateRoutePreviewArtifactV3Browser
2155
+ Rn as DEFAULT_DESIGN_COMPILE_LIMITS,
2156
+ Nn as DESIGN_IMPORT_KINDS,
2157
+ An as DESIGN_IR_SCHEMA,
2158
+ On as DESIGN_IR_VERSION,
2159
+ gn as PygmalionCatalogDocument,
2160
+ pn as PygmalionCatalogMatrix,
2161
+ mn as PygmalionCatalogSection,
2162
+ Pn as PygmalionEditor,
2163
+ wt as STORYBOARD_ENVIRONMENT_CONTROL,
2164
+ $n as STORYBOARD_ENVIRONMENT_QUERY,
2165
+ bn as SourceRefControl,
2166
+ Sn as __debug,
2167
+ Mn as applyTokenOverride,
2168
+ vt as bootstrapPreviewArtifact,
2169
+ Dn as clearPreviewEnvironmentControlValues,
2170
+ kn as clearPygmalionPreviewCache,
2171
+ Fn as compileDesignDocument,
2172
+ yn as createDesignComponentCatalog,
2173
+ Xt as createDesignComponentVariantMatrix,
2174
+ hn as createDesignGalleryCatalog,
2175
+ Tn as createDesignImportController,
2176
+ zn as createDesignIntermediateDocument,
2177
+ _n as createDesignScreenCollection,
2178
+ ht as createPreviewArtifactHttpTransport,
2179
+ jn as createPreviewCacheNamespace,
2180
+ Bn as createPreviewFrameFingerprint,
2181
+ Un as createPreviewRecipeFingerprint,
2182
+ Hn as createStoryboardCaptureRecipeIdentity,
2183
+ Ot as createStoryboardGraph,
2184
+ Kt as createStoryboardGraphFromDiscovery,
2185
+ qn as createStoryboardGraphViewModel,
2186
+ Gn as createStoryboardRouteUrl,
2187
+ Wt as designCatalogKey,
2188
+ Qe as designCatalogRegistryName,
2189
+ Kn as enumerateDesignComponentConnectionCases,
2190
+ Vn as expandDesignScreenCasesViewports,
2191
+ Jn as expandDesignScreenCollectionViewports,
2192
+ Wn as getDesignCodegenAdapters,
2193
+ Ln as getDesignComponentConnection,
2194
+ Qn as getDesignComponentConnectionForComponent,
2195
+ Xn as getDesignComponentConnections,
2196
+ Yn as getPreviewEnvironmentControlValue,
2197
+ Zn as getPreviewEnvironmentControls,
2198
+ er as getPreviewEnvironmentOverride,
2199
+ tr as getRecommendedPygmalionPreviewConcurrency,
2200
+ be as getStoryboardBaselineEnvironment,
2201
+ We as getStoryboardDiscoveryBaselineEnvironment,
2202
+ nr as getStoryboardGraph,
2203
+ rr as getViewportPresets,
2204
+ Le as loadStoryboardDiscovery,
2205
+ or as mergeScreenPresets,
2206
+ Ze as mergeStoryboardEnvironment,
2207
+ fn as publishStoryboardDiscovery,
2208
+ vn as pygmalionNavigate,
2209
+ In as pygmalionOpenPreview,
2210
+ xn as pygmalionResetCurrentEdits,
2211
+ sr as reconstructRoutePreviewArtifactScreenshotV3,
2212
+ ir as reconstructRoutePreviewArtifactSnapshotV3,
2213
+ ar as registerDesignCodegenAdapter,
2214
+ cr as resetTokenOverrides,
2215
+ lr as resolvePreviewArtifactFrames,
2216
+ Tt as resolveStoryboardScreenCases,
2217
+ rt as setComponentRegistry,
2218
+ ot as setDesignComponentConnections,
2219
+ dr as setPreviewEnvironmentControlValue,
2220
+ mt as setPreviewEnvironmentControls,
2221
+ ft as setPygmalionAppOrigin,
2222
+ lt as setPygmalionPreviewConcurrency,
2223
+ gt as setPygmalionPreviewRevision,
2224
+ ue as setStoryboardBaselineEnvironment,
2225
+ ne as setStoryboardGraph,
2226
+ st as setTokens,
2227
+ it as setViewportPresets,
2228
+ Rt as storyboardScreenRecipeKey,
2229
+ ur as subscribePreviewEnvironmentControls,
2230
+ fr as subscribeStoryboardGraph,
2231
+ wn as usePygmalionProject,
2232
+ gr as validateDesignComponentConnections,
2233
+ mr as validatePreviewArtifactBundle,
2234
+ pr as validateRoutePreviewArtifactV3Browser
2200
2235
  };