@marimo-team/islands 0.14.18-dev1 → 0.14.18-dev10
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-D-_w0-5f.js → ConnectedDataExplorerComponent-BtZjFoaC.js} +2 -2
- package/dist/{ImageComparisonComponent-ZPzSyBtg.js → ImageComparisonComponent-CNd8CBiK.js} +1 -1
- package/dist/{_baseUniq-Cj-9GFmL.js → _baseUniq-quRGkTiY.js} +1 -1
- package/dist/{any-language-editor-tCzSYtJK.js → any-language-editor-DsQPbJN6.js} +1 -1
- package/dist/{architectureDiagram-SUXI7LT5-CO6QntPu.js → architectureDiagram-SUXI7LT5-DlFWt0qs.js} +5 -5
- package/dist/assets/{worker-BFGyNjDW.js → worker-CvLTHCt4.js} +479 -477
- package/dist/{blockDiagram-6J76NXCF-CQ-Z-JZZ.js → blockDiagram-6J76NXCF-BR7eLpjJ.js} +5 -5
- package/dist/{c4Diagram-6F6E4RAY-DIXAf9fJ.js → c4Diagram-6F6E4RAY-CdvW-mpI.js} +2 -2
- package/dist/{channel-CS6wTkT7.js → channel-syCI4-HH.js} +1 -1
- package/dist/{chunk-353BL4L5-iNXZ1Vxa.js → chunk-353BL4L5-Muz3vyK7.js} +1 -1
- package/dist/{chunk-67H74DCK-D4SFvdUy.js → chunk-67H74DCK-hPXhH_aW.js} +1 -1
- package/dist/{chunk-AACKK3MU-B9uNQzDE.js → chunk-AACKK3MU-FST_laGh.js} +1 -1
- package/dist/{chunk-BFAMUDN2-B0F2LqCw.js → chunk-BFAMUDN2-CzCSW8QL.js} +1 -1
- package/dist/{chunk-E2GYISFI-CK4OZ54r.js → chunk-E2GYISFI-D_f0bVm6.js} +1 -1
- package/dist/{chunk-OW32GOEJ-DdcP2V-p.js → chunk-OW32GOEJ-BnhM21kz.js} +3 -3
- package/dist/{chunk-SKB7J2MH-DVcXVxbA.js → chunk-SKB7J2MH-CF3QDtnr.js} +1 -1
- package/dist/{chunk-SZ463SBG-CovY-_af.js → chunk-SZ463SBG-Bod5Kd38.js} +4 -4
- package/dist/{classDiagram-v2-YAWTLIQI-DCJ9l2Lu.js → classDiagram-M3E45YP4-BFu-osca.js} +2 -2
- package/dist/{classDiagram-M3E45YP4-DCJ9l2Lu.js → classDiagram-v2-YAWTLIQI-BFu-osca.js} +2 -2
- package/dist/{clone-B7lHVMV3.js → clone-DUlWVDeQ.js} +1 -1
- package/dist/{dagre-JOIXM2OF-HsO3R2sn.js → dagre-JOIXM2OF-crUwGdRr.js} +6 -6
- package/dist/{data-grid-overlay-editor-Bx-wbTSh.js → data-grid-overlay-editor-J231CRg_.js} +2 -2
- package/dist/{diagram-5UYTHUR4-DKkfzKlA.js → diagram-5UYTHUR4-DtTCIW9D.js} +3 -3
- package/dist/{diagram-VMROVX33-DUhLsO2w.js → diagram-VMROVX33-BmH-pCKA.js} +5 -5
- package/dist/{diagram-ZTM2IBQH-DSKgI1P7.js → diagram-ZTM2IBQH-kxj3u8cx.js} +3 -3
- package/dist/{erDiagram-3M52JZNH-B2xADQeL.js → erDiagram-3M52JZNH-BrlptFSI.js} +4 -4
- package/dist/{flowDiagram-KYDEHFYC-BeCTiZOl.js → flowDiagram-KYDEHFYC-C6JlzKED.js} +5 -5
- package/dist/{ganttDiagram-EK5VF46D-CChw_was.js → ganttDiagram-EK5VF46D-CaHRTFWt.js} +4 -4
- package/dist/{gitGraphDiagram-GW3U2K7C-BnQFmaFG.js → gitGraphDiagram-GW3U2K7C-CaIflCry.js} +4 -4
- package/dist/{glide-data-editor-BKrFXSle.js → glide-data-editor-D8gUOSTg.js} +3 -3
- package/dist/{graph-BEOd7aZs.js → graph-CapKgW8a.js} +3 -3
- package/dist/{index-BtW67jLT.js → index-0BxBq79g.js} +1 -1
- package/dist/{index-BezfgwBn.js → index-DDhySdjm.js} +1 -1
- package/dist/{index-BOVC7PPB.js → index-YZ0LT7S5.js} +3 -3
- package/dist/{index-91RDWWY5.js → index-cBbteuwQ.js} +1 -1
- package/dist/{infoDiagram-LHK5PUON-zGkjyDNy.js → infoDiagram-LHK5PUON-vnXdcuP0.js} +2 -2
- package/dist/{journeyDiagram-EWQZEKCU-CHYw8CTc.js → journeyDiagram-EWQZEKCU-Dq-a4htE.js} +3 -3
- package/dist/{kanban-definition-ZSS6B67P-DhgPAEZV.js → kanban-definition-ZSS6B67P-DcpyNgk_.js} +2 -2
- package/dist/{layout-CxQfgB12.js → layout-tTBhRb58.js} +4 -4
- package/dist/{linear-BmQ3M4pE.js → linear-C-qyvD3u.js} +1 -1
- package/dist/{main-DBS3Amn_.js → main-WQzhKXJB.js} +23204 -23204
- package/dist/main.js +1 -1
- package/dist/{mermaid-CMOJnfyJ.js → mermaid-OyRQ2b9Q.js} +29 -29
- package/dist/{min-D8SpcQyr.js → min-Dl62Vpo6.js} +2 -2
- package/dist/{mindmap-definition-6CBA2TL7-D6__Wx-i.js → mindmap-definition-6CBA2TL7-C5PyS6pO.js} +2 -2
- package/dist/{number-overlay-editor-BfS9aO9f.js → number-overlay-editor-B_8gCLus.js} +2 -2
- package/dist/{pieDiagram-NIOCPIFQ-VNxi_LBo.js → pieDiagram-NIOCPIFQ-D1PIRt8U.js} +3 -3
- package/dist/{quadrantDiagram-2OG54O6I-zCVe6AeS.js → quadrantDiagram-2OG54O6I-vsHdxPPB.js} +2 -2
- package/dist/{react-plotly-B3srCC_o.js → react-plotly-DMCaOHQq.js} +1 -1
- package/dist/{requirementDiagram-QOLK2EJ7-Bu1DNi2L.js → requirementDiagram-QOLK2EJ7-D5nni-Gc.js} +3 -3
- package/dist/{sankeyDiagram-4UZDY2LN-soDJin5T.js → sankeyDiagram-4UZDY2LN-CNt4fXtN.js} +1 -1
- package/dist/{sequenceDiagram-SKLFT4DO-DFwAo_PR.js → sequenceDiagram-SKLFT4DO-DSC9xJpD.js} +3 -3
- package/dist/{slides-component-_YFDMRO5.js → slides-component-C6b92EQI.js} +1 -1
- package/dist/{stateDiagram-MI5ZYTHO-CCtIAqLn.js → stateDiagram-MI5ZYTHO-LCoorhwX.js} +4 -4
- package/dist/{stateDiagram-v2-5AN5P6BG-BM6-_jPy.js → stateDiagram-v2-5AN5P6BG-ChN9Pos6.js} +2 -2
- package/dist/{time-B-rHZftI.js → time-C-sZL6Xo.js} +2 -2
- package/dist/{timeline-definition-MYPXXCX6-DyikUfme.js → timeline-definition-MYPXXCX6-q--aipnO.js} +1 -1
- package/dist/{treemap-75Q7IDZK-CVWDfIc1.js → treemap-75Q7IDZK-C3xs-EDy.js} +5 -5
- package/dist/{vega-component-B5i6kLfu.js → vega-component-5Rnbt4we.js} +2 -2
- package/dist/{xychartDiagram-H2YORKM3-ChaIylPp.js → xychartDiagram-H2YORKM3-cpPoofcd.js} +2 -2
- package/package.json +3 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
var dr = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
2
|
+
var bn = dr((Tn, Qe) => {
|
|
3
|
+
const cr = 1e10, lr = 1e3;
|
|
4
|
+
function be(t, e) {
|
|
5
5
|
const r = t.map((n) => `"${n}"`).join(", ");
|
|
6
6
|
return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function ur(t = {}) {
|
|
9
9
|
let e = {};
|
|
10
10
|
function r(y) {
|
|
11
11
|
e = y;
|
|
12
12
|
}
|
|
13
13
|
let n = {};
|
|
14
14
|
function a(y) {
|
|
15
|
-
n.unregisterHandler && n.unregisterHandler(), n = y, n.registerHandler?.(
|
|
15
|
+
n.unregisterHandler && n.unregisterHandler(), n = y, n.registerHandler?.(or);
|
|
16
16
|
}
|
|
17
17
|
let s;
|
|
18
18
|
function i(y) {
|
|
@@ -20,86 +20,86 @@ var wn = or((Sn, Ye) => {
|
|
|
20
20
|
s = y;
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
s = (b,
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
23
|
+
s = (b, O) => {
|
|
24
|
+
const R = y[b];
|
|
25
|
+
if (R)
|
|
26
|
+
return R(O);
|
|
27
27
|
const $ = y._;
|
|
28
28
|
if (!$)
|
|
29
29
|
throw new Error(`The requested method has no handler: ${b}`);
|
|
30
|
-
return $(b,
|
|
30
|
+
return $(b, O);
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
const { maxRequestTime: o =
|
|
33
|
+
const { maxRequestTime: o = lr } = t;
|
|
34
34
|
t.transport && a(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
35
35
|
let d = 0;
|
|
36
36
|
function l() {
|
|
37
|
-
return d <=
|
|
37
|
+
return d <= cr ? ++d : d = 0;
|
|
38
38
|
}
|
|
39
39
|
const h = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
40
40
|
function S(y, ...b) {
|
|
41
|
-
const
|
|
42
|
-
return new Promise((
|
|
41
|
+
const O = b[0];
|
|
42
|
+
return new Promise((R, $) => {
|
|
43
43
|
if (!n.send)
|
|
44
|
-
throw
|
|
45
|
-
const z = l(),
|
|
44
|
+
throw be(["send"], "make requests");
|
|
45
|
+
const z = l(), nt = {
|
|
46
46
|
type: "request",
|
|
47
47
|
id: z,
|
|
48
48
|
method: y,
|
|
49
|
-
params:
|
|
49
|
+
params: O
|
|
50
50
|
};
|
|
51
|
-
h.set(z, { resolve:
|
|
51
|
+
h.set(z, { resolve: R, reject: $ }), o !== 1 / 0 && x.set(z, setTimeout(() => {
|
|
52
52
|
x.delete(z), $(new Error("RPC request timed out."));
|
|
53
|
-
}, o)), e.onSend?.(
|
|
53
|
+
}, o)), e.onSend?.(nt), n.send(nt);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
const j = new Proxy(S, {
|
|
57
|
-
get: (y, b,
|
|
57
|
+
get: (y, b, O) => b in y ? Reflect.get(y, b, O) : (R) => S(b, R)
|
|
58
58
|
}), D = j;
|
|
59
|
-
function
|
|
60
|
-
const
|
|
59
|
+
function we(y, ...b) {
|
|
60
|
+
const O = b[0];
|
|
61
61
|
if (!n.send)
|
|
62
|
-
throw
|
|
63
|
-
const
|
|
62
|
+
throw be(["send"], "send messages");
|
|
63
|
+
const R = {
|
|
64
64
|
type: "message",
|
|
65
65
|
id: y,
|
|
66
|
-
payload:
|
|
66
|
+
payload: O
|
|
67
67
|
};
|
|
68
|
-
e.onSend?.(
|
|
68
|
+
e.onSend?.(R), n.send(R);
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
get: (y, b,
|
|
72
|
-
}),
|
|
73
|
-
function
|
|
70
|
+
const tt = new Proxy(we, {
|
|
71
|
+
get: (y, b, O) => b in y ? Reflect.get(y, b, O) : (R) => we(b, R)
|
|
72
|
+
}), rt = tt, Y = /* @__PURE__ */ new Map(), Fe = /* @__PURE__ */ new Set();
|
|
73
|
+
function sr(y, b) {
|
|
74
74
|
if (!n.registerHandler)
|
|
75
|
-
throw
|
|
75
|
+
throw be(["registerHandler"], "register message listeners");
|
|
76
76
|
if (y === "*") {
|
|
77
|
-
|
|
77
|
+
Fe.add(b);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
Y.has(y) || Y.set(y, /* @__PURE__ */ new Set()), Y.get(y)?.add(b);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function ir(y, b) {
|
|
83
83
|
if (y === "*") {
|
|
84
|
-
|
|
84
|
+
Fe.delete(b);
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
Y.get(y)?.delete(b), Y.get(y)?.size === 0 && Y.delete(y);
|
|
88
88
|
}
|
|
89
|
-
async function
|
|
89
|
+
async function or(y) {
|
|
90
90
|
if (e.onReceive?.(y), !("type" in y))
|
|
91
91
|
throw new Error("Message does not contain a type.");
|
|
92
92
|
if (y.type === "request") {
|
|
93
93
|
if (!n.send || !s)
|
|
94
|
-
throw
|
|
95
|
-
const { id: b, method:
|
|
94
|
+
throw be(["send", "requestHandler"], "handle requests");
|
|
95
|
+
const { id: b, method: O, params: R } = y;
|
|
96
96
|
let $;
|
|
97
97
|
try {
|
|
98
98
|
$ = {
|
|
99
99
|
type: "response",
|
|
100
100
|
id: b,
|
|
101
101
|
success: !0,
|
|
102
|
-
payload: await s(
|
|
102
|
+
payload: await s(O, R)
|
|
103
103
|
};
|
|
104
104
|
} catch (z) {
|
|
105
105
|
if (!(z instanceof Error))
|
|
@@ -117,18 +117,18 @@ var wn = or((Sn, Ye) => {
|
|
|
117
117
|
if (y.type === "response") {
|
|
118
118
|
const b = x.get(y.id);
|
|
119
119
|
b != null && clearTimeout(b);
|
|
120
|
-
const { resolve:
|
|
121
|
-
y.success ?
|
|
120
|
+
const { resolve: O, reject: R } = h.get(y.id) ?? {};
|
|
121
|
+
y.success ? O?.(y.payload) : R?.(new Error(y.error));
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
if (y.type === "message") {
|
|
125
|
-
for (const
|
|
126
|
-
|
|
125
|
+
for (const O of Fe)
|
|
126
|
+
O(y.id, y.payload);
|
|
127
127
|
const b = Y.get(y.id);
|
|
128
128
|
if (!b)
|
|
129
129
|
return;
|
|
130
|
-
for (const
|
|
131
|
-
|
|
130
|
+
for (const O of b)
|
|
131
|
+
O(y.payload);
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
throw new Error(`Unexpected RPC message type: ${y.type}`);
|
|
@@ -138,44 +138,44 @@ var wn = or((Sn, Ye) => {
|
|
|
138
138
|
setRequestHandler: i,
|
|
139
139
|
request: j,
|
|
140
140
|
requestProxy: D,
|
|
141
|
-
send:
|
|
142
|
-
sendProxy:
|
|
143
|
-
addMessageListener:
|
|
144
|
-
removeMessageListener:
|
|
145
|
-
proxy: { send:
|
|
141
|
+
send: tt,
|
|
142
|
+
sendProxy: rt,
|
|
143
|
+
addMessageListener: sr,
|
|
144
|
+
removeMessageListener: ir,
|
|
145
|
+
proxy: { send: rt, request: D },
|
|
146
146
|
_setDebugHooks: r
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
149
|
+
function fr(t) {
|
|
150
|
+
return ur(t);
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
function
|
|
152
|
+
const xt = "[transport-id]";
|
|
153
|
+
function hr(t, e) {
|
|
154
154
|
const { transportId: r } = e;
|
|
155
|
-
return r != null ? { [
|
|
155
|
+
return r != null ? { [xt]: r, data: t } : t;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function pr(t, e) {
|
|
158
158
|
const { transportId: r, filter: n } = e, a = n?.();
|
|
159
159
|
if (r != null && a != null)
|
|
160
160
|
throw new Error("Cannot use both `transportId` and `filter` at the same time");
|
|
161
161
|
let s = t;
|
|
162
162
|
if (r) {
|
|
163
|
-
if (t[
|
|
163
|
+
if (t[xt] !== r)
|
|
164
164
|
return [!0];
|
|
165
165
|
s = t.data;
|
|
166
166
|
}
|
|
167
167
|
return a === !1 ? [!0] : [!1, s];
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function mr(t, e = {}) {
|
|
170
170
|
const { transportId: r, filter: n, remotePort: a } = e, s = t, i = a ?? t;
|
|
171
171
|
let o;
|
|
172
172
|
return {
|
|
173
173
|
send(d) {
|
|
174
|
-
i.postMessage(
|
|
174
|
+
i.postMessage(hr(d, { transportId: r }));
|
|
175
175
|
},
|
|
176
176
|
registerHandler(d) {
|
|
177
177
|
o = (l) => {
|
|
178
|
-
const h = l.data, [x, S] =
|
|
178
|
+
const h = l.data, [x, S] = pr(h, {
|
|
179
179
|
transportId: r,
|
|
180
180
|
filter: () => n?.(l)
|
|
181
181
|
});
|
|
@@ -187,31 +187,31 @@ var wn = or((Sn, Ye) => {
|
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
190
|
+
function yr(t) {
|
|
191
|
+
return mr(self, t);
|
|
192
192
|
}
|
|
193
|
-
const
|
|
194
|
-
var
|
|
193
|
+
const gr = "marimo-transport";
|
|
194
|
+
var _r = Object.defineProperty, k = (t, e) => _r(t, "name", { value: e, configurable: !0 }), St = ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (e, r) => (typeof require < "u" ? require : e)[r] }) : t)(function(t) {
|
|
195
195
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
196
196
|
throw new Error('Dynamic require of "' + t + '" is not supported');
|
|
197
197
|
});
|
|
198
|
-
function
|
|
198
|
+
function Tt(t) {
|
|
199
199
|
return !isNaN(parseFloat(t)) && isFinite(t);
|
|
200
200
|
}
|
|
201
|
-
k(
|
|
201
|
+
k(Tt, "_isNumber");
|
|
202
202
|
function W(t) {
|
|
203
203
|
return t.charAt(0).toUpperCase() + t.substring(1);
|
|
204
204
|
}
|
|
205
205
|
k(W, "_capitalize");
|
|
206
|
-
function
|
|
206
|
+
function $e(t) {
|
|
207
207
|
return function() {
|
|
208
208
|
return this[t];
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
k(
|
|
212
|
-
var
|
|
211
|
+
k($e, "_getter");
|
|
212
|
+
var re = ["isConstructor", "isEval", "isNative", "isToplevel"], ne = ["columnNumber", "lineNumber"], ae = ["fileName", "functionName", "source"], vr = ["args"], kr = ["evalOrigin"], xe = re.concat(ne, ae, vr, kr);
|
|
213
213
|
function I(t) {
|
|
214
|
-
if (t) for (var e = 0; e <
|
|
214
|
+
if (t) for (var e = 0; e < xe.length; e++) t[xe[e]] !== void 0 && this["set" + W(xe[e])](t[xe[e]]);
|
|
215
215
|
}
|
|
216
216
|
k(I, "StackFrame");
|
|
217
217
|
I.prototype = { getArgs: function() {
|
|
@@ -234,26 +234,26 @@ var wn = or((Sn, Ye) => {
|
|
|
234
234
|
if (s.indexOf("@") === 0) var i = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s, ""), o = i[1], d = i[2], l = i[3];
|
|
235
235
|
return new I({ functionName: n, args: a || void 0, fileName: o, lineNumber: d || void 0, columnNumber: l || void 0 });
|
|
236
236
|
}, "StackFrame$$fromString");
|
|
237
|
-
for (Q = 0; Q <
|
|
237
|
+
for (Q = 0; Q < re.length; Q++) I.prototype["get" + W(re[Q])] = $e(re[Q]), I.prototype["set" + W(re[Q])] = /* @__PURE__ */ function(t) {
|
|
238
238
|
return function(e) {
|
|
239
239
|
this[t] = !!e;
|
|
240
240
|
};
|
|
241
|
-
}(
|
|
241
|
+
}(re[Q]);
|
|
242
242
|
var Q;
|
|
243
|
-
for (X = 0; X <
|
|
243
|
+
for (X = 0; X < ne.length; X++) I.prototype["get" + W(ne[X])] = $e(ne[X]), I.prototype["set" + W(ne[X])] = /* @__PURE__ */ function(t) {
|
|
244
244
|
return function(e) {
|
|
245
|
-
if (!
|
|
245
|
+
if (!Tt(e)) throw new TypeError(t + " must be a Number");
|
|
246
246
|
this[t] = Number(e);
|
|
247
247
|
};
|
|
248
|
-
}(
|
|
248
|
+
}(ne[X]);
|
|
249
249
|
var X;
|
|
250
|
-
for (G = 0; G <
|
|
250
|
+
for (G = 0; G < ae.length; G++) I.prototype["get" + W(ae[G])] = $e(ae[G]), I.prototype["set" + W(ae[G])] = /* @__PURE__ */ function(t) {
|
|
251
251
|
return function(e) {
|
|
252
252
|
this[t] = String(e);
|
|
253
253
|
};
|
|
254
|
-
}(
|
|
255
|
-
var G,
|
|
256
|
-
function
|
|
254
|
+
}(ae[G]);
|
|
255
|
+
var G, Ze = I;
|
|
256
|
+
function Ot() {
|
|
257
257
|
var t = /^\s*at .*(\S+:\d+|\(native\))/m, e = /^(eval@)?(\[native code])?$/;
|
|
258
258
|
return { parse: k(function(r) {
|
|
259
259
|
if (r.stack && r.stack.match(t)) return this.parseV8OrIE(r);
|
|
@@ -273,7 +273,7 @@ var wn = or((Sn, Ye) => {
|
|
|
273
273
|
var s = a.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), i = s.match(/ (\(.+\)$)/);
|
|
274
274
|
s = i ? s.replace(i[0], "") : s;
|
|
275
275
|
var o = this.extractLocation(i ? i[1] : s), d = i && s || void 0, l = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
|
|
276
|
-
return new
|
|
276
|
+
return new Ze({ functionName: d, fileName: l, lineNumber: o[1], columnNumber: o[2], source: a });
|
|
277
277
|
}, this);
|
|
278
278
|
}, "ErrorStackParser$$parseV8OrIE"), parseFFOrSafari: k(function(r) {
|
|
279
279
|
var n = r.stack.split(`
|
|
@@ -281,58 +281,58 @@ var wn = or((Sn, Ye) => {
|
|
|
281
281
|
return !a.match(e);
|
|
282
282
|
}, this);
|
|
283
283
|
return n.map(function(a) {
|
|
284
|
-
if (a.indexOf(" > eval") > -1 && (a = a.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), a.indexOf("@") === -1 && a.indexOf(":") === -1) return new
|
|
284
|
+
if (a.indexOf(" > eval") > -1 && (a = a.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), a.indexOf("@") === -1 && a.indexOf(":") === -1) return new Ze({ functionName: a });
|
|
285
285
|
var s = /((.*".+"[^@]*)?[^@]*)(?:@)/, i = a.match(s), o = i && i[1] ? i[1] : void 0, d = this.extractLocation(a.replace(s, ""));
|
|
286
|
-
return new
|
|
286
|
+
return new Ze({ functionName: o, fileName: d[0], lineNumber: d[1], columnNumber: d[2], source: a });
|
|
287
287
|
}, this);
|
|
288
288
|
}, "ErrorStackParser$$parseFFOrSafari") };
|
|
289
289
|
}
|
|
290
|
-
k(
|
|
291
|
-
var
|
|
290
|
+
k(Ot, "ErrorStackParser");
|
|
291
|
+
var wr = new Ot(), br = wr, L = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && !process.browser, Et = L && typeof Qe < "u" && typeof Qe.exports < "u" && typeof St < "u" && typeof __dirname < "u", xr = L && !Et, Sr = typeof Deno < "u", Nt = !L && !Sr, Tr = Nt && typeof window == "object" && typeof document == "object" && typeof document.createElement == "function" && "sessionStorage" in window && typeof importScripts != "function", Or = Nt && typeof importScripts == "function" && typeof self == "object";
|
|
292
292
|
typeof navigator == "object" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") > -1;
|
|
293
|
-
var
|
|
294
|
-
async function
|
|
295
|
-
if (!L || (
|
|
296
|
-
let t =
|
|
293
|
+
var Rt, Le, Ct, at, Xe;
|
|
294
|
+
async function Ge() {
|
|
295
|
+
if (!L || (Rt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, at = await import("./__vite-browser-external-CPvbk0mb.js"), Xe = await import("./__vite-browser-external-CPvbk0mb.js"), Ct = (await import("./__vite-browser-external-CPvbk0mb.js")).default, Le = await import("./__vite-browser-external-CPvbk0mb.js"), Ke = Le.sep, typeof St < "u")) return;
|
|
296
|
+
let t = at, e = await import("./__vite-browser-external-CPvbk0mb.js"), r = await import("./__vite-browser-external-CPvbk0mb.js"), n = await import("./__vite-browser-external-CPvbk0mb.js"), a = { fs: t, crypto: e, ws: r, child_process: n };
|
|
297
297
|
globalThis.require = function(s) {
|
|
298
298
|
return a[s];
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
-
k(
|
|
302
|
-
function Ct(t, e) {
|
|
303
|
-
return Me.resolve(e || ".", t);
|
|
304
|
-
}
|
|
305
|
-
k(Ct, "node_resolvePath");
|
|
301
|
+
k(Ge, "initNodeModules");
|
|
306
302
|
function At(t, e) {
|
|
307
|
-
return
|
|
303
|
+
return Le.resolve(e || ".", t);
|
|
308
304
|
}
|
|
309
|
-
k(At, "
|
|
310
|
-
var Le;
|
|
311
|
-
L ? Le = Ct : Le = At;
|
|
312
|
-
var Ge;
|
|
313
|
-
L || (Ge = "/");
|
|
305
|
+
k(At, "node_resolvePath");
|
|
314
306
|
function It(t, e) {
|
|
315
|
-
return
|
|
307
|
+
return e === void 0 && (e = location), new URL(t, e).toString();
|
|
316
308
|
}
|
|
317
|
-
k(It, "
|
|
309
|
+
k(It, "browser_resolvePath");
|
|
310
|
+
var De;
|
|
311
|
+
L ? De = At : De = It;
|
|
312
|
+
var Ke;
|
|
313
|
+
L || (Ke = "/");
|
|
318
314
|
function Pt(t, e) {
|
|
315
|
+
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: Xe.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
316
|
+
}
|
|
317
|
+
k(Pt, "node_getBinaryResponse");
|
|
318
|
+
function jt(t, e) {
|
|
319
319
|
let r = new URL(t, location);
|
|
320
320
|
return { response: fetch(r, e ? { integrity: e } : {}) };
|
|
321
321
|
}
|
|
322
|
-
k(
|
|
323
|
-
var
|
|
324
|
-
L ?
|
|
325
|
-
async function
|
|
326
|
-
let { response: r, binary: n } =
|
|
322
|
+
k(jt, "browser_getBinaryResponse");
|
|
323
|
+
var Oe;
|
|
324
|
+
L ? Oe = Pt : Oe = jt;
|
|
325
|
+
async function $t(t, e) {
|
|
326
|
+
let { response: r, binary: n } = Oe(t, e);
|
|
327
327
|
if (n) return n;
|
|
328
328
|
let a = await r;
|
|
329
329
|
if (!a.ok) throw new Error(`Failed to load '${t}': request failed.`);
|
|
330
330
|
return new Uint8Array(await a.arrayBuffer());
|
|
331
331
|
}
|
|
332
|
-
k(
|
|
333
|
-
var
|
|
334
|
-
if (
|
|
335
|
-
else if (
|
|
332
|
+
k($t, "loadBinaryFile");
|
|
333
|
+
var Se;
|
|
334
|
+
if (Tr) Se = k(async (t) => await import(t), "loadScript");
|
|
335
|
+
else if (Or) Se = k(async (t) => {
|
|
336
336
|
try {
|
|
337
337
|
globalThis.importScripts(t);
|
|
338
338
|
} catch (e) {
|
|
@@ -340,39 +340,39 @@ var wn = or((Sn, Ye) => {
|
|
|
340
340
|
else throw e;
|
|
341
341
|
}
|
|
342
342
|
}, "loadScript");
|
|
343
|
-
else if (L)
|
|
343
|
+
else if (L) Se = Ft;
|
|
344
344
|
else throw new Error("Cannot determine runtime environment");
|
|
345
|
-
async function $t(t) {
|
|
346
|
-
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? Rt.runInThisContext(await (await fetch(t)).text()) : await import(Nt.pathToFileURL(t).href);
|
|
347
|
-
}
|
|
348
|
-
k($t, "nodeLoadScript");
|
|
349
345
|
async function Ft(t) {
|
|
346
|
+
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? Ct.runInThisContext(await (await fetch(t)).text()) : await import(Rt.pathToFileURL(t).href);
|
|
347
|
+
}
|
|
348
|
+
k(Ft, "nodeLoadScript");
|
|
349
|
+
async function Zt(t) {
|
|
350
350
|
if (L) {
|
|
351
|
-
await
|
|
352
|
-
let e = await
|
|
351
|
+
await Ge();
|
|
352
|
+
let e = await Xe.readFile(t, { encoding: "utf8" });
|
|
353
353
|
return JSON.parse(e);
|
|
354
354
|
} else return await (await fetch(t)).json();
|
|
355
355
|
}
|
|
356
|
-
k(
|
|
357
|
-
async function
|
|
358
|
-
if (
|
|
356
|
+
k(Zt, "loadLockFile");
|
|
357
|
+
async function Mt() {
|
|
358
|
+
if (Et) return __dirname;
|
|
359
359
|
let t;
|
|
360
360
|
try {
|
|
361
361
|
throw new Error();
|
|
362
362
|
} catch (n) {
|
|
363
363
|
t = n;
|
|
364
364
|
}
|
|
365
|
-
let e =
|
|
366
|
-
if (L && !e.startsWith("file://") && (e = `file://${e}`),
|
|
365
|
+
let e = br.parse(t)[0].fileName;
|
|
366
|
+
if (L && !e.startsWith("file://") && (e = `file://${e}`), xr) {
|
|
367
367
|
let n = await import("./__vite-browser-external-CPvbk0mb.js");
|
|
368
368
|
return (await import("./__vite-browser-external-CPvbk0mb.js")).fileURLToPath(n.dirname(e));
|
|
369
369
|
}
|
|
370
|
-
let r = e.lastIndexOf(
|
|
370
|
+
let r = e.lastIndexOf(Ke);
|
|
371
371
|
if (r === -1) throw new Error("Could not extract indexURL path from pyodide module location");
|
|
372
372
|
return e.slice(0, r);
|
|
373
373
|
}
|
|
374
|
-
k(
|
|
375
|
-
function
|
|
374
|
+
k(Mt, "calculateDirname");
|
|
375
|
+
function Lt(t) {
|
|
376
376
|
let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH, a = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(s) {
|
|
377
377
|
if (!s.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
|
|
378
378
|
return r.mount.apply(null, arguments);
|
|
@@ -400,7 +400,7 @@ var wn = or((Sn, Ye) => {
|
|
|
400
400
|
}
|
|
401
401
|
return { type: "local", entries: i };
|
|
402
402
|
}, getRemoteSet: async (s) => {
|
|
403
|
-
let i = /* @__PURE__ */ Object.create(null), o = await
|
|
403
|
+
let i = /* @__PURE__ */ Object.create(null), o = await Er(s.opts.fileSystemHandle);
|
|
404
404
|
for (let [d, l] of o) d !== "." && (i[n.join2(s.mountpoint, d)] = { timestamp: l.kind === "file" ? new Date((await l.getFile()).lastModified) : /* @__PURE__ */ new Date(), mode: l.kind === "file" ? a.FILE_MODE : a.DIR_MODE });
|
|
405
405
|
return { type: "remote", entries: i, handles: o };
|
|
406
406
|
}, loadLocalEntry: (s) => {
|
|
@@ -447,8 +447,8 @@ var wn = or((Sn, Ye) => {
|
|
|
447
447
|
for (let S of l) {
|
|
448
448
|
let j = n.normalize(S.replace(s.mountpoint, "/")).substring(1);
|
|
449
449
|
if (o.type === "local") {
|
|
450
|
-
let D = x.get(j),
|
|
451
|
-
a.storeLocalEntry(S,
|
|
450
|
+
let D = x.get(j), we = await a.loadRemoteEntry(D);
|
|
451
|
+
a.storeLocalEntry(S, we);
|
|
452
452
|
} else {
|
|
453
453
|
let D = a.loadLocalEntry(S);
|
|
454
454
|
await a.storeRemoteEntry(x, j, D);
|
|
@@ -462,8 +462,8 @@ var wn = or((Sn, Ye) => {
|
|
|
462
462
|
} };
|
|
463
463
|
t.FS.filesystems.NATIVEFS_ASYNC = a;
|
|
464
464
|
}
|
|
465
|
-
k(
|
|
466
|
-
var
|
|
465
|
+
k(Lt, "initializeNativeFS");
|
|
466
|
+
var Er = k(async (t) => {
|
|
467
467
|
let e = [];
|
|
468
468
|
async function r(a) {
|
|
469
469
|
for await (let s of a.values()) e.push(s), s.kind === "directory" && await r(s);
|
|
@@ -477,14 +477,14 @@ var wn = or((Sn, Ye) => {
|
|
|
477
477
|
}
|
|
478
478
|
return n;
|
|
479
479
|
}, "getFsHandles");
|
|
480
|
-
function
|
|
481
|
-
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun:
|
|
480
|
+
function Dt(t) {
|
|
481
|
+
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun: Ht(t), quit(r, n) {
|
|
482
482
|
throw e.exited = { status: r, toThrow: n }, n;
|
|
483
|
-
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm:
|
|
483
|
+
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm: Bt(t.indexURL) };
|
|
484
484
|
return e;
|
|
485
485
|
}
|
|
486
|
-
k(
|
|
487
|
-
function
|
|
486
|
+
k(Dt, "createSettings");
|
|
487
|
+
function qt(t) {
|
|
488
488
|
return function(e) {
|
|
489
489
|
let r = "/";
|
|
490
490
|
try {
|
|
@@ -495,14 +495,14 @@ var wn = or((Sn, Ye) => {
|
|
|
495
495
|
e.FS.chdir(t);
|
|
496
496
|
};
|
|
497
497
|
}
|
|
498
|
-
k(
|
|
499
|
-
function
|
|
498
|
+
k(qt, "createHomeDirectory");
|
|
499
|
+
function Vt(t) {
|
|
500
500
|
return function(e) {
|
|
501
501
|
Object.assign(e.ENV, t);
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
|
-
k(
|
|
505
|
-
function
|
|
504
|
+
k(Vt, "setEnvironment");
|
|
505
|
+
function zt(t) {
|
|
506
506
|
return t ? [async (e) => {
|
|
507
507
|
e.addRunDependency("fsInitHook");
|
|
508
508
|
try {
|
|
@@ -512,9 +512,9 @@ var wn = or((Sn, Ye) => {
|
|
|
512
512
|
}
|
|
513
513
|
}] : [];
|
|
514
514
|
}
|
|
515
|
-
k(
|
|
516
|
-
function
|
|
517
|
-
let e =
|
|
515
|
+
k(zt, "callFsInitHook");
|
|
516
|
+
function Ut(t) {
|
|
517
|
+
let e = $t(t);
|
|
518
518
|
return async (r) => {
|
|
519
519
|
let n = r._py_version_major(), a = r._py_version_minor();
|
|
520
520
|
r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${a}/site-packages`, r.FS.mkdirTree(r.API.sitePackages), r.addRunDependency("install-stdlib");
|
|
@@ -528,15 +528,15 @@ var wn = or((Sn, Ye) => {
|
|
|
528
528
|
}
|
|
529
529
|
};
|
|
530
530
|
}
|
|
531
|
-
k(
|
|
532
|
-
function
|
|
531
|
+
k(Ut, "installStdlib");
|
|
532
|
+
function Ht(t) {
|
|
533
533
|
let e;
|
|
534
|
-
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...
|
|
534
|
+
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...zt(t.fsInit), Ut(e), qt(t.env.HOME), Vt(t.env), Lt];
|
|
535
535
|
}
|
|
536
|
-
k(
|
|
537
|
-
function
|
|
536
|
+
k(Ht, "getFileSystemInitializationFuncs");
|
|
537
|
+
function Bt(t) {
|
|
538
538
|
if (typeof WasmOffsetConverter < "u") return;
|
|
539
|
-
let { binary: e, response: r } =
|
|
539
|
+
let { binary: e, response: r } = Oe(t + "pyodide.asm.wasm");
|
|
540
540
|
return function(n, a) {
|
|
541
541
|
return async function() {
|
|
542
542
|
try {
|
|
@@ -550,19 +550,19 @@ var wn = or((Sn, Ye) => {
|
|
|
550
550
|
}(), {};
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
|
-
k(
|
|
554
|
-
var
|
|
555
|
-
async function
|
|
553
|
+
k(Bt, "getInstantiateWasmFunc");
|
|
554
|
+
var qe = "0.27.7";
|
|
555
|
+
async function Ve(t = {}) {
|
|
556
556
|
var e, r;
|
|
557
|
-
await
|
|
558
|
-
let n = t.indexURL || await
|
|
559
|
-
n =
|
|
557
|
+
await Ge();
|
|
558
|
+
let n = t.indexURL || await Mt();
|
|
559
|
+
n = De(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
|
|
560
560
|
let a = { fullStdLib: !1, jsglobals: globalThis, stdin: globalThis.prompt ? globalThis.prompt : void 0, lockFileURL: n + "pyodide-lock.json", args: [], env: {}, packageCacheDir: n, packages: [], enableRunUntilComplete: !0, checkAPIVersion: !0, BUILD_ID: "e94377f5ce7dcf67e0417b69a0016733c2cfb6b4622ee8c490a6f17eb58e863b" }, s = Object.assign(a, t);
|
|
561
561
|
(e = s.env).HOME ?? (e.HOME = "/home/pyodide"), (r = s.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
|
|
562
|
-
let i =
|
|
563
|
-
if (o.lockFilePromise =
|
|
562
|
+
let i = Dt(s), o = i.API;
|
|
563
|
+
if (o.lockFilePromise = Zt(s.lockFileURL), typeof _createPyodideModule != "function") {
|
|
564
564
|
let S = `${s.indexURL}pyodide.asm.js`;
|
|
565
|
-
await
|
|
565
|
+
await Se(S);
|
|
566
566
|
}
|
|
567
567
|
let d;
|
|
568
568
|
if (t._loadSnapshot) {
|
|
@@ -571,7 +571,7 @@ var wn = or((Sn, Ye) => {
|
|
|
571
571
|
}
|
|
572
572
|
let l = await _createPyodideModule(i);
|
|
573
573
|
if (i.exited) throw i.exited.toThrow;
|
|
574
|
-
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !==
|
|
574
|
+
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== qe && s.checkAPIVersion) throw new Error(`Pyodide version does not match: '${qe}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
|
|
575
575
|
l.locateFile = (S) => {
|
|
576
576
|
throw new Error("Didn't expect to load any more file_packager files!");
|
|
577
577
|
};
|
|
@@ -580,12 +580,12 @@ var wn = or((Sn, Ye) => {
|
|
|
580
580
|
let x = o.finalizeBootstrap(h, t._snapshotDeserializer);
|
|
581
581
|
return o.sys.path.insert(0, ""), x.version.includes("dev") || o.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${x.version}/full/`), o._pyodide.set_excepthook(), await o.packageIndexReady, o.initializeStreams(s.stdin, s.stdout, s.stderr), x;
|
|
582
582
|
}
|
|
583
|
-
k(
|
|
584
|
-
const
|
|
585
|
-
function
|
|
586
|
-
return t.includes("dev") &&
|
|
583
|
+
k(Ve, "loadPyodide");
|
|
584
|
+
const Nr = !1;
|
|
585
|
+
function Rr(t) {
|
|
586
|
+
return t.includes("dev") && Nr ? "dev" : `v${qe}`;
|
|
587
587
|
}
|
|
588
|
-
class
|
|
588
|
+
class Cr {
|
|
589
589
|
constructor(e) {
|
|
590
590
|
this.onMessage = e, this.buffer = [];
|
|
591
591
|
}
|
|
@@ -601,10 +601,10 @@ var wn = or((Sn, Ye) => {
|
|
|
601
601
|
this.started = !0, this.buffer.forEach((e) => this.onMessage(e)), this.buffer = [];
|
|
602
602
|
};
|
|
603
603
|
}
|
|
604
|
-
const
|
|
604
|
+
const he = {
|
|
605
605
|
NOOP: () => {
|
|
606
606
|
}
|
|
607
|
-
},
|
|
607
|
+
}, Wt = (t, e) => {
|
|
608
608
|
const r = `[${t}]`;
|
|
609
609
|
return {
|
|
610
610
|
debug: (...n) => e.debug(r, ...n),
|
|
@@ -612,10 +612,10 @@ var wn = or((Sn, Ye) => {
|
|
|
612
612
|
warn: (...n) => e.warn(r, ...n),
|
|
613
613
|
error: (...n) => e.error(r, ...n),
|
|
614
614
|
trace: (...n) => e.trace(r, ...n),
|
|
615
|
-
get: (n) =>
|
|
616
|
-
disabled: (n = !0) => n ?
|
|
615
|
+
get: (n) => Wt(`${t}.${n}`, e),
|
|
616
|
+
disabled: (n = !0) => n ? Ne : e
|
|
617
617
|
};
|
|
618
|
-
},
|
|
618
|
+
}, Ee = {
|
|
619
619
|
debug: (...t) => {
|
|
620
620
|
console.debug(...t);
|
|
621
621
|
},
|
|
@@ -631,22 +631,22 @@ var wn = or((Sn, Ye) => {
|
|
|
631
631
|
trace: (...t) => {
|
|
632
632
|
console.trace(...t);
|
|
633
633
|
},
|
|
634
|
-
get: (t) =>
|
|
635
|
-
disabled: (t = !0) => t ?
|
|
636
|
-
},
|
|
637
|
-
debug: () =>
|
|
638
|
-
log: () =>
|
|
639
|
-
warn: () =>
|
|
640
|
-
error: () =>
|
|
641
|
-
trace: () =>
|
|
642
|
-
get: () =>
|
|
643
|
-
disabled: () =>
|
|
634
|
+
get: (t) => Wt(t, Ee),
|
|
635
|
+
disabled: (t = !0) => t ? Ne : Ee
|
|
636
|
+
}, Ne = {
|
|
637
|
+
debug: () => he.NOOP,
|
|
638
|
+
log: () => he.NOOP,
|
|
639
|
+
warn: () => he.NOOP,
|
|
640
|
+
error: () => he.NOOP,
|
|
641
|
+
trace: () => he.NOOP,
|
|
642
|
+
get: () => Ne,
|
|
643
|
+
disabled: () => Ne
|
|
644
644
|
};
|
|
645
|
-
function
|
|
646
|
-
return typeof window < "u" && window.Logger ||
|
|
645
|
+
function Ar() {
|
|
646
|
+
return typeof window < "u" && window.Logger || Ee;
|
|
647
647
|
}
|
|
648
|
-
const H =
|
|
649
|
-
class
|
|
648
|
+
const H = Ar();
|
|
649
|
+
class Ir {
|
|
650
650
|
promise;
|
|
651
651
|
resolve;
|
|
652
652
|
reject;
|
|
@@ -698,14 +698,14 @@ var wn = or((Sn, Ye) => {
|
|
|
698
698
|
}
|
|
699
699
|
t.joinValues = n, t.jsonStringifyReplacer = (a, s) => typeof s == "bigint" ? s.toString() : s;
|
|
700
700
|
})(w || (w = {}));
|
|
701
|
-
var
|
|
701
|
+
var st;
|
|
702
702
|
(function(t) {
|
|
703
703
|
t.mergeShapes = (e, r) => ({
|
|
704
704
|
...e,
|
|
705
705
|
...r
|
|
706
706
|
// second overwrites first
|
|
707
707
|
});
|
|
708
|
-
})(
|
|
708
|
+
})(st || (st = {}));
|
|
709
709
|
const f = w.arrayToEnum([
|
|
710
710
|
"string",
|
|
711
711
|
"nan",
|
|
@@ -830,7 +830,7 @@ var wn = or((Sn, Ye) => {
|
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
832
|
V.create = (t) => new V(t);
|
|
833
|
-
const
|
|
833
|
+
const ze = (t, e) => {
|
|
834
834
|
let r;
|
|
835
835
|
switch (t.code) {
|
|
836
836
|
case c.invalid_type:
|
|
@@ -886,11 +886,11 @@ var wn = or((Sn, Ye) => {
|
|
|
886
886
|
}
|
|
887
887
|
return { message: r };
|
|
888
888
|
};
|
|
889
|
-
let
|
|
890
|
-
function
|
|
891
|
-
return
|
|
889
|
+
let Pr = ze;
|
|
890
|
+
function jr() {
|
|
891
|
+
return Pr;
|
|
892
892
|
}
|
|
893
|
-
const
|
|
893
|
+
const $r = (t) => {
|
|
894
894
|
const { data: e, path: r, errorMaps: n, issueData: a } = t, s = [...r, ...a.path || []], i = {
|
|
895
895
|
...a,
|
|
896
896
|
path: s
|
|
@@ -912,7 +912,7 @@ var wn = or((Sn, Ye) => {
|
|
|
912
912
|
};
|
|
913
913
|
};
|
|
914
914
|
function u(t, e) {
|
|
915
|
-
const r =
|
|
915
|
+
const r = jr(), n = $r({
|
|
916
916
|
issueData: e,
|
|
917
917
|
data: t.data,
|
|
918
918
|
path: t.path,
|
|
@@ -923,7 +923,7 @@ var wn = or((Sn, Ye) => {
|
|
|
923
923
|
// then schema-bound map if available
|
|
924
924
|
r,
|
|
925
925
|
// then global override map
|
|
926
|
-
r ===
|
|
926
|
+
r === ze ? void 0 : ze
|
|
927
927
|
// then global default map
|
|
928
928
|
].filter((a) => !!a)
|
|
929
929
|
});
|
|
@@ -972,7 +972,7 @@ var wn = or((Sn, Ye) => {
|
|
|
972
972
|
}
|
|
973
973
|
const g = Object.freeze({
|
|
974
974
|
status: "aborted"
|
|
975
|
-
}),
|
|
975
|
+
}), ge = (t) => ({ status: "dirty", value: t }), P = (t) => ({ status: "valid", value: t }), it = (t) => t.status === "aborted", ot = (t) => t.status === "dirty", oe = (t) => t.status === "valid", Re = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
976
976
|
var p;
|
|
977
977
|
(function(t) {
|
|
978
978
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
@@ -985,8 +985,8 @@ var wn = or((Sn, Ye) => {
|
|
|
985
985
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
|
-
const
|
|
989
|
-
if (
|
|
988
|
+
const dt = (t, e) => {
|
|
989
|
+
if (oe(e))
|
|
990
990
|
return { success: !0, data: e.value };
|
|
991
991
|
if (!t.common.issues.length)
|
|
992
992
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -1043,7 +1043,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
_parseSync(e) {
|
|
1045
1045
|
const r = this._parse(e);
|
|
1046
|
-
if (
|
|
1046
|
+
if (Re(r))
|
|
1047
1047
|
throw new Error("Synchronous parse encountered promise.");
|
|
1048
1048
|
return r;
|
|
1049
1049
|
}
|
|
@@ -1070,7 +1070,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1070
1070
|
data: e,
|
|
1071
1071
|
parsedType: U(e)
|
|
1072
1072
|
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
|
1073
|
-
return
|
|
1073
|
+
return dt(n, a);
|
|
1074
1074
|
}
|
|
1075
1075
|
"~validate"(e) {
|
|
1076
1076
|
const r = {
|
|
@@ -1087,7 +1087,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1087
1087
|
if (!this["~standard"].async)
|
|
1088
1088
|
try {
|
|
1089
1089
|
const n = this._parseSync({ data: e, path: [], parent: r });
|
|
1090
|
-
return
|
|
1090
|
+
return oe(n) ? {
|
|
1091
1091
|
value: n.value
|
|
1092
1092
|
} : {
|
|
1093
1093
|
issues: r.common.issues
|
|
@@ -1098,7 +1098,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1098
1098
|
async: !0
|
|
1099
1099
|
};
|
|
1100
1100
|
}
|
|
1101
|
-
return this._parseAsync({ data: e, path: [], parent: r }).then((n) =>
|
|
1101
|
+
return this._parseAsync({ data: e, path: [], parent: r }).then((n) => oe(n) ? {
|
|
1102
1102
|
value: n.value
|
|
1103
1103
|
} : {
|
|
1104
1104
|
issues: r.common.issues
|
|
@@ -1122,8 +1122,8 @@ var wn = or((Sn, Ye) => {
|
|
|
1122
1122
|
parent: null,
|
|
1123
1123
|
data: e,
|
|
1124
1124
|
parsedType: U(e)
|
|
1125
|
-
}, a = this._parse({ data: e, path: n.path, parent: n }), s = await (
|
|
1126
|
-
return
|
|
1125
|
+
}, a = this._parse({ data: e, path: n.path, parent: n }), s = await (Re(a) ? a : Promise.resolve(a));
|
|
1126
|
+
return dt(n, s);
|
|
1127
1127
|
}
|
|
1128
1128
|
refine(e, r) {
|
|
1129
1129
|
const n = (a) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(a) : r;
|
|
@@ -1139,7 +1139,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1139
1139
|
return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof r == "function" ? r(n, a) : r), !1));
|
|
1140
1140
|
}
|
|
1141
1141
|
_refinement(e) {
|
|
1142
|
-
return new
|
|
1142
|
+
return new le({
|
|
1143
1143
|
schema: this,
|
|
1144
1144
|
typeName: m.ZodEffects,
|
|
1145
1145
|
effect: { type: "refinement", refinement: e }
|
|
@@ -1159,7 +1159,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1159
1159
|
return B.create(this, this._def);
|
|
1160
1160
|
}
|
|
1161
1161
|
nullable() {
|
|
1162
|
-
return
|
|
1162
|
+
return ue.create(this, this._def);
|
|
1163
1163
|
}
|
|
1164
1164
|
nullish() {
|
|
1165
1165
|
return this.nullable().optional();
|
|
@@ -1168,16 +1168,16 @@ var wn = or((Sn, Ye) => {
|
|
|
1168
1168
|
return Z.create(this);
|
|
1169
1169
|
}
|
|
1170
1170
|
promise() {
|
|
1171
|
-
return
|
|
1171
|
+
return je.create(this, this._def);
|
|
1172
1172
|
}
|
|
1173
1173
|
or(e) {
|
|
1174
|
-
return
|
|
1174
|
+
return Ae.create([this, e], this._def);
|
|
1175
1175
|
}
|
|
1176
1176
|
and(e) {
|
|
1177
|
-
return
|
|
1177
|
+
return Ie.create(this, e, this._def);
|
|
1178
1178
|
}
|
|
1179
1179
|
transform(e) {
|
|
1180
|
-
return new
|
|
1180
|
+
return new le({
|
|
1181
1181
|
..._(this._def),
|
|
1182
1182
|
schema: this,
|
|
1183
1183
|
typeName: m.ZodEffects,
|
|
@@ -1186,7 +1186,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
default(e) {
|
|
1188
1188
|
const r = typeof e == "function" ? e : () => e;
|
|
1189
|
-
return new
|
|
1189
|
+
return new Be({
|
|
1190
1190
|
..._(this._def),
|
|
1191
1191
|
innerType: this,
|
|
1192
1192
|
defaultValue: r,
|
|
@@ -1194,7 +1194,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
1196
1196
|
brand() {
|
|
1197
|
-
return new
|
|
1197
|
+
return new an({
|
|
1198
1198
|
typeName: m.ZodBranded,
|
|
1199
1199
|
type: this,
|
|
1200
1200
|
..._(this._def)
|
|
@@ -1202,7 +1202,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
catch(e) {
|
|
1204
1204
|
const r = typeof e == "function" ? e : () => e;
|
|
1205
|
-
return new
|
|
1205
|
+
return new We({
|
|
1206
1206
|
..._(this._def),
|
|
1207
1207
|
innerType: this,
|
|
1208
1208
|
catchValue: r,
|
|
@@ -1217,10 +1217,10 @@ var wn = or((Sn, Ye) => {
|
|
|
1217
1217
|
});
|
|
1218
1218
|
}
|
|
1219
1219
|
pipe(e) {
|
|
1220
|
-
return
|
|
1220
|
+
return et.create(this, e);
|
|
1221
1221
|
}
|
|
1222
1222
|
readonly() {
|
|
1223
|
-
return
|
|
1223
|
+
return Je.create(this);
|
|
1224
1224
|
}
|
|
1225
1225
|
isOptional() {
|
|
1226
1226
|
return this.safeParse(void 0).success;
|
|
@@ -1229,28 +1229,28 @@ var wn = or((Sn, Ye) => {
|
|
|
1229
1229
|
return this.safeParse(null).success;
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
|
-
const
|
|
1233
|
-
let
|
|
1234
|
-
const
|
|
1235
|
-
function
|
|
1232
|
+
const Fr = /^c[^\s-]{8,}$/i, Zr = /^[0-9a-z]+$/, Mr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Lr = /^[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, Dr = /^[a-z0-9_-]{21}$/i, qr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Vr = /^[-+]?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)?)??$/, zr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ur = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1233
|
+
let Me;
|
|
1234
|
+
const Hr = /^(?:(?: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])$/, Br = /^(?:(?: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])$/, Wr = /^(([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]))$/, Jr = /^(([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])$/, Yr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Qr = /^([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])))", Xr = new RegExp(`^${Jt}$`);
|
|
1235
|
+
function Yt(t) {
|
|
1236
1236
|
let e = "[0-5]\\d";
|
|
1237
1237
|
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
1238
1238
|
const r = t.precision ? "+" : "?";
|
|
1239
1239
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`;
|
|
1240
1240
|
}
|
|
1241
|
-
function Xr(t) {
|
|
1242
|
-
return new RegExp(`^${Jt(t)}$`);
|
|
1243
|
-
}
|
|
1244
1241
|
function Gr(t) {
|
|
1245
|
-
|
|
1242
|
+
return new RegExp(`^${Yt(t)}$`);
|
|
1243
|
+
}
|
|
1244
|
+
function Kr(t) {
|
|
1245
|
+
let e = `${Jt}T${Yt(t)}`;
|
|
1246
1246
|
const r = [];
|
|
1247
1247
|
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
|
1248
1248
|
}
|
|
1249
|
-
function Kr(t, e) {
|
|
1250
|
-
return !!((e === "v4" || !e) && Ur.test(t) || (e === "v6" || !e) && Br.test(t));
|
|
1251
|
-
}
|
|
1252
1249
|
function en(t, e) {
|
|
1253
|
-
|
|
1250
|
+
return !!((e === "v4" || !e) && Hr.test(t) || (e === "v6" || !e) && Wr.test(t));
|
|
1251
|
+
}
|
|
1252
|
+
function tn(t, e) {
|
|
1253
|
+
if (!qr.test(t))
|
|
1254
1254
|
return !1;
|
|
1255
1255
|
try {
|
|
1256
1256
|
const [r] = t.split(".");
|
|
@@ -1262,8 +1262,8 @@ var wn = or((Sn, Ye) => {
|
|
|
1262
1262
|
return !1;
|
|
1263
1263
|
}
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1266
|
-
return !!((e === "v4" || !e) &&
|
|
1265
|
+
function rn(t, e) {
|
|
1266
|
+
return !!((e === "v4" || !e) && Br.test(t) || (e === "v6" || !e) && Jr.test(t));
|
|
1267
1267
|
}
|
|
1268
1268
|
class q extends v {
|
|
1269
1269
|
_parse(e) {
|
|
@@ -1314,43 +1314,43 @@ var wn = or((Sn, Ye) => {
|
|
|
1314
1314
|
message: s.message
|
|
1315
1315
|
}), n.dirty());
|
|
1316
1316
|
} else if (s.kind === "email")
|
|
1317
|
-
|
|
1317
|
+
zr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1318
1318
|
validation: "email",
|
|
1319
1319
|
code: c.invalid_string,
|
|
1320
1320
|
message: s.message
|
|
1321
1321
|
}), n.dirty());
|
|
1322
1322
|
else if (s.kind === "emoji")
|
|
1323
|
-
|
|
1323
|
+
Me || (Me = new RegExp(Ur, "u")), Me.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1324
1324
|
validation: "emoji",
|
|
1325
1325
|
code: c.invalid_string,
|
|
1326
1326
|
message: s.message
|
|
1327
1327
|
}), n.dirty());
|
|
1328
1328
|
else if (s.kind === "uuid")
|
|
1329
|
-
|
|
1329
|
+
Lr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1330
1330
|
validation: "uuid",
|
|
1331
1331
|
code: c.invalid_string,
|
|
1332
1332
|
message: s.message
|
|
1333
1333
|
}), n.dirty());
|
|
1334
1334
|
else if (s.kind === "nanoid")
|
|
1335
|
-
|
|
1335
|
+
Dr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1336
1336
|
validation: "nanoid",
|
|
1337
1337
|
code: c.invalid_string,
|
|
1338
1338
|
message: s.message
|
|
1339
1339
|
}), n.dirty());
|
|
1340
1340
|
else if (s.kind === "cuid")
|
|
1341
|
-
|
|
1341
|
+
Fr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1342
1342
|
validation: "cuid",
|
|
1343
1343
|
code: c.invalid_string,
|
|
1344
1344
|
message: s.message
|
|
1345
1345
|
}), n.dirty());
|
|
1346
1346
|
else if (s.kind === "cuid2")
|
|
1347
|
-
|
|
1347
|
+
Zr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1348
1348
|
validation: "cuid2",
|
|
1349
1349
|
code: c.invalid_string,
|
|
1350
1350
|
message: s.message
|
|
1351
1351
|
}), n.dirty());
|
|
1352
1352
|
else if (s.kind === "ulid")
|
|
1353
|
-
|
|
1353
|
+
Mr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1354
1354
|
validation: "ulid",
|
|
1355
1355
|
code: c.invalid_string,
|
|
1356
1356
|
message: s.message
|
|
@@ -1381,39 +1381,39 @@ var wn = or((Sn, Ye) => {
|
|
|
1381
1381
|
code: c.invalid_string,
|
|
1382
1382
|
validation: { endsWith: s.value },
|
|
1383
1383
|
message: s.message
|
|
1384
|
-
}), n.dirty()) : s.kind === "datetime" ?
|
|
1384
|
+
}), n.dirty()) : s.kind === "datetime" ? Kr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1385
1385
|
code: c.invalid_string,
|
|
1386
1386
|
validation: "datetime",
|
|
1387
1387
|
message: s.message
|
|
1388
|
-
}), n.dirty()) : s.kind === "date" ?
|
|
1388
|
+
}), n.dirty()) : s.kind === "date" ? Xr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1389
1389
|
code: c.invalid_string,
|
|
1390
1390
|
validation: "date",
|
|
1391
1391
|
message: s.message
|
|
1392
|
-
}), n.dirty()) : s.kind === "time" ?
|
|
1392
|
+
}), n.dirty()) : s.kind === "time" ? Gr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1393
1393
|
code: c.invalid_string,
|
|
1394
1394
|
validation: "time",
|
|
1395
1395
|
message: s.message
|
|
1396
|
-
}), n.dirty()) : s.kind === "duration" ?
|
|
1396
|
+
}), n.dirty()) : s.kind === "duration" ? Vr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1397
1397
|
validation: "duration",
|
|
1398
1398
|
code: c.invalid_string,
|
|
1399
1399
|
message: s.message
|
|
1400
|
-
}), n.dirty()) : s.kind === "ip" ?
|
|
1400
|
+
}), n.dirty()) : s.kind === "ip" ? en(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1401
1401
|
validation: "ip",
|
|
1402
1402
|
code: c.invalid_string,
|
|
1403
1403
|
message: s.message
|
|
1404
|
-
}), n.dirty()) : s.kind === "jwt" ?
|
|
1404
|
+
}), n.dirty()) : s.kind === "jwt" ? tn(e.data, s.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1405
1405
|
validation: "jwt",
|
|
1406
1406
|
code: c.invalid_string,
|
|
1407
1407
|
message: s.message
|
|
1408
|
-
}), n.dirty()) : s.kind === "cidr" ?
|
|
1408
|
+
}), n.dirty()) : s.kind === "cidr" ? rn(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1409
1409
|
validation: "cidr",
|
|
1410
1410
|
code: c.invalid_string,
|
|
1411
1411
|
message: s.message
|
|
1412
|
-
}), n.dirty()) : s.kind === "base64" ?
|
|
1412
|
+
}), n.dirty()) : s.kind === "base64" ? Yr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1413
1413
|
validation: "base64",
|
|
1414
1414
|
code: c.invalid_string,
|
|
1415
1415
|
message: s.message
|
|
1416
|
-
}), n.dirty()) : s.kind === "base64url" ?
|
|
1416
|
+
}), n.dirty()) : s.kind === "base64url" ? Qr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1417
1417
|
validation: "base64url",
|
|
1418
1418
|
code: c.invalid_string,
|
|
1419
1419
|
message: s.message
|
|
@@ -1648,11 +1648,11 @@ var wn = or((Sn, Ye) => {
|
|
|
1648
1648
|
coerce: t?.coerce ?? !1,
|
|
1649
1649
|
..._(t)
|
|
1650
1650
|
});
|
|
1651
|
-
function
|
|
1651
|
+
function nn(t, e) {
|
|
1652
1652
|
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = r > n ? r : n, s = Number.parseInt(t.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
|
|
1653
1653
|
return s % i / 10 ** a;
|
|
1654
1654
|
}
|
|
1655
|
-
class
|
|
1655
|
+
class de extends v {
|
|
1656
1656
|
constructor() {
|
|
1657
1657
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1658
1658
|
}
|
|
@@ -1687,7 +1687,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1687
1687
|
inclusive: s.inclusive,
|
|
1688
1688
|
exact: !1,
|
|
1689
1689
|
message: s.message
|
|
1690
|
-
}), a.dirty()) : s.kind === "multipleOf" ?
|
|
1690
|
+
}), a.dirty()) : s.kind === "multipleOf" ? nn(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1691
1691
|
code: c.not_multiple_of,
|
|
1692
1692
|
multipleOf: s.value,
|
|
1693
1693
|
message: s.message
|
|
@@ -1710,7 +1710,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1710
1710
|
return this.setLimit("max", e, !1, p.toString(r));
|
|
1711
1711
|
}
|
|
1712
1712
|
setLimit(e, r, n, a) {
|
|
1713
|
-
return new
|
|
1713
|
+
return new de({
|
|
1714
1714
|
...this._def,
|
|
1715
1715
|
checks: [
|
|
1716
1716
|
...this._def.checks,
|
|
@@ -1724,7 +1724,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
1726
1726
|
_addCheck(e) {
|
|
1727
|
-
return new
|
|
1727
|
+
return new de({
|
|
1728
1728
|
...this._def,
|
|
1729
1729
|
checks: [...this._def.checks, e]
|
|
1730
1730
|
});
|
|
@@ -1818,13 +1818,13 @@ var wn = or((Sn, Ye) => {
|
|
|
1818
1818
|
return Number.isFinite(r) && Number.isFinite(e);
|
|
1819
1819
|
}
|
|
1820
1820
|
}
|
|
1821
|
-
|
|
1821
|
+
de.create = (t) => new de({
|
|
1822
1822
|
checks: [],
|
|
1823
1823
|
typeName: m.ZodNumber,
|
|
1824
1824
|
coerce: t?.coerce || !1,
|
|
1825
1825
|
..._(t)
|
|
1826
1826
|
});
|
|
1827
|
-
class
|
|
1827
|
+
class ve extends v {
|
|
1828
1828
|
constructor() {
|
|
1829
1829
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1830
1830
|
}
|
|
@@ -1880,7 +1880,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1880
1880
|
return this.setLimit("max", e, !1, p.toString(r));
|
|
1881
1881
|
}
|
|
1882
1882
|
setLimit(e, r, n, a) {
|
|
1883
|
-
return new
|
|
1883
|
+
return new ve({
|
|
1884
1884
|
...this._def,
|
|
1885
1885
|
checks: [
|
|
1886
1886
|
...this._def.checks,
|
|
@@ -1894,7 +1894,7 @@ var wn = or((Sn, Ye) => {
|
|
|
1894
1894
|
});
|
|
1895
1895
|
}
|
|
1896
1896
|
_addCheck(e) {
|
|
1897
|
-
return new
|
|
1897
|
+
return new ve({
|
|
1898
1898
|
...this._def,
|
|
1899
1899
|
checks: [...this._def.checks, e]
|
|
1900
1900
|
});
|
|
@@ -1951,13 +1951,13 @@ var wn = or((Sn, Ye) => {
|
|
|
1951
1951
|
return e;
|
|
1952
1952
|
}
|
|
1953
1953
|
}
|
|
1954
|
-
|
|
1954
|
+
ve.create = (t) => new ve({
|
|
1955
1955
|
checks: [],
|
|
1956
1956
|
typeName: m.ZodBigInt,
|
|
1957
1957
|
coerce: t?.coerce ?? !1,
|
|
1958
1958
|
..._(t)
|
|
1959
1959
|
});
|
|
1960
|
-
class
|
|
1960
|
+
class Ue extends v {
|
|
1961
1961
|
_parse(e) {
|
|
1962
1962
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1963
1963
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1970,12 +1970,12 @@ var wn = or((Sn, Ye) => {
|
|
|
1970
1970
|
return P(e.data);
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
|
|
1973
|
+
Ue.create = (t) => new Ue({
|
|
1974
1974
|
typeName: m.ZodBoolean,
|
|
1975
1975
|
coerce: t?.coerce || !1,
|
|
1976
1976
|
..._(t)
|
|
1977
1977
|
});
|
|
1978
|
-
class
|
|
1978
|
+
class Ce extends v {
|
|
1979
1979
|
_parse(e) {
|
|
1980
1980
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1981
1981
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2015,7 +2015,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2015
2015
|
};
|
|
2016
2016
|
}
|
|
2017
2017
|
_addCheck(e) {
|
|
2018
|
-
return new
|
|
2018
|
+
return new Ce({
|
|
2019
2019
|
...this._def,
|
|
2020
2020
|
checks: [...this._def.checks, e]
|
|
2021
2021
|
});
|
|
@@ -2047,13 +2047,13 @@ var wn = or((Sn, Ye) => {
|
|
|
2047
2047
|
return e != null ? new Date(e) : null;
|
|
2048
2048
|
}
|
|
2049
2049
|
}
|
|
2050
|
-
|
|
2050
|
+
Ce.create = (t) => new Ce({
|
|
2051
2051
|
checks: [],
|
|
2052
2052
|
coerce: t?.coerce || !1,
|
|
2053
2053
|
typeName: m.ZodDate,
|
|
2054
2054
|
..._(t)
|
|
2055
2055
|
});
|
|
2056
|
-
class
|
|
2056
|
+
class ct extends v {
|
|
2057
2057
|
_parse(e) {
|
|
2058
2058
|
if (this._getType(e) !== f.symbol) {
|
|
2059
2059
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2066,11 +2066,11 @@ var wn = or((Sn, Ye) => {
|
|
|
2066
2066
|
return P(e.data);
|
|
2067
2067
|
}
|
|
2068
2068
|
}
|
|
2069
|
-
|
|
2069
|
+
ct.create = (t) => new ct({
|
|
2070
2070
|
typeName: m.ZodSymbol,
|
|
2071
2071
|
..._(t)
|
|
2072
2072
|
});
|
|
2073
|
-
class
|
|
2073
|
+
class lt extends v {
|
|
2074
2074
|
_parse(e) {
|
|
2075
2075
|
if (this._getType(e) !== f.undefined) {
|
|
2076
2076
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2083,11 +2083,11 @@ var wn = or((Sn, Ye) => {
|
|
|
2083
2083
|
return P(e.data);
|
|
2084
2084
|
}
|
|
2085
2085
|
}
|
|
2086
|
-
|
|
2086
|
+
lt.create = (t) => new lt({
|
|
2087
2087
|
typeName: m.ZodUndefined,
|
|
2088
2088
|
..._(t)
|
|
2089
2089
|
});
|
|
2090
|
-
class
|
|
2090
|
+
class ut extends v {
|
|
2091
2091
|
_parse(e) {
|
|
2092
2092
|
if (this._getType(e) !== f.null) {
|
|
2093
2093
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2100,11 +2100,11 @@ var wn = or((Sn, Ye) => {
|
|
|
2100
2100
|
return P(e.data);
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
|
-
|
|
2103
|
+
ut.create = (t) => new ut({
|
|
2104
2104
|
typeName: m.ZodNull,
|
|
2105
2105
|
..._(t)
|
|
2106
2106
|
});
|
|
2107
|
-
class
|
|
2107
|
+
class ft extends v {
|
|
2108
2108
|
constructor() {
|
|
2109
2109
|
super(...arguments), this._any = !0;
|
|
2110
2110
|
}
|
|
@@ -2112,11 +2112,11 @@ var wn = or((Sn, Ye) => {
|
|
|
2112
2112
|
return P(e.data);
|
|
2113
2113
|
}
|
|
2114
2114
|
}
|
|
2115
|
-
|
|
2115
|
+
ft.create = (t) => new ft({
|
|
2116
2116
|
typeName: m.ZodAny,
|
|
2117
2117
|
..._(t)
|
|
2118
2118
|
});
|
|
2119
|
-
class
|
|
2119
|
+
class ht extends v {
|
|
2120
2120
|
constructor() {
|
|
2121
2121
|
super(...arguments), this._unknown = !0;
|
|
2122
2122
|
}
|
|
@@ -2124,7 +2124,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2124
2124
|
return P(e.data);
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
|
-
|
|
2127
|
+
ht.create = (t) => new ht({
|
|
2128
2128
|
typeName: m.ZodUnknown,
|
|
2129
2129
|
..._(t)
|
|
2130
2130
|
});
|
|
@@ -2142,7 +2142,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2142
2142
|
typeName: m.ZodNever,
|
|
2143
2143
|
..._(t)
|
|
2144
2144
|
});
|
|
2145
|
-
class
|
|
2145
|
+
class pt extends v {
|
|
2146
2146
|
_parse(e) {
|
|
2147
2147
|
if (this._getType(e) !== f.undefined) {
|
|
2148
2148
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2155,7 +2155,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2155
2155
|
return P(e.data);
|
|
2156
2156
|
}
|
|
2157
2157
|
}
|
|
2158
|
-
|
|
2158
|
+
pt.create = (t) => new pt({
|
|
2159
2159
|
typeName: m.ZodVoid,
|
|
2160
2160
|
..._(t)
|
|
2161
2161
|
});
|
|
@@ -2232,12 +2232,12 @@ var wn = or((Sn, Ye) => {
|
|
|
2232
2232
|
typeName: m.ZodArray,
|
|
2233
2233
|
..._(e)
|
|
2234
2234
|
});
|
|
2235
|
-
function
|
|
2235
|
+
function se(t) {
|
|
2236
2236
|
if (t instanceof T) {
|
|
2237
2237
|
const e = {};
|
|
2238
2238
|
for (const r in t.shape) {
|
|
2239
2239
|
const n = t.shape[r];
|
|
2240
|
-
e[r] = B.create(
|
|
2240
|
+
e[r] = B.create(se(n));
|
|
2241
2241
|
}
|
|
2242
2242
|
return new T({
|
|
2243
2243
|
...t._def,
|
|
@@ -2245,8 +2245,8 @@ var wn = or((Sn, Ye) => {
|
|
|
2245
2245
|
});
|
|
2246
2246
|
} else return t instanceof Z ? new Z({
|
|
2247
2247
|
...t._def,
|
|
2248
|
-
type:
|
|
2249
|
-
}) : t instanceof B ? B.create(
|
|
2248
|
+
type: se(t.element)
|
|
2249
|
+
}) : t instanceof B ? B.create(se(t.unwrap())) : t instanceof ue ? ue.create(se(t.unwrap())) : t instanceof ee ? ee.create(t.items.map((e) => se(e))) : t;
|
|
2250
2250
|
}
|
|
2251
2251
|
class T extends v {
|
|
2252
2252
|
constructor() {
|
|
@@ -2481,7 +2481,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2481
2481
|
* @deprecated
|
|
2482
2482
|
*/
|
|
2483
2483
|
deepPartial() {
|
|
2484
|
-
return
|
|
2484
|
+
return se(this);
|
|
2485
2485
|
}
|
|
2486
2486
|
partial(e) {
|
|
2487
2487
|
const r = {};
|
|
@@ -2511,7 +2511,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2511
2511
|
});
|
|
2512
2512
|
}
|
|
2513
2513
|
keyof() {
|
|
2514
|
-
return
|
|
2514
|
+
return Qt(w.objectKeys(this.shape));
|
|
2515
2515
|
}
|
|
2516
2516
|
}
|
|
2517
2517
|
T.create = (t, e) => new T({
|
|
@@ -2535,7 +2535,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2535
2535
|
typeName: m.ZodObject,
|
|
2536
2536
|
..._(e)
|
|
2537
2537
|
});
|
|
2538
|
-
class
|
|
2538
|
+
class Ae extends v {
|
|
2539
2539
|
_parse(e) {
|
|
2540
2540
|
const { ctx: r } = this._processInputParams(e), n = this._def.options;
|
|
2541
2541
|
function a(s) {
|
|
@@ -2603,19 +2603,19 @@ var wn = or((Sn, Ye) => {
|
|
|
2603
2603
|
return this._def.options;
|
|
2604
2604
|
}
|
|
2605
2605
|
}
|
|
2606
|
-
|
|
2606
|
+
Ae.create = (t, e) => new Ae({
|
|
2607
2607
|
options: t,
|
|
2608
2608
|
typeName: m.ZodUnion,
|
|
2609
2609
|
..._(e)
|
|
2610
2610
|
});
|
|
2611
|
-
function
|
|
2611
|
+
function He(t, e) {
|
|
2612
2612
|
const r = U(t), n = U(e);
|
|
2613
2613
|
if (t === e)
|
|
2614
2614
|
return { valid: !0, data: t };
|
|
2615
2615
|
if (r === f.object && n === f.object) {
|
|
2616
2616
|
const a = w.objectKeys(e), s = w.objectKeys(t).filter((o) => a.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2617
2617
|
for (const o of s) {
|
|
2618
|
-
const d =
|
|
2618
|
+
const d = He(t[o], e[o]);
|
|
2619
2619
|
if (!d.valid)
|
|
2620
2620
|
return { valid: !1 };
|
|
2621
2621
|
i[o] = d.data;
|
|
@@ -2626,7 +2626,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2626
2626
|
return { valid: !1 };
|
|
2627
2627
|
const a = [];
|
|
2628
2628
|
for (let s = 0; s < t.length; s++) {
|
|
2629
|
-
const i = t[s], o = e[s], d =
|
|
2629
|
+
const i = t[s], o = e[s], d = He(i, o);
|
|
2630
2630
|
if (!d.valid)
|
|
2631
2631
|
return { valid: !1 };
|
|
2632
2632
|
a.push(d.data);
|
|
@@ -2634,13 +2634,13 @@ var wn = or((Sn, Ye) => {
|
|
|
2634
2634
|
return { valid: !0, data: a };
|
|
2635
2635
|
} else return r === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2636
2636
|
}
|
|
2637
|
-
class
|
|
2637
|
+
class Ie extends v {
|
|
2638
2638
|
_parse(e) {
|
|
2639
2639
|
const { status: r, ctx: n } = this._processInputParams(e), a = (s, i) => {
|
|
2640
|
-
if (
|
|
2640
|
+
if (it(s) || it(i))
|
|
2641
2641
|
return g;
|
|
2642
|
-
const o =
|
|
2643
|
-
return o.valid ? ((
|
|
2642
|
+
const o = He(s.value, i.value);
|
|
2643
|
+
return o.valid ? ((ot(s) || ot(i)) && r.dirty(), { status: r.value, value: o.data }) : (u(n, {
|
|
2644
2644
|
code: c.invalid_intersection_types
|
|
2645
2645
|
}), g);
|
|
2646
2646
|
};
|
|
@@ -2666,7 +2666,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2666
2666
|
}));
|
|
2667
2667
|
}
|
|
2668
2668
|
}
|
|
2669
|
-
|
|
2669
|
+
Ie.create = (t, e, r) => new Ie({
|
|
2670
2670
|
left: t,
|
|
2671
2671
|
right: e,
|
|
2672
2672
|
typeName: m.ZodIntersection,
|
|
@@ -2722,7 +2722,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2722
2722
|
..._(e)
|
|
2723
2723
|
});
|
|
2724
2724
|
};
|
|
2725
|
-
class
|
|
2725
|
+
class Pe extends v {
|
|
2726
2726
|
get keySchema() {
|
|
2727
2727
|
return this._def.keyType;
|
|
2728
2728
|
}
|
|
@@ -2750,12 +2750,12 @@ var wn = or((Sn, Ye) => {
|
|
|
2750
2750
|
return this._def.valueType;
|
|
2751
2751
|
}
|
|
2752
2752
|
static create(e, r, n) {
|
|
2753
|
-
return r instanceof v ? new
|
|
2753
|
+
return r instanceof v ? new Pe({
|
|
2754
2754
|
keyType: e,
|
|
2755
2755
|
valueType: r,
|
|
2756
2756
|
typeName: m.ZodRecord,
|
|
2757
2757
|
..._(n)
|
|
2758
|
-
}) : new
|
|
2758
|
+
}) : new Pe({
|
|
2759
2759
|
keyType: q.create(),
|
|
2760
2760
|
valueType: e,
|
|
2761
2761
|
typeName: m.ZodRecord,
|
|
@@ -2763,7 +2763,7 @@ var wn = or((Sn, Ye) => {
|
|
|
2763
2763
|
});
|
|
2764
2764
|
}
|
|
2765
2765
|
}
|
|
2766
|
-
class
|
|
2766
|
+
class mt extends v {
|
|
2767
2767
|
get keySchema() {
|
|
2768
2768
|
return this._def.keyType;
|
|
2769
2769
|
}
|
|
@@ -2805,13 +2805,13 @@ var wn = or((Sn, Ye) => {
|
|
|
2805
2805
|
}
|
|
2806
2806
|
}
|
|
2807
2807
|
}
|
|
2808
|
-
|
|
2808
|
+
mt.create = (t, e, r) => new mt({
|
|
2809
2809
|
valueType: e,
|
|
2810
2810
|
keyType: t,
|
|
2811
2811
|
typeName: m.ZodMap,
|
|
2812
2812
|
..._(r)
|
|
2813
2813
|
});
|
|
2814
|
-
class
|
|
2814
|
+
class ke extends v {
|
|
2815
2815
|
_parse(e) {
|
|
2816
2816
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2817
2817
|
if (n.parsedType !== f.set)
|
|
@@ -2850,13 +2850,13 @@ var wn = or((Sn, Ye) => {
|
|
|
2850
2850
|
return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
|
|
2851
2851
|
}
|
|
2852
2852
|
min(e, r) {
|
|
2853
|
-
return new
|
|
2853
|
+
return new ke({
|
|
2854
2854
|
...this._def,
|
|
2855
2855
|
minSize: { value: e, message: p.toString(r) }
|
|
2856
2856
|
});
|
|
2857
2857
|
}
|
|
2858
2858
|
max(e, r) {
|
|
2859
|
-
return new
|
|
2859
|
+
return new ke({
|
|
2860
2860
|
...this._def,
|
|
2861
2861
|
maxSize: { value: e, message: p.toString(r) }
|
|
2862
2862
|
});
|
|
@@ -2868,14 +2868,14 @@ var wn = or((Sn, Ye) => {
|
|
|
2868
2868
|
return this.min(1, e);
|
|
2869
2869
|
}
|
|
2870
2870
|
}
|
|
2871
|
-
|
|
2871
|
+
ke.create = (t, e) => new ke({
|
|
2872
2872
|
valueType: t,
|
|
2873
2873
|
minSize: null,
|
|
2874
2874
|
maxSize: null,
|
|
2875
2875
|
typeName: m.ZodSet,
|
|
2876
2876
|
..._(e)
|
|
2877
2877
|
});
|
|
2878
|
-
class
|
|
2878
|
+
class yt extends v {
|
|
2879
2879
|
get schema() {
|
|
2880
2880
|
return this._def.getter();
|
|
2881
2881
|
}
|
|
@@ -2884,12 +2884,12 @@ var wn = or((Sn, Ye) => {
|
|
|
2884
2884
|
return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
|
|
2885
2885
|
}
|
|
2886
2886
|
}
|
|
2887
|
-
|
|
2887
|
+
yt.create = (t, e) => new yt({
|
|
2888
2888
|
getter: t,
|
|
2889
2889
|
typeName: m.ZodLazy,
|
|
2890
2890
|
..._(e)
|
|
2891
2891
|
});
|
|
2892
|
-
class
|
|
2892
|
+
class gt extends v {
|
|
2893
2893
|
_parse(e) {
|
|
2894
2894
|
if (e.data !== this._def.value) {
|
|
2895
2895
|
const r = this._getOrReturnCtx(e);
|
|
@@ -2905,19 +2905,19 @@ var wn = or((Sn, Ye) => {
|
|
|
2905
2905
|
return this._def.value;
|
|
2906
2906
|
}
|
|
2907
2907
|
}
|
|
2908
|
-
|
|
2908
|
+
gt.create = (t, e) => new gt({
|
|
2909
2909
|
value: t,
|
|
2910
2910
|
typeName: m.ZodLiteral,
|
|
2911
2911
|
..._(e)
|
|
2912
2912
|
});
|
|
2913
|
-
function
|
|
2914
|
-
return new
|
|
2913
|
+
function Qt(t, e) {
|
|
2914
|
+
return new ce({
|
|
2915
2915
|
values: t,
|
|
2916
2916
|
typeName: m.ZodEnum,
|
|
2917
2917
|
..._(e)
|
|
2918
2918
|
});
|
|
2919
2919
|
}
|
|
2920
|
-
class
|
|
2920
|
+
class ce extends v {
|
|
2921
2921
|
_parse(e) {
|
|
2922
2922
|
if (typeof e.data != "string") {
|
|
2923
2923
|
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
@@ -2959,20 +2959,20 @@ var wn = or((Sn, Ye) => {
|
|
|
2959
2959
|
return e;
|
|
2960
2960
|
}
|
|
2961
2961
|
extract(e, r = this._def) {
|
|
2962
|
-
return
|
|
2962
|
+
return ce.create(e, {
|
|
2963
2963
|
...this._def,
|
|
2964
2964
|
...r
|
|
2965
2965
|
});
|
|
2966
2966
|
}
|
|
2967
2967
|
exclude(e, r = this._def) {
|
|
2968
|
-
return
|
|
2968
|
+
return ce.create(this.options.filter((n) => !e.includes(n)), {
|
|
2969
2969
|
...this._def,
|
|
2970
2970
|
...r
|
|
2971
2971
|
});
|
|
2972
2972
|
}
|
|
2973
2973
|
}
|
|
2974
|
-
|
|
2975
|
-
class
|
|
2974
|
+
ce.create = Qt;
|
|
2975
|
+
class _t extends v {
|
|
2976
2976
|
_parse(e) {
|
|
2977
2977
|
const r = w.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2978
2978
|
if (n.parsedType !== f.string && n.parsedType !== f.number) {
|
|
@@ -2997,12 +2997,12 @@ var wn = or((Sn, Ye) => {
|
|
|
2997
2997
|
return this._def.values;
|
|
2998
2998
|
}
|
|
2999
2999
|
}
|
|
3000
|
-
|
|
3000
|
+
_t.create = (t, e) => new _t({
|
|
3001
3001
|
values: t,
|
|
3002
3002
|
typeName: m.ZodNativeEnum,
|
|
3003
3003
|
..._(e)
|
|
3004
3004
|
});
|
|
3005
|
-
class
|
|
3005
|
+
class je extends v {
|
|
3006
3006
|
unwrap() {
|
|
3007
3007
|
return this._def.type;
|
|
3008
3008
|
}
|
|
@@ -3021,12 +3021,12 @@ var wn = or((Sn, Ye) => {
|
|
|
3021
3021
|
})));
|
|
3022
3022
|
}
|
|
3023
3023
|
}
|
|
3024
|
-
|
|
3024
|
+
je.create = (t, e) => new je({
|
|
3025
3025
|
type: t,
|
|
3026
3026
|
typeName: m.ZodPromise,
|
|
3027
3027
|
..._(e)
|
|
3028
3028
|
});
|
|
3029
|
-
class
|
|
3029
|
+
class le extends v {
|
|
3030
3030
|
innerType() {
|
|
3031
3031
|
return this._def.schema;
|
|
3032
3032
|
}
|
|
@@ -3053,7 +3053,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3053
3053
|
path: n.path,
|
|
3054
3054
|
parent: n
|
|
3055
3055
|
});
|
|
3056
|
-
return d.status === "aborted" ? g : d.status === "dirty" || r.value === "dirty" ?
|
|
3056
|
+
return d.status === "aborted" ? g : d.status === "dirty" || r.value === "dirty" ? ge(d.value) : d;
|
|
3057
3057
|
});
|
|
3058
3058
|
{
|
|
3059
3059
|
if (r.value === "aborted")
|
|
@@ -3063,7 +3063,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3063
3063
|
path: n.path,
|
|
3064
3064
|
parent: n
|
|
3065
3065
|
});
|
|
3066
|
-
return o.status === "aborted" ? g : o.status === "dirty" || r.value === "dirty" ?
|
|
3066
|
+
return o.status === "aborted" ? g : o.status === "dirty" || r.value === "dirty" ? ge(o.value) : o;
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
3069
|
if (a.type === "refinement") {
|
|
@@ -3092,27 +3092,27 @@ var wn = or((Sn, Ye) => {
|
|
|
3092
3092
|
path: n.path,
|
|
3093
3093
|
parent: n
|
|
3094
3094
|
});
|
|
3095
|
-
if (!
|
|
3095
|
+
if (!oe(i))
|
|
3096
3096
|
return g;
|
|
3097
3097
|
const o = a.transform(i.value, s);
|
|
3098
3098
|
if (o instanceof Promise)
|
|
3099
3099
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3100
3100
|
return { status: r.value, value: o };
|
|
3101
3101
|
} else
|
|
3102
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
3102
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => oe(i) ? Promise.resolve(a.transform(i.value, s)).then((o) => ({
|
|
3103
3103
|
status: r.value,
|
|
3104
3104
|
value: o
|
|
3105
3105
|
})) : g);
|
|
3106
3106
|
w.assertNever(a);
|
|
3107
3107
|
}
|
|
3108
3108
|
}
|
|
3109
|
-
|
|
3109
|
+
le.create = (t, e, r) => new le({
|
|
3110
3110
|
schema: t,
|
|
3111
3111
|
typeName: m.ZodEffects,
|
|
3112
3112
|
effect: e,
|
|
3113
3113
|
..._(r)
|
|
3114
3114
|
});
|
|
3115
|
-
|
|
3115
|
+
le.createWithPreprocess = (t, e, r) => new le({
|
|
3116
3116
|
schema: e,
|
|
3117
3117
|
effect: { type: "preprocess", transform: t },
|
|
3118
3118
|
typeName: m.ZodEffects,
|
|
@@ -3131,7 +3131,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3131
3131
|
typeName: m.ZodOptional,
|
|
3132
3132
|
..._(e)
|
|
3133
3133
|
});
|
|
3134
|
-
class
|
|
3134
|
+
class ue extends v {
|
|
3135
3135
|
_parse(e) {
|
|
3136
3136
|
return this._getType(e) === f.null ? P(null) : this._def.innerType._parse(e);
|
|
3137
3137
|
}
|
|
@@ -3139,12 +3139,12 @@ var wn = or((Sn, Ye) => {
|
|
|
3139
3139
|
return this._def.innerType;
|
|
3140
3140
|
}
|
|
3141
3141
|
}
|
|
3142
|
-
|
|
3142
|
+
ue.create = (t, e) => new ue({
|
|
3143
3143
|
innerType: t,
|
|
3144
3144
|
typeName: m.ZodNullable,
|
|
3145
3145
|
..._(e)
|
|
3146
3146
|
});
|
|
3147
|
-
class
|
|
3147
|
+
class Be extends v {
|
|
3148
3148
|
_parse(e) {
|
|
3149
3149
|
const { ctx: r } = this._processInputParams(e);
|
|
3150
3150
|
let n = r.data;
|
|
@@ -3158,13 +3158,13 @@ var wn = or((Sn, Ye) => {
|
|
|
3158
3158
|
return this._def.innerType;
|
|
3159
3159
|
}
|
|
3160
3160
|
}
|
|
3161
|
-
|
|
3161
|
+
Be.create = (t, e) => new Be({
|
|
3162
3162
|
innerType: t,
|
|
3163
3163
|
typeName: m.ZodDefault,
|
|
3164
3164
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
3165
3165
|
..._(e)
|
|
3166
3166
|
});
|
|
3167
|
-
class
|
|
3167
|
+
class We extends v {
|
|
3168
3168
|
_parse(e) {
|
|
3169
3169
|
const { ctx: r } = this._processInputParams(e), n = {
|
|
3170
3170
|
...r,
|
|
@@ -3179,7 +3179,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3179
3179
|
...n
|
|
3180
3180
|
}
|
|
3181
3181
|
});
|
|
3182
|
-
return
|
|
3182
|
+
return Re(a) ? a.then((s) => ({
|
|
3183
3183
|
status: "valid",
|
|
3184
3184
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
3185
3185
|
get error() {
|
|
@@ -3201,13 +3201,13 @@ var wn = or((Sn, Ye) => {
|
|
|
3201
3201
|
return this._def.innerType;
|
|
3202
3202
|
}
|
|
3203
3203
|
}
|
|
3204
|
-
|
|
3204
|
+
We.create = (t, e) => new We({
|
|
3205
3205
|
innerType: t,
|
|
3206
3206
|
typeName: m.ZodCatch,
|
|
3207
3207
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
3208
3208
|
..._(e)
|
|
3209
3209
|
});
|
|
3210
|
-
class
|
|
3210
|
+
class vt extends v {
|
|
3211
3211
|
_parse(e) {
|
|
3212
3212
|
if (this._getType(e) !== f.nan) {
|
|
3213
3213
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3220,11 +3220,11 @@ var wn = or((Sn, Ye) => {
|
|
|
3220
3220
|
return { status: "valid", value: e.data };
|
|
3221
3221
|
}
|
|
3222
3222
|
}
|
|
3223
|
-
|
|
3223
|
+
vt.create = (t) => new vt({
|
|
3224
3224
|
typeName: m.ZodNaN,
|
|
3225
3225
|
..._(t)
|
|
3226
3226
|
});
|
|
3227
|
-
class
|
|
3227
|
+
class an extends v {
|
|
3228
3228
|
_parse(e) {
|
|
3229
3229
|
const { ctx: r } = this._processInputParams(e), n = r.data;
|
|
3230
3230
|
return this._def.type._parse({
|
|
@@ -3237,7 +3237,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3237
3237
|
return this._def.type;
|
|
3238
3238
|
}
|
|
3239
3239
|
}
|
|
3240
|
-
class
|
|
3240
|
+
class et extends v {
|
|
3241
3241
|
_parse(e) {
|
|
3242
3242
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
3243
3243
|
if (n.common.async)
|
|
@@ -3247,7 +3247,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3247
3247
|
path: n.path,
|
|
3248
3248
|
parent: n
|
|
3249
3249
|
});
|
|
3250
|
-
return s.status === "aborted" ? g : s.status === "dirty" ? (r.dirty(),
|
|
3250
|
+
return s.status === "aborted" ? g : s.status === "dirty" ? (r.dirty(), ge(s.value)) : this._def.out._parseAsync({
|
|
3251
3251
|
data: s.value,
|
|
3252
3252
|
path: n.path,
|
|
3253
3253
|
parent: n
|
|
@@ -3270,23 +3270,23 @@ var wn = or((Sn, Ye) => {
|
|
|
3270
3270
|
}
|
|
3271
3271
|
}
|
|
3272
3272
|
static create(e, r) {
|
|
3273
|
-
return new
|
|
3273
|
+
return new et({
|
|
3274
3274
|
in: e,
|
|
3275
3275
|
out: r,
|
|
3276
3276
|
typeName: m.ZodPipeline
|
|
3277
3277
|
});
|
|
3278
3278
|
}
|
|
3279
3279
|
}
|
|
3280
|
-
class
|
|
3280
|
+
class Je extends v {
|
|
3281
3281
|
_parse(e) {
|
|
3282
|
-
const r = this._def.innerType._parse(e), n = (a) => (
|
|
3283
|
-
return
|
|
3282
|
+
const r = this._def.innerType._parse(e), n = (a) => (oe(a) && (a.value = Object.freeze(a.value)), a);
|
|
3283
|
+
return Re(r) ? r.then((a) => n(a)) : n(r);
|
|
3284
3284
|
}
|
|
3285
3285
|
unwrap() {
|
|
3286
3286
|
return this._def.innerType;
|
|
3287
3287
|
}
|
|
3288
3288
|
}
|
|
3289
|
-
|
|
3289
|
+
Je.create = (t, e) => new Je({
|
|
3290
3290
|
innerType: t,
|
|
3291
3291
|
typeName: m.ZodReadonly,
|
|
3292
3292
|
..._(e)
|
|
@@ -3295,32 +3295,32 @@ var wn = or((Sn, Ye) => {
|
|
|
3295
3295
|
(function(t) {
|
|
3296
3296
|
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";
|
|
3297
3297
|
})(m || (m = {}));
|
|
3298
|
-
const
|
|
3298
|
+
const C = q.create, pe = de.create, F = Ue.create;
|
|
3299
3299
|
J.create;
|
|
3300
|
-
const
|
|
3301
|
-
|
|
3300
|
+
const Xt = Z.create, N = T.create, sn = Ae.create;
|
|
3301
|
+
Ie.create;
|
|
3302
3302
|
ee.create;
|
|
3303
|
-
const
|
|
3304
|
-
|
|
3303
|
+
const on = Pe.create, E = ce.create;
|
|
3304
|
+
je.create;
|
|
3305
3305
|
B.create;
|
|
3306
|
-
|
|
3307
|
-
const
|
|
3308
|
-
detail:
|
|
3309
|
-
}),
|
|
3310
|
-
error:
|
|
3306
|
+
ue.create;
|
|
3307
|
+
const Ye = N({
|
|
3308
|
+
detail: C()
|
|
3309
|
+
}), Gt = N({
|
|
3310
|
+
error: C()
|
|
3311
3311
|
});
|
|
3312
|
-
function
|
|
3312
|
+
function Kt(t) {
|
|
3313
3313
|
if (!t)
|
|
3314
3314
|
return "Unknown error";
|
|
3315
3315
|
if (t instanceof Error) {
|
|
3316
|
-
const e =
|
|
3317
|
-
return e.success ? e.data.detail :
|
|
3316
|
+
const e = Ye.safeParse(t.cause);
|
|
3317
|
+
return e.success ? e.data.detail : dn(t.message);
|
|
3318
3318
|
}
|
|
3319
3319
|
if (typeof t == "object") {
|
|
3320
|
-
const e =
|
|
3320
|
+
const e = Ye.safeParse(t);
|
|
3321
3321
|
if (e.success)
|
|
3322
3322
|
return e.data.detail;
|
|
3323
|
-
const r =
|
|
3323
|
+
const r = Gt.safeParse(t);
|
|
3324
3324
|
if (r.success)
|
|
3325
3325
|
return r.data.error;
|
|
3326
3326
|
}
|
|
@@ -3330,113 +3330,115 @@ var wn = or((Sn, Ye) => {
|
|
|
3330
3330
|
return String(t);
|
|
3331
3331
|
}
|
|
3332
3332
|
}
|
|
3333
|
-
function
|
|
3334
|
-
const e =
|
|
3333
|
+
function dn(t) {
|
|
3334
|
+
const e = cn(t);
|
|
3335
3335
|
if (!e)
|
|
3336
3336
|
return t;
|
|
3337
|
-
const r =
|
|
3337
|
+
const r = Ye.safeParse(e);
|
|
3338
3338
|
if (r.success)
|
|
3339
3339
|
return r.data.detail;
|
|
3340
|
-
const n =
|
|
3340
|
+
const n = Gt.safeParse(e);
|
|
3341
3341
|
return n.success ? n.data.error : t;
|
|
3342
3342
|
}
|
|
3343
|
-
function
|
|
3343
|
+
function cn(t) {
|
|
3344
3344
|
try {
|
|
3345
3345
|
return JSON.parse(t);
|
|
3346
3346
|
} catch {
|
|
3347
3347
|
return t;
|
|
3348
3348
|
}
|
|
3349
3349
|
}
|
|
3350
|
-
function
|
|
3350
|
+
function er(t, e) {
|
|
3351
3351
|
if (!t)
|
|
3352
3352
|
throw new Error(e);
|
|
3353
3353
|
}
|
|
3354
|
-
const
|
|
3354
|
+
const ln = [
|
|
3355
3355
|
"pip",
|
|
3356
3356
|
"uv",
|
|
3357
3357
|
"rye",
|
|
3358
3358
|
"poetry",
|
|
3359
3359
|
"pixi"
|
|
3360
|
-
],
|
|
3360
|
+
], tr = [
|
|
3361
3361
|
"normal",
|
|
3362
3362
|
"compact",
|
|
3363
3363
|
"medium",
|
|
3364
3364
|
"full",
|
|
3365
3365
|
"columns"
|
|
3366
|
-
],
|
|
3366
|
+
], rr = [
|
|
3367
3367
|
"auto",
|
|
3368
3368
|
"native",
|
|
3369
3369
|
"polars",
|
|
3370
3370
|
"lazy-polars",
|
|
3371
3371
|
"pandas"
|
|
3372
|
-
],
|
|
3373
|
-
|
|
3372
|
+
], nr = ["html", "markdown", "ipynb"], te = N({
|
|
3373
|
+
api_key: C().optional(),
|
|
3374
|
+
base_url: C().optional()
|
|
3375
|
+
}).passthrough(), un = N({
|
|
3376
|
+
completion: N({
|
|
3374
3377
|
activate_on_typing: F().default(!0),
|
|
3375
|
-
copilot:
|
|
3376
|
-
codeium_api_key:
|
|
3378
|
+
copilot: sn([F(), E(["github", "codeium", "custom"])]).default(!1).transform((t) => t === !0 ? "github" : t),
|
|
3379
|
+
codeium_api_key: C().nullish()
|
|
3377
3380
|
}).passthrough().default({}),
|
|
3378
|
-
save:
|
|
3379
|
-
autosave:
|
|
3380
|
-
autosave_delay:
|
|
3381
|
+
save: N({
|
|
3382
|
+
autosave: E(["off", "after_delay"]).default("after_delay"),
|
|
3383
|
+
autosave_delay: pe().nonnegative().transform((t) => Math.max(t, 1e3)).default(1e3),
|
|
3381
3384
|
format_on_save: F().default(!1)
|
|
3382
3385
|
}).passthrough().default({}),
|
|
3383
|
-
formatting:
|
|
3384
|
-
line_length:
|
|
3386
|
+
formatting: N({
|
|
3387
|
+
line_length: pe().nonnegative().default(79).transform((t) => Math.min(t, 1e3))
|
|
3385
3388
|
}).passthrough().default({}),
|
|
3386
|
-
keymap:
|
|
3387
|
-
preset:
|
|
3388
|
-
overrides:
|
|
3389
|
+
keymap: N({
|
|
3390
|
+
preset: E(["default", "vim"]).default("default"),
|
|
3391
|
+
overrides: on(C()).default({}),
|
|
3389
3392
|
destructive_delete: F().default(!0)
|
|
3390
3393
|
}).passthrough().default({}),
|
|
3391
|
-
runtime:
|
|
3394
|
+
runtime: N({
|
|
3392
3395
|
auto_instantiate: F().default(!0),
|
|
3393
|
-
on_cell_change:
|
|
3394
|
-
auto_reload:
|
|
3395
|
-
watcher_on_save:
|
|
3396
|
-
default_sql_output:
|
|
3397
|
-
default_auto_download:
|
|
3396
|
+
on_cell_change: E(["lazy", "autorun"]).default("autorun"),
|
|
3397
|
+
auto_reload: E(["off", "lazy", "autorun"]).default("off"),
|
|
3398
|
+
watcher_on_save: E(["lazy", "autorun"]).default("lazy"),
|
|
3399
|
+
default_sql_output: E(rr).default("auto"),
|
|
3400
|
+
default_auto_download: Xt(E(nr)).default([])
|
|
3398
3401
|
}).passthrough().default({}),
|
|
3399
|
-
display:
|
|
3400
|
-
theme:
|
|
3401
|
-
code_editor_font_size:
|
|
3402
|
-
cell_output:
|
|
3403
|
-
dataframes:
|
|
3404
|
-
default_table_page_size:
|
|
3405
|
-
default_table_max_columns:
|
|
3406
|
-
default_width:
|
|
3402
|
+
display: N({
|
|
3403
|
+
theme: E(["light", "dark", "system"]).default("light"),
|
|
3404
|
+
code_editor_font_size: pe().nonnegative().default(14),
|
|
3405
|
+
cell_output: E(["above", "below"]).default("above"),
|
|
3406
|
+
dataframes: E(["rich", "plain"]).default("rich"),
|
|
3407
|
+
default_table_page_size: pe().default(10),
|
|
3408
|
+
default_table_max_columns: pe().default(50),
|
|
3409
|
+
default_width: E(tr).default("medium").transform((t) => t === "normal" ? "compact" : t),
|
|
3407
3410
|
reference_highlighting: F().default(!1)
|
|
3408
3411
|
}).passthrough().default({}),
|
|
3409
|
-
package_management:
|
|
3410
|
-
manager:
|
|
3412
|
+
package_management: N({
|
|
3413
|
+
manager: E(ln).default("pip")
|
|
3411
3414
|
}).passthrough().default({ manager: "pip" }),
|
|
3412
|
-
ai:
|
|
3413
|
-
rules:
|
|
3414
|
-
mode:
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
model:
|
|
3419
|
-
}).optional(),
|
|
3420
|
-
anthropic:
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
aws_secret_access_key: R().optional()
|
|
3415
|
+
ai: N({
|
|
3416
|
+
rules: C().default(""),
|
|
3417
|
+
mode: E(["manual", "ask"]).default("manual"),
|
|
3418
|
+
// TODO: the model currently exists on the open_ai object, but we should
|
|
3419
|
+
// move it to the top level.
|
|
3420
|
+
open_ai: te.extend({
|
|
3421
|
+
model: C().optional()
|
|
3422
|
+
}).passthrough().optional(),
|
|
3423
|
+
anthropic: te.optional(),
|
|
3424
|
+
google: te.optional(),
|
|
3425
|
+
ollama: te.optional(),
|
|
3426
|
+
open_ai_compatible: te.optional(),
|
|
3427
|
+
azure: te.optional(),
|
|
3428
|
+
bedrock: N({
|
|
3429
|
+
region_name: C().optional(),
|
|
3430
|
+
profile_name: C().optional(),
|
|
3431
|
+
aws_access_key_id: C().optional(),
|
|
3432
|
+
aws_secret_access_key: C().optional()
|
|
3431
3433
|
}).optional()
|
|
3432
3434
|
}).passthrough().default({}),
|
|
3433
|
-
experimental:
|
|
3435
|
+
experimental: N({
|
|
3434
3436
|
markdown: F().optional(),
|
|
3435
3437
|
rtc: F().optional()
|
|
3436
3438
|
// Add new experimental features here
|
|
3437
3439
|
}).passthrough().default({}),
|
|
3438
|
-
server:
|
|
3439
|
-
sharing:
|
|
3440
|
+
server: N({}).passthrough().default({}),
|
|
3441
|
+
sharing: N({
|
|
3440
3442
|
html: F().optional(),
|
|
3441
3443
|
wasm: F().optional()
|
|
3442
3444
|
}).passthrough().optional()
|
|
@@ -3454,55 +3456,55 @@ var wn = or((Sn, Ye) => {
|
|
|
3454
3456
|
mode: "manual",
|
|
3455
3457
|
open_ai: {}
|
|
3456
3458
|
}
|
|
3457
|
-
}),
|
|
3458
|
-
|
|
3459
|
-
width:
|
|
3460
|
-
app_title:
|
|
3461
|
-
css_file:
|
|
3462
|
-
html_head_file:
|
|
3463
|
-
auto_download:
|
|
3464
|
-
sql_output:
|
|
3459
|
+
}), fn = C(), hn = E(rr).default("auto");
|
|
3460
|
+
N({
|
|
3461
|
+
width: E(tr).default("medium").transform((t) => t === "normal" ? "compact" : t),
|
|
3462
|
+
app_title: fn.nullish(),
|
|
3463
|
+
css_file: C().nullish(),
|
|
3464
|
+
html_head_file: C().nullish(),
|
|
3465
|
+
auto_download: Xt(E(nr)).default([]),
|
|
3466
|
+
sql_output: hn
|
|
3465
3467
|
}).default({ width: "medium", auto_download: [] });
|
|
3466
|
-
function
|
|
3467
|
-
return
|
|
3468
|
+
function pn() {
|
|
3469
|
+
return un.parse({});
|
|
3468
3470
|
}
|
|
3469
|
-
const
|
|
3470
|
-
function
|
|
3471
|
+
const kt = (t) => new TextDecoder().decode(t);
|
|
3472
|
+
function _e(t) {
|
|
3471
3473
|
return t.FS;
|
|
3472
3474
|
}
|
|
3473
|
-
const
|
|
3474
|
-
NOTEBOOK_FILENAME:
|
|
3475
|
-
HOME_DIR:
|
|
3475
|
+
const me = "notebook.py", ye = "/marimo", K = {
|
|
3476
|
+
NOTEBOOK_FILENAME: me,
|
|
3477
|
+
HOME_DIR: ye,
|
|
3476
3478
|
createHomeDir: (t) => {
|
|
3477
|
-
const e =
|
|
3479
|
+
const e = _e(t);
|
|
3478
3480
|
try {
|
|
3479
|
-
e.mkdirTree(
|
|
3481
|
+
e.mkdirTree(ye);
|
|
3480
3482
|
} catch {
|
|
3481
3483
|
}
|
|
3482
|
-
e.chdir(
|
|
3484
|
+
e.chdir(ye);
|
|
3483
3485
|
},
|
|
3484
3486
|
mountFS: (t) => {
|
|
3485
|
-
|
|
3487
|
+
_e(t).mount(t.FS.filesystems.IDBFS, { root: "." }, ye);
|
|
3486
3488
|
},
|
|
3487
3489
|
populateFilesToMemory: async (t) => {
|
|
3488
|
-
await
|
|
3490
|
+
await wt(t, !0);
|
|
3489
3491
|
},
|
|
3490
3492
|
persistFilesToRemote: async (t) => {
|
|
3491
|
-
await
|
|
3493
|
+
await wt(t, !1);
|
|
3492
3494
|
},
|
|
3493
3495
|
readNotebook: (t) => {
|
|
3494
|
-
const e =
|
|
3495
|
-
return
|
|
3496
|
+
const e = _e(t), r = `${ye}/${me}`;
|
|
3497
|
+
return kt(e.readFile(r));
|
|
3496
3498
|
},
|
|
3497
3499
|
initNotebookCode: (t) => {
|
|
3498
|
-
const { pyodide: e, filename: r, code: n } = t, a =
|
|
3500
|
+
const { pyodide: e, filename: r, code: n } = t, a = _e(e), s = (i) => {
|
|
3499
3501
|
try {
|
|
3500
|
-
return
|
|
3502
|
+
return kt(a.readFile(i));
|
|
3501
3503
|
} catch {
|
|
3502
3504
|
return null;
|
|
3503
3505
|
}
|
|
3504
3506
|
};
|
|
3505
|
-
if (r && r !==
|
|
3507
|
+
if (r && r !== me) {
|
|
3506
3508
|
const i = s(r);
|
|
3507
3509
|
if (i)
|
|
3508
3510
|
return {
|
|
@@ -3510,15 +3512,15 @@ var wn = or((Sn, Ye) => {
|
|
|
3510
3512
|
filename: r
|
|
3511
3513
|
};
|
|
3512
3514
|
}
|
|
3513
|
-
return a.writeFile(
|
|
3515
|
+
return a.writeFile(me, n), {
|
|
3514
3516
|
code: n,
|
|
3515
|
-
filename:
|
|
3517
|
+
filename: me
|
|
3516
3518
|
};
|
|
3517
3519
|
}
|
|
3518
3520
|
};
|
|
3519
|
-
function
|
|
3521
|
+
function wt(t, e) {
|
|
3520
3522
|
return new Promise((r, n) => {
|
|
3521
|
-
|
|
3523
|
+
_e(t).syncfs(e, (a) => {
|
|
3522
3524
|
if (a instanceof Error) {
|
|
3523
3525
|
n(a);
|
|
3524
3526
|
return;
|
|
@@ -3527,7 +3529,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3527
3529
|
});
|
|
3528
3530
|
});
|
|
3529
3531
|
}
|
|
3530
|
-
class
|
|
3532
|
+
class mn {
|
|
3531
3533
|
spans = [];
|
|
3532
3534
|
startSpan(e, r = {}) {
|
|
3533
3535
|
const n = {
|
|
@@ -3567,23 +3569,23 @@ var wn = or((Sn, Ye) => {
|
|
|
3567
3569
|
logSpans() {
|
|
3568
3570
|
}
|
|
3569
3571
|
}
|
|
3570
|
-
const
|
|
3571
|
-
globalThis.t =
|
|
3572
|
-
const
|
|
3573
|
-
class
|
|
3572
|
+
const ie = new mn();
|
|
3573
|
+
globalThis.t = ie;
|
|
3574
|
+
const yn = !1;
|
|
3575
|
+
class gn {
|
|
3574
3576
|
pyodide = null;
|
|
3575
3577
|
get requirePyodide() {
|
|
3576
|
-
return
|
|
3578
|
+
return er(this.pyodide, "Pyodide not loaded"), this.pyodide;
|
|
3577
3579
|
}
|
|
3578
3580
|
async bootstrap(e) {
|
|
3579
3581
|
return await this.loadPyodideAndPackages(e);
|
|
3580
3582
|
}
|
|
3581
3583
|
async loadPyodideAndPackages(e) {
|
|
3582
|
-
if (!
|
|
3584
|
+
if (!Ve)
|
|
3583
3585
|
throw new Error("loadPyodide is not defined");
|
|
3584
|
-
const r =
|
|
3586
|
+
const r = ie.startSpan("loadPyodide");
|
|
3585
3587
|
try {
|
|
3586
|
-
const n = await
|
|
3588
|
+
const n = await Ve({
|
|
3587
3589
|
// Perf: These get loaded while pyodide is being bootstrapped
|
|
3588
3590
|
packages: [
|
|
3589
3591
|
"micropip",
|
|
@@ -3593,7 +3595,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3593
3595
|
"narwhals",
|
|
3594
3596
|
"packaging"
|
|
3595
3597
|
],
|
|
3596
|
-
_makeSnapshot:
|
|
3598
|
+
_makeSnapshot: yn,
|
|
3597
3599
|
lockFileURL: `https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,
|
|
3598
3600
|
// Without this, this fails in Firefox with
|
|
3599
3601
|
// `Could not extract indexURL path from pyodide module`
|
|
@@ -3606,7 +3608,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3606
3608
|
}
|
|
3607
3609
|
}
|
|
3608
3610
|
async mountFilesystem(e) {
|
|
3609
|
-
const r =
|
|
3611
|
+
const r = ie.startSpan("mountFilesystem");
|
|
3610
3612
|
return K.createHomeDir(this.requirePyodide), K.mountFS(this.requirePyodide), await K.populateFilesToMemory(this.requirePyodide), r.end("ok"), K.initNotebookCode({
|
|
3611
3613
|
pyodide: this.requirePyodide,
|
|
3612
3614
|
code: e.code,
|
|
@@ -3618,7 +3620,7 @@ var wn = or((Sn, Ye) => {
|
|
|
3618
3620
|
self.messenger = {
|
|
3619
3621
|
callback: a
|
|
3620
3622
|
}, self.query_params = s, self.user_config = i;
|
|
3621
|
-
const o =
|
|
3623
|
+
const o = ie.startSpan("startSession.runPython"), d = n || K.NOTEBOOK_FILENAME, [l, h, x] = this.requirePyodide.runPython(
|
|
3622
3624
|
`
|
|
3623
3625
|
print("[py] Starting marimo...")
|
|
3624
3626
|
import asyncio
|
|
@@ -3661,11 +3663,11 @@ ${e}`, e = `import jedi
|
|
|
3661
3663
|
${e}`, e = `import pyodide_http
|
|
3662
3664
|
${e}`;
|
|
3663
3665
|
const a = [...r];
|
|
3664
|
-
let s =
|
|
3666
|
+
let s = ie.startSpan("pyodide.loadPackage");
|
|
3665
3667
|
await n.loadPackagesFromImports(e, {
|
|
3666
3668
|
errorCallback: H.error,
|
|
3667
3669
|
messageCallback: H.log
|
|
3668
|
-
}), s.end(), s =
|
|
3670
|
+
}), s.end(), s = ie.startSpan("micropip.install");
|
|
3669
3671
|
const i = a.filter(
|
|
3670
3672
|
(o) => !n.loadedPackages[o]
|
|
3671
3673
|
);
|
|
@@ -3682,7 +3684,7 @@ ${e}`;
|
|
|
3682
3684
|
}), s.end();
|
|
3683
3685
|
}
|
|
3684
3686
|
}
|
|
3685
|
-
class
|
|
3687
|
+
class _n extends gn {
|
|
3686
3688
|
async bootstrap(e) {
|
|
3687
3689
|
return await super.bootstrap(e);
|
|
3688
3690
|
}
|
|
@@ -3705,46 +3707,46 @@ ${e}`;
|
|
|
3705
3707
|
code: e.code,
|
|
3706
3708
|
filename: e.filename,
|
|
3707
3709
|
onMessage: e.onMessage,
|
|
3708
|
-
userConfig:
|
|
3710
|
+
userConfig: pn()
|
|
3709
3711
|
});
|
|
3710
3712
|
}
|
|
3711
3713
|
}
|
|
3712
|
-
async function
|
|
3713
|
-
const t =
|
|
3714
|
+
async function vn() {
|
|
3715
|
+
const t = wn(), e = Rr(t);
|
|
3714
3716
|
try {
|
|
3715
|
-
self.controller = new
|
|
3717
|
+
self.controller = new _n(), self.pyodide = await self.controller.bootstrap({
|
|
3716
3718
|
version: t,
|
|
3717
3719
|
pyodideVersion: e
|
|
3718
3720
|
});
|
|
3719
3721
|
} catch (r) {
|
|
3720
|
-
H.error("Error bootstrapping", r),
|
|
3721
|
-
error:
|
|
3722
|
+
H.error("Error bootstrapping", r), fe.send.initializedError({
|
|
3723
|
+
error: Kt(r)
|
|
3722
3724
|
});
|
|
3723
3725
|
}
|
|
3724
3726
|
}
|
|
3725
|
-
const
|
|
3727
|
+
const Te = vn(), ar = new Cr(
|
|
3726
3728
|
(t) => {
|
|
3727
|
-
|
|
3729
|
+
fe.send.kernelMessage({ message: t });
|
|
3728
3730
|
}
|
|
3729
|
-
),
|
|
3731
|
+
), bt = new Ir(), kn = {
|
|
3730
3732
|
/**
|
|
3731
3733
|
* Start the session
|
|
3732
3734
|
*/
|
|
3733
3735
|
startSession: async (t) => {
|
|
3734
|
-
await
|
|
3736
|
+
await Te;
|
|
3735
3737
|
try {
|
|
3736
|
-
|
|
3738
|
+
er(self.controller, "Controller not loaded");
|
|
3737
3739
|
const e = await self.controller.mountFilesystem({
|
|
3738
3740
|
code: t.code,
|
|
3739
3741
|
filename: `app-${t.appId}.py`
|
|
3740
3742
|
}), r = await self.controller.startSession({
|
|
3741
3743
|
...e,
|
|
3742
|
-
onMessage:
|
|
3744
|
+
onMessage: ar.push
|
|
3743
3745
|
});
|
|
3744
|
-
|
|
3746
|
+
bt.resolve(r), fe.send.initialized({});
|
|
3745
3747
|
} catch (e) {
|
|
3746
|
-
|
|
3747
|
-
error:
|
|
3748
|
+
fe.send.initializedError({
|
|
3749
|
+
error: Kt(e)
|
|
3748
3750
|
});
|
|
3749
3751
|
}
|
|
3750
3752
|
},
|
|
@@ -3752,7 +3754,7 @@ ${e}`;
|
|
|
3752
3754
|
* Load packages
|
|
3753
3755
|
*/
|
|
3754
3756
|
loadPackages: async (t) => {
|
|
3755
|
-
await
|
|
3757
|
+
await Te, t.includes("mo.sql") && (t = `import pandas
|
|
3756
3758
|
${t}`, t = `import duckdb
|
|
3757
3759
|
${t}`, t = `import sqlglot
|
|
3758
3760
|
${t}`, t.includes("polars") && (t = `import pyarrow
|
|
@@ -3765,8 +3767,8 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
3765
3767
|
* Call a function on the bridge
|
|
3766
3768
|
*/
|
|
3767
3769
|
bridge: async (t) => {
|
|
3768
|
-
await
|
|
3769
|
-
const { functionName: e, payload: r } = t, n = await
|
|
3770
|
+
await Te;
|
|
3771
|
+
const { functionName: e, payload: r } = t, n = await bt.promise, a = r == null ? null : typeof r == "string" ? r : JSON.stringify(r), s = a == null ? (
|
|
3770
3772
|
// @ts-expect-error ehh TypeScript
|
|
3771
3773
|
await n[e]()
|
|
3772
3774
|
) : (
|
|
@@ -3775,18 +3777,18 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
3775
3777
|
);
|
|
3776
3778
|
return typeof s == "string" ? JSON.parse(s) : s;
|
|
3777
3779
|
}
|
|
3778
|
-
},
|
|
3779
|
-
transport:
|
|
3780
|
-
transportId:
|
|
3780
|
+
}, fe = fr({
|
|
3781
|
+
transport: yr({
|
|
3782
|
+
transportId: gr
|
|
3781
3783
|
}),
|
|
3782
|
-
requestHandler:
|
|
3784
|
+
requestHandler: kn
|
|
3783
3785
|
});
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
await
|
|
3786
|
+
fe.send("ready", {});
|
|
3787
|
+
fe.addMessageListener("consumerReady", async () => {
|
|
3788
|
+
await Te, ar.start();
|
|
3787
3789
|
});
|
|
3788
|
-
function
|
|
3790
|
+
function wn() {
|
|
3789
3791
|
return self.name;
|
|
3790
3792
|
}
|
|
3791
3793
|
});
|
|
3792
|
-
export default
|
|
3794
|
+
export default bn();
|