@metapages/metapage 1.8.19 → 1.8.22
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 +1030 -1011
- package/dist/index.js.map +1 -1
- package/dist/metapage/Metapage.d.ts +4 -0
- package/dist/metapage/Metapage.d.ts.map +1 -1
- package/dist/metapage/metapageRenderer.d.ts +4 -3
- package/dist/metapage/metapageRenderer.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/metapage/Metapage.ts +28 -0
- package/src/metapage/metapageRenderer.ts +35 -21
package/dist/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
const It = ["0.3", "0.4", "0.5", "0.6", "1", "2"], Ct = ["0.2", "0.3", "1", "2"], We = "2", Le = "2", Mi = "metaframe.json", Ii = "metapage/definition", Ci = "metapage/state", Vt = Ct[Ct.length - 1],
|
|
1
|
+
const It = ["0.3", "0.4", "0.5", "0.6", "1", "2"], Ct = ["0.2", "0.3", "1", "2"], We = "2", Le = "2", Mi = "metaframe.json", Ii = "metapage/definition", Ci = "metapage/state", Vt = Ct[Ct.length - 1], As = It[It.length - 1], Es = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, $t = (t) => {
|
|
2
2
|
if (typeof t != "string")
|
|
3
3
|
throw new TypeError("Invalid argument expected string");
|
|
4
|
-
const e = t.match(
|
|
4
|
+
const e = t.match(Es);
|
|
5
5
|
if (!e)
|
|
6
6
|
throw new Error(`Invalid argument not valid semver ('${t}' received)`);
|
|
7
7
|
return e.shift(), e;
|
|
8
8
|
}, xt = (t) => t === "*" || t === "x" || t === "X", Lt = (t) => {
|
|
9
9
|
const e = parseInt(t, 10);
|
|
10
10
|
return isNaN(e) ? t : e;
|
|
11
|
-
},
|
|
11
|
+
}, Ms = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], Is = (t, e) => {
|
|
12
12
|
if (xt(t) || xt(e))
|
|
13
13
|
return 0;
|
|
14
|
-
const [
|
|
15
|
-
return
|
|
14
|
+
const [s, n] = Ms(Lt(t), Lt(e));
|
|
15
|
+
return s > n ? 1 : s < n ? -1 : 0;
|
|
16
16
|
}, Tt = (t, e) => {
|
|
17
|
-
for (let
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
17
|
+
for (let s = 0; s < Math.max(t.length, e.length); s++) {
|
|
18
|
+
const n = Is(t[s] || "0", e[s] || "0");
|
|
19
|
+
if (n !== 0)
|
|
20
|
+
return n;
|
|
21
21
|
}
|
|
22
22
|
return 0;
|
|
23
23
|
}, j = (t, e) => {
|
|
24
|
-
const
|
|
24
|
+
const s = $t(t), n = $t(e), i = s.pop(), o = n.pop(), r = Tt(s, n);
|
|
25
25
|
return r !== 0 ? r : i && o ? Tt(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
|
|
26
26
|
};
|
|
27
|
-
var
|
|
27
|
+
var Cs = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
28
28
|
function mt(t) {
|
|
29
29
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
30
30
|
}
|
|
31
31
|
var Wt = { exports: {} };
|
|
32
32
|
(function(t, e) {
|
|
33
|
-
(function(
|
|
34
|
-
t.exports =
|
|
35
|
-
})(
|
|
36
|
-
var
|
|
33
|
+
(function(s, n) {
|
|
34
|
+
t.exports = n();
|
|
35
|
+
})(Cs, function() {
|
|
36
|
+
var s = function(o, r) {
|
|
37
37
|
if (r = r || {}, typeof o != "function")
|
|
38
38
|
throw new i("fetch must be a function");
|
|
39
39
|
if (typeof r != "object")
|
|
40
40
|
throw new i("defaults must be an object");
|
|
41
|
-
if (r.retries !== void 0 && !
|
|
41
|
+
if (r.retries !== void 0 && !n(r.retries))
|
|
42
42
|
throw new i("retries must be a positive integer");
|
|
43
|
-
if (r.retryDelay !== void 0 && !
|
|
43
|
+
if (r.retryDelay !== void 0 && !n(r.retryDelay) && typeof r.retryDelay != "function")
|
|
44
44
|
throw new i("retryDelay must be a positive integer or a function returning a positive integer");
|
|
45
45
|
if (r.retryOn !== void 0 && !Array.isArray(r.retryOn) && typeof r.retryOn != "function")
|
|
46
46
|
throw new i("retryOn property expects an array or function");
|
|
@@ -52,12 +52,12 @@ var Wt = { exports: {} };
|
|
|
52
52
|
return r = Object.assign(a, r), function(l, c) {
|
|
53
53
|
var d = r.retries, _ = r.retryDelay, v = r.retryOn;
|
|
54
54
|
if (c && c.retries !== void 0)
|
|
55
|
-
if (
|
|
55
|
+
if (n(c.retries))
|
|
56
56
|
d = c.retries;
|
|
57
57
|
else
|
|
58
58
|
throw new i("retries must be a positive integer");
|
|
59
59
|
if (c && c.retryDelay !== void 0)
|
|
60
|
-
if (
|
|
60
|
+
if (n(c.retryDelay) || typeof c.retryDelay == "function")
|
|
61
61
|
_ = c.retryDelay;
|
|
62
62
|
else
|
|
63
63
|
throw new i("retryDelay must be a positive integer or a function returning a positive integer");
|
|
@@ -74,54 +74,54 @@ var Wt = { exports: {} };
|
|
|
74
74
|
m(E);
|
|
75
75
|
else if (typeof v == "function")
|
|
76
76
|
try {
|
|
77
|
-
return Promise.resolve(v(b, null, E)).then(function(
|
|
78
|
-
|
|
77
|
+
return Promise.resolve(v(b, null, E)).then(function(O) {
|
|
78
|
+
O ? x(b, null, E) : m(E);
|
|
79
79
|
}).catch(S);
|
|
80
|
-
} catch (
|
|
81
|
-
S(
|
|
80
|
+
} catch (O) {
|
|
81
|
+
S(O);
|
|
82
82
|
}
|
|
83
83
|
else
|
|
84
|
-
b < d ?
|
|
84
|
+
b < d ? x(b, null, E) : m(E);
|
|
85
85
|
}).catch(function(E) {
|
|
86
86
|
if (typeof v == "function")
|
|
87
87
|
try {
|
|
88
|
-
Promise.resolve(v(b, E, null)).then(function(
|
|
89
|
-
|
|
90
|
-
}).catch(function(
|
|
91
|
-
S(
|
|
88
|
+
Promise.resolve(v(b, E, null)).then(function(O) {
|
|
89
|
+
O ? x(b, E, null) : S(E);
|
|
90
|
+
}).catch(function(O) {
|
|
91
|
+
S(O);
|
|
92
92
|
});
|
|
93
|
-
} catch (
|
|
94
|
-
S(
|
|
93
|
+
} catch (O) {
|
|
94
|
+
S(O);
|
|
95
95
|
}
|
|
96
96
|
else
|
|
97
|
-
b < d ?
|
|
97
|
+
b < d ? x(b, E, null) : S(E);
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
-
function
|
|
101
|
-
var
|
|
100
|
+
function x(b, A, E) {
|
|
101
|
+
var O = typeof _ == "function" ? _(b, A, E) : _;
|
|
102
102
|
setTimeout(function() {
|
|
103
103
|
w(++b);
|
|
104
|
-
},
|
|
104
|
+
}, O);
|
|
105
105
|
}
|
|
106
106
|
w(0);
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
function
|
|
110
|
+
function n(o) {
|
|
111
111
|
return Number.isInteger(o) && o >= 0;
|
|
112
112
|
}
|
|
113
113
|
function i(o) {
|
|
114
114
|
this.name = "ArgumentError", this.message = o;
|
|
115
115
|
}
|
|
116
|
-
return
|
|
116
|
+
return s;
|
|
117
117
|
});
|
|
118
118
|
})(Wt);
|
|
119
|
-
var
|
|
120
|
-
const yt = /* @__PURE__ */ mt(
|
|
119
|
+
var $s = Wt.exports;
|
|
120
|
+
const yt = /* @__PURE__ */ mt($s), J = {
|
|
121
121
|
Remove: "remove",
|
|
122
122
|
Replace: "replace",
|
|
123
123
|
Add: "add"
|
|
124
|
-
}, Kt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"),
|
|
124
|
+
}, Kt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), xs = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Be = Symbol.iterator, Z = {
|
|
125
125
|
mutable: "mutable",
|
|
126
126
|
immutable: "immutable"
|
|
127
127
|
}, gt = {};
|
|
@@ -130,12 +130,12 @@ function Ie(t, e) {
|
|
|
130
130
|
}
|
|
131
131
|
function Pt(t, e) {
|
|
132
132
|
if (e in t) {
|
|
133
|
-
let
|
|
134
|
-
for (;
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
return
|
|
138
|
-
|
|
133
|
+
let s = Reflect.getPrototypeOf(t);
|
|
134
|
+
for (; s; ) {
|
|
135
|
+
const n = Reflect.getOwnPropertyDescriptor(s, e);
|
|
136
|
+
if (n)
|
|
137
|
+
return n;
|
|
138
|
+
s = Reflect.getPrototypeOf(s);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -151,22 +151,22 @@ function P(t) {
|
|
|
151
151
|
}
|
|
152
152
|
function _t(t) {
|
|
153
153
|
var e;
|
|
154
|
-
const
|
|
155
|
-
return
|
|
154
|
+
const s = P(t);
|
|
155
|
+
return s ? (e = s.copy) !== null && e !== void 0 ? e : s.original : t;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function ne(t, e) {
|
|
158
158
|
if (!t || typeof t != "object")
|
|
159
159
|
return !1;
|
|
160
|
-
let
|
|
161
|
-
return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((
|
|
160
|
+
let s;
|
|
161
|
+
return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((s = e.mark(t, Z)) === Z.immutable || typeof s == "function");
|
|
162
162
|
}
|
|
163
163
|
function Xt(t, e = []) {
|
|
164
164
|
if (Object.hasOwnProperty.call(t, "key")) {
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
165
|
+
const s = t.parent.copy, n = P(pe(s, t.key));
|
|
166
|
+
if (n !== null && (n == null ? void 0 : n.original) !== t.original)
|
|
167
167
|
return null;
|
|
168
168
|
const i = t.parent.type === 3, o = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
|
|
169
|
-
if (!(i &&
|
|
169
|
+
if (!(i && s.size > o || Ie(s, o)))
|
|
170
170
|
return null;
|
|
171
171
|
e.push(o);
|
|
172
172
|
}
|
|
@@ -174,7 +174,7 @@ function Xt(t, e = []) {
|
|
|
174
174
|
return Xt(t.parent, e);
|
|
175
175
|
e.reverse();
|
|
176
176
|
try {
|
|
177
|
-
|
|
177
|
+
Ls(t.copy, e);
|
|
178
178
|
} catch {
|
|
179
179
|
return null;
|
|
180
180
|
}
|
|
@@ -186,12 +186,12 @@ function we(t) {
|
|
|
186
186
|
function pe(t, e) {
|
|
187
187
|
return we(t) === 2 ? t.get(e) : t[e];
|
|
188
188
|
}
|
|
189
|
-
function Te(t, e,
|
|
190
|
-
we(t) === 2 ? t.set(e,
|
|
189
|
+
function Te(t, e, s) {
|
|
190
|
+
we(t) === 2 ? t.set(e, s) : t[e] = s;
|
|
191
191
|
}
|
|
192
192
|
function et(t, e) {
|
|
193
|
-
const
|
|
194
|
-
return (
|
|
193
|
+
const s = P(t);
|
|
194
|
+
return (s ? Y(s) : t)[e];
|
|
195
195
|
}
|
|
196
196
|
function fe(t, e) {
|
|
197
197
|
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
@@ -202,60 +202,60 @@ function ot(t) {
|
|
|
202
202
|
t.finalities.revoke.pop()();
|
|
203
203
|
}
|
|
204
204
|
function _e(t, e) {
|
|
205
|
-
return e ? t : [""].concat(t).map((
|
|
206
|
-
const
|
|
207
|
-
return
|
|
205
|
+
return e ? t : [""].concat(t).map((s) => {
|
|
206
|
+
const n = `${s}`;
|
|
207
|
+
return n.indexOf("/") === -1 && n.indexOf("~") === -1 ? n : n.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
208
208
|
}).join("/");
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
for (let
|
|
212
|
-
const
|
|
213
|
-
if (t = pe(we(t) === 3 ? Array.from(t) : t,
|
|
210
|
+
function Ls(t, e) {
|
|
211
|
+
for (let s = 0; s < e.length - 1; s += 1) {
|
|
212
|
+
const n = e[s];
|
|
213
|
+
if (t = pe(we(t) === 3 ? Array.from(t) : t, n), typeof t != "object")
|
|
214
214
|
throw new Error(`Cannot resolve patch at '${e.join("/")}'.`);
|
|
215
215
|
}
|
|
216
216
|
return t;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Ts(t) {
|
|
219
219
|
const e = Object.create(Object.getPrototypeOf(t));
|
|
220
|
-
return Reflect.ownKeys(t).forEach((
|
|
221
|
-
let
|
|
222
|
-
if (
|
|
223
|
-
e[
|
|
220
|
+
return Reflect.ownKeys(t).forEach((s) => {
|
|
221
|
+
let n = Reflect.getOwnPropertyDescriptor(t, s);
|
|
222
|
+
if (n.enumerable && n.configurable && n.writable) {
|
|
223
|
+
e[s] = t[s];
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
n.writable || (n.writable = !0, n.configurable = !0), (n.get || n.set) && (n = {
|
|
227
227
|
configurable: !0,
|
|
228
228
|
writable: !0,
|
|
229
|
-
enumerable:
|
|
230
|
-
value: t[
|
|
231
|
-
}), Reflect.defineProperty(e,
|
|
229
|
+
enumerable: n.enumerable,
|
|
230
|
+
value: t[s]
|
|
231
|
+
}), Reflect.defineProperty(e, s, n);
|
|
232
232
|
}), e;
|
|
233
233
|
}
|
|
234
|
-
const
|
|
234
|
+
const Ps = Object.prototype.propertyIsEnumerable;
|
|
235
235
|
function qt(t, e) {
|
|
236
|
-
let
|
|
236
|
+
let s;
|
|
237
237
|
if (Array.isArray(t))
|
|
238
238
|
return Array.prototype.concat.call(t);
|
|
239
239
|
if (t instanceof Set)
|
|
240
240
|
return new Set(t.values());
|
|
241
241
|
if (t instanceof Map)
|
|
242
242
|
return new Map(t);
|
|
243
|
-
if (e != null && e.mark && (
|
|
244
|
-
if (
|
|
245
|
-
return
|
|
246
|
-
if (typeof
|
|
243
|
+
if (e != null && e.mark && (s = e.mark(t, Z), s !== void 0) && s !== Z.mutable) {
|
|
244
|
+
if (s === Z.immutable)
|
|
245
|
+
return Ts(t);
|
|
246
|
+
if (typeof s == "function") {
|
|
247
247
|
if (e.enablePatches || e.enableAutoFreeze)
|
|
248
248
|
throw new Error("You can't use mark and patches or auto freeze together.");
|
|
249
|
-
return
|
|
249
|
+
return s();
|
|
250
250
|
}
|
|
251
|
-
throw new Error(`Unsupported mark result: ${
|
|
251
|
+
throw new Error(`Unsupported mark result: ${s}`);
|
|
252
252
|
} else if (typeof t == "object" && Object.getPrototypeOf(t) === Object.prototype) {
|
|
253
|
-
const
|
|
253
|
+
const n = {};
|
|
254
254
|
return Object.keys(t).forEach((i) => {
|
|
255
|
-
|
|
255
|
+
n[i] = t[i];
|
|
256
256
|
}), Object.getOwnPropertySymbols(t).forEach((i) => {
|
|
257
|
-
|
|
258
|
-
}),
|
|
257
|
+
Ps.call(t, i) && (n[i] = t[i]);
|
|
258
|
+
}), n;
|
|
259
259
|
} else
|
|
260
260
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
261
261
|
}
|
|
@@ -263,17 +263,17 @@ function q(t) {
|
|
|
263
263
|
t.copy || (t.copy = qt(t.original, t.options));
|
|
264
264
|
}
|
|
265
265
|
function Ae(t) {
|
|
266
|
-
if (!
|
|
266
|
+
if (!ne(t))
|
|
267
267
|
return _t(t);
|
|
268
268
|
if (Array.isArray(t))
|
|
269
269
|
return t.map(Ae);
|
|
270
270
|
if (t instanceof Map)
|
|
271
|
-
return new Map(Array.from(t.entries()).map(([
|
|
271
|
+
return new Map(Array.from(t.entries()).map(([s, n]) => [s, Ae(n)]));
|
|
272
272
|
if (t instanceof Set)
|
|
273
273
|
return new Set(Array.from(t).map(Ae));
|
|
274
274
|
const e = Object.create(Object.getPrototypeOf(t));
|
|
275
|
-
for (const
|
|
276
|
-
e[
|
|
275
|
+
for (const s in t)
|
|
276
|
+
e[s] = Ae(t[s]);
|
|
277
277
|
return e;
|
|
278
278
|
}
|
|
279
279
|
function Fe(t) {
|
|
@@ -286,78 +286,78 @@ function ue(t) {
|
|
|
286
286
|
function Dt() {
|
|
287
287
|
throw new Error("Cannot modify frozen object");
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function Oe(t, e, s, n, i) {
|
|
290
290
|
{
|
|
291
|
-
|
|
292
|
-
const r =
|
|
293
|
-
if (
|
|
294
|
-
const a =
|
|
291
|
+
s = s ?? /* @__PURE__ */ new WeakMap(), n = n ?? [], i = i ?? [];
|
|
292
|
+
const r = s.has(t) ? s.get(t) : t;
|
|
293
|
+
if (n.length > 0) {
|
|
294
|
+
const a = n.indexOf(r);
|
|
295
295
|
if (r && typeof r == "object" && a !== -1)
|
|
296
|
-
throw
|
|
296
|
+
throw n[0] === r ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${i.slice(0, a).map((u, l) => {
|
|
297
297
|
if (typeof u == "symbol")
|
|
298
298
|
return `[${u.toString()}]`;
|
|
299
|
-
const c =
|
|
299
|
+
const c = n[l];
|
|
300
300
|
return typeof u == "object" && (c instanceof Map || c instanceof Set) ? Array.from(c.keys()).indexOf(u) : u;
|
|
301
301
|
}).join("/")}`);
|
|
302
|
-
|
|
302
|
+
n.push(r), i.push(e);
|
|
303
303
|
} else
|
|
304
|
-
|
|
304
|
+
n.push(r);
|
|
305
305
|
}
|
|
306
306
|
if (Object.isFrozen(t) || be(t)) {
|
|
307
|
-
|
|
307
|
+
n.pop(), i.pop();
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
310
|
switch (we(t)) {
|
|
311
311
|
case 2:
|
|
312
312
|
for (const [a, u] of t)
|
|
313
|
-
|
|
313
|
+
Oe(a, a, s, n, i), Oe(u, a, s, n, i);
|
|
314
314
|
t.set = t.clear = t.delete = Dt;
|
|
315
315
|
break;
|
|
316
316
|
case 3:
|
|
317
317
|
for (const a of t)
|
|
318
|
-
|
|
318
|
+
Oe(a, a, s, n, i);
|
|
319
319
|
t.add = t.clear = t.delete = Dt;
|
|
320
320
|
break;
|
|
321
321
|
case 1:
|
|
322
322
|
Object.freeze(t);
|
|
323
323
|
let r = 0;
|
|
324
324
|
for (const a of t)
|
|
325
|
-
|
|
325
|
+
Oe(a, r, s, n, i), r += 1;
|
|
326
326
|
break;
|
|
327
327
|
default:
|
|
328
328
|
Object.freeze(t), Object.keys(t).forEach((a) => {
|
|
329
329
|
const u = t[a];
|
|
330
|
-
|
|
330
|
+
Oe(u, a, s, n, i);
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
|
-
|
|
333
|
+
n.pop(), i.pop();
|
|
334
334
|
}
|
|
335
335
|
function bt(t, e) {
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
-
Reflect.ownKeys(t).forEach((
|
|
339
|
-
e(
|
|
336
|
+
const s = we(t);
|
|
337
|
+
if (s === 0)
|
|
338
|
+
Reflect.ownKeys(t).forEach((n) => {
|
|
339
|
+
e(n, t[n], t);
|
|
340
340
|
});
|
|
341
|
-
else if (
|
|
342
|
-
let
|
|
341
|
+
else if (s === 1) {
|
|
342
|
+
let n = 0;
|
|
343
343
|
for (const i of t)
|
|
344
|
-
e(
|
|
344
|
+
e(n, i, t), n += 1;
|
|
345
345
|
} else
|
|
346
|
-
t.forEach((
|
|
346
|
+
t.forEach((n, i) => e(i, n, t));
|
|
347
347
|
}
|
|
348
|
-
function Qt(t, e,
|
|
349
|
-
if (be(t) || !
|
|
348
|
+
function Qt(t, e, s) {
|
|
349
|
+
if (be(t) || !ne(t, s) || e.has(t) || Object.isFrozen(t))
|
|
350
350
|
return;
|
|
351
|
-
const
|
|
351
|
+
const n = t instanceof Set, i = n ? /* @__PURE__ */ new Map() : void 0;
|
|
352
352
|
if (e.add(t), bt(t, (o, r) => {
|
|
353
353
|
var a;
|
|
354
354
|
if (be(r)) {
|
|
355
355
|
const u = P(r);
|
|
356
356
|
q(u);
|
|
357
357
|
const l = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
|
|
358
|
-
Te(
|
|
358
|
+
Te(n ? i : t, o, l);
|
|
359
359
|
} else
|
|
360
|
-
Qt(r, e,
|
|
360
|
+
Qt(r, e, s);
|
|
361
361
|
}), i) {
|
|
362
362
|
const o = t, r = Array.from(o);
|
|
363
363
|
o.clear(), r.forEach((a) => {
|
|
@@ -365,50 +365,50 @@ function Qt(t, e, n) {
|
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
const
|
|
370
|
-
t.finalities.revoke.length > 1 && t.assignedMap.get(e) &&
|
|
368
|
+
function Ds(t, e) {
|
|
369
|
+
const s = t.type === 3 ? t.setMap : t.copy;
|
|
370
|
+
t.finalities.revoke.length > 1 && t.assignedMap.get(e) && s && Qt(pe(s, e), t.finalities.handledSet, t.options);
|
|
371
371
|
}
|
|
372
372
|
function at(t) {
|
|
373
373
|
t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
|
|
374
374
|
t.copy.add(_t(e));
|
|
375
375
|
}));
|
|
376
376
|
}
|
|
377
|
-
function ut(t, e,
|
|
377
|
+
function ut(t, e, s, n) {
|
|
378
378
|
if (t.operated && t.assignedMap && t.assignedMap.size > 0 && !t.finalized) {
|
|
379
|
-
if (
|
|
379
|
+
if (s && n) {
|
|
380
380
|
const o = Xt(t);
|
|
381
|
-
o && e(t, o,
|
|
381
|
+
o && e(t, o, s, n);
|
|
382
382
|
}
|
|
383
383
|
t.finalized = !0;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
function wt(t, e,
|
|
387
|
-
const i = P(
|
|
386
|
+
function wt(t, e, s, n) {
|
|
387
|
+
const i = P(s);
|
|
388
388
|
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, r) => {
|
|
389
389
|
var a;
|
|
390
390
|
const u = t.type === 3 ? t.setMap : t.copy;
|
|
391
|
-
if (fe(pe(u, e),
|
|
391
|
+
if (fe(pe(u, e), s)) {
|
|
392
392
|
let l = i.original;
|
|
393
|
-
i.copy && (l = i.copy), at(t), ut(t,
|
|
393
|
+
i.copy && (l = i.copy), at(t), ut(t, n, o, r), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(l, i.original)), Te(u, e, l);
|
|
394
394
|
}
|
|
395
|
-
}), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)),
|
|
395
|
+
}), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), ne(s, t.options) && t.finalities.draft.push(() => {
|
|
396
396
|
const o = t.type === 3 ? t.setMap : t.copy;
|
|
397
|
-
fe(pe(o, e),
|
|
397
|
+
fe(pe(o, e), s) && Ds(t, e);
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function ks(t, e, s, n, i) {
|
|
401
401
|
let { original: o, assignedMap: r, options: a } = t, u = t.copy;
|
|
402
|
-
u.length < o.length && ([o, u] = [u, o], [
|
|
402
|
+
u.length < o.length && ([o, u] = [u, o], [s, n] = [n, s]);
|
|
403
403
|
for (let l = 0; l < o.length; l += 1)
|
|
404
404
|
if (r.get(l.toString()) && u[l] !== o[l]) {
|
|
405
405
|
const c = e.concat([l]), d = _e(c, i);
|
|
406
|
-
|
|
406
|
+
s.push({
|
|
407
407
|
op: J.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
410
|
value: Fe(u[l])
|
|
411
|
-
}),
|
|
411
|
+
}), n.push({
|
|
412
412
|
op: J.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.
|
|
@@ -417,7 +417,7 @@ function Hn(t, e, n, s, i) {
|
|
|
417
417
|
}
|
|
418
418
|
for (let l = o.length; l < u.length; l += 1) {
|
|
419
419
|
const c = e.concat([l]), d = _e(c, i);
|
|
420
|
-
|
|
420
|
+
s.push({
|
|
421
421
|
op: J.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.
|
|
@@ -428,7 +428,7 @@ function Hn(t, e, n, s, i) {
|
|
|
428
428
|
const { arrayLengthAssignment: l = !0 } = a.enablePatches;
|
|
429
429
|
if (l) {
|
|
430
430
|
const c = e.concat(["length"]), d = _e(c, i);
|
|
431
|
-
|
|
431
|
+
n.push({
|
|
432
432
|
op: J.Replace,
|
|
433
433
|
path: d,
|
|
434
434
|
value: o.length
|
|
@@ -436,28 +436,28 @@ function Hn(t, e, n, s, i) {
|
|
|
436
436
|
} else
|
|
437
437
|
for (let c = u.length; o.length < c; c -= 1) {
|
|
438
438
|
const d = e.concat([c - 1]), _ = _e(d, i);
|
|
439
|
-
|
|
439
|
+
n.push({
|
|
440
440
|
op: J.Remove,
|
|
441
441
|
path: _
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
|
|
446
|
+
function Hs({ original: t, copy: e, assignedMap: s }, n, i, o, r) {
|
|
447
|
+
s.forEach((a, u) => {
|
|
448
448
|
const l = pe(t, u), c = Fe(pe(e, u)), d = a ? Ie(t, u) ? J.Replace : J.Add : J.Remove;
|
|
449
449
|
if (fe(l, c) && d === J.Replace)
|
|
450
450
|
return;
|
|
451
|
-
const _ =
|
|
451
|
+
const _ = n.concat(u), v = _e(_, r);
|
|
452
452
|
i.push(d === J.Remove ? { op: d, path: v } : { op: d, path: v, value: c }), o.push(d === J.Add ? { op: J.Remove, path: v } : d === J.Remove ? { op: J.Add, path: v, value: l } : { op: J.Replace, path: v, value: l });
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Ns({ original: t, copy: e }, s, n, i, o) {
|
|
456
456
|
let r = 0;
|
|
457
457
|
t.forEach((a) => {
|
|
458
458
|
if (!e.has(a)) {
|
|
459
|
-
const u =
|
|
460
|
-
|
|
459
|
+
const u = s.concat([r]), l = _e(u, o);
|
|
460
|
+
n.push({
|
|
461
461
|
op: J.Remove,
|
|
462
462
|
path: l,
|
|
463
463
|
value: a
|
|
@@ -470,8 +470,8 @@ function jn({ original: t, copy: e }, n, s, i, o) {
|
|
|
470
470
|
r += 1;
|
|
471
471
|
}), r = 0, e.forEach((a) => {
|
|
472
472
|
if (!t.has(a)) {
|
|
473
|
-
const u =
|
|
474
|
-
|
|
473
|
+
const u = s.concat([r]), l = _e(u, o);
|
|
474
|
+
n.push({
|
|
475
475
|
op: J.Add,
|
|
476
476
|
path: l,
|
|
477
477
|
value: a
|
|
@@ -484,21 +484,21 @@ function jn({ original: t, copy: e }, n, s, i, o) {
|
|
|
484
484
|
r += 1;
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
|
-
function $e(t, e,
|
|
487
|
+
function $e(t, e, s, n) {
|
|
488
488
|
const { pathAsArray: i = !0 } = t.options.enablePatches;
|
|
489
489
|
switch (t.type) {
|
|
490
490
|
case 0:
|
|
491
491
|
case 2:
|
|
492
|
-
return
|
|
492
|
+
return Hs(t, e, s, n, i);
|
|
493
493
|
case 1:
|
|
494
|
-
return
|
|
494
|
+
return ks(t, e, s, n, i);
|
|
495
495
|
case 3:
|
|
496
|
-
return
|
|
496
|
+
return Ns(t, e, s, n, i);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
let
|
|
500
|
-
const ze = (t, e,
|
|
501
|
-
if (typeof t == "object" && t !== null && (!
|
|
499
|
+
let js = !1;
|
|
500
|
+
const ze = (t, e, s = !1) => {
|
|
501
|
+
if (typeof t == "object" && t !== null && (!ne(t, e) || s) && !js)
|
|
502
502
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
503
503
|
}, ct = {
|
|
504
504
|
get size() {
|
|
@@ -508,8 +508,8 @@ const ze = (t, e, n = !1) => {
|
|
|
508
508
|
return Y(P(this)).has(t);
|
|
509
509
|
},
|
|
510
510
|
set(t, e) {
|
|
511
|
-
const
|
|
512
|
-
return (!
|
|
511
|
+
const s = P(this), n = Y(s);
|
|
512
|
+
return (!n.has(t) || !fe(n.get(t), e)) && (q(s), ue(s), s.assignedMap.set(t, !0), s.copy.set(t, e), wt(s, t, e, $e)), this;
|
|
513
513
|
},
|
|
514
514
|
delete(t) {
|
|
515
515
|
if (!this.has(t))
|
|
@@ -527,24 +527,24 @@ const ze = (t, e, n = !1) => {
|
|
|
527
527
|
}
|
|
528
528
|
},
|
|
529
529
|
forEach(t, e) {
|
|
530
|
-
const
|
|
531
|
-
Y(
|
|
530
|
+
const s = P(this);
|
|
531
|
+
Y(s).forEach((n, i) => {
|
|
532
532
|
t.call(e, this.get(i), i, this);
|
|
533
533
|
});
|
|
534
534
|
},
|
|
535
535
|
get(t) {
|
|
536
|
-
var e,
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
536
|
+
var e, s;
|
|
537
|
+
const n = P(this), i = Y(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, Z)) === Z.mutable;
|
|
538
|
+
if (n.options.strict && ze(i, n.options, o), o || n.finalized || !ne(i, n.options) || i !== n.original.get(t))
|
|
539
539
|
return i;
|
|
540
540
|
const r = gt.createDraft({
|
|
541
541
|
original: i,
|
|
542
|
-
parentDraft:
|
|
542
|
+
parentDraft: n,
|
|
543
543
|
key: t,
|
|
544
|
-
finalities:
|
|
545
|
-
options:
|
|
544
|
+
finalities: n.finalities,
|
|
545
|
+
options: n.options
|
|
546
546
|
});
|
|
547
|
-
return q(
|
|
547
|
+
return q(n), n.copy.set(t, r), r;
|
|
548
548
|
},
|
|
549
549
|
keys() {
|
|
550
550
|
return Y(P(this)).keys();
|
|
@@ -570,10 +570,10 @@ const ze = (t, e, n = !1) => {
|
|
|
570
570
|
const e = t.next();
|
|
571
571
|
if (e.done)
|
|
572
572
|
return e;
|
|
573
|
-
const
|
|
573
|
+
const s = this.get(e.value);
|
|
574
574
|
return {
|
|
575
575
|
done: !1,
|
|
576
|
-
value: [e.value,
|
|
576
|
+
value: [e.value, s]
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
579
|
};
|
|
@@ -581,15 +581,15 @@ const ze = (t, e, n = !1) => {
|
|
|
581
581
|
[Be]() {
|
|
582
582
|
return this.entries();
|
|
583
583
|
}
|
|
584
|
-
},
|
|
585
|
-
var
|
|
584
|
+
}, Us = Reflect.ownKeys(ct), kt = (t, e, { isValuesIterator: s }) => () => {
|
|
585
|
+
var n, i;
|
|
586
586
|
const o = e.next();
|
|
587
587
|
if (o.done)
|
|
588
588
|
return o;
|
|
589
589
|
const r = o.value;
|
|
590
590
|
let a = t.setMap.get(r);
|
|
591
|
-
const u = P(a), l = ((i = (
|
|
592
|
-
if (t.options.strict && ze(r, t.options, l), !l && !u &&
|
|
591
|
+
const u = P(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, Z)) === Z.mutable;
|
|
592
|
+
if (t.options.strict && ze(r, t.options, l), !l && !u && ne(r, t.options) && !t.finalized && t.original.has(r)) {
|
|
593
593
|
const c = gt.createDraft({
|
|
594
594
|
original: r,
|
|
595
595
|
parentDraft: t,
|
|
@@ -602,7 +602,7 @@ const ze = (t, e, n = !1) => {
|
|
|
602
602
|
u && (a = u.proxy);
|
|
603
603
|
return {
|
|
604
604
|
done: !1,
|
|
605
|
-
value:
|
|
605
|
+
value: s ? a : [a, a]
|
|
606
606
|
};
|
|
607
607
|
}, lt = {
|
|
608
608
|
get size() {
|
|
@@ -613,8 +613,8 @@ const ze = (t, e, n = !1) => {
|
|
|
613
613
|
if (e.setMap.has(t))
|
|
614
614
|
return !0;
|
|
615
615
|
q(e);
|
|
616
|
-
const
|
|
617
|
-
return !!(
|
|
616
|
+
const s = P(t);
|
|
617
|
+
return !!(s && e.setMap.has(s.original));
|
|
618
618
|
},
|
|
619
619
|
add(t) {
|
|
620
620
|
const e = P(this);
|
|
@@ -625,8 +625,8 @@ const ze = (t, e, n = !1) => {
|
|
|
625
625
|
return !1;
|
|
626
626
|
const e = P(this);
|
|
627
627
|
q(e), ue(e);
|
|
628
|
-
const
|
|
629
|
-
return
|
|
628
|
+
const s = P(t);
|
|
629
|
+
return s && e.setMap.has(s.original) ? (e.assignedMap.set(s.original, !1), e.setMap.delete(s.original)) : (!s && e.setMap.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.setMap.delete(t));
|
|
630
630
|
},
|
|
631
631
|
clear() {
|
|
632
632
|
if (!this.size)
|
|
@@ -664,34 +664,34 @@ const ze = (t, e, n = !1) => {
|
|
|
664
664
|
return this.values();
|
|
665
665
|
},
|
|
666
666
|
forEach(t, e) {
|
|
667
|
-
const
|
|
668
|
-
let
|
|
669
|
-
for (; !
|
|
670
|
-
t.call(e,
|
|
671
|
-
}
|
|
672
|
-
},
|
|
673
|
-
get(t, e,
|
|
674
|
-
var
|
|
675
|
-
const o = (
|
|
667
|
+
const s = this.values();
|
|
668
|
+
let n = s.next();
|
|
669
|
+
for (; !n.done; )
|
|
670
|
+
t.call(e, n.value, n.value, this), n = s.next();
|
|
671
|
+
}
|
|
672
|
+
}, Bs = Reflect.ownKeys(lt), Yt = /* @__PURE__ */ new WeakSet(), Zt = {
|
|
673
|
+
get(t, e, s) {
|
|
674
|
+
var n, i;
|
|
675
|
+
const o = (n = t.copy) === null || n === void 0 ? void 0 : n[e];
|
|
676
676
|
if (o && Yt.has(o))
|
|
677
677
|
return o;
|
|
678
678
|
if (e === Kt)
|
|
679
679
|
return t;
|
|
680
680
|
let r;
|
|
681
681
|
if (t.options.mark) {
|
|
682
|
-
const l = e === "size" && (t.original instanceof Map || t.original instanceof Set) ? Reflect.get(t.original, e) : Reflect.get(t.original, e,
|
|
682
|
+
const l = e === "size" && (t.original instanceof Map || t.original instanceof Set) ? Reflect.get(t.original, e) : Reflect.get(t.original, e, s);
|
|
683
683
|
if (r = t.options.mark(l, Z), r === Z.mutable)
|
|
684
684
|
return t.options.strict && ze(l, t.options, !0), l;
|
|
685
685
|
}
|
|
686
686
|
const a = Y(t);
|
|
687
|
-
if (a instanceof Map &&
|
|
687
|
+
if (a instanceof Map && Us.includes(e)) {
|
|
688
688
|
if (e === "size")
|
|
689
689
|
return Object.getOwnPropertyDescriptor(ct, "size").get.call(t.proxy);
|
|
690
690
|
const l = ct[e];
|
|
691
691
|
if (l)
|
|
692
692
|
return l.bind(t.proxy);
|
|
693
693
|
}
|
|
694
|
-
if (a instanceof Set &&
|
|
694
|
+
if (a instanceof Set && Bs.includes(e)) {
|
|
695
695
|
if (e === "size")
|
|
696
696
|
return Object.getOwnPropertyDescriptor(lt, "size").get.call(t.proxy);
|
|
697
697
|
const l = lt[e];
|
|
@@ -706,7 +706,7 @@ const ze = (t, e, n = !1) => {
|
|
|
706
706
|
) : void 0;
|
|
707
707
|
}
|
|
708
708
|
const u = a[e];
|
|
709
|
-
if (t.options.strict && ze(u, t.options), t.finalized || !
|
|
709
|
+
if (t.options.strict && ze(u, t.options), t.finalized || !ne(u, t.options))
|
|
710
710
|
return u;
|
|
711
711
|
if (u === et(t.original, e)) {
|
|
712
712
|
if (q(t), t.copy[e] = vt({
|
|
@@ -723,8 +723,8 @@ const ze = (t, e, n = !1) => {
|
|
|
723
723
|
}
|
|
724
724
|
return u;
|
|
725
725
|
},
|
|
726
|
-
set(t, e,
|
|
727
|
-
var
|
|
726
|
+
set(t, e, s) {
|
|
727
|
+
var n;
|
|
728
728
|
if (t.type === 3 || t.type === 2)
|
|
729
729
|
throw new Error("Map/Set draft does not support any property assignment.");
|
|
730
730
|
let i;
|
|
@@ -732,9 +732,9 @@ const ze = (t, e, n = !1) => {
|
|
|
732
732
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
733
733
|
const o = Pt(Y(t), e);
|
|
734
734
|
if (o != null && o.set)
|
|
735
|
-
return o.set.call(t.proxy,
|
|
735
|
+
return o.set.call(t.proxy, s), !0;
|
|
736
736
|
const r = et(Y(t), e), a = P(r);
|
|
737
|
-
return a && fe(a.original,
|
|
737
|
+
return a && fe(a.original, s) ? (t.copy[e] = s, t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (fe(s, r) && (s !== void 0 || Ie(t.original, e)) || (q(t), ue(t), Ie(t.original, e) && fe(s, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = s, wt(t, e, s, $e)), !0);
|
|
738
738
|
},
|
|
739
739
|
has(t, e) {
|
|
740
740
|
return e in Y(t);
|
|
@@ -743,12 +743,12 @@ const ze = (t, e, n = !1) => {
|
|
|
743
743
|
return Reflect.ownKeys(Y(t));
|
|
744
744
|
},
|
|
745
745
|
getOwnPropertyDescriptor(t, e) {
|
|
746
|
-
const
|
|
747
|
-
return
|
|
746
|
+
const s = Y(t), n = Reflect.getOwnPropertyDescriptor(s, e);
|
|
747
|
+
return n && {
|
|
748
748
|
writable: !0,
|
|
749
749
|
configurable: t.type !== 1 || e !== "length",
|
|
750
|
-
enumerable:
|
|
751
|
-
value:
|
|
750
|
+
enumerable: n.enumerable,
|
|
751
|
+
value: s[e]
|
|
752
752
|
};
|
|
753
753
|
},
|
|
754
754
|
getPrototypeOf(t) {
|
|
@@ -761,15 +761,15 @@ const ze = (t, e, n = !1) => {
|
|
|
761
761
|
throw new Error("Cannot call 'defineProperty()' on drafts");
|
|
762
762
|
},
|
|
763
763
|
deleteProperty(t, e) {
|
|
764
|
-
var
|
|
765
|
-
return t.type === 1 ? Zt.set.call(this, t, e, void 0, t.proxy) : (et(t.original, e) !== void 0 || e in t.original ? (q(t), ue(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (
|
|
764
|
+
var s;
|
|
765
|
+
return t.type === 1 ? Zt.set.call(this, t, e, void 0, t.proxy) : (et(t.original, e) !== void 0 || e in t.original ? (q(t), ue(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
|
|
766
766
|
}
|
|
767
767
|
};
|
|
768
768
|
function vt(t) {
|
|
769
|
-
const { original: e, parentDraft:
|
|
769
|
+
const { original: e, parentDraft: s, key: n, finalities: i, options: o } = t, r = we(e), a = {
|
|
770
770
|
type: r,
|
|
771
771
|
finalized: !1,
|
|
772
|
-
parent:
|
|
772
|
+
parent: s,
|
|
773
773
|
original: e,
|
|
774
774
|
copy: null,
|
|
775
775
|
proxy: null,
|
|
@@ -778,18 +778,18 @@ function vt(t) {
|
|
|
778
778
|
// Mapping of draft Set items to their corresponding draft values.
|
|
779
779
|
setMap: r === 3 ? new Map(e.entries()) : void 0
|
|
780
780
|
};
|
|
781
|
-
(
|
|
781
|
+
(n || "key" in t) && (a.key = n);
|
|
782
782
|
const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, Zt);
|
|
783
|
-
if (i.revoke.push(l), Yt.add(u), a.proxy = u,
|
|
784
|
-
const c =
|
|
783
|
+
if (i.revoke.push(l), Yt.add(u), a.proxy = u, s) {
|
|
784
|
+
const c = s;
|
|
785
785
|
c.finalities.draft.push((d, _) => {
|
|
786
786
|
var v, m;
|
|
787
787
|
const S = P(u);
|
|
788
788
|
let w = c.type === 3 ? c.setMap : c.copy;
|
|
789
|
-
const
|
|
789
|
+
const x = pe(w, n), b = P(x);
|
|
790
790
|
if (b) {
|
|
791
791
|
let A = b.original;
|
|
792
|
-
b.operated && (A = _t(
|
|
792
|
+
b.operated && (A = _t(x)), at(b), ut(b, $e, d, _), c.options.enableAutoFreeze && (c.options.updatedValues = (v = c.options.updatedValues) !== null && v !== void 0 ? v : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, b.original)), Te(w, n, A);
|
|
793
793
|
}
|
|
794
794
|
(m = S.callbacks) === null || m === void 0 || m.forEach((A) => {
|
|
795
795
|
A(d, _);
|
|
@@ -804,45 +804,45 @@ function vt(t) {
|
|
|
804
804
|
return u;
|
|
805
805
|
}
|
|
806
806
|
gt.createDraft = vt;
|
|
807
|
-
function
|
|
807
|
+
function Fs(t, e, s, n, i) {
|
|
808
808
|
var o;
|
|
809
809
|
const r = P(t), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : t, u = !!e.length;
|
|
810
810
|
if (r != null && r.operated)
|
|
811
811
|
for (; r.finalities.draft.length > 0; )
|
|
812
|
-
r.finalities.draft.pop()(
|
|
812
|
+
r.finalities.draft.pop()(s, n);
|
|
813
813
|
const l = u ? e[0] : r ? r.operated ? r.copy : r.original : t;
|
|
814
|
-
return r && ot(r), i &&
|
|
814
|
+
return r && ot(r), i && Oe(l, l, r == null ? void 0 : r.options.updatedValues), [
|
|
815
815
|
l,
|
|
816
|
-
|
|
817
|
-
|
|
816
|
+
s && u ? [{ op: J.Replace, path: [], value: e[0] }] : s,
|
|
817
|
+
n && u ? [{ op: J.Replace, path: [], value: a }] : n
|
|
818
818
|
];
|
|
819
819
|
}
|
|
820
|
-
function
|
|
821
|
-
var
|
|
822
|
-
const
|
|
820
|
+
function zs(t, e) {
|
|
821
|
+
var s;
|
|
822
|
+
const n = {
|
|
823
823
|
draft: [],
|
|
824
824
|
revoke: [],
|
|
825
825
|
handledSet: /* @__PURE__ */ new WeakSet()
|
|
826
826
|
};
|
|
827
827
|
let i, o;
|
|
828
828
|
e.enablePatches && (i = [], o = []);
|
|
829
|
-
const a = ((
|
|
829
|
+
const a = ((s = e.mark) === null || s === void 0 ? void 0 : s.call(e, t, Z)) === Z.mutable || !ne(t, e) ? t : vt({
|
|
830
830
|
original: t,
|
|
831
831
|
parentDraft: null,
|
|
832
|
-
finalities:
|
|
832
|
+
finalities: n,
|
|
833
833
|
options: e
|
|
834
834
|
});
|
|
835
835
|
return [
|
|
836
836
|
a,
|
|
837
837
|
(u = []) => {
|
|
838
|
-
const [l, c, d] =
|
|
838
|
+
const [l, c, d] = Fs(a, u, i, o, e.enableAutoFreeze);
|
|
839
839
|
return e.enablePatches ? [l, c, d] : l;
|
|
840
840
|
}
|
|
841
841
|
];
|
|
842
842
|
}
|
|
843
843
|
function ft(t) {
|
|
844
|
-
const { rootDraft: e, value:
|
|
845
|
-
bt(
|
|
844
|
+
const { rootDraft: e, value: s, useRawReturn: n = !1, isRoot: i = !0 } = t;
|
|
845
|
+
bt(s, (o, r, a) => {
|
|
846
846
|
const u = P(r);
|
|
847
847
|
if (u && e && u.finalities === e.finalities) {
|
|
848
848
|
t.isContainDraft = !0;
|
|
@@ -854,18 +854,18 @@ function ft(t) {
|
|
|
854
854
|
Te(a, o, l);
|
|
855
855
|
} else
|
|
856
856
|
typeof r == "object" && r !== null && (t.value = r, t.isRoot = !1, ft(t));
|
|
857
|
-
}), i && (t.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."),
|
|
857
|
+
}), i && (t.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), n && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function es(t) {
|
|
860
860
|
const e = P(t);
|
|
861
|
-
if (!
|
|
861
|
+
if (!ne(t, e == null ? void 0 : e.options))
|
|
862
862
|
return t;
|
|
863
|
-
const
|
|
863
|
+
const s = we(t);
|
|
864
864
|
if (e && !e.operated)
|
|
865
865
|
return e.original;
|
|
866
|
-
let
|
|
866
|
+
let n;
|
|
867
867
|
function i() {
|
|
868
|
-
|
|
868
|
+
n = s === 2 ? new Map(t) : s === 3 ? Array.from(e.setMap.values()) : qt(t, e == null ? void 0 : e.options);
|
|
869
869
|
}
|
|
870
870
|
if (e) {
|
|
871
871
|
e.finalized = !0;
|
|
@@ -875,38 +875,38 @@ function en(t) {
|
|
|
875
875
|
e.finalized = !1;
|
|
876
876
|
}
|
|
877
877
|
} else
|
|
878
|
-
|
|
879
|
-
return bt(
|
|
878
|
+
n = t;
|
|
879
|
+
return bt(n, (o, r) => {
|
|
880
880
|
if (e && fe(pe(e.original, o), r))
|
|
881
881
|
return;
|
|
882
|
-
const a =
|
|
883
|
-
a !== r && (
|
|
884
|
-
}),
|
|
882
|
+
const a = es(r);
|
|
883
|
+
a !== r && (n === t && i(), Te(n, o, a));
|
|
884
|
+
}), s === 3 ? new Set(n) : n;
|
|
885
885
|
}
|
|
886
886
|
function Ht(t) {
|
|
887
887
|
if (!be(t))
|
|
888
888
|
throw new Error(`current() is only used for Draft, parameter: ${t}`);
|
|
889
|
-
return
|
|
889
|
+
return es(t);
|
|
890
890
|
}
|
|
891
|
-
const
|
|
891
|
+
const Js = (t) => {
|
|
892
892
|
if (t !== void 0 && Object.prototype.toString.call(t) !== "[object Object]")
|
|
893
893
|
throw new Error(`Invalid options: ${String(t)}, 'options' should be an object.`);
|
|
894
|
-
return function e(
|
|
894
|
+
return function e(s, n, i) {
|
|
895
895
|
var o, r, a;
|
|
896
|
-
if (typeof
|
|
897
|
-
return function(
|
|
898
|
-
return e(
|
|
896
|
+
if (typeof s == "function" && typeof n != "function")
|
|
897
|
+
return function(O, ...H) {
|
|
898
|
+
return e(O, (R) => s.call(this, R, ...H), n);
|
|
899
899
|
};
|
|
900
|
-
const u =
|
|
900
|
+
const u = s, l = n;
|
|
901
901
|
let c = i;
|
|
902
|
-
if (typeof
|
|
902
|
+
if (typeof n != "function" && (c = n), 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({}, t), c);
|
|
905
|
-
const d = be(u) ? Ht(u) : u, _ = Array.isArray(c.mark) ? (
|
|
906
|
-
for (const
|
|
907
|
-
if (typeof
|
|
908
|
-
throw new Error(`Invalid mark: ${
|
|
909
|
-
const L = O
|
|
905
|
+
const d = be(u) ? Ht(u) : u, _ = Array.isArray(c.mark) ? (O, H) => {
|
|
906
|
+
for (const R of c.mark) {
|
|
907
|
+
if (typeof R != "function")
|
|
908
|
+
throw new Error(`Invalid mark: ${R}, 'mark' should be a function.`);
|
|
909
|
+
const L = R(O, H);
|
|
910
910
|
if (L)
|
|
911
911
|
return L;
|
|
912
912
|
}
|
|
@@ -916,63 +916,63 @@ const Gn = (t) => {
|
|
|
916
916
|
strict: m,
|
|
917
917
|
enablePatches: v
|
|
918
918
|
};
|
|
919
|
-
if (!
|
|
919
|
+
if (!ne(d, w) && 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 [
|
|
922
|
-
if (typeof
|
|
923
|
-
if (!
|
|
921
|
+
const [x, b] = zs(d, w);
|
|
922
|
+
if (typeof n != "function") {
|
|
923
|
+
if (!ne(d, w))
|
|
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
|
-
return [
|
|
925
|
+
return [x, b];
|
|
926
926
|
}
|
|
927
927
|
let A;
|
|
928
928
|
try {
|
|
929
|
-
A = l(
|
|
930
|
-
} catch (
|
|
931
|
-
throw ot(P(
|
|
932
|
-
}
|
|
933
|
-
const E = (
|
|
934
|
-
const H = P(
|
|
935
|
-
if (!be(
|
|
936
|
-
if (
|
|
929
|
+
A = l(x);
|
|
930
|
+
} catch (O) {
|
|
931
|
+
throw ot(P(x)), O;
|
|
932
|
+
}
|
|
933
|
+
const E = (O) => {
|
|
934
|
+
const H = P(x);
|
|
935
|
+
if (!be(O)) {
|
|
936
|
+
if (O !== void 0 && !fe(O, x) && (H != null && H.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 =
|
|
938
|
+
const L = O == null ? void 0 : O[xs];
|
|
939
939
|
if (L) {
|
|
940
940
|
const U = L[0];
|
|
941
|
-
return w.strict && typeof
|
|
941
|
+
return w.strict && typeof O == "object" && O !== null && ft({
|
|
942
942
|
rootDraft: H,
|
|
943
|
-
value:
|
|
943
|
+
value: O,
|
|
944
944
|
useRawReturn: !0
|
|
945
945
|
}), b([U]);
|
|
946
946
|
}
|
|
947
|
-
if (
|
|
948
|
-
return typeof
|
|
947
|
+
if (O !== void 0)
|
|
948
|
+
return typeof O == "object" && O !== null && ft({ rootDraft: H, value: O }), b([O]);
|
|
949
949
|
}
|
|
950
|
-
if (
|
|
950
|
+
if (O === x || O === void 0)
|
|
951
951
|
return b([]);
|
|
952
|
-
const
|
|
953
|
-
if (w ===
|
|
954
|
-
if (
|
|
952
|
+
const R = P(O);
|
|
953
|
+
if (w === R.options) {
|
|
954
|
+
if (R.operated)
|
|
955
955
|
throw new Error("Cannot return a modified child draft.");
|
|
956
|
-
return b([Ht(
|
|
956
|
+
return b([Ht(O)]);
|
|
957
957
|
}
|
|
958
|
-
return b([
|
|
958
|
+
return b([O]);
|
|
959
959
|
};
|
|
960
|
-
return A instanceof Promise ? A.then(E, (
|
|
961
|
-
throw ot(P(
|
|
960
|
+
return A instanceof Promise ? A.then(E, (O) => {
|
|
961
|
+
throw ot(P(x)), O;
|
|
962
962
|
}) : E(A);
|
|
963
963
|
};
|
|
964
|
-
}, C =
|
|
964
|
+
}, C = Js();
|
|
965
965
|
Object.prototype.constructor.toString();
|
|
966
|
-
const
|
|
966
|
+
const Gs = yt(fetch), ts = async (t, e) => {
|
|
967
967
|
if (!t)
|
|
968
968
|
throw "Metapage definition null";
|
|
969
|
-
if (t.version || (t = C(t, (
|
|
970
|
-
|
|
969
|
+
if (t.version || (t = C(t, (n) => {
|
|
970
|
+
n.version = "0.3";
|
|
971
971
|
})), !e)
|
|
972
972
|
throw 'Missing "version" argument';
|
|
973
973
|
if (j(e, Le) > 0)
|
|
974
974
|
try {
|
|
975
|
-
return await (await
|
|
975
|
+
return await (await Gs(`https://module.metapage.io/conversion/metapage/v${e}`, {
|
|
976
976
|
redirect: "follow",
|
|
977
977
|
retries: 3,
|
|
978
978
|
retryDelay: 1e3,
|
|
@@ -982,59 +982,59 @@ const Vn = yt(fetch), tn = async (t, e) => {
|
|
|
982
982
|
"Content-Type": "application/json"
|
|
983
983
|
}
|
|
984
984
|
})).json();
|
|
985
|
-
} catch (
|
|
986
|
-
throw `Error converting metapage definition to version ${e}: ${
|
|
985
|
+
} catch (n) {
|
|
986
|
+
throw `Error converting metapage definition to version ${e}: ${n}`;
|
|
987
987
|
}
|
|
988
|
-
return
|
|
989
|
-
},
|
|
988
|
+
return Ws(t, e);
|
|
989
|
+
}, Vs = async (t) => ts(t, Le), Ws = (t, e) => {
|
|
990
990
|
if (!t)
|
|
991
991
|
throw "Metapage definition null";
|
|
992
992
|
if (!t.version)
|
|
993
993
|
throw `Missing "version" key in metapage definition: ${JSON.stringify(t)}`;
|
|
994
|
-
let
|
|
995
|
-
if (
|
|
994
|
+
let s = he(t.version);
|
|
995
|
+
if (s === e)
|
|
996
996
|
return t;
|
|
997
|
-
let
|
|
998
|
-
for (;
|
|
999
|
-
switch (
|
|
997
|
+
let n = t;
|
|
998
|
+
for (; s !== e; )
|
|
999
|
+
switch (s) {
|
|
1000
1000
|
case "0.2": {
|
|
1001
|
-
if (j(e,
|
|
1002
|
-
|
|
1001
|
+
if (j(e, s) > 0)
|
|
1002
|
+
n = Ks(n), s = he(n.version);
|
|
1003
1003
|
else
|
|
1004
|
-
throw `Cannot convert from version ${
|
|
1004
|
+
throw `Cannot convert from version ${s} to ${e}`;
|
|
1005
1005
|
break;
|
|
1006
1006
|
}
|
|
1007
1007
|
case "0.3": {
|
|
1008
|
-
j(e,
|
|
1008
|
+
j(e, s) > 0 ? (n = qs(n), s = he(n.version)) : (n = Xs(n), s = he(n.version));
|
|
1009
1009
|
break;
|
|
1010
1010
|
}
|
|
1011
1011
|
case "1": {
|
|
1012
|
-
j(e,
|
|
1012
|
+
j(e, s) > 0 ? (n = Zs(n), s = he(n.version)) : (n = Qs(n), s = he(n.version));
|
|
1013
1013
|
break;
|
|
1014
1014
|
}
|
|
1015
1015
|
case "2": {
|
|
1016
|
-
if (j(e,
|
|
1017
|
-
throw `Cannot convert from version ${
|
|
1018
|
-
|
|
1016
|
+
if (j(e, s) > 0)
|
|
1017
|
+
throw `Cannot convert from version ${s} to ${e}, 1 is the latest version`;
|
|
1018
|
+
n = Ys(n), s = he(n.version);
|
|
1019
1019
|
break;
|
|
1020
1020
|
}
|
|
1021
1021
|
default:
|
|
1022
|
-
throw `Unknow version ${
|
|
1022
|
+
throw `Unknow version ${s} to ${e}`;
|
|
1023
1023
|
}
|
|
1024
|
-
return
|
|
1025
|
-
},
|
|
1024
|
+
return n;
|
|
1025
|
+
}, Ks = (t) => C(t, (e) => {
|
|
1026
1026
|
e.version = "0.3";
|
|
1027
|
-
}),
|
|
1027
|
+
}), Xs = (t) => C(t, (e) => {
|
|
1028
1028
|
e.version = "0.2";
|
|
1029
|
-
}),
|
|
1030
|
-
const
|
|
1031
|
-
delete
|
|
1032
|
-
}),
|
|
1033
|
-
var
|
|
1034
|
-
return e.version = "1", (
|
|
1035
|
-
}),
|
|
1036
|
-
var
|
|
1037
|
-
return e.version = "2", (
|
|
1029
|
+
}), qs = (t) => C(t, (e) => {
|
|
1030
|
+
const s = e;
|
|
1031
|
+
delete s.plugins, s.version = "1";
|
|
1032
|
+
}), Qs = (t) => C(t, (e) => (e.version = "0.3", e)), Ys = (t) => C(t, (e) => {
|
|
1033
|
+
var s, n;
|
|
1034
|
+
return e.version = "1", (s = e == null ? void 0 : e.meta) != null && s.tags && (e.meta.keywords = e.meta.tags, delete e.meta.tags), (n = e == null ? void 0 : e.meta) != null && n.authors && (e.meta.author = e.meta.authors[0], delete e.meta.authors), e;
|
|
1035
|
+
}), Zs = (t) => C(t, (e) => {
|
|
1036
|
+
var s, n;
|
|
1037
|
+
return e.version = "2", (s = e == null ? void 0 : e.meta) != null && s.keywords && (e.meta.tags = e.meta.keywords, delete e.meta.keywords), (n = e == null ? void 0 : e.meta) != null && n.author && (e.meta.authors = [e.meta.author], delete e.meta.author), e;
|
|
1038
1038
|
}), he = (t) => {
|
|
1039
1039
|
if (t === "latest")
|
|
1040
1040
|
return Le;
|
|
@@ -1049,7 +1049,7 @@ const Vn = yt(fetch), tn = async (t, e) => {
|
|
|
1049
1049
|
if (t === "2")
|
|
1050
1050
|
return "2";
|
|
1051
1051
|
throw `Unknown version: ${t}`;
|
|
1052
|
-
},
|
|
1052
|
+
}, en = yt(fetch), ss = async (t, e) => {
|
|
1053
1053
|
if (!t)
|
|
1054
1054
|
throw "Metaframe definition null";
|
|
1055
1055
|
if (!t.version)
|
|
@@ -1058,7 +1058,7 @@ const Vn = yt(fetch), tn = async (t, e) => {
|
|
|
1058
1058
|
throw 'Missing "version" argument';
|
|
1059
1059
|
if (j(e, We) > 0)
|
|
1060
1060
|
try {
|
|
1061
|
-
return await (await
|
|
1061
|
+
return await (await en(`https://module.metapage.io/conversion/metaframe/v${e}`, {
|
|
1062
1062
|
redirect: "follow",
|
|
1063
1063
|
retries: 3,
|
|
1064
1064
|
retryDelay: 1e3,
|
|
@@ -1068,100 +1068,100 @@ const Vn = yt(fetch), tn = async (t, e) => {
|
|
|
1068
1068
|
"Content-Type": "application/json"
|
|
1069
1069
|
}
|
|
1070
1070
|
})).json();
|
|
1071
|
-
} catch (
|
|
1072
|
-
throw `Error converting metapage definition to version ${e}: ${
|
|
1071
|
+
} catch (n) {
|
|
1072
|
+
throw `Error converting metapage definition to version ${e}: ${n}`;
|
|
1073
1073
|
}
|
|
1074
|
-
return
|
|
1075
|
-
},
|
|
1074
|
+
return sn(t, e);
|
|
1075
|
+
}, tn = async (t) => ss(t, We), sn = (t, e) => {
|
|
1076
1076
|
if (!t)
|
|
1077
1077
|
throw "Metaframe definition null";
|
|
1078
1078
|
t.version || (t = C(t, (i) => {
|
|
1079
1079
|
i.version = "0.3";
|
|
1080
1080
|
}));
|
|
1081
|
-
let
|
|
1082
|
-
if (
|
|
1081
|
+
let s = te(t.version);
|
|
1082
|
+
if (s === e)
|
|
1083
1083
|
return t;
|
|
1084
|
-
let
|
|
1085
|
-
for (;
|
|
1086
|
-
switch (
|
|
1084
|
+
let n = t;
|
|
1085
|
+
for (; s !== e; )
|
|
1086
|
+
switch (s) {
|
|
1087
1087
|
case "0.3": {
|
|
1088
|
-
if (j(e,
|
|
1089
|
-
|
|
1088
|
+
if (j(e, s) > 0)
|
|
1089
|
+
n = rn(n), s = te(n.version);
|
|
1090
1090
|
else
|
|
1091
|
-
throw `Cannot convert from version ${
|
|
1091
|
+
throw `Cannot convert from version ${s} to ${e}`;
|
|
1092
1092
|
break;
|
|
1093
1093
|
}
|
|
1094
1094
|
case "0.4": {
|
|
1095
|
-
j(e,
|
|
1095
|
+
j(e, s) > 0 ? (n = on(n), s = te(n.version)) : (n = nn(n), s = te(n.version));
|
|
1096
1096
|
break;
|
|
1097
1097
|
}
|
|
1098
1098
|
case "0.5": {
|
|
1099
|
-
j(e,
|
|
1099
|
+
j(e, s) > 0 ? (n = pn(n), s = te(n.version)) : (n = an(n), s = te(n.version));
|
|
1100
1100
|
break;
|
|
1101
1101
|
}
|
|
1102
1102
|
case "0.6": {
|
|
1103
|
-
j(e,
|
|
1103
|
+
j(e, s) > 0 ? (n = un(n), s = te(n.version)) : (n = hn(n), s = te(n.version));
|
|
1104
1104
|
break;
|
|
1105
1105
|
}
|
|
1106
1106
|
case "1": {
|
|
1107
|
-
j(e,
|
|
1107
|
+
j(e, s) > 0 ? (n = fn(n), s = te(n.version)) : (n = cn(n), s = te(n.version));
|
|
1108
1108
|
break;
|
|
1109
1109
|
}
|
|
1110
1110
|
case "2": {
|
|
1111
|
-
if (j(e,
|
|
1112
|
-
throw `Cannot convert from version ${
|
|
1113
|
-
|
|
1111
|
+
if (j(e, s) > 0)
|
|
1112
|
+
throw `Cannot convert from version ${s} to ${e}`;
|
|
1113
|
+
n = ln(n), s = te(n.version);
|
|
1114
1114
|
break;
|
|
1115
1115
|
}
|
|
1116
1116
|
default:
|
|
1117
|
-
throw `Unknow version ${
|
|
1117
|
+
throw `Unknow version ${s} to ${e}`;
|
|
1118
1118
|
}
|
|
1119
|
-
return
|
|
1119
|
+
return n;
|
|
1120
1120
|
}, pt = async (t, e) => {
|
|
1121
1121
|
if (t)
|
|
1122
|
-
return
|
|
1123
|
-
},
|
|
1122
|
+
return tn(t);
|
|
1123
|
+
}, nn = (t) => C(t, (e) => {
|
|
1124
1124
|
e.version = "0.3", delete e.allow;
|
|
1125
|
-
}),
|
|
1125
|
+
}), rn = (t) => C(t, (e) => {
|
|
1126
1126
|
e.version = "0.4";
|
|
1127
|
-
}),
|
|
1127
|
+
}), on = (t) => C(t, (e) => {
|
|
1128
1128
|
if (e.version = "0.5", !(e != null && e.metadata))
|
|
1129
1129
|
return;
|
|
1130
|
-
const
|
|
1131
|
-
delete e.metadata.title, e.metadata.name =
|
|
1132
|
-
const
|
|
1133
|
-
delete e.metadata.descriptionUrl, e.metadata.description =
|
|
1130
|
+
const s = e.metadata.title;
|
|
1131
|
+
delete e.metadata.title, e.metadata.name = s;
|
|
1132
|
+
const n = e.metadata.descriptionUrl;
|
|
1133
|
+
delete e.metadata.descriptionUrl, e.metadata.description = n;
|
|
1134
1134
|
const i = e.metadata.keywords;
|
|
1135
1135
|
delete e.metadata.keywords, e.metadata.tags = i;
|
|
1136
|
-
}),
|
|
1136
|
+
}), an = (t) => C(t, (e) => {
|
|
1137
1137
|
if (e.version = "0.4", !(e != null && e.metadata))
|
|
1138
1138
|
return;
|
|
1139
|
-
const
|
|
1140
|
-
delete e.metadata.name, e.metadata.title =
|
|
1141
|
-
const
|
|
1142
|
-
delete e.metadata.description, e.metadata.descriptionUrl =
|
|
1139
|
+
const s = e.metadata.name;
|
|
1140
|
+
delete e.metadata.name, e.metadata.title = s;
|
|
1141
|
+
const n = e.metadata.description;
|
|
1142
|
+
delete e.metadata.description, e.metadata.descriptionUrl = n;
|
|
1143
1143
|
const i = e.metadata.tags;
|
|
1144
1144
|
delete e.metadata.tags, e.metadata.keywords = i;
|
|
1145
|
-
}),
|
|
1146
|
-
var
|
|
1147
|
-
e.version = "1", (
|
|
1148
|
-
}),
|
|
1149
|
-
var
|
|
1150
|
-
e.version = "0.6", (
|
|
1151
|
-
}),
|
|
1152
|
-
var
|
|
1153
|
-
return e.version = "1", (
|
|
1154
|
-
}),
|
|
1155
|
-
var
|
|
1156
|
-
return e.version = "2", (
|
|
1145
|
+
}), un = (t) => C(t, (e) => {
|
|
1146
|
+
var s;
|
|
1147
|
+
e.version = "1", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
|
|
1148
|
+
}), cn = (t) => C(t, (e) => {
|
|
1149
|
+
var s;
|
|
1150
|
+
e.version = "0.6", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
|
|
1151
|
+
}), ln = (t) => C(t, (e) => {
|
|
1152
|
+
var s, n;
|
|
1153
|
+
return e.version = "1", (s = e == null ? void 0 : e.metadata) != null && s.authors && (e.metadata.author = (n = e == null ? void 0 : e.metadata) == null ? void 0 : n.authors[0], delete e.metadata.authors), e;
|
|
1154
|
+
}), fn = (t) => C(t, (e) => {
|
|
1155
|
+
var s;
|
|
1156
|
+
return e.version = "2", (s = e == null ? void 0 : e.metadata) != null && s.author && (e.metadata.authors = [
|
|
1157
1157
|
e.metadata.author
|
|
1158
1158
|
], delete e.metadata.author), e;
|
|
1159
|
-
}),
|
|
1160
|
-
var
|
|
1161
|
-
e.version = "0.6", (
|
|
1162
|
-
}),
|
|
1163
|
-
var
|
|
1164
|
-
e.version = "0.5", (
|
|
1159
|
+
}), pn = (t) => C(t, (e) => {
|
|
1160
|
+
var s;
|
|
1161
|
+
e.version = "0.6", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
|
|
1162
|
+
}), hn = (t) => C(t, (e) => {
|
|
1163
|
+
var s;
|
|
1164
|
+
e.version = "0.5", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
|
|
1165
1165
|
}), te = (t) => {
|
|
1166
1166
|
if (t === "latest")
|
|
1167
1167
|
return We;
|
|
@@ -1181,58 +1181,58 @@ const Vn = yt(fetch), tn = async (t, e) => {
|
|
|
1181
1181
|
return "2";
|
|
1182
1182
|
throw `Unknown version: ${t}`;
|
|
1183
1183
|
};
|
|
1184
|
-
var
|
|
1185
|
-
for (var je = 0; je <
|
|
1186
|
-
Ee[
|
|
1184
|
+
var Re = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ee = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
1185
|
+
for (var je = 0; je < Re.length; je++)
|
|
1186
|
+
Ee[Re.charCodeAt(je)] = je;
|
|
1187
1187
|
var Ue = function(t) {
|
|
1188
|
-
var e = new Uint8Array(t),
|
|
1189
|
-
for (
|
|
1190
|
-
i +=
|
|
1191
|
-
return
|
|
1188
|
+
var e = new Uint8Array(t), s, n = e.length, i = "";
|
|
1189
|
+
for (s = 0; s < n; s += 3)
|
|
1190
|
+
i += Re[e[s] >> 2], i += Re[(e[s] & 3) << 4 | e[s + 1] >> 4], i += Re[(e[s + 1] & 15) << 2 | e[s + 2] >> 6], i += Re[e[s + 2] & 63];
|
|
1191
|
+
return n % 3 === 2 ? i = i.substring(0, i.length - 1) + "=" : n % 3 === 1 && (i = i.substring(0, i.length - 2) + "=="), i;
|
|
1192
1192
|
}, de = function(t) {
|
|
1193
|
-
var e = t.length * 0.75,
|
|
1193
|
+
var e = t.length * 0.75, s = t.length, n, i = 0, o, r, a, u;
|
|
1194
1194
|
t[t.length - 1] === "=" && (e--, t[t.length - 2] === "=" && e--);
|
|
1195
1195
|
var l = new ArrayBuffer(e), c = new Uint8Array(l);
|
|
1196
|
-
for (
|
|
1197
|
-
o = Ee[t.charCodeAt(
|
|
1196
|
+
for (n = 0; n < s; n += 4)
|
|
1197
|
+
o = Ee[t.charCodeAt(n)], r = Ee[t.charCodeAt(n + 1)], a = Ee[t.charCodeAt(n + 2)], u = Ee[t.charCodeAt(n + 3)], c[i++] = o << 2 | r >> 4, c[i++] = (r & 15) << 4 | a >> 2, c[i++] = (a & 3) << 6 | u & 63;
|
|
1198
1198
|
return l;
|
|
1199
1199
|
};
|
|
1200
1200
|
const Ke = async (t) => C(t, async (e) => {
|
|
1201
|
-
for (const
|
|
1202
|
-
const
|
|
1203
|
-
return e[
|
|
1201
|
+
for (const s of Object.keys(t)) {
|
|
1202
|
+
const n = await dn(t[s]);
|
|
1203
|
+
return e[s] = n, e;
|
|
1204
1204
|
}
|
|
1205
1205
|
}), Ce = async (t) => C(t, async (e) => {
|
|
1206
|
-
for (const
|
|
1207
|
-
const
|
|
1208
|
-
return e[
|
|
1206
|
+
for (const s of Object.keys(t)) {
|
|
1207
|
+
const n = await ns(t[s]);
|
|
1208
|
+
return e[s] = n, e;
|
|
1209
1209
|
}
|
|
1210
|
-
}), $i = async (t, e,
|
|
1211
|
-
if (t =
|
|
1212
|
-
return new File([t], e,
|
|
1210
|
+
}), $i = async (t, e, s) => {
|
|
1211
|
+
if (t = ns(t), s = s || {}, s.type || (s.type = "application/octet-stream"), t instanceof ArrayBuffer)
|
|
1212
|
+
return new File([t], e, s);
|
|
1213
1213
|
if (t instanceof File || t instanceof Blob) {
|
|
1214
1214
|
const i = await t.arrayBuffer();
|
|
1215
|
-
return t instanceof File && (
|
|
1215
|
+
return t instanceof File && (s.type = t.type), new File([i], e, s);
|
|
1216
1216
|
}
|
|
1217
1217
|
if (t instanceof Int8Array || t instanceof Uint8Array || t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array) {
|
|
1218
1218
|
const i = t;
|
|
1219
|
-
return new File([i.buffer], e,
|
|
1219
|
+
return new File([i.buffer], e, s);
|
|
1220
1220
|
}
|
|
1221
1221
|
if (typeof t == "string") {
|
|
1222
|
-
var
|
|
1223
|
-
return
|
|
1222
|
+
var n = new Blob([t], { type: "text/plain" });
|
|
1223
|
+
return s.type = "text/plain", new File([n], e, s);
|
|
1224
1224
|
}
|
|
1225
1225
|
if (typeof t == "object") {
|
|
1226
1226
|
const i = new Blob([JSON.stringify(t)], {
|
|
1227
1227
|
type: "application/json"
|
|
1228
1228
|
});
|
|
1229
|
-
return
|
|
1229
|
+
return s.type = "application/json", new File([i], e, s);
|
|
1230
1230
|
}
|
|
1231
|
-
var
|
|
1232
|
-
return
|
|
1233
|
-
},
|
|
1231
|
+
var n = new Blob([t], { type: "text/plain" });
|
|
1232
|
+
return s.type = "text/plain", new File([n], e, s);
|
|
1233
|
+
}, dn = async (t) => {
|
|
1234
1234
|
if (t instanceof Int8Array || t instanceof Uint8Array || t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array) {
|
|
1235
|
-
const e = t,
|
|
1235
|
+
const e = t, s = {
|
|
1236
1236
|
_s: !0,
|
|
1237
1237
|
_c: t.constructor.name,
|
|
1238
1238
|
value: Ue(e.buffer),
|
|
@@ -1240,55 +1240,55 @@ const Ke = async (t) => C(t, async (e) => {
|
|
|
1240
1240
|
byteOffset: e.byteOffset,
|
|
1241
1241
|
size: e.byteLength
|
|
1242
1242
|
};
|
|
1243
|
-
return Promise.resolve(
|
|
1243
|
+
return Promise.resolve(s);
|
|
1244
1244
|
} else if (t instanceof File) {
|
|
1245
|
-
const e = t,
|
|
1245
|
+
const e = t, s = await e.arrayBuffer();
|
|
1246
1246
|
return {
|
|
1247
1247
|
_s: !0,
|
|
1248
1248
|
_c: File.name,
|
|
1249
|
-
value: Ue(
|
|
1249
|
+
value: Ue(s),
|
|
1250
1250
|
name: e.name,
|
|
1251
1251
|
fileType: e.type,
|
|
1252
1252
|
lastModified: e.lastModified,
|
|
1253
|
-
size:
|
|
1253
|
+
size: s.byteLength
|
|
1254
1254
|
};
|
|
1255
1255
|
} else if (t instanceof Blob) {
|
|
1256
|
-
const e = t,
|
|
1256
|
+
const e = t, s = await e.arrayBuffer();
|
|
1257
1257
|
return {
|
|
1258
1258
|
_s: !0,
|
|
1259
1259
|
_c: Blob.name,
|
|
1260
|
-
value: Ue(
|
|
1260
|
+
value: Ue(s),
|
|
1261
1261
|
fileType: e.type,
|
|
1262
|
-
size:
|
|
1262
|
+
size: s.byteLength
|
|
1263
1263
|
};
|
|
1264
1264
|
} else if (t instanceof ArrayBuffer) {
|
|
1265
|
-
const e = t,
|
|
1265
|
+
const e = t, s = {
|
|
1266
1266
|
_s: !0,
|
|
1267
1267
|
_c: ArrayBuffer.name,
|
|
1268
1268
|
value: Ue(e),
|
|
1269
1269
|
size: e.byteLength
|
|
1270
1270
|
};
|
|
1271
|
-
return Promise.resolve(
|
|
1271
|
+
return Promise.resolve(s);
|
|
1272
1272
|
}
|
|
1273
1273
|
return Promise.resolve(t);
|
|
1274
|
-
},
|
|
1274
|
+
}, ns = (t) => {
|
|
1275
1275
|
if (!(t && typeof t == "object" && t._s === !0))
|
|
1276
1276
|
return t;
|
|
1277
|
-
const e = t,
|
|
1278
|
-
if (
|
|
1277
|
+
const e = t, s = e._c;
|
|
1278
|
+
if (s === Blob.name) {
|
|
1279
1279
|
const r = t;
|
|
1280
1280
|
return new Blob([de(e.value)], {
|
|
1281
1281
|
type: r.fileType
|
|
1282
1282
|
});
|
|
1283
|
-
} else if (
|
|
1283
|
+
} else if (s === File.name) {
|
|
1284
1284
|
const r = t;
|
|
1285
1285
|
return new File([de(e.value)], r.name, {
|
|
1286
1286
|
type: r.fileType,
|
|
1287
1287
|
lastModified: r.lastModified
|
|
1288
1288
|
});
|
|
1289
|
-
} else if (
|
|
1289
|
+
} else if (s === ArrayBuffer.name)
|
|
1290
1290
|
return de(e.value);
|
|
1291
|
-
const
|
|
1291
|
+
const n = t, i = de(n.value), o = n._c;
|
|
1292
1292
|
try {
|
|
1293
1293
|
return new globalThis[o](i);
|
|
1294
1294
|
} catch {
|
|
@@ -1297,27 +1297,27 @@ const Ke = async (t) => C(t, async (e) => {
|
|
|
1297
1297
|
}, xi = (t) => {
|
|
1298
1298
|
if (!(t && typeof t == "object" && t._s === !0))
|
|
1299
1299
|
return;
|
|
1300
|
-
const e = t,
|
|
1301
|
-
if (
|
|
1300
|
+
const e = t, s = e._c;
|
|
1301
|
+
if (s === Blob.name) {
|
|
1302
1302
|
const r = t, a = new Blob([de(e.value)], {
|
|
1303
1303
|
type: r.fileType
|
|
1304
1304
|
});
|
|
1305
1305
|
return new File([a], "file", {
|
|
1306
1306
|
type: a.type
|
|
1307
1307
|
});
|
|
1308
|
-
} else if (
|
|
1308
|
+
} else if (s === File.name) {
|
|
1309
1309
|
const r = t;
|
|
1310
1310
|
return new File([de(e.value)], r.name, {
|
|
1311
1311
|
type: r.fileType,
|
|
1312
1312
|
lastModified: r.lastModified
|
|
1313
1313
|
});
|
|
1314
|
-
} else if (
|
|
1314
|
+
} else if (s === ArrayBuffer.name) {
|
|
1315
1315
|
const r = de(e.value);
|
|
1316
1316
|
return new File([r], "file", {
|
|
1317
1317
|
type: "application/octet-stream"
|
|
1318
1318
|
});
|
|
1319
1319
|
}
|
|
1320
|
-
const
|
|
1320
|
+
const n = t, i = de(n.value), o = n._c;
|
|
1321
1321
|
try {
|
|
1322
1322
|
const r = new globalThis[o](i);
|
|
1323
1323
|
return new File([r], "file", {
|
|
@@ -1326,10 +1326,10 @@ const Ke = async (t) => C(t, async (e) => {
|
|
|
1326
1326
|
} catch {
|
|
1327
1327
|
}
|
|
1328
1328
|
};
|
|
1329
|
-
var
|
|
1329
|
+
var $;
|
|
1330
1330
|
(function(t) {
|
|
1331
1331
|
t.Inputs = "inputs", t.Outputs = "outputs", t.State = "state", t.Definition = "definition", t.Error = "error", t.Warning = "warning", t.UrlHashUpdate = "urlhashupdate", t.Message = "Message";
|
|
1332
|
-
})(
|
|
1332
|
+
})($ || ($ = {}));
|
|
1333
1333
|
var X;
|
|
1334
1334
|
(function(t) {
|
|
1335
1335
|
t.InputsUpdate = "InputsUpdate", t.OutputsUpdate = "OutputsUpdate", t.SetupIframeClientRequest = "SetupIframeClientRequest", t.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", t.HashParamsUpdate = "HashParamsUpdate";
|
|
@@ -1351,36 +1351,36 @@ function Hi(t) {
|
|
|
1351
1351
|
return !1;
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
|
-
var
|
|
1354
|
+
var is = { exports: {} };
|
|
1355
1355
|
(function(t) {
|
|
1356
|
-
var e = Object.prototype.hasOwnProperty,
|
|
1357
|
-
function
|
|
1356
|
+
var e = Object.prototype.hasOwnProperty, s = "~";
|
|
1357
|
+
function n() {
|
|
1358
1358
|
}
|
|
1359
|
-
Object.create && (
|
|
1359
|
+
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (s = !1));
|
|
1360
1360
|
function i(u, l, c) {
|
|
1361
1361
|
this.fn = u, this.context = l, this.once = c || !1;
|
|
1362
1362
|
}
|
|
1363
1363
|
function o(u, l, c, d, _) {
|
|
1364
1364
|
if (typeof c != "function")
|
|
1365
1365
|
throw new TypeError("The listener must be a function");
|
|
1366
|
-
var v = new i(c, d || u, _), m =
|
|
1366
|
+
var v = new i(c, d || u, _), m = s ? s + l : l;
|
|
1367
1367
|
return u._events[m] ? u._events[m].fn ? u._events[m] = [u._events[m], v] : u._events[m].push(v) : (u._events[m] = v, u._eventsCount++), u;
|
|
1368
1368
|
}
|
|
1369
1369
|
function r(u, l) {
|
|
1370
|
-
--u._eventsCount === 0 ? u._events = new
|
|
1370
|
+
--u._eventsCount === 0 ? u._events = new n() : delete u._events[l];
|
|
1371
1371
|
}
|
|
1372
1372
|
function a() {
|
|
1373
|
-
this._events = new
|
|
1373
|
+
this._events = new n(), this._eventsCount = 0;
|
|
1374
1374
|
}
|
|
1375
1375
|
a.prototype.eventNames = function() {
|
|
1376
1376
|
var l = [], c, d;
|
|
1377
1377
|
if (this._eventsCount === 0)
|
|
1378
1378
|
return l;
|
|
1379
1379
|
for (d in c = this._events)
|
|
1380
|
-
e.call(c, d) && l.push(
|
|
1380
|
+
e.call(c, d) && l.push(s ? d.slice(1) : d);
|
|
1381
1381
|
return Object.getOwnPropertySymbols ? l.concat(Object.getOwnPropertySymbols(c)) : l;
|
|
1382
1382
|
}, a.prototype.listeners = function(l) {
|
|
1383
|
-
var c =
|
|
1383
|
+
var c = s ? s + l : l, d = this._events[c];
|
|
1384
1384
|
if (!d)
|
|
1385
1385
|
return [];
|
|
1386
1386
|
if (d.fn)
|
|
@@ -1389,15 +1389,15 @@ var rn = { exports: {} };
|
|
|
1389
1389
|
m[_] = d[_].fn;
|
|
1390
1390
|
return m;
|
|
1391
1391
|
}, a.prototype.listenerCount = function(l) {
|
|
1392
|
-
var c =
|
|
1392
|
+
var c = s ? s + l : l, d = this._events[c];
|
|
1393
1393
|
return d ? d.fn ? 1 : d.length : 0;
|
|
1394
1394
|
}, a.prototype.emit = function(l, c, d, _, v, m) {
|
|
1395
|
-
var S =
|
|
1395
|
+
var S = s ? s + l : l;
|
|
1396
1396
|
if (!this._events[S])
|
|
1397
1397
|
return !1;
|
|
1398
|
-
var w = this._events[S],
|
|
1398
|
+
var w = this._events[S], x = arguments.length, b, A;
|
|
1399
1399
|
if (w.fn) {
|
|
1400
|
-
switch (w.once && this.removeListener(l, w.fn, void 0, !0),
|
|
1400
|
+
switch (w.once && this.removeListener(l, w.fn, void 0, !0), x) {
|
|
1401
1401
|
case 1:
|
|
1402
1402
|
return w.fn.call(w.context), !0;
|
|
1403
1403
|
case 2:
|
|
@@ -1411,13 +1411,13 @@ var rn = { exports: {} };
|
|
|
1411
1411
|
case 6:
|
|
1412
1412
|
return w.fn.call(w.context, c, d, _, v, m), !0;
|
|
1413
1413
|
}
|
|
1414
|
-
for (A = 1, b = new Array(
|
|
1414
|
+
for (A = 1, b = new Array(x - 1); A < x; A++)
|
|
1415
1415
|
b[A - 1] = arguments[A];
|
|
1416
1416
|
w.fn.apply(w.context, b);
|
|
1417
1417
|
} else {
|
|
1418
|
-
var E = w.length,
|
|
1418
|
+
var E = w.length, O;
|
|
1419
1419
|
for (A = 0; A < E; A++)
|
|
1420
|
-
switch (w[A].once && this.removeListener(l, w[A].fn, void 0, !0),
|
|
1420
|
+
switch (w[A].once && this.removeListener(l, w[A].fn, void 0, !0), x) {
|
|
1421
1421
|
case 1:
|
|
1422
1422
|
w[A].fn.call(w[A].context);
|
|
1423
1423
|
break;
|
|
@@ -1432,8 +1432,8 @@ var rn = { exports: {} };
|
|
|
1432
1432
|
break;
|
|
1433
1433
|
default:
|
|
1434
1434
|
if (!b)
|
|
1435
|
-
for (
|
|
1436
|
-
b[
|
|
1435
|
+
for (O = 1, b = new Array(x - 1); O < x; O++)
|
|
1436
|
+
b[O - 1] = arguments[O];
|
|
1437
1437
|
w[A].fn.apply(w[A].context, b);
|
|
1438
1438
|
}
|
|
1439
1439
|
}
|
|
@@ -1443,7 +1443,7 @@ var rn = { exports: {} };
|
|
|
1443
1443
|
}, a.prototype.once = function(l, c, d) {
|
|
1444
1444
|
return o(this, l, c, d, !0);
|
|
1445
1445
|
}, a.prototype.removeListener = function(l, c, d, _) {
|
|
1446
|
-
var v =
|
|
1446
|
+
var v = s ? s + l : l;
|
|
1447
1447
|
if (!this._events[v])
|
|
1448
1448
|
return this;
|
|
1449
1449
|
if (!c)
|
|
@@ -1452,23 +1452,23 @@ var rn = { exports: {} };
|
|
|
1452
1452
|
if (m.fn)
|
|
1453
1453
|
m.fn === c && (!_ || m.once) && (!d || m.context === d) && r(this, v);
|
|
1454
1454
|
else {
|
|
1455
|
-
for (var S = 0, w = [],
|
|
1455
|
+
for (var S = 0, w = [], x = m.length; S < x; S++)
|
|
1456
1456
|
(m[S].fn !== c || _ && !m[S].once || d && m[S].context !== d) && w.push(m[S]);
|
|
1457
1457
|
w.length ? this._events[v] = w.length === 1 ? w[0] : w : r(this, v);
|
|
1458
1458
|
}
|
|
1459
1459
|
return this;
|
|
1460
1460
|
}, a.prototype.removeAllListeners = function(l) {
|
|
1461
1461
|
var c;
|
|
1462
|
-
return l ? (c =
|
|
1463
|
-
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed =
|
|
1464
|
-
})(
|
|
1465
|
-
var
|
|
1466
|
-
function
|
|
1462
|
+
return l ? (c = s ? s + l : l, this._events[c] && r(this, c)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
1463
|
+
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = s, a.EventEmitter = a, t.exports = a;
|
|
1464
|
+
})(is);
|
|
1465
|
+
var Ot = is.exports;
|
|
1466
|
+
function mn(t) {
|
|
1467
1467
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1468
1468
|
}
|
|
1469
|
-
var
|
|
1469
|
+
var yn = function(t, e) {
|
|
1470
1470
|
e || (e = {}), typeof e == "function" && (e = { cmp: e });
|
|
1471
|
-
var
|
|
1471
|
+
var s = typeof e.cycles == "boolean" ? e.cycles : !1, n = e.cmp && /* @__PURE__ */ function(o) {
|
|
1472
1472
|
return function(r) {
|
|
1473
1473
|
return function(a, u) {
|
|
1474
1474
|
var l = { key: a, value: r[a] }, c = { key: u, value: r[u] };
|
|
@@ -1491,11 +1491,11 @@ var ys = function(t, e) {
|
|
|
1491
1491
|
if (r === null)
|
|
1492
1492
|
return "null";
|
|
1493
1493
|
if (i.indexOf(r) !== -1) {
|
|
1494
|
-
if (
|
|
1494
|
+
if (s)
|
|
1495
1495
|
return JSON.stringify("__cycle__");
|
|
1496
1496
|
throw new TypeError("Converting circular structure to JSON");
|
|
1497
1497
|
}
|
|
1498
|
-
var l = i.push(r) - 1, c = Object.keys(r).sort(
|
|
1498
|
+
var l = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
|
|
1499
1499
|
for (u = "", a = 0; a < c.length; a++) {
|
|
1500
1500
|
var d = c[a], _ = o(r[d]);
|
|
1501
1501
|
_ && (u && (u += ","), u += JSON.stringify(d) + ":" + _);
|
|
@@ -1504,31 +1504,31 @@ var ys = function(t, e) {
|
|
|
1504
1504
|
}
|
|
1505
1505
|
}(t);
|
|
1506
1506
|
};
|
|
1507
|
-
const
|
|
1507
|
+
const gn = /* @__PURE__ */ mn(yn), _n = (t) => rs(gn(t)), bn = (t) => {
|
|
1508
1508
|
if (t && t.length > 0)
|
|
1509
1509
|
try {
|
|
1510
|
-
return JSON.parse(
|
|
1510
|
+
return JSON.parse(os(t));
|
|
1511
1511
|
} catch {
|
|
1512
1512
|
return JSON.parse(decodeURIComponent(atob(decodeURIComponent(t))));
|
|
1513
1513
|
}
|
|
1514
|
-
},
|
|
1514
|
+
}, rs = (t) => btoa(encodeURIComponent(t)), os = (t) => {
|
|
1515
1515
|
try {
|
|
1516
1516
|
return decodeURIComponent(atob(t));
|
|
1517
1517
|
} catch {
|
|
1518
1518
|
return decodeURIComponent(atob(decodeURIComponent(t)));
|
|
1519
1519
|
}
|
|
1520
|
-
},
|
|
1520
|
+
}, as = (t) => {
|
|
1521
1521
|
const e = t instanceof URL ? t : new URL(t);
|
|
1522
|
-
return
|
|
1523
|
-
},
|
|
1522
|
+
return us(e.hash);
|
|
1523
|
+
}, us = (t) => {
|
|
1524
1524
|
let e = t;
|
|
1525
1525
|
for (; e.startsWith("#"); )
|
|
1526
1526
|
e = e.substring(1);
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1527
|
+
const s = e.indexOf("?");
|
|
1528
|
+
if (s === -1)
|
|
1529
1529
|
return [e, {}];
|
|
1530
|
-
const
|
|
1531
|
-
e = e.substring(
|
|
1530
|
+
const n = e.substring(0, s);
|
|
1531
|
+
e = e.substring(s + 1);
|
|
1532
1532
|
const i = {};
|
|
1533
1533
|
return e.split("&").filter((o) => o.length > 0).map((o) => {
|
|
1534
1534
|
const r = o.indexOf("=");
|
|
@@ -1540,17 +1540,17 @@ const gs = /* @__PURE__ */ ms(ys), _s = (t) => on(gs(t)), bs = (t) => {
|
|
|
1540
1540
|
i[o] = r;
|
|
1541
1541
|
}), Object.keys(i).forEach((o) => {
|
|
1542
1542
|
i[o] = i[o];
|
|
1543
|
-
}), [
|
|
1543
|
+
}), [n, i];
|
|
1544
1544
|
}, Pe = (t, e) => {
|
|
1545
|
-
const [
|
|
1546
|
-
return
|
|
1547
|
-
},
|
|
1548
|
-
const
|
|
1549
|
-
i !==
|
|
1550
|
-
},
|
|
1551
|
-
const [
|
|
1545
|
+
const [s, n] = as(t);
|
|
1546
|
+
return n[e];
|
|
1547
|
+
}, wn = (t) => vn()[1][t], vn = () => as(window.location.href), Se = (t, e, s) => {
|
|
1548
|
+
const n = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, i = On(n, t, e);
|
|
1549
|
+
i !== n && (s != null && s.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"))));
|
|
1550
|
+
}, On = (t, e, s) => {
|
|
1551
|
+
const [n, i] = us(t);
|
|
1552
1552
|
let o = !1;
|
|
1553
|
-
if (i.hasOwnProperty(e) &&
|
|
1553
|
+
if (i.hasOwnProperty(e) && s === null || s === void 0 ? (delete i[e], o = !0) : i[e] !== s && (i[e] = s, o = !0), !o)
|
|
1554
1554
|
return t;
|
|
1555
1555
|
const r = Object.keys(i);
|
|
1556
1556
|
r.sort();
|
|
@@ -1558,36 +1558,36 @@ const gs = /* @__PURE__ */ ms(ys), _s = (t) => on(gs(t)), bs = (t) => {
|
|
|
1558
1558
|
const c = i[u];
|
|
1559
1559
|
return /^[A-Za-z0-9+/]+={0,2}$/.test(c) && c.length % 4, `${u}=${c}`;
|
|
1560
1560
|
}).join("&");
|
|
1561
|
-
return !
|
|
1562
|
-
},
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1565
|
-
return
|
|
1566
|
-
},
|
|
1567
|
-
const
|
|
1568
|
-
Se(t,
|
|
1569
|
-
},
|
|
1570
|
-
const
|
|
1571
|
-
return
|
|
1572
|
-
},
|
|
1573
|
-
Se(t, e != null ? e.toString() : void 0,
|
|
1574
|
-
},
|
|
1575
|
-
const
|
|
1576
|
-
return
|
|
1577
|
-
},
|
|
1578
|
-
|
|
1579
|
-
},
|
|
1580
|
-
Se(t, e ? "true" : void 0,
|
|
1581
|
-
},
|
|
1582
|
-
const
|
|
1583
|
-
return
|
|
1584
|
-
},
|
|
1585
|
-
const
|
|
1586
|
-
Se(t,
|
|
1587
|
-
},
|
|
1588
|
-
var
|
|
1561
|
+
return !n && !a ? "" : `${n || ""}${a ? "?" + a : ""}`;
|
|
1562
|
+
}, Rt = (t, e) => {
|
|
1563
|
+
const s = Pe(t, e);
|
|
1564
|
+
if (s && s !== "")
|
|
1565
|
+
return bn(s);
|
|
1566
|
+
}, Rn = (t, e, s) => {
|
|
1567
|
+
const n = e ? _n(e) : void 0;
|
|
1568
|
+
Se(t, n, s);
|
|
1569
|
+
}, Sn = (t) => Rt(window.location.href, t), An = (t, e) => {
|
|
1570
|
+
const s = Pe(t, e);
|
|
1571
|
+
return s ? parseFloat(s) : void 0;
|
|
1572
|
+
}, cs = (t, e, s) => {
|
|
1573
|
+
Se(t, e != null ? e.toString() : void 0, s);
|
|
1574
|
+
}, En = (t) => An(window.location.href, t), Mn = (t, e) => {
|
|
1575
|
+
const s = Pe(t, e);
|
|
1576
|
+
return s ? parseInt(s) : void 0;
|
|
1577
|
+
}, In = (t, e, s) => {
|
|
1578
|
+
cs(t, e, s);
|
|
1579
|
+
}, Cn = (t) => Mn(window.location.href, t), $n = (t, e) => Pe(t, e) === "true", xn = (t, e, s) => {
|
|
1580
|
+
Se(t, e ? "true" : void 0, s);
|
|
1581
|
+
}, Ln = (t) => $n(window.location.href, t), Tn = (t, e) => {
|
|
1582
|
+
const s = Pe(t, e);
|
|
1583
|
+
return s && s !== "" ? os(s) : void 0;
|
|
1584
|
+
}, Pn = (t, e, s) => {
|
|
1585
|
+
const n = e == null ? void 0 : rs(e);
|
|
1586
|
+
Se(t, n, s);
|
|
1587
|
+
}, Dn = (t) => Tn(window.location.href, t);
|
|
1588
|
+
var kn = function(t, e) {
|
|
1589
1589
|
e || (e = {}), typeof e == "function" && (e = { cmp: e });
|
|
1590
|
-
var
|
|
1590
|
+
var s = typeof e.cycles == "boolean" ? e.cycles : !1, n = e.cmp && function(o) {
|
|
1591
1591
|
return function(r) {
|
|
1592
1592
|
return function(a, u) {
|
|
1593
1593
|
var l = { key: a, value: r[a] }, c = { key: u, value: r[u] };
|
|
@@ -1610,11 +1610,11 @@ var ks = function(t, e) {
|
|
|
1610
1610
|
if (r === null)
|
|
1611
1611
|
return "null";
|
|
1612
1612
|
if (i.indexOf(r) !== -1) {
|
|
1613
|
-
if (
|
|
1613
|
+
if (s)
|
|
1614
1614
|
return JSON.stringify("__cycle__");
|
|
1615
1615
|
throw new TypeError("Converting circular structure to JSON");
|
|
1616
1616
|
}
|
|
1617
|
-
var l = i.push(r) - 1, c = Object.keys(r).sort(
|
|
1617
|
+
var l = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
|
|
1618
1618
|
for (u = "", a = 0; a < c.length; a++) {
|
|
1619
1619
|
var d = c[a], _ = o(r[d]);
|
|
1620
1620
|
_ && (u && (u += ","), u += JSON.stringify(d) + ":" + _);
|
|
@@ -1623,24 +1623,24 @@ var ks = function(t, e) {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
}(t);
|
|
1625
1625
|
};
|
|
1626
|
-
const
|
|
1626
|
+
const ls = /* @__PURE__ */ mt(kn);
|
|
1627
1627
|
var xe;
|
|
1628
1628
|
(function(t) {
|
|
1629
1629
|
t.mp_debug = "mp_debug";
|
|
1630
1630
|
})(xe || (xe = {}));
|
|
1631
|
-
const
|
|
1631
|
+
const Hn = () => {
|
|
1632
1632
|
try {
|
|
1633
1633
|
return window !== window.top;
|
|
1634
1634
|
} catch {
|
|
1635
1635
|
return !1;
|
|
1636
1636
|
}
|
|
1637
|
-
},
|
|
1637
|
+
}, fs = {
|
|
1638
1638
|
version: Le,
|
|
1639
1639
|
metaframes: {}
|
|
1640
1640
|
};
|
|
1641
|
-
class
|
|
1641
|
+
class Nn extends Ot.EventEmitter {
|
|
1642
1642
|
constructor() {
|
|
1643
|
-
super(), this._definition =
|
|
1643
|
+
super(), this._definition = fs, this.getDefinition = this.getDefinition.bind(this);
|
|
1644
1644
|
}
|
|
1645
1645
|
error(e) {
|
|
1646
1646
|
throw "Subclass should implement";
|
|
@@ -1649,31 +1649,31 @@ class Ns extends Rt.EventEmitter {
|
|
|
1649
1649
|
return this._definition;
|
|
1650
1650
|
}
|
|
1651
1651
|
}
|
|
1652
|
-
const Je = (t, e) => e ? C(t, (
|
|
1653
|
-
Object.keys(e).forEach((
|
|
1654
|
-
e[
|
|
1652
|
+
const Je = (t, e) => e ? C(t, (s) => {
|
|
1653
|
+
Object.keys(e).forEach((n) => {
|
|
1654
|
+
e[n] === void 0 ? delete s[n] : s[n] = e[n];
|
|
1655
1655
|
});
|
|
1656
1656
|
}) : t, Ni = (t) => window.location.search ? new URLSearchParams(window.location.search).get(t) : null, ji = () => new URLSearchParams(window.location.search).has(xe.mp_debug), ht = () => {
|
|
1657
1657
|
const t = new URLSearchParams(window.location.search).get(xe.mp_debug);
|
|
1658
1658
|
return t === "true" || t === "1";
|
|
1659
|
-
}, Ui = (t = 8) => St(t),
|
|
1660
|
-
for (var e = "",
|
|
1661
|
-
e += Nt.charAt(Math.floor(Math.random() *
|
|
1659
|
+
}, Ui = (t = 8) => St(t), jn = (t = 8) => St(t), Bi = (t = 8) => St(t), Nt = "abcdefghijklmnopqrstuvwxyz0123456789", St = (t = 8) => {
|
|
1660
|
+
for (var e = "", s = Nt.length, n = 0; n < t; n++)
|
|
1661
|
+
e += Nt.charAt(Math.floor(Math.random() * s));
|
|
1662
1662
|
return e;
|
|
1663
|
-
}, At = (t, e,
|
|
1663
|
+
}, At = (t, e, s) => {
|
|
1664
1664
|
e = e || "000", e && e.trim() == "" && (e = void 0);
|
|
1665
|
-
let
|
|
1666
|
-
if (typeof t == "string" ?
|
|
1665
|
+
let n;
|
|
1666
|
+
if (typeof t == "string" ? n = t : typeof t == "number" ? n = t + "" : n = JSON.stringify(t, null, " "), e && e.trim() != "") {
|
|
1667
1667
|
var i = `color: #${e}`;
|
|
1668
|
-
|
|
1668
|
+
s && (i = `${i}; background: #${s}`), n = `%c${n}`, window.console.log(n, i);
|
|
1669
1669
|
} else
|
|
1670
|
-
window.console.log(
|
|
1671
|
-
},
|
|
1670
|
+
window.console.log(n);
|
|
1671
|
+
}, ps = (t) => Bn(Un(t)), Un = (t) => {
|
|
1672
1672
|
var e = 0;
|
|
1673
|
-
for (let
|
|
1674
|
-
e = t.charCodeAt(
|
|
1673
|
+
for (let s = 0; s < t.length; s++)
|
|
1674
|
+
e = t.charCodeAt(s) + ((e << 5) - e);
|
|
1675
1675
|
return e;
|
|
1676
|
-
},
|
|
1676
|
+
}, Bn = (t) => {
|
|
1677
1677
|
var e = (t & 16777215).toString(16).toUpperCase();
|
|
1678
1678
|
return "00000".substring(0, 6 - e.length) + e;
|
|
1679
1679
|
}, tt = () => document.readyState == "complete" || document.readyState == "interactive", Xe = async () => tt() ? Promise.resolve() : new Promise((t) => {
|
|
@@ -1688,18 +1688,18 @@ const Je = (t, e) => e ? C(t, (n) => {
|
|
|
1688
1688
|
!e && tt() && (e = !0, t());
|
|
1689
1689
|
}, 200);
|
|
1690
1690
|
}), Fi = async (t) => {
|
|
1691
|
-
const e =
|
|
1692
|
-
return await
|
|
1691
|
+
const e = ls(t);
|
|
1692
|
+
return await hs(e);
|
|
1693
1693
|
}, zi = async (t) => {
|
|
1694
|
-
const e =
|
|
1694
|
+
const e = ls({
|
|
1695
1695
|
version: t.version,
|
|
1696
1696
|
metaframes: t.metaframes
|
|
1697
1697
|
});
|
|
1698
|
-
return await
|
|
1698
|
+
return await hs(e);
|
|
1699
1699
|
};
|
|
1700
|
-
async function
|
|
1701
|
-
const
|
|
1702
|
-
return btoa(String.fromCharCode(...new Uint8Array(
|
|
1700
|
+
async function hs(t) {
|
|
1701
|
+
const s = new TextEncoder().encode(t), n = await crypto.subtle.digest("SHA-256", s);
|
|
1702
|
+
return btoa(String.fromCharCode(...new Uint8Array(n)));
|
|
1703
1703
|
}
|
|
1704
1704
|
var ae;
|
|
1705
1705
|
(function(t) {
|
|
@@ -1709,48 +1709,48 @@ var z;
|
|
|
1709
1709
|
(function(t) {
|
|
1710
1710
|
t.Connected = "connected", t.Error = "error", t.Input = "input", t.Inputs = "inputs", t.Message = "message";
|
|
1711
1711
|
})(z || (z = {}));
|
|
1712
|
-
class ie extends
|
|
1712
|
+
class ie extends Ot.EventEmitter {
|
|
1713
1713
|
constructor(e) {
|
|
1714
|
-
if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = ae.WaitingForPageLoad, this._messageSendCount = 0, this.debug = ht(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = ht(), this._isIframe =
|
|
1714
|
+
if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = ae.WaitingForPageLoad, this._messageSendCount = 0, this.debug = ht(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = ht(), this._isIframe = Hn(), 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) {
|
|
1715
1715
|
this.log("Not an iframe, metaframe code disabled");
|
|
1716
1716
|
return;
|
|
1717
1717
|
}
|
|
1718
|
-
const
|
|
1718
|
+
const s = this;
|
|
1719
1719
|
Xe().then(() => {
|
|
1720
|
-
this.log("pageLoaded"), window.addEventListener("message", this.onMessage),
|
|
1720
|
+
this.log("pageLoaded"), window.addEventListener("message", this.onMessage), s.sendRpc(X.SetupIframeClientRequest, {
|
|
1721
1721
|
version: ie.version
|
|
1722
|
-
}),
|
|
1722
|
+
}), s._state = ae.SentSetupIframeClientRequest;
|
|
1723
1723
|
}), e && e.disableHashChangeEvent || window.addEventListener("hashchange", this._onHashUrlChange);
|
|
1724
1724
|
}
|
|
1725
1725
|
_resolveSetupIframeServerResponse(e) {
|
|
1726
1726
|
if (this._state === ae.WaitingForPageLoad)
|
|
1727
1727
|
throw "Got message but page has not finished loading, we should never get in this state";
|
|
1728
|
-
(async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color =
|
|
1728
|
+
(async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color = ps(this.id), this._parentId = e.parentId, this.log(`metapage[${this._parentId}](v${this._parentVersion ? this._parentVersion : "unknown"}) registered`), e.state && e.state.inputs && (this.isInputOutputBlobSerialization ? this._inputPipeValues = await Ce(e.state.inputs) : this._inputPipeValues = e.state.inputs), this._state = ae.Ready, this.sendRpc(X.SetupIframeServerResponseAck, {
|
|
1729
1729
|
version: ie.version
|
|
1730
|
-
}), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(z.Inputs, this._inputPipeValues), this.listenerCount(z.Input) > 0 && Object.keys(this._inputPipeValues).forEach((
|
|
1730
|
+
}), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(z.Inputs, this._inputPipeValues), this.listenerCount(z.Input) > 0 && Object.keys(this._inputPipeValues).forEach((s) => this.emit(z.Input, s, this._inputPipeValues[s]))), this.emit(z.Connected), this.sendRpc(X.OutputsUpdate, this._outputPipeValues)))();
|
|
1731
1731
|
}
|
|
1732
1732
|
isConnected() {
|
|
1733
1733
|
return this._state === ae.Ready;
|
|
1734
1734
|
}
|
|
1735
1735
|
async connected() {
|
|
1736
|
-
return new Promise((e,
|
|
1736
|
+
return new Promise((e, s) => {
|
|
1737
1737
|
if (this._state === ae.Ready) {
|
|
1738
1738
|
e();
|
|
1739
1739
|
return;
|
|
1740
1740
|
}
|
|
1741
|
-
let
|
|
1742
|
-
|
|
1743
|
-
e(),
|
|
1741
|
+
let n;
|
|
1742
|
+
n = this.addListenerReturnDisposer(z.Connected, () => {
|
|
1743
|
+
e(), n();
|
|
1744
1744
|
});
|
|
1745
1745
|
});
|
|
1746
1746
|
}
|
|
1747
|
-
addListenerReturnDisposer(e,
|
|
1748
|
-
return super.addListener(e,
|
|
1749
|
-
super.removeListener(e,
|
|
1747
|
+
addListenerReturnDisposer(e, s) {
|
|
1748
|
+
return super.addListener(e, s), () => {
|
|
1749
|
+
super.removeListener(e, s);
|
|
1750
1750
|
};
|
|
1751
1751
|
}
|
|
1752
|
-
log(e,
|
|
1753
|
-
this.debug && this.logInternal(e,
|
|
1752
|
+
log(e, s, n) {
|
|
1753
|
+
this.debug && this.logInternal(e, s || this.color);
|
|
1754
1754
|
}
|
|
1755
1755
|
warn(e) {
|
|
1756
1756
|
this.debug && this.logInternal(e, "000", this.color);
|
|
@@ -1758,48 +1758,48 @@ class ie extends Rt.EventEmitter {
|
|
|
1758
1758
|
error(e) {
|
|
1759
1759
|
this.logInternal(e, this.color, "f00");
|
|
1760
1760
|
}
|
|
1761
|
-
logInternal(e,
|
|
1761
|
+
logInternal(e, s, n) {
|
|
1762
1762
|
let i;
|
|
1763
|
-
typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e),
|
|
1763
|
+
typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), s = s && s + "", i = (this.id ? `Metaframe[${this.id}] ` : "") + `${i}`, At(i, s, n);
|
|
1764
1764
|
}
|
|
1765
1765
|
dispose() {
|
|
1766
1766
|
super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this.disableNotifyOnHashUrlChange(), this._inputPipeValues = void 0, this._outputPipeValues = void 0;
|
|
1767
1767
|
}
|
|
1768
|
-
addListener(e,
|
|
1769
|
-
return super.addListener(e,
|
|
1770
|
-
this._inputPipeValues &&
|
|
1768
|
+
addListener(e, s) {
|
|
1769
|
+
return super.addListener(e, s), e === z.Inputs && window.setTimeout(() => {
|
|
1770
|
+
this._inputPipeValues && s(this._inputPipeValues);
|
|
1771
1771
|
}, 0), this;
|
|
1772
1772
|
}
|
|
1773
|
-
onInput(e,
|
|
1774
|
-
return this.addListenerReturnDisposer(z.Input, (
|
|
1775
|
-
e ===
|
|
1773
|
+
onInput(e, s) {
|
|
1774
|
+
return this.addListenerReturnDisposer(z.Input, (n, i) => {
|
|
1775
|
+
e === n && s(i);
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
onInputs(e) {
|
|
1779
1779
|
return this.addListenerReturnDisposer(z.Inputs, e);
|
|
1780
1780
|
}
|
|
1781
|
-
setInput(e,
|
|
1782
|
-
var
|
|
1783
|
-
|
|
1781
|
+
setInput(e, s) {
|
|
1782
|
+
var n = {};
|
|
1783
|
+
n[e] = s, this.setInputs(n);
|
|
1784
1784
|
}
|
|
1785
1785
|
async setInputs(e) {
|
|
1786
1786
|
this.isInputOutputBlobSerialization && (e = await Ce(e)), this.sendRpc(X.InputsUpdate, e);
|
|
1787
1787
|
}
|
|
1788
1788
|
async setInternalInputsAndNotify(e) {
|
|
1789
1789
|
this.isInputOutputBlobSerialization && (e = await Ce(e));
|
|
1790
|
-
const
|
|
1791
|
-
if (this._inputPipeValues = Je(this._inputPipeValues, e), this._inputPipeValues !==
|
|
1792
|
-
Object.keys(e).forEach((
|
|
1790
|
+
const s = e;
|
|
1791
|
+
if (this._inputPipeValues = Je(this._inputPipeValues, e), this._inputPipeValues !== s) {
|
|
1792
|
+
Object.keys(e).forEach((n) => {
|
|
1793
1793
|
try {
|
|
1794
|
-
this.emit(z.Input,
|
|
1794
|
+
this.emit(z.Input, n, e[n]);
|
|
1795
1795
|
} catch (i) {
|
|
1796
|
-
console.error(`Error emitting input ${
|
|
1796
|
+
console.error(`Error emitting input ${n}: ${i}`), this.emit(z.Error, `Error emitting input ${n}: ${i}`);
|
|
1797
1797
|
}
|
|
1798
1798
|
});
|
|
1799
1799
|
try {
|
|
1800
1800
|
this.emit(z.Inputs, e);
|
|
1801
|
-
} catch (
|
|
1802
|
-
console.error(`Error emitting inputs: ${
|
|
1801
|
+
} catch (n) {
|
|
1802
|
+
console.error(`Error emitting inputs: ${n}`), this.emit(z.Error, `Error emitting inputs: ${n}`);
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
@@ -1809,110 +1809,110 @@ class ie extends Rt.EventEmitter {
|
|
|
1809
1809
|
getInputs() {
|
|
1810
1810
|
return this._inputPipeValues;
|
|
1811
1811
|
}
|
|
1812
|
-
setOutput(e,
|
|
1812
|
+
setOutput(e, s) {
|
|
1813
1813
|
console.assert(!!e);
|
|
1814
|
-
var
|
|
1815
|
-
|
|
1814
|
+
var n = {};
|
|
1815
|
+
n[e] = s, this.setOutputs(n);
|
|
1816
1816
|
}
|
|
1817
1817
|
async setOutputs(e) {
|
|
1818
1818
|
this.isInputOutputBlobSerialization && (e = await Ke(e));
|
|
1819
|
-
const
|
|
1820
|
-
this._outputPipeValues = Je(this._outputPipeValues, e), this._outputPipeValues !==
|
|
1819
|
+
const s = e;
|
|
1820
|
+
this._outputPipeValues = Je(this._outputPipeValues, e), this._outputPipeValues !== s && this._state === ae.Ready && this.sendRpc(X.OutputsUpdate, e);
|
|
1821
1821
|
}
|
|
1822
1822
|
disableNotifyOnHashUrlChange() {
|
|
1823
1823
|
window.removeEventListener("hashchange", this._onHashUrlChange);
|
|
1824
1824
|
}
|
|
1825
1825
|
_onHashUrlChange(e) {
|
|
1826
|
-
const
|
|
1826
|
+
const s = {
|
|
1827
1827
|
hash: window.location.hash,
|
|
1828
1828
|
metaframe: this.id
|
|
1829
1829
|
};
|
|
1830
|
-
this.sendRpc(X.HashParamsUpdate,
|
|
1830
|
+
this.sendRpc(X.HashParamsUpdate, s);
|
|
1831
1831
|
}
|
|
1832
|
-
sendRpc(e,
|
|
1832
|
+
sendRpc(e, s) {
|
|
1833
1833
|
if (this._isIframe) {
|
|
1834
|
-
const
|
|
1834
|
+
const n = {
|
|
1835
1835
|
jsonrpc: "2.0",
|
|
1836
1836
|
id: ++this._messageSendCount,
|
|
1837
1837
|
method: e,
|
|
1838
|
-
params:
|
|
1838
|
+
params: s,
|
|
1839
1839
|
iframeId: this.id,
|
|
1840
1840
|
parentId: this._parentId
|
|
1841
1841
|
};
|
|
1842
|
-
window.parent && window.parent.postMessage(
|
|
1842
|
+
window.parent && window.parent.postMessage(n, "*");
|
|
1843
1843
|
} else
|
|
1844
1844
|
this.log("Cannot send JSON-RPC window message: there is no window.parent which means we are not an iframe");
|
|
1845
1845
|
}
|
|
1846
1846
|
onMessage(e) {
|
|
1847
1847
|
if (typeof e.data == "object") {
|
|
1848
|
-
let
|
|
1849
|
-
if (
|
|
1850
|
-
var
|
|
1851
|
-
if (!(
|
|
1852
|
-
this.log(`window.message: received message (method=${
|
|
1848
|
+
let n = e.data;
|
|
1849
|
+
if (n.jsonrpc === "2.0") {
|
|
1850
|
+
var s = n.method;
|
|
1851
|
+
if (!(s == "SetupIframeServerResponse" || n.parentId == this._parentId && n.iframeId == this.id)) {
|
|
1852
|
+
this.log(`window.message: received message (method=${s}) but jsonrpc.parentId=${n.parentId} _parentId=${this._parentId} jsonrpc.iframeId=${n.iframeId} id=${this.id}`);
|
|
1853
1853
|
return;
|
|
1854
1854
|
}
|
|
1855
|
-
switch (
|
|
1855
|
+
switch (s) {
|
|
1856
1856
|
case me.SetupIframeServerResponse:
|
|
1857
|
-
this._resolveSetupIframeServerResponse(
|
|
1857
|
+
this._resolveSetupIframeServerResponse(n.params);
|
|
1858
1858
|
break;
|
|
1859
1859
|
case me.InputsUpdate:
|
|
1860
1860
|
if (this._state !== ae.Ready)
|
|
1861
1861
|
throw "Got InputsUpdate but metaframe is not MetaframeLoadingState.Ready";
|
|
1862
|
-
this.setInternalInputsAndNotify(
|
|
1862
|
+
this.setInternalInputsAndNotify(n.params.inputs);
|
|
1863
1863
|
break;
|
|
1864
1864
|
case me.MessageAck:
|
|
1865
|
-
this.debug && this.log(`ACK: ${JSON.stringify(
|
|
1865
|
+
this.debug && this.log(`ACK: ${JSON.stringify(n)}`);
|
|
1866
1866
|
break;
|
|
1867
1867
|
default:
|
|
1868
|
-
this.debug && this.log(`window.message: unknown JSON-RPC method: ${JSON.stringify(
|
|
1868
|
+
this.debug && this.log(`window.message: unknown JSON-RPC method: ${JSON.stringify(n)}`);
|
|
1869
1869
|
break;
|
|
1870
1870
|
}
|
|
1871
|
-
this.listenerCount(z.Message) > 0 && this.emit(z.Message,
|
|
1871
|
+
this.listenerCount(z.Message) > 0 && this.emit(z.Message, n);
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
|
-
setParameter(e,
|
|
1876
|
-
Se(e,
|
|
1875
|
+
setParameter(e, s) {
|
|
1876
|
+
Se(e, s);
|
|
1877
1877
|
}
|
|
1878
1878
|
getParameter(e) {
|
|
1879
|
-
return
|
|
1879
|
+
return wn(e);
|
|
1880
1880
|
}
|
|
1881
|
-
setParameterBoolean(e,
|
|
1882
|
-
|
|
1881
|
+
setParameterBoolean(e, s) {
|
|
1882
|
+
xn(e, s);
|
|
1883
1883
|
}
|
|
1884
1884
|
getParameterBoolean(e) {
|
|
1885
|
-
return
|
|
1885
|
+
return Ln(e);
|
|
1886
1886
|
}
|
|
1887
|
-
setParameterJson(e,
|
|
1888
|
-
|
|
1887
|
+
setParameterJson(e, s) {
|
|
1888
|
+
Rn(e, s);
|
|
1889
1889
|
}
|
|
1890
1890
|
getParameterJson(e) {
|
|
1891
|
-
return
|
|
1891
|
+
return Sn(e);
|
|
1892
1892
|
}
|
|
1893
|
-
setParameterBase64(e,
|
|
1894
|
-
|
|
1893
|
+
setParameterBase64(e, s) {
|
|
1894
|
+
Pn(e, s);
|
|
1895
1895
|
}
|
|
1896
1896
|
getParameterBase64(e) {
|
|
1897
|
-
return
|
|
1897
|
+
return Dn(e);
|
|
1898
1898
|
}
|
|
1899
|
-
setParameterFloat(e,
|
|
1900
|
-
|
|
1899
|
+
setParameterFloat(e, s) {
|
|
1900
|
+
cs(e, s);
|
|
1901
1901
|
}
|
|
1902
1902
|
getParameterFloat(e) {
|
|
1903
|
-
return
|
|
1903
|
+
return En(e);
|
|
1904
1904
|
}
|
|
1905
|
-
setParameterInt(e,
|
|
1906
|
-
|
|
1905
|
+
setParameterInt(e, s) {
|
|
1906
|
+
In(e, s);
|
|
1907
1907
|
}
|
|
1908
1908
|
getParameterInt(e) {
|
|
1909
|
-
return
|
|
1909
|
+
return Cn(e);
|
|
1910
1910
|
}
|
|
1911
1911
|
deleteParameter(e) {
|
|
1912
1912
|
Se(e, void 0);
|
|
1913
1913
|
}
|
|
1914
1914
|
}
|
|
1915
|
-
ie.version =
|
|
1915
|
+
ie.version = As;
|
|
1916
1916
|
ie.ERROR = z.Error;
|
|
1917
1917
|
ie.CONNECTED = z.Connected;
|
|
1918
1918
|
ie.INPUT = z.Input;
|
|
@@ -1921,25 +1921,25 @@ ie.MESSAGE = z.Message;
|
|
|
1921
1921
|
ie.deserializeInputs = Ce;
|
|
1922
1922
|
ie.serializeInputs = Ke;
|
|
1923
1923
|
var qe = {};
|
|
1924
|
-
const oe = "\\\\/", jt = `[^${oe}]`, le = "\\.",
|
|
1924
|
+
const oe = "\\\\/", jt = `[^${oe}]`, le = "\\.", Fn = "\\+", zn = "\\?", Qe = "\\/", Jn = "(?=.)", ds = "[^/]", Et = `(?:${Qe}|$)`, ms = `(?:^|${Qe})`, Mt = `${le}{1,2}${Et}`, Gn = `(?!${le})`, Vn = `(?!${ms}${Mt})`, Wn = `(?!${le}{0,1}${Et})`, Kn = `(?!${Mt})`, Xn = `[^.${Qe}]`, qn = `${ds}*?`, Qn = "/", ys = {
|
|
1925
1925
|
DOT_LITERAL: le,
|
|
1926
|
-
PLUS_LITERAL:
|
|
1927
|
-
QMARK_LITERAL:
|
|
1926
|
+
PLUS_LITERAL: Fn,
|
|
1927
|
+
QMARK_LITERAL: zn,
|
|
1928
1928
|
SLASH_LITERAL: Qe,
|
|
1929
|
-
ONE_CHAR:
|
|
1930
|
-
QMARK:
|
|
1929
|
+
ONE_CHAR: Jn,
|
|
1930
|
+
QMARK: ds,
|
|
1931
1931
|
END_ANCHOR: Et,
|
|
1932
1932
|
DOTS_SLASH: Mt,
|
|
1933
|
-
NO_DOT:
|
|
1934
|
-
NO_DOTS:
|
|
1935
|
-
NO_DOT_SLASH:
|
|
1936
|
-
NO_DOTS_SLASH:
|
|
1937
|
-
QMARK_NO_DOT:
|
|
1938
|
-
STAR:
|
|
1939
|
-
START_ANCHOR:
|
|
1940
|
-
SEP:
|
|
1941
|
-
},
|
|
1942
|
-
...
|
|
1933
|
+
NO_DOT: Gn,
|
|
1934
|
+
NO_DOTS: Vn,
|
|
1935
|
+
NO_DOT_SLASH: Wn,
|
|
1936
|
+
NO_DOTS_SLASH: Kn,
|
|
1937
|
+
QMARK_NO_DOT: Xn,
|
|
1938
|
+
STAR: qn,
|
|
1939
|
+
START_ANCHOR: ms,
|
|
1940
|
+
SEP: Qn
|
|
1941
|
+
}, Yn = {
|
|
1942
|
+
...ys,
|
|
1943
1943
|
SLASH_LITERAL: `[${oe}]`,
|
|
1944
1944
|
QMARK: jt,
|
|
1945
1945
|
STAR: `${jt}*?`,
|
|
@@ -1952,7 +1952,7 @@ const oe = "\\\\/", jt = `[^${oe}]`, le = "\\.", Fs = "\\+", zs = "\\?", Qe = "\
|
|
|
1952
1952
|
START_ANCHOR: `(?:^|[${oe}])`,
|
|
1953
1953
|
END_ANCHOR: `(?:[${oe}]|$)`,
|
|
1954
1954
|
SEP: "\\"
|
|
1955
|
-
},
|
|
1955
|
+
}, Zn = {
|
|
1956
1956
|
alnum: "a-zA-Z0-9",
|
|
1957
1957
|
alpha: "a-zA-Z",
|
|
1958
1958
|
ascii: "\\x00-\\x7F",
|
|
@@ -1970,7 +1970,7 @@ const oe = "\\\\/", jt = `[^${oe}]`, le = "\\.", Fs = "\\+", zs = "\\?", Qe = "\
|
|
|
1970
1970
|
};
|
|
1971
1971
|
var Ye = {
|
|
1972
1972
|
MAX_LENGTH: 1024 * 64,
|
|
1973
|
-
POSIX_REGEX_SOURCE:
|
|
1973
|
+
POSIX_REGEX_SOURCE: Zn,
|
|
1974
1974
|
// regular expressions
|
|
1975
1975
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
1976
1976
|
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
@@ -2089,17 +2089,17 @@ var Ye = {
|
|
|
2089
2089
|
* Create GLOB_CHARS
|
|
2090
2090
|
*/
|
|
2091
2091
|
globChars(t) {
|
|
2092
|
-
return t === !0 ?
|
|
2092
|
+
return t === !0 ? Yn : ys;
|
|
2093
2093
|
}
|
|
2094
2094
|
};
|
|
2095
2095
|
(function(t) {
|
|
2096
2096
|
const {
|
|
2097
2097
|
REGEX_BACKSLASH: e,
|
|
2098
|
-
REGEX_REMOVE_BACKSLASH:
|
|
2099
|
-
REGEX_SPECIAL_CHARS:
|
|
2098
|
+
REGEX_REMOVE_BACKSLASH: s,
|
|
2099
|
+
REGEX_SPECIAL_CHARS: n,
|
|
2100
2100
|
REGEX_SPECIAL_CHARS_GLOBAL: i
|
|
2101
2101
|
} = Ye;
|
|
2102
|
-
t.isObject = (o) => o !== null && typeof o == "object" && !Array.isArray(o), t.hasRegexChars = (o) =>
|
|
2102
|
+
t.isObject = (o) => o !== null && typeof o == "object" && !Array.isArray(o), t.hasRegexChars = (o) => n.test(o), t.isRegexChar = (o) => o.length === 1 && t.hasRegexChars(o), t.escapeRegex = (o) => o.replace(i, "\\$1"), t.toPosixSlashes = (o) => o.replace(e, "/"), t.removeBackslashes = (o) => o.replace(s, (r) => r === "\\" ? "" : r), t.supportsLookbehinds = () => {
|
|
2103
2103
|
const o = process.version.slice(1).split(".").map(Number);
|
|
2104
2104
|
return o.length === 3 && o[0] >= 9 || o[0] === 8 && o[1] >= 10;
|
|
2105
2105
|
}, t.escapeLast = (o, r, a) => {
|
|
@@ -2115,7 +2115,7 @@ var Ye = {
|
|
|
2115
2115
|
}, t.basename = (o, { windows: r } = {}) => r ? o.replace(/[\\/]$/, "").replace(/.*[\\/]/, "") : o.replace(/\/$/, "").replace(/.*\//, "");
|
|
2116
2116
|
})(qe);
|
|
2117
2117
|
const Ut = qe, {
|
|
2118
|
-
CHAR_ASTERISK:
|
|
2118
|
+
CHAR_ASTERISK: st,
|
|
2119
2119
|
/* * */
|
|
2120
2120
|
CHAR_AT: ei,
|
|
2121
2121
|
/* @ */
|
|
@@ -2123,19 +2123,19 @@ const Ut = qe, {
|
|
|
2123
2123
|
/* \ */
|
|
2124
2124
|
CHAR_COMMA: ti,
|
|
2125
2125
|
/* , */
|
|
2126
|
-
CHAR_DOT:
|
|
2126
|
+
CHAR_DOT: nt,
|
|
2127
2127
|
/* . */
|
|
2128
2128
|
CHAR_EXCLAMATION_MARK: Bt,
|
|
2129
2129
|
/* ! */
|
|
2130
|
-
CHAR_FORWARD_SLASH:
|
|
2130
|
+
CHAR_FORWARD_SLASH: gs,
|
|
2131
2131
|
/* / */
|
|
2132
2132
|
CHAR_LEFT_CURLY_BRACE: it,
|
|
2133
2133
|
/* { */
|
|
2134
2134
|
CHAR_LEFT_PARENTHESES: rt,
|
|
2135
2135
|
/* ( */
|
|
2136
|
-
CHAR_LEFT_SQUARE_BRACKET:
|
|
2136
|
+
CHAR_LEFT_SQUARE_BRACKET: si,
|
|
2137
2137
|
/* [ */
|
|
2138
|
-
CHAR_PLUS:
|
|
2138
|
+
CHAR_PLUS: ni,
|
|
2139
2139
|
/* + */
|
|
2140
2140
|
CHAR_QUESTION_MARK: Ft,
|
|
2141
2141
|
/* ? */
|
|
@@ -2145,41 +2145,41 @@ const Ut = qe, {
|
|
|
2145
2145
|
/* ) */
|
|
2146
2146
|
CHAR_RIGHT_SQUARE_BRACKET: ri
|
|
2147
2147
|
/* ] */
|
|
2148
|
-
} = Ye, Jt = (t) => t ===
|
|
2148
|
+
} = Ye, Jt = (t) => t === gs || t === Me, Gt = (t) => {
|
|
2149
2149
|
t.isPrefix !== !0 && (t.depth = t.isGlobstar ? 1 / 0 : 1);
|
|
2150
2150
|
}, oi = (t, e) => {
|
|
2151
|
-
const
|
|
2152
|
-
let u = t, l = -1, c = 0, d = 0, _ = !1, v = !1, m = !1, S = !1, w = !1,
|
|
2153
|
-
const U = () => l >=
|
|
2154
|
-
for (; l <
|
|
2155
|
-
|
|
2151
|
+
const s = e || {}, n = t.length - 1, i = s.parts === !0 || s.scanToEnd === !0, o = [], r = [], a = [];
|
|
2152
|
+
let u = t, l = -1, c = 0, d = 0, _ = !1, v = !1, m = !1, S = !1, w = !1, x = !1, b = !1, A = !1, E = !1, O = 0, H, R, L = { value: "", depth: 0, isGlob: !1 };
|
|
2153
|
+
const U = () => l >= n, f = () => u.charCodeAt(l + 1), M = () => (H = R, u.charCodeAt(++l));
|
|
2154
|
+
for (; l < n; ) {
|
|
2155
|
+
R = M();
|
|
2156
2156
|
let W;
|
|
2157
|
-
if (
|
|
2158
|
-
b = L.backslashes = !0,
|
|
2157
|
+
if (R === Me) {
|
|
2158
|
+
b = L.backslashes = !0, R = M(), R === it && (x = !0);
|
|
2159
2159
|
continue;
|
|
2160
2160
|
}
|
|
2161
|
-
if (
|
|
2162
|
-
for (
|
|
2163
|
-
if (
|
|
2161
|
+
if (x === !0 || R === it) {
|
|
2162
|
+
for (O++; U() !== !0 && (R = M()); ) {
|
|
2163
|
+
if (R === Me) {
|
|
2164
2164
|
b = L.backslashes = !0, M();
|
|
2165
2165
|
continue;
|
|
2166
2166
|
}
|
|
2167
|
-
if (
|
|
2168
|
-
|
|
2167
|
+
if (R === it) {
|
|
2168
|
+
O++;
|
|
2169
2169
|
continue;
|
|
2170
2170
|
}
|
|
2171
|
-
if (
|
|
2171
|
+
if (x !== !0 && R === nt && (R = M()) === nt) {
|
|
2172
2172
|
if (_ = L.isBrace = !0, m = L.isGlob = !0, E = !0, i === !0)
|
|
2173
2173
|
continue;
|
|
2174
2174
|
break;
|
|
2175
2175
|
}
|
|
2176
|
-
if (
|
|
2176
|
+
if (x !== !0 && R === ti) {
|
|
2177
2177
|
if (_ = L.isBrace = !0, m = L.isGlob = !0, E = !0, i === !0)
|
|
2178
2178
|
continue;
|
|
2179
2179
|
break;
|
|
2180
2180
|
}
|
|
2181
|
-
if (
|
|
2182
|
-
|
|
2181
|
+
if (R === ii && (O--, O === 0)) {
|
|
2182
|
+
x = !1, _ = L.isBrace = !0, E = !0;
|
|
2183
2183
|
break;
|
|
2184
2184
|
}
|
|
2185
2185
|
}
|
|
@@ -2187,24 +2187,24 @@ const Ut = qe, {
|
|
|
2187
2187
|
continue;
|
|
2188
2188
|
break;
|
|
2189
2189
|
}
|
|
2190
|
-
if (
|
|
2190
|
+
if (R === gs) {
|
|
2191
2191
|
if (o.push(l), r.push(L), L = { value: "", depth: 0, isGlob: !1 }, E === !0)
|
|
2192
2192
|
continue;
|
|
2193
|
-
if (H ===
|
|
2193
|
+
if (H === nt && l === c + 1) {
|
|
2194
2194
|
c += 2;
|
|
2195
2195
|
continue;
|
|
2196
2196
|
}
|
|
2197
2197
|
d = l + 1;
|
|
2198
2198
|
continue;
|
|
2199
2199
|
}
|
|
2200
|
-
if (
|
|
2200
|
+
if (s.noext !== !0 && (R === ni || R === ei || R === st || R === Ft || R === Bt) === !0 && f() === rt) {
|
|
2201
2201
|
if (m = L.isGlob = !0, S = L.isExtglob = !0, E = !0, i === !0) {
|
|
2202
|
-
for (; U() !== !0 && (
|
|
2203
|
-
if (
|
|
2204
|
-
b = L.backslashes = !0,
|
|
2202
|
+
for (; U() !== !0 && (R = M()); ) {
|
|
2203
|
+
if (R === Me) {
|
|
2204
|
+
b = L.backslashes = !0, R = M();
|
|
2205
2205
|
continue;
|
|
2206
2206
|
}
|
|
2207
|
-
if (
|
|
2207
|
+
if (R === zt) {
|
|
2208
2208
|
m = L.isGlob = !0, E = !0;
|
|
2209
2209
|
break;
|
|
2210
2210
|
}
|
|
@@ -2213,17 +2213,17 @@ const Ut = qe, {
|
|
|
2213
2213
|
}
|
|
2214
2214
|
break;
|
|
2215
2215
|
}
|
|
2216
|
-
if (
|
|
2217
|
-
if (H ===
|
|
2216
|
+
if (R === st) {
|
|
2217
|
+
if (H === st && (w = L.isGlobstar = !0), m = L.isGlob = !0, E = !0, i === !0)
|
|
2218
2218
|
continue;
|
|
2219
2219
|
break;
|
|
2220
2220
|
}
|
|
2221
|
-
if (
|
|
2221
|
+
if (R === Ft) {
|
|
2222
2222
|
if (m = L.isGlob = !0, E = !0, i === !0)
|
|
2223
2223
|
continue;
|
|
2224
2224
|
break;
|
|
2225
2225
|
}
|
|
2226
|
-
if (
|
|
2226
|
+
if (R === si)
|
|
2227
2227
|
for (; U() !== !0 && (W = M()); ) {
|
|
2228
2228
|
if (W === Me) {
|
|
2229
2229
|
b = L.backslashes = !0, M();
|
|
@@ -2235,18 +2235,18 @@ const Ut = qe, {
|
|
|
2235
2235
|
break;
|
|
2236
2236
|
}
|
|
2237
2237
|
}
|
|
2238
|
-
if (
|
|
2238
|
+
if (s.nonegate !== !0 && R === Bt && l === c) {
|
|
2239
2239
|
A = L.negated = !0, c++;
|
|
2240
2240
|
continue;
|
|
2241
2241
|
}
|
|
2242
|
-
if (
|
|
2242
|
+
if (s.noparen !== !0 && R === rt) {
|
|
2243
2243
|
if (m = L.isGlob = !0, i === !0) {
|
|
2244
|
-
for (; U() !== !0 && (
|
|
2245
|
-
if (
|
|
2246
|
-
b = L.backslashes = !0,
|
|
2244
|
+
for (; U() !== !0 && (R = M()); ) {
|
|
2245
|
+
if (R === rt) {
|
|
2246
|
+
b = L.backslashes = !0, R = M();
|
|
2247
2247
|
continue;
|
|
2248
2248
|
}
|
|
2249
|
-
if (
|
|
2249
|
+
if (R === zt) {
|
|
2250
2250
|
E = !0;
|
|
2251
2251
|
break;
|
|
2252
2252
|
}
|
|
@@ -2261,9 +2261,9 @@ const Ut = qe, {
|
|
|
2261
2261
|
break;
|
|
2262
2262
|
}
|
|
2263
2263
|
}
|
|
2264
|
-
|
|
2264
|
+
s.noext === !0 && (S = !1, m = !1);
|
|
2265
2265
|
let I = u, B = "", h = "";
|
|
2266
|
-
c > 0 && (B = u.slice(0, c), u = u.slice(c), d -= c), I && m === !0 && d > 0 ? (I = u.slice(0, d), h = u.slice(d)) : m === !0 ? (I = "", h = u) : I = u, I && I !== "" && I !== "/" && I !== u && Jt(I.charCodeAt(I.length - 1)) && (I = I.slice(0, -1)),
|
|
2266
|
+
c > 0 && (B = u.slice(0, c), u = u.slice(c), d -= c), I && m === !0 && d > 0 ? (I = u.slice(0, d), h = u.slice(d)) : m === !0 ? (I = "", h = u) : I = u, I && I !== "" && I !== "/" && I !== u && Jt(I.charCodeAt(I.length - 1)) && (I = I.slice(0, -1)), s.unescape === !0 && (h && (h = Ut.removeBackslashes(h)), I && b === !0 && (I = Ut.removeBackslashes(I)));
|
|
2267
2267
|
const p = {
|
|
2268
2268
|
prefix: B,
|
|
2269
2269
|
input: t,
|
|
@@ -2277,47 +2277,47 @@ const Ut = qe, {
|
|
|
2277
2277
|
isGlobstar: w,
|
|
2278
2278
|
negated: A
|
|
2279
2279
|
};
|
|
2280
|
-
if (
|
|
2280
|
+
if (s.tokens === !0 && (p.maxDepth = 0, Jt(R) || r.push(L), p.tokens = r), s.parts === !0 || s.tokens === !0) {
|
|
2281
2281
|
let W;
|
|
2282
2282
|
for (let k = 0; k < o.length; k++) {
|
|
2283
2283
|
const re = W ? W + 1 : c, ce = o[k], Q = t.slice(re, ce);
|
|
2284
|
-
|
|
2284
|
+
s.tokens && (k === 0 && c !== 0 ? (r[k].isPrefix = !0, r[k].value = B) : r[k].value = Q, Gt(r[k]), p.maxDepth += r[k].depth), (k !== 0 || Q !== "") && a.push(Q), W = ce;
|
|
2285
2285
|
}
|
|
2286
2286
|
if (W && W + 1 < t.length) {
|
|
2287
2287
|
const k = t.slice(W + 1);
|
|
2288
|
-
a.push(k),
|
|
2288
|
+
a.push(k), s.tokens && (r[r.length - 1].value = k, Gt(r[r.length - 1]), p.maxDepth += r[r.length - 1].depth);
|
|
2289
2289
|
}
|
|
2290
2290
|
p.slashes = o, p.parts = a;
|
|
2291
2291
|
}
|
|
2292
2292
|
return p;
|
|
2293
2293
|
};
|
|
2294
2294
|
var ai = oi;
|
|
2295
|
-
const Ge = Ye,
|
|
2295
|
+
const Ge = Ye, se = qe, {
|
|
2296
2296
|
MAX_LENGTH: Ve,
|
|
2297
2297
|
POSIX_REGEX_SOURCE: ui,
|
|
2298
2298
|
REGEX_NON_SPECIAL_CHARS: ci,
|
|
2299
2299
|
REGEX_SPECIAL_CHARS_BACKREF: li,
|
|
2300
|
-
REPLACEMENTS:
|
|
2300
|
+
REPLACEMENTS: _s
|
|
2301
2301
|
} = Ge, fi = (t, e) => {
|
|
2302
2302
|
if (typeof e.expandRange == "function")
|
|
2303
2303
|
return e.expandRange(...t, e);
|
|
2304
2304
|
t.sort();
|
|
2305
|
-
const
|
|
2305
|
+
const s = `[${t.join("-")}]`;
|
|
2306
2306
|
try {
|
|
2307
|
-
new RegExp(
|
|
2307
|
+
new RegExp(s);
|
|
2308
2308
|
} catch {
|
|
2309
|
-
return t.map((i) =>
|
|
2309
|
+
return t.map((i) => se.escapeRegex(i)).join("..");
|
|
2310
2310
|
}
|
|
2311
|
-
return
|
|
2312
|
-
}, ve = (t, e) => `Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,
|
|
2311
|
+
return s;
|
|
2312
|
+
}, ve = (t, e) => `Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`, bs = (t, e) => {
|
|
2313
2313
|
if (typeof t != "string")
|
|
2314
2314
|
throw new TypeError("Expected a string");
|
|
2315
|
-
t =
|
|
2316
|
-
const
|
|
2315
|
+
t = _s[t] || t;
|
|
2316
|
+
const s = { ...e }, n = typeof s.maxLength == "number" ? Math.min(Ve, s.maxLength) : Ve;
|
|
2317
2317
|
let i = t.length;
|
|
2318
|
-
if (i >
|
|
2319
|
-
throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${
|
|
2320
|
-
const o = { type: "bos", value: "", output:
|
|
2318
|
+
if (i > n)
|
|
2319
|
+
throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);
|
|
2320
|
+
const o = { type: "bos", value: "", output: s.prepend || "" }, r = [o], a = s.capture ? "" : "?:", u = Ge.globChars(s.windows), l = Ge.extglobChars(u), {
|
|
2321
2321
|
DOT_LITERAL: c,
|
|
2322
2322
|
PLUS_LITERAL: d,
|
|
2323
2323
|
SLASH_LITERAL: _,
|
|
@@ -2325,19 +2325,19 @@ const Ge = Ye, ne = qe, {
|
|
|
2325
2325
|
DOTS_SLASH: m,
|
|
2326
2326
|
NO_DOT: S,
|
|
2327
2327
|
NO_DOT_SLASH: w,
|
|
2328
|
-
NO_DOTS_SLASH:
|
|
2328
|
+
NO_DOTS_SLASH: x,
|
|
2329
2329
|
QMARK: b,
|
|
2330
2330
|
QMARK_NO_DOT: A,
|
|
2331
2331
|
STAR: E,
|
|
2332
|
-
START_ANCHOR:
|
|
2333
|
-
} = u, H = (g) => `(${a}(?:(?!${
|
|
2334
|
-
let U =
|
|
2335
|
-
|
|
2332
|
+
START_ANCHOR: O
|
|
2333
|
+
} = u, H = (g) => `(${a}(?:(?!${O}${g.dot ? m : c}).)*?)`, R = s.dot ? "" : S, L = s.dot ? b : A;
|
|
2334
|
+
let U = s.bash === !0 ? H(s) : E;
|
|
2335
|
+
s.capture && (U = `(${U})`), typeof s.noext == "boolean" && (s.noextglob = s.noext);
|
|
2336
2336
|
const f = {
|
|
2337
2337
|
input: t,
|
|
2338
2338
|
index: -1,
|
|
2339
2339
|
start: 0,
|
|
2340
|
-
dot:
|
|
2340
|
+
dot: s.dot === !0,
|
|
2341
2341
|
consumed: "",
|
|
2342
2342
|
output: "",
|
|
2343
2343
|
prefix: "",
|
|
@@ -2350,14 +2350,14 @@ const Ge = Ye, ne = qe, {
|
|
|
2350
2350
|
globstar: !1,
|
|
2351
2351
|
tokens: r
|
|
2352
2352
|
};
|
|
2353
|
-
t =
|
|
2353
|
+
t = se.removePrefix(t, f), i = t.length;
|
|
2354
2354
|
const M = [], I = [], B = [];
|
|
2355
2355
|
let h = o, p;
|
|
2356
2356
|
const W = () => f.index === i - 1, k = f.peek = (g = 1) => t[f.index + g], re = f.advance = () => t[++f.index], ce = () => t.slice(f.index + 1), Q = (g = "", N = 0) => {
|
|
2357
2357
|
f.consumed += g, f.index += N;
|
|
2358
2358
|
}, De = (g) => {
|
|
2359
2359
|
f.output += g.output != null ? g.output : g.value, Q(g.value);
|
|
2360
|
-
},
|
|
2360
|
+
}, Rs = () => {
|
|
2361
2361
|
let g = 1;
|
|
2362
2362
|
for (; k() === "!" && (k(2) !== "(" || k(3) === "?"); )
|
|
2363
2363
|
re(), f.start++, g++;
|
|
@@ -2379,26 +2379,26 @@ const Ge = Ye, ne = qe, {
|
|
|
2379
2379
|
}, He = (g, N) => {
|
|
2380
2380
|
const y = { ...l[N], conditions: 1, inner: "" };
|
|
2381
2381
|
y.prev = h, y.parens = f.parens, y.output = f.output;
|
|
2382
|
-
const D = (
|
|
2382
|
+
const D = (s.capture ? "(" : "") + y.open;
|
|
2383
2383
|
ke("parens"), T({ type: g, value: N, output: f.output ? "" : v }), T({ type: "paren", extglob: !0, value: re(), output: D }), M.push(y);
|
|
2384
|
-
},
|
|
2385
|
-
let N = g.close + (
|
|
2384
|
+
}, Ss = (g) => {
|
|
2385
|
+
let N = g.close + (s.capture ? ")" : "");
|
|
2386
2386
|
if (g.type === "negate") {
|
|
2387
2387
|
let y = U;
|
|
2388
|
-
g.inner && g.inner.length > 1 && g.inner.includes("/") && (y = H(
|
|
2388
|
+
g.inner && g.inner.length > 1 && g.inner.includes("/") && (y = H(s)), (y !== U || W() || /^\)+$/.test(ce())) && (N = g.close = `)$))${y}`), g.prev.type === "bos" && W() && (f.negatedExtglob = !0);
|
|
2389
2389
|
}
|
|
2390
2390
|
T({ type: "paren", extglob: !0, value: p, output: N }), ye("parens");
|
|
2391
2391
|
};
|
|
2392
|
-
if (
|
|
2392
|
+
if (s.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(t)) {
|
|
2393
2393
|
let g = !1, N = t.replace(li, (y, D, F, K, V, Ze) => K === "\\" ? (g = !0, y) : K === "?" ? D ? D + K + (V ? b.repeat(V.length) : "") : Ze === 0 ? L + (V ? b.repeat(V.length) : "") : b.repeat(F.length) : K === "." ? c.repeat(F.length) : K === "*" ? D ? D + K + (V ? U : "") : U : D ? y : `\\${y}`);
|
|
2394
|
-
return g === !0 && (
|
|
2394
|
+
return g === !0 && (s.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (y) => y.length % 2 === 0 ? "\\\\" : y ? "\\" : "")), N === t && s.contains === !0 ? (f.output = t, f) : (f.output = se.wrapOutput(N, f, e), f);
|
|
2395
2395
|
}
|
|
2396
2396
|
for (; !W(); ) {
|
|
2397
2397
|
if (p = re(), p === "\0")
|
|
2398
2398
|
continue;
|
|
2399
2399
|
if (p === "\\") {
|
|
2400
2400
|
const y = k();
|
|
2401
|
-
if (y === "/" &&
|
|
2401
|
+
if (y === "/" && s.bash !== !0 || y === "." || y === ";")
|
|
2402
2402
|
continue;
|
|
2403
2403
|
if (!y) {
|
|
2404
2404
|
p += "\\", T({ type: "text", value: p });
|
|
@@ -2406,13 +2406,13 @@ const Ge = Ye, ne = qe, {
|
|
|
2406
2406
|
}
|
|
2407
2407
|
const D = /^\\+/.exec(ce());
|
|
2408
2408
|
let F = 0;
|
|
2409
|
-
if (D && D[0].length > 2 && (F = D[0].length, f.index += F, F % 2 !== 0 && (p += "\\")),
|
|
2409
|
+
if (D && D[0].length > 2 && (F = D[0].length, f.index += F, F % 2 !== 0 && (p += "\\")), s.unescape === !0 ? p = re() || "" : p += re() || "", f.brackets === 0) {
|
|
2410
2410
|
T({ type: "text", value: p });
|
|
2411
2411
|
continue;
|
|
2412
2412
|
}
|
|
2413
2413
|
}
|
|
2414
2414
|
if (f.brackets > 0 && (p !== "]" || h.value === "[" || h.value === "[^")) {
|
|
2415
|
-
if (
|
|
2415
|
+
if (s.posix !== !1 && p === ":") {
|
|
2416
2416
|
const y = h.value.slice(1);
|
|
2417
2417
|
if (y.includes("[") && (h.posix = !0, y.includes(":"))) {
|
|
2418
2418
|
const D = h.value.lastIndexOf("["), F = h.value.slice(0, D), K = h.value.slice(D + 2), V = ui[K];
|
|
@@ -2422,15 +2422,15 @@ const Ge = Ye, ne = qe, {
|
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
2425
|
-
(p === "[" && k() !== ":" || p === "-" && k() === "]") && (p = `\\${p}`), p === "]" && (h.value === "[" || h.value === "[^") && (p = `\\${p}`),
|
|
2425
|
+
(p === "[" && k() !== ":" || p === "-" && k() === "]") && (p = `\\${p}`), p === "]" && (h.value === "[" || h.value === "[^") && (p = `\\${p}`), s.posix === !0 && p === "!" && h.value === "[" && (p = "^"), h.value += p, De({ value: p });
|
|
2426
2426
|
continue;
|
|
2427
2427
|
}
|
|
2428
2428
|
if (f.quotes === 1 && p !== '"') {
|
|
2429
|
-
p =
|
|
2429
|
+
p = se.escapeRegex(p), h.value += p, De({ value: p });
|
|
2430
2430
|
continue;
|
|
2431
2431
|
}
|
|
2432
2432
|
if (p === '"') {
|
|
2433
|
-
f.quotes = f.quotes === 1 ? 0 : 1,
|
|
2433
|
+
f.quotes = f.quotes === 1 ? 0 : 1, s.keepQuotes === !0 && T({ type: "text", value: p });
|
|
2434
2434
|
continue;
|
|
2435
2435
|
}
|
|
2436
2436
|
if (p === "(") {
|
|
@@ -2438,19 +2438,19 @@ const Ge = Ye, ne = qe, {
|
|
|
2438
2438
|
continue;
|
|
2439
2439
|
}
|
|
2440
2440
|
if (p === ")") {
|
|
2441
|
-
if (f.parens === 0 &&
|
|
2441
|
+
if (f.parens === 0 && s.strictBrackets === !0)
|
|
2442
2442
|
throw new SyntaxError(ve("opening", "("));
|
|
2443
2443
|
const y = M[M.length - 1];
|
|
2444
2444
|
if (y && f.parens === y.parens + 1) {
|
|
2445
|
-
|
|
2445
|
+
Ss(M.pop());
|
|
2446
2446
|
continue;
|
|
2447
2447
|
}
|
|
2448
2448
|
T({ type: "paren", value: p, output: f.parens ? ")" : "\\)" }), ye("parens");
|
|
2449
2449
|
continue;
|
|
2450
2450
|
}
|
|
2451
2451
|
if (p === "[") {
|
|
2452
|
-
if (
|
|
2453
|
-
if (
|
|
2452
|
+
if (s.nobracket === !0 || !ce().includes("]")) {
|
|
2453
|
+
if (s.nobracket !== !0 && s.strictBrackets === !0)
|
|
2454
2454
|
throw new SyntaxError(ve("closing", "]"));
|
|
2455
2455
|
p = `\\${p}`;
|
|
2456
2456
|
} else
|
|
@@ -2459,29 +2459,29 @@ const Ge = Ye, ne = qe, {
|
|
|
2459
2459
|
continue;
|
|
2460
2460
|
}
|
|
2461
2461
|
if (p === "]") {
|
|
2462
|
-
if (
|
|
2462
|
+
if (s.nobracket === !0 || h && h.type === "bracket" && h.value.length === 1) {
|
|
2463
2463
|
T({ type: "text", value: p, output: `\\${p}` });
|
|
2464
2464
|
continue;
|
|
2465
2465
|
}
|
|
2466
2466
|
if (f.brackets === 0) {
|
|
2467
|
-
if (
|
|
2467
|
+
if (s.strictBrackets === !0)
|
|
2468
2468
|
throw new SyntaxError(ve("opening", "["));
|
|
2469
2469
|
T({ type: "text", value: p, output: `\\${p}` });
|
|
2470
2470
|
continue;
|
|
2471
2471
|
}
|
|
2472
2472
|
ye("brackets");
|
|
2473
2473
|
const y = h.value.slice(1);
|
|
2474
|
-
if (h.posix !== !0 && y[0] === "^" && !y.includes("/") && (p = `/${p}`), h.value += p, De({ value: p }),
|
|
2474
|
+
if (h.posix !== !0 && y[0] === "^" && !y.includes("/") && (p = `/${p}`), h.value += p, De({ value: p }), s.literalBrackets === !1 || se.hasRegexChars(y))
|
|
2475
2475
|
continue;
|
|
2476
|
-
const D =
|
|
2477
|
-
if (f.output = f.output.slice(0, -h.value.length),
|
|
2476
|
+
const D = se.escapeRegex(h.value);
|
|
2477
|
+
if (f.output = f.output.slice(0, -h.value.length), s.literalBrackets === !0) {
|
|
2478
2478
|
f.output += D, h.value = D;
|
|
2479
2479
|
continue;
|
|
2480
2480
|
}
|
|
2481
2481
|
h.value = `(${a}${D}|${h.value})`, f.output += h.value;
|
|
2482
2482
|
continue;
|
|
2483
2483
|
}
|
|
2484
|
-
if (p === "{" &&
|
|
2484
|
+
if (p === "{" && s.nobrace !== !0) {
|
|
2485
2485
|
ke("braces");
|
|
2486
2486
|
const y = {
|
|
2487
2487
|
type: "brace",
|
|
@@ -2495,7 +2495,7 @@ const Ge = Ye, ne = qe, {
|
|
|
2495
2495
|
}
|
|
2496
2496
|
if (p === "}") {
|
|
2497
2497
|
const y = I[I.length - 1];
|
|
2498
|
-
if (
|
|
2498
|
+
if (s.nobrace === !0 || !y) {
|
|
2499
2499
|
T({ type: "text", value: p, output: p });
|
|
2500
2500
|
continue;
|
|
2501
2501
|
}
|
|
@@ -2504,7 +2504,7 @@ const Ge = Ye, ne = qe, {
|
|
|
2504
2504
|
const F = r.slice(), K = [];
|
|
2505
2505
|
for (let V = F.length - 1; V >= 0 && (r.pop(), F[V].type !== "brace"); V--)
|
|
2506
2506
|
F[V].type !== "dots" && K.unshift(F[V].value);
|
|
2507
|
-
D = fi(K,
|
|
2507
|
+
D = fi(K, s), f.backtrack = !0;
|
|
2508
2508
|
}
|
|
2509
2509
|
if (y.comma !== !0 && y.dots !== !0) {
|
|
2510
2510
|
const F = f.output.slice(0, y.outputIndex), K = f.tokens.slice(y.tokensIndex);
|
|
@@ -2548,19 +2548,19 @@ const Ge = Ye, ne = qe, {
|
|
|
2548
2548
|
continue;
|
|
2549
2549
|
}
|
|
2550
2550
|
if (p === "?") {
|
|
2551
|
-
if (!(h && h.value === "(") &&
|
|
2551
|
+
if (!(h && h.value === "(") && s.noextglob !== !0 && k() === "(" && k(2) !== "?") {
|
|
2552
2552
|
He("qmark", p);
|
|
2553
2553
|
continue;
|
|
2554
2554
|
}
|
|
2555
2555
|
if (h && h.type === "paren") {
|
|
2556
2556
|
const D = k();
|
|
2557
2557
|
let F = p;
|
|
2558
|
-
if (D === "<" && !
|
|
2558
|
+
if (D === "<" && !se.supportsLookbehinds())
|
|
2559
2559
|
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
2560
2560
|
(h.value === "(" && !/[!=<:]/.test(D) || D === "<" && !/<([!=]|\w+>)/.test(ce())) && (F = `\\${p}`), T({ type: "text", value: p, output: F });
|
|
2561
2561
|
continue;
|
|
2562
2562
|
}
|
|
2563
|
-
if (
|
|
2563
|
+
if (s.dot !== !0 && (h.type === "slash" || h.type === "bos")) {
|
|
2564
2564
|
T({ type: "qmark", value: p, output: A });
|
|
2565
2565
|
continue;
|
|
2566
2566
|
}
|
|
@@ -2568,21 +2568,21 @@ const Ge = Ye, ne = qe, {
|
|
|
2568
2568
|
continue;
|
|
2569
2569
|
}
|
|
2570
2570
|
if (p === "!") {
|
|
2571
|
-
if (
|
|
2571
|
+
if (s.noextglob !== !0 && k() === "(" && (k(2) !== "?" || !/[!=<:]/.test(k(3)))) {
|
|
2572
2572
|
He("negate", p);
|
|
2573
2573
|
continue;
|
|
2574
2574
|
}
|
|
2575
|
-
if (
|
|
2576
|
-
|
|
2575
|
+
if (s.nonegate !== !0 && f.index === 0) {
|
|
2576
|
+
Rs();
|
|
2577
2577
|
continue;
|
|
2578
2578
|
}
|
|
2579
2579
|
}
|
|
2580
2580
|
if (p === "+") {
|
|
2581
|
-
if (
|
|
2581
|
+
if (s.noextglob !== !0 && k() === "(" && k(2) !== "?") {
|
|
2582
2582
|
He("plus", p);
|
|
2583
2583
|
continue;
|
|
2584
2584
|
}
|
|
2585
|
-
if (h && h.value === "(" ||
|
|
2585
|
+
if (h && h.value === "(" || s.regex === !1) {
|
|
2586
2586
|
T({ type: "plus", value: p, output: d });
|
|
2587
2587
|
continue;
|
|
2588
2588
|
}
|
|
@@ -2594,7 +2594,7 @@ const Ge = Ye, ne = qe, {
|
|
|
2594
2594
|
continue;
|
|
2595
2595
|
}
|
|
2596
2596
|
if (p === "@") {
|
|
2597
|
-
if (
|
|
2597
|
+
if (s.noextglob !== !0 && k() === "(" && k(2) !== "?") {
|
|
2598
2598
|
T({ type: "at", extglob: !0, value: p, output: "" });
|
|
2599
2599
|
continue;
|
|
2600
2600
|
}
|
|
@@ -2612,17 +2612,17 @@ const Ge = Ye, ne = qe, {
|
|
|
2612
2612
|
continue;
|
|
2613
2613
|
}
|
|
2614
2614
|
let g = ce();
|
|
2615
|
-
if (
|
|
2615
|
+
if (s.noextglob !== !0 && /^\([^?]/.test(g)) {
|
|
2616
2616
|
He("star", p);
|
|
2617
2617
|
continue;
|
|
2618
2618
|
}
|
|
2619
2619
|
if (h.type === "star") {
|
|
2620
|
-
if (
|
|
2620
|
+
if (s.noglobstar === !0) {
|
|
2621
2621
|
Q(p);
|
|
2622
2622
|
continue;
|
|
2623
2623
|
}
|
|
2624
2624
|
const y = h.prev, D = y.prev, F = y.type === "slash" || y.type === "bos", K = D && (D.type === "star" || D.type === "globstar");
|
|
2625
|
-
if (
|
|
2625
|
+
if (s.bash === !0 && (!F || g[0] && g[0] !== "/")) {
|
|
2626
2626
|
T({ type: "star", value: p, output: "" });
|
|
2627
2627
|
continue;
|
|
2628
2628
|
}
|
|
@@ -2638,63 +2638,63 @@ const Ge = Ye, ne = qe, {
|
|
|
2638
2638
|
g = g.slice(3), Q("/**", 3);
|
|
2639
2639
|
}
|
|
2640
2640
|
if (y.type === "bos" && W()) {
|
|
2641
|
-
h.type = "globstar", h.value += p, h.output = H(
|
|
2641
|
+
h.type = "globstar", h.value += p, h.output = H(s), f.output = h.output, f.globstar = !0, Q(p);
|
|
2642
2642
|
continue;
|
|
2643
2643
|
}
|
|
2644
2644
|
if (y.type === "slash" && y.prev.type !== "bos" && !K && W()) {
|
|
2645
|
-
f.output = f.output.slice(0, -(y.output + h.output).length), y.output = `(?:${y.output}`, h.type = "globstar", h.output = H(
|
|
2645
|
+
f.output = f.output.slice(0, -(y.output + h.output).length), y.output = `(?:${y.output}`, h.type = "globstar", h.output = H(s) + (s.strictSlashes ? ")" : "|$)"), h.value += p, f.globstar = !0, f.output += y.output + h.output, Q(p);
|
|
2646
2646
|
continue;
|
|
2647
2647
|
}
|
|
2648
2648
|
if (y.type === "slash" && y.prev.type !== "bos" && g[0] === "/") {
|
|
2649
2649
|
const Ne = g[1] !== void 0 ? "|$" : "";
|
|
2650
|
-
f.output = f.output.slice(0, -(y.output + h.output).length), y.output = `(?:${y.output}`, h.type = "globstar", h.output = `${H(
|
|
2650
|
+
f.output = f.output.slice(0, -(y.output + h.output).length), y.output = `(?:${y.output}`, h.type = "globstar", h.output = `${H(s)}${_}|${_}${Ne})`, h.value += p, f.output += y.output + h.output, f.globstar = !0, Q(p + re()), T({ type: "slash", value: "/", output: "" });
|
|
2651
2651
|
continue;
|
|
2652
2652
|
}
|
|
2653
2653
|
if (y.type === "bos" && g[0] === "/") {
|
|
2654
|
-
h.type = "globstar", h.value += p, h.output = `(?:^|${_}|${H(
|
|
2654
|
+
h.type = "globstar", h.value += p, h.output = `(?:^|${_}|${H(s)}${_})`, f.output = h.output, f.globstar = !0, Q(p + re()), T({ type: "slash", value: "/", output: "" });
|
|
2655
2655
|
continue;
|
|
2656
2656
|
}
|
|
2657
|
-
f.output = f.output.slice(0, -h.output.length), h.type = "globstar", h.output = H(
|
|
2657
|
+
f.output = f.output.slice(0, -h.output.length), h.type = "globstar", h.output = H(s), h.value += p, f.output += h.output, f.globstar = !0, Q(p);
|
|
2658
2658
|
continue;
|
|
2659
2659
|
}
|
|
2660
2660
|
const N = { type: "star", value: p, output: U };
|
|
2661
|
-
if (
|
|
2662
|
-
N.output = ".*?", (h.type === "bos" || h.type === "slash") && (N.output =
|
|
2661
|
+
if (s.bash === !0) {
|
|
2662
|
+
N.output = ".*?", (h.type === "bos" || h.type === "slash") && (N.output = R + N.output), T(N);
|
|
2663
2663
|
continue;
|
|
2664
2664
|
}
|
|
2665
|
-
if (h && (h.type === "bracket" || h.type === "paren") &&
|
|
2665
|
+
if (h && (h.type === "bracket" || h.type === "paren") && s.regex === !0) {
|
|
2666
2666
|
N.output = p, T(N);
|
|
2667
2667
|
continue;
|
|
2668
2668
|
}
|
|
2669
|
-
(f.index === f.start || h.type === "slash" || h.type === "dot") && (h.type === "dot" ? (f.output += w, h.output += w) :
|
|
2669
|
+
(f.index === f.start || h.type === "slash" || h.type === "dot") && (h.type === "dot" ? (f.output += w, h.output += w) : s.dot === !0 ? (f.output += x, h.output += x) : (f.output += R, h.output += R), k() !== "*" && (f.output += v, h.output += v)), T(N);
|
|
2670
2670
|
}
|
|
2671
2671
|
for (; f.brackets > 0; ) {
|
|
2672
|
-
if (
|
|
2672
|
+
if (s.strictBrackets === !0)
|
|
2673
2673
|
throw new SyntaxError(ve("closing", "]"));
|
|
2674
|
-
f.output =
|
|
2674
|
+
f.output = se.escapeLast(f.output, "["), ye("brackets");
|
|
2675
2675
|
}
|
|
2676
2676
|
for (; f.parens > 0; ) {
|
|
2677
|
-
if (
|
|
2677
|
+
if (s.strictBrackets === !0)
|
|
2678
2678
|
throw new SyntaxError(ve("closing", ")"));
|
|
2679
|
-
f.output =
|
|
2679
|
+
f.output = se.escapeLast(f.output, "("), ye("parens");
|
|
2680
2680
|
}
|
|
2681
2681
|
for (; f.braces > 0; ) {
|
|
2682
|
-
if (
|
|
2682
|
+
if (s.strictBrackets === !0)
|
|
2683
2683
|
throw new SyntaxError(ve("closing", "}"));
|
|
2684
|
-
f.output =
|
|
2684
|
+
f.output = se.escapeLast(f.output, "{"), ye("braces");
|
|
2685
2685
|
}
|
|
2686
|
-
if (
|
|
2686
|
+
if (s.strictSlashes !== !0 && (h.type === "star" || h.type === "bracket") && T({ type: "maybe_slash", value: "", output: `${_}?` }), f.backtrack === !0) {
|
|
2687
2687
|
f.output = "";
|
|
2688
2688
|
for (const g of f.tokens)
|
|
2689
2689
|
f.output += g.output != null ? g.output : g.value, g.suffix && (f.output += g.suffix);
|
|
2690
2690
|
}
|
|
2691
2691
|
return f;
|
|
2692
2692
|
};
|
|
2693
|
-
|
|
2694
|
-
const
|
|
2695
|
-
if (i >
|
|
2696
|
-
throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${
|
|
2697
|
-
t =
|
|
2693
|
+
bs.fastpaths = (t, e) => {
|
|
2694
|
+
const s = { ...e }, n = typeof s.maxLength == "number" ? Math.min(Ve, s.maxLength) : Ve, i = t.length;
|
|
2695
|
+
if (i > n)
|
|
2696
|
+
throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);
|
|
2697
|
+
t = _s[t] || t;
|
|
2698
2698
|
const {
|
|
2699
2699
|
DOT_LITERAL: o,
|
|
2700
2700
|
SLASH_LITERAL: r,
|
|
@@ -2705,11 +2705,11 @@ wn.fastpaths = (t, e) => {
|
|
|
2705
2705
|
NO_DOTS_SLASH: d,
|
|
2706
2706
|
STAR: _,
|
|
2707
2707
|
START_ANCHOR: v
|
|
2708
|
-
} = Ge.globChars(
|
|
2709
|
-
let b =
|
|
2710
|
-
|
|
2711
|
-
const A = (
|
|
2712
|
-
switch (
|
|
2708
|
+
} = Ge.globChars(s.windows), m = s.dot ? c : l, S = s.dot ? d : l, w = s.capture ? "" : "?:", x = { negated: !1, prefix: "" };
|
|
2709
|
+
let b = s.bash === !0 ? ".*?" : _;
|
|
2710
|
+
s.capture && (b = `(${b})`);
|
|
2711
|
+
const A = (R) => R.noglobstar === !0 ? b : `(${w}(?:(?!${v}${R.dot ? u : o}).)*?)`, E = (R) => {
|
|
2712
|
+
switch (R) {
|
|
2713
2713
|
case "*":
|
|
2714
2714
|
return `${m}${a}${b}`;
|
|
2715
2715
|
case ".*":
|
|
@@ -2719,29 +2719,29 @@ wn.fastpaths = (t, e) => {
|
|
|
2719
2719
|
case "*/*":
|
|
2720
2720
|
return `${m}${b}${r}${a}${S}${b}`;
|
|
2721
2721
|
case "**":
|
|
2722
|
-
return m + A(
|
|
2722
|
+
return m + A(s);
|
|
2723
2723
|
case "**/*":
|
|
2724
|
-
return `(?:${m}${A(
|
|
2724
|
+
return `(?:${m}${A(s)}${r})?${S}${a}${b}`;
|
|
2725
2725
|
case "**/*.*":
|
|
2726
|
-
return `(?:${m}${A(
|
|
2726
|
+
return `(?:${m}${A(s)}${r})?${S}${b}${o}${a}${b}`;
|
|
2727
2727
|
case "**/.*":
|
|
2728
|
-
return `(?:${m}${A(
|
|
2728
|
+
return `(?:${m}${A(s)}${r})?${o}${a}${b}`;
|
|
2729
2729
|
default: {
|
|
2730
|
-
const L = /^(.*?)\.(\w+)$/.exec(
|
|
2730
|
+
const L = /^(.*?)\.(\w+)$/.exec(R);
|
|
2731
2731
|
if (!L)
|
|
2732
2732
|
return;
|
|
2733
2733
|
const U = E(L[1]);
|
|
2734
2734
|
return U ? U + o + L[2] : void 0;
|
|
2735
2735
|
}
|
|
2736
2736
|
}
|
|
2737
|
-
},
|
|
2738
|
-
let H = E(
|
|
2739
|
-
return H &&
|
|
2737
|
+
}, O = se.removePrefix(t, x);
|
|
2738
|
+
let H = E(O);
|
|
2739
|
+
return H && s.strictSlashes !== !0 && (H += `${r}?`), H;
|
|
2740
2740
|
};
|
|
2741
|
-
var pi =
|
|
2742
|
-
const hi = ai, dt = pi,
|
|
2741
|
+
var pi = bs;
|
|
2742
|
+
const hi = ai, dt = pi, ws = qe, di = Ye, mi = (t) => t && typeof t == "object" && !Array.isArray(t), G = (t, e, s = !1) => {
|
|
2743
2743
|
if (Array.isArray(t)) {
|
|
2744
|
-
const c = t.map((_) => G(_, e,
|
|
2744
|
+
const c = t.map((_) => G(_, e, s));
|
|
2745
2745
|
return (_) => {
|
|
2746
2746
|
for (const v of c) {
|
|
2747
2747
|
const m = v(_);
|
|
@@ -2751,84 +2751,84 @@ const hi = ai, dt = pi, vn = qe, di = Ye, mi = (t) => t && typeof t == "object"
|
|
|
2751
2751
|
return !1;
|
|
2752
2752
|
};
|
|
2753
2753
|
}
|
|
2754
|
-
const
|
|
2755
|
-
if (t === "" || typeof t != "string" && !
|
|
2754
|
+
const n = mi(t) && t.tokens && t.input;
|
|
2755
|
+
if (t === "" || typeof t != "string" && !n)
|
|
2756
2756
|
throw new TypeError("Expected pattern to be a non-empty string");
|
|
2757
|
-
const i = e || {}, o = i.windows, r =
|
|
2757
|
+
const i = e || {}, o = i.windows, r = n ? G.compileRe(t, e) : G.makeRe(t, e, !1, !0), a = r.state;
|
|
2758
2758
|
delete r.state;
|
|
2759
2759
|
let u = () => !1;
|
|
2760
2760
|
if (i.ignore) {
|
|
2761
2761
|
const c = { ...e, ignore: null, onMatch: null, onResult: null };
|
|
2762
|
-
u = G(i.ignore, c,
|
|
2762
|
+
u = G(i.ignore, c, s);
|
|
2763
2763
|
}
|
|
2764
2764
|
const l = (c, d = !1) => {
|
|
2765
2765
|
const { isMatch: _, match: v, output: m } = G.test(c, r, e, { glob: t, posix: o }), S = { glob: t, state: a, regex: r, posix: o, input: c, output: m, match: v, isMatch: _ };
|
|
2766
2766
|
return typeof i.onResult == "function" && i.onResult(S), _ === !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);
|
|
2767
2767
|
};
|
|
2768
|
-
return
|
|
2768
|
+
return s && (l.state = a), l;
|
|
2769
2769
|
};
|
|
2770
|
-
G.test = (t, e,
|
|
2770
|
+
G.test = (t, e, s, { glob: n, posix: i } = {}) => {
|
|
2771
2771
|
if (typeof t != "string")
|
|
2772
2772
|
throw new TypeError("Expected input to be a string");
|
|
2773
2773
|
if (t === "")
|
|
2774
2774
|
return { isMatch: !1, output: "" };
|
|
2775
|
-
const o =
|
|
2776
|
-
let a = t ===
|
|
2777
|
-
return a === !1 && (u = r ? r(t) : t, a = u ===
|
|
2775
|
+
const o = s || {}, r = o.format || (i ? ws.toPosixSlashes : null);
|
|
2776
|
+
let a = t === n, u = a && r ? r(t) : t;
|
|
2777
|
+
return a === !1 && (u = r ? r(t) : t, a = u === n), (a === !1 || o.capture === !0) && (o.matchBase === !0 || o.basename === !0 ? a = G.matchBase(t, e, s, i) : a = e.exec(u)), { isMatch: !!a, match: a, output: u };
|
|
2778
2778
|
};
|
|
2779
|
-
G.matchBase = (t, e,
|
|
2780
|
-
G.isMatch = (t, e,
|
|
2781
|
-
G.parse = (t, e) => Array.isArray(t) ? t.map((
|
|
2779
|
+
G.matchBase = (t, e, s) => (e instanceof RegExp ? e : G.makeRe(e, s)).test(ws.basename(t));
|
|
2780
|
+
G.isMatch = (t, e, s) => G(e, s)(t);
|
|
2781
|
+
G.parse = (t, e) => Array.isArray(t) ? t.map((s) => G.parse(s, e)) : dt(t, { ...e, fastpaths: !1 });
|
|
2782
2782
|
G.scan = (t, e) => hi(t, e);
|
|
2783
|
-
G.compileRe = (t, e,
|
|
2784
|
-
if (
|
|
2783
|
+
G.compileRe = (t, e, s = !1, n = !1) => {
|
|
2784
|
+
if (s === !0)
|
|
2785
2785
|
return t.output;
|
|
2786
2786
|
const i = e || {}, o = i.contains ? "" : "^", r = i.contains ? "" : "$";
|
|
2787
2787
|
let a = `${o}(?:${t.output})${r}`;
|
|
2788
2788
|
t && t.negated === !0 && (a = `^(?!${a}).*$`);
|
|
2789
2789
|
const u = G.toRegex(a, e);
|
|
2790
|
-
return
|
|
2790
|
+
return n === !0 && (u.state = t), u;
|
|
2791
2791
|
};
|
|
2792
|
-
G.makeRe = (t, e,
|
|
2792
|
+
G.makeRe = (t, e, s = !1, n = !1) => {
|
|
2793
2793
|
if (!t || typeof t != "string")
|
|
2794
2794
|
throw new TypeError("Expected a non-empty string");
|
|
2795
2795
|
const i = e || {};
|
|
2796
2796
|
let o = { negated: !1, fastpaths: !0 }, r = "", a;
|
|
2797
|
-
return t.startsWith("./") && (t = t.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (t[0] === "." || t[0] === "*") && (a = dt.fastpaths(t, e)), a === void 0 ? (o = dt(t, e), o.prefix = r + (o.prefix || "")) : o.output = a, G.compileRe(o, e,
|
|
2797
|
+
return t.startsWith("./") && (t = t.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (t[0] === "." || t[0] === "*") && (a = dt.fastpaths(t, e)), a === void 0 ? (o = dt(t, e), o.prefix = r + (o.prefix || "")) : o.output = a, G.compileRe(o, e, s, n);
|
|
2798
2798
|
};
|
|
2799
2799
|
G.toRegex = (t, e) => {
|
|
2800
2800
|
try {
|
|
2801
|
-
const
|
|
2802
|
-
return new RegExp(t,
|
|
2803
|
-
} catch (
|
|
2801
|
+
const s = e || {};
|
|
2802
|
+
return new RegExp(t, s.flags || (s.nocase ? "i" : ""));
|
|
2803
|
+
} catch (s) {
|
|
2804
2804
|
if (e && e.debug === !0)
|
|
2805
|
-
throw
|
|
2805
|
+
throw s;
|
|
2806
2806
|
return /$^/;
|
|
2807
2807
|
}
|
|
2808
2808
|
};
|
|
2809
2809
|
G.constants = di;
|
|
2810
2810
|
var yi = G, gi = yi;
|
|
2811
|
-
const _i = /* @__PURE__ */ mt(gi),
|
|
2812
|
-
const
|
|
2813
|
-
|
|
2814
|
-
const i = await (await
|
|
2811
|
+
const _i = /* @__PURE__ */ mt(gi), vs = yt(fetch), bi = async (t, e) => {
|
|
2812
|
+
const s = new URL(t);
|
|
2813
|
+
s.pathname = s.pathname + (s.pathname.endsWith("/") ? "metapage.json" : "/metapage.json");
|
|
2814
|
+
const i = await (await vs(s.href, {
|
|
2815
2815
|
redirect: "follow",
|
|
2816
2816
|
retries: 3,
|
|
2817
2817
|
retryDelay: 1e3
|
|
2818
2818
|
})).json();
|
|
2819
|
-
return await
|
|
2819
|
+
return await ts(i, e || Le);
|
|
2820
2820
|
}, wi = async (t, e) => {
|
|
2821
2821
|
if (t.startsWith("data:") || t.startsWith("https://docs.google.com"))
|
|
2822
2822
|
return;
|
|
2823
|
-
const
|
|
2824
|
-
if (
|
|
2823
|
+
const s = new URL(t);
|
|
2824
|
+
if (s.origin.endsWith(".notion.site"))
|
|
2825
2825
|
return;
|
|
2826
|
-
let
|
|
2827
|
-
if (
|
|
2828
|
-
return pt(
|
|
2829
|
-
|
|
2826
|
+
let n = Rt(t, "definition");
|
|
2827
|
+
if (n != null && n.version)
|
|
2828
|
+
return pt(n);
|
|
2829
|
+
s.pathname.endsWith("metaframe.json") || (s.pathname = s.pathname + (s.pathname.endsWith("/") ? "metaframe.json" : "/metaframe.json"));
|
|
2830
2830
|
try {
|
|
2831
|
-
const i = await
|
|
2831
|
+
const i = await vs(s.href, {
|
|
2832
2832
|
redirect: "follow",
|
|
2833
2833
|
retries: 3,
|
|
2834
2834
|
retryDelay: 1e3
|
|
@@ -2836,30 +2836,30 @@ const _i = /* @__PURE__ */ mt(gi), Rn = yt(fetch), bi = async (t, e) => {
|
|
|
2836
2836
|
if (i.status !== 200)
|
|
2837
2837
|
return;
|
|
2838
2838
|
const o = await i.json();
|
|
2839
|
-
return await
|
|
2839
|
+
return await ss(o, e || We);
|
|
2840
2840
|
} catch (i) {
|
|
2841
|
-
console.error(`Error fetching metaframe definition from ${
|
|
2841
|
+
console.error(`Error fetching metaframe definition from ${s.href}: ${i}`);
|
|
2842
2842
|
return;
|
|
2843
2843
|
}
|
|
2844
2844
|
}, Ji = (t) => t ? !(t != null && t.inputs && Object.keys(t.inputs).length > 0 || t != null && t.outputs && Object.keys(t.outputs).length > 0 || t != null && t.allow || t != null && t.metadata && Object.keys(t.metadata).length > 0) : !0;
|
|
2845
|
-
class vi extends
|
|
2846
|
-
constructor(e,
|
|
2845
|
+
class vi extends Ot.EventEmitter {
|
|
2846
|
+
constructor(e, s, n, i, o, r = !1) {
|
|
2847
2847
|
if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this._cachedEventInputsUpdate = {
|
|
2848
2848
|
iframeId: void 0,
|
|
2849
2849
|
inputs: void 0
|
|
2850
2850
|
}, this._cachedEventOutputsUpdate = {
|
|
2851
2851
|
iframeId: null,
|
|
2852
2852
|
inputs: null
|
|
2853
|
-
}, !
|
|
2854
|
-
for (;
|
|
2855
|
-
|
|
2856
|
-
|
|
2853
|
+
}, !s.startsWith("data:") && !s.startsWith("http")) {
|
|
2854
|
+
for (; s.startsWith("/"); )
|
|
2855
|
+
s = s.substring(1);
|
|
2856
|
+
s = window.location.protocol + "//" + window.location.hostname + (window.location.port && window.location.port != "" ? ":" + window.location.port : "") + "/" + s;
|
|
2857
2857
|
}
|
|
2858
|
-
if (this.url =
|
|
2858
|
+
if (this.url = s, this._metapage = e, this._debug = r, r) {
|
|
2859
2859
|
var a = new URL(this.url);
|
|
2860
2860
|
a.searchParams.set(xe.mp_debug, "true"), this.url = a.href;
|
|
2861
2861
|
}
|
|
2862
|
-
this.id =
|
|
2862
|
+
this.id = n, this._parentId = i, this._color = ps(this.id), this._consoleBackgroundColor = o, this._iframe = document.createElement("iframe"), this._iframe.name = this.id;
|
|
2863
2863
|
const u = this;
|
|
2864
2864
|
this.iframe = new Promise((l) => {
|
|
2865
2865
|
Xe().then(async () => {
|
|
@@ -2868,7 +2868,7 @@ class vi extends Rt.EventEmitter {
|
|
|
2868
2868
|
if ((v = (_ = (d = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : d.metaframes) == null ? void 0 : _[this.id]) != null && v.allow)
|
|
2869
2869
|
u._iframe.allow = this._metapage._definition.metaframes[this.id].allow, this._debug && this.log(`mf allow=${u._iframe.allow} from this._metapage?._definition`);
|
|
2870
2870
|
else {
|
|
2871
|
-
let m =
|
|
2871
|
+
let m = Rt(this.url, "definition");
|
|
2872
2872
|
if (m = m && (m != null && m.version) ? await pt(m) : void 0, !u._iframe)
|
|
2873
2873
|
return;
|
|
2874
2874
|
if (m != null && m.allow)
|
|
@@ -2885,9 +2885,9 @@ class vi extends Rt.EventEmitter {
|
|
|
2885
2885
|
});
|
|
2886
2886
|
}), this.ack = this.ack.bind(this), this.dispose = this.dispose.bind(this), this.getDefinition = this.getDefinition.bind(this), this.getDefinitionUrl = this.getDefinitionUrl.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.onOutput = this.onOutput.bind(this), this.onOutputs = this.onOutputs.bind(this), this.register = this.register.bind(this), this.registered = this.registered.bind(this), this.sendInputs = this.sendInputs.bind(this), this.sendOrBufferPostMessage = this.sendOrBufferPostMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.sendRpcInternal = this.sendRpcInternal.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setMetapage = this.setMetapage.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.isDisposed = this.isDisposed.bind(this);
|
|
2887
2887
|
}
|
|
2888
|
-
addListenerReturnDisposer(e,
|
|
2889
|
-
return super.addListener(e,
|
|
2890
|
-
super.removeListener(e,
|
|
2888
|
+
addListenerReturnDisposer(e, s) {
|
|
2889
|
+
return super.addListener(e, s), () => {
|
|
2890
|
+
super.removeListener(e, s);
|
|
2891
2891
|
};
|
|
2892
2892
|
}
|
|
2893
2893
|
setMetapage(e) {
|
|
@@ -2901,62 +2901,62 @@ class vi extends Rt.EventEmitter {
|
|
|
2901
2901
|
if (this._definition)
|
|
2902
2902
|
return this._definition;
|
|
2903
2903
|
try {
|
|
2904
|
-
const
|
|
2905
|
-
if (
|
|
2906
|
-
return this._definition =
|
|
2907
|
-
} catch (
|
|
2904
|
+
const s = await wi(this.url);
|
|
2905
|
+
if (s)
|
|
2906
|
+
return this._definition = s, this._definition;
|
|
2907
|
+
} catch (s) {
|
|
2908
2908
|
var e = this.getDefinitionUrl();
|
|
2909
|
-
this.emit(
|
|
2910
|
-
Error: ${
|
|
2909
|
+
this.emit($.Warning, `Failed to fetch or convert: ${e}
|
|
2910
|
+
Error: ${s != null && s.message ? s == null ? void 0 : s.message : s == null ? void 0 : s.toString()}`);
|
|
2911
2911
|
}
|
|
2912
2912
|
}
|
|
2913
|
-
setInput(e,
|
|
2913
|
+
setInput(e, s) {
|
|
2914
2914
|
console.assert(!!e);
|
|
2915
|
-
var
|
|
2916
|
-
|
|
2915
|
+
var n = {};
|
|
2916
|
+
n[e] = s, this.setInputs(n);
|
|
2917
2917
|
}
|
|
2918
2918
|
setInputs(e) {
|
|
2919
2919
|
this.log({ m: "MetapageIFrameRpcClient", inputs: e });
|
|
2920
|
-
const
|
|
2921
|
-
if (this.inputs = Je(this.inputs, e), this.inputs ===
|
|
2920
|
+
const s = e;
|
|
2921
|
+
if (this.inputs = Je(this.inputs, e), this.inputs === s)
|
|
2922
2922
|
return this;
|
|
2923
|
-
if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(e), this.emit(
|
|
2924
|
-
var
|
|
2925
|
-
|
|
2923
|
+
if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(e), this.emit($.Inputs, this.inputs), this._metapage.listenerCount($.Inputs) > 0) {
|
|
2924
|
+
var n = {};
|
|
2925
|
+
n[this.id] = e, this._metapage.emit($.Inputs, n);
|
|
2926
2926
|
}
|
|
2927
2927
|
return this;
|
|
2928
2928
|
}
|
|
2929
|
-
setOutput(e,
|
|
2929
|
+
setOutput(e, s) {
|
|
2930
2930
|
console.assert(!!e);
|
|
2931
|
-
var
|
|
2932
|
-
|
|
2931
|
+
var n = {};
|
|
2932
|
+
n[e] = s, this.setOutputs(n);
|
|
2933
2933
|
}
|
|
2934
2934
|
setOutputs(e) {
|
|
2935
|
-
const
|
|
2936
|
-
if (this.outputs = Je(this.outputs, e), this.outputs ===
|
|
2935
|
+
const s = e;
|
|
2936
|
+
if (this.outputs = Je(this.outputs, e), this.outputs === s)
|
|
2937
2937
|
return this;
|
|
2938
|
-
if (this.emit(
|
|
2939
|
-
var
|
|
2940
|
-
|
|
2938
|
+
if (this.emit($.Outputs, e), this._metapage.listenerCount($.Outputs) > 0) {
|
|
2939
|
+
var n = {};
|
|
2940
|
+
n[this.id] = this.outputs, this._metapage.emit($.Outputs, n);
|
|
2941
2941
|
}
|
|
2942
2942
|
}
|
|
2943
2943
|
onInputs(e) {
|
|
2944
|
-
return this.addListenerReturnDisposer(
|
|
2944
|
+
return this.addListenerReturnDisposer($.Inputs, e);
|
|
2945
2945
|
}
|
|
2946
|
-
onInput(e,
|
|
2947
|
-
var
|
|
2948
|
-
i.hasOwnProperty(e) &&
|
|
2946
|
+
onInput(e, s) {
|
|
2947
|
+
var n = function(i) {
|
|
2948
|
+
i.hasOwnProperty(e) && s(i[e]);
|
|
2949
2949
|
};
|
|
2950
|
-
return this.addListenerReturnDisposer(
|
|
2950
|
+
return this.addListenerReturnDisposer($.Inputs, n);
|
|
2951
2951
|
}
|
|
2952
2952
|
onOutputs(e) {
|
|
2953
|
-
return this.addListenerReturnDisposer(
|
|
2953
|
+
return this.addListenerReturnDisposer($.Outputs, e);
|
|
2954
2954
|
}
|
|
2955
|
-
onOutput(e,
|
|
2956
|
-
var
|
|
2957
|
-
i.hasOwnProperty(e) &&
|
|
2955
|
+
onOutput(e, s) {
|
|
2956
|
+
var n = function(i) {
|
|
2957
|
+
i.hasOwnProperty(e) && s(i[e]);
|
|
2958
2958
|
};
|
|
2959
|
-
return this.addListenerReturnDisposer(
|
|
2959
|
+
return this.addListenerReturnDisposer($.Outputs, n);
|
|
2960
2960
|
}
|
|
2961
2961
|
isDisposed() {
|
|
2962
2962
|
return this.inputs === void 0;
|
|
@@ -2994,44 +2994,44 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
|
|
|
2994
2994
|
parentId: this._parentId
|
|
2995
2995
|
}));
|
|
2996
2996
|
}
|
|
2997
|
-
sendRpc(e,
|
|
2998
|
-
var
|
|
2999
|
-
if ((
|
|
3000
|
-
this.sendRpcInternal(e,
|
|
2997
|
+
sendRpc(e, s) {
|
|
2998
|
+
var n, i;
|
|
2999
|
+
if ((n = this == null ? void 0 : this._iframe) != null && n.parentNode && this._loaded)
|
|
3000
|
+
this.sendRpcInternal(e, s);
|
|
3001
3001
|
else {
|
|
3002
3002
|
(i = this == null ? void 0 : this._metapage) == null || i.error("sending rpc later");
|
|
3003
3003
|
const o = this;
|
|
3004
3004
|
this == null || this._onLoaded.push(() => {
|
|
3005
|
-
o.sendRpcInternal(e,
|
|
3005
|
+
o.sendRpcInternal(e, s);
|
|
3006
3006
|
});
|
|
3007
3007
|
}
|
|
3008
3008
|
}
|
|
3009
3009
|
ack(e) {
|
|
3010
3010
|
if (this._debug) {
|
|
3011
3011
|
this.log("⚒ ⚒ ⚒ sending ack from client to frame");
|
|
3012
|
-
var
|
|
3012
|
+
var s = {
|
|
3013
3013
|
message: e
|
|
3014
3014
|
};
|
|
3015
|
-
this.sendRpc(me.MessageAck,
|
|
3015
|
+
this.sendRpc(me.MessageAck, s);
|
|
3016
3016
|
}
|
|
3017
3017
|
}
|
|
3018
3018
|
log(e) {
|
|
3019
3019
|
this._debug && this.logInternal(e);
|
|
3020
3020
|
}
|
|
3021
3021
|
logInternal(e) {
|
|
3022
|
-
let
|
|
3023
|
-
typeof e == "string" ?
|
|
3022
|
+
let s;
|
|
3023
|
+
typeof e == "string" ? s = e : typeof e == "string" ? s = e + "" : s = JSON.stringify(e), At(`Metapage[${this._parentId}] Metaframe[${this.id}] ${s}`, this._color, this._consoleBackgroundColor);
|
|
3024
3024
|
}
|
|
3025
|
-
sendRpcInternal(e,
|
|
3026
|
-
const
|
|
3025
|
+
sendRpcInternal(e, s) {
|
|
3026
|
+
const n = {
|
|
3027
3027
|
id: "_",
|
|
3028
3028
|
iframeId: this.id,
|
|
3029
3029
|
jsonrpc: "2.0",
|
|
3030
3030
|
method: e,
|
|
3031
|
-
params:
|
|
3031
|
+
params: s,
|
|
3032
3032
|
parentId: this._parentId
|
|
3033
3033
|
};
|
|
3034
|
-
this._iframe ? this.sendOrBufferPostMessage(
|
|
3034
|
+
this._iframe ? this.sendOrBufferPostMessage(n) : this._metapage ? this._metapage.error(`Cannot send to child iframe messageJSON=${JSON.stringify(n).substring(0, 200)}`) : console.error(`Cannot send to child iframe messageJSON=${JSON.stringify(n).substring(0, 200)}`);
|
|
3035
3035
|
}
|
|
3036
3036
|
sendOrBufferPostMessage(e) {
|
|
3037
3037
|
if (this._iframe && this._iframe.contentWindow)
|
|
@@ -3040,9 +3040,9 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
|
|
|
3040
3040
|
this._bufferMessages.push(e);
|
|
3041
3041
|
else {
|
|
3042
3042
|
this._bufferMessages = [e];
|
|
3043
|
-
const
|
|
3043
|
+
const s = this;
|
|
3044
3044
|
this._bufferTimeout = window.setInterval(function() {
|
|
3045
|
-
|
|
3045
|
+
s._iframe && s._iframe.contentWindow && (s._bufferMessages.forEach((n) => s._iframe.contentWindow.postMessage(n, s.url)), window.clearInterval(s._bufferTimeout), s._bufferTimeout = void 0, s._bufferMessages = void 0);
|
|
3046
3046
|
}, 0);
|
|
3047
3047
|
}
|
|
3048
3048
|
}
|
|
@@ -3052,9 +3052,9 @@ const ge = C({
|
|
|
3052
3052
|
inputs: {},
|
|
3053
3053
|
outputs: {}
|
|
3054
3054
|
}
|
|
3055
|
-
}, (t) => t), Gi = (t) => he(t),
|
|
3056
|
-
class ee extends
|
|
3057
|
-
static async from(e,
|
|
3055
|
+
}, (t) => t), Gi = (t) => he(t), Oi = (t, e) => !!(!e || e === "**" || t === e || _i.isMatch(t, e)), Ri = "bcbcbc";
|
|
3056
|
+
class ee extends Nn {
|
|
3057
|
+
static async from(e, s) {
|
|
3058
3058
|
if (e == null)
|
|
3059
3059
|
throw "Metapage definition cannot be null";
|
|
3060
3060
|
if (typeof e == "string")
|
|
@@ -3063,33 +3063,42 @@ class ee extends Ns {
|
|
|
3063
3063
|
} catch {
|
|
3064
3064
|
throw "Cannot parse into JSON:\n${metaPageDef}";
|
|
3065
3065
|
}
|
|
3066
|
-
var
|
|
3067
|
-
return
|
|
3066
|
+
var n = new ee();
|
|
3067
|
+
return n.setDefinition(e);
|
|
3068
3068
|
}
|
|
3069
3069
|
constructor(e) {
|
|
3070
|
-
super(), this._state = ge, this._metaframes = C({}, (
|
|
3070
|
+
super(), this._state = ge, this._metaframes = C({}, (s) => s), this.debug = ht(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (s) => s), this._inputMap = {}, this._id = e && e.id ? e.id : jn(), this._consoleBackgroundColor = e && e.color ? e.color : Ri, 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.onMessageJsonRpc = this.onMessageJsonRpc.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.setOutputs = this.setOutputs.bind(this), this.onInputs = this.onInputs.bind(this), this.onOutputs = this.onOutputs.bind(this), this.onState = this.onState.bind(this), this.setMetaframeOutputs = this.setMetaframeOutputs.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.setMetadata = this.setMetadata.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), Xe().then(() => {
|
|
3071
3071
|
this.isDisposed() || (window.addEventListener("message", this.onMessage), this.log("Initialized"));
|
|
3072
3072
|
});
|
|
3073
3073
|
}
|
|
3074
3074
|
isDisposed() {
|
|
3075
3075
|
return this._metaframes === void 0;
|
|
3076
3076
|
}
|
|
3077
|
-
addListenerReturnDisposer(e,
|
|
3078
|
-
return super.addListener(e,
|
|
3079
|
-
super.removeListener(e,
|
|
3077
|
+
addListenerReturnDisposer(e, s) {
|
|
3078
|
+
return super.addListener(e, s), () => {
|
|
3079
|
+
super.removeListener(e, s);
|
|
3080
3080
|
};
|
|
3081
3081
|
}
|
|
3082
|
+
onInputs(e) {
|
|
3083
|
+
return this.addListenerReturnDisposer($.Inputs, e);
|
|
3084
|
+
}
|
|
3085
|
+
onOutputs(e) {
|
|
3086
|
+
return this.addListenerReturnDisposer($.Outputs, e);
|
|
3087
|
+
}
|
|
3088
|
+
onState(e) {
|
|
3089
|
+
return this.addListenerReturnDisposer($.State, e);
|
|
3090
|
+
}
|
|
3082
3091
|
setDebugFromUrlParams() {
|
|
3083
3092
|
const e = new URL(window.location.href);
|
|
3084
|
-
return this.debug = ["debug", "mp_debug"].reduce((
|
|
3093
|
+
return this.debug = ["debug", "mp_debug"].reduce((s, n) => s || e.searchParams.get(n) === "true" || e.searchParams.get(n) === "1", !1), this;
|
|
3085
3094
|
}
|
|
3086
3095
|
getState() {
|
|
3087
3096
|
return this._state;
|
|
3088
3097
|
}
|
|
3089
3098
|
setState(e) {
|
|
3090
|
-
this._state = C(e, (
|
|
3091
|
-
this.getMetaframe(
|
|
3092
|
-
}), this.listenerCount(
|
|
3099
|
+
this._state = C(e, (s) => s), this.getMetaframeIds().forEach((s) => {
|
|
3100
|
+
this.getMetaframe(s).setInputs(this._state.metaframes.inputs[s]), this.getMetaframe(s).setOutputs(this._state.metaframes.outputs[s]);
|
|
3101
|
+
}), this.listenerCount($.State) > 0 && ge !== this._state && this.emit($.State, this._state);
|
|
3093
3102
|
}
|
|
3094
3103
|
getStateMetaframes() {
|
|
3095
3104
|
return this._state.metaframes;
|
|
@@ -3097,63 +3106,63 @@ class ee extends Ns {
|
|
|
3097
3106
|
getDefinition() {
|
|
3098
3107
|
return this._definition;
|
|
3099
3108
|
}
|
|
3100
|
-
async setDefinition(e,
|
|
3109
|
+
async setDefinition(e, s) {
|
|
3101
3110
|
if (!e.version)
|
|
3102
3111
|
throw "Metapage definition must have a version";
|
|
3103
|
-
const
|
|
3112
|
+
const n = await Vs(e);
|
|
3104
3113
|
if (this.isDisposed())
|
|
3105
3114
|
return this;
|
|
3106
|
-
|
|
3107
|
-
var r =
|
|
3115
|
+
n.metaframes && Object.keys(n.metaframes).forEach((o) => {
|
|
3116
|
+
var r = n.metaframes[o];
|
|
3108
3117
|
if (typeof r != "object")
|
|
3109
3118
|
throw this.emitErrorMessage(`Metaframe "${o}" is not an object`), `Metaframe "${o}" is not an object`;
|
|
3110
3119
|
if (!r.url)
|
|
3111
3120
|
throw this.emitErrorMessage(`Metaframe "${o}" missing field: url`), `Metaframe "${o}" missing field: url`;
|
|
3112
3121
|
});
|
|
3113
3122
|
const i = this._definition;
|
|
3114
|
-
return this._definition =
|
|
3115
|
-
(!
|
|
3116
|
-
}),
|
|
3123
|
+
return this._definition = n, Object.keys(this._metaframes).forEach((o) => {
|
|
3124
|
+
(!n.metaframes || !n.metaframes[o]) && this.removeMetaframe(o);
|
|
3125
|
+
}), s && (this._state = C(s, (o) => o)), n.metaframes && Object.keys(n.metaframes).forEach((o) => {
|
|
3117
3126
|
if (!this._metaframes.hasOwnProperty(o)) {
|
|
3118
|
-
const r =
|
|
3127
|
+
const r = n.metaframes[o];
|
|
3119
3128
|
this.addMetaframe(o, r);
|
|
3120
3129
|
}
|
|
3121
|
-
}), i !==
|
|
3122
|
-
!this.isDisposed() &&
|
|
3130
|
+
}), i !== fs && window.setTimeout(() => {
|
|
3131
|
+
!this.isDisposed() && n === this._definition && (this._emitDefinitionEvent(), s && this.listenerCount($.State) > 0 && ge !== this._state && this.emit($.State, this._state));
|
|
3123
3132
|
}, 0), this;
|
|
3124
3133
|
}
|
|
3125
3134
|
setMetadata(e) {
|
|
3126
|
-
this._definition = C(this._definition, (
|
|
3127
|
-
|
|
3135
|
+
this._definition = C(this._definition, (s) => {
|
|
3136
|
+
s.meta = e;
|
|
3128
3137
|
}), this._emitDefinitionEvent();
|
|
3129
3138
|
}
|
|
3130
3139
|
_emitDefinitionEvent() {
|
|
3131
|
-
if (this.listenerCount(
|
|
3140
|
+
if (this.listenerCount($.Definition) > 0) {
|
|
3132
3141
|
const e = {
|
|
3133
3142
|
definition: this._definition,
|
|
3134
3143
|
metaframes: this._metaframes
|
|
3135
3144
|
};
|
|
3136
|
-
this.emit(
|
|
3145
|
+
this.emit($.Definition, e);
|
|
3137
3146
|
}
|
|
3138
3147
|
}
|
|
3139
|
-
addPipe(e,
|
|
3140
|
-
this._inputMap = C(this._inputMap, (
|
|
3141
|
-
|
|
3148
|
+
addPipe(e, s) {
|
|
3149
|
+
this._inputMap = C(this._inputMap, (n) => {
|
|
3150
|
+
n[e] || (n[e] = []), n[e].push(s);
|
|
3142
3151
|
});
|
|
3143
3152
|
}
|
|
3144
3153
|
removeMetaframe(e) {
|
|
3145
|
-
this._metaframes[e] && (this._metaframes[e].dispose(), this._metaframes = C(this._metaframes, (
|
|
3146
|
-
delete
|
|
3147
|
-
}), this._state = C(this._state, (
|
|
3148
|
-
delete
|
|
3149
|
-
}), this._inputMap = C(this._inputMap, (
|
|
3150
|
-
delete
|
|
3151
|
-
const i = n
|
|
3154
|
+
this._metaframes[e] && (this._metaframes[e].dispose(), this._metaframes = C(this._metaframes, (s) => {
|
|
3155
|
+
delete s[e];
|
|
3156
|
+
}), this._state = C(this._state, (s) => {
|
|
3157
|
+
delete s.metaframes.inputs[e], delete s.metaframes.outputs[e];
|
|
3158
|
+
}), this._inputMap = C(this._inputMap, (s) => {
|
|
3159
|
+
delete s[e], Object.keys(s).forEach((n) => {
|
|
3160
|
+
const i = s[n];
|
|
3152
3161
|
let o = 0;
|
|
3153
3162
|
for (; o <= i.length; )
|
|
3154
3163
|
i[o] && i[o].metaframe === e ? i.splice(o, 1) : o++;
|
|
3155
3164
|
});
|
|
3156
|
-
}), this._cachedInputLookupMap = C({}, (
|
|
3165
|
+
}), this._cachedInputLookupMap = C({}, (s) => s));
|
|
3157
3166
|
}
|
|
3158
3167
|
removeAll() {
|
|
3159
3168
|
Object.keys(this._metaframes).forEach((e) => this._metaframes[e].dispose()), this._metaframes = C({}, (e) => e), this._state = ge, this._inputMap = C({}, (e) => e), this._cachedInputLookupMap = C({}, (e) => e);
|
|
@@ -3173,52 +3182,52 @@ class ee extends Ns {
|
|
|
3173
3182
|
getMetaframe(e) {
|
|
3174
3183
|
return this == null ? void 0 : this._metaframes[e];
|
|
3175
3184
|
}
|
|
3176
|
-
addMetaframe(e,
|
|
3185
|
+
addMetaframe(e, s) {
|
|
3177
3186
|
if (!e)
|
|
3178
3187
|
throw "addMetaframe missing metaframeId";
|
|
3179
|
-
if (!
|
|
3188
|
+
if (!s)
|
|
3180
3189
|
throw "addMetaframe missing definition";
|
|
3181
3190
|
if (this._metaframes[e])
|
|
3182
3191
|
throw this.emitErrorMessage(`Existing metaframe for id=${e}`), `Existing metaframe for id=${e}`;
|
|
3183
|
-
if (!
|
|
3192
|
+
if (!s.url)
|
|
3184
3193
|
throw this.emitErrorMessage(`Metaframe definition missing url id=${e}`), `Metaframe definition missing url id=${e}`;
|
|
3185
|
-
var
|
|
3194
|
+
var n = new vi(this, s.url, e, this._id, this._consoleBackgroundColor, this.debug).setMetapage(this);
|
|
3186
3195
|
return this._metaframes = C(this._metaframes, (i) => {
|
|
3187
|
-
i[e] =
|
|
3188
|
-
}),
|
|
3189
|
-
this.emit(
|
|
3190
|
-
metaframeId:
|
|
3191
|
-
metaframeUrl:
|
|
3196
|
+
i[e] = n;
|
|
3197
|
+
}), n.addListener($.Error, (i) => {
|
|
3198
|
+
this.emit($.Error, {
|
|
3199
|
+
metaframeId: n.id,
|
|
3200
|
+
metaframeUrl: n.url,
|
|
3192
3201
|
error: i
|
|
3193
3202
|
});
|
|
3194
|
-
}),
|
|
3203
|
+
}), s.inputs && s.inputs.forEach((i) => this.addPipe(e, i)), n.setInputs(this._state.metaframes.inputs[e]), n;
|
|
3195
3204
|
}
|
|
3196
3205
|
dispose() {
|
|
3197
3206
|
this.log("disposing"), super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this._metaframes && Object.keys(this._metaframes).forEach((e) => this._metaframes[e].dispose()), this._id = void 0, this._metaframes = void 0, this._state = void 0, this._cachedInputLookupMap = void 0, this._inputMap = void 0;
|
|
3198
3207
|
}
|
|
3199
|
-
log(e,
|
|
3200
|
-
this.debug && this.logInternal(e,
|
|
3208
|
+
log(e, s, n) {
|
|
3209
|
+
this.debug && this.logInternal(e, s, n);
|
|
3201
3210
|
}
|
|
3202
3211
|
error(e) {
|
|
3203
3212
|
this.logInternal(e, "f00", this._consoleBackgroundColor), this.emitErrorMessage(`${e}`);
|
|
3204
3213
|
}
|
|
3205
3214
|
emitErrorMessage(e) {
|
|
3206
|
-
this.emit(
|
|
3215
|
+
this.emit($.Error, e);
|
|
3207
3216
|
}
|
|
3208
|
-
getInputsFromOutput(e,
|
|
3209
|
-
return this._cachedInputLookupMap[e] || (this._cachedInputLookupMap = C(this._cachedInputLookupMap, (
|
|
3210
|
-
|
|
3211
|
-
})), this._cachedInputLookupMap[e][
|
|
3217
|
+
getInputsFromOutput(e, s) {
|
|
3218
|
+
return this._cachedInputLookupMap[e] || (this._cachedInputLookupMap = C(this._cachedInputLookupMap, (n) => {
|
|
3219
|
+
n[e] = C({}, (i) => i);
|
|
3220
|
+
})), this._cachedInputLookupMap[e][s] || (this._cachedInputLookupMap = C(this._cachedInputLookupMap, (n) => {
|
|
3212
3221
|
var i = [];
|
|
3213
|
-
|
|
3222
|
+
n[e][s] = i, Object.keys(this._inputMap).forEach((o) => {
|
|
3214
3223
|
o !== e && this._inputMap[o].forEach((r) => {
|
|
3215
|
-
if (r.metaframe === e &&
|
|
3224
|
+
if (r.metaframe === e && Oi(s, r.source)) {
|
|
3216
3225
|
var a = r.target || "";
|
|
3217
|
-
!r.target || r.target.startsWith("*") || r.target === "" ? a =
|
|
3226
|
+
!r.target || r.target.startsWith("*") || r.target === "" ? a = s : a && a.endsWith("/") && (a = a + s), i.push({ metaframe: o, pipe: a });
|
|
3218
3227
|
}
|
|
3219
3228
|
});
|
|
3220
3229
|
});
|
|
3221
|
-
})), this._cachedInputLookupMap[e][
|
|
3230
|
+
})), this._cachedInputLookupMap[e][s];
|
|
3222
3231
|
}
|
|
3223
3232
|
isValidJSONRpcMessage(e) {
|
|
3224
3233
|
if (e.jsonrpc !== "2.0")
|
|
@@ -3227,17 +3236,17 @@ class ee extends Ns {
|
|
|
3227
3236
|
case X.SetupIframeClientRequest:
|
|
3228
3237
|
return !0;
|
|
3229
3238
|
default:
|
|
3230
|
-
var
|
|
3231
|
-
return
|
|
3239
|
+
var n = e.iframeId;
|
|
3240
|
+
return n && e.parentId === this._id && !!this._metaframes[n];
|
|
3232
3241
|
}
|
|
3233
3242
|
}
|
|
3234
|
-
setInput(e,
|
|
3243
|
+
setInput(e, s, n) {
|
|
3235
3244
|
var i, o;
|
|
3236
|
-
typeof e == "object" ? this.setInputStateOnlyMetapageInstanceInputs(e) : typeof
|
|
3245
|
+
typeof e == "object" ? this.setInputStateOnlyMetapageInstanceInputs(e) : typeof s == "string" ? this.setInputStateOnlyMetaframeInputValue(e, s, n) : this.setInputStateOnlyMetaframeInputMap(e, s || {}), this.setMetaframeClientInputAndSentClientEvent(e, s, n), (this.listenerCount($.State) > 0 || this.listenerCount($.Inputs) > 0) && ge !== this._state && (this.emit($.State, this._state), this.emit($.Inputs, (o = (i = this._state) == null ? void 0 : i.metaframes) == null ? void 0 : o.inputs));
|
|
3237
3246
|
}
|
|
3238
|
-
setMetaframeClientInputAndSentClientEvent(e,
|
|
3247
|
+
setMetaframeClientInputAndSentClientEvent(e, s, n) {
|
|
3239
3248
|
if (typeof e == "object") {
|
|
3240
|
-
if (
|
|
3249
|
+
if (s || n)
|
|
3241
3250
|
throw "bad arguments, see API docs";
|
|
3242
3251
|
const i = e;
|
|
3243
3252
|
Object.keys(i).forEach((o) => {
|
|
@@ -3249,96 +3258,100 @@ class ee extends Ns {
|
|
|
3249
3258
|
});
|
|
3250
3259
|
} else if (typeof e == "string") {
|
|
3251
3260
|
const i = this._metaframes[e];
|
|
3252
|
-
if (i == null && this.error(`No iframe id=${e}`), typeof
|
|
3253
|
-
i.setInput(
|
|
3254
|
-
else if (typeof
|
|
3255
|
-
i.setInputs(
|
|
3261
|
+
if (i == null && this.error(`No iframe id=${e}`), typeof s == "string")
|
|
3262
|
+
i.setInput(s, n);
|
|
3263
|
+
else if (typeof s == "object")
|
|
3264
|
+
i.setInputs(s);
|
|
3256
3265
|
else
|
|
3257
3266
|
throw "bad arguments, see API docs";
|
|
3258
3267
|
} else
|
|
3259
3268
|
throw "bad arguments, see API docs";
|
|
3260
3269
|
}
|
|
3261
|
-
setInputs(e,
|
|
3262
|
-
this.setInput(e,
|
|
3270
|
+
setInputs(e, s, n) {
|
|
3271
|
+
this.setInput(e, s, n);
|
|
3263
3272
|
}
|
|
3264
3273
|
setOutputStateOnlyMetapageInstanceInputs(e) {
|
|
3265
3274
|
this._setStateOnlyMetaframes(!1, e);
|
|
3266
3275
|
}
|
|
3267
|
-
setOutputStateOnlyMetaframeInputValue(e,
|
|
3268
|
-
this._setStateOnlyMetaframeInputValue(!1, e,
|
|
3276
|
+
setOutputStateOnlyMetaframeInputValue(e, s, n) {
|
|
3277
|
+
this._setStateOnlyMetaframeInputValue(!1, e, s, n);
|
|
3269
3278
|
}
|
|
3270
|
-
setOutputStateOnlyMetaframeInputMap(e,
|
|
3271
|
-
this._setStateOnlyMetaframeInputMap(!1, e,
|
|
3279
|
+
setOutputStateOnlyMetaframeInputMap(e, s) {
|
|
3280
|
+
this._setStateOnlyMetaframeInputMap(!1, e, s);
|
|
3272
3281
|
}
|
|
3273
3282
|
setInputStateOnlyMetapageInstanceInputs(e) {
|
|
3274
3283
|
this._setStateOnlyMetaframes(!0, e);
|
|
3275
3284
|
}
|
|
3276
|
-
setInputStateOnlyMetaframeInputValue(e,
|
|
3277
|
-
this._setStateOnlyMetaframeInputValue(!0, e,
|
|
3285
|
+
setInputStateOnlyMetaframeInputValue(e, s, n) {
|
|
3286
|
+
this._setStateOnlyMetaframeInputValue(!0, e, s, n);
|
|
3278
3287
|
}
|
|
3279
|
-
setInputStateOnlyMetaframeInputMap(e,
|
|
3280
|
-
this._setStateOnlyMetaframeInputMap(!0, e,
|
|
3288
|
+
setInputStateOnlyMetaframeInputMap(e, s) {
|
|
3289
|
+
this._setStateOnlyMetaframeInputMap(!0, e, s);
|
|
3281
3290
|
}
|
|
3282
|
-
_setStateOnlyMetaframeInputValue(e,
|
|
3291
|
+
_setStateOnlyMetaframeInputValue(e, s, n, i) {
|
|
3283
3292
|
this._state = C(this._state, (o) => {
|
|
3284
|
-
if (!this._metaframes.hasOwnProperty(
|
|
3285
|
-
throw `No metaframe: ${
|
|
3293
|
+
if (!this._metaframes.hasOwnProperty(s))
|
|
3294
|
+
throw `No metaframe: ${s}`;
|
|
3286
3295
|
o.metaframes || (o.metaframes = { inputs: {}, outputs: {} }), e ? o.metaframes.inputs || (o.metaframes.inputs = {}) : o.metaframes.outputs || (o.metaframes.outputs = {});
|
|
3287
3296
|
let a = e ? o.metaframes.inputs : o.metaframes.outputs;
|
|
3288
|
-
a = a || {}, a[
|
|
3297
|
+
a = a || {}, a[s] = a[s] ? a[s] : {}, i === void 0 ? delete a[s][n] : a[s][n] = i;
|
|
3289
3298
|
});
|
|
3290
3299
|
}
|
|
3291
|
-
_setStateOnlyMetaframeInputMap(e,
|
|
3292
|
-
!
|
|
3293
|
-
if (!this._metaframes.hasOwnProperty(
|
|
3294
|
-
throw `No metaframe: ${
|
|
3300
|
+
_setStateOnlyMetaframeInputMap(e, s, n) {
|
|
3301
|
+
!n || Object.keys(n).length === 0 || (this._state = C(this._state, (i) => {
|
|
3302
|
+
if (!this._metaframes.hasOwnProperty(s))
|
|
3303
|
+
throw `No metaframe: ${s}`;
|
|
3295
3304
|
let r = e ? i.metaframes.inputs : i.metaframes.outputs;
|
|
3296
|
-
r[
|
|
3297
|
-
|
|
3305
|
+
r[s] = r[s] ? r[s] : {}, Object.keys(n).forEach((a) => {
|
|
3306
|
+
n[a] === void 0 ? delete r[s][a] : r[s][a] = n[a];
|
|
3298
3307
|
});
|
|
3299
3308
|
}));
|
|
3300
3309
|
}
|
|
3301
|
-
_setStateOnlyMetaframes(e,
|
|
3302
|
-
!
|
|
3303
|
-
Object.keys(
|
|
3304
|
-
var o =
|
|
3310
|
+
_setStateOnlyMetaframes(e, s) {
|
|
3311
|
+
!s || Object.keys(s).length === 0 || (this._state = C(this._state, (n) => {
|
|
3312
|
+
Object.keys(s).forEach((i) => {
|
|
3313
|
+
var o = s[i];
|
|
3305
3314
|
if (typeof o != "object")
|
|
3306
3315
|
throw "Object values must be objects";
|
|
3307
3316
|
if (!this._metaframes.hasOwnProperty(i))
|
|
3308
3317
|
throw "No metaframe: ${metaframeId}";
|
|
3309
|
-
const a = e ?
|
|
3318
|
+
const a = e ? n.metaframes.inputs : n.metaframes.outputs;
|
|
3310
3319
|
a[i] = a[i] ? a[i] : {}, Object.keys(o).forEach((u) => {
|
|
3311
3320
|
o[u] === void 0 ? delete a[i][u] : a[i][u] = o[u];
|
|
3312
3321
|
});
|
|
3313
3322
|
});
|
|
3314
3323
|
}));
|
|
3315
3324
|
}
|
|
3316
|
-
setMetaframeOutputs(e,
|
|
3325
|
+
setMetaframeOutputs(e, s) {
|
|
3317
3326
|
this.onMessageJsonRpc({
|
|
3318
3327
|
iframeId: e,
|
|
3319
3328
|
parentId: this._id,
|
|
3320
3329
|
jsonrpc: "2.0",
|
|
3321
3330
|
method: X.OutputsUpdate,
|
|
3322
3331
|
id: "_",
|
|
3323
|
-
params:
|
|
3332
|
+
params: s
|
|
3324
3333
|
});
|
|
3325
3334
|
}
|
|
3335
|
+
setOutputs(e) {
|
|
3336
|
+
for (const s in e)
|
|
3337
|
+
this.setMetaframeOutputs(s, e[s]);
|
|
3338
|
+
}
|
|
3326
3339
|
onMessage(e) {
|
|
3327
3340
|
if (typeof e.data == "object") {
|
|
3328
|
-
const
|
|
3329
|
-
if (!this.isValidJSONRpcMessage(
|
|
3341
|
+
const s = e.data;
|
|
3342
|
+
if (!this.isValidJSONRpcMessage(s))
|
|
3330
3343
|
return;
|
|
3331
|
-
this.onMessageJsonRpc(
|
|
3344
|
+
this.onMessageJsonRpc(s);
|
|
3332
3345
|
}
|
|
3333
3346
|
}
|
|
3334
3347
|
onMessageJsonRpc(e) {
|
|
3335
|
-
var
|
|
3336
|
-
const
|
|
3337
|
-
if (!
|
|
3348
|
+
var s = e.method;
|
|
3349
|
+
const n = e.iframeId;
|
|
3350
|
+
if (!n || s !== "SetupIframeClientRequest" && e.parentId !== this._id)
|
|
3338
3351
|
return;
|
|
3339
|
-
const i = this.getMetaframe(
|
|
3352
|
+
const i = this.getMetaframe(n);
|
|
3340
3353
|
if (i) {
|
|
3341
|
-
switch (e._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(e, null, " ").substring(0, 500)}`),
|
|
3354
|
+
switch (e._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(e, null, " ").substring(0, 500)}`), s) {
|
|
3342
3355
|
case X.SetupIframeClientRequest:
|
|
3343
3356
|
i.register();
|
|
3344
3357
|
break;
|
|
@@ -3352,28 +3365,28 @@ class ee extends Ns {
|
|
|
3352
3365
|
const u = e.params;
|
|
3353
3366
|
if (!u || Object.keys(u).length === 0)
|
|
3354
3367
|
break;
|
|
3355
|
-
if (this._metaframes[
|
|
3356
|
-
var o = this._metaframes[
|
|
3357
|
-
this.setOutputStateOnlyMetaframeInputMap(
|
|
3368
|
+
if (this._metaframes[n]) {
|
|
3369
|
+
var o = this._metaframes[n];
|
|
3370
|
+
this.setOutputStateOnlyMetaframeInputMap(n, u), o.setOutputs(u);
|
|
3358
3371
|
var r = !1;
|
|
3359
3372
|
const l = Object.keys(u), c = {};
|
|
3360
3373
|
l.forEach((d, _) => {
|
|
3361
|
-
const v = this.getInputsFromOutput(
|
|
3374
|
+
const v = this.getInputsFromOutput(n, d);
|
|
3362
3375
|
v.length > 0 && v.forEach((m) => {
|
|
3363
3376
|
c[m.metaframe] || (c[m.metaframe] = {}), c[m.metaframe][m.pipe] = u[d], r = !0;
|
|
3364
3377
|
});
|
|
3365
3378
|
}), r && (this.setInputStateOnlyMetapageInstanceInputs(c), Object.keys(c).forEach((d) => {
|
|
3366
3379
|
this._metaframes[d].setInputs(c[d]);
|
|
3367
|
-
})), this.listenerCount(
|
|
3380
|
+
})), this.listenerCount($.State) > 0 && ge !== this._state && this.emit($.State, this._state), this.debug && o.ack({ jsonrpc: e, state: this._state });
|
|
3368
3381
|
} else
|
|
3369
|
-
this.error(`missing metaframe=${
|
|
3382
|
+
this.error(`missing metaframe=${n}`);
|
|
3370
3383
|
break;
|
|
3371
3384
|
case X.InputsUpdate:
|
|
3372
3385
|
var a = e.params;
|
|
3373
|
-
this.debug && this.log(`inputs ${JSON.stringify(a)} from ${
|
|
3386
|
+
this.debug && this.log(`inputs ${JSON.stringify(a)} from ${n}`), this._metaframes[n] ? (this.setInputStateOnlyMetaframeInputMap(n, a), this._metaframes[n].setInputs(a), this.listenerCount($.State) > 0 && ge !== this._state && this.emit($.State, this._state), this.debug && this._metaframes[n].ack({
|
|
3374
3387
|
jsonrpc: e,
|
|
3375
3388
|
state: this._state
|
|
3376
|
-
})) : (console.error(`InputsUpdate failed no metaframe id: "${
|
|
3389
|
+
})) : (console.error(`InputsUpdate failed no metaframe id: "${n}"`), this.error(`InputsUpdate failed no metaframe id: "${n}"`));
|
|
3377
3390
|
break;
|
|
3378
3391
|
case X.HashParamsUpdate:
|
|
3379
3392
|
if (i) {
|
|
@@ -3384,27 +3397,27 @@ class ee extends Ns {
|
|
|
3384
3397
|
}
|
|
3385
3398
|
break;
|
|
3386
3399
|
default:
|
|
3387
|
-
this.debug && this.log(`Unknown RPC method: "${
|
|
3400
|
+
this.debug && this.log(`Unknown RPC method: "${s}"`);
|
|
3388
3401
|
}
|
|
3389
|
-
this.listenerCount(
|
|
3402
|
+
this.listenerCount($.Message) > 0 && this.emit($.Message, e);
|
|
3390
3403
|
}
|
|
3391
3404
|
}
|
|
3392
|
-
logInternal(e,
|
|
3393
|
-
|
|
3405
|
+
logInternal(e, s, n) {
|
|
3406
|
+
n = n || this._consoleBackgroundColor;
|
|
3394
3407
|
let i;
|
|
3395
|
-
typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), i = this._id ? `Metapage[${this._id}] ${i}` : i, At(i,
|
|
3408
|
+
typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), i = this._id ? `Metapage[${this._id}] ${i}` : i, At(i, s, n);
|
|
3396
3409
|
}
|
|
3397
3410
|
}
|
|
3398
3411
|
ee.version = Vt;
|
|
3399
|
-
ee.DEFINITION =
|
|
3400
|
-
ee.ERROR =
|
|
3401
|
-
ee.INPUTS =
|
|
3402
|
-
ee.MESSAGE =
|
|
3403
|
-
ee.OUTPUTS =
|
|
3404
|
-
ee.STATE =
|
|
3412
|
+
ee.DEFINITION = $.Definition;
|
|
3413
|
+
ee.ERROR = $.Error;
|
|
3414
|
+
ee.INPUTS = $.Inputs;
|
|
3415
|
+
ee.MESSAGE = $.Message;
|
|
3416
|
+
ee.OUTPUTS = $.Outputs;
|
|
3417
|
+
ee.STATE = $.State;
|
|
3405
3418
|
ee.deserializeInputs = Ce;
|
|
3406
3419
|
ee.serializeInputs = Ke;
|
|
3407
|
-
function
|
|
3420
|
+
function Os(t) {
|
|
3408
3421
|
return t.startsWith("data:") ? t.includes("type=metapage-divider") : !1;
|
|
3409
3422
|
}
|
|
3410
3423
|
function Si(t) {
|
|
@@ -3419,55 +3432,55 @@ function Si(t) {
|
|
|
3419
3432
|
},
|
|
3420
3433
|
layout: []
|
|
3421
3434
|
});
|
|
3422
|
-
const
|
|
3435
|
+
const s = e.meta.layouts["react-grid-layout"];
|
|
3423
3436
|
if (e.metaframes) {
|
|
3424
3437
|
Object.keys(e.metaframes).forEach((i) => {
|
|
3425
|
-
if (!
|
|
3426
|
-
const o =
|
|
3427
|
-
|
|
3438
|
+
if (!s.layout.some((o) => o.i === i)) {
|
|
3439
|
+
const o = s.layout.length > 0 ? Math.max(...s.layout.map((r) => (r.y || 0) + (r.h || 2))) : 0;
|
|
3440
|
+
s.layout.push({
|
|
3428
3441
|
i,
|
|
3429
3442
|
x: 0,
|
|
3430
3443
|
y: o,
|
|
3431
|
-
w:
|
|
3432
|
-
h:
|
|
3444
|
+
w: s.props.cols,
|
|
3445
|
+
h: Os(e.metaframes[i].url) ? 1 : 3
|
|
3433
3446
|
});
|
|
3434
3447
|
}
|
|
3435
3448
|
});
|
|
3436
|
-
const
|
|
3437
|
-
|
|
3449
|
+
const n = new Set(Object.keys(e.metaframes));
|
|
3450
|
+
s.layout = s.layout.filter((i) => n.has(i.i)), s.layout.forEach((i) => {
|
|
3438
3451
|
i.x = i.x || 0, i.y = i.y || 0, i.w = i.w || 1, i.h = i.h || 1;
|
|
3439
3452
|
});
|
|
3440
3453
|
}
|
|
3441
3454
|
return e;
|
|
3442
3455
|
}
|
|
3443
3456
|
async function Vi(t) {
|
|
3444
|
-
var
|
|
3445
|
-
let { url: e, definition:
|
|
3446
|
-
if (!e && !
|
|
3457
|
+
var O, H, R, L, U;
|
|
3458
|
+
let { url: e, definition: s, onOutputs: n, rootDiv: i, options: o = {} } = t;
|
|
3459
|
+
if (!e && !s)
|
|
3447
3460
|
throw new Error("Either url or definition must be provided");
|
|
3448
|
-
if (e &&
|
|
3461
|
+
if (e && s)
|
|
3449
3462
|
throw new Error("Either url or definition must be provided, not both");
|
|
3450
|
-
if (e && (
|
|
3463
|
+
if (e && (s = await bi(e)), !s)
|
|
3451
3464
|
throw new Error("Failed to fetch metapage definition");
|
|
3452
|
-
|
|
3465
|
+
s = Si(s), s = await Ei(s), await Xe();
|
|
3453
3466
|
const r = new ee();
|
|
3454
3467
|
r.debug = o.debug || !1;
|
|
3455
3468
|
try {
|
|
3456
|
-
await r.setDefinition(JSON.parse(JSON.stringify(
|
|
3469
|
+
await r.setDefinition(JSON.parse(JSON.stringify(s)));
|
|
3457
3470
|
} catch (f) {
|
|
3458
3471
|
throw r.dispose(), new Error(`Failed to set metapage definition: ${f}`);
|
|
3459
3472
|
}
|
|
3460
3473
|
const a = [];
|
|
3461
|
-
|
|
3462
|
-
const u = (H = (
|
|
3474
|
+
n && a.push(r.addListenerReturnDisposer($.Outputs, n));
|
|
3475
|
+
const u = (H = (O = s == null ? void 0 : s.meta) == null ? void 0 : O.layouts) == null ? void 0 : H["react-grid-layout"], l = u == null ? void 0 : u.layout;
|
|
3463
3476
|
if (!u || !l)
|
|
3464
3477
|
throw new Error("No valid layout found in metapage definition");
|
|
3465
3478
|
const c = /* @__PURE__ */ new Set(), d = l.map((f, M) => {
|
|
3466
3479
|
const I = r.getMetaframes()[f.i];
|
|
3467
|
-
return I &&
|
|
3480
|
+
return I && Os(I.url) ? { index: M, y: f.y, id: f.i } : null;
|
|
3468
3481
|
}).filter((f) => f !== null);
|
|
3469
3482
|
if (d.length > 0) {
|
|
3470
|
-
const f = d.reduce((I, B) => B.y < I.y ? B : I), M = ((
|
|
3483
|
+
const f = d.reduce((I, B) => B.y < I.y ? B : I), M = ((R = l.find((I) => I.i === f.id)) == null ? void 0 : R.y) ?? 0;
|
|
3471
3484
|
l.forEach((I) => {
|
|
3472
3485
|
I.y >= M && c.add(I.i);
|
|
3473
3486
|
});
|
|
@@ -3480,6 +3493,9 @@ async function Vi(t) {
|
|
|
3480
3493
|
setInputs: (f) => {
|
|
3481
3494
|
r.isDisposed() || r.setInputs(f);
|
|
3482
3495
|
},
|
|
3496
|
+
setOutputs: (f) => {
|
|
3497
|
+
r.isDisposed() || r.setOutputs(f);
|
|
3498
|
+
},
|
|
3483
3499
|
dispose: () => {
|
|
3484
3500
|
a.forEach((f) => f()), r.dispose(), i.innerHTML = "";
|
|
3485
3501
|
}
|
|
@@ -3508,8 +3524,8 @@ async function Vi(t) {
|
|
|
3508
3524
|
i.innerHTML = "";
|
|
3509
3525
|
const w = document.createElement("div");
|
|
3510
3526
|
Object.assign(w.style, S);
|
|
3511
|
-
const
|
|
3512
|
-
Object.assign(
|
|
3527
|
+
const x = document.createElement("div");
|
|
3528
|
+
Object.assign(x.style, m);
|
|
3513
3529
|
const b = [];
|
|
3514
3530
|
for (const f of _) {
|
|
3515
3531
|
const M = l.find((W) => W.i === f);
|
|
@@ -3530,10 +3546,10 @@ async function Vi(t) {
|
|
|
3530
3546
|
alignSelf: "stretch",
|
|
3531
3547
|
justifySelf: "stretch"
|
|
3532
3548
|
}, p = document.createElement("div");
|
|
3533
|
-
Object.assign(p.style, h), p.appendChild(B),
|
|
3549
|
+
Object.assign(p.style, h), p.appendChild(B), x.appendChild(p);
|
|
3534
3550
|
}
|
|
3535
3551
|
const A = Math.max(...b.map((f) => f.x + f.w));
|
|
3536
|
-
Math.max(...b.map((f) => f.y + f.h)),
|
|
3552
|
+
Math.max(...b.map((f) => f.y + f.h)), x.style.gridTemplateColumns = `repeat(${Math.max(1, A)}, 1fr)`;
|
|
3537
3553
|
const E = document.createElement("div");
|
|
3538
3554
|
E.style.position = "absolute", E.style.top = "-9999px", E.style.left = "-9999px", E.style.width = "1px", E.style.height = "1px", E.style.overflow = "hidden", E.style.pointerEvents = "none";
|
|
3539
3555
|
for (const f of Object.keys(r.getMetaframes()).filter((M) => c.has(M))) {
|
|
@@ -3545,39 +3561,42 @@ async function Vi(t) {
|
|
|
3545
3561
|
let B;
|
|
3546
3562
|
M.iframe ? B = await M.iframe : (B = document.createElement("iframe"), B.src = M.url, B.style.border = "none", B.style.width = "100%", B.style.height = "100%"), I.appendChild(B), E.appendChild(I);
|
|
3547
3563
|
}
|
|
3548
|
-
return w.appendChild(
|
|
3564
|
+
return w.appendChild(x), w.appendChild(E), i.appendChild(w), {
|
|
3549
3565
|
metapage: r,
|
|
3550
3566
|
setInputs: (f) => {
|
|
3551
3567
|
r.isDisposed() || r.setInputs(f);
|
|
3552
3568
|
},
|
|
3569
|
+
setOutputs: (f) => {
|
|
3570
|
+
r.isDisposed() || r.setOutputs(f);
|
|
3571
|
+
},
|
|
3553
3572
|
dispose: () => {
|
|
3554
3573
|
a.forEach((f) => f()), r.dispose(), i.innerHTML = "";
|
|
3555
3574
|
}
|
|
3556
3575
|
};
|
|
3557
3576
|
}
|
|
3558
3577
|
const Ai = (t) => {
|
|
3559
|
-
var
|
|
3578
|
+
var s;
|
|
3560
3579
|
if (!t)
|
|
3561
3580
|
return;
|
|
3562
3581
|
typeof t == "string" && (t.startsWith("/") && (t = "https://metapage.io" + t), t = new URL(t));
|
|
3563
|
-
let e = (
|
|
3582
|
+
let e = (s = /\/m?f\/([0-9a-zA-Z-]{3,})\/?(metaframe\.json)?.*$/g.exec(t.pathname)) == null ? void 0 : s[1];
|
|
3564
3583
|
return e || (t.searchParams.get("mfk") ?? void 0);
|
|
3565
3584
|
}, Ei = async (t) => {
|
|
3566
3585
|
if (!(t != null && t.metaframes))
|
|
3567
3586
|
return t;
|
|
3568
|
-
for (const [e,
|
|
3569
|
-
if (!(
|
|
3587
|
+
for (const [e, s] of Object.entries(t.metaframes)) {
|
|
3588
|
+
if (!(s.url.startsWith("https://metapage.io/mf/") || s.url.startsWith("https://metapage.io/f/")))
|
|
3570
3589
|
continue;
|
|
3571
|
-
const
|
|
3572
|
-
if (!
|
|
3590
|
+
const n = Ai(s.url);
|
|
3591
|
+
if (!n)
|
|
3573
3592
|
continue;
|
|
3574
|
-
const i = await fetch(`https://metapage.io/f/${
|
|
3575
|
-
i != null && i.url && (
|
|
3593
|
+
const i = await fetch(`https://metapage.io/f/${n}/definition.json`).then((o) => o.json());
|
|
3594
|
+
i != null && i.url && (s.url = i == null ? void 0 : i.url);
|
|
3576
3595
|
}
|
|
3577
3596
|
return t;
|
|
3578
3597
|
};
|
|
3579
3598
|
export {
|
|
3580
|
-
|
|
3599
|
+
fs as INITIAL_NULL_METAPAGE_DEFINITION,
|
|
3581
3600
|
ki as INTERNAL_ERROR,
|
|
3582
3601
|
Di as INVALID_PARAMS,
|
|
3583
3602
|
Ti as INVALID_REQUEST,
|
|
@@ -3593,24 +3612,24 @@ export {
|
|
|
3593
3612
|
We as MetaframeVersionCurrent,
|
|
3594
3613
|
It as MetaframeVersionsAll,
|
|
3595
3614
|
ee as Metapage,
|
|
3596
|
-
|
|
3615
|
+
$ as MetapageEvents,
|
|
3597
3616
|
xe as MetapageHashParams,
|
|
3598
3617
|
vi as MetapageIFrameRpcClient,
|
|
3599
|
-
|
|
3618
|
+
Nn as MetapageShared,
|
|
3600
3619
|
Le as MetapageVersionCurrent,
|
|
3601
3620
|
Ct as MetapageVersionsAll,
|
|
3602
3621
|
Li as PARSE_ERROR,
|
|
3603
|
-
|
|
3622
|
+
As as VERSION_METAFRAME,
|
|
3604
3623
|
Vt as VERSION_METAPAGE,
|
|
3605
|
-
|
|
3606
|
-
|
|
3624
|
+
tn as convertMetaframeDefinitionToCurrentVersion,
|
|
3625
|
+
ss as convertMetaframeDefinitionToVersion,
|
|
3607
3626
|
pt as convertMetaframeJsonToCurrentVersion,
|
|
3608
|
-
|
|
3609
|
-
|
|
3627
|
+
Vs as convertMetapageDefinitionToCurrentVersion,
|
|
3628
|
+
ts as convertMetapageDefinitionToVersion,
|
|
3610
3629
|
Ce as deserializeInputs,
|
|
3611
3630
|
St as generateId,
|
|
3612
3631
|
Ui as generateMetaframeId,
|
|
3613
|
-
|
|
3632
|
+
jn as generateMetapageId,
|
|
3614
3633
|
Bi as generateNonce,
|
|
3615
3634
|
Gi as getLibraryVersionMatching,
|
|
3616
3635
|
te as getMatchingMetaframeVersion,
|
|
@@ -3619,25 +3638,25 @@ export {
|
|
|
3619
3638
|
bi as getMetapageDefinitionFromUrl,
|
|
3620
3639
|
Ni as getUrlParam,
|
|
3621
3640
|
ji as getUrlParamDebug,
|
|
3622
|
-
|
|
3623
|
-
|
|
3641
|
+
Un as hashCode,
|
|
3642
|
+
Bn as intToRGB,
|
|
3624
3643
|
ht as isDebugFromUrlsParams,
|
|
3625
3644
|
Ji as isEmptyMetaframeDefinition,
|
|
3626
|
-
|
|
3645
|
+
Hn as isIframe,
|
|
3627
3646
|
Hi as isJsonRpcId,
|
|
3628
3647
|
tt as isPageLoaded,
|
|
3629
3648
|
At as log,
|
|
3630
|
-
|
|
3649
|
+
Oi as matchPipe,
|
|
3631
3650
|
Je as merge,
|
|
3632
3651
|
Fi as metapageAllSha256Hash,
|
|
3633
3652
|
zi as metapageOnlyEssentailSha256Hash,
|
|
3634
3653
|
Xe as pageLoaded,
|
|
3635
3654
|
xi as possiblyDeserializeDatarefToFile,
|
|
3636
|
-
|
|
3637
|
-
|
|
3655
|
+
ns as possiblyDeserializeDatarefToValue,
|
|
3656
|
+
dn as possiblySerializeValueToDataref,
|
|
3638
3657
|
Vi as renderMetapage,
|
|
3639
3658
|
Ke as serializeInputs,
|
|
3640
|
-
|
|
3659
|
+
ps as stringToRgb,
|
|
3641
3660
|
$i as valueToFile
|
|
3642
3661
|
};
|
|
3643
3662
|
//# sourceMappingURL=index.js.map
|