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