@marimo-team/islands 0.13.16-dev1 → 0.13.16-dev100
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-C4lg6WvO.js → ConnectedDataExplorerComponent-vrARwYxE.js} +1651 -1653
- package/dist/ImageComparisonComponent-m9d4jyDR.js +248 -0
- package/dist/VegaLite-BM3pVXw2.js +36029 -0
- package/dist/{_baseUniq-CqHdJYki.js → _baseUniq-BKFPcxpI.js} +13 -13
- package/dist/any-language-editor-DoX-PQu0.js +45 -0
- package/dist/{architectureDiagram-IEHRJDOE-CJBt_cJx.js → architectureDiagram-IEHRJDOE-DbalWqMN.js} +1800 -1800
- package/dist/asn1-jKiBa2Ya.js +10 -10
- package/dist/assets/{save-worker-9HEtFDM0.js → save-worker-CtVuV4Hi.js} +838 -844
- package/dist/assets/{worker-BGGm0KYZ.js → worker-BU1a2jgP.js} +866 -872
- package/dist/assets/{worker-BNsqBj5w.js → worker-Tb399Bgs.js} +3420 -3424
- package/dist/blockDiagram-JOT3LUYC-vxt9N4N0.js +2249 -0
- package/dist/{c4Diagram-VJAJSXHY-C-yy5YOk.js → c4Diagram-VJAJSXHY-DA924Uqr.js} +401 -400
- package/dist/{channel-nlDKUO5V.js → channel-BNFWU0qj.js} +1 -1
- package/dist/chunk-4BMEZGHF-D-kwEajx.js +9 -0
- package/dist/chunk-A2AXSNBT-mnA-dvyL.js +1373 -0
- package/dist/chunk-AEK57VVT-DfZ4LFZA.js +1416 -0
- package/dist/{chunk-D6G4REZN-DqBAgqjZ.js → chunk-D6G4REZN-DhzRGH5j.js} +2 -2
- package/dist/{chunk-RZ5BOZE2-CIuUvSxj.js → chunk-RZ5BOZE2-Df8bxccr.js} +8 -8
- package/dist/chunk-XZIHB7SX-DGGTR7BI.js +16 -0
- package/dist/{classDiagram-GIVACNV2-DZEBEdiS.js → classDiagram-GIVACNV2-BM7szU-p.js} +2 -2
- package/dist/{classDiagram-v2-COTLJTTW-DZEBEdiS.js → classDiagram-v2-COTLJTTW-BM7szU-p.js} +2 -2
- package/dist/clojure-CCKyeQKf.js +2 -2
- package/dist/{clone-B6TsxdPq.js → clone-ChUTYvhR.js} +1 -1
- package/dist/css-bIlmDBTK.js +19 -19
- package/dist/{cytoscape.esm-DAyNQ0qu.js → cytoscape.esm-CCQ3SVU1.js} +2301 -2301
- package/dist/dagre-OKDRZEBW-CGYLUe7b.js +447 -0
- package/dist/{data-editor-DcBCvQu_.js → data-editor-CqVMOKSx.js} +5785 -5795
- package/dist/{diagram-SSKATNLV-gHHGNb1o.js → diagram-SSKATNLV-INSQH2O3.js} +13 -13
- package/dist/{diagram-VNBRO52H-B8PrANsV.js → diagram-VNBRO52H-E2lgExBZ.js} +3 -3
- package/dist/{erDiagram-Q7BY3M3F-BvXMy7ds.js → erDiagram-Q7BY3M3F-B9XVc4sN.js} +263 -262
- package/dist/flowDiagram-4HSFHLVR-BmDgLkBR.js +1623 -0
- package/dist/{ganttDiagram-APWFNJXF-CXvGZ1tB.js → ganttDiagram-APWFNJXF-xvOUnGih.js} +45 -45
- package/dist/gitGraphDiagram-7IBYFJ6S-BDNJD_4s.js +712 -0
- package/dist/{graph-CLTIT-rM.js → graph-B1kC92m3.js} +9 -9
- package/dist/{index-D918hshO.js → index-BeP8XLVf.js} +107 -106
- package/dist/{index-CFnbzzJT.js → index-BmgeA7zl.js} +4 -4
- package/dist/{index-C2y-wjw9.js → index-CVxbkLgR.js} +9 -9
- package/dist/{index-D4AyYSc-.js → index-DSZ4Bzcr.js} +28 -28
- package/dist/{infoDiagram-PH2N3AL5-C8wRTnZ3.js → infoDiagram-PH2N3AL5-DWUhqj86.js} +3 -3
- package/dist/javascript-WMWNx-Vj.js +47 -47
- package/dist/{journeyDiagram-U35MCT3I-Dt70xoNj.js → journeyDiagram-U35MCT3I-D-a9EVQW.js} +18 -18
- package/dist/kanban-definition-NDS4AKOZ-OWmu-q9c.js +719 -0
- package/dist/{katex-9tX9hjoM.js → katex-CUSbq6rG.js} +2180 -2180
- package/dist/{layout-GgC31MfB.js → layout-CSpWapat.js} +27 -27
- package/dist/{linear-Bdn7-YnQ.js → linear-JNsJWFlM.js} +2 -2
- package/dist/main-CogZooDC.js +168224 -0
- package/dist/main.js +1 -1
- package/dist/mermaid-BSHpbWYL.js +14517 -0
- package/dist/{mhchem-L5-rce7L.js → mhchem-Db_f2n8C.js} +30 -30
- package/dist/{min-DEm-Bgo8.js → min-DJ8TFP7s.js} +2 -2
- package/dist/{mindmap-definition-ALO5MXBD-CnwLpJXd.js → mindmap-definition-ALO5MXBD-CD8BfQLX.js} +359 -359
- package/dist/mllike-BSnXJBGA.js +7 -7
- package/dist/{pieDiagram-IB7DONF6-BSVeFstR.js → pieDiagram-IB7DONF6-BcHbXepJ.js} +34 -34
- package/dist/pug-BqUR2bBq.js +35 -35
- package/dist/python-B5QdSKoL.js +18 -18
- package/dist/quadrantDiagram-7GDLP6J5-Ccdvm8Zt.js +1025 -0
- package/dist/{radar-MK3ICKWK-CE3UYlPE.js → radar-MK3ICKWK-apVjQGPF.js} +2555 -2554
- package/dist/{react-plotly-Dzix_ayx.js → react-plotly-Df98sQl5.js} +6595 -6597
- package/dist/{requirementDiagram-KVF5MWMF-Dr6JfEas.js → requirementDiagram-KVF5MWMF-CPe5eLDw.js} +251 -250
- package/dist/rpm-IznJm2Xc.js +9 -9
- package/dist/{sankeyDiagram-QLVOVGJD-VRJ-7td4.js → sankeyDiagram-QLVOVGJD-BinA8Lh3.js} +339 -338
- package/dist/{sequenceDiagram-X6HHIX6F-Dvd-1Hka.js → sequenceDiagram-X6HHIX6F-egi_2Zz-.js} +822 -821
- package/dist/{slides-component-2jiSuHN0.js → slides-component-Bw2PqiFj.js} +3231 -3231
- package/dist/sql-mMre1Bo3.js +9 -9
- package/dist/{stateDiagram-DGXRK772-C2H3qTjE.js → stateDiagram-DGXRK772-Ch4lb-af.js} +17 -17
- package/dist/{stateDiagram-v2-YXO3MK2T-wsWxga8R.js → stateDiagram-v2-YXO3MK2T-C4M8cpBt.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{time-COXzN_sj.js → time-DrIMyKm3.js} +2 -2
- package/dist/{timeline-definition-BDJGKUSR-j48AuNW4.js → timeline-definition-BDJGKUSR-B8fhx1LZ.js} +261 -261
- package/dist/timer-BYwnU4DF.js +378 -378
- package/dist/ttcn-cfg-Bac_acMi.js +9 -9
- package/dist/{vega-component-DaS5RZh7.js → vega-component-CMWUi5AZ.js} +111 -111
- package/dist/{xychartDiagram-VJFVF3MP-DBxCy3z5.js → xychartDiagram-VJFVF3MP-DU4m5h5D.js} +472 -471
- package/package.json +26 -26
- package/dist/VegaLite-D5N6vx9w.js +0 -36326
- package/dist/any-language-editor-Wvx3toF4.js +0 -45
- package/dist/blockDiagram-JOT3LUYC-C2MVNwUw.js +0 -2248
- package/dist/chunk-4BMEZGHF-DXhrksbF.js +0 -9
- package/dist/chunk-A2AXSNBT-yapD4PZC.js +0 -1372
- package/dist/chunk-AEK57VVT-Cva-aSWE.js +0 -1415
- package/dist/chunk-XZIHB7SX-DtJFMI1l.js +0 -15
- package/dist/dagre-OKDRZEBW-C8AmO6Uf.js +0 -447
- package/dist/flowDiagram-4HSFHLVR-CdWDR3le.js +0 -1622
- package/dist/gitGraphDiagram-7IBYFJ6S-EppRhmRN.js +0 -712
- package/dist/kanban-definition-NDS4AKOZ-CGtT-Ej_.js +0 -719
- package/dist/main-mN5dINk1.js +0 -156522
- package/dist/mermaid-CakMewtQ.js +0 -11991
- package/dist/quadrantDiagram-7GDLP6J5-Dt2JAcYW.js +0 -1024
|
@@ -1,20 +1,202 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var _r = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
2
|
+
var ls = _r((ps, mt) => {
|
|
3
|
+
const wr = 1e10, kr = 1e3;
|
|
4
|
+
function De(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 br(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?.(vr);
|
|
16
|
+
}
|
|
17
|
+
let a;
|
|
18
|
+
function i(g) {
|
|
19
|
+
if (typeof g == "function") {
|
|
20
|
+
a = g;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
a = (S, E) => {
|
|
24
|
+
const N = g[S];
|
|
25
|
+
if (N)
|
|
26
|
+
return N(E);
|
|
27
|
+
const F = g._;
|
|
28
|
+
if (!F)
|
|
29
|
+
throw new Error(`The requested method has no handler: ${S}`);
|
|
30
|
+
return F(S, E);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const { maxRequestTime: o = kr } = t;
|
|
34
|
+
t.transport && s(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
35
|
+
let c = 0;
|
|
36
|
+
function d() {
|
|
37
|
+
return c <= wr ? ++c : c = 0;
|
|
38
|
+
}
|
|
39
|
+
const u = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
40
|
+
function x(g, ...S) {
|
|
41
|
+
const E = S[0];
|
|
42
|
+
return new Promise((N, F) => {
|
|
43
|
+
if (!n.send)
|
|
44
|
+
throw De(["send"], "make requests");
|
|
45
|
+
const J = d(), bt = {
|
|
46
|
+
type: "request",
|
|
47
|
+
id: J,
|
|
48
|
+
method: g,
|
|
49
|
+
params: E
|
|
10
50
|
};
|
|
51
|
+
u.set(J, { resolve: N, reject: F }), o !== 1 / 0 && w.set(J, setTimeout(() => {
|
|
52
|
+
w.delete(J), F(new Error("RPC request timed out."));
|
|
53
|
+
}, o)), e.onSend?.(bt), n.send(bt);
|
|
11
54
|
});
|
|
12
55
|
}
|
|
56
|
+
const P = new Proxy(x, {
|
|
57
|
+
get: (g, S, E) => S in g ? Reflect.get(g, S, E) : (N) => x(S, N)
|
|
58
|
+
}), q = P;
|
|
59
|
+
function Le(g, ...S) {
|
|
60
|
+
const E = S[0];
|
|
61
|
+
if (!n.send)
|
|
62
|
+
throw De(["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(Le, {
|
|
71
|
+
get: (g, S, E) => S in g ? Reflect.get(g, S, E) : (N) => Le(S, N)
|
|
72
|
+
}), kt = wt, te = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Set();
|
|
73
|
+
function yr(g, S) {
|
|
74
|
+
if (!n.registerHandler)
|
|
75
|
+
throw De(["registerHandler"], "register message listeners");
|
|
76
|
+
if (g === "*") {
|
|
77
|
+
rt.add(S);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
te.has(g) || te.set(g, /* @__PURE__ */ new Set()), te.get(g)?.add(S);
|
|
81
|
+
}
|
|
82
|
+
function gr(g, S) {
|
|
83
|
+
if (g === "*") {
|
|
84
|
+
rt.delete(S);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
te.get(g)?.delete(S), te.get(g)?.size === 0 && te.delete(g);
|
|
88
|
+
}
|
|
89
|
+
async function vr(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 De(["send", "requestHandler"], "handle requests");
|
|
95
|
+
const { id: S, method: E, params: N } = g;
|
|
96
|
+
let F;
|
|
97
|
+
try {
|
|
98
|
+
F = {
|
|
99
|
+
type: "response",
|
|
100
|
+
id: S,
|
|
101
|
+
success: !0,
|
|
102
|
+
payload: await a(E, N)
|
|
103
|
+
};
|
|
104
|
+
} catch (J) {
|
|
105
|
+
if (!(J instanceof Error))
|
|
106
|
+
throw J;
|
|
107
|
+
F = {
|
|
108
|
+
type: "response",
|
|
109
|
+
id: S,
|
|
110
|
+
success: !1,
|
|
111
|
+
error: J.message
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
e.onSend?.(F), n.send(F);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (g.type === "response") {
|
|
118
|
+
const S = w.get(g.id);
|
|
119
|
+
S != null && clearTimeout(S);
|
|
120
|
+
const { resolve: E, reject: N } = u.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 rt)
|
|
126
|
+
E(g.id, g.payload);
|
|
127
|
+
const S = te.get(g.id);
|
|
128
|
+
if (!S)
|
|
129
|
+
return;
|
|
130
|
+
for (const E of S)
|
|
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: P,
|
|
140
|
+
requestProxy: q,
|
|
141
|
+
send: wt,
|
|
142
|
+
sendProxy: kt,
|
|
143
|
+
addMessageListener: yr,
|
|
144
|
+
removeMessageListener: gr,
|
|
145
|
+
proxy: { send: kt, request: q },
|
|
146
|
+
_setDebugHooks: r
|
|
147
|
+
};
|
|
13
148
|
}
|
|
14
|
-
function
|
|
15
|
-
return t
|
|
149
|
+
function xr(t) {
|
|
150
|
+
return br(t);
|
|
151
|
+
}
|
|
152
|
+
const Pt = "[transport-id]";
|
|
153
|
+
function Sr(t, e) {
|
|
154
|
+
const { transportId: r } = e;
|
|
155
|
+
return r != null ? { [Pt]: r, data: t } : t;
|
|
156
|
+
}
|
|
157
|
+
function Tr(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[Pt] !== r)
|
|
164
|
+
return [!0];
|
|
165
|
+
a = t.data;
|
|
166
|
+
}
|
|
167
|
+
return s === !1 ? [!0] : [!1, a];
|
|
168
|
+
}
|
|
169
|
+
function Er(t, e = {}) {
|
|
170
|
+
const { transportId: r, filter: n, remotePort: s } = e, a = t, i = s ?? t;
|
|
171
|
+
let o;
|
|
172
|
+
return {
|
|
173
|
+
send(c) {
|
|
174
|
+
i.postMessage(Sr(c, { transportId: r }));
|
|
175
|
+
},
|
|
176
|
+
registerHandler(c) {
|
|
177
|
+
o = (d) => {
|
|
178
|
+
const u = d.data, [w, x] = Tr(u, {
|
|
179
|
+
transportId: r,
|
|
180
|
+
filter: () => n?.(d)
|
|
181
|
+
});
|
|
182
|
+
w || c(x);
|
|
183
|
+
}, a.addEventListener("message", o);
|
|
184
|
+
},
|
|
185
|
+
unregisterHandler() {
|
|
186
|
+
o && a.removeEventListener("message", o);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function Or(t) {
|
|
191
|
+
return Er(self, t);
|
|
192
|
+
}
|
|
193
|
+
function Nr(t) {
|
|
194
|
+
let e, r = !1;
|
|
195
|
+
return function(...n) {
|
|
196
|
+
return r || (r = !0, e = t.apply(this, n)), e;
|
|
197
|
+
};
|
|
16
198
|
}
|
|
17
|
-
const
|
|
199
|
+
const _e = {
|
|
18
200
|
NOOP: () => {
|
|
19
201
|
}
|
|
20
202
|
}, Ct = (t, e) => {
|
|
@@ -26,9 +208,9 @@ var us = wr((hs, gt) => {
|
|
|
26
208
|
error: (...n) => e.error(r, ...n),
|
|
27
209
|
trace: (...n) => e.trace(r, ...n),
|
|
28
210
|
get: (n) => Ct(`${t}.${n}`, e),
|
|
29
|
-
disabled: (n = !0) => n ?
|
|
211
|
+
disabled: (n = !0) => n ? Ue : e
|
|
30
212
|
};
|
|
31
|
-
},
|
|
213
|
+
}, qe = {
|
|
32
214
|
debug: (...t) => {
|
|
33
215
|
console.debug(...t);
|
|
34
216
|
},
|
|
@@ -44,84 +226,30 @@ var us = wr((hs, gt) => {
|
|
|
44
226
|
trace: (...t) => {
|
|
45
227
|
console.trace(...t);
|
|
46
228
|
},
|
|
47
|
-
get: (t) => Ct(t,
|
|
48
|
-
disabled: (t = !0) => t ?
|
|
49
|
-
},
|
|
50
|
-
debug: () =>
|
|
51
|
-
log: () =>
|
|
52
|
-
warn: () =>
|
|
53
|
-
error: () =>
|
|
54
|
-
trace: () =>
|
|
55
|
-
get: () =>
|
|
56
|
-
disabled: () =>
|
|
229
|
+
get: (t) => Ct(t, qe),
|
|
230
|
+
disabled: (t = !0) => t ? Ue : qe
|
|
231
|
+
}, Ue = {
|
|
232
|
+
debug: () => _e.NOOP,
|
|
233
|
+
log: () => _e.NOOP,
|
|
234
|
+
warn: () => _e.NOOP,
|
|
235
|
+
error: () => _e.NOOP,
|
|
236
|
+
trace: () => _e.NOOP,
|
|
237
|
+
get: () => Ue,
|
|
238
|
+
disabled: () => Ue
|
|
57
239
|
};
|
|
58
|
-
function
|
|
59
|
-
return typeof window < "u" && window.Logger ||
|
|
240
|
+
function Rr() {
|
|
241
|
+
return typeof window < "u" && window.Logger || qe;
|
|
60
242
|
}
|
|
61
|
-
const Y =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
e.chdir(xe);
|
|
71
|
-
},
|
|
72
|
-
mountFS: (t) => {
|
|
73
|
-
Se(t).mount(t.FS.filesystems.IDBFS, { root: "." }, xe);
|
|
74
|
-
},
|
|
75
|
-
populateFilesToMemory: async (t) => {
|
|
76
|
-
await St(t, !0);
|
|
77
|
-
},
|
|
78
|
-
persistFilesToRemote: async (t) => {
|
|
79
|
-
await St(t, !1);
|
|
80
|
-
},
|
|
81
|
-
readNotebook: (t) => {
|
|
82
|
-
const e = Se(t), r = `${xe}/${be}`;
|
|
83
|
-
return ot(e.readFile(r));
|
|
84
|
-
},
|
|
85
|
-
initNotebookCode: (t) => {
|
|
86
|
-
const { pyodide: e, filename: r, code: n } = t, s = Se(e), a = (i) => {
|
|
87
|
-
try {
|
|
88
|
-
return ot(s.readFile(i));
|
|
89
|
-
} catch {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
if (r && r !== be) {
|
|
94
|
-
const i = a(r);
|
|
95
|
-
if (i)
|
|
96
|
-
return {
|
|
97
|
-
code: i,
|
|
98
|
-
filename: r
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
return s.writeFile(be, n), {
|
|
102
|
-
code: n,
|
|
103
|
-
filename: be
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
function St(t, e) {
|
|
108
|
-
return new Promise((r, n) => {
|
|
109
|
-
Se(t).syncfs(e, (s) => {
|
|
110
|
-
if (s instanceof Error) {
|
|
111
|
-
n(s);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
r();
|
|
243
|
+
const Y = Rr(), at = (t) => new TextDecoder().decode(t);
|
|
244
|
+
class Ar {
|
|
245
|
+
constructor() {
|
|
246
|
+
this.status = "pending", this.promise = new Promise((e, r) => {
|
|
247
|
+
this.reject = (n) => {
|
|
248
|
+
this.status = "rejected", r(n);
|
|
249
|
+
}, this.resolve = (n) => {
|
|
250
|
+
this.status = "resolved", e(n);
|
|
251
|
+
};
|
|
115
252
|
});
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
class xr {
|
|
119
|
-
constructor(e) {
|
|
120
|
-
this.onMessage = e, this.started = !1, this.push = (r) => {
|
|
121
|
-
this.started ? this.onMessage(r) : this.buffer.push(r);
|
|
122
|
-
}, this.start = () => {
|
|
123
|
-
this.started = !0, this.buffer.forEach((r) => this.onMessage(r)), this.buffer = [];
|
|
124
|
-
}, this.buffer = [];
|
|
125
253
|
}
|
|
126
254
|
}
|
|
127
255
|
var k;
|
|
@@ -160,14 +288,14 @@ var us = wr((hs, gt) => {
|
|
|
160
288
|
}
|
|
161
289
|
t.joinValues = n, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
162
290
|
})(k || (k = {}));
|
|
163
|
-
var
|
|
291
|
+
var it;
|
|
164
292
|
(function(t) {
|
|
165
293
|
t.mergeShapes = (e, r) => ({
|
|
166
294
|
...e,
|
|
167
295
|
...r
|
|
168
296
|
// second overwrites first
|
|
169
297
|
});
|
|
170
|
-
})(
|
|
298
|
+
})(it || (it = {}));
|
|
171
299
|
const p = k.arrayToEnum([
|
|
172
300
|
"string",
|
|
173
301
|
"nan",
|
|
@@ -189,7 +317,7 @@ var us = wr((hs, gt) => {
|
|
|
189
317
|
"never",
|
|
190
318
|
"map",
|
|
191
319
|
"set"
|
|
192
|
-
]),
|
|
320
|
+
]), B = (t) => {
|
|
193
321
|
switch (typeof t) {
|
|
194
322
|
case "undefined":
|
|
195
323
|
return p.undefined;
|
|
@@ -227,8 +355,8 @@ var us = wr((hs, gt) => {
|
|
|
227
355
|
"invalid_intersection_types",
|
|
228
356
|
"not_multiple_of",
|
|
229
357
|
"not_finite"
|
|
230
|
-
]),
|
|
231
|
-
class
|
|
358
|
+
]), Pr = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
359
|
+
class C extends Error {
|
|
232
360
|
get errors() {
|
|
233
361
|
return this.issues;
|
|
234
362
|
}
|
|
@@ -265,7 +393,7 @@ var us = wr((hs, gt) => {
|
|
|
265
393
|
return s(this), n;
|
|
266
394
|
}
|
|
267
395
|
static assert(e) {
|
|
268
|
-
if (!(e instanceof
|
|
396
|
+
if (!(e instanceof C))
|
|
269
397
|
throw new Error(`Not a ZodError: ${e}`);
|
|
270
398
|
}
|
|
271
399
|
toString() {
|
|
@@ -287,8 +415,8 @@ var us = wr((hs, gt) => {
|
|
|
287
415
|
return this.flatten();
|
|
288
416
|
}
|
|
289
417
|
}
|
|
290
|
-
|
|
291
|
-
const
|
|
418
|
+
C.create = (t) => new C(t);
|
|
419
|
+
const ye = (t, e) => {
|
|
292
420
|
let r;
|
|
293
421
|
switch (t.code) {
|
|
294
422
|
case l.invalid_type:
|
|
@@ -344,14 +472,14 @@ var us = wr((hs, gt) => {
|
|
|
344
472
|
}
|
|
345
473
|
return { message: r };
|
|
346
474
|
};
|
|
347
|
-
let It =
|
|
348
|
-
function
|
|
475
|
+
let It = ye;
|
|
476
|
+
function Cr(t) {
|
|
349
477
|
It = t;
|
|
350
478
|
}
|
|
351
|
-
function
|
|
479
|
+
function Be() {
|
|
352
480
|
return It;
|
|
353
481
|
}
|
|
354
|
-
const
|
|
482
|
+
const He = (t) => {
|
|
355
483
|
const { data: e, path: r, errorMaps: n, issueData: s } = t, a = [...r, ...s.path || []], i = {
|
|
356
484
|
...s,
|
|
357
485
|
path: a
|
|
@@ -371,9 +499,9 @@ var us = wr((hs, gt) => {
|
|
|
371
499
|
path: a,
|
|
372
500
|
message: o
|
|
373
501
|
};
|
|
374
|
-
},
|
|
502
|
+
}, Ir = [];
|
|
375
503
|
function f(t, e) {
|
|
376
|
-
const r =
|
|
504
|
+
const r = Be(), n = He({
|
|
377
505
|
issueData: e,
|
|
378
506
|
data: t.data,
|
|
379
507
|
path: t.path,
|
|
@@ -384,13 +512,13 @@ var us = wr((hs, gt) => {
|
|
|
384
512
|
// then schema-bound map if available
|
|
385
513
|
r,
|
|
386
514
|
// then global override map
|
|
387
|
-
r ===
|
|
515
|
+
r === ye ? void 0 : ye
|
|
388
516
|
// then global default map
|
|
389
517
|
].filter((s) => !!s)
|
|
390
518
|
});
|
|
391
519
|
t.common.issues.push(n);
|
|
392
520
|
}
|
|
393
|
-
class
|
|
521
|
+
class O {
|
|
394
522
|
constructor() {
|
|
395
523
|
this.value = "valid";
|
|
396
524
|
}
|
|
@@ -418,7 +546,7 @@ var us = wr((hs, gt) => {
|
|
|
418
546
|
value: i
|
|
419
547
|
});
|
|
420
548
|
}
|
|
421
|
-
return
|
|
549
|
+
return O.mergeObjectSync(e, n);
|
|
422
550
|
}
|
|
423
551
|
static mergeObjectSync(e, r) {
|
|
424
552
|
const n = {};
|
|
@@ -433,8 +561,8 @@ var us = wr((hs, gt) => {
|
|
|
433
561
|
}
|
|
434
562
|
const y = Object.freeze({
|
|
435
563
|
status: "aborted"
|
|
436
|
-
}),
|
|
437
|
-
function
|
|
564
|
+
}), he = (t) => ({ status: "dirty", value: t }), A = (t) => ({ status: "valid", value: t }), ot = (t) => t.status === "aborted", ct = (t) => t.status === "dirty", oe = (t) => t.status === "valid", Te = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
565
|
+
function We(t, e, r, n) {
|
|
438
566
|
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");
|
|
439
567
|
return e.get(t);
|
|
440
568
|
}
|
|
@@ -444,10 +572,10 @@ var us = wr((hs, gt) => {
|
|
|
444
572
|
}
|
|
445
573
|
var h;
|
|
446
574
|
(function(t) {
|
|
447
|
-
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e
|
|
575
|
+
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
448
576
|
})(h || (h = {}));
|
|
449
|
-
var
|
|
450
|
-
class
|
|
577
|
+
var be, xe;
|
|
578
|
+
class D {
|
|
451
579
|
constructor(e, r, n, s) {
|
|
452
580
|
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = s;
|
|
453
581
|
}
|
|
@@ -455,8 +583,8 @@ var us = wr((hs, gt) => {
|
|
|
455
583
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
456
584
|
}
|
|
457
585
|
}
|
|
458
|
-
const
|
|
459
|
-
if (
|
|
586
|
+
const xt = (t, e) => {
|
|
587
|
+
if (oe(e))
|
|
460
588
|
return { success: !0, data: e.value };
|
|
461
589
|
if (!t.common.issues.length)
|
|
462
590
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -465,7 +593,7 @@ var us = wr((hs, gt) => {
|
|
|
465
593
|
get error() {
|
|
466
594
|
if (this._error)
|
|
467
595
|
return this._error;
|
|
468
|
-
const r = new
|
|
596
|
+
const r = new C(t.common.issues);
|
|
469
597
|
return this._error = r, this._error;
|
|
470
598
|
}
|
|
471
599
|
};
|
|
@@ -487,13 +615,13 @@ var us = wr((hs, gt) => {
|
|
|
487
615
|
return this._def.description;
|
|
488
616
|
}
|
|
489
617
|
_getType(e) {
|
|
490
|
-
return
|
|
618
|
+
return B(e.data);
|
|
491
619
|
}
|
|
492
620
|
_getOrReturnCtx(e, r) {
|
|
493
621
|
return r || {
|
|
494
622
|
common: e.parent.common,
|
|
495
623
|
data: e.data,
|
|
496
|
-
parsedType:
|
|
624
|
+
parsedType: B(e.data),
|
|
497
625
|
schemaErrorMap: this._def.errorMap,
|
|
498
626
|
path: e.path,
|
|
499
627
|
parent: e.parent
|
|
@@ -501,11 +629,11 @@ var us = wr((hs, gt) => {
|
|
|
501
629
|
}
|
|
502
630
|
_processInputParams(e) {
|
|
503
631
|
return {
|
|
504
|
-
status: new
|
|
632
|
+
status: new O(),
|
|
505
633
|
ctx: {
|
|
506
634
|
common: e.parent.common,
|
|
507
635
|
data: e.data,
|
|
508
|
-
parsedType:
|
|
636
|
+
parsedType: B(e.data),
|
|
509
637
|
schemaErrorMap: this._def.errorMap,
|
|
510
638
|
path: e.path,
|
|
511
639
|
parent: e.parent
|
|
@@ -514,7 +642,7 @@ var us = wr((hs, gt) => {
|
|
|
514
642
|
}
|
|
515
643
|
_parseSync(e) {
|
|
516
644
|
const r = this._parse(e);
|
|
517
|
-
if (
|
|
645
|
+
if (Te(r))
|
|
518
646
|
throw new Error("Synchronous parse encountered promise.");
|
|
519
647
|
return r;
|
|
520
648
|
}
|
|
@@ -533,16 +661,16 @@ var us = wr((hs, gt) => {
|
|
|
533
661
|
const s = {
|
|
534
662
|
common: {
|
|
535
663
|
issues: [],
|
|
536
|
-
async: (n = r
|
|
537
|
-
contextualErrorMap: r
|
|
664
|
+
async: (n = r?.async) !== null && n !== void 0 ? n : !1,
|
|
665
|
+
contextualErrorMap: r?.errorMap
|
|
538
666
|
},
|
|
539
|
-
path:
|
|
667
|
+
path: r?.path || [],
|
|
540
668
|
schemaErrorMap: this._def.errorMap,
|
|
541
669
|
parent: null,
|
|
542
670
|
data: e,
|
|
543
|
-
parsedType:
|
|
671
|
+
parsedType: B(e)
|
|
544
672
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
545
|
-
return
|
|
673
|
+
return xt(s, a);
|
|
546
674
|
}
|
|
547
675
|
"~validate"(e) {
|
|
548
676
|
var r, n;
|
|
@@ -555,23 +683,23 @@ var us = wr((hs, gt) => {
|
|
|
555
683
|
schemaErrorMap: this._def.errorMap,
|
|
556
684
|
parent: null,
|
|
557
685
|
data: e,
|
|
558
|
-
parsedType:
|
|
686
|
+
parsedType: B(e)
|
|
559
687
|
};
|
|
560
688
|
if (!this["~standard"].async)
|
|
561
689
|
try {
|
|
562
690
|
const a = this._parseSync({ data: e, path: [], parent: s });
|
|
563
|
-
return
|
|
691
|
+
return oe(a) ? {
|
|
564
692
|
value: a.value
|
|
565
693
|
} : {
|
|
566
694
|
issues: s.common.issues
|
|
567
695
|
};
|
|
568
696
|
} catch (a) {
|
|
569
|
-
!((n = (r = a
|
|
697
|
+
!((n = (r = a?.message) === null || r === void 0 ? void 0 : r.toLowerCase()) === null || n === void 0) && n.includes("encountered") && (this["~standard"].async = !0), s.common = {
|
|
570
698
|
issues: [],
|
|
571
699
|
async: !0
|
|
572
700
|
};
|
|
573
701
|
}
|
|
574
|
-
return this._parseAsync({ data: e, path: [], parent: s }).then((a) =>
|
|
702
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((a) => oe(a) ? {
|
|
575
703
|
value: a.value
|
|
576
704
|
} : {
|
|
577
705
|
issues: s.common.issues
|
|
@@ -587,16 +715,16 @@ var us = wr((hs, gt) => {
|
|
|
587
715
|
const n = {
|
|
588
716
|
common: {
|
|
589
717
|
issues: [],
|
|
590
|
-
contextualErrorMap: r
|
|
718
|
+
contextualErrorMap: r?.errorMap,
|
|
591
719
|
async: !0
|
|
592
720
|
},
|
|
593
|
-
path:
|
|
721
|
+
path: r?.path || [],
|
|
594
722
|
schemaErrorMap: this._def.errorMap,
|
|
595
723
|
parent: null,
|
|
596
724
|
data: e,
|
|
597
|
-
parsedType:
|
|
598
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
599
|
-
return
|
|
725
|
+
parsedType: B(e)
|
|
726
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (Te(s) ? s : Promise.resolve(s));
|
|
727
|
+
return xt(n, a);
|
|
600
728
|
}
|
|
601
729
|
refine(e, r) {
|
|
602
730
|
const n = (s) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(s) : r;
|
|
@@ -612,7 +740,7 @@ var us = wr((hs, gt) => {
|
|
|
612
740
|
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof r == "function" ? r(n, s) : r), !1));
|
|
613
741
|
}
|
|
614
742
|
_refinement(e) {
|
|
615
|
-
return new
|
|
743
|
+
return new $({
|
|
616
744
|
schema: this,
|
|
617
745
|
typeName: m.ZodEffects,
|
|
618
746
|
effect: { type: "refinement", refinement: e }
|
|
@@ -629,7 +757,7 @@ var us = wr((hs, gt) => {
|
|
|
629
757
|
};
|
|
630
758
|
}
|
|
631
759
|
optional() {
|
|
632
|
-
return
|
|
760
|
+
return L.create(this, this._def);
|
|
633
761
|
}
|
|
634
762
|
nullable() {
|
|
635
763
|
return Q.create(this, this._def);
|
|
@@ -638,19 +766,19 @@ var us = wr((hs, gt) => {
|
|
|
638
766
|
return this.nullable().optional();
|
|
639
767
|
}
|
|
640
768
|
array() {
|
|
641
|
-
return
|
|
769
|
+
return j.create(this);
|
|
642
770
|
}
|
|
643
771
|
promise() {
|
|
644
|
-
return
|
|
772
|
+
return ve.create(this, this._def);
|
|
645
773
|
}
|
|
646
774
|
or(e) {
|
|
647
|
-
return
|
|
775
|
+
return Re.create([this, e], this._def);
|
|
648
776
|
}
|
|
649
777
|
and(e) {
|
|
650
|
-
return
|
|
778
|
+
return Ae.create(this, e, this._def);
|
|
651
779
|
}
|
|
652
780
|
transform(e) {
|
|
653
|
-
return new
|
|
781
|
+
return new $({
|
|
654
782
|
...v(this._def),
|
|
655
783
|
schema: this,
|
|
656
784
|
typeName: m.ZodEffects,
|
|
@@ -659,7 +787,7 @@ var us = wr((hs, gt) => {
|
|
|
659
787
|
}
|
|
660
788
|
default(e) {
|
|
661
789
|
const r = typeof e == "function" ? e : () => e;
|
|
662
|
-
return new
|
|
790
|
+
return new je({
|
|
663
791
|
...v(this._def),
|
|
664
792
|
innerType: this,
|
|
665
793
|
defaultValue: r,
|
|
@@ -667,7 +795,7 @@ var us = wr((hs, gt) => {
|
|
|
667
795
|
});
|
|
668
796
|
}
|
|
669
797
|
brand() {
|
|
670
|
-
return new
|
|
798
|
+
return new yt({
|
|
671
799
|
typeName: m.ZodBranded,
|
|
672
800
|
type: this,
|
|
673
801
|
...v(this._def)
|
|
@@ -675,7 +803,7 @@ var us = wr((hs, gt) => {
|
|
|
675
803
|
}
|
|
676
804
|
catch(e) {
|
|
677
805
|
const r = typeof e == "function" ? e : () => e;
|
|
678
|
-
return new
|
|
806
|
+
return new $e({
|
|
679
807
|
...v(this._def),
|
|
680
808
|
innerType: this,
|
|
681
809
|
catchValue: r,
|
|
@@ -690,10 +818,10 @@ var us = wr((hs, gt) => {
|
|
|
690
818
|
});
|
|
691
819
|
}
|
|
692
820
|
pipe(e) {
|
|
693
|
-
return
|
|
821
|
+
return Me.create(this, e);
|
|
694
822
|
}
|
|
695
823
|
readonly() {
|
|
696
|
-
return
|
|
824
|
+
return Fe.create(this);
|
|
697
825
|
}
|
|
698
826
|
isOptional() {
|
|
699
827
|
return this.safeParse(void 0).success;
|
|
@@ -702,14 +830,14 @@ var us = wr((hs, gt) => {
|
|
|
702
830
|
return this.safeParse(null).success;
|
|
703
831
|
}
|
|
704
832
|
}
|
|
705
|
-
const
|
|
706
|
-
let
|
|
707
|
-
const
|
|
833
|
+
const Zr = /^c[^\s-]{8,}$/i, jr = /^[0-9a-z]+$/, $r = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Fr = /^[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, Mr = /^[a-z0-9_-]{21}$/i, Lr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Dr = /^[-+]?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)?)??$/, Vr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, zr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
834
|
+
let nt;
|
|
835
|
+
const qr = /^(?:(?: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])$/, Ur = /^(?:(?: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])$/, Br = /^(([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]))$/, Hr = /^(([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])$/, Wr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Jr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, jt = "((\\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])))", Yr = new RegExp(`^${jt}$`);
|
|
708
836
|
function $t(t) {
|
|
709
837
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
710
838
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
711
839
|
}
|
|
712
|
-
function
|
|
840
|
+
function Kr(t) {
|
|
713
841
|
return new RegExp(`^${$t(t)}$`);
|
|
714
842
|
}
|
|
715
843
|
function Ft(t) {
|
|
@@ -717,11 +845,11 @@ var us = wr((hs, gt) => {
|
|
|
717
845
|
const r = [];
|
|
718
846
|
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
|
719
847
|
}
|
|
720
|
-
function
|
|
721
|
-
return !!((e === "v4" || !e) &&
|
|
848
|
+
function Gr(t, e) {
|
|
849
|
+
return !!((e === "v4" || !e) && qr.test(t) || (e === "v6" || !e) && Br.test(t));
|
|
722
850
|
}
|
|
723
|
-
function
|
|
724
|
-
if (!
|
|
851
|
+
function Xr(t, e) {
|
|
852
|
+
if (!Lr.test(t))
|
|
725
853
|
return !1;
|
|
726
854
|
try {
|
|
727
855
|
const [r] = t.split("."), n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
@@ -730,10 +858,10 @@ var us = wr((hs, gt) => {
|
|
|
730
858
|
return !1;
|
|
731
859
|
}
|
|
732
860
|
}
|
|
733
|
-
function
|
|
734
|
-
return !!((e === "v4" || !e) &&
|
|
861
|
+
function Qr(t, e) {
|
|
862
|
+
return !!((e === "v4" || !e) && Ur.test(t) || (e === "v6" || !e) && Hr.test(t));
|
|
735
863
|
}
|
|
736
|
-
class
|
|
864
|
+
class Z extends _ {
|
|
737
865
|
_parse(e) {
|
|
738
866
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
|
|
739
867
|
const a = this._getOrReturnCtx(e);
|
|
@@ -743,7 +871,7 @@ var us = wr((hs, gt) => {
|
|
|
743
871
|
received: a.parsedType
|
|
744
872
|
}), y;
|
|
745
873
|
}
|
|
746
|
-
const n = new
|
|
874
|
+
const n = new O();
|
|
747
875
|
let s;
|
|
748
876
|
for (const a of this._def.checks)
|
|
749
877
|
if (a.kind === "min")
|
|
@@ -782,43 +910,43 @@ var us = wr((hs, gt) => {
|
|
|
782
910
|
message: a.message
|
|
783
911
|
}), n.dirty());
|
|
784
912
|
} else if (a.kind === "email")
|
|
785
|
-
|
|
913
|
+
Vr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
786
914
|
validation: "email",
|
|
787
915
|
code: l.invalid_string,
|
|
788
916
|
message: a.message
|
|
789
917
|
}), n.dirty());
|
|
790
918
|
else if (a.kind === "emoji")
|
|
791
|
-
|
|
919
|
+
nt || (nt = new RegExp(zr, "u")), nt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
792
920
|
validation: "emoji",
|
|
793
921
|
code: l.invalid_string,
|
|
794
922
|
message: a.message
|
|
795
923
|
}), n.dirty());
|
|
796
924
|
else if (a.kind === "uuid")
|
|
797
|
-
|
|
925
|
+
Fr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
798
926
|
validation: "uuid",
|
|
799
927
|
code: l.invalid_string,
|
|
800
928
|
message: a.message
|
|
801
929
|
}), n.dirty());
|
|
802
930
|
else if (a.kind === "nanoid")
|
|
803
|
-
|
|
931
|
+
Mr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
804
932
|
validation: "nanoid",
|
|
805
933
|
code: l.invalid_string,
|
|
806
934
|
message: a.message
|
|
807
935
|
}), n.dirty());
|
|
808
936
|
else if (a.kind === "cuid")
|
|
809
|
-
|
|
937
|
+
Zr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
810
938
|
validation: "cuid",
|
|
811
939
|
code: l.invalid_string,
|
|
812
940
|
message: a.message
|
|
813
941
|
}), n.dirty());
|
|
814
942
|
else if (a.kind === "cuid2")
|
|
815
|
-
|
|
943
|
+
jr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
816
944
|
validation: "cuid2",
|
|
817
945
|
code: l.invalid_string,
|
|
818
946
|
message: a.message
|
|
819
947
|
}), n.dirty());
|
|
820
948
|
else if (a.kind === "ulid")
|
|
821
|
-
|
|
949
|
+
$r.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
822
950
|
validation: "ulid",
|
|
823
951
|
code: l.invalid_string,
|
|
824
952
|
message: a.message
|
|
@@ -853,35 +981,35 @@ var us = wr((hs, gt) => {
|
|
|
853
981
|
code: l.invalid_string,
|
|
854
982
|
validation: "datetime",
|
|
855
983
|
message: a.message
|
|
856
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
984
|
+
}), n.dirty()) : a.kind === "date" ? Yr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
857
985
|
code: l.invalid_string,
|
|
858
986
|
validation: "date",
|
|
859
987
|
message: a.message
|
|
860
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
988
|
+
}), n.dirty()) : a.kind === "time" ? Kr(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
861
989
|
code: l.invalid_string,
|
|
862
990
|
validation: "time",
|
|
863
991
|
message: a.message
|
|
864
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
992
|
+
}), n.dirty()) : a.kind === "duration" ? Dr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
865
993
|
validation: "duration",
|
|
866
994
|
code: l.invalid_string,
|
|
867
995
|
message: a.message
|
|
868
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
996
|
+
}), n.dirty()) : a.kind === "ip" ? Gr(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
869
997
|
validation: "ip",
|
|
870
998
|
code: l.invalid_string,
|
|
871
999
|
message: a.message
|
|
872
|
-
}), n.dirty()) : a.kind === "jwt" ?
|
|
1000
|
+
}), n.dirty()) : a.kind === "jwt" ? Xr(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
873
1001
|
validation: "jwt",
|
|
874
1002
|
code: l.invalid_string,
|
|
875
1003
|
message: a.message
|
|
876
|
-
}), n.dirty()) : a.kind === "cidr" ?
|
|
1004
|
+
}), n.dirty()) : a.kind === "cidr" ? Qr(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
877
1005
|
validation: "cidr",
|
|
878
1006
|
code: l.invalid_string,
|
|
879
1007
|
message: a.message
|
|
880
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
1008
|
+
}), n.dirty()) : a.kind === "base64" ? Wr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
881
1009
|
validation: "base64",
|
|
882
1010
|
code: l.invalid_string,
|
|
883
1011
|
message: a.message
|
|
884
|
-
}), n.dirty()) : a.kind === "base64url" ?
|
|
1012
|
+
}), n.dirty()) : a.kind === "base64url" ? Jr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
885
1013
|
validation: "base64url",
|
|
886
1014
|
code: l.invalid_string,
|
|
887
1015
|
message: a.message
|
|
@@ -896,7 +1024,7 @@ var us = wr((hs, gt) => {
|
|
|
896
1024
|
});
|
|
897
1025
|
}
|
|
898
1026
|
_addCheck(e) {
|
|
899
|
-
return new
|
|
1027
|
+
return new Z({
|
|
900
1028
|
...this._def,
|
|
901
1029
|
checks: [...this._def.checks, e]
|
|
902
1030
|
});
|
|
@@ -953,10 +1081,10 @@ var us = wr((hs, gt) => {
|
|
|
953
1081
|
message: e
|
|
954
1082
|
}) : this._addCheck({
|
|
955
1083
|
kind: "datetime",
|
|
956
|
-
precision: typeof
|
|
957
|
-
offset: (r = e
|
|
958
|
-
local: (n = e
|
|
959
|
-
...h.errToObj(e
|
|
1084
|
+
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
1085
|
+
offset: (r = e?.offset) !== null && r !== void 0 ? r : !1,
|
|
1086
|
+
local: (n = e?.local) !== null && n !== void 0 ? n : !1,
|
|
1087
|
+
...h.errToObj(e?.message)
|
|
960
1088
|
});
|
|
961
1089
|
}
|
|
962
1090
|
date(e) {
|
|
@@ -969,8 +1097,8 @@ var us = wr((hs, gt) => {
|
|
|
969
1097
|
message: e
|
|
970
1098
|
}) : this._addCheck({
|
|
971
1099
|
kind: "time",
|
|
972
|
-
precision: typeof
|
|
973
|
-
...h.errToObj(e
|
|
1100
|
+
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
1101
|
+
...h.errToObj(e?.message)
|
|
974
1102
|
});
|
|
975
1103
|
}
|
|
976
1104
|
duration(e) {
|
|
@@ -987,8 +1115,8 @@ var us = wr((hs, gt) => {
|
|
|
987
1115
|
return this._addCheck({
|
|
988
1116
|
kind: "includes",
|
|
989
1117
|
value: e,
|
|
990
|
-
position: r
|
|
991
|
-
...h.errToObj(r
|
|
1118
|
+
position: r?.position,
|
|
1119
|
+
...h.errToObj(r?.message)
|
|
992
1120
|
});
|
|
993
1121
|
}
|
|
994
1122
|
startsWith(e, r) {
|
|
@@ -1033,19 +1161,19 @@ var us = wr((hs, gt) => {
|
|
|
1033
1161
|
return this.min(1, h.errToObj(e));
|
|
1034
1162
|
}
|
|
1035
1163
|
trim() {
|
|
1036
|
-
return new
|
|
1164
|
+
return new Z({
|
|
1037
1165
|
...this._def,
|
|
1038
1166
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1039
1167
|
});
|
|
1040
1168
|
}
|
|
1041
1169
|
toLowerCase() {
|
|
1042
|
-
return new
|
|
1170
|
+
return new Z({
|
|
1043
1171
|
...this._def,
|
|
1044
1172
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1045
1173
|
});
|
|
1046
1174
|
}
|
|
1047
1175
|
toUpperCase() {
|
|
1048
|
-
return new
|
|
1176
|
+
return new Z({
|
|
1049
1177
|
...this._def,
|
|
1050
1178
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1051
1179
|
});
|
|
@@ -1111,16 +1239,16 @@ var us = wr((hs, gt) => {
|
|
|
1111
1239
|
return e;
|
|
1112
1240
|
}
|
|
1113
1241
|
}
|
|
1114
|
-
|
|
1242
|
+
Z.create = (t) => {
|
|
1115
1243
|
var e;
|
|
1116
|
-
return new
|
|
1244
|
+
return new Z({
|
|
1117
1245
|
checks: [],
|
|
1118
1246
|
typeName: m.ZodString,
|
|
1119
|
-
coerce: (e = t
|
|
1247
|
+
coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
|
|
1120
1248
|
...v(t)
|
|
1121
1249
|
});
|
|
1122
1250
|
};
|
|
1123
|
-
function
|
|
1251
|
+
function en(t, e) {
|
|
1124
1252
|
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(".", ""));
|
|
1125
1253
|
return a % i / Math.pow(10, s);
|
|
1126
1254
|
}
|
|
@@ -1138,7 +1266,7 @@ var us = wr((hs, gt) => {
|
|
|
1138
1266
|
}), y;
|
|
1139
1267
|
}
|
|
1140
1268
|
let n;
|
|
1141
|
-
const s = new
|
|
1269
|
+
const s = new O();
|
|
1142
1270
|
for (const a of this._def.checks)
|
|
1143
1271
|
a.kind === "int" ? k.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1144
1272
|
code: l.invalid_type,
|
|
@@ -1159,7 +1287,7 @@ var us = wr((hs, gt) => {
|
|
|
1159
1287
|
inclusive: a.inclusive,
|
|
1160
1288
|
exact: !1,
|
|
1161
1289
|
message: a.message
|
|
1162
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
1290
|
+
}), s.dirty()) : a.kind === "multipleOf" ? en(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1163
1291
|
code: l.not_multiple_of,
|
|
1164
1292
|
multipleOf: a.value,
|
|
1165
1293
|
message: a.message
|
|
@@ -1293,7 +1421,7 @@ var us = wr((hs, gt) => {
|
|
|
1293
1421
|
K.create = (t) => new K({
|
|
1294
1422
|
checks: [],
|
|
1295
1423
|
typeName: m.ZodNumber,
|
|
1296
|
-
coerce:
|
|
1424
|
+
coerce: t?.coerce || !1,
|
|
1297
1425
|
...v(t)
|
|
1298
1426
|
});
|
|
1299
1427
|
class G extends _ {
|
|
@@ -1310,7 +1438,7 @@ var us = wr((hs, gt) => {
|
|
|
1310
1438
|
if (this._getType(e) !== p.bigint)
|
|
1311
1439
|
return this._getInvalidInput(e);
|
|
1312
1440
|
let n;
|
|
1313
|
-
const s = new
|
|
1441
|
+
const s = new O();
|
|
1314
1442
|
for (const a of this._def.checks)
|
|
1315
1443
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1316
1444
|
code: l.too_small,
|
|
@@ -1428,11 +1556,11 @@ var us = wr((hs, gt) => {
|
|
|
1428
1556
|
return new G({
|
|
1429
1557
|
checks: [],
|
|
1430
1558
|
typeName: m.ZodBigInt,
|
|
1431
|
-
coerce: (e = t
|
|
1559
|
+
coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
|
|
1432
1560
|
...v(t)
|
|
1433
1561
|
});
|
|
1434
1562
|
};
|
|
1435
|
-
class
|
|
1563
|
+
class Ee extends _ {
|
|
1436
1564
|
_parse(e) {
|
|
1437
1565
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
|
|
1438
1566
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1442,15 +1570,15 @@ var us = wr((hs, gt) => {
|
|
|
1442
1570
|
received: n.parsedType
|
|
1443
1571
|
}), y;
|
|
1444
1572
|
}
|
|
1445
|
-
return
|
|
1573
|
+
return A(e.data);
|
|
1446
1574
|
}
|
|
1447
1575
|
}
|
|
1448
|
-
|
|
1576
|
+
Ee.create = (t) => new Ee({
|
|
1449
1577
|
typeName: m.ZodBoolean,
|
|
1450
|
-
coerce:
|
|
1578
|
+
coerce: t?.coerce || !1,
|
|
1451
1579
|
...v(t)
|
|
1452
1580
|
});
|
|
1453
|
-
class
|
|
1581
|
+
class ce extends _ {
|
|
1454
1582
|
_parse(e) {
|
|
1455
1583
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
|
|
1456
1584
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1466,7 +1594,7 @@ var us = wr((hs, gt) => {
|
|
|
1466
1594
|
code: l.invalid_date
|
|
1467
1595
|
}), y;
|
|
1468
1596
|
}
|
|
1469
|
-
const n = new
|
|
1597
|
+
const n = new O();
|
|
1470
1598
|
let s;
|
|
1471
1599
|
for (const a of this._def.checks)
|
|
1472
1600
|
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), f(s, {
|
|
@@ -1490,7 +1618,7 @@ var us = wr((hs, gt) => {
|
|
|
1490
1618
|
};
|
|
1491
1619
|
}
|
|
1492
1620
|
_addCheck(e) {
|
|
1493
|
-
return new
|
|
1621
|
+
return new ce({
|
|
1494
1622
|
...this._def,
|
|
1495
1623
|
checks: [...this._def.checks, e]
|
|
1496
1624
|
});
|
|
@@ -1522,13 +1650,13 @@ var us = wr((hs, gt) => {
|
|
|
1522
1650
|
return e != null ? new Date(e) : null;
|
|
1523
1651
|
}
|
|
1524
1652
|
}
|
|
1525
|
-
|
|
1653
|
+
ce.create = (t) => new ce({
|
|
1526
1654
|
checks: [],
|
|
1527
|
-
coerce:
|
|
1655
|
+
coerce: t?.coerce || !1,
|
|
1528
1656
|
typeName: m.ZodDate,
|
|
1529
1657
|
...v(t)
|
|
1530
1658
|
});
|
|
1531
|
-
class
|
|
1659
|
+
class Je extends _ {
|
|
1532
1660
|
_parse(e) {
|
|
1533
1661
|
if (this._getType(e) !== p.symbol) {
|
|
1534
1662
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1538,14 +1666,14 @@ var us = wr((hs, gt) => {
|
|
|
1538
1666
|
received: n.parsedType
|
|
1539
1667
|
}), y;
|
|
1540
1668
|
}
|
|
1541
|
-
return
|
|
1669
|
+
return A(e.data);
|
|
1542
1670
|
}
|
|
1543
1671
|
}
|
|
1544
|
-
|
|
1672
|
+
Je.create = (t) => new Je({
|
|
1545
1673
|
typeName: m.ZodSymbol,
|
|
1546
1674
|
...v(t)
|
|
1547
1675
|
});
|
|
1548
|
-
class
|
|
1676
|
+
class Oe extends _ {
|
|
1549
1677
|
_parse(e) {
|
|
1550
1678
|
if (this._getType(e) !== p.undefined) {
|
|
1551
1679
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1555,14 +1683,14 @@ var us = wr((hs, gt) => {
|
|
|
1555
1683
|
received: n.parsedType
|
|
1556
1684
|
}), y;
|
|
1557
1685
|
}
|
|
1558
|
-
return
|
|
1686
|
+
return A(e.data);
|
|
1559
1687
|
}
|
|
1560
1688
|
}
|
|
1561
|
-
|
|
1689
|
+
Oe.create = (t) => new Oe({
|
|
1562
1690
|
typeName: m.ZodUndefined,
|
|
1563
1691
|
...v(t)
|
|
1564
1692
|
});
|
|
1565
|
-
class
|
|
1693
|
+
class Ne extends _ {
|
|
1566
1694
|
_parse(e) {
|
|
1567
1695
|
if (this._getType(e) !== p.null) {
|
|
1568
1696
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1572,38 +1700,38 @@ var us = wr((hs, gt) => {
|
|
|
1572
1700
|
received: n.parsedType
|
|
1573
1701
|
}), y;
|
|
1574
1702
|
}
|
|
1575
|
-
return
|
|
1703
|
+
return A(e.data);
|
|
1576
1704
|
}
|
|
1577
1705
|
}
|
|
1578
|
-
|
|
1706
|
+
Ne.create = (t) => new Ne({
|
|
1579
1707
|
typeName: m.ZodNull,
|
|
1580
1708
|
...v(t)
|
|
1581
1709
|
});
|
|
1582
|
-
class
|
|
1710
|
+
class ge extends _ {
|
|
1583
1711
|
constructor() {
|
|
1584
1712
|
super(...arguments), this._any = !0;
|
|
1585
1713
|
}
|
|
1586
1714
|
_parse(e) {
|
|
1587
|
-
return
|
|
1715
|
+
return A(e.data);
|
|
1588
1716
|
}
|
|
1589
1717
|
}
|
|
1590
|
-
|
|
1718
|
+
ge.create = (t) => new ge({
|
|
1591
1719
|
typeName: m.ZodAny,
|
|
1592
1720
|
...v(t)
|
|
1593
1721
|
});
|
|
1594
|
-
class
|
|
1722
|
+
class ie extends _ {
|
|
1595
1723
|
constructor() {
|
|
1596
1724
|
super(...arguments), this._unknown = !0;
|
|
1597
1725
|
}
|
|
1598
1726
|
_parse(e) {
|
|
1599
|
-
return
|
|
1727
|
+
return A(e.data);
|
|
1600
1728
|
}
|
|
1601
1729
|
}
|
|
1602
|
-
|
|
1730
|
+
ie.create = (t) => new ie({
|
|
1603
1731
|
typeName: m.ZodUnknown,
|
|
1604
1732
|
...v(t)
|
|
1605
1733
|
});
|
|
1606
|
-
class
|
|
1734
|
+
class W extends _ {
|
|
1607
1735
|
_parse(e) {
|
|
1608
1736
|
const r = this._getOrReturnCtx(e);
|
|
1609
1737
|
return f(r, {
|
|
@@ -1613,11 +1741,11 @@ var us = wr((hs, gt) => {
|
|
|
1613
1741
|
}), y;
|
|
1614
1742
|
}
|
|
1615
1743
|
}
|
|
1616
|
-
|
|
1744
|
+
W.create = (t) => new W({
|
|
1617
1745
|
typeName: m.ZodNever,
|
|
1618
1746
|
...v(t)
|
|
1619
1747
|
});
|
|
1620
|
-
class
|
|
1748
|
+
class Ye extends _ {
|
|
1621
1749
|
_parse(e) {
|
|
1622
1750
|
if (this._getType(e) !== p.undefined) {
|
|
1623
1751
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1627,14 +1755,14 @@ var us = wr((hs, gt) => {
|
|
|
1627
1755
|
received: n.parsedType
|
|
1628
1756
|
}), y;
|
|
1629
1757
|
}
|
|
1630
|
-
return
|
|
1758
|
+
return A(e.data);
|
|
1631
1759
|
}
|
|
1632
1760
|
}
|
|
1633
|
-
|
|
1761
|
+
Ye.create = (t) => new Ye({
|
|
1634
1762
|
typeName: m.ZodVoid,
|
|
1635
1763
|
...v(t)
|
|
1636
1764
|
});
|
|
1637
|
-
class
|
|
1765
|
+
class j extends _ {
|
|
1638
1766
|
_parse(e) {
|
|
1639
1767
|
const { ctx: r, status: n } = this._processInputParams(e), s = this._def;
|
|
1640
1768
|
if (r.parsedType !== p.array)
|
|
@@ -1670,27 +1798,27 @@ var us = wr((hs, gt) => {
|
|
|
1670
1798
|
exact: !1,
|
|
1671
1799
|
message: s.maxLength.message
|
|
1672
1800
|
}), n.dirty()), r.common.async)
|
|
1673
|
-
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new
|
|
1674
|
-
const a = [...r.data].map((i, o) => s.type._parseSync(new
|
|
1675
|
-
return
|
|
1801
|
+
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new D(r, i, r.path, o)))).then((i) => O.mergeArray(n, i));
|
|
1802
|
+
const a = [...r.data].map((i, o) => s.type._parseSync(new D(r, i, r.path, o)));
|
|
1803
|
+
return O.mergeArray(n, a);
|
|
1676
1804
|
}
|
|
1677
1805
|
get element() {
|
|
1678
1806
|
return this._def.type;
|
|
1679
1807
|
}
|
|
1680
1808
|
min(e, r) {
|
|
1681
|
-
return new
|
|
1809
|
+
return new j({
|
|
1682
1810
|
...this._def,
|
|
1683
1811
|
minLength: { value: e, message: h.toString(r) }
|
|
1684
1812
|
});
|
|
1685
1813
|
}
|
|
1686
1814
|
max(e, r) {
|
|
1687
|
-
return new
|
|
1815
|
+
return new j({
|
|
1688
1816
|
...this._def,
|
|
1689
1817
|
maxLength: { value: e, message: h.toString(r) }
|
|
1690
1818
|
});
|
|
1691
1819
|
}
|
|
1692
1820
|
length(e, r) {
|
|
1693
|
-
return new
|
|
1821
|
+
return new j({
|
|
1694
1822
|
...this._def,
|
|
1695
1823
|
exactLength: { value: e, message: h.toString(r) }
|
|
1696
1824
|
});
|
|
@@ -1699,7 +1827,7 @@ var us = wr((hs, gt) => {
|
|
|
1699
1827
|
return this.min(1, e);
|
|
1700
1828
|
}
|
|
1701
1829
|
}
|
|
1702
|
-
|
|
1830
|
+
j.create = (t, e) => new j({
|
|
1703
1831
|
type: t,
|
|
1704
1832
|
minLength: null,
|
|
1705
1833
|
maxLength: null,
|
|
@@ -1707,23 +1835,23 @@ var us = wr((hs, gt) => {
|
|
|
1707
1835
|
typeName: m.ZodArray,
|
|
1708
1836
|
...v(e)
|
|
1709
1837
|
});
|
|
1710
|
-
function
|
|
1711
|
-
if (t instanceof
|
|
1838
|
+
function le(t) {
|
|
1839
|
+
if (t instanceof T) {
|
|
1712
1840
|
const e = {};
|
|
1713
1841
|
for (const r in t.shape) {
|
|
1714
1842
|
const n = t.shape[r];
|
|
1715
|
-
e[r] =
|
|
1843
|
+
e[r] = L.create(le(n));
|
|
1716
1844
|
}
|
|
1717
|
-
return new
|
|
1845
|
+
return new T({
|
|
1718
1846
|
...t._def,
|
|
1719
1847
|
shape: () => e
|
|
1720
1848
|
});
|
|
1721
|
-
} else return t instanceof
|
|
1849
|
+
} else return t instanceof j ? new j({
|
|
1722
1850
|
...t._def,
|
|
1723
|
-
type:
|
|
1724
|
-
}) : t instanceof
|
|
1851
|
+
type: le(t.element)
|
|
1852
|
+
}) : t instanceof L ? L.create(le(t.unwrap())) : t instanceof Q ? Q.create(le(t.unwrap())) : t instanceof V ? V.create(t.items.map((e) => le(e))) : t;
|
|
1725
1853
|
}
|
|
1726
|
-
class
|
|
1854
|
+
class T extends _ {
|
|
1727
1855
|
constructor() {
|
|
1728
1856
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1729
1857
|
}
|
|
@@ -1743,7 +1871,7 @@ var us = wr((hs, gt) => {
|
|
|
1743
1871
|
}), y;
|
|
1744
1872
|
}
|
|
1745
1873
|
const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1746
|
-
if (!(this._def.catchall instanceof
|
|
1874
|
+
if (!(this._def.catchall instanceof W && this._def.unknownKeys === "strip"))
|
|
1747
1875
|
for (const d in s.data)
|
|
1748
1876
|
i.includes(d) || o.push(d);
|
|
1749
1877
|
const c = [];
|
|
@@ -1751,11 +1879,11 @@ var us = wr((hs, gt) => {
|
|
|
1751
1879
|
const u = a[d], w = s.data[d];
|
|
1752
1880
|
c.push({
|
|
1753
1881
|
key: { status: "valid", value: d },
|
|
1754
|
-
value: u._parse(new
|
|
1882
|
+
value: u._parse(new D(s, w, s.path, d)),
|
|
1755
1883
|
alwaysSet: d in s.data
|
|
1756
1884
|
});
|
|
1757
1885
|
}
|
|
1758
|
-
if (this._def.catchall instanceof
|
|
1886
|
+
if (this._def.catchall instanceof W) {
|
|
1759
1887
|
const d = this._def.unknownKeys;
|
|
1760
1888
|
if (d === "passthrough")
|
|
1761
1889
|
for (const u of o)
|
|
@@ -1776,7 +1904,7 @@ var us = wr((hs, gt) => {
|
|
|
1776
1904
|
c.push({
|
|
1777
1905
|
key: { status: "valid", value: u },
|
|
1778
1906
|
value: d._parse(
|
|
1779
|
-
new
|
|
1907
|
+
new D(s, w, s.path, u)
|
|
1780
1908
|
//, ctx.child(key), value, getParsedType(value)
|
|
1781
1909
|
),
|
|
1782
1910
|
alwaysSet: u in s.data
|
|
@@ -1794,13 +1922,13 @@ var us = wr((hs, gt) => {
|
|
|
1794
1922
|
});
|
|
1795
1923
|
}
|
|
1796
1924
|
return d;
|
|
1797
|
-
}).then((d) =>
|
|
1925
|
+
}).then((d) => O.mergeObjectSync(n, d)) : O.mergeObjectSync(n, c);
|
|
1798
1926
|
}
|
|
1799
1927
|
get shape() {
|
|
1800
1928
|
return this._def.shape();
|
|
1801
1929
|
}
|
|
1802
1930
|
strict(e) {
|
|
1803
|
-
return h.errToObj, new
|
|
1931
|
+
return h.errToObj, new T({
|
|
1804
1932
|
...this._def,
|
|
1805
1933
|
unknownKeys: "strict",
|
|
1806
1934
|
...e !== void 0 ? {
|
|
@@ -1817,13 +1945,13 @@ var us = wr((hs, gt) => {
|
|
|
1817
1945
|
});
|
|
1818
1946
|
}
|
|
1819
1947
|
strip() {
|
|
1820
|
-
return new
|
|
1948
|
+
return new T({
|
|
1821
1949
|
...this._def,
|
|
1822
1950
|
unknownKeys: "strip"
|
|
1823
1951
|
});
|
|
1824
1952
|
}
|
|
1825
1953
|
passthrough() {
|
|
1826
|
-
return new
|
|
1954
|
+
return new T({
|
|
1827
1955
|
...this._def,
|
|
1828
1956
|
unknownKeys: "passthrough"
|
|
1829
1957
|
});
|
|
@@ -1846,7 +1974,7 @@ var us = wr((hs, gt) => {
|
|
|
1846
1974
|
// }) as any;
|
|
1847
1975
|
// };
|
|
1848
1976
|
extend(e) {
|
|
1849
|
-
return new
|
|
1977
|
+
return new T({
|
|
1850
1978
|
...this._def,
|
|
1851
1979
|
shape: () => ({
|
|
1852
1980
|
...this._def.shape(),
|
|
@@ -1860,7 +1988,7 @@ var us = wr((hs, gt) => {
|
|
|
1860
1988
|
* upgrade if you are experiencing issues.
|
|
1861
1989
|
*/
|
|
1862
1990
|
merge(e) {
|
|
1863
|
-
return new
|
|
1991
|
+
return new T({
|
|
1864
1992
|
unknownKeys: e._def.unknownKeys,
|
|
1865
1993
|
catchall: e._def.catchall,
|
|
1866
1994
|
shape: () => ({
|
|
@@ -1930,7 +2058,7 @@ var us = wr((hs, gt) => {
|
|
|
1930
2058
|
// return merged;
|
|
1931
2059
|
// }
|
|
1932
2060
|
catchall(e) {
|
|
1933
|
-
return new
|
|
2061
|
+
return new T({
|
|
1934
2062
|
...this._def,
|
|
1935
2063
|
catchall: e
|
|
1936
2064
|
});
|
|
@@ -1939,7 +2067,7 @@ var us = wr((hs, gt) => {
|
|
|
1939
2067
|
const r = {};
|
|
1940
2068
|
return k.objectKeys(e).forEach((n) => {
|
|
1941
2069
|
e[n] && this.shape[n] && (r[n] = this.shape[n]);
|
|
1942
|
-
}), new
|
|
2070
|
+
}), new T({
|
|
1943
2071
|
...this._def,
|
|
1944
2072
|
shape: () => r
|
|
1945
2073
|
});
|
|
@@ -1948,7 +2076,7 @@ var us = wr((hs, gt) => {
|
|
|
1948
2076
|
const r = {};
|
|
1949
2077
|
return k.objectKeys(this.shape).forEach((n) => {
|
|
1950
2078
|
e[n] || (r[n] = this.shape[n]);
|
|
1951
|
-
}), new
|
|
2079
|
+
}), new T({
|
|
1952
2080
|
...this._def,
|
|
1953
2081
|
shape: () => r
|
|
1954
2082
|
});
|
|
@@ -1957,14 +2085,14 @@ var us = wr((hs, gt) => {
|
|
|
1957
2085
|
* @deprecated
|
|
1958
2086
|
*/
|
|
1959
2087
|
deepPartial() {
|
|
1960
|
-
return
|
|
2088
|
+
return le(this);
|
|
1961
2089
|
}
|
|
1962
2090
|
partial(e) {
|
|
1963
2091
|
const r = {};
|
|
1964
2092
|
return k.objectKeys(this.shape).forEach((n) => {
|
|
1965
2093
|
const s = this.shape[n];
|
|
1966
2094
|
e && !e[n] ? r[n] = s : r[n] = s.optional();
|
|
1967
|
-
}), new
|
|
2095
|
+
}), new T({
|
|
1968
2096
|
...this._def,
|
|
1969
2097
|
shape: () => r
|
|
1970
2098
|
});
|
|
@@ -1976,11 +2104,11 @@ var us = wr((hs, gt) => {
|
|
|
1976
2104
|
r[n] = this.shape[n];
|
|
1977
2105
|
else {
|
|
1978
2106
|
let a = this.shape[n];
|
|
1979
|
-
for (; a instanceof
|
|
2107
|
+
for (; a instanceof L; )
|
|
1980
2108
|
a = a._def.innerType;
|
|
1981
2109
|
r[n] = a;
|
|
1982
2110
|
}
|
|
1983
|
-
}), new
|
|
2111
|
+
}), new T({
|
|
1984
2112
|
...this._def,
|
|
1985
2113
|
shape: () => r
|
|
1986
2114
|
});
|
|
@@ -1989,28 +2117,28 @@ var us = wr((hs, gt) => {
|
|
|
1989
2117
|
return Mt(k.objectKeys(this.shape));
|
|
1990
2118
|
}
|
|
1991
2119
|
}
|
|
1992
|
-
|
|
2120
|
+
T.create = (t, e) => new T({
|
|
1993
2121
|
shape: () => t,
|
|
1994
2122
|
unknownKeys: "strip",
|
|
1995
|
-
catchall:
|
|
2123
|
+
catchall: W.create(),
|
|
1996
2124
|
typeName: m.ZodObject,
|
|
1997
2125
|
...v(e)
|
|
1998
2126
|
});
|
|
1999
|
-
|
|
2127
|
+
T.strictCreate = (t, e) => new T({
|
|
2000
2128
|
shape: () => t,
|
|
2001
2129
|
unknownKeys: "strict",
|
|
2002
|
-
catchall:
|
|
2130
|
+
catchall: W.create(),
|
|
2003
2131
|
typeName: m.ZodObject,
|
|
2004
2132
|
...v(e)
|
|
2005
2133
|
});
|
|
2006
|
-
|
|
2134
|
+
T.lazycreate = (t, e) => new T({
|
|
2007
2135
|
shape: t,
|
|
2008
2136
|
unknownKeys: "strip",
|
|
2009
|
-
catchall:
|
|
2137
|
+
catchall: W.create(),
|
|
2010
2138
|
typeName: m.ZodObject,
|
|
2011
2139
|
...v(e)
|
|
2012
2140
|
});
|
|
2013
|
-
class
|
|
2141
|
+
class Re extends _ {
|
|
2014
2142
|
_parse(e) {
|
|
2015
2143
|
const { ctx: r } = this._processInputParams(e), n = this._def.options;
|
|
2016
2144
|
function s(a) {
|
|
@@ -2020,7 +2148,7 @@ var us = wr((hs, gt) => {
|
|
|
2020
2148
|
for (const o of a)
|
|
2021
2149
|
if (o.result.status === "dirty")
|
|
2022
2150
|
return r.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2023
|
-
const i = a.map((o) => new
|
|
2151
|
+
const i = a.map((o) => new C(o.ctx.common.issues));
|
|
2024
2152
|
return f(r, {
|
|
2025
2153
|
code: l.invalid_union,
|
|
2026
2154
|
unionErrors: i
|
|
@@ -2067,7 +2195,7 @@ var us = wr((hs, gt) => {
|
|
|
2067
2195
|
}
|
|
2068
2196
|
if (a)
|
|
2069
2197
|
return r.common.issues.push(...a.ctx.common.issues), a.result;
|
|
2070
|
-
const o = i.map((c) => new
|
|
2198
|
+
const o = i.map((c) => new C(c));
|
|
2071
2199
|
return f(r, {
|
|
2072
2200
|
code: l.invalid_union,
|
|
2073
2201
|
unionErrors: o
|
|
@@ -2078,13 +2206,13 @@ var us = wr((hs, gt) => {
|
|
|
2078
2206
|
return this._def.options;
|
|
2079
2207
|
}
|
|
2080
2208
|
}
|
|
2081
|
-
|
|
2209
|
+
Re.create = (t, e) => new Re({
|
|
2082
2210
|
options: t,
|
|
2083
2211
|
typeName: m.ZodUnion,
|
|
2084
2212
|
...v(e)
|
|
2085
2213
|
});
|
|
2086
|
-
const
|
|
2087
|
-
class
|
|
2214
|
+
const U = (t) => t instanceof Ce ? U(t.schema) : t instanceof $ ? U(t.innerType()) : t instanceof Ie ? [t.value] : t instanceof X ? t.options : t instanceof Ze ? k.objectValues(t.enum) : t instanceof je ? U(t._def.innerType) : t instanceof Oe ? [void 0] : t instanceof Ne ? [null] : t instanceof L ? [void 0, ...U(t.unwrap())] : t instanceof Q ? [null, ...U(t.unwrap())] : t instanceof yt || t instanceof Fe ? U(t.unwrap()) : t instanceof $e ? U(t._def.innerType) : [];
|
|
2215
|
+
class et extends _ {
|
|
2088
2216
|
_parse(e) {
|
|
2089
2217
|
const { ctx: r } = this._processInputParams(e);
|
|
2090
2218
|
if (r.parsedType !== p.object)
|
|
@@ -2128,7 +2256,7 @@ var us = wr((hs, gt) => {
|
|
|
2128
2256
|
static create(e, r, n) {
|
|
2129
2257
|
const s = /* @__PURE__ */ new Map();
|
|
2130
2258
|
for (const a of r) {
|
|
2131
|
-
const i =
|
|
2259
|
+
const i = U(a.shape[e]);
|
|
2132
2260
|
if (!i.length)
|
|
2133
2261
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2134
2262
|
for (const o of i) {
|
|
@@ -2137,7 +2265,7 @@ var us = wr((hs, gt) => {
|
|
|
2137
2265
|
s.set(o, a);
|
|
2138
2266
|
}
|
|
2139
2267
|
}
|
|
2140
|
-
return new
|
|
2268
|
+
return new et({
|
|
2141
2269
|
typeName: m.ZodDiscriminatedUnion,
|
|
2142
2270
|
discriminator: e,
|
|
2143
2271
|
options: r,
|
|
@@ -2146,14 +2274,14 @@ var us = wr((hs, gt) => {
|
|
|
2146
2274
|
});
|
|
2147
2275
|
}
|
|
2148
2276
|
}
|
|
2149
|
-
function
|
|
2150
|
-
const r =
|
|
2277
|
+
function dt(t, e) {
|
|
2278
|
+
const r = B(t), n = B(e);
|
|
2151
2279
|
if (t === e)
|
|
2152
2280
|
return { valid: !0, data: t };
|
|
2153
2281
|
if (r === p.object && n === p.object) {
|
|
2154
2282
|
const s = k.objectKeys(e), a = k.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2155
2283
|
for (const o of a) {
|
|
2156
|
-
const c =
|
|
2284
|
+
const c = dt(t[o], e[o]);
|
|
2157
2285
|
if (!c.valid)
|
|
2158
2286
|
return { valid: !1 };
|
|
2159
2287
|
i[o] = c.data;
|
|
@@ -2164,7 +2292,7 @@ var us = wr((hs, gt) => {
|
|
|
2164
2292
|
return { valid: !1 };
|
|
2165
2293
|
const s = [];
|
|
2166
2294
|
for (let a = 0; a < t.length; a++) {
|
|
2167
|
-
const i = t[a], o = e[a], c =
|
|
2295
|
+
const i = t[a], o = e[a], c = dt(i, o);
|
|
2168
2296
|
if (!c.valid)
|
|
2169
2297
|
return { valid: !1 };
|
|
2170
2298
|
s.push(c.data);
|
|
@@ -2172,13 +2300,13 @@ var us = wr((hs, gt) => {
|
|
|
2172
2300
|
return { valid: !0, data: s };
|
|
2173
2301
|
} else return r === p.date && n === p.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2174
2302
|
}
|
|
2175
|
-
class
|
|
2303
|
+
class Ae extends _ {
|
|
2176
2304
|
_parse(e) {
|
|
2177
2305
|
const { status: r, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
2178
|
-
if (
|
|
2306
|
+
if (ot(a) || ot(i))
|
|
2179
2307
|
return y;
|
|
2180
|
-
const o =
|
|
2181
|
-
return o.valid ? ((
|
|
2308
|
+
const o = dt(a.value, i.value);
|
|
2309
|
+
return o.valid ? ((ct(a) || ct(i)) && r.dirty(), { status: r.value, value: o.data }) : (f(n, {
|
|
2182
2310
|
code: l.invalid_intersection_types
|
|
2183
2311
|
}), y);
|
|
2184
2312
|
};
|
|
@@ -2204,13 +2332,13 @@ var us = wr((hs, gt) => {
|
|
|
2204
2332
|
}));
|
|
2205
2333
|
}
|
|
2206
2334
|
}
|
|
2207
|
-
|
|
2335
|
+
Ae.create = (t, e, r) => new Ae({
|
|
2208
2336
|
left: t,
|
|
2209
2337
|
right: e,
|
|
2210
2338
|
typeName: m.ZodIntersection,
|
|
2211
2339
|
...v(r)
|
|
2212
2340
|
});
|
|
2213
|
-
class
|
|
2341
|
+
class V extends _ {
|
|
2214
2342
|
_parse(e) {
|
|
2215
2343
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2216
2344
|
if (n.parsedType !== p.array)
|
|
@@ -2236,31 +2364,31 @@ var us = wr((hs, gt) => {
|
|
|
2236
2364
|
}), r.dirty());
|
|
2237
2365
|
const a = [...n.data].map((i, o) => {
|
|
2238
2366
|
const c = this._def.items[o] || this._def.rest;
|
|
2239
|
-
return c ? c._parse(new
|
|
2367
|
+
return c ? c._parse(new D(n, i, n.path, o)) : null;
|
|
2240
2368
|
}).filter((i) => !!i);
|
|
2241
|
-
return n.common.async ? Promise.all(a).then((i) =>
|
|
2369
|
+
return n.common.async ? Promise.all(a).then((i) => O.mergeArray(r, i)) : O.mergeArray(r, a);
|
|
2242
2370
|
}
|
|
2243
2371
|
get items() {
|
|
2244
2372
|
return this._def.items;
|
|
2245
2373
|
}
|
|
2246
2374
|
rest(e) {
|
|
2247
|
-
return new
|
|
2375
|
+
return new V({
|
|
2248
2376
|
...this._def,
|
|
2249
2377
|
rest: e
|
|
2250
2378
|
});
|
|
2251
2379
|
}
|
|
2252
2380
|
}
|
|
2253
|
-
|
|
2381
|
+
V.create = (t, e) => {
|
|
2254
2382
|
if (!Array.isArray(t))
|
|
2255
2383
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2256
|
-
return new
|
|
2384
|
+
return new V({
|
|
2257
2385
|
items: t,
|
|
2258
2386
|
typeName: m.ZodTuple,
|
|
2259
2387
|
rest: null,
|
|
2260
2388
|
...v(e)
|
|
2261
2389
|
});
|
|
2262
2390
|
};
|
|
2263
|
-
class
|
|
2391
|
+
class Pe extends _ {
|
|
2264
2392
|
get keySchema() {
|
|
2265
2393
|
return this._def.keyType;
|
|
2266
2394
|
}
|
|
@@ -2278,30 +2406,30 @@ var us = wr((hs, gt) => {
|
|
|
2278
2406
|
const s = [], a = this._def.keyType, i = this._def.valueType;
|
|
2279
2407
|
for (const o in n.data)
|
|
2280
2408
|
s.push({
|
|
2281
|
-
key: a._parse(new
|
|
2282
|
-
value: i._parse(new
|
|
2409
|
+
key: a._parse(new D(n, o, n.path, o)),
|
|
2410
|
+
value: i._parse(new D(n, n.data[o], n.path, o)),
|
|
2283
2411
|
alwaysSet: o in n.data
|
|
2284
2412
|
});
|
|
2285
|
-
return n.common.async ?
|
|
2413
|
+
return n.common.async ? O.mergeObjectAsync(r, s) : O.mergeObjectSync(r, s);
|
|
2286
2414
|
}
|
|
2287
2415
|
get element() {
|
|
2288
2416
|
return this._def.valueType;
|
|
2289
2417
|
}
|
|
2290
2418
|
static create(e, r, n) {
|
|
2291
|
-
return r instanceof _ ? new
|
|
2419
|
+
return r instanceof _ ? new Pe({
|
|
2292
2420
|
keyType: e,
|
|
2293
2421
|
valueType: r,
|
|
2294
2422
|
typeName: m.ZodRecord,
|
|
2295
2423
|
...v(n)
|
|
2296
|
-
}) : new
|
|
2297
|
-
keyType:
|
|
2424
|
+
}) : new Pe({
|
|
2425
|
+
keyType: Z.create(),
|
|
2298
2426
|
valueType: e,
|
|
2299
2427
|
typeName: m.ZodRecord,
|
|
2300
2428
|
...v(r)
|
|
2301
2429
|
});
|
|
2302
2430
|
}
|
|
2303
2431
|
}
|
|
2304
|
-
class
|
|
2432
|
+
class Ke extends _ {
|
|
2305
2433
|
get keySchema() {
|
|
2306
2434
|
return this._def.keyType;
|
|
2307
2435
|
}
|
|
@@ -2317,8 +2445,8 @@ var us = wr((hs, gt) => {
|
|
|
2317
2445
|
received: n.parsedType
|
|
2318
2446
|
}), y;
|
|
2319
2447
|
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, c], d) => ({
|
|
2320
|
-
key: s._parse(new
|
|
2321
|
-
value: a._parse(new
|
|
2448
|
+
key: s._parse(new D(n, o, n.path, [d, "key"])),
|
|
2449
|
+
value: a._parse(new D(n, c, n.path, [d, "value"]))
|
|
2322
2450
|
}));
|
|
2323
2451
|
if (n.common.async) {
|
|
2324
2452
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2343,13 +2471,13 @@ var us = wr((hs, gt) => {
|
|
|
2343
2471
|
}
|
|
2344
2472
|
}
|
|
2345
2473
|
}
|
|
2346
|
-
|
|
2474
|
+
Ke.create = (t, e, r) => new Ke({
|
|
2347
2475
|
valueType: e,
|
|
2348
2476
|
keyType: t,
|
|
2349
2477
|
typeName: m.ZodMap,
|
|
2350
2478
|
...v(r)
|
|
2351
2479
|
});
|
|
2352
|
-
class
|
|
2480
|
+
class de extends _ {
|
|
2353
2481
|
_parse(e) {
|
|
2354
2482
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2355
2483
|
if (n.parsedType !== p.set)
|
|
@@ -2384,17 +2512,17 @@ var us = wr((hs, gt) => {
|
|
|
2384
2512
|
}
|
|
2385
2513
|
return { status: r.value, value: d };
|
|
2386
2514
|
}
|
|
2387
|
-
const o = [...n.data.values()].map((c, d) => a._parse(new
|
|
2515
|
+
const o = [...n.data.values()].map((c, d) => a._parse(new D(n, c, n.path, d)));
|
|
2388
2516
|
return n.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
2389
2517
|
}
|
|
2390
2518
|
min(e, r) {
|
|
2391
|
-
return new
|
|
2519
|
+
return new de({
|
|
2392
2520
|
...this._def,
|
|
2393
2521
|
minSize: { value: e, message: h.toString(r) }
|
|
2394
2522
|
});
|
|
2395
2523
|
}
|
|
2396
2524
|
max(e, r) {
|
|
2397
|
-
return new
|
|
2525
|
+
return new de({
|
|
2398
2526
|
...this._def,
|
|
2399
2527
|
maxSize: { value: e, message: h.toString(r) }
|
|
2400
2528
|
});
|
|
@@ -2406,14 +2534,14 @@ var us = wr((hs, gt) => {
|
|
|
2406
2534
|
return this.min(1, e);
|
|
2407
2535
|
}
|
|
2408
2536
|
}
|
|
2409
|
-
|
|
2537
|
+
de.create = (t, e) => new de({
|
|
2410
2538
|
valueType: t,
|
|
2411
2539
|
minSize: null,
|
|
2412
2540
|
maxSize: null,
|
|
2413
2541
|
typeName: m.ZodSet,
|
|
2414
2542
|
...v(e)
|
|
2415
2543
|
});
|
|
2416
|
-
class
|
|
2544
|
+
class me extends _ {
|
|
2417
2545
|
constructor() {
|
|
2418
2546
|
super(...arguments), this.validate = this.implement;
|
|
2419
2547
|
}
|
|
@@ -2426,14 +2554,14 @@ var us = wr((hs, gt) => {
|
|
|
2426
2554
|
received: r.parsedType
|
|
2427
2555
|
}), y;
|
|
2428
2556
|
function n(o, c) {
|
|
2429
|
-
return
|
|
2557
|
+
return He({
|
|
2430
2558
|
data: o,
|
|
2431
2559
|
path: r.path,
|
|
2432
2560
|
errorMaps: [
|
|
2433
2561
|
r.common.contextualErrorMap,
|
|
2434
2562
|
r.schemaErrorMap,
|
|
2435
|
-
|
|
2436
|
-
|
|
2563
|
+
Be(),
|
|
2564
|
+
ye
|
|
2437
2565
|
].filter((d) => !!d),
|
|
2438
2566
|
issueData: {
|
|
2439
2567
|
code: l.invalid_arguments,
|
|
@@ -2442,14 +2570,14 @@ var us = wr((hs, gt) => {
|
|
|
2442
2570
|
});
|
|
2443
2571
|
}
|
|
2444
2572
|
function s(o, c) {
|
|
2445
|
-
return
|
|
2573
|
+
return He({
|
|
2446
2574
|
data: o,
|
|
2447
2575
|
path: r.path,
|
|
2448
2576
|
errorMaps: [
|
|
2449
2577
|
r.common.contextualErrorMap,
|
|
2450
2578
|
r.schemaErrorMap,
|
|
2451
|
-
|
|
2452
|
-
|
|
2579
|
+
Be(),
|
|
2580
|
+
ye
|
|
2453
2581
|
].filter((d) => !!d),
|
|
2454
2582
|
issueData: {
|
|
2455
2583
|
code: l.invalid_return_type,
|
|
@@ -2458,25 +2586,25 @@ var us = wr((hs, gt) => {
|
|
|
2458
2586
|
});
|
|
2459
2587
|
}
|
|
2460
2588
|
const a = { errorMap: r.common.contextualErrorMap }, i = r.data;
|
|
2461
|
-
if (this._def.returns instanceof
|
|
2589
|
+
if (this._def.returns instanceof ve) {
|
|
2462
2590
|
const o = this;
|
|
2463
|
-
return
|
|
2464
|
-
const d = new
|
|
2465
|
-
throw d.addIssue(n(c,
|
|
2591
|
+
return A(async function(...c) {
|
|
2592
|
+
const d = new C([]), u = await o._def.args.parseAsync(c, a).catch((P) => {
|
|
2593
|
+
throw d.addIssue(n(c, P)), d;
|
|
2466
2594
|
}), w = await Reflect.apply(i, this, u);
|
|
2467
|
-
return await o._def.returns._def.type.parseAsync(w, a).catch((
|
|
2468
|
-
throw d.addIssue(s(w,
|
|
2595
|
+
return await o._def.returns._def.type.parseAsync(w, a).catch((P) => {
|
|
2596
|
+
throw d.addIssue(s(w, P)), d;
|
|
2469
2597
|
});
|
|
2470
2598
|
});
|
|
2471
2599
|
} else {
|
|
2472
2600
|
const o = this;
|
|
2473
|
-
return
|
|
2601
|
+
return A(function(...c) {
|
|
2474
2602
|
const d = o._def.args.safeParse(c, a);
|
|
2475
2603
|
if (!d.success)
|
|
2476
|
-
throw new
|
|
2604
|
+
throw new C([n(c, d.error)]);
|
|
2477
2605
|
const u = Reflect.apply(i, this, d.data), w = o._def.returns.safeParse(u, a);
|
|
2478
2606
|
if (!w.success)
|
|
2479
|
-
throw new
|
|
2607
|
+
throw new C([s(u, w.error)]);
|
|
2480
2608
|
return w.data;
|
|
2481
2609
|
});
|
|
2482
2610
|
}
|
|
@@ -2488,13 +2616,13 @@ var us = wr((hs, gt) => {
|
|
|
2488
2616
|
return this._def.returns;
|
|
2489
2617
|
}
|
|
2490
2618
|
args(...e) {
|
|
2491
|
-
return new
|
|
2619
|
+
return new me({
|
|
2492
2620
|
...this._def,
|
|
2493
|
-
args:
|
|
2621
|
+
args: V.create(e).rest(ie.create())
|
|
2494
2622
|
});
|
|
2495
2623
|
}
|
|
2496
2624
|
returns(e) {
|
|
2497
|
-
return new
|
|
2625
|
+
return new me({
|
|
2498
2626
|
...this._def,
|
|
2499
2627
|
returns: e
|
|
2500
2628
|
});
|
|
@@ -2506,15 +2634,15 @@ var us = wr((hs, gt) => {
|
|
|
2506
2634
|
return this.parse(e);
|
|
2507
2635
|
}
|
|
2508
2636
|
static create(e, r, n) {
|
|
2509
|
-
return new
|
|
2510
|
-
args: e ||
|
|
2511
|
-
returns: r ||
|
|
2637
|
+
return new me({
|
|
2638
|
+
args: e || V.create([]).rest(ie.create()),
|
|
2639
|
+
returns: r || ie.create(),
|
|
2512
2640
|
typeName: m.ZodFunction,
|
|
2513
2641
|
...v(n)
|
|
2514
2642
|
});
|
|
2515
2643
|
}
|
|
2516
2644
|
}
|
|
2517
|
-
class
|
|
2645
|
+
class Ce extends _ {
|
|
2518
2646
|
get schema() {
|
|
2519
2647
|
return this._def.getter();
|
|
2520
2648
|
}
|
|
@@ -2523,12 +2651,12 @@ var us = wr((hs, gt) => {
|
|
|
2523
2651
|
return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
|
|
2524
2652
|
}
|
|
2525
2653
|
}
|
|
2526
|
-
|
|
2654
|
+
Ce.create = (t, e) => new Ce({
|
|
2527
2655
|
getter: t,
|
|
2528
2656
|
typeName: m.ZodLazy,
|
|
2529
2657
|
...v(e)
|
|
2530
2658
|
});
|
|
2531
|
-
class
|
|
2659
|
+
class Ie extends _ {
|
|
2532
2660
|
_parse(e) {
|
|
2533
2661
|
if (e.data !== this._def.value) {
|
|
2534
2662
|
const r = this._getOrReturnCtx(e);
|
|
@@ -2544,7 +2672,7 @@ var us = wr((hs, gt) => {
|
|
|
2544
2672
|
return this._def.value;
|
|
2545
2673
|
}
|
|
2546
2674
|
}
|
|
2547
|
-
|
|
2675
|
+
Ie.create = (t, e) => new Ie({
|
|
2548
2676
|
value: t,
|
|
2549
2677
|
typeName: m.ZodLiteral,
|
|
2550
2678
|
...v(e)
|
|
@@ -2558,7 +2686,7 @@ var us = wr((hs, gt) => {
|
|
|
2558
2686
|
}
|
|
2559
2687
|
class X extends _ {
|
|
2560
2688
|
constructor() {
|
|
2561
|
-
super(...arguments),
|
|
2689
|
+
super(...arguments), be.set(this, void 0);
|
|
2562
2690
|
}
|
|
2563
2691
|
_parse(e) {
|
|
2564
2692
|
if (typeof e.data != "string") {
|
|
@@ -2569,7 +2697,7 @@ var us = wr((hs, gt) => {
|
|
|
2569
2697
|
code: l.invalid_type
|
|
2570
2698
|
}), y;
|
|
2571
2699
|
}
|
|
2572
|
-
if (
|
|
2700
|
+
if (We(this, be) || Zt(this, be, new Set(this._def.values)), !We(this, be).has(e.data)) {
|
|
2573
2701
|
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
2574
2702
|
return f(r, {
|
|
2575
2703
|
received: r.data,
|
|
@@ -2577,7 +2705,7 @@ var us = wr((hs, gt) => {
|
|
|
2577
2705
|
options: n
|
|
2578
2706
|
}), y;
|
|
2579
2707
|
}
|
|
2580
|
-
return
|
|
2708
|
+
return A(e.data);
|
|
2581
2709
|
}
|
|
2582
2710
|
get options() {
|
|
2583
2711
|
return this._def.values;
|
|
@@ -2613,11 +2741,11 @@ var us = wr((hs, gt) => {
|
|
|
2613
2741
|
});
|
|
2614
2742
|
}
|
|
2615
2743
|
}
|
|
2616
|
-
|
|
2744
|
+
be = /* @__PURE__ */ new WeakMap();
|
|
2617
2745
|
X.create = Mt;
|
|
2618
|
-
class
|
|
2746
|
+
class Ze extends _ {
|
|
2619
2747
|
constructor() {
|
|
2620
|
-
super(...arguments),
|
|
2748
|
+
super(...arguments), xe.set(this, void 0);
|
|
2621
2749
|
}
|
|
2622
2750
|
_parse(e) {
|
|
2623
2751
|
const r = k.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2629,7 +2757,7 @@ var us = wr((hs, gt) => {
|
|
|
2629
2757
|
code: l.invalid_type
|
|
2630
2758
|
}), y;
|
|
2631
2759
|
}
|
|
2632
|
-
if (
|
|
2760
|
+
if (We(this, xe) || Zt(this, xe, new Set(k.getValidEnumValues(this._def.values))), !We(this, xe).has(e.data)) {
|
|
2633
2761
|
const s = k.objectValues(r);
|
|
2634
2762
|
return f(n, {
|
|
2635
2763
|
received: n.data,
|
|
@@ -2637,19 +2765,19 @@ var us = wr((hs, gt) => {
|
|
|
2637
2765
|
options: s
|
|
2638
2766
|
}), y;
|
|
2639
2767
|
}
|
|
2640
|
-
return
|
|
2768
|
+
return A(e.data);
|
|
2641
2769
|
}
|
|
2642
2770
|
get enum() {
|
|
2643
2771
|
return this._def.values;
|
|
2644
2772
|
}
|
|
2645
2773
|
}
|
|
2646
|
-
|
|
2647
|
-
|
|
2774
|
+
xe = /* @__PURE__ */ new WeakMap();
|
|
2775
|
+
Ze.create = (t, e) => new Ze({
|
|
2648
2776
|
values: t,
|
|
2649
2777
|
typeName: m.ZodNativeEnum,
|
|
2650
2778
|
...v(e)
|
|
2651
2779
|
});
|
|
2652
|
-
class
|
|
2780
|
+
class ve extends _ {
|
|
2653
2781
|
unwrap() {
|
|
2654
2782
|
return this._def.type;
|
|
2655
2783
|
}
|
|
@@ -2662,18 +2790,18 @@ var us = wr((hs, gt) => {
|
|
|
2662
2790
|
received: r.parsedType
|
|
2663
2791
|
}), y;
|
|
2664
2792
|
const n = r.parsedType === p.promise ? r.data : Promise.resolve(r.data);
|
|
2665
|
-
return
|
|
2793
|
+
return A(n.then((s) => this._def.type.parseAsync(s, {
|
|
2666
2794
|
path: r.path,
|
|
2667
2795
|
errorMap: r.common.contextualErrorMap
|
|
2668
2796
|
})));
|
|
2669
2797
|
}
|
|
2670
2798
|
}
|
|
2671
|
-
|
|
2799
|
+
ve.create = (t, e) => new ve({
|
|
2672
2800
|
type: t,
|
|
2673
2801
|
typeName: m.ZodPromise,
|
|
2674
2802
|
...v(e)
|
|
2675
2803
|
});
|
|
2676
|
-
class
|
|
2804
|
+
class $ extends _ {
|
|
2677
2805
|
innerType() {
|
|
2678
2806
|
return this._def.schema;
|
|
2679
2807
|
}
|
|
@@ -2700,7 +2828,7 @@ var us = wr((hs, gt) => {
|
|
|
2700
2828
|
path: n.path,
|
|
2701
2829
|
parent: n
|
|
2702
2830
|
});
|
|
2703
|
-
return c.status === "aborted" ? y : c.status === "dirty" || r.value === "dirty" ?
|
|
2831
|
+
return c.status === "aborted" ? y : c.status === "dirty" || r.value === "dirty" ? he(c.value) : c;
|
|
2704
2832
|
});
|
|
2705
2833
|
{
|
|
2706
2834
|
if (r.value === "aborted")
|
|
@@ -2710,7 +2838,7 @@ var us = wr((hs, gt) => {
|
|
|
2710
2838
|
path: n.path,
|
|
2711
2839
|
parent: n
|
|
2712
2840
|
});
|
|
2713
|
-
return o.status === "aborted" ? y : o.status === "dirty" || r.value === "dirty" ?
|
|
2841
|
+
return o.status === "aborted" ? y : o.status === "dirty" || r.value === "dirty" ? he(o.value) : o;
|
|
2714
2842
|
}
|
|
2715
2843
|
}
|
|
2716
2844
|
if (s.type === "refinement") {
|
|
@@ -2739,45 +2867,45 @@ var us = wr((hs, gt) => {
|
|
|
2739
2867
|
path: n.path,
|
|
2740
2868
|
parent: n
|
|
2741
2869
|
});
|
|
2742
|
-
if (!
|
|
2870
|
+
if (!oe(i))
|
|
2743
2871
|
return i;
|
|
2744
2872
|
const o = s.transform(i.value, a);
|
|
2745
2873
|
if (o instanceof Promise)
|
|
2746
2874
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2747
2875
|
return { status: r.value, value: o };
|
|
2748
2876
|
} else
|
|
2749
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2877
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => oe(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: r.value, value: o })) : i);
|
|
2750
2878
|
k.assertNever(s);
|
|
2751
2879
|
}
|
|
2752
2880
|
}
|
|
2753
|
-
|
|
2881
|
+
$.create = (t, e, r) => new $({
|
|
2754
2882
|
schema: t,
|
|
2755
2883
|
typeName: m.ZodEffects,
|
|
2756
2884
|
effect: e,
|
|
2757
2885
|
...v(r)
|
|
2758
2886
|
});
|
|
2759
|
-
|
|
2887
|
+
$.createWithPreprocess = (t, e, r) => new $({
|
|
2760
2888
|
schema: e,
|
|
2761
2889
|
effect: { type: "preprocess", transform: t },
|
|
2762
2890
|
typeName: m.ZodEffects,
|
|
2763
2891
|
...v(r)
|
|
2764
2892
|
});
|
|
2765
|
-
class
|
|
2893
|
+
class L extends _ {
|
|
2766
2894
|
_parse(e) {
|
|
2767
|
-
return this._getType(e) === p.undefined ?
|
|
2895
|
+
return this._getType(e) === p.undefined ? A(void 0) : this._def.innerType._parse(e);
|
|
2768
2896
|
}
|
|
2769
2897
|
unwrap() {
|
|
2770
2898
|
return this._def.innerType;
|
|
2771
2899
|
}
|
|
2772
2900
|
}
|
|
2773
|
-
|
|
2901
|
+
L.create = (t, e) => new L({
|
|
2774
2902
|
innerType: t,
|
|
2775
2903
|
typeName: m.ZodOptional,
|
|
2776
2904
|
...v(e)
|
|
2777
2905
|
});
|
|
2778
2906
|
class Q extends _ {
|
|
2779
2907
|
_parse(e) {
|
|
2780
|
-
return this._getType(e) === p.null ?
|
|
2908
|
+
return this._getType(e) === p.null ? A(null) : this._def.innerType._parse(e);
|
|
2781
2909
|
}
|
|
2782
2910
|
unwrap() {
|
|
2783
2911
|
return this._def.innerType;
|
|
@@ -2788,7 +2916,7 @@ var us = wr((hs, gt) => {
|
|
|
2788
2916
|
typeName: m.ZodNullable,
|
|
2789
2917
|
...v(e)
|
|
2790
2918
|
});
|
|
2791
|
-
class
|
|
2919
|
+
class je extends _ {
|
|
2792
2920
|
_parse(e) {
|
|
2793
2921
|
const { ctx: r } = this._processInputParams(e);
|
|
2794
2922
|
let n = r.data;
|
|
@@ -2802,13 +2930,13 @@ var us = wr((hs, gt) => {
|
|
|
2802
2930
|
return this._def.innerType;
|
|
2803
2931
|
}
|
|
2804
2932
|
}
|
|
2805
|
-
|
|
2933
|
+
je.create = (t, e) => new je({
|
|
2806
2934
|
innerType: t,
|
|
2807
2935
|
typeName: m.ZodDefault,
|
|
2808
2936
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2809
2937
|
...v(e)
|
|
2810
2938
|
});
|
|
2811
|
-
class
|
|
2939
|
+
class $e extends _ {
|
|
2812
2940
|
_parse(e) {
|
|
2813
2941
|
const { ctx: r } = this._processInputParams(e), n = {
|
|
2814
2942
|
...r,
|
|
@@ -2823,11 +2951,11 @@ var us = wr((hs, gt) => {
|
|
|
2823
2951
|
...n
|
|
2824
2952
|
}
|
|
2825
2953
|
});
|
|
2826
|
-
return
|
|
2954
|
+
return Te(s) ? s.then((a) => ({
|
|
2827
2955
|
status: "valid",
|
|
2828
2956
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2829
2957
|
get error() {
|
|
2830
|
-
return new
|
|
2958
|
+
return new C(n.common.issues);
|
|
2831
2959
|
},
|
|
2832
2960
|
input: n.data
|
|
2833
2961
|
})
|
|
@@ -2835,7 +2963,7 @@ var us = wr((hs, gt) => {
|
|
|
2835
2963
|
status: "valid",
|
|
2836
2964
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2837
2965
|
get error() {
|
|
2838
|
-
return new
|
|
2966
|
+
return new C(n.common.issues);
|
|
2839
2967
|
},
|
|
2840
2968
|
input: n.data
|
|
2841
2969
|
})
|
|
@@ -2845,13 +2973,13 @@ var us = wr((hs, gt) => {
|
|
|
2845
2973
|
return this._def.innerType;
|
|
2846
2974
|
}
|
|
2847
2975
|
}
|
|
2848
|
-
|
|
2976
|
+
$e.create = (t, e) => new $e({
|
|
2849
2977
|
innerType: t,
|
|
2850
2978
|
typeName: m.ZodCatch,
|
|
2851
2979
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2852
2980
|
...v(e)
|
|
2853
2981
|
});
|
|
2854
|
-
class
|
|
2982
|
+
class Ge extends _ {
|
|
2855
2983
|
_parse(e) {
|
|
2856
2984
|
if (this._getType(e) !== p.nan) {
|
|
2857
2985
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2864,12 +2992,12 @@ var us = wr((hs, gt) => {
|
|
|
2864
2992
|
return { status: "valid", value: e.data };
|
|
2865
2993
|
}
|
|
2866
2994
|
}
|
|
2867
|
-
|
|
2995
|
+
Ge.create = (t) => new Ge({
|
|
2868
2996
|
typeName: m.ZodNaN,
|
|
2869
2997
|
...v(t)
|
|
2870
2998
|
});
|
|
2871
|
-
const
|
|
2872
|
-
class
|
|
2999
|
+
const tn = Symbol("zod_brand");
|
|
3000
|
+
class yt extends _ {
|
|
2873
3001
|
_parse(e) {
|
|
2874
3002
|
const { ctx: r } = this._processInputParams(e), n = r.data;
|
|
2875
3003
|
return this._def.type._parse({
|
|
@@ -2882,7 +3010,7 @@ var us = wr((hs, gt) => {
|
|
|
2882
3010
|
return this._def.type;
|
|
2883
3011
|
}
|
|
2884
3012
|
}
|
|
2885
|
-
class
|
|
3013
|
+
class Me extends _ {
|
|
2886
3014
|
_parse(e) {
|
|
2887
3015
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2888
3016
|
if (n.common.async)
|
|
@@ -2892,7 +3020,7 @@ var us = wr((hs, gt) => {
|
|
|
2892
3020
|
path: n.path,
|
|
2893
3021
|
parent: n
|
|
2894
3022
|
});
|
|
2895
|
-
return a.status === "aborted" ? y : a.status === "dirty" ? (r.dirty(),
|
|
3023
|
+
return a.status === "aborted" ? y : a.status === "dirty" ? (r.dirty(), he(a.value)) : this._def.out._parseAsync({
|
|
2896
3024
|
data: a.value,
|
|
2897
3025
|
path: n.path,
|
|
2898
3026
|
parent: n
|
|
@@ -2915,198 +3043,198 @@ var us = wr((hs, gt) => {
|
|
|
2915
3043
|
}
|
|
2916
3044
|
}
|
|
2917
3045
|
static create(e, r) {
|
|
2918
|
-
return new
|
|
3046
|
+
return new Me({
|
|
2919
3047
|
in: e,
|
|
2920
3048
|
out: r,
|
|
2921
3049
|
typeName: m.ZodPipeline
|
|
2922
3050
|
});
|
|
2923
3051
|
}
|
|
2924
3052
|
}
|
|
2925
|
-
class
|
|
3053
|
+
class Fe extends _ {
|
|
2926
3054
|
_parse(e) {
|
|
2927
|
-
const r = this._def.innerType._parse(e), n = (s) => (
|
|
2928
|
-
return
|
|
3055
|
+
const r = this._def.innerType._parse(e), n = (s) => (oe(s) && (s.value = Object.freeze(s.value)), s);
|
|
3056
|
+
return Te(r) ? r.then((s) => n(s)) : n(r);
|
|
2929
3057
|
}
|
|
2930
3058
|
unwrap() {
|
|
2931
3059
|
return this._def.innerType;
|
|
2932
3060
|
}
|
|
2933
3061
|
}
|
|
2934
|
-
|
|
3062
|
+
Fe.create = (t, e) => new Fe({
|
|
2935
3063
|
innerType: t,
|
|
2936
3064
|
typeName: m.ZodReadonly,
|
|
2937
3065
|
...v(e)
|
|
2938
3066
|
});
|
|
2939
|
-
function
|
|
3067
|
+
function St(t, e) {
|
|
2940
3068
|
const r = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
2941
3069
|
return typeof r == "string" ? { message: r } : r;
|
|
2942
3070
|
}
|
|
2943
3071
|
function Lt(t, e = {}, r) {
|
|
2944
|
-
return t ?
|
|
3072
|
+
return t ? ge.create().superRefine((n, s) => {
|
|
2945
3073
|
var a, i;
|
|
2946
3074
|
const o = t(n);
|
|
2947
3075
|
if (o instanceof Promise)
|
|
2948
3076
|
return o.then((c) => {
|
|
2949
3077
|
var d, u;
|
|
2950
3078
|
if (!c) {
|
|
2951
|
-
const w =
|
|
3079
|
+
const w = St(e, n), x = (u = (d = w.fatal) !== null && d !== void 0 ? d : r) !== null && u !== void 0 ? u : !0;
|
|
2952
3080
|
s.addIssue({ code: "custom", ...w, fatal: x });
|
|
2953
3081
|
}
|
|
2954
3082
|
});
|
|
2955
3083
|
if (!o) {
|
|
2956
|
-
const c =
|
|
3084
|
+
const c = St(e, n), d = (i = (a = c.fatal) !== null && a !== void 0 ? a : r) !== null && i !== void 0 ? i : !0;
|
|
2957
3085
|
s.addIssue({ code: "custom", ...c, fatal: d });
|
|
2958
3086
|
}
|
|
2959
|
-
}) :
|
|
3087
|
+
}) : ge.create();
|
|
2960
3088
|
}
|
|
2961
|
-
const
|
|
2962
|
-
object:
|
|
3089
|
+
const rn = {
|
|
3090
|
+
object: T.lazycreate
|
|
2963
3091
|
};
|
|
2964
3092
|
var m;
|
|
2965
3093
|
(function(t) {
|
|
2966
3094
|
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";
|
|
2967
3095
|
})(m || (m = {}));
|
|
2968
|
-
const
|
|
3096
|
+
const nn = (t, e = {
|
|
2969
3097
|
message: `Input not instance of ${t.name}`
|
|
2970
|
-
}) => Lt((r) => r instanceof t, e), Dt =
|
|
2971
|
-
string: (t) =>
|
|
3098
|
+
}) => Lt((r) => r instanceof t, e), Dt = Z.create, Vt = K.create, sn = Ge.create, an = G.create, zt = Ee.create, on = ce.create, cn = Je.create, dn = Oe.create, ln = Ne.create, un = ge.create, fn = ie.create, pn = W.create, hn = Ye.create, mn = j.create, yn = T.create, gn = T.strictCreate, vn = Re.create, _n = et.create, wn = Ae.create, kn = V.create, bn = Pe.create, xn = Ke.create, Sn = de.create, Tn = me.create, En = Ce.create, On = Ie.create, Nn = X.create, Rn = Ze.create, An = ve.create, Tt = $.create, Pn = L.create, Cn = Q.create, In = $.createWithPreprocess, Zn = Me.create, jn = () => Dt().optional(), $n = () => Vt().optional(), Fn = () => zt().optional(), Mn = {
|
|
3099
|
+
string: (t) => Z.create({ ...t, coerce: !0 }),
|
|
2972
3100
|
number: (t) => K.create({ ...t, coerce: !0 }),
|
|
2973
|
-
boolean: (t) =>
|
|
3101
|
+
boolean: (t) => Ee.create({
|
|
2974
3102
|
...t,
|
|
2975
3103
|
coerce: !0
|
|
2976
3104
|
}),
|
|
2977
3105
|
bigint: (t) => G.create({ ...t, coerce: !0 }),
|
|
2978
|
-
date: (t) =>
|
|
2979
|
-
},
|
|
2980
|
-
var
|
|
3106
|
+
date: (t) => ce.create({ ...t, coerce: !0 })
|
|
3107
|
+
}, Ln = y;
|
|
3108
|
+
var Xe = /* @__PURE__ */ Object.freeze({
|
|
2981
3109
|
__proto__: null,
|
|
2982
|
-
defaultErrorMap:
|
|
2983
|
-
setErrorMap:
|
|
2984
|
-
getErrorMap:
|
|
2985
|
-
makeIssue:
|
|
2986
|
-
EMPTY_PATH:
|
|
3110
|
+
defaultErrorMap: ye,
|
|
3111
|
+
setErrorMap: Cr,
|
|
3112
|
+
getErrorMap: Be,
|
|
3113
|
+
makeIssue: He,
|
|
3114
|
+
EMPTY_PATH: Ir,
|
|
2987
3115
|
addIssueToContext: f,
|
|
2988
|
-
ParseStatus:
|
|
3116
|
+
ParseStatus: O,
|
|
2989
3117
|
INVALID: y,
|
|
2990
|
-
DIRTY:
|
|
2991
|
-
OK:
|
|
2992
|
-
isAborted:
|
|
2993
|
-
isDirty:
|
|
2994
|
-
isValid:
|
|
2995
|
-
isAsync:
|
|
3118
|
+
DIRTY: he,
|
|
3119
|
+
OK: A,
|
|
3120
|
+
isAborted: ot,
|
|
3121
|
+
isDirty: ct,
|
|
3122
|
+
isValid: oe,
|
|
3123
|
+
isAsync: Te,
|
|
2996
3124
|
get util() {
|
|
2997
3125
|
return k;
|
|
2998
3126
|
},
|
|
2999
3127
|
get objectUtil() {
|
|
3000
|
-
return
|
|
3128
|
+
return it;
|
|
3001
3129
|
},
|
|
3002
3130
|
ZodParsedType: p,
|
|
3003
|
-
getParsedType:
|
|
3131
|
+
getParsedType: B,
|
|
3004
3132
|
ZodType: _,
|
|
3005
3133
|
datetimeRegex: Ft,
|
|
3006
|
-
ZodString:
|
|
3134
|
+
ZodString: Z,
|
|
3007
3135
|
ZodNumber: K,
|
|
3008
3136
|
ZodBigInt: G,
|
|
3009
|
-
ZodBoolean:
|
|
3010
|
-
ZodDate:
|
|
3011
|
-
ZodSymbol:
|
|
3012
|
-
ZodUndefined:
|
|
3013
|
-
ZodNull:
|
|
3014
|
-
ZodAny:
|
|
3015
|
-
ZodUnknown:
|
|
3016
|
-
ZodNever:
|
|
3017
|
-
ZodVoid:
|
|
3018
|
-
ZodArray:
|
|
3019
|
-
ZodObject:
|
|
3020
|
-
ZodUnion:
|
|
3021
|
-
ZodDiscriminatedUnion:
|
|
3022
|
-
ZodIntersection:
|
|
3023
|
-
ZodTuple:
|
|
3024
|
-
ZodRecord:
|
|
3025
|
-
ZodMap:
|
|
3026
|
-
ZodSet:
|
|
3027
|
-
ZodFunction:
|
|
3028
|
-
ZodLazy:
|
|
3029
|
-
ZodLiteral:
|
|
3137
|
+
ZodBoolean: Ee,
|
|
3138
|
+
ZodDate: ce,
|
|
3139
|
+
ZodSymbol: Je,
|
|
3140
|
+
ZodUndefined: Oe,
|
|
3141
|
+
ZodNull: Ne,
|
|
3142
|
+
ZodAny: ge,
|
|
3143
|
+
ZodUnknown: ie,
|
|
3144
|
+
ZodNever: W,
|
|
3145
|
+
ZodVoid: Ye,
|
|
3146
|
+
ZodArray: j,
|
|
3147
|
+
ZodObject: T,
|
|
3148
|
+
ZodUnion: Re,
|
|
3149
|
+
ZodDiscriminatedUnion: et,
|
|
3150
|
+
ZodIntersection: Ae,
|
|
3151
|
+
ZodTuple: V,
|
|
3152
|
+
ZodRecord: Pe,
|
|
3153
|
+
ZodMap: Ke,
|
|
3154
|
+
ZodSet: de,
|
|
3155
|
+
ZodFunction: me,
|
|
3156
|
+
ZodLazy: Ce,
|
|
3157
|
+
ZodLiteral: Ie,
|
|
3030
3158
|
ZodEnum: X,
|
|
3031
|
-
ZodNativeEnum:
|
|
3032
|
-
ZodPromise:
|
|
3033
|
-
ZodEffects:
|
|
3034
|
-
ZodTransformer:
|
|
3035
|
-
ZodOptional:
|
|
3159
|
+
ZodNativeEnum: Ze,
|
|
3160
|
+
ZodPromise: ve,
|
|
3161
|
+
ZodEffects: $,
|
|
3162
|
+
ZodTransformer: $,
|
|
3163
|
+
ZodOptional: L,
|
|
3036
3164
|
ZodNullable: Q,
|
|
3037
|
-
ZodDefault:
|
|
3038
|
-
ZodCatch:
|
|
3039
|
-
ZodNaN:
|
|
3040
|
-
BRAND:
|
|
3041
|
-
ZodBranded:
|
|
3042
|
-
ZodPipeline:
|
|
3043
|
-
ZodReadonly:
|
|
3165
|
+
ZodDefault: je,
|
|
3166
|
+
ZodCatch: $e,
|
|
3167
|
+
ZodNaN: Ge,
|
|
3168
|
+
BRAND: tn,
|
|
3169
|
+
ZodBranded: yt,
|
|
3170
|
+
ZodPipeline: Me,
|
|
3171
|
+
ZodReadonly: Fe,
|
|
3044
3172
|
custom: Lt,
|
|
3045
3173
|
Schema: _,
|
|
3046
3174
|
ZodSchema: _,
|
|
3047
|
-
late:
|
|
3175
|
+
late: rn,
|
|
3048
3176
|
get ZodFirstPartyTypeKind() {
|
|
3049
3177
|
return m;
|
|
3050
3178
|
},
|
|
3051
|
-
coerce:
|
|
3052
|
-
any:
|
|
3053
|
-
array:
|
|
3054
|
-
bigint:
|
|
3179
|
+
coerce: Mn,
|
|
3180
|
+
any: un,
|
|
3181
|
+
array: mn,
|
|
3182
|
+
bigint: an,
|
|
3055
3183
|
boolean: zt,
|
|
3056
|
-
date:
|
|
3057
|
-
discriminatedUnion:
|
|
3058
|
-
effect:
|
|
3059
|
-
enum:
|
|
3060
|
-
function:
|
|
3061
|
-
instanceof:
|
|
3062
|
-
intersection:
|
|
3063
|
-
lazy:
|
|
3064
|
-
literal:
|
|
3065
|
-
map:
|
|
3066
|
-
nan:
|
|
3067
|
-
nativeEnum:
|
|
3068
|
-
never:
|
|
3069
|
-
null:
|
|
3070
|
-
nullable:
|
|
3184
|
+
date: on,
|
|
3185
|
+
discriminatedUnion: _n,
|
|
3186
|
+
effect: Tt,
|
|
3187
|
+
enum: Nn,
|
|
3188
|
+
function: Tn,
|
|
3189
|
+
instanceof: nn,
|
|
3190
|
+
intersection: wn,
|
|
3191
|
+
lazy: En,
|
|
3192
|
+
literal: On,
|
|
3193
|
+
map: xn,
|
|
3194
|
+
nan: sn,
|
|
3195
|
+
nativeEnum: Rn,
|
|
3196
|
+
never: pn,
|
|
3197
|
+
null: ln,
|
|
3198
|
+
nullable: Cn,
|
|
3071
3199
|
number: Vt,
|
|
3072
|
-
object:
|
|
3073
|
-
oboolean:
|
|
3074
|
-
onumber:
|
|
3075
|
-
optional:
|
|
3076
|
-
ostring:
|
|
3077
|
-
pipeline:
|
|
3078
|
-
preprocess:
|
|
3079
|
-
promise:
|
|
3080
|
-
record:
|
|
3081
|
-
set:
|
|
3082
|
-
strictObject:
|
|
3200
|
+
object: yn,
|
|
3201
|
+
oboolean: Fn,
|
|
3202
|
+
onumber: $n,
|
|
3203
|
+
optional: Pn,
|
|
3204
|
+
ostring: jn,
|
|
3205
|
+
pipeline: Zn,
|
|
3206
|
+
preprocess: In,
|
|
3207
|
+
promise: An,
|
|
3208
|
+
record: bn,
|
|
3209
|
+
set: Sn,
|
|
3210
|
+
strictObject: gn,
|
|
3083
3211
|
string: Dt,
|
|
3084
|
-
symbol:
|
|
3085
|
-
transformer:
|
|
3086
|
-
tuple:
|
|
3087
|
-
undefined:
|
|
3088
|
-
union:
|
|
3089
|
-
unknown:
|
|
3090
|
-
void:
|
|
3091
|
-
NEVER:
|
|
3212
|
+
symbol: cn,
|
|
3213
|
+
transformer: Tt,
|
|
3214
|
+
tuple: kn,
|
|
3215
|
+
undefined: dn,
|
|
3216
|
+
union: vn,
|
|
3217
|
+
unknown: fn,
|
|
3218
|
+
void: hn,
|
|
3219
|
+
NEVER: Ln,
|
|
3092
3220
|
ZodIssueCode: l,
|
|
3093
|
-
quotelessJson:
|
|
3094
|
-
ZodError:
|
|
3221
|
+
quotelessJson: Pr,
|
|
3222
|
+
ZodError: C
|
|
3095
3223
|
});
|
|
3096
|
-
const
|
|
3097
|
-
detail:
|
|
3098
|
-
}), qt =
|
|
3099
|
-
error:
|
|
3224
|
+
const lt = Xe.object({
|
|
3225
|
+
detail: Xe.string()
|
|
3226
|
+
}), qt = Xe.object({
|
|
3227
|
+
error: Xe.string()
|
|
3100
3228
|
});
|
|
3101
3229
|
function Ut(t) {
|
|
3102
3230
|
if (!t)
|
|
3103
3231
|
return "Unknown error";
|
|
3104
3232
|
if (t instanceof Error) {
|
|
3105
|
-
const e =
|
|
3106
|
-
return e.success ? e.data.detail :
|
|
3233
|
+
const e = lt.safeParse(t.cause);
|
|
3234
|
+
return e.success ? e.data.detail : Dn(t.message);
|
|
3107
3235
|
}
|
|
3108
3236
|
if (typeof t == "object") {
|
|
3109
|
-
const e =
|
|
3237
|
+
const e = lt.safeParse(t);
|
|
3110
3238
|
if (e.success)
|
|
3111
3239
|
return e.data.detail;
|
|
3112
3240
|
const r = qt.safeParse(t);
|
|
@@ -3119,248 +3247,112 @@ var us = wr((hs, gt) => {
|
|
|
3119
3247
|
return String(t);
|
|
3120
3248
|
}
|
|
3121
3249
|
}
|
|
3122
|
-
function
|
|
3123
|
-
const e =
|
|
3250
|
+
function Dn(t) {
|
|
3251
|
+
const e = Vn(t);
|
|
3124
3252
|
if (!e)
|
|
3125
3253
|
return t;
|
|
3126
|
-
const r =
|
|
3254
|
+
const r = lt.safeParse(e);
|
|
3127
3255
|
if (r.success)
|
|
3128
3256
|
return r.data.detail;
|
|
3129
3257
|
const n = qt.safeParse(e);
|
|
3130
3258
|
return n.success ? n.data.error : t;
|
|
3131
3259
|
}
|
|
3132
|
-
function
|
|
3260
|
+
function Vn(t) {
|
|
3133
3261
|
try {
|
|
3134
3262
|
return JSON.parse(t);
|
|
3135
3263
|
} catch {
|
|
3136
3264
|
return t;
|
|
3137
3265
|
}
|
|
3138
3266
|
}
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
|
|
3267
|
+
function Bt(t, e) {
|
|
3268
|
+
if (!t)
|
|
3269
|
+
throw new Error(e);
|
|
3143
3270
|
}
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
if (typeof g == "function") {
|
|
3157
|
-
a = g;
|
|
3158
|
-
return;
|
|
3159
|
-
}
|
|
3160
|
-
a = (S, O) => {
|
|
3161
|
-
const T = g[S];
|
|
3162
|
-
if (T)
|
|
3163
|
-
return T(O);
|
|
3164
|
-
const N = g._;
|
|
3165
|
-
if (!N)
|
|
3166
|
-
throw new Error(`The requested method has no handler: ${S}`);
|
|
3167
|
-
return N(S, O);
|
|
3168
|
-
};
|
|
3169
|
-
}
|
|
3170
|
-
const { maxRequestTime: o = $n } = t;
|
|
3171
|
-
t.transport && s(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
3172
|
-
let c = 0;
|
|
3173
|
-
function d() {
|
|
3174
|
-
return c <= jn ? ++c : c = 0;
|
|
3175
|
-
}
|
|
3176
|
-
const u = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
3177
|
-
function x(g, ...S) {
|
|
3178
|
-
const O = S[0];
|
|
3179
|
-
return new Promise((T, N) => {
|
|
3180
|
-
var ue;
|
|
3181
|
-
if (!n.send)
|
|
3182
|
-
throw ze(["send"], "make requests");
|
|
3183
|
-
const M = d(), re = {
|
|
3184
|
-
type: "request",
|
|
3185
|
-
id: M,
|
|
3186
|
-
method: g,
|
|
3187
|
-
params: O
|
|
3188
|
-
};
|
|
3189
|
-
u.set(M, { resolve: T, reject: N }), o !== 1 / 0 && w.set(M, setTimeout(() => {
|
|
3190
|
-
w.delete(M), N(new Error("RPC request timed out."));
|
|
3191
|
-
}, o)), (ue = e.onSend) == null || ue.call(e, re), n.send(re);
|
|
3192
|
-
});
|
|
3193
|
-
}
|
|
3194
|
-
const C = new Proxy(x, {
|
|
3195
|
-
get: (g, S, O) => S in g ? Reflect.get(g, S, O) : (T) => x(S, T)
|
|
3196
|
-
}), U = C;
|
|
3197
|
-
function Ve(g, ...S) {
|
|
3198
|
-
var N;
|
|
3199
|
-
const O = S[0];
|
|
3200
|
-
if (!n.send)
|
|
3201
|
-
throw ze(["send"], "send messages");
|
|
3202
|
-
const T = {
|
|
3203
|
-
type: "message",
|
|
3204
|
-
id: g,
|
|
3205
|
-
payload: O
|
|
3206
|
-
};
|
|
3207
|
-
(N = e.onSend) == null || N.call(e, T), n.send(T);
|
|
3208
|
-
}
|
|
3209
|
-
const bt = new Proxy(Ve, {
|
|
3210
|
-
get: (g, S, O) => S in g ? Reflect.get(g, S, O) : (T) => Ve(S, T)
|
|
3211
|
-
}), xt = bt, te = /* @__PURE__ */ new Map(), st = /* @__PURE__ */ new Set();
|
|
3212
|
-
function gr(g, S) {
|
|
3213
|
-
var O;
|
|
3214
|
-
if (!n.registerHandler)
|
|
3215
|
-
throw ze(["registerHandler"], "register message listeners");
|
|
3216
|
-
if (g === "*") {
|
|
3217
|
-
st.add(S);
|
|
3218
|
-
return;
|
|
3219
|
-
}
|
|
3220
|
-
te.has(g) || te.set(g, /* @__PURE__ */ new Set()), (O = te.get(g)) == null || O.add(S);
|
|
3221
|
-
}
|
|
3222
|
-
function vr(g, S) {
|
|
3223
|
-
var O, T;
|
|
3224
|
-
if (g === "*") {
|
|
3225
|
-
st.delete(S);
|
|
3226
|
-
return;
|
|
3271
|
+
const zn = "marimo-transport";
|
|
3272
|
+
function Se(t) {
|
|
3273
|
+
return t.FS;
|
|
3274
|
+
}
|
|
3275
|
+
const we = "notebook.py", ke = "/marimo", ae = {
|
|
3276
|
+
NOTEBOOK_FILENAME: we,
|
|
3277
|
+
HOME_DIR: ke,
|
|
3278
|
+
createHomeDir: (t) => {
|
|
3279
|
+
const e = Se(t);
|
|
3280
|
+
try {
|
|
3281
|
+
e.mkdirTree(ke);
|
|
3282
|
+
} catch {
|
|
3227
3283
|
}
|
|
3228
|
-
|
|
3229
|
-
}
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3284
|
+
e.chdir(ke);
|
|
3285
|
+
},
|
|
3286
|
+
mountFS: (t) => {
|
|
3287
|
+
Se(t).mount(t.FS.filesystems.IDBFS, { root: "." }, ke);
|
|
3288
|
+
},
|
|
3289
|
+
populateFilesToMemory: async (t) => {
|
|
3290
|
+
await Et(t, !0);
|
|
3291
|
+
},
|
|
3292
|
+
persistFilesToRemote: async (t) => {
|
|
3293
|
+
await Et(t, !1);
|
|
3294
|
+
},
|
|
3295
|
+
readNotebook: (t) => {
|
|
3296
|
+
const e = Se(t), r = `${ke}/${we}`;
|
|
3297
|
+
return at(e.readFile(r));
|
|
3298
|
+
},
|
|
3299
|
+
initNotebookCode: (t) => {
|
|
3300
|
+
const { pyodide: e, filename: r, code: n } = t, s = Se(e), a = (i) => {
|
|
3239
3301
|
try {
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
success: !0,
|
|
3244
|
-
payload: await a(N, M)
|
|
3245
|
-
};
|
|
3246
|
-
} catch (ue) {
|
|
3247
|
-
if (!(ue instanceof Error))
|
|
3248
|
-
throw ue;
|
|
3249
|
-
re = {
|
|
3250
|
-
type: "response",
|
|
3251
|
-
id: T,
|
|
3252
|
-
success: !1,
|
|
3253
|
-
error: ue.message
|
|
3254
|
-
};
|
|
3302
|
+
return at(s.readFile(i));
|
|
3303
|
+
} catch {
|
|
3304
|
+
return null;
|
|
3255
3305
|
}
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
return;
|
|
3265
|
-
}
|
|
3266
|
-
if (g.type === "message") {
|
|
3267
|
-
for (const N of st)
|
|
3268
|
-
N(g.id, g.payload);
|
|
3269
|
-
const T = te.get(g.id);
|
|
3270
|
-
if (!T)
|
|
3271
|
-
return;
|
|
3272
|
-
for (const N of T)
|
|
3273
|
-
N(g.payload);
|
|
3274
|
-
return;
|
|
3306
|
+
};
|
|
3307
|
+
if (r && r !== we) {
|
|
3308
|
+
const i = a(r);
|
|
3309
|
+
if (i)
|
|
3310
|
+
return {
|
|
3311
|
+
code: i,
|
|
3312
|
+
filename: r
|
|
3313
|
+
};
|
|
3275
3314
|
}
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
setRequestHandler: i,
|
|
3281
|
-
request: C,
|
|
3282
|
-
requestProxy: U,
|
|
3283
|
-
send: bt,
|
|
3284
|
-
sendProxy: xt,
|
|
3285
|
-
addMessageListener: gr,
|
|
3286
|
-
removeMessageListener: vr,
|
|
3287
|
-
proxy: { send: xt, request: U },
|
|
3288
|
-
_setDebugHooks: r
|
|
3289
|
-
};
|
|
3290
|
-
}
|
|
3291
|
-
function Mn(t) {
|
|
3292
|
-
return Fn(t);
|
|
3293
|
-
}
|
|
3294
|
-
const Bt = "[transport-id]";
|
|
3295
|
-
function Ln(t, e) {
|
|
3296
|
-
const { transportId: r } = e;
|
|
3297
|
-
return r != null ? { [Bt]: r, data: t } : t;
|
|
3298
|
-
}
|
|
3299
|
-
function Dn(t, e) {
|
|
3300
|
-
const { transportId: r, filter: n } = e, s = n == null ? void 0 : n();
|
|
3301
|
-
if (r != null && s != null)
|
|
3302
|
-
throw new Error("Cannot use both `transportId` and `filter` at the same time");
|
|
3303
|
-
let a = t;
|
|
3304
|
-
if (r) {
|
|
3305
|
-
if (t[Bt] !== r)
|
|
3306
|
-
return [!0];
|
|
3307
|
-
a = t.data;
|
|
3315
|
+
return s.writeFile(we, n), {
|
|
3316
|
+
code: n,
|
|
3317
|
+
filename: we
|
|
3318
|
+
};
|
|
3308
3319
|
}
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
const u = d.data, [w, x] = Dn(u, {
|
|
3321
|
-
transportId: r,
|
|
3322
|
-
filter: () => n == null ? void 0 : n(d)
|
|
3323
|
-
});
|
|
3324
|
-
w || c(x);
|
|
3325
|
-
}, a.addEventListener("message", o);
|
|
3326
|
-
},
|
|
3327
|
-
unregisterHandler() {
|
|
3328
|
-
o && a.removeEventListener("message", o);
|
|
3329
|
-
}
|
|
3330
|
-
};
|
|
3331
|
-
}
|
|
3332
|
-
function zn(t) {
|
|
3333
|
-
return Vn(self, t);
|
|
3334
|
-
}
|
|
3335
|
-
const qn = "marimo-transport";
|
|
3336
|
-
function Ht(t, e) {
|
|
3337
|
-
if (!t)
|
|
3338
|
-
throw new Error(e);
|
|
3320
|
+
};
|
|
3321
|
+
function Et(t, e) {
|
|
3322
|
+
return new Promise((r, n) => {
|
|
3323
|
+
Se(t).syncfs(e, (s) => {
|
|
3324
|
+
if (s instanceof Error) {
|
|
3325
|
+
n(s);
|
|
3326
|
+
return;
|
|
3327
|
+
}
|
|
3328
|
+
r();
|
|
3329
|
+
});
|
|
3330
|
+
});
|
|
3339
3331
|
}
|
|
3340
|
-
var
|
|
3332
|
+
var qn = Object.defineProperty, b = (t, e) => qn(t, "name", { value: e, configurable: !0 }), Ht = ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (e, r) => (typeof require < "u" ? require : e)[r] }) : t)(function(t) {
|
|
3341
3333
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
3342
3334
|
throw new Error('Dynamic require of "' + t + '" is not supported');
|
|
3343
3335
|
});
|
|
3344
|
-
function
|
|
3336
|
+
function Wt(t) {
|
|
3345
3337
|
return !isNaN(parseFloat(t)) && isFinite(t);
|
|
3346
3338
|
}
|
|
3347
|
-
b(
|
|
3339
|
+
b(Wt, "_isNumber");
|
|
3348
3340
|
function ee(t) {
|
|
3349
3341
|
return t.charAt(0).toUpperCase() + t.substring(1);
|
|
3350
3342
|
}
|
|
3351
3343
|
b(ee, "_capitalize");
|
|
3352
|
-
function
|
|
3344
|
+
function tt(t) {
|
|
3353
3345
|
return function() {
|
|
3354
3346
|
return this[t];
|
|
3355
3347
|
};
|
|
3356
3348
|
}
|
|
3357
|
-
b(
|
|
3358
|
-
var
|
|
3359
|
-
function
|
|
3360
|
-
if (t) for (var e = 0; e <
|
|
3349
|
+
b(tt, "_getter");
|
|
3350
|
+
var ue = ["isConstructor", "isEval", "isNative", "isToplevel"], fe = ["columnNumber", "lineNumber"], pe = ["fileName", "functionName", "source"], Un = ["args"], Bn = ["evalOrigin"], Ve = ue.concat(fe, pe, Un, Bn);
|
|
3351
|
+
function I(t) {
|
|
3352
|
+
if (t) for (var e = 0; e < Ve.length; e++) t[Ve[e]] !== void 0 && this["set" + ee(Ve[e])](t[Ve[e]]);
|
|
3361
3353
|
}
|
|
3362
|
-
b(
|
|
3363
|
-
|
|
3354
|
+
b(I, "StackFrame");
|
|
3355
|
+
I.prototype = { getArgs: function() {
|
|
3364
3356
|
return this.args;
|
|
3365
3357
|
}, setArgs: function(t) {
|
|
3366
3358
|
if (Object.prototype.toString.call(t) !== "[object Array]") throw new TypeError("Args must be an Array");
|
|
@@ -3368,38 +3360,38 @@ var us = wr((hs, gt) => {
|
|
|
3368
3360
|
}, getEvalOrigin: function() {
|
|
3369
3361
|
return this.evalOrigin;
|
|
3370
3362
|
}, setEvalOrigin: function(t) {
|
|
3371
|
-
if (t instanceof
|
|
3372
|
-
else if (t instanceof Object) this.evalOrigin = new
|
|
3363
|
+
if (t instanceof I) this.evalOrigin = t;
|
|
3364
|
+
else if (t instanceof Object) this.evalOrigin = new I(t);
|
|
3373
3365
|
else throw new TypeError("Eval Origin must be an Object or StackFrame");
|
|
3374
3366
|
}, toString: function() {
|
|
3375
3367
|
var t = this.getFileName() || "", e = this.getLineNumber() || "", r = this.getColumnNumber() || "", n = this.getFunctionName() || "";
|
|
3376
3368
|
return this.getIsEval() ? t ? "[eval] (" + t + ":" + e + ":" + r + ")" : "[eval]:" + e + ":" + r : n ? n + " (" + t + ":" + e + ":" + r + ")" : t + ":" + e + ":" + r;
|
|
3377
3369
|
} };
|
|
3378
|
-
|
|
3370
|
+
I.fromString = b(function(t) {
|
|
3379
3371
|
var e = t.indexOf("("), r = t.lastIndexOf(")"), n = t.substring(0, e), s = t.substring(e + 1, r).split(","), a = t.substring(r + 1);
|
|
3380
3372
|
if (a.indexOf("@") === 0) var i = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a, ""), o = i[1], c = i[2], d = i[3];
|
|
3381
|
-
return new
|
|
3373
|
+
return new I({ functionName: n, args: s || void 0, fileName: o, lineNumber: c || void 0, columnNumber: d || void 0 });
|
|
3382
3374
|
}, "StackFrame$$fromString");
|
|
3383
|
-
for (
|
|
3375
|
+
for (re = 0; re < ue.length; re++) I.prototype["get" + ee(ue[re])] = tt(ue[re]), I.prototype["set" + ee(ue[re])] = /* @__PURE__ */ function(t) {
|
|
3384
3376
|
return function(e) {
|
|
3385
3377
|
this[t] = !!e;
|
|
3386
3378
|
};
|
|
3387
|
-
}(
|
|
3388
|
-
var
|
|
3389
|
-
for (
|
|
3379
|
+
}(ue[re]);
|
|
3380
|
+
var re;
|
|
3381
|
+
for (ne = 0; ne < fe.length; ne++) I.prototype["get" + ee(fe[ne])] = tt(fe[ne]), I.prototype["set" + ee(fe[ne])] = /* @__PURE__ */ function(t) {
|
|
3390
3382
|
return function(e) {
|
|
3391
|
-
if (!
|
|
3383
|
+
if (!Wt(e)) throw new TypeError(t + " must be a Number");
|
|
3392
3384
|
this[t] = Number(e);
|
|
3393
3385
|
};
|
|
3394
|
-
}(
|
|
3395
|
-
var
|
|
3396
|
-
for (
|
|
3386
|
+
}(fe[ne]);
|
|
3387
|
+
var ne;
|
|
3388
|
+
for (se = 0; se < pe.length; se++) I.prototype["get" + ee(pe[se])] = tt(pe[se]), I.prototype["set" + ee(pe[se])] = /* @__PURE__ */ function(t) {
|
|
3397
3389
|
return function(e) {
|
|
3398
3390
|
this[t] = String(e);
|
|
3399
3391
|
};
|
|
3400
|
-
}(
|
|
3401
|
-
var
|
|
3402
|
-
function
|
|
3392
|
+
}(pe[se]);
|
|
3393
|
+
var se, st = I;
|
|
3394
|
+
function Jt() {
|
|
3403
3395
|
var t = /^\s*at .*(\S+:\d+|\(native\))/m, e = /^(eval@)?(\[native code])?$/;
|
|
3404
3396
|
return { parse: b(function(r) {
|
|
3405
3397
|
if (r.stack && r.stack.match(t)) return this.parseV8OrIE(r);
|
|
@@ -3419,7 +3411,7 @@ var us = wr((hs, gt) => {
|
|
|
3419
3411
|
var a = s.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), i = a.match(/ (\(.+\)$)/);
|
|
3420
3412
|
a = i ? a.replace(i[0], "") : a;
|
|
3421
3413
|
var o = this.extractLocation(i ? i[1] : a), c = i && a || void 0, d = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
|
|
3422
|
-
return new
|
|
3414
|
+
return new st({ functionName: c, fileName: d, lineNumber: o[1], columnNumber: o[2], source: s });
|
|
3423
3415
|
}, this);
|
|
3424
3416
|
}, "ErrorStackParser$$parseV8OrIE"), parseFFOrSafari: b(function(r) {
|
|
3425
3417
|
var n = r.stack.split(`
|
|
@@ -3427,58 +3419,58 @@ var us = wr((hs, gt) => {
|
|
|
3427
3419
|
return !s.match(e);
|
|
3428
3420
|
}, this);
|
|
3429
3421
|
return n.map(function(s) {
|
|
3430
|
-
if (s.indexOf(" > eval") > -1 && (s = s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), s.indexOf("@") === -1 && s.indexOf(":") === -1) return new
|
|
3422
|
+
if (s.indexOf(" > eval") > -1 && (s = s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), s.indexOf("@") === -1 && s.indexOf(":") === -1) return new st({ functionName: s });
|
|
3431
3423
|
var a = /((.*".+"[^@]*)?[^@]*)(?:@)/, i = s.match(a), o = i && i[1] ? i[1] : void 0, c = this.extractLocation(s.replace(a, ""));
|
|
3432
|
-
return new
|
|
3424
|
+
return new st({ functionName: o, fileName: c[0], lineNumber: c[1], columnNumber: c[2], source: s });
|
|
3433
3425
|
}, this);
|
|
3434
3426
|
}, "ErrorStackParser$$parseFFOrSafari") };
|
|
3435
3427
|
}
|
|
3436
|
-
b(
|
|
3437
|
-
var
|
|
3428
|
+
b(Jt, "ErrorStackParser");
|
|
3429
|
+
var Hn = new Jt(), Wn = Hn, z = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && !process.browser, Yt = z && typeof mt < "u" && typeof mt.exports < "u" && typeof Ht < "u" && typeof __dirname < "u", Jn = z && !Yt, Yn = typeof Deno < "u", Kt = !z && !Yn, Kn = Kt && typeof window == "object" && typeof document == "object" && typeof document.createElement == "function" && "sessionStorage" in window && typeof importScripts != "function", Gn = Kt && typeof importScripts == "function" && typeof self == "object";
|
|
3438
3430
|
typeof navigator == "object" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") > -1;
|
|
3439
|
-
var
|
|
3440
|
-
async function
|
|
3441
|
-
if (!
|
|
3442
|
-
let t =
|
|
3431
|
+
var Gt, ut, Xt, Ot, gt;
|
|
3432
|
+
async function vt() {
|
|
3433
|
+
if (!z || (Gt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, Ot = await import("./__vite-browser-external-CPvbk0mb.js"), gt = await import("./__vite-browser-external-CPvbk0mb.js"), Xt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, ut = await import("./__vite-browser-external-CPvbk0mb.js"), _t = ut.sep, typeof Ht < "u")) return;
|
|
3434
|
+
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 };
|
|
3443
3435
|
globalThis.require = function(a) {
|
|
3444
3436
|
return s[a];
|
|
3445
3437
|
};
|
|
3446
3438
|
}
|
|
3447
|
-
b(
|
|
3439
|
+
b(vt, "initNodeModules");
|
|
3440
|
+
function Qt(t, e) {
|
|
3441
|
+
return ut.resolve(e || ".", t);
|
|
3442
|
+
}
|
|
3443
|
+
b(Qt, "node_resolvePath");
|
|
3448
3444
|
function er(t, e) {
|
|
3449
|
-
return
|
|
3445
|
+
return e === void 0 && (e = location), new URL(t, e).toString();
|
|
3450
3446
|
}
|
|
3451
|
-
b(er, "
|
|
3447
|
+
b(er, "browser_resolvePath");
|
|
3448
|
+
var ft;
|
|
3449
|
+
z ? ft = Qt : ft = er;
|
|
3450
|
+
var _t;
|
|
3451
|
+
z || (_t = "/");
|
|
3452
3452
|
function tr(t, e) {
|
|
3453
|
-
return
|
|
3453
|
+
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: gt.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
3454
3454
|
}
|
|
3455
|
-
b(tr, "
|
|
3456
|
-
var ht;
|
|
3457
|
-
q ? ht = er : ht = tr;
|
|
3458
|
-
var kt;
|
|
3459
|
-
q || (kt = "/");
|
|
3455
|
+
b(tr, "node_getBinaryResponse");
|
|
3460
3456
|
function rr(t, e) {
|
|
3461
|
-
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: _t.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
3462
|
-
}
|
|
3463
|
-
b(rr, "node_getBinaryResponse");
|
|
3464
|
-
function nr(t, e) {
|
|
3465
3457
|
let r = new URL(t, location);
|
|
3466
3458
|
return { response: fetch(r, e ? { integrity: e } : {}) };
|
|
3467
3459
|
}
|
|
3468
|
-
b(
|
|
3469
|
-
var
|
|
3470
|
-
|
|
3471
|
-
async function
|
|
3472
|
-
let { response: r, binary: n } =
|
|
3460
|
+
b(rr, "browser_getBinaryResponse");
|
|
3461
|
+
var Qe;
|
|
3462
|
+
z ? Qe = tr : Qe = rr;
|
|
3463
|
+
async function nr(t, e) {
|
|
3464
|
+
let { response: r, binary: n } = Qe(t, e);
|
|
3473
3465
|
if (n) return n;
|
|
3474
3466
|
let s = await r;
|
|
3475
3467
|
if (!s.ok) throw new Error(`Failed to load '${t}': request failed.`);
|
|
3476
3468
|
return new Uint8Array(await s.arrayBuffer());
|
|
3477
3469
|
}
|
|
3478
|
-
b(
|
|
3479
|
-
var
|
|
3480
|
-
if (
|
|
3481
|
-
else if (
|
|
3470
|
+
b(nr, "loadBinaryFile");
|
|
3471
|
+
var ze;
|
|
3472
|
+
if (Kn) ze = b(async (t) => await import(t), "loadScript");
|
|
3473
|
+
else if (Gn) ze = b(async (t) => {
|
|
3482
3474
|
try {
|
|
3483
3475
|
globalThis.importScripts(t);
|
|
3484
3476
|
} catch (e) {
|
|
@@ -3486,39 +3478,39 @@ var us = wr((hs, gt) => {
|
|
|
3486
3478
|
else throw e;
|
|
3487
3479
|
}
|
|
3488
3480
|
}, "loadScript");
|
|
3489
|
-
else if (
|
|
3481
|
+
else if (z) ze = sr;
|
|
3490
3482
|
else throw new Error("Cannot determine runtime environment");
|
|
3491
|
-
async function
|
|
3492
|
-
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ?
|
|
3483
|
+
async function sr(t) {
|
|
3484
|
+
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? Xt.runInThisContext(await (await fetch(t)).text()) : await import(Gt.pathToFileURL(t).href);
|
|
3493
3485
|
}
|
|
3494
|
-
b(
|
|
3495
|
-
async function
|
|
3496
|
-
if (
|
|
3497
|
-
await
|
|
3498
|
-
let e = await
|
|
3486
|
+
b(sr, "nodeLoadScript");
|
|
3487
|
+
async function ar(t) {
|
|
3488
|
+
if (z) {
|
|
3489
|
+
await vt();
|
|
3490
|
+
let e = await gt.readFile(t, { encoding: "utf8" });
|
|
3499
3491
|
return JSON.parse(e);
|
|
3500
3492
|
} else return await (await fetch(t)).json();
|
|
3501
3493
|
}
|
|
3502
|
-
b(
|
|
3503
|
-
async function
|
|
3504
|
-
if (
|
|
3494
|
+
b(ar, "loadLockFile");
|
|
3495
|
+
async function ir() {
|
|
3496
|
+
if (Yt) return __dirname;
|
|
3505
3497
|
let t;
|
|
3506
3498
|
try {
|
|
3507
3499
|
throw new Error();
|
|
3508
3500
|
} catch (n) {
|
|
3509
3501
|
t = n;
|
|
3510
3502
|
}
|
|
3511
|
-
let e =
|
|
3512
|
-
if (
|
|
3503
|
+
let e = Wn.parse(t)[0].fileName;
|
|
3504
|
+
if (z && !e.startsWith("file://") && (e = `file://${e}`), Jn) {
|
|
3513
3505
|
let n = await import("./__vite-browser-external-CPvbk0mb.js");
|
|
3514
3506
|
return (await import("./__vite-browser-external-CPvbk0mb.js")).fileURLToPath(n.dirname(e));
|
|
3515
3507
|
}
|
|
3516
|
-
let r = e.lastIndexOf(
|
|
3508
|
+
let r = e.lastIndexOf(_t);
|
|
3517
3509
|
if (r === -1) throw new Error("Could not extract indexURL path from pyodide module location");
|
|
3518
3510
|
return e.slice(0, r);
|
|
3519
3511
|
}
|
|
3520
|
-
b(
|
|
3521
|
-
function
|
|
3512
|
+
b(ir, "calculateDirname");
|
|
3513
|
+
function or(t) {
|
|
3522
3514
|
let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH, s = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(a) {
|
|
3523
3515
|
if (!a.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
|
|
3524
3516
|
return r.mount.apply(null, arguments);
|
|
@@ -3546,7 +3538,7 @@ var us = wr((hs, gt) => {
|
|
|
3546
3538
|
}
|
|
3547
3539
|
return { type: "local", entries: i };
|
|
3548
3540
|
}, getRemoteSet: async (a) => {
|
|
3549
|
-
let i = /* @__PURE__ */ Object.create(null), o = await
|
|
3541
|
+
let i = /* @__PURE__ */ Object.create(null), o = await Xn(a.opts.fileSystemHandle);
|
|
3550
3542
|
for (let [c, d] of o) c !== "." && (i[n.join2(a.mountpoint, c)] = { timestamp: d.kind === "file" ? new Date((await d.getFile()).lastModified) : /* @__PURE__ */ new Date(), mode: d.kind === "file" ? s.FILE_MODE : s.DIR_MODE });
|
|
3551
3543
|
return { type: "remote", entries: i, handles: o };
|
|
3552
3544
|
}, loadLocalEntry: (a) => {
|
|
@@ -3582,8 +3574,8 @@ var us = wr((hs, gt) => {
|
|
|
3582
3574
|
}, reconcile: async (a, i, o) => {
|
|
3583
3575
|
let c = 0, d = [];
|
|
3584
3576
|
Object.keys(i.entries).forEach(function(x) {
|
|
3585
|
-
let
|
|
3586
|
-
(!
|
|
3577
|
+
let P = i.entries[x], q = o.entries[x];
|
|
3578
|
+
(!q || e.isFile(P.mode) && P.timestamp.getTime() > q.timestamp.getTime()) && (d.push(x), c++);
|
|
3587
3579
|
}), d.sort();
|
|
3588
3580
|
let u = [];
|
|
3589
3581
|
if (Object.keys(o.entries).forEach(function(x) {
|
|
@@ -3591,25 +3583,25 @@ var us = wr((hs, gt) => {
|
|
|
3591
3583
|
}), u.sort().reverse(), !c) return;
|
|
3592
3584
|
let w = i.type === "remote" ? i.handles : o.handles;
|
|
3593
3585
|
for (let x of d) {
|
|
3594
|
-
let
|
|
3586
|
+
let P = n.normalize(x.replace(a.mountpoint, "/")).substring(1);
|
|
3595
3587
|
if (o.type === "local") {
|
|
3596
|
-
let
|
|
3597
|
-
s.storeLocalEntry(x,
|
|
3588
|
+
let q = w.get(P), Le = await s.loadRemoteEntry(q);
|
|
3589
|
+
s.storeLocalEntry(x, Le);
|
|
3598
3590
|
} else {
|
|
3599
|
-
let
|
|
3600
|
-
await s.storeRemoteEntry(w,
|
|
3591
|
+
let q = s.loadLocalEntry(x);
|
|
3592
|
+
await s.storeRemoteEntry(w, P, q);
|
|
3601
3593
|
}
|
|
3602
3594
|
}
|
|
3603
3595
|
for (let x of u) if (o.type === "local") s.removeLocalEntry(x);
|
|
3604
3596
|
else {
|
|
3605
|
-
let
|
|
3606
|
-
await s.removeRemoteEntry(w,
|
|
3597
|
+
let P = n.normalize(x.replace(a.mountpoint, "/")).substring(1);
|
|
3598
|
+
await s.removeRemoteEntry(w, P);
|
|
3607
3599
|
}
|
|
3608
3600
|
} };
|
|
3609
3601
|
t.FS.filesystems.NATIVEFS_ASYNC = s;
|
|
3610
3602
|
}
|
|
3611
|
-
b(
|
|
3612
|
-
var
|
|
3603
|
+
b(or, "initializeNativeFS");
|
|
3604
|
+
var Xn = b(async (t) => {
|
|
3613
3605
|
let e = [];
|
|
3614
3606
|
async function r(s) {
|
|
3615
3607
|
for await (let a of s.values()) e.push(a), a.kind === "directory" && await r(a);
|
|
@@ -3623,14 +3615,14 @@ var us = wr((hs, gt) => {
|
|
|
3623
3615
|
}
|
|
3624
3616
|
return n;
|
|
3625
3617
|
}, "getFsHandles");
|
|
3626
|
-
function
|
|
3627
|
-
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun:
|
|
3618
|
+
function cr(t) {
|
|
3619
|
+
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun: pr(t), quit(r, n) {
|
|
3628
3620
|
throw e.exited = { status: r, toThrow: n }, n;
|
|
3629
|
-
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm:
|
|
3621
|
+
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm: hr(t.indexURL) };
|
|
3630
3622
|
return e;
|
|
3631
3623
|
}
|
|
3632
|
-
b(
|
|
3633
|
-
function
|
|
3624
|
+
b(cr, "createSettings");
|
|
3625
|
+
function dr(t) {
|
|
3634
3626
|
return function(e) {
|
|
3635
3627
|
let r = "/";
|
|
3636
3628
|
try {
|
|
@@ -3641,14 +3633,14 @@ var us = wr((hs, gt) => {
|
|
|
3641
3633
|
e.FS.chdir(t);
|
|
3642
3634
|
};
|
|
3643
3635
|
}
|
|
3644
|
-
b(
|
|
3645
|
-
function
|
|
3636
|
+
b(dr, "createHomeDirectory");
|
|
3637
|
+
function lr(t) {
|
|
3646
3638
|
return function(e) {
|
|
3647
3639
|
Object.assign(e.ENV, t);
|
|
3648
3640
|
};
|
|
3649
3641
|
}
|
|
3650
|
-
b(
|
|
3651
|
-
function
|
|
3642
|
+
b(lr, "setEnvironment");
|
|
3643
|
+
function ur(t) {
|
|
3652
3644
|
return t ? [async (e) => {
|
|
3653
3645
|
e.addRunDependency("fsInitHook");
|
|
3654
3646
|
try {
|
|
@@ -3658,9 +3650,9 @@ var us = wr((hs, gt) => {
|
|
|
3658
3650
|
}
|
|
3659
3651
|
}] : [];
|
|
3660
3652
|
}
|
|
3661
|
-
b(
|
|
3662
|
-
function
|
|
3663
|
-
let e =
|
|
3653
|
+
b(ur, "callFsInitHook");
|
|
3654
|
+
function fr(t) {
|
|
3655
|
+
let e = nr(t);
|
|
3664
3656
|
return async (r) => {
|
|
3665
3657
|
let n = r._py_version_major(), s = r._py_version_minor();
|
|
3666
3658
|
r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${s}/site-packages`, r.FS.mkdirTree(r.API.sitePackages), r.addRunDependency("install-stdlib");
|
|
@@ -3674,15 +3666,15 @@ var us = wr((hs, gt) => {
|
|
|
3674
3666
|
}
|
|
3675
3667
|
};
|
|
3676
3668
|
}
|
|
3677
|
-
b(
|
|
3678
|
-
function
|
|
3669
|
+
b(fr, "installStdlib");
|
|
3670
|
+
function pr(t) {
|
|
3679
3671
|
let e;
|
|
3680
|
-
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...
|
|
3672
|
+
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...ur(t.fsInit), fr(e), dr(t.env.HOME), lr(t.env), or];
|
|
3681
3673
|
}
|
|
3682
|
-
b(
|
|
3683
|
-
function
|
|
3674
|
+
b(pr, "getFileSystemInitializationFuncs");
|
|
3675
|
+
function hr(t) {
|
|
3684
3676
|
if (typeof WasmOffsetConverter < "u") return;
|
|
3685
|
-
let { binary: e, response: r } =
|
|
3677
|
+
let { binary: e, response: r } = Qe(t + "pyodide.asm.wasm");
|
|
3686
3678
|
return function(n, s) {
|
|
3687
3679
|
return async function() {
|
|
3688
3680
|
try {
|
|
@@ -3696,19 +3688,19 @@ var us = wr((hs, gt) => {
|
|
|
3696
3688
|
}(), {};
|
|
3697
3689
|
};
|
|
3698
3690
|
}
|
|
3699
|
-
b(
|
|
3700
|
-
var
|
|
3701
|
-
async function
|
|
3691
|
+
b(hr, "getInstantiateWasmFunc");
|
|
3692
|
+
var pt = "0.27.5";
|
|
3693
|
+
async function ht(t = {}) {
|
|
3702
3694
|
var e, r;
|
|
3703
|
-
await
|
|
3704
|
-
let n = t.indexURL || await
|
|
3705
|
-
n =
|
|
3695
|
+
await vt();
|
|
3696
|
+
let n = t.indexURL || await ir();
|
|
3697
|
+
n = ft(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
|
|
3706
3698
|
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);
|
|
3707
3699
|
(e = a.env).HOME ?? (e.HOME = "/home/pyodide"), (r = a.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
|
|
3708
|
-
let i =
|
|
3709
|
-
if (o.lockFilePromise =
|
|
3700
|
+
let i = cr(a), o = i.API;
|
|
3701
|
+
if (o.lockFilePromise = ar(a.lockFileURL), typeof _createPyodideModule != "function") {
|
|
3710
3702
|
let x = `${a.indexURL}pyodide.asm.js`;
|
|
3711
|
-
await
|
|
3703
|
+
await ze(x);
|
|
3712
3704
|
}
|
|
3713
3705
|
let c;
|
|
3714
3706
|
if (t._loadSnapshot) {
|
|
@@ -3717,7 +3709,7 @@ var us = wr((hs, gt) => {
|
|
|
3717
3709
|
}
|
|
3718
3710
|
let d = await _createPyodideModule(i);
|
|
3719
3711
|
if (i.exited) throw i.exited.toThrow;
|
|
3720
|
-
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !==
|
|
3712
|
+
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== pt && a.checkAPIVersion) throw new Error(`Pyodide version does not match: '${pt}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
|
|
3721
3713
|
d.locateFile = (x) => {
|
|
3722
3714
|
throw new Error("Didn't expect to load any more file_packager files!");
|
|
3723
3715
|
};
|
|
@@ -3726,12 +3718,8 @@ var us = wr((hs, gt) => {
|
|
|
3726
3718
|
let w = o.finalizeBootstrap(u, t._snapshotDeserializer);
|
|
3727
3719
|
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;
|
|
3728
3720
|
}
|
|
3729
|
-
b(
|
|
3730
|
-
|
|
3731
|
-
function ts(t) {
|
|
3732
|
-
return t.includes("dev") && es ? "dev" : `v${mt}`;
|
|
3733
|
-
}
|
|
3734
|
-
class rs {
|
|
3721
|
+
b(ht, "loadPyodide");
|
|
3722
|
+
class Qn {
|
|
3735
3723
|
constructor() {
|
|
3736
3724
|
this.spans = [];
|
|
3737
3725
|
}
|
|
@@ -3773,31 +3761,25 @@ var us = wr((hs, gt) => {
|
|
|
3773
3761
|
logSpans() {
|
|
3774
3762
|
}
|
|
3775
3763
|
}
|
|
3776
|
-
const
|
|
3777
|
-
globalThis.t =
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
return function(...n) {
|
|
3781
|
-
return r || (r = !0, e = t.apply(this, n)), e;
|
|
3782
|
-
};
|
|
3783
|
-
}
|
|
3784
|
-
const ss = !1;
|
|
3785
|
-
class as {
|
|
3764
|
+
const R = new Qn();
|
|
3765
|
+
globalThis.t = R;
|
|
3766
|
+
const es = !1;
|
|
3767
|
+
class ts {
|
|
3786
3768
|
constructor() {
|
|
3787
3769
|
this.pyodide = null;
|
|
3788
3770
|
}
|
|
3789
3771
|
get requirePyodide() {
|
|
3790
|
-
return
|
|
3772
|
+
return Bt(this.pyodide, "Pyodide not loaded"), this.pyodide;
|
|
3791
3773
|
}
|
|
3792
3774
|
async bootstrap(e) {
|
|
3793
3775
|
return await this.loadPyodideAndPackages(e);
|
|
3794
3776
|
}
|
|
3795
3777
|
async loadPyodideAndPackages(e) {
|
|
3796
|
-
if (!
|
|
3778
|
+
if (!ht)
|
|
3797
3779
|
throw new Error("loadPyodide is not defined");
|
|
3798
|
-
const r =
|
|
3780
|
+
const r = R.startSpan("loadPyodide");
|
|
3799
3781
|
try {
|
|
3800
|
-
const n = await
|
|
3782
|
+
const n = await ht({
|
|
3801
3783
|
// Perf: These get loaded while pyodide is being bootstrapped
|
|
3802
3784
|
packages: [
|
|
3803
3785
|
"micropip",
|
|
@@ -3807,7 +3789,7 @@ var us = wr((hs, gt) => {
|
|
|
3807
3789
|
"narwhals",
|
|
3808
3790
|
"packaging"
|
|
3809
3791
|
],
|
|
3810
|
-
_makeSnapshot:
|
|
3792
|
+
_makeSnapshot: es,
|
|
3811
3793
|
lockFileURL: `https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,
|
|
3812
3794
|
// Without this, this fails in Firefox with
|
|
3813
3795
|
// `Could not extract indexURL path from pyodide module`
|
|
@@ -3820,8 +3802,8 @@ var us = wr((hs, gt) => {
|
|
|
3820
3802
|
}
|
|
3821
3803
|
}
|
|
3822
3804
|
async mountFilesystem(e) {
|
|
3823
|
-
const r =
|
|
3824
|
-
return
|
|
3805
|
+
const r = R.startSpan("mountFilesystem");
|
|
3806
|
+
return ae.createHomeDir(this.requirePyodide), ae.mountFS(this.requirePyodide), await ae.populateFilesToMemory(this.requirePyodide), r.end("ok"), ae.initNotebookCode({
|
|
3825
3807
|
pyodide: this.requirePyodide,
|
|
3826
3808
|
code: e.code,
|
|
3827
3809
|
filename: e.filename
|
|
@@ -3832,7 +3814,7 @@ var us = wr((hs, gt) => {
|
|
|
3832
3814
|
self.messenger = {
|
|
3833
3815
|
callback: s
|
|
3834
3816
|
}, self.query_params = a, self.user_config = i;
|
|
3835
|
-
const o =
|
|
3817
|
+
const o = R.startSpan("startSession.runPython"), c = n || ae.NOTEBOOK_FILENAME, [d, u, w] = this.requirePyodide.runPython(
|
|
3836
3818
|
`
|
|
3837
3819
|
print("[py] Starting marimo...")
|
|
3838
3820
|
import asyncio
|
|
@@ -3875,11 +3857,11 @@ ${e}`, e = `import jedi
|
|
|
3875
3857
|
${e}`, e = `import pyodide_http
|
|
3876
3858
|
${e}`;
|
|
3877
3859
|
const s = [...r];
|
|
3878
|
-
let a =
|
|
3860
|
+
let a = R.startSpan("pyodide.loadPackage");
|
|
3879
3861
|
await n.loadPackagesFromImports(e, {
|
|
3880
3862
|
errorCallback: Y.error,
|
|
3881
3863
|
messageCallback: Y.log
|
|
3882
|
-
}), a.end(), a =
|
|
3864
|
+
}), a.end(), a = R.startSpan("micropip.install");
|
|
3883
3865
|
const i = s.filter(
|
|
3884
3866
|
(o) => !n.loadedPackages[o]
|
|
3885
3867
|
);
|
|
@@ -3896,86 +3878,98 @@ ${e}`;
|
|
|
3896
3878
|
}), a.end();
|
|
3897
3879
|
}
|
|
3898
3880
|
}
|
|
3899
|
-
async function
|
|
3881
|
+
async function rs(t) {
|
|
3900
3882
|
try {
|
|
3901
3883
|
return await import(
|
|
3902
3884
|
/* @vite-ignore */
|
|
3903
3885
|
`/wasm/controller.js?version=${t}`
|
|
3904
3886
|
);
|
|
3905
3887
|
} catch {
|
|
3906
|
-
return new
|
|
3888
|
+
return new ts();
|
|
3907
3889
|
}
|
|
3908
3890
|
}
|
|
3909
|
-
const
|
|
3910
|
-
|
|
3891
|
+
const ns = !1;
|
|
3892
|
+
function ss(t) {
|
|
3893
|
+
return t.includes("dev") && ns ? "dev" : `v${pt}`;
|
|
3894
|
+
}
|
|
3895
|
+
class as {
|
|
3896
|
+
constructor(e) {
|
|
3897
|
+
this.onMessage = e, this.started = !1, this.push = (r) => {
|
|
3898
|
+
this.started ? this.onMessage(r) : this.buffer.push(r);
|
|
3899
|
+
}, this.start = () => {
|
|
3900
|
+
this.started = !0, this.buffer.forEach((r) => this.onMessage(r)), this.buffer = [];
|
|
3901
|
+
}, this.buffer = [];
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
const Nt = R.startSpan("worker:init");
|
|
3905
|
+
async function is() {
|
|
3911
3906
|
try {
|
|
3912
|
-
const t =
|
|
3913
|
-
self.controller = r,
|
|
3907
|
+
const t = ds(), e = ss(t), r = await R.wrapAsync(rs)(t);
|
|
3908
|
+
self.controller = r, H.send.initializingMessage({
|
|
3914
3909
|
message: "Loading marimo..."
|
|
3915
|
-
}), self.pyodide = await
|
|
3910
|
+
}), self.pyodide = await R.wrapAsync(r.bootstrap.bind(r))({
|
|
3916
3911
|
version: t,
|
|
3917
3912
|
pyodideVersion: e
|
|
3918
3913
|
});
|
|
3919
3914
|
} catch (t) {
|
|
3920
|
-
Y.error("Error bootstrapping", t),
|
|
3915
|
+
Y.error("Error bootstrapping", t), H.send.initializedError({
|
|
3921
3916
|
error: Ut(t)
|
|
3922
3917
|
});
|
|
3923
3918
|
}
|
|
3924
3919
|
}
|
|
3925
|
-
const
|
|
3920
|
+
const mr = new as(
|
|
3926
3921
|
(t) => {
|
|
3927
|
-
|
|
3922
|
+
H.send.kernelMessage({ message: t });
|
|
3928
3923
|
}
|
|
3929
|
-
),
|
|
3930
|
-
let
|
|
3931
|
-
const
|
|
3924
|
+
), Rt = new Ar();
|
|
3925
|
+
let At = !1;
|
|
3926
|
+
const os = {
|
|
3932
3927
|
/**
|
|
3933
3928
|
* Start the session
|
|
3934
3929
|
*/
|
|
3935
3930
|
startSession: async (t) => {
|
|
3936
|
-
|
|
3937
|
-
if (await L, Pt) {
|
|
3931
|
+
if (await M, At) {
|
|
3938
3932
|
Y.warn("Session already started");
|
|
3939
3933
|
return;
|
|
3940
3934
|
}
|
|
3941
|
-
|
|
3935
|
+
At = !0;
|
|
3942
3936
|
try {
|
|
3943
|
-
|
|
3937
|
+
Bt(self.controller, "Controller not loaded"), await self.controller.mountFilesystem?.({
|
|
3944
3938
|
code: t.code,
|
|
3945
3939
|
filename: t.filename
|
|
3946
|
-
})
|
|
3947
|
-
const
|
|
3940
|
+
});
|
|
3941
|
+
const e = R.wrapAsync(
|
|
3948
3942
|
self.controller.startSession.bind(self.controller)
|
|
3949
|
-
),
|
|
3950
|
-
|
|
3943
|
+
), r = Nr(() => {
|
|
3944
|
+
H.send.initializingMessage({
|
|
3951
3945
|
message: "Initializing notebook..."
|
|
3952
|
-
}),
|
|
3946
|
+
}), H.send.initialized({});
|
|
3953
3947
|
});
|
|
3954
|
-
|
|
3948
|
+
H.send.initializingMessage({
|
|
3955
3949
|
message: "Loading notebook and dependencies..."
|
|
3956
3950
|
});
|
|
3957
|
-
const
|
|
3951
|
+
const n = await e({
|
|
3958
3952
|
code: t.code,
|
|
3959
3953
|
filename: t.filename,
|
|
3960
3954
|
queryParameters: t.queryParameters,
|
|
3961
3955
|
userConfig: t.userConfig,
|
|
3962
|
-
onMessage: (
|
|
3963
|
-
|
|
3956
|
+
onMessage: (s) => {
|
|
3957
|
+
r(), mr.push(s);
|
|
3964
3958
|
}
|
|
3965
3959
|
});
|
|
3966
|
-
|
|
3967
|
-
} catch (
|
|
3968
|
-
|
|
3969
|
-
error: Ut(
|
|
3970
|
-
}),
|
|
3960
|
+
Rt.resolve(n), Nt.end("ok");
|
|
3961
|
+
} catch (e) {
|
|
3962
|
+
H.send.initializedError({
|
|
3963
|
+
error: Ut(e)
|
|
3964
|
+
}), Nt.end("error");
|
|
3971
3965
|
}
|
|
3972
3966
|
},
|
|
3973
3967
|
/**
|
|
3974
3968
|
* Load packages
|
|
3975
3969
|
*/
|
|
3976
3970
|
loadPackages: async (t) => {
|
|
3977
|
-
const e =
|
|
3978
|
-
await
|
|
3971
|
+
const e = R.startSpan("loadPackages");
|
|
3972
|
+
await M, t.includes("mo.sql") && (t = `import pandas
|
|
3979
3973
|
${t}`, t = `import duckdb
|
|
3980
3974
|
${t}`, t = `import sqlglot
|
|
3981
3975
|
${t}`, t.includes("polars") && (t = `import pyarrow
|
|
@@ -3988,19 +3982,19 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
3988
3982
|
* Read a file
|
|
3989
3983
|
*/
|
|
3990
3984
|
readFile: async (t) => {
|
|
3991
|
-
const e =
|
|
3992
|
-
await
|
|
3993
|
-
const r =
|
|
3985
|
+
const e = R.startSpan("readFile");
|
|
3986
|
+
await M;
|
|
3987
|
+
const r = at(self.pyodide.FS.readFile(t));
|
|
3994
3988
|
return e.end(), r;
|
|
3995
3989
|
},
|
|
3996
3990
|
/**
|
|
3997
3991
|
* Set the interrupt buffer
|
|
3998
3992
|
*/
|
|
3999
3993
|
setInterruptBuffer: async (t) => {
|
|
4000
|
-
await
|
|
3994
|
+
await M, self.pyodide.setInterruptBuffer(t);
|
|
4001
3995
|
},
|
|
4002
3996
|
addPackage: async (t) => {
|
|
4003
|
-
await
|
|
3997
|
+
await M;
|
|
4004
3998
|
const { package: e } = t, r = e.split(" ").map((s) => s.trim()), n = await self.pyodide.runPythonAsync(`
|
|
4005
3999
|
import micropip
|
|
4006
4000
|
import json
|
|
@@ -4015,7 +4009,7 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4015
4009
|
return JSON.parse(n);
|
|
4016
4010
|
},
|
|
4017
4011
|
removePackage: async (t) => {
|
|
4018
|
-
await
|
|
4012
|
+
await M;
|
|
4019
4013
|
const { package: e } = t, r = await self.pyodide.runPythonAsync(`
|
|
4020
4014
|
import micropip
|
|
4021
4015
|
import json
|
|
@@ -4030,8 +4024,8 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4030
4024
|
return JSON.parse(r);
|
|
4031
4025
|
},
|
|
4032
4026
|
listPackages: async () => {
|
|
4033
|
-
const t =
|
|
4034
|
-
await
|
|
4027
|
+
const t = R.startSpan("listPackages");
|
|
4028
|
+
await M;
|
|
4035
4029
|
const e = await self.pyodide.runPythonAsync(`
|
|
4036
4030
|
import json
|
|
4037
4031
|
import micropip
|
|
@@ -4051,19 +4045,19 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4051
4045
|
* Save the notebook
|
|
4052
4046
|
*/
|
|
4053
4047
|
saveNotebook: async (t) => {
|
|
4054
|
-
await
|
|
4048
|
+
await M, await self.pyodide.runPython(`
|
|
4055
4049
|
from marimo._pyodide.bootstrap import save_file
|
|
4056
4050
|
save_file
|
|
4057
|
-
`)(JSON.stringify(t),
|
|
4051
|
+
`)(JSON.stringify(t), ae.NOTEBOOK_FILENAME);
|
|
4058
4052
|
},
|
|
4059
4053
|
/**
|
|
4060
4054
|
* Call a function on the bridge
|
|
4061
4055
|
*/
|
|
4062
4056
|
bridge: async (t) => {
|
|
4063
|
-
const e =
|
|
4057
|
+
const e = R.startSpan("bridge", {
|
|
4064
4058
|
functionName: t.functionName
|
|
4065
4059
|
});
|
|
4066
|
-
await
|
|
4060
|
+
await M;
|
|
4067
4061
|
const { functionName: r, payload: n } = t;
|
|
4068
4062
|
r === "format" && await self.pyodide.runPythonAsync(`
|
|
4069
4063
|
import micropip
|
|
@@ -4080,26 +4074,26 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4080
4074
|
except ModuleNotFoundError:
|
|
4081
4075
|
await micropip.install("pyyaml")
|
|
4082
4076
|
`);
|
|
4083
|
-
const s = await
|
|
4077
|
+
const s = await Rt.promise, a = n == null ? null : typeof n == "string" ? n : JSON.stringify(n), i = a == null ? (
|
|
4084
4078
|
// @ts-expect-error ehh TypeScript
|
|
4085
4079
|
await s[r]()
|
|
4086
4080
|
) : (
|
|
4087
4081
|
// @ts-expect-error ehh TypeScript
|
|
4088
4082
|
await s[r](a)
|
|
4089
4083
|
);
|
|
4090
|
-
return
|
|
4084
|
+
return cs.has(r) && ae.persistFilesToRemote(self.pyodide), e.end(), typeof i == "string" ? JSON.parse(i) : i;
|
|
4091
4085
|
}
|
|
4092
|
-
},
|
|
4093
|
-
transport:
|
|
4094
|
-
transportId:
|
|
4086
|
+
}, H = xr({
|
|
4087
|
+
transport: Or({
|
|
4088
|
+
transportId: zn
|
|
4095
4089
|
}),
|
|
4096
|
-
requestHandler:
|
|
4090
|
+
requestHandler: os
|
|
4097
4091
|
});
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
await
|
|
4092
|
+
H.send("ready", {});
|
|
4093
|
+
H.addMessageListener("consumerReady", async () => {
|
|
4094
|
+
await M, mr.start();
|
|
4101
4095
|
});
|
|
4102
|
-
const
|
|
4096
|
+
const cs = /* @__PURE__ */ new Set([
|
|
4103
4097
|
"save",
|
|
4104
4098
|
"save_app_config",
|
|
4105
4099
|
"rename_file",
|
|
@@ -4108,9 +4102,9 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4108
4102
|
"move_file_or_directory",
|
|
4109
4103
|
"update_file"
|
|
4110
4104
|
]);
|
|
4111
|
-
function
|
|
4105
|
+
function ds() {
|
|
4112
4106
|
return self.name;
|
|
4113
4107
|
}
|
|
4114
|
-
const
|
|
4108
|
+
const M = R.wrapAsync(is)();
|
|
4115
4109
|
});
|
|
4116
|
-
export default
|
|
4110
|
+
export default ls();
|