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