@marimo-team/islands 0.13.16-dev10 → 0.13.16-dev101
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/{ConnectedDataExplorerComponent-A7fdApN8.js → ConnectedDataExplorerComponent-CXakwumf.js} +252 -253
- package/dist/ImageComparisonComponent-CHsi_5dR.js +248 -0
- package/dist/{VegaLite-cH0d7AKe.js → VegaLite-CyRNIzn6.js} +11085 -11380
- package/dist/{_baseUniq-VGkfS0ac.js → _baseUniq-CrN-wpGh.js} +1 -1
- package/dist/{any-language-editor-zP_MHtqz.js → any-language-editor-zxRjTZVZ.js} +15 -15
- package/dist/{architectureDiagram-IEHRJDOE-9bzqI9xU.js → architectureDiagram-IEHRJDOE-DLDOHzzx.js} +5 -5
- package/dist/assets/{save-worker-DwN_qfSx.js → save-worker-CtVuV4Hi.js} +471 -470
- package/dist/assets/{worker-BzMPE1Lq.js → worker-BU1a2jgP.js} +406 -405
- package/dist/assets/{worker-ISYYr8IB.js → worker-Tb399Bgs.js} +3430 -3428
- package/dist/{blockDiagram-JOT3LUYC-BJAMR_en.js → blockDiagram-JOT3LUYC-DrDD3Oa1.js} +4 -4
- package/dist/{c4Diagram-VJAJSXHY-BgKfLoA5.js → c4Diagram-VJAJSXHY-MowbawnJ.js} +2 -2
- package/dist/{channel-JUB4CnY6.js → channel-9b6EGbeS.js} +1 -1
- package/dist/{chunk-4BMEZGHF-DeJtdwCO.js → chunk-4BMEZGHF-ldyoLG6i.js} +1 -1
- package/dist/{chunk-A2AXSNBT-C9Pp_tIO.js → chunk-A2AXSNBT-BoPlSbb2.js} +2 -2
- package/dist/{chunk-AEK57VVT-DVA0-Gak.js → chunk-AEK57VVT-yYPlFzSh.js} +2 -2
- package/dist/{chunk-D6G4REZN-AoVGIQ0P.js → chunk-D6G4REZN-BUfQYyiO.js} +1 -1
- package/dist/{chunk-RZ5BOZE2-DP2jcZaE.js → chunk-RZ5BOZE2-C-dlhwEX.js} +1 -1
- package/dist/{chunk-XZIHB7SX-i32Q4Gjs.js → chunk-XZIHB7SX-drMwzTzE.js} +1 -1
- package/dist/{classDiagram-GIVACNV2-inGz81ig.js → classDiagram-GIVACNV2-B_Tfvd3c.js} +2 -2
- package/dist/{classDiagram-v2-COTLJTTW-inGz81ig.js → classDiagram-v2-COTLJTTW-B_Tfvd3c.js} +2 -2
- package/dist/{clone-1JkOwsMD.js → clone-BW-4yG65.js} +1 -1
- package/dist/{dagre-OKDRZEBW-D0K43h5Z.js → dagre-OKDRZEBW-D_mGL0zZ.js} +6 -6
- package/dist/{data-editor-BFIc09s8.js → data-editor-CVrtr7tJ.js} +1 -1
- package/dist/{diagram-SSKATNLV--ZKj5ozg.js → diagram-SSKATNLV-BKZ6pRj5.js} +3 -3
- package/dist/{diagram-VNBRO52H-l9MGj2bj.js → diagram-VNBRO52H-CwbHMIYw.js} +3 -3
- package/dist/{erDiagram-Q7BY3M3F-CToy4jJO.js → erDiagram-Q7BY3M3F-BVBIZSV3.js} +3 -3
- package/dist/{flowDiagram-4HSFHLVR-DPXjhssW.js → flowDiagram-4HSFHLVR-62b_P_o9.js} +3 -3
- package/dist/{ganttDiagram-APWFNJXF-BCg0UNz5.js → ganttDiagram-APWFNJXF-Hoxlq0Jl.js} +4 -4
- package/dist/{gitGraphDiagram-7IBYFJ6S-T865D8lM.js → gitGraphDiagram-7IBYFJ6S-DwVHGow9.js} +4 -4
- package/dist/{graph-Dh5RCoo-.js → graph-Bll7YfM8.js} +3 -3
- package/dist/{index-BQdo5ytW.js → index-Dnn1T153.js} +3 -3
- package/dist/{index-BWKSupvt.js → index-Q2DOv1hL.js} +1 -1
- package/dist/{index-B96oNQ4E.js → index-cgPKgVm9.js} +15 -15
- package/dist/{index-DovrtkqJ.js → index-uqQxG-YV.js} +1 -1
- package/dist/{infoDiagram-PH2N3AL5-D4bq4naO.js → infoDiagram-PH2N3AL5-BU4PZemj.js} +2 -2
- package/dist/{journeyDiagram-U35MCT3I-DMPNH8T3.js → journeyDiagram-U35MCT3I-0Vy-PR_z.js} +2 -2
- package/dist/{kanban-definition-NDS4AKOZ-DeQvOmMv.js → kanban-definition-NDS4AKOZ-CU3rew6m.js} +1 -1
- package/dist/{layout--Y05TO_e.js → layout-CNmu8kTe.js} +4 -4
- package/dist/{linear-m2dqs0Bo.js → linear-CtjM0VX6.js} +1 -1
- package/dist/{main-D5eHkxiP.js → main-BKFOpkWC.js} +143549 -145203
- package/dist/main.js +1 -1
- package/dist/{mermaid-DQHS9Tyo.js → mermaid-BiFRk7fS.js} +274 -274
- package/dist/{min-5Jyzc0Gu.js → min-Beq8rsty.js} +2 -2
- package/dist/{mindmap-definition-ALO5MXBD-J2fSs--m.js → mindmap-definition-ALO5MXBD-DdZ2dNd4.js} +2 -2
- package/dist/{pieDiagram-IB7DONF6-CnRqJ6qw.js → pieDiagram-IB7DONF6-7WzESgCy.js} +3 -3
- package/dist/{quadrantDiagram-7GDLP6J5-DU1mM55g.js → quadrantDiagram-7GDLP6J5-BDSHfjh4.js} +2 -2
- package/dist/{radar-MK3ICKWK-C8KCYibk.js → radar-MK3ICKWK-_buuYrUT.js} +5 -5
- package/dist/{react-plotly-CYVkXG9F.js → react-plotly-CeF1Yey8.js} +1 -1
- package/dist/{requirementDiagram-KVF5MWMF-B-hCcu3Q.js → requirementDiagram-KVF5MWMF-CC1WjxAh.js} +2 -2
- package/dist/{sankeyDiagram-QLVOVGJD-DpAHW2rB.js → sankeyDiagram-QLVOVGJD-PSDF9xf8.js} +1 -1
- package/dist/{sequenceDiagram-X6HHIX6F-BM3qubVZ.js → sequenceDiagram-X6HHIX6F-wL9XrWSn.js} +3 -3
- package/dist/{slides-component-xKVgBacc.js → slides-component-CRcSvXKv.js} +3223 -3223
- package/dist/{stateDiagram-DGXRK772-BVRyX2q1.js → stateDiagram-DGXRK772-kYO_59RM.js} +4 -4
- package/dist/{stateDiagram-v2-YXO3MK2T-CYUvPmam.js → stateDiagram-v2-YXO3MK2T-BBTbrBHT.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{time-B6BhXG57.js → time-exdFVpJD.js} +2 -2
- package/dist/{timeline-definition-BDJGKUSR-C_PK56hq.js → timeline-definition-BDJGKUSR-CN8nBucr.js} +1 -1
- package/dist/{vega-component-DV9kb7Lh.js → vega-component-DUACooAT.js} +38 -38
- package/dist/{xychartDiagram-VJFVF3MP-B9Zwahd0.js → xychartDiagram-VJFVF3MP-6PE9WpyO.js} +2 -2
- package/package.json +26 -26
|
@@ -1,5 +1,240 @@
|
|
|
1
1
|
var pr = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
2
2
|
var rs = pr((as, mt) => {
|
|
3
|
+
const hr = 1e10, mr = 1e3;
|
|
4
|
+
function Me(t, e) {
|
|
5
|
+
const r = t.map((n) => `"${n}"`).join(", ");
|
|
6
|
+
return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
|
|
7
|
+
}
|
|
8
|
+
function yr(t = {}) {
|
|
9
|
+
let e = {};
|
|
10
|
+
function r(g) {
|
|
11
|
+
e = g;
|
|
12
|
+
}
|
|
13
|
+
let n = {};
|
|
14
|
+
function s(g) {
|
|
15
|
+
n.unregisterHandler && n.unregisterHandler(), n = g, n.registerHandler?.(fr);
|
|
16
|
+
}
|
|
17
|
+
let a;
|
|
18
|
+
function i(g) {
|
|
19
|
+
if (typeof g == "function") {
|
|
20
|
+
a = g;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
a = (T, E) => {
|
|
24
|
+
const N = g[T];
|
|
25
|
+
if (N)
|
|
26
|
+
return N(E);
|
|
27
|
+
const $ = g._;
|
|
28
|
+
if (!$)
|
|
29
|
+
throw new Error(`The requested method has no handler: ${T}`);
|
|
30
|
+
return $(T, E);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const { maxRequestTime: o = mr } = t;
|
|
34
|
+
t.transport && s(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
35
|
+
let d = 0;
|
|
36
|
+
function c() {
|
|
37
|
+
return d <= hr ? ++d : d = 0;
|
|
38
|
+
}
|
|
39
|
+
const l = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
40
|
+
function x(g, ...T) {
|
|
41
|
+
const E = T[0];
|
|
42
|
+
return new Promise((N, $) => {
|
|
43
|
+
if (!n.send)
|
|
44
|
+
throw Me(["send"], "make requests");
|
|
45
|
+
const H = c(), kt = {
|
|
46
|
+
type: "request",
|
|
47
|
+
id: H,
|
|
48
|
+
method: g,
|
|
49
|
+
params: E
|
|
50
|
+
};
|
|
51
|
+
l.set(H, { resolve: N, reject: $ }), o !== 1 / 0 && w.set(H, setTimeout(() => {
|
|
52
|
+
w.delete(H), $(new Error("RPC request timed out."));
|
|
53
|
+
}, o)), e.onSend?.(kt), n.send(kt);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const A = new Proxy(x, {
|
|
57
|
+
get: (g, T, E) => T in g ? Reflect.get(g, T, E) : (N) => x(T, N)
|
|
58
|
+
}), V = A;
|
|
59
|
+
function Fe(g, ...T) {
|
|
60
|
+
const E = T[0];
|
|
61
|
+
if (!n.send)
|
|
62
|
+
throw Me(["send"], "send messages");
|
|
63
|
+
const N = {
|
|
64
|
+
type: "message",
|
|
65
|
+
id: g,
|
|
66
|
+
payload: E
|
|
67
|
+
};
|
|
68
|
+
e.onSend?.(N), n.send(N);
|
|
69
|
+
}
|
|
70
|
+
const wt = new Proxy(Fe, {
|
|
71
|
+
get: (g, T, E) => T in g ? Reflect.get(g, T, E) : (N) => Fe(T, N)
|
|
72
|
+
}), bt = wt, X = /* @__PURE__ */ new Map(), et = /* @__PURE__ */ new Set();
|
|
73
|
+
function ur(g, T) {
|
|
74
|
+
if (!n.registerHandler)
|
|
75
|
+
throw Me(["registerHandler"], "register message listeners");
|
|
76
|
+
if (g === "*") {
|
|
77
|
+
et.add(T);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
X.has(g) || X.set(g, /* @__PURE__ */ new Set()), X.get(g)?.add(T);
|
|
81
|
+
}
|
|
82
|
+
function lr(g, T) {
|
|
83
|
+
if (g === "*") {
|
|
84
|
+
et.delete(T);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
X.get(g)?.delete(T), X.get(g)?.size === 0 && X.delete(g);
|
|
88
|
+
}
|
|
89
|
+
async function fr(g) {
|
|
90
|
+
if (e.onReceive?.(g), !("type" in g))
|
|
91
|
+
throw new Error("Message does not contain a type.");
|
|
92
|
+
if (g.type === "request") {
|
|
93
|
+
if (!n.send || !a)
|
|
94
|
+
throw Me(["send", "requestHandler"], "handle requests");
|
|
95
|
+
const { id: T, method: E, params: N } = g;
|
|
96
|
+
let $;
|
|
97
|
+
try {
|
|
98
|
+
$ = {
|
|
99
|
+
type: "response",
|
|
100
|
+
id: T,
|
|
101
|
+
success: !0,
|
|
102
|
+
payload: await a(E, N)
|
|
103
|
+
};
|
|
104
|
+
} catch (H) {
|
|
105
|
+
if (!(H instanceof Error))
|
|
106
|
+
throw H;
|
|
107
|
+
$ = {
|
|
108
|
+
type: "response",
|
|
109
|
+
id: T,
|
|
110
|
+
success: !1,
|
|
111
|
+
error: H.message
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
e.onSend?.($), n.send($);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (g.type === "response") {
|
|
118
|
+
const T = w.get(g.id);
|
|
119
|
+
T != null && clearTimeout(T);
|
|
120
|
+
const { resolve: E, reject: N } = l.get(g.id) ?? {};
|
|
121
|
+
g.success ? E?.(g.payload) : N?.(new Error(g.error));
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (g.type === "message") {
|
|
125
|
+
for (const E of et)
|
|
126
|
+
E(g.id, g.payload);
|
|
127
|
+
const T = X.get(g.id);
|
|
128
|
+
if (!T)
|
|
129
|
+
return;
|
|
130
|
+
for (const E of T)
|
|
131
|
+
E(g.payload);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
throw new Error(`Unexpected RPC message type: ${g.type}`);
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
setTransport: s,
|
|
138
|
+
setRequestHandler: i,
|
|
139
|
+
request: A,
|
|
140
|
+
requestProxy: V,
|
|
141
|
+
send: wt,
|
|
142
|
+
sendProxy: bt,
|
|
143
|
+
addMessageListener: ur,
|
|
144
|
+
removeMessageListener: lr,
|
|
145
|
+
proxy: { send: bt, request: V },
|
|
146
|
+
_setDebugHooks: r
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function gr(t) {
|
|
150
|
+
return yr(t);
|
|
151
|
+
}
|
|
152
|
+
const Nt = "[transport-id]";
|
|
153
|
+
function vr(t, e) {
|
|
154
|
+
const { transportId: r } = e;
|
|
155
|
+
return r != null ? { [Nt]: r, data: t } : t;
|
|
156
|
+
}
|
|
157
|
+
function _r(t, e) {
|
|
158
|
+
const { transportId: r, filter: n } = e, s = n?.();
|
|
159
|
+
if (r != null && s != null)
|
|
160
|
+
throw new Error("Cannot use both `transportId` and `filter` at the same time");
|
|
161
|
+
let a = t;
|
|
162
|
+
if (r) {
|
|
163
|
+
if (t[Nt] !== r)
|
|
164
|
+
return [!0];
|
|
165
|
+
a = t.data;
|
|
166
|
+
}
|
|
167
|
+
return s === !1 ? [!0] : [!1, a];
|
|
168
|
+
}
|
|
169
|
+
function wr(t, e = {}) {
|
|
170
|
+
const { transportId: r, filter: n, remotePort: s } = e, a = t, i = s ?? t;
|
|
171
|
+
let o;
|
|
172
|
+
return {
|
|
173
|
+
send(d) {
|
|
174
|
+
i.postMessage(vr(d, { transportId: r }));
|
|
175
|
+
},
|
|
176
|
+
registerHandler(d) {
|
|
177
|
+
o = (c) => {
|
|
178
|
+
const l = c.data, [w, x] = _r(l, {
|
|
179
|
+
transportId: r,
|
|
180
|
+
filter: () => n?.(c)
|
|
181
|
+
});
|
|
182
|
+
w || d(x);
|
|
183
|
+
}, a.addEventListener("message", o);
|
|
184
|
+
},
|
|
185
|
+
unregisterHandler() {
|
|
186
|
+
o && a.removeEventListener("message", o);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function br(t) {
|
|
191
|
+
return wr(self, t);
|
|
192
|
+
}
|
|
193
|
+
const ye = {
|
|
194
|
+
NOOP: () => {
|
|
195
|
+
}
|
|
196
|
+
}, Rt = (t, e) => {
|
|
197
|
+
const r = `[${t}]`;
|
|
198
|
+
return {
|
|
199
|
+
debug: (...n) => e.debug(r, ...n),
|
|
200
|
+
log: (...n) => e.log(r, ...n),
|
|
201
|
+
warn: (...n) => e.warn(r, ...n),
|
|
202
|
+
error: (...n) => e.error(r, ...n),
|
|
203
|
+
trace: (...n) => e.trace(r, ...n),
|
|
204
|
+
get: (n) => Rt(`${t}.${n}`, e),
|
|
205
|
+
disabled: (n = !0) => n ? Ue : e
|
|
206
|
+
};
|
|
207
|
+
}, Ve = {
|
|
208
|
+
debug: (...t) => {
|
|
209
|
+
console.debug(...t);
|
|
210
|
+
},
|
|
211
|
+
log: (...t) => {
|
|
212
|
+
console.log(...t);
|
|
213
|
+
},
|
|
214
|
+
warn: (...t) => {
|
|
215
|
+
console.warn(...t);
|
|
216
|
+
},
|
|
217
|
+
error: (...t) => {
|
|
218
|
+
console.error(...t);
|
|
219
|
+
},
|
|
220
|
+
trace: (...t) => {
|
|
221
|
+
console.trace(...t);
|
|
222
|
+
},
|
|
223
|
+
get: (t) => Rt(t, Ve),
|
|
224
|
+
disabled: (t = !0) => t ? Ue : Ve
|
|
225
|
+
}, Ue = {
|
|
226
|
+
debug: () => ye.NOOP,
|
|
227
|
+
log: () => ye.NOOP,
|
|
228
|
+
warn: () => ye.NOOP,
|
|
229
|
+
error: () => ye.NOOP,
|
|
230
|
+
trace: () => ye.NOOP,
|
|
231
|
+
get: () => Ue,
|
|
232
|
+
disabled: () => Ue
|
|
233
|
+
};
|
|
234
|
+
function kr() {
|
|
235
|
+
return typeof window < "u" && window.Logger || Ve;
|
|
236
|
+
}
|
|
237
|
+
const _e = kr(), st = (t) => new TextDecoder().decode(t);
|
|
3
238
|
var b;
|
|
4
239
|
(function(t) {
|
|
5
240
|
t.assertEqual = (s) => s;
|
|
@@ -36,14 +271,14 @@ var rs = pr((as, mt) => {
|
|
|
36
271
|
}
|
|
37
272
|
t.joinValues = n, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
38
273
|
})(b || (b = {}));
|
|
39
|
-
var
|
|
274
|
+
var at;
|
|
40
275
|
(function(t) {
|
|
41
276
|
t.mergeShapes = (e, r) => ({
|
|
42
277
|
...e,
|
|
43
278
|
...r
|
|
44
279
|
// second overwrites first
|
|
45
280
|
});
|
|
46
|
-
})(
|
|
281
|
+
})(at || (at = {}));
|
|
47
282
|
const p = b.arrayToEnum([
|
|
48
283
|
"string",
|
|
49
284
|
"nan",
|
|
@@ -103,7 +338,7 @@ var rs = pr((as, mt) => {
|
|
|
103
338
|
"invalid_intersection_types",
|
|
104
339
|
"not_multiple_of",
|
|
105
340
|
"not_finite"
|
|
106
|
-
]),
|
|
341
|
+
]), xr = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
107
342
|
class C extends Error {
|
|
108
343
|
get errors() {
|
|
109
344
|
return this.issues;
|
|
@@ -220,14 +455,14 @@ var rs = pr((as, mt) => {
|
|
|
220
455
|
}
|
|
221
456
|
return { message: r };
|
|
222
457
|
};
|
|
223
|
-
let
|
|
224
|
-
function
|
|
225
|
-
|
|
458
|
+
let At = pe;
|
|
459
|
+
function Tr(t) {
|
|
460
|
+
At = t;
|
|
226
461
|
}
|
|
227
|
-
function
|
|
228
|
-
return
|
|
462
|
+
function ze() {
|
|
463
|
+
return At;
|
|
229
464
|
}
|
|
230
|
-
const
|
|
465
|
+
const qe = (t) => {
|
|
231
466
|
const { data: e, path: r, errorMaps: n, issueData: s } = t, a = [...r, ...s.path || []], i = {
|
|
232
467
|
...s,
|
|
233
468
|
path: a
|
|
@@ -247,9 +482,9 @@ var rs = pr((as, mt) => {
|
|
|
247
482
|
path: a,
|
|
248
483
|
message: o
|
|
249
484
|
};
|
|
250
|
-
},
|
|
485
|
+
}, Sr = [];
|
|
251
486
|
function f(t, e) {
|
|
252
|
-
const r =
|
|
487
|
+
const r = ze(), n = qe({
|
|
253
488
|
issueData: e,
|
|
254
489
|
data: t.data,
|
|
255
490
|
path: t.path,
|
|
@@ -309,12 +544,12 @@ var rs = pr((as, mt) => {
|
|
|
309
544
|
}
|
|
310
545
|
const y = Object.freeze({
|
|
311
546
|
status: "aborted"
|
|
312
|
-
}), le = (t) => ({ status: "dirty", value: t }), R = (t) => ({ status: "valid", value: t }),
|
|
313
|
-
function
|
|
547
|
+
}), le = (t) => ({ status: "dirty", value: t }), R = (t) => ({ status: "valid", value: t }), it = (t) => t.status === "aborted", ot = (t) => t.status === "dirty", ne = (t) => t.status === "valid", xe = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
548
|
+
function He(t, e, r, n) {
|
|
314
549
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
315
550
|
return e.get(t);
|
|
316
551
|
}
|
|
317
|
-
function
|
|
552
|
+
function Ct(t, e, r, n, s) {
|
|
318
553
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
319
554
|
return e.set(t, r), r;
|
|
320
555
|
}
|
|
@@ -322,7 +557,7 @@ var rs = pr((as, mt) => {
|
|
|
322
557
|
(function(t) {
|
|
323
558
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
324
559
|
})(h || (h = {}));
|
|
325
|
-
var
|
|
560
|
+
var we, be;
|
|
326
561
|
class M {
|
|
327
562
|
constructor(e, r, n, s) {
|
|
328
563
|
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = s;
|
|
@@ -578,26 +813,26 @@ var rs = pr((as, mt) => {
|
|
|
578
813
|
return this.safeParse(null).success;
|
|
579
814
|
}
|
|
580
815
|
}
|
|
581
|
-
const
|
|
816
|
+
const Er = /^c[^\s-]{8,}$/i, Or = /^[0-9a-z]+$/, Nr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Rr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ar = /^[a-z0-9_-]{21}$/i, Cr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ir = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Pr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Zr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
582
817
|
let tt;
|
|
583
|
-
const
|
|
584
|
-
function
|
|
818
|
+
const jr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, $r = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Fr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Mr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Lr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Dr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, It = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Vr = new RegExp(`^${It}$`);
|
|
819
|
+
function Pt(t) {
|
|
585
820
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
586
821
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
587
822
|
}
|
|
588
|
-
function
|
|
589
|
-
return new RegExp(`^${
|
|
823
|
+
function Ur(t) {
|
|
824
|
+
return new RegExp(`^${Pt(t)}$`);
|
|
590
825
|
}
|
|
591
|
-
function
|
|
592
|
-
let e = `${
|
|
826
|
+
function Zt(t) {
|
|
827
|
+
let e = `${It}T${Pt(t)}`;
|
|
593
828
|
const r = [];
|
|
594
829
|
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
|
595
830
|
}
|
|
596
|
-
function
|
|
597
|
-
return !!((e === "v4" || !e) &&
|
|
831
|
+
function zr(t, e) {
|
|
832
|
+
return !!((e === "v4" || !e) && jr.test(t) || (e === "v6" || !e) && Fr.test(t));
|
|
598
833
|
}
|
|
599
|
-
function
|
|
600
|
-
if (!
|
|
834
|
+
function qr(t, e) {
|
|
835
|
+
if (!Cr.test(t))
|
|
601
836
|
return !1;
|
|
602
837
|
try {
|
|
603
838
|
const [r] = t.split("."), n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
@@ -606,8 +841,8 @@ var rs = pr((as, mt) => {
|
|
|
606
841
|
return !1;
|
|
607
842
|
}
|
|
608
843
|
}
|
|
609
|
-
function
|
|
610
|
-
return !!((e === "v4" || !e) &&
|
|
844
|
+
function Hr(t, e) {
|
|
845
|
+
return !!((e === "v4" || !e) && $r.test(t) || (e === "v6" || !e) && Mr.test(t));
|
|
611
846
|
}
|
|
612
847
|
class P extends _ {
|
|
613
848
|
_parse(e) {
|
|
@@ -658,43 +893,43 @@ var rs = pr((as, mt) => {
|
|
|
658
893
|
message: a.message
|
|
659
894
|
}), n.dirty());
|
|
660
895
|
} else if (a.kind === "email")
|
|
661
|
-
|
|
896
|
+
Pr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
662
897
|
validation: "email",
|
|
663
898
|
code: u.invalid_string,
|
|
664
899
|
message: a.message
|
|
665
900
|
}), n.dirty());
|
|
666
901
|
else if (a.kind === "emoji")
|
|
667
|
-
tt || (tt = new RegExp(
|
|
902
|
+
tt || (tt = new RegExp(Zr, "u")), tt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
668
903
|
validation: "emoji",
|
|
669
904
|
code: u.invalid_string,
|
|
670
905
|
message: a.message
|
|
671
906
|
}), n.dirty());
|
|
672
907
|
else if (a.kind === "uuid")
|
|
673
|
-
|
|
908
|
+
Rr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
674
909
|
validation: "uuid",
|
|
675
910
|
code: u.invalid_string,
|
|
676
911
|
message: a.message
|
|
677
912
|
}), n.dirty());
|
|
678
913
|
else if (a.kind === "nanoid")
|
|
679
|
-
|
|
914
|
+
Ar.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
680
915
|
validation: "nanoid",
|
|
681
916
|
code: u.invalid_string,
|
|
682
917
|
message: a.message
|
|
683
918
|
}), n.dirty());
|
|
684
919
|
else if (a.kind === "cuid")
|
|
685
|
-
|
|
920
|
+
Er.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
686
921
|
validation: "cuid",
|
|
687
922
|
code: u.invalid_string,
|
|
688
923
|
message: a.message
|
|
689
924
|
}), n.dirty());
|
|
690
925
|
else if (a.kind === "cuid2")
|
|
691
|
-
|
|
926
|
+
Or.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
692
927
|
validation: "cuid2",
|
|
693
928
|
code: u.invalid_string,
|
|
694
929
|
message: a.message
|
|
695
930
|
}), n.dirty());
|
|
696
931
|
else if (a.kind === "ulid")
|
|
697
|
-
|
|
932
|
+
Nr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
698
933
|
validation: "ulid",
|
|
699
934
|
code: u.invalid_string,
|
|
700
935
|
message: a.message
|
|
@@ -725,39 +960,39 @@ var rs = pr((as, mt) => {
|
|
|
725
960
|
code: u.invalid_string,
|
|
726
961
|
validation: { endsWith: a.value },
|
|
727
962
|
message: a.message
|
|
728
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
963
|
+
}), n.dirty()) : a.kind === "datetime" ? Zt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
729
964
|
code: u.invalid_string,
|
|
730
965
|
validation: "datetime",
|
|
731
966
|
message: a.message
|
|
732
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
967
|
+
}), n.dirty()) : a.kind === "date" ? Vr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
733
968
|
code: u.invalid_string,
|
|
734
969
|
validation: "date",
|
|
735
970
|
message: a.message
|
|
736
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
971
|
+
}), n.dirty()) : a.kind === "time" ? Ur(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
737
972
|
code: u.invalid_string,
|
|
738
973
|
validation: "time",
|
|
739
974
|
message: a.message
|
|
740
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
975
|
+
}), n.dirty()) : a.kind === "duration" ? Ir.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
741
976
|
validation: "duration",
|
|
742
977
|
code: u.invalid_string,
|
|
743
978
|
message: a.message
|
|
744
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
979
|
+
}), n.dirty()) : a.kind === "ip" ? zr(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
745
980
|
validation: "ip",
|
|
746
981
|
code: u.invalid_string,
|
|
747
982
|
message: a.message
|
|
748
|
-
}), n.dirty()) : a.kind === "jwt" ?
|
|
983
|
+
}), n.dirty()) : a.kind === "jwt" ? qr(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
749
984
|
validation: "jwt",
|
|
750
985
|
code: u.invalid_string,
|
|
751
986
|
message: a.message
|
|
752
|
-
}), n.dirty()) : a.kind === "cidr" ?
|
|
987
|
+
}), n.dirty()) : a.kind === "cidr" ? Hr(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
753
988
|
validation: "cidr",
|
|
754
989
|
code: u.invalid_string,
|
|
755
990
|
message: a.message
|
|
756
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
991
|
+
}), n.dirty()) : a.kind === "base64" ? Lr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
757
992
|
validation: "base64",
|
|
758
993
|
code: u.invalid_string,
|
|
759
994
|
message: a.message
|
|
760
|
-
}), n.dirty()) : a.kind === "base64url" ?
|
|
995
|
+
}), n.dirty()) : a.kind === "base64url" ? Dr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
761
996
|
validation: "base64url",
|
|
762
997
|
code: u.invalid_string,
|
|
763
998
|
message: a.message
|
|
@@ -996,7 +1231,7 @@ var rs = pr((as, mt) => {
|
|
|
996
1231
|
...v(t)
|
|
997
1232
|
});
|
|
998
1233
|
};
|
|
999
|
-
function
|
|
1234
|
+
function Br(t, e) {
|
|
1000
1235
|
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = r > n ? r : n, a = parseInt(t.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
1001
1236
|
return a % i / Math.pow(10, s);
|
|
1002
1237
|
}
|
|
@@ -1035,7 +1270,7 @@ var rs = pr((as, mt) => {
|
|
|
1035
1270
|
inclusive: a.inclusive,
|
|
1036
1271
|
exact: !1,
|
|
1037
1272
|
message: a.message
|
|
1038
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
1273
|
+
}), s.dirty()) : a.kind === "multipleOf" ? Br(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1039
1274
|
code: u.not_multiple_of,
|
|
1040
1275
|
multipleOf: a.value,
|
|
1041
1276
|
message: a.message
|
|
@@ -1404,7 +1639,7 @@ var rs = pr((as, mt) => {
|
|
|
1404
1639
|
typeName: m.ZodDate,
|
|
1405
1640
|
...v(t)
|
|
1406
1641
|
});
|
|
1407
|
-
class
|
|
1642
|
+
class Be extends _ {
|
|
1408
1643
|
_parse(e) {
|
|
1409
1644
|
if (this._getType(e) !== p.symbol) {
|
|
1410
1645
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1417,7 +1652,7 @@ var rs = pr((as, mt) => {
|
|
|
1417
1652
|
return R(e.data);
|
|
1418
1653
|
}
|
|
1419
1654
|
}
|
|
1420
|
-
|
|
1655
|
+
Be.create = (t) => new Be({
|
|
1421
1656
|
typeName: m.ZodSymbol,
|
|
1422
1657
|
...v(t)
|
|
1423
1658
|
});
|
|
@@ -1493,7 +1728,7 @@ var rs = pr((as, mt) => {
|
|
|
1493
1728
|
typeName: m.ZodNever,
|
|
1494
1729
|
...v(t)
|
|
1495
1730
|
});
|
|
1496
|
-
class
|
|
1731
|
+
class We extends _ {
|
|
1497
1732
|
_parse(e) {
|
|
1498
1733
|
if (this._getType(e) !== p.undefined) {
|
|
1499
1734
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1506,7 +1741,7 @@ var rs = pr((as, mt) => {
|
|
|
1506
1741
|
return R(e.data);
|
|
1507
1742
|
}
|
|
1508
1743
|
}
|
|
1509
|
-
|
|
1744
|
+
We.create = (t) => new We({
|
|
1510
1745
|
typeName: m.ZodVoid,
|
|
1511
1746
|
...v(t)
|
|
1512
1747
|
});
|
|
@@ -1862,7 +2097,7 @@ var rs = pr((as, mt) => {
|
|
|
1862
2097
|
});
|
|
1863
2098
|
}
|
|
1864
2099
|
keyof() {
|
|
1865
|
-
return
|
|
2100
|
+
return jt(b.objectKeys(this.shape));
|
|
1866
2101
|
}
|
|
1867
2102
|
}
|
|
1868
2103
|
S.create = (t, e) => new S({
|
|
@@ -2022,14 +2257,14 @@ var rs = pr((as, mt) => {
|
|
|
2022
2257
|
});
|
|
2023
2258
|
}
|
|
2024
2259
|
}
|
|
2025
|
-
function
|
|
2260
|
+
function dt(t, e) {
|
|
2026
2261
|
const r = z(t), n = z(e);
|
|
2027
2262
|
if (t === e)
|
|
2028
2263
|
return { valid: !0, data: t };
|
|
2029
2264
|
if (r === p.object && n === p.object) {
|
|
2030
2265
|
const s = b.objectKeys(e), a = b.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2031
2266
|
for (const o of a) {
|
|
2032
|
-
const d =
|
|
2267
|
+
const d = dt(t[o], e[o]);
|
|
2033
2268
|
if (!d.valid)
|
|
2034
2269
|
return { valid: !1 };
|
|
2035
2270
|
i[o] = d.data;
|
|
@@ -2040,7 +2275,7 @@ var rs = pr((as, mt) => {
|
|
|
2040
2275
|
return { valid: !1 };
|
|
2041
2276
|
const s = [];
|
|
2042
2277
|
for (let a = 0; a < t.length; a++) {
|
|
2043
|
-
const i = t[a], o = e[a], d =
|
|
2278
|
+
const i = t[a], o = e[a], d = dt(i, o);
|
|
2044
2279
|
if (!d.valid)
|
|
2045
2280
|
return { valid: !1 };
|
|
2046
2281
|
s.push(d.data);
|
|
@@ -2051,10 +2286,10 @@ var rs = pr((as, mt) => {
|
|
|
2051
2286
|
class Ne extends _ {
|
|
2052
2287
|
_parse(e) {
|
|
2053
2288
|
const { status: r, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
2054
|
-
if (
|
|
2289
|
+
if (it(a) || it(i))
|
|
2055
2290
|
return y;
|
|
2056
|
-
const o =
|
|
2057
|
-
return o.valid ? ((
|
|
2291
|
+
const o = dt(a.value, i.value);
|
|
2292
|
+
return o.valid ? ((ot(a) || ot(i)) && r.dirty(), { status: r.value, value: o.data }) : (f(n, {
|
|
2058
2293
|
code: u.invalid_intersection_types
|
|
2059
2294
|
}), y);
|
|
2060
2295
|
};
|
|
@@ -2177,7 +2412,7 @@ var rs = pr((as, mt) => {
|
|
|
2177
2412
|
});
|
|
2178
2413
|
}
|
|
2179
2414
|
}
|
|
2180
|
-
class
|
|
2415
|
+
class Je extends _ {
|
|
2181
2416
|
get keySchema() {
|
|
2182
2417
|
return this._def.keyType;
|
|
2183
2418
|
}
|
|
@@ -2219,7 +2454,7 @@ var rs = pr((as, mt) => {
|
|
|
2219
2454
|
}
|
|
2220
2455
|
}
|
|
2221
2456
|
}
|
|
2222
|
-
|
|
2457
|
+
Je.create = (t, e, r) => new Je({
|
|
2223
2458
|
valueType: e,
|
|
2224
2459
|
keyType: t,
|
|
2225
2460
|
typeName: m.ZodMap,
|
|
@@ -2302,13 +2537,13 @@ var rs = pr((as, mt) => {
|
|
|
2302
2537
|
received: r.parsedType
|
|
2303
2538
|
}), y;
|
|
2304
2539
|
function n(o, d) {
|
|
2305
|
-
return
|
|
2540
|
+
return qe({
|
|
2306
2541
|
data: o,
|
|
2307
2542
|
path: r.path,
|
|
2308
2543
|
errorMaps: [
|
|
2309
2544
|
r.common.contextualErrorMap,
|
|
2310
2545
|
r.schemaErrorMap,
|
|
2311
|
-
|
|
2546
|
+
ze(),
|
|
2312
2547
|
pe
|
|
2313
2548
|
].filter((c) => !!c),
|
|
2314
2549
|
issueData: {
|
|
@@ -2318,13 +2553,13 @@ var rs = pr((as, mt) => {
|
|
|
2318
2553
|
});
|
|
2319
2554
|
}
|
|
2320
2555
|
function s(o, d) {
|
|
2321
|
-
return
|
|
2556
|
+
return qe({
|
|
2322
2557
|
data: o,
|
|
2323
2558
|
path: r.path,
|
|
2324
2559
|
errorMaps: [
|
|
2325
2560
|
r.common.contextualErrorMap,
|
|
2326
2561
|
r.schemaErrorMap,
|
|
2327
|
-
|
|
2562
|
+
ze(),
|
|
2328
2563
|
pe
|
|
2329
2564
|
].filter((c) => !!c),
|
|
2330
2565
|
issueData: {
|
|
@@ -2425,7 +2660,7 @@ var rs = pr((as, mt) => {
|
|
|
2425
2660
|
typeName: m.ZodLiteral,
|
|
2426
2661
|
...v(e)
|
|
2427
2662
|
});
|
|
2428
|
-
function
|
|
2663
|
+
function jt(t, e) {
|
|
2429
2664
|
return new Y({
|
|
2430
2665
|
values: t,
|
|
2431
2666
|
typeName: m.ZodEnum,
|
|
@@ -2434,7 +2669,7 @@ var rs = pr((as, mt) => {
|
|
|
2434
2669
|
}
|
|
2435
2670
|
class Y extends _ {
|
|
2436
2671
|
constructor() {
|
|
2437
|
-
super(...arguments),
|
|
2672
|
+
super(...arguments), we.set(this, void 0);
|
|
2438
2673
|
}
|
|
2439
2674
|
_parse(e) {
|
|
2440
2675
|
if (typeof e.data != "string") {
|
|
@@ -2445,7 +2680,7 @@ var rs = pr((as, mt) => {
|
|
|
2445
2680
|
code: u.invalid_type
|
|
2446
2681
|
}), y;
|
|
2447
2682
|
}
|
|
2448
|
-
if (
|
|
2683
|
+
if (He(this, we) || Ct(this, we, new Set(this._def.values)), !He(this, we).has(e.data)) {
|
|
2449
2684
|
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
2450
2685
|
return f(r, {
|
|
2451
2686
|
received: r.data,
|
|
@@ -2489,11 +2724,11 @@ var rs = pr((as, mt) => {
|
|
|
2489
2724
|
});
|
|
2490
2725
|
}
|
|
2491
2726
|
}
|
|
2492
|
-
|
|
2493
|
-
Y.create =
|
|
2727
|
+
we = /* @__PURE__ */ new WeakMap();
|
|
2728
|
+
Y.create = jt;
|
|
2494
2729
|
class Ie extends _ {
|
|
2495
2730
|
constructor() {
|
|
2496
|
-
super(...arguments),
|
|
2731
|
+
super(...arguments), be.set(this, void 0);
|
|
2497
2732
|
}
|
|
2498
2733
|
_parse(e) {
|
|
2499
2734
|
const r = b.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2505,7 +2740,7 @@ var rs = pr((as, mt) => {
|
|
|
2505
2740
|
code: u.invalid_type
|
|
2506
2741
|
}), y;
|
|
2507
2742
|
}
|
|
2508
|
-
if (
|
|
2743
|
+
if (He(this, be) || Ct(this, be, new Set(b.getValidEnumValues(this._def.values))), !He(this, be).has(e.data)) {
|
|
2509
2744
|
const s = b.objectValues(r);
|
|
2510
2745
|
return f(n, {
|
|
2511
2746
|
received: n.data,
|
|
@@ -2519,7 +2754,7 @@ var rs = pr((as, mt) => {
|
|
|
2519
2754
|
return this._def.values;
|
|
2520
2755
|
}
|
|
2521
2756
|
}
|
|
2522
|
-
|
|
2757
|
+
be = /* @__PURE__ */ new WeakMap();
|
|
2523
2758
|
Ie.create = (t, e) => new Ie({
|
|
2524
2759
|
values: t,
|
|
2525
2760
|
typeName: m.ZodNativeEnum,
|
|
@@ -2727,7 +2962,7 @@ var rs = pr((as, mt) => {
|
|
|
2727
2962
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2728
2963
|
...v(e)
|
|
2729
2964
|
});
|
|
2730
|
-
class
|
|
2965
|
+
class Ye extends _ {
|
|
2731
2966
|
_parse(e) {
|
|
2732
2967
|
if (this._getType(e) !== p.nan) {
|
|
2733
2968
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2740,11 +2975,11 @@ var rs = pr((as, mt) => {
|
|
|
2740
2975
|
return { status: "valid", value: e.data };
|
|
2741
2976
|
}
|
|
2742
2977
|
}
|
|
2743
|
-
|
|
2978
|
+
Ye.create = (t) => new Ye({
|
|
2744
2979
|
typeName: m.ZodNaN,
|
|
2745
2980
|
...v(t)
|
|
2746
2981
|
});
|
|
2747
|
-
const
|
|
2982
|
+
const Wr = Symbol("zod_brand");
|
|
2748
2983
|
class yt extends _ {
|
|
2749
2984
|
_parse(e) {
|
|
2750
2985
|
const { ctx: r } = this._processInputParams(e), n = r.data;
|
|
@@ -2816,7 +3051,7 @@ var rs = pr((as, mt) => {
|
|
|
2816
3051
|
const r = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
2817
3052
|
return typeof r == "string" ? { message: r } : r;
|
|
2818
3053
|
}
|
|
2819
|
-
function
|
|
3054
|
+
function $t(t, e = {}, r) {
|
|
2820
3055
|
return t ? he.create().superRefine((n, s) => {
|
|
2821
3056
|
var a, i;
|
|
2822
3057
|
const o = t(n);
|
|
@@ -2834,16 +3069,16 @@ var rs = pr((as, mt) => {
|
|
|
2834
3069
|
}
|
|
2835
3070
|
}) : he.create();
|
|
2836
3071
|
}
|
|
2837
|
-
const
|
|
3072
|
+
const Jr = {
|
|
2838
3073
|
object: S.lazycreate
|
|
2839
3074
|
};
|
|
2840
3075
|
var m;
|
|
2841
3076
|
(function(t) {
|
|
2842
3077
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
2843
3078
|
})(m || (m = {}));
|
|
2844
|
-
const
|
|
3079
|
+
const Yr = (t, e = {
|
|
2845
3080
|
message: `Input not instance of ${t.name}`
|
|
2846
|
-
}) =>
|
|
3081
|
+
}) => $t((r) => r instanceof t, e), Ft = P.create, Mt = W.create, Kr = Ye.create, Gr = J.create, Lt = Te.create, Xr = se.create, Qr = Be.create, en = Se.create, tn = Ee.create, rn = he.create, nn = re.create, sn = q.create, an = We.create, on = Z.create, dn = S.create, cn = S.strictCreate, un = Oe.create, ln = Xe.create, fn = Ne.create, pn = L.create, hn = Re.create, mn = Je.create, yn = ae.create, gn = fe.create, vn = Ae.create, _n = Ce.create, wn = Y.create, bn = Ie.create, kn = me.create, St = j.create, xn = F.create, Tn = K.create, Sn = j.createWithPreprocess, En = $e.create, On = () => Ft().optional(), Nn = () => Mt().optional(), Rn = () => Lt().optional(), An = {
|
|
2847
3082
|
string: (t) => P.create({ ...t, coerce: !0 }),
|
|
2848
3083
|
number: (t) => W.create({ ...t, coerce: !0 }),
|
|
2849
3084
|
boolean: (t) => Te.create({
|
|
@@ -2852,45 +3087,45 @@ var rs = pr((as, mt) => {
|
|
|
2852
3087
|
}),
|
|
2853
3088
|
bigint: (t) => J.create({ ...t, coerce: !0 }),
|
|
2854
3089
|
date: (t) => se.create({ ...t, coerce: !0 })
|
|
2855
|
-
},
|
|
2856
|
-
var
|
|
3090
|
+
}, Cn = y;
|
|
3091
|
+
var Ke = /* @__PURE__ */ Object.freeze({
|
|
2857
3092
|
__proto__: null,
|
|
2858
3093
|
defaultErrorMap: pe,
|
|
2859
|
-
setErrorMap:
|
|
2860
|
-
getErrorMap:
|
|
2861
|
-
makeIssue:
|
|
2862
|
-
EMPTY_PATH:
|
|
3094
|
+
setErrorMap: Tr,
|
|
3095
|
+
getErrorMap: ze,
|
|
3096
|
+
makeIssue: qe,
|
|
3097
|
+
EMPTY_PATH: Sr,
|
|
2863
3098
|
addIssueToContext: f,
|
|
2864
3099
|
ParseStatus: O,
|
|
2865
3100
|
INVALID: y,
|
|
2866
3101
|
DIRTY: le,
|
|
2867
3102
|
OK: R,
|
|
2868
|
-
isAborted:
|
|
2869
|
-
isDirty:
|
|
3103
|
+
isAborted: it,
|
|
3104
|
+
isDirty: ot,
|
|
2870
3105
|
isValid: ne,
|
|
2871
3106
|
isAsync: xe,
|
|
2872
3107
|
get util() {
|
|
2873
3108
|
return b;
|
|
2874
3109
|
},
|
|
2875
3110
|
get objectUtil() {
|
|
2876
|
-
return
|
|
3111
|
+
return at;
|
|
2877
3112
|
},
|
|
2878
3113
|
ZodParsedType: p,
|
|
2879
3114
|
getParsedType: z,
|
|
2880
3115
|
ZodType: _,
|
|
2881
|
-
datetimeRegex:
|
|
3116
|
+
datetimeRegex: Zt,
|
|
2882
3117
|
ZodString: P,
|
|
2883
3118
|
ZodNumber: W,
|
|
2884
3119
|
ZodBigInt: J,
|
|
2885
3120
|
ZodBoolean: Te,
|
|
2886
3121
|
ZodDate: se,
|
|
2887
|
-
ZodSymbol:
|
|
3122
|
+
ZodSymbol: Be,
|
|
2888
3123
|
ZodUndefined: Se,
|
|
2889
3124
|
ZodNull: Ee,
|
|
2890
3125
|
ZodAny: he,
|
|
2891
3126
|
ZodUnknown: re,
|
|
2892
3127
|
ZodNever: q,
|
|
2893
|
-
ZodVoid:
|
|
3128
|
+
ZodVoid: We,
|
|
2894
3129
|
ZodArray: Z,
|
|
2895
3130
|
ZodObject: S,
|
|
2896
3131
|
ZodUnion: Oe,
|
|
@@ -2898,7 +3133,7 @@ var rs = pr((as, mt) => {
|
|
|
2898
3133
|
ZodIntersection: Ne,
|
|
2899
3134
|
ZodTuple: L,
|
|
2900
3135
|
ZodRecord: Re,
|
|
2901
|
-
ZodMap:
|
|
3136
|
+
ZodMap: Je,
|
|
2902
3137
|
ZodSet: ae,
|
|
2903
3138
|
ZodFunction: fe,
|
|
2904
3139
|
ZodLazy: Ae,
|
|
@@ -2912,80 +3147,80 @@ var rs = pr((as, mt) => {
|
|
|
2912
3147
|
ZodNullable: K,
|
|
2913
3148
|
ZodDefault: Pe,
|
|
2914
3149
|
ZodCatch: Ze,
|
|
2915
|
-
ZodNaN:
|
|
2916
|
-
BRAND:
|
|
3150
|
+
ZodNaN: Ye,
|
|
3151
|
+
BRAND: Wr,
|
|
2917
3152
|
ZodBranded: yt,
|
|
2918
3153
|
ZodPipeline: $e,
|
|
2919
3154
|
ZodReadonly: je,
|
|
2920
|
-
custom:
|
|
3155
|
+
custom: $t,
|
|
2921
3156
|
Schema: _,
|
|
2922
3157
|
ZodSchema: _,
|
|
2923
|
-
late:
|
|
3158
|
+
late: Jr,
|
|
2924
3159
|
get ZodFirstPartyTypeKind() {
|
|
2925
3160
|
return m;
|
|
2926
3161
|
},
|
|
2927
|
-
coerce:
|
|
2928
|
-
any:
|
|
2929
|
-
array:
|
|
2930
|
-
bigint:
|
|
2931
|
-
boolean:
|
|
2932
|
-
date:
|
|
2933
|
-
discriminatedUnion:
|
|
3162
|
+
coerce: An,
|
|
3163
|
+
any: rn,
|
|
3164
|
+
array: on,
|
|
3165
|
+
bigint: Gr,
|
|
3166
|
+
boolean: Lt,
|
|
3167
|
+
date: Xr,
|
|
3168
|
+
discriminatedUnion: ln,
|
|
2934
3169
|
effect: St,
|
|
2935
|
-
enum:
|
|
2936
|
-
function:
|
|
2937
|
-
instanceof:
|
|
2938
|
-
intersection:
|
|
2939
|
-
lazy:
|
|
2940
|
-
literal:
|
|
2941
|
-
map:
|
|
2942
|
-
nan:
|
|
2943
|
-
nativeEnum:
|
|
2944
|
-
never:
|
|
2945
|
-
null:
|
|
2946
|
-
nullable:
|
|
2947
|
-
number:
|
|
2948
|
-
object:
|
|
2949
|
-
oboolean:
|
|
2950
|
-
onumber:
|
|
2951
|
-
optional:
|
|
2952
|
-
ostring:
|
|
2953
|
-
pipeline:
|
|
2954
|
-
preprocess:
|
|
2955
|
-
promise:
|
|
2956
|
-
record:
|
|
2957
|
-
set:
|
|
2958
|
-
strictObject:
|
|
2959
|
-
string:
|
|
2960
|
-
symbol:
|
|
3170
|
+
enum: wn,
|
|
3171
|
+
function: gn,
|
|
3172
|
+
instanceof: Yr,
|
|
3173
|
+
intersection: fn,
|
|
3174
|
+
lazy: vn,
|
|
3175
|
+
literal: _n,
|
|
3176
|
+
map: mn,
|
|
3177
|
+
nan: Kr,
|
|
3178
|
+
nativeEnum: bn,
|
|
3179
|
+
never: sn,
|
|
3180
|
+
null: tn,
|
|
3181
|
+
nullable: Tn,
|
|
3182
|
+
number: Mt,
|
|
3183
|
+
object: dn,
|
|
3184
|
+
oboolean: Rn,
|
|
3185
|
+
onumber: Nn,
|
|
3186
|
+
optional: xn,
|
|
3187
|
+
ostring: On,
|
|
3188
|
+
pipeline: En,
|
|
3189
|
+
preprocess: Sn,
|
|
3190
|
+
promise: kn,
|
|
3191
|
+
record: hn,
|
|
3192
|
+
set: yn,
|
|
3193
|
+
strictObject: cn,
|
|
3194
|
+
string: Ft,
|
|
3195
|
+
symbol: Qr,
|
|
2961
3196
|
transformer: St,
|
|
2962
|
-
tuple:
|
|
2963
|
-
undefined:
|
|
2964
|
-
union:
|
|
2965
|
-
unknown:
|
|
2966
|
-
void:
|
|
2967
|
-
NEVER:
|
|
3197
|
+
tuple: pn,
|
|
3198
|
+
undefined: en,
|
|
3199
|
+
union: un,
|
|
3200
|
+
unknown: nn,
|
|
3201
|
+
void: an,
|
|
3202
|
+
NEVER: Cn,
|
|
2968
3203
|
ZodIssueCode: u,
|
|
2969
|
-
quotelessJson:
|
|
3204
|
+
quotelessJson: xr,
|
|
2970
3205
|
ZodError: C
|
|
2971
3206
|
});
|
|
2972
|
-
const
|
|
2973
|
-
detail:
|
|
2974
|
-
}),
|
|
2975
|
-
error:
|
|
3207
|
+
const ct = Ke.object({
|
|
3208
|
+
detail: Ke.string()
|
|
3209
|
+
}), Dt = Ke.object({
|
|
3210
|
+
error: Ke.string()
|
|
2976
3211
|
});
|
|
2977
|
-
function
|
|
3212
|
+
function In(t) {
|
|
2978
3213
|
if (!t)
|
|
2979
3214
|
return "Unknown error";
|
|
2980
3215
|
if (t instanceof Error) {
|
|
2981
|
-
const e =
|
|
2982
|
-
return e.success ? e.data.detail :
|
|
3216
|
+
const e = ct.safeParse(t.cause);
|
|
3217
|
+
return e.success ? e.data.detail : Pn(t.message);
|
|
2983
3218
|
}
|
|
2984
3219
|
if (typeof t == "object") {
|
|
2985
|
-
const e =
|
|
3220
|
+
const e = ct.safeParse(t);
|
|
2986
3221
|
if (e.success)
|
|
2987
3222
|
return e.data.detail;
|
|
2988
|
-
const r =
|
|
3223
|
+
const r = Dt.safeParse(t);
|
|
2989
3224
|
if (r.success)
|
|
2990
3225
|
return r.data.error;
|
|
2991
3226
|
}
|
|
@@ -2995,258 +3230,84 @@ var rs = pr((as, mt) => {
|
|
|
2995
3230
|
return String(t);
|
|
2996
3231
|
}
|
|
2997
3232
|
}
|
|
2998
|
-
function
|
|
2999
|
-
const e =
|
|
3233
|
+
function Pn(t) {
|
|
3234
|
+
const e = Zn(t);
|
|
3000
3235
|
if (!e)
|
|
3001
3236
|
return t;
|
|
3002
|
-
const r =
|
|
3237
|
+
const r = ct.safeParse(e);
|
|
3003
3238
|
if (r.success)
|
|
3004
3239
|
return r.data.detail;
|
|
3005
|
-
const n =
|
|
3240
|
+
const n = Dt.safeParse(e);
|
|
3006
3241
|
return n.success ? n.data.error : t;
|
|
3007
3242
|
}
|
|
3008
|
-
function
|
|
3243
|
+
function Zn(t) {
|
|
3009
3244
|
try {
|
|
3010
3245
|
return JSON.parse(t);
|
|
3011
3246
|
} catch {
|
|
3012
3247
|
return t;
|
|
3013
3248
|
}
|
|
3014
3249
|
}
|
|
3015
|
-
const
|
|
3016
|
-
function
|
|
3017
|
-
|
|
3018
|
-
return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
|
|
3250
|
+
const jn = "marimo-transport";
|
|
3251
|
+
function ke(t) {
|
|
3252
|
+
return t.FS;
|
|
3019
3253
|
}
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
}
|
|
3029
|
-
let a;
|
|
3030
|
-
function i(g) {
|
|
3031
|
-
if (typeof g == "function") {
|
|
3032
|
-
a = g;
|
|
3033
|
-
return;
|
|
3254
|
+
const ge = "notebook.py", ve = "/marimo", B = {
|
|
3255
|
+
NOTEBOOK_FILENAME: ge,
|
|
3256
|
+
HOME_DIR: ve,
|
|
3257
|
+
createHomeDir: (t) => {
|
|
3258
|
+
const e = ke(t);
|
|
3259
|
+
try {
|
|
3260
|
+
e.mkdirTree(ve);
|
|
3261
|
+
} catch {
|
|
3034
3262
|
}
|
|
3035
|
-
|
|
3036
|
-
const N = g[T];
|
|
3037
|
-
if (N)
|
|
3038
|
-
return N(E);
|
|
3039
|
-
const $ = g._;
|
|
3040
|
-
if (!$)
|
|
3041
|
-
throw new Error(`The requested method has no handler: ${T}`);
|
|
3042
|
-
return $(T, E);
|
|
3043
|
-
};
|
|
3044
|
-
}
|
|
3045
|
-
const { maxRequestTime: o = On } = t;
|
|
3046
|
-
t.transport && s(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
3047
|
-
let d = 0;
|
|
3048
|
-
function c() {
|
|
3049
|
-
return d <= En ? ++d : d = 0;
|
|
3050
|
-
}
|
|
3051
|
-
const l = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
3052
|
-
function x(g, ...T) {
|
|
3053
|
-
const E = T[0];
|
|
3054
|
-
return new Promise((N, $) => {
|
|
3055
|
-
if (!n.send)
|
|
3056
|
-
throw Me(["send"], "make requests");
|
|
3057
|
-
const H = c(), kt = {
|
|
3058
|
-
type: "request",
|
|
3059
|
-
id: H,
|
|
3060
|
-
method: g,
|
|
3061
|
-
params: E
|
|
3062
|
-
};
|
|
3063
|
-
l.set(H, { resolve: N, reject: $ }), o !== 1 / 0 && w.set(H, setTimeout(() => {
|
|
3064
|
-
w.delete(H), $(new Error("RPC request timed out."));
|
|
3065
|
-
}, o)), e.onSend?.(kt), n.send(kt);
|
|
3066
|
-
});
|
|
3067
|
-
}
|
|
3068
|
-
const A = new Proxy(x, {
|
|
3069
|
-
get: (g, T, E) => T in g ? Reflect.get(g, T, E) : (N) => x(T, N)
|
|
3070
|
-
}), V = A;
|
|
3071
|
-
function Fe(g, ...T) {
|
|
3072
|
-
const E = T[0];
|
|
3073
|
-
if (!n.send)
|
|
3074
|
-
throw Me(["send"], "send messages");
|
|
3075
|
-
const N = {
|
|
3076
|
-
type: "message",
|
|
3077
|
-
id: g,
|
|
3078
|
-
payload: E
|
|
3079
|
-
};
|
|
3080
|
-
e.onSend?.(N), n.send(N);
|
|
3081
|
-
}
|
|
3082
|
-
const wt = new Proxy(Fe, {
|
|
3083
|
-
get: (g, T, E) => T in g ? Reflect.get(g, T, E) : (N) => Fe(T, N)
|
|
3084
|
-
}), bt = wt, X = /* @__PURE__ */ new Map(), et = /* @__PURE__ */ new Set();
|
|
3085
|
-
function ur(g, T) {
|
|
3086
|
-
if (!n.registerHandler)
|
|
3087
|
-
throw Me(["registerHandler"], "register message listeners");
|
|
3088
|
-
if (g === "*") {
|
|
3089
|
-
et.add(T);
|
|
3090
|
-
return;
|
|
3091
|
-
}
|
|
3092
|
-
X.has(g) || X.set(g, /* @__PURE__ */ new Set()), X.get(g)?.add(T);
|
|
3093
|
-
}
|
|
3094
|
-
function lr(g, T) {
|
|
3095
|
-
if (g === "*") {
|
|
3096
|
-
et.delete(T);
|
|
3097
|
-
return;
|
|
3098
|
-
}
|
|
3099
|
-
X.get(g)?.delete(T), X.get(g)?.size === 0 && X.delete(g);
|
|
3100
|
-
}
|
|
3101
|
-
async function fr(g) {
|
|
3102
|
-
if (e.onReceive?.(g), !("type" in g))
|
|
3103
|
-
throw new Error("Message does not contain a type.");
|
|
3104
|
-
if (g.type === "request") {
|
|
3105
|
-
if (!n.send || !a)
|
|
3106
|
-
throw Me(["send", "requestHandler"], "handle requests");
|
|
3107
|
-
const { id: T, method: E, params: N } = g;
|
|
3108
|
-
let $;
|
|
3109
|
-
try {
|
|
3110
|
-
$ = {
|
|
3111
|
-
type: "response",
|
|
3112
|
-
id: T,
|
|
3113
|
-
success: !0,
|
|
3114
|
-
payload: await a(E, N)
|
|
3115
|
-
};
|
|
3116
|
-
} catch (H) {
|
|
3117
|
-
if (!(H instanceof Error))
|
|
3118
|
-
throw H;
|
|
3119
|
-
$ = {
|
|
3120
|
-
type: "response",
|
|
3121
|
-
id: T,
|
|
3122
|
-
success: !1,
|
|
3123
|
-
error: H.message
|
|
3124
|
-
};
|
|
3125
|
-
}
|
|
3126
|
-
e.onSend?.($), n.send($);
|
|
3127
|
-
return;
|
|
3128
|
-
}
|
|
3129
|
-
if (g.type === "response") {
|
|
3130
|
-
const T = w.get(g.id);
|
|
3131
|
-
T != null && clearTimeout(T);
|
|
3132
|
-
const { resolve: E, reject: N } = l.get(g.id) ?? {};
|
|
3133
|
-
g.success ? E?.(g.payload) : N?.(new Error(g.error));
|
|
3134
|
-
return;
|
|
3135
|
-
}
|
|
3136
|
-
if (g.type === "message") {
|
|
3137
|
-
for (const E of et)
|
|
3138
|
-
E(g.id, g.payload);
|
|
3139
|
-
const T = X.get(g.id);
|
|
3140
|
-
if (!T)
|
|
3141
|
-
return;
|
|
3142
|
-
for (const E of T)
|
|
3143
|
-
E(g.payload);
|
|
3144
|
-
return;
|
|
3145
|
-
}
|
|
3146
|
-
throw new Error(`Unexpected RPC message type: ${g.type}`);
|
|
3147
|
-
}
|
|
3148
|
-
return {
|
|
3149
|
-
setTransport: s,
|
|
3150
|
-
setRequestHandler: i,
|
|
3151
|
-
request: A,
|
|
3152
|
-
requestProxy: V,
|
|
3153
|
-
send: wt,
|
|
3154
|
-
sendProxy: bt,
|
|
3155
|
-
addMessageListener: ur,
|
|
3156
|
-
removeMessageListener: lr,
|
|
3157
|
-
proxy: { send: bt, request: V },
|
|
3158
|
-
_setDebugHooks: r
|
|
3159
|
-
};
|
|
3160
|
-
}
|
|
3161
|
-
function Rn(t) {
|
|
3162
|
-
return Nn(t);
|
|
3163
|
-
}
|
|
3164
|
-
const Lt = "[transport-id]";
|
|
3165
|
-
function An(t, e) {
|
|
3166
|
-
const { transportId: r } = e;
|
|
3167
|
-
return r != null ? { [Lt]: r, data: t } : t;
|
|
3168
|
-
}
|
|
3169
|
-
function Cn(t, e) {
|
|
3170
|
-
const { transportId: r, filter: n } = e, s = n?.();
|
|
3171
|
-
if (r != null && s != null)
|
|
3172
|
-
throw new Error("Cannot use both `transportId` and `filter` at the same time");
|
|
3173
|
-
let a = t;
|
|
3174
|
-
if (r) {
|
|
3175
|
-
if (t[Lt] !== r)
|
|
3176
|
-
return [!0];
|
|
3177
|
-
a = t.data;
|
|
3178
|
-
}
|
|
3179
|
-
return s === !1 ? [!0] : [!1, a];
|
|
3180
|
-
}
|
|
3181
|
-
function In(t, e = {}) {
|
|
3182
|
-
const { transportId: r, filter: n, remotePort: s } = e, a = t, i = s ?? t;
|
|
3183
|
-
let o;
|
|
3184
|
-
return {
|
|
3185
|
-
send(d) {
|
|
3186
|
-
i.postMessage(An(d, { transportId: r }));
|
|
3187
|
-
},
|
|
3188
|
-
registerHandler(d) {
|
|
3189
|
-
o = (c) => {
|
|
3190
|
-
const l = c.data, [w, x] = Cn(l, {
|
|
3191
|
-
transportId: r,
|
|
3192
|
-
filter: () => n?.(c)
|
|
3193
|
-
});
|
|
3194
|
-
w || d(x);
|
|
3195
|
-
}, a.addEventListener("message", o);
|
|
3196
|
-
},
|
|
3197
|
-
unregisterHandler() {
|
|
3198
|
-
o && a.removeEventListener("message", o);
|
|
3199
|
-
}
|
|
3200
|
-
};
|
|
3201
|
-
}
|
|
3202
|
-
function Pn(t) {
|
|
3203
|
-
return In(self, t);
|
|
3204
|
-
}
|
|
3205
|
-
const ye = {
|
|
3206
|
-
NOOP: () => {
|
|
3207
|
-
}
|
|
3208
|
-
}, Dt = (t, e) => {
|
|
3209
|
-
const r = `[${t}]`;
|
|
3210
|
-
return {
|
|
3211
|
-
debug: (...n) => e.debug(r, ...n),
|
|
3212
|
-
log: (...n) => e.log(r, ...n),
|
|
3213
|
-
warn: (...n) => e.warn(r, ...n),
|
|
3214
|
-
error: (...n) => e.error(r, ...n),
|
|
3215
|
-
trace: (...n) => e.trace(r, ...n),
|
|
3216
|
-
get: (n) => Dt(`${t}.${n}`, e),
|
|
3217
|
-
disabled: (n = !0) => n ? Ke : e
|
|
3218
|
-
};
|
|
3219
|
-
}, Ye = {
|
|
3220
|
-
debug: (...t) => {
|
|
3221
|
-
console.debug(...t);
|
|
3263
|
+
e.chdir(ve);
|
|
3222
3264
|
},
|
|
3223
|
-
|
|
3224
|
-
|
|
3265
|
+
mountFS: (t) => {
|
|
3266
|
+
ke(t).mount(t.FS.filesystems.IDBFS, { root: "." }, ve);
|
|
3225
3267
|
},
|
|
3226
|
-
|
|
3227
|
-
|
|
3268
|
+
populateFilesToMemory: async (t) => {
|
|
3269
|
+
await Et(t, !0);
|
|
3228
3270
|
},
|
|
3229
|
-
|
|
3230
|
-
|
|
3271
|
+
persistFilesToRemote: async (t) => {
|
|
3272
|
+
await Et(t, !1);
|
|
3231
3273
|
},
|
|
3232
|
-
|
|
3233
|
-
|
|
3274
|
+
readNotebook: (t) => {
|
|
3275
|
+
const e = ke(t), r = `${ve}/${ge}`;
|
|
3276
|
+
return st(e.readFile(r));
|
|
3234
3277
|
},
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3278
|
+
initNotebookCode: (t) => {
|
|
3279
|
+
const { pyodide: e, filename: r, code: n } = t, s = ke(e), a = (i) => {
|
|
3280
|
+
try {
|
|
3281
|
+
return st(s.readFile(i));
|
|
3282
|
+
} catch {
|
|
3283
|
+
return null;
|
|
3284
|
+
}
|
|
3285
|
+
};
|
|
3286
|
+
if (r && r !== ge) {
|
|
3287
|
+
const i = a(r);
|
|
3288
|
+
if (i)
|
|
3289
|
+
return {
|
|
3290
|
+
code: i,
|
|
3291
|
+
filename: r
|
|
3292
|
+
};
|
|
3293
|
+
}
|
|
3294
|
+
return s.writeFile(ge, n), {
|
|
3295
|
+
code: n,
|
|
3296
|
+
filename: ge
|
|
3297
|
+
};
|
|
3298
|
+
}
|
|
3245
3299
|
};
|
|
3246
|
-
function
|
|
3247
|
-
return
|
|
3300
|
+
function Et(t, e) {
|
|
3301
|
+
return new Promise((r, n) => {
|
|
3302
|
+
ke(t).syncfs(e, (s) => {
|
|
3303
|
+
if (s instanceof Error) {
|
|
3304
|
+
n(s);
|
|
3305
|
+
return;
|
|
3306
|
+
}
|
|
3307
|
+
r();
|
|
3308
|
+
});
|
|
3309
|
+
});
|
|
3248
3310
|
}
|
|
3249
|
-
const be = Zn(), jn = "marimo-transport";
|
|
3250
3311
|
var $n = Object.defineProperty, k = (t, e) => $n(t, "name", { value: e, configurable: !0 }), Vt = ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (e, r) => (typeof require < "u" ? require : e)[r] }) : t)(function(t) {
|
|
3251
3312
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
3252
3313
|
throw new Error('Dynamic require of "' + t + '" is not supported');
|
|
@@ -3346,25 +3407,25 @@ var rs = pr((as, mt) => {
|
|
|
3346
3407
|
k(zt, "ErrorStackParser");
|
|
3347
3408
|
var Ln = new zt(), Dn = Ln, D = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && !process.browser, qt = D && typeof mt < "u" && typeof mt.exports < "u" && typeof Vt < "u" && typeof __dirname < "u", Vn = D && !qt, Un = typeof Deno < "u", Ht = !D && !Un, zn = Ht && typeof window == "object" && typeof document == "object" && typeof document.createElement == "function" && "sessionStorage" in window && typeof importScripts != "function", qn = Ht && typeof importScripts == "function" && typeof self == "object";
|
|
3348
3409
|
typeof navigator == "object" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") > -1;
|
|
3349
|
-
var Bt,
|
|
3410
|
+
var Bt, ut, Wt, Ot, gt;
|
|
3350
3411
|
async function vt() {
|
|
3351
|
-
if (!D || (Bt = (await import("./__vite-browser-external-CPvbk0mb.js")).default,
|
|
3352
|
-
let t =
|
|
3412
|
+
if (!D || (Bt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, Ot = await import("./__vite-browser-external-CPvbk0mb.js"), gt = await import("./__vite-browser-external-CPvbk0mb.js"), Wt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, ut = await import("./__vite-browser-external-CPvbk0mb.js"), _t = ut.sep, typeof Vt < "u")) return;
|
|
3413
|
+
let t = Ot, e = await import("./__vite-browser-external-CPvbk0mb.js"), r = await import("./__vite-browser-external-CPvbk0mb.js"), n = await import("./__vite-browser-external-CPvbk0mb.js"), s = { fs: t, crypto: e, ws: r, child_process: n };
|
|
3353
3414
|
globalThis.require = function(a) {
|
|
3354
3415
|
return s[a];
|
|
3355
3416
|
};
|
|
3356
3417
|
}
|
|
3357
3418
|
k(vt, "initNodeModules");
|
|
3358
3419
|
function Jt(t, e) {
|
|
3359
|
-
return
|
|
3420
|
+
return ut.resolve(e || ".", t);
|
|
3360
3421
|
}
|
|
3361
3422
|
k(Jt, "node_resolvePath");
|
|
3362
3423
|
function Yt(t, e) {
|
|
3363
3424
|
return e === void 0 && (e = location), new URL(t, e).toString();
|
|
3364
3425
|
}
|
|
3365
3426
|
k(Yt, "browser_resolvePath");
|
|
3366
|
-
var
|
|
3367
|
-
D ?
|
|
3427
|
+
var lt;
|
|
3428
|
+
D ? lt = Jt : lt = Yt;
|
|
3368
3429
|
var _t;
|
|
3369
3430
|
D || (_t = "/");
|
|
3370
3431
|
function Kt(t, e) {
|
|
@@ -3607,12 +3668,12 @@ var rs = pr((as, mt) => {
|
|
|
3607
3668
|
};
|
|
3608
3669
|
}
|
|
3609
3670
|
k(cr, "getInstantiateWasmFunc");
|
|
3610
|
-
var
|
|
3611
|
-
async function
|
|
3671
|
+
var ft = "0.27.5";
|
|
3672
|
+
async function pt(t = {}) {
|
|
3612
3673
|
var e, r;
|
|
3613
3674
|
await vt();
|
|
3614
3675
|
let n = t.indexURL || await tr();
|
|
3615
|
-
n =
|
|
3676
|
+
n = lt(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
|
|
3616
3677
|
let s = { fullStdLib: !1, jsglobals: globalThis, stdin: globalThis.prompt ? globalThis.prompt : void 0, lockFileURL: n + "pyodide-lock.json", args: [], env: {}, packageCacheDir: n, packages: [], enableRunUntilComplete: !1, checkAPIVersion: !0, BUILD_ID: "bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4" }, a = Object.assign(s, t);
|
|
3617
3678
|
(e = a.env).HOME ?? (e.HOME = "/home/pyodide"), (r = a.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
|
|
3618
3679
|
let i = nr(a), o = i.API;
|
|
@@ -3627,7 +3688,7 @@ var rs = pr((as, mt) => {
|
|
|
3627
3688
|
}
|
|
3628
3689
|
let c = await _createPyodideModule(i);
|
|
3629
3690
|
if (i.exited) throw i.exited.toThrow;
|
|
3630
|
-
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !==
|
|
3691
|
+
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== ft && a.checkAPIVersion) throw new Error(`Pyodide version does not match: '${ft}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
|
|
3631
3692
|
c.locateFile = (x) => {
|
|
3632
3693
|
throw new Error("Didn't expect to load any more file_packager files!");
|
|
3633
3694
|
};
|
|
@@ -3636,76 +3697,12 @@ var rs = pr((as, mt) => {
|
|
|
3636
3697
|
let w = o.finalizeBootstrap(l, t._snapshotDeserializer);
|
|
3637
3698
|
return o.sys.path.insert(0, o.config.env.HOME), w.version.includes("dev") || o.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${w.version}/full/`), o._pyodide.set_excepthook(), await o.packageIndexReady, o.initializeStreams(a.stdin, a.stdout, a.stderr), w;
|
|
3638
3699
|
}
|
|
3639
|
-
k(
|
|
3640
|
-
|
|
3641
|
-
function Wn(t) {
|
|
3642
|
-
return t.includes("dev") && Bn ? "dev" : `v${lt}`;
|
|
3643
|
-
}
|
|
3644
|
-
function ke(t) {
|
|
3645
|
-
return t.FS;
|
|
3646
|
-
}
|
|
3647
|
-
const pt = (t) => new TextDecoder().decode(t), ge = "notebook.py", ve = "/marimo", B = {
|
|
3648
|
-
NOTEBOOK_FILENAME: ge,
|
|
3649
|
-
HOME_DIR: ve,
|
|
3650
|
-
createHomeDir: (t) => {
|
|
3651
|
-
const e = ke(t);
|
|
3652
|
-
try {
|
|
3653
|
-
e.mkdirTree(ve);
|
|
3654
|
-
} catch {
|
|
3655
|
-
}
|
|
3656
|
-
e.chdir(ve);
|
|
3657
|
-
},
|
|
3658
|
-
mountFS: (t) => {
|
|
3659
|
-
ke(t).mount(t.FS.filesystems.IDBFS, { root: "." }, ve);
|
|
3660
|
-
},
|
|
3661
|
-
populateFilesToMemory: async (t) => {
|
|
3662
|
-
await Ot(t, !0);
|
|
3663
|
-
},
|
|
3664
|
-
persistFilesToRemote: async (t) => {
|
|
3665
|
-
await Ot(t, !1);
|
|
3666
|
-
},
|
|
3667
|
-
readNotebook: (t) => {
|
|
3668
|
-
const e = ke(t), r = `${ve}/${ge}`;
|
|
3669
|
-
return pt(e.readFile(r));
|
|
3670
|
-
},
|
|
3671
|
-
initNotebookCode: (t) => {
|
|
3672
|
-
const { pyodide: e, filename: r, code: n } = t, s = ke(e), a = (i) => {
|
|
3673
|
-
try {
|
|
3674
|
-
return pt(s.readFile(i));
|
|
3675
|
-
} catch {
|
|
3676
|
-
return null;
|
|
3677
|
-
}
|
|
3678
|
-
};
|
|
3679
|
-
if (r && r !== ge) {
|
|
3680
|
-
const i = a(r);
|
|
3681
|
-
if (i)
|
|
3682
|
-
return {
|
|
3683
|
-
code: i,
|
|
3684
|
-
filename: r
|
|
3685
|
-
};
|
|
3686
|
-
}
|
|
3687
|
-
return s.writeFile(ge, n), {
|
|
3688
|
-
code: n,
|
|
3689
|
-
filename: ge
|
|
3690
|
-
};
|
|
3691
|
-
}
|
|
3692
|
-
};
|
|
3693
|
-
function Ot(t, e) {
|
|
3694
|
-
return new Promise((r, n) => {
|
|
3695
|
-
ke(t).syncfs(e, (s) => {
|
|
3696
|
-
if (s instanceof Error) {
|
|
3697
|
-
n(s);
|
|
3698
|
-
return;
|
|
3699
|
-
}
|
|
3700
|
-
r();
|
|
3701
|
-
});
|
|
3702
|
-
});
|
|
3703
|
-
}
|
|
3704
|
-
function Jn(t, e) {
|
|
3700
|
+
k(pt, "loadPyodide");
|
|
3701
|
+
function Bn(t, e) {
|
|
3705
3702
|
if (!t)
|
|
3706
3703
|
throw new Error(e);
|
|
3707
3704
|
}
|
|
3708
|
-
class
|
|
3705
|
+
class Wn {
|
|
3709
3706
|
constructor() {
|
|
3710
3707
|
this.spans = [];
|
|
3711
3708
|
}
|
|
@@ -3747,25 +3744,25 @@ var rs = pr((as, mt) => {
|
|
|
3747
3744
|
logSpans() {
|
|
3748
3745
|
}
|
|
3749
3746
|
}
|
|
3750
|
-
const ue = new
|
|
3747
|
+
const ue = new Wn();
|
|
3751
3748
|
globalThis.t = ue;
|
|
3752
|
-
const
|
|
3753
|
-
class
|
|
3749
|
+
const Jn = !1;
|
|
3750
|
+
class Yn {
|
|
3754
3751
|
constructor() {
|
|
3755
3752
|
this.pyodide = null;
|
|
3756
3753
|
}
|
|
3757
3754
|
get requirePyodide() {
|
|
3758
|
-
return
|
|
3755
|
+
return Bn(this.pyodide, "Pyodide not loaded"), this.pyodide;
|
|
3759
3756
|
}
|
|
3760
3757
|
async bootstrap(e) {
|
|
3761
3758
|
return await this.loadPyodideAndPackages(e);
|
|
3762
3759
|
}
|
|
3763
3760
|
async loadPyodideAndPackages(e) {
|
|
3764
|
-
if (!
|
|
3761
|
+
if (!pt)
|
|
3765
3762
|
throw new Error("loadPyodide is not defined");
|
|
3766
3763
|
const r = ue.startSpan("loadPyodide");
|
|
3767
3764
|
try {
|
|
3768
|
-
const n = await
|
|
3765
|
+
const n = await pt({
|
|
3769
3766
|
// Perf: These get loaded while pyodide is being bootstrapped
|
|
3770
3767
|
packages: [
|
|
3771
3768
|
"micropip",
|
|
@@ -3775,7 +3772,7 @@ var rs = pr((as, mt) => {
|
|
|
3775
3772
|
"narwhals",
|
|
3776
3773
|
"packaging"
|
|
3777
3774
|
],
|
|
3778
|
-
_makeSnapshot:
|
|
3775
|
+
_makeSnapshot: Jn,
|
|
3779
3776
|
lockFileURL: `https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,
|
|
3780
3777
|
// Without this, this fails in Firefox with
|
|
3781
3778
|
// `Could not extract indexURL path from pyodide module`
|
|
@@ -3784,7 +3781,7 @@ var rs = pr((as, mt) => {
|
|
|
3784
3781
|
});
|
|
3785
3782
|
return this.pyodide = n, r.end("ok"), n;
|
|
3786
3783
|
} catch (n) {
|
|
3787
|
-
throw
|
|
3784
|
+
throw _e.error("Failed to load Pyodide", n), n;
|
|
3788
3785
|
}
|
|
3789
3786
|
}
|
|
3790
3787
|
async mountFilesystem(e) {
|
|
@@ -3845,8 +3842,8 @@ ${e}`;
|
|
|
3845
3842
|
const s = [...r];
|
|
3846
3843
|
let a = ue.startSpan("pyodide.loadPackage");
|
|
3847
3844
|
await n.loadPackagesFromImports(e, {
|
|
3848
|
-
errorCallback:
|
|
3849
|
-
messageCallback:
|
|
3845
|
+
errorCallback: _e.error,
|
|
3846
|
+
messageCallback: _e.log
|
|
3850
3847
|
}), a.end(), a = ue.startSpan("micropip.install");
|
|
3851
3848
|
const i = s.filter(
|
|
3852
3849
|
(o) => !n.loadedPackages[o]
|
|
@@ -3860,23 +3857,27 @@ ${e}`;
|
|
|
3860
3857
|
print("Loading from micropip:", missing)
|
|
3861
3858
|
await micropip.install(missing)
|
|
3862
3859
|
`).catch((o) => {
|
|
3863
|
-
|
|
3860
|
+
_e.error("Failed to load packages from micropip", o);
|
|
3864
3861
|
}), a.end();
|
|
3865
3862
|
}
|
|
3866
3863
|
}
|
|
3867
|
-
async function
|
|
3864
|
+
async function Kn(t) {
|
|
3868
3865
|
try {
|
|
3869
3866
|
return await import(
|
|
3870
3867
|
/* @vite-ignore */
|
|
3871
3868
|
`/wasm/controller.js?version=${t}`
|
|
3872
3869
|
);
|
|
3873
3870
|
} catch {
|
|
3874
|
-
return new
|
|
3871
|
+
return new Yn();
|
|
3875
3872
|
}
|
|
3876
3873
|
}
|
|
3874
|
+
const Gn = !1;
|
|
3875
|
+
function Xn(t) {
|
|
3876
|
+
return t.includes("dev") && Gn ? "dev" : `v${ft}`;
|
|
3877
|
+
}
|
|
3877
3878
|
async function Qn() {
|
|
3878
3879
|
try {
|
|
3879
|
-
const t = ts(), e =
|
|
3880
|
+
const t = ts(), e = Xn(t), r = await Kn(t);
|
|
3880
3881
|
self.controller = r, self.pyodide = await r.bootstrap({
|
|
3881
3882
|
version: t,
|
|
3882
3883
|
pyodideVersion: e
|
|
@@ -3885,11 +3886,11 @@ ${e}`;
|
|
|
3885
3886
|
filename: null
|
|
3886
3887
|
}), ht.send.initialized({});
|
|
3887
3888
|
} catch (t) {
|
|
3888
|
-
|
|
3889
|
+
_e.error("Error bootstrapping", t), ht.send.initializedError({ error: In(t) });
|
|
3889
3890
|
}
|
|
3890
3891
|
}
|
|
3891
3892
|
const nt = Qn(), es = {
|
|
3892
|
-
readFile: async (t) => (await nt,
|
|
3893
|
+
readFile: async (t) => (await nt, st(self.pyodide.FS.readFile(t))),
|
|
3893
3894
|
readNotebook: async () => (await nt, B.readNotebook(self.pyodide)),
|
|
3894
3895
|
saveNotebook: async (t) => {
|
|
3895
3896
|
await nt, await self.pyodide.runPython(`
|
|
@@ -3898,8 +3899,8 @@ ${e}`;
|
|
|
3898
3899
|
save_file
|
|
3899
3900
|
`)(JSON.stringify(t), B.NOTEBOOK_FILENAME), await B.persistFilesToRemote(self.pyodide);
|
|
3900
3901
|
}
|
|
3901
|
-
}, ht =
|
|
3902
|
-
transport:
|
|
3902
|
+
}, ht = gr({
|
|
3903
|
+
transport: br({
|
|
3903
3904
|
transportId: jn
|
|
3904
3905
|
}),
|
|
3905
3906
|
requestHandler: es
|