@metapages/metapage 1.1.0 → 1.2.0
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/index.js +927 -769
- package/dist/index.js.map +1 -1
- package/dist/metapage/Metaframe.d.ts +14 -0
- package/dist/metapage/Metaframe.d.ts.map +1 -1
- package/dist/metapage/Metapage.d.ts.map +1 -1
- package/dist/metapage/MetapageIFrameRpcClient.d.ts.map +1 -1
- package/package.json +11 -2
- package/src/metapage/Metaframe.ts +112 -15
- package/src/metapage/Metapage.ts +1 -5
- package/src/metapage/MetapageIFrameRpcClient.ts +0 -5
package/dist/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Et = ["0.3", "0.4", "0.5", "0.6", "1"], Mt = ["0.2", "0.3", "1"], pt = "1", Je = "1", _i = "metaframe.json", gi = "metapage/definition", bi = "metapage/state", Vt = Mt[Mt.length - 1], An = Et[Et.length - 1], Sn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, It = (e) => {
|
|
2
2
|
if (typeof e != "string")
|
|
3
3
|
throw new TypeError("Invalid argument expected string");
|
|
4
|
-
const t = e.match(
|
|
4
|
+
const t = e.match(Sn);
|
|
5
5
|
if (!t)
|
|
6
6
|
throw new Error(`Invalid argument not valid semver ('${e}' received)`);
|
|
7
7
|
return t.shift(), t;
|
|
8
|
-
},
|
|
8
|
+
}, Ct = (e) => e === "*" || e === "x" || e === "X", $t = (e) => {
|
|
9
9
|
const t = parseInt(e, 10);
|
|
10
10
|
return isNaN(t) ? e : t;
|
|
11
|
-
},
|
|
12
|
-
if (
|
|
11
|
+
}, En = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Mn = (e, t) => {
|
|
12
|
+
if (Ct(e) || Ct(t))
|
|
13
13
|
return 0;
|
|
14
|
-
const [n, s] =
|
|
14
|
+
const [n, s] = En($t(e), $t(t));
|
|
15
15
|
return n > s ? 1 : n < s ? -1 : 0;
|
|
16
|
-
},
|
|
16
|
+
}, xt = (e, t) => {
|
|
17
17
|
for (let n = 0; n < Math.max(e.length, t.length); n++) {
|
|
18
|
-
const s =
|
|
18
|
+
const s = Mn(e[n] || "0", t[n] || "0");
|
|
19
19
|
if (s !== 0)
|
|
20
20
|
return s;
|
|
21
21
|
}
|
|
22
22
|
return 0;
|
|
23
23
|
}, V = (e, t) => {
|
|
24
|
-
const n =
|
|
25
|
-
return r !== 0 ? r : i && o ?
|
|
24
|
+
const n = It(e), s = It(t), i = n.pop(), o = s.pop(), r = xt(n, s);
|
|
25
|
+
return r !== 0 ? r : i && o ? xt(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
|
|
26
26
|
};
|
|
27
|
-
var
|
|
28
|
-
function
|
|
27
|
+
var In = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
28
|
+
function ht(e) {
|
|
29
29
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var Jt = { exports: {} };
|
|
32
32
|
(function(e, t) {
|
|
33
33
|
(function(n, s) {
|
|
34
34
|
e.exports = s();
|
|
35
|
-
})(
|
|
35
|
+
})(In, function() {
|
|
36
36
|
var n = function(o, r) {
|
|
37
37
|
if (r = r || {}, typeof o != "function")
|
|
38
38
|
throw new i("fetch must be a function");
|
|
@@ -50,7 +50,7 @@ var Gt = { exports: {} };
|
|
|
50
50
|
retryOn: []
|
|
51
51
|
};
|
|
52
52
|
return r = Object.assign(a, r), function(f, c) {
|
|
53
|
-
var d = r.retries,
|
|
53
|
+
var d = r.retries, y = r.retryDelay, w = r.retryOn;
|
|
54
54
|
if (c && c.retries !== void 0)
|
|
55
55
|
if (s(c.retries))
|
|
56
56
|
d = c.retries;
|
|
@@ -58,7 +58,7 @@ var Gt = { exports: {} };
|
|
|
58
58
|
throw new i("retries must be a positive integer");
|
|
59
59
|
if (c && c.retryDelay !== void 0)
|
|
60
60
|
if (s(c.retryDelay) || typeof c.retryDelay == "function")
|
|
61
|
-
|
|
61
|
+
y = c.retryDelay;
|
|
62
62
|
else
|
|
63
63
|
throw new i("retryDelay must be a positive integer or a function returning a positive integer");
|
|
64
64
|
if (c && c.retryOn)
|
|
@@ -66,39 +66,39 @@ var Gt = { exports: {} };
|
|
|
66
66
|
w = c.retryOn;
|
|
67
67
|
else
|
|
68
68
|
throw new i("retryOn property expects an array or function");
|
|
69
|
-
return new Promise(function(
|
|
69
|
+
return new Promise(function(_, S) {
|
|
70
70
|
var v = function(b) {
|
|
71
|
-
var
|
|
72
|
-
o(
|
|
71
|
+
var A = typeof Request < "u" && f instanceof Request ? f.clone() : f;
|
|
72
|
+
o(A, c).then(function(M) {
|
|
73
73
|
if (Array.isArray(w) && w.indexOf(M.status) === -1)
|
|
74
|
-
|
|
74
|
+
_(M);
|
|
75
75
|
else if (typeof w == "function")
|
|
76
76
|
try {
|
|
77
77
|
return Promise.resolve(w(b, null, M)).then(function(R) {
|
|
78
|
-
R ? x(b, null, M) :
|
|
79
|
-
}).catch(
|
|
78
|
+
R ? x(b, null, M) : _(M);
|
|
79
|
+
}).catch(S);
|
|
80
80
|
} catch (R) {
|
|
81
|
-
|
|
81
|
+
S(R);
|
|
82
82
|
}
|
|
83
83
|
else
|
|
84
|
-
b < d ? x(b, null, M) :
|
|
84
|
+
b < d ? x(b, null, M) : _(M);
|
|
85
85
|
}).catch(function(M) {
|
|
86
86
|
if (typeof w == "function")
|
|
87
87
|
try {
|
|
88
88
|
Promise.resolve(w(b, M, null)).then(function(R) {
|
|
89
|
-
R ? x(b, M, null) :
|
|
89
|
+
R ? x(b, M, null) : S(M);
|
|
90
90
|
}).catch(function(R) {
|
|
91
|
-
|
|
91
|
+
S(R);
|
|
92
92
|
});
|
|
93
93
|
} catch (R) {
|
|
94
|
-
|
|
94
|
+
S(R);
|
|
95
95
|
}
|
|
96
96
|
else
|
|
97
|
-
b < d ? x(b, M, null) :
|
|
97
|
+
b < d ? x(b, M, null) : S(M);
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
-
function x(b,
|
|
101
|
-
var R = typeof
|
|
100
|
+
function x(b, A, M) {
|
|
101
|
+
var R = typeof y == "function" ? y(b, A, M) : y;
|
|
102
102
|
setTimeout(function() {
|
|
103
103
|
v(++b);
|
|
104
104
|
}, R);
|
|
@@ -115,20 +115,20 @@ var Gt = { exports: {} };
|
|
|
115
115
|
}
|
|
116
116
|
return n;
|
|
117
117
|
});
|
|
118
|
-
})(
|
|
119
|
-
var
|
|
120
|
-
const
|
|
118
|
+
})(Jt);
|
|
119
|
+
var Cn = Jt.exports;
|
|
120
|
+
const dt = /* @__PURE__ */ ht(Cn), B = {
|
|
121
121
|
Remove: "remove",
|
|
122
122
|
Replace: "replace",
|
|
123
123
|
Add: "add"
|
|
124
|
-
},
|
|
124
|
+
}, Wt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), $n = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Ue = Symbol.iterator, Y = {
|
|
125
125
|
mutable: "mutable",
|
|
126
126
|
immutable: "immutable"
|
|
127
|
-
},
|
|
128
|
-
function
|
|
127
|
+
}, mt = {};
|
|
128
|
+
function Ie(e, t) {
|
|
129
129
|
return e instanceof Map ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Lt(e, t) {
|
|
132
132
|
if (t in e) {
|
|
133
133
|
let n = Reflect.getPrototypeOf(e);
|
|
134
134
|
for (; n; ) {
|
|
@@ -139,7 +139,7 @@ function $t(e, t) {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Q(e) {
|
|
143
143
|
var t;
|
|
144
144
|
return (t = e.copy) !== null && t !== void 0 ? t : e.original;
|
|
145
145
|
}
|
|
@@ -147,9 +147,9 @@ function ge(e) {
|
|
|
147
147
|
return !!$(e);
|
|
148
148
|
}
|
|
149
149
|
function $(e) {
|
|
150
|
-
return typeof e != "object" ? null : e == null ? void 0 : e[
|
|
150
|
+
return typeof e != "object" ? null : e == null ? void 0 : e[Wt];
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function yt(e) {
|
|
153
153
|
var t;
|
|
154
154
|
const n = $(e);
|
|
155
155
|
return n ? (t = n.copy) !== null && t !== void 0 ? t : n.original : e;
|
|
@@ -162,11 +162,11 @@ function ee(e, t) {
|
|
|
162
162
|
}
|
|
163
163
|
function Kt(e, t = []) {
|
|
164
164
|
if (Object.hasOwnProperty.call(e, "key")) {
|
|
165
|
-
const n = e.parent.copy, s = $(
|
|
165
|
+
const n = e.parent.copy, s = $(pe(n, e.key));
|
|
166
166
|
if (s !== null && (s == null ? void 0 : s.original) !== e.original)
|
|
167
167
|
return null;
|
|
168
168
|
const i = e.parent.type === 3, o = i ? Array.from(e.parent.setMap.keys()).indexOf(e.key) : e.key;
|
|
169
|
-
if (!(i && n.size > o ||
|
|
169
|
+
if (!(i && n.size > o || Ie(n, o)))
|
|
170
170
|
return null;
|
|
171
171
|
t.push(o);
|
|
172
172
|
}
|
|
@@ -174,7 +174,7 @@ function Kt(e, t = []) {
|
|
|
174
174
|
return Kt(e.parent, t);
|
|
175
175
|
t.reverse();
|
|
176
176
|
try {
|
|
177
|
-
|
|
177
|
+
xn(e.copy, t);
|
|
178
178
|
} catch {
|
|
179
179
|
return null;
|
|
180
180
|
}
|
|
@@ -183,20 +183,20 @@ function Kt(e, t = []) {
|
|
|
183
183
|
function be(e) {
|
|
184
184
|
return Array.isArray(e) ? 1 : e instanceof Map ? 2 : e instanceof Set ? 3 : 0;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function pe(e, t) {
|
|
187
187
|
return be(e) === 2 ? e.get(t) : e[t];
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Le(e, t, n) {
|
|
190
190
|
be(e) === 2 ? e.set(t, n) : e[t] = n;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function Ye(e, t) {
|
|
193
193
|
const n = $(e);
|
|
194
|
-
return (n ?
|
|
194
|
+
return (n ? Q(n) : e)[t];
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function le(e, t) {
|
|
197
197
|
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function it(e) {
|
|
200
200
|
if (e)
|
|
201
201
|
for (; e.finalities.revoke.length > 0; )
|
|
202
202
|
e.finalities.revoke.pop()();
|
|
@@ -207,15 +207,15 @@ function _e(e, t) {
|
|
|
207
207
|
return s.indexOf("/") === -1 && s.indexOf("~") === -1 ? s : s.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
208
208
|
}).join("/");
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function xn(e, t) {
|
|
211
211
|
for (let n = 0; n < t.length - 1; n += 1) {
|
|
212
212
|
const s = t[n];
|
|
213
|
-
if (e =
|
|
213
|
+
if (e = pe(be(e) === 3 ? Array.from(e) : e, s), typeof e != "object")
|
|
214
214
|
throw new Error(`Cannot resolve patch at '${t.join("/")}'.`);
|
|
215
215
|
}
|
|
216
216
|
return e;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Ln(e) {
|
|
219
219
|
const t = Object.create(Object.getPrototypeOf(e));
|
|
220
220
|
return Reflect.ownKeys(e).forEach((n) => {
|
|
221
221
|
let s = Reflect.getOwnPropertyDescriptor(e, n);
|
|
@@ -231,8 +231,8 @@ function On(e) {
|
|
|
231
231
|
}), Reflect.defineProperty(t, n, s);
|
|
232
232
|
}), t;
|
|
233
233
|
}
|
|
234
|
-
const
|
|
235
|
-
function
|
|
234
|
+
const Pn = Object.prototype.propertyIsEnumerable;
|
|
235
|
+
function Xt(e, t) {
|
|
236
236
|
let n;
|
|
237
237
|
if (Array.isArray(e))
|
|
238
238
|
return Array.prototype.concat.call(e);
|
|
@@ -242,7 +242,7 @@ function Wt(e, t) {
|
|
|
242
242
|
return new Map(e);
|
|
243
243
|
if (t != null && t.mark && (n = t.mark(e, Y), n !== void 0) && n !== Y.mutable) {
|
|
244
244
|
if (n === Y.immutable)
|
|
245
|
-
return
|
|
245
|
+
return Ln(e);
|
|
246
246
|
if (typeof n == "function") {
|
|
247
247
|
if (t.enablePatches || t.enableAutoFreeze)
|
|
248
248
|
throw new Error("You can't use mark and patches or auto freeze together.");
|
|
@@ -254,17 +254,17 @@ function Wt(e, t) {
|
|
|
254
254
|
return Object.keys(e).forEach((i) => {
|
|
255
255
|
s[i] = e[i];
|
|
256
256
|
}), Object.getOwnPropertySymbols(e).forEach((i) => {
|
|
257
|
-
|
|
257
|
+
Pn.call(e, i) && (s[i] = e[i]);
|
|
258
258
|
}), s;
|
|
259
259
|
} else
|
|
260
260
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
e.copy || (e.copy =
|
|
262
|
+
function K(e) {
|
|
263
|
+
e.copy || (e.copy = Xt(e.original, e.options));
|
|
264
264
|
}
|
|
265
265
|
function Se(e) {
|
|
266
266
|
if (!ee(e))
|
|
267
|
-
return
|
|
267
|
+
return yt(e);
|
|
268
268
|
if (Array.isArray(e))
|
|
269
269
|
return e.map(Se);
|
|
270
270
|
if (e instanceof Map)
|
|
@@ -276,14 +276,14 @@ function Se(e) {
|
|
|
276
276
|
t[n] = Se(e[n]);
|
|
277
277
|
return t;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Be(e) {
|
|
280
280
|
return ge(e) ? Se(e) : e;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function oe(e) {
|
|
283
283
|
var t;
|
|
284
|
-
e.assignedMap = (t = e.assignedMap) !== null && t !== void 0 ? t : /* @__PURE__ */ new Map(), e.operated || (e.operated = !0, e.parent &&
|
|
284
|
+
e.assignedMap = (t = e.assignedMap) !== null && t !== void 0 ? t : /* @__PURE__ */ new Map(), e.operated || (e.operated = !0, e.parent && oe(e.parent));
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function Pt() {
|
|
287
287
|
throw new Error("Cannot modify frozen object");
|
|
288
288
|
}
|
|
289
289
|
function we(e, t, n, s, i) {
|
|
@@ -311,12 +311,12 @@ function we(e, t, n, s, i) {
|
|
|
311
311
|
case 2:
|
|
312
312
|
for (const [a, u] of e)
|
|
313
313
|
we(a, a, n, s, i), we(u, a, n, s, i);
|
|
314
|
-
e.set = e.clear = e.delete =
|
|
314
|
+
e.set = e.clear = e.delete = Pt;
|
|
315
315
|
break;
|
|
316
316
|
case 3:
|
|
317
317
|
for (const a of e)
|
|
318
318
|
we(a, a, n, s, i);
|
|
319
|
-
e.add = e.clear = e.delete =
|
|
319
|
+
e.add = e.clear = e.delete = Pt;
|
|
320
320
|
break;
|
|
321
321
|
case 1:
|
|
322
322
|
Object.freeze(e);
|
|
@@ -332,7 +332,7 @@ function we(e, t, n, s, i) {
|
|
|
332
332
|
}
|
|
333
333
|
s.pop(), i.pop();
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function _t(e, t) {
|
|
336
336
|
const n = be(e);
|
|
337
337
|
if (n === 0)
|
|
338
338
|
Reflect.ownKeys(e).forEach((s) => {
|
|
@@ -345,19 +345,19 @@ function mt(e, t) {
|
|
|
345
345
|
} else
|
|
346
346
|
e.forEach((s, i) => t(i, s, e));
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function qt(e, t, n) {
|
|
349
349
|
if (ge(e) || !ee(e, n) || t.has(e) || Object.isFrozen(e))
|
|
350
350
|
return;
|
|
351
351
|
const s = e instanceof Set, i = s ? /* @__PURE__ */ new Map() : void 0;
|
|
352
|
-
if (t.add(e),
|
|
352
|
+
if (t.add(e), _t(e, (o, r) => {
|
|
353
353
|
var a;
|
|
354
354
|
if (ge(r)) {
|
|
355
355
|
const u = $(r);
|
|
356
|
-
|
|
356
|
+
K(u);
|
|
357
357
|
const f = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
|
|
358
|
-
|
|
358
|
+
Le(s ? i : e, o, f);
|
|
359
359
|
} else
|
|
360
|
-
|
|
360
|
+
qt(r, t, n);
|
|
361
361
|
}), i) {
|
|
362
362
|
const o = e, r = Array.from(o);
|
|
363
363
|
o.clear(), r.forEach((a) => {
|
|
@@ -365,16 +365,16 @@ function Jt(e, t, n) {
|
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Tn(e, t) {
|
|
369
369
|
const n = e.type === 3 ? e.setMap : e.copy;
|
|
370
|
-
e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n &&
|
|
370
|
+
e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n && qt(pe(n, t), e.finalities.handledSet, e.options);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function rt(e) {
|
|
373
373
|
e.type === 3 && e.copy && (e.copy.clear(), e.setMap.forEach((t) => {
|
|
374
|
-
e.copy.add(
|
|
374
|
+
e.copy.add(yt(t));
|
|
375
375
|
}));
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function ot(e, t, n, s) {
|
|
378
378
|
if (e.operated && e.assignedMap && e.assignedMap.size > 0 && !e.finalized) {
|
|
379
379
|
if (n && s) {
|
|
380
380
|
const o = Kt(e);
|
|
@@ -383,45 +383,45 @@ function it(e, t, n, s) {
|
|
|
383
383
|
e.finalized = !0;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function gt(e, t, n, s) {
|
|
387
387
|
const i = $(n);
|
|
388
388
|
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, r) => {
|
|
389
389
|
var a;
|
|
390
390
|
const u = e.type === 3 ? e.setMap : e.copy;
|
|
391
|
-
if (
|
|
391
|
+
if (le(pe(u, t), n)) {
|
|
392
392
|
let f = i.original;
|
|
393
|
-
i.copy && (f = i.copy),
|
|
393
|
+
i.copy && (f = i.copy), rt(e), ot(e, s, o, r), e.options.enableAutoFreeze && (e.options.updatedValues = (a = e.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), e.options.updatedValues.set(f, i.original)), Le(u, t, f);
|
|
394
394
|
}
|
|
395
395
|
}), e.options.enableAutoFreeze && i.finalities !== e.finalities && (e.options.enableAutoFreeze = !1)), ee(n, e.options) && e.finalities.draft.push(() => {
|
|
396
396
|
const o = e.type === 3 ? e.setMap : e.copy;
|
|
397
|
-
|
|
397
|
+
le(pe(o, t), n) && Tn(e, t);
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function Dn(e, t, n, s, i) {
|
|
401
401
|
let { original: o, assignedMap: r, options: a } = e, u = e.copy;
|
|
402
402
|
u.length < o.length && ([o, u] = [u, o], [n, s] = [s, n]);
|
|
403
403
|
for (let f = 0; f < o.length; f += 1)
|
|
404
404
|
if (r.get(f.toString()) && u[f] !== o[f]) {
|
|
405
405
|
const c = t.concat([f]), d = _e(c, i);
|
|
406
406
|
n.push({
|
|
407
|
-
op:
|
|
407
|
+
op: B.Replace,
|
|
408
408
|
path: d,
|
|
409
409
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
410
|
-
value:
|
|
410
|
+
value: Be(u[f])
|
|
411
411
|
}), s.push({
|
|
412
|
-
op:
|
|
412
|
+
op: B.Replace,
|
|
413
413
|
path: d,
|
|
414
414
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
415
|
-
value:
|
|
415
|
+
value: Be(o[f])
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
for (let f = o.length; f < u.length; f += 1) {
|
|
419
419
|
const c = t.concat([f]), d = _e(c, i);
|
|
420
420
|
n.push({
|
|
421
|
-
op:
|
|
421
|
+
op: B.Add,
|
|
422
422
|
path: d,
|
|
423
423
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
424
|
-
value:
|
|
424
|
+
value: Be(u[f])
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
if (o.length < u.length) {
|
|
@@ -429,40 +429,40 @@ function In(e, t, n, s, i) {
|
|
|
429
429
|
if (f) {
|
|
430
430
|
const c = t.concat(["length"]), d = _e(c, i);
|
|
431
431
|
s.push({
|
|
432
|
-
op:
|
|
432
|
+
op: B.Replace,
|
|
433
433
|
path: d,
|
|
434
434
|
value: o.length
|
|
435
435
|
});
|
|
436
436
|
} else
|
|
437
437
|
for (let c = u.length; o.length < c; c -= 1) {
|
|
438
|
-
const d = t.concat([c - 1]),
|
|
438
|
+
const d = t.concat([c - 1]), y = _e(d, i);
|
|
439
439
|
s.push({
|
|
440
|
-
op:
|
|
441
|
-
path:
|
|
440
|
+
op: B.Remove,
|
|
441
|
+
path: y
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function Hn({ original: e, copy: t, assignedMap: n }, s, i, o, r) {
|
|
447
447
|
n.forEach((a, u) => {
|
|
448
|
-
const f =
|
|
449
|
-
if (
|
|
448
|
+
const f = pe(e, u), c = Be(pe(t, u)), d = a ? Ie(e, u) ? B.Replace : B.Add : B.Remove;
|
|
449
|
+
if (le(f, c) && d === B.Replace)
|
|
450
450
|
return;
|
|
451
|
-
const
|
|
452
|
-
i.push(d ===
|
|
451
|
+
const y = s.concat(u), w = _e(y, r);
|
|
452
|
+
i.push(d === B.Remove ? { op: d, path: w } : { op: d, path: w, value: c }), o.push(d === B.Add ? { op: B.Remove, path: w } : d === B.Remove ? { op: B.Add, path: w, value: f } : { op: B.Replace, path: w, value: f });
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Nn({ original: e, copy: t }, n, s, i, o) {
|
|
456
456
|
let r = 0;
|
|
457
457
|
e.forEach((a) => {
|
|
458
458
|
if (!t.has(a)) {
|
|
459
459
|
const u = n.concat([r]), f = _e(u, o);
|
|
460
460
|
s.push({
|
|
461
|
-
op:
|
|
461
|
+
op: B.Remove,
|
|
462
462
|
path: f,
|
|
463
463
|
value: a
|
|
464
464
|
}), i.unshift({
|
|
465
|
-
op:
|
|
465
|
+
op: B.Add,
|
|
466
466
|
path: f,
|
|
467
467
|
value: a
|
|
468
468
|
});
|
|
@@ -472,11 +472,11 @@ function $n({ original: e, copy: t }, n, s, i, o) {
|
|
|
472
472
|
if (!e.has(a)) {
|
|
473
473
|
const u = n.concat([r]), f = _e(u, o);
|
|
474
474
|
s.push({
|
|
475
|
-
op:
|
|
475
|
+
op: B.Add,
|
|
476
476
|
path: f,
|
|
477
477
|
value: a
|
|
478
478
|
}), i.unshift({
|
|
479
|
-
op:
|
|
479
|
+
op: B.Remove,
|
|
480
480
|
path: f,
|
|
481
481
|
value: a
|
|
482
482
|
});
|
|
@@ -484,43 +484,43 @@ function $n({ original: e, copy: t }, n, s, i, o) {
|
|
|
484
484
|
r += 1;
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function $e(e, t, n, s) {
|
|
488
488
|
const { pathAsArray: i = !0 } = e.options.enablePatches;
|
|
489
489
|
switch (e.type) {
|
|
490
490
|
case 0:
|
|
491
491
|
case 2:
|
|
492
|
-
return
|
|
492
|
+
return Hn(e, t, n, s, i);
|
|
493
493
|
case 1:
|
|
494
|
-
return
|
|
494
|
+
return Dn(e, t, n, s, i);
|
|
495
495
|
case 3:
|
|
496
|
-
return
|
|
496
|
+
return Nn(e, t, n, s, i);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
let
|
|
500
|
-
const
|
|
501
|
-
if (typeof e == "object" && e !== null && (!ee(e, t) || n) && !
|
|
499
|
+
let kn = !1;
|
|
500
|
+
const Fe = (e, t, n = !1) => {
|
|
501
|
+
if (typeof e == "object" && e !== null && (!ee(e, t) || n) && !kn)
|
|
502
502
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
503
|
-
},
|
|
503
|
+
}, at = {
|
|
504
504
|
get size() {
|
|
505
|
-
return
|
|
505
|
+
return Q($(this)).size;
|
|
506
506
|
},
|
|
507
507
|
has(e) {
|
|
508
|
-
return
|
|
508
|
+
return Q($(this)).has(e);
|
|
509
509
|
},
|
|
510
510
|
set(e, t) {
|
|
511
|
-
const n = $(this), s =
|
|
512
|
-
return (!s.has(e) || !
|
|
511
|
+
const n = $(this), s = Q(n);
|
|
512
|
+
return (!s.has(e) || !le(s.get(e), t)) && (K(n), oe(n), n.assignedMap.set(e, !0), n.copy.set(e, t), gt(n, e, t, $e)), this;
|
|
513
513
|
},
|
|
514
514
|
delete(e) {
|
|
515
515
|
if (!this.has(e))
|
|
516
516
|
return !1;
|
|
517
517
|
const t = $(this);
|
|
518
|
-
return
|
|
518
|
+
return K(t), oe(t), t.original.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.copy.delete(e), !0;
|
|
519
519
|
},
|
|
520
520
|
clear() {
|
|
521
521
|
const e = $(this);
|
|
522
522
|
if (this.size) {
|
|
523
|
-
|
|
523
|
+
K(e), oe(e), e.assignedMap = /* @__PURE__ */ new Map();
|
|
524
524
|
for (const [t] of e.original)
|
|
525
525
|
e.assignedMap.set(t, !1);
|
|
526
526
|
e.copy.clear();
|
|
@@ -528,31 +528,31 @@ const Ue = (e, t, n = !1) => {
|
|
|
528
528
|
},
|
|
529
529
|
forEach(e, t) {
|
|
530
530
|
const n = $(this);
|
|
531
|
-
|
|
531
|
+
Q(n).forEach((s, i) => {
|
|
532
532
|
e.call(t, this.get(i), i, this);
|
|
533
533
|
});
|
|
534
534
|
},
|
|
535
535
|
get(e) {
|
|
536
536
|
var t, n;
|
|
537
|
-
const s = $(this), i =
|
|
538
|
-
if (s.options.strict &&
|
|
537
|
+
const s = $(this), i = Q(s).get(e), o = ((n = (t = s.options).mark) === null || n === void 0 ? void 0 : n.call(t, i, Y)) === Y.mutable;
|
|
538
|
+
if (s.options.strict && Fe(i, s.options, o), o || s.finalized || !ee(i, s.options) || i !== s.original.get(e))
|
|
539
539
|
return i;
|
|
540
|
-
const r =
|
|
540
|
+
const r = mt.createDraft({
|
|
541
541
|
original: i,
|
|
542
542
|
parentDraft: s,
|
|
543
543
|
key: e,
|
|
544
544
|
finalities: s.finalities,
|
|
545
545
|
options: s.options
|
|
546
546
|
});
|
|
547
|
-
return
|
|
547
|
+
return K(s), s.copy.set(e, r), r;
|
|
548
548
|
},
|
|
549
549
|
keys() {
|
|
550
|
-
return
|
|
550
|
+
return Q($(this)).keys();
|
|
551
551
|
},
|
|
552
552
|
values() {
|
|
553
553
|
const e = this.keys();
|
|
554
554
|
return {
|
|
555
|
-
[
|
|
555
|
+
[Ue]: () => this.values(),
|
|
556
556
|
next: () => {
|
|
557
557
|
const t = e.next();
|
|
558
558
|
return t.done ? t : {
|
|
@@ -565,7 +565,7 @@ const Ue = (e, t, n = !1) => {
|
|
|
565
565
|
entries() {
|
|
566
566
|
const e = this.keys();
|
|
567
567
|
return {
|
|
568
|
-
[
|
|
568
|
+
[Ue]: () => this.entries(),
|
|
569
569
|
next: () => {
|
|
570
570
|
const t = e.next();
|
|
571
571
|
if (t.done)
|
|
@@ -578,10 +578,10 @@ const Ue = (e, t, n = !1) => {
|
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
580
|
},
|
|
581
|
-
[
|
|
581
|
+
[Ue]() {
|
|
582
582
|
return this.entries();
|
|
583
583
|
}
|
|
584
|
-
},
|
|
584
|
+
}, jn = Reflect.ownKeys(at), Tt = (e, t, { isValuesIterator: n }) => () => {
|
|
585
585
|
var s, i;
|
|
586
586
|
const o = t.next();
|
|
587
587
|
if (o.done)
|
|
@@ -589,8 +589,8 @@ const Ue = (e, t, n = !1) => {
|
|
|
589
589
|
const r = o.value;
|
|
590
590
|
let a = e.setMap.get(r);
|
|
591
591
|
const u = $(a), f = ((i = (s = e.options).mark) === null || i === void 0 ? void 0 : i.call(s, a, Y)) === Y.mutable;
|
|
592
|
-
if (e.options.strict &&
|
|
593
|
-
const c =
|
|
592
|
+
if (e.options.strict && Fe(r, e.options, f), !f && !u && ee(r, e.options) && !e.finalized && e.original.has(r)) {
|
|
593
|
+
const c = mt.createDraft({
|
|
594
594
|
original: r,
|
|
595
595
|
parentDraft: e,
|
|
596
596
|
key: r,
|
|
@@ -604,7 +604,7 @@ const Ue = (e, t, n = !1) => {
|
|
|
604
604
|
done: !1,
|
|
605
605
|
value: n ? a : [a, a]
|
|
606
606
|
};
|
|
607
|
-
},
|
|
607
|
+
}, ut = {
|
|
608
608
|
get size() {
|
|
609
609
|
return $(this).setMap.size;
|
|
610
610
|
},
|
|
@@ -612,19 +612,19 @@ const Ue = (e, t, n = !1) => {
|
|
|
612
612
|
const t = $(this);
|
|
613
613
|
if (t.setMap.has(e))
|
|
614
614
|
return !0;
|
|
615
|
-
|
|
615
|
+
K(t);
|
|
616
616
|
const n = $(e);
|
|
617
617
|
return !!(n && t.setMap.has(n.original));
|
|
618
618
|
},
|
|
619
619
|
add(e) {
|
|
620
620
|
const t = $(this);
|
|
621
|
-
return this.has(e) || (
|
|
621
|
+
return this.has(e) || (K(t), oe(t), t.assignedMap.set(e, !0), t.setMap.set(e, e), gt(t, e, e, $e)), this;
|
|
622
622
|
},
|
|
623
623
|
delete(e) {
|
|
624
624
|
if (!this.has(e))
|
|
625
625
|
return !1;
|
|
626
626
|
const t = $(this);
|
|
627
|
-
|
|
627
|
+
K(t), oe(t);
|
|
628
628
|
const n = $(e);
|
|
629
629
|
return n && t.setMap.has(n.original) ? (t.assignedMap.set(n.original, !1), t.setMap.delete(n.original)) : (!n && t.setMap.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.setMap.delete(e));
|
|
630
630
|
},
|
|
@@ -632,27 +632,27 @@ const Ue = (e, t, n = !1) => {
|
|
|
632
632
|
if (!this.size)
|
|
633
633
|
return;
|
|
634
634
|
const e = $(this);
|
|
635
|
-
|
|
635
|
+
K(e), oe(e);
|
|
636
636
|
for (const t of e.original)
|
|
637
637
|
e.assignedMap.set(t, !1);
|
|
638
638
|
e.setMap.clear();
|
|
639
639
|
},
|
|
640
640
|
values() {
|
|
641
641
|
const e = $(this);
|
|
642
|
-
|
|
642
|
+
K(e);
|
|
643
643
|
const t = e.setMap.keys();
|
|
644
644
|
return {
|
|
645
645
|
[Symbol.iterator]: () => this.values(),
|
|
646
|
-
next:
|
|
646
|
+
next: Tt(e, t, { isValuesIterator: !0 })
|
|
647
647
|
};
|
|
648
648
|
},
|
|
649
649
|
entries() {
|
|
650
650
|
const e = $(this);
|
|
651
|
-
|
|
651
|
+
K(e);
|
|
652
652
|
const t = e.setMap.keys();
|
|
653
653
|
return {
|
|
654
654
|
[Symbol.iterator]: () => this.entries(),
|
|
655
|
-
next:
|
|
655
|
+
next: Tt(e, t, {
|
|
656
656
|
isValuesIterator: !1
|
|
657
657
|
})
|
|
658
658
|
};
|
|
@@ -660,7 +660,7 @@ const Ue = (e, t, n = !1) => {
|
|
|
660
660
|
keys() {
|
|
661
661
|
return this.values();
|
|
662
662
|
},
|
|
663
|
-
[
|
|
663
|
+
[Ue]() {
|
|
664
664
|
return this.values();
|
|
665
665
|
},
|
|
666
666
|
forEach(e, t) {
|
|
@@ -669,47 +669,47 @@ const Ue = (e, t, n = !1) => {
|
|
|
669
669
|
for (; !s.done; )
|
|
670
670
|
e.call(t, s.value, s.value, this), s = n.next();
|
|
671
671
|
}
|
|
672
|
-
},
|
|
672
|
+
}, Un = Reflect.ownKeys(ut), Qt = /* @__PURE__ */ new WeakSet(), Yt = {
|
|
673
673
|
get(e, t, n) {
|
|
674
674
|
var s, i;
|
|
675
675
|
const o = (s = e.copy) === null || s === void 0 ? void 0 : s[t];
|
|
676
|
-
if (o &&
|
|
676
|
+
if (o && Qt.has(o))
|
|
677
677
|
return o;
|
|
678
|
-
if (t ===
|
|
678
|
+
if (t === Wt)
|
|
679
679
|
return e;
|
|
680
680
|
let r;
|
|
681
681
|
if (e.options.mark) {
|
|
682
682
|
const f = t === "size" && (e.original instanceof Map || e.original instanceof Set) ? Reflect.get(e.original, t) : Reflect.get(e.original, t, n);
|
|
683
683
|
if (r = e.options.mark(f, Y), r === Y.mutable)
|
|
684
|
-
return e.options.strict &&
|
|
684
|
+
return e.options.strict && Fe(f, e.options, !0), f;
|
|
685
685
|
}
|
|
686
|
-
const a =
|
|
687
|
-
if (a instanceof Map &&
|
|
686
|
+
const a = Q(e);
|
|
687
|
+
if (a instanceof Map && jn.includes(t)) {
|
|
688
688
|
if (t === "size")
|
|
689
|
-
return Object.getOwnPropertyDescriptor(
|
|
690
|
-
const f =
|
|
689
|
+
return Object.getOwnPropertyDescriptor(at, "size").get.call(e.proxy);
|
|
690
|
+
const f = at[t];
|
|
691
691
|
if (f)
|
|
692
692
|
return f.bind(e.proxy);
|
|
693
693
|
}
|
|
694
|
-
if (a instanceof Set &&
|
|
694
|
+
if (a instanceof Set && Un.includes(t)) {
|
|
695
695
|
if (t === "size")
|
|
696
|
-
return Object.getOwnPropertyDescriptor(
|
|
697
|
-
const f =
|
|
696
|
+
return Object.getOwnPropertyDescriptor(ut, "size").get.call(e.proxy);
|
|
697
|
+
const f = ut[t];
|
|
698
698
|
if (f)
|
|
699
699
|
return f.bind(e.proxy);
|
|
700
700
|
}
|
|
701
|
-
if (!
|
|
702
|
-
const f =
|
|
701
|
+
if (!Ie(a, t)) {
|
|
702
|
+
const f = Lt(a, t);
|
|
703
703
|
return f ? "value" in f ? f.value : (
|
|
704
704
|
// !case: support for getter
|
|
705
705
|
(i = f.get) === null || i === void 0 ? void 0 : i.call(e.proxy)
|
|
706
706
|
) : void 0;
|
|
707
707
|
}
|
|
708
708
|
const u = a[t];
|
|
709
|
-
if (e.options.strict &&
|
|
709
|
+
if (e.options.strict && Fe(u, e.options), e.finalized || !ee(u, e.options))
|
|
710
710
|
return u;
|
|
711
|
-
if (u ===
|
|
712
|
-
if (
|
|
711
|
+
if (u === Ye(e.original, t)) {
|
|
712
|
+
if (K(e), e.copy[t] = bt({
|
|
713
713
|
original: e.original[t],
|
|
714
714
|
parentDraft: e,
|
|
715
715
|
key: e.type === 1 ? Number(t) : t,
|
|
@@ -717,7 +717,7 @@ const Ue = (e, t, n = !1) => {
|
|
|
717
717
|
options: e.options
|
|
718
718
|
}), typeof r == "function") {
|
|
719
719
|
const f = $(e.copy[t]);
|
|
720
|
-
return
|
|
720
|
+
return K(f), oe(f), f.copy;
|
|
721
721
|
}
|
|
722
722
|
return e.copy[t];
|
|
723
723
|
}
|
|
@@ -730,20 +730,20 @@ const Ue = (e, t, n = !1) => {
|
|
|
730
730
|
let i;
|
|
731
731
|
if (e.type === 1 && t !== "length" && !(Number.isInteger(i = Number(t)) && i >= 0 && (t === 0 || i === 0 || String(i) === String(t))))
|
|
732
732
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
733
|
-
const o =
|
|
733
|
+
const o = Lt(Q(e), t);
|
|
734
734
|
if (o != null && o.set)
|
|
735
735
|
return o.set.call(e.proxy, n), !0;
|
|
736
|
-
const r =
|
|
737
|
-
return a &&
|
|
736
|
+
const r = Ye(Q(e), t), a = $(r);
|
|
737
|
+
return a && le(a.original, n) ? (e.copy[t] = n, e.assignedMap = (s = e.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), e.assignedMap.set(t, !1), !0) : (le(n, r) && (n !== void 0 || Ie(e.original, t)) || (K(e), oe(e), Ie(e.original, t) && le(n, e.original[t]) ? e.assignedMap.delete(t) : e.assignedMap.set(t, !0), e.copy[t] = n, gt(e, t, n, $e)), !0);
|
|
738
738
|
},
|
|
739
739
|
has(e, t) {
|
|
740
|
-
return t in
|
|
740
|
+
return t in Q(e);
|
|
741
741
|
},
|
|
742
742
|
ownKeys(e) {
|
|
743
|
-
return Reflect.ownKeys(
|
|
743
|
+
return Reflect.ownKeys(Q(e));
|
|
744
744
|
},
|
|
745
745
|
getOwnPropertyDescriptor(e, t) {
|
|
746
|
-
const n =
|
|
746
|
+
const n = Q(e), s = Reflect.getOwnPropertyDescriptor(n, t);
|
|
747
747
|
return s && {
|
|
748
748
|
writable: !0,
|
|
749
749
|
configurable: e.type !== 1 || t !== "length",
|
|
@@ -762,10 +762,10 @@ const Ue = (e, t, n = !1) => {
|
|
|
762
762
|
},
|
|
763
763
|
deleteProperty(e, t) {
|
|
764
764
|
var n;
|
|
765
|
-
return e.type === 1 ?
|
|
765
|
+
return e.type === 1 ? Yt.set.call(this, e, t, void 0, e.proxy) : (Ye(e.original, t) !== void 0 || t in e.original ? (K(e), oe(e), e.assignedMap.set(t, !1)) : (e.assignedMap = (n = e.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), e.assignedMap.delete(t)), e.copy && delete e.copy[t], !0);
|
|
766
766
|
}
|
|
767
767
|
};
|
|
768
|
-
function
|
|
768
|
+
function bt(e) {
|
|
769
769
|
const { original: t, parentDraft: n, key: s, finalities: i, options: o } = e, r = be(t), a = {
|
|
770
770
|
type: r,
|
|
771
771
|
finalized: !1,
|
|
@@ -779,45 +779,45 @@ function _t(e) {
|
|
|
779
779
|
setMap: r === 3 ? new Map(t.entries()) : void 0
|
|
780
780
|
};
|
|
781
781
|
(s || "key" in e) && (a.key = s);
|
|
782
|
-
const { proxy: u, revoke: f } = Proxy.revocable(r === 1 ? Object.assign([], a) : a,
|
|
783
|
-
if (i.revoke.push(f),
|
|
782
|
+
const { proxy: u, revoke: f } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, Yt);
|
|
783
|
+
if (i.revoke.push(f), Qt.add(u), a.proxy = u, n) {
|
|
784
784
|
const c = n;
|
|
785
|
-
c.finalities.draft.push((d,
|
|
786
|
-
var w,
|
|
787
|
-
const
|
|
785
|
+
c.finalities.draft.push((d, y) => {
|
|
786
|
+
var w, _;
|
|
787
|
+
const S = $(u);
|
|
788
788
|
let v = c.type === 3 ? c.setMap : c.copy;
|
|
789
|
-
const x =
|
|
789
|
+
const x = pe(v, s), b = $(x);
|
|
790
790
|
if (b) {
|
|
791
|
-
let
|
|
792
|
-
b.operated && (
|
|
791
|
+
let A = b.original;
|
|
792
|
+
b.operated && (A = yt(x)), rt(b), ot(b, $e, d, y), c.options.enableAutoFreeze && (c.options.updatedValues = (w = c.options.updatedValues) !== null && w !== void 0 ? w : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, b.original)), Le(v, s, A);
|
|
793
793
|
}
|
|
794
|
-
(
|
|
795
|
-
|
|
794
|
+
(_ = S.callbacks) === null || _ === void 0 || _.forEach((A) => {
|
|
795
|
+
A(d, y);
|
|
796
796
|
});
|
|
797
797
|
});
|
|
798
798
|
} else {
|
|
799
799
|
const c = $(u);
|
|
800
|
-
c.finalities.draft.push((d,
|
|
801
|
-
|
|
800
|
+
c.finalities.draft.push((d, y) => {
|
|
801
|
+
rt(c), ot(c, $e, d, y);
|
|
802
802
|
});
|
|
803
803
|
}
|
|
804
804
|
return u;
|
|
805
805
|
}
|
|
806
|
-
|
|
807
|
-
function
|
|
806
|
+
mt.createDraft = bt;
|
|
807
|
+
function Bn(e, t, n, s, i) {
|
|
808
808
|
var o;
|
|
809
809
|
const r = $(e), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : e, u = !!t.length;
|
|
810
810
|
if (r != null && r.operated)
|
|
811
811
|
for (; r.finalities.draft.length > 0; )
|
|
812
812
|
r.finalities.draft.pop()(n, s);
|
|
813
813
|
const f = u ? t[0] : r ? r.operated ? r.copy : r.original : e;
|
|
814
|
-
return r &&
|
|
814
|
+
return r && it(r), i && we(f, f, r == null ? void 0 : r.options.updatedValues), [
|
|
815
815
|
f,
|
|
816
|
-
n && u ? [{ op:
|
|
817
|
-
s && u ? [{ op:
|
|
816
|
+
n && u ? [{ op: B.Replace, path: [], value: t[0] }] : n,
|
|
817
|
+
s && u ? [{ op: B.Replace, path: [], value: a }] : s
|
|
818
818
|
];
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Fn(e, t) {
|
|
821
821
|
var n;
|
|
822
822
|
const s = {
|
|
823
823
|
draft: [],
|
|
@@ -826,7 +826,7 @@ function Pn(e, t) {
|
|
|
826
826
|
};
|
|
827
827
|
let i, o;
|
|
828
828
|
t.enablePatches && (i = [], o = []);
|
|
829
|
-
const a = ((n = t.mark) === null || n === void 0 ? void 0 : n.call(t, e, Y)) === Y.mutable || !ee(e, t) ? e :
|
|
829
|
+
const a = ((n = t.mark) === null || n === void 0 ? void 0 : n.call(t, e, Y)) === Y.mutable || !ee(e, t) ? e : bt({
|
|
830
830
|
original: e,
|
|
831
831
|
parentDraft: null,
|
|
832
832
|
finalities: s,
|
|
@@ -835,14 +835,14 @@ function Pn(e, t) {
|
|
|
835
835
|
return [
|
|
836
836
|
a,
|
|
837
837
|
(u = []) => {
|
|
838
|
-
const [f, c, d] =
|
|
838
|
+
const [f, c, d] = Bn(a, u, i, o, t.enableAutoFreeze);
|
|
839
839
|
return t.enablePatches ? [f, c, d] : f;
|
|
840
840
|
}
|
|
841
841
|
];
|
|
842
842
|
}
|
|
843
|
-
function
|
|
843
|
+
function ct(e) {
|
|
844
844
|
const { rootDraft: t, value: n, useRawReturn: s = !1, isRoot: i = !0 } = e;
|
|
845
|
-
|
|
845
|
+
_t(n, (o, r, a) => {
|
|
846
846
|
const u = $(r);
|
|
847
847
|
if (u && t && u.finalities === t.finalities) {
|
|
848
848
|
e.isContainDraft = !0;
|
|
@@ -851,12 +851,12 @@ function at(e) {
|
|
|
851
851
|
const c = Array.from(a);
|
|
852
852
|
a.clear(), c.forEach((d) => a.add(o === d ? f : d));
|
|
853
853
|
} else
|
|
854
|
-
|
|
854
|
+
Le(a, o, f);
|
|
855
855
|
} else
|
|
856
|
-
typeof r == "object" && r !== null && (e.value = r, e.isRoot = !1,
|
|
856
|
+
typeof r == "object" && r !== null && (e.value = r, e.isRoot = !1, ct(e));
|
|
857
857
|
}), i && (e.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), s && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function Zt(e) {
|
|
860
860
|
const t = $(e);
|
|
861
861
|
if (!ee(e, t == null ? void 0 : t.options))
|
|
862
862
|
return e;
|
|
@@ -865,7 +865,7 @@ function Qt(e) {
|
|
|
865
865
|
return t.original;
|
|
866
866
|
let s;
|
|
867
867
|
function i() {
|
|
868
|
-
s = n === 2 ? new Map(e) : n === 3 ? Array.from(t.setMap.values()) :
|
|
868
|
+
s = n === 2 ? new Map(e) : n === 3 ? Array.from(t.setMap.values()) : Xt(e, t == null ? void 0 : t.options);
|
|
869
869
|
}
|
|
870
870
|
if (t) {
|
|
871
871
|
t.finalized = !0;
|
|
@@ -876,103 +876,103 @@ function Qt(e) {
|
|
|
876
876
|
}
|
|
877
877
|
} else
|
|
878
878
|
s = e;
|
|
879
|
-
return
|
|
880
|
-
if (t &&
|
|
879
|
+
return _t(s, (o, r) => {
|
|
880
|
+
if (t && le(pe(t.original, o), r))
|
|
881
881
|
return;
|
|
882
|
-
const a =
|
|
883
|
-
a !== r && (s === e && i(),
|
|
882
|
+
const a = Zt(r);
|
|
883
|
+
a !== r && (s === e && i(), Le(s, o, a));
|
|
884
884
|
}), n === 3 ? new Set(s) : s;
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function Dt(e) {
|
|
887
887
|
if (!ge(e))
|
|
888
888
|
throw new Error(`current() is only used for Draft, parameter: ${e}`);
|
|
889
|
-
return
|
|
889
|
+
return Zt(e);
|
|
890
890
|
}
|
|
891
|
-
const
|
|
891
|
+
const zn = (e) => {
|
|
892
892
|
if (e !== void 0 && Object.prototype.toString.call(e) !== "[object Object]")
|
|
893
893
|
throw new Error(`Invalid options: ${String(e)}, 'options' should be an object.`);
|
|
894
894
|
return function t(n, s, i) {
|
|
895
895
|
var o, r, a;
|
|
896
896
|
if (typeof n == "function" && typeof s != "function")
|
|
897
|
-
return function(R, ...
|
|
898
|
-
return t(R, (
|
|
897
|
+
return function(R, ...D) {
|
|
898
|
+
return t(R, (O) => n.call(this, O, ...D), s);
|
|
899
899
|
};
|
|
900
900
|
const u = n, f = s;
|
|
901
901
|
let c = i;
|
|
902
902
|
if (typeof s != "function" && (c = s), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
|
|
903
903
|
throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
|
|
904
904
|
c = Object.assign(Object.assign({}, e), c);
|
|
905
|
-
const d = ge(u) ?
|
|
906
|
-
for (const
|
|
907
|
-
if (typeof
|
|
908
|
-
throw new Error(`Invalid mark: ${
|
|
909
|
-
const L =
|
|
905
|
+
const d = ge(u) ? Dt(u) : u, y = Array.isArray(c.mark) ? (R, D) => {
|
|
906
|
+
for (const O of c.mark) {
|
|
907
|
+
if (typeof O != "function")
|
|
908
|
+
throw new Error(`Invalid mark: ${O}, 'mark' should be a function.`);
|
|
909
|
+
const L = O(R, D);
|
|
910
910
|
if (L)
|
|
911
911
|
return L;
|
|
912
912
|
}
|
|
913
|
-
} : c.mark, w = (o = c.enablePatches) !== null && o !== void 0 ? o : !1,
|
|
913
|
+
} : c.mark, w = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, _ = (r = c.strict) !== null && r !== void 0 ? r : !1, v = {
|
|
914
914
|
enableAutoFreeze: (a = c.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
|
|
915
|
-
mark:
|
|
916
|
-
strict:
|
|
915
|
+
mark: y,
|
|
916
|
+
strict: _,
|
|
917
917
|
enablePatches: w
|
|
918
918
|
};
|
|
919
919
|
if (!ee(d, v) && typeof d == "object" && d !== null)
|
|
920
920
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
921
|
-
const [x, b] =
|
|
921
|
+
const [x, b] = Fn(d, v);
|
|
922
922
|
if (typeof s != "function") {
|
|
923
923
|
if (!ee(d, v))
|
|
924
924
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
925
925
|
return [x, b];
|
|
926
926
|
}
|
|
927
|
-
let
|
|
927
|
+
let A;
|
|
928
928
|
try {
|
|
929
|
-
|
|
929
|
+
A = f(x);
|
|
930
930
|
} catch (R) {
|
|
931
|
-
throw
|
|
931
|
+
throw it($(x)), R;
|
|
932
932
|
}
|
|
933
933
|
const M = (R) => {
|
|
934
|
-
const
|
|
934
|
+
const D = $(x);
|
|
935
935
|
if (!ge(R)) {
|
|
936
|
-
if (R !== void 0 && !
|
|
936
|
+
if (R !== void 0 && !le(R, x) && (D != null && D.operated))
|
|
937
937
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
938
|
-
const L = R == null ? void 0 : R[
|
|
938
|
+
const L = R == null ? void 0 : R[$n];
|
|
939
939
|
if (L) {
|
|
940
940
|
const z = L[0];
|
|
941
|
-
return v.strict && typeof R == "object" && R !== null &&
|
|
942
|
-
rootDraft:
|
|
941
|
+
return v.strict && typeof R == "object" && R !== null && ct({
|
|
942
|
+
rootDraft: D,
|
|
943
943
|
value: R,
|
|
944
944
|
useRawReturn: !0
|
|
945
945
|
}), b([z]);
|
|
946
946
|
}
|
|
947
947
|
if (R !== void 0)
|
|
948
|
-
return typeof R == "object" && R !== null &&
|
|
948
|
+
return typeof R == "object" && R !== null && ct({ rootDraft: D, value: R }), b([R]);
|
|
949
949
|
}
|
|
950
950
|
if (R === x || R === void 0)
|
|
951
951
|
return b([]);
|
|
952
|
-
const
|
|
953
|
-
if (v ===
|
|
954
|
-
if (
|
|
952
|
+
const O = $(R);
|
|
953
|
+
if (v === O.options) {
|
|
954
|
+
if (O.operated)
|
|
955
955
|
throw new Error("Cannot return a modified child draft.");
|
|
956
|
-
return b([
|
|
956
|
+
return b([Dt(R)]);
|
|
957
957
|
}
|
|
958
958
|
return b([R]);
|
|
959
959
|
};
|
|
960
|
-
return
|
|
961
|
-
throw
|
|
962
|
-
}) : M(
|
|
960
|
+
return A instanceof Promise ? A.then(M, (R) => {
|
|
961
|
+
throw it($(x)), R;
|
|
962
|
+
}) : M(A);
|
|
963
963
|
};
|
|
964
|
-
}, C =
|
|
964
|
+
}, C = zn();
|
|
965
965
|
Object.prototype.constructor.toString();
|
|
966
|
-
const
|
|
966
|
+
const Gn = dt(fetch), en = async (e, t) => {
|
|
967
967
|
if (!e)
|
|
968
968
|
throw "Metapage definition null";
|
|
969
969
|
if (!e.version)
|
|
970
970
|
throw 'Missing "version" key in metapage definition';
|
|
971
971
|
if (!t)
|
|
972
972
|
throw 'Missing "version" argument';
|
|
973
|
-
if (V(t,
|
|
973
|
+
if (V(t, Je) > 0)
|
|
974
974
|
try {
|
|
975
|
-
return await (await
|
|
975
|
+
return await (await Gn(`https://module.metapage.io/conversion/metapage/${t}`, {
|
|
976
976
|
redirect: "follow",
|
|
977
977
|
retries: 3,
|
|
978
978
|
retryDelay: 1e3,
|
|
@@ -985,8 +985,8 @@ const kn = pt(fetch), Yt = async (e, t) => {
|
|
|
985
985
|
} catch (s) {
|
|
986
986
|
throw `Error converting metapage definition to version ${t}: ${s}`;
|
|
987
987
|
}
|
|
988
|
-
return
|
|
989
|
-
},
|
|
988
|
+
return Jn(e, t);
|
|
989
|
+
}, Vn = async (e) => en(e, Je), Jn = (e, t) => {
|
|
990
990
|
if (!e)
|
|
991
991
|
throw "Metapage definition null";
|
|
992
992
|
if (!e.version)
|
|
@@ -999,35 +999,35 @@ const kn = pt(fetch), Yt = async (e, t) => {
|
|
|
999
999
|
switch (n) {
|
|
1000
1000
|
case "0.2": {
|
|
1001
1001
|
if (V(t, n) > 0)
|
|
1002
|
-
s =
|
|
1002
|
+
s = Wn(s), n = Re(s.version);
|
|
1003
1003
|
else
|
|
1004
1004
|
throw `Cannot convert from version ${n} to ${t}`;
|
|
1005
1005
|
break;
|
|
1006
1006
|
}
|
|
1007
1007
|
case "0.3": {
|
|
1008
|
-
V(t, n) > 0 ? (s =
|
|
1008
|
+
V(t, n) > 0 ? (s = Xn(s), n = Re(s.version)) : (s = Kn(s), n = Re(s.version));
|
|
1009
1009
|
break;
|
|
1010
1010
|
}
|
|
1011
1011
|
case "1": {
|
|
1012
1012
|
if (V(t, n) > 0)
|
|
1013
1013
|
throw `Cannot convert from version ${n} to ${t}, 1 is the latest version`;
|
|
1014
|
-
s =
|
|
1014
|
+
s = qn(s), n = Re(s.version);
|
|
1015
1015
|
break;
|
|
1016
1016
|
}
|
|
1017
1017
|
default:
|
|
1018
1018
|
throw `Unknow version ${n} to ${t}`;
|
|
1019
1019
|
}
|
|
1020
1020
|
return s;
|
|
1021
|
-
},
|
|
1021
|
+
}, Wn = (e) => C(e, (t) => {
|
|
1022
1022
|
t.version = "0.3";
|
|
1023
|
-
}),
|
|
1023
|
+
}), Kn = (e) => C(e, (t) => {
|
|
1024
1024
|
t.version = "0.2";
|
|
1025
|
-
}),
|
|
1025
|
+
}), Xn = (e) => C(e, (t) => {
|
|
1026
1026
|
const n = t;
|
|
1027
1027
|
delete n.plugins, n.version = "1";
|
|
1028
|
-
}),
|
|
1028
|
+
}), qn = (e) => C(e, (t) => (t.version = "0.3", t)), Re = (e) => {
|
|
1029
1029
|
if (e === "latest")
|
|
1030
|
-
return
|
|
1030
|
+
return Je;
|
|
1031
1031
|
if (V(e, "0.2") < 0)
|
|
1032
1032
|
throw `Unknown version: ${e}`;
|
|
1033
1033
|
if (V(e, "0.2") <= 0 && V(e, "0.3") < 0)
|
|
@@ -1037,16 +1037,16 @@ const kn = pt(fetch), Yt = async (e, t) => {
|
|
|
1037
1037
|
if (e === "1")
|
|
1038
1038
|
return "1";
|
|
1039
1039
|
throw `Unknown version: ${e}`;
|
|
1040
|
-
},
|
|
1040
|
+
}, Qn = dt(fetch), tn = async (e, t) => {
|
|
1041
1041
|
if (!e)
|
|
1042
1042
|
throw "Metapage definition null";
|
|
1043
1043
|
if (!e.version)
|
|
1044
1044
|
throw 'Missing "version" key in metapage definition';
|
|
1045
1045
|
if (!t)
|
|
1046
1046
|
throw 'Missing "version" argument';
|
|
1047
|
-
if (V(t,
|
|
1047
|
+
if (V(t, pt) > 0)
|
|
1048
1048
|
try {
|
|
1049
|
-
return await (await
|
|
1049
|
+
return await (await Qn(`https://module.metapage.io/conversion/metaframe/${t}`, {
|
|
1050
1050
|
redirect: "follow",
|
|
1051
1051
|
retries: 3,
|
|
1052
1052
|
retryDelay: 1e3,
|
|
@@ -1059,13 +1059,13 @@ const kn = pt(fetch), Yt = async (e, t) => {
|
|
|
1059
1059
|
} catch (s) {
|
|
1060
1060
|
throw `Error converting metapage definition to version ${t}: ${s}`;
|
|
1061
1061
|
}
|
|
1062
|
-
return
|
|
1063
|
-
},
|
|
1062
|
+
return Zn(e, t);
|
|
1063
|
+
}, Yn = async (e) => tn(e, pt), Zn = (e, t) => {
|
|
1064
1064
|
if (!e)
|
|
1065
1065
|
throw "Metaframe definition null";
|
|
1066
1066
|
if (!e.version)
|
|
1067
1067
|
throw 'Missing "version" key in metaframe definition';
|
|
1068
|
-
let n =
|
|
1068
|
+
let n = ue(e.version);
|
|
1069
1069
|
if (n === t)
|
|
1070
1070
|
return e;
|
|
1071
1071
|
let s = e;
|
|
@@ -1073,41 +1073,41 @@ const kn = pt(fetch), Yt = async (e, t) => {
|
|
|
1073
1073
|
switch (n) {
|
|
1074
1074
|
case "0.3": {
|
|
1075
1075
|
if (V(t, n) > 0)
|
|
1076
|
-
s =
|
|
1076
|
+
s = ns(s), n = ue(s.version);
|
|
1077
1077
|
else
|
|
1078
1078
|
throw `Cannot convert from version ${n} to ${t}`;
|
|
1079
1079
|
break;
|
|
1080
1080
|
}
|
|
1081
1081
|
case "0.4": {
|
|
1082
|
-
V(t, n) > 0 ? (s =
|
|
1082
|
+
V(t, n) > 0 ? (s = ss(s), n = ue(s.version)) : (s = ts(s), n = ue(s.version));
|
|
1083
1083
|
break;
|
|
1084
1084
|
}
|
|
1085
1085
|
case "0.5": {
|
|
1086
|
-
V(t, n) > 0 ? (s =
|
|
1086
|
+
V(t, n) > 0 ? (s = as(s), n = ue(s.version)) : (s = is(s), n = ue(s.version));
|
|
1087
1087
|
break;
|
|
1088
1088
|
}
|
|
1089
1089
|
case "0.6": {
|
|
1090
|
-
V(t, n) > 0 ? (s =
|
|
1090
|
+
V(t, n) > 0 ? (s = rs(s), n = ue(s.version)) : (s = us(s), n = ue(s.version));
|
|
1091
1091
|
break;
|
|
1092
1092
|
}
|
|
1093
1093
|
case "1": {
|
|
1094
1094
|
if (V(t, n) > 0)
|
|
1095
1095
|
throw `Cannot convert from version ${n} to ${t}, 1 is the latest version`;
|
|
1096
|
-
s =
|
|
1096
|
+
s = os(s), n = ue(s.version);
|
|
1097
1097
|
break;
|
|
1098
1098
|
}
|
|
1099
1099
|
default:
|
|
1100
1100
|
throw `Unknow version ${n} to ${t}`;
|
|
1101
1101
|
}
|
|
1102
1102
|
return s;
|
|
1103
|
-
},
|
|
1103
|
+
}, es = async (e, t) => {
|
|
1104
1104
|
if (e)
|
|
1105
|
-
return
|
|
1106
|
-
},
|
|
1105
|
+
return Yn(e);
|
|
1106
|
+
}, ts = (e) => C(e, (t) => {
|
|
1107
1107
|
t.version = "0.3", delete t.allow;
|
|
1108
|
-
}),
|
|
1108
|
+
}), ns = (e) => C(e, (t) => {
|
|
1109
1109
|
t.version = "0.4";
|
|
1110
|
-
}),
|
|
1110
|
+
}), ss = (e) => C(e, (t) => {
|
|
1111
1111
|
if (t.version = "0.5", !(t != null && t.metadata))
|
|
1112
1112
|
return;
|
|
1113
1113
|
const n = t.metadata.title;
|
|
@@ -1116,7 +1116,7 @@ const kn = pt(fetch), Yt = async (e, t) => {
|
|
|
1116
1116
|
delete t.metadata.descriptionUrl, t.metadata.description = s;
|
|
1117
1117
|
const i = t.metadata.keywords;
|
|
1118
1118
|
delete t.metadata.keywords, t.metadata.tags = i;
|
|
1119
|
-
}),
|
|
1119
|
+
}), is = (e) => C(e, (t) => {
|
|
1120
1120
|
if (t.version = "0.4", !(t != null && t.metadata))
|
|
1121
1121
|
return;
|
|
1122
1122
|
const n = t.metadata.name;
|
|
@@ -1125,21 +1125,21 @@ const kn = pt(fetch), Yt = async (e, t) => {
|
|
|
1125
1125
|
delete t.metadata.description, t.metadata.descriptionUrl = s;
|
|
1126
1126
|
const i = t.metadata.tags;
|
|
1127
1127
|
delete t.metadata.tags, t.metadata.keywords = i;
|
|
1128
|
-
}),
|
|
1128
|
+
}), rs = (e) => C(e, (t) => {
|
|
1129
1129
|
var n;
|
|
1130
1130
|
t.version = "1", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
|
|
1131
|
-
}),
|
|
1131
|
+
}), os = (e) => C(e, (t) => {
|
|
1132
1132
|
var n;
|
|
1133
1133
|
t.version = "0.6", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
|
|
1134
|
-
}),
|
|
1134
|
+
}), as = (e) => C(e, (t) => {
|
|
1135
1135
|
var n;
|
|
1136
1136
|
t.version = "0.6", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
|
|
1137
|
-
}),
|
|
1137
|
+
}), us = (e) => C(e, (t) => {
|
|
1138
1138
|
var n;
|
|
1139
1139
|
t.version = "0.5", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
|
|
1140
|
-
}),
|
|
1140
|
+
}), ue = (e) => {
|
|
1141
1141
|
if (e === "latest")
|
|
1142
|
-
return
|
|
1142
|
+
return pt;
|
|
1143
1143
|
if (V(e, "0.3") < 0)
|
|
1144
1144
|
throw `Unknown version: ${e}`;
|
|
1145
1145
|
if (V(e, "0.3") <= 0)
|
|
@@ -1154,34 +1154,34 @@ const kn = pt(fetch), Yt = async (e, t) => {
|
|
|
1154
1154
|
return "1";
|
|
1155
1155
|
throw `Unknown version: ${e}`;
|
|
1156
1156
|
};
|
|
1157
|
-
var
|
|
1158
|
-
for (var
|
|
1159
|
-
Oe
|
|
1160
|
-
var
|
|
1157
|
+
var Oe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ee = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
1158
|
+
for (var ke = 0; ke < Oe.length; ke++)
|
|
1159
|
+
Ee[Oe.charCodeAt(ke)] = ke;
|
|
1160
|
+
var je = function(e) {
|
|
1161
1161
|
var t = new Uint8Array(e), n, s = t.length, i = "";
|
|
1162
1162
|
for (n = 0; n < s; n += 3)
|
|
1163
|
-
i +=
|
|
1163
|
+
i += Oe[t[n] >> 2], i += Oe[(t[n] & 3) << 4 | t[n + 1] >> 4], i += Oe[(t[n + 1] & 15) << 2 | t[n + 2] >> 6], i += Oe[t[n + 2] & 63];
|
|
1164
1164
|
return s % 3 === 2 ? i = i.substring(0, i.length - 1) + "=" : s % 3 === 1 && (i = i.substring(0, i.length - 2) + "=="), i;
|
|
1165
1165
|
}, de = function(e) {
|
|
1166
1166
|
var t = e.length * 0.75, n = e.length, s, i = 0, o, r, a, u;
|
|
1167
1167
|
e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
|
|
1168
1168
|
var f = new ArrayBuffer(t), c = new Uint8Array(f);
|
|
1169
1169
|
for (s = 0; s < n; s += 4)
|
|
1170
|
-
o =
|
|
1170
|
+
o = Ee[e.charCodeAt(s)], r = Ee[e.charCodeAt(s + 1)], a = Ee[e.charCodeAt(s + 2)], u = Ee[e.charCodeAt(s + 3)], c[i++] = o << 2 | r >> 4, c[i++] = (r & 15) << 4 | a >> 2, c[i++] = (a & 3) << 6 | u & 63;
|
|
1171
1171
|
return f;
|
|
1172
1172
|
};
|
|
1173
|
-
const
|
|
1173
|
+
const We = async (e) => C(e, async (t) => {
|
|
1174
1174
|
for (const n of Object.keys(e)) {
|
|
1175
|
-
const s = await
|
|
1175
|
+
const s = await cs(e[n]);
|
|
1176
1176
|
return t[n] = s, t;
|
|
1177
1177
|
}
|
|
1178
|
-
}),
|
|
1178
|
+
}), Ce = async (e) => C(e, async (t) => {
|
|
1179
1179
|
for (const n of Object.keys(e)) {
|
|
1180
|
-
const s = await
|
|
1180
|
+
const s = await nn(e[n]);
|
|
1181
1181
|
return t[n] = s, t;
|
|
1182
1182
|
}
|
|
1183
|
-
}),
|
|
1184
|
-
if (e =
|
|
1183
|
+
}), vi = async (e, t, n) => {
|
|
1184
|
+
if (e = nn(e), n = n || {}, n.type || (n.type = "application/octet-stream"), e instanceof ArrayBuffer)
|
|
1185
1185
|
return new File([e], t, n);
|
|
1186
1186
|
if (e instanceof File || e instanceof Blob) {
|
|
1187
1187
|
const i = await e.arrayBuffer();
|
|
@@ -1203,12 +1203,12 @@ const Ve = async (e) => C(e, async (t) => {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
var s = new Blob([e], { type: "text/plain" });
|
|
1205
1205
|
return n.type = "text/plain", new File([s], t, n);
|
|
1206
|
-
},
|
|
1206
|
+
}, cs = async (e) => {
|
|
1207
1207
|
if (e instanceof Int8Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array) {
|
|
1208
1208
|
const t = e, n = {
|
|
1209
1209
|
_s: !0,
|
|
1210
1210
|
_c: e.constructor.name,
|
|
1211
|
-
value:
|
|
1211
|
+
value: je(t.buffer),
|
|
1212
1212
|
byteLength: t.byteLength,
|
|
1213
1213
|
byteOffset: t.byteOffset,
|
|
1214
1214
|
size: t.byteLength
|
|
@@ -1219,7 +1219,7 @@ const Ve = async (e) => C(e, async (t) => {
|
|
|
1219
1219
|
return {
|
|
1220
1220
|
_s: !0,
|
|
1221
1221
|
_c: File.name,
|
|
1222
|
-
value:
|
|
1222
|
+
value: je(n),
|
|
1223
1223
|
name: t.name,
|
|
1224
1224
|
fileType: t.type,
|
|
1225
1225
|
lastModified: t.lastModified,
|
|
@@ -1230,7 +1230,7 @@ const Ve = async (e) => C(e, async (t) => {
|
|
|
1230
1230
|
return {
|
|
1231
1231
|
_s: !0,
|
|
1232
1232
|
_c: Blob.name,
|
|
1233
|
-
value:
|
|
1233
|
+
value: je(n),
|
|
1234
1234
|
fileType: t.type,
|
|
1235
1235
|
size: n.byteLength
|
|
1236
1236
|
};
|
|
@@ -1238,13 +1238,13 @@ const Ve = async (e) => C(e, async (t) => {
|
|
|
1238
1238
|
const t = e, n = {
|
|
1239
1239
|
_s: !0,
|
|
1240
1240
|
_c: ArrayBuffer.name,
|
|
1241
|
-
value:
|
|
1241
|
+
value: je(t),
|
|
1242
1242
|
size: t.byteLength
|
|
1243
1243
|
};
|
|
1244
1244
|
return Promise.resolve(n);
|
|
1245
1245
|
}
|
|
1246
1246
|
return Promise.resolve(e);
|
|
1247
|
-
},
|
|
1247
|
+
}, nn = (e) => {
|
|
1248
1248
|
if (!(e && typeof e == "object" && e._s === !0))
|
|
1249
1249
|
return e;
|
|
1250
1250
|
const t = e, n = t._c;
|
|
@@ -1267,7 +1267,7 @@ const Ve = async (e) => C(e, async (t) => {
|
|
|
1267
1267
|
} catch {
|
|
1268
1268
|
}
|
|
1269
1269
|
return e;
|
|
1270
|
-
},
|
|
1270
|
+
}, wi = (e) => {
|
|
1271
1271
|
if (!(e && typeof e == "object" && e._s === !0))
|
|
1272
1272
|
return;
|
|
1273
1273
|
const t = e, n = t._c;
|
|
@@ -1303,16 +1303,16 @@ var E;
|
|
|
1303
1303
|
(function(e) {
|
|
1304
1304
|
e.Inputs = "inputs", e.Outputs = "outputs", e.State = "state", e.Definition = "definition", e.Error = "error", e.UrlHashUpdate = "urlhashupdate", e.Message = "Message";
|
|
1305
1305
|
})(E || (E = {}));
|
|
1306
|
-
var
|
|
1306
|
+
var X;
|
|
1307
1307
|
(function(e) {
|
|
1308
1308
|
e.InputsUpdate = "InputsUpdate", e.OutputsUpdate = "OutputsUpdate", e.SetupIframeClientRequest = "SetupIframeClientRequest", e.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", e.HashParamsUpdate = "HashParamsUpdate";
|
|
1309
|
-
})(
|
|
1310
|
-
var
|
|
1309
|
+
})(X || (X = {}));
|
|
1310
|
+
var fe;
|
|
1311
1311
|
(function(e) {
|
|
1312
1312
|
e.InputsUpdate = "InputsUpdate", e.MessageAck = "MessageAck", e.SetupIframeServerResponse = "SetupIframeServerResponse";
|
|
1313
|
-
})(
|
|
1314
|
-
const
|
|
1315
|
-
function
|
|
1313
|
+
})(fe || (fe = {}));
|
|
1314
|
+
const Ri = -32700, Oi = -32600, Ai = -32601, Si = -32602, Ei = -32603;
|
|
1315
|
+
function Mi(e) {
|
|
1316
1316
|
switch (typeof e) {
|
|
1317
1317
|
case "string":
|
|
1318
1318
|
return !0;
|
|
@@ -1324,7 +1324,7 @@ function Ys(e) {
|
|
|
1324
1324
|
return !1;
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
|
-
var
|
|
1327
|
+
var sn = { exports: {} };
|
|
1328
1328
|
(function(e) {
|
|
1329
1329
|
var t = Object.prototype.hasOwnProperty, n = "~";
|
|
1330
1330
|
function s() {
|
|
@@ -1333,11 +1333,11 @@ var tn = { exports: {} };
|
|
|
1333
1333
|
function i(u, f, c) {
|
|
1334
1334
|
this.fn = u, this.context = f, this.once = c || !1;
|
|
1335
1335
|
}
|
|
1336
|
-
function o(u, f, c, d,
|
|
1336
|
+
function o(u, f, c, d, y) {
|
|
1337
1337
|
if (typeof c != "function")
|
|
1338
1338
|
throw new TypeError("The listener must be a function");
|
|
1339
|
-
var w = new i(c, d || u,
|
|
1340
|
-
return u._events[
|
|
1339
|
+
var w = new i(c, d || u, y), _ = n ? n + f : f;
|
|
1340
|
+
return u._events[_] ? u._events[_].fn ? u._events[_] = [u._events[_], w] : u._events[_].push(w) : (u._events[_] = w, u._eventsCount++), u;
|
|
1341
1341
|
}
|
|
1342
1342
|
function r(u, f) {
|
|
1343
1343
|
--u._eventsCount === 0 ? u._events = new s() : delete u._events[f];
|
|
@@ -1358,17 +1358,17 @@ var tn = { exports: {} };
|
|
|
1358
1358
|
return [];
|
|
1359
1359
|
if (d.fn)
|
|
1360
1360
|
return [d.fn];
|
|
1361
|
-
for (var
|
|
1362
|
-
y
|
|
1363
|
-
return
|
|
1361
|
+
for (var y = 0, w = d.length, _ = new Array(w); y < w; y++)
|
|
1362
|
+
_[y] = d[y].fn;
|
|
1363
|
+
return _;
|
|
1364
1364
|
}, a.prototype.listenerCount = function(f) {
|
|
1365
1365
|
var c = n ? n + f : f, d = this._events[c];
|
|
1366
1366
|
return d ? d.fn ? 1 : d.length : 0;
|
|
1367
|
-
}, a.prototype.emit = function(f, c, d,
|
|
1368
|
-
var
|
|
1369
|
-
if (!this._events[
|
|
1367
|
+
}, a.prototype.emit = function(f, c, d, y, w, _) {
|
|
1368
|
+
var S = n ? n + f : f;
|
|
1369
|
+
if (!this._events[S])
|
|
1370
1370
|
return !1;
|
|
1371
|
-
var v = this._events[
|
|
1371
|
+
var v = this._events[S], x = arguments.length, b, A;
|
|
1372
1372
|
if (v.fn) {
|
|
1373
1373
|
switch (v.once && this.removeListener(f, v.fn, void 0, !0), x) {
|
|
1374
1374
|
case 1:
|
|
@@ -1378,36 +1378,36 @@ var tn = { exports: {} };
|
|
|
1378
1378
|
case 3:
|
|
1379
1379
|
return v.fn.call(v.context, c, d), !0;
|
|
1380
1380
|
case 4:
|
|
1381
|
-
return v.fn.call(v.context, c, d,
|
|
1381
|
+
return v.fn.call(v.context, c, d, y), !0;
|
|
1382
1382
|
case 5:
|
|
1383
|
-
return v.fn.call(v.context, c, d,
|
|
1383
|
+
return v.fn.call(v.context, c, d, y, w), !0;
|
|
1384
1384
|
case 6:
|
|
1385
|
-
return v.fn.call(v.context, c, d,
|
|
1385
|
+
return v.fn.call(v.context, c, d, y, w, _), !0;
|
|
1386
1386
|
}
|
|
1387
|
-
for (
|
|
1388
|
-
b[
|
|
1387
|
+
for (A = 1, b = new Array(x - 1); A < x; A++)
|
|
1388
|
+
b[A - 1] = arguments[A];
|
|
1389
1389
|
v.fn.apply(v.context, b);
|
|
1390
1390
|
} else {
|
|
1391
1391
|
var M = v.length, R;
|
|
1392
|
-
for (
|
|
1393
|
-
switch (v[
|
|
1392
|
+
for (A = 0; A < M; A++)
|
|
1393
|
+
switch (v[A].once && this.removeListener(f, v[A].fn, void 0, !0), x) {
|
|
1394
1394
|
case 1:
|
|
1395
|
-
v[
|
|
1395
|
+
v[A].fn.call(v[A].context);
|
|
1396
1396
|
break;
|
|
1397
1397
|
case 2:
|
|
1398
|
-
v[
|
|
1398
|
+
v[A].fn.call(v[A].context, c);
|
|
1399
1399
|
break;
|
|
1400
1400
|
case 3:
|
|
1401
|
-
v[
|
|
1401
|
+
v[A].fn.call(v[A].context, c, d);
|
|
1402
1402
|
break;
|
|
1403
1403
|
case 4:
|
|
1404
|
-
v[
|
|
1404
|
+
v[A].fn.call(v[A].context, c, d, y);
|
|
1405
1405
|
break;
|
|
1406
1406
|
default:
|
|
1407
1407
|
if (!b)
|
|
1408
1408
|
for (R = 1, b = new Array(x - 1); R < x; R++)
|
|
1409
1409
|
b[R - 1] = arguments[R];
|
|
1410
|
-
v[
|
|
1410
|
+
v[A].fn.apply(v[A].context, b);
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
1413
|
return !0;
|
|
@@ -1415,18 +1415,18 @@ var tn = { exports: {} };
|
|
|
1415
1415
|
return o(this, f, c, d, !1);
|
|
1416
1416
|
}, a.prototype.once = function(f, c, d) {
|
|
1417
1417
|
return o(this, f, c, d, !0);
|
|
1418
|
-
}, a.prototype.removeListener = function(f, c, d,
|
|
1418
|
+
}, a.prototype.removeListener = function(f, c, d, y) {
|
|
1419
1419
|
var w = n ? n + f : f;
|
|
1420
1420
|
if (!this._events[w])
|
|
1421
1421
|
return this;
|
|
1422
1422
|
if (!c)
|
|
1423
1423
|
return r(this, w), this;
|
|
1424
|
-
var
|
|
1425
|
-
if (
|
|
1426
|
-
|
|
1424
|
+
var _ = this._events[w];
|
|
1425
|
+
if (_.fn)
|
|
1426
|
+
_.fn === c && (!y || _.once) && (!d || _.context === d) && r(this, w);
|
|
1427
1427
|
else {
|
|
1428
|
-
for (var
|
|
1429
|
-
(
|
|
1428
|
+
for (var S = 0, v = [], x = _.length; S < x; S++)
|
|
1429
|
+
(_[S].fn !== c || y && !_[S].once || d && _[S].context !== d) && v.push(_[S]);
|
|
1430
1430
|
v.length ? this._events[w] = v.length === 1 ? v[0] : v : r(this, w);
|
|
1431
1431
|
}
|
|
1432
1432
|
return this;
|
|
@@ -1434,8 +1434,122 @@ var tn = { exports: {} };
|
|
|
1434
1434
|
var c;
|
|
1435
1435
|
return f ? (c = n ? n + f : f, this._events[c] && r(this, c)) : (this._events = new s(), this._eventsCount = 0), this;
|
|
1436
1436
|
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = n, a.EventEmitter = a, e.exports = a;
|
|
1437
|
-
})(
|
|
1438
|
-
var
|
|
1437
|
+
})(sn);
|
|
1438
|
+
var vt = sn.exports;
|
|
1439
|
+
function fs(e) {
|
|
1440
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1441
|
+
}
|
|
1442
|
+
var ls = function(e, t) {
|
|
1443
|
+
t || (t = {}), typeof t == "function" && (t = { cmp: t });
|
|
1444
|
+
var n = typeof t.cycles == "boolean" ? t.cycles : !1, s = t.cmp && /* @__PURE__ */ function(o) {
|
|
1445
|
+
return function(r) {
|
|
1446
|
+
return function(a, u) {
|
|
1447
|
+
var f = { key: a, value: r[a] }, c = { key: u, value: r[u] };
|
|
1448
|
+
return o(f, c);
|
|
1449
|
+
};
|
|
1450
|
+
};
|
|
1451
|
+
}(t.cmp), i = [];
|
|
1452
|
+
return function o(r) {
|
|
1453
|
+
if (r && r.toJSON && typeof r.toJSON == "function" && (r = r.toJSON()), r !== void 0) {
|
|
1454
|
+
if (typeof r == "number")
|
|
1455
|
+
return isFinite(r) ? "" + r : "null";
|
|
1456
|
+
if (typeof r != "object")
|
|
1457
|
+
return JSON.stringify(r);
|
|
1458
|
+
var a, u;
|
|
1459
|
+
if (Array.isArray(r)) {
|
|
1460
|
+
for (u = "[", a = 0; a < r.length; a++)
|
|
1461
|
+
a && (u += ","), u += o(r[a]) || "null";
|
|
1462
|
+
return u + "]";
|
|
1463
|
+
}
|
|
1464
|
+
if (r === null)
|
|
1465
|
+
return "null";
|
|
1466
|
+
if (i.indexOf(r) !== -1) {
|
|
1467
|
+
if (n)
|
|
1468
|
+
return JSON.stringify("__cycle__");
|
|
1469
|
+
throw new TypeError("Converting circular structure to JSON");
|
|
1470
|
+
}
|
|
1471
|
+
var f = i.push(r) - 1, c = Object.keys(r).sort(s && s(r));
|
|
1472
|
+
for (u = "", a = 0; a < c.length; a++) {
|
|
1473
|
+
var d = c[a], y = o(r[d]);
|
|
1474
|
+
y && (u && (u += ","), u += JSON.stringify(d) + ":" + y);
|
|
1475
|
+
}
|
|
1476
|
+
return i.splice(f, 1), "{" + u + "}";
|
|
1477
|
+
}
|
|
1478
|
+
}(e);
|
|
1479
|
+
};
|
|
1480
|
+
const ps = /* @__PURE__ */ fs(ls), hs = (e) => rn(ps(e)), ds = (e) => {
|
|
1481
|
+
if (e && e.length > 0)
|
|
1482
|
+
return JSON.parse(on(e));
|
|
1483
|
+
}, rn = (e) => btoa(encodeURIComponent(e)), on = (e) => decodeURIComponent(atob(e)), an = (e) => {
|
|
1484
|
+
const t = new URL(e);
|
|
1485
|
+
return un(t.hash);
|
|
1486
|
+
}, un = (e) => {
|
|
1487
|
+
let t = e;
|
|
1488
|
+
for (; t.startsWith("#"); )
|
|
1489
|
+
t = t.substring(1);
|
|
1490
|
+
const n = t.indexOf("?");
|
|
1491
|
+
if (n === -1)
|
|
1492
|
+
return [t, {}];
|
|
1493
|
+
const s = t.substring(0, n);
|
|
1494
|
+
t = t.substring(n + 1);
|
|
1495
|
+
const i = {};
|
|
1496
|
+
return t.split("&").filter((o) => o.length > 0).map((o) => {
|
|
1497
|
+
const r = o.indexOf("=");
|
|
1498
|
+
if (r === -1)
|
|
1499
|
+
return [o, ""];
|
|
1500
|
+
const a = o.substring(0, r), u = o.substring(r + 1);
|
|
1501
|
+
return [a, u];
|
|
1502
|
+
}).forEach(([o, r]) => {
|
|
1503
|
+
i[o] = r;
|
|
1504
|
+
}), Object.keys(i).forEach((o) => {
|
|
1505
|
+
try {
|
|
1506
|
+
i[o] = decodeURI(i[o]);
|
|
1507
|
+
} catch {
|
|
1508
|
+
i[o] = i[o];
|
|
1509
|
+
}
|
|
1510
|
+
}), [s, i];
|
|
1511
|
+
}, Pe = (e, t) => {
|
|
1512
|
+
const [n, s] = an(e);
|
|
1513
|
+
return s[t];
|
|
1514
|
+
}, ms = (e) => ys()[1][e], ys = () => an(window.location.href), Ae = (e, t, n) => {
|
|
1515
|
+
const s = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, i = _s(s, e, t);
|
|
1516
|
+
i !== s && (n != null && n.modifyHistory ? window.location.hash = i : (window.history.replaceState(null, document.title, `${window.location.pathname}${window.location.search}${i.startsWith("#") ? "" : "#"}${i}`), window.dispatchEvent(new HashChangeEvent("hashchange"))));
|
|
1517
|
+
}, _s = (e, t, n) => {
|
|
1518
|
+
const [s, i] = un(e);
|
|
1519
|
+
let o = !1;
|
|
1520
|
+
if (i.hasOwnProperty(t) && n === null || n === void 0 ? (delete i[t], o = !0) : i[t] !== n && (i[t] = n, o = !0), !o)
|
|
1521
|
+
return e;
|
|
1522
|
+
const r = Object.keys(i);
|
|
1523
|
+
r.sort();
|
|
1524
|
+
const a = r.map((u, f) => `${u}=${encodeURI(i[u])}`).join("&");
|
|
1525
|
+
return `${s}?${a}`;
|
|
1526
|
+
}, gs = (e, t) => {
|
|
1527
|
+
const n = Pe(e, t);
|
|
1528
|
+
if (n && n !== "")
|
|
1529
|
+
return ds(n);
|
|
1530
|
+
}, bs = (e, t, n) => {
|
|
1531
|
+
const s = t ? hs(t) : void 0;
|
|
1532
|
+
Ae(e, s, n);
|
|
1533
|
+
}, vs = (e) => gs(window.location.href, e), ws = (e, t) => {
|
|
1534
|
+
const n = Pe(e, t);
|
|
1535
|
+
return n ? parseFloat(n) : void 0;
|
|
1536
|
+
}, cn = (e, t, n) => {
|
|
1537
|
+
Ae(e, t != null ? t.toString() : void 0, n);
|
|
1538
|
+
}, Rs = (e) => ws(window.location.href, e), Os = (e, t) => {
|
|
1539
|
+
const n = Pe(e, t);
|
|
1540
|
+
return n ? parseInt(n) : void 0;
|
|
1541
|
+
}, As = (e, t, n) => {
|
|
1542
|
+
cn(e, t, n);
|
|
1543
|
+
}, Ss = (e) => Os(window.location.href, e), Es = (e, t) => Pe(e, t) === "true", Ms = (e, t, n) => {
|
|
1544
|
+
Ae(e, t ? "true" : void 0, n);
|
|
1545
|
+
}, Is = (e) => Es(window.location.href, e), Cs = (e, t) => {
|
|
1546
|
+
const n = Pe(e, t);
|
|
1547
|
+
return n && n !== "" ? on(n) : void 0;
|
|
1548
|
+
}, $s = (e, t, n) => {
|
|
1549
|
+
const s = t == null ? void 0 : rn(t);
|
|
1550
|
+
Ae(e, s, n);
|
|
1551
|
+
}, xs = (e) => Cs(window.location.href, e);
|
|
1552
|
+
var Ls = function(e, t) {
|
|
1439
1553
|
t || (t = {}), typeof t == "function" && (t = { cmp: t });
|
|
1440
1554
|
var n = typeof t.cycles == "boolean" ? t.cycles : !1, s = t.cmp && function(o) {
|
|
1441
1555
|
return function(r) {
|
|
@@ -1466,31 +1580,31 @@ var gt = tn.exports, ss = function(e, t) {
|
|
|
1466
1580
|
}
|
|
1467
1581
|
var f = i.push(r) - 1, c = Object.keys(r).sort(s && s(r));
|
|
1468
1582
|
for (u = "", a = 0; a < c.length; a++) {
|
|
1469
|
-
var d = c[a],
|
|
1470
|
-
|
|
1583
|
+
var d = c[a], y = o(r[d]);
|
|
1584
|
+
y && (u && (u += ","), u += JSON.stringify(d) + ":" + y);
|
|
1471
1585
|
}
|
|
1472
1586
|
return i.splice(f, 1), "{" + u + "}";
|
|
1473
1587
|
}
|
|
1474
1588
|
}(e);
|
|
1475
1589
|
};
|
|
1476
|
-
const
|
|
1477
|
-
var
|
|
1590
|
+
const fn = /* @__PURE__ */ ht(Ls);
|
|
1591
|
+
var xe;
|
|
1478
1592
|
(function(e) {
|
|
1479
1593
|
e.mp_debug = "mp_debug";
|
|
1480
|
-
})(
|
|
1481
|
-
const
|
|
1594
|
+
})(xe || (xe = {}));
|
|
1595
|
+
const Ps = () => {
|
|
1482
1596
|
try {
|
|
1483
1597
|
return window !== window.top;
|
|
1484
1598
|
} catch {
|
|
1485
1599
|
return !1;
|
|
1486
1600
|
}
|
|
1487
|
-
},
|
|
1488
|
-
version:
|
|
1601
|
+
}, ln = {
|
|
1602
|
+
version: Je,
|
|
1489
1603
|
metaframes: {}
|
|
1490
1604
|
};
|
|
1491
|
-
class
|
|
1605
|
+
class Ts extends vt.EventEmitter {
|
|
1492
1606
|
constructor() {
|
|
1493
|
-
super(), this._definition =
|
|
1607
|
+
super(), this._definition = ln, this.getDefinition = this.getDefinition.bind(this);
|
|
1494
1608
|
}
|
|
1495
1609
|
error(t) {
|
|
1496
1610
|
throw "Subclass should implement";
|
|
@@ -1499,18 +1613,18 @@ class rs extends gt.EventEmitter {
|
|
|
1499
1613
|
return this._definition;
|
|
1500
1614
|
}
|
|
1501
1615
|
}
|
|
1502
|
-
const
|
|
1616
|
+
const ze = (e, t) => t ? C(e, (n) => {
|
|
1503
1617
|
Object.keys(t).forEach((s) => {
|
|
1504
1618
|
t[s] === void 0 ? delete n[s] : n[s] = t[s];
|
|
1505
1619
|
});
|
|
1506
|
-
}) : e,
|
|
1507
|
-
const e = new URLSearchParams(window.location.search).get(
|
|
1620
|
+
}) : e, Ii = (e) => window.location.search ? new URLSearchParams(window.location.search).get(e) : null, Ci = () => new URLSearchParams(window.location.search).has(xe.mp_debug), ft = () => {
|
|
1621
|
+
const e = new URLSearchParams(window.location.search).get(xe.mp_debug);
|
|
1508
1622
|
return e === "true" || e === "1";
|
|
1509
|
-
},
|
|
1510
|
-
for (var t = "", n =
|
|
1511
|
-
t +=
|
|
1623
|
+
}, $i = (e = 8) => wt(e), Ds = (e = 8) => wt(e), xi = (e = 8) => wt(e), Ht = "abcdefghijklmnopqrstuvwxyz0123456789", wt = (e = 8) => {
|
|
1624
|
+
for (var t = "", n = Ht.length, s = 0; s < e; s++)
|
|
1625
|
+
t += Ht.charAt(Math.floor(Math.random() * n));
|
|
1512
1626
|
return t;
|
|
1513
|
-
},
|
|
1627
|
+
}, Rt = (e, t, n) => {
|
|
1514
1628
|
t = t || "000", t && t.trim() == "" && (t = void 0);
|
|
1515
1629
|
let s;
|
|
1516
1630
|
if (typeof e == "string" ? s = e : typeof e == "number" ? s = e + "" : s = JSON.stringify(e, null, " "), t && t.trim() != "") {
|
|
@@ -1518,16 +1632,16 @@ const Be = (e, t) => t ? C(e, (n) => {
|
|
|
1518
1632
|
n && (i = `${i}; background: #${n}`), s = `%c${s}`, window.console.log(s, i);
|
|
1519
1633
|
} else
|
|
1520
1634
|
window.console.log(s);
|
|
1521
|
-
},
|
|
1635
|
+
}, pn = (e) => Ns(Hs(e)), Hs = (e) => {
|
|
1522
1636
|
var t = 0;
|
|
1523
1637
|
for (let n = 0; n < e.length; n++)
|
|
1524
1638
|
t = e.charCodeAt(n) + ((t << 5) - t);
|
|
1525
1639
|
return t;
|
|
1526
|
-
},
|
|
1640
|
+
}, Ns = (e) => {
|
|
1527
1641
|
var t = (e & 16777215).toString(16).toUpperCase();
|
|
1528
1642
|
return "00000".substring(0, 6 - t.length) + t;
|
|
1529
|
-
},
|
|
1530
|
-
if (
|
|
1643
|
+
}, Ze = () => document.readyState == "complete" || document.readyState == "interactive", Ot = async () => Ze() ? Promise.resolve() : new Promise((e) => {
|
|
1644
|
+
if (Ze()) {
|
|
1531
1645
|
e();
|
|
1532
1646
|
return;
|
|
1533
1647
|
}
|
|
@@ -1535,58 +1649,64 @@ const Be = (e, t) => t ? C(e, (n) => {
|
|
|
1535
1649
|
window.addEventListener("load", () => {
|
|
1536
1650
|
t || (t = !0, e());
|
|
1537
1651
|
}), setTimeout(() => {
|
|
1538
|
-
!t &&
|
|
1652
|
+
!t && Ze() && (t = !0, e());
|
|
1539
1653
|
}, 200);
|
|
1540
|
-
}),
|
|
1541
|
-
const t =
|
|
1542
|
-
return await
|
|
1543
|
-
},
|
|
1544
|
-
const t =
|
|
1654
|
+
}), Li = async (e) => {
|
|
1655
|
+
const t = fn(e);
|
|
1656
|
+
return await hn(t);
|
|
1657
|
+
}, Pi = async (e) => {
|
|
1658
|
+
const t = fn({
|
|
1545
1659
|
version: e.version,
|
|
1546
1660
|
metaframes: e.metaframes
|
|
1547
1661
|
});
|
|
1548
|
-
return await
|
|
1662
|
+
return await hn(t);
|
|
1549
1663
|
};
|
|
1550
|
-
async function
|
|
1664
|
+
async function hn(e) {
|
|
1551
1665
|
const n = new TextEncoder().encode(e), s = await crypto.subtle.digest("SHA-256", n);
|
|
1552
1666
|
return btoa(String.fromCharCode(...new Uint8Array(s)));
|
|
1553
1667
|
}
|
|
1554
|
-
var
|
|
1668
|
+
var re;
|
|
1555
1669
|
(function(e) {
|
|
1556
1670
|
e.WaitingForPageLoad = "WaitingForPageLoad", e.SentSetupIframeClientRequest = "SentSetupIframeClientRequest", e.Ready = "Ready";
|
|
1557
|
-
})(
|
|
1558
|
-
var
|
|
1671
|
+
})(re || (re = {}));
|
|
1672
|
+
var U;
|
|
1559
1673
|
(function(e) {
|
|
1560
1674
|
e.Connected = "connected", e.Error = "error", e.Input = "input", e.Inputs = "inputs", e.Message = "message";
|
|
1561
|
-
})(
|
|
1562
|
-
class te extends
|
|
1675
|
+
})(U || (U = {}));
|
|
1676
|
+
class te extends vt.EventEmitter {
|
|
1563
1677
|
constructor(t) {
|
|
1564
|
-
if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state =
|
|
1678
|
+
if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = re.WaitingForPageLoad, this._messageSendCount = 0, this.debug = ft(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = ft(), this._isIframe = Ps(), this.addListener = this.addListener.bind(this), this.dispose = this.dispose.bind(this), this.error = this.error.bind(this), this.getInput = this.getInput.bind(this), this.getInputs = this.getInputs.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onMessage = this.onMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInternalInputsAndNotify = this.setInternalInputsAndNotify.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.warn = this.warn.bind(this), this._resolveSetupIframeServerResponse = this._resolveSetupIframeServerResponse.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.connected = this.connected.bind(this), this.isConnected = this.isConnected.bind(this), this.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), this.setParameter = this.setParameter.bind(this), this.setParameterBoolean = this.setParameterBoolean.bind(this), this.setParameterJson = this.setParameterJson.bind(this), this.setParameterBase64 = this.setParameterBase64.bind(this), this.setParameterFloat = this.setParameterFloat.bind(this), this.setParameterInt = this.setParameterInt.bind(this), this.getParameter = this.getParameter.bind(this), this.getParameterBoolean = this.getParameterBoolean.bind(this), this.getParameterJson = this.getParameterJson.bind(this), this.getParameterBase64 = this.getParameterBase64.bind(this), this.getParameterFloat = this.getParameterFloat.bind(this), this.getParameterInt = this.getParameterInt.bind(this), this.deleteParameter = this.deleteParameter.bind(this), !this._isIframe) {
|
|
1565
1679
|
this.log("Not an iframe, metaframe code disabled");
|
|
1566
1680
|
return;
|
|
1567
1681
|
}
|
|
1568
1682
|
const n = this;
|
|
1569
|
-
|
|
1570
|
-
this.log("pageLoaded"), window.addEventListener("message", this.onMessage), n.sendRpc(
|
|
1683
|
+
Ot().then(() => {
|
|
1684
|
+
this.log("pageLoaded"), window.addEventListener("message", this.onMessage), n.sendRpc(X.SetupIframeClientRequest, {
|
|
1571
1685
|
version: te.version
|
|
1572
|
-
}), n._state =
|
|
1686
|
+
}), n._state = re.SentSetupIframeClientRequest;
|
|
1573
1687
|
}), t && t.disableHashChangeEvent || window.addEventListener("hashchange", this._onHashUrlChange);
|
|
1574
1688
|
}
|
|
1575
1689
|
_resolveSetupIframeServerResponse(t) {
|
|
1576
|
-
if (this._state ===
|
|
1690
|
+
if (this._state === re.WaitingForPageLoad)
|
|
1577
1691
|
throw "Got message but page has not finished loading, we should never get in this state";
|
|
1578
|
-
(async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = t.version, this.color =
|
|
1692
|
+
(async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = t.version, this.color = pn(this.id), this._parentId = t.parentId, this.log(`metapage[${this._parentId}](v${this._parentVersion ? this._parentVersion : "unknown"}) registered`), t.state && t.state.inputs && (this.isInputOutputBlobSerialization ? this._inputPipeValues = await Ce(t.state.inputs) : this._inputPipeValues = t.state.inputs), this._state = re.Ready, this.sendRpc(X.SetupIframeServerResponseAck, {
|
|
1579
1693
|
version: te.version
|
|
1580
|
-
}), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(
|
|
1694
|
+
}), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(U.Inputs, this._inputPipeValues), this.listenerCount(U.Input) > 0 && Object.keys(this._inputPipeValues).forEach((n) => this.emit(U.Input, n, this._inputPipeValues[n]))), this.emit(U.Connected), this.sendRpc(X.OutputsUpdate, this._outputPipeValues)))();
|
|
1695
|
+
}
|
|
1696
|
+
isConnected() {
|
|
1697
|
+
return this._state === re.Ready;
|
|
1581
1698
|
}
|
|
1582
1699
|
async connected() {
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1700
|
+
return new Promise((t, n) => {
|
|
1701
|
+
if (this._state === re.Ready) {
|
|
1702
|
+
t();
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
let s;
|
|
1706
|
+
s = this.addListenerReturnDisposer(U.Connected, () => {
|
|
1707
|
+
t(), s();
|
|
1589
1708
|
});
|
|
1709
|
+
});
|
|
1590
1710
|
}
|
|
1591
1711
|
addListenerReturnDisposer(t, n) {
|
|
1592
1712
|
return super.addListener(t, n), () => {
|
|
@@ -1604,46 +1724,46 @@ class te extends gt.EventEmitter {
|
|
|
1604
1724
|
}
|
|
1605
1725
|
logInternal(t, n, s) {
|
|
1606
1726
|
let i;
|
|
1607
|
-
typeof t == "string" ? i = t : typeof t == "number" ? i = t + "" : i = JSON.stringify(t), n = n && n + "", i = (this.id ? `Metaframe[${this.id}] ` : "") + `${i}`,
|
|
1727
|
+
typeof t == "string" ? i = t : typeof t == "number" ? i = t + "" : i = JSON.stringify(t), n = n && n + "", i = (this.id ? `Metaframe[${this.id}] ` : "") + `${i}`, Rt(i, n, s);
|
|
1608
1728
|
}
|
|
1609
1729
|
dispose() {
|
|
1610
1730
|
super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this.disableNotifyOnHashUrlChange(), this._inputPipeValues = void 0, this._outputPipeValues = void 0;
|
|
1611
1731
|
}
|
|
1612
1732
|
addListener(t, n) {
|
|
1613
|
-
return super.addListener(t, n), t ===
|
|
1733
|
+
return super.addListener(t, n), t === U.Inputs && window.setTimeout(() => {
|
|
1614
1734
|
this._inputPipeValues && n(this._inputPipeValues);
|
|
1615
1735
|
}, 0), this;
|
|
1616
1736
|
}
|
|
1617
1737
|
onInput(t, n) {
|
|
1618
|
-
return this.addListenerReturnDisposer(
|
|
1738
|
+
return this.addListenerReturnDisposer(U.Input, (s, i) => {
|
|
1619
1739
|
t === s && n(i);
|
|
1620
1740
|
});
|
|
1621
1741
|
}
|
|
1622
1742
|
onInputs(t) {
|
|
1623
|
-
return this.addListenerReturnDisposer(
|
|
1743
|
+
return this.addListenerReturnDisposer(U.Inputs, t);
|
|
1624
1744
|
}
|
|
1625
1745
|
setInput(t, n) {
|
|
1626
1746
|
var s = {};
|
|
1627
1747
|
s[t] = n, this.setInputs(s);
|
|
1628
1748
|
}
|
|
1629
1749
|
async setInputs(t) {
|
|
1630
|
-
this.isInputOutputBlobSerialization && (t = await
|
|
1750
|
+
this.isInputOutputBlobSerialization && (t = await Ce(t)), this.sendRpc(X.InputsUpdate, t);
|
|
1631
1751
|
}
|
|
1632
1752
|
async setInternalInputsAndNotify(t) {
|
|
1633
|
-
this.isInputOutputBlobSerialization && (t = await
|
|
1753
|
+
this.isInputOutputBlobSerialization && (t = await Ce(t));
|
|
1634
1754
|
const n = t;
|
|
1635
|
-
if (this._inputPipeValues =
|
|
1755
|
+
if (this._inputPipeValues = ze(this._inputPipeValues, t), this._inputPipeValues !== n) {
|
|
1636
1756
|
Object.keys(t).forEach((s) => {
|
|
1637
1757
|
try {
|
|
1638
|
-
this.emit(
|
|
1758
|
+
this.emit(U.Input, s, t[s]);
|
|
1639
1759
|
} catch (i) {
|
|
1640
|
-
console.error(`Error emitting input ${s}: ${i}`), this.emit(
|
|
1760
|
+
console.error(`Error emitting input ${s}: ${i}`), this.emit(U.Error, `Error emitting input ${s}: ${i}`);
|
|
1641
1761
|
}
|
|
1642
1762
|
});
|
|
1643
1763
|
try {
|
|
1644
|
-
this.emit(
|
|
1764
|
+
this.emit(U.Inputs, t);
|
|
1645
1765
|
} catch (s) {
|
|
1646
|
-
console.error(`Error emitting inputs: ${s}`), this.emit(
|
|
1766
|
+
console.error(`Error emitting inputs: ${s}`), this.emit(U.Error, `Error emitting inputs: ${s}`);
|
|
1647
1767
|
}
|
|
1648
1768
|
}
|
|
1649
1769
|
}
|
|
@@ -1659,9 +1779,9 @@ class te extends gt.EventEmitter {
|
|
|
1659
1779
|
s[t] = n, this.setOutputs(s);
|
|
1660
1780
|
}
|
|
1661
1781
|
async setOutputs(t) {
|
|
1662
|
-
this.isInputOutputBlobSerialization && (t = await
|
|
1782
|
+
this.isInputOutputBlobSerialization && (t = await We(t));
|
|
1663
1783
|
const n = t;
|
|
1664
|
-
this._outputPipeValues =
|
|
1784
|
+
this._outputPipeValues = ze(this._outputPipeValues, t), this._outputPipeValues !== n && this._state === re.Ready && this.sendRpc(X.OutputsUpdate, t);
|
|
1665
1785
|
}
|
|
1666
1786
|
disableNotifyOnHashUrlChange() {
|
|
1667
1787
|
window.removeEventListener("hashchange", this._onHashUrlChange);
|
|
@@ -1671,7 +1791,7 @@ class te extends gt.EventEmitter {
|
|
|
1671
1791
|
hash: window.location.hash,
|
|
1672
1792
|
metaframe: this.id
|
|
1673
1793
|
};
|
|
1674
|
-
this.sendRpc(
|
|
1794
|
+
this.sendRpc(X.HashParamsUpdate, n);
|
|
1675
1795
|
}
|
|
1676
1796
|
sendRpc(t, n) {
|
|
1677
1797
|
if (this._isIframe) {
|
|
@@ -1692,72 +1812,111 @@ class te extends gt.EventEmitter {
|
|
|
1692
1812
|
let s = t.data;
|
|
1693
1813
|
if (s.jsonrpc === "2.0") {
|
|
1694
1814
|
var n = s.method;
|
|
1695
|
-
if (!(n ==
|
|
1815
|
+
if (!(n == fe.SetupIframeServerResponse || s.parentId == this._parentId && s.iframeId == this.id)) {
|
|
1696
1816
|
this.log(`window.message: received message but jsonrpc.parentId=${s.parentId} _parentId=${this._parentId} jsonrpc.iframeId=${s.iframeId} id=${this.id}`);
|
|
1697
1817
|
return;
|
|
1698
1818
|
}
|
|
1699
1819
|
switch (n) {
|
|
1700
|
-
case
|
|
1820
|
+
case fe.SetupIframeServerResponse:
|
|
1701
1821
|
this._resolveSetupIframeServerResponse(s.params);
|
|
1702
1822
|
break;
|
|
1703
|
-
case
|
|
1704
|
-
if (this._state !==
|
|
1823
|
+
case fe.InputsUpdate:
|
|
1824
|
+
if (this._state !== re.Ready)
|
|
1705
1825
|
throw "Got InputsUpdate but metaframe is not MetaframeLoadingState.Ready";
|
|
1706
1826
|
this.setInternalInputsAndNotify(s.params.inputs);
|
|
1707
1827
|
break;
|
|
1708
|
-
case
|
|
1828
|
+
case fe.MessageAck:
|
|
1709
1829
|
this.debug && this.log(`ACK: ${JSON.stringify(s)}`);
|
|
1710
1830
|
break;
|
|
1711
1831
|
default:
|
|
1712
1832
|
this.debug && this.log(`window.message: unknown JSON-RPC method: ${JSON.stringify(s)}`);
|
|
1713
1833
|
break;
|
|
1714
1834
|
}
|
|
1715
|
-
this.emit(
|
|
1835
|
+
this.listenerCount(U.Message) > 0 && this.emit(U.Message, s);
|
|
1716
1836
|
}
|
|
1717
1837
|
}
|
|
1718
1838
|
}
|
|
1839
|
+
setParameter(t, n) {
|
|
1840
|
+
Ae(t, n);
|
|
1841
|
+
}
|
|
1842
|
+
getParameter(t) {
|
|
1843
|
+
return ms(t);
|
|
1844
|
+
}
|
|
1845
|
+
setParameterBoolean(t, n) {
|
|
1846
|
+
Ms(t, n);
|
|
1847
|
+
}
|
|
1848
|
+
getParameterBoolean(t) {
|
|
1849
|
+
return Is(t);
|
|
1850
|
+
}
|
|
1851
|
+
setParameterJson(t, n) {
|
|
1852
|
+
bs(t, n);
|
|
1853
|
+
}
|
|
1854
|
+
getParameterJson(t) {
|
|
1855
|
+
return vs(t);
|
|
1856
|
+
}
|
|
1857
|
+
setParameterBase64(t, n) {
|
|
1858
|
+
$s(t, n);
|
|
1859
|
+
}
|
|
1860
|
+
getParameterBase64(t) {
|
|
1861
|
+
return xs(t);
|
|
1862
|
+
}
|
|
1863
|
+
setParameterFloat(t, n) {
|
|
1864
|
+
cn(t, n);
|
|
1865
|
+
}
|
|
1866
|
+
getParameterFloat(t) {
|
|
1867
|
+
return Rs(t);
|
|
1868
|
+
}
|
|
1869
|
+
setParameterInt(t, n) {
|
|
1870
|
+
As(t, n);
|
|
1871
|
+
}
|
|
1872
|
+
getParameterInt(t) {
|
|
1873
|
+
return Ss(t);
|
|
1874
|
+
}
|
|
1875
|
+
deleteParameter(t) {
|
|
1876
|
+
Ae(t, void 0);
|
|
1877
|
+
}
|
|
1719
1878
|
}
|
|
1720
|
-
te.version =
|
|
1721
|
-
te.ERROR =
|
|
1722
|
-
te.CONNECTED =
|
|
1723
|
-
te.INPUT =
|
|
1724
|
-
te.INPUTS =
|
|
1725
|
-
te.MESSAGE =
|
|
1726
|
-
te.deserializeInputs =
|
|
1727
|
-
te.serializeInputs =
|
|
1879
|
+
te.version = An;
|
|
1880
|
+
te.ERROR = U.Error;
|
|
1881
|
+
te.CONNECTED = U.Connected;
|
|
1882
|
+
te.INPUT = U.Input;
|
|
1883
|
+
te.INPUTS = U.Inputs;
|
|
1884
|
+
te.MESSAGE = U.Message;
|
|
1885
|
+
te.deserializeInputs = Ce;
|
|
1886
|
+
te.serializeInputs = We;
|
|
1728
1887
|
var Ke = {};
|
|
1729
|
-
const ie = "\\\\/",
|
|
1730
|
-
DOT_LITERAL:
|
|
1731
|
-
PLUS_LITERAL:
|
|
1732
|
-
QMARK_LITERAL:
|
|
1733
|
-
SLASH_LITERAL:
|
|
1734
|
-
ONE_CHAR:
|
|
1735
|
-
QMARK:
|
|
1736
|
-
END_ANCHOR:
|
|
1737
|
-
DOTS_SLASH:
|
|
1738
|
-
NO_DOT:
|
|
1739
|
-
NO_DOTS:
|
|
1740
|
-
NO_DOT_SLASH:
|
|
1741
|
-
NO_DOTS_SLASH:
|
|
1742
|
-
QMARK_NO_DOT:
|
|
1743
|
-
STAR:
|
|
1744
|
-
START_ANCHOR:
|
|
1745
|
-
SEP:
|
|
1746
|
-
},
|
|
1747
|
-
...
|
|
1888
|
+
const ie = "\\\\/", Nt = `[^${ie}]`, ce = "\\.", ks = "\\+", js = "\\?", Xe = "\\/", Us = "(?=.)", dn = "[^/]", At = `(?:${Xe}|$)`, mn = `(?:^|${Xe})`, St = `${ce}{1,2}${At}`, Bs = `(?!${ce})`, Fs = `(?!${mn}${St})`, zs = `(?!${ce}{0,1}${At})`, Gs = `(?!${St})`, Vs = `[^.${Xe}]`, Js = `${dn}*?`, Ws = "/", yn = {
|
|
1889
|
+
DOT_LITERAL: ce,
|
|
1890
|
+
PLUS_LITERAL: ks,
|
|
1891
|
+
QMARK_LITERAL: js,
|
|
1892
|
+
SLASH_LITERAL: Xe,
|
|
1893
|
+
ONE_CHAR: Us,
|
|
1894
|
+
QMARK: dn,
|
|
1895
|
+
END_ANCHOR: At,
|
|
1896
|
+
DOTS_SLASH: St,
|
|
1897
|
+
NO_DOT: Bs,
|
|
1898
|
+
NO_DOTS: Fs,
|
|
1899
|
+
NO_DOT_SLASH: zs,
|
|
1900
|
+
NO_DOTS_SLASH: Gs,
|
|
1901
|
+
QMARK_NO_DOT: Vs,
|
|
1902
|
+
STAR: Js,
|
|
1903
|
+
START_ANCHOR: mn,
|
|
1904
|
+
SEP: Ws
|
|
1905
|
+
}, Ks = {
|
|
1906
|
+
...yn,
|
|
1748
1907
|
SLASH_LITERAL: `[${ie}]`,
|
|
1749
|
-
QMARK:
|
|
1750
|
-
STAR: `${
|
|
1751
|
-
DOTS_SLASH: `${
|
|
1752
|
-
NO_DOT: `(?!${
|
|
1753
|
-
NO_DOTS: `(?!(?:^|[${ie}])${
|
|
1754
|
-
NO_DOT_SLASH: `(?!${
|
|
1755
|
-
NO_DOTS_SLASH: `(?!${
|
|
1908
|
+
QMARK: Nt,
|
|
1909
|
+
STAR: `${Nt}*?`,
|
|
1910
|
+
DOTS_SLASH: `${ce}{1,2}(?:[${ie}]|$)`,
|
|
1911
|
+
NO_DOT: `(?!${ce})`,
|
|
1912
|
+
NO_DOTS: `(?!(?:^|[${ie}])${ce}{1,2}(?:[${ie}]|$))`,
|
|
1913
|
+
NO_DOT_SLASH: `(?!${ce}{0,1}(?:[${ie}]|$))`,
|
|
1914
|
+
NO_DOTS_SLASH: `(?!${ce}{1,2}(?:[${ie}]|$))`,
|
|
1756
1915
|
QMARK_NO_DOT: `[^.${ie}]`,
|
|
1757
1916
|
START_ANCHOR: `(?:^|[${ie}])`,
|
|
1758
1917
|
END_ANCHOR: `(?:[${ie}]|$)`,
|
|
1759
1918
|
SEP: "\\"
|
|
1760
|
-
},
|
|
1919
|
+
}, Xs = {
|
|
1761
1920
|
alnum: "a-zA-Z0-9",
|
|
1762
1921
|
alpha: "a-zA-Z",
|
|
1763
1922
|
ascii: "\\x00-\\x7F",
|
|
@@ -1773,9 +1932,9 @@ const ie = "\\\\/", Pt = `[^${ie}]`, ue = "\\.", cs = "\\+", fs = "\\?", We = "\
|
|
|
1773
1932
|
word: "A-Za-z0-9_",
|
|
1774
1933
|
xdigit: "A-Fa-f0-9"
|
|
1775
1934
|
};
|
|
1776
|
-
var
|
|
1935
|
+
var qe = {
|
|
1777
1936
|
MAX_LENGTH: 1024 * 64,
|
|
1778
|
-
POSIX_REGEX_SOURCE:
|
|
1937
|
+
POSIX_REGEX_SOURCE: Xs,
|
|
1779
1938
|
// regular expressions
|
|
1780
1939
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
1781
1940
|
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
@@ -1894,7 +2053,7 @@ var Je = {
|
|
|
1894
2053
|
* Create GLOB_CHARS
|
|
1895
2054
|
*/
|
|
1896
2055
|
globChars(e) {
|
|
1897
|
-
return e === !0 ?
|
|
2056
|
+
return e === !0 ? Ks : yn;
|
|
1898
2057
|
}
|
|
1899
2058
|
};
|
|
1900
2059
|
(function(e) {
|
|
@@ -1903,7 +2062,7 @@ var Je = {
|
|
|
1903
2062
|
REGEX_REMOVE_BACKSLASH: n,
|
|
1904
2063
|
REGEX_SPECIAL_CHARS: s,
|
|
1905
2064
|
REGEX_SPECIAL_CHARS_GLOBAL: i
|
|
1906
|
-
} =
|
|
2065
|
+
} = qe;
|
|
1907
2066
|
e.isObject = (o) => o !== null && typeof o == "object" && !Array.isArray(o), e.hasRegexChars = (o) => s.test(o), e.isRegexChar = (o) => o.length === 1 && e.hasRegexChars(o), e.escapeRegex = (o) => o.replace(i, "\\$1"), e.toPosixSlashes = (o) => o.replace(t, "/"), e.removeBackslashes = (o) => o.replace(n, (r) => r === "\\" ? "" : r), e.supportsLookbehinds = () => {
|
|
1908
2067
|
const o = process.version.slice(1).split(".").map(Number);
|
|
1909
2068
|
return o.length === 3 && o[0] >= 9 || o[0] === 8 && o[1] >= 10;
|
|
@@ -1919,72 +2078,72 @@ var Je = {
|
|
|
1919
2078
|
return r.negated === !0 && (c = `(?:^(?!${c}).*$)`), c;
|
|
1920
2079
|
}, e.basename = (o, { windows: r } = {}) => r ? o.replace(/[\\/]$/, "").replace(/.*[\\/]/, "") : o.replace(/\/$/, "").replace(/.*\//, "");
|
|
1921
2080
|
})(Ke);
|
|
1922
|
-
const
|
|
1923
|
-
CHAR_ASTERISK:
|
|
2081
|
+
const kt = Ke, {
|
|
2082
|
+
CHAR_ASTERISK: et,
|
|
1924
2083
|
/* * */
|
|
1925
|
-
CHAR_AT:
|
|
2084
|
+
CHAR_AT: qs,
|
|
1926
2085
|
/* @ */
|
|
1927
|
-
CHAR_BACKWARD_SLASH:
|
|
2086
|
+
CHAR_BACKWARD_SLASH: Me,
|
|
1928
2087
|
/* \ */
|
|
1929
|
-
CHAR_COMMA:
|
|
2088
|
+
CHAR_COMMA: Qs,
|
|
1930
2089
|
/* , */
|
|
1931
|
-
CHAR_DOT:
|
|
2090
|
+
CHAR_DOT: tt,
|
|
1932
2091
|
/* . */
|
|
1933
|
-
CHAR_EXCLAMATION_MARK:
|
|
2092
|
+
CHAR_EXCLAMATION_MARK: jt,
|
|
1934
2093
|
/* ! */
|
|
1935
|
-
CHAR_FORWARD_SLASH:
|
|
2094
|
+
CHAR_FORWARD_SLASH: _n,
|
|
1936
2095
|
/* / */
|
|
1937
|
-
CHAR_LEFT_CURLY_BRACE:
|
|
2096
|
+
CHAR_LEFT_CURLY_BRACE: nt,
|
|
1938
2097
|
/* { */
|
|
1939
|
-
CHAR_LEFT_PARENTHESES:
|
|
2098
|
+
CHAR_LEFT_PARENTHESES: st,
|
|
1940
2099
|
/* ( */
|
|
1941
|
-
CHAR_LEFT_SQUARE_BRACKET:
|
|
2100
|
+
CHAR_LEFT_SQUARE_BRACKET: Ys,
|
|
1942
2101
|
/* [ */
|
|
1943
|
-
CHAR_PLUS:
|
|
2102
|
+
CHAR_PLUS: Zs,
|
|
1944
2103
|
/* + */
|
|
1945
|
-
CHAR_QUESTION_MARK:
|
|
2104
|
+
CHAR_QUESTION_MARK: Ut,
|
|
1946
2105
|
/* ? */
|
|
1947
|
-
CHAR_RIGHT_CURLY_BRACE:
|
|
2106
|
+
CHAR_RIGHT_CURLY_BRACE: ei,
|
|
1948
2107
|
/* } */
|
|
1949
|
-
CHAR_RIGHT_PARENTHESES:
|
|
2108
|
+
CHAR_RIGHT_PARENTHESES: Bt,
|
|
1950
2109
|
/* ) */
|
|
1951
|
-
CHAR_RIGHT_SQUARE_BRACKET:
|
|
2110
|
+
CHAR_RIGHT_SQUARE_BRACKET: ti
|
|
1952
2111
|
/* ] */
|
|
1953
|
-
} =
|
|
2112
|
+
} = qe, Ft = (e) => e === _n || e === Me, zt = (e) => {
|
|
1954
2113
|
e.isPrefix !== !0 && (e.depth = e.isGlobstar ? 1 / 0 : 1);
|
|
1955
|
-
},
|
|
2114
|
+
}, ni = (e, t) => {
|
|
1956
2115
|
const n = t || {}, s = e.length - 1, i = n.parts === !0 || n.scanToEnd === !0, o = [], r = [], a = [];
|
|
1957
|
-
let u = e, f = -1, c = 0, d = 0,
|
|
1958
|
-
const z = () => f >= s, h = () => u.charCodeAt(f + 1),
|
|
2116
|
+
let u = e, f = -1, c = 0, d = 0, y = !1, w = !1, _ = !1, S = !1, v = !1, x = !1, b = !1, A = !1, M = !1, R = 0, D, O, L = { value: "", depth: 0, isGlob: !1 };
|
|
2117
|
+
const z = () => f >= s, h = () => u.charCodeAt(f + 1), N = () => (D = O, u.charCodeAt(++f));
|
|
1959
2118
|
for (; f < s; ) {
|
|
1960
|
-
|
|
1961
|
-
let
|
|
1962
|
-
if (
|
|
1963
|
-
b = L.backslashes = !0,
|
|
2119
|
+
O = N();
|
|
2120
|
+
let J;
|
|
2121
|
+
if (O === Me) {
|
|
2122
|
+
b = L.backslashes = !0, O = N(), O === nt && (x = !0);
|
|
1964
2123
|
continue;
|
|
1965
2124
|
}
|
|
1966
|
-
if (x === !0 ||
|
|
1967
|
-
for (R++; z() !== !0 && (
|
|
1968
|
-
if (
|
|
1969
|
-
b = L.backslashes = !0,
|
|
2125
|
+
if (x === !0 || O === nt) {
|
|
2126
|
+
for (R++; z() !== !0 && (O = N()); ) {
|
|
2127
|
+
if (O === Me) {
|
|
2128
|
+
b = L.backslashes = !0, N();
|
|
1970
2129
|
continue;
|
|
1971
2130
|
}
|
|
1972
|
-
if (
|
|
2131
|
+
if (O === nt) {
|
|
1973
2132
|
R++;
|
|
1974
2133
|
continue;
|
|
1975
2134
|
}
|
|
1976
|
-
if (x !== !0 &&
|
|
1977
|
-
if (
|
|
2135
|
+
if (x !== !0 && O === tt && (O = N()) === tt) {
|
|
2136
|
+
if (y = L.isBrace = !0, _ = L.isGlob = !0, M = !0, i === !0)
|
|
1978
2137
|
continue;
|
|
1979
2138
|
break;
|
|
1980
2139
|
}
|
|
1981
|
-
if (x !== !0 &&
|
|
1982
|
-
if (
|
|
2140
|
+
if (x !== !0 && O === Qs) {
|
|
2141
|
+
if (y = L.isBrace = !0, _ = L.isGlob = !0, M = !0, i === !0)
|
|
1983
2142
|
continue;
|
|
1984
2143
|
break;
|
|
1985
2144
|
}
|
|
1986
|
-
if (
|
|
1987
|
-
x = !1,
|
|
2145
|
+
if (O === ei && (R--, R === 0)) {
|
|
2146
|
+
x = !1, y = L.isBrace = !0, M = !0;
|
|
1988
2147
|
break;
|
|
1989
2148
|
}
|
|
1990
2149
|
}
|
|
@@ -1992,25 +2151,25 @@ const Ht = Ke, {
|
|
|
1992
2151
|
continue;
|
|
1993
2152
|
break;
|
|
1994
2153
|
}
|
|
1995
|
-
if (
|
|
2154
|
+
if (O === _n) {
|
|
1996
2155
|
if (o.push(f), r.push(L), L = { value: "", depth: 0, isGlob: !1 }, M === !0)
|
|
1997
2156
|
continue;
|
|
1998
|
-
if (
|
|
2157
|
+
if (D === tt && f === c + 1) {
|
|
1999
2158
|
c += 2;
|
|
2000
2159
|
continue;
|
|
2001
2160
|
}
|
|
2002
2161
|
d = f + 1;
|
|
2003
2162
|
continue;
|
|
2004
2163
|
}
|
|
2005
|
-
if (n.noext !== !0 && (
|
|
2006
|
-
if (
|
|
2007
|
-
for (; z() !== !0 && (
|
|
2008
|
-
if (
|
|
2009
|
-
b = L.backslashes = !0,
|
|
2164
|
+
if (n.noext !== !0 && (O === Zs || O === qs || O === et || O === Ut || O === jt) === !0 && h() === st) {
|
|
2165
|
+
if (_ = L.isGlob = !0, S = L.isExtglob = !0, M = !0, i === !0) {
|
|
2166
|
+
for (; z() !== !0 && (O = N()); ) {
|
|
2167
|
+
if (O === Me) {
|
|
2168
|
+
b = L.backslashes = !0, O = N();
|
|
2010
2169
|
continue;
|
|
2011
2170
|
}
|
|
2012
|
-
if (
|
|
2013
|
-
|
|
2171
|
+
if (O === Bt) {
|
|
2172
|
+
_ = L.isGlob = !0, M = !0;
|
|
2014
2173
|
break;
|
|
2015
2174
|
}
|
|
2016
2175
|
}
|
|
@@ -2018,40 +2177,40 @@ const Ht = Ke, {
|
|
|
2018
2177
|
}
|
|
2019
2178
|
break;
|
|
2020
2179
|
}
|
|
2021
|
-
if (
|
|
2022
|
-
if (
|
|
2180
|
+
if (O === et) {
|
|
2181
|
+
if (D === et && (v = L.isGlobstar = !0), _ = L.isGlob = !0, M = !0, i === !0)
|
|
2023
2182
|
continue;
|
|
2024
2183
|
break;
|
|
2025
2184
|
}
|
|
2026
|
-
if (
|
|
2027
|
-
if (
|
|
2185
|
+
if (O === Ut) {
|
|
2186
|
+
if (_ = L.isGlob = !0, M = !0, i === !0)
|
|
2028
2187
|
continue;
|
|
2029
2188
|
break;
|
|
2030
2189
|
}
|
|
2031
|
-
if (
|
|
2032
|
-
for (; z() !== !0 && (
|
|
2033
|
-
if (
|
|
2034
|
-
b = L.backslashes = !0,
|
|
2190
|
+
if (O === Ys)
|
|
2191
|
+
for (; z() !== !0 && (J = N()); ) {
|
|
2192
|
+
if (J === Me) {
|
|
2193
|
+
b = L.backslashes = !0, N();
|
|
2035
2194
|
continue;
|
|
2036
2195
|
}
|
|
2037
|
-
if (
|
|
2038
|
-
if (w = L.isBracket = !0,
|
|
2196
|
+
if (J === ti) {
|
|
2197
|
+
if (w = L.isBracket = !0, _ = L.isGlob = !0, M = !0, i === !0)
|
|
2039
2198
|
continue;
|
|
2040
2199
|
break;
|
|
2041
2200
|
}
|
|
2042
2201
|
}
|
|
2043
|
-
if (n.nonegate !== !0 &&
|
|
2044
|
-
|
|
2202
|
+
if (n.nonegate !== !0 && O === jt && f === c) {
|
|
2203
|
+
A = L.negated = !0, c++;
|
|
2045
2204
|
continue;
|
|
2046
2205
|
}
|
|
2047
|
-
if (n.noparen !== !0 &&
|
|
2048
|
-
if (
|
|
2049
|
-
for (; z() !== !0 && (
|
|
2050
|
-
if (
|
|
2051
|
-
b = L.backslashes = !0,
|
|
2206
|
+
if (n.noparen !== !0 && O === st) {
|
|
2207
|
+
if (_ = L.isGlob = !0, i === !0) {
|
|
2208
|
+
for (; z() !== !0 && (O = N()); ) {
|
|
2209
|
+
if (O === st) {
|
|
2210
|
+
b = L.backslashes = !0, O = N();
|
|
2052
2211
|
continue;
|
|
2053
2212
|
}
|
|
2054
|
-
if (
|
|
2213
|
+
if (O === Bt) {
|
|
2055
2214
|
M = !0;
|
|
2056
2215
|
break;
|
|
2057
2216
|
}
|
|
@@ -2060,50 +2219,50 @@ const Ht = Ke, {
|
|
|
2060
2219
|
}
|
|
2061
2220
|
break;
|
|
2062
2221
|
}
|
|
2063
|
-
if (
|
|
2222
|
+
if (_ === !0) {
|
|
2064
2223
|
if (M = !0, i === !0)
|
|
2065
2224
|
continue;
|
|
2066
2225
|
break;
|
|
2067
2226
|
}
|
|
2068
2227
|
}
|
|
2069
|
-
n.noext === !0 && (
|
|
2070
|
-
let H = u,
|
|
2071
|
-
c > 0 && (
|
|
2228
|
+
n.noext === !0 && (S = !1, _ = !1);
|
|
2229
|
+
let H = u, he = "", l = "";
|
|
2230
|
+
c > 0 && (he = u.slice(0, c), u = u.slice(c), d -= c), H && _ === !0 && d > 0 ? (H = u.slice(0, d), l = u.slice(d)) : _ === !0 ? (H = "", l = u) : H = u, H && H !== "" && H !== "/" && H !== u && Ft(H.charCodeAt(H.length - 1)) && (H = H.slice(0, -1)), n.unescape === !0 && (l && (l = kt.removeBackslashes(l)), H && b === !0 && (H = kt.removeBackslashes(H)));
|
|
2072
2231
|
const p = {
|
|
2073
|
-
prefix:
|
|
2232
|
+
prefix: he,
|
|
2074
2233
|
input: e,
|
|
2075
2234
|
start: c,
|
|
2076
2235
|
base: H,
|
|
2077
2236
|
glob: l,
|
|
2078
|
-
isBrace:
|
|
2237
|
+
isBrace: y,
|
|
2079
2238
|
isBracket: w,
|
|
2080
|
-
isGlob:
|
|
2081
|
-
isExtglob:
|
|
2239
|
+
isGlob: _,
|
|
2240
|
+
isExtglob: S,
|
|
2082
2241
|
isGlobstar: v,
|
|
2083
|
-
negated:
|
|
2242
|
+
negated: A
|
|
2084
2243
|
};
|
|
2085
|
-
if (n.tokens === !0 && (p.maxDepth = 0,
|
|
2086
|
-
let
|
|
2087
|
-
for (let
|
|
2088
|
-
const se =
|
|
2089
|
-
n.tokens && (
|
|
2244
|
+
if (n.tokens === !0 && (p.maxDepth = 0, Ft(O) || r.push(L), p.tokens = r), n.parts === !0 || n.tokens === !0) {
|
|
2245
|
+
let J;
|
|
2246
|
+
for (let T = 0; T < o.length; T++) {
|
|
2247
|
+
const se = J ? J + 1 : c, ae = o[T], q = e.slice(se, ae);
|
|
2248
|
+
n.tokens && (T === 0 && c !== 0 ? (r[T].isPrefix = !0, r[T].value = he) : r[T].value = q, zt(r[T]), p.maxDepth += r[T].depth), (T !== 0 || q !== "") && a.push(q), J = ae;
|
|
2090
2249
|
}
|
|
2091
|
-
if (
|
|
2092
|
-
const
|
|
2093
|
-
a.push(
|
|
2250
|
+
if (J && J + 1 < e.length) {
|
|
2251
|
+
const T = e.slice(J + 1);
|
|
2252
|
+
a.push(T), n.tokens && (r[r.length - 1].value = T, zt(r[r.length - 1]), p.maxDepth += r[r.length - 1].depth);
|
|
2094
2253
|
}
|
|
2095
2254
|
p.slashes = o, p.parts = a;
|
|
2096
2255
|
}
|
|
2097
2256
|
return p;
|
|
2098
2257
|
};
|
|
2099
|
-
var
|
|
2100
|
-
const
|
|
2101
|
-
MAX_LENGTH:
|
|
2102
|
-
POSIX_REGEX_SOURCE:
|
|
2103
|
-
REGEX_NON_SPECIAL_CHARS:
|
|
2104
|
-
REGEX_SPECIAL_CHARS_BACKREF:
|
|
2105
|
-
REPLACEMENTS:
|
|
2106
|
-
} =
|
|
2258
|
+
var si = ni;
|
|
2259
|
+
const Ge = qe, Z = Ke, {
|
|
2260
|
+
MAX_LENGTH: Ve,
|
|
2261
|
+
POSIX_REGEX_SOURCE: ii,
|
|
2262
|
+
REGEX_NON_SPECIAL_CHARS: ri,
|
|
2263
|
+
REGEX_SPECIAL_CHARS_BACKREF: oi,
|
|
2264
|
+
REPLACEMENTS: gn
|
|
2265
|
+
} = Ge, ai = (e, t) => {
|
|
2107
2266
|
if (typeof t.expandRange == "function")
|
|
2108
2267
|
return t.expandRange(...e, t);
|
|
2109
2268
|
e.sort();
|
|
@@ -2114,29 +2273,29 @@ const Fe = Je, Z = Ke, {
|
|
|
2114
2273
|
return e.map((i) => Z.escapeRegex(i)).join("..");
|
|
2115
2274
|
}
|
|
2116
2275
|
return n;
|
|
2117
|
-
}, ve = (e, t) => `Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,
|
|
2276
|
+
}, ve = (e, t) => `Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`, bn = (e, t) => {
|
|
2118
2277
|
if (typeof e != "string")
|
|
2119
2278
|
throw new TypeError("Expected a string");
|
|
2120
|
-
e =
|
|
2121
|
-
const n = { ...t }, s = typeof n.maxLength == "number" ? Math.min(
|
|
2279
|
+
e = gn[e] || e;
|
|
2280
|
+
const n = { ...t }, s = typeof n.maxLength == "number" ? Math.min(Ve, n.maxLength) : Ve;
|
|
2122
2281
|
let i = e.length;
|
|
2123
2282
|
if (i > s)
|
|
2124
2283
|
throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${s}`);
|
|
2125
|
-
const o = { type: "bos", value: "", output: n.prepend || "" }, r = [o], a = n.capture ? "" : "?:", u =
|
|
2284
|
+
const o = { type: "bos", value: "", output: n.prepend || "" }, r = [o], a = n.capture ? "" : "?:", u = Ge.globChars(n.windows), f = Ge.extglobChars(u), {
|
|
2126
2285
|
DOT_LITERAL: c,
|
|
2127
2286
|
PLUS_LITERAL: d,
|
|
2128
|
-
SLASH_LITERAL:
|
|
2287
|
+
SLASH_LITERAL: y,
|
|
2129
2288
|
ONE_CHAR: w,
|
|
2130
|
-
DOTS_SLASH:
|
|
2131
|
-
NO_DOT:
|
|
2289
|
+
DOTS_SLASH: _,
|
|
2290
|
+
NO_DOT: S,
|
|
2132
2291
|
NO_DOT_SLASH: v,
|
|
2133
2292
|
NO_DOTS_SLASH: x,
|
|
2134
2293
|
QMARK: b,
|
|
2135
|
-
QMARK_NO_DOT:
|
|
2294
|
+
QMARK_NO_DOT: A,
|
|
2136
2295
|
STAR: M,
|
|
2137
2296
|
START_ANCHOR: R
|
|
2138
|
-
} = u,
|
|
2139
|
-
let z = n.bash === !0 ?
|
|
2297
|
+
} = u, D = (g) => `(${a}(?:(?!${R}${g.dot ? _ : c}).)*?)`, O = n.dot ? "" : S, L = n.dot ? b : A;
|
|
2298
|
+
let z = n.bash === !0 ? D(n) : M;
|
|
2140
2299
|
n.capture && (z = `(${z})`), typeof n.noext == "boolean" && (n.noextglob = n.noext);
|
|
2141
2300
|
const h = {
|
|
2142
2301
|
input: e,
|
|
@@ -2156,62 +2315,62 @@ const Fe = Je, Z = Ke, {
|
|
|
2156
2315
|
tokens: r
|
|
2157
2316
|
};
|
|
2158
2317
|
e = Z.removePrefix(e, h), i = e.length;
|
|
2159
|
-
const
|
|
2318
|
+
const N = [], H = [], he = [];
|
|
2160
2319
|
let l = o, p;
|
|
2161
|
-
const
|
|
2162
|
-
h.consumed +=
|
|
2163
|
-
},
|
|
2164
|
-
h.output +=
|
|
2165
|
-
},
|
|
2166
|
-
let
|
|
2167
|
-
for (;
|
|
2168
|
-
se(), h.start++,
|
|
2169
|
-
return
|
|
2170
|
-
},
|
|
2171
|
-
h[
|
|
2172
|
-
}, me = (
|
|
2173
|
-
h[
|
|
2174
|
-
}, I = (
|
|
2320
|
+
const J = () => h.index === i - 1, T = h.peek = (g = 1) => e[h.index + g], se = h.advance = () => e[++h.index], ae = () => e.slice(h.index + 1), q = (g = "", k = 0) => {
|
|
2321
|
+
h.consumed += g, h.index += k;
|
|
2322
|
+
}, Te = (g) => {
|
|
2323
|
+
h.output += g.output != null ? g.output : g.value, q(g.value);
|
|
2324
|
+
}, Rn = () => {
|
|
2325
|
+
let g = 1;
|
|
2326
|
+
for (; T() === "!" && (T(2) !== "(" || T(3) === "?"); )
|
|
2327
|
+
se(), h.start++, g++;
|
|
2328
|
+
return g % 2 === 0 ? !1 : (h.negated = !0, h.start++, !0);
|
|
2329
|
+
}, De = (g) => {
|
|
2330
|
+
h[g]++, he.push(g);
|
|
2331
|
+
}, me = (g) => {
|
|
2332
|
+
h[g]--, he.pop();
|
|
2333
|
+
}, I = (g) => {
|
|
2175
2334
|
if (l.type === "globstar") {
|
|
2176
|
-
const
|
|
2177
|
-
|
|
2335
|
+
const k = h.braces > 0 && (g.type === "comma" || g.type === "brace"), m = g.extglob === !0 || N.length && (g.type === "pipe" || g.type === "paren");
|
|
2336
|
+
g.type !== "slash" && g.type !== "paren" && !k && !m && (h.output = h.output.slice(0, -l.output.length), l.type = "star", l.value = "*", l.output = z, h.output += l.output);
|
|
2178
2337
|
}
|
|
2179
|
-
if (
|
|
2180
|
-
l.value +=
|
|
2338
|
+
if (N.length && g.type !== "paren" && !f[g.value] && (N[N.length - 1].inner += g.value), (g.value || g.output) && Te(g), l && l.type === "text" && g.type === "text") {
|
|
2339
|
+
l.value += g.value, l.output = (l.output || "") + g.value;
|
|
2181
2340
|
return;
|
|
2182
2341
|
}
|
|
2183
|
-
|
|
2184
|
-
},
|
|
2185
|
-
const m = { ...f[
|
|
2342
|
+
g.prev = l, r.push(g), l = g;
|
|
2343
|
+
}, He = (g, k) => {
|
|
2344
|
+
const m = { ...f[k], conditions: 1, inner: "" };
|
|
2186
2345
|
m.prev = l, m.parens = h.parens, m.output = h.output;
|
|
2187
|
-
const
|
|
2188
|
-
|
|
2189
|
-
},
|
|
2190
|
-
let
|
|
2191
|
-
if (
|
|
2346
|
+
const P = (n.capture ? "(" : "") + m.open;
|
|
2347
|
+
De("parens"), I({ type: g, value: k, output: h.output ? "" : w }), I({ type: "paren", extglob: !0, value: se(), output: P }), N.push(m);
|
|
2348
|
+
}, On = (g) => {
|
|
2349
|
+
let k = g.close + (n.capture ? ")" : "");
|
|
2350
|
+
if (g.type === "negate") {
|
|
2192
2351
|
let m = z;
|
|
2193
|
-
|
|
2352
|
+
g.inner && g.inner.length > 1 && g.inner.includes("/") && (m = D(n)), (m !== z || J() || /^\)+$/.test(ae())) && (k = g.close = `)$))${m}`), g.prev.type === "bos" && J() && (h.negatedExtglob = !0);
|
|
2194
2353
|
}
|
|
2195
|
-
I({ type: "paren", extglob: !0, value: p, output:
|
|
2354
|
+
I({ type: "paren", extglob: !0, value: p, output: k }), me("parens");
|
|
2196
2355
|
};
|
|
2197
2356
|
if (n.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(e)) {
|
|
2198
|
-
let
|
|
2199
|
-
return
|
|
2357
|
+
let g = !1, k = e.replace(oi, (m, P, j, W, G, Qe) => W === "\\" ? (g = !0, m) : W === "?" ? P ? P + W + (G ? b.repeat(G.length) : "") : Qe === 0 ? L + (G ? b.repeat(G.length) : "") : b.repeat(j.length) : W === "." ? c.repeat(j.length) : W === "*" ? P ? P + W + (G ? z : "") : z : P ? m : `\\${m}`);
|
|
2358
|
+
return g === !0 && (n.unescape === !0 ? k = k.replace(/\\/g, "") : k = k.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), k === e && n.contains === !0 ? (h.output = e, h) : (h.output = Z.wrapOutput(k, h, t), h);
|
|
2200
2359
|
}
|
|
2201
|
-
for (; !
|
|
2360
|
+
for (; !J(); ) {
|
|
2202
2361
|
if (p = se(), p === "\0")
|
|
2203
2362
|
continue;
|
|
2204
2363
|
if (p === "\\") {
|
|
2205
|
-
const m =
|
|
2364
|
+
const m = T();
|
|
2206
2365
|
if (m === "/" && n.bash !== !0 || m === "." || m === ";")
|
|
2207
2366
|
continue;
|
|
2208
2367
|
if (!m) {
|
|
2209
2368
|
p += "\\", I({ type: "text", value: p });
|
|
2210
2369
|
continue;
|
|
2211
2370
|
}
|
|
2212
|
-
const
|
|
2371
|
+
const P = /^\\+/.exec(ae());
|
|
2213
2372
|
let j = 0;
|
|
2214
|
-
if (
|
|
2373
|
+
if (P && P[0].length > 2 && (j = P[0].length, h.index += j, j % 2 !== 0 && (p += "\\")), n.unescape === !0 ? p = se() || "" : p += se() || "", h.brackets === 0) {
|
|
2215
2374
|
I({ type: "text", value: p });
|
|
2216
2375
|
continue;
|
|
2217
2376
|
}
|
|
@@ -2220,18 +2379,18 @@ const Fe = Je, Z = Ke, {
|
|
|
2220
2379
|
if (n.posix !== !1 && p === ":") {
|
|
2221
2380
|
const m = l.value.slice(1);
|
|
2222
2381
|
if (m.includes("[") && (l.posix = !0, m.includes(":"))) {
|
|
2223
|
-
const
|
|
2382
|
+
const P = l.value.lastIndexOf("["), j = l.value.slice(0, P), W = l.value.slice(P + 2), G = ii[W];
|
|
2224
2383
|
if (G) {
|
|
2225
2384
|
l.value = j + G, h.backtrack = !0, se(), !o.output && r.indexOf(l) === 1 && (o.output = w);
|
|
2226
2385
|
continue;
|
|
2227
2386
|
}
|
|
2228
2387
|
}
|
|
2229
2388
|
}
|
|
2230
|
-
(p === "[" &&
|
|
2389
|
+
(p === "[" && T() !== ":" || p === "-" && T() === "]") && (p = `\\${p}`), p === "]" && (l.value === "[" || l.value === "[^") && (p = `\\${p}`), n.posix === !0 && p === "!" && l.value === "[" && (p = "^"), l.value += p, Te({ value: p });
|
|
2231
2390
|
continue;
|
|
2232
2391
|
}
|
|
2233
2392
|
if (h.quotes === 1 && p !== '"') {
|
|
2234
|
-
p = Z.escapeRegex(p), l.value += p,
|
|
2393
|
+
p = Z.escapeRegex(p), l.value += p, Te({ value: p });
|
|
2235
2394
|
continue;
|
|
2236
2395
|
}
|
|
2237
2396
|
if (p === '"') {
|
|
@@ -2239,27 +2398,27 @@ const Fe = Je, Z = Ke, {
|
|
|
2239
2398
|
continue;
|
|
2240
2399
|
}
|
|
2241
2400
|
if (p === "(") {
|
|
2242
|
-
|
|
2401
|
+
De("parens"), I({ type: "paren", value: p });
|
|
2243
2402
|
continue;
|
|
2244
2403
|
}
|
|
2245
2404
|
if (p === ")") {
|
|
2246
2405
|
if (h.parens === 0 && n.strictBrackets === !0)
|
|
2247
2406
|
throw new SyntaxError(ve("opening", "("));
|
|
2248
|
-
const m =
|
|
2407
|
+
const m = N[N.length - 1];
|
|
2249
2408
|
if (m && h.parens === m.parens + 1) {
|
|
2250
|
-
|
|
2409
|
+
On(N.pop());
|
|
2251
2410
|
continue;
|
|
2252
2411
|
}
|
|
2253
2412
|
I({ type: "paren", value: p, output: h.parens ? ")" : "\\)" }), me("parens");
|
|
2254
2413
|
continue;
|
|
2255
2414
|
}
|
|
2256
2415
|
if (p === "[") {
|
|
2257
|
-
if (n.nobracket === !0 || !
|
|
2416
|
+
if (n.nobracket === !0 || !ae().includes("]")) {
|
|
2258
2417
|
if (n.nobracket !== !0 && n.strictBrackets === !0)
|
|
2259
2418
|
throw new SyntaxError(ve("closing", "]"));
|
|
2260
2419
|
p = `\\${p}`;
|
|
2261
2420
|
} else
|
|
2262
|
-
|
|
2421
|
+
De("brackets");
|
|
2263
2422
|
I({ type: "bracket", value: p });
|
|
2264
2423
|
continue;
|
|
2265
2424
|
}
|
|
@@ -2276,18 +2435,18 @@ const Fe = Je, Z = Ke, {
|
|
|
2276
2435
|
}
|
|
2277
2436
|
me("brackets");
|
|
2278
2437
|
const m = l.value.slice(1);
|
|
2279
|
-
if (l.posix !== !0 && m[0] === "^" && !m.includes("/") && (p = `/${p}`), l.value += p,
|
|
2438
|
+
if (l.posix !== !0 && m[0] === "^" && !m.includes("/") && (p = `/${p}`), l.value += p, Te({ value: p }), n.literalBrackets === !1 || Z.hasRegexChars(m))
|
|
2280
2439
|
continue;
|
|
2281
|
-
const
|
|
2440
|
+
const P = Z.escapeRegex(l.value);
|
|
2282
2441
|
if (h.output = h.output.slice(0, -l.value.length), n.literalBrackets === !0) {
|
|
2283
|
-
h.output +=
|
|
2442
|
+
h.output += P, l.value = P;
|
|
2284
2443
|
continue;
|
|
2285
2444
|
}
|
|
2286
|
-
l.value = `(${a}${
|
|
2445
|
+
l.value = `(${a}${P}|${l.value})`, h.output += l.value;
|
|
2287
2446
|
continue;
|
|
2288
2447
|
}
|
|
2289
2448
|
if (p === "{" && n.nobrace !== !0) {
|
|
2290
|
-
|
|
2449
|
+
De("braces");
|
|
2291
2450
|
const m = {
|
|
2292
2451
|
type: "brace",
|
|
2293
2452
|
value: p,
|
|
@@ -2304,30 +2463,30 @@ const Fe = Je, Z = Ke, {
|
|
|
2304
2463
|
I({ type: "text", value: p, output: p });
|
|
2305
2464
|
continue;
|
|
2306
2465
|
}
|
|
2307
|
-
let
|
|
2466
|
+
let P = ")";
|
|
2308
2467
|
if (m.dots === !0) {
|
|
2309
2468
|
const j = r.slice(), W = [];
|
|
2310
2469
|
for (let G = j.length - 1; G >= 0 && (r.pop(), j[G].type !== "brace"); G--)
|
|
2311
2470
|
j[G].type !== "dots" && W.unshift(j[G].value);
|
|
2312
|
-
|
|
2471
|
+
P = ai(W, n), h.backtrack = !0;
|
|
2313
2472
|
}
|
|
2314
2473
|
if (m.comma !== !0 && m.dots !== !0) {
|
|
2315
2474
|
const j = h.output.slice(0, m.outputIndex), W = h.tokens.slice(m.tokensIndex);
|
|
2316
|
-
m.value = m.output = "\\{", p =
|
|
2475
|
+
m.value = m.output = "\\{", p = P = "\\}", h.output = j;
|
|
2317
2476
|
for (const G of W)
|
|
2318
2477
|
h.output += G.output || G.value;
|
|
2319
2478
|
}
|
|
2320
|
-
I({ type: "brace", value: p, output:
|
|
2479
|
+
I({ type: "brace", value: p, output: P }), me("braces"), H.pop();
|
|
2321
2480
|
continue;
|
|
2322
2481
|
}
|
|
2323
2482
|
if (p === "|") {
|
|
2324
|
-
|
|
2483
|
+
N.length > 0 && N[N.length - 1].conditions++, I({ type: "text", value: p });
|
|
2325
2484
|
continue;
|
|
2326
2485
|
}
|
|
2327
2486
|
if (p === ",") {
|
|
2328
2487
|
let m = p;
|
|
2329
|
-
const
|
|
2330
|
-
|
|
2488
|
+
const P = H[H.length - 1];
|
|
2489
|
+
P && he[he.length - 1] === "braces" && (P.comma = !0, m = "|"), I({ type: "comma", value: p, output: m });
|
|
2331
2490
|
continue;
|
|
2332
2491
|
}
|
|
2333
2492
|
if (p === "/") {
|
|
@@ -2335,7 +2494,7 @@ const Fe = Je, Z = Ke, {
|
|
|
2335
2494
|
h.start = h.index + 1, h.consumed = "", h.output = "", r.pop(), l = o;
|
|
2336
2495
|
continue;
|
|
2337
2496
|
}
|
|
2338
|
-
I({ type: "slash", value: p, output:
|
|
2497
|
+
I({ type: "slash", value: p, output: y });
|
|
2339
2498
|
continue;
|
|
2340
2499
|
}
|
|
2341
2500
|
if (p === ".") {
|
|
@@ -2353,38 +2512,38 @@ const Fe = Je, Z = Ke, {
|
|
|
2353
2512
|
continue;
|
|
2354
2513
|
}
|
|
2355
2514
|
if (p === "?") {
|
|
2356
|
-
if (!(l && l.value === "(") && n.noextglob !== !0 &&
|
|
2357
|
-
|
|
2515
|
+
if (!(l && l.value === "(") && n.noextglob !== !0 && T() === "(" && T(2) !== "?") {
|
|
2516
|
+
He("qmark", p);
|
|
2358
2517
|
continue;
|
|
2359
2518
|
}
|
|
2360
2519
|
if (l && l.type === "paren") {
|
|
2361
|
-
const
|
|
2520
|
+
const P = T();
|
|
2362
2521
|
let j = p;
|
|
2363
|
-
if (
|
|
2522
|
+
if (P === "<" && !Z.supportsLookbehinds())
|
|
2364
2523
|
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
2365
|
-
(l.value === "(" && !/[!=<:]/.test(
|
|
2524
|
+
(l.value === "(" && !/[!=<:]/.test(P) || P === "<" && !/<([!=]|\w+>)/.test(ae())) && (j = `\\${p}`), I({ type: "text", value: p, output: j });
|
|
2366
2525
|
continue;
|
|
2367
2526
|
}
|
|
2368
2527
|
if (n.dot !== !0 && (l.type === "slash" || l.type === "bos")) {
|
|
2369
|
-
I({ type: "qmark", value: p, output:
|
|
2528
|
+
I({ type: "qmark", value: p, output: A });
|
|
2370
2529
|
continue;
|
|
2371
2530
|
}
|
|
2372
2531
|
I({ type: "qmark", value: p, output: b });
|
|
2373
2532
|
continue;
|
|
2374
2533
|
}
|
|
2375
2534
|
if (p === "!") {
|
|
2376
|
-
if (n.noextglob !== !0 &&
|
|
2377
|
-
|
|
2535
|
+
if (n.noextglob !== !0 && T() === "(" && (T(2) !== "?" || !/[!=<:]/.test(T(3)))) {
|
|
2536
|
+
He("negate", p);
|
|
2378
2537
|
continue;
|
|
2379
2538
|
}
|
|
2380
2539
|
if (n.nonegate !== !0 && h.index === 0) {
|
|
2381
|
-
|
|
2540
|
+
Rn();
|
|
2382
2541
|
continue;
|
|
2383
2542
|
}
|
|
2384
2543
|
}
|
|
2385
2544
|
if (p === "+") {
|
|
2386
|
-
if (n.noextglob !== !0 &&
|
|
2387
|
-
|
|
2545
|
+
if (n.noextglob !== !0 && T() === "(" && T(2) !== "?") {
|
|
2546
|
+
He("plus", p);
|
|
2388
2547
|
continue;
|
|
2389
2548
|
}
|
|
2390
2549
|
if (l && l.value === "(" || n.regex === !1) {
|
|
@@ -2399,7 +2558,7 @@ const Fe = Je, Z = Ke, {
|
|
|
2399
2558
|
continue;
|
|
2400
2559
|
}
|
|
2401
2560
|
if (p === "@") {
|
|
2402
|
-
if (n.noextglob !== !0 &&
|
|
2561
|
+
if (n.noextglob !== !0 && T() === "(" && T(2) !== "?") {
|
|
2403
2562
|
I({ type: "at", extglob: !0, value: p, output: "" });
|
|
2404
2563
|
continue;
|
|
2405
2564
|
}
|
|
@@ -2408,70 +2567,70 @@ const Fe = Je, Z = Ke, {
|
|
|
2408
2567
|
}
|
|
2409
2568
|
if (p !== "*") {
|
|
2410
2569
|
(p === "$" || p === "^") && (p = `\\${p}`);
|
|
2411
|
-
const m =
|
|
2570
|
+
const m = ri.exec(ae());
|
|
2412
2571
|
m && (p += m[0], h.index += m[0].length), I({ type: "text", value: p });
|
|
2413
2572
|
continue;
|
|
2414
2573
|
}
|
|
2415
2574
|
if (l && (l.type === "globstar" || l.star === !0)) {
|
|
2416
|
-
l.type = "star", l.star = !0, l.value += p, l.output = z, h.backtrack = !0, h.globstar = !0,
|
|
2575
|
+
l.type = "star", l.star = !0, l.value += p, l.output = z, h.backtrack = !0, h.globstar = !0, q(p);
|
|
2417
2576
|
continue;
|
|
2418
2577
|
}
|
|
2419
|
-
let
|
|
2420
|
-
if (n.noextglob !== !0 && /^\([^?]/.test(
|
|
2421
|
-
|
|
2578
|
+
let g = ae();
|
|
2579
|
+
if (n.noextglob !== !0 && /^\([^?]/.test(g)) {
|
|
2580
|
+
He("star", p);
|
|
2422
2581
|
continue;
|
|
2423
2582
|
}
|
|
2424
2583
|
if (l.type === "star") {
|
|
2425
2584
|
if (n.noglobstar === !0) {
|
|
2426
|
-
|
|
2585
|
+
q(p);
|
|
2427
2586
|
continue;
|
|
2428
2587
|
}
|
|
2429
|
-
const m = l.prev,
|
|
2430
|
-
if (n.bash === !0 && (!j ||
|
|
2588
|
+
const m = l.prev, P = m.prev, j = m.type === "slash" || m.type === "bos", W = P && (P.type === "star" || P.type === "globstar");
|
|
2589
|
+
if (n.bash === !0 && (!j || g[0] && g[0] !== "/")) {
|
|
2431
2590
|
I({ type: "star", value: p, output: "" });
|
|
2432
2591
|
continue;
|
|
2433
2592
|
}
|
|
2434
|
-
const G = h.braces > 0 && (m.type === "comma" || m.type === "brace"),
|
|
2435
|
-
if (!j && m.type !== "paren" && !G && !
|
|
2593
|
+
const G = h.braces > 0 && (m.type === "comma" || m.type === "brace"), Qe = N.length && (m.type === "pipe" || m.type === "paren");
|
|
2594
|
+
if (!j && m.type !== "paren" && !G && !Qe) {
|
|
2436
2595
|
I({ type: "star", value: p, output: "" });
|
|
2437
2596
|
continue;
|
|
2438
2597
|
}
|
|
2439
|
-
for (;
|
|
2440
|
-
const
|
|
2441
|
-
if (
|
|
2598
|
+
for (; g.slice(0, 3) === "/**"; ) {
|
|
2599
|
+
const Ne = e[h.index + 4];
|
|
2600
|
+
if (Ne && Ne !== "/")
|
|
2442
2601
|
break;
|
|
2443
|
-
|
|
2602
|
+
g = g.slice(3), q("/**", 3);
|
|
2444
2603
|
}
|
|
2445
|
-
if (m.type === "bos" &&
|
|
2446
|
-
l.type = "globstar", l.value += p, l.output =
|
|
2604
|
+
if (m.type === "bos" && J()) {
|
|
2605
|
+
l.type = "globstar", l.value += p, l.output = D(n), h.output = l.output, h.globstar = !0, q(p);
|
|
2447
2606
|
continue;
|
|
2448
2607
|
}
|
|
2449
|
-
if (m.type === "slash" && m.prev.type !== "bos" && !W &&
|
|
2450
|
-
h.output = h.output.slice(0, -(m.output + l.output).length), m.output = `(?:${m.output}`, l.type = "globstar", l.output =
|
|
2608
|
+
if (m.type === "slash" && m.prev.type !== "bos" && !W && J()) {
|
|
2609
|
+
h.output = h.output.slice(0, -(m.output + l.output).length), m.output = `(?:${m.output}`, l.type = "globstar", l.output = D(n) + (n.strictSlashes ? ")" : "|$)"), l.value += p, h.globstar = !0, h.output += m.output + l.output, q(p);
|
|
2451
2610
|
continue;
|
|
2452
2611
|
}
|
|
2453
|
-
if (m.type === "slash" && m.prev.type !== "bos" &&
|
|
2454
|
-
const
|
|
2455
|
-
h.output = h.output.slice(0, -(m.output + l.output).length), m.output = `(?:${m.output}`, l.type = "globstar", l.output = `${
|
|
2612
|
+
if (m.type === "slash" && m.prev.type !== "bos" && g[0] === "/") {
|
|
2613
|
+
const Ne = g[1] !== void 0 ? "|$" : "";
|
|
2614
|
+
h.output = h.output.slice(0, -(m.output + l.output).length), m.output = `(?:${m.output}`, l.type = "globstar", l.output = `${D(n)}${y}|${y}${Ne})`, l.value += p, h.output += m.output + l.output, h.globstar = !0, q(p + se()), I({ type: "slash", value: "/", output: "" });
|
|
2456
2615
|
continue;
|
|
2457
2616
|
}
|
|
2458
|
-
if (m.type === "bos" &&
|
|
2459
|
-
l.type = "globstar", l.value += p, l.output = `(?:^|${
|
|
2617
|
+
if (m.type === "bos" && g[0] === "/") {
|
|
2618
|
+
l.type = "globstar", l.value += p, l.output = `(?:^|${y}|${D(n)}${y})`, h.output = l.output, h.globstar = !0, q(p + se()), I({ type: "slash", value: "/", output: "" });
|
|
2460
2619
|
continue;
|
|
2461
2620
|
}
|
|
2462
|
-
h.output = h.output.slice(0, -l.output.length), l.type = "globstar", l.output =
|
|
2621
|
+
h.output = h.output.slice(0, -l.output.length), l.type = "globstar", l.output = D(n), l.value += p, h.output += l.output, h.globstar = !0, q(p);
|
|
2463
2622
|
continue;
|
|
2464
2623
|
}
|
|
2465
|
-
const
|
|
2624
|
+
const k = { type: "star", value: p, output: z };
|
|
2466
2625
|
if (n.bash === !0) {
|
|
2467
|
-
|
|
2626
|
+
k.output = ".*?", (l.type === "bos" || l.type === "slash") && (k.output = O + k.output), I(k);
|
|
2468
2627
|
continue;
|
|
2469
2628
|
}
|
|
2470
2629
|
if (l && (l.type === "bracket" || l.type === "paren") && n.regex === !0) {
|
|
2471
|
-
|
|
2630
|
+
k.output = p, I(k);
|
|
2472
2631
|
continue;
|
|
2473
2632
|
}
|
|
2474
|
-
(h.index === h.start || l.type === "slash" || l.type === "dot") && (l.type === "dot" ? (h.output += v, l.output += v) : n.dot === !0 ? (h.output += x, l.output += x) : (h.output +=
|
|
2633
|
+
(h.index === h.start || l.type === "slash" || l.type === "dot") && (l.type === "dot" ? (h.output += v, l.output += v) : n.dot === !0 ? (h.output += x, l.output += x) : (h.output += O, l.output += O), T() !== "*" && (h.output += w, l.output += w)), I(k);
|
|
2475
2634
|
}
|
|
2476
2635
|
for (; h.brackets > 0; ) {
|
|
2477
2636
|
if (n.strictBrackets === !0)
|
|
@@ -2488,18 +2647,18 @@ const Fe = Je, Z = Ke, {
|
|
|
2488
2647
|
throw new SyntaxError(ve("closing", "}"));
|
|
2489
2648
|
h.output = Z.escapeLast(h.output, "{"), me("braces");
|
|
2490
2649
|
}
|
|
2491
|
-
if (n.strictSlashes !== !0 && (l.type === "star" || l.type === "bracket") && I({ type: "maybe_slash", value: "", output: `${
|
|
2650
|
+
if (n.strictSlashes !== !0 && (l.type === "star" || l.type === "bracket") && I({ type: "maybe_slash", value: "", output: `${y}?` }), h.backtrack === !0) {
|
|
2492
2651
|
h.output = "";
|
|
2493
|
-
for (const
|
|
2494
|
-
h.output +=
|
|
2652
|
+
for (const g of h.tokens)
|
|
2653
|
+
h.output += g.output != null ? g.output : g.value, g.suffix && (h.output += g.suffix);
|
|
2495
2654
|
}
|
|
2496
2655
|
return h;
|
|
2497
2656
|
};
|
|
2498
|
-
|
|
2499
|
-
const n = { ...t }, s = typeof n.maxLength == "number" ? Math.min(
|
|
2657
|
+
bn.fastpaths = (e, t) => {
|
|
2658
|
+
const n = { ...t }, s = typeof n.maxLength == "number" ? Math.min(Ve, n.maxLength) : Ve, i = e.length;
|
|
2500
2659
|
if (i > s)
|
|
2501
2660
|
throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${s}`);
|
|
2502
|
-
e =
|
|
2661
|
+
e = gn[e] || e;
|
|
2503
2662
|
const {
|
|
2504
2663
|
DOT_LITERAL: o,
|
|
2505
2664
|
SLASH_LITERAL: r,
|
|
@@ -2508,31 +2667,31 @@ pn.fastpaths = (e, t) => {
|
|
|
2508
2667
|
NO_DOT: f,
|
|
2509
2668
|
NO_DOTS: c,
|
|
2510
2669
|
NO_DOTS_SLASH: d,
|
|
2511
|
-
STAR:
|
|
2670
|
+
STAR: y,
|
|
2512
2671
|
START_ANCHOR: w
|
|
2513
|
-
} =
|
|
2514
|
-
let b = n.bash === !0 ? ".*?" :
|
|
2672
|
+
} = Ge.globChars(n.windows), _ = n.dot ? c : f, S = n.dot ? d : f, v = n.capture ? "" : "?:", x = { negated: !1, prefix: "" };
|
|
2673
|
+
let b = n.bash === !0 ? ".*?" : y;
|
|
2515
2674
|
n.capture && (b = `(${b})`);
|
|
2516
|
-
const
|
|
2517
|
-
switch (
|
|
2675
|
+
const A = (O) => O.noglobstar === !0 ? b : `(${v}(?:(?!${w}${O.dot ? u : o}).)*?)`, M = (O) => {
|
|
2676
|
+
switch (O) {
|
|
2518
2677
|
case "*":
|
|
2519
|
-
return `${
|
|
2678
|
+
return `${_}${a}${b}`;
|
|
2520
2679
|
case ".*":
|
|
2521
2680
|
return `${o}${a}${b}`;
|
|
2522
2681
|
case "*.*":
|
|
2523
|
-
return `${
|
|
2682
|
+
return `${_}${b}${o}${a}${b}`;
|
|
2524
2683
|
case "*/*":
|
|
2525
|
-
return `${
|
|
2684
|
+
return `${_}${b}${r}${a}${S}${b}`;
|
|
2526
2685
|
case "**":
|
|
2527
|
-
return
|
|
2686
|
+
return _ + A(n);
|
|
2528
2687
|
case "**/*":
|
|
2529
|
-
return `(?:${
|
|
2688
|
+
return `(?:${_}${A(n)}${r})?${S}${a}${b}`;
|
|
2530
2689
|
case "**/*.*":
|
|
2531
|
-
return `(?:${
|
|
2690
|
+
return `(?:${_}${A(n)}${r})?${S}${b}${o}${a}${b}`;
|
|
2532
2691
|
case "**/.*":
|
|
2533
|
-
return `(?:${
|
|
2692
|
+
return `(?:${_}${A(n)}${r})?${o}${a}${b}`;
|
|
2534
2693
|
default: {
|
|
2535
|
-
const L = /^(.*?)\.(\w+)$/.exec(
|
|
2694
|
+
const L = /^(.*?)\.(\w+)$/.exec(O);
|
|
2536
2695
|
if (!L)
|
|
2537
2696
|
return;
|
|
2538
2697
|
const z = M(L[1]);
|
|
@@ -2540,68 +2699,68 @@ pn.fastpaths = (e, t) => {
|
|
|
2540
2699
|
}
|
|
2541
2700
|
}
|
|
2542
2701
|
}, R = Z.removePrefix(e, x);
|
|
2543
|
-
let
|
|
2544
|
-
return
|
|
2702
|
+
let D = M(R);
|
|
2703
|
+
return D && n.strictSlashes !== !0 && (D += `${r}?`), D;
|
|
2545
2704
|
};
|
|
2546
|
-
var
|
|
2547
|
-
const
|
|
2705
|
+
var ui = bn;
|
|
2706
|
+
const ci = si, lt = ui, vn = Ke, fi = qe, li = (e) => e && typeof e == "object" && !Array.isArray(e), F = (e, t, n = !1) => {
|
|
2548
2707
|
if (Array.isArray(e)) {
|
|
2549
|
-
const c = e.map((
|
|
2550
|
-
return (
|
|
2708
|
+
const c = e.map((y) => F(y, t, n));
|
|
2709
|
+
return (y) => {
|
|
2551
2710
|
for (const w of c) {
|
|
2552
|
-
const
|
|
2553
|
-
if (
|
|
2554
|
-
return
|
|
2711
|
+
const _ = w(y);
|
|
2712
|
+
if (_)
|
|
2713
|
+
return _;
|
|
2555
2714
|
}
|
|
2556
2715
|
return !1;
|
|
2557
2716
|
};
|
|
2558
2717
|
}
|
|
2559
|
-
const s =
|
|
2718
|
+
const s = li(e) && e.tokens && e.input;
|
|
2560
2719
|
if (e === "" || typeof e != "string" && !s)
|
|
2561
2720
|
throw new TypeError("Expected pattern to be a non-empty string");
|
|
2562
|
-
const i = t || {}, o = i.windows, r = s ?
|
|
2721
|
+
const i = t || {}, o = i.windows, r = s ? F.compileRe(e, t) : F.makeRe(e, t, !1, !0), a = r.state;
|
|
2563
2722
|
delete r.state;
|
|
2564
2723
|
let u = () => !1;
|
|
2565
2724
|
if (i.ignore) {
|
|
2566
2725
|
const c = { ...t, ignore: null, onMatch: null, onResult: null };
|
|
2567
|
-
u =
|
|
2726
|
+
u = F(i.ignore, c, n);
|
|
2568
2727
|
}
|
|
2569
2728
|
const f = (c, d = !1) => {
|
|
2570
|
-
const { isMatch:
|
|
2571
|
-
return typeof i.onResult == "function" && i.onResult(
|
|
2729
|
+
const { isMatch: y, match: w, output: _ } = F.test(c, r, t, { glob: e, posix: o }), S = { glob: e, state: a, regex: r, posix: o, input: c, output: _, match: w, isMatch: y };
|
|
2730
|
+
return typeof i.onResult == "function" && i.onResult(S), y === !1 ? (S.isMatch = !1, d ? S : !1) : u(c) ? (typeof i.onIgnore == "function" && i.onIgnore(S), S.isMatch = !1, d ? S : !1) : (typeof i.onMatch == "function" && i.onMatch(S), d ? S : !0);
|
|
2572
2731
|
};
|
|
2573
2732
|
return n && (f.state = a), f;
|
|
2574
2733
|
};
|
|
2575
|
-
|
|
2734
|
+
F.test = (e, t, n, { glob: s, posix: i } = {}) => {
|
|
2576
2735
|
if (typeof e != "string")
|
|
2577
2736
|
throw new TypeError("Expected input to be a string");
|
|
2578
2737
|
if (e === "")
|
|
2579
2738
|
return { isMatch: !1, output: "" };
|
|
2580
|
-
const o = n || {}, r = o.format || (i ?
|
|
2739
|
+
const o = n || {}, r = o.format || (i ? vn.toPosixSlashes : null);
|
|
2581
2740
|
let a = e === s, u = a && r ? r(e) : e;
|
|
2582
|
-
return a === !1 && (u = r ? r(e) : e, a = u === s), (a === !1 || o.capture === !0) && (o.matchBase === !0 || o.basename === !0 ? a =
|
|
2741
|
+
return a === !1 && (u = r ? r(e) : e, a = u === s), (a === !1 || o.capture === !0) && (o.matchBase === !0 || o.basename === !0 ? a = F.matchBase(e, t, n, i) : a = t.exec(u)), { isMatch: !!a, match: a, output: u };
|
|
2583
2742
|
};
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2743
|
+
F.matchBase = (e, t, n) => (t instanceof RegExp ? t : F.makeRe(t, n)).test(vn.basename(e));
|
|
2744
|
+
F.isMatch = (e, t, n) => F(t, n)(e);
|
|
2745
|
+
F.parse = (e, t) => Array.isArray(e) ? e.map((n) => F.parse(n, t)) : lt(e, { ...t, fastpaths: !1 });
|
|
2746
|
+
F.scan = (e, t) => ci(e, t);
|
|
2747
|
+
F.compileRe = (e, t, n = !1, s = !1) => {
|
|
2589
2748
|
if (n === !0)
|
|
2590
2749
|
return e.output;
|
|
2591
2750
|
const i = t || {}, o = i.contains ? "" : "^", r = i.contains ? "" : "$";
|
|
2592
2751
|
let a = `${o}(?:${e.output})${r}`;
|
|
2593
2752
|
e && e.negated === !0 && (a = `^(?!${a}).*$`);
|
|
2594
|
-
const u =
|
|
2753
|
+
const u = F.toRegex(a, t);
|
|
2595
2754
|
return s === !0 && (u.state = e), u;
|
|
2596
2755
|
};
|
|
2597
|
-
|
|
2756
|
+
F.makeRe = (e, t, n = !1, s = !1) => {
|
|
2598
2757
|
if (!e || typeof e != "string")
|
|
2599
2758
|
throw new TypeError("Expected a non-empty string");
|
|
2600
2759
|
const i = t || {};
|
|
2601
2760
|
let o = { negated: !1, fastpaths: !0 }, r = "", a;
|
|
2602
|
-
return e.startsWith("./") && (e = e.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (e[0] === "." || e[0] === "*") && (a =
|
|
2761
|
+
return e.startsWith("./") && (e = e.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (e[0] === "." || e[0] === "*") && (a = lt.fastpaths(e, t)), a === void 0 ? (o = lt(e, t), o.prefix = r + (o.prefix || "")) : o.output = a, F.compileRe(o, t, n, s);
|
|
2603
2762
|
};
|
|
2604
|
-
|
|
2763
|
+
F.toRegex = (e, t) => {
|
|
2605
2764
|
try {
|
|
2606
2765
|
const n = t || {};
|
|
2607
2766
|
return new RegExp(e, n.flags || (n.nocase ? "i" : ""));
|
|
@@ -2611,10 +2770,10 @@ B.toRegex = (e, t) => {
|
|
|
2611
2770
|
return /$^/;
|
|
2612
2771
|
}
|
|
2613
2772
|
};
|
|
2614
|
-
|
|
2615
|
-
var
|
|
2616
|
-
const
|
|
2617
|
-
class
|
|
2773
|
+
F.constants = fi;
|
|
2774
|
+
var pi = F, hi = pi;
|
|
2775
|
+
const Gt = /* @__PURE__ */ ht(hi);
|
|
2776
|
+
class di extends vt.EventEmitter {
|
|
2618
2777
|
constructor(t, n, s, i, o, r = !1) {
|
|
2619
2778
|
if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this._cachedEventInputsUpdate = {
|
|
2620
2779
|
iframeId: void 0,
|
|
@@ -2629,21 +2788,21 @@ class js extends gt.EventEmitter {
|
|
|
2629
2788
|
}
|
|
2630
2789
|
if (this.url = n, this._metapage = t, this._debug = r, r) {
|
|
2631
2790
|
var a = new URL(this.url);
|
|
2632
|
-
a.searchParams.set(
|
|
2791
|
+
a.searchParams.set(xe.mp_debug, "true"), this.url = a.href;
|
|
2633
2792
|
}
|
|
2634
|
-
this.id = s, this._parentId = i, this._color =
|
|
2793
|
+
this.id = s, this._parentId = i, this._color = pn(this.id), this._consoleBackgroundColor = o, this._iframe = document.createElement("iframe"), this._iframe.name = this.id;
|
|
2635
2794
|
const u = this;
|
|
2636
2795
|
this.iframe = new Promise((f) => {
|
|
2637
|
-
|
|
2638
|
-
var c, d,
|
|
2796
|
+
Ot().then(async () => {
|
|
2797
|
+
var c, d, y, w;
|
|
2639
2798
|
if (u._iframe) {
|
|
2640
|
-
if ((w = (
|
|
2799
|
+
if ((w = (y = (d = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : d.metaframes) == null ? void 0 : y[this.id]) != null && w.allow)
|
|
2641
2800
|
u._iframe.allow = this._metapage._definition.metaframes[this.id].allow;
|
|
2642
2801
|
else {
|
|
2643
|
-
const
|
|
2802
|
+
const _ = await u.getDefinition();
|
|
2644
2803
|
if (!u._iframe)
|
|
2645
2804
|
return;
|
|
2646
|
-
|
|
2805
|
+
_ && _.allow && (u._iframe.allow = _.allow);
|
|
2647
2806
|
}
|
|
2648
2807
|
u._iframe.src = this.url, f(u._iframe);
|
|
2649
2808
|
}
|
|
@@ -2671,7 +2830,7 @@ class js extends gt.EventEmitter {
|
|
|
2671
2830
|
signal: AbortSignal.timeout(6e3)
|
|
2672
2831
|
});
|
|
2673
2832
|
if (n.ok) {
|
|
2674
|
-
const s = await n.json(), i = await
|
|
2833
|
+
const s = await n.json(), i = await es(s);
|
|
2675
2834
|
return this._definition = i, this._definition;
|
|
2676
2835
|
} else
|
|
2677
2836
|
this.emit(E.Error, `Failed to fetch: ${t}
|
|
@@ -2690,7 +2849,7 @@ Error: ${n}`);
|
|
|
2690
2849
|
setInputs(t) {
|
|
2691
2850
|
this.log({ m: "MetapageIFrameRpcClient", inputs: t });
|
|
2692
2851
|
const n = t;
|
|
2693
|
-
if (this.inputs =
|
|
2852
|
+
if (this.inputs = ze(this.inputs, t), this.inputs === n)
|
|
2694
2853
|
return this;
|
|
2695
2854
|
if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(t), this.emit(E.Inputs, this.inputs), this._metapage.listenerCount(E.Inputs) > 0) {
|
|
2696
2855
|
var s = {};
|
|
@@ -2705,7 +2864,7 @@ Error: ${n}`);
|
|
|
2705
2864
|
}
|
|
2706
2865
|
setOutputs(t) {
|
|
2707
2866
|
const n = t;
|
|
2708
|
-
if (this.outputs =
|
|
2867
|
+
if (this.outputs = ze(this.outputs, t), this.outputs === n)
|
|
2709
2868
|
return this;
|
|
2710
2869
|
if (this.emit(E.Outputs, t), this._metapage.listenerCount(E.Outputs) > 0) {
|
|
2711
2870
|
var s = {};
|
|
@@ -2747,9 +2906,9 @@ Error: ${n}`);
|
|
|
2747
2906
|
state: {
|
|
2748
2907
|
inputs: this.inputs
|
|
2749
2908
|
},
|
|
2750
|
-
version:
|
|
2909
|
+
version: Vt
|
|
2751
2910
|
};
|
|
2752
|
-
this.sendRpcInternal(
|
|
2911
|
+
this.sendRpcInternal(fe.SetupIframeServerResponse, t);
|
|
2753
2912
|
}
|
|
2754
2913
|
registered(t) {
|
|
2755
2914
|
if (this.log({ m: "MetapageIFrameRpcClient.registered", inputs: this.inputs }), !this._loaded) {
|
|
@@ -2761,7 +2920,7 @@ Error: ${n}`);
|
|
|
2761
2920
|
}
|
|
2762
2921
|
}
|
|
2763
2922
|
async sendInputs(t) {
|
|
2764
|
-
t && (t = await
|
|
2923
|
+
t && (t = await We(t), !this.isDisposed() && this.sendRpc(fe.InputsUpdate, {
|
|
2765
2924
|
inputs: t,
|
|
2766
2925
|
parentId: this._parentId
|
|
2767
2926
|
}));
|
|
@@ -2779,21 +2938,20 @@ Error: ${n}`);
|
|
|
2779
2938
|
}
|
|
2780
2939
|
}
|
|
2781
2940
|
ack(t) {
|
|
2782
|
-
if (this.
|
|
2941
|
+
if (this._debug) {
|
|
2783
2942
|
this.log("⚒ ⚒ ⚒ sending ack from client to frame");
|
|
2784
2943
|
var n = {
|
|
2785
2944
|
message: t
|
|
2786
2945
|
};
|
|
2787
|
-
this.sendRpc(
|
|
2788
|
-
}
|
|
2789
|
-
this.log("⚒ ⚒ ⚒ NOT sending ack from client to frame since not debug mode");
|
|
2946
|
+
this.sendRpc(fe.MessageAck, n);
|
|
2947
|
+
}
|
|
2790
2948
|
}
|
|
2791
2949
|
log(t) {
|
|
2792
2950
|
this._debug && this.logInternal(t);
|
|
2793
2951
|
}
|
|
2794
2952
|
logInternal(t) {
|
|
2795
2953
|
let n;
|
|
2796
|
-
typeof t == "string" ? n = t : typeof t == "string" ? n = t + "" : n = JSON.stringify(t),
|
|
2954
|
+
typeof t == "string" ? n = t : typeof t == "string" ? n = t + "" : n = JSON.stringify(t), Rt(`Metapage[${this._parentId}] Metaframe[${this.id}] ${n}`, this._color, this._consoleBackgroundColor);
|
|
2797
2955
|
}
|
|
2798
2956
|
sendRpcInternal(t, n) {
|
|
2799
2957
|
const s = {
|
|
@@ -2825,8 +2983,8 @@ const ye = C({
|
|
|
2825
2983
|
inputs: {},
|
|
2826
2984
|
outputs: {}
|
|
2827
2985
|
}
|
|
2828
|
-
}, (e) => e),
|
|
2829
|
-
class ne extends
|
|
2986
|
+
}, (e) => e), Ti = (e) => Re(e), mi = (e, t, n) => (!t || t === "*") && (!n || n === "*") || e === t ? !0 : Gt.isMatch(e, t) ? !!(!n || n === "*" || n.endsWith("/") || Gt.isMatch(e, n)) : !1, yi = "bcbcbc";
|
|
2987
|
+
class ne extends Ts {
|
|
2830
2988
|
static async from(t, n) {
|
|
2831
2989
|
if (t == null)
|
|
2832
2990
|
throw "Metapage definition cannot be null";
|
|
@@ -2840,7 +2998,7 @@ class ne extends rs {
|
|
|
2840
2998
|
return s.setDefinition(t);
|
|
2841
2999
|
}
|
|
2842
3000
|
constructor(t) {
|
|
2843
|
-
super(), this._state = ye, this._metaframes = C({}, (n) => n), this.debug =
|
|
3001
|
+
super(), this._state = ye, this._metaframes = C({}, (n) => n), this.debug = ft(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (n) => n), this._inputMap = {}, this._id = t && t.id ? t.id : Ds(), this._consoleBackgroundColor = t && t.color ? t.color : yi, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Ot().then(() => {
|
|
2844
3002
|
this.isDisposed() || (window.addEventListener("message", this.onMessage), this.log("Initialized"));
|
|
2845
3003
|
});
|
|
2846
3004
|
}
|
|
@@ -2873,7 +3031,7 @@ class ne extends rs {
|
|
|
2873
3031
|
async setDefinition(t, n) {
|
|
2874
3032
|
if (!t.version)
|
|
2875
3033
|
throw "Metapage definition must have a version";
|
|
2876
|
-
const s = await
|
|
3034
|
+
const s = await Vn(t);
|
|
2877
3035
|
if (this.isDisposed())
|
|
2878
3036
|
return this;
|
|
2879
3037
|
s.metaframes && Object.keys(s.metaframes).forEach((o) => {
|
|
@@ -2891,7 +3049,7 @@ class ne extends rs {
|
|
|
2891
3049
|
const r = s.metaframes[o];
|
|
2892
3050
|
this.addMetaframe(o, r);
|
|
2893
3051
|
}
|
|
2894
|
-
}), i !==
|
|
3052
|
+
}), i !== ln && window.setTimeout(() => {
|
|
2895
3053
|
!this.isDisposed() && s === this._definition && (this._emitDefinitionEvent(), n && this.listenerCount(E.State) > 0 && ye !== this._state && this.emit(E.State, this._state));
|
|
2896
3054
|
}, 0), this;
|
|
2897
3055
|
}
|
|
@@ -2950,7 +3108,7 @@ class ne extends rs {
|
|
|
2950
3108
|
throw this.emitErrorMessage(`Existing metaframe for id=${t}`), `Existing metaframe for id=${t}`;
|
|
2951
3109
|
if (!n.url)
|
|
2952
3110
|
throw this.emitErrorMessage(`Metaframe definition missing url id=${t}`), `Metaframe definition missing url id=${t}`;
|
|
2953
|
-
var s = new
|
|
3111
|
+
var s = new di(this, n.url, t, this._id, this._consoleBackgroundColor, this.debug).setMetapage(this);
|
|
2954
3112
|
return this._metaframes = C(this._metaframes, (i) => {
|
|
2955
3113
|
i[t] = s;
|
|
2956
3114
|
}), s.addListener(E.Error, (i) => {
|
|
@@ -2980,7 +3138,7 @@ class ne extends rs {
|
|
|
2980
3138
|
var i = [];
|
|
2981
3139
|
s[t][n] = i, Object.keys(this._inputMap).forEach((o) => {
|
|
2982
3140
|
o !== t && this._inputMap[o].forEach((r) => {
|
|
2983
|
-
if (r.metaframe === t &&
|
|
3141
|
+
if (r.metaframe === t && mi(n, r.source || "*", r.target || "*")) {
|
|
2984
3142
|
var a = r.target;
|
|
2985
3143
|
!r.target || r.target.startsWith("*") || r.target === "" ? a = n : a.endsWith("/") && (a = a + n), i.push({ metaframe: o, pipe: a });
|
|
2986
3144
|
}
|
|
@@ -2992,7 +3150,7 @@ class ne extends rs {
|
|
|
2992
3150
|
if (t.jsonrpc !== "2.0")
|
|
2993
3151
|
return !1;
|
|
2994
3152
|
switch (t.method) {
|
|
2995
|
-
case
|
|
3153
|
+
case X.SetupIframeClientRequest:
|
|
2996
3154
|
return !0;
|
|
2997
3155
|
default:
|
|
2998
3156
|
var s = t.iframeId;
|
|
@@ -3096,45 +3254,45 @@ class ne extends rs {
|
|
|
3096
3254
|
return;
|
|
3097
3255
|
}
|
|
3098
3256
|
switch (r._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(r, null, " ").substring(0, 500)}`), n) {
|
|
3099
|
-
case
|
|
3100
|
-
u
|
|
3257
|
+
case X.SetupIframeClientRequest:
|
|
3258
|
+
u.register();
|
|
3101
3259
|
break;
|
|
3102
|
-
case
|
|
3260
|
+
case X.SetupIframeServerResponseAck:
|
|
3103
3261
|
if (u) {
|
|
3104
3262
|
const c = r.params;
|
|
3105
3263
|
u.registered(c.version);
|
|
3106
3264
|
}
|
|
3107
3265
|
break;
|
|
3108
|
-
case
|
|
3266
|
+
case X.OutputsUpdate:
|
|
3109
3267
|
const f = r.params;
|
|
3110
3268
|
if (this._metaframes[a]) {
|
|
3111
3269
|
var s = this._metaframes[a];
|
|
3112
3270
|
this.setOutputStateOnlyMetaframeInputMap(a, f), s.setOutputs(f);
|
|
3113
3271
|
var i = !1;
|
|
3114
3272
|
const c = Object.keys(f), d = {};
|
|
3115
|
-
c.forEach((
|
|
3116
|
-
const
|
|
3117
|
-
|
|
3118
|
-
d[
|
|
3273
|
+
c.forEach((y, w) => {
|
|
3274
|
+
const _ = this.getInputsFromOutput(a, y);
|
|
3275
|
+
_.length > 0 && _.forEach((S) => {
|
|
3276
|
+
d[S.metaframe] || (d[S.metaframe] = {}), d[S.metaframe][S.pipe] = f[y], i = !0;
|
|
3119
3277
|
});
|
|
3120
|
-
}), i && (this.setInputStateOnlyMetapageInstanceInputs(d), Object.keys(d).forEach((
|
|
3121
|
-
this._metaframes[
|
|
3278
|
+
}), i && (this.setInputStateOnlyMetapageInstanceInputs(d), Object.keys(d).forEach((y) => {
|
|
3279
|
+
this._metaframes[y].setInputs(d[y]);
|
|
3122
3280
|
})), this.listenerCount(E.State) > 0 && ye !== this._state && this.emit(E.State, this._state), this.debug && s.ack({ jsonrpc: r, state: this._state });
|
|
3123
3281
|
} else
|
|
3124
3282
|
this.error(`missing metaframe=${a}`);
|
|
3125
3283
|
break;
|
|
3126
|
-
case
|
|
3284
|
+
case X.InputsUpdate:
|
|
3127
3285
|
var o = r.params;
|
|
3128
3286
|
this.debug && this.log(`inputs ${JSON.stringify(o)} from ${a}`), this._metaframes[a] ? (this.setInputStateOnlyMetaframeInputMap(a, o), this._metaframes[a].setInputs(o), this.listenerCount(E.State) > 0 && ye !== this._state && this.emit(E.State, this._state), this.debug && this._metaframes[a].ack({
|
|
3129
3287
|
jsonrpc: r,
|
|
3130
3288
|
state: this._state
|
|
3131
3289
|
})) : (console.error(`InputsUpdate failed no metaframe id: "${a}"`), this.error(`InputsUpdate failed no metaframe id: "${a}"`));
|
|
3132
3290
|
break;
|
|
3133
|
-
case
|
|
3291
|
+
case X.HashParamsUpdate:
|
|
3134
3292
|
if (u) {
|
|
3135
3293
|
const c = r.params, d = new URL(u.url);
|
|
3136
|
-
d.hash = c.hash, u.url = d.href, this._definition = C(this._definition, (
|
|
3137
|
-
|
|
3294
|
+
d.hash = c.hash, u.url = d.href, this._definition = C(this._definition, (y) => {
|
|
3295
|
+
y.metaframes[c.metaframe].url = d.href;
|
|
3138
3296
|
}), this._emitDefinitionEvent();
|
|
3139
3297
|
}
|
|
3140
3298
|
break;
|
|
@@ -3147,97 +3305,97 @@ class ne extends rs {
|
|
|
3147
3305
|
logInternal(t, n, s) {
|
|
3148
3306
|
s = s || this._consoleBackgroundColor;
|
|
3149
3307
|
let i;
|
|
3150
|
-
typeof t == "string" ? i = t : typeof t == "number" ? i = t + "" : i = JSON.stringify(t), i = this._id ? `Metapage[${this._id}] ${i}` : i,
|
|
3308
|
+
typeof t == "string" ? i = t : typeof t == "number" ? i = t + "" : i = JSON.stringify(t), i = this._id ? `Metapage[${this._id}] ${i}` : i, Rt(i, n, s);
|
|
3151
3309
|
}
|
|
3152
3310
|
}
|
|
3153
|
-
ne.version =
|
|
3311
|
+
ne.version = Vt;
|
|
3154
3312
|
ne.DEFINITION = E.Definition;
|
|
3155
3313
|
ne.ERROR = E.Error;
|
|
3156
3314
|
ne.INPUTS = E.Inputs;
|
|
3157
3315
|
ne.MESSAGE = E.Message;
|
|
3158
3316
|
ne.OUTPUTS = E.Outputs;
|
|
3159
3317
|
ne.STATE = E.State;
|
|
3160
|
-
ne.deserializeInputs =
|
|
3161
|
-
ne.serializeInputs =
|
|
3162
|
-
const
|
|
3318
|
+
ne.deserializeInputs = Ce;
|
|
3319
|
+
ne.serializeInputs = We;
|
|
3320
|
+
const wn = dt(fetch), Di = async (e, t) => {
|
|
3163
3321
|
const n = new URL(e);
|
|
3164
3322
|
n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metapage.json" : "/metapage.json");
|
|
3165
|
-
const i = await (await
|
|
3323
|
+
const i = await (await wn(n.href, {
|
|
3166
3324
|
redirect: "follow",
|
|
3167
3325
|
retries: 3,
|
|
3168
3326
|
retryDelay: 1e3
|
|
3169
3327
|
})).json();
|
|
3170
|
-
return await
|
|
3171
|
-
},
|
|
3328
|
+
return await en(i, t || "1");
|
|
3329
|
+
}, Hi = async (e, t) => {
|
|
3172
3330
|
const n = new URL(e);
|
|
3173
3331
|
n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metaframe.json" : "/metaframe.json");
|
|
3174
|
-
const i = await (await
|
|
3332
|
+
const i = await (await wn(n.href, {
|
|
3175
3333
|
redirect: "follow",
|
|
3176
3334
|
retries: 3,
|
|
3177
3335
|
retryDelay: 1e3
|
|
3178
3336
|
})).json();
|
|
3179
|
-
return await
|
|
3337
|
+
return await tn(i, t || "1");
|
|
3180
3338
|
};
|
|
3181
3339
|
export {
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3340
|
+
ln as INITIAL_NULL_METAPAGE_DEFINITION,
|
|
3341
|
+
Ei as INTERNAL_ERROR,
|
|
3342
|
+
Si as INVALID_PARAMS,
|
|
3343
|
+
Oi as INVALID_REQUEST,
|
|
3344
|
+
X as JsonRpcMethodsFromChild,
|
|
3345
|
+
fe as JsonRpcMethodsFromParent,
|
|
3346
|
+
_i as METAFRAME_JSON_FILE,
|
|
3347
|
+
gi as METAPAGE_KEY_DEFINITION,
|
|
3348
|
+
bi as METAPAGE_KEY_STATE,
|
|
3349
|
+
Ai as METHOD_NOT_FOUND,
|
|
3192
3350
|
te as Metaframe,
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3351
|
+
U as MetaframeEvents,
|
|
3352
|
+
re as MetaframeLoadingState,
|
|
3353
|
+
pt as MetaframeVersionCurrent,
|
|
3354
|
+
Et as MetaframeVersionsAll,
|
|
3197
3355
|
ne as Metapage,
|
|
3198
3356
|
E as MetapageEvents,
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3357
|
+
xe as MetapageHashParams,
|
|
3358
|
+
di as MetapageIFrameRpcClient,
|
|
3359
|
+
Ts as MetapageShared,
|
|
3360
|
+
Je as MetapageVersionCurrent,
|
|
3361
|
+
Mt as MetapageVersionsAll,
|
|
3362
|
+
Ri as PARSE_ERROR,
|
|
3363
|
+
An as VERSION_METAFRAME,
|
|
3364
|
+
Vt as VERSION_METAPAGE,
|
|
3365
|
+
Yn as convertMetaframeDefinitionToCurrentVersion,
|
|
3366
|
+
tn as convertMetaframeDefinitionToVersion,
|
|
3367
|
+
es as convertMetaframeJsonToCurrentVersion,
|
|
3368
|
+
Vn as convertMetapageDefinitionToCurrentVersion,
|
|
3369
|
+
en as convertMetapageDefinitionToVersion,
|
|
3370
|
+
Ce as deserializeInputs,
|
|
3371
|
+
wt as generateId,
|
|
3372
|
+
$i as generateMetaframeId,
|
|
3373
|
+
Ds as generateMetapageId,
|
|
3374
|
+
xi as generateNonce,
|
|
3375
|
+
Ti as getLibraryVersionMatching,
|
|
3376
|
+
ue as getMatchingMetaframeVersion,
|
|
3219
3377
|
Re as getMatchingMetapageVersion,
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3378
|
+
Hi as getMetaframeDefinitionFromUrl,
|
|
3379
|
+
Di as getMetapageDefinitionFromUrl,
|
|
3380
|
+
Ii as getUrlParam,
|
|
3381
|
+
Ci as getUrlParamDebug,
|
|
3382
|
+
Hs as hashCode,
|
|
3383
|
+
Ns as intToRGB,
|
|
3384
|
+
ft as isDebugFromUrlsParams,
|
|
3385
|
+
Ps as isIframe,
|
|
3386
|
+
Mi as isJsonRpcId,
|
|
3387
|
+
Ze as isPageLoaded,
|
|
3388
|
+
Rt as log,
|
|
3389
|
+
mi as matchPipe,
|
|
3390
|
+
ze as merge,
|
|
3391
|
+
Li as metapageAllSha256Hash,
|
|
3392
|
+
Pi as metapageOnlyEssentailSha256Hash,
|
|
3393
|
+
Ot as pageLoaded,
|
|
3394
|
+
wi as possiblyDeserializeDatarefToFile,
|
|
3395
|
+
nn as possiblyDeserializeDatarefToValue,
|
|
3396
|
+
cs as possiblySerializeValueToDataref,
|
|
3397
|
+
We as serializeInputs,
|
|
3398
|
+
pn as stringToRgb,
|
|
3399
|
+
vi as valueToFile
|
|
3242
3400
|
};
|
|
3243
3401
|
//# sourceMappingURL=index.js.map
|