@metapages/metapage 0.16.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1434 -2430
- package/dist/index.js.map +1 -1
- package/dist/metapage/Constants.d.ts +2 -2
- package/dist/metapage/Constants.d.ts.map +1 -1
- package/dist/metapage/Metaframe.d.ts +4 -16
- package/dist/metapage/Metaframe.d.ts.map +1 -1
- package/dist/metapage/Metapage.d.ts +29 -42
- package/dist/metapage/Metapage.d.ts.map +1 -1
- package/dist/metapage/MetapageIFrameRpcClient.d.ts +3 -8
- package/dist/metapage/MetapageIFrameRpcClient.d.ts.map +1 -1
- package/dist/metapage/MetapageTools.d.ts +9 -7
- package/dist/metapage/MetapageTools.d.ts.map +1 -1
- package/dist/metapage/Shared.d.ts +6 -6
- package/dist/metapage/Shared.d.ts.map +1 -1
- package/dist/metapage/{v0_4/jsonrpc.d.ts → jsonrpc.d.ts} +2 -11
- package/dist/metapage/jsonrpc.d.ts.map +1 -0
- package/dist/metapage/v0_0_1/all.d.ts +1 -1
- package/dist/metapage/v0_0_1/all.d.ts.map +1 -1
- package/dist/metapage/v0_1_0/all.d.ts +1 -1
- package/dist/metapage/v0_1_0/all.d.ts.map +1 -1
- package/dist/metapage/v0_2/all.d.ts +1 -1
- package/dist/metapage/v0_2/all.d.ts.map +1 -1
- package/dist/metapage/v0_4/core.d.ts +1 -1
- package/dist/metapage/v0_4/core.d.ts.map +1 -1
- package/dist/metapage/v0_4/index.d.ts +2 -2
- package/dist/metapage/v0_4/index.d.ts.map +1 -1
- package/dist/metapage/v0_4/metaframe.d.ts +1 -1
- package/dist/metapage/v0_4/metaframe.d.ts.map +1 -1
- package/dist/metapage/v0_4/metapage.d.ts +1 -1
- package/dist/metapage/v0_4/metapage.d.ts.map +1 -1
- package/dist/metapage/v1/core.d.ts +6 -0
- package/dist/metapage/v1/core.d.ts.map +1 -0
- package/dist/metapage/v1/events.d.ts +22 -0
- package/dist/metapage/v1/events.d.ts.map +1 -0
- package/dist/metapage/v1/index.d.ts +7 -0
- package/dist/metapage/v1/index.d.ts.map +1 -0
- package/dist/metapage/v1/metaframe.d.ts +86 -0
- package/dist/metapage/v1/metaframe.d.ts.map +1 -0
- package/dist/metapage/v1/metapage.d.ts +32 -0
- package/dist/metapage/v1/metapage.d.ts.map +1 -0
- package/dist/metapage/{v0_4/versions.d.ts → versions.d.ts} +2 -2
- package/dist/metapage/versions.d.ts.map +1 -0
- package/package.json +2 -8
- package/src/metapage/Constants.ts +10 -1
- package/src/metapage/Metaframe.ts +8 -77
- package/src/metapage/Metapage.ts +289 -612
- package/src/metapage/MetapageIFrameRpcClient.ts +9 -40
- package/src/metapage/MetapageTools.ts +115 -88
- package/src/metapage/Shared.ts +10 -9
- package/src/metapage/{v0_4/jsonrpc.ts → jsonrpc.ts} +2 -16
- package/src/metapage/v0_0_1/all.ts +1 -1
- package/src/metapage/v0_1_0/all.ts +1 -1
- package/src/metapage/v0_2/all.ts +1 -1
- package/src/metapage/v0_4/core.ts +1 -1
- package/src/metapage/v0_4/index.ts +2 -2
- package/src/metapage/v0_4/metaframe.ts +1 -1
- package/src/metapage/v0_4/metapage.ts +1 -1
- package/src/metapage/v1/core.ts +5 -0
- package/src/metapage/v1/events.ts +28 -0
- package/src/metapage/v1/index.ts +6 -0
- package/src/metapage/v1/metaframe.ts +135 -0
- package/src/metapage/v1/metapage.ts +43 -0
- package/src/metapage/{v0_4/versions.ts → versions.ts} +4 -4
- package/dist/metapage/v0_4/jsonrpc.d.ts.map +0 -1
- package/dist/metapage/v0_4/versions.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,539 +1,539 @@
|
|
|
1
|
-
const
|
|
1
|
+
const M = {
|
|
2
2
|
Remove: "remove",
|
|
3
3
|
Replace: "replace",
|
|
4
4
|
Add: "add"
|
|
5
|
-
},
|
|
5
|
+
}, Ht = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), he = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), rt = Symbol.iterator, C = {
|
|
6
6
|
mutable: "mutable",
|
|
7
7
|
immutable: "immutable"
|
|
8
|
-
},
|
|
9
|
-
function
|
|
10
|
-
return
|
|
8
|
+
}, It = {};
|
|
9
|
+
function G(t, e) {
|
|
10
|
+
return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (
|
|
14
|
-
let
|
|
15
|
-
for (;
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
return
|
|
19
|
-
|
|
12
|
+
function Lt(t, e) {
|
|
13
|
+
if (e in t) {
|
|
14
|
+
let s = Reflect.getPrototypeOf(t);
|
|
15
|
+
for (; s; ) {
|
|
16
|
+
const n = Reflect.getOwnPropertyDescriptor(s, e);
|
|
17
|
+
if (n)
|
|
18
|
+
return n;
|
|
19
|
+
s = Reflect.getPrototypeOf(s);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
var
|
|
25
|
-
return (
|
|
23
|
+
function E(t) {
|
|
24
|
+
var e;
|
|
25
|
+
return (e = t.copy) !== null && e !== void 0 ? e : t.original;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
27
|
+
function N(t) {
|
|
28
|
+
return !!g(t);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return typeof
|
|
30
|
+
function g(t) {
|
|
31
|
+
return typeof t != "object" ? null : t == null ? void 0 : t[Ht];
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
var
|
|
35
|
-
const
|
|
36
|
-
return
|
|
33
|
+
function St(t) {
|
|
34
|
+
var e;
|
|
35
|
+
const s = g(t);
|
|
36
|
+
return s ? (e = s.copy) !== null && e !== void 0 ? e : s.original : t;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
if (!
|
|
38
|
+
function j(t, e) {
|
|
39
|
+
if (!t || typeof t != "object")
|
|
40
40
|
return !1;
|
|
41
|
-
let
|
|
42
|
-
return Object.getPrototypeOf(
|
|
41
|
+
let s;
|
|
42
|
+
return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((s = e.mark(t, C)) === C.immutable || typeof s == "function");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
if (Object.hasOwnProperty.call(
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
44
|
+
function qt(t, e = []) {
|
|
45
|
+
if (Object.hasOwnProperty.call(t, "key")) {
|
|
46
|
+
const s = t.parent.copy, n = g(V(s, t.key));
|
|
47
|
+
if (n !== null && (n == null ? void 0 : n.original) !== t.original)
|
|
48
48
|
return null;
|
|
49
|
-
const
|
|
50
|
-
if (!(
|
|
49
|
+
const i = t.parent.type === 3, a = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
|
|
50
|
+
if (!(i && s.size > a || G(s, a)))
|
|
51
51
|
return null;
|
|
52
|
-
|
|
52
|
+
e.push(a);
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
55
|
-
return
|
|
56
|
-
|
|
54
|
+
if (t.parent)
|
|
55
|
+
return qt(t.parent, e);
|
|
56
|
+
e.reverse();
|
|
57
57
|
try {
|
|
58
|
-
|
|
58
|
+
le(t.copy, e);
|
|
59
59
|
} catch {
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return e;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
return Array.isArray(
|
|
64
|
+
function F(t) {
|
|
65
|
+
return Array.isArray(t) ? 1 : t instanceof Map ? 2 : t instanceof Set ? 3 : 0;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
67
|
+
function V(t, e) {
|
|
68
|
+
return F(t) === 2 ? t.get(e) : t[e];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
70
|
+
function tt(t, e, s) {
|
|
71
|
+
F(t) === 2 ? t.set(e, s) : t[e] = s;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
75
|
-
return (
|
|
73
|
+
function pt(t, e) {
|
|
74
|
+
const s = g(t);
|
|
75
|
+
return (s ? E(s) : t)[e];
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
77
|
+
function z(t, e) {
|
|
78
|
+
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
if (
|
|
82
|
-
for (;
|
|
83
|
-
|
|
80
|
+
function mt(t) {
|
|
81
|
+
if (t)
|
|
82
|
+
for (; t.finalities.revoke.length > 0; )
|
|
83
|
+
t.finalities.revoke.pop()();
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
87
|
-
const
|
|
88
|
-
return
|
|
85
|
+
function k(t, e) {
|
|
86
|
+
return e ? t : [""].concat(t).map((s) => {
|
|
87
|
+
const n = `${s}`;
|
|
88
|
+
return n.indexOf("/") === -1 && n.indexOf("~") === -1 ? n : n.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
89
89
|
}).join("/");
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
for (let
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
throw new Error(`Cannot resolve patch at '${
|
|
91
|
+
function le(t, e) {
|
|
92
|
+
for (let s = 0; s < e.length - 1; s += 1) {
|
|
93
|
+
const n = e[s];
|
|
94
|
+
if (t = V(F(t) === 3 ? Array.from(t) : t, n), typeof t != "object")
|
|
95
|
+
throw new Error(`Cannot resolve patch at '${e.join("/")}'.`);
|
|
96
96
|
}
|
|
97
|
-
return
|
|
97
|
+
return t;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const
|
|
101
|
-
return Reflect.ownKeys(
|
|
102
|
-
let
|
|
103
|
-
if (
|
|
104
|
-
|
|
99
|
+
function pe(t) {
|
|
100
|
+
const e = Object.create(Object.getPrototypeOf(t));
|
|
101
|
+
return Reflect.ownKeys(t).forEach((s) => {
|
|
102
|
+
let n = Reflect.getOwnPropertyDescriptor(t, s);
|
|
103
|
+
if (n.enumerable && n.configurable && n.writable) {
|
|
104
|
+
e[s] = t[s];
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
n.writable || (n.writable = !0, n.configurable = !0), (n.get || n.set) && (n = {
|
|
108
108
|
configurable: !0,
|
|
109
109
|
writable: !0,
|
|
110
|
-
enumerable:
|
|
111
|
-
value:
|
|
112
|
-
}), Reflect.defineProperty(
|
|
113
|
-
}),
|
|
110
|
+
enumerable: n.enumerable,
|
|
111
|
+
value: t[s]
|
|
112
|
+
}), Reflect.defineProperty(e, s, n);
|
|
113
|
+
}), e;
|
|
114
114
|
}
|
|
115
|
-
const
|
|
116
|
-
function
|
|
117
|
-
let
|
|
118
|
-
if (Array.isArray(
|
|
119
|
-
return Array.prototype.concat.call(
|
|
120
|
-
if (
|
|
121
|
-
return new Set(
|
|
122
|
-
if (
|
|
123
|
-
return new Map(
|
|
124
|
-
if (
|
|
125
|
-
if (
|
|
126
|
-
return
|
|
127
|
-
if (typeof
|
|
128
|
-
if (
|
|
115
|
+
const de = Object.prototype.propertyIsEnumerable;
|
|
116
|
+
function Kt(t, e) {
|
|
117
|
+
let s;
|
|
118
|
+
if (Array.isArray(t))
|
|
119
|
+
return Array.prototype.concat.call(t);
|
|
120
|
+
if (t instanceof Set)
|
|
121
|
+
return new Set(t.values());
|
|
122
|
+
if (t instanceof Map)
|
|
123
|
+
return new Map(t);
|
|
124
|
+
if (e != null && e.mark && (s = e.mark(t, C), s !== void 0) && s !== C.mutable) {
|
|
125
|
+
if (s === C.immutable)
|
|
126
|
+
return pe(t);
|
|
127
|
+
if (typeof s == "function") {
|
|
128
|
+
if (e.enablePatches || e.enableAutoFreeze)
|
|
129
129
|
throw new Error("You can't use mark and patches or auto freeze together.");
|
|
130
|
-
return
|
|
130
|
+
return s();
|
|
131
131
|
}
|
|
132
|
-
throw new Error(`Unsupported mark result: ${
|
|
133
|
-
} else if (typeof
|
|
134
|
-
const
|
|
135
|
-
return Object.keys(
|
|
136
|
-
i
|
|
137
|
-
}), Object.getOwnPropertySymbols(
|
|
138
|
-
|
|
139
|
-
}),
|
|
132
|
+
throw new Error(`Unsupported mark result: ${s}`);
|
|
133
|
+
} else if (typeof t == "object" && Object.getPrototypeOf(t) === Object.prototype) {
|
|
134
|
+
const n = {};
|
|
135
|
+
return Object.keys(t).forEach((i) => {
|
|
136
|
+
n[i] = t[i];
|
|
137
|
+
}), Object.getOwnPropertySymbols(t).forEach((i) => {
|
|
138
|
+
de.call(t, i) && (n[i] = t[i]);
|
|
139
|
+
}), n;
|
|
140
140
|
} else
|
|
141
141
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
|
|
143
|
+
function R(t) {
|
|
144
|
+
t.copy || (t.copy = Kt(t.original, t.options));
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
if (!
|
|
148
|
-
return
|
|
149
|
-
if (Array.isArray(
|
|
150
|
-
return
|
|
151
|
-
if (
|
|
152
|
-
return new Map(Array.from(
|
|
153
|
-
if (
|
|
154
|
-
return new Set(Array.from(
|
|
155
|
-
const
|
|
156
|
-
for (const
|
|
157
|
-
|
|
158
|
-
return
|
|
146
|
+
function q(t) {
|
|
147
|
+
if (!j(t))
|
|
148
|
+
return St(t);
|
|
149
|
+
if (Array.isArray(t))
|
|
150
|
+
return t.map(q);
|
|
151
|
+
if (t instanceof Map)
|
|
152
|
+
return new Map(Array.from(t.entries()).map(([s, n]) => [s, q(n)]));
|
|
153
|
+
if (t instanceof Set)
|
|
154
|
+
return new Set(Array.from(t).map(q));
|
|
155
|
+
const e = Object.create(Object.getPrototypeOf(t));
|
|
156
|
+
for (const s in t)
|
|
157
|
+
e[s] = q(t[s]);
|
|
158
|
+
return e;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
return
|
|
160
|
+
function ot(t) {
|
|
161
|
+
return N(t) ? q(t) : t;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
var
|
|
165
|
-
|
|
163
|
+
function L(t) {
|
|
164
|
+
var e;
|
|
165
|
+
t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && L(t.parent));
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function Ut() {
|
|
168
168
|
throw new Error("Cannot modify frozen object");
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function J(t, e, s, n, i) {
|
|
171
171
|
{
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
throw
|
|
178
|
-
if (typeof
|
|
179
|
-
return `[${
|
|
180
|
-
const
|
|
181
|
-
return typeof
|
|
172
|
+
s = s ?? /* @__PURE__ */ new WeakMap(), n = n ?? [], i = i ?? [];
|
|
173
|
+
const r = s.has(t) ? s.get(t) : t;
|
|
174
|
+
if (n.length > 0) {
|
|
175
|
+
const o = n.indexOf(r);
|
|
176
|
+
if (r && typeof r == "object" && o !== -1)
|
|
177
|
+
throw n[0] === r ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${i.slice(0, o).map((u, f) => {
|
|
178
|
+
if (typeof u == "symbol")
|
|
179
|
+
return `[${u.toString()}]`;
|
|
180
|
+
const c = n[f];
|
|
181
|
+
return typeof u == "object" && (c instanceof Map || c instanceof Set) ? Array.from(c.keys()).indexOf(u) : u;
|
|
182
182
|
}).join("/")}`);
|
|
183
|
-
|
|
183
|
+
n.push(r), i.push(e);
|
|
184
184
|
} else
|
|
185
|
-
|
|
185
|
+
n.push(r);
|
|
186
186
|
}
|
|
187
|
-
if (Object.isFrozen(
|
|
188
|
-
|
|
187
|
+
if (Object.isFrozen(t) || N(t)) {
|
|
188
|
+
n.pop(), i.pop();
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
|
-
switch (
|
|
191
|
+
switch (F(t)) {
|
|
192
192
|
case 2:
|
|
193
|
-
for (const [
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
for (const [o, u] of t)
|
|
194
|
+
J(o, o, s, n, i), J(u, o, s, n, i);
|
|
195
|
+
t.set = t.clear = t.delete = Ut;
|
|
196
196
|
break;
|
|
197
197
|
case 3:
|
|
198
|
-
for (const
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
for (const o of t)
|
|
199
|
+
J(o, o, s, n, i);
|
|
200
|
+
t.add = t.clear = t.delete = Ut;
|
|
201
201
|
break;
|
|
202
202
|
case 1:
|
|
203
|
-
Object.freeze(
|
|
204
|
-
let
|
|
205
|
-
for (const
|
|
206
|
-
|
|
203
|
+
Object.freeze(t);
|
|
204
|
+
let r = 0;
|
|
205
|
+
for (const o of t)
|
|
206
|
+
J(o, r, s, n, i), r += 1;
|
|
207
207
|
break;
|
|
208
208
|
default:
|
|
209
|
-
Object.freeze(
|
|
210
|
-
const
|
|
211
|
-
|
|
209
|
+
Object.freeze(t), Object.keys(t).forEach((o) => {
|
|
210
|
+
const u = t[o];
|
|
211
|
+
J(u, o, s, n, i);
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
-
|
|
214
|
+
n.pop(), i.pop();
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
Reflect.ownKeys(
|
|
220
|
-
|
|
216
|
+
function Rt(t, e) {
|
|
217
|
+
const s = F(t);
|
|
218
|
+
if (s === 0)
|
|
219
|
+
Reflect.ownKeys(t).forEach((n) => {
|
|
220
|
+
e(n, t[n], t);
|
|
221
221
|
});
|
|
222
|
-
else if (
|
|
223
|
-
let
|
|
224
|
-
for (const
|
|
225
|
-
|
|
222
|
+
else if (s === 1) {
|
|
223
|
+
let n = 0;
|
|
224
|
+
for (const i of t)
|
|
225
|
+
e(n, i, t), n += 1;
|
|
226
226
|
} else
|
|
227
|
-
|
|
227
|
+
t.forEach((n, i) => e(i, n, t));
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
if (
|
|
229
|
+
function Gt(t, e, s) {
|
|
230
|
+
if (N(t) || !j(t, s) || e.has(t) || Object.isFrozen(t))
|
|
231
231
|
return;
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
234
|
-
var
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
232
|
+
const n = t instanceof Set, i = n ? /* @__PURE__ */ new Map() : void 0;
|
|
233
|
+
if (e.add(t), Rt(t, (a, r) => {
|
|
234
|
+
var o;
|
|
235
|
+
if (N(r)) {
|
|
236
|
+
const u = g(r);
|
|
237
|
+
R(u);
|
|
238
|
+
const f = !((o = u.assignedMap) === null || o === void 0) && o.size || u.operated ? u.copy : u.original;
|
|
239
|
+
tt(n ? i : t, a, f);
|
|
240
240
|
} else
|
|
241
|
-
|
|
242
|
-
}),
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
Gt(r, e, s);
|
|
242
|
+
}), i) {
|
|
243
|
+
const a = t, r = Array.from(a);
|
|
244
|
+
a.clear(), r.forEach((o) => {
|
|
245
|
+
a.add(i.has(o) ? i.get(o) : o);
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
const
|
|
251
|
-
|
|
249
|
+
function me(t, e) {
|
|
250
|
+
const s = t.type === 3 ? t.setMap : t.copy;
|
|
251
|
+
t.finalities.revoke.length > 1 && t.assignedMap.get(e) && s && Gt(V(s, e), t.finalities.handledSet, t.options);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
function gt(t) {
|
|
254
|
+
t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
|
|
255
|
+
t.copy.add(St(e));
|
|
256
256
|
}));
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
if (
|
|
260
|
-
if (
|
|
261
|
-
const
|
|
262
|
-
|
|
258
|
+
function yt(t, e, s, n) {
|
|
259
|
+
if (t.operated && t.assignedMap && t.assignedMap.size > 0 && !t.finalized) {
|
|
260
|
+
if (s && n) {
|
|
261
|
+
const a = qt(t);
|
|
262
|
+
a && e(t, a, s, n);
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
t.finalized = !0;
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
function
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
var
|
|
271
|
-
const
|
|
272
|
-
if (
|
|
273
|
-
let
|
|
274
|
-
|
|
267
|
+
function Et(t, e, s, n) {
|
|
268
|
+
const i = g(s);
|
|
269
|
+
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((a, r) => {
|
|
270
|
+
var o;
|
|
271
|
+
const u = t.type === 3 ? t.setMap : t.copy;
|
|
272
|
+
if (z(V(u, e), s)) {
|
|
273
|
+
let f = i.original;
|
|
274
|
+
i.copy && (f = i.copy), gt(t), yt(t, n, a, r), t.options.enableAutoFreeze && (t.options.updatedValues = (o = t.options.updatedValues) !== null && o !== void 0 ? o : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(f, i.original)), tt(u, e, f);
|
|
275
275
|
}
|
|
276
|
-
}),
|
|
277
|
-
const
|
|
278
|
-
|
|
276
|
+
}), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), j(s, t.options) && t.finalities.draft.push(() => {
|
|
277
|
+
const a = t.type === 3 ? t.setMap : t.copy;
|
|
278
|
+
z(V(a, e), s) && me(t, e);
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
let { original:
|
|
283
|
-
|
|
284
|
-
for (let
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
op:
|
|
289
|
-
path:
|
|
281
|
+
function ge(t, e, s, n, i) {
|
|
282
|
+
let { original: a, assignedMap: r, options: o } = t, u = t.copy;
|
|
283
|
+
u.length < a.length && ([a, u] = [u, a], [s, n] = [n, s]);
|
|
284
|
+
for (let f = 0; f < a.length; f += 1)
|
|
285
|
+
if (r.get(f.toString()) && u[f] !== a[f]) {
|
|
286
|
+
const c = e.concat([f]), h = k(c, i);
|
|
287
|
+
s.push({
|
|
288
|
+
op: M.Replace,
|
|
289
|
+
path: h,
|
|
290
290
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
291
|
-
value:
|
|
292
|
-
}),
|
|
293
|
-
op:
|
|
294
|
-
path:
|
|
291
|
+
value: ot(u[f])
|
|
292
|
+
}), n.push({
|
|
293
|
+
op: M.Replace,
|
|
294
|
+
path: h,
|
|
295
295
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
296
|
-
value:
|
|
296
|
+
value: ot(a[f])
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
for (let
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
op:
|
|
303
|
-
path:
|
|
299
|
+
for (let f = a.length; f < u.length; f += 1) {
|
|
300
|
+
const c = e.concat([f]), h = k(c, i);
|
|
301
|
+
s.push({
|
|
302
|
+
op: M.Add,
|
|
303
|
+
path: h,
|
|
304
304
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
305
|
-
value:
|
|
305
|
+
value: ot(u[f])
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
|
-
if (
|
|
309
|
-
const { arrayLengthAssignment:
|
|
310
|
-
if (
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
op:
|
|
314
|
-
path:
|
|
315
|
-
value:
|
|
308
|
+
if (a.length < u.length) {
|
|
309
|
+
const { arrayLengthAssignment: f = !0 } = o.enablePatches;
|
|
310
|
+
if (f) {
|
|
311
|
+
const c = e.concat(["length"]), h = k(c, i);
|
|
312
|
+
n.push({
|
|
313
|
+
op: M.Replace,
|
|
314
|
+
path: h,
|
|
315
|
+
value: a.length
|
|
316
316
|
});
|
|
317
317
|
} else
|
|
318
|
-
for (let
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
op:
|
|
322
|
-
path:
|
|
318
|
+
for (let c = u.length; a.length < c; c -= 1) {
|
|
319
|
+
const h = e.concat([c - 1]), l = k(h, i);
|
|
320
|
+
n.push({
|
|
321
|
+
op: M.Remove,
|
|
322
|
+
path: l
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
if (
|
|
327
|
+
function ye({ original: t, copy: e, assignedMap: s }, n, i, a, r) {
|
|
328
|
+
s.forEach((o, u) => {
|
|
329
|
+
const f = V(t, u), c = ot(V(e, u)), h = o ? G(t, u) ? M.Replace : M.Add : M.Remove;
|
|
330
|
+
if (z(f, c) && h === M.Replace)
|
|
331
331
|
return;
|
|
332
|
-
const
|
|
333
|
-
|
|
332
|
+
const l = n.concat(u), y = k(l, r);
|
|
333
|
+
i.push(h === M.Remove ? { op: h, path: y } : { op: h, path: y, value: c }), a.push(h === M.Add ? { op: M.Remove, path: y } : h === M.Remove ? { op: M.Add, path: y, value: f } : { op: M.Replace, path: y, value: f });
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
let
|
|
338
|
-
|
|
339
|
-
if (!
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
op:
|
|
343
|
-
path:
|
|
344
|
-
value:
|
|
345
|
-
}),
|
|
346
|
-
op:
|
|
347
|
-
path:
|
|
348
|
-
value:
|
|
336
|
+
function be({ original: t, copy: e }, s, n, i, a) {
|
|
337
|
+
let r = 0;
|
|
338
|
+
t.forEach((o) => {
|
|
339
|
+
if (!e.has(o)) {
|
|
340
|
+
const u = s.concat([r]), f = k(u, a);
|
|
341
|
+
n.push({
|
|
342
|
+
op: M.Remove,
|
|
343
|
+
path: f,
|
|
344
|
+
value: o
|
|
345
|
+
}), i.unshift({
|
|
346
|
+
op: M.Add,
|
|
347
|
+
path: f,
|
|
348
|
+
value: o
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
|
|
352
|
-
}),
|
|
353
|
-
if (!
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
op:
|
|
357
|
-
path:
|
|
358
|
-
value:
|
|
359
|
-
}),
|
|
360
|
-
op:
|
|
361
|
-
path:
|
|
362
|
-
value:
|
|
351
|
+
r += 1;
|
|
352
|
+
}), r = 0, e.forEach((o) => {
|
|
353
|
+
if (!t.has(o)) {
|
|
354
|
+
const u = s.concat([r]), f = k(u, a);
|
|
355
|
+
n.push({
|
|
356
|
+
op: M.Add,
|
|
357
|
+
path: f,
|
|
358
|
+
value: o
|
|
359
|
+
}), i.unshift({
|
|
360
|
+
op: M.Remove,
|
|
361
|
+
path: f,
|
|
362
|
+
value: o
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
|
|
365
|
+
r += 1;
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
const { pathAsArray:
|
|
370
|
-
switch (
|
|
368
|
+
function Q(t, e, s, n) {
|
|
369
|
+
const { pathAsArray: i = !0 } = t.options.enablePatches;
|
|
370
|
+
switch (t.type) {
|
|
371
371
|
case 0:
|
|
372
372
|
case 2:
|
|
373
|
-
return
|
|
373
|
+
return ye(t, e, s, n, i);
|
|
374
374
|
case 1:
|
|
375
|
-
return
|
|
375
|
+
return ge(t, e, s, n, i);
|
|
376
376
|
case 3:
|
|
377
|
-
return
|
|
377
|
+
return be(t, e, s, n, i);
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
let
|
|
381
|
-
const
|
|
382
|
-
if (typeof
|
|
380
|
+
let _e = !1;
|
|
381
|
+
const ut = (t, e, s = !1) => {
|
|
382
|
+
if (typeof t == "object" && t !== null && (!j(t, e) || s) && !_e)
|
|
383
383
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
384
|
-
},
|
|
384
|
+
}, bt = {
|
|
385
385
|
get size() {
|
|
386
|
-
return
|
|
386
|
+
return E(g(this)).size;
|
|
387
387
|
},
|
|
388
|
-
has(
|
|
389
|
-
return
|
|
388
|
+
has(t) {
|
|
389
|
+
return E(g(this)).has(t);
|
|
390
390
|
},
|
|
391
|
-
set(
|
|
392
|
-
const
|
|
393
|
-
return (!
|
|
391
|
+
set(t, e) {
|
|
392
|
+
const s = g(this), n = E(s);
|
|
393
|
+
return (!n.has(t) || !z(n.get(t), e)) && (R(s), L(s), s.assignedMap.set(t, !0), s.copy.set(t, e), Et(s, t, e, Q)), this;
|
|
394
394
|
},
|
|
395
|
-
delete(
|
|
396
|
-
if (!this.has(
|
|
395
|
+
delete(t) {
|
|
396
|
+
if (!this.has(t))
|
|
397
397
|
return !1;
|
|
398
|
-
const
|
|
399
|
-
return
|
|
398
|
+
const e = g(this);
|
|
399
|
+
return R(e), L(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
|
|
400
400
|
},
|
|
401
401
|
clear() {
|
|
402
|
-
const
|
|
402
|
+
const t = g(this);
|
|
403
403
|
if (this.size) {
|
|
404
|
-
|
|
405
|
-
for (const [
|
|
406
|
-
|
|
407
|
-
|
|
404
|
+
R(t), L(t), t.assignedMap = /* @__PURE__ */ new Map();
|
|
405
|
+
for (const [e] of t.original)
|
|
406
|
+
t.assignedMap.set(e, !1);
|
|
407
|
+
t.copy.clear();
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
|
-
forEach(
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
|
|
410
|
+
forEach(t, e) {
|
|
411
|
+
const s = g(this);
|
|
412
|
+
E(s).forEach((n, i) => {
|
|
413
|
+
t.call(e, this.get(i), i, this);
|
|
414
414
|
});
|
|
415
415
|
},
|
|
416
|
-
get(
|
|
417
|
-
var
|
|
418
|
-
const
|
|
419
|
-
if (
|
|
420
|
-
return
|
|
421
|
-
const
|
|
422
|
-
original:
|
|
423
|
-
parentDraft:
|
|
424
|
-
key:
|
|
425
|
-
finalities:
|
|
426
|
-
options:
|
|
416
|
+
get(t) {
|
|
417
|
+
var e, s;
|
|
418
|
+
const n = g(this), i = E(n).get(t), a = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, C)) === C.mutable;
|
|
419
|
+
if (n.options.strict && ut(i, n.options, a), a || n.finalized || !j(i, n.options) || i !== n.original.get(t))
|
|
420
|
+
return i;
|
|
421
|
+
const r = It.createDraft({
|
|
422
|
+
original: i,
|
|
423
|
+
parentDraft: n,
|
|
424
|
+
key: t,
|
|
425
|
+
finalities: n.finalities,
|
|
426
|
+
options: n.options
|
|
427
427
|
});
|
|
428
|
-
return
|
|
428
|
+
return R(n), n.copy.set(t, r), r;
|
|
429
429
|
},
|
|
430
430
|
keys() {
|
|
431
|
-
return
|
|
431
|
+
return E(g(this)).keys();
|
|
432
432
|
},
|
|
433
433
|
values() {
|
|
434
|
-
const
|
|
434
|
+
const t = this.keys();
|
|
435
435
|
return {
|
|
436
|
-
[
|
|
436
|
+
[rt]: () => this.values(),
|
|
437
437
|
next: () => {
|
|
438
|
-
const
|
|
439
|
-
return
|
|
438
|
+
const e = t.next();
|
|
439
|
+
return e.done ? e : {
|
|
440
440
|
done: !1,
|
|
441
|
-
value: this.get(
|
|
441
|
+
value: this.get(e.value)
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
444
|
};
|
|
445
445
|
},
|
|
446
446
|
entries() {
|
|
447
|
-
const
|
|
447
|
+
const t = this.keys();
|
|
448
448
|
return {
|
|
449
|
-
[
|
|
449
|
+
[rt]: () => this.entries(),
|
|
450
450
|
next: () => {
|
|
451
|
-
const
|
|
452
|
-
if (
|
|
453
|
-
return
|
|
454
|
-
const
|
|
451
|
+
const e = t.next();
|
|
452
|
+
if (e.done)
|
|
453
|
+
return e;
|
|
454
|
+
const s = this.get(e.value);
|
|
455
455
|
return {
|
|
456
456
|
done: !1,
|
|
457
|
-
value: [
|
|
457
|
+
value: [e.value, s]
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
461
|
},
|
|
462
|
-
[
|
|
462
|
+
[rt]() {
|
|
463
463
|
return this.entries();
|
|
464
464
|
}
|
|
465
|
-
},
|
|
466
|
-
var
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
return
|
|
470
|
-
const
|
|
471
|
-
let
|
|
472
|
-
const
|
|
473
|
-
if (
|
|
474
|
-
const
|
|
475
|
-
original:
|
|
476
|
-
parentDraft:
|
|
477
|
-
key:
|
|
478
|
-
finalities:
|
|
479
|
-
options:
|
|
465
|
+
}, ve = Reflect.ownKeys(bt), $t = (t, e, { isValuesIterator: s }) => () => {
|
|
466
|
+
var n, i;
|
|
467
|
+
const a = e.next();
|
|
468
|
+
if (a.done)
|
|
469
|
+
return a;
|
|
470
|
+
const r = a.value;
|
|
471
|
+
let o = t.setMap.get(r);
|
|
472
|
+
const u = g(o), f = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, o, C)) === C.mutable;
|
|
473
|
+
if (t.options.strict && ut(r, t.options, f), !f && !u && j(r, t.options) && !t.finalized && t.original.has(r)) {
|
|
474
|
+
const c = It.createDraft({
|
|
475
|
+
original: r,
|
|
476
|
+
parentDraft: t,
|
|
477
|
+
key: r,
|
|
478
|
+
finalities: t.finalities,
|
|
479
|
+
options: t.options
|
|
480
480
|
});
|
|
481
|
-
|
|
481
|
+
t.setMap.set(r, c), o = c;
|
|
482
482
|
} else
|
|
483
|
-
|
|
483
|
+
u && (o = u.proxy);
|
|
484
484
|
return {
|
|
485
485
|
done: !1,
|
|
486
|
-
value:
|
|
486
|
+
value: s ? o : [o, o]
|
|
487
487
|
};
|
|
488
|
-
},
|
|
488
|
+
}, _t = {
|
|
489
489
|
get size() {
|
|
490
|
-
return
|
|
490
|
+
return g(this).setMap.size;
|
|
491
491
|
},
|
|
492
|
-
has(
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
492
|
+
has(t) {
|
|
493
|
+
const e = g(this);
|
|
494
|
+
if (e.setMap.has(t))
|
|
495
495
|
return !0;
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
return !!(
|
|
496
|
+
R(e);
|
|
497
|
+
const s = g(t);
|
|
498
|
+
return !!(s && e.setMap.has(s.original));
|
|
499
499
|
},
|
|
500
|
-
add(
|
|
501
|
-
const
|
|
502
|
-
return this.has(
|
|
500
|
+
add(t) {
|
|
501
|
+
const e = g(this);
|
|
502
|
+
return this.has(t) || (R(e), L(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), Et(e, t, t, Q)), this;
|
|
503
503
|
},
|
|
504
|
-
delete(
|
|
505
|
-
if (!this.has(
|
|
504
|
+
delete(t) {
|
|
505
|
+
if (!this.has(t))
|
|
506
506
|
return !1;
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
return
|
|
507
|
+
const e = g(this);
|
|
508
|
+
R(e), L(e);
|
|
509
|
+
const s = g(t);
|
|
510
|
+
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));
|
|
511
511
|
},
|
|
512
512
|
clear() {
|
|
513
513
|
if (!this.size)
|
|
514
514
|
return;
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
for (const
|
|
518
|
-
|
|
519
|
-
|
|
515
|
+
const t = g(this);
|
|
516
|
+
R(t), L(t);
|
|
517
|
+
for (const e of t.original)
|
|
518
|
+
t.assignedMap.set(e, !1);
|
|
519
|
+
t.setMap.clear();
|
|
520
520
|
},
|
|
521
521
|
values() {
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const
|
|
522
|
+
const t = g(this);
|
|
523
|
+
R(t);
|
|
524
|
+
const e = t.setMap.keys();
|
|
525
525
|
return {
|
|
526
526
|
[Symbol.iterator]: () => this.values(),
|
|
527
|
-
next:
|
|
527
|
+
next: $t(t, e, { isValuesIterator: !0 })
|
|
528
528
|
};
|
|
529
529
|
},
|
|
530
530
|
entries() {
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
const
|
|
531
|
+
const t = g(this);
|
|
532
|
+
R(t);
|
|
533
|
+
const e = t.setMap.keys();
|
|
534
534
|
return {
|
|
535
535
|
[Symbol.iterator]: () => this.entries(),
|
|
536
|
-
next:
|
|
536
|
+
next: $t(t, e, {
|
|
537
537
|
isValuesIterator: !1
|
|
538
538
|
})
|
|
539
539
|
};
|
|
@@ -541,99 +541,99 @@ const $t = (e, t, n = !1) => {
|
|
|
541
541
|
keys() {
|
|
542
542
|
return this.values();
|
|
543
543
|
},
|
|
544
|
-
[
|
|
544
|
+
[rt]() {
|
|
545
545
|
return this.values();
|
|
546
546
|
},
|
|
547
|
-
forEach(
|
|
548
|
-
const
|
|
549
|
-
let
|
|
550
|
-
for (; !
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
get(
|
|
555
|
-
var
|
|
556
|
-
const
|
|
557
|
-
if (
|
|
558
|
-
return
|
|
559
|
-
if (
|
|
560
|
-
return
|
|
561
|
-
let
|
|
562
|
-
if (
|
|
563
|
-
const
|
|
564
|
-
if (
|
|
565
|
-
return
|
|
547
|
+
forEach(t, e) {
|
|
548
|
+
const s = this.values();
|
|
549
|
+
let n = s.next();
|
|
550
|
+
for (; !n.done; )
|
|
551
|
+
t.call(e, n.value, n.value, this), n = s.next();
|
|
552
|
+
}
|
|
553
|
+
}, we = Reflect.ownKeys(_t), Yt = /* @__PURE__ */ new WeakSet(), Xt = {
|
|
554
|
+
get(t, e, s) {
|
|
555
|
+
var n, i;
|
|
556
|
+
const a = (n = t.copy) === null || n === void 0 ? void 0 : n[e];
|
|
557
|
+
if (a && Yt.has(a))
|
|
558
|
+
return a;
|
|
559
|
+
if (e === Ht)
|
|
560
|
+
return t;
|
|
561
|
+
let r;
|
|
562
|
+
if (t.options.mark) {
|
|
563
|
+
const f = e === "size" && (t.original instanceof Map || t.original instanceof Set) ? Reflect.get(t.original, e) : Reflect.get(t.original, e, s);
|
|
564
|
+
if (r = t.options.mark(f, C), r === C.mutable)
|
|
565
|
+
return t.options.strict && ut(f, t.options, !0), f;
|
|
566
566
|
}
|
|
567
|
-
const
|
|
568
|
-
if (
|
|
569
|
-
if (
|
|
570
|
-
return Object.getOwnPropertyDescriptor(
|
|
571
|
-
const
|
|
572
|
-
if (
|
|
573
|
-
return
|
|
567
|
+
const o = E(t);
|
|
568
|
+
if (o instanceof Map && ve.includes(e)) {
|
|
569
|
+
if (e === "size")
|
|
570
|
+
return Object.getOwnPropertyDescriptor(bt, "size").get.call(t.proxy);
|
|
571
|
+
const f = bt[e];
|
|
572
|
+
if (f)
|
|
573
|
+
return f.bind(t.proxy);
|
|
574
574
|
}
|
|
575
|
-
if (
|
|
576
|
-
if (
|
|
577
|
-
return Object.getOwnPropertyDescriptor(
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
580
|
-
return
|
|
575
|
+
if (o instanceof Set && we.includes(e)) {
|
|
576
|
+
if (e === "size")
|
|
577
|
+
return Object.getOwnPropertyDescriptor(_t, "size").get.call(t.proxy);
|
|
578
|
+
const f = _t[e];
|
|
579
|
+
if (f)
|
|
580
|
+
return f.bind(t.proxy);
|
|
581
581
|
}
|
|
582
|
-
if (!
|
|
583
|
-
const
|
|
584
|
-
return
|
|
582
|
+
if (!G(o, e)) {
|
|
583
|
+
const f = Lt(o, e);
|
|
584
|
+
return f ? "value" in f ? f.value : (
|
|
585
585
|
// !case: support for getter
|
|
586
|
-
(
|
|
586
|
+
(i = f.get) === null || i === void 0 ? void 0 : i.call(t.proxy)
|
|
587
587
|
) : void 0;
|
|
588
588
|
}
|
|
589
|
-
const
|
|
590
|
-
if (
|
|
591
|
-
return
|
|
592
|
-
if (
|
|
593
|
-
if (
|
|
594
|
-
original:
|
|
595
|
-
parentDraft:
|
|
596
|
-
key:
|
|
597
|
-
finalities:
|
|
598
|
-
options:
|
|
599
|
-
}), typeof
|
|
600
|
-
const
|
|
601
|
-
return
|
|
589
|
+
const u = o[e];
|
|
590
|
+
if (t.options.strict && ut(u, t.options), t.finalized || !j(u, t.options))
|
|
591
|
+
return u;
|
|
592
|
+
if (u === pt(t.original, e)) {
|
|
593
|
+
if (R(t), t.copy[e] = At({
|
|
594
|
+
original: t.original[e],
|
|
595
|
+
parentDraft: t,
|
|
596
|
+
key: t.type === 1 ? Number(e) : e,
|
|
597
|
+
finalities: t.finalities,
|
|
598
|
+
options: t.options
|
|
599
|
+
}), typeof r == "function") {
|
|
600
|
+
const f = g(t.copy[e]);
|
|
601
|
+
return R(f), L(f), f.copy;
|
|
602
602
|
}
|
|
603
|
-
return
|
|
603
|
+
return t.copy[e];
|
|
604
604
|
}
|
|
605
|
-
return
|
|
605
|
+
return u;
|
|
606
606
|
},
|
|
607
|
-
set(
|
|
608
|
-
var
|
|
609
|
-
if (
|
|
607
|
+
set(t, e, s) {
|
|
608
|
+
var n;
|
|
609
|
+
if (t.type === 3 || t.type === 2)
|
|
610
610
|
throw new Error("Map/Set draft does not support any property assignment.");
|
|
611
|
-
let
|
|
612
|
-
if (
|
|
611
|
+
let i;
|
|
612
|
+
if (t.type === 1 && e !== "length" && !(Number.isInteger(i = Number(e)) && i >= 0 && (e === 0 || i === 0 || String(i) === String(e))))
|
|
613
613
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
616
|
-
return
|
|
617
|
-
const
|
|
618
|
-
return
|
|
614
|
+
const a = Lt(E(t), e);
|
|
615
|
+
if (a != null && a.set)
|
|
616
|
+
return a.set.call(t.proxy, s), !0;
|
|
617
|
+
const r = pt(E(t), e), o = g(r);
|
|
618
|
+
return o && z(o.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) : (z(s, r) && (s !== void 0 || G(t.original, e)) || (R(t), L(t), G(t.original, e) && z(s, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = s, Et(t, e, s, Q)), !0);
|
|
619
619
|
},
|
|
620
|
-
has(
|
|
621
|
-
return
|
|
620
|
+
has(t, e) {
|
|
621
|
+
return e in E(t);
|
|
622
622
|
},
|
|
623
|
-
ownKeys(
|
|
624
|
-
return Reflect.ownKeys(
|
|
623
|
+
ownKeys(t) {
|
|
624
|
+
return Reflect.ownKeys(E(t));
|
|
625
625
|
},
|
|
626
|
-
getOwnPropertyDescriptor(
|
|
627
|
-
const
|
|
628
|
-
return
|
|
626
|
+
getOwnPropertyDescriptor(t, e) {
|
|
627
|
+
const s = E(t), n = Reflect.getOwnPropertyDescriptor(s, e);
|
|
628
|
+
return n && {
|
|
629
629
|
writable: !0,
|
|
630
|
-
configurable:
|
|
631
|
-
enumerable:
|
|
632
|
-
value:
|
|
630
|
+
configurable: t.type !== 1 || e !== "length",
|
|
631
|
+
enumerable: n.enumerable,
|
|
632
|
+
value: s[e]
|
|
633
633
|
};
|
|
634
634
|
},
|
|
635
|
-
getPrototypeOf(
|
|
636
|
-
return Reflect.getPrototypeOf(
|
|
635
|
+
getPrototypeOf(t) {
|
|
636
|
+
return Reflect.getPrototypeOf(t.original);
|
|
637
637
|
},
|
|
638
638
|
setPrototypeOf() {
|
|
639
639
|
throw new Error("Cannot call 'setPrototypeOf()' on drafts");
|
|
@@ -641,1841 +641,969 @@ const $t = (e, t, n = !1) => {
|
|
|
641
641
|
defineProperty() {
|
|
642
642
|
throw new Error("Cannot call 'defineProperty()' on drafts");
|
|
643
643
|
},
|
|
644
|
-
deleteProperty(
|
|
645
|
-
var
|
|
646
|
-
return
|
|
644
|
+
deleteProperty(t, e) {
|
|
645
|
+
var s;
|
|
646
|
+
return t.type === 1 ? Xt.set.call(this, t, e, void 0, t.proxy) : (pt(t.original, e) !== void 0 || e in t.original ? (R(t), L(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);
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
|
-
function
|
|
650
|
-
const { original:
|
|
651
|
-
type:
|
|
649
|
+
function At(t) {
|
|
650
|
+
const { original: e, parentDraft: s, key: n, finalities: i, options: a } = t, r = F(e), o = {
|
|
651
|
+
type: r,
|
|
652
652
|
finalized: !1,
|
|
653
|
-
parent:
|
|
654
|
-
original:
|
|
653
|
+
parent: s,
|
|
654
|
+
original: e,
|
|
655
655
|
copy: null,
|
|
656
656
|
proxy: null,
|
|
657
|
-
finalities:
|
|
658
|
-
options:
|
|
657
|
+
finalities: i,
|
|
658
|
+
options: a,
|
|
659
659
|
// Mapping of draft Set items to their corresponding draft values.
|
|
660
|
-
setMap:
|
|
660
|
+
setMap: r === 3 ? new Map(e.entries()) : void 0
|
|
661
661
|
};
|
|
662
|
-
(
|
|
663
|
-
const { proxy:
|
|
664
|
-
if (
|
|
665
|
-
const
|
|
666
|
-
|
|
667
|
-
var
|
|
668
|
-
const
|
|
669
|
-
let
|
|
670
|
-
const S =
|
|
671
|
-
if (
|
|
672
|
-
let
|
|
673
|
-
|
|
662
|
+
(n || "key" in t) && (o.key = n);
|
|
663
|
+
const { proxy: u, revoke: f } = Proxy.revocable(r === 1 ? Object.assign([], o) : o, Xt);
|
|
664
|
+
if (i.revoke.push(f), Yt.add(u), o.proxy = u, s) {
|
|
665
|
+
const c = s;
|
|
666
|
+
c.finalities.draft.push((h, l) => {
|
|
667
|
+
var y, m;
|
|
668
|
+
const I = g(u);
|
|
669
|
+
let p = c.type === 3 ? c.setMap : c.copy;
|
|
670
|
+
const S = V(p, n), w = g(S);
|
|
671
|
+
if (w) {
|
|
672
|
+
let _ = w.original;
|
|
673
|
+
w.operated && (_ = St(S)), gt(w), yt(w, Q, h, l), c.options.enableAutoFreeze && (c.options.updatedValues = (y = c.options.updatedValues) !== null && y !== void 0 ? y : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(_, w.original)), tt(p, n, _);
|
|
674
674
|
}
|
|
675
|
-
(
|
|
676
|
-
|
|
675
|
+
(m = I.callbacks) === null || m === void 0 || m.forEach((_) => {
|
|
676
|
+
_(h, l);
|
|
677
677
|
});
|
|
678
678
|
});
|
|
679
679
|
} else {
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
680
|
+
const c = g(u);
|
|
681
|
+
c.finalities.draft.push((h, l) => {
|
|
682
|
+
gt(c), yt(c, Q, h, l);
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
|
-
return
|
|
685
|
+
return u;
|
|
686
686
|
}
|
|
687
|
-
|
|
688
|
-
function
|
|
689
|
-
var
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
for (;
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
return
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
687
|
+
It.createDraft = At;
|
|
688
|
+
function Me(t, e, s, n, i) {
|
|
689
|
+
var a;
|
|
690
|
+
const r = g(t), o = (a = r == null ? void 0 : r.original) !== null && a !== void 0 ? a : t, u = !!e.length;
|
|
691
|
+
if (r != null && r.operated)
|
|
692
|
+
for (; r.finalities.draft.length > 0; )
|
|
693
|
+
r.finalities.draft.pop()(s, n);
|
|
694
|
+
const f = u ? e[0] : r ? r.operated ? r.copy : r.original : t;
|
|
695
|
+
return r && mt(r), i && J(f, f, r == null ? void 0 : r.options.updatedValues), [
|
|
696
|
+
f,
|
|
697
|
+
s && u ? [{ op: M.Replace, path: [], value: e[0] }] : s,
|
|
698
|
+
n && u ? [{ op: M.Replace, path: [], value: o }] : n
|
|
699
699
|
];
|
|
700
700
|
}
|
|
701
|
-
function
|
|
702
|
-
var
|
|
703
|
-
const
|
|
701
|
+
function Oe(t, e) {
|
|
702
|
+
var s;
|
|
703
|
+
const n = {
|
|
704
704
|
draft: [],
|
|
705
705
|
revoke: [],
|
|
706
706
|
handledSet: /* @__PURE__ */ new WeakSet()
|
|
707
707
|
};
|
|
708
|
-
let
|
|
709
|
-
|
|
710
|
-
const
|
|
711
|
-
original:
|
|
708
|
+
let i, a;
|
|
709
|
+
e.enablePatches && (i = [], a = []);
|
|
710
|
+
const o = ((s = e.mark) === null || s === void 0 ? void 0 : s.call(e, t, C)) === C.mutable || !j(t, e) ? t : At({
|
|
711
|
+
original: t,
|
|
712
712
|
parentDraft: null,
|
|
713
|
-
finalities:
|
|
714
|
-
options:
|
|
713
|
+
finalities: n,
|
|
714
|
+
options: e
|
|
715
715
|
});
|
|
716
716
|
return [
|
|
717
|
-
|
|
718
|
-
(
|
|
719
|
-
const [
|
|
720
|
-
return
|
|
717
|
+
o,
|
|
718
|
+
(u = []) => {
|
|
719
|
+
const [f, c, h] = Me(o, u, i, a, e.enableAutoFreeze);
|
|
720
|
+
return e.enablePatches ? [f, c, h] : f;
|
|
721
721
|
}
|
|
722
722
|
];
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
const { rootDraft:
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
if (
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
if (
|
|
732
|
-
const
|
|
733
|
-
|
|
724
|
+
function vt(t) {
|
|
725
|
+
const { rootDraft: e, value: s, useRawReturn: n = !1, isRoot: i = !0 } = t;
|
|
726
|
+
Rt(s, (a, r, o) => {
|
|
727
|
+
const u = g(r);
|
|
728
|
+
if (u && e && u.finalities === e.finalities) {
|
|
729
|
+
t.isContainDraft = !0;
|
|
730
|
+
const f = u.original;
|
|
731
|
+
if (o instanceof Set) {
|
|
732
|
+
const c = Array.from(o);
|
|
733
|
+
o.clear(), c.forEach((h) => o.add(a === h ? f : h));
|
|
734
734
|
} else
|
|
735
|
-
|
|
735
|
+
tt(o, a, f);
|
|
736
736
|
} else
|
|
737
|
-
typeof
|
|
738
|
-
}),
|
|
737
|
+
typeof r == "object" && r !== null && (t.value = r, t.isRoot = !1, vt(t));
|
|
738
|
+
}), 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."));
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
const
|
|
742
|
-
if (!
|
|
743
|
-
return
|
|
744
|
-
const
|
|
745
|
-
if (
|
|
746
|
-
return
|
|
747
|
-
let
|
|
748
|
-
function
|
|
749
|
-
|
|
740
|
+
function Qt(t) {
|
|
741
|
+
const e = g(t);
|
|
742
|
+
if (!j(t, e == null ? void 0 : e.options))
|
|
743
|
+
return t;
|
|
744
|
+
const s = F(t);
|
|
745
|
+
if (e && !e.operated)
|
|
746
|
+
return e.original;
|
|
747
|
+
let n;
|
|
748
|
+
function i() {
|
|
749
|
+
n = s === 2 ? new Map(t) : s === 3 ? Array.from(e.setMap.values()) : Kt(t, e == null ? void 0 : e.options);
|
|
750
750
|
}
|
|
751
|
-
if (
|
|
752
|
-
|
|
751
|
+
if (e) {
|
|
752
|
+
e.finalized = !0;
|
|
753
753
|
try {
|
|
754
|
-
|
|
754
|
+
i();
|
|
755
755
|
} finally {
|
|
756
|
-
|
|
756
|
+
e.finalized = !1;
|
|
757
757
|
}
|
|
758
758
|
} else
|
|
759
|
-
|
|
760
|
-
return
|
|
761
|
-
if (
|
|
759
|
+
n = t;
|
|
760
|
+
return Rt(n, (a, r) => {
|
|
761
|
+
if (e && z(V(e.original, a), r))
|
|
762
762
|
return;
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
}),
|
|
763
|
+
const o = Qt(r);
|
|
764
|
+
o !== r && (n === t && i(), tt(n, a, o));
|
|
765
|
+
}), s === 3 ? new Set(n) : n;
|
|
766
766
|
}
|
|
767
|
-
function
|
|
768
|
-
if (!
|
|
769
|
-
throw new Error(`current() is only used for Draft, parameter: ${
|
|
770
|
-
return
|
|
767
|
+
function zt(t) {
|
|
768
|
+
if (!N(t))
|
|
769
|
+
throw new Error(`current() is only used for Draft, parameter: ${t}`);
|
|
770
|
+
return Qt(t);
|
|
771
771
|
}
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
throw new Error(`Invalid options: ${String(
|
|
775
|
-
return function
|
|
776
|
-
var
|
|
777
|
-
if (typeof
|
|
778
|
-
return function(
|
|
779
|
-
return
|
|
772
|
+
const Ie = (t) => {
|
|
773
|
+
if (t !== void 0 && Object.prototype.toString.call(t) !== "[object Object]")
|
|
774
|
+
throw new Error(`Invalid options: ${String(t)}, 'options' should be an object.`);
|
|
775
|
+
return function e(s, n, i) {
|
|
776
|
+
var a, r, o;
|
|
777
|
+
if (typeof s == "function" && typeof n != "function")
|
|
778
|
+
return function(b, ...U) {
|
|
779
|
+
return e(b, (x) => s.call(this, x, ...U), n);
|
|
780
780
|
};
|
|
781
|
-
const
|
|
782
|
-
let
|
|
783
|
-
if (typeof
|
|
784
|
-
throw new Error(`Invalid options: ${
|
|
785
|
-
|
|
786
|
-
const
|
|
787
|
-
for (const
|
|
788
|
-
if (typeof
|
|
789
|
-
throw new Error(`Invalid mark: ${
|
|
790
|
-
const
|
|
791
|
-
if (
|
|
792
|
-
return
|
|
781
|
+
const u = s, f = n;
|
|
782
|
+
let c = i;
|
|
783
|
+
if (typeof n != "function" && (c = n), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
|
|
784
|
+
throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
|
|
785
|
+
c = Object.assign(Object.assign({}, t), c);
|
|
786
|
+
const h = N(u) ? zt(u) : u, l = Array.isArray(c.mark) ? (b, U) => {
|
|
787
|
+
for (const x of c.mark) {
|
|
788
|
+
if (typeof x != "function")
|
|
789
|
+
throw new Error(`Invalid mark: ${x}, 'mark' should be a function.`);
|
|
790
|
+
const H = x(b, U);
|
|
791
|
+
if (H)
|
|
792
|
+
return H;
|
|
793
793
|
}
|
|
794
|
-
} :
|
|
795
|
-
enableAutoFreeze: (
|
|
796
|
-
mark:
|
|
797
|
-
strict:
|
|
798
|
-
enablePatches:
|
|
794
|
+
} : c.mark, y = (a = c.enablePatches) !== null && a !== void 0 ? a : !1, m = (r = c.strict) !== null && r !== void 0 ? r : !1, p = {
|
|
795
|
+
enableAutoFreeze: (o = c.enableAutoFreeze) !== null && o !== void 0 ? o : !1,
|
|
796
|
+
mark: l,
|
|
797
|
+
strict: m,
|
|
798
|
+
enablePatches: y
|
|
799
799
|
};
|
|
800
|
-
if (!
|
|
800
|
+
if (!j(h, p) && typeof h == "object" && h !== null)
|
|
801
801
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
802
|
-
const [S,
|
|
803
|
-
if (typeof
|
|
804
|
-
if (!
|
|
802
|
+
const [S, w] = Oe(h, p);
|
|
803
|
+
if (typeof n != "function") {
|
|
804
|
+
if (!j(h, p))
|
|
805
805
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
806
|
-
return [S,
|
|
806
|
+
return [S, w];
|
|
807
807
|
}
|
|
808
|
-
let
|
|
808
|
+
let _;
|
|
809
809
|
try {
|
|
810
|
-
|
|
811
|
-
} catch (
|
|
812
|
-
throw
|
|
810
|
+
_ = f(S);
|
|
811
|
+
} catch (b) {
|
|
812
|
+
throw mt(g(S)), b;
|
|
813
813
|
}
|
|
814
|
-
const
|
|
815
|
-
const
|
|
816
|
-
if (!
|
|
817
|
-
if (
|
|
814
|
+
const et = (b) => {
|
|
815
|
+
const U = g(S);
|
|
816
|
+
if (!N(b)) {
|
|
817
|
+
if (b !== void 0 && !z(b, S) && (U != null && U.operated))
|
|
818
818
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
819
|
-
const
|
|
820
|
-
if (
|
|
821
|
-
const
|
|
822
|
-
return
|
|
823
|
-
rootDraft:
|
|
824
|
-
value:
|
|
819
|
+
const H = b == null ? void 0 : b[he];
|
|
820
|
+
if (H) {
|
|
821
|
+
const ce = H[0];
|
|
822
|
+
return p.strict && typeof b == "object" && b !== null && vt({
|
|
823
|
+
rootDraft: U,
|
|
824
|
+
value: b,
|
|
825
825
|
useRawReturn: !0
|
|
826
|
-
}),
|
|
826
|
+
}), w([ce]);
|
|
827
827
|
}
|
|
828
|
-
if (
|
|
829
|
-
return typeof
|
|
828
|
+
if (b !== void 0)
|
|
829
|
+
return typeof b == "object" && b !== null && vt({ rootDraft: U, value: b }), w([b]);
|
|
830
830
|
}
|
|
831
|
-
if (
|
|
832
|
-
return
|
|
833
|
-
const
|
|
834
|
-
if (
|
|
835
|
-
if (
|
|
831
|
+
if (b === S || b === void 0)
|
|
832
|
+
return w([]);
|
|
833
|
+
const x = g(b);
|
|
834
|
+
if (p === x.options) {
|
|
835
|
+
if (x.operated)
|
|
836
836
|
throw new Error("Cannot return a modified child draft.");
|
|
837
|
-
return
|
|
837
|
+
return w([zt(b)]);
|
|
838
838
|
}
|
|
839
|
-
return
|
|
839
|
+
return w([b]);
|
|
840
840
|
};
|
|
841
|
-
return
|
|
842
|
-
throw
|
|
843
|
-
}) :
|
|
841
|
+
return _ instanceof Promise ? _.then(et, (b) => {
|
|
842
|
+
throw mt(g(S)), b;
|
|
843
|
+
}) : et(_);
|
|
844
844
|
};
|
|
845
|
-
},
|
|
845
|
+
}, v = Ie();
|
|
846
846
|
Object.prototype.constructor.toString();
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
for (var h = typeof Ut == "function" && Ut, g = 0; g < c.length; g++)
|
|
877
|
-
f(c[g]);
|
|
878
|
-
return f;
|
|
879
|
-
}({ 1: [function(n, i, o) {
|
|
880
|
-
(function(c, f, h, g, y, b, O, U, B) {
|
|
881
|
-
var I = n("crypto");
|
|
882
|
-
function L(m, v) {
|
|
883
|
-
v = R(m, v);
|
|
884
|
-
var a;
|
|
885
|
-
return (a = v.algorithm !== "passthrough" ? I.createHash(v.algorithm) : new j()).write === void 0 && (a.write = a.update, a.end = a.update), P(v, a).dispatch(m), a.update || a.end(""), a.digest ? a.digest(v.encoding === "buffer" ? void 0 : v.encoding) : (m = a.read(), v.encoding !== "buffer" ? m.toString(v.encoding) : m);
|
|
886
|
-
}
|
|
887
|
-
(o = i.exports = L).sha1 = function(m) {
|
|
888
|
-
return L(m);
|
|
889
|
-
}, o.keys = function(m) {
|
|
890
|
-
return L(m, { excludeValues: !0, algorithm: "sha1", encoding: "hex" });
|
|
891
|
-
}, o.MD5 = function(m) {
|
|
892
|
-
return L(m, { algorithm: "md5", encoding: "hex" });
|
|
893
|
-
}, o.keysMD5 = function(m) {
|
|
894
|
-
return L(m, { algorithm: "md5", encoding: "hex", excludeValues: !0 });
|
|
895
|
-
};
|
|
896
|
-
var d = I.getHashes ? I.getHashes().slice() : ["sha1", "md5"], S = (d.push("passthrough"), ["buffer", "hex", "binary", "base64"]);
|
|
897
|
-
function R(m, v) {
|
|
898
|
-
var a = {};
|
|
899
|
-
if (a.algorithm = (v = v || {}).algorithm || "sha1", a.encoding = v.encoding || "hex", a.excludeValues = !!v.excludeValues, a.algorithm = a.algorithm.toLowerCase(), a.encoding = a.encoding.toLowerCase(), a.ignoreUnknown = v.ignoreUnknown === !0, a.respectType = v.respectType !== !1, a.respectFunctionNames = v.respectFunctionNames !== !1, a.respectFunctionProperties = v.respectFunctionProperties !== !1, a.unorderedArrays = v.unorderedArrays === !0, a.unorderedSets = v.unorderedSets !== !1, a.unorderedObjects = v.unorderedObjects !== !1, a.replacer = v.replacer || void 0, a.excludeKeys = v.excludeKeys || void 0, m === void 0)
|
|
900
|
-
throw new Error("Object argument required.");
|
|
901
|
-
for (var l = 0; l < d.length; ++l)
|
|
902
|
-
d[l].toLowerCase() === a.algorithm.toLowerCase() && (a.algorithm = d[l]);
|
|
903
|
-
if (d.indexOf(a.algorithm) === -1)
|
|
904
|
-
throw new Error('Algorithm "' + a.algorithm + '" not supported. supported values: ' + d.join(", "));
|
|
905
|
-
if (S.indexOf(a.encoding) === -1 && a.algorithm !== "passthrough")
|
|
906
|
-
throw new Error('Encoding "' + a.encoding + '" not supported. supported values: ' + S.join(", "));
|
|
907
|
-
return a;
|
|
908
|
-
}
|
|
909
|
-
function E(m) {
|
|
910
|
-
if (typeof m == "function")
|
|
911
|
-
return /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(m)) != null;
|
|
912
|
-
}
|
|
913
|
-
function P(m, v, a) {
|
|
914
|
-
a = a || [];
|
|
915
|
-
function l(r) {
|
|
916
|
-
return v.update ? v.update(r, "utf8") : v.write(r, "utf8");
|
|
917
|
-
}
|
|
918
|
-
return { dispatch: function(r) {
|
|
919
|
-
return this["_" + ((r = m.replacer ? m.replacer(r) : r) === null ? "null" : typeof r)](r);
|
|
920
|
-
}, _object: function(r) {
|
|
921
|
-
var w, _ = Object.prototype.toString.call(r), N = /\[object (.*)\]/i.exec(_);
|
|
922
|
-
if (N = (N = N ? N[1] : "unknown:[" + _ + "]").toLowerCase(), 0 <= (_ = a.indexOf(r)))
|
|
923
|
-
return this.dispatch("[CIRCULAR:" + _ + "]");
|
|
924
|
-
if (a.push(r), h !== void 0 && h.isBuffer && h.isBuffer(r))
|
|
925
|
-
return l("buffer:"), l(r);
|
|
926
|
-
if (N === "object" || N === "function" || N === "asyncfunction")
|
|
927
|
-
return _ = Object.keys(r), m.unorderedObjects && (_ = _.sort()), m.respectType === !1 || E(r) || _.splice(0, 0, "prototype", "__proto__", "constructor"), m.excludeKeys && (_ = _.filter(function(T) {
|
|
928
|
-
return !m.excludeKeys(T);
|
|
929
|
-
})), l("object:" + _.length + ":"), w = this, _.forEach(function(T) {
|
|
930
|
-
w.dispatch(T), l(":"), m.excludeValues || w.dispatch(r[T]), l(",");
|
|
931
|
-
});
|
|
932
|
-
if (!this["_" + N]) {
|
|
933
|
-
if (m.ignoreUnknown)
|
|
934
|
-
return l("[" + N + "]");
|
|
935
|
-
throw new Error('Unknown object type "' + N + '"');
|
|
936
|
-
}
|
|
937
|
-
this["_" + N](r);
|
|
938
|
-
}, _array: function(r, T) {
|
|
939
|
-
T = T !== void 0 ? T : m.unorderedArrays !== !1;
|
|
940
|
-
var _ = this;
|
|
941
|
-
if (l("array:" + r.length + ":"), !T || r.length <= 1)
|
|
942
|
-
return r.forEach(function(z) {
|
|
943
|
-
return _.dispatch(z);
|
|
944
|
-
});
|
|
945
|
-
var N = [], T = r.map(function(z) {
|
|
946
|
-
var x = new j(), J = a.slice();
|
|
947
|
-
return P(m, x, J).dispatch(z), N = N.concat(J.slice(a.length)), x.read().toString();
|
|
948
|
-
});
|
|
949
|
-
return a = a.concat(N), T.sort(), this._array(T, !1);
|
|
950
|
-
}, _date: function(r) {
|
|
951
|
-
return l("date:" + r.toJSON());
|
|
952
|
-
}, _symbol: function(r) {
|
|
953
|
-
return l("symbol:" + r.toString());
|
|
954
|
-
}, _error: function(r) {
|
|
955
|
-
return l("error:" + r.toString());
|
|
956
|
-
}, _boolean: function(r) {
|
|
957
|
-
return l("bool:" + r.toString());
|
|
958
|
-
}, _string: function(r) {
|
|
959
|
-
l("string:" + r.length + ":"), l(r.toString());
|
|
960
|
-
}, _function: function(r) {
|
|
961
|
-
l("fn:"), E(r) ? this.dispatch("[native]") : this.dispatch(r.toString()), m.respectFunctionNames !== !1 && this.dispatch("function-name:" + String(r.name)), m.respectFunctionProperties && this._object(r);
|
|
962
|
-
}, _number: function(r) {
|
|
963
|
-
return l("number:" + r.toString());
|
|
964
|
-
}, _xml: function(r) {
|
|
965
|
-
return l("xml:" + r.toString());
|
|
966
|
-
}, _null: function() {
|
|
967
|
-
return l("Null");
|
|
968
|
-
}, _undefined: function() {
|
|
969
|
-
return l("Undefined");
|
|
970
|
-
}, _regexp: function(r) {
|
|
971
|
-
return l("regex:" + r.toString());
|
|
972
|
-
}, _uint8array: function(r) {
|
|
973
|
-
return l("uint8array:"), this.dispatch(Array.prototype.slice.call(r));
|
|
974
|
-
}, _uint8clampedarray: function(r) {
|
|
975
|
-
return l("uint8clampedarray:"), this.dispatch(Array.prototype.slice.call(r));
|
|
976
|
-
}, _int8array: function(r) {
|
|
977
|
-
return l("int8array:"), this.dispatch(Array.prototype.slice.call(r));
|
|
978
|
-
}, _uint16array: function(r) {
|
|
979
|
-
return l("uint16array:"), this.dispatch(Array.prototype.slice.call(r));
|
|
980
|
-
}, _int16array: function(r) {
|
|
981
|
-
return l("int16array:"), this.dispatch(Array.prototype.slice.call(r));
|
|
982
|
-
}, _uint32array: function(r) {
|
|
983
|
-
return l("uint32array:"), this.dispatch(Array.prototype.slice.call(r));
|
|
984
|
-
}, _int32array: function(r) {
|
|
985
|
-
return l("int32array:"), this.dispatch(Array.prototype.slice.call(r));
|
|
986
|
-
}, _float32array: function(r) {
|
|
987
|
-
return l("float32array:"), this.dispatch(Array.prototype.slice.call(r));
|
|
988
|
-
}, _float64array: function(r) {
|
|
989
|
-
return l("float64array:"), this.dispatch(Array.prototype.slice.call(r));
|
|
990
|
-
}, _arraybuffer: function(r) {
|
|
991
|
-
return l("arraybuffer:"), this.dispatch(new Uint8Array(r));
|
|
992
|
-
}, _url: function(r) {
|
|
993
|
-
return l("url:" + r.toString());
|
|
994
|
-
}, _map: function(r) {
|
|
995
|
-
return l("map:"), r = Array.from(r), this._array(r, m.unorderedSets !== !1);
|
|
996
|
-
}, _set: function(r) {
|
|
997
|
-
return l("set:"), r = Array.from(r), this._array(r, m.unorderedSets !== !1);
|
|
998
|
-
}, _file: function(r) {
|
|
999
|
-
return l("file:"), this.dispatch([r.name, r.size, r.type, r.lastModfied]);
|
|
1000
|
-
}, _blob: function() {
|
|
1001
|
-
if (m.ignoreUnknown)
|
|
1002
|
-
return l("[blob]");
|
|
1003
|
-
throw Error(`Hashing Blob objects is currently not supported
|
|
1004
|
-
(see https://github.com/puleos/object-hash/issues/26)
|
|
1005
|
-
Use "options.replacer" or "options.ignoreUnknown"
|
|
1006
|
-
`);
|
|
1007
|
-
}, _domwindow: function() {
|
|
1008
|
-
return l("domwindow");
|
|
1009
|
-
}, _bigint: function(r) {
|
|
1010
|
-
return l("bigint:" + r.toString());
|
|
1011
|
-
}, _process: function() {
|
|
1012
|
-
return l("process");
|
|
1013
|
-
}, _timer: function() {
|
|
1014
|
-
return l("timer");
|
|
1015
|
-
}, _pipe: function() {
|
|
1016
|
-
return l("pipe");
|
|
1017
|
-
}, _tcp: function() {
|
|
1018
|
-
return l("tcp");
|
|
1019
|
-
}, _udp: function() {
|
|
1020
|
-
return l("udp");
|
|
1021
|
-
}, _tty: function() {
|
|
1022
|
-
return l("tty");
|
|
1023
|
-
}, _statwatcher: function() {
|
|
1024
|
-
return l("statwatcher");
|
|
1025
|
-
}, _securecontext: function() {
|
|
1026
|
-
return l("securecontext");
|
|
1027
|
-
}, _connection: function() {
|
|
1028
|
-
return l("connection");
|
|
1029
|
-
}, _zlib: function() {
|
|
1030
|
-
return l("zlib");
|
|
1031
|
-
}, _context: function() {
|
|
1032
|
-
return l("context");
|
|
1033
|
-
}, _nodescript: function() {
|
|
1034
|
-
return l("nodescript");
|
|
1035
|
-
}, _httpparser: function() {
|
|
1036
|
-
return l("httpparser");
|
|
1037
|
-
}, _dataview: function() {
|
|
1038
|
-
return l("dataview");
|
|
1039
|
-
}, _signal: function() {
|
|
1040
|
-
return l("signal");
|
|
1041
|
-
}, _fsevent: function() {
|
|
1042
|
-
return l("fsevent");
|
|
1043
|
-
}, _tlswrap: function() {
|
|
1044
|
-
return l("tlswrap");
|
|
1045
|
-
} };
|
|
1046
|
-
}
|
|
1047
|
-
function j() {
|
|
1048
|
-
return { buf: "", write: function(m) {
|
|
1049
|
-
this.buf += m;
|
|
1050
|
-
}, end: function(m) {
|
|
1051
|
-
this.buf += m;
|
|
1052
|
-
}, read: function() {
|
|
1053
|
-
return this.buf;
|
|
1054
|
-
} };
|
|
1055
|
-
}
|
|
1056
|
-
o.writeToStream = function(m, v, a) {
|
|
1057
|
-
return a === void 0 && (a = v, v = {}), P(v = R(m, v), a).dispatch(m);
|
|
1058
|
-
};
|
|
1059
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/fake_9a5aa49d.js", "/");
|
|
1060
|
-
}, { buffer: 3, crypto: 5, lYpoI2: 11 }], 2: [function(n, i, o) {
|
|
1061
|
-
(function(c, f, h, g, y, b, O, U, B) {
|
|
1062
|
-
(function(I) {
|
|
1063
|
-
var L = typeof Uint8Array < "u" ? Uint8Array : Array, d = "+".charCodeAt(0), S = "/".charCodeAt(0), R = "0".charCodeAt(0), E = "a".charCodeAt(0), P = "A".charCodeAt(0), j = "-".charCodeAt(0), m = "_".charCodeAt(0);
|
|
1064
|
-
function v(a) {
|
|
1065
|
-
return a = a.charCodeAt(0), a === d || a === j ? 62 : a === S || a === m ? 63 : a < R ? -1 : a < R + 10 ? a - R + 26 + 26 : a < P + 26 ? a - P : a < E + 26 ? a - E + 26 : void 0;
|
|
1066
|
-
}
|
|
1067
|
-
I.toByteArray = function(a) {
|
|
1068
|
-
var l, r;
|
|
1069
|
-
if (0 < a.length % 4)
|
|
1070
|
-
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
1071
|
-
var w = a.length, w = a.charAt(w - 2) === "=" ? 2 : a.charAt(w - 1) === "=" ? 1 : 0, _ = new L(3 * a.length / 4 - w), N = 0 < w ? a.length - 4 : a.length, T = 0;
|
|
1072
|
-
function z(x) {
|
|
1073
|
-
_[T++] = x;
|
|
1074
|
-
}
|
|
1075
|
-
for (l = 0; l < N; l += 4, 0)
|
|
1076
|
-
z((16711680 & (r = v(a.charAt(l)) << 18 | v(a.charAt(l + 1)) << 12 | v(a.charAt(l + 2)) << 6 | v(a.charAt(l + 3)))) >> 16), z((65280 & r) >> 8), z(255 & r);
|
|
1077
|
-
return w == 2 ? z(255 & (r = v(a.charAt(l)) << 2 | v(a.charAt(l + 1)) >> 4)) : w == 1 && (z((r = v(a.charAt(l)) << 10 | v(a.charAt(l + 1)) << 4 | v(a.charAt(l + 2)) >> 2) >> 8 & 255), z(255 & r)), _;
|
|
1078
|
-
}, I.fromByteArray = function(a) {
|
|
1079
|
-
var l, r, w, _, N = a.length % 3, T = "";
|
|
1080
|
-
function z(x) {
|
|
1081
|
-
return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(x);
|
|
1082
|
-
}
|
|
1083
|
-
for (l = 0, w = a.length - N; l < w; l += 3)
|
|
1084
|
-
r = (a[l] << 16) + (a[l + 1] << 8) + a[l + 2], T += z((_ = r) >> 18 & 63) + z(_ >> 12 & 63) + z(_ >> 6 & 63) + z(63 & _);
|
|
1085
|
-
switch (N) {
|
|
1086
|
-
case 1:
|
|
1087
|
-
T = (T += z((r = a[a.length - 1]) >> 2)) + z(r << 4 & 63) + "==";
|
|
1088
|
-
break;
|
|
1089
|
-
case 2:
|
|
1090
|
-
T = (T = (T += z((r = (a[a.length - 2] << 8) + a[a.length - 1]) >> 10)) + z(r >> 4 & 63)) + z(r << 2 & 63) + "=";
|
|
1091
|
-
}
|
|
1092
|
-
return T;
|
|
1093
|
-
};
|
|
1094
|
-
})(o === void 0 ? this.base64js = {} : o);
|
|
1095
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js", "/node_modules/gulp-browserify/node_modules/base64-js/lib");
|
|
1096
|
-
}, { buffer: 3, lYpoI2: 11 }], 3: [function(n, i, o) {
|
|
1097
|
-
(function(c, f, d, g, y, b, O, U, B) {
|
|
1098
|
-
var I = n("base64-js"), L = n("ieee754");
|
|
1099
|
-
function d(s, u, p) {
|
|
1100
|
-
if (!(this instanceof d))
|
|
1101
|
-
return new d(s, u, p);
|
|
1102
|
-
var A, M, D, F, Y = typeof s;
|
|
1103
|
-
if (u === "base64" && Y == "string")
|
|
1104
|
-
for (s = (F = s).trim ? F.trim() : F.replace(/^\s+|\s+$/g, ""); s.length % 4 != 0; )
|
|
1105
|
-
s += "=";
|
|
1106
|
-
if (Y == "number")
|
|
1107
|
-
A = Q(s);
|
|
1108
|
-
else if (Y == "string")
|
|
1109
|
-
A = d.byteLength(s, u);
|
|
1110
|
-
else {
|
|
1111
|
-
if (Y != "object")
|
|
1112
|
-
throw new Error("First argument needs to be a number, array or string.");
|
|
1113
|
-
A = Q(s.length);
|
|
1114
|
-
}
|
|
1115
|
-
if (d._useTypedArrays ? M = d._augment(new Uint8Array(A)) : ((M = this).length = A, M._isBuffer = !0), d._useTypedArrays && typeof s.byteLength == "number")
|
|
1116
|
-
M._set(s);
|
|
1117
|
-
else if (W(F = s) || d.isBuffer(F) || F && typeof F == "object" && typeof F.length == "number")
|
|
1118
|
-
for (D = 0; D < A; D++)
|
|
1119
|
-
d.isBuffer(s) ? M[D] = s.readUInt8(D) : M[D] = s[D];
|
|
1120
|
-
else if (Y == "string")
|
|
1121
|
-
M.write(s, 0, u);
|
|
1122
|
-
else if (Y == "number" && !d._useTypedArrays && !p)
|
|
1123
|
-
for (D = 0; D < A; D++)
|
|
1124
|
-
M[D] = 0;
|
|
1125
|
-
return M;
|
|
1126
|
-
}
|
|
1127
|
-
function S(s, u, p, A) {
|
|
1128
|
-
return d._charsWritten = Lt(function(M) {
|
|
1129
|
-
for (var D = [], F = 0; F < M.length; F++)
|
|
1130
|
-
D.push(255 & M.charCodeAt(F));
|
|
1131
|
-
return D;
|
|
1132
|
-
}(u), s, p, A);
|
|
1133
|
-
}
|
|
1134
|
-
function R(s, u, p, A) {
|
|
1135
|
-
return d._charsWritten = Lt(function(M) {
|
|
1136
|
-
for (var D, F, Y = [], G = 0; G < M.length; G++)
|
|
1137
|
-
F = M.charCodeAt(G), D = F >> 8, F = F % 256, Y.push(F), Y.push(D);
|
|
1138
|
-
return Y;
|
|
1139
|
-
}(u), s, p, A);
|
|
1140
|
-
}
|
|
1141
|
-
function E(s, u, p) {
|
|
1142
|
-
var A = "";
|
|
1143
|
-
p = Math.min(s.length, p);
|
|
1144
|
-
for (var M = u; M < p; M++)
|
|
1145
|
-
A += String.fromCharCode(s[M]);
|
|
1146
|
-
return A;
|
|
1147
|
-
}
|
|
1148
|
-
function P(s, u, p, D) {
|
|
1149
|
-
D || (C(typeof p == "boolean", "missing or invalid endian"), C(u != null, "missing offset"), C(u + 1 < s.length, "Trying to read beyond buffer length"));
|
|
1150
|
-
var M, D = s.length;
|
|
1151
|
-
if (!(D <= u))
|
|
1152
|
-
return p ? (M = s[u], u + 1 < D && (M |= s[u + 1] << 8)) : (M = s[u] << 8, u + 1 < D && (M |= s[u + 1])), M;
|
|
1153
|
-
}
|
|
1154
|
-
function j(s, u, p, D) {
|
|
1155
|
-
D || (C(typeof p == "boolean", "missing or invalid endian"), C(u != null, "missing offset"), C(u + 3 < s.length, "Trying to read beyond buffer length"));
|
|
1156
|
-
var M, D = s.length;
|
|
1157
|
-
if (!(D <= u))
|
|
1158
|
-
return p ? (u + 2 < D && (M = s[u + 2] << 16), u + 1 < D && (M |= s[u + 1] << 8), M |= s[u], u + 3 < D && (M += s[u + 3] << 24 >>> 0)) : (u + 1 < D && (M = s[u + 1] << 16), u + 2 < D && (M |= s[u + 2] << 8), u + 3 < D && (M |= s[u + 3]), M += s[u] << 24 >>> 0), M;
|
|
1159
|
-
}
|
|
1160
|
-
function m(s, u, p, A) {
|
|
1161
|
-
if (A || (C(typeof p == "boolean", "missing or invalid endian"), C(u != null, "missing offset"), C(u + 1 < s.length, "Trying to read beyond buffer length")), !(s.length <= u))
|
|
1162
|
-
return A = P(s, u, p, !0), 32768 & A ? -1 * (65535 - A + 1) : A;
|
|
1163
|
-
}
|
|
1164
|
-
function v(s, u, p, A) {
|
|
1165
|
-
if (A || (C(typeof p == "boolean", "missing or invalid endian"), C(u != null, "missing offset"), C(u + 3 < s.length, "Trying to read beyond buffer length")), !(s.length <= u))
|
|
1166
|
-
return A = j(s, u, p, !0), 2147483648 & A ? -1 * (4294967295 - A + 1) : A;
|
|
1167
|
-
}
|
|
1168
|
-
function a(s, u, p, A) {
|
|
1169
|
-
return A || (C(typeof p == "boolean", "missing or invalid endian"), C(u + 3 < s.length, "Trying to read beyond buffer length")), L.read(s, u, p, 23, 4);
|
|
1170
|
-
}
|
|
1171
|
-
function l(s, u, p, A) {
|
|
1172
|
-
return A || (C(typeof p == "boolean", "missing or invalid endian"), C(u + 7 < s.length, "Trying to read beyond buffer length")), L.read(s, u, p, 52, 8);
|
|
1173
|
-
}
|
|
1174
|
-
function r(s, u, p, A, M) {
|
|
1175
|
-
if (M || (C(u != null, "missing value"), C(typeof A == "boolean", "missing or invalid endian"), C(p != null, "missing offset"), C(p + 1 < s.length, "trying to write beyond buffer length"), Yt(u, 65535)), M = s.length, !(M <= p))
|
|
1176
|
-
for (var D = 0, F = Math.min(M - p, 2); D < F; D++)
|
|
1177
|
-
s[p + D] = (u & 255 << 8 * (A ? D : 1 - D)) >>> 8 * (A ? D : 1 - D);
|
|
1178
|
-
}
|
|
1179
|
-
function w(s, u, p, A, M) {
|
|
1180
|
-
if (M || (C(u != null, "missing value"), C(typeof A == "boolean", "missing or invalid endian"), C(p != null, "missing offset"), C(p + 3 < s.length, "trying to write beyond buffer length"), Yt(u, 4294967295)), M = s.length, !(M <= p))
|
|
1181
|
-
for (var D = 0, F = Math.min(M - p, 4); D < F; D++)
|
|
1182
|
-
s[p + D] = u >>> 8 * (A ? D : 3 - D) & 255;
|
|
1183
|
-
}
|
|
1184
|
-
function _(s, u, p, A, M) {
|
|
1185
|
-
M || (C(u != null, "missing value"), C(typeof A == "boolean", "missing or invalid endian"), C(p != null, "missing offset"), C(p + 1 < s.length, "Trying to write beyond buffer length"), qt(u, 32767, -32768)), s.length <= p || r(s, 0 <= u ? u : 65535 + u + 1, p, A, M);
|
|
1186
|
-
}
|
|
1187
|
-
function N(s, u, p, A, M) {
|
|
1188
|
-
M || (C(u != null, "missing value"), C(typeof A == "boolean", "missing or invalid endian"), C(p != null, "missing offset"), C(p + 3 < s.length, "Trying to write beyond buffer length"), qt(u, 2147483647, -2147483648)), s.length <= p || w(s, 0 <= u ? u : 4294967295 + u + 1, p, A, M);
|
|
1189
|
-
}
|
|
1190
|
-
function T(s, u, p, A, M) {
|
|
1191
|
-
M || (C(u != null, "missing value"), C(typeof A == "boolean", "missing or invalid endian"), C(p != null, "missing offset"), C(p + 3 < s.length, "Trying to write beyond buffer length"), ge(u, 34028234663852886e22, -34028234663852886e22)), s.length <= p || L.write(s, u, p, A, 23, 4);
|
|
1192
|
-
}
|
|
1193
|
-
function z(s, u, p, A, M) {
|
|
1194
|
-
M || (C(u != null, "missing value"), C(typeof A == "boolean", "missing or invalid endian"), C(p != null, "missing offset"), C(p + 7 < s.length, "Trying to write beyond buffer length"), ge(u, 17976931348623157e292, -17976931348623157e292)), s.length <= p || L.write(s, u, p, A, 52, 8);
|
|
1195
|
-
}
|
|
1196
|
-
o.Buffer = d, o.SlowBuffer = d, o.INSPECT_MAX_BYTES = 50, d.poolSize = 8192, d._useTypedArrays = function() {
|
|
1197
|
-
try {
|
|
1198
|
-
var s = new ArrayBuffer(0), u = new Uint8Array(s);
|
|
1199
|
-
return u.foo = function() {
|
|
1200
|
-
return 42;
|
|
1201
|
-
}, u.foo() === 42 && typeof u.subarray == "function";
|
|
1202
|
-
} catch {
|
|
1203
|
-
return !1;
|
|
1204
|
-
}
|
|
1205
|
-
}(), d.isEncoding = function(s) {
|
|
1206
|
-
switch (String(s).toLowerCase()) {
|
|
1207
|
-
case "hex":
|
|
1208
|
-
case "utf8":
|
|
1209
|
-
case "utf-8":
|
|
1210
|
-
case "ascii":
|
|
1211
|
-
case "binary":
|
|
1212
|
-
case "base64":
|
|
1213
|
-
case "raw":
|
|
1214
|
-
case "ucs2":
|
|
1215
|
-
case "ucs-2":
|
|
1216
|
-
case "utf16le":
|
|
1217
|
-
case "utf-16le":
|
|
1218
|
-
return !0;
|
|
1219
|
-
default:
|
|
1220
|
-
return !1;
|
|
1221
|
-
}
|
|
1222
|
-
}, d.isBuffer = function(s) {
|
|
1223
|
-
return !(s == null || !s._isBuffer);
|
|
1224
|
-
}, d.byteLength = function(s, u) {
|
|
1225
|
-
var p;
|
|
1226
|
-
switch (s += "", u || "utf8") {
|
|
1227
|
-
case "hex":
|
|
1228
|
-
p = s.length / 2;
|
|
1229
|
-
break;
|
|
1230
|
-
case "utf8":
|
|
1231
|
-
case "utf-8":
|
|
1232
|
-
p = ht(s).length;
|
|
1233
|
-
break;
|
|
1234
|
-
case "ascii":
|
|
1235
|
-
case "binary":
|
|
1236
|
-
case "raw":
|
|
1237
|
-
p = s.length;
|
|
1238
|
-
break;
|
|
1239
|
-
case "base64":
|
|
1240
|
-
p = de(s).length;
|
|
1241
|
-
break;
|
|
1242
|
-
case "ucs2":
|
|
1243
|
-
case "ucs-2":
|
|
1244
|
-
case "utf16le":
|
|
1245
|
-
case "utf-16le":
|
|
1246
|
-
p = 2 * s.length;
|
|
1247
|
-
break;
|
|
1248
|
-
default:
|
|
1249
|
-
throw new Error("Unknown encoding");
|
|
1250
|
-
}
|
|
1251
|
-
return p;
|
|
1252
|
-
}, d.concat = function(s, u) {
|
|
1253
|
-
if (C(W(s), `Usage: Buffer.concat(list, [totalLength])
|
|
1254
|
-
list should be an Array.`), s.length === 0)
|
|
1255
|
-
return new d(0);
|
|
1256
|
-
if (s.length === 1)
|
|
1257
|
-
return s[0];
|
|
1258
|
-
if (typeof u != "number")
|
|
1259
|
-
for (M = u = 0; M < s.length; M++)
|
|
1260
|
-
u += s[M].length;
|
|
1261
|
-
for (var p = new d(u), A = 0, M = 0; M < s.length; M++) {
|
|
1262
|
-
var D = s[M];
|
|
1263
|
-
D.copy(p, A), A += D.length;
|
|
1264
|
-
}
|
|
1265
|
-
return p;
|
|
1266
|
-
}, d.prototype.write = function(s, u, p, A) {
|
|
1267
|
-
isFinite(u) ? isFinite(p) || (A = p, p = void 0) : (G = A, A = u, u = p, p = G), u = Number(u) || 0;
|
|
1268
|
-
var M, D, F, Y, G = this.length - u;
|
|
1269
|
-
switch ((!p || G < (p = Number(p))) && (p = G), A = String(A || "utf8").toLowerCase()) {
|
|
1270
|
-
case "hex":
|
|
1271
|
-
M = function(at, nt, it, X) {
|
|
1272
|
-
it = Number(it) || 0;
|
|
1273
|
-
var H = at.length - it;
|
|
1274
|
-
(!X || H < (X = Number(X))) && (X = H), C((H = nt.length) % 2 == 0, "Invalid hex string"), H / 2 < X && (X = H / 2);
|
|
1275
|
-
for (var vt = 0; vt < X; vt++) {
|
|
1276
|
-
var ye = parseInt(nt.substr(2 * vt, 2), 16);
|
|
1277
|
-
C(!isNaN(ye), "Invalid hex string"), at[it + vt] = ye;
|
|
1278
|
-
}
|
|
1279
|
-
return d._charsWritten = 2 * vt, vt;
|
|
1280
|
-
}(this, s, u, p);
|
|
1281
|
-
break;
|
|
1282
|
-
case "utf8":
|
|
1283
|
-
case "utf-8":
|
|
1284
|
-
D = this, F = u, Y = p, M = d._charsWritten = Lt(ht(s), D, F, Y);
|
|
1285
|
-
break;
|
|
1286
|
-
case "ascii":
|
|
1287
|
-
case "binary":
|
|
1288
|
-
M = S(this, s, u, p);
|
|
1289
|
-
break;
|
|
1290
|
-
case "base64":
|
|
1291
|
-
D = this, F = u, Y = p, M = d._charsWritten = Lt(de(s), D, F, Y);
|
|
1292
|
-
break;
|
|
1293
|
-
case "ucs2":
|
|
1294
|
-
case "ucs-2":
|
|
1295
|
-
case "utf16le":
|
|
1296
|
-
case "utf-16le":
|
|
1297
|
-
M = R(this, s, u, p);
|
|
1298
|
-
break;
|
|
1299
|
-
default:
|
|
1300
|
-
throw new Error("Unknown encoding");
|
|
1301
|
-
}
|
|
1302
|
-
return M;
|
|
1303
|
-
}, d.prototype.toString = function(s, u, p) {
|
|
1304
|
-
var A, M, D, F, Y = this;
|
|
1305
|
-
if (s = String(s || "utf8").toLowerCase(), u = Number(u) || 0, (p = p !== void 0 ? Number(p) : Y.length) === u)
|
|
1306
|
-
return "";
|
|
1307
|
-
switch (s) {
|
|
1308
|
-
case "hex":
|
|
1309
|
-
A = function(G, at, nt) {
|
|
1310
|
-
var it = G.length;
|
|
1311
|
-
(!at || at < 0) && (at = 0), (!nt || nt < 0 || it < nt) && (nt = it);
|
|
1312
|
-
for (var X = "", H = at; H < nt; H++)
|
|
1313
|
-
X += V(G[H]);
|
|
1314
|
-
return X;
|
|
1315
|
-
}(Y, u, p);
|
|
1316
|
-
break;
|
|
1317
|
-
case "utf8":
|
|
1318
|
-
case "utf-8":
|
|
1319
|
-
A = function(G, at, nt) {
|
|
1320
|
-
var it = "", X = "";
|
|
1321
|
-
nt = Math.min(G.length, nt);
|
|
1322
|
-
for (var H = at; H < nt; H++)
|
|
1323
|
-
G[H] <= 127 ? (it += me(X) + String.fromCharCode(G[H]), X = "") : X += "%" + G[H].toString(16);
|
|
1324
|
-
return it + me(X);
|
|
1325
|
-
}(Y, u, p);
|
|
1326
|
-
break;
|
|
1327
|
-
case "ascii":
|
|
1328
|
-
case "binary":
|
|
1329
|
-
A = E(Y, u, p);
|
|
1330
|
-
break;
|
|
1331
|
-
case "base64":
|
|
1332
|
-
M = Y, F = p, A = (D = u) === 0 && F === M.length ? I.fromByteArray(M) : I.fromByteArray(M.slice(D, F));
|
|
1333
|
-
break;
|
|
1334
|
-
case "ucs2":
|
|
1335
|
-
case "ucs-2":
|
|
1336
|
-
case "utf16le":
|
|
1337
|
-
case "utf-16le":
|
|
1338
|
-
A = function(G, at, nt) {
|
|
1339
|
-
for (var it = G.slice(at, nt), X = "", H = 0; H < it.length; H += 2)
|
|
1340
|
-
X += String.fromCharCode(it[H] + 256 * it[H + 1]);
|
|
1341
|
-
return X;
|
|
1342
|
-
}(Y, u, p);
|
|
1343
|
-
break;
|
|
1344
|
-
default:
|
|
1345
|
-
throw new Error("Unknown encoding");
|
|
1346
|
-
}
|
|
1347
|
-
return A;
|
|
1348
|
-
}, d.prototype.toJSON = function() {
|
|
1349
|
-
return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
|
|
1350
|
-
}, d.prototype.copy = function(s, u, p, A) {
|
|
1351
|
-
if (u = u || 0, (A = A || A === 0 ? A : this.length) !== (p = p || 0) && s.length !== 0 && this.length !== 0) {
|
|
1352
|
-
C(p <= A, "sourceEnd < sourceStart"), C(0 <= u && u < s.length, "targetStart out of bounds"), C(0 <= p && p < this.length, "sourceStart out of bounds"), C(0 <= A && A <= this.length, "sourceEnd out of bounds"), A > this.length && (A = this.length);
|
|
1353
|
-
var M = (A = s.length - u < A - p ? s.length - u + p : A) - p;
|
|
1354
|
-
if (M < 100 || !d._useTypedArrays)
|
|
1355
|
-
for (var D = 0; D < M; D++)
|
|
1356
|
-
s[D + u] = this[D + p];
|
|
1357
|
-
else
|
|
1358
|
-
s._set(this.subarray(p, p + M), u);
|
|
1359
|
-
}
|
|
1360
|
-
}, d.prototype.slice = function(s, u) {
|
|
1361
|
-
var p = this.length;
|
|
1362
|
-
if (s = J(s, p, 0), u = J(u, p, p), d._useTypedArrays)
|
|
1363
|
-
return d._augment(this.subarray(s, u));
|
|
1364
|
-
for (var A = u - s, M = new d(A, void 0, !0), D = 0; D < A; D++)
|
|
1365
|
-
M[D] = this[D + s];
|
|
1366
|
-
return M;
|
|
1367
|
-
}, d.prototype.get = function(s) {
|
|
1368
|
-
return console.log(".get() is deprecated. Access using array indexes instead."), this.readUInt8(s);
|
|
1369
|
-
}, d.prototype.set = function(s, u) {
|
|
1370
|
-
return console.log(".set() is deprecated. Access using array indexes instead."), this.writeUInt8(s, u);
|
|
1371
|
-
}, d.prototype.readUInt8 = function(s, u) {
|
|
1372
|
-
if (u || (C(s != null, "missing offset"), C(s < this.length, "Trying to read beyond buffer length")), !(s >= this.length))
|
|
1373
|
-
return this[s];
|
|
1374
|
-
}, d.prototype.readUInt16LE = function(s, u) {
|
|
1375
|
-
return P(this, s, !0, u);
|
|
1376
|
-
}, d.prototype.readUInt16BE = function(s, u) {
|
|
1377
|
-
return P(this, s, !1, u);
|
|
1378
|
-
}, d.prototype.readUInt32LE = function(s, u) {
|
|
1379
|
-
return j(this, s, !0, u);
|
|
1380
|
-
}, d.prototype.readUInt32BE = function(s, u) {
|
|
1381
|
-
return j(this, s, !1, u);
|
|
1382
|
-
}, d.prototype.readInt8 = function(s, u) {
|
|
1383
|
-
if (u || (C(s != null, "missing offset"), C(s < this.length, "Trying to read beyond buffer length")), !(s >= this.length))
|
|
1384
|
-
return 128 & this[s] ? -1 * (255 - this[s] + 1) : this[s];
|
|
1385
|
-
}, d.prototype.readInt16LE = function(s, u) {
|
|
1386
|
-
return m(this, s, !0, u);
|
|
1387
|
-
}, d.prototype.readInt16BE = function(s, u) {
|
|
1388
|
-
return m(this, s, !1, u);
|
|
1389
|
-
}, d.prototype.readInt32LE = function(s, u) {
|
|
1390
|
-
return v(this, s, !0, u);
|
|
1391
|
-
}, d.prototype.readInt32BE = function(s, u) {
|
|
1392
|
-
return v(this, s, !1, u);
|
|
1393
|
-
}, d.prototype.readFloatLE = function(s, u) {
|
|
1394
|
-
return a(this, s, !0, u);
|
|
1395
|
-
}, d.prototype.readFloatBE = function(s, u) {
|
|
1396
|
-
return a(this, s, !1, u);
|
|
1397
|
-
}, d.prototype.readDoubleLE = function(s, u) {
|
|
1398
|
-
return l(this, s, !0, u);
|
|
1399
|
-
}, d.prototype.readDoubleBE = function(s, u) {
|
|
1400
|
-
return l(this, s, !1, u);
|
|
1401
|
-
}, d.prototype.writeUInt8 = function(s, u, p) {
|
|
1402
|
-
p || (C(s != null, "missing value"), C(u != null, "missing offset"), C(u < this.length, "trying to write beyond buffer length"), Yt(s, 255)), u >= this.length || (this[u] = s);
|
|
1403
|
-
}, d.prototype.writeUInt16LE = function(s, u, p) {
|
|
1404
|
-
r(this, s, u, !0, p);
|
|
1405
|
-
}, d.prototype.writeUInt16BE = function(s, u, p) {
|
|
1406
|
-
r(this, s, u, !1, p);
|
|
1407
|
-
}, d.prototype.writeUInt32LE = function(s, u, p) {
|
|
1408
|
-
w(this, s, u, !0, p);
|
|
1409
|
-
}, d.prototype.writeUInt32BE = function(s, u, p) {
|
|
1410
|
-
w(this, s, u, !1, p);
|
|
1411
|
-
}, d.prototype.writeInt8 = function(s, u, p) {
|
|
1412
|
-
p || (C(s != null, "missing value"), C(u != null, "missing offset"), C(u < this.length, "Trying to write beyond buffer length"), qt(s, 127, -128)), u >= this.length || (0 <= s ? this.writeUInt8(s, u, p) : this.writeUInt8(255 + s + 1, u, p));
|
|
1413
|
-
}, d.prototype.writeInt16LE = function(s, u, p) {
|
|
1414
|
-
_(this, s, u, !0, p);
|
|
1415
|
-
}, d.prototype.writeInt16BE = function(s, u, p) {
|
|
1416
|
-
_(this, s, u, !1, p);
|
|
1417
|
-
}, d.prototype.writeInt32LE = function(s, u, p) {
|
|
1418
|
-
N(this, s, u, !0, p);
|
|
1419
|
-
}, d.prototype.writeInt32BE = function(s, u, p) {
|
|
1420
|
-
N(this, s, u, !1, p);
|
|
1421
|
-
}, d.prototype.writeFloatLE = function(s, u, p) {
|
|
1422
|
-
T(this, s, u, !0, p);
|
|
1423
|
-
}, d.prototype.writeFloatBE = function(s, u, p) {
|
|
1424
|
-
T(this, s, u, !1, p);
|
|
1425
|
-
}, d.prototype.writeDoubleLE = function(s, u, p) {
|
|
1426
|
-
z(this, s, u, !0, p);
|
|
1427
|
-
}, d.prototype.writeDoubleBE = function(s, u, p) {
|
|
1428
|
-
z(this, s, u, !1, p);
|
|
1429
|
-
}, d.prototype.fill = function(s, u, p) {
|
|
1430
|
-
if (u = u || 0, p = p || this.length, C(typeof (s = typeof (s = s || 0) == "string" ? s.charCodeAt(0) : s) == "number" && !isNaN(s), "value is not a number"), C(u <= p, "end < start"), p !== u && this.length !== 0) {
|
|
1431
|
-
C(0 <= u && u < this.length, "start out of bounds"), C(0 <= p && p <= this.length, "end out of bounds");
|
|
1432
|
-
for (var A = u; A < p; A++)
|
|
1433
|
-
this[A] = s;
|
|
1434
|
-
}
|
|
1435
|
-
}, d.prototype.inspect = function() {
|
|
1436
|
-
for (var s = [], u = this.length, p = 0; p < u; p++)
|
|
1437
|
-
if (s[p] = V(this[p]), p === o.INSPECT_MAX_BYTES) {
|
|
1438
|
-
s[p + 1] = "...";
|
|
1439
|
-
break;
|
|
1440
|
-
}
|
|
1441
|
-
return "<Buffer " + s.join(" ") + ">";
|
|
1442
|
-
}, d.prototype.toArrayBuffer = function() {
|
|
1443
|
-
if (typeof Uint8Array > "u")
|
|
1444
|
-
throw new Error("Buffer.toArrayBuffer not supported in this browser");
|
|
1445
|
-
if (d._useTypedArrays)
|
|
1446
|
-
return new d(this).buffer;
|
|
1447
|
-
for (var s = new Uint8Array(this.length), u = 0, p = s.length; u < p; u += 1)
|
|
1448
|
-
s[u] = this[u];
|
|
1449
|
-
return s.buffer;
|
|
1450
|
-
};
|
|
1451
|
-
var x = d.prototype;
|
|
1452
|
-
function J(s, u, p) {
|
|
1453
|
-
return typeof s != "number" ? p : u <= (s = ~~s) ? u : 0 <= s || 0 <= (s += u) ? s : 0;
|
|
1454
|
-
}
|
|
1455
|
-
function Q(s) {
|
|
1456
|
-
return (s = ~~Math.ceil(+s)) < 0 ? 0 : s;
|
|
1457
|
-
}
|
|
1458
|
-
function W(s) {
|
|
1459
|
-
return (Array.isArray || function(u) {
|
|
1460
|
-
return Object.prototype.toString.call(u) === "[object Array]";
|
|
1461
|
-
})(s);
|
|
1462
|
-
}
|
|
1463
|
-
function V(s) {
|
|
1464
|
-
return s < 16 ? "0" + s.toString(16) : s.toString(16);
|
|
1465
|
-
}
|
|
1466
|
-
function ht(s) {
|
|
1467
|
-
for (var u = [], p = 0; p < s.length; p++) {
|
|
1468
|
-
var A = s.charCodeAt(p);
|
|
1469
|
-
if (A <= 127)
|
|
1470
|
-
u.push(s.charCodeAt(p));
|
|
1471
|
-
else
|
|
1472
|
-
for (var M = p, D = (55296 <= A && A <= 57343 && p++, encodeURIComponent(s.slice(M, p + 1)).substr(1).split("%")), F = 0; F < D.length; F++)
|
|
1473
|
-
u.push(parseInt(D[F], 16));
|
|
1474
|
-
}
|
|
1475
|
-
return u;
|
|
1476
|
-
}
|
|
1477
|
-
function de(s) {
|
|
1478
|
-
return I.toByteArray(s);
|
|
1479
|
-
}
|
|
1480
|
-
function Lt(s, u, p, A) {
|
|
1481
|
-
for (var M = 0; M < A && !(M + p >= u.length || M >= s.length); M++)
|
|
1482
|
-
u[M + p] = s[M];
|
|
1483
|
-
return M;
|
|
1484
|
-
}
|
|
1485
|
-
function me(s) {
|
|
1486
|
-
try {
|
|
1487
|
-
return decodeURIComponent(s);
|
|
1488
|
-
} catch {
|
|
1489
|
-
return String.fromCharCode(65533);
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
function Yt(s, u) {
|
|
1493
|
-
C(typeof s == "number", "cannot write a non-number as a number"), C(0 <= s, "specified a negative value for writing an unsigned value"), C(s <= u, "value is larger than maximum value for type"), C(Math.floor(s) === s, "value has a fractional component");
|
|
1494
|
-
}
|
|
1495
|
-
function qt(s, u, p) {
|
|
1496
|
-
C(typeof s == "number", "cannot write a non-number as a number"), C(s <= u, "value larger than maximum allowed value"), C(p <= s, "value smaller than minimum allowed value"), C(Math.floor(s) === s, "value has a fractional component");
|
|
1497
|
-
}
|
|
1498
|
-
function ge(s, u, p) {
|
|
1499
|
-
C(typeof s == "number", "cannot write a non-number as a number"), C(s <= u, "value larger than maximum allowed value"), C(p <= s, "value smaller than minimum allowed value");
|
|
1500
|
-
}
|
|
1501
|
-
function C(s, u) {
|
|
1502
|
-
if (!s)
|
|
1503
|
-
throw new Error(u || "Failed assertion");
|
|
1504
|
-
}
|
|
1505
|
-
d._augment = function(s) {
|
|
1506
|
-
return s._isBuffer = !0, s._get = s.get, s._set = s.set, s.get = x.get, s.set = x.set, s.write = x.write, s.toString = x.toString, s.toLocaleString = x.toString, s.toJSON = x.toJSON, s.copy = x.copy, s.slice = x.slice, s.readUInt8 = x.readUInt8, s.readUInt16LE = x.readUInt16LE, s.readUInt16BE = x.readUInt16BE, s.readUInt32LE = x.readUInt32LE, s.readUInt32BE = x.readUInt32BE, s.readInt8 = x.readInt8, s.readInt16LE = x.readInt16LE, s.readInt16BE = x.readInt16BE, s.readInt32LE = x.readInt32LE, s.readInt32BE = x.readInt32BE, s.readFloatLE = x.readFloatLE, s.readFloatBE = x.readFloatBE, s.readDoubleLE = x.readDoubleLE, s.readDoubleBE = x.readDoubleBE, s.writeUInt8 = x.writeUInt8, s.writeUInt16LE = x.writeUInt16LE, s.writeUInt16BE = x.writeUInt16BE, s.writeUInt32LE = x.writeUInt32LE, s.writeUInt32BE = x.writeUInt32BE, s.writeInt8 = x.writeInt8, s.writeInt16LE = x.writeInt16LE, s.writeInt16BE = x.writeInt16BE, s.writeInt32LE = x.writeInt32LE, s.writeInt32BE = x.writeInt32BE, s.writeFloatLE = x.writeFloatLE, s.writeFloatBE = x.writeFloatBE, s.writeDoubleLE = x.writeDoubleLE, s.writeDoubleBE = x.writeDoubleBE, s.fill = x.fill, s.inspect = x.inspect, s.toArrayBuffer = x.toArrayBuffer, s;
|
|
1507
|
-
};
|
|
1508
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/buffer/index.js", "/node_modules/gulp-browserify/node_modules/buffer");
|
|
1509
|
-
}, { "base64-js": 2, buffer: 3, ieee754: 10, lYpoI2: 11 }], 4: [function(n, i, o) {
|
|
1510
|
-
(function(c, f, I, g, y, b, O, U, B) {
|
|
1511
|
-
var I = n("buffer").Buffer, L = 4, d = new I(L);
|
|
1512
|
-
d.fill(0), i.exports = { hash: function(S, R, E, P) {
|
|
1513
|
-
for (var j = R(function(r, w) {
|
|
1514
|
-
r.length % L != 0 && (_ = r.length + (L - r.length % L), r = I.concat([r, d], _));
|
|
1515
|
-
for (var _, N = [], T = w ? r.readInt32BE : r.readInt32LE, z = 0; z < r.length; z += L)
|
|
1516
|
-
N.push(T.call(r, z));
|
|
1517
|
-
return N;
|
|
1518
|
-
}(S = I.isBuffer(S) ? S : new I(S), P), 8 * S.length), R = P, m = new I(E), v = R ? m.writeInt32BE : m.writeInt32LE, a = 0; a < j.length; a++)
|
|
1519
|
-
v.call(m, j[a], 4 * a, !0);
|
|
1520
|
-
return m;
|
|
1521
|
-
} };
|
|
1522
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
1523
|
-
}, { buffer: 3, lYpoI2: 11 }], 5: [function(n, i, o) {
|
|
1524
|
-
(function(c, f, I, g, y, b, O, U, B) {
|
|
1525
|
-
var I = n("buffer").Buffer, L = n("./sha"), d = n("./sha256"), S = n("./rng"), R = { sha1: L, sha256: d, md5: n("./md5") }, E = 64, P = new I(E);
|
|
1526
|
-
function j(r, w) {
|
|
1527
|
-
var _ = R[r = r || "sha1"], N = [];
|
|
1528
|
-
return _ || m("algorithm:", r, "is not yet supported"), { update: function(T) {
|
|
1529
|
-
return I.isBuffer(T) || (T = new I(T)), N.push(T), T.length, this;
|
|
1530
|
-
}, digest: function(T) {
|
|
1531
|
-
var z = I.concat(N), z = w ? function(x, J, Q) {
|
|
1532
|
-
I.isBuffer(J) || (J = new I(J)), I.isBuffer(Q) || (Q = new I(Q)), J.length > E ? J = x(J) : J.length < E && (J = I.concat([J, P], E));
|
|
1533
|
-
for (var W = new I(E), V = new I(E), ht = 0; ht < E; ht++)
|
|
1534
|
-
W[ht] = 54 ^ J[ht], V[ht] = 92 ^ J[ht];
|
|
1535
|
-
return Q = x(I.concat([W, Q])), x(I.concat([V, Q]));
|
|
1536
|
-
}(_, w, z) : _(z);
|
|
1537
|
-
return N = null, T ? z.toString(T) : z;
|
|
1538
|
-
} };
|
|
1539
|
-
}
|
|
1540
|
-
function m() {
|
|
1541
|
-
var r = [].slice.call(arguments).join(" ");
|
|
1542
|
-
throw new Error([r, "we accept pull requests", "http://github.com/dominictarr/crypto-browserify"].join(`
|
|
1543
|
-
`));
|
|
1544
|
-
}
|
|
1545
|
-
P.fill(0), o.createHash = function(r) {
|
|
1546
|
-
return j(r);
|
|
1547
|
-
}, o.createHmac = j, o.randomBytes = function(r, w) {
|
|
1548
|
-
if (!w || !w.call)
|
|
1549
|
-
return new I(S(r));
|
|
1550
|
-
try {
|
|
1551
|
-
w.call(this, void 0, new I(S(r)));
|
|
1552
|
-
} catch (_) {
|
|
1553
|
-
w(_);
|
|
1554
|
-
}
|
|
1555
|
-
};
|
|
1556
|
-
var v, a = ["createCredentials", "createCipher", "createCipheriv", "createDecipher", "createDecipheriv", "createSign", "createVerify", "createDiffieHellman", "pbkdf2"], l = function(r) {
|
|
1557
|
-
o[r] = function() {
|
|
1558
|
-
m("sorry,", r, "is not implemented yet");
|
|
1559
|
-
};
|
|
1560
|
-
};
|
|
1561
|
-
for (v in a)
|
|
1562
|
-
l(a[v]);
|
|
1563
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
1564
|
-
}, { "./md5": 6, "./rng": 7, "./sha": 8, "./sha256": 9, buffer: 3, lYpoI2: 11 }], 6: [function(n, i, o) {
|
|
1565
|
-
(function(c, f, h, g, y, b, O, U, B) {
|
|
1566
|
-
var I = n("./helpers");
|
|
1567
|
-
function L(m, v) {
|
|
1568
|
-
m[v >> 5] |= 128 << v % 32, m[14 + (v + 64 >>> 9 << 4)] = v;
|
|
1569
|
-
for (var a = 1732584193, l = -271733879, r = -1732584194, w = 271733878, _ = 0; _ < m.length; _ += 16) {
|
|
1570
|
-
var N = a, T = l, z = r, x = w, a = S(a, l, r, w, m[_ + 0], 7, -680876936), w = S(w, a, l, r, m[_ + 1], 12, -389564586), r = S(r, w, a, l, m[_ + 2], 17, 606105819), l = S(l, r, w, a, m[_ + 3], 22, -1044525330);
|
|
1571
|
-
a = S(a, l, r, w, m[_ + 4], 7, -176418897), w = S(w, a, l, r, m[_ + 5], 12, 1200080426), r = S(r, w, a, l, m[_ + 6], 17, -1473231341), l = S(l, r, w, a, m[_ + 7], 22, -45705983), a = S(a, l, r, w, m[_ + 8], 7, 1770035416), w = S(w, a, l, r, m[_ + 9], 12, -1958414417), r = S(r, w, a, l, m[_ + 10], 17, -42063), l = S(l, r, w, a, m[_ + 11], 22, -1990404162), a = S(a, l, r, w, m[_ + 12], 7, 1804603682), w = S(w, a, l, r, m[_ + 13], 12, -40341101), r = S(r, w, a, l, m[_ + 14], 17, -1502002290), a = R(a, l = S(l, r, w, a, m[_ + 15], 22, 1236535329), r, w, m[_ + 1], 5, -165796510), w = R(w, a, l, r, m[_ + 6], 9, -1069501632), r = R(r, w, a, l, m[_ + 11], 14, 643717713), l = R(l, r, w, a, m[_ + 0], 20, -373897302), a = R(a, l, r, w, m[_ + 5], 5, -701558691), w = R(w, a, l, r, m[_ + 10], 9, 38016083), r = R(r, w, a, l, m[_ + 15], 14, -660478335), l = R(l, r, w, a, m[_ + 4], 20, -405537848), a = R(a, l, r, w, m[_ + 9], 5, 568446438), w = R(w, a, l, r, m[_ + 14], 9, -1019803690), r = R(r, w, a, l, m[_ + 3], 14, -187363961), l = R(l, r, w, a, m[_ + 8], 20, 1163531501), a = R(a, l, r, w, m[_ + 13], 5, -1444681467), w = R(w, a, l, r, m[_ + 2], 9, -51403784), r = R(r, w, a, l, m[_ + 7], 14, 1735328473), a = E(a, l = R(l, r, w, a, m[_ + 12], 20, -1926607734), r, w, m[_ + 5], 4, -378558), w = E(w, a, l, r, m[_ + 8], 11, -2022574463), r = E(r, w, a, l, m[_ + 11], 16, 1839030562), l = E(l, r, w, a, m[_ + 14], 23, -35309556), a = E(a, l, r, w, m[_ + 1], 4, -1530992060), w = E(w, a, l, r, m[_ + 4], 11, 1272893353), r = E(r, w, a, l, m[_ + 7], 16, -155497632), l = E(l, r, w, a, m[_ + 10], 23, -1094730640), a = E(a, l, r, w, m[_ + 13], 4, 681279174), w = E(w, a, l, r, m[_ + 0], 11, -358537222), r = E(r, w, a, l, m[_ + 3], 16, -722521979), l = E(l, r, w, a, m[_ + 6], 23, 76029189), a = E(a, l, r, w, m[_ + 9], 4, -640364487), w = E(w, a, l, r, m[_ + 12], 11, -421815835), r = E(r, w, a, l, m[_ + 15], 16, 530742520), a = P(a, l = E(l, r, w, a, m[_ + 2], 23, -995338651), r, w, m[_ + 0], 6, -198630844), w = P(w, a, l, r, m[_ + 7], 10, 1126891415), r = P(r, w, a, l, m[_ + 14], 15, -1416354905), l = P(l, r, w, a, m[_ + 5], 21, -57434055), a = P(a, l, r, w, m[_ + 12], 6, 1700485571), w = P(w, a, l, r, m[_ + 3], 10, -1894986606), r = P(r, w, a, l, m[_ + 10], 15, -1051523), l = P(l, r, w, a, m[_ + 1], 21, -2054922799), a = P(a, l, r, w, m[_ + 8], 6, 1873313359), w = P(w, a, l, r, m[_ + 15], 10, -30611744), r = P(r, w, a, l, m[_ + 6], 15, -1560198380), l = P(l, r, w, a, m[_ + 13], 21, 1309151649), a = P(a, l, r, w, m[_ + 4], 6, -145523070), w = P(w, a, l, r, m[_ + 11], 10, -1120210379), r = P(r, w, a, l, m[_ + 2], 15, 718787259), l = P(l, r, w, a, m[_ + 9], 21, -343485551), a = j(a, N), l = j(l, T), r = j(r, z), w = j(w, x);
|
|
1572
|
-
}
|
|
1573
|
-
return Array(a, l, r, w);
|
|
1574
|
-
}
|
|
1575
|
-
function d(m, v, a, l, r, w) {
|
|
1576
|
-
return j((v = j(j(v, m), j(l, w))) << r | v >>> 32 - r, a);
|
|
1577
|
-
}
|
|
1578
|
-
function S(m, v, a, l, r, w, _) {
|
|
1579
|
-
return d(v & a | ~v & l, m, v, r, w, _);
|
|
1580
|
-
}
|
|
1581
|
-
function R(m, v, a, l, r, w, _) {
|
|
1582
|
-
return d(v & l | a & ~l, m, v, r, w, _);
|
|
1583
|
-
}
|
|
1584
|
-
function E(m, v, a, l, r, w, _) {
|
|
1585
|
-
return d(v ^ a ^ l, m, v, r, w, _);
|
|
1586
|
-
}
|
|
1587
|
-
function P(m, v, a, l, r, w, _) {
|
|
1588
|
-
return d(a ^ (v | ~l), m, v, r, w, _);
|
|
1589
|
-
}
|
|
1590
|
-
function j(m, v) {
|
|
1591
|
-
var a = (65535 & m) + (65535 & v);
|
|
1592
|
-
return (m >> 16) + (v >> 16) + (a >> 16) << 16 | 65535 & a;
|
|
1593
|
-
}
|
|
1594
|
-
i.exports = function(m) {
|
|
1595
|
-
return I.hash(m, L, 16);
|
|
1596
|
-
};
|
|
1597
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
1598
|
-
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 7: [function(n, i, o) {
|
|
1599
|
-
(function(c, f, h, g, y, b, O, U, B) {
|
|
1600
|
-
i.exports = function(I) {
|
|
1601
|
-
for (var L, d = new Array(I), S = 0; S < I; S++)
|
|
1602
|
-
!(3 & S) && (L = 4294967296 * Math.random()), d[S] = L >>> ((3 & S) << 3) & 255;
|
|
1603
|
-
return d;
|
|
1604
|
-
};
|
|
1605
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
1606
|
-
}, { buffer: 3, lYpoI2: 11 }], 8: [function(n, i, o) {
|
|
1607
|
-
(function(c, f, h, g, y, b, O, U, B) {
|
|
1608
|
-
var I = n("./helpers");
|
|
1609
|
-
function L(R, E) {
|
|
1610
|
-
R[E >> 5] |= 128 << 24 - E % 32, R[15 + (E + 64 >> 9 << 4)] = E;
|
|
1611
|
-
for (var P, j, m, v = Array(80), a = 1732584193, l = -271733879, r = -1732584194, w = 271733878, _ = -1009589776, N = 0; N < R.length; N += 16) {
|
|
1612
|
-
for (var T = a, z = l, x = r, J = w, Q = _, W = 0; W < 80; W++) {
|
|
1613
|
-
v[W] = W < 16 ? R[N + W] : S(v[W - 3] ^ v[W - 8] ^ v[W - 14] ^ v[W - 16], 1);
|
|
1614
|
-
var V = d(d(S(a, 5), (V = l, j = r, m = w, (P = W) < 20 ? V & j | ~V & m : !(P < 40) && P < 60 ? V & j | V & m | j & m : V ^ j ^ m)), d(d(_, v[W]), (P = W) < 20 ? 1518500249 : P < 40 ? 1859775393 : P < 60 ? -1894007588 : -899497514)), _ = w, w = r, r = S(l, 30), l = a, a = V;
|
|
1615
|
-
}
|
|
1616
|
-
a = d(a, T), l = d(l, z), r = d(r, x), w = d(w, J), _ = d(_, Q);
|
|
1617
|
-
}
|
|
1618
|
-
return Array(a, l, r, w, _);
|
|
1619
|
-
}
|
|
1620
|
-
function d(R, E) {
|
|
1621
|
-
var P = (65535 & R) + (65535 & E);
|
|
1622
|
-
return (R >> 16) + (E >> 16) + (P >> 16) << 16 | 65535 & P;
|
|
1623
|
-
}
|
|
1624
|
-
function S(R, E) {
|
|
1625
|
-
return R << E | R >>> 32 - E;
|
|
1626
|
-
}
|
|
1627
|
-
i.exports = function(R) {
|
|
1628
|
-
return I.hash(R, L, 20, !0);
|
|
1629
|
-
};
|
|
1630
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
1631
|
-
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 9: [function(n, i, o) {
|
|
1632
|
-
(function(c, f, h, g, y, b, O, U, B) {
|
|
1633
|
-
function I(E, P) {
|
|
1634
|
-
var j = (65535 & E) + (65535 & P);
|
|
1635
|
-
return (E >> 16) + (P >> 16) + (j >> 16) << 16 | 65535 & j;
|
|
1636
|
-
}
|
|
1637
|
-
function L(E, P) {
|
|
1638
|
-
var j, m = new Array(1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298), v = new Array(1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225), a = new Array(64);
|
|
1639
|
-
E[P >> 5] |= 128 << 24 - P % 32, E[15 + (P + 64 >> 9 << 4)] = P;
|
|
1640
|
-
for (var l, r, w = 0; w < E.length; w += 16) {
|
|
1641
|
-
for (var _ = v[0], N = v[1], T = v[2], z = v[3], x = v[4], J = v[5], Q = v[6], W = v[7], V = 0; V < 64; V++)
|
|
1642
|
-
a[V] = V < 16 ? E[V + w] : I(I(I((r = a[V - 2], S(r, 17) ^ S(r, 19) ^ R(r, 10)), a[V - 7]), (r = a[V - 15], S(r, 7) ^ S(r, 18) ^ R(r, 3))), a[V - 16]), j = I(I(I(I(W, S(r = x, 6) ^ S(r, 11) ^ S(r, 25)), x & J ^ ~x & Q), m[V]), a[V]), l = I(S(l = _, 2) ^ S(l, 13) ^ S(l, 22), _ & N ^ _ & T ^ N & T), W = Q, Q = J, J = x, x = I(z, j), z = T, T = N, N = _, _ = I(j, l);
|
|
1643
|
-
v[0] = I(_, v[0]), v[1] = I(N, v[1]), v[2] = I(T, v[2]), v[3] = I(z, v[3]), v[4] = I(x, v[4]), v[5] = I(J, v[5]), v[6] = I(Q, v[6]), v[7] = I(W, v[7]);
|
|
1644
|
-
}
|
|
1645
|
-
return v;
|
|
1646
|
-
}
|
|
1647
|
-
var d = n("./helpers"), S = function(E, P) {
|
|
1648
|
-
return E >>> P | E << 32 - P;
|
|
1649
|
-
}, R = function(E, P) {
|
|
1650
|
-
return E >>> P;
|
|
1651
|
-
};
|
|
1652
|
-
i.exports = function(E) {
|
|
1653
|
-
return d.hash(E, L, 32, !0);
|
|
1654
|
-
};
|
|
1655
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
1656
|
-
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 10: [function(n, i, o) {
|
|
1657
|
-
(function(c, f, h, g, y, b, O, U, B) {
|
|
1658
|
-
o.read = function(I, L, d, S, w) {
|
|
1659
|
-
var E, P, j = 8 * w - S - 1, m = (1 << j) - 1, v = m >> 1, a = -7, l = d ? w - 1 : 0, r = d ? -1 : 1, w = I[L + l];
|
|
1660
|
-
for (l += r, E = w & (1 << -a) - 1, w >>= -a, a += j; 0 < a; E = 256 * E + I[L + l], l += r, a -= 8)
|
|
1661
|
-
;
|
|
1662
|
-
for (P = E & (1 << -a) - 1, E >>= -a, a += S; 0 < a; P = 256 * P + I[L + l], l += r, a -= 8)
|
|
1663
|
-
;
|
|
1664
|
-
if (E === 0)
|
|
1665
|
-
E = 1 - v;
|
|
1666
|
-
else {
|
|
1667
|
-
if (E === m)
|
|
1668
|
-
return P ? NaN : 1 / 0 * (w ? -1 : 1);
|
|
1669
|
-
P += Math.pow(2, S), E -= v;
|
|
1670
|
-
}
|
|
1671
|
-
return (w ? -1 : 1) * P * Math.pow(2, E - S);
|
|
1672
|
-
}, o.write = function(I, L, d, S, R, _) {
|
|
1673
|
-
var P, j, m = 8 * _ - R - 1, v = (1 << m) - 1, a = v >> 1, l = R === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, r = S ? 0 : _ - 1, w = S ? 1 : -1, _ = L < 0 || L === 0 && 1 / L < 0 ? 1 : 0;
|
|
1674
|
-
for (L = Math.abs(L), isNaN(L) || L === 1 / 0 ? (j = isNaN(L) ? 1 : 0, P = v) : (P = Math.floor(Math.log(L) / Math.LN2), L * (S = Math.pow(2, -P)) < 1 && (P--, S *= 2), 2 <= (L += 1 <= P + a ? l / S : l * Math.pow(2, 1 - a)) * S && (P++, S /= 2), v <= P + a ? (j = 0, P = v) : 1 <= P + a ? (j = (L * S - 1) * Math.pow(2, R), P += a) : (j = L * Math.pow(2, a - 1) * Math.pow(2, R), P = 0)); 8 <= R; I[d + r] = 255 & j, r += w, j /= 256, R -= 8)
|
|
1675
|
-
;
|
|
1676
|
-
for (P = P << R | j, m += R; 0 < m; I[d + r] = 255 & P, r += w, P /= 256, m -= 8)
|
|
1677
|
-
;
|
|
1678
|
-
I[d + r - w] |= 128 * _;
|
|
1679
|
-
};
|
|
1680
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/ieee754/index.js", "/node_modules/gulp-browserify/node_modules/ieee754");
|
|
1681
|
-
}, { buffer: 3, lYpoI2: 11 }], 11: [function(n, i, o) {
|
|
1682
|
-
(function(c, f, h, g, y, b, O, U, B) {
|
|
1683
|
-
var I, L, d;
|
|
1684
|
-
function S() {
|
|
1685
|
-
}
|
|
1686
|
-
(c = i.exports = {}).nextTick = (L = typeof window < "u" && window.setImmediate, d = typeof window < "u" && window.postMessage && window.addEventListener, L ? function(R) {
|
|
1687
|
-
return window.setImmediate(R);
|
|
1688
|
-
} : d ? (I = [], window.addEventListener("message", function(R) {
|
|
1689
|
-
var E = R.source;
|
|
1690
|
-
E !== window && E !== null || R.data !== "process-tick" || (R.stopPropagation(), 0 < I.length && I.shift()());
|
|
1691
|
-
}, !0), function(R) {
|
|
1692
|
-
I.push(R), window.postMessage("process-tick", "*");
|
|
1693
|
-
}) : function(R) {
|
|
1694
|
-
setTimeout(R, 0);
|
|
1695
|
-
}), c.title = "browser", c.browser = !0, c.env = {}, c.argv = [], c.on = S, c.addListener = S, c.once = S, c.off = S, c.removeListener = S, c.removeAllListeners = S, c.emit = S, c.binding = function(R) {
|
|
1696
|
-
throw new Error("process.binding is not supported");
|
|
1697
|
-
}, c.cwd = function() {
|
|
1698
|
-
return "/";
|
|
1699
|
-
}, c.chdir = function(R) {
|
|
1700
|
-
throw new Error("process.chdir is not supported");
|
|
1701
|
-
};
|
|
1702
|
-
}).call(this, n("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, n("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/process/browser.js", "/node_modules/gulp-browserify/node_modules/process");
|
|
1703
|
-
}, { buffer: 3, lYpoI2: 11 }] }, {}, [1])(1);
|
|
1704
|
-
});
|
|
1705
|
-
})(Ne);
|
|
1706
|
-
var Ie = Ne.exports;
|
|
1707
|
-
const Ee = ["0.3", "0.4", "0.5", "0.6"], Se = ["0.2", "0.3"], xn = "0.6", Rt = "0.3";
|
|
1708
|
-
var k;
|
|
1709
|
-
(function(e) {
|
|
1710
|
-
e.Inputs = "inputs", e.Outputs = "outputs", e.State = "state", e.Definition = "definition", e.DefinitionUpdateRequest = "definitionupdaterequest", e.Error = "error", e.UrlHashUpdate = "urlhashupdate", e.Message = "Message";
|
|
1711
|
-
})(k || (k = {}));
|
|
1712
|
-
var tt;
|
|
1713
|
-
(function(e) {
|
|
1714
|
-
e.InputsUpdate = "InputsUpdate", e.OutputsUpdate = "OutputsUpdate", e.SetupIframeClientRequest = "SetupIframeClientRequest", e.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", e.PluginRequest = "SetupIframeServerPluginRequestResponseAck", e.HashParamsUpdate = "HashParamsUpdate";
|
|
1715
|
-
})(tt || (tt = {}));
|
|
1716
|
-
var pt;
|
|
1717
|
-
(function(e) {
|
|
1718
|
-
e.InputsUpdate = "InputsUpdate", e.MessageAck = "MessageAck", e.SetupIframeServerResponse = "SetupIframeServerResponse";
|
|
1719
|
-
})(pt || (pt = {}));
|
|
1720
|
-
var ne;
|
|
1721
|
-
(function(e) {
|
|
1722
|
-
e.State = "metapage/state";
|
|
1723
|
-
})(ne || (ne = {}));
|
|
1724
|
-
const ct = "metapage/definition", yt = "metapage/state", ze = Se[Se.length - 1], pn = Ee[Ee.length - 1];
|
|
1725
|
-
var Et = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Mt = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
1726
|
-
for (var xt = 0; xt < Et.length; xt++)
|
|
1727
|
-
Mt[Et.charCodeAt(xt)] = xt;
|
|
1728
|
-
var Bt = function(e) {
|
|
1729
|
-
var t = new Uint8Array(e), n, i = t.length, o = "";
|
|
1730
|
-
for (n = 0; n < i; n += 3)
|
|
1731
|
-
o += Et[t[n] >> 2], o += Et[(t[n] & 3) << 4 | t[n + 1] >> 4], o += Et[(t[n + 1] & 15) << 2 | t[n + 2] >> 6], o += Et[t[n + 2] & 63];
|
|
1732
|
-
return i % 3 === 2 ? o = o.substring(0, o.length - 1) + "=" : i % 3 === 1 && (o = o.substring(0, o.length - 2) + "=="), o;
|
|
1733
|
-
}, kt = function(e) {
|
|
1734
|
-
var t = e.length * 0.75, n = e.length, i, o = 0, c, f, h, g;
|
|
1735
|
-
e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
|
|
1736
|
-
var y = new ArrayBuffer(t), b = new Uint8Array(y);
|
|
1737
|
-
for (i = 0; i < n; i += 4)
|
|
1738
|
-
c = Mt[e.charCodeAt(i)], f = Mt[e.charCodeAt(i + 1)], h = Mt[e.charCodeAt(i + 2)], g = Mt[e.charCodeAt(i + 3)], b[o++] = c << 2 | f >> 4, b[o++] = (f & 15) << 4 | h >> 2, b[o++] = (h & 3) << 6 | g & 63;
|
|
1739
|
-
return y;
|
|
847
|
+
const Vt = ["0.3", "0.4", "0.5", "0.6", "1"], xt = ["0.2", "0.3", "1"], He = "1", Y = "1";
|
|
848
|
+
var Tt;
|
|
849
|
+
(function(t) {
|
|
850
|
+
t.Inputs = "inputs", t.Outputs = "outputs", t.State = "state", t.Definition = "definition", t.DefinitionUpdateRequest = "definitionupdaterequest", t.Error = "error", t.UrlHashUpdate = "urlhashupdate", t.Message = "Message";
|
|
851
|
+
})(Tt || (Tt = {}));
|
|
852
|
+
var A;
|
|
853
|
+
(function(t) {
|
|
854
|
+
t.InputsUpdate = "InputsUpdate", t.OutputsUpdate = "OutputsUpdate", t.SetupIframeClientRequest = "SetupIframeClientRequest", t.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", t.HashParamsUpdate = "HashParamsUpdate";
|
|
855
|
+
})(A || (A = {}));
|
|
856
|
+
var $;
|
|
857
|
+
(function(t) {
|
|
858
|
+
t.InputsUpdate = "InputsUpdate", t.MessageAck = "MessageAck", t.SetupIframeServerResponse = "SetupIframeServerResponse";
|
|
859
|
+
})($ || ($ = {}));
|
|
860
|
+
const Zt = xt[xt.length - 1], Se = Vt[Vt.length - 1];
|
|
861
|
+
var B = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", K = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
862
|
+
for (var st = 0; st < B.length; st++)
|
|
863
|
+
K[B.charCodeAt(st)] = st;
|
|
864
|
+
var nt = function(t) {
|
|
865
|
+
var e = new Uint8Array(t), s, n = e.length, i = "";
|
|
866
|
+
for (s = 0; s < n; s += 3)
|
|
867
|
+
i += B[e[s] >> 2], i += B[(e[s] & 3) << 4 | e[s + 1] >> 4], i += B[(e[s + 1] & 15) << 2 | e[s + 2] >> 6], i += B[e[s + 2] & 63];
|
|
868
|
+
return n % 3 === 2 ? i = i.substring(0, i.length - 1) + "=" : n % 3 === 1 && (i = i.substring(0, i.length - 2) + "=="), i;
|
|
869
|
+
}, it = function(t) {
|
|
870
|
+
var e = t.length * 0.75, s = t.length, n, i = 0, a, r, o, u;
|
|
871
|
+
t[t.length - 1] === "=" && (e--, t[t.length - 2] === "=" && e--);
|
|
872
|
+
var f = new ArrayBuffer(e), c = new Uint8Array(f);
|
|
873
|
+
for (n = 0; n < s; n += 4)
|
|
874
|
+
a = K[t.charCodeAt(n)], r = K[t.charCodeAt(n + 1)], o = K[t.charCodeAt(n + 2)], u = K[t.charCodeAt(n + 3)], c[i++] = a << 2 | r >> 4, c[i++] = (r & 15) << 4 | o >> 2, c[i++] = (o & 3) << 6 | u & 63;
|
|
875
|
+
return f;
|
|
1740
876
|
};
|
|
1741
|
-
const
|
|
1742
|
-
for (const
|
|
1743
|
-
const
|
|
1744
|
-
e
|
|
877
|
+
const ht = async (t) => {
|
|
878
|
+
for (const e of Object.keys(t)) {
|
|
879
|
+
const s = await Re(t[e]);
|
|
880
|
+
t[e] = s;
|
|
1745
881
|
}
|
|
1746
|
-
return
|
|
1747
|
-
},
|
|
1748
|
-
for (const
|
|
1749
|
-
const
|
|
1750
|
-
e
|
|
882
|
+
return t;
|
|
883
|
+
}, X = async (t) => {
|
|
884
|
+
for (const e of Object.keys(t)) {
|
|
885
|
+
const s = await Ee(t[e]);
|
|
886
|
+
t[e] = s;
|
|
1751
887
|
}
|
|
1752
|
-
return
|
|
1753
|
-
},
|
|
1754
|
-
if (
|
|
1755
|
-
const
|
|
888
|
+
return t;
|
|
889
|
+
}, Re = async (t) => {
|
|
890
|
+
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) {
|
|
891
|
+
const e = t, s = {
|
|
1756
892
|
_s: !0,
|
|
1757
|
-
_c:
|
|
1758
|
-
value:
|
|
1759
|
-
byteLength:
|
|
1760
|
-
byteOffset:
|
|
1761
|
-
size:
|
|
893
|
+
_c: t.constructor.name,
|
|
894
|
+
value: nt(e.buffer),
|
|
895
|
+
byteLength: e.byteLength,
|
|
896
|
+
byteOffset: e.byteOffset,
|
|
897
|
+
size: e.byteLength
|
|
1762
898
|
};
|
|
1763
|
-
return Promise.resolve(
|
|
1764
|
-
} else if (
|
|
1765
|
-
const
|
|
899
|
+
return Promise.resolve(s);
|
|
900
|
+
} else if (t instanceof File) {
|
|
901
|
+
const e = t, s = await e.arrayBuffer();
|
|
1766
902
|
return {
|
|
1767
903
|
_s: !0,
|
|
1768
904
|
_c: File.name,
|
|
1769
|
-
value:
|
|
1770
|
-
name:
|
|
1771
|
-
fileType:
|
|
1772
|
-
lastModified:
|
|
1773
|
-
size:
|
|
905
|
+
value: nt(s),
|
|
906
|
+
name: e.name,
|
|
907
|
+
fileType: e.type,
|
|
908
|
+
lastModified: e.lastModified,
|
|
909
|
+
size: s.byteLength
|
|
1774
910
|
};
|
|
1775
|
-
} else if (
|
|
1776
|
-
const
|
|
911
|
+
} else if (t instanceof Blob) {
|
|
912
|
+
const e = t, s = await e.arrayBuffer();
|
|
1777
913
|
return {
|
|
1778
914
|
_s: !0,
|
|
1779
915
|
_c: Blob.name,
|
|
1780
|
-
value:
|
|
1781
|
-
fileType:
|
|
1782
|
-
size:
|
|
916
|
+
value: nt(s),
|
|
917
|
+
fileType: e.type,
|
|
918
|
+
size: s.byteLength
|
|
1783
919
|
};
|
|
1784
|
-
} else if (
|
|
1785
|
-
const
|
|
920
|
+
} else if (t instanceof ArrayBuffer) {
|
|
921
|
+
const e = t, s = {
|
|
1786
922
|
_s: !0,
|
|
1787
923
|
_c: ArrayBuffer.name,
|
|
1788
|
-
value:
|
|
1789
|
-
size:
|
|
924
|
+
value: nt(e),
|
|
925
|
+
size: e.byteLength
|
|
1790
926
|
};
|
|
1791
|
-
return Promise.resolve(
|
|
1792
|
-
}
|
|
1793
|
-
return Promise.resolve(
|
|
1794
|
-
},
|
|
1795
|
-
if (!(
|
|
1796
|
-
return
|
|
1797
|
-
const
|
|
1798
|
-
if (
|
|
1799
|
-
const
|
|
1800
|
-
return new Blob([
|
|
1801
|
-
type:
|
|
927
|
+
return Promise.resolve(s);
|
|
928
|
+
}
|
|
929
|
+
return Promise.resolve(t);
|
|
930
|
+
}, Ee = (t) => {
|
|
931
|
+
if (!(t && typeof t == "object" && t._s === !0))
|
|
932
|
+
return t;
|
|
933
|
+
const e = t, s = e._c;
|
|
934
|
+
if (s === Blob.name) {
|
|
935
|
+
const r = t;
|
|
936
|
+
return new Blob([it(e.value)], {
|
|
937
|
+
type: r.fileType
|
|
1802
938
|
});
|
|
1803
|
-
} else if (
|
|
1804
|
-
const
|
|
1805
|
-
return new File([
|
|
1806
|
-
type:
|
|
1807
|
-
lastModified:
|
|
939
|
+
} else if (s === File.name) {
|
|
940
|
+
const r = t;
|
|
941
|
+
return new File([it(e.value)], r.name, {
|
|
942
|
+
type: r.fileType,
|
|
943
|
+
lastModified: r.lastModified
|
|
1808
944
|
});
|
|
1809
|
-
} else if (
|
|
1810
|
-
return
|
|
1811
|
-
const
|
|
945
|
+
} else if (s === ArrayBuffer.name)
|
|
946
|
+
return it(e.value);
|
|
947
|
+
const n = t, i = it(n.value), a = n._c;
|
|
1812
948
|
try {
|
|
1813
|
-
return new globalThis[
|
|
949
|
+
return new globalThis[a](i);
|
|
1814
950
|
} catch {
|
|
1815
951
|
}
|
|
1816
|
-
return
|
|
952
|
+
return t;
|
|
1817
953
|
};
|
|
1818
|
-
|
|
1819
|
-
(
|
|
1820
|
-
|
|
1821
|
-
|
|
954
|
+
function Ae(t) {
|
|
955
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
956
|
+
}
|
|
957
|
+
var te = { exports: {} };
|
|
958
|
+
(function(t) {
|
|
959
|
+
var e = Object.prototype.hasOwnProperty, s = "~";
|
|
960
|
+
function n() {
|
|
1822
961
|
}
|
|
1823
|
-
Object.create && (
|
|
1824
|
-
function
|
|
1825
|
-
this.fn =
|
|
962
|
+
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (s = !1));
|
|
963
|
+
function i(u, f, c) {
|
|
964
|
+
this.fn = u, this.context = f, this.once = c || !1;
|
|
1826
965
|
}
|
|
1827
|
-
function
|
|
1828
|
-
if (typeof
|
|
966
|
+
function a(u, f, c, h, l) {
|
|
967
|
+
if (typeof c != "function")
|
|
1829
968
|
throw new TypeError("The listener must be a function");
|
|
1830
|
-
var
|
|
1831
|
-
return
|
|
969
|
+
var y = new i(c, h || u, l), m = s ? s + f : f;
|
|
970
|
+
return u._events[m] ? u._events[m].fn ? u._events[m] = [u._events[m], y] : u._events[m].push(y) : (u._events[m] = y, u._eventsCount++), u;
|
|
1832
971
|
}
|
|
1833
|
-
function
|
|
1834
|
-
--
|
|
972
|
+
function r(u, f) {
|
|
973
|
+
--u._eventsCount === 0 ? u._events = new n() : delete u._events[f];
|
|
1835
974
|
}
|
|
1836
|
-
function
|
|
1837
|
-
this._events = new
|
|
975
|
+
function o() {
|
|
976
|
+
this._events = new n(), this._eventsCount = 0;
|
|
1838
977
|
}
|
|
1839
|
-
|
|
1840
|
-
var
|
|
978
|
+
o.prototype.eventNames = function() {
|
|
979
|
+
var f = [], c, h;
|
|
1841
980
|
if (this._eventsCount === 0)
|
|
1842
|
-
return
|
|
1843
|
-
for (
|
|
1844
|
-
|
|
1845
|
-
return Object.getOwnPropertySymbols ?
|
|
1846
|
-
},
|
|
1847
|
-
var
|
|
1848
|
-
if (!
|
|
981
|
+
return f;
|
|
982
|
+
for (h in c = this._events)
|
|
983
|
+
e.call(c, h) && f.push(s ? h.slice(1) : h);
|
|
984
|
+
return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(c)) : f;
|
|
985
|
+
}, o.prototype.listeners = function(f) {
|
|
986
|
+
var c = s ? s + f : f, h = this._events[c];
|
|
987
|
+
if (!h)
|
|
1849
988
|
return [];
|
|
1850
|
-
if (
|
|
1851
|
-
return [
|
|
1852
|
-
for (var
|
|
1853
|
-
|
|
1854
|
-
return
|
|
1855
|
-
},
|
|
1856
|
-
var
|
|
1857
|
-
return
|
|
1858
|
-
},
|
|
1859
|
-
var
|
|
1860
|
-
if (!this._events[
|
|
989
|
+
if (h.fn)
|
|
990
|
+
return [h.fn];
|
|
991
|
+
for (var l = 0, y = h.length, m = new Array(y); l < y; l++)
|
|
992
|
+
m[l] = h[l].fn;
|
|
993
|
+
return m;
|
|
994
|
+
}, o.prototype.listenerCount = function(f) {
|
|
995
|
+
var c = s ? s + f : f, h = this._events[c];
|
|
996
|
+
return h ? h.fn ? 1 : h.length : 0;
|
|
997
|
+
}, o.prototype.emit = function(f, c, h, l, y, m) {
|
|
998
|
+
var I = s ? s + f : f;
|
|
999
|
+
if (!this._events[I])
|
|
1861
1000
|
return !1;
|
|
1862
|
-
var
|
|
1863
|
-
if (
|
|
1864
|
-
switch (
|
|
1001
|
+
var p = this._events[I], S = arguments.length, w, _;
|
|
1002
|
+
if (p.fn) {
|
|
1003
|
+
switch (p.once && this.removeListener(f, p.fn, void 0, !0), S) {
|
|
1865
1004
|
case 1:
|
|
1866
|
-
return
|
|
1005
|
+
return p.fn.call(p.context), !0;
|
|
1867
1006
|
case 2:
|
|
1868
|
-
return
|
|
1007
|
+
return p.fn.call(p.context, c), !0;
|
|
1869
1008
|
case 3:
|
|
1870
|
-
return
|
|
1009
|
+
return p.fn.call(p.context, c, h), !0;
|
|
1871
1010
|
case 4:
|
|
1872
|
-
return
|
|
1011
|
+
return p.fn.call(p.context, c, h, l), !0;
|
|
1873
1012
|
case 5:
|
|
1874
|
-
return
|
|
1013
|
+
return p.fn.call(p.context, c, h, l, y), !0;
|
|
1875
1014
|
case 6:
|
|
1876
|
-
return
|
|
1015
|
+
return p.fn.call(p.context, c, h, l, y, m), !0;
|
|
1877
1016
|
}
|
|
1878
|
-
for (
|
|
1879
|
-
|
|
1880
|
-
|
|
1017
|
+
for (_ = 1, w = new Array(S - 1); _ < S; _++)
|
|
1018
|
+
w[_ - 1] = arguments[_];
|
|
1019
|
+
p.fn.apply(p.context, w);
|
|
1881
1020
|
} else {
|
|
1882
|
-
var
|
|
1883
|
-
for (
|
|
1884
|
-
switch (
|
|
1021
|
+
var et = p.length, b;
|
|
1022
|
+
for (_ = 0; _ < et; _++)
|
|
1023
|
+
switch (p[_].once && this.removeListener(f, p[_].fn, void 0, !0), S) {
|
|
1885
1024
|
case 1:
|
|
1886
|
-
|
|
1025
|
+
p[_].fn.call(p[_].context);
|
|
1887
1026
|
break;
|
|
1888
1027
|
case 2:
|
|
1889
|
-
|
|
1028
|
+
p[_].fn.call(p[_].context, c);
|
|
1890
1029
|
break;
|
|
1891
1030
|
case 3:
|
|
1892
|
-
|
|
1031
|
+
p[_].fn.call(p[_].context, c, h);
|
|
1893
1032
|
break;
|
|
1894
1033
|
case 4:
|
|
1895
|
-
|
|
1034
|
+
p[_].fn.call(p[_].context, c, h, l);
|
|
1896
1035
|
break;
|
|
1897
1036
|
default:
|
|
1898
|
-
if (!
|
|
1899
|
-
for (
|
|
1900
|
-
|
|
1901
|
-
|
|
1037
|
+
if (!w)
|
|
1038
|
+
for (b = 1, w = new Array(S - 1); b < S; b++)
|
|
1039
|
+
w[b - 1] = arguments[b];
|
|
1040
|
+
p[_].fn.apply(p[_].context, w);
|
|
1902
1041
|
}
|
|
1903
1042
|
}
|
|
1904
1043
|
return !0;
|
|
1905
|
-
},
|
|
1906
|
-
return
|
|
1907
|
-
},
|
|
1908
|
-
return
|
|
1909
|
-
},
|
|
1910
|
-
var
|
|
1911
|
-
if (!this._events[
|
|
1044
|
+
}, o.prototype.on = function(f, c, h) {
|
|
1045
|
+
return a(this, f, c, h, !1);
|
|
1046
|
+
}, o.prototype.once = function(f, c, h) {
|
|
1047
|
+
return a(this, f, c, h, !0);
|
|
1048
|
+
}, o.prototype.removeListener = function(f, c, h, l) {
|
|
1049
|
+
var y = s ? s + f : f;
|
|
1050
|
+
if (!this._events[y])
|
|
1912
1051
|
return this;
|
|
1913
|
-
if (!
|
|
1914
|
-
return
|
|
1915
|
-
var
|
|
1916
|
-
if (
|
|
1917
|
-
|
|
1052
|
+
if (!c)
|
|
1053
|
+
return r(this, y), this;
|
|
1054
|
+
var m = this._events[y];
|
|
1055
|
+
if (m.fn)
|
|
1056
|
+
m.fn === c && (!l || m.once) && (!h || m.context === h) && r(this, y);
|
|
1918
1057
|
else {
|
|
1919
|
-
for (var
|
|
1920
|
-
(I
|
|
1921
|
-
|
|
1058
|
+
for (var I = 0, p = [], S = m.length; I < S; I++)
|
|
1059
|
+
(m[I].fn !== c || l && !m[I].once || h && m[I].context !== h) && p.push(m[I]);
|
|
1060
|
+
p.length ? this._events[y] = p.length === 1 ? p[0] : p : r(this, y);
|
|
1922
1061
|
}
|
|
1923
1062
|
return this;
|
|
1924
|
-
},
|
|
1925
|
-
var
|
|
1926
|
-
return
|
|
1927
|
-
},
|
|
1928
|
-
})(
|
|
1929
|
-
var
|
|
1930
|
-
function
|
|
1931
|
-
const
|
|
1932
|
-
return
|
|
1063
|
+
}, o.prototype.removeAllListeners = function(f) {
|
|
1064
|
+
var c;
|
|
1065
|
+
return f ? (c = s ? s + f : f, this._events[c] && r(this, c)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
1066
|
+
}, o.prototype.off = o.prototype.removeListener, o.prototype.addListener = o.prototype.on, o.prefixed = s, o.EventEmitter = o, t.exports = o;
|
|
1067
|
+
})(te);
|
|
1068
|
+
var Ct = te.exports;
|
|
1069
|
+
function lt(t, e) {
|
|
1070
|
+
const s = ft(t), n = ft(e), i = s.pop(), a = n.pop(), r = wt(s, n);
|
|
1071
|
+
return r !== 0 ? r : i && a ? wt(i.split("."), a.split(".")) : i || a ? i ? -1 : 1 : 0;
|
|
1933
1072
|
}
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1936
|
-
const
|
|
1937
|
-
return
|
|
1938
|
-
},
|
|
1939
|
-
const
|
|
1940
|
-
if (
|
|
1941
|
-
return
|
|
1942
|
-
const [
|
|
1943
|
-
return
|
|
1073
|
+
const Ce = (t) => typeof t == "string" && /^[v\d]/.test(t) && ee.test(t), W = (t, e, s) => {
|
|
1074
|
+
Pe(s);
|
|
1075
|
+
const n = lt(t, e);
|
|
1076
|
+
return se[s].includes(n);
|
|
1077
|
+
}, je = (t, e) => {
|
|
1078
|
+
const s = e.match(/^([<>=~^]+)/), n = s ? s[1] : "=";
|
|
1079
|
+
if (n !== "^" && n !== "~")
|
|
1080
|
+
return W(t, e, n);
|
|
1081
|
+
const [i, a, r] = ft(t), [o, u, f] = ft(e);
|
|
1082
|
+
return at(i, o) !== 0 ? !1 : n === "^" ? wt([a, r], [u, f]) >= 0 : at(a, u) !== 0 ? !1 : at(r, f) >= 0;
|
|
1944
1083
|
};
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
const
|
|
1949
|
-
if (typeof
|
|
1084
|
+
lt.validate = Ce;
|
|
1085
|
+
lt.compare = W;
|
|
1086
|
+
lt.satisfies = je;
|
|
1087
|
+
const ee = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, ft = (t) => {
|
|
1088
|
+
if (typeof t != "string")
|
|
1950
1089
|
throw new TypeError("Invalid argument expected string");
|
|
1951
|
-
const
|
|
1952
|
-
if (!
|
|
1953
|
-
throw new Error(`Invalid argument not valid semver ('${
|
|
1954
|
-
return
|
|
1955
|
-
},
|
|
1956
|
-
const
|
|
1957
|
-
return isNaN(
|
|
1958
|
-
},
|
|
1959
|
-
if (
|
|
1090
|
+
const e = t.match(ee);
|
|
1091
|
+
if (!e)
|
|
1092
|
+
throw new Error(`Invalid argument not valid semver ('${t}' received)`);
|
|
1093
|
+
return e.shift(), e;
|
|
1094
|
+
}, kt = (t) => t === "*" || t === "x" || t === "X", Nt = (t) => {
|
|
1095
|
+
const e = parseInt(t, 10);
|
|
1096
|
+
return isNaN(e) ? t : e;
|
|
1097
|
+
}, De = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], at = (t, e) => {
|
|
1098
|
+
if (kt(t) || kt(e))
|
|
1960
1099
|
return 0;
|
|
1961
|
-
const [
|
|
1962
|
-
return
|
|
1963
|
-
},
|
|
1964
|
-
for (let
|
|
1965
|
-
const
|
|
1966
|
-
if (
|
|
1967
|
-
return
|
|
1100
|
+
const [s, n] = De(Nt(t), Nt(e));
|
|
1101
|
+
return s > n ? 1 : s < n ? -1 : 0;
|
|
1102
|
+
}, wt = (t, e) => {
|
|
1103
|
+
for (let s = 0; s < Math.max(t.length, e.length); s++) {
|
|
1104
|
+
const n = at(t[s] || 0, e[s] || 0);
|
|
1105
|
+
if (n !== 0)
|
|
1106
|
+
return n;
|
|
1968
1107
|
}
|
|
1969
1108
|
return 0;
|
|
1970
|
-
},
|
|
1109
|
+
}, se = {
|
|
1971
1110
|
">": [1],
|
|
1972
1111
|
">=": [0, 1],
|
|
1973
1112
|
"=": [0],
|
|
1974
1113
|
"<=": [-1, 0],
|
|
1975
1114
|
"<": [-1]
|
|
1976
|
-
},
|
|
1977
|
-
if (typeof
|
|
1115
|
+
}, Ft = Object.keys(se), Pe = (t) => {
|
|
1116
|
+
if (typeof t != "string")
|
|
1978
1117
|
throw new TypeError(
|
|
1979
|
-
`Invalid operator type, expected string but got ${typeof
|
|
1118
|
+
`Invalid operator type, expected string but got ${typeof t}`
|
|
1980
1119
|
);
|
|
1981
|
-
if (
|
|
1120
|
+
if (Ft.indexOf(t) === -1)
|
|
1982
1121
|
throw new Error(
|
|
1983
|
-
`Invalid operator, expected one of ${
|
|
1122
|
+
`Invalid operator, expected one of ${Ft.join("|")}`
|
|
1984
1123
|
);
|
|
1985
1124
|
};
|
|
1986
|
-
var
|
|
1987
|
-
|
|
1988
|
-
var
|
|
1989
|
-
return function(
|
|
1990
|
-
return function(
|
|
1991
|
-
var
|
|
1992
|
-
return
|
|
1125
|
+
var Le = function(t, e) {
|
|
1126
|
+
e || (e = {}), typeof e == "function" && (e = { cmp: e });
|
|
1127
|
+
var s = typeof e.cycles == "boolean" ? e.cycles : !1, n = e.cmp && function(a) {
|
|
1128
|
+
return function(r) {
|
|
1129
|
+
return function(o, u) {
|
|
1130
|
+
var f = { key: o, value: r[o] }, c = { key: u, value: r[u] };
|
|
1131
|
+
return a(f, c);
|
|
1993
1132
|
};
|
|
1994
1133
|
};
|
|
1995
|
-
}(
|
|
1996
|
-
return function
|
|
1997
|
-
if (
|
|
1998
|
-
if (typeof
|
|
1999
|
-
return isFinite(
|
|
2000
|
-
if (typeof
|
|
2001
|
-
return JSON.stringify(
|
|
2002
|
-
var
|
|
2003
|
-
if (Array.isArray(
|
|
2004
|
-
for (
|
|
2005
|
-
|
|
2006
|
-
return
|
|
1134
|
+
}(e.cmp), i = [];
|
|
1135
|
+
return function a(r) {
|
|
1136
|
+
if (r && r.toJSON && typeof r.toJSON == "function" && (r = r.toJSON()), r !== void 0) {
|
|
1137
|
+
if (typeof r == "number")
|
|
1138
|
+
return isFinite(r) ? "" + r : "null";
|
|
1139
|
+
if (typeof r != "object")
|
|
1140
|
+
return JSON.stringify(r);
|
|
1141
|
+
var o, u;
|
|
1142
|
+
if (Array.isArray(r)) {
|
|
1143
|
+
for (u = "[", o = 0; o < r.length; o++)
|
|
1144
|
+
o && (u += ","), u += a(r[o]) || "null";
|
|
1145
|
+
return u + "]";
|
|
2007
1146
|
}
|
|
2008
|
-
if (
|
|
1147
|
+
if (r === null)
|
|
2009
1148
|
return "null";
|
|
2010
|
-
if (
|
|
2011
|
-
if (
|
|
1149
|
+
if (i.indexOf(r) !== -1) {
|
|
1150
|
+
if (s)
|
|
2012
1151
|
return JSON.stringify("__cycle__");
|
|
2013
1152
|
throw new TypeError("Converting circular structure to JSON");
|
|
2014
1153
|
}
|
|
2015
|
-
var
|
|
2016
|
-
for (
|
|
2017
|
-
var
|
|
2018
|
-
|
|
1154
|
+
var f = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
|
|
1155
|
+
for (u = "", o = 0; o < c.length; o++) {
|
|
1156
|
+
var h = c[o], l = a(r[h]);
|
|
1157
|
+
l && (u && (u += ","), u += JSON.stringify(h) + ":" + l);
|
|
2019
1158
|
}
|
|
2020
|
-
return
|
|
1159
|
+
return i.splice(f, 1), "{" + u + "}";
|
|
2021
1160
|
}
|
|
2022
|
-
}(
|
|
1161
|
+
}(t);
|
|
2023
1162
|
};
|
|
2024
|
-
const
|
|
2025
|
-
var
|
|
2026
|
-
(function(
|
|
2027
|
-
|
|
2028
|
-
})(
|
|
2029
|
-
const
|
|
1163
|
+
const ne = /* @__PURE__ */ Ae(Le);
|
|
1164
|
+
var Z;
|
|
1165
|
+
(function(t) {
|
|
1166
|
+
t.mp_debug = "mp_debug";
|
|
1167
|
+
})(Z || (Z = {}));
|
|
1168
|
+
const Ue = () => {
|
|
2030
1169
|
try {
|
|
2031
1170
|
return window !== window.top;
|
|
2032
1171
|
} catch {
|
|
2033
1172
|
return !1;
|
|
2034
1173
|
}
|
|
2035
|
-
},
|
|
2036
|
-
version:
|
|
1174
|
+
}, ie = {
|
|
1175
|
+
version: Y,
|
|
2037
1176
|
metaframes: {}
|
|
2038
1177
|
};
|
|
2039
|
-
class
|
|
1178
|
+
class $e extends Ct.EventEmitter {
|
|
2040
1179
|
constructor() {
|
|
2041
|
-
super(), this._definition =
|
|
1180
|
+
super(), this._definition = ie, this.getDefinition = this.getDefinition.bind(this);
|
|
2042
1181
|
}
|
|
2043
|
-
error(
|
|
1182
|
+
error(e) {
|
|
2044
1183
|
throw "Subclass should implement";
|
|
2045
1184
|
}
|
|
2046
1185
|
getDefinition() {
|
|
2047
1186
|
return this._definition;
|
|
2048
1187
|
}
|
|
2049
1188
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
1189
|
+
var d;
|
|
1190
|
+
(function(t) {
|
|
1191
|
+
t.Inputs = "inputs", t.Outputs = "outputs", t.State = "state", t.Definition = "definition", t.Error = "error", t.UrlHashUpdate = "urlhashupdate", t.Message = "Message";
|
|
1192
|
+
})(d || (d = {}));
|
|
1193
|
+
const Mt = (t) => {
|
|
1194
|
+
if (t === null)
|
|
2052
1195
|
throw "Metapage definition cannot be null";
|
|
2053
|
-
if (typeof
|
|
1196
|
+
if (typeof t == "string")
|
|
2054
1197
|
try {
|
|
2055
|
-
|
|
1198
|
+
t = JSON.parse(t);
|
|
2056
1199
|
} catch {
|
|
2057
1200
|
throw `Cannot parse into JSON:
|
|
2058
|
-
${
|
|
1201
|
+
${t}`;
|
|
2059
1202
|
}
|
|
2060
|
-
if (!
|
|
1203
|
+
if (!t.version)
|
|
2061
1204
|
throw 'Missing "version" key in metapage definition';
|
|
2062
|
-
let
|
|
2063
|
-
switch (
|
|
1205
|
+
let e;
|
|
1206
|
+
switch (ae(t.version)) {
|
|
2064
1207
|
case "0.2": {
|
|
2065
|
-
|
|
1208
|
+
e = Mt(xe(t));
|
|
2066
1209
|
break;
|
|
2067
1210
|
}
|
|
2068
1211
|
case "0.3": {
|
|
2069
|
-
|
|
1212
|
+
e = Mt(Te(t));
|
|
1213
|
+
break;
|
|
1214
|
+
}
|
|
1215
|
+
case "1": {
|
|
1216
|
+
e = t;
|
|
2070
1217
|
break;
|
|
2071
1218
|
}
|
|
2072
1219
|
default:
|
|
2073
|
-
console.warn(`Metapage definition version=${
|
|
1220
|
+
console.warn(`Metapage definition version=${t.version} but we only know up to version ${Y}. Assuming the definition is compatible, but it's the future!`), e = t;
|
|
2074
1221
|
break;
|
|
2075
1222
|
}
|
|
2076
|
-
return
|
|
2077
|
-
},
|
|
2078
|
-
if (
|
|
2079
|
-
switch (
|
|
1223
|
+
return v(e, (s) => s);
|
|
1224
|
+
}, re = (t, e) => {
|
|
1225
|
+
if (t)
|
|
1226
|
+
switch (t.version) {
|
|
2080
1227
|
case void 0:
|
|
2081
1228
|
case "0.3":
|
|
2082
1229
|
case "0.4":
|
|
2083
|
-
return
|
|
1230
|
+
return re(Jt(ze(t)));
|
|
2084
1231
|
case "0.5":
|
|
2085
|
-
return
|
|
1232
|
+
return Jt(t);
|
|
2086
1233
|
case "0.6":
|
|
2087
|
-
return
|
|
1234
|
+
return oe(t);
|
|
1235
|
+
case "1":
|
|
1236
|
+
return t;
|
|
2088
1237
|
default:
|
|
2089
|
-
if (
|
|
1238
|
+
if (e && e.errorIfUnknownVersion)
|
|
2090
1239
|
throw `Unsupported metaframe version. Please upgrade to a new version: npm i @metapages/metapage@latest
|
|
2091
|
-
${JSON.stringify(
|
|
1240
|
+
${JSON.stringify(t)}
|
|
2092
1241
|
${window.location.href}`;
|
|
2093
1242
|
return console.error(`Unsupported metaframe version. Not throwing an error because you might not be able to upgrade. Please upgrade to a new version: npm i @metapages/metapage@latest
|
|
2094
|
-
${JSON.stringify(
|
|
2095
|
-
${window.location.href}`),
|
|
1243
|
+
${JSON.stringify(t)}
|
|
1244
|
+
${window.location.href}`), t;
|
|
2096
1245
|
}
|
|
2097
|
-
},
|
|
2098
|
-
const { version:
|
|
2099
|
-
name:
|
|
2100
|
-
author:
|
|
2101
|
-
description:
|
|
2102
|
-
image:
|
|
2103
|
-
tags:
|
|
2104
|
-
...
|
|
1246
|
+
}, ze = (t) => {
|
|
1247
|
+
const { version: e, inputs: s, outputs: n, allow: i, metadata: a, ...r } = t, o = a, { title: u, author: f, image: c, descriptionUrl: h, keywords: l, iconUrl: y, ...m } = o, I = {
|
|
1248
|
+
name: u,
|
|
1249
|
+
author: f,
|
|
1250
|
+
description: h,
|
|
1251
|
+
image: c,
|
|
1252
|
+
tags: l,
|
|
1253
|
+
...m
|
|
2105
1254
|
};
|
|
2106
1255
|
return {
|
|
2107
1256
|
version: "0.5",
|
|
2108
|
-
inputs:
|
|
2109
|
-
outputs:
|
|
2110
|
-
allow:
|
|
2111
|
-
metadata:
|
|
2112
|
-
...
|
|
1257
|
+
inputs: s,
|
|
1258
|
+
outputs: n,
|
|
1259
|
+
allow: i,
|
|
1260
|
+
metadata: I,
|
|
1261
|
+
...r
|
|
2113
1262
|
};
|
|
2114
|
-
},
|
|
2115
|
-
const { metadata:
|
|
1263
|
+
}, oe = (t) => t, Jt = (t) => oe(Ve(t)), Ve = (t) => v(t, (e) => {
|
|
1264
|
+
const { metadata: s, ...n } = e, i = {
|
|
2116
1265
|
...n,
|
|
2117
1266
|
version: "0.6"
|
|
2118
1267
|
};
|
|
2119
|
-
if (
|
|
2120
|
-
const { edit:
|
|
2121
|
-
if (i.metadata =
|
|
2122
|
-
switch (
|
|
1268
|
+
if (s) {
|
|
1269
|
+
const { edit: a, ...r } = s, o = { ...r };
|
|
1270
|
+
if (i.metadata = o, a && !(o && o.operations && o.operations.edit))
|
|
1271
|
+
switch (o.operations || (o.operations = {}), a.type) {
|
|
2123
1272
|
case "metapage":
|
|
2124
|
-
const
|
|
1273
|
+
const u = a.value, f = {
|
|
2125
1274
|
type: "metapage",
|
|
2126
|
-
metapage:
|
|
2127
|
-
metaframe:
|
|
1275
|
+
metapage: u.definition,
|
|
1276
|
+
metaframe: u.key || "edit"
|
|
2128
1277
|
};
|
|
2129
|
-
|
|
1278
|
+
o.operations.edit = f;
|
|
2130
1279
|
break;
|
|
2131
1280
|
case "metaframe":
|
|
2132
|
-
const
|
|
1281
|
+
const c = a.value, h = {
|
|
2133
1282
|
type: "url",
|
|
2134
|
-
url:
|
|
2135
|
-
params:
|
|
2136
|
-
to:
|
|
2137
|
-
from:
|
|
2138
|
-
toType:
|
|
1283
|
+
url: c.url,
|
|
1284
|
+
params: c.params ? c.params.map((l) => ({
|
|
1285
|
+
to: l.to,
|
|
1286
|
+
from: l.from,
|
|
1287
|
+
toType: l.toType === "path" ? void 0 : l.toType
|
|
2139
1288
|
})) : void 0
|
|
2140
1289
|
};
|
|
2141
|
-
|
|
1290
|
+
o.operations.edit = h;
|
|
2142
1291
|
break;
|
|
2143
1292
|
default:
|
|
2144
|
-
throw `Unsupported edit type: ${
|
|
1293
|
+
throw `Unsupported edit type: ${a.type} in metadata for metaframe ${JSON.stringify(s)}`;
|
|
2145
1294
|
}
|
|
2146
1295
|
}
|
|
2147
1296
|
return i;
|
|
2148
|
-
},
|
|
2149
|
-
|
|
1297
|
+
}), xe = (t) => v(t, (e) => {
|
|
1298
|
+
e.version = "0.3";
|
|
1299
|
+
}), Te = (t) => v(t, (e) => {
|
|
1300
|
+
const s = e;
|
|
1301
|
+
delete s.plugins;
|
|
1302
|
+
}), ct = (t, e) => {
|
|
1303
|
+
if (!e)
|
|
2150
1304
|
return !1;
|
|
2151
|
-
let
|
|
2152
|
-
return Object.keys(
|
|
2153
|
-
|
|
2154
|
-
}),
|
|
2155
|
-
},
|
|
2156
|
-
if (
|
|
2157
|
-
return
|
|
2158
|
-
if (
|
|
2159
|
-
throw `Unknown version: ${
|
|
2160
|
-
return
|
|
2161
|
-
},
|
|
2162
|
-
const
|
|
2163
|
-
return
|
|
2164
|
-
},
|
|
2165
|
-
for (var
|
|
2166
|
-
|
|
2167
|
-
return
|
|
2168
|
-
},
|
|
2169
|
-
|
|
2170
|
-
let
|
|
2171
|
-
if (typeof
|
|
2172
|
-
var
|
|
2173
|
-
|
|
1305
|
+
let s = !1;
|
|
1306
|
+
return Object.keys(e).forEach((n) => {
|
|
1307
|
+
s = !0, e[n] === void 0 ? delete t[n] : t[n] = e[n];
|
|
1308
|
+
}), s;
|
|
1309
|
+
}, ae = (t) => {
|
|
1310
|
+
if (t === "latest")
|
|
1311
|
+
return Y;
|
|
1312
|
+
if (W(t, "0.2", "<"))
|
|
1313
|
+
throw `Unknown version: ${t}`;
|
|
1314
|
+
return W(t, "0.2", ">=") && W(t, "0.3", "<") ? "0.2" : W(t, "0.3", "<=") ? "0.3" : t === "1" ? "1" : (console.log(`Could not match version=${t} to any known version, assuming ${Y}`), Y);
|
|
1315
|
+
}, qe = (t) => window.location.search ? new URLSearchParams(window.location.search).get(t) : null, Ke = () => new URLSearchParams(window.location.search).has(Z.mp_debug), Ot = () => {
|
|
1316
|
+
const t = new URLSearchParams(window.location.search).get(Z.mp_debug);
|
|
1317
|
+
return t === "true" || t === "1";
|
|
1318
|
+
}, Ge = (t = 8) => jt(t), ke = (t = 8) => jt(t), Ye = (t = 8) => jt(t), Bt = "abcdefghijklmnopqrstuvwxyz0123456789", jt = (t = 8) => {
|
|
1319
|
+
for (var e = "", s = Bt.length, n = 0; n < t; n++)
|
|
1320
|
+
e += Bt.charAt(Math.floor(Math.random() * s));
|
|
1321
|
+
return e;
|
|
1322
|
+
}, Dt = (t, e, s) => {
|
|
1323
|
+
e = e || "000", e && e.trim() == "" && (e = void 0);
|
|
1324
|
+
let n;
|
|
1325
|
+
if (typeof t == "string" ? n = t : typeof t == "number" ? n = t + "" : n = JSON.stringify(t, null, " "), e && e.trim() != "") {
|
|
1326
|
+
var i = `color: #${e}`;
|
|
1327
|
+
s && (i = `${i}; background: #${s}`), n = `%c${n}`, window.console.log(n, i);
|
|
2174
1328
|
} else
|
|
2175
|
-
window.console.log(
|
|
2176
|
-
},
|
|
2177
|
-
var
|
|
2178
|
-
for (let
|
|
2179
|
-
|
|
2180
|
-
return
|
|
2181
|
-
},
|
|
2182
|
-
var
|
|
2183
|
-
return "00000".substring(0, 6 -
|
|
2184
|
-
},
|
|
2185
|
-
if (
|
|
2186
|
-
|
|
1329
|
+
window.console.log(n);
|
|
1330
|
+
}, ue = (t) => Fe(Ne(t)), Ne = (t) => {
|
|
1331
|
+
var e = 0;
|
|
1332
|
+
for (let s = 0; s < t.length; s++)
|
|
1333
|
+
e = t.charCodeAt(s) + ((e << 5) - e);
|
|
1334
|
+
return e;
|
|
1335
|
+
}, Fe = (t) => {
|
|
1336
|
+
var e = (t & 16777215).toString(16).toUpperCase();
|
|
1337
|
+
return "00000".substring(0, 6 - e.length) + e;
|
|
1338
|
+
}, dt = () => document.readyState == "complete" || document.readyState == "interactive", Pt = async () => dt() ? Promise.resolve() : new Promise((t) => {
|
|
1339
|
+
if (dt()) {
|
|
1340
|
+
t();
|
|
2187
1341
|
return;
|
|
2188
1342
|
}
|
|
2189
|
-
let
|
|
1343
|
+
let e = !1;
|
|
2190
1344
|
window.addEventListener("load", () => {
|
|
2191
|
-
|
|
1345
|
+
e || (e = !0, t());
|
|
2192
1346
|
}), setTimeout(() => {
|
|
2193
|
-
!
|
|
1347
|
+
!e && dt() && (e = !0, t());
|
|
2194
1348
|
}, 200);
|
|
2195
|
-
}),
|
|
2196
|
-
const
|
|
2197
|
-
return await
|
|
2198
|
-
},
|
|
2199
|
-
const
|
|
2200
|
-
version:
|
|
2201
|
-
metaframes:
|
|
2202
|
-
plugins: e.plugins
|
|
1349
|
+
}), Xe = async (t) => {
|
|
1350
|
+
const e = ne(t);
|
|
1351
|
+
return await fe(e);
|
|
1352
|
+
}, Qe = async (t) => {
|
|
1353
|
+
const e = ne({
|
|
1354
|
+
version: t.version,
|
|
1355
|
+
metaframes: t.metaframes
|
|
2203
1356
|
});
|
|
2204
|
-
return await
|
|
1357
|
+
return await fe(e);
|
|
2205
1358
|
};
|
|
2206
|
-
async function
|
|
2207
|
-
const
|
|
2208
|
-
return btoa(String.fromCharCode(...new Uint8Array(
|
|
1359
|
+
async function fe(t) {
|
|
1360
|
+
const s = new TextEncoder().encode(t), n = await crypto.subtle.digest("SHA-256", s);
|
|
1361
|
+
return btoa(String.fromCharCode(...new Uint8Array(n)));
|
|
2209
1362
|
}
|
|
2210
|
-
class
|
|
2211
|
-
constructor(
|
|
2212
|
-
if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this.
|
|
1363
|
+
class Je extends Ct.EventEmitter {
|
|
1364
|
+
constructor(e, s, n, i, a, r = !1) {
|
|
1365
|
+
if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this._cachedEventInputsUpdate = {
|
|
2213
1366
|
iframeId: void 0,
|
|
2214
1367
|
inputs: void 0
|
|
2215
1368
|
}, this._cachedEventOutputsUpdate = {
|
|
2216
1369
|
iframeId: null,
|
|
2217
1370
|
inputs: null
|
|
2218
|
-
}, !
|
|
2219
|
-
for (;
|
|
2220
|
-
|
|
2221
|
-
|
|
1371
|
+
}, !s.startsWith("http")) {
|
|
1372
|
+
for (; s.startsWith("/"); )
|
|
1373
|
+
s = s.substring(1);
|
|
1374
|
+
s = window.location.protocol + "//" + window.location.hostname + (window.location.port && window.location.port != "" ? ":" + window.location.port : "") + "/" + s;
|
|
2222
1375
|
}
|
|
2223
|
-
if (this.url =
|
|
2224
|
-
var
|
|
2225
|
-
|
|
1376
|
+
if (this.url = s, this._metapage = e, this._debug = r, r) {
|
|
1377
|
+
var o = new URL(this.url);
|
|
1378
|
+
o.searchParams.set(Z.mp_debug, "true"), this.url = o.href;
|
|
2226
1379
|
}
|
|
2227
|
-
this.id =
|
|
2228
|
-
const
|
|
2229
|
-
this.iframe = new Promise((
|
|
2230
|
-
|
|
2231
|
-
var
|
|
2232
|
-
if (
|
|
2233
|
-
if ((
|
|
2234
|
-
|
|
1380
|
+
this.id = n, this._parentId = i, this._color = ue(this.id), this._consoleBackgroundColor = a, this._iframe = document.createElement("iframe"), this._iframe.name = this.id;
|
|
1381
|
+
const u = this;
|
|
1382
|
+
this.iframe = new Promise((f) => {
|
|
1383
|
+
Pt().then(async () => {
|
|
1384
|
+
var c, h, l, y;
|
|
1385
|
+
if (u._iframe) {
|
|
1386
|
+
if ((y = (l = (h = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : h.metaframes) == null ? void 0 : l[this.id]) != null && y.allow)
|
|
1387
|
+
u._iframe.allow = this._metapage._definition.metaframes[this.id].allow;
|
|
2235
1388
|
else {
|
|
2236
|
-
const
|
|
2237
|
-
if (!
|
|
1389
|
+
const m = await u.getDefinition();
|
|
1390
|
+
if (!u._iframe)
|
|
2238
1391
|
return;
|
|
2239
|
-
|
|
1392
|
+
m && m.allow && (u._iframe.allow = m.allow);
|
|
2240
1393
|
}
|
|
2241
|
-
|
|
1394
|
+
u._iframe.src = this.url, f(u._iframe);
|
|
2242
1395
|
}
|
|
2243
1396
|
});
|
|
2244
|
-
}), 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.
|
|
1397
|
+
}), 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);
|
|
2245
1398
|
}
|
|
2246
|
-
addListenerReturnDisposer(
|
|
2247
|
-
return super.addListener(
|
|
2248
|
-
super.removeListener(
|
|
1399
|
+
addListenerReturnDisposer(e, s) {
|
|
1400
|
+
return super.addListener(e, s), () => {
|
|
1401
|
+
super.removeListener(e, s);
|
|
2249
1402
|
};
|
|
2250
1403
|
}
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
throw "Cannot setPlugin after MetapageIFrameRpcClient already loaded";
|
|
2254
|
-
return this._plugin = !0, this;
|
|
2255
|
-
}
|
|
2256
|
-
setMetapage(t) {
|
|
2257
|
-
return this._metapage = t, this;
|
|
2258
|
-
}
|
|
2259
|
-
hasPermissionsState() {
|
|
2260
|
-
return this._definition !== void 0 && this._definition.inputs !== void 0 && this._definition.inputs[yt] !== void 0;
|
|
2261
|
-
}
|
|
2262
|
-
hasPermissionsDefinition() {
|
|
2263
|
-
return this._definition !== void 0 && this._definition.inputs !== void 0 && this._definition.inputs[ct] !== void 0;
|
|
1404
|
+
setMetapage(e) {
|
|
1405
|
+
return this._metapage = e, this;
|
|
2264
1406
|
}
|
|
2265
1407
|
getDefinitionUrl() {
|
|
2266
|
-
var
|
|
2267
|
-
return
|
|
1408
|
+
var e = new URL(this.url);
|
|
1409
|
+
return e.pathname = e.pathname + (e.pathname.endsWith("/") ? "metaframe.json" : "/metaframe.json"), e.href;
|
|
2268
1410
|
}
|
|
2269
1411
|
async getDefinition() {
|
|
2270
1412
|
if (this._definition)
|
|
2271
1413
|
return this._definition;
|
|
2272
|
-
var
|
|
1414
|
+
var e = this.getDefinitionUrl();
|
|
2273
1415
|
try {
|
|
2274
|
-
const
|
|
1416
|
+
const s = await window.fetch(e, {
|
|
2275
1417
|
signal: AbortSignal.timeout(6e3)
|
|
2276
1418
|
});
|
|
2277
|
-
if (
|
|
2278
|
-
const
|
|
2279
|
-
return this._definition =
|
|
1419
|
+
if (s.ok) {
|
|
1420
|
+
const n = await s.json(), i = re(n);
|
|
1421
|
+
return this._definition = i, this._definition;
|
|
2280
1422
|
} else
|
|
2281
|
-
this.emit(
|
|
2282
|
-
Status: ${
|
|
2283
|
-
Status text: ${
|
|
2284
|
-
} catch (
|
|
2285
|
-
this.emit(
|
|
2286
|
-
Error: ${
|
|
1423
|
+
this.emit(d.Error, `Failed to fetch: ${e}
|
|
1424
|
+
Status: ${s.status}
|
|
1425
|
+
Status text: ${s.statusText}`);
|
|
1426
|
+
} catch (s) {
|
|
1427
|
+
this.emit(d.Error, `Failed to fetch or convert: ${e}
|
|
1428
|
+
Error: ${s}`);
|
|
2287
1429
|
}
|
|
2288
1430
|
}
|
|
2289
|
-
setInput(
|
|
2290
|
-
console.assert(!!
|
|
2291
|
-
var
|
|
2292
|
-
|
|
1431
|
+
setInput(e, s) {
|
|
1432
|
+
console.assert(!!e);
|
|
1433
|
+
var n = {};
|
|
1434
|
+
n[e] = s, this.setInputs(n);
|
|
2293
1435
|
}
|
|
2294
|
-
setInputs(
|
|
2295
|
-
if (this.log({ m: "MetapageIFrameRpcClient", inputs:
|
|
1436
|
+
setInputs(e) {
|
|
1437
|
+
if (this.log({ m: "MetapageIFrameRpcClient", inputs: e }), !ct(this.inputs, e))
|
|
2296
1438
|
return this;
|
|
2297
|
-
if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(
|
|
2298
|
-
var
|
|
2299
|
-
|
|
1439
|
+
if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(e), this.emit(d.Inputs, this.inputs), this._metapage.listenerCount(d.Inputs) > 0) {
|
|
1440
|
+
var s = {};
|
|
1441
|
+
s[this.id] = e, this._metapage.emit(d.Inputs, s);
|
|
2300
1442
|
}
|
|
2301
1443
|
return this;
|
|
2302
1444
|
}
|
|
2303
|
-
setOutput(
|
|
2304
|
-
console.assert(!!
|
|
2305
|
-
var
|
|
2306
|
-
|
|
1445
|
+
setOutput(e, s) {
|
|
1446
|
+
console.assert(!!e);
|
|
1447
|
+
var n = {};
|
|
1448
|
+
n[e] = s, this.setOutputs(n);
|
|
2307
1449
|
}
|
|
2308
|
-
setOutputs(
|
|
2309
|
-
if (
|
|
2310
|
-
var
|
|
2311
|
-
|
|
1450
|
+
setOutputs(e) {
|
|
1451
|
+
if (ct(this.outputs, e) && (this.emit(d.Outputs, e), this._metapage.listenerCount(d.Outputs) > 0)) {
|
|
1452
|
+
var s = {};
|
|
1453
|
+
s[this.id] = this.outputs, this._metapage.emit(d.Outputs, s);
|
|
2312
1454
|
}
|
|
2313
1455
|
}
|
|
2314
|
-
onInputs(
|
|
2315
|
-
return this.addListenerReturnDisposer(
|
|
1456
|
+
onInputs(e) {
|
|
1457
|
+
return this.addListenerReturnDisposer(d.Inputs, e);
|
|
2316
1458
|
}
|
|
2317
|
-
onInput(
|
|
2318
|
-
var
|
|
2319
|
-
|
|
1459
|
+
onInput(e, s) {
|
|
1460
|
+
var n = function(i) {
|
|
1461
|
+
i.hasOwnProperty(e) && s(i[e]);
|
|
2320
1462
|
};
|
|
2321
|
-
return this.addListenerReturnDisposer(
|
|
1463
|
+
return this.addListenerReturnDisposer(d.Inputs, n);
|
|
2322
1464
|
}
|
|
2323
|
-
onOutputs(
|
|
2324
|
-
return this.addListenerReturnDisposer(
|
|
1465
|
+
onOutputs(e) {
|
|
1466
|
+
return this.addListenerReturnDisposer(d.Outputs, e);
|
|
2325
1467
|
}
|
|
2326
|
-
onOutput(
|
|
2327
|
-
var
|
|
2328
|
-
|
|
1468
|
+
onOutput(e, s) {
|
|
1469
|
+
var n = function(i) {
|
|
1470
|
+
i.hasOwnProperty(e) && s(i[e]);
|
|
2329
1471
|
};
|
|
2330
|
-
return this.addListenerReturnDisposer(
|
|
1472
|
+
return this.addListenerReturnDisposer(d.Outputs, n);
|
|
2331
1473
|
}
|
|
2332
1474
|
isDisposed() {
|
|
2333
1475
|
return this.inputs === void 0;
|
|
2334
1476
|
}
|
|
2335
1477
|
dispose() {
|
|
2336
1478
|
for (super.removeAllListeners(); this._disposables && this._disposables.length > 0; ) {
|
|
2337
|
-
const
|
|
2338
|
-
|
|
1479
|
+
const e = this._disposables.pop();
|
|
1480
|
+
e && e();
|
|
2339
1481
|
}
|
|
2340
1482
|
this._rpcListeners = void 0, this.inputs = void 0, this.outputs = void 0, this._iframe && this._iframe.parentNode && this._iframe.parentNode.removeChild(this._iframe), this._iframe = void 0, this._bufferMessages = void 0, this._bufferTimeout && (window.clearInterval(this._bufferTimeout), this._bufferTimeout = void 0), this._metapage = void 0;
|
|
2341
1483
|
}
|
|
2342
1484
|
register() {
|
|
2343
|
-
var
|
|
1485
|
+
var e = {
|
|
2344
1486
|
iframeId: this.id,
|
|
2345
1487
|
parentId: this._parentId,
|
|
2346
|
-
plugin: this._plugin,
|
|
2347
1488
|
state: {
|
|
2348
1489
|
inputs: this.inputs
|
|
2349
1490
|
},
|
|
2350
|
-
version:
|
|
1491
|
+
version: Zt
|
|
2351
1492
|
};
|
|
2352
|
-
this.sendRpcInternal(
|
|
1493
|
+
this.sendRpcInternal($.SetupIframeServerResponse, e);
|
|
2353
1494
|
}
|
|
2354
|
-
registered(
|
|
1495
|
+
registered(e) {
|
|
2355
1496
|
if (this.log({ m: "MetapageIFrameRpcClient.registered", inputs: this.inputs }), !this._loaded) {
|
|
2356
|
-
if (!
|
|
1497
|
+
if (!e)
|
|
2357
1498
|
throw "Cannot register without a version";
|
|
2358
|
-
for (this.version =
|
|
1499
|
+
for (this.version = e, this._loaded = !0; this._onLoaded && this._onLoaded.length > 0; )
|
|
2359
1500
|
this._onLoaded.pop()();
|
|
2360
1501
|
this._sendInputsAfterRegistration && this.sendInputs(this.inputs);
|
|
2361
1502
|
}
|
|
2362
1503
|
}
|
|
2363
|
-
async sendInputs(
|
|
2364
|
-
|
|
2365
|
-
inputs:
|
|
1504
|
+
async sendInputs(e) {
|
|
1505
|
+
e = await ht(e), this.sendRpc($.InputsUpdate, {
|
|
1506
|
+
inputs: e,
|
|
2366
1507
|
parentId: this._parentId
|
|
2367
1508
|
});
|
|
2368
1509
|
}
|
|
2369
|
-
sendRpc(
|
|
2370
|
-
var
|
|
2371
|
-
if ((
|
|
2372
|
-
this.sendRpcInternal(
|
|
1510
|
+
sendRpc(e, s) {
|
|
1511
|
+
var n, i;
|
|
1512
|
+
if ((n = this == null ? void 0 : this._iframe) != null && n.parentNode && this._loaded)
|
|
1513
|
+
this.sendRpcInternal(e, s);
|
|
2373
1514
|
else {
|
|
2374
|
-
(
|
|
2375
|
-
const
|
|
1515
|
+
(i = this == null ? void 0 : this._metapage) == null || i.error("sending rpc later");
|
|
1516
|
+
const a = this;
|
|
2376
1517
|
this == null || this._onLoaded.push(() => {
|
|
2377
|
-
|
|
1518
|
+
a.sendRpcInternal(e, s);
|
|
2378
1519
|
});
|
|
2379
1520
|
}
|
|
2380
1521
|
}
|
|
2381
|
-
ack(
|
|
1522
|
+
ack(e) {
|
|
2382
1523
|
if (this.log("⚒ ⚒ ⚒ calling ack"), this._debug) {
|
|
2383
1524
|
this.log("⚒ ⚒ ⚒ sending ack from client to frame");
|
|
2384
|
-
var
|
|
2385
|
-
message:
|
|
1525
|
+
var s = {
|
|
1526
|
+
message: e
|
|
2386
1527
|
};
|
|
2387
|
-
this.sendRpc(
|
|
1528
|
+
this.sendRpc($.MessageAck, s);
|
|
2388
1529
|
} else
|
|
2389
1530
|
this.log("⚒ ⚒ ⚒ NOT sending ack from client to frame since not debug mode");
|
|
2390
1531
|
}
|
|
2391
|
-
log(
|
|
2392
|
-
this._debug && this.logInternal(
|
|
1532
|
+
log(e) {
|
|
1533
|
+
this._debug && this.logInternal(e);
|
|
2393
1534
|
}
|
|
2394
|
-
logInternal(
|
|
2395
|
-
let
|
|
2396
|
-
typeof
|
|
1535
|
+
logInternal(e) {
|
|
1536
|
+
let s;
|
|
1537
|
+
typeof e == "string" ? s = e : typeof e == "string" ? s = e + "" : s = JSON.stringify(e), Dt(`Metapage[${this._parentId}] Metaframe[${this.id}] ${s}`, this._color, this._consoleBackgroundColor);
|
|
2397
1538
|
}
|
|
2398
|
-
sendRpcInternal(
|
|
2399
|
-
const
|
|
1539
|
+
sendRpcInternal(e, s) {
|
|
1540
|
+
const n = {
|
|
2400
1541
|
id: "_",
|
|
2401
1542
|
iframeId: this.id,
|
|
2402
1543
|
jsonrpc: "2.0",
|
|
2403
|
-
method:
|
|
2404
|
-
params:
|
|
1544
|
+
method: e,
|
|
1545
|
+
params: s,
|
|
2405
1546
|
parentId: this._parentId
|
|
2406
1547
|
};
|
|
2407
|
-
this._iframe ? this.sendOrBufferPostMessage(
|
|
1548
|
+
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)}`);
|
|
2408
1549
|
}
|
|
2409
|
-
sendOrBufferPostMessage(
|
|
1550
|
+
sendOrBufferPostMessage(e) {
|
|
2410
1551
|
if (this._iframe && this._iframe.contentWindow)
|
|
2411
|
-
this._iframe.contentWindow.postMessage(
|
|
1552
|
+
this._iframe.contentWindow.postMessage(e, this.url);
|
|
2412
1553
|
else if (this._bufferMessages)
|
|
2413
|
-
this._bufferMessages.push(
|
|
1554
|
+
this._bufferMessages.push(e);
|
|
2414
1555
|
else {
|
|
2415
|
-
this._bufferMessages = [
|
|
2416
|
-
const
|
|
1556
|
+
this._bufferMessages = [e];
|
|
1557
|
+
const s = this;
|
|
2417
1558
|
this._bufferTimeout = window.setInterval(function() {
|
|
2418
|
-
|
|
1559
|
+
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);
|
|
2419
1560
|
}, 0);
|
|
2420
1561
|
}
|
|
2421
1562
|
}
|
|
2422
1563
|
}
|
|
2423
|
-
|
|
2424
|
-
(function(e) {
|
|
2425
|
-
e.all = "all", e.delta = "delta";
|
|
2426
|
-
})(je || (je = {}));
|
|
2427
|
-
const Ce = () => ({
|
|
1564
|
+
const Wt = () => v({
|
|
2428
1565
|
metaframes: {
|
|
2429
1566
|
inputs: {},
|
|
2430
1567
|
outputs: {}
|
|
2431
|
-
},
|
|
2432
|
-
plugins: {
|
|
2433
|
-
inputs: {},
|
|
2434
|
-
outputs: {}
|
|
2435
1568
|
}
|
|
2436
|
-
}),
|
|
2437
|
-
class
|
|
2438
|
-
static from(
|
|
2439
|
-
if (
|
|
1569
|
+
}, (t) => t), Ze = (t) => ae(t), Be = (t, e) => !e || e === "*" || t === e ? !0 : e.endsWith("*") ? t.startsWith(e.slice(0, -1)) : e.startsWith("*") ? t.endsWith(e.slice(1)) : !1, We = "bcbcbc";
|
|
1570
|
+
class P extends $e {
|
|
1571
|
+
static from(e, s) {
|
|
1572
|
+
if (e == null)
|
|
2440
1573
|
throw "Metapage definition cannot be null";
|
|
2441
|
-
if (typeof
|
|
1574
|
+
if (typeof e == "string")
|
|
2442
1575
|
try {
|
|
2443
|
-
|
|
1576
|
+
e = JSON.parse(e);
|
|
2444
1577
|
} catch {
|
|
2445
1578
|
throw "Cannot parse into JSON:\n${metaPageDef}";
|
|
2446
1579
|
}
|
|
2447
|
-
var
|
|
2448
|
-
return
|
|
1580
|
+
var n = new P();
|
|
1581
|
+
return n.setDefinition(e);
|
|
2449
1582
|
}
|
|
2450
|
-
constructor(
|
|
2451
|
-
super(), this._state =
|
|
1583
|
+
constructor(e) {
|
|
1584
|
+
super(), this._state = Wt(), this._metaframes = v({}, (s) => s), this.debug = Ot(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = v({}, (s) => s), this._inputMap = {}, this._id = e && e.id ? e.id : ke(), this._consoleBackgroundColor = e && e.color ? e.color : We, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Pt().then(() => {
|
|
2452
1585
|
this.isDisposed() || (window.addEventListener("message", this.onMessage), this.log("Initialized"));
|
|
2453
1586
|
});
|
|
2454
1587
|
}
|
|
2455
1588
|
isDisposed() {
|
|
2456
1589
|
return this._metaframes === void 0;
|
|
2457
1590
|
}
|
|
2458
|
-
addListenerReturnDisposer(
|
|
2459
|
-
return super.addListener(
|
|
2460
|
-
super.removeListener(
|
|
1591
|
+
addListenerReturnDisposer(e, s) {
|
|
1592
|
+
return super.addListener(e, s), () => {
|
|
1593
|
+
super.removeListener(e, s);
|
|
2461
1594
|
};
|
|
2462
1595
|
}
|
|
2463
1596
|
setDebugFromUrlParams() {
|
|
2464
|
-
|
|
1597
|
+
const e = new URL(window.location.href);
|
|
1598
|
+
return this.debug = ["debug", "mp_debug"].reduce((s, n) => s || e.searchParams.get(n) === "true" || e.searchParams.get(n) === "1", !1), this;
|
|
2465
1599
|
}
|
|
2466
1600
|
getState() {
|
|
2467
1601
|
return this._state;
|
|
2468
1602
|
}
|
|
2469
|
-
setState(
|
|
2470
|
-
|
|
2471
|
-
this.getMetaframe(
|
|
2472
|
-
}), this.
|
|
2473
|
-
this.getPlugin(n).setInputs(this._state.plugins.inputs[n]), this.getPlugin(n).setOutputs(this._state.plugins.outputs[n]);
|
|
2474
|
-
}), this.listenerCount(k.State) > 0) {
|
|
2475
|
-
const n = Z(this._state, (i) => {
|
|
2476
|
-
});
|
|
2477
|
-
this.emit(k.State, n);
|
|
2478
|
-
}
|
|
1603
|
+
setState(e) {
|
|
1604
|
+
this._state = v(e, (s) => s), this.getMetaframeIds().forEach((s) => {
|
|
1605
|
+
this.getMetaframe(s).setInputs(this._state.metaframes.inputs[s]), this.getMetaframe(s).setOutputs(this._state.metaframes.outputs[s]);
|
|
1606
|
+
}), this.listenerCount(d.State) > 0 && this.emit(d.State, this._state);
|
|
2479
1607
|
}
|
|
2480
1608
|
getStateMetaframes() {
|
|
2481
1609
|
return this._state.metaframes;
|
|
@@ -2483,69 +1611,59 @@ class ot extends In {
|
|
|
2483
1611
|
getDefinition() {
|
|
2484
1612
|
return this._definition;
|
|
2485
1613
|
}
|
|
2486
|
-
setDefinition(
|
|
2487
|
-
if (!
|
|
1614
|
+
setDefinition(e, s) {
|
|
1615
|
+
if (!e.version)
|
|
2488
1616
|
throw "Metapage definition must have a version";
|
|
2489
|
-
const
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
if (
|
|
2495
|
-
throw this.emitErrorMessage(`Metaframe "${
|
|
2496
|
-
if (!f.url)
|
|
2497
|
-
throw this.emitErrorMessage(`Metaframe "${c}" missing field: url`), `Metaframe "${c}" missing field: url`;
|
|
1617
|
+
const n = Mt(e);
|
|
1618
|
+
n.metaframes && Object.keys(n.metaframes).forEach((a) => {
|
|
1619
|
+
var r = n.metaframes[a];
|
|
1620
|
+
if (typeof r != "object")
|
|
1621
|
+
throw this.emitErrorMessage(`Metaframe "${a}" is not an object`), `Metaframe "${a}" is not an object`;
|
|
1622
|
+
if (!r.url)
|
|
1623
|
+
throw this.emitErrorMessage(`Metaframe "${a}" missing field: url`), `Metaframe "${a}" missing field: url`;
|
|
2498
1624
|
});
|
|
2499
|
-
const
|
|
2500
|
-
return this._definition =
|
|
2501
|
-
(!
|
|
2502
|
-
}), Object.keys(
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
const f = i.metaframes[c];
|
|
2507
|
-
this.addMetaframe(c, f);
|
|
2508
|
-
}
|
|
2509
|
-
}), i.plugins && i.plugins.forEach((c) => {
|
|
2510
|
-
this._plugins.hasOwnProperty(c) || this.addPlugin(c);
|
|
2511
|
-
}), o !== We && window.setTimeout(() => {
|
|
2512
|
-
if (!this.isDisposed() && i === this._definition && (this._emitDefinitionEvent(), n && this.listenerCount(k.State) > 0)) {
|
|
2513
|
-
const c = Z(this._state, (f) => {
|
|
2514
|
-
});
|
|
2515
|
-
this.emit(k.State, c);
|
|
1625
|
+
const i = this._definition;
|
|
1626
|
+
return this._definition = n, Object.keys(this._metaframes).forEach((a) => {
|
|
1627
|
+
(!n.metaframes || !n.metaframes[a]) && this.removeMetaframe(a);
|
|
1628
|
+
}), s && (this._state = v(s, (a) => a)), n.metaframes && Object.keys(n.metaframes).forEach((a) => {
|
|
1629
|
+
if (!this._metaframes.hasOwnProperty(a)) {
|
|
1630
|
+
const r = n.metaframes[a];
|
|
1631
|
+
this.addMetaframe(a, r);
|
|
2516
1632
|
}
|
|
1633
|
+
}), i !== ie && window.setTimeout(() => {
|
|
1634
|
+
!this.isDisposed() && n === this._definition && (this._emitDefinitionEvent(), s && this.listenerCount(d.State) > 0 && this.emit(d.State, this._state));
|
|
2517
1635
|
}, 0), this;
|
|
2518
1636
|
}
|
|
2519
1637
|
_emitDefinitionEvent() {
|
|
2520
|
-
if (this.listenerCount(
|
|
2521
|
-
const
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
}), i = Z(this._plugins, (c) => {
|
|
2525
|
-
}), o = {
|
|
2526
|
-
definition: t,
|
|
2527
|
-
metaframes: n,
|
|
2528
|
-
plugins: i
|
|
1638
|
+
if (this.listenerCount(d.Definition) > 0) {
|
|
1639
|
+
const e = {
|
|
1640
|
+
definition: this._definition,
|
|
1641
|
+
metaframes: this._metaframes
|
|
2529
1642
|
};
|
|
2530
|
-
this.emit(
|
|
1643
|
+
this.emit(d.Definition, e);
|
|
2531
1644
|
}
|
|
2532
1645
|
}
|
|
2533
|
-
addPipe(
|
|
2534
|
-
this._inputMap
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
this._metaframes[t] && (this._metaframes[t].dispose(), delete this._metaframes[t], delete this._state.metaframes.inputs[t], delete this._state.metaframes.outputs[t], delete this._inputMap[t], Object.keys(this._inputMap).forEach((n) => {
|
|
2538
|
-
const i = this._inputMap[n];
|
|
2539
|
-
let o = 0;
|
|
2540
|
-
for (; o <= i.length; )
|
|
2541
|
-
i[o] && i[o].metaframe === t ? i.splice(o, 1) : o++;
|
|
2542
|
-
}), this._cachedInputLookupMap = {});
|
|
1646
|
+
addPipe(e, s) {
|
|
1647
|
+
this._inputMap = v(this._inputMap, (n) => {
|
|
1648
|
+
n[e] || (n[e] = []), n[e].push(s);
|
|
1649
|
+
});
|
|
2543
1650
|
}
|
|
2544
|
-
|
|
2545
|
-
this.
|
|
1651
|
+
removeMetaframe(e) {
|
|
1652
|
+
this._metaframes[e] && (this._metaframes[e].dispose(), this._metaframes = v(this._metaframes, (s) => {
|
|
1653
|
+
delete s[e];
|
|
1654
|
+
}), this._state = v(this._state, (s) => {
|
|
1655
|
+
delete s.metaframes.inputs[e], delete s.metaframes.outputs[e];
|
|
1656
|
+
}), this._inputMap = v(this._inputMap, (s) => {
|
|
1657
|
+
delete s[e], Object.keys(s).forEach((n) => {
|
|
1658
|
+
const i = s[n];
|
|
1659
|
+
let a = 0;
|
|
1660
|
+
for (; a <= i.length; )
|
|
1661
|
+
i[a] && i[a].metaframe === e ? i.splice(a, 1) : a++;
|
|
1662
|
+
});
|
|
1663
|
+
}), this._cachedInputLookupMap = v({}, (s) => s));
|
|
2546
1664
|
}
|
|
2547
1665
|
removeAll() {
|
|
2548
|
-
Object.keys(this._metaframes).forEach((
|
|
1666
|
+
Object.keys(this._metaframes).forEach((e) => this._metaframes[e].dispose()), this._metaframes = v({}, (e) => e), this._state = Wt(), this._inputMap = v({}, (e) => e), this._cachedInputLookupMap = v({}, (e) => e);
|
|
2549
1667
|
}
|
|
2550
1668
|
metaframes() {
|
|
2551
1669
|
return this.getMetaframes();
|
|
@@ -2557,553 +1675,439 @@ class ot extends In {
|
|
|
2557
1675
|
return Object.keys(this._metaframes);
|
|
2558
1676
|
}
|
|
2559
1677
|
getMetaframes() {
|
|
2560
|
-
return
|
|
2561
|
-
}
|
|
2562
|
-
plugins() {
|
|
2563
|
-
return Object.assign({}, this._plugins);
|
|
2564
|
-
}
|
|
2565
|
-
pluginIds() {
|
|
2566
|
-
return this.getPluginIds();
|
|
2567
|
-
}
|
|
2568
|
-
getPluginIds() {
|
|
2569
|
-
return this._pluginOrder.slice(0);
|
|
1678
|
+
return this._metaframes;
|
|
2570
1679
|
}
|
|
2571
|
-
getMetaframe(
|
|
2572
|
-
return this == null ? void 0 : this._metaframes[
|
|
1680
|
+
getMetaframe(e) {
|
|
1681
|
+
return this == null ? void 0 : this._metaframes[e];
|
|
2573
1682
|
}
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
return (n = this == null ? void 0 : this._plugins) == null ? void 0 : n[t];
|
|
2577
|
-
}
|
|
2578
|
-
addMetaframe(t, n) {
|
|
2579
|
-
if (!t)
|
|
1683
|
+
addMetaframe(e, s) {
|
|
1684
|
+
if (!e)
|
|
2580
1685
|
throw "addMetaframe missing metaframeId";
|
|
2581
|
-
if (!
|
|
1686
|
+
if (!s)
|
|
2582
1687
|
throw "addMetaframe missing definition";
|
|
2583
|
-
if (this._metaframes[
|
|
2584
|
-
throw this.emitErrorMessage(`Existing metaframe for id=${
|
|
2585
|
-
if (!
|
|
2586
|
-
throw this.emitErrorMessage(`Metaframe definition missing url id=${
|
|
2587
|
-
var
|
|
2588
|
-
return this._metaframes
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
1688
|
+
if (this._metaframes[e])
|
|
1689
|
+
throw this.emitErrorMessage(`Existing metaframe for id=${e}`), `Existing metaframe for id=${e}`;
|
|
1690
|
+
if (!s.url)
|
|
1691
|
+
throw this.emitErrorMessage(`Metaframe definition missing url id=${e}`), `Metaframe definition missing url id=${e}`;
|
|
1692
|
+
var n = new Je(this, s.url, e, this._id, this._consoleBackgroundColor, this.debug).setMetapage(this);
|
|
1693
|
+
return this._metaframes = v(this._metaframes, (i) => {
|
|
1694
|
+
i[e] = n;
|
|
1695
|
+
}), n.addListener(d.Error, (i) => {
|
|
1696
|
+
this.emit(d.Error, {
|
|
1697
|
+
metaframeId: n.id,
|
|
1698
|
+
metaframeUrl: n.url,
|
|
1699
|
+
error: i
|
|
2593
1700
|
});
|
|
2594
|
-
}),
|
|
2595
|
-
}
|
|
2596
|
-
addPlugin(t) {
|
|
2597
|
-
if (!t)
|
|
2598
|
-
throw "Plugin missing url";
|
|
2599
|
-
const n = new Pe(this, t, t, this._id, this._consoleBackgroundColor, this.debug).setInputs(this._state.plugins.inputs[t]).setMetapage(this).setPlugin();
|
|
2600
|
-
return Dn(this, n), this._plugins[t] = n, n;
|
|
1701
|
+
}), s.inputs && s.inputs.forEach((i) => this.addPipe(e, i)), n.setInputs(this._state.metaframes.inputs[e]), n;
|
|
2601
1702
|
}
|
|
2602
1703
|
dispose() {
|
|
2603
|
-
this.log("disposing"), super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this._metaframes && Object.keys(this._metaframes).forEach((
|
|
1704
|
+
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;
|
|
2604
1705
|
}
|
|
2605
|
-
log(
|
|
2606
|
-
this.debug && this.logInternal(
|
|
1706
|
+
log(e, s, n) {
|
|
1707
|
+
this.debug && this.logInternal(e, s, n);
|
|
2607
1708
|
}
|
|
2608
|
-
error(
|
|
2609
|
-
this.logInternal(
|
|
1709
|
+
error(e) {
|
|
1710
|
+
this.logInternal(e, "f00", this._consoleBackgroundColor), this.emitErrorMessage(`${e}`);
|
|
2610
1711
|
}
|
|
2611
|
-
emitErrorMessage(
|
|
2612
|
-
this.emit(
|
|
1712
|
+
emitErrorMessage(e) {
|
|
1713
|
+
this.emit(d.Error, e);
|
|
2613
1714
|
}
|
|
2614
|
-
getInputsFromOutput(
|
|
2615
|
-
|
|
1715
|
+
getInputsFromOutput(e, s) {
|
|
1716
|
+
return this._cachedInputLookupMap[e] || (this._cachedInputLookupMap = v(this._cachedInputLookupMap, (n) => {
|
|
1717
|
+
n[e] = v({}, (i) => i);
|
|
1718
|
+
})), this._cachedInputLookupMap[e][s] || (this._cachedInputLookupMap = v(this._cachedInputLookupMap, (n) => {
|
|
2616
1719
|
var i = [];
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
if (
|
|
2620
|
-
var
|
|
2621
|
-
(!
|
|
1720
|
+
n[e][s] = i, Object.keys(this._inputMap).forEach((a) => {
|
|
1721
|
+
a !== e && this._inputMap[a].forEach((r) => {
|
|
1722
|
+
if (r.metaframe === e && Be(s, r.source)) {
|
|
1723
|
+
var o = r.target;
|
|
1724
|
+
(!r.target || r.target.startsWith("*") || r.target === "") && (o = s), i.push({ metaframe: a, pipe: o });
|
|
2622
1725
|
}
|
|
2623
1726
|
});
|
|
2624
1727
|
});
|
|
2625
|
-
}
|
|
2626
|
-
return this._cachedInputLookupMap[t][n];
|
|
1728
|
+
})), this._cachedInputLookupMap[e][s];
|
|
2627
1729
|
}
|
|
2628
|
-
isValidJSONRpcMessage(
|
|
2629
|
-
if (
|
|
1730
|
+
isValidJSONRpcMessage(e) {
|
|
1731
|
+
if (e.jsonrpc !== "2.0")
|
|
2630
1732
|
return !1;
|
|
2631
|
-
switch (
|
|
2632
|
-
case
|
|
1733
|
+
switch (e.method) {
|
|
1734
|
+
case A.SetupIframeClientRequest:
|
|
2633
1735
|
return !0;
|
|
2634
1736
|
default:
|
|
2635
|
-
var
|
|
2636
|
-
return !(
|
|
1737
|
+
var n = e.iframeId;
|
|
1738
|
+
return !(n && !(e.parentId === this._id && this._metaframes[n]));
|
|
2637
1739
|
}
|
|
2638
1740
|
}
|
|
2639
|
-
setInput(
|
|
2640
|
-
|
|
2641
|
-
const o = Z(this._state, (c) => {
|
|
2642
|
-
});
|
|
2643
|
-
this.emit(k.State, o), this.emit(k.Inputs, o);
|
|
2644
|
-
}
|
|
1741
|
+
setInput(e, s, n) {
|
|
1742
|
+
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(d.State) > 0 || this.listenerCount(d.Inputs) > 0) && (this.emit(d.State, this._state), this.emit(d.Inputs, this._state));
|
|
2645
1743
|
}
|
|
2646
|
-
setMetaframeClientInputAndSentClientEvent(
|
|
2647
|
-
if (typeof
|
|
2648
|
-
if (
|
|
1744
|
+
setMetaframeClientInputAndSentClientEvent(e, s, n) {
|
|
1745
|
+
if (typeof e == "object") {
|
|
1746
|
+
if (s || n)
|
|
2649
1747
|
throw "bad arguments, see API docs";
|
|
2650
|
-
const
|
|
2651
|
-
Object.keys(
|
|
2652
|
-
var
|
|
2653
|
-
if (typeof
|
|
1748
|
+
const i = e;
|
|
1749
|
+
Object.keys(i).forEach((a) => {
|
|
1750
|
+
var r = a, o = i[r];
|
|
1751
|
+
if (typeof o != "object")
|
|
2654
1752
|
throw "bad arguments, see API docs";
|
|
2655
|
-
var
|
|
2656
|
-
|
|
1753
|
+
var u = this._metaframes[r];
|
|
1754
|
+
u ? u.setInputs(o) : this.error("No iframe id=$metaframeId");
|
|
2657
1755
|
});
|
|
2658
|
-
} else if (typeof
|
|
2659
|
-
const
|
|
2660
|
-
if (
|
|
2661
|
-
|
|
2662
|
-
else if (typeof
|
|
2663
|
-
|
|
1756
|
+
} else if (typeof e == "string") {
|
|
1757
|
+
const i = this._metaframes[e];
|
|
1758
|
+
if (i == null && this.error(`No iframe id=${e}`), typeof s == "string")
|
|
1759
|
+
i.setInput(s, n);
|
|
1760
|
+
else if (typeof s == "object")
|
|
1761
|
+
i.setInputs(s);
|
|
2664
1762
|
else
|
|
2665
1763
|
throw "bad arguments, see API docs";
|
|
2666
1764
|
} else
|
|
2667
1765
|
throw "bad arguments, see API docs";
|
|
2668
1766
|
}
|
|
2669
|
-
setInputs(
|
|
2670
|
-
this.setInput(
|
|
1767
|
+
setInputs(e, s, n) {
|
|
1768
|
+
this.setInput(e, s, n);
|
|
1769
|
+
}
|
|
1770
|
+
setOutputStateOnlyMetapageInstanceInputs(e) {
|
|
1771
|
+
this._setStateOnlyMetaframes(!1, e);
|
|
1772
|
+
}
|
|
1773
|
+
setOutputStateOnlyMetaframeInputValue(e, s, n) {
|
|
1774
|
+
this._setStateOnlyMetaframeInputValue(!1, e, s, n);
|
|
1775
|
+
}
|
|
1776
|
+
setOutputStateOnlyMetaframeInputMap(e, s) {
|
|
1777
|
+
this._setStateOnlyMetaframeInputMap(!1, e, s);
|
|
2671
1778
|
}
|
|
2672
|
-
|
|
2673
|
-
this.
|
|
1779
|
+
setInputStateOnlyMetapageInstanceInputs(e) {
|
|
1780
|
+
this._setStateOnlyMetaframes(!0, e);
|
|
2674
1781
|
}
|
|
2675
|
-
|
|
2676
|
-
this.
|
|
1782
|
+
setInputStateOnlyMetaframeInputValue(e, s, n) {
|
|
1783
|
+
this._setStateOnlyMetaframeInputValue(!0, e, s, n);
|
|
2677
1784
|
}
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
1785
|
+
setInputStateOnlyMetaframeInputMap(e, s) {
|
|
1786
|
+
this._setStateOnlyMetaframeInputMap(!0, e, s);
|
|
1787
|
+
}
|
|
1788
|
+
_setStateOnlyMetaframeInputValue(e, s, n, i) {
|
|
1789
|
+
this._state = v(this._state, (a) => {
|
|
1790
|
+
if (!this._metaframes.hasOwnProperty(s))
|
|
1791
|
+
throw `No metaframe: ${s}`;
|
|
1792
|
+
a.metaframes || (a.metaframes = { inputs: {}, outputs: {} }), e ? a.metaframes.inputs || (a.metaframes.inputs = {}) : a.metaframes.outputs || (a.metaframes.outputs = {});
|
|
1793
|
+
let o = e ? a.metaframes.inputs : a.metaframes.outputs;
|
|
1794
|
+
o = o || {}, o[s] = o[s] ? o[s] : {}, i === void 0 ? delete o[s][n] : o[s][n] = i;
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
_setStateOnlyMetaframeInputMap(e, s, n) {
|
|
1798
|
+
!n || Object.keys(n).length === 0 || (this._state = v(this._state, (i) => {
|
|
1799
|
+
if (!this._metaframes.hasOwnProperty(s))
|
|
1800
|
+
throw `No metaframe: ${s}`;
|
|
1801
|
+
let r = e ? i.metaframes.inputs : i.metaframes.outputs;
|
|
1802
|
+
r[s] = r[s] ? r[s] : {}, Object.keys(n).forEach((o) => {
|
|
1803
|
+
n[o] === void 0 ? delete r[s][o] : r[s][o] = n[o];
|
|
1804
|
+
});
|
|
1805
|
+
}));
|
|
1806
|
+
}
|
|
1807
|
+
_setStateOnlyMetaframes(e, s) {
|
|
1808
|
+
!s || Object.keys(s).length === 0 || (this._state = v(this._state, (n) => {
|
|
1809
|
+
Object.keys(s).forEach((i) => {
|
|
1810
|
+
var a = s[i];
|
|
1811
|
+
if (typeof a != "object")
|
|
2686
1812
|
throw "Object values must be objects";
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
h[b] === void 0 ? delete y[f][b] : y[f][b] = h[b];
|
|
1813
|
+
if (!this._metaframes.hasOwnProperty(i))
|
|
1814
|
+
throw "No metaframe: ${metaframeId}";
|
|
1815
|
+
const o = e ? n.metaframes.inputs : n.metaframes.outputs;
|
|
1816
|
+
o[i] = o[i] ? o[i] : {}, Object.keys(a).forEach((u) => {
|
|
1817
|
+
a[u] === void 0 ? delete o[i][u] : o[i][u] = a[u];
|
|
2693
1818
|
});
|
|
2694
1819
|
});
|
|
2695
|
-
}
|
|
2696
|
-
const c = n, f = this._metaframes.hasOwnProperty(c);
|
|
2697
|
-
if (!f && !this._plugins.hasOwnProperty(c))
|
|
2698
|
-
throw `No metaframe or plugin: ${c}`;
|
|
2699
|
-
let h = f ? t ? this._state.metaframes.inputs : this._state.metaframes.outputs : t ? this._state.plugins.inputs : this._state.plugins.outputs;
|
|
2700
|
-
if (typeof i == "string") {
|
|
2701
|
-
h = { ...h }, h[c] = h[c] ? h[c] : {};
|
|
2702
|
-
const g = i;
|
|
2703
|
-
o === void 0 ? delete h[c][g] : h[c][g] = o;
|
|
2704
|
-
} else if (typeof i == "object") {
|
|
2705
|
-
h[c] = h[c] ? h[c] : {};
|
|
2706
|
-
const g = i;
|
|
2707
|
-
Object.keys(g).forEach((y) => {
|
|
2708
|
-
g[y] === void 0 ? delete h[c][y] : h[c][y] = g[y];
|
|
2709
|
-
});
|
|
2710
|
-
} else
|
|
2711
|
-
throw "Second argument must be a string or an object";
|
|
2712
|
-
} else
|
|
2713
|
-
throw "First argument must be a string or an object";
|
|
2714
|
-
}
|
|
2715
|
-
getMetaframeOrPlugin(t) {
|
|
2716
|
-
var n = this._metaframes[t];
|
|
2717
|
-
return n || (n = this._plugins[t]), n;
|
|
1820
|
+
}));
|
|
2718
1821
|
}
|
|
2719
|
-
onMessage(
|
|
2720
|
-
if (typeof
|
|
2721
|
-
const
|
|
2722
|
-
if (!this.isValidJSONRpcMessage(
|
|
1822
|
+
onMessage(e) {
|
|
1823
|
+
if (typeof e.data == "object") {
|
|
1824
|
+
const r = e.data;
|
|
1825
|
+
if (!this.isValidJSONRpcMessage(r))
|
|
2723
1826
|
return;
|
|
2724
|
-
var
|
|
2725
|
-
const
|
|
2726
|
-
if (!
|
|
1827
|
+
var s = r.method;
|
|
1828
|
+
const o = r.iframeId;
|
|
1829
|
+
if (!o)
|
|
2727
1830
|
return;
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
1831
|
+
const u = this.getMetaframe(o);
|
|
1832
|
+
if (!u) {
|
|
1833
|
+
this.error(`💥 onMessage no metaframe id=${o}`);
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
switch (r._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(r, null, " ").substring(0, 500)}`), s) {
|
|
1837
|
+
case A.SetupIframeClientRequest:
|
|
1838
|
+
u && u.register();
|
|
2734
1839
|
break;
|
|
2735
|
-
case
|
|
2736
|
-
if (
|
|
2737
|
-
const
|
|
2738
|
-
|
|
1840
|
+
case A.SetupIframeServerResponseAck:
|
|
1841
|
+
if (u) {
|
|
1842
|
+
const c = r.params;
|
|
1843
|
+
u.registered(c.version);
|
|
2739
1844
|
}
|
|
2740
1845
|
break;
|
|
2741
|
-
case
|
|
2742
|
-
const
|
|
2743
|
-
if (this._metaframes[
|
|
2744
|
-
var
|
|
2745
|
-
this.
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
B[S.metaframe] || (B[S.metaframe] = {}), B[S.metaframe][S.pipe] = O[I], this.setInputStateOnly(S.metaframe, S.pipe, O[I]), o = !0;
|
|
1846
|
+
case A.OutputsUpdate:
|
|
1847
|
+
const f = r.params;
|
|
1848
|
+
if (this._metaframes[o]) {
|
|
1849
|
+
var n = this._metaframes[o];
|
|
1850
|
+
this.setOutputStateOnlyMetaframeInputMap(o, f), n.setOutputs(f);
|
|
1851
|
+
var i = !1;
|
|
1852
|
+
const c = Object.keys(f), h = {};
|
|
1853
|
+
c.forEach((l, y) => {
|
|
1854
|
+
const m = this.getInputsFromOutput(o, l);
|
|
1855
|
+
m.length > 0 && m.forEach((I) => {
|
|
1856
|
+
h[I.metaframe] || (h[I.metaframe] = {}), h[I.metaframe][I.pipe] = f[l], i = !0;
|
|
2753
1857
|
});
|
|
2754
|
-
}), Object.keys(
|
|
2755
|
-
this._metaframes[
|
|
2756
|
-
}),
|
|
2757
|
-
})), this.emit(k.State, b)), this.debug && (b || (b = Z(this._state, (I) => {
|
|
2758
|
-
})), i.ack({ jsonrpc: f, state: b }));
|
|
2759
|
-
} else if (this._plugins[h]) {
|
|
2760
|
-
const U = !O[yt] && !O[ct];
|
|
2761
|
-
U && this.setOutputStateOnly(h, O), this._plugins[h].setOutputs(O), U && this.listenerCount(k.State) > 0 && (b || (b = Z(this._state, (B) => {
|
|
2762
|
-
})), this.emit(k.State, b)), this.debug && (b || (b = Z(this._state, (B) => {
|
|
2763
|
-
})), this._plugins[h].ack({
|
|
2764
|
-
jsonrpc: f,
|
|
2765
|
-
state: b
|
|
2766
|
-
}));
|
|
2767
|
-
} else
|
|
2768
|
-
this.error("missing metaframe/plugin=$metaframeId");
|
|
2769
|
-
break;
|
|
2770
|
-
case tt.InputsUpdate:
|
|
2771
|
-
var c = f.params;
|
|
2772
|
-
if (this.debug && this.log(`inputs ${JSON.stringify(c)} from ${h}`), this._metaframes[h])
|
|
2773
|
-
this.setInputStateOnly(h, c), this._metaframes[h].setInputs(c), this.listenerCount(k.State) > 0 && (b || (b = Z(this._state, (U) => {
|
|
2774
|
-
})), this.emit(k.State, b)), this.debug && (b || (b = Z(this._state, (U) => {
|
|
2775
|
-
})), this._metaframes[h].ack({
|
|
2776
|
-
jsonrpc: f,
|
|
2777
|
-
state: b
|
|
2778
|
-
}));
|
|
2779
|
-
else if (this._plugins[h]) {
|
|
2780
|
-
const U = !c[yt] && !c[ct];
|
|
2781
|
-
U && this.setInputStateOnly(h, c), this._plugins[h].setInputs(c), U && this.listenerCount(k.State) > 0 && (b || (b = Z(this._state, (B) => {
|
|
2782
|
-
})), this.emit(k.State, b)), this.debug && (b || (b = Z(this._state, (B) => {
|
|
2783
|
-
})), this._plugins[h].ack({
|
|
2784
|
-
jsonrpc: f,
|
|
2785
|
-
state: b
|
|
2786
|
-
}));
|
|
1858
|
+
}), i && (this.setInputStateOnlyMetapageInstanceInputs(h), Object.keys(h).forEach((l) => {
|
|
1859
|
+
this._metaframes[l].setInputs(h[l]);
|
|
1860
|
+
})), this.listenerCount(d.State) > 0 && this.emit(d.State, this._state), this.debug && n.ack({ jsonrpc: r, state: this._state });
|
|
2787
1861
|
} else
|
|
2788
|
-
|
|
1862
|
+
this.error(`missing metaframe=${o}`);
|
|
2789
1863
|
break;
|
|
2790
|
-
case
|
|
2791
|
-
|
|
1864
|
+
case A.InputsUpdate:
|
|
1865
|
+
var a = r.params;
|
|
1866
|
+
this.debug && this.log(`inputs ${JSON.stringify(a)} from ${o}`), this._metaframes[o] ? (this.setInputStateOnlyMetaframeInputMap(o, a), this._metaframes[o].setInputs(a), this.listenerCount(d.State) > 0 && this.emit(d.State, this._state), this.debug && this._metaframes[o].ack({
|
|
1867
|
+
jsonrpc: r,
|
|
1868
|
+
state: this._state
|
|
1869
|
+
})) : (console.error(`InputsUpdate failed no metaframe id: "${o}"`), this.error(`InputsUpdate failed no metaframe id: "${o}"`));
|
|
2792
1870
|
break;
|
|
2793
|
-
case
|
|
2794
|
-
if (
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2797
|
-
|
|
1871
|
+
case A.HashParamsUpdate:
|
|
1872
|
+
if (u) {
|
|
1873
|
+
const c = r.params, h = new URL(u.url);
|
|
1874
|
+
h.hash = c.hash, u.url = h.href, this._definition = v(this._definition, (l) => {
|
|
1875
|
+
l.metaframes[c.metaframe].url = h.href;
|
|
2798
1876
|
}), this._emitDefinitionEvent();
|
|
2799
1877
|
}
|
|
2800
1878
|
break;
|
|
2801
1879
|
default:
|
|
2802
|
-
this.debug && this.log(`Unknown RPC method: "${
|
|
1880
|
+
this.debug && this.log(`Unknown RPC method: "${s}"`);
|
|
2803
1881
|
}
|
|
2804
|
-
this.listenerCount(
|
|
1882
|
+
this.listenerCount(d.Message) > 0 && this.emit(d.Message, r);
|
|
2805
1883
|
}
|
|
2806
1884
|
}
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
});
|
|
2811
|
-
}
|
|
2812
|
-
logInternal(t, n, i) {
|
|
2813
|
-
i = i || this._consoleBackgroundColor;
|
|
2814
|
-
let o;
|
|
2815
|
-
typeof t == "string" ? o = t : typeof t == "number" ? o = t + "" : o = JSON.stringify(t), o = this._id ? `Metapage[${this._id}] ${o}` : o, he(o, n, i);
|
|
1885
|
+
logInternal(e, s, n) {
|
|
1886
|
+
n = n || this._consoleBackgroundColor;
|
|
1887
|
+
let i;
|
|
1888
|
+
typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), i = this._id ? `Metapage[${this._id}] ${i}` : i, Dt(i, s, n);
|
|
2816
1889
|
}
|
|
2817
1890
|
}
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
});
|
|
2839
|
-
t._disposables.push(n);
|
|
2840
|
-
var i = e.getDefinition();
|
|
2841
|
-
if (i && (t.setInput(ct, i), o.outputs)) {
|
|
2842
|
-
var n = t.onOutput(ct, (f) => {
|
|
2843
|
-
e.listenerCount(k.DefinitionUpdateRequest) > 0 && Ie.sha1(f) !== Ie.sha1(i) && e.emit(k.DefinitionUpdateRequest, f);
|
|
2844
|
-
});
|
|
2845
|
-
t._disposables.push(n);
|
|
2846
|
-
}
|
|
2847
|
-
}
|
|
2848
|
-
if (t.hasPermissionsState() && o.outputs) {
|
|
2849
|
-
var n = t.onOutput(yt, (f) => {
|
|
2850
|
-
e.setState(f);
|
|
2851
|
-
});
|
|
2852
|
-
t._disposables.push(n);
|
|
2853
|
-
}
|
|
2854
|
-
} catch (o) {
|
|
2855
|
-
console.error(o), e.emit(k.Error, `Failed to get plugin definition from "${t.getDefinitionUrl()}", error=${o}`);
|
|
2856
|
-
}
|
|
2857
|
-
}, Ln = (e) => {
|
|
2858
|
-
const t = e._metapage.getDefinition();
|
|
2859
|
-
e.setInput(ct, t);
|
|
2860
|
-
};
|
|
2861
|
-
var gt;
|
|
2862
|
-
(function(e) {
|
|
2863
|
-
e.WaitingForPageLoad = "WaitingForPageLoad", e.SentSetupIframeClientRequest = "SentSetupIframeClientRequest", e.Ready = "Ready";
|
|
2864
|
-
})(gt || (gt = {}));
|
|
2865
|
-
var K;
|
|
2866
|
-
(function(e) {
|
|
2867
|
-
e.Connected = "connected", e.Error = "error", e.Input = "input", e.Inputs = "inputs", e.Message = "message";
|
|
2868
|
-
})(K || (K = {}));
|
|
2869
|
-
class ft extends le.EventEmitter {
|
|
2870
|
-
constructor(t) {
|
|
2871
|
-
if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = gt.WaitingForPageLoad, this._messageSendCount = 0, this.debug = se(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = se(), this._isIframe = vn(), 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.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), !this._isIframe) {
|
|
1891
|
+
P.version = Zt;
|
|
1892
|
+
P.DEFINITION = d.Definition;
|
|
1893
|
+
P.ERROR = d.Error;
|
|
1894
|
+
P.INPUTS = d.Inputs;
|
|
1895
|
+
P.MESSAGE = d.Message;
|
|
1896
|
+
P.OUTPUTS = d.Outputs;
|
|
1897
|
+
P.STATE = d.State;
|
|
1898
|
+
P.deserializeInputs = X;
|
|
1899
|
+
P.serializeInputs = ht;
|
|
1900
|
+
var T;
|
|
1901
|
+
(function(t) {
|
|
1902
|
+
t.WaitingForPageLoad = "WaitingForPageLoad", t.SentSetupIframeClientRequest = "SentSetupIframeClientRequest", t.Ready = "Ready";
|
|
1903
|
+
})(T || (T = {}));
|
|
1904
|
+
var O;
|
|
1905
|
+
(function(t) {
|
|
1906
|
+
t.Connected = "connected", t.Error = "error", t.Input = "input", t.Inputs = "inputs", t.Message = "message";
|
|
1907
|
+
})(O || (O = {}));
|
|
1908
|
+
class D extends Ct.EventEmitter {
|
|
1909
|
+
constructor(e) {
|
|
1910
|
+
if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = T.WaitingForPageLoad, this._messageSendCount = 0, this.debug = Ot(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = Ot(), this._isIframe = Ue(), 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.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), !this._isIframe) {
|
|
2872
1911
|
this.log("Not an iframe, metaframe code disabled");
|
|
2873
1912
|
return;
|
|
2874
1913
|
}
|
|
2875
|
-
const
|
|
2876
|
-
|
|
2877
|
-
this.log("pageLoaded"), window.addEventListener("message", this.onMessage),
|
|
2878
|
-
version:
|
|
2879
|
-
}),
|
|
2880
|
-
}),
|
|
2881
|
-
}
|
|
2882
|
-
_resolveSetupIframeServerResponse(
|
|
2883
|
-
if (this._state ===
|
|
1914
|
+
const s = this;
|
|
1915
|
+
Pt().then(() => {
|
|
1916
|
+
this.log("pageLoaded"), window.addEventListener("message", this.onMessage), s.sendRpc(A.SetupIframeClientRequest, {
|
|
1917
|
+
version: D.version
|
|
1918
|
+
}), s._state = T.SentSetupIframeClientRequest;
|
|
1919
|
+
}), e && e.disableHashChangeEvent || window.addEventListener("hashchange", this._onHashUrlChange);
|
|
1920
|
+
}
|
|
1921
|
+
_resolveSetupIframeServerResponse(e) {
|
|
1922
|
+
if (this._state === T.WaitingForPageLoad)
|
|
2884
1923
|
throw "Got message but page has not finished loading, we should never get in this state";
|
|
2885
|
-
(async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion =
|
|
2886
|
-
version:
|
|
2887
|
-
}), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(
|
|
1924
|
+
(async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color = ue(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 X(e.state.inputs) : this._inputPipeValues = e.state.inputs), this._state = T.Ready, this.sendRpc(A.SetupIframeServerResponseAck, {
|
|
1925
|
+
version: D.version
|
|
1926
|
+
}), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(O.Inputs, this._inputPipeValues), Object.keys(this._inputPipeValues).forEach((s) => this.emit(O.Input, s, this._inputPipeValues[s]))), this.emit(O.Inputs, this._inputPipeValues), this.emit(O.Connected)))();
|
|
2888
1927
|
}
|
|
2889
1928
|
async connected() {
|
|
2890
|
-
if (this._state !==
|
|
2891
|
-
return new Promise((
|
|
2892
|
-
let
|
|
2893
|
-
|
|
2894
|
-
|
|
1929
|
+
if (this._state !== T.Ready)
|
|
1930
|
+
return new Promise((e, s) => {
|
|
1931
|
+
let n;
|
|
1932
|
+
n = this.addListenerReturnDisposer(O.Connected, () => {
|
|
1933
|
+
e(), n();
|
|
2895
1934
|
});
|
|
2896
1935
|
});
|
|
2897
1936
|
}
|
|
2898
|
-
addListenerReturnDisposer(
|
|
2899
|
-
return super.addListener(
|
|
2900
|
-
super.removeListener(
|
|
1937
|
+
addListenerReturnDisposer(e, s) {
|
|
1938
|
+
return super.addListener(e, s), () => {
|
|
1939
|
+
super.removeListener(e, s);
|
|
2901
1940
|
};
|
|
2902
1941
|
}
|
|
2903
|
-
log(
|
|
2904
|
-
this.debug && this.logInternal(
|
|
1942
|
+
log(e, s, n) {
|
|
1943
|
+
this.debug && this.logInternal(e, s || this.color);
|
|
2905
1944
|
}
|
|
2906
|
-
warn(
|
|
2907
|
-
this.debug && this.logInternal(
|
|
1945
|
+
warn(e) {
|
|
1946
|
+
this.debug && this.logInternal(e, "000", this.color);
|
|
2908
1947
|
}
|
|
2909
|
-
error(
|
|
2910
|
-
this.logInternal(
|
|
1948
|
+
error(e) {
|
|
1949
|
+
this.logInternal(e, this.color, "f00");
|
|
2911
1950
|
}
|
|
2912
|
-
logInternal(
|
|
2913
|
-
let
|
|
2914
|
-
typeof
|
|
1951
|
+
logInternal(e, s, n) {
|
|
1952
|
+
let i;
|
|
1953
|
+
typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), s = s && s + "", i = (this.id ? `Metaframe[${this.id}] ` : "") + `${i}`, Dt(i, s, n);
|
|
2915
1954
|
}
|
|
2916
1955
|
dispose() {
|
|
2917
1956
|
super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this.disableNotifyOnHashUrlChange(), this._inputPipeValues = void 0, this._outputPipeValues = void 0;
|
|
2918
1957
|
}
|
|
2919
|
-
addListener(
|
|
2920
|
-
return super.addListener(
|
|
2921
|
-
this._inputPipeValues &&
|
|
1958
|
+
addListener(e, s) {
|
|
1959
|
+
return super.addListener(e, s), e === O.Inputs && window.setTimeout(() => {
|
|
1960
|
+
this._inputPipeValues && s(this._inputPipeValues);
|
|
2922
1961
|
}, 0), this;
|
|
2923
1962
|
}
|
|
2924
|
-
onInput(
|
|
2925
|
-
return this.addListenerReturnDisposer(
|
|
2926
|
-
|
|
1963
|
+
onInput(e, s) {
|
|
1964
|
+
return this.addListenerReturnDisposer(O.Input, (n, i) => {
|
|
1965
|
+
e === n && s(i);
|
|
2927
1966
|
});
|
|
2928
1967
|
}
|
|
2929
|
-
onInputs(
|
|
2930
|
-
return this.addListenerReturnDisposer(
|
|
1968
|
+
onInputs(e) {
|
|
1969
|
+
return this.addListenerReturnDisposer(O.Inputs, e);
|
|
2931
1970
|
}
|
|
2932
|
-
setInput(
|
|
2933
|
-
var
|
|
2934
|
-
|
|
1971
|
+
setInput(e, s) {
|
|
1972
|
+
var n = {};
|
|
1973
|
+
n[e] = s, this.setInputs(n);
|
|
2935
1974
|
}
|
|
2936
|
-
async setInputs(
|
|
2937
|
-
this.isInputOutputBlobSerialization && (
|
|
1975
|
+
async setInputs(e) {
|
|
1976
|
+
this.isInputOutputBlobSerialization && (e = await X(e)), this.sendRpc(A.InputsUpdate, e);
|
|
2938
1977
|
}
|
|
2939
|
-
async setInternalInputsAndNotify(
|
|
2940
|
-
if (this.isInputOutputBlobSerialization && (
|
|
2941
|
-
Object.keys(
|
|
1978
|
+
async setInternalInputsAndNotify(e) {
|
|
1979
|
+
if (this.isInputOutputBlobSerialization && (e = await X(e)), !!ct(this._inputPipeValues, e)) {
|
|
1980
|
+
Object.keys(e).forEach((s) => {
|
|
2942
1981
|
try {
|
|
2943
|
-
this.emit(
|
|
2944
|
-
} catch (
|
|
2945
|
-
console.error(`Error emitting input ${
|
|
1982
|
+
this.emit(O.Input, s, e[s]);
|
|
1983
|
+
} catch (n) {
|
|
1984
|
+
console.error(`Error emitting input ${s}: ${n}`), this.emit(O.Error, `Error emitting input ${s}: ${n}`);
|
|
2946
1985
|
}
|
|
2947
1986
|
});
|
|
2948
1987
|
try {
|
|
2949
|
-
this.emit(
|
|
2950
|
-
} catch (
|
|
2951
|
-
console.error(`Error emitting inputs: ${
|
|
1988
|
+
this.emit(O.Inputs, e);
|
|
1989
|
+
} catch (s) {
|
|
1990
|
+
console.error(`Error emitting inputs: ${s}`), this.emit(O.Error, `Error emitting inputs: ${s}`);
|
|
2952
1991
|
}
|
|
2953
1992
|
}
|
|
2954
1993
|
}
|
|
2955
|
-
getInput(
|
|
2956
|
-
return console.assert(!!
|
|
1994
|
+
getInput(e) {
|
|
1995
|
+
return console.assert(!!e), this._inputPipeValues[e];
|
|
2957
1996
|
}
|
|
2958
1997
|
getInputs() {
|
|
2959
1998
|
return this._inputPipeValues;
|
|
2960
1999
|
}
|
|
2961
|
-
setOutput(
|
|
2962
|
-
console.assert(!!
|
|
2963
|
-
var
|
|
2964
|
-
|
|
2000
|
+
setOutput(e, s) {
|
|
2001
|
+
console.assert(!!e);
|
|
2002
|
+
var n = {};
|
|
2003
|
+
n[e] = s, this.setOutputs(n);
|
|
2965
2004
|
}
|
|
2966
|
-
async setOutputs(
|
|
2967
|
-
this.isInputOutputBlobSerialization && (
|
|
2005
|
+
async setOutputs(e) {
|
|
2006
|
+
this.isInputOutputBlobSerialization && (e = await ht(e)), ct(this._outputPipeValues, e) && this.sendRpc(A.OutputsUpdate, e);
|
|
2968
2007
|
}
|
|
2969
2008
|
disableNotifyOnHashUrlChange() {
|
|
2970
2009
|
window.removeEventListener("hashchange", this._onHashUrlChange);
|
|
2971
2010
|
}
|
|
2972
|
-
_onHashUrlChange(
|
|
2973
|
-
const
|
|
2011
|
+
_onHashUrlChange(e) {
|
|
2012
|
+
const s = {
|
|
2974
2013
|
hash: window.location.hash,
|
|
2975
2014
|
metaframe: this.id
|
|
2976
2015
|
};
|
|
2977
|
-
this.sendRpc(
|
|
2016
|
+
this.sendRpc(A.HashParamsUpdate, s);
|
|
2978
2017
|
}
|
|
2979
|
-
sendRpc(
|
|
2018
|
+
sendRpc(e, s) {
|
|
2980
2019
|
if (this._isIframe) {
|
|
2981
|
-
const
|
|
2020
|
+
const n = {
|
|
2982
2021
|
jsonrpc: "2.0",
|
|
2983
2022
|
id: ++this._messageSendCount,
|
|
2984
|
-
method:
|
|
2985
|
-
params:
|
|
2023
|
+
method: e,
|
|
2024
|
+
params: s,
|
|
2986
2025
|
iframeId: this.id,
|
|
2987
2026
|
parentId: this._parentId
|
|
2988
2027
|
};
|
|
2989
|
-
window.parent && window.parent.postMessage(
|
|
2028
|
+
window.parent && window.parent.postMessage(n, "*");
|
|
2990
2029
|
} else
|
|
2991
2030
|
this.log("Cannot send JSON-RPC window message: there is no window.parent which means we are not an iframe");
|
|
2992
2031
|
}
|
|
2993
|
-
onMessage(
|
|
2994
|
-
if (typeof
|
|
2995
|
-
let
|
|
2996
|
-
if (
|
|
2997
|
-
var
|
|
2998
|
-
if (!(
|
|
2999
|
-
this.log(`window.message: received message but jsonrpc.parentId=${
|
|
2032
|
+
onMessage(e) {
|
|
2033
|
+
if (typeof e.data == "object") {
|
|
2034
|
+
let n = e.data;
|
|
2035
|
+
if (n.jsonrpc === "2.0") {
|
|
2036
|
+
var s = n.method;
|
|
2037
|
+
if (!(s == $.SetupIframeServerResponse || n.parentId == this._parentId && n.iframeId == this.id)) {
|
|
2038
|
+
this.log(`window.message: received message but jsonrpc.parentId=${n.parentId} _parentId=${this._parentId} jsonrpc.iframeId=${n.iframeId} id=${this.id}`);
|
|
3000
2039
|
return;
|
|
3001
2040
|
}
|
|
3002
|
-
switch (
|
|
3003
|
-
case
|
|
3004
|
-
this._resolveSetupIframeServerResponse(
|
|
2041
|
+
switch (s) {
|
|
2042
|
+
case $.SetupIframeServerResponse:
|
|
2043
|
+
this._resolveSetupIframeServerResponse(n.params);
|
|
3005
2044
|
break;
|
|
3006
|
-
case
|
|
3007
|
-
if (this._state !==
|
|
2045
|
+
case $.InputsUpdate:
|
|
2046
|
+
if (this._state !== T.Ready)
|
|
3008
2047
|
throw "Got InputsUpdate but metaframe is not MetaframeLoadingState.Ready";
|
|
3009
|
-
this.setInternalInputsAndNotify(
|
|
2048
|
+
this.setInternalInputsAndNotify(n.params.inputs);
|
|
3010
2049
|
break;
|
|
3011
|
-
case
|
|
3012
|
-
this.debug && this.log(`ACK: ${JSON.stringify(
|
|
2050
|
+
case $.MessageAck:
|
|
2051
|
+
this.debug && this.log(`ACK: ${JSON.stringify(n)}`);
|
|
3013
2052
|
break;
|
|
3014
2053
|
default:
|
|
3015
|
-
this.debug && this.log(`window.message: unknown JSON-RPC method: ${JSON.stringify(
|
|
2054
|
+
this.debug && this.log(`window.message: unknown JSON-RPC method: ${JSON.stringify(n)}`);
|
|
3016
2055
|
break;
|
|
3017
2056
|
}
|
|
3018
|
-
this.emit(
|
|
2057
|
+
this.emit(O.Message, n);
|
|
3019
2058
|
}
|
|
3020
2059
|
}
|
|
3021
2060
|
}
|
|
3022
2061
|
}
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
class Un {
|
|
3032
|
-
constructor(t) {
|
|
3033
|
-
this._metaframe = t, this.requestState = this.requestState.bind(this), this.onState = this.onState.bind(this), this.getState = this.getState.bind(this), this.setState = this.setState.bind(this), this.onDefinition = this.onDefinition.bind(this), this.getDefinition = this.getDefinition.bind(this), this.setDefinition = this.setDefinition.bind(this);
|
|
3034
|
-
}
|
|
3035
|
-
requestState() {
|
|
3036
|
-
var t = {
|
|
3037
|
-
method: ne.State
|
|
3038
|
-
};
|
|
3039
|
-
this._metaframe.sendRpc(tt.PluginRequest, t);
|
|
3040
|
-
}
|
|
3041
|
-
onState(t) {
|
|
3042
|
-
const n = this._metaframe.onInput(yt, t);
|
|
3043
|
-
return this.getState() && t(this.getState()), n;
|
|
3044
|
-
}
|
|
3045
|
-
getState() {
|
|
3046
|
-
return this._metaframe.getInput(yt);
|
|
3047
|
-
}
|
|
3048
|
-
setState(t) {
|
|
3049
|
-
this._metaframe.setOutput(yt, t);
|
|
3050
|
-
}
|
|
3051
|
-
onDefinition(t) {
|
|
3052
|
-
var n = this._metaframe.onInput(ct, t);
|
|
3053
|
-
return this.getDefinition() && t(this.getDefinition()), n;
|
|
3054
|
-
}
|
|
3055
|
-
setDefinition(t) {
|
|
3056
|
-
this._metaframe.setOutput(ct, t);
|
|
3057
|
-
}
|
|
3058
|
-
getDefinition() {
|
|
3059
|
-
return this._metaframe.getInput(ct);
|
|
3060
|
-
}
|
|
3061
|
-
}
|
|
2062
|
+
D.version = Se;
|
|
2063
|
+
D.ERROR = O.Error;
|
|
2064
|
+
D.CONNECTED = O.Connected;
|
|
2065
|
+
D.INPUT = O.Input;
|
|
2066
|
+
D.INPUTS = O.Inputs;
|
|
2067
|
+
D.MESSAGE = O.Message;
|
|
2068
|
+
D.deserializeInputs = X;
|
|
2069
|
+
D.serializeInputs = ht;
|
|
3062
2070
|
export {
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
mn as possiblyDeserializeDatarefToValue,
|
|
3105
|
-
dn as possiblySerializeValueToDataref,
|
|
3106
|
-
Jt as serializeInputs,
|
|
3107
|
-
Ke as stringToRgb
|
|
2071
|
+
ie as INITIAL_NULL_METAPAGE_DEFINITION,
|
|
2072
|
+
A as JsonRpcMethodsFromChild,
|
|
2073
|
+
$ as JsonRpcMethodsFromParent,
|
|
2074
|
+
D as Metaframe,
|
|
2075
|
+
O as MetaframeEvents,
|
|
2076
|
+
T as MetaframeLoadingState,
|
|
2077
|
+
He as MetaframeVersionCurrent,
|
|
2078
|
+
Vt as MetaframeVersionsAll,
|
|
2079
|
+
P as Metapage,
|
|
2080
|
+
Tt as MetapageEvents,
|
|
2081
|
+
Z as MetapageHashParams,
|
|
2082
|
+
Je as MetapageIFrameRpcClient,
|
|
2083
|
+
$e as MetapageShared,
|
|
2084
|
+
Y as MetapageVersionCurrent,
|
|
2085
|
+
xt as MetapageVersionsAll,
|
|
2086
|
+
re as convertMetaframeJsonToCurrentVersion,
|
|
2087
|
+
Mt as convertMetapageDefinitionToCurrentVersion,
|
|
2088
|
+
X as deserializeInputs,
|
|
2089
|
+
jt as generateId,
|
|
2090
|
+
Ge as generateMetaframeId,
|
|
2091
|
+
ke as generateMetapageId,
|
|
2092
|
+
Ye as generateNonce,
|
|
2093
|
+
Ze as getLibraryVersionMatching,
|
|
2094
|
+
ae as getMatchingVersion,
|
|
2095
|
+
qe as getUrlParam,
|
|
2096
|
+
Ke as getUrlParamDebug,
|
|
2097
|
+
Ne as hashCode,
|
|
2098
|
+
Fe as intToRGB,
|
|
2099
|
+
Ot as isDebugFromUrlsParams,
|
|
2100
|
+
Ue as isIframe,
|
|
2101
|
+
dt as isPageLoaded,
|
|
2102
|
+
Dt as log,
|
|
2103
|
+
Be as matchPipe,
|
|
2104
|
+
ct as merge,
|
|
2105
|
+
Xe as metapageAllSha256Hash,
|
|
2106
|
+
Qe as metapageOnlyEssentailSha256Hash,
|
|
2107
|
+
Pt as pageLoaded,
|
|
2108
|
+
Ee as possiblyDeserializeDatarefToValue,
|
|
2109
|
+
Re as possiblySerializeValueToDataref,
|
|
2110
|
+
ht as serializeInputs,
|
|
2111
|
+
ue as stringToRgb
|
|
3108
2112
|
};
|
|
3109
2113
|
//# sourceMappingURL=index.js.map
|