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