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