@pygmalionjs/pygmalion 0.2.38 → 0.2.40

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