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