@magiclabs.ai/magicbook-client 0.5.6 → 0.6.1
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/README.md +1 -1
- package/magicbook-client.js +808 -796
- package/magicbook-client.umd.cjs +4 -3
- package/models/design-request/index.d.ts +2 -2
- package/models/galleon.d.ts +15 -15
- package/package.json +1 -1
- package/utils/engine-api/books.d.ts +1 -1
- package/utils/engine-api/design-options.d.ts +2 -2
package/magicbook-client.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (t, e, s) => (
|
|
4
|
-
function
|
|
1
|
+
var bs = Object.defineProperty;
|
|
2
|
+
var ws = (t, e, s) => e in t ? bs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var b = (t, e, s) => (ws(t, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
+
function xs(t, e, s) {
|
|
5
5
|
const n = e.pop() || "", r = e.reduce(
|
|
6
|
-
(
|
|
6
|
+
(i, a) => i[a] = i[a] || {},
|
|
7
7
|
t
|
|
8
8
|
);
|
|
9
9
|
r[n] = s;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Rt(t, e) {
|
|
12
12
|
return Object.keys(e).map((s) => {
|
|
13
|
-
typeof t[s] == "object" && typeof e[s] == "object" ?
|
|
13
|
+
typeof t[s] == "object" && typeof e[s] == "object" ? Rt(t[s], e[s]) : t[s] = e[s];
|
|
14
14
|
}), t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function ks(t) {
|
|
17
17
|
return t.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function It(t) {
|
|
20
20
|
return Object.keys(t).map((e) => {
|
|
21
|
-
const s =
|
|
22
|
-
s.includes("_") && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] =
|
|
21
|
+
const s = ks(e);
|
|
22
|
+
s.includes("_") && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] = It(t[s]));
|
|
23
23
|
}), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ss(t) {
|
|
26
26
|
return t.replace(/([-_][a-z])/g, (e) => e.toUpperCase().replace("-", "").replace("_", ""));
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function jt(t) {
|
|
29
29
|
return Object.keys(t).map((e) => {
|
|
30
|
-
const s =
|
|
31
|
-
s !== e && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] =
|
|
30
|
+
const s = Ss(e);
|
|
31
|
+
s !== e && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] = jt(t[s]));
|
|
32
32
|
}), t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Zt(t, e) {
|
|
35
35
|
return function() {
|
|
36
36
|
return t.apply(e, arguments);
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
const { toString:
|
|
40
|
-
const s =
|
|
39
|
+
const { toString: Ts } = Object.prototype, { getPrototypeOf: lt } = Object, $e = ((t) => (e) => {
|
|
40
|
+
const s = Ts.call(e);
|
|
41
41
|
return t[s] || (t[s] = s.slice(8, -1).toLowerCase());
|
|
42
42
|
})(/* @__PURE__ */ Object.create(null)), $ = (t) => (t = t.toLowerCase(), (e) => $e(e) === t), Ve = (t) => (e) => typeof e === t, { isArray: le } = Array, ue = Ve("undefined");
|
|
43
|
-
function
|
|
43
|
+
function Es(t) {
|
|
44
44
|
return t !== null && !ue(t) && t.constructor !== null && !ue(t.constructor) && j(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
function
|
|
46
|
+
const Lt = $("ArrayBuffer");
|
|
47
|
+
function Os(t) {
|
|
48
48
|
let e;
|
|
49
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer &&
|
|
49
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Lt(t.buffer), e;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const Ns = Ve("string"), j = Ve("function"), Dt = Ve("number"), Fe = (t) => t !== null && typeof t == "object", Cs = (t) => t === !0 || t === !1, Oe = (t) => {
|
|
52
52
|
if ($e(t) !== "object")
|
|
53
53
|
return !1;
|
|
54
54
|
const e = lt(t);
|
|
55
55
|
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t);
|
|
56
|
-
},
|
|
56
|
+
}, As = $("Date"), Rs = $("File"), Is = $("Blob"), js = $("FileList"), Zs = (t) => Fe(t) && j(t.pipe), Ls = (t) => {
|
|
57
57
|
let e;
|
|
58
58
|
return t && (typeof FormData == "function" && t instanceof FormData || j(t.append) && ((e = $e(t)) === "formdata" || // detect form-data instance
|
|
59
59
|
e === "object" && j(t.toString) && t.toString() === "[object FormData]"));
|
|
60
|
-
},
|
|
60
|
+
}, Ds = $("URLSearchParams"), Ps = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
61
61
|
function xe(t, e, { allOwnKeys: s = !1 } = {}) {
|
|
62
62
|
if (t === null || typeof t > "u")
|
|
63
63
|
return;
|
|
@@ -66,13 +66,13 @@ function xe(t, e, { allOwnKeys: s = !1 } = {}) {
|
|
|
66
66
|
for (n = 0, r = t.length; n < r; n++)
|
|
67
67
|
e.call(null, t[n], n, t);
|
|
68
68
|
else {
|
|
69
|
-
const
|
|
69
|
+
const i = s ? Object.getOwnPropertyNames(t) : Object.keys(t), a = i.length;
|
|
70
70
|
let o;
|
|
71
|
-
for (n = 0; n <
|
|
72
|
-
o =
|
|
71
|
+
for (n = 0; n < a; n++)
|
|
72
|
+
o = i[n], e.call(null, t[o], o, t);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Pt(t, e) {
|
|
76
76
|
e = e.toLowerCase();
|
|
77
77
|
const s = Object.keys(t);
|
|
78
78
|
let n = s.length, r;
|
|
@@ -81,74 +81,74 @@ function Dt(t, e) {
|
|
|
81
81
|
return r;
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const Bt = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Mt = (t) => !ue(t) && t !== Bt;
|
|
85
85
|
function et() {
|
|
86
|
-
const { caseless: t } =
|
|
87
|
-
const
|
|
88
|
-
Oe(e[
|
|
86
|
+
const { caseless: t } = Mt(this) && this || {}, e = {}, s = (n, r) => {
|
|
87
|
+
const i = t && Pt(e, r) || r;
|
|
88
|
+
Oe(e[i]) && Oe(n) ? e[i] = et(e[i], n) : Oe(n) ? e[i] = et({}, n) : le(n) ? e[i] = n.slice() : e[i] = n;
|
|
89
89
|
};
|
|
90
90
|
for (let n = 0, r = arguments.length; n < r; n++)
|
|
91
91
|
arguments[n] && xe(arguments[n], s);
|
|
92
92
|
return e;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
s && j(r) ? t[
|
|
96
|
-
}, { allOwnKeys: n }), t),
|
|
94
|
+
const Bs = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, i) => {
|
|
95
|
+
s && j(r) ? t[i] = Zt(r, s) : t[i] = r;
|
|
96
|
+
}, { allOwnKeys: n }), t), Ms = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Us = (t, e, s, n) => {
|
|
97
97
|
t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
98
98
|
value: e.prototype
|
|
99
99
|
}), s && Object.assign(t.prototype, s);
|
|
100
|
-
},
|
|
101
|
-
let r,
|
|
100
|
+
}, zs = (t, e, s, n) => {
|
|
101
|
+
let r, i, a;
|
|
102
102
|
const o = {};
|
|
103
103
|
if (e = e || {}, t == null)
|
|
104
104
|
return e;
|
|
105
105
|
do {
|
|
106
|
-
for (r = Object.getOwnPropertyNames(t),
|
|
107
|
-
|
|
106
|
+
for (r = Object.getOwnPropertyNames(t), i = r.length; i-- > 0; )
|
|
107
|
+
a = r[i], (!n || n(a, t, e)) && !o[a] && (e[a] = t[a], o[a] = !0);
|
|
108
108
|
t = s !== !1 && lt(t);
|
|
109
109
|
} while (t && (!s || s(t, e)) && t !== Object.prototype);
|
|
110
110
|
return e;
|
|
111
|
-
},
|
|
111
|
+
}, $s = (t, e, s) => {
|
|
112
112
|
t = String(t), (s === void 0 || s > t.length) && (s = t.length), s -= e.length;
|
|
113
113
|
const n = t.indexOf(e, s);
|
|
114
114
|
return n !== -1 && n === s;
|
|
115
|
-
},
|
|
115
|
+
}, Vs = (t) => {
|
|
116
116
|
if (!t)
|
|
117
117
|
return null;
|
|
118
118
|
if (le(t))
|
|
119
119
|
return t;
|
|
120
120
|
let e = t.length;
|
|
121
|
-
if (!
|
|
121
|
+
if (!Dt(e))
|
|
122
122
|
return null;
|
|
123
123
|
const s = new Array(e);
|
|
124
124
|
for (; e-- > 0; )
|
|
125
125
|
s[e] = t[e];
|
|
126
126
|
return s;
|
|
127
|
-
},
|
|
127
|
+
}, Fs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && lt(Uint8Array)), Hs = (t, e) => {
|
|
128
128
|
const n = (t && t[Symbol.iterator]).call(t);
|
|
129
129
|
let r;
|
|
130
130
|
for (; (r = n.next()) && !r.done; ) {
|
|
131
|
-
const
|
|
132
|
-
e.call(t,
|
|
131
|
+
const i = r.value;
|
|
132
|
+
e.call(t, i[0], i[1]);
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, Js = (t, e) => {
|
|
135
135
|
let s;
|
|
136
136
|
const n = [];
|
|
137
137
|
for (; (s = t.exec(e)) !== null; )
|
|
138
138
|
n.push(s);
|
|
139
139
|
return n;
|
|
140
|
-
},
|
|
140
|
+
}, Ws = $("HTMLFormElement"), Ks = (t) => t.toLowerCase().replace(
|
|
141
141
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
142
142
|
function(s, n, r) {
|
|
143
143
|
return n.toUpperCase() + r;
|
|
144
144
|
}
|
|
145
|
-
),
|
|
145
|
+
), gt = (({ hasOwnProperty: t }) => (e, s) => t.call(e, s))(Object.prototype), qs = $("RegExp"), Ut = (t, e) => {
|
|
146
146
|
const s = Object.getOwnPropertyDescriptors(t), n = {};
|
|
147
|
-
xe(s, (r,
|
|
148
|
-
e(r,
|
|
147
|
+
xe(s, (r, i) => {
|
|
148
|
+
e(r, i, t) !== !1 && (n[i] = r);
|
|
149
149
|
}), Object.defineProperties(t, n);
|
|
150
|
-
},
|
|
151
|
-
|
|
150
|
+
}, Gs = (t) => {
|
|
151
|
+
Ut(t, (e, s) => {
|
|
152
152
|
if (j(t) && ["arguments", "caller", "callee"].indexOf(s) !== -1)
|
|
153
153
|
return !1;
|
|
154
154
|
const n = t[s];
|
|
@@ -162,98 +162,98 @@ const Ps = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, a) => {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
},
|
|
165
|
+
}, Xs = (t, e) => {
|
|
166
166
|
const s = {}, n = (r) => {
|
|
167
|
-
r.forEach((
|
|
168
|
-
s[
|
|
167
|
+
r.forEach((i) => {
|
|
168
|
+
s[i] = !0;
|
|
169
169
|
});
|
|
170
170
|
};
|
|
171
171
|
return le(t) ? n(t) : n(String(t).split(e)), s;
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
DIGIT:
|
|
172
|
+
}, Ys = () => {
|
|
173
|
+
}, Qs = (t, e) => (t = +t, Number.isFinite(t) ? t : e), qe = "abcdefghijklmnopqrstuvwxyz", vt = "0123456789", zt = {
|
|
174
|
+
DIGIT: vt,
|
|
175
175
|
ALPHA: qe,
|
|
176
|
-
ALPHA_DIGIT: qe + qe.toUpperCase() +
|
|
177
|
-
},
|
|
176
|
+
ALPHA_DIGIT: qe + qe.toUpperCase() + vt
|
|
177
|
+
}, en = (t = 16, e = zt.ALPHA_DIGIT) => {
|
|
178
178
|
let s = "";
|
|
179
179
|
const { length: n } = e;
|
|
180
180
|
for (; t--; )
|
|
181
181
|
s += e[Math.random() * n | 0];
|
|
182
182
|
return s;
|
|
183
183
|
};
|
|
184
|
-
function
|
|
184
|
+
function tn(t) {
|
|
185
185
|
return !!(t && j(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const sn = (t) => {
|
|
188
188
|
const e = new Array(10), s = (n, r) => {
|
|
189
189
|
if (Fe(n)) {
|
|
190
190
|
if (e.indexOf(n) >= 0)
|
|
191
191
|
return;
|
|
192
192
|
if (!("toJSON" in n)) {
|
|
193
193
|
e[r] = n;
|
|
194
|
-
const
|
|
195
|
-
return xe(n, (
|
|
196
|
-
const u = s(
|
|
197
|
-
!ue(u) && (
|
|
198
|
-
}), e[r] = void 0,
|
|
194
|
+
const i = le(n) ? [] : {};
|
|
195
|
+
return xe(n, (a, o) => {
|
|
196
|
+
const u = s(a, r + 1);
|
|
197
|
+
!ue(u) && (i[o] = u);
|
|
198
|
+
}), e[r] = void 0, i;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
return n;
|
|
202
202
|
};
|
|
203
203
|
return s(t, 0);
|
|
204
|
-
},
|
|
204
|
+
}, nn = $("AsyncFunction"), rn = (t) => t && (Fe(t) || j(t)) && j(t.then) && j(t.catch), c = {
|
|
205
205
|
isArray: le,
|
|
206
|
-
isArrayBuffer:
|
|
207
|
-
isBuffer:
|
|
208
|
-
isFormData:
|
|
209
|
-
isArrayBufferView:
|
|
210
|
-
isString:
|
|
211
|
-
isNumber:
|
|
212
|
-
isBoolean:
|
|
206
|
+
isArrayBuffer: Lt,
|
|
207
|
+
isBuffer: Es,
|
|
208
|
+
isFormData: Ls,
|
|
209
|
+
isArrayBufferView: Os,
|
|
210
|
+
isString: Ns,
|
|
211
|
+
isNumber: Dt,
|
|
212
|
+
isBoolean: Cs,
|
|
213
213
|
isObject: Fe,
|
|
214
214
|
isPlainObject: Oe,
|
|
215
215
|
isUndefined: ue,
|
|
216
|
-
isDate:
|
|
217
|
-
isFile:
|
|
218
|
-
isBlob:
|
|
219
|
-
isRegExp:
|
|
216
|
+
isDate: As,
|
|
217
|
+
isFile: Rs,
|
|
218
|
+
isBlob: Is,
|
|
219
|
+
isRegExp: qs,
|
|
220
220
|
isFunction: j,
|
|
221
|
-
isStream:
|
|
222
|
-
isURLSearchParams:
|
|
223
|
-
isTypedArray:
|
|
224
|
-
isFileList:
|
|
221
|
+
isStream: Zs,
|
|
222
|
+
isURLSearchParams: Ds,
|
|
223
|
+
isTypedArray: Fs,
|
|
224
|
+
isFileList: js,
|
|
225
225
|
forEach: xe,
|
|
226
226
|
merge: et,
|
|
227
|
-
extend:
|
|
228
|
-
trim:
|
|
229
|
-
stripBOM:
|
|
230
|
-
inherits:
|
|
231
|
-
toFlatObject:
|
|
227
|
+
extend: Bs,
|
|
228
|
+
trim: Ps,
|
|
229
|
+
stripBOM: Ms,
|
|
230
|
+
inherits: Us,
|
|
231
|
+
toFlatObject: zs,
|
|
232
232
|
kindOf: $e,
|
|
233
233
|
kindOfTest: $,
|
|
234
|
-
endsWith:
|
|
235
|
-
toArray:
|
|
236
|
-
forEachEntry:
|
|
237
|
-
matchAll:
|
|
238
|
-
isHTMLForm:
|
|
239
|
-
hasOwnProperty:
|
|
240
|
-
hasOwnProp:
|
|
234
|
+
endsWith: $s,
|
|
235
|
+
toArray: Vs,
|
|
236
|
+
forEachEntry: Hs,
|
|
237
|
+
matchAll: Js,
|
|
238
|
+
isHTMLForm: Ws,
|
|
239
|
+
hasOwnProperty: gt,
|
|
240
|
+
hasOwnProp: gt,
|
|
241
241
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
242
|
-
reduceDescriptors:
|
|
243
|
-
freezeMethods:
|
|
244
|
-
toObjectSet:
|
|
245
|
-
toCamelCase:
|
|
246
|
-
noop:
|
|
247
|
-
toFiniteNumber:
|
|
248
|
-
findKey:
|
|
249
|
-
global:
|
|
250
|
-
isContextDefined:
|
|
251
|
-
ALPHABET:
|
|
252
|
-
generateString:
|
|
253
|
-
isSpecCompliantForm:
|
|
254
|
-
toJSONObject:
|
|
255
|
-
isAsyncFn:
|
|
256
|
-
isThenable:
|
|
242
|
+
reduceDescriptors: Ut,
|
|
243
|
+
freezeMethods: Gs,
|
|
244
|
+
toObjectSet: Xs,
|
|
245
|
+
toCamelCase: Ks,
|
|
246
|
+
noop: Ys,
|
|
247
|
+
toFiniteNumber: Qs,
|
|
248
|
+
findKey: Pt,
|
|
249
|
+
global: Bt,
|
|
250
|
+
isContextDefined: Mt,
|
|
251
|
+
ALPHABET: zt,
|
|
252
|
+
generateString: en,
|
|
253
|
+
isSpecCompliantForm: tn,
|
|
254
|
+
toJSONObject: sn,
|
|
255
|
+
isAsyncFn: nn,
|
|
256
|
+
isThenable: rn
|
|
257
257
|
};
|
|
258
258
|
function T(t, e, s, n, r) {
|
|
259
259
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), s && (this.config = s), n && (this.request = n), r && (this.response = r);
|
|
@@ -279,7 +279,7 @@ c.inherits(T, Error, {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
|
-
const
|
|
282
|
+
const $t = T.prototype, Vt = {};
|
|
283
283
|
[
|
|
284
284
|
"ERR_BAD_OPTION_VALUE",
|
|
285
285
|
"ERR_BAD_OPTION",
|
|
@@ -295,32 +295,32 @@ const zt = T.prototype, $t = {};
|
|
|
295
295
|
"ERR_INVALID_URL"
|
|
296
296
|
// eslint-disable-next-line func-names
|
|
297
297
|
].forEach((t) => {
|
|
298
|
-
|
|
298
|
+
Vt[t] = { value: t };
|
|
299
299
|
});
|
|
300
|
-
Object.defineProperties(T,
|
|
301
|
-
Object.defineProperty(
|
|
302
|
-
T.from = (t, e, s, n, r,
|
|
303
|
-
const
|
|
304
|
-
return c.toFlatObject(t,
|
|
300
|
+
Object.defineProperties(T, Vt);
|
|
301
|
+
Object.defineProperty($t, "isAxiosError", { value: !0 });
|
|
302
|
+
T.from = (t, e, s, n, r, i) => {
|
|
303
|
+
const a = Object.create($t);
|
|
304
|
+
return c.toFlatObject(t, a, function(u) {
|
|
305
305
|
return u !== Error.prototype;
|
|
306
|
-
}, (o) => o !== "isAxiosError"), T.call(
|
|
306
|
+
}, (o) => o !== "isAxiosError"), T.call(a, t.message, e, s, n, r), a.cause = t, a.name = t.name, i && Object.assign(a, i), a;
|
|
307
307
|
};
|
|
308
|
-
const
|
|
308
|
+
const an = null;
|
|
309
309
|
function tt(t) {
|
|
310
310
|
return c.isPlainObject(t) || c.isArray(t);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Ft(t) {
|
|
313
313
|
return c.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
return t ? t.concat(e).map(function(r,
|
|
317
|
-
return r =
|
|
315
|
+
function _t(t, e, s) {
|
|
316
|
+
return t ? t.concat(e).map(function(r, i) {
|
|
317
|
+
return r = Ft(r), !s && i ? "[" + r + "]" : r;
|
|
318
318
|
}).join(s ? "." : "") : e;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function on(t) {
|
|
321
321
|
return c.isArray(t) && !t.some(tt);
|
|
322
322
|
}
|
|
323
|
-
const
|
|
323
|
+
const ln = c.toFlatObject(c, {}, null, function(e) {
|
|
324
324
|
return /^is[A-Z]/.test(e);
|
|
325
325
|
});
|
|
326
326
|
function He(t, e, s) {
|
|
@@ -333,7 +333,7 @@ function He(t, e, s) {
|
|
|
333
333
|
}, !1, function(S, V) {
|
|
334
334
|
return !c.isUndefined(V[S]);
|
|
335
335
|
});
|
|
336
|
-
const n = s.metaTokens, r = s.visitor || f,
|
|
336
|
+
const n = s.metaTokens, r = s.visitor || f, i = s.dots, a = s.indexes, u = (s.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(e);
|
|
337
337
|
if (!c.isFunction(r))
|
|
338
338
|
throw new TypeError("visitor must be a function");
|
|
339
339
|
function l(g) {
|
|
@@ -350,18 +350,18 @@ function He(t, e, s) {
|
|
|
350
350
|
if (g && !V && typeof g == "object") {
|
|
351
351
|
if (c.endsWith(S, "{}"))
|
|
352
352
|
S = n ? S : S.slice(0, -2), g = JSON.stringify(g);
|
|
353
|
-
else if (c.isArray(g) &&
|
|
354
|
-
return S =
|
|
353
|
+
else if (c.isArray(g) && on(g) || (c.isFileList(g) || c.endsWith(S, "[]")) && (Z = c.toArray(g)))
|
|
354
|
+
return S = Ft(S), Z.forEach(function(Ee, _s) {
|
|
355
355
|
!(c.isUndefined(Ee) || Ee === null) && e.append(
|
|
356
356
|
// eslint-disable-next-line no-nested-ternary
|
|
357
|
-
|
|
357
|
+
a === !0 ? _t([S], _s, i) : a === null ? S : S + "[]",
|
|
358
358
|
l(Ee)
|
|
359
359
|
);
|
|
360
360
|
}), !1;
|
|
361
361
|
}
|
|
362
|
-
return tt(g) ? !0 : (e.append(
|
|
362
|
+
return tt(g) ? !0 : (e.append(_t(V, S, i), l(g)), !1);
|
|
363
363
|
}
|
|
364
|
-
const _ = [], C = Object.assign(
|
|
364
|
+
const _ = [], C = Object.assign(ln, {
|
|
365
365
|
defaultVisitor: f,
|
|
366
366
|
convertValue: l,
|
|
367
367
|
isVisitable: tt
|
|
@@ -385,7 +385,7 @@ function He(t, e, s) {
|
|
|
385
385
|
throw new TypeError("data must be an object");
|
|
386
386
|
return O(t), e;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function bt(t) {
|
|
389
389
|
const e = {
|
|
390
390
|
"!": "%21",
|
|
391
391
|
"'": "%27",
|
|
@@ -402,33 +402,33 @@ function _t(t) {
|
|
|
402
402
|
function ct(t, e) {
|
|
403
403
|
this._pairs = [], t && He(t, this, e);
|
|
404
404
|
}
|
|
405
|
-
const
|
|
406
|
-
|
|
405
|
+
const Ht = ct.prototype;
|
|
406
|
+
Ht.append = function(e, s) {
|
|
407
407
|
this._pairs.push([e, s]);
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
Ht.toString = function(e) {
|
|
410
410
|
const s = e ? function(n) {
|
|
411
|
-
return e.call(this, n,
|
|
412
|
-
} :
|
|
411
|
+
return e.call(this, n, bt);
|
|
412
|
+
} : bt;
|
|
413
413
|
return this._pairs.map(function(r) {
|
|
414
414
|
return s(r[0]) + "=" + s(r[1]);
|
|
415
415
|
}, "").join("&");
|
|
416
416
|
};
|
|
417
|
-
function
|
|
417
|
+
function cn(t) {
|
|
418
418
|
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Jt(t, e, s) {
|
|
421
421
|
if (!e)
|
|
422
422
|
return t;
|
|
423
|
-
const n = s && s.encode ||
|
|
424
|
-
let
|
|
425
|
-
if (r ?
|
|
426
|
-
const
|
|
427
|
-
|
|
423
|
+
const n = s && s.encode || cn, r = s && s.serialize;
|
|
424
|
+
let i;
|
|
425
|
+
if (r ? i = r(e, s) : i = c.isURLSearchParams(e) ? e.toString() : new ct(e, s).toString(n), i) {
|
|
426
|
+
const a = t.indexOf("#");
|
|
427
|
+
a !== -1 && (t = t.slice(0, a)), t += (t.indexOf("?") === -1 ? "?" : "&") + i;
|
|
428
428
|
}
|
|
429
429
|
return t;
|
|
430
430
|
}
|
|
431
|
-
class
|
|
431
|
+
class un {
|
|
432
432
|
constructor() {
|
|
433
433
|
this.handlers = [];
|
|
434
434
|
}
|
|
@@ -482,62 +482,62 @@ class cn {
|
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
const
|
|
485
|
+
const wt = un, Wt = {
|
|
486
486
|
silentJSONParsing: !0,
|
|
487
487
|
forcedJSONParsing: !0,
|
|
488
488
|
clarifyTimeoutError: !1
|
|
489
|
-
},
|
|
489
|
+
}, dn = typeof URLSearchParams < "u" ? URLSearchParams : ct, fn = typeof FormData < "u" ? FormData : null, hn = typeof Blob < "u" ? Blob : null, pn = (() => {
|
|
490
490
|
let t;
|
|
491
491
|
return typeof navigator < "u" && ((t = navigator.product) === "ReactNative" || t === "NativeScript" || t === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
492
|
-
})(),
|
|
492
|
+
})(), mn = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
493
493
|
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), M = {
|
|
494
494
|
isBrowser: !0,
|
|
495
495
|
classes: {
|
|
496
|
-
URLSearchParams:
|
|
497
|
-
FormData:
|
|
498
|
-
Blob:
|
|
496
|
+
URLSearchParams: dn,
|
|
497
|
+
FormData: fn,
|
|
498
|
+
Blob: hn
|
|
499
499
|
},
|
|
500
|
-
isStandardBrowserEnv:
|
|
501
|
-
isStandardBrowserWebWorkerEnv:
|
|
500
|
+
isStandardBrowserEnv: pn,
|
|
501
|
+
isStandardBrowserWebWorkerEnv: mn,
|
|
502
502
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
503
503
|
};
|
|
504
|
-
function
|
|
504
|
+
function yn(t, e) {
|
|
505
505
|
return He(t, new M.classes.URLSearchParams(), Object.assign({
|
|
506
|
-
visitor: function(s, n, r,
|
|
507
|
-
return M.isNode && c.isBuffer(s) ? (this.append(n, s.toString("base64")), !1) :
|
|
506
|
+
visitor: function(s, n, r, i) {
|
|
507
|
+
return M.isNode && c.isBuffer(s) ? (this.append(n, s.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
508
508
|
}
|
|
509
509
|
}, e));
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function gn(t) {
|
|
512
512
|
return c.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function vn(t) {
|
|
515
515
|
const e = {}, s = Object.keys(t);
|
|
516
516
|
let n;
|
|
517
517
|
const r = s.length;
|
|
518
|
-
let
|
|
518
|
+
let i;
|
|
519
519
|
for (n = 0; n < r; n++)
|
|
520
|
-
|
|
520
|
+
i = s[n], e[i] = t[i];
|
|
521
521
|
return e;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
function e(s, n, r,
|
|
525
|
-
let
|
|
526
|
-
const o = Number.isFinite(+
|
|
527
|
-
return
|
|
523
|
+
function Kt(t) {
|
|
524
|
+
function e(s, n, r, i) {
|
|
525
|
+
let a = s[i++];
|
|
526
|
+
const o = Number.isFinite(+a), u = i >= s.length;
|
|
527
|
+
return a = !a && c.isArray(r) ? r.length : a, u ? (c.hasOwnProp(r, a) ? r[a] = [r[a], n] : r[a] = n, !o) : ((!r[a] || !c.isObject(r[a])) && (r[a] = []), e(s, n, r[a], i) && c.isArray(r[a]) && (r[a] = vn(r[a])), !o);
|
|
528
528
|
}
|
|
529
529
|
if (c.isFormData(t) && c.isFunction(t.entries)) {
|
|
530
530
|
const s = {};
|
|
531
531
|
return c.forEachEntry(t, (n, r) => {
|
|
532
|
-
e(
|
|
532
|
+
e(gn(n), r, s, 0);
|
|
533
533
|
}), s;
|
|
534
534
|
}
|
|
535
535
|
return null;
|
|
536
536
|
}
|
|
537
|
-
const
|
|
537
|
+
const _n = {
|
|
538
538
|
"Content-Type": void 0
|
|
539
539
|
};
|
|
540
|
-
function
|
|
540
|
+
function bn(t, e, s) {
|
|
541
541
|
if (c.isString(t))
|
|
542
542
|
try {
|
|
543
543
|
return (e || JSON.parse)(t), c.trim(t);
|
|
@@ -548,12 +548,12 @@ function _n(t, e, s) {
|
|
|
548
548
|
return (s || JSON.stringify)(t);
|
|
549
549
|
}
|
|
550
550
|
const Je = {
|
|
551
|
-
transitional:
|
|
551
|
+
transitional: Wt,
|
|
552
552
|
adapter: ["xhr", "http"],
|
|
553
553
|
transformRequest: [function(e, s) {
|
|
554
|
-
const n = s.getContentType() || "", r = n.indexOf("application/json") > -1,
|
|
555
|
-
if (
|
|
556
|
-
return r && r ? JSON.stringify(
|
|
554
|
+
const n = s.getContentType() || "", r = n.indexOf("application/json") > -1, i = c.isObject(e);
|
|
555
|
+
if (i && c.isHTMLForm(e) && (e = new FormData(e)), c.isFormData(e))
|
|
556
|
+
return r && r ? JSON.stringify(Kt(e)) : e;
|
|
557
557
|
if (c.isArrayBuffer(e) || c.isBuffer(e) || c.isStream(e) || c.isFile(e) || c.isBlob(e))
|
|
558
558
|
return e;
|
|
559
559
|
if (c.isArrayBufferView(e))
|
|
@@ -561,9 +561,9 @@ const Je = {
|
|
|
561
561
|
if (c.isURLSearchParams(e))
|
|
562
562
|
return s.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
563
563
|
let o;
|
|
564
|
-
if (
|
|
564
|
+
if (i) {
|
|
565
565
|
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
566
|
-
return
|
|
566
|
+
return yn(e, this.formSerializer).toString();
|
|
567
567
|
if ((o = c.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
568
568
|
const u = this.env && this.env.FormData;
|
|
569
569
|
return He(
|
|
@@ -573,16 +573,16 @@ const Je = {
|
|
|
573
573
|
);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
return
|
|
576
|
+
return i || r ? (s.setContentType("application/json", !1), bn(e)) : e;
|
|
577
577
|
}],
|
|
578
578
|
transformResponse: [function(e) {
|
|
579
579
|
const s = this.transitional || Je.transitional, n = s && s.forcedJSONParsing, r = this.responseType === "json";
|
|
580
580
|
if (e && c.isString(e) && (n && !this.responseType || r)) {
|
|
581
|
-
const
|
|
581
|
+
const a = !(s && s.silentJSONParsing) && r;
|
|
582
582
|
try {
|
|
583
583
|
return JSON.parse(e);
|
|
584
584
|
} catch (o) {
|
|
585
|
-
if (
|
|
585
|
+
if (a)
|
|
586
586
|
throw o.name === "SyntaxError" ? T.from(o, T.ERR_BAD_RESPONSE, this, null, this.response) : o;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
@@ -614,9 +614,9 @@ c.forEach(["delete", "get", "head"], function(e) {
|
|
|
614
614
|
Je.headers[e] = {};
|
|
615
615
|
});
|
|
616
616
|
c.forEach(["post", "put", "patch"], function(e) {
|
|
617
|
-
Je.headers[e] = c.merge(
|
|
617
|
+
Je.headers[e] = c.merge(_n);
|
|
618
618
|
});
|
|
619
|
-
const ut = Je,
|
|
619
|
+
const ut = Je, wn = c.toObjectSet([
|
|
620
620
|
"age",
|
|
621
621
|
"authorization",
|
|
622
622
|
"content-length",
|
|
@@ -634,28 +634,28 @@ const ut = Je, bn = c.toObjectSet([
|
|
|
634
634
|
"referer",
|
|
635
635
|
"retry-after",
|
|
636
636
|
"user-agent"
|
|
637
|
-
]),
|
|
637
|
+
]), xn = (t) => {
|
|
638
638
|
const e = {};
|
|
639
639
|
let s, n, r;
|
|
640
640
|
return t && t.split(`
|
|
641
|
-
`).forEach(function(
|
|
642
|
-
r =
|
|
641
|
+
`).forEach(function(a) {
|
|
642
|
+
r = a.indexOf(":"), s = a.substring(0, r).trim().toLowerCase(), n = a.substring(r + 1).trim(), !(!s || e[s] && wn[s]) && (s === "set-cookie" ? e[s] ? e[s].push(n) : e[s] = [n] : e[s] = e[s] ? e[s] + ", " + n : n);
|
|
643
643
|
}), e;
|
|
644
|
-
},
|
|
644
|
+
}, xt = Symbol("internals");
|
|
645
645
|
function ce(t) {
|
|
646
646
|
return t && String(t).trim().toLowerCase();
|
|
647
647
|
}
|
|
648
648
|
function Ne(t) {
|
|
649
649
|
return t === !1 || t == null ? t : c.isArray(t) ? t.map(Ne) : String(t);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function kn(t) {
|
|
652
652
|
const e = /* @__PURE__ */ Object.create(null), s = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
653
653
|
let n;
|
|
654
654
|
for (; n = s.exec(t); )
|
|
655
655
|
e[n[1]] = n[2];
|
|
656
656
|
return e;
|
|
657
657
|
}
|
|
658
|
-
const
|
|
658
|
+
const Sn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
659
659
|
function Ge(t, e, s, n, r) {
|
|
660
660
|
if (c.isFunction(n))
|
|
661
661
|
return n.call(this, e, s);
|
|
@@ -666,15 +666,15 @@ function Ge(t, e, s, n, r) {
|
|
|
666
666
|
return n.test(e);
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Tn(t) {
|
|
670
670
|
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, s, n) => s.toUpperCase() + n);
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function En(t, e) {
|
|
673
673
|
const s = c.toCamelCase(" " + e);
|
|
674
674
|
["get", "set", "has"].forEach((n) => {
|
|
675
675
|
Object.defineProperty(t, n + s, {
|
|
676
|
-
value: function(r,
|
|
677
|
-
return this[n].call(this, e, r,
|
|
676
|
+
value: function(r, i, a) {
|
|
677
|
+
return this[n].call(this, e, r, i, a);
|
|
678
678
|
},
|
|
679
679
|
configurable: !0
|
|
680
680
|
});
|
|
@@ -686,15 +686,15 @@ class We {
|
|
|
686
686
|
}
|
|
687
687
|
set(e, s, n) {
|
|
688
688
|
const r = this;
|
|
689
|
-
function
|
|
689
|
+
function i(o, u, l) {
|
|
690
690
|
const f = ce(u);
|
|
691
691
|
if (!f)
|
|
692
692
|
throw new Error("header name must be a non-empty string");
|
|
693
693
|
const _ = c.findKey(r, f);
|
|
694
694
|
(!_ || r[_] === void 0 || l === !0 || l === void 0 && r[_] !== !1) && (r[_ || u] = Ne(o));
|
|
695
695
|
}
|
|
696
|
-
const
|
|
697
|
-
return c.isPlainObject(e) || e instanceof this.constructor ?
|
|
696
|
+
const a = (o, u) => c.forEach(o, (l, f) => i(l, f, u));
|
|
697
|
+
return c.isPlainObject(e) || e instanceof this.constructor ? a(e, s) : c.isString(e) && (e = e.trim()) && !Sn(e) ? a(xn(e), s) : e != null && i(s, e, n), this;
|
|
698
698
|
}
|
|
699
699
|
get(e, s) {
|
|
700
700
|
if (e = ce(e), e) {
|
|
@@ -704,7 +704,7 @@ class We {
|
|
|
704
704
|
if (!s)
|
|
705
705
|
return r;
|
|
706
706
|
if (s === !0)
|
|
707
|
-
return
|
|
707
|
+
return kn(r);
|
|
708
708
|
if (c.isFunction(s))
|
|
709
709
|
return s.call(this, r, n);
|
|
710
710
|
if (c.isRegExp(s))
|
|
@@ -723,33 +723,33 @@ class We {
|
|
|
723
723
|
delete(e, s) {
|
|
724
724
|
const n = this;
|
|
725
725
|
let r = !1;
|
|
726
|
-
function a
|
|
727
|
-
if (
|
|
728
|
-
const o = c.findKey(n,
|
|
726
|
+
function i(a) {
|
|
727
|
+
if (a = ce(a), a) {
|
|
728
|
+
const o = c.findKey(n, a);
|
|
729
729
|
o && (!s || Ge(n, n[o], o, s)) && (delete n[o], r = !0);
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
|
-
return c.isArray(e) ? e.forEach(
|
|
732
|
+
return c.isArray(e) ? e.forEach(i) : i(e), r;
|
|
733
733
|
}
|
|
734
734
|
clear(e) {
|
|
735
735
|
const s = Object.keys(this);
|
|
736
736
|
let n = s.length, r = !1;
|
|
737
737
|
for (; n--; ) {
|
|
738
|
-
const
|
|
739
|
-
(!e || Ge(this, this[
|
|
738
|
+
const i = s[n];
|
|
739
|
+
(!e || Ge(this, this[i], i, e, !0)) && (delete this[i], r = !0);
|
|
740
740
|
}
|
|
741
741
|
return r;
|
|
742
742
|
}
|
|
743
743
|
normalize(e) {
|
|
744
744
|
const s = this, n = {};
|
|
745
|
-
return c.forEach(this, (r,
|
|
746
|
-
const
|
|
747
|
-
if (
|
|
748
|
-
s[
|
|
745
|
+
return c.forEach(this, (r, i) => {
|
|
746
|
+
const a = c.findKey(n, i);
|
|
747
|
+
if (a) {
|
|
748
|
+
s[a] = Ne(r), delete s[i];
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
const o = e ?
|
|
752
|
-
o !==
|
|
751
|
+
const o = e ? Tn(i) : String(i).trim();
|
|
752
|
+
o !== i && delete s[i], s[o] = Ne(r), n[o] = !0;
|
|
753
753
|
}), this;
|
|
754
754
|
}
|
|
755
755
|
concat(...e) {
|
|
@@ -779,14 +779,14 @@ class We {
|
|
|
779
779
|
return s.forEach((r) => n.set(r)), n;
|
|
780
780
|
}
|
|
781
781
|
static accessor(e) {
|
|
782
|
-
const n = (this[
|
|
782
|
+
const n = (this[xt] = this[xt] = {
|
|
783
783
|
accessors: {}
|
|
784
784
|
}).accessors, r = this.prototype;
|
|
785
|
-
function a
|
|
786
|
-
const o = ce(
|
|
787
|
-
n[o] || (
|
|
785
|
+
function i(a) {
|
|
786
|
+
const o = ce(a);
|
|
787
|
+
n[o] || (En(r, a), n[o] = !0);
|
|
788
788
|
}
|
|
789
|
-
return c.isArray(e) ? e.forEach(
|
|
789
|
+
return c.isArray(e) ? e.forEach(i) : i(e), this;
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
792
|
We.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
@@ -795,12 +795,12 @@ c.freezeMethods(We);
|
|
|
795
795
|
const F = We;
|
|
796
796
|
function Xe(t, e) {
|
|
797
797
|
const s = this || ut, n = e || s, r = F.from(n.headers);
|
|
798
|
-
let
|
|
798
|
+
let i = n.data;
|
|
799
799
|
return c.forEach(t, function(o) {
|
|
800
|
-
|
|
801
|
-
}), r.normalize(),
|
|
800
|
+
i = o.call(s, i, r.normalize(), e ? e.status : void 0);
|
|
801
|
+
}), r.normalize(), i;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function qt(t) {
|
|
804
804
|
return !!(t && t.__CANCEL__);
|
|
805
805
|
}
|
|
806
806
|
function ke(t, e, s) {
|
|
@@ -809,7 +809,7 @@ function ke(t, e, s) {
|
|
|
809
809
|
c.inherits(ke, T, {
|
|
810
810
|
__CANCEL__: !0
|
|
811
811
|
});
|
|
812
|
-
function
|
|
812
|
+
function On(t, e, s) {
|
|
813
813
|
const n = s.config.validateStatus;
|
|
814
814
|
!s.status || !n || n(s.status) ? t(s) : e(new T(
|
|
815
815
|
"Request failed with status code " + s.status,
|
|
@@ -819,13 +819,13 @@ function En(t, e, s) {
|
|
|
819
819
|
s
|
|
820
820
|
));
|
|
821
821
|
}
|
|
822
|
-
const
|
|
822
|
+
const Nn = M.isStandardBrowserEnv ? (
|
|
823
823
|
// Standard browser envs support document.cookie
|
|
824
824
|
function() {
|
|
825
825
|
return {
|
|
826
|
-
write: function(s, n, r,
|
|
826
|
+
write: function(s, n, r, i, a, o) {
|
|
827
827
|
const u = [];
|
|
828
|
-
u.push(s + "=" + encodeURIComponent(n)), c.isNumber(r) && u.push("expires=" + new Date(r).toGMTString()), c.isString(
|
|
828
|
+
u.push(s + "=" + encodeURIComponent(n)), c.isNumber(r) && u.push("expires=" + new Date(r).toGMTString()), c.isString(i) && u.push("path=" + i), c.isString(a) && u.push("domain=" + a), o === !0 && u.push("secure"), document.cookie = u.join("; ");
|
|
829
829
|
},
|
|
830
830
|
read: function(s) {
|
|
831
831
|
const n = document.cookie.match(new RegExp("(^|;\\s*)(" + s + ")=([^;]*)"));
|
|
@@ -850,24 +850,24 @@ const On = M.isStandardBrowserEnv ? (
|
|
|
850
850
|
};
|
|
851
851
|
}()
|
|
852
852
|
);
|
|
853
|
-
function
|
|
853
|
+
function Cn(t) {
|
|
854
854
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function An(t, e) {
|
|
857
857
|
return e ? t.replace(/\/+$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
return t && !
|
|
859
|
+
function Gt(t, e) {
|
|
860
|
+
return t && !Cn(e) ? An(t, e) : e;
|
|
861
861
|
}
|
|
862
|
-
const
|
|
862
|
+
const Rn = M.isStandardBrowserEnv ? (
|
|
863
863
|
// Standard browser envs have full support of the APIs needed to test
|
|
864
864
|
// whether the request URL is of the same origin as current location.
|
|
865
865
|
function() {
|
|
866
866
|
const e = /(msie|trident)/i.test(navigator.userAgent), s = document.createElement("a");
|
|
867
867
|
let n;
|
|
868
|
-
function r(
|
|
869
|
-
let
|
|
870
|
-
return e && (s.setAttribute("href",
|
|
868
|
+
function r(i) {
|
|
869
|
+
let a = i;
|
|
870
|
+
return e && (s.setAttribute("href", a), a = s.href), s.setAttribute("href", a), {
|
|
871
871
|
href: s.href,
|
|
872
872
|
protocol: s.protocol ? s.protocol.replace(/:$/, "") : "",
|
|
873
873
|
host: s.host,
|
|
@@ -878,8 +878,8 @@ const An = M.isStandardBrowserEnv ? (
|
|
|
878
878
|
pathname: s.pathname.charAt(0) === "/" ? s.pathname : "/" + s.pathname
|
|
879
879
|
};
|
|
880
880
|
}
|
|
881
|
-
return n = r(window.location.href), function(
|
|
882
|
-
const o = c.isString(
|
|
881
|
+
return n = r(window.location.href), function(a) {
|
|
882
|
+
const o = c.isString(a) ? r(a) : a;
|
|
883
883
|
return o.protocol === n.protocol && o.host === n.host;
|
|
884
884
|
};
|
|
885
885
|
}()
|
|
@@ -891,74 +891,74 @@ const An = M.isStandardBrowserEnv ? (
|
|
|
891
891
|
};
|
|
892
892
|
}()
|
|
893
893
|
);
|
|
894
|
-
function
|
|
894
|
+
function In(t) {
|
|
895
895
|
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
896
896
|
return e && e[1] || "";
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function jn(t, e) {
|
|
899
899
|
t = t || 10;
|
|
900
900
|
const s = new Array(t), n = new Array(t);
|
|
901
|
-
let r = 0,
|
|
901
|
+
let r = 0, i = 0, a;
|
|
902
902
|
return e = e !== void 0 ? e : 1e3, function(u) {
|
|
903
|
-
const l = Date.now(), f = n[
|
|
904
|
-
|
|
905
|
-
let _ =
|
|
903
|
+
const l = Date.now(), f = n[i];
|
|
904
|
+
a || (a = l), s[r] = u, n[r] = l;
|
|
905
|
+
let _ = i, C = 0;
|
|
906
906
|
for (; _ !== r; )
|
|
907
907
|
C += s[_++], _ = _ % t;
|
|
908
|
-
if (r = (r + 1) % t, r ===
|
|
908
|
+
if (r = (r + 1) % t, r === i && (i = (i + 1) % t), l - a < e)
|
|
909
909
|
return;
|
|
910
910
|
const O = f && l - f;
|
|
911
911
|
return O ? Math.round(C * 1e3 / O) : void 0;
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function kt(t, e) {
|
|
915
915
|
let s = 0;
|
|
916
|
-
const n =
|
|
916
|
+
const n = jn(50, 250);
|
|
917
917
|
return (r) => {
|
|
918
|
-
const
|
|
919
|
-
s =
|
|
918
|
+
const i = r.loaded, a = r.lengthComputable ? r.total : void 0, o = i - s, u = n(o), l = i <= a;
|
|
919
|
+
s = i;
|
|
920
920
|
const f = {
|
|
921
|
-
loaded:
|
|
922
|
-
total:
|
|
923
|
-
progress:
|
|
921
|
+
loaded: i,
|
|
922
|
+
total: a,
|
|
923
|
+
progress: a ? i / a : void 0,
|
|
924
924
|
bytes: o,
|
|
925
925
|
rate: u || void 0,
|
|
926
|
-
estimated: u &&
|
|
926
|
+
estimated: u && a && l ? (a - i) / u : void 0,
|
|
927
927
|
event: r
|
|
928
928
|
};
|
|
929
929
|
f[e ? "download" : "upload"] = !0, t(f);
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
|
-
const
|
|
932
|
+
const Zn = typeof XMLHttpRequest < "u", Ln = Zn && function(t) {
|
|
933
933
|
return new Promise(function(s, n) {
|
|
934
934
|
let r = t.data;
|
|
935
|
-
const
|
|
935
|
+
const i = F.from(t.headers).normalize(), a = t.responseType;
|
|
936
936
|
let o;
|
|
937
937
|
function u() {
|
|
938
938
|
t.cancelToken && t.cancelToken.unsubscribe(o), t.signal && t.signal.removeEventListener("abort", o);
|
|
939
939
|
}
|
|
940
|
-
c.isFormData(r) && (M.isStandardBrowserEnv || M.isStandardBrowserWebWorkerEnv ?
|
|
940
|
+
c.isFormData(r) && (M.isStandardBrowserEnv || M.isStandardBrowserWebWorkerEnv ? i.setContentType(!1) : i.setContentType("multipart/form-data;", !1));
|
|
941
941
|
let l = new XMLHttpRequest();
|
|
942
942
|
if (t.auth) {
|
|
943
943
|
const O = t.auth.username || "", g = t.auth.password ? unescape(encodeURIComponent(t.auth.password)) : "";
|
|
944
|
-
|
|
944
|
+
i.set("Authorization", "Basic " + btoa(O + ":" + g));
|
|
945
945
|
}
|
|
946
|
-
const f =
|
|
947
|
-
l.open(t.method.toUpperCase(),
|
|
946
|
+
const f = Gt(t.baseURL, t.url);
|
|
947
|
+
l.open(t.method.toUpperCase(), Jt(f, t.params, t.paramsSerializer), !0), l.timeout = t.timeout;
|
|
948
948
|
function _() {
|
|
949
949
|
if (!l)
|
|
950
950
|
return;
|
|
951
951
|
const O = F.from(
|
|
952
952
|
"getAllResponseHeaders" in l && l.getAllResponseHeaders()
|
|
953
953
|
), S = {
|
|
954
|
-
data: !
|
|
954
|
+
data: !a || a === "text" || a === "json" ? l.responseText : l.response,
|
|
955
955
|
status: l.status,
|
|
956
956
|
statusText: l.statusText,
|
|
957
957
|
headers: O,
|
|
958
958
|
config: t,
|
|
959
959
|
request: l
|
|
960
960
|
};
|
|
961
|
-
|
|
961
|
+
On(function(Z) {
|
|
962
962
|
s(Z), u();
|
|
963
963
|
}, function(Z) {
|
|
964
964
|
n(Z), u();
|
|
@@ -972,7 +972,7 @@ const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
|
972
972
|
n(new T("Network Error", T.ERR_NETWORK, t, l)), l = null;
|
|
973
973
|
}, l.ontimeout = function() {
|
|
974
974
|
let g = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
|
|
975
|
-
const S = t.transitional ||
|
|
975
|
+
const S = t.transitional || Wt;
|
|
976
976
|
t.timeoutErrorMessage && (g = t.timeoutErrorMessage), n(new T(
|
|
977
977
|
g,
|
|
978
978
|
S.clarifyTimeoutError ? T.ETIMEDOUT : T.ECONNABORTED,
|
|
@@ -980,15 +980,15 @@ const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
|
980
980
|
l
|
|
981
981
|
)), l = null;
|
|
982
982
|
}, M.isStandardBrowserEnv) {
|
|
983
|
-
const O = (t.withCredentials ||
|
|
984
|
-
O &&
|
|
983
|
+
const O = (t.withCredentials || Rn(f)) && t.xsrfCookieName && Nn.read(t.xsrfCookieName);
|
|
984
|
+
O && i.set(t.xsrfHeaderName, O);
|
|
985
985
|
}
|
|
986
|
-
r === void 0 &&
|
|
986
|
+
r === void 0 && i.setContentType(null), "setRequestHeader" in l && c.forEach(i.toJSON(), function(g, S) {
|
|
987
987
|
l.setRequestHeader(S, g);
|
|
988
|
-
}), c.isUndefined(t.withCredentials) || (l.withCredentials = !!t.withCredentials),
|
|
988
|
+
}), c.isUndefined(t.withCredentials) || (l.withCredentials = !!t.withCredentials), a && a !== "json" && (l.responseType = t.responseType), typeof t.onDownloadProgress == "function" && l.addEventListener("progress", kt(t.onDownloadProgress, !0)), typeof t.onUploadProgress == "function" && l.upload && l.upload.addEventListener("progress", kt(t.onUploadProgress)), (t.cancelToken || t.signal) && (o = (O) => {
|
|
989
989
|
l && (n(!O || O.type ? new ke(null, t, l) : O), l.abort(), l = null);
|
|
990
990
|
}, t.cancelToken && t.cancelToken.subscribe(o), t.signal && (t.signal.aborted ? o() : t.signal.addEventListener("abort", o)));
|
|
991
|
-
const C =
|
|
991
|
+
const C = In(f);
|
|
992
992
|
if (C && M.protocols.indexOf(C) === -1) {
|
|
993
993
|
n(new T("Unsupported protocol " + C + ":", T.ERR_BAD_REQUEST, t));
|
|
994
994
|
return;
|
|
@@ -996,8 +996,8 @@ const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
|
996
996
|
l.send(r || null);
|
|
997
997
|
});
|
|
998
998
|
}, Ce = {
|
|
999
|
-
http:
|
|
1000
|
-
xhr:
|
|
999
|
+
http: an,
|
|
1000
|
+
xhr: Ln
|
|
1001
1001
|
};
|
|
1002
1002
|
c.forEach(Ce, (t, e) => {
|
|
1003
1003
|
if (t) {
|
|
@@ -1008,7 +1008,7 @@ c.forEach(Ce, (t, e) => {
|
|
|
1008
1008
|
Object.defineProperty(t, "adapterName", { value: e });
|
|
1009
1009
|
}
|
|
1010
1010
|
});
|
|
1011
|
-
const
|
|
1011
|
+
const Dn = {
|
|
1012
1012
|
getAdapter: (t) => {
|
|
1013
1013
|
t = c.isArray(t) ? t : [t];
|
|
1014
1014
|
const { length: e } = t;
|
|
@@ -1032,26 +1032,26 @@ function Ye(t) {
|
|
|
1032
1032
|
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1033
1033
|
throw new ke(null, t);
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function St(t) {
|
|
1036
1036
|
return Ye(t), t.headers = F.from(t.headers), t.data = Xe.call(
|
|
1037
1037
|
t,
|
|
1038
1038
|
t.transformRequest
|
|
1039
|
-
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1039
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), Dn.getAdapter(t.adapter || ut.adapter)(t).then(function(n) {
|
|
1040
1040
|
return Ye(t), n.data = Xe.call(
|
|
1041
1041
|
t,
|
|
1042
1042
|
t.transformResponse,
|
|
1043
1043
|
n
|
|
1044
1044
|
), n.headers = F.from(n.headers), n;
|
|
1045
1045
|
}, function(n) {
|
|
1046
|
-
return
|
|
1046
|
+
return qt(n) || (Ye(t), n && n.response && (n.response.data = Xe.call(
|
|
1047
1047
|
t,
|
|
1048
1048
|
t.transformResponse,
|
|
1049
1049
|
n.response
|
|
1050
1050
|
), n.response.headers = F.from(n.response.headers))), Promise.reject(n);
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
|
-
const
|
|
1054
|
-
function
|
|
1053
|
+
const Tt = (t) => t instanceof F ? t.toJSON() : t;
|
|
1054
|
+
function ie(t, e) {
|
|
1055
1055
|
e = e || {};
|
|
1056
1056
|
const s = {};
|
|
1057
1057
|
function n(l, f, _) {
|
|
@@ -1064,11 +1064,11 @@ function ae(t, e) {
|
|
|
1064
1064
|
} else
|
|
1065
1065
|
return n(l, f, _);
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function i(l, f) {
|
|
1068
1068
|
if (!c.isUndefined(f))
|
|
1069
1069
|
return n(void 0, f);
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1071
|
+
function a(l, f) {
|
|
1072
1072
|
if (c.isUndefined(f)) {
|
|
1073
1073
|
if (!c.isUndefined(l))
|
|
1074
1074
|
return n(void 0, l);
|
|
@@ -1082,91 +1082,91 @@ function ae(t, e) {
|
|
|
1082
1082
|
return n(void 0, l);
|
|
1083
1083
|
}
|
|
1084
1084
|
const u = {
|
|
1085
|
-
url:
|
|
1086
|
-
method:
|
|
1087
|
-
data:
|
|
1088
|
-
baseURL:
|
|
1089
|
-
transformRequest:
|
|
1090
|
-
transformResponse:
|
|
1091
|
-
paramsSerializer:
|
|
1092
|
-
timeout:
|
|
1093
|
-
timeoutMessage:
|
|
1094
|
-
withCredentials:
|
|
1095
|
-
adapter:
|
|
1096
|
-
responseType:
|
|
1097
|
-
xsrfCookieName:
|
|
1098
|
-
xsrfHeaderName:
|
|
1099
|
-
onUploadProgress:
|
|
1100
|
-
onDownloadProgress:
|
|
1101
|
-
decompress:
|
|
1102
|
-
maxContentLength:
|
|
1103
|
-
maxBodyLength:
|
|
1104
|
-
beforeRedirect:
|
|
1105
|
-
transport:
|
|
1106
|
-
httpAgent:
|
|
1107
|
-
httpsAgent:
|
|
1108
|
-
cancelToken:
|
|
1109
|
-
socketPath:
|
|
1110
|
-
responseEncoding:
|
|
1085
|
+
url: i,
|
|
1086
|
+
method: i,
|
|
1087
|
+
data: i,
|
|
1088
|
+
baseURL: a,
|
|
1089
|
+
transformRequest: a,
|
|
1090
|
+
transformResponse: a,
|
|
1091
|
+
paramsSerializer: a,
|
|
1092
|
+
timeout: a,
|
|
1093
|
+
timeoutMessage: a,
|
|
1094
|
+
withCredentials: a,
|
|
1095
|
+
adapter: a,
|
|
1096
|
+
responseType: a,
|
|
1097
|
+
xsrfCookieName: a,
|
|
1098
|
+
xsrfHeaderName: a,
|
|
1099
|
+
onUploadProgress: a,
|
|
1100
|
+
onDownloadProgress: a,
|
|
1101
|
+
decompress: a,
|
|
1102
|
+
maxContentLength: a,
|
|
1103
|
+
maxBodyLength: a,
|
|
1104
|
+
beforeRedirect: a,
|
|
1105
|
+
transport: a,
|
|
1106
|
+
httpAgent: a,
|
|
1107
|
+
httpsAgent: a,
|
|
1108
|
+
cancelToken: a,
|
|
1109
|
+
socketPath: a,
|
|
1110
|
+
responseEncoding: a,
|
|
1111
1111
|
validateStatus: o,
|
|
1112
|
-
headers: (l, f) => r(
|
|
1112
|
+
headers: (l, f) => r(Tt(l), Tt(f), !0)
|
|
1113
1113
|
};
|
|
1114
1114
|
return c.forEach(Object.keys(Object.assign({}, t, e)), function(f) {
|
|
1115
1115
|
const _ = u[f] || r, C = _(t[f], e[f], f);
|
|
1116
1116
|
c.isUndefined(C) && _ !== o || (s[f] = C);
|
|
1117
1117
|
}), s;
|
|
1118
1118
|
}
|
|
1119
|
-
const
|
|
1119
|
+
const Xt = "1.4.0", dt = {};
|
|
1120
1120
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1121
1121
|
dt[t] = function(n) {
|
|
1122
1122
|
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1123
1123
|
};
|
|
1124
1124
|
});
|
|
1125
|
-
const
|
|
1125
|
+
const Et = {};
|
|
1126
1126
|
dt.transitional = function(e, s, n) {
|
|
1127
|
-
function r(
|
|
1128
|
-
return "[Axios v" +
|
|
1127
|
+
function r(i, a) {
|
|
1128
|
+
return "[Axios v" + Xt + "] Transitional option '" + i + "'" + a + (n ? ". " + n : "");
|
|
1129
1129
|
}
|
|
1130
|
-
return (
|
|
1130
|
+
return (i, a, o) => {
|
|
1131
1131
|
if (e === !1)
|
|
1132
1132
|
throw new T(
|
|
1133
|
-
r(
|
|
1133
|
+
r(a, " has been removed" + (s ? " in " + s : "")),
|
|
1134
1134
|
T.ERR_DEPRECATED
|
|
1135
1135
|
);
|
|
1136
|
-
return s && !
|
|
1136
|
+
return s && !Et[a] && (Et[a] = !0, console.warn(
|
|
1137
1137
|
r(
|
|
1138
|
-
|
|
1138
|
+
a,
|
|
1139
1139
|
" has been deprecated since v" + s + " and will be removed in the near future"
|
|
1140
1140
|
)
|
|
1141
|
-
)), e ? e(
|
|
1141
|
+
)), e ? e(i, a, o) : !0;
|
|
1142
1142
|
};
|
|
1143
1143
|
};
|
|
1144
|
-
function
|
|
1144
|
+
function Pn(t, e, s) {
|
|
1145
1145
|
if (typeof t != "object")
|
|
1146
1146
|
throw new T("options must be an object", T.ERR_BAD_OPTION_VALUE);
|
|
1147
1147
|
const n = Object.keys(t);
|
|
1148
1148
|
let r = n.length;
|
|
1149
1149
|
for (; r-- > 0; ) {
|
|
1150
|
-
const
|
|
1151
|
-
if (
|
|
1152
|
-
const o = t[
|
|
1150
|
+
const i = n[r], a = e[i];
|
|
1151
|
+
if (a) {
|
|
1152
|
+
const o = t[i], u = o === void 0 || a(o, i, t);
|
|
1153
1153
|
if (u !== !0)
|
|
1154
|
-
throw new T("option " +
|
|
1154
|
+
throw new T("option " + i + " must be " + u, T.ERR_BAD_OPTION_VALUE);
|
|
1155
1155
|
continue;
|
|
1156
1156
|
}
|
|
1157
1157
|
if (s !== !0)
|
|
1158
|
-
throw new T("Unknown option " +
|
|
1158
|
+
throw new T("Unknown option " + i, T.ERR_BAD_OPTION);
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
1161
|
const st = {
|
|
1162
|
-
assertOptions:
|
|
1162
|
+
assertOptions: Pn,
|
|
1163
1163
|
validators: dt
|
|
1164
1164
|
}, W = st.validators;
|
|
1165
1165
|
class Ie {
|
|
1166
1166
|
constructor(e) {
|
|
1167
1167
|
this.defaults = e, this.interceptors = {
|
|
1168
|
-
request: new
|
|
1169
|
-
response: new
|
|
1168
|
+
request: new wt(),
|
|
1169
|
+
response: new wt()
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
1172
|
/**
|
|
@@ -1178,8 +1178,8 @@ class Ie {
|
|
|
1178
1178
|
* @returns {Promise} The Promise to be fulfilled
|
|
1179
1179
|
*/
|
|
1180
1180
|
request(e, s) {
|
|
1181
|
-
typeof e == "string" ? (s = s || {}, s.url = e) : s = e || {}, s =
|
|
1182
|
-
const { transitional: n, paramsSerializer: r, headers:
|
|
1181
|
+
typeof e == "string" ? (s = s || {}, s.url = e) : s = e || {}, s = ie(this.defaults, s);
|
|
1182
|
+
const { transitional: n, paramsSerializer: r, headers: i } = s;
|
|
1183
1183
|
n !== void 0 && st.assertOptions(n, {
|
|
1184
1184
|
silentJSONParsing: W.transitional(W.boolean),
|
|
1185
1185
|
forcedJSONParsing: W.transitional(W.boolean),
|
|
@@ -1190,16 +1190,16 @@ class Ie {
|
|
|
1190
1190
|
encode: W.function,
|
|
1191
1191
|
serialize: W.function
|
|
1192
1192
|
}, !0)), s.method = (s.method || this.defaults.method || "get").toLowerCase();
|
|
1193
|
-
let
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
),
|
|
1193
|
+
let a;
|
|
1194
|
+
a = i && c.merge(
|
|
1195
|
+
i.common,
|
|
1196
|
+
i[s.method]
|
|
1197
|
+
), a && c.forEach(
|
|
1198
1198
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1199
1199
|
(g) => {
|
|
1200
|
-
delete
|
|
1200
|
+
delete i[g];
|
|
1201
1201
|
}
|
|
1202
|
-
), s.headers = F.concat(
|
|
1202
|
+
), s.headers = F.concat(a, i);
|
|
1203
1203
|
const o = [];
|
|
1204
1204
|
let u = !0;
|
|
1205
1205
|
this.interceptors.request.forEach(function(S) {
|
|
@@ -1211,7 +1211,7 @@ class Ie {
|
|
|
1211
1211
|
});
|
|
1212
1212
|
let f, _ = 0, C;
|
|
1213
1213
|
if (!u) {
|
|
1214
|
-
const g = [
|
|
1214
|
+
const g = [St.bind(this), void 0];
|
|
1215
1215
|
for (g.unshift.apply(g, o), g.push.apply(g, l), C = g.length, f = Promise.resolve(s); _ < C; )
|
|
1216
1216
|
f = f.then(g[_++], g[_++]);
|
|
1217
1217
|
return f;
|
|
@@ -1228,7 +1228,7 @@ class Ie {
|
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
1230
|
try {
|
|
1231
|
-
f =
|
|
1231
|
+
f = St.call(this, O);
|
|
1232
1232
|
} catch (g) {
|
|
1233
1233
|
return Promise.reject(g);
|
|
1234
1234
|
}
|
|
@@ -1237,14 +1237,14 @@ class Ie {
|
|
|
1237
1237
|
return f;
|
|
1238
1238
|
}
|
|
1239
1239
|
getUri(e) {
|
|
1240
|
-
e =
|
|
1241
|
-
const s =
|
|
1242
|
-
return
|
|
1240
|
+
e = ie(this.defaults, e);
|
|
1241
|
+
const s = Gt(e.baseURL, e.url);
|
|
1242
|
+
return Jt(s, e.params, e.paramsSerializer);
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
1245
|
c.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1246
1246
|
Ie.prototype[e] = function(s, n) {
|
|
1247
|
-
return this.request(
|
|
1247
|
+
return this.request(ie(n || {}, {
|
|
1248
1248
|
method: e,
|
|
1249
1249
|
url: s,
|
|
1250
1250
|
data: (n || {}).data
|
|
@@ -1253,14 +1253,14 @@ c.forEach(["delete", "get", "head", "options"], function(e) {
|
|
|
1253
1253
|
});
|
|
1254
1254
|
c.forEach(["post", "put", "patch"], function(e) {
|
|
1255
1255
|
function s(n) {
|
|
1256
|
-
return function(
|
|
1257
|
-
return this.request(
|
|
1256
|
+
return function(i, a, o) {
|
|
1257
|
+
return this.request(ie(o || {}, {
|
|
1258
1258
|
method: e,
|
|
1259
1259
|
headers: n ? {
|
|
1260
1260
|
"Content-Type": "multipart/form-data"
|
|
1261
1261
|
} : {},
|
|
1262
|
-
url:
|
|
1263
|
-
data:
|
|
1262
|
+
url: i,
|
|
1263
|
+
data: a
|
|
1264
1264
|
}));
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
@@ -1272,27 +1272,27 @@ class ft {
|
|
|
1272
1272
|
if (typeof e != "function")
|
|
1273
1273
|
throw new TypeError("executor must be a function.");
|
|
1274
1274
|
let s;
|
|
1275
|
-
this.promise = new Promise(function(
|
|
1276
|
-
s =
|
|
1275
|
+
this.promise = new Promise(function(i) {
|
|
1276
|
+
s = i;
|
|
1277
1277
|
});
|
|
1278
1278
|
const n = this;
|
|
1279
1279
|
this.promise.then((r) => {
|
|
1280
1280
|
if (!n._listeners)
|
|
1281
1281
|
return;
|
|
1282
|
-
let
|
|
1283
|
-
for (;
|
|
1284
|
-
n._listeners[
|
|
1282
|
+
let i = n._listeners.length;
|
|
1283
|
+
for (; i-- > 0; )
|
|
1284
|
+
n._listeners[i](r);
|
|
1285
1285
|
n._listeners = null;
|
|
1286
1286
|
}), this.promise.then = (r) => {
|
|
1287
|
-
let
|
|
1288
|
-
const
|
|
1289
|
-
n.subscribe(o),
|
|
1287
|
+
let i;
|
|
1288
|
+
const a = new Promise((o) => {
|
|
1289
|
+
n.subscribe(o), i = o;
|
|
1290
1290
|
}).then(r);
|
|
1291
|
-
return
|
|
1292
|
-
n.unsubscribe(
|
|
1293
|
-
},
|
|
1294
|
-
}, e(function(
|
|
1295
|
-
n.reason || (n.reason = new ke(
|
|
1291
|
+
return a.cancel = function() {
|
|
1292
|
+
n.unsubscribe(i);
|
|
1293
|
+
}, a;
|
|
1294
|
+
}, e(function(i, a, o) {
|
|
1295
|
+
n.reason || (n.reason = new ke(i, a, o), s(n.reason));
|
|
1296
1296
|
});
|
|
1297
1297
|
}
|
|
1298
1298
|
/**
|
|
@@ -1335,13 +1335,13 @@ class ft {
|
|
|
1335
1335
|
};
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
|
-
const
|
|
1339
|
-
function
|
|
1338
|
+
const Bn = ft;
|
|
1339
|
+
function Mn(t) {
|
|
1340
1340
|
return function(s) {
|
|
1341
1341
|
return t.apply(null, s);
|
|
1342
1342
|
};
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function Un(t) {
|
|
1345
1345
|
return c.isObject(t) && t.isAxiosError === !0;
|
|
1346
1346
|
}
|
|
1347
1347
|
const nt = {
|
|
@@ -1412,45 +1412,48 @@ const nt = {
|
|
|
1412
1412
|
Object.entries(nt).forEach(([t, e]) => {
|
|
1413
1413
|
nt[e] = t;
|
|
1414
1414
|
});
|
|
1415
|
-
const
|
|
1416
|
-
function
|
|
1417
|
-
const e = new Ae(t), s =
|
|
1415
|
+
const zn = nt;
|
|
1416
|
+
function Yt(t) {
|
|
1417
|
+
const e = new Ae(t), s = Zt(Ae.prototype.request, e);
|
|
1418
1418
|
return c.extend(s, Ae.prototype, e, { allOwnKeys: !0 }), c.extend(s, e, null, { allOwnKeys: !0 }), s.create = function(r) {
|
|
1419
|
-
return
|
|
1419
|
+
return Yt(ie(t, r));
|
|
1420
1420
|
}, s;
|
|
1421
1421
|
}
|
|
1422
|
-
const A =
|
|
1422
|
+
const A = Yt(ut);
|
|
1423
1423
|
A.Axios = Ae;
|
|
1424
1424
|
A.CanceledError = ke;
|
|
1425
|
-
A.CancelToken =
|
|
1426
|
-
A.isCancel =
|
|
1427
|
-
A.VERSION =
|
|
1425
|
+
A.CancelToken = Bn;
|
|
1426
|
+
A.isCancel = qt;
|
|
1427
|
+
A.VERSION = Xt;
|
|
1428
1428
|
A.toFormData = He;
|
|
1429
1429
|
A.AxiosError = T;
|
|
1430
1430
|
A.Cancel = A.CanceledError;
|
|
1431
1431
|
A.all = function(e) {
|
|
1432
1432
|
return Promise.all(e);
|
|
1433
1433
|
};
|
|
1434
|
-
A.spread =
|
|
1435
|
-
A.isAxiosError =
|
|
1436
|
-
A.mergeConfig =
|
|
1434
|
+
A.spread = Mn;
|
|
1435
|
+
A.isAxiosError = Un;
|
|
1436
|
+
A.mergeConfig = ie;
|
|
1437
1437
|
A.AxiosHeaders = F;
|
|
1438
|
-
A.formToJSON = (t) =>
|
|
1439
|
-
A.HttpStatusCode =
|
|
1438
|
+
A.formToJSON = (t) => Kt(c.isHTMLForm(t) ? new FormData(t) : t);
|
|
1439
|
+
A.HttpStatusCode = zn;
|
|
1440
1440
|
A.default = A;
|
|
1441
1441
|
const ht = A;
|
|
1442
1442
|
function pt({ apiKey: t, options: e }) {
|
|
1443
1443
|
let s = {};
|
|
1444
|
-
return t &&
|
|
1444
|
+
return t && xs(s, ["headers", "Authorization"], `API-Key ${t}`), e && (s = Rt(s, e)), s;
|
|
1445
1445
|
}
|
|
1446
|
-
|
|
1447
|
-
return
|
|
1446
|
+
function mt(t) {
|
|
1447
|
+
return t.replaceAll(" ", "").trim();
|
|
1448
1448
|
}
|
|
1449
|
-
async function Qt({ url: t, apiKey: e, options: s
|
|
1450
|
-
return await ht.
|
|
1449
|
+
async function Qt({ url: t, apiKey: e, options: s }) {
|
|
1450
|
+
return await ht.get(mt(t), pt({ apiKey: e, options: s }));
|
|
1451
1451
|
}
|
|
1452
|
-
async function
|
|
1453
|
-
return await ht.
|
|
1452
|
+
async function es({ url: t, apiKey: e, options: s, payload: n = {} }) {
|
|
1453
|
+
return await ht.post(mt(t), n, pt({ apiKey: e, options: s }));
|
|
1454
|
+
}
|
|
1455
|
+
async function $n({ url: t, apiKey: e, options: s, payload: n }) {
|
|
1456
|
+
return await ht.put(mt(t), n, pt({ apiKey: e, options: s }));
|
|
1454
1457
|
}
|
|
1455
1458
|
async function Se(t) {
|
|
1456
1459
|
try {
|
|
@@ -1459,10 +1462,10 @@ async function Se(t) {
|
|
|
1459
1462
|
return Promise.reject(e);
|
|
1460
1463
|
}
|
|
1461
1464
|
}
|
|
1462
|
-
async function
|
|
1465
|
+
async function Vn({ apiKey: t, apiHost: e }, s, n) {
|
|
1463
1466
|
return Se(async () => {
|
|
1464
|
-
const r = (await
|
|
1465
|
-
return
|
|
1467
|
+
const r = (await es({ url: `${e}/v1/images/book/${s}`, apiKey: t, payload: n })).data;
|
|
1468
|
+
return Vr.parse(r);
|
|
1466
1469
|
});
|
|
1467
1470
|
}
|
|
1468
1471
|
var E;
|
|
@@ -1475,31 +1478,31 @@ var E;
|
|
|
1475
1478
|
throw new Error();
|
|
1476
1479
|
}
|
|
1477
1480
|
t.assertNever = s, t.arrayToEnum = (r) => {
|
|
1478
|
-
const
|
|
1479
|
-
for (const
|
|
1480
|
-
a
|
|
1481
|
-
return
|
|
1481
|
+
const i = {};
|
|
1482
|
+
for (const a of r)
|
|
1483
|
+
i[a] = a;
|
|
1484
|
+
return i;
|
|
1482
1485
|
}, t.getValidEnumValues = (r) => {
|
|
1483
|
-
const
|
|
1484
|
-
for (const o of
|
|
1485
|
-
|
|
1486
|
-
return t.objectValues(
|
|
1487
|
-
}, t.objectValues = (r) => t.objectKeys(r).map(function(
|
|
1488
|
-
return r[
|
|
1486
|
+
const i = t.objectKeys(r).filter((o) => typeof r[r[o]] != "number"), a = {};
|
|
1487
|
+
for (const o of i)
|
|
1488
|
+
a[o] = r[o];
|
|
1489
|
+
return t.objectValues(a);
|
|
1490
|
+
}, t.objectValues = (r) => t.objectKeys(r).map(function(i) {
|
|
1491
|
+
return r[i];
|
|
1489
1492
|
}), t.objectKeys = typeof Object.keys == "function" ? (r) => Object.keys(r) : (r) => {
|
|
1490
|
-
const
|
|
1491
|
-
for (const
|
|
1492
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
1493
|
-
return
|
|
1494
|
-
}, t.find = (r,
|
|
1495
|
-
for (const
|
|
1496
|
-
if (a
|
|
1497
|
-
return
|
|
1493
|
+
const i = [];
|
|
1494
|
+
for (const a in r)
|
|
1495
|
+
Object.prototype.hasOwnProperty.call(r, a) && i.push(a);
|
|
1496
|
+
return i;
|
|
1497
|
+
}, t.find = (r, i) => {
|
|
1498
|
+
for (const a of r)
|
|
1499
|
+
if (i(a))
|
|
1500
|
+
return a;
|
|
1498
1501
|
}, t.isInteger = typeof Number.isInteger == "function" ? (r) => Number.isInteger(r) : (r) => typeof r == "number" && isFinite(r) && Math.floor(r) === r;
|
|
1499
|
-
function n(r,
|
|
1500
|
-
return r.map((
|
|
1502
|
+
function n(r, i = " | ") {
|
|
1503
|
+
return r.map((a) => typeof a == "string" ? `'${a}'` : a).join(i);
|
|
1501
1504
|
}
|
|
1502
|
-
t.joinValues = n, t.jsonStringifyReplacer = (r,
|
|
1505
|
+
t.joinValues = n, t.jsonStringifyReplacer = (r, i) => typeof i == "bigint" ? i.toString() : i;
|
|
1503
1506
|
})(E || (E = {}));
|
|
1504
1507
|
var rt;
|
|
1505
1508
|
(function(t) {
|
|
@@ -1568,7 +1571,7 @@ const p = E.arrayToEnum([
|
|
|
1568
1571
|
"invalid_intersection_types",
|
|
1569
1572
|
"not_multiple_of",
|
|
1570
1573
|
"not_finite"
|
|
1571
|
-
]),
|
|
1574
|
+
]), Fn = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
1572
1575
|
class D extends Error {
|
|
1573
1576
|
constructor(e) {
|
|
1574
1577
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
@@ -1583,23 +1586,23 @@ class D extends Error {
|
|
|
1583
1586
|
return this.issues;
|
|
1584
1587
|
}
|
|
1585
1588
|
format(e) {
|
|
1586
|
-
const s = e || function(
|
|
1587
|
-
return
|
|
1588
|
-
}, n = { _errors: [] }, r = (
|
|
1589
|
-
for (const
|
|
1590
|
-
if (
|
|
1591
|
-
|
|
1592
|
-
else if (
|
|
1593
|
-
r(
|
|
1594
|
-
else if (
|
|
1595
|
-
r(
|
|
1596
|
-
else if (
|
|
1597
|
-
n._errors.push(s(
|
|
1589
|
+
const s = e || function(i) {
|
|
1590
|
+
return i.message;
|
|
1591
|
+
}, n = { _errors: [] }, r = (i) => {
|
|
1592
|
+
for (const a of i.issues)
|
|
1593
|
+
if (a.code === "invalid_union")
|
|
1594
|
+
a.unionErrors.map(r);
|
|
1595
|
+
else if (a.code === "invalid_return_type")
|
|
1596
|
+
r(a.returnTypeError);
|
|
1597
|
+
else if (a.code === "invalid_arguments")
|
|
1598
|
+
r(a.argumentsError);
|
|
1599
|
+
else if (a.path.length === 0)
|
|
1600
|
+
n._errors.push(s(a));
|
|
1598
1601
|
else {
|
|
1599
1602
|
let o = n, u = 0;
|
|
1600
|
-
for (; u <
|
|
1601
|
-
const l =
|
|
1602
|
-
u ===
|
|
1603
|
+
for (; u < a.path.length; ) {
|
|
1604
|
+
const l = a.path[u];
|
|
1605
|
+
u === a.path.length - 1 ? (o[l] = o[l] || { _errors: [] }, o[l]._errors.push(s(a))) : o[l] = o[l] || { _errors: [] }, o = o[l], u++;
|
|
1603
1606
|
}
|
|
1604
1607
|
}
|
|
1605
1608
|
};
|
|
@@ -1681,28 +1684,28 @@ const de = (t, e) => {
|
|
|
1681
1684
|
}
|
|
1682
1685
|
return { message: s };
|
|
1683
1686
|
};
|
|
1684
|
-
let
|
|
1685
|
-
function
|
|
1686
|
-
|
|
1687
|
+
let ts = de;
|
|
1688
|
+
function Hn(t) {
|
|
1689
|
+
ts = t;
|
|
1687
1690
|
}
|
|
1688
1691
|
function je() {
|
|
1689
|
-
return
|
|
1692
|
+
return ts;
|
|
1690
1693
|
}
|
|
1691
1694
|
const Ze = (t) => {
|
|
1692
|
-
const { data: e, path: s, errorMaps: n, issueData: r } = t,
|
|
1695
|
+
const { data: e, path: s, errorMaps: n, issueData: r } = t, i = [...s, ...r.path || []], a = {
|
|
1693
1696
|
...r,
|
|
1694
|
-
path:
|
|
1697
|
+
path: i
|
|
1695
1698
|
};
|
|
1696
1699
|
let o = "";
|
|
1697
1700
|
const u = n.filter((l) => !!l).slice().reverse();
|
|
1698
1701
|
for (const l of u)
|
|
1699
|
-
o = l(
|
|
1702
|
+
o = l(a, { data: e, defaultError: o }).message;
|
|
1700
1703
|
return {
|
|
1701
1704
|
...r,
|
|
1702
|
-
path:
|
|
1705
|
+
path: i,
|
|
1703
1706
|
message: r.message || o
|
|
1704
1707
|
};
|
|
1705
|
-
},
|
|
1708
|
+
}, Jn = [];
|
|
1706
1709
|
function m(t, e) {
|
|
1707
1710
|
const s = Ze({
|
|
1708
1711
|
issueData: e,
|
|
@@ -1749,17 +1752,17 @@ class R {
|
|
|
1749
1752
|
static mergeObjectSync(e, s) {
|
|
1750
1753
|
const n = {};
|
|
1751
1754
|
for (const r of s) {
|
|
1752
|
-
const { key:
|
|
1753
|
-
if (
|
|
1755
|
+
const { key: i, value: a } = r;
|
|
1756
|
+
if (i.status === "aborted" || a.status === "aborted")
|
|
1754
1757
|
return w;
|
|
1755
|
-
|
|
1758
|
+
i.status === "dirty" && e.dirty(), a.status === "dirty" && e.dirty(), (typeof a.value < "u" || r.alwaysSet) && (n[i.value] = a.value);
|
|
1756
1759
|
}
|
|
1757
1760
|
return { status: e.value, value: n };
|
|
1758
1761
|
}
|
|
1759
1762
|
}
|
|
1760
1763
|
const w = Object.freeze({
|
|
1761
1764
|
status: "aborted"
|
|
1762
|
-
}),
|
|
1765
|
+
}), ss = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), it = (t) => t.status === "aborted", at = (t) => t.status === "dirty", Le = (t) => t.status === "valid", De = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
1763
1766
|
var y;
|
|
1764
1767
|
(function(t) {
|
|
1765
1768
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
@@ -1772,7 +1775,7 @@ class U {
|
|
|
1772
1775
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1773
1776
|
}
|
|
1774
1777
|
}
|
|
1775
|
-
const
|
|
1778
|
+
const Ot = (t, e) => {
|
|
1776
1779
|
if (Le(e))
|
|
1777
1780
|
return { success: !0, data: e.value };
|
|
1778
1781
|
if (!t.common.issues.length)
|
|
@@ -1793,7 +1796,7 @@ function x(t) {
|
|
|
1793
1796
|
const { errorMap: e, invalid_type_error: s, required_error: n, description: r } = t;
|
|
1794
1797
|
if (e && (s || n))
|
|
1795
1798
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
1796
|
-
return e ? { errorMap: e, description: r } : { errorMap: (
|
|
1799
|
+
return e ? { errorMap: e, description: r } : { errorMap: (a, o) => a.code !== "invalid_type" ? { message: o.defaultError } : typeof o.data > "u" ? { message: n ?? o.defaultError } : { message: s ?? o.defaultError }, description: r };
|
|
1797
1800
|
}
|
|
1798
1801
|
class k {
|
|
1799
1802
|
constructor(e) {
|
|
@@ -1857,8 +1860,8 @@ class k {
|
|
|
1857
1860
|
parent: null,
|
|
1858
1861
|
data: e,
|
|
1859
1862
|
parsedType: K(e)
|
|
1860
|
-
},
|
|
1861
|
-
return
|
|
1863
|
+
}, i = this._parseSync({ data: e, path: r.path, parent: r });
|
|
1864
|
+
return Ot(r, i);
|
|
1862
1865
|
}
|
|
1863
1866
|
async parseAsync(e, s) {
|
|
1864
1867
|
const n = await this.safeParseAsync(e, s);
|
|
@@ -1878,17 +1881,17 @@ class k {
|
|
|
1878
1881
|
parent: null,
|
|
1879
1882
|
data: e,
|
|
1880
1883
|
parsedType: K(e)
|
|
1881
|
-
}, r = this._parse({ data: e, path: n.path, parent: n }),
|
|
1882
|
-
return
|
|
1884
|
+
}, r = this._parse({ data: e, path: n.path, parent: n }), i = await (De(r) ? r : Promise.resolve(r));
|
|
1885
|
+
return Ot(n, i);
|
|
1883
1886
|
}
|
|
1884
1887
|
refine(e, s) {
|
|
1885
1888
|
const n = (r) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(r) : s;
|
|
1886
|
-
return this._refinement((r,
|
|
1887
|
-
const
|
|
1889
|
+
return this._refinement((r, i) => {
|
|
1890
|
+
const a = e(r), o = () => i.addIssue({
|
|
1888
1891
|
code: h.custom,
|
|
1889
1892
|
...n(r)
|
|
1890
1893
|
});
|
|
1891
|
-
return typeof Promise < "u" &&
|
|
1894
|
+
return typeof Promise < "u" && a instanceof Promise ? a.then((u) => u ? !0 : (o(), !1)) : a ? !0 : (o(), !1);
|
|
1892
1895
|
});
|
|
1893
1896
|
}
|
|
1894
1897
|
refinement(e, s) {
|
|
@@ -1943,7 +1946,7 @@ class k {
|
|
|
1943
1946
|
});
|
|
1944
1947
|
}
|
|
1945
1948
|
brand() {
|
|
1946
|
-
return new
|
|
1949
|
+
return new rs({
|
|
1947
1950
|
typeName: v.ZodBranded,
|
|
1948
1951
|
type: this,
|
|
1949
1952
|
...x(this._def)
|
|
@@ -1975,9 +1978,9 @@ class k {
|
|
|
1975
1978
|
return this.safeParse(null).success;
|
|
1976
1979
|
}
|
|
1977
1980
|
}
|
|
1978
|
-
const
|
|
1979
|
-
function
|
|
1980
|
-
return !!((e === "v4" || !e) &&
|
|
1981
|
+
const Wn = /^c[^\s-]{8,}$/i, Kn = /^[a-z][a-z0-9]*$/, qn = /[0-9A-HJKMNP-TV-Z]{26}/, Gn = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i, Xn = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/, Yn = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u, Qn = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/, er = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, tr = (t) => t.precision ? t.offset ? new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`) : new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`) : t.precision === 0 ? t.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$") : t.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");
|
|
1982
|
+
function sr(t, e) {
|
|
1983
|
+
return !!((e === "v4" || !e) && Qn.test(t) || (e === "v6" || !e) && er.test(t));
|
|
1981
1984
|
}
|
|
1982
1985
|
class L extends k {
|
|
1983
1986
|
constructor() {
|
|
@@ -1998,127 +2001,127 @@ class L extends k {
|
|
|
1998
2001
|
}
|
|
1999
2002
|
_parse(e) {
|
|
2000
2003
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
|
|
2001
|
-
const
|
|
2004
|
+
const i = this._getOrReturnCtx(e);
|
|
2002
2005
|
return m(
|
|
2003
|
-
|
|
2006
|
+
i,
|
|
2004
2007
|
{
|
|
2005
2008
|
code: h.invalid_type,
|
|
2006
2009
|
expected: p.string,
|
|
2007
|
-
received:
|
|
2010
|
+
received: i.parsedType
|
|
2008
2011
|
}
|
|
2009
2012
|
//
|
|
2010
2013
|
), w;
|
|
2011
2014
|
}
|
|
2012
2015
|
const n = new R();
|
|
2013
2016
|
let r;
|
|
2014
|
-
for (const
|
|
2015
|
-
if (
|
|
2016
|
-
e.data.length <
|
|
2017
|
+
for (const i of this._def.checks)
|
|
2018
|
+
if (i.kind === "min")
|
|
2019
|
+
e.data.length < i.value && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2017
2020
|
code: h.too_small,
|
|
2018
|
-
minimum:
|
|
2021
|
+
minimum: i.value,
|
|
2019
2022
|
type: "string",
|
|
2020
2023
|
inclusive: !0,
|
|
2021
2024
|
exact: !1,
|
|
2022
|
-
message:
|
|
2025
|
+
message: i.message
|
|
2023
2026
|
}), n.dirty());
|
|
2024
|
-
else if (
|
|
2025
|
-
e.data.length >
|
|
2027
|
+
else if (i.kind === "max")
|
|
2028
|
+
e.data.length > i.value && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2026
2029
|
code: h.too_big,
|
|
2027
|
-
maximum:
|
|
2030
|
+
maximum: i.value,
|
|
2028
2031
|
type: "string",
|
|
2029
2032
|
inclusive: !0,
|
|
2030
2033
|
exact: !1,
|
|
2031
|
-
message:
|
|
2034
|
+
message: i.message
|
|
2032
2035
|
}), n.dirty());
|
|
2033
|
-
else if (
|
|
2034
|
-
const
|
|
2035
|
-
(
|
|
2036
|
+
else if (i.kind === "length") {
|
|
2037
|
+
const a = e.data.length > i.value, o = e.data.length < i.value;
|
|
2038
|
+
(a || o) && (r = this._getOrReturnCtx(e, r), a ? m(r, {
|
|
2036
2039
|
code: h.too_big,
|
|
2037
|
-
maximum:
|
|
2040
|
+
maximum: i.value,
|
|
2038
2041
|
type: "string",
|
|
2039
2042
|
inclusive: !0,
|
|
2040
2043
|
exact: !0,
|
|
2041
|
-
message:
|
|
2044
|
+
message: i.message
|
|
2042
2045
|
}) : o && m(r, {
|
|
2043
2046
|
code: h.too_small,
|
|
2044
|
-
minimum:
|
|
2047
|
+
minimum: i.value,
|
|
2045
2048
|
type: "string",
|
|
2046
2049
|
inclusive: !0,
|
|
2047
2050
|
exact: !0,
|
|
2048
|
-
message:
|
|
2051
|
+
message: i.message
|
|
2049
2052
|
}), n.dirty());
|
|
2050
|
-
} else if (
|
|
2051
|
-
|
|
2053
|
+
} else if (i.kind === "email")
|
|
2054
|
+
Xn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2052
2055
|
validation: "email",
|
|
2053
2056
|
code: h.invalid_string,
|
|
2054
|
-
message:
|
|
2057
|
+
message: i.message
|
|
2055
2058
|
}), n.dirty());
|
|
2056
|
-
else if (
|
|
2057
|
-
|
|
2059
|
+
else if (i.kind === "emoji")
|
|
2060
|
+
Yn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2058
2061
|
validation: "emoji",
|
|
2059
2062
|
code: h.invalid_string,
|
|
2060
|
-
message:
|
|
2063
|
+
message: i.message
|
|
2061
2064
|
}), n.dirty());
|
|
2062
|
-
else if (
|
|
2063
|
-
|
|
2065
|
+
else if (i.kind === "uuid")
|
|
2066
|
+
Gn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2064
2067
|
validation: "uuid",
|
|
2065
2068
|
code: h.invalid_string,
|
|
2066
|
-
message:
|
|
2069
|
+
message: i.message
|
|
2067
2070
|
}), n.dirty());
|
|
2068
|
-
else if (
|
|
2069
|
-
|
|
2071
|
+
else if (i.kind === "cuid")
|
|
2072
|
+
Wn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2070
2073
|
validation: "cuid",
|
|
2071
2074
|
code: h.invalid_string,
|
|
2072
|
-
message:
|
|
2075
|
+
message: i.message
|
|
2073
2076
|
}), n.dirty());
|
|
2074
|
-
else if (
|
|
2075
|
-
|
|
2077
|
+
else if (i.kind === "cuid2")
|
|
2078
|
+
Kn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2076
2079
|
validation: "cuid2",
|
|
2077
2080
|
code: h.invalid_string,
|
|
2078
|
-
message:
|
|
2081
|
+
message: i.message
|
|
2079
2082
|
}), n.dirty());
|
|
2080
|
-
else if (
|
|
2081
|
-
|
|
2083
|
+
else if (i.kind === "ulid")
|
|
2084
|
+
qn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2082
2085
|
validation: "ulid",
|
|
2083
2086
|
code: h.invalid_string,
|
|
2084
|
-
message:
|
|
2087
|
+
message: i.message
|
|
2085
2088
|
}), n.dirty());
|
|
2086
|
-
else if (
|
|
2089
|
+
else if (i.kind === "url")
|
|
2087
2090
|
try {
|
|
2088
2091
|
new URL(e.data);
|
|
2089
2092
|
} catch {
|
|
2090
2093
|
r = this._getOrReturnCtx(e, r), m(r, {
|
|
2091
2094
|
validation: "url",
|
|
2092
2095
|
code: h.invalid_string,
|
|
2093
|
-
message:
|
|
2096
|
+
message: i.message
|
|
2094
2097
|
}), n.dirty();
|
|
2095
2098
|
}
|
|
2096
2099
|
else
|
|
2097
|
-
|
|
2100
|
+
i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2098
2101
|
validation: "regex",
|
|
2099
2102
|
code: h.invalid_string,
|
|
2100
|
-
message:
|
|
2101
|
-
}), n.dirty())) :
|
|
2103
|
+
message: i.message
|
|
2104
|
+
}), n.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2102
2105
|
code: h.invalid_string,
|
|
2103
|
-
validation: { includes:
|
|
2104
|
-
message:
|
|
2105
|
-
}), n.dirty()) :
|
|
2106
|
+
validation: { includes: i.value, position: i.position },
|
|
2107
|
+
message: i.message
|
|
2108
|
+
}), n.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2106
2109
|
code: h.invalid_string,
|
|
2107
|
-
validation: { startsWith:
|
|
2108
|
-
message:
|
|
2109
|
-
}), n.dirty()) :
|
|
2110
|
+
validation: { startsWith: i.value },
|
|
2111
|
+
message: i.message
|
|
2112
|
+
}), n.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2110
2113
|
code: h.invalid_string,
|
|
2111
|
-
validation: { endsWith:
|
|
2112
|
-
message:
|
|
2113
|
-
}), n.dirty()) :
|
|
2114
|
+
validation: { endsWith: i.value },
|
|
2115
|
+
message: i.message
|
|
2116
|
+
}), n.dirty()) : i.kind === "datetime" ? tr(i).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2114
2117
|
code: h.invalid_string,
|
|
2115
2118
|
validation: "datetime",
|
|
2116
|
-
message:
|
|
2117
|
-
}), n.dirty()) :
|
|
2119
|
+
message: i.message
|
|
2120
|
+
}), n.dirty()) : i.kind === "ip" ? sr(e.data, i.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2118
2121
|
validation: "ip",
|
|
2119
2122
|
code: h.invalid_string,
|
|
2120
|
-
message:
|
|
2121
|
-
}), n.dirty()) : E.assertNever(
|
|
2123
|
+
message: i.message
|
|
2124
|
+
}), n.dirty()) : E.assertNever(i);
|
|
2122
2125
|
return { status: n.value, value: e.data };
|
|
2123
2126
|
}
|
|
2124
2127
|
_addCheck(e) {
|
|
@@ -2264,9 +2267,9 @@ L.create = (t) => {
|
|
|
2264
2267
|
...x(t)
|
|
2265
2268
|
});
|
|
2266
2269
|
};
|
|
2267
|
-
function
|
|
2268
|
-
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n,
|
|
2269
|
-
return
|
|
2270
|
+
function nr(t, e) {
|
|
2271
|
+
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n, i = parseInt(t.toFixed(r).replace(".", "")), a = parseInt(e.toFixed(r).replace(".", ""));
|
|
2272
|
+
return i % a / Math.pow(10, r);
|
|
2270
2273
|
}
|
|
2271
2274
|
class q extends k {
|
|
2272
2275
|
constructor() {
|
|
@@ -2274,43 +2277,43 @@ class q extends k {
|
|
|
2274
2277
|
}
|
|
2275
2278
|
_parse(e) {
|
|
2276
2279
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== p.number) {
|
|
2277
|
-
const
|
|
2278
|
-
return m(
|
|
2280
|
+
const i = this._getOrReturnCtx(e);
|
|
2281
|
+
return m(i, {
|
|
2279
2282
|
code: h.invalid_type,
|
|
2280
2283
|
expected: p.number,
|
|
2281
|
-
received:
|
|
2284
|
+
received: i.parsedType
|
|
2282
2285
|
}), w;
|
|
2283
2286
|
}
|
|
2284
2287
|
let n;
|
|
2285
2288
|
const r = new R();
|
|
2286
|
-
for (const
|
|
2287
|
-
|
|
2289
|
+
for (const i of this._def.checks)
|
|
2290
|
+
i.kind === "int" ? E.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2288
2291
|
code: h.invalid_type,
|
|
2289
2292
|
expected: "integer",
|
|
2290
2293
|
received: "float",
|
|
2291
|
-
message:
|
|
2292
|
-
}), r.dirty()) :
|
|
2294
|
+
message: i.message
|
|
2295
|
+
}), r.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2293
2296
|
code: h.too_small,
|
|
2294
|
-
minimum:
|
|
2297
|
+
minimum: i.value,
|
|
2295
2298
|
type: "number",
|
|
2296
|
-
inclusive:
|
|
2299
|
+
inclusive: i.inclusive,
|
|
2297
2300
|
exact: !1,
|
|
2298
|
-
message:
|
|
2299
|
-
}), r.dirty()) :
|
|
2301
|
+
message: i.message
|
|
2302
|
+
}), r.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2300
2303
|
code: h.too_big,
|
|
2301
|
-
maximum:
|
|
2304
|
+
maximum: i.value,
|
|
2302
2305
|
type: "number",
|
|
2303
|
-
inclusive:
|
|
2306
|
+
inclusive: i.inclusive,
|
|
2304
2307
|
exact: !1,
|
|
2305
|
-
message:
|
|
2306
|
-
}), r.dirty()) :
|
|
2308
|
+
message: i.message
|
|
2309
|
+
}), r.dirty()) : i.kind === "multipleOf" ? nr(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2307
2310
|
code: h.not_multiple_of,
|
|
2308
|
-
multipleOf:
|
|
2309
|
-
message:
|
|
2310
|
-
}), r.dirty()) :
|
|
2311
|
+
multipleOf: i.value,
|
|
2312
|
+
message: i.message
|
|
2313
|
+
}), r.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2311
2314
|
code: h.not_finite,
|
|
2312
|
-
message:
|
|
2313
|
-
}), r.dirty()) : E.assertNever(
|
|
2315
|
+
message: i.message
|
|
2316
|
+
}), r.dirty()) : E.assertNever(i);
|
|
2314
2317
|
return { status: r.value, value: e.data };
|
|
2315
2318
|
}
|
|
2316
2319
|
gte(e, s) {
|
|
@@ -2446,33 +2449,33 @@ class G extends k {
|
|
|
2446
2449
|
}
|
|
2447
2450
|
_parse(e) {
|
|
2448
2451
|
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== p.bigint) {
|
|
2449
|
-
const
|
|
2450
|
-
return m(
|
|
2452
|
+
const i = this._getOrReturnCtx(e);
|
|
2453
|
+
return m(i, {
|
|
2451
2454
|
code: h.invalid_type,
|
|
2452
2455
|
expected: p.bigint,
|
|
2453
|
-
received:
|
|
2456
|
+
received: i.parsedType
|
|
2454
2457
|
}), w;
|
|
2455
2458
|
}
|
|
2456
2459
|
let n;
|
|
2457
2460
|
const r = new R();
|
|
2458
|
-
for (const
|
|
2459
|
-
|
|
2461
|
+
for (const i of this._def.checks)
|
|
2462
|
+
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2460
2463
|
code: h.too_small,
|
|
2461
2464
|
type: "bigint",
|
|
2462
|
-
minimum:
|
|
2463
|
-
inclusive:
|
|
2464
|
-
message:
|
|
2465
|
-
}), r.dirty()) :
|
|
2465
|
+
minimum: i.value,
|
|
2466
|
+
inclusive: i.inclusive,
|
|
2467
|
+
message: i.message
|
|
2468
|
+
}), r.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2466
2469
|
code: h.too_big,
|
|
2467
2470
|
type: "bigint",
|
|
2468
|
-
maximum:
|
|
2469
|
-
inclusive:
|
|
2470
|
-
message:
|
|
2471
|
-
}), r.dirty()) :
|
|
2471
|
+
maximum: i.value,
|
|
2472
|
+
inclusive: i.inclusive,
|
|
2473
|
+
message: i.message
|
|
2474
|
+
}), r.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2472
2475
|
code: h.not_multiple_of,
|
|
2473
|
-
multipleOf:
|
|
2474
|
-
message:
|
|
2475
|
-
}), r.dirty()) : E.assertNever(
|
|
2476
|
+
multipleOf: i.value,
|
|
2477
|
+
message: i.message
|
|
2478
|
+
}), r.dirty()) : E.assertNever(i);
|
|
2476
2479
|
return { status: r.value, value: e.data };
|
|
2477
2480
|
}
|
|
2478
2481
|
gte(e, s) {
|
|
@@ -2589,37 +2592,37 @@ fe.create = (t) => new fe({
|
|
|
2589
2592
|
class Q extends k {
|
|
2590
2593
|
_parse(e) {
|
|
2591
2594
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
|
|
2592
|
-
const
|
|
2593
|
-
return m(
|
|
2595
|
+
const i = this._getOrReturnCtx(e);
|
|
2596
|
+
return m(i, {
|
|
2594
2597
|
code: h.invalid_type,
|
|
2595
2598
|
expected: p.date,
|
|
2596
|
-
received:
|
|
2599
|
+
received: i.parsedType
|
|
2597
2600
|
}), w;
|
|
2598
2601
|
}
|
|
2599
2602
|
if (isNaN(e.data.getTime())) {
|
|
2600
|
-
const
|
|
2601
|
-
return m(
|
|
2603
|
+
const i = this._getOrReturnCtx(e);
|
|
2604
|
+
return m(i, {
|
|
2602
2605
|
code: h.invalid_date
|
|
2603
2606
|
}), w;
|
|
2604
2607
|
}
|
|
2605
2608
|
const n = new R();
|
|
2606
2609
|
let r;
|
|
2607
|
-
for (const
|
|
2608
|
-
|
|
2610
|
+
for (const i of this._def.checks)
|
|
2611
|
+
i.kind === "min" ? e.data.getTime() < i.value && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2609
2612
|
code: h.too_small,
|
|
2610
|
-
message:
|
|
2613
|
+
message: i.message,
|
|
2611
2614
|
inclusive: !0,
|
|
2612
2615
|
exact: !1,
|
|
2613
|
-
minimum:
|
|
2616
|
+
minimum: i.value,
|
|
2614
2617
|
type: "date"
|
|
2615
|
-
}), n.dirty()) :
|
|
2618
|
+
}), n.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2616
2619
|
code: h.too_big,
|
|
2617
|
-
message:
|
|
2620
|
+
message: i.message,
|
|
2618
2621
|
inclusive: !0,
|
|
2619
2622
|
exact: !1,
|
|
2620
|
-
maximum:
|
|
2623
|
+
maximum: i.value,
|
|
2621
2624
|
type: "date"
|
|
2622
|
-
}), n.dirty()) : E.assertNever(
|
|
2625
|
+
}), n.dirty()) : E.assertNever(i);
|
|
2623
2626
|
return {
|
|
2624
2627
|
status: n.value,
|
|
2625
2628
|
value: new Date(e.data.getTime())
|
|
@@ -2715,7 +2718,7 @@ pe.create = (t) => new pe({
|
|
|
2715
2718
|
typeName: v.ZodNull,
|
|
2716
2719
|
...x(t)
|
|
2717
2720
|
});
|
|
2718
|
-
class
|
|
2721
|
+
class ae extends k {
|
|
2719
2722
|
constructor() {
|
|
2720
2723
|
super(...arguments), this._any = !0;
|
|
2721
2724
|
}
|
|
@@ -2723,7 +2726,7 @@ class ie extends k {
|
|
|
2723
2726
|
return I(e.data);
|
|
2724
2727
|
}
|
|
2725
2728
|
}
|
|
2726
|
-
|
|
2729
|
+
ae.create = (t) => new ae({
|
|
2727
2730
|
typeName: v.ZodAny,
|
|
2728
2731
|
...x(t)
|
|
2729
2732
|
});
|
|
@@ -2780,11 +2783,11 @@ class P extends k {
|
|
|
2780
2783
|
received: s.parsedType
|
|
2781
2784
|
}), w;
|
|
2782
2785
|
if (r.exactLength !== null) {
|
|
2783
|
-
const
|
|
2784
|
-
(
|
|
2785
|
-
code:
|
|
2786
|
+
const a = s.data.length > r.exactLength.value, o = s.data.length < r.exactLength.value;
|
|
2787
|
+
(a || o) && (m(s, {
|
|
2788
|
+
code: a ? h.too_big : h.too_small,
|
|
2786
2789
|
minimum: o ? r.exactLength.value : void 0,
|
|
2787
|
-
maximum:
|
|
2790
|
+
maximum: a ? r.exactLength.value : void 0,
|
|
2788
2791
|
type: "array",
|
|
2789
2792
|
inclusive: !0,
|
|
2790
2793
|
exact: !0,
|
|
@@ -2806,9 +2809,9 @@ class P extends k {
|
|
|
2806
2809
|
exact: !1,
|
|
2807
2810
|
message: r.maxLength.message
|
|
2808
2811
|
}), n.dirty()), s.common.async)
|
|
2809
|
-
return Promise.all([...s.data].map((
|
|
2810
|
-
const
|
|
2811
|
-
return R.mergeArray(n,
|
|
2812
|
+
return Promise.all([...s.data].map((a, o) => r.type._parseAsync(new U(s, a, s.path, o)))).then((a) => R.mergeArray(n, a));
|
|
2813
|
+
const i = [...s.data].map((a, o) => r.type._parseSync(new U(s, a, s.path, o)));
|
|
2814
|
+
return R.mergeArray(n, i);
|
|
2812
2815
|
}
|
|
2813
2816
|
get element() {
|
|
2814
2817
|
return this._def.type;
|
|
@@ -2879,13 +2882,13 @@ class N extends k {
|
|
|
2879
2882
|
received: l.parsedType
|
|
2880
2883
|
}), w;
|
|
2881
2884
|
}
|
|
2882
|
-
const { status: n, ctx: r } = this._processInputParams(e), { shape:
|
|
2885
|
+
const { status: n, ctx: r } = this._processInputParams(e), { shape: i, keys: a } = this._getCached(), o = [];
|
|
2883
2886
|
if (!(this._def.catchall instanceof J && this._def.unknownKeys === "strip"))
|
|
2884
2887
|
for (const l in r.data)
|
|
2885
|
-
|
|
2888
|
+
a.includes(l) || o.push(l);
|
|
2886
2889
|
const u = [];
|
|
2887
|
-
for (const l of
|
|
2888
|
-
const f =
|
|
2890
|
+
for (const l of a) {
|
|
2891
|
+
const f = i[l], _ = r.data[l];
|
|
2889
2892
|
u.push({
|
|
2890
2893
|
key: { status: "valid", value: l },
|
|
2891
2894
|
value: f._parse(new U(r, _, r.path, l)),
|
|
@@ -2943,8 +2946,8 @@ class N extends k {
|
|
|
2943
2946
|
unknownKeys: "strict",
|
|
2944
2947
|
...e !== void 0 ? {
|
|
2945
2948
|
errorMap: (s, n) => {
|
|
2946
|
-
var r,
|
|
2947
|
-
const u = (
|
|
2949
|
+
var r, i, a, o;
|
|
2950
|
+
const u = (a = (i = (r = this._def).errorMap) === null || i === void 0 ? void 0 : i.call(r, s, n).message) !== null && a !== void 0 ? a : n.defaultError;
|
|
2948
2951
|
return s.code === "unrecognized_keys" ? {
|
|
2949
2952
|
message: (o = y.errToObj(e).message) !== null && o !== void 0 ? o : u
|
|
2950
2953
|
} : {
|
|
@@ -3113,10 +3116,10 @@ class N extends k {
|
|
|
3113
3116
|
if (e && !e[n])
|
|
3114
3117
|
s[n] = this.shape[n];
|
|
3115
3118
|
else {
|
|
3116
|
-
let
|
|
3117
|
-
for (;
|
|
3118
|
-
|
|
3119
|
-
s[n] =
|
|
3119
|
+
let i = this.shape[n];
|
|
3120
|
+
for (; i instanceof H; )
|
|
3121
|
+
i = i._def.innerType;
|
|
3122
|
+
s[n] = i;
|
|
3120
3123
|
}
|
|
3121
3124
|
}), new N({
|
|
3122
3125
|
...this._def,
|
|
@@ -3124,7 +3127,7 @@ class N extends k {
|
|
|
3124
3127
|
});
|
|
3125
3128
|
}
|
|
3126
3129
|
keyof() {
|
|
3127
|
-
return
|
|
3130
|
+
return ns(E.objectKeys(this.shape));
|
|
3128
3131
|
}
|
|
3129
3132
|
}
|
|
3130
3133
|
N.create = (t, e) => new N({
|
|
@@ -3151,22 +3154,22 @@ N.lazycreate = (t, e) => new N({
|
|
|
3151
3154
|
class me extends k {
|
|
3152
3155
|
_parse(e) {
|
|
3153
3156
|
const { ctx: s } = this._processInputParams(e), n = this._def.options;
|
|
3154
|
-
function r(
|
|
3155
|
-
for (const o of
|
|
3157
|
+
function r(i) {
|
|
3158
|
+
for (const o of i)
|
|
3156
3159
|
if (o.result.status === "valid")
|
|
3157
3160
|
return o.result;
|
|
3158
|
-
for (const o of
|
|
3161
|
+
for (const o of i)
|
|
3159
3162
|
if (o.result.status === "dirty")
|
|
3160
3163
|
return s.common.issues.push(...o.ctx.common.issues), o.result;
|
|
3161
|
-
const
|
|
3164
|
+
const a = i.map((o) => new D(o.ctx.common.issues));
|
|
3162
3165
|
return m(s, {
|
|
3163
3166
|
code: h.invalid_union,
|
|
3164
|
-
unionErrors:
|
|
3167
|
+
unionErrors: a
|
|
3165
3168
|
}), w;
|
|
3166
3169
|
}
|
|
3167
3170
|
if (s.common.async)
|
|
3168
|
-
return Promise.all(n.map(async (
|
|
3169
|
-
const
|
|
3171
|
+
return Promise.all(n.map(async (i) => {
|
|
3172
|
+
const a = {
|
|
3170
3173
|
...s,
|
|
3171
3174
|
common: {
|
|
3172
3175
|
...s.common,
|
|
@@ -3175,17 +3178,17 @@ class me extends k {
|
|
|
3175
3178
|
parent: null
|
|
3176
3179
|
};
|
|
3177
3180
|
return {
|
|
3178
|
-
result: await
|
|
3181
|
+
result: await i._parseAsync({
|
|
3179
3182
|
data: s.data,
|
|
3180
3183
|
path: s.path,
|
|
3181
|
-
parent:
|
|
3184
|
+
parent: a
|
|
3182
3185
|
}),
|
|
3183
|
-
ctx:
|
|
3186
|
+
ctx: a
|
|
3184
3187
|
};
|
|
3185
3188
|
})).then(r);
|
|
3186
3189
|
{
|
|
3187
|
-
let
|
|
3188
|
-
const
|
|
3190
|
+
let i;
|
|
3191
|
+
const a = [];
|
|
3189
3192
|
for (const u of n) {
|
|
3190
3193
|
const l = {
|
|
3191
3194
|
...s,
|
|
@@ -3201,11 +3204,11 @@ class me extends k {
|
|
|
3201
3204
|
});
|
|
3202
3205
|
if (f.status === "valid")
|
|
3203
3206
|
return f;
|
|
3204
|
-
f.status === "dirty" && !
|
|
3207
|
+
f.status === "dirty" && !i && (i = { result: f, ctx: l }), l.common.issues.length && a.push(l.common.issues);
|
|
3205
3208
|
}
|
|
3206
|
-
if (
|
|
3207
|
-
return s.common.issues.push(...
|
|
3208
|
-
const o =
|
|
3209
|
+
if (i)
|
|
3210
|
+
return s.common.issues.push(...i.ctx.common.issues), i.result;
|
|
3211
|
+
const o = a.map((u) => new D(u));
|
|
3209
3212
|
return m(s, {
|
|
3210
3213
|
code: h.invalid_union,
|
|
3211
3214
|
unionErrors: o
|
|
@@ -3231,12 +3234,12 @@ class Ke extends k {
|
|
|
3231
3234
|
expected: p.object,
|
|
3232
3235
|
received: s.parsedType
|
|
3233
3236
|
}), w;
|
|
3234
|
-
const n = this.discriminator, r = s.data[n],
|
|
3235
|
-
return
|
|
3237
|
+
const n = this.discriminator, r = s.data[n], i = this.optionsMap.get(r);
|
|
3238
|
+
return i ? s.common.async ? i._parseAsync({
|
|
3236
3239
|
data: s.data,
|
|
3237
3240
|
path: s.path,
|
|
3238
3241
|
parent: s
|
|
3239
|
-
}) :
|
|
3242
|
+
}) : i._parseSync({
|
|
3240
3243
|
data: s.data,
|
|
3241
3244
|
path: s.path,
|
|
3242
3245
|
parent: s
|
|
@@ -3265,14 +3268,14 @@ class Ke extends k {
|
|
|
3265
3268
|
*/
|
|
3266
3269
|
static create(e, s, n) {
|
|
3267
3270
|
const r = /* @__PURE__ */ new Map();
|
|
3268
|
-
for (const
|
|
3269
|
-
const
|
|
3270
|
-
if (!
|
|
3271
|
+
for (const i of s) {
|
|
3272
|
+
const a = Re(i.shape[e]);
|
|
3273
|
+
if (!a)
|
|
3271
3274
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
3272
|
-
for (const o of
|
|
3275
|
+
for (const o of a) {
|
|
3273
3276
|
if (r.has(o))
|
|
3274
3277
|
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
3275
|
-
r.set(o,
|
|
3278
|
+
r.set(o, i);
|
|
3276
3279
|
}
|
|
3277
3280
|
}
|
|
3278
3281
|
return new Ke({
|
|
@@ -3289,20 +3292,20 @@ function ot(t, e) {
|
|
|
3289
3292
|
if (t === e)
|
|
3290
3293
|
return { valid: !0, data: t };
|
|
3291
3294
|
if (s === p.object && n === p.object) {
|
|
3292
|
-
const r = E.objectKeys(e),
|
|
3293
|
-
for (const o of
|
|
3295
|
+
const r = E.objectKeys(e), i = E.objectKeys(t).filter((o) => r.indexOf(o) !== -1), a = { ...t, ...e };
|
|
3296
|
+
for (const o of i) {
|
|
3294
3297
|
const u = ot(t[o], e[o]);
|
|
3295
3298
|
if (!u.valid)
|
|
3296
3299
|
return { valid: !1 };
|
|
3297
|
-
|
|
3300
|
+
a[o] = u.data;
|
|
3298
3301
|
}
|
|
3299
|
-
return { valid: !0, data:
|
|
3302
|
+
return { valid: !0, data: a };
|
|
3300
3303
|
} else if (s === p.array && n === p.array) {
|
|
3301
3304
|
if (t.length !== e.length)
|
|
3302
3305
|
return { valid: !1 };
|
|
3303
3306
|
const r = [];
|
|
3304
|
-
for (let
|
|
3305
|
-
const
|
|
3307
|
+
for (let i = 0; i < t.length; i++) {
|
|
3308
|
+
const a = t[i], o = e[i], u = ot(a, o);
|
|
3306
3309
|
if (!u.valid)
|
|
3307
3310
|
return { valid: !1 };
|
|
3308
3311
|
r.push(u.data);
|
|
@@ -3313,11 +3316,11 @@ function ot(t, e) {
|
|
|
3313
3316
|
}
|
|
3314
3317
|
class ye extends k {
|
|
3315
3318
|
_parse(e) {
|
|
3316
|
-
const { status: s, ctx: n } = this._processInputParams(e), r = (
|
|
3317
|
-
if (
|
|
3319
|
+
const { status: s, ctx: n } = this._processInputParams(e), r = (i, a) => {
|
|
3320
|
+
if (it(i) || it(a))
|
|
3318
3321
|
return w;
|
|
3319
|
-
const o = ot(
|
|
3320
|
-
return o.valid ? ((
|
|
3322
|
+
const o = ot(i.value, a.value);
|
|
3323
|
+
return o.valid ? ((at(i) || at(a)) && s.dirty(), { status: s.value, value: o.data }) : (m(n, {
|
|
3321
3324
|
code: h.invalid_intersection_types
|
|
3322
3325
|
}), w);
|
|
3323
3326
|
};
|
|
@@ -3332,7 +3335,7 @@ class ye extends k {
|
|
|
3332
3335
|
path: n.path,
|
|
3333
3336
|
parent: n
|
|
3334
3337
|
})
|
|
3335
|
-
]).then(([
|
|
3338
|
+
]).then(([i, a]) => r(i, a)) : r(this._def.left._parseSync({
|
|
3336
3339
|
data: n.data,
|
|
3337
3340
|
path: n.path,
|
|
3338
3341
|
parent: n
|
|
@@ -3373,11 +3376,11 @@ class z extends k {
|
|
|
3373
3376
|
exact: !1,
|
|
3374
3377
|
type: "array"
|
|
3375
3378
|
}), s.dirty());
|
|
3376
|
-
const
|
|
3379
|
+
const i = [...n.data].map((a, o) => {
|
|
3377
3380
|
const u = this._def.items[o] || this._def.rest;
|
|
3378
|
-
return u ? u._parse(new U(n,
|
|
3379
|
-
}).filter((
|
|
3380
|
-
return n.common.async ? Promise.all(
|
|
3381
|
+
return u ? u._parse(new U(n, a, n.path, o)) : null;
|
|
3382
|
+
}).filter((a) => !!a);
|
|
3383
|
+
return n.common.async ? Promise.all(i).then((a) => R.mergeArray(s, a)) : R.mergeArray(s, i);
|
|
3381
3384
|
}
|
|
3382
3385
|
get items() {
|
|
3383
3386
|
return this._def.items;
|
|
@@ -3414,11 +3417,11 @@ class ge extends k {
|
|
|
3414
3417
|
expected: p.object,
|
|
3415
3418
|
received: n.parsedType
|
|
3416
3419
|
}), w;
|
|
3417
|
-
const r = [],
|
|
3420
|
+
const r = [], i = this._def.keyType, a = this._def.valueType;
|
|
3418
3421
|
for (const o in n.data)
|
|
3419
3422
|
r.push({
|
|
3420
|
-
key:
|
|
3421
|
-
value:
|
|
3423
|
+
key: i._parse(new U(n, o, n.path, o)),
|
|
3424
|
+
value: a._parse(new U(n, n.data[o], n.path, o))
|
|
3422
3425
|
});
|
|
3423
3426
|
return n.common.async ? R.mergeObjectAsync(s, r) : R.mergeObjectSync(s, r);
|
|
3424
3427
|
}
|
|
@@ -3448,14 +3451,14 @@ class Me extends k {
|
|
|
3448
3451
|
expected: p.map,
|
|
3449
3452
|
received: n.parsedType
|
|
3450
3453
|
}), w;
|
|
3451
|
-
const r = this._def.keyType,
|
|
3454
|
+
const r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([o, u], l) => ({
|
|
3452
3455
|
key: r._parse(new U(n, o, n.path, [l, "key"])),
|
|
3453
|
-
value:
|
|
3456
|
+
value: i._parse(new U(n, u, n.path, [l, "value"]))
|
|
3454
3457
|
}));
|
|
3455
3458
|
if (n.common.async) {
|
|
3456
3459
|
const o = /* @__PURE__ */ new Map();
|
|
3457
3460
|
return Promise.resolve().then(async () => {
|
|
3458
|
-
for (const u of
|
|
3461
|
+
for (const u of a) {
|
|
3459
3462
|
const l = await u.key, f = await u.value;
|
|
3460
3463
|
if (l.status === "aborted" || f.status === "aborted")
|
|
3461
3464
|
return w;
|
|
@@ -3465,7 +3468,7 @@ class Me extends k {
|
|
|
3465
3468
|
});
|
|
3466
3469
|
} else {
|
|
3467
3470
|
const o = /* @__PURE__ */ new Map();
|
|
3468
|
-
for (const u of
|
|
3471
|
+
for (const u of a) {
|
|
3469
3472
|
const l = u.key, f = u.value;
|
|
3470
3473
|
if (l.status === "aborted" || f.status === "aborted")
|
|
3471
3474
|
return w;
|
|
@@ -3506,8 +3509,8 @@ class ee extends k {
|
|
|
3506
3509
|
exact: !1,
|
|
3507
3510
|
message: r.maxSize.message
|
|
3508
3511
|
}), s.dirty());
|
|
3509
|
-
const
|
|
3510
|
-
function
|
|
3512
|
+
const i = this._def.valueType;
|
|
3513
|
+
function a(u) {
|
|
3511
3514
|
const l = /* @__PURE__ */ new Set();
|
|
3512
3515
|
for (const f of u) {
|
|
3513
3516
|
if (f.status === "aborted")
|
|
@@ -3516,8 +3519,8 @@ class ee extends k {
|
|
|
3516
3519
|
}
|
|
3517
3520
|
return { status: s.value, value: l };
|
|
3518
3521
|
}
|
|
3519
|
-
const o = [...n.data.values()].map((u, l) =>
|
|
3520
|
-
return n.common.async ? Promise.all(o).then((u) =>
|
|
3522
|
+
const o = [...n.data.values()].map((u, l) => i._parse(new U(n, u, n.path, l)));
|
|
3523
|
+
return n.common.async ? Promise.all(o).then((u) => a(u)) : a(o);
|
|
3521
3524
|
}
|
|
3522
3525
|
min(e, s) {
|
|
3523
3526
|
return new ee({
|
|
@@ -3589,19 +3592,19 @@ class re extends k {
|
|
|
3589
3592
|
}
|
|
3590
3593
|
});
|
|
3591
3594
|
}
|
|
3592
|
-
const
|
|
3595
|
+
const i = { errorMap: s.common.contextualErrorMap }, a = s.data;
|
|
3593
3596
|
return this._def.returns instanceof oe ? I(async (...o) => {
|
|
3594
|
-
const u = new D([]), l = await this._def.args.parseAsync(o,
|
|
3597
|
+
const u = new D([]), l = await this._def.args.parseAsync(o, i).catch((C) => {
|
|
3595
3598
|
throw u.addIssue(n(o, C)), u;
|
|
3596
|
-
}), f = await
|
|
3597
|
-
return await this._def.returns._def.type.parseAsync(f,
|
|
3599
|
+
}), f = await a(...l);
|
|
3600
|
+
return await this._def.returns._def.type.parseAsync(f, i).catch((C) => {
|
|
3598
3601
|
throw u.addIssue(r(f, C)), u;
|
|
3599
3602
|
});
|
|
3600
3603
|
}) : I((...o) => {
|
|
3601
|
-
const u = this._def.args.safeParse(o,
|
|
3604
|
+
const u = this._def.args.safeParse(o, i);
|
|
3602
3605
|
if (!u.success)
|
|
3603
3606
|
throw new D([n(o, u.error)]);
|
|
3604
|
-
const l =
|
|
3607
|
+
const l = a(...u.data), f = this._def.returns.safeParse(l, i);
|
|
3605
3608
|
if (!f.success)
|
|
3606
3609
|
throw new D([r(l, f.error)]);
|
|
3607
3610
|
return f.data;
|
|
@@ -3675,7 +3678,7 @@ _e.create = (t, e) => new _e({
|
|
|
3675
3678
|
typeName: v.ZodLiteral,
|
|
3676
3679
|
...x(e)
|
|
3677
3680
|
});
|
|
3678
|
-
function
|
|
3681
|
+
function ns(t, e) {
|
|
3679
3682
|
return new X({
|
|
3680
3683
|
values: t,
|
|
3681
3684
|
typeName: v.ZodEnum,
|
|
@@ -3730,7 +3733,7 @@ class X extends k {
|
|
|
3730
3733
|
return X.create(this.options.filter((s) => !e.includes(s)));
|
|
3731
3734
|
}
|
|
3732
3735
|
}
|
|
3733
|
-
X.create =
|
|
3736
|
+
X.create = ns;
|
|
3734
3737
|
class be extends k {
|
|
3735
3738
|
_parse(e) {
|
|
3736
3739
|
const s = E.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -3795,28 +3798,28 @@ class B extends k {
|
|
|
3795
3798
|
_parse(e) {
|
|
3796
3799
|
const { status: s, ctx: n } = this._processInputParams(e), r = this._def.effect || null;
|
|
3797
3800
|
if (r.type === "preprocess") {
|
|
3798
|
-
const
|
|
3799
|
-
return n.common.async ? Promise.resolve(
|
|
3801
|
+
const a = r.transform(n.data);
|
|
3802
|
+
return n.common.async ? Promise.resolve(a).then((o) => this._def.schema._parseAsync({
|
|
3800
3803
|
data: o,
|
|
3801
3804
|
path: n.path,
|
|
3802
3805
|
parent: n
|
|
3803
3806
|
})) : this._def.schema._parseSync({
|
|
3804
|
-
data:
|
|
3807
|
+
data: a,
|
|
3805
3808
|
path: n.path,
|
|
3806
3809
|
parent: n
|
|
3807
3810
|
});
|
|
3808
3811
|
}
|
|
3809
|
-
const
|
|
3810
|
-
addIssue: (
|
|
3811
|
-
m(n,
|
|
3812
|
+
const i = {
|
|
3813
|
+
addIssue: (a) => {
|
|
3814
|
+
m(n, a), a.fatal ? s.abort() : s.dirty();
|
|
3812
3815
|
},
|
|
3813
3816
|
get path() {
|
|
3814
3817
|
return n.path;
|
|
3815
3818
|
}
|
|
3816
3819
|
};
|
|
3817
|
-
if (
|
|
3818
|
-
const
|
|
3819
|
-
const u = r.refinement(o,
|
|
3820
|
+
if (i.addIssue = i.addIssue.bind(i), r.type === "refinement") {
|
|
3821
|
+
const a = (o) => {
|
|
3822
|
+
const u = r.refinement(o, i);
|
|
3820
3823
|
if (n.common.async)
|
|
3821
3824
|
return Promise.resolve(u);
|
|
3822
3825
|
if (u instanceof Promise)
|
|
@@ -3829,25 +3832,25 @@ class B extends k {
|
|
|
3829
3832
|
path: n.path,
|
|
3830
3833
|
parent: n
|
|
3831
3834
|
});
|
|
3832
|
-
return o.status === "aborted" ? w : (o.status === "dirty" && s.dirty(),
|
|
3835
|
+
return o.status === "aborted" ? w : (o.status === "dirty" && s.dirty(), a(o.value), { status: s.value, value: o.value });
|
|
3833
3836
|
} else
|
|
3834
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? w : (o.status === "dirty" && s.dirty(),
|
|
3837
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? w : (o.status === "dirty" && s.dirty(), a(o.value).then(() => ({ status: s.value, value: o.value }))));
|
|
3835
3838
|
}
|
|
3836
3839
|
if (r.type === "transform")
|
|
3837
3840
|
if (n.common.async === !1) {
|
|
3838
|
-
const
|
|
3841
|
+
const a = this._def.schema._parseSync({
|
|
3839
3842
|
data: n.data,
|
|
3840
3843
|
path: n.path,
|
|
3841
3844
|
parent: n
|
|
3842
3845
|
});
|
|
3843
|
-
if (!Le(
|
|
3844
|
-
return
|
|
3845
|
-
const o = r.transform(
|
|
3846
|
+
if (!Le(a))
|
|
3847
|
+
return a;
|
|
3848
|
+
const o = r.transform(a.value, i);
|
|
3846
3849
|
if (o instanceof Promise)
|
|
3847
3850
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3848
3851
|
return { status: s.value, value: o };
|
|
3849
3852
|
} else
|
|
3850
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((
|
|
3853
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((a) => Le(a) ? Promise.resolve(r.transform(a.value, i)).then((o) => ({ status: s.value, value: o })) : a);
|
|
3851
3854
|
E.assertNever(r);
|
|
3852
3855
|
}
|
|
3853
3856
|
}
|
|
@@ -3924,9 +3927,9 @@ class Ue extends k {
|
|
|
3924
3927
|
...n
|
|
3925
3928
|
}
|
|
3926
3929
|
});
|
|
3927
|
-
return De(r) ? r.then((
|
|
3930
|
+
return De(r) ? r.then((i) => ({
|
|
3928
3931
|
status: "valid",
|
|
3929
|
-
value:
|
|
3932
|
+
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
3930
3933
|
get error() {
|
|
3931
3934
|
return new D(n.common.issues);
|
|
3932
3935
|
},
|
|
@@ -3969,8 +3972,8 @@ ze.create = (t) => new ze({
|
|
|
3969
3972
|
typeName: v.ZodNaN,
|
|
3970
3973
|
...x(t)
|
|
3971
3974
|
});
|
|
3972
|
-
const
|
|
3973
|
-
class
|
|
3975
|
+
const rr = Symbol("zod_brand");
|
|
3976
|
+
class rs extends k {
|
|
3974
3977
|
_parse(e) {
|
|
3975
3978
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
3976
3979
|
return this._def.type._parse({
|
|
@@ -3988,13 +3991,13 @@ class Te extends k {
|
|
|
3988
3991
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
3989
3992
|
if (n.common.async)
|
|
3990
3993
|
return (async () => {
|
|
3991
|
-
const
|
|
3994
|
+
const i = await this._def.in._parseAsync({
|
|
3992
3995
|
data: n.data,
|
|
3993
3996
|
path: n.path,
|
|
3994
3997
|
parent: n
|
|
3995
3998
|
});
|
|
3996
|
-
return
|
|
3997
|
-
data:
|
|
3999
|
+
return i.status === "aborted" ? w : i.status === "dirty" ? (s.dirty(), ss(i.value)) : this._def.out._parseAsync({
|
|
4000
|
+
data: i.value,
|
|
3998
4001
|
path: n.path,
|
|
3999
4002
|
parent: n
|
|
4000
4003
|
});
|
|
@@ -4023,13 +4026,13 @@ class Te extends k {
|
|
|
4023
4026
|
});
|
|
4024
4027
|
}
|
|
4025
4028
|
}
|
|
4026
|
-
const
|
|
4027
|
-
var
|
|
4029
|
+
const is = (t, e = {}, s) => t ? ae.create().superRefine((n, r) => {
|
|
4030
|
+
var i, a;
|
|
4028
4031
|
if (!t(n)) {
|
|
4029
|
-
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (
|
|
4032
|
+
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (a = (i = o.fatal) !== null && i !== void 0 ? i : s) !== null && a !== void 0 ? a : !0, l = typeof o == "string" ? { message: o } : o;
|
|
4030
4033
|
r.addIssue({ code: "custom", ...l, fatal: u });
|
|
4031
4034
|
}
|
|
4032
|
-
}) :
|
|
4035
|
+
}) : ae.create(), ir = {
|
|
4033
4036
|
object: N.lazycreate
|
|
4034
4037
|
};
|
|
4035
4038
|
var v;
|
|
@@ -4038,7 +4041,7 @@ var v;
|
|
|
4038
4041
|
})(v || (v = {}));
|
|
4039
4042
|
const ar = (t, e = {
|
|
4040
4043
|
message: `Input not instance of ${t.name}`
|
|
4041
|
-
}) =>
|
|
4044
|
+
}) => is((s) => s instanceof t, e), as = L.create, os = q.create, or = ze.create, lr = G.create, ls = fe.create, cr = Q.create, ur = Pe.create, dr = he.create, fr = pe.create, hr = ae.create, pr = Y.create, mr = J.create, yr = Be.create, gr = P.create, vr = N.create, _r = N.strictCreate, br = me.create, wr = Ke.create, xr = ye.create, kr = z.create, Sr = ge.create, Tr = Me.create, Er = ee.create, Or = re.create, Nr = ve.create, Cr = _e.create, Ar = X.create, Rr = be.create, Ir = oe.create, Nt = B.create, jr = H.create, Zr = te.create, Lr = B.createWithPreprocess, Dr = Te.create, Pr = () => as().optional(), Br = () => os().optional(), Mr = () => ls().optional(), Ur = {
|
|
4042
4045
|
string: (t) => L.create({ ...t, coerce: !0 }),
|
|
4043
4046
|
number: (t) => q.create({ ...t, coerce: !0 }),
|
|
4044
4047
|
boolean: (t) => fe.create({
|
|
@@ -4047,21 +4050,21 @@ const ar = (t, e = {
|
|
|
4047
4050
|
}),
|
|
4048
4051
|
bigint: (t) => G.create({ ...t, coerce: !0 }),
|
|
4049
4052
|
date: (t) => Q.create({ ...t, coerce: !0 })
|
|
4050
|
-
},
|
|
4053
|
+
}, zr = w;
|
|
4051
4054
|
var d = /* @__PURE__ */ Object.freeze({
|
|
4052
4055
|
__proto__: null,
|
|
4053
4056
|
defaultErrorMap: de,
|
|
4054
|
-
setErrorMap:
|
|
4057
|
+
setErrorMap: Hn,
|
|
4055
4058
|
getErrorMap: je,
|
|
4056
4059
|
makeIssue: Ze,
|
|
4057
|
-
EMPTY_PATH:
|
|
4060
|
+
EMPTY_PATH: Jn,
|
|
4058
4061
|
addIssueToContext: m,
|
|
4059
4062
|
ParseStatus: R,
|
|
4060
4063
|
INVALID: w,
|
|
4061
|
-
DIRTY:
|
|
4064
|
+
DIRTY: ss,
|
|
4062
4065
|
OK: I,
|
|
4063
|
-
isAborted:
|
|
4064
|
-
isDirty:
|
|
4066
|
+
isAborted: it,
|
|
4067
|
+
isDirty: at,
|
|
4065
4068
|
isValid: Le,
|
|
4066
4069
|
isAsync: De,
|
|
4067
4070
|
get util() {
|
|
@@ -4081,7 +4084,7 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
4081
4084
|
ZodSymbol: Pe,
|
|
4082
4085
|
ZodUndefined: he,
|
|
4083
4086
|
ZodNull: pe,
|
|
4084
|
-
ZodAny:
|
|
4087
|
+
ZodAny: ae,
|
|
4085
4088
|
ZodUnknown: Y,
|
|
4086
4089
|
ZodNever: J,
|
|
4087
4090
|
ZodVoid: Be,
|
|
@@ -4107,62 +4110,62 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
4107
4110
|
ZodDefault: we,
|
|
4108
4111
|
ZodCatch: Ue,
|
|
4109
4112
|
ZodNaN: ze,
|
|
4110
|
-
BRAND:
|
|
4111
|
-
ZodBranded:
|
|
4113
|
+
BRAND: rr,
|
|
4114
|
+
ZodBranded: rs,
|
|
4112
4115
|
ZodPipeline: Te,
|
|
4113
|
-
custom:
|
|
4116
|
+
custom: is,
|
|
4114
4117
|
Schema: k,
|
|
4115
4118
|
ZodSchema: k,
|
|
4116
|
-
late:
|
|
4119
|
+
late: ir,
|
|
4117
4120
|
get ZodFirstPartyTypeKind() {
|
|
4118
4121
|
return v;
|
|
4119
4122
|
},
|
|
4120
|
-
coerce:
|
|
4121
|
-
any:
|
|
4122
|
-
array:
|
|
4123
|
-
bigint:
|
|
4124
|
-
boolean:
|
|
4125
|
-
date:
|
|
4126
|
-
discriminatedUnion:
|
|
4127
|
-
effect:
|
|
4128
|
-
enum:
|
|
4129
|
-
function:
|
|
4123
|
+
coerce: Ur,
|
|
4124
|
+
any: hr,
|
|
4125
|
+
array: gr,
|
|
4126
|
+
bigint: lr,
|
|
4127
|
+
boolean: ls,
|
|
4128
|
+
date: cr,
|
|
4129
|
+
discriminatedUnion: wr,
|
|
4130
|
+
effect: Nt,
|
|
4131
|
+
enum: Ar,
|
|
4132
|
+
function: Or,
|
|
4130
4133
|
instanceof: ar,
|
|
4131
|
-
intersection:
|
|
4132
|
-
lazy:
|
|
4133
|
-
literal:
|
|
4134
|
-
map:
|
|
4135
|
-
nan:
|
|
4136
|
-
nativeEnum:
|
|
4137
|
-
never:
|
|
4138
|
-
null:
|
|
4139
|
-
nullable:
|
|
4140
|
-
number:
|
|
4141
|
-
object:
|
|
4142
|
-
oboolean:
|
|
4143
|
-
onumber:
|
|
4144
|
-
optional:
|
|
4145
|
-
ostring:
|
|
4146
|
-
pipeline:
|
|
4147
|
-
preprocess:
|
|
4148
|
-
promise:
|
|
4149
|
-
record:
|
|
4150
|
-
set:
|
|
4151
|
-
strictObject:
|
|
4134
|
+
intersection: xr,
|
|
4135
|
+
lazy: Nr,
|
|
4136
|
+
literal: Cr,
|
|
4137
|
+
map: Tr,
|
|
4138
|
+
nan: or,
|
|
4139
|
+
nativeEnum: Rr,
|
|
4140
|
+
never: mr,
|
|
4141
|
+
null: fr,
|
|
4142
|
+
nullable: Zr,
|
|
4143
|
+
number: os,
|
|
4144
|
+
object: vr,
|
|
4145
|
+
oboolean: Mr,
|
|
4146
|
+
onumber: Br,
|
|
4147
|
+
optional: jr,
|
|
4148
|
+
ostring: Pr,
|
|
4149
|
+
pipeline: Dr,
|
|
4150
|
+
preprocess: Lr,
|
|
4151
|
+
promise: Ir,
|
|
4152
|
+
record: Sr,
|
|
4153
|
+
set: Er,
|
|
4154
|
+
strictObject: _r,
|
|
4152
4155
|
string: as,
|
|
4153
|
-
symbol:
|
|
4154
|
-
transformer:
|
|
4155
|
-
tuple:
|
|
4156
|
-
undefined:
|
|
4157
|
-
union:
|
|
4158
|
-
unknown:
|
|
4159
|
-
void:
|
|
4160
|
-
NEVER:
|
|
4156
|
+
symbol: ur,
|
|
4157
|
+
transformer: Nt,
|
|
4158
|
+
tuple: kr,
|
|
4159
|
+
undefined: dr,
|
|
4160
|
+
union: br,
|
|
4161
|
+
unknown: pr,
|
|
4162
|
+
void: yr,
|
|
4163
|
+
NEVER: zr,
|
|
4161
4164
|
ZodIssueCode: h,
|
|
4162
|
-
quotelessJson:
|
|
4165
|
+
quotelessJson: Fn,
|
|
4163
4166
|
ZodError: D
|
|
4164
4167
|
});
|
|
4165
|
-
class
|
|
4168
|
+
class $r {
|
|
4166
4169
|
constructor(e, s) {
|
|
4167
4170
|
b(this, "client");
|
|
4168
4171
|
b(this, "parentId");
|
|
@@ -4171,12 +4174,12 @@ class zr {
|
|
|
4171
4174
|
this.client = e, this.parentId = s, this.images = [], this.length = this.images.length;
|
|
4172
4175
|
}
|
|
4173
4176
|
async add(e) {
|
|
4174
|
-
return this.images.push(e), this.length = this.images.length, await
|
|
4177
|
+
return this.images.push(e), this.length = this.images.length, await Vn(this.client, this.parentId, new Fr(e)), new Promise((s) => {
|
|
4175
4178
|
s(this.length);
|
|
4176
4179
|
});
|
|
4177
4180
|
}
|
|
4178
4181
|
}
|
|
4179
|
-
const
|
|
4182
|
+
const Vr = d.object({
|
|
4180
4183
|
handle: d.string(),
|
|
4181
4184
|
url: d.string(),
|
|
4182
4185
|
width: d.number(),
|
|
@@ -4187,7 +4190,7 @@ const $r = d.object({
|
|
|
4187
4190
|
camera: d.string().optional(),
|
|
4188
4191
|
filename: d.string()
|
|
4189
4192
|
});
|
|
4190
|
-
class
|
|
4193
|
+
class Fr {
|
|
4191
4194
|
constructor(e) {
|
|
4192
4195
|
b(this, "handle");
|
|
4193
4196
|
b(this, "url");
|
|
@@ -4201,7 +4204,7 @@ class Vr {
|
|
|
4201
4204
|
this.handle = e.handle, this.url = e.url, this.width = e.width, this.height = e.height, this.orientation = e.rotation, this.taken_at = e.captureTime, this.camera_make = e.cameraMake, this.camera = e.cameraModel, this.filename = e.filename;
|
|
4202
4205
|
}
|
|
4203
4206
|
}
|
|
4204
|
-
const
|
|
4207
|
+
const Hr = [
|
|
4205
4208
|
"new",
|
|
4206
4209
|
"ingesting",
|
|
4207
4210
|
"submitted",
|
|
@@ -4214,7 +4217,7 @@ const Fr = [
|
|
|
4214
4217
|
"polishing",
|
|
4215
4218
|
"ready",
|
|
4216
4219
|
"error"
|
|
4217
|
-
],
|
|
4220
|
+
], cs = [
|
|
4218
4221
|
"baby",
|
|
4219
4222
|
"birthday",
|
|
4220
4223
|
"default",
|
|
@@ -4230,7 +4233,7 @@ const Fr = [
|
|
|
4230
4233
|
"travel",
|
|
4231
4234
|
"wedding",
|
|
4232
4235
|
"year-in-review"
|
|
4233
|
-
],
|
|
4236
|
+
], us = {
|
|
4234
4237
|
1005: { slug: "modern-black-sfly" },
|
|
4235
4238
|
1101: { slug: "bon-voyage-sfly" },
|
|
4236
4239
|
1103: { slug: "fun-in-the-sun-sfly" },
|
|
@@ -4391,8 +4394,8 @@ const Fr = [
|
|
|
4391
4394
|
6097: { slug: "boho-wedding-sfly" },
|
|
4392
4395
|
6098: { slug: "black-and-white-rustic-sfly" },
|
|
4393
4396
|
6099: { slug: "bright-color-pop-sfly" }
|
|
4394
|
-
},
|
|
4395
|
-
class
|
|
4397
|
+
}, ds = ["8x8", "10x10", "12x12", "8x11", "11x8", "11x14"], fs = ["sc", "hc", "pl"], hs = ["sp", "sl", "dl"], ps = ["low", "medium", "high"], ms = ["best", "most", "all"], ys = ["none", "few", "lots"], gs = ["none", "few", "lots"], Jr = "https://api.sfly-sls.magicbook.io", Wr = "wss://socket.sfly-sls.magicbook.io", Kr = parseInt("300000") || 3e5;
|
|
4398
|
+
class qr {
|
|
4396
4399
|
constructor(e) {
|
|
4397
4400
|
b(this, "occasion");
|
|
4398
4401
|
b(this, "style");
|
|
@@ -4406,36 +4409,36 @@ class Kr {
|
|
|
4406
4409
|
this.occasion = e.occasion, this.style = e.style, this.book_size = e.book_size, this.cover_type = e.cover_type, this.page_type = e.page_type, this.image_density = e.image_density, this.image_filtering_level = e.image_filtering_level, this.embellishment_level = e.embellishment_level, this.text_sticker_level = e.text_sticker_level;
|
|
4407
4410
|
}
|
|
4408
4411
|
}
|
|
4409
|
-
const
|
|
4410
|
-
occasion: d.enum(
|
|
4412
|
+
const Gr = d.object({
|
|
4413
|
+
occasion: d.enum(cs),
|
|
4411
4414
|
style: d.string(),
|
|
4412
|
-
book_size: d.enum(
|
|
4413
|
-
cover_type: d.enum(
|
|
4414
|
-
page_type: d.enum(
|
|
4415
|
-
image_density: d.enum(
|
|
4416
|
-
image_filtering_level: d.enum(
|
|
4417
|
-
embellishment_level: d.enum(
|
|
4418
|
-
text_sticker_level: d.enum(
|
|
4419
|
-
}),
|
|
4415
|
+
book_size: d.enum(ds),
|
|
4416
|
+
cover_type: d.enum(fs),
|
|
4417
|
+
page_type: d.enum(hs),
|
|
4418
|
+
image_density: d.enum(ps),
|
|
4419
|
+
image_filtering_level: d.enum(ms),
|
|
4420
|
+
embellishment_level: d.enum(ys),
|
|
4421
|
+
text_sticker_level: d.enum(gs)
|
|
4422
|
+
}), vs = d.object({
|
|
4420
4423
|
id: d.string(),
|
|
4421
4424
|
title: d.string(),
|
|
4422
|
-
design_request:
|
|
4423
|
-
state: d.enum(
|
|
4425
|
+
design_request: Gr,
|
|
4426
|
+
state: d.enum(Hr).optional(),
|
|
4424
4427
|
guid: d.string().optional()
|
|
4425
4428
|
});
|
|
4426
|
-
class
|
|
4429
|
+
class yt {
|
|
4427
4430
|
constructor(e) {
|
|
4428
4431
|
b(this, "id");
|
|
4429
4432
|
b(this, "title");
|
|
4430
4433
|
b(this, "design_request");
|
|
4431
4434
|
b(this, "state");
|
|
4432
4435
|
b(this, "guid");
|
|
4433
|
-
this.id = e.id, this.title = e.title, this.design_request = new
|
|
4436
|
+
this.id = e.id, this.title = e.title, this.design_request = new qr(e.design_request), this.state = e.state, this.guid = e.guid;
|
|
4434
4437
|
}
|
|
4435
4438
|
}
|
|
4436
|
-
function
|
|
4437
|
-
const e =
|
|
4438
|
-
return s.style = e, new
|
|
4439
|
+
function Ct(t) {
|
|
4440
|
+
const e = us[t.style].slug, s = It(JSON.parse(JSON.stringify(t)));
|
|
4441
|
+
return s.style = e, new yt({
|
|
4439
4442
|
id: t.parentId,
|
|
4440
4443
|
guid: t.guid,
|
|
4441
4444
|
title: t.title,
|
|
@@ -4448,31 +4451,35 @@ const Qe = d.object({
|
|
|
4448
4451
|
maxImageCount: d.number(),
|
|
4449
4452
|
avgImageCount: d.number(),
|
|
4450
4453
|
minImageCount: d.number()
|
|
4451
|
-
}),
|
|
4454
|
+
}), Xr = d.object({
|
|
4452
4455
|
high: Qe,
|
|
4453
4456
|
medium: Qe,
|
|
4454
4457
|
low: Qe
|
|
4455
|
-
}),
|
|
4456
|
-
densities:
|
|
4458
|
+
}), Yr = d.object({
|
|
4459
|
+
densities: Xr
|
|
4457
4460
|
});
|
|
4458
|
-
async function
|
|
4461
|
+
async function Qr({ apiKey: t, apiHost: e }, s, n, r) {
|
|
4459
4462
|
return Se(async () => {
|
|
4460
|
-
const
|
|
4461
|
-
{
|
|
4462
|
-
|
|
4463
|
-
|
|
4463
|
+
const i = await Qt(
|
|
4464
|
+
{
|
|
4465
|
+
url: `${e}/v1/designoptions/booksize/${s}/imagecount/${n}
|
|
4466
|
+
/imagefilteringlevel/${r}`,
|
|
4467
|
+
apiKey: t
|
|
4468
|
+
}
|
|
4469
|
+
), a = jt(i.data);
|
|
4470
|
+
return Yr.parse(a);
|
|
4464
4471
|
});
|
|
4465
4472
|
}
|
|
4466
|
-
const
|
|
4473
|
+
const ei = d.object({
|
|
4467
4474
|
photoRefId: d.string(),
|
|
4468
4475
|
finalCrop: d.array(d.number())
|
|
4469
|
-
}),
|
|
4476
|
+
}), ti = d.object({
|
|
4470
4477
|
x: d.number(),
|
|
4471
4478
|
y: d.number(),
|
|
4472
4479
|
width: d.number().optional(),
|
|
4473
4480
|
height: d.number().optional(),
|
|
4474
4481
|
rotation: d.number()
|
|
4475
|
-
}),
|
|
4482
|
+
}), si = d.object({
|
|
4476
4483
|
id: d.string(),
|
|
4477
4484
|
llx: d.number(),
|
|
4478
4485
|
lly: d.number(),
|
|
@@ -4486,13 +4493,13 @@ const Qr = d.object({
|
|
|
4486
4493
|
source: d.string(),
|
|
4487
4494
|
rotation: d.number(),
|
|
4488
4495
|
uploadTime: d.string()
|
|
4489
|
-
}),
|
|
4496
|
+
}), ni = d.object({
|
|
4490
4497
|
key: d.string(),
|
|
4491
|
-
value: d.
|
|
4492
|
-
}),
|
|
4498
|
+
value: d.any()
|
|
4499
|
+
}), ri = d.object({
|
|
4493
4500
|
type: d.string(),
|
|
4494
|
-
imageAssignment:
|
|
4495
|
-
position:
|
|
4501
|
+
imageAssignment: ei.optional(),
|
|
4502
|
+
position: ti,
|
|
4496
4503
|
seqNum: d.number(),
|
|
4497
4504
|
z: d.number(),
|
|
4498
4505
|
id: d.string().optional(),
|
|
@@ -4503,52 +4510,52 @@ const Qr = d.object({
|
|
|
4503
4510
|
fontSize: d.number().optional(),
|
|
4504
4511
|
fontColor: d.string().optional(),
|
|
4505
4512
|
frame: d.string().optional()
|
|
4506
|
-
}),
|
|
4513
|
+
}), ii = d.object({
|
|
4507
4514
|
url: d.string(),
|
|
4508
4515
|
encryptId: d.string(),
|
|
4509
4516
|
photoRefId: d.string(),
|
|
4510
4517
|
photoId: d.string(),
|
|
4511
|
-
photoMetadata:
|
|
4512
|
-
}),
|
|
4513
|
-
properties: d.array(
|
|
4514
|
-
}),
|
|
4518
|
+
photoMetadata: si
|
|
4519
|
+
}), ai = d.object({
|
|
4520
|
+
properties: d.array(ni)
|
|
4521
|
+
}), oi = d.object({
|
|
4515
4522
|
backgroundId: d.string().nullable(),
|
|
4516
|
-
assets: d.array(
|
|
4517
|
-
}),
|
|
4523
|
+
assets: d.array(ri).optional()
|
|
4524
|
+
}), li = d.object({
|
|
4518
4525
|
pageNum: d.number(),
|
|
4519
4526
|
type: d.string(),
|
|
4520
|
-
canvas:
|
|
4521
|
-
}),
|
|
4522
|
-
pages: d.array(
|
|
4523
|
-
photoStrip: d.array(
|
|
4524
|
-
}),
|
|
4527
|
+
canvas: oi
|
|
4528
|
+
}), ci = d.object({
|
|
4529
|
+
pages: d.array(li),
|
|
4530
|
+
photoStrip: d.array(ii)
|
|
4531
|
+
}), ui = d.object({
|
|
4525
4532
|
title: d.string(),
|
|
4526
4533
|
binding: d.string(),
|
|
4527
4534
|
coverSpecId: d.string(),
|
|
4528
4535
|
styleId: d.number(),
|
|
4529
4536
|
userId: d.string(),
|
|
4530
|
-
magicShopBook:
|
|
4531
|
-
reportingData:
|
|
4537
|
+
magicShopBook: ci,
|
|
4538
|
+
reportingData: ai
|
|
4532
4539
|
});
|
|
4533
|
-
async function
|
|
4540
|
+
async function di({ apiHost: t, apiKey: e }, s) {
|
|
4534
4541
|
return Se(async () => {
|
|
4535
|
-
const n = (await
|
|
4536
|
-
return
|
|
4542
|
+
const n = (await es({ url: `${t}/v1/books`, apiKey: e, payload: s })).data;
|
|
4543
|
+
return vs.safeParse(n), new yt(n);
|
|
4537
4544
|
});
|
|
4538
4545
|
}
|
|
4539
|
-
async function
|
|
4546
|
+
async function At({ apiHost: t, apiKey: e }, s) {
|
|
4540
4547
|
return Se(async () => {
|
|
4541
|
-
const n = (await
|
|
4542
|
-
return
|
|
4548
|
+
const n = (await $n({ url: `${t}/v1/books/${s.id}`, apiKey: e, payload: s })).data;
|
|
4549
|
+
return vs.safeParse(n), new yt(n);
|
|
4543
4550
|
});
|
|
4544
4551
|
}
|
|
4545
|
-
async function
|
|
4552
|
+
async function fi({ apiHost: t, apiKey: e }, s) {
|
|
4546
4553
|
return Se(async () => {
|
|
4547
|
-
const n = (await
|
|
4548
|
-
return
|
|
4554
|
+
const n = (await Qt({ url: `${t}/v1/books/${s}/format/galleon`, apiKey: e })).data;
|
|
4555
|
+
return ui.parse(n);
|
|
4549
4556
|
});
|
|
4550
4557
|
}
|
|
4551
|
-
class
|
|
4558
|
+
class hi {
|
|
4552
4559
|
constructor(e, s, n) {
|
|
4553
4560
|
b(this, "client");
|
|
4554
4561
|
b(this, "parentId");
|
|
@@ -4564,64 +4571,69 @@ class fa {
|
|
|
4564
4571
|
b(this, "textStickerLevel");
|
|
4565
4572
|
b(this, "images");
|
|
4566
4573
|
b(this, "guid");
|
|
4567
|
-
this.client = s, this.parentId = e, this.title = (n == null ? void 0 : n.title) || "", this.occasion = (n == null ? void 0 : n.occasion) ||
|
|
4574
|
+
this.client = s, this.parentId = e, this.title = (n == null ? void 0 : n.title) || "", this.occasion = (n == null ? void 0 : n.occasion) || cs[0], this.style = (n == null ? void 0 : n.style) || parseInt(Object.keys(us)[0]), this.bookSize = (n == null ? void 0 : n.bookSize) || ds[0], this.coverType = (n == null ? void 0 : n.coverType) || fs[0], this.pageType = (n == null ? void 0 : n.pageType) || hs[0], this.imageDensity = (n == null ? void 0 : n.imageDensity) || ps[0], this.imageFilteringLevel = (n == null ? void 0 : n.imageFilteringLevel) || ms[0], this.embellishmentLevel = (n == null ? void 0 : n.embellishmentLevel) || ys[0], this.textStickerLevel = (n == null ? void 0 : n.textStickerLevel) || gs[0], this.images = new $r(this.client, this.parentId);
|
|
4568
4575
|
}
|
|
4569
4576
|
async getOptions(e) {
|
|
4570
|
-
return await
|
|
4577
|
+
return await Qr(
|
|
4578
|
+
this.client,
|
|
4579
|
+
this.bookSize,
|
|
4580
|
+
e || this.images.length,
|
|
4581
|
+
this.imageFilteringLevel
|
|
4582
|
+
);
|
|
4571
4583
|
}
|
|
4572
4584
|
async submit(e) {
|
|
4573
|
-
return e && Object.assign(this, e), this.getProgress(), await
|
|
4585
|
+
return e && Object.assign(this, e), this.getProgress(), await At(this.client, Ct(this)), this;
|
|
4574
4586
|
}
|
|
4575
4587
|
async setGuid(e) {
|
|
4576
|
-
return this.guid = e, await
|
|
4588
|
+
return this.guid = e, await At(this.client, Ct(this)), this.guid;
|
|
4577
4589
|
}
|
|
4578
4590
|
async getJSON() {
|
|
4579
|
-
return await
|
|
4591
|
+
return await fi(this.client, this.parentId);
|
|
4580
4592
|
}
|
|
4581
4593
|
async getProgress() {
|
|
4582
4594
|
let e = "new";
|
|
4583
4595
|
const s = new WebSocket(`${this.client.webSocketHost}/?book_id=${this.parentId}`), n = setTimeout(() => {
|
|
4584
4596
|
throw s.close(), new Error("Something went wrong. Please try again.");
|
|
4585
|
-
},
|
|
4597
|
+
}, Kr);
|
|
4586
4598
|
s.onmessage = (r) => {
|
|
4587
|
-
const
|
|
4588
|
-
if (e !==
|
|
4589
|
-
e =
|
|
4590
|
-
const
|
|
4591
|
-
["error", "ready"].includes(
|
|
4599
|
+
const i = JSON.parse(r.data);
|
|
4600
|
+
if (e !== i.state) {
|
|
4601
|
+
e = i.state;
|
|
4602
|
+
const a = new CustomEvent("MagicBook.designRequestUpdated", { detail: i });
|
|
4603
|
+
["error", "ready"].includes(i.state) && (s.close(), clearTimeout(n)), window.dispatchEvent(a);
|
|
4592
4604
|
}
|
|
4593
4605
|
};
|
|
4594
4606
|
}
|
|
4595
4607
|
}
|
|
4596
|
-
class
|
|
4597
|
-
constructor(e, s =
|
|
4608
|
+
class mi {
|
|
4609
|
+
constructor(e, s = Jr, n = Wr) {
|
|
4598
4610
|
b(this, "apiKey");
|
|
4599
4611
|
b(this, "apiHost");
|
|
4600
4612
|
b(this, "webSocketHost");
|
|
4601
4613
|
this.apiKey = e, this.apiHost = s, this.webSocketHost = n;
|
|
4602
4614
|
}
|
|
4603
4615
|
async createDesignRequest(e) {
|
|
4604
|
-
const s = await
|
|
4605
|
-
return new
|
|
4616
|
+
const s = await di(this);
|
|
4617
|
+
return new hi(s.id, this, e);
|
|
4606
4618
|
}
|
|
4607
4619
|
}
|
|
4608
4620
|
export {
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4621
|
+
hi as DesignRequest,
|
|
4622
|
+
Fr as ImageServer,
|
|
4623
|
+
$r as Images,
|
|
4624
|
+
mi as MagicBookClient,
|
|
4625
|
+
ds as bookSizes,
|
|
4626
|
+
fs as coverTypes,
|
|
4627
|
+
Yr as designOptionsSchema,
|
|
4628
|
+
ys as embellishmentLevels,
|
|
4629
|
+
ps as imageDensities,
|
|
4618
4630
|
Qe as imageDensityOptionSchema,
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4631
|
+
Xr as imageDensityOptionsSchema,
|
|
4632
|
+
ms as imageFilteringLevels,
|
|
4633
|
+
Vr as imageServerSchema,
|
|
4634
|
+
cs as occasions,
|
|
4635
|
+
hs as pageTypes,
|
|
4636
|
+
Hr as states,
|
|
4637
|
+
us as styles,
|
|
4638
|
+
gs as textStickerLevels
|
|
4627
4639
|
};
|