@magiclabs.ai/magicbook-client 0.5.1 → 0.5.5
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/config.d.ts +3 -3
- package/data/design-request.d.ts +1 -1
- package/magicbook-client.js +583 -585
- package/magicbook-client.umd.cjs +3 -3
- package/models/book.d.ts +3 -3
- package/models/client.d.ts +3 -1
- package/models/design-request/image.d.ts +3 -2
- package/models/design-request/index.d.ts +5 -4
- package/models/galleon.d.ts +48 -48
- package/package.json +1 -1
- package/utils/engine-api/books.d.ts +7 -6
- package/utils/engine-api/design-options.d.ts +2 -1
- package/utils/engine-api/images.d.ts +12 -1
package/magicbook-client.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var _s = Object.defineProperty;
|
|
2
|
+
var bs = (t, e, s) => e in t ? _s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var b = (t, e, s) => (bs(t, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
+
function ws(t, e, s) {
|
|
5
5
|
const n = e.pop() || "", r = e.reduce(
|
|
6
6
|
(a, i) => a[i] = a[i] || {},
|
|
7
7
|
t
|
|
8
8
|
);
|
|
9
9
|
r[n] = s;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function At(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" ? At(t[s], e[s]) : t[s] = e[s];
|
|
14
14
|
}), t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function xs(t) {
|
|
17
17
|
return t.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Rt(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 = xs(e);
|
|
22
|
+
s.includes("_") && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] = Rt(t[s]));
|
|
23
23
|
}), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function ks(t) {
|
|
26
26
|
return t.replace(/([-_][a-z])/g, (e) => e.toUpperCase().replace("-", "").replace("_", ""));
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function It(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 = ks(e);
|
|
31
|
+
s !== e && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] = It(t[s]));
|
|
32
32
|
}), t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function jt(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: Ss } = Object.prototype, { getPrototypeOf: lt } = Object, $e = ((t) => (e) => {
|
|
40
|
+
const s = Ss.call(e);
|
|
41
41
|
return t[s] || (t[s] = s.slice(8, -1).toLowerCase());
|
|
42
|
-
})(/* @__PURE__ */ Object.create(null)), $ = (t) => (t = t.toLowerCase(), (e) =>
|
|
43
|
-
function
|
|
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 Ts(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 Zt = $("ArrayBuffer");
|
|
47
|
+
function Es(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 && Zt(t.buffer), e;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
51
|
+
const Os = Ve("string"), j = Ve("function"), Lt = Ve("number"), Fe = (t) => t !== null && typeof t == "object", Ns = (t) => t === !0 || t === !1, Oe = (t) => {
|
|
52
|
+
if ($e(t) !== "object")
|
|
53
53
|
return !1;
|
|
54
|
-
const e =
|
|
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
|
+
}, Cs = $("Date"), As = $("File"), Rs = $("Blob"), Is = $("FileList"), js = (t) => Fe(t) && j(t.pipe), Zs = (t) => {
|
|
57
57
|
let e;
|
|
58
|
-
return t && (typeof FormData == "function" && t instanceof FormData || j(t.append) && ((e =
|
|
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
|
+
}, Ls = $("URLSearchParams"), Ds = (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;
|
|
@@ -72,7 +72,7 @@ function xe(t, e, { allOwnKeys: s = !1 } = {}) {
|
|
|
72
72
|
o = a[n], e.call(null, t[o], o, t);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Dt(t, e) {
|
|
76
76
|
e = e.toLowerCase();
|
|
77
77
|
const s = Object.keys(t);
|
|
78
78
|
let n = s.length, r;
|
|
@@ -81,23 +81,23 @@ function Pt(t, e) {
|
|
|
81
81
|
return r;
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
|
-
const
|
|
85
|
-
function
|
|
86
|
-
const { caseless: t } =
|
|
87
|
-
const a = t &&
|
|
88
|
-
|
|
84
|
+
const Pt = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Bt = (t) => !ue(t) && t !== Pt;
|
|
85
|
+
function et() {
|
|
86
|
+
const { caseless: t } = Bt(this) && this || {}, e = {}, s = (n, r) => {
|
|
87
|
+
const a = t && Dt(e, r) || r;
|
|
88
|
+
Oe(e[a]) && Oe(n) ? e[a] = et(e[a], n) : Oe(n) ? e[a] = et({}, n) : le(n) ? e[a] = n.slice() : e[a] = 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[a] =
|
|
96
|
-
}, { allOwnKeys: n }), t),
|
|
94
|
+
const Ps = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, a) => {
|
|
95
|
+
s && j(r) ? t[a] = jt(r, s) : t[a] = r;
|
|
96
|
+
}, { allOwnKeys: n }), t), Bs = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ms = (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
|
-
},
|
|
100
|
+
}, Us = (t, e, s, n) => {
|
|
101
101
|
let r, a, i;
|
|
102
102
|
const o = {};
|
|
103
103
|
if (e = e || {}, t == null)
|
|
@@ -105,50 +105,50 @@ const Bs = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, a) => {
|
|
|
105
105
|
do {
|
|
106
106
|
for (r = Object.getOwnPropertyNames(t), a = r.length; a-- > 0; )
|
|
107
107
|
i = r[a], (!n || n(i, t, e)) && !o[i] && (e[i] = t[i], o[i] = !0);
|
|
108
|
-
t = s !== !1 &&
|
|
108
|
+
t = s !== !1 && lt(t);
|
|
109
109
|
} while (t && (!s || s(t, e)) && t !== Object.prototype);
|
|
110
110
|
return e;
|
|
111
|
-
},
|
|
111
|
+
}, zs = (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
|
+
}, $s = (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 (!Lt(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
|
+
}, Vs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && lt(Uint8Array)), Fs = (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
131
|
const a = r.value;
|
|
132
132
|
e.call(t, a[0], a[1]);
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, Hs = (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
|
+
}, Js = $("HTMLFormElement"), Ws = (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
|
+
), yt = (({ hasOwnProperty: t }) => (e, s) => t.call(e, s))(Object.prototype), Ks = $("RegExp"), Mt = (t, e) => {
|
|
146
146
|
const s = Object.getOwnPropertyDescriptors(t), n = {};
|
|
147
147
|
xe(s, (r, a) => {
|
|
148
148
|
e(r, a, t) !== !1 && (n[a] = r);
|
|
149
149
|
}), Object.defineProperties(t, n);
|
|
150
|
-
},
|
|
151
|
-
|
|
150
|
+
}, qs = (t) => {
|
|
151
|
+
Mt(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,31 +162,31 @@ const Bs = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, a) => {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
},
|
|
165
|
+
}, Gs = (t, e) => {
|
|
166
166
|
const s = {}, n = (r) => {
|
|
167
167
|
r.forEach((a) => {
|
|
168
168
|
s[a] = !0;
|
|
169
169
|
});
|
|
170
170
|
};
|
|
171
171
|
return le(t) ? n(t) : n(String(t).split(e)), s;
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
DIGIT:
|
|
175
|
-
ALPHA:
|
|
176
|
-
ALPHA_DIGIT:
|
|
177
|
-
},
|
|
172
|
+
}, Xs = () => {
|
|
173
|
+
}, Ys = (t, e) => (t = +t, Number.isFinite(t) ? t : e), qe = "abcdefghijklmnopqrstuvwxyz", gt = "0123456789", Ut = {
|
|
174
|
+
DIGIT: gt,
|
|
175
|
+
ALPHA: qe,
|
|
176
|
+
ALPHA_DIGIT: qe + qe.toUpperCase() + gt
|
|
177
|
+
}, Qs = (t = 16, e = Ut.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 en(t) {
|
|
185
185
|
return !!(t && j(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const tn = (t) => {
|
|
188
188
|
const e = new Array(10), s = (n, r) => {
|
|
189
|
-
if (
|
|
189
|
+
if (Fe(n)) {
|
|
190
190
|
if (e.indexOf(n) >= 0)
|
|
191
191
|
return;
|
|
192
192
|
if (!("toJSON" in n)) {
|
|
@@ -201,59 +201,59 @@ const sn = (t) => {
|
|
|
201
201
|
return n;
|
|
202
202
|
};
|
|
203
203
|
return s(t, 0);
|
|
204
|
-
},
|
|
204
|
+
}, sn = $("AsyncFunction"), nn = (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:
|
|
213
|
-
isObject:
|
|
214
|
-
isPlainObject:
|
|
206
|
+
isArrayBuffer: Zt,
|
|
207
|
+
isBuffer: Ts,
|
|
208
|
+
isFormData: Zs,
|
|
209
|
+
isArrayBufferView: Es,
|
|
210
|
+
isString: Os,
|
|
211
|
+
isNumber: Lt,
|
|
212
|
+
isBoolean: Ns,
|
|
213
|
+
isObject: Fe,
|
|
214
|
+
isPlainObject: Oe,
|
|
215
215
|
isUndefined: ue,
|
|
216
|
-
isDate:
|
|
217
|
-
isFile:
|
|
218
|
-
isBlob:
|
|
219
|
-
isRegExp:
|
|
216
|
+
isDate: Cs,
|
|
217
|
+
isFile: As,
|
|
218
|
+
isBlob: Rs,
|
|
219
|
+
isRegExp: Ks,
|
|
220
220
|
isFunction: j,
|
|
221
|
-
isStream:
|
|
222
|
-
isURLSearchParams:
|
|
223
|
-
isTypedArray:
|
|
224
|
-
isFileList:
|
|
221
|
+
isStream: js,
|
|
222
|
+
isURLSearchParams: Ls,
|
|
223
|
+
isTypedArray: Vs,
|
|
224
|
+
isFileList: Is,
|
|
225
225
|
forEach: xe,
|
|
226
|
-
merge:
|
|
227
|
-
extend:
|
|
228
|
-
trim:
|
|
229
|
-
stripBOM:
|
|
230
|
-
inherits:
|
|
231
|
-
toFlatObject:
|
|
232
|
-
kindOf:
|
|
226
|
+
merge: et,
|
|
227
|
+
extend: Ps,
|
|
228
|
+
trim: Ds,
|
|
229
|
+
stripBOM: Bs,
|
|
230
|
+
inherits: Ms,
|
|
231
|
+
toFlatObject: Us,
|
|
232
|
+
kindOf: $e,
|
|
233
233
|
kindOfTest: $,
|
|
234
|
-
endsWith:
|
|
235
|
-
toArray:
|
|
236
|
-
forEachEntry:
|
|
237
|
-
matchAll:
|
|
238
|
-
isHTMLForm:
|
|
239
|
-
hasOwnProperty:
|
|
240
|
-
hasOwnProp:
|
|
234
|
+
endsWith: zs,
|
|
235
|
+
toArray: $s,
|
|
236
|
+
forEachEntry: Fs,
|
|
237
|
+
matchAll: Hs,
|
|
238
|
+
isHTMLForm: Js,
|
|
239
|
+
hasOwnProperty: yt,
|
|
240
|
+
hasOwnProp: yt,
|
|
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: Mt,
|
|
243
|
+
freezeMethods: qs,
|
|
244
|
+
toObjectSet: Gs,
|
|
245
|
+
toCamelCase: Ws,
|
|
246
|
+
noop: Xs,
|
|
247
|
+
toFiniteNumber: Ys,
|
|
248
|
+
findKey: Dt,
|
|
249
|
+
global: Pt,
|
|
250
|
+
isContextDefined: Bt,
|
|
251
|
+
ALPHABET: Ut,
|
|
252
|
+
generateString: Qs,
|
|
253
|
+
isSpecCompliantForm: en,
|
|
254
|
+
toJSONObject: tn,
|
|
255
|
+
isAsyncFn: sn,
|
|
256
|
+
isThenable: nn
|
|
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 zt = T.prototype, $t = {};
|
|
283
283
|
[
|
|
284
284
|
"ERR_BAD_OPTION_VALUE",
|
|
285
285
|
"ERR_BAD_OPTION",
|
|
@@ -295,35 +295,35 @@ const $t = T.prototype, Vt = {};
|
|
|
295
295
|
"ERR_INVALID_URL"
|
|
296
296
|
// eslint-disable-next-line func-names
|
|
297
297
|
].forEach((t) => {
|
|
298
|
-
|
|
298
|
+
$t[t] = { value: t };
|
|
299
299
|
});
|
|
300
|
-
Object.defineProperties(T,
|
|
301
|
-
Object.defineProperty(
|
|
300
|
+
Object.defineProperties(T, $t);
|
|
301
|
+
Object.defineProperty(zt, "isAxiosError", { value: !0 });
|
|
302
302
|
T.from = (t, e, s, n, r, a) => {
|
|
303
|
-
const i = Object.create(
|
|
303
|
+
const i = Object.create(zt);
|
|
304
304
|
return c.toFlatObject(t, i, function(u) {
|
|
305
305
|
return u !== Error.prototype;
|
|
306
306
|
}, (o) => o !== "isAxiosError"), T.call(i, t.message, e, s, n, r), i.cause = t, i.name = t.name, a && Object.assign(i, a), i;
|
|
307
307
|
};
|
|
308
|
-
const
|
|
309
|
-
function
|
|
308
|
+
const rn = null;
|
|
309
|
+
function tt(t) {
|
|
310
310
|
return c.isPlainObject(t) || c.isArray(t);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Vt(t) {
|
|
313
313
|
return c.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function vt(t, e, s) {
|
|
316
316
|
return t ? t.concat(e).map(function(r, a) {
|
|
317
|
-
return r =
|
|
317
|
+
return r = Vt(r), !s && a ? "[" + r + "]" : r;
|
|
318
318
|
}).join(s ? "." : "") : e;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
return c.isArray(t) && !t.some(
|
|
320
|
+
function an(t) {
|
|
321
|
+
return c.isArray(t) && !t.some(tt);
|
|
322
322
|
}
|
|
323
|
-
const
|
|
323
|
+
const on = c.toFlatObject(c, {}, null, function(e) {
|
|
324
324
|
return /^is[A-Z]/.test(e);
|
|
325
325
|
});
|
|
326
|
-
function
|
|
326
|
+
function He(t, e, s) {
|
|
327
327
|
if (!c.isObject(t))
|
|
328
328
|
throw new TypeError("target must be an object");
|
|
329
329
|
e = e || new FormData(), s = c.toFlatObject(s, {
|
|
@@ -350,21 +350,21 @@ function Je(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 =
|
|
355
|
-
!(c.isUndefined(
|
|
353
|
+
else if (c.isArray(g) && an(g) || (c.isFileList(g) || c.endsWith(S, "[]")) && (Z = c.toArray(g)))
|
|
354
|
+
return S = Vt(S), Z.forEach(function(Ee, vs) {
|
|
355
|
+
!(c.isUndefined(Ee) || Ee === null) && e.append(
|
|
356
356
|
// eslint-disable-next-line no-nested-ternary
|
|
357
|
-
i === !0 ?
|
|
358
|
-
l(
|
|
357
|
+
i === !0 ? vt([S], vs, a) : i === null ? S : S + "[]",
|
|
358
|
+
l(Ee)
|
|
359
359
|
);
|
|
360
360
|
}), !1;
|
|
361
361
|
}
|
|
362
|
-
return
|
|
362
|
+
return tt(g) ? !0 : (e.append(vt(V, S, a), l(g)), !1);
|
|
363
363
|
}
|
|
364
|
-
const _ = [], C = Object.assign(
|
|
364
|
+
const _ = [], C = Object.assign(on, {
|
|
365
365
|
defaultVisitor: f,
|
|
366
366
|
convertValue: l,
|
|
367
|
-
isVisitable:
|
|
367
|
+
isVisitable: tt
|
|
368
368
|
});
|
|
369
369
|
function O(g, S) {
|
|
370
370
|
if (!c.isUndefined(g)) {
|
|
@@ -385,7 +385,7 @@ function Je(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 _t(t) {
|
|
389
389
|
const e = {
|
|
390
390
|
"!": "%21",
|
|
391
391
|
"'": "%27",
|
|
@@ -399,36 +399,36 @@ function bt(t) {
|
|
|
399
399
|
return e[n];
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
|
-
function
|
|
403
|
-
this._pairs = [], t &&
|
|
402
|
+
function ct(t, e) {
|
|
403
|
+
this._pairs = [], t && He(t, this, e);
|
|
404
404
|
}
|
|
405
|
-
const
|
|
406
|
-
|
|
405
|
+
const Ft = ct.prototype;
|
|
406
|
+
Ft.append = function(e, s) {
|
|
407
407
|
this._pairs.push([e, s]);
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
Ft.toString = function(e) {
|
|
410
410
|
const s = e ? function(n) {
|
|
411
|
-
return e.call(this, n,
|
|
412
|
-
} :
|
|
411
|
+
return e.call(this, n, _t);
|
|
412
|
+
} : _t;
|
|
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 ln(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 Ht(t, e, s) {
|
|
421
421
|
if (!e)
|
|
422
422
|
return t;
|
|
423
|
-
const n = s && s.encode ||
|
|
423
|
+
const n = s && s.encode || ln, r = s && s.serialize;
|
|
424
424
|
let a;
|
|
425
|
-
if (r ? a = r(e, s) : a = c.isURLSearchParams(e) ? e.toString() : new
|
|
425
|
+
if (r ? a = r(e, s) : a = c.isURLSearchParams(e) ? e.toString() : new ct(e, s).toString(n), a) {
|
|
426
426
|
const i = t.indexOf("#");
|
|
427
427
|
i !== -1 && (t = t.slice(0, i)), t += (t.indexOf("?") === -1 ? "?" : "&") + a;
|
|
428
428
|
}
|
|
429
429
|
return t;
|
|
430
430
|
}
|
|
431
|
-
class
|
|
431
|
+
class cn {
|
|
432
432
|
constructor() {
|
|
433
433
|
this.handlers = [];
|
|
434
434
|
}
|
|
@@ -482,36 +482,36 @@ class un {
|
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
const
|
|
485
|
+
const bt = cn, Jt = {
|
|
486
486
|
silentJSONParsing: !0,
|
|
487
487
|
forcedJSONParsing: !0,
|
|
488
488
|
clarifyTimeoutError: !1
|
|
489
|
-
},
|
|
489
|
+
}, un = typeof URLSearchParams < "u" ? URLSearchParams : ct, dn = typeof FormData < "u" ? FormData : null, fn = typeof Blob < "u" ? Blob : null, hn = (() => {
|
|
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
|
+
})(), pn = (() => 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: un,
|
|
497
|
+
FormData: dn,
|
|
498
|
+
Blob: fn
|
|
499
499
|
},
|
|
500
|
-
isStandardBrowserEnv:
|
|
501
|
-
isStandardBrowserWebWorkerEnv:
|
|
500
|
+
isStandardBrowserEnv: hn,
|
|
501
|
+
isStandardBrowserWebWorkerEnv: pn,
|
|
502
502
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
503
503
|
};
|
|
504
|
-
function
|
|
505
|
-
return
|
|
504
|
+
function mn(t, e) {
|
|
505
|
+
return He(t, new M.classes.URLSearchParams(), Object.assign({
|
|
506
506
|
visitor: function(s, n, r, a) {
|
|
507
507
|
return M.isNode && c.isBuffer(s) ? (this.append(n, s.toString("base64")), !1) : a.defaultVisitor.apply(this, arguments);
|
|
508
508
|
}
|
|
509
509
|
}, e));
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function yn(t) {
|
|
512
512
|
return c.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function gn(t) {
|
|
515
515
|
const e = {}, s = Object.keys(t);
|
|
516
516
|
let n;
|
|
517
517
|
const r = s.length;
|
|
@@ -520,24 +520,24 @@ function vn(t) {
|
|
|
520
520
|
a = s[n], e[a] = t[a];
|
|
521
521
|
return e;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Wt(t) {
|
|
524
524
|
function e(s, n, r, a) {
|
|
525
525
|
let i = s[a++];
|
|
526
526
|
const o = Number.isFinite(+i), u = a >= s.length;
|
|
527
|
-
return i = !i && c.isArray(r) ? r.length : i, u ? (c.hasOwnProp(r, i) ? r[i] = [r[i], n] : r[i] = n, !o) : ((!r[i] || !c.isObject(r[i])) && (r[i] = []), e(s, n, r[i], a) && c.isArray(r[i]) && (r[i] =
|
|
527
|
+
return i = !i && c.isArray(r) ? r.length : i, u ? (c.hasOwnProp(r, i) ? r[i] = [r[i], n] : r[i] = n, !o) : ((!r[i] || !c.isObject(r[i])) && (r[i] = []), e(s, n, r[i], a) && c.isArray(r[i]) && (r[i] = gn(r[i])), !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(yn(n), r, s, 0);
|
|
533
533
|
}), s;
|
|
534
534
|
}
|
|
535
535
|
return null;
|
|
536
536
|
}
|
|
537
|
-
const
|
|
537
|
+
const vn = {
|
|
538
538
|
"Content-Type": void 0
|
|
539
539
|
};
|
|
540
|
-
function
|
|
540
|
+
function _n(t, e, s) {
|
|
541
541
|
if (c.isString(t))
|
|
542
542
|
try {
|
|
543
543
|
return (e || JSON.parse)(t), c.trim(t);
|
|
@@ -547,13 +547,13 @@ function bn(t, e, s) {
|
|
|
547
547
|
}
|
|
548
548
|
return (s || JSON.stringify)(t);
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
transitional:
|
|
550
|
+
const Je = {
|
|
551
|
+
transitional: Jt,
|
|
552
552
|
adapter: ["xhr", "http"],
|
|
553
553
|
transformRequest: [function(e, s) {
|
|
554
554
|
const n = s.getContentType() || "", r = n.indexOf("application/json") > -1, a = c.isObject(e);
|
|
555
555
|
if (a && c.isHTMLForm(e) && (e = new FormData(e)), c.isFormData(e))
|
|
556
|
-
return r && r ? JSON.stringify(
|
|
556
|
+
return r && r ? JSON.stringify(Wt(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))
|
|
@@ -563,20 +563,20 @@ const We = {
|
|
|
563
563
|
let o;
|
|
564
564
|
if (a) {
|
|
565
565
|
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
566
|
-
return
|
|
566
|
+
return mn(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
|
-
return
|
|
569
|
+
return He(
|
|
570
570
|
o ? { "files[]": e } : e,
|
|
571
571
|
u && new u(),
|
|
572
572
|
this.formSerializer
|
|
573
573
|
);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
return a || r ? (s.setContentType("application/json", !1),
|
|
576
|
+
return a || r ? (s.setContentType("application/json", !1), _n(e)) : e;
|
|
577
577
|
}],
|
|
578
578
|
transformResponse: [function(e) {
|
|
579
|
-
const s = this.transitional ||
|
|
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
581
|
const i = !(s && s.silentJSONParsing) && r;
|
|
582
582
|
try {
|
|
@@ -611,12 +611,12 @@ const We = {
|
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
613
|
c.forEach(["delete", "get", "head"], function(e) {
|
|
614
|
-
|
|
614
|
+
Je.headers[e] = {};
|
|
615
615
|
});
|
|
616
616
|
c.forEach(["post", "put", "patch"], function(e) {
|
|
617
|
-
|
|
617
|
+
Je.headers[e] = c.merge(vn);
|
|
618
618
|
});
|
|
619
|
-
const
|
|
619
|
+
const ut = Je, bn = c.toObjectSet([
|
|
620
620
|
"age",
|
|
621
621
|
"authorization",
|
|
622
622
|
"content-length",
|
|
@@ -634,29 +634,29 @@ const dt = We, wn = c.toObjectSet([
|
|
|
634
634
|
"referer",
|
|
635
635
|
"retry-after",
|
|
636
636
|
"user-agent"
|
|
637
|
-
]),
|
|
637
|
+
]), wn = (t) => {
|
|
638
638
|
const e = {};
|
|
639
639
|
let s, n, r;
|
|
640
640
|
return t && t.split(`
|
|
641
641
|
`).forEach(function(i) {
|
|
642
|
-
r = i.indexOf(":"), s = i.substring(0, r).trim().toLowerCase(), n = i.substring(r + 1).trim(), !(!s || e[s] &&
|
|
642
|
+
r = i.indexOf(":"), s = i.substring(0, r).trim().toLowerCase(), n = i.substring(r + 1).trim(), !(!s || e[s] && bn[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
|
+
}, wt = Symbol("internals");
|
|
645
645
|
function ce(t) {
|
|
646
646
|
return t && String(t).trim().toLowerCase();
|
|
647
647
|
}
|
|
648
|
-
function
|
|
649
|
-
return t === !1 || t == null ? t : c.isArray(t) ? t.map(
|
|
648
|
+
function Ne(t) {
|
|
649
|
+
return t === !1 || t == null ? t : c.isArray(t) ? t.map(Ne) : String(t);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function xn(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
|
|
659
|
-
function
|
|
658
|
+
const kn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
659
|
+
function Ge(t, e, s, n, r) {
|
|
660
660
|
if (c.isFunction(n))
|
|
661
661
|
return n.call(this, e, s);
|
|
662
662
|
if (r && (e = s), !!c.isString(e)) {
|
|
@@ -666,10 +666,10 @@ function Xe(t, e, s, n, r) {
|
|
|
666
666
|
return n.test(e);
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Sn(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 Tn(t, e) {
|
|
673
673
|
const s = c.toCamelCase(" " + e);
|
|
674
674
|
["get", "set", "has"].forEach((n) => {
|
|
675
675
|
Object.defineProperty(t, n + s, {
|
|
@@ -680,7 +680,7 @@ function En(t, e) {
|
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
|
-
class
|
|
683
|
+
class We {
|
|
684
684
|
constructor(e) {
|
|
685
685
|
e && this.set(e);
|
|
686
686
|
}
|
|
@@ -691,10 +691,10 @@ class Ke {
|
|
|
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
|
-
(!_ || r[_] === void 0 || l === !0 || l === void 0 && r[_] !== !1) && (r[_ || u] =
|
|
694
|
+
(!_ || r[_] === void 0 || l === !0 || l === void 0 && r[_] !== !1) && (r[_ || u] = Ne(o));
|
|
695
695
|
}
|
|
696
696
|
const i = (o, u) => c.forEach(o, (l, f) => a(l, f, u));
|
|
697
|
-
return c.isPlainObject(e) || e instanceof this.constructor ? i(e, s) : c.isString(e) && (e = e.trim()) && !
|
|
697
|
+
return c.isPlainObject(e) || e instanceof this.constructor ? i(e, s) : c.isString(e) && (e = e.trim()) && !kn(e) ? i(wn(e), s) : e != null && a(s, e, n), this;
|
|
698
698
|
}
|
|
699
699
|
get(e, s) {
|
|
700
700
|
if (e = ce(e), e) {
|
|
@@ -704,7 +704,7 @@ class Ke {
|
|
|
704
704
|
if (!s)
|
|
705
705
|
return r;
|
|
706
706
|
if (s === !0)
|
|
707
|
-
return
|
|
707
|
+
return xn(r);
|
|
708
708
|
if (c.isFunction(s))
|
|
709
709
|
return s.call(this, r, n);
|
|
710
710
|
if (c.isRegExp(s))
|
|
@@ -716,7 +716,7 @@ class Ke {
|
|
|
716
716
|
has(e, s) {
|
|
717
717
|
if (e = ce(e), e) {
|
|
718
718
|
const n = c.findKey(this, e);
|
|
719
|
-
return !!(n && this[n] !== void 0 && (!s ||
|
|
719
|
+
return !!(n && this[n] !== void 0 && (!s || Ge(this, this[n], n, s)));
|
|
720
720
|
}
|
|
721
721
|
return !1;
|
|
722
722
|
}
|
|
@@ -726,7 +726,7 @@ class Ke {
|
|
|
726
726
|
function a(i) {
|
|
727
727
|
if (i = ce(i), i) {
|
|
728
728
|
const o = c.findKey(n, i);
|
|
729
|
-
o && (!s ||
|
|
729
|
+
o && (!s || Ge(n, n[o], o, s)) && (delete n[o], r = !0);
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
732
|
return c.isArray(e) ? e.forEach(a) : a(e), r;
|
|
@@ -736,7 +736,7 @@ class Ke {
|
|
|
736
736
|
let n = s.length, r = !1;
|
|
737
737
|
for (; n--; ) {
|
|
738
738
|
const a = s[n];
|
|
739
|
-
(!e ||
|
|
739
|
+
(!e || Ge(this, this[a], a, e, !0)) && (delete this[a], r = !0);
|
|
740
740
|
}
|
|
741
741
|
return r;
|
|
742
742
|
}
|
|
@@ -745,11 +745,11 @@ class Ke {
|
|
|
745
745
|
return c.forEach(this, (r, a) => {
|
|
746
746
|
const i = c.findKey(n, a);
|
|
747
747
|
if (i) {
|
|
748
|
-
s[i] =
|
|
748
|
+
s[i] = Ne(r), delete s[a];
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
const o = e ?
|
|
752
|
-
o !== a && delete s[a], s[o] =
|
|
751
|
+
const o = e ? Sn(a) : String(a).trim();
|
|
752
|
+
o !== a && delete s[a], s[o] = Ne(r), n[o] = !0;
|
|
753
753
|
}), this;
|
|
754
754
|
}
|
|
755
755
|
concat(...e) {
|
|
@@ -779,28 +779,28 @@ class Ke {
|
|
|
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[wt] = this[wt] = {
|
|
783
783
|
accessors: {}
|
|
784
784
|
}).accessors, r = this.prototype;
|
|
785
785
|
function a(i) {
|
|
786
786
|
const o = ce(i);
|
|
787
|
-
n[o] || (
|
|
787
|
+
n[o] || (Tn(r, i), n[o] = !0);
|
|
788
788
|
}
|
|
789
789
|
return c.isArray(e) ? e.forEach(a) : a(e), this;
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
|
-
|
|
793
|
-
c.freezeMethods(
|
|
794
|
-
c.freezeMethods(
|
|
795
|
-
const F =
|
|
796
|
-
function
|
|
797
|
-
const s = this ||
|
|
792
|
+
We.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
793
|
+
c.freezeMethods(We.prototype);
|
|
794
|
+
c.freezeMethods(We);
|
|
795
|
+
const F = We;
|
|
796
|
+
function Xe(t, e) {
|
|
797
|
+
const s = this || ut, n = e || s, r = F.from(n.headers);
|
|
798
798
|
let a = n.data;
|
|
799
799
|
return c.forEach(t, function(o) {
|
|
800
800
|
a = o.call(s, a, r.normalize(), e ? e.status : void 0);
|
|
801
801
|
}), r.normalize(), a;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function Kt(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 En(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,7 +819,7 @@ function On(t, e, s) {
|
|
|
819
819
|
s
|
|
820
820
|
));
|
|
821
821
|
}
|
|
822
|
-
const
|
|
822
|
+
const On = M.isStandardBrowserEnv ? (
|
|
823
823
|
// Standard browser envs support document.cookie
|
|
824
824
|
function() {
|
|
825
825
|
return {
|
|
@@ -850,16 +850,16 @@ const Nn = M.isStandardBrowserEnv ? (
|
|
|
850
850
|
};
|
|
851
851
|
}()
|
|
852
852
|
);
|
|
853
|
-
function
|
|
853
|
+
function Nn(t) {
|
|
854
854
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function Cn(t, e) {
|
|
857
857
|
return e ? t.replace(/\/+$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
return t && !
|
|
859
|
+
function qt(t, e) {
|
|
860
|
+
return t && !Nn(e) ? Cn(t, e) : e;
|
|
861
861
|
}
|
|
862
|
-
const
|
|
862
|
+
const An = 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() {
|
|
@@ -891,11 +891,11 @@ const Rn = M.isStandardBrowserEnv ? (
|
|
|
891
891
|
};
|
|
892
892
|
}()
|
|
893
893
|
);
|
|
894
|
-
function
|
|
894
|
+
function Rn(t) {
|
|
895
895
|
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
896
896
|
return e && e[1] || "";
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function In(t, e) {
|
|
899
899
|
t = t || 10;
|
|
900
900
|
const s = new Array(t), n = new Array(t);
|
|
901
901
|
let r = 0, a = 0, i;
|
|
@@ -911,9 +911,9 @@ function jn(t, e) {
|
|
|
911
911
|
return O ? Math.round(C * 1e3 / O) : void 0;
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function xt(t, e) {
|
|
915
915
|
let s = 0;
|
|
916
|
-
const n =
|
|
916
|
+
const n = In(50, 250);
|
|
917
917
|
return (r) => {
|
|
918
918
|
const a = r.loaded, i = r.lengthComputable ? r.total : void 0, o = a - s, u = n(o), l = a <= i;
|
|
919
919
|
s = a;
|
|
@@ -929,7 +929,7 @@ function kt(t, e) {
|
|
|
929
929
|
f[e ? "download" : "upload"] = !0, t(f);
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
|
-
const
|
|
932
|
+
const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
933
933
|
return new Promise(function(s, n) {
|
|
934
934
|
let r = t.data;
|
|
935
935
|
const a = F.from(t.headers).normalize(), i = t.responseType;
|
|
@@ -943,8 +943,8 @@ const Zn = typeof XMLHttpRequest < "u", Ln = Zn && function(t) {
|
|
|
943
943
|
const O = t.auth.username || "", g = t.auth.password ? unescape(encodeURIComponent(t.auth.password)) : "";
|
|
944
944
|
a.set("Authorization", "Basic " + btoa(O + ":" + g));
|
|
945
945
|
}
|
|
946
|
-
const f =
|
|
947
|
-
l.open(t.method.toUpperCase(),
|
|
946
|
+
const f = qt(t.baseURL, t.url);
|
|
947
|
+
l.open(t.method.toUpperCase(), Ht(f, t.params, t.paramsSerializer), !0), l.timeout = t.timeout;
|
|
948
948
|
function _() {
|
|
949
949
|
if (!l)
|
|
950
950
|
return;
|
|
@@ -958,7 +958,7 @@ const Zn = typeof XMLHttpRequest < "u", Ln = Zn && function(t) {
|
|
|
958
958
|
config: t,
|
|
959
959
|
request: l
|
|
960
960
|
};
|
|
961
|
-
|
|
961
|
+
En(function(Z) {
|
|
962
962
|
s(Z), u();
|
|
963
963
|
}, function(Z) {
|
|
964
964
|
n(Z), u();
|
|
@@ -972,7 +972,7 @@ const Zn = typeof XMLHttpRequest < "u", Ln = Zn && 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 || Jt;
|
|
976
976
|
t.timeoutErrorMessage && (g = t.timeoutErrorMessage), n(new T(
|
|
977
977
|
g,
|
|
978
978
|
S.clarifyTimeoutError ? T.ETIMEDOUT : T.ECONNABORTED,
|
|
@@ -980,26 +980,26 @@ const Zn = typeof XMLHttpRequest < "u", Ln = Zn && function(t) {
|
|
|
980
980
|
l
|
|
981
981
|
)), l = null;
|
|
982
982
|
}, M.isStandardBrowserEnv) {
|
|
983
|
-
const O = (t.withCredentials ||
|
|
983
|
+
const O = (t.withCredentials || An(f)) && t.xsrfCookieName && On.read(t.xsrfCookieName);
|
|
984
984
|
O && a.set(t.xsrfHeaderName, O);
|
|
985
985
|
}
|
|
986
986
|
r === void 0 && a.setContentType(null), "setRequestHeader" in l && c.forEach(a.toJSON(), function(g, S) {
|
|
987
987
|
l.setRequestHeader(S, g);
|
|
988
|
-
}), c.isUndefined(t.withCredentials) || (l.withCredentials = !!t.withCredentials), i && i !== "json" && (l.responseType = t.responseType), typeof t.onDownloadProgress == "function" && l.addEventListener("progress",
|
|
988
|
+
}), c.isUndefined(t.withCredentials) || (l.withCredentials = !!t.withCredentials), i && i !== "json" && (l.responseType = t.responseType), typeof t.onDownloadProgress == "function" && l.addEventListener("progress", xt(t.onDownloadProgress, !0)), typeof t.onUploadProgress == "function" && l.upload && l.upload.addEventListener("progress", xt(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 = Rn(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;
|
|
995
995
|
}
|
|
996
996
|
l.send(r || null);
|
|
997
997
|
});
|
|
998
|
-
},
|
|
999
|
-
http:
|
|
1000
|
-
xhr:
|
|
998
|
+
}, Ce = {
|
|
999
|
+
http: rn,
|
|
1000
|
+
xhr: Zn
|
|
1001
1001
|
};
|
|
1002
|
-
c.forEach(
|
|
1002
|
+
c.forEach(Ce, (t, e) => {
|
|
1003
1003
|
if (t) {
|
|
1004
1004
|
try {
|
|
1005
1005
|
Object.defineProperty(t, "name", { value: e });
|
|
@@ -1008,49 +1008,49 @@ c.forEach(Ae, (t, e) => {
|
|
|
1008
1008
|
Object.defineProperty(t, "adapterName", { value: e });
|
|
1009
1009
|
}
|
|
1010
1010
|
});
|
|
1011
|
-
const
|
|
1011
|
+
const Ln = {
|
|
1012
1012
|
getAdapter: (t) => {
|
|
1013
1013
|
t = c.isArray(t) ? t : [t];
|
|
1014
1014
|
const { length: e } = t;
|
|
1015
1015
|
let s, n;
|
|
1016
|
-
for (let r = 0; r < e && (s = t[r], !(n = c.isString(s) ?
|
|
1016
|
+
for (let r = 0; r < e && (s = t[r], !(n = c.isString(s) ? Ce[s.toLowerCase()] : s)); r++)
|
|
1017
1017
|
;
|
|
1018
1018
|
if (!n)
|
|
1019
1019
|
throw n === !1 ? new T(
|
|
1020
1020
|
`Adapter ${s} is not supported by the environment`,
|
|
1021
1021
|
"ERR_NOT_SUPPORT"
|
|
1022
1022
|
) : new Error(
|
|
1023
|
-
c.hasOwnProp(
|
|
1023
|
+
c.hasOwnProp(Ce, s) ? `Adapter '${s}' is not available in the build` : `Unknown adapter '${s}'`
|
|
1024
1024
|
);
|
|
1025
1025
|
if (!c.isFunction(n))
|
|
1026
1026
|
throw new TypeError("adapter is not a function");
|
|
1027
1027
|
return n;
|
|
1028
1028
|
},
|
|
1029
|
-
adapters:
|
|
1029
|
+
adapters: Ce
|
|
1030
1030
|
};
|
|
1031
|
-
function
|
|
1031
|
+
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
|
|
1036
|
-
return
|
|
1035
|
+
function kt(t) {
|
|
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),
|
|
1040
|
-
return
|
|
1039
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), Ln.getAdapter(t.adapter || ut.adapter)(t).then(function(n) {
|
|
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 Kt(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
|
|
1053
|
+
const St = (t) => t instanceof F ? t.toJSON() : t;
|
|
1054
1054
|
function ae(t, e) {
|
|
1055
1055
|
e = e || {};
|
|
1056
1056
|
const s = {};
|
|
@@ -1109,23 +1109,23 @@ function ae(t, e) {
|
|
|
1109
1109
|
socketPath: i,
|
|
1110
1110
|
responseEncoding: i,
|
|
1111
1111
|
validateStatus: o,
|
|
1112
|
-
headers: (l, f) => r(
|
|
1112
|
+
headers: (l, f) => r(St(l), St(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 Gt = "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
|
|
1126
|
-
|
|
1125
|
+
const Tt = {};
|
|
1126
|
+
dt.transitional = function(e, s, n) {
|
|
1127
1127
|
function r(a, i) {
|
|
1128
|
-
return "[Axios v" +
|
|
1128
|
+
return "[Axios v" + Gt + "] Transitional option '" + a + "'" + i + (n ? ". " + n : "");
|
|
1129
1129
|
}
|
|
1130
1130
|
return (a, i, o) => {
|
|
1131
1131
|
if (e === !1)
|
|
@@ -1133,7 +1133,7 @@ ft.transitional = function(e, s, n) {
|
|
|
1133
1133
|
r(i, " has been removed" + (s ? " in " + s : "")),
|
|
1134
1134
|
T.ERR_DEPRECATED
|
|
1135
1135
|
);
|
|
1136
|
-
return s && !
|
|
1136
|
+
return s && !Tt[i] && (Tt[i] = !0, console.warn(
|
|
1137
1137
|
r(
|
|
1138
1138
|
i,
|
|
1139
1139
|
" has been deprecated since v" + s + " and will be removed in the near future"
|
|
@@ -1141,7 +1141,7 @@ ft.transitional = function(e, s, n) {
|
|
|
1141
1141
|
)), e ? e(a, i, o) : !0;
|
|
1142
1142
|
};
|
|
1143
1143
|
};
|
|
1144
|
-
function
|
|
1144
|
+
function Dn(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);
|
|
@@ -1158,15 +1158,15 @@ function Pn(t, e, s) {
|
|
|
1158
1158
|
throw new T("Unknown option " + a, T.ERR_BAD_OPTION);
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
|
-
const
|
|
1162
|
-
assertOptions:
|
|
1163
|
-
validators:
|
|
1164
|
-
}, W =
|
|
1165
|
-
class
|
|
1161
|
+
const st = {
|
|
1162
|
+
assertOptions: Dn,
|
|
1163
|
+
validators: dt
|
|
1164
|
+
}, W = st.validators;
|
|
1165
|
+
class Ie {
|
|
1166
1166
|
constructor(e) {
|
|
1167
1167
|
this.defaults = e, this.interceptors = {
|
|
1168
|
-
request: new
|
|
1169
|
-
response: new
|
|
1168
|
+
request: new bt(),
|
|
1169
|
+
response: new bt()
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
1172
|
/**
|
|
@@ -1180,13 +1180,13 @@ class je {
|
|
|
1180
1180
|
request(e, s) {
|
|
1181
1181
|
typeof e == "string" ? (s = s || {}, s.url = e) : s = e || {}, s = ae(this.defaults, s);
|
|
1182
1182
|
const { transitional: n, paramsSerializer: r, headers: a } = s;
|
|
1183
|
-
n !== void 0 &&
|
|
1183
|
+
n !== void 0 && st.assertOptions(n, {
|
|
1184
1184
|
silentJSONParsing: W.transitional(W.boolean),
|
|
1185
1185
|
forcedJSONParsing: W.transitional(W.boolean),
|
|
1186
1186
|
clarifyTimeoutError: W.transitional(W.boolean)
|
|
1187
1187
|
}, !1), r != null && (c.isFunction(r) ? s.paramsSerializer = {
|
|
1188
1188
|
serialize: r
|
|
1189
|
-
} :
|
|
1189
|
+
} : st.assertOptions(r, {
|
|
1190
1190
|
encode: W.function,
|
|
1191
1191
|
serialize: W.function
|
|
1192
1192
|
}, !0)), s.method = (s.method || this.defaults.method || "get").toLowerCase();
|
|
@@ -1211,7 +1211,7 @@ class je {
|
|
|
1211
1211
|
});
|
|
1212
1212
|
let f, _ = 0, C;
|
|
1213
1213
|
if (!u) {
|
|
1214
|
-
const g = [
|
|
1214
|
+
const g = [kt.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 je {
|
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
1230
|
try {
|
|
1231
|
-
f =
|
|
1231
|
+
f = kt.call(this, O);
|
|
1232
1232
|
} catch (g) {
|
|
1233
1233
|
return Promise.reject(g);
|
|
1234
1234
|
}
|
|
@@ -1238,12 +1238,12 @@ class je {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
getUri(e) {
|
|
1240
1240
|
e = ae(this.defaults, e);
|
|
1241
|
-
const s =
|
|
1242
|
-
return
|
|
1241
|
+
const s = qt(e.baseURL, e.url);
|
|
1242
|
+
return Ht(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
1247
|
return this.request(ae(n || {}, {
|
|
1248
1248
|
method: e,
|
|
1249
1249
|
url: s,
|
|
@@ -1264,10 +1264,10 @@ c.forEach(["post", "put", "patch"], function(e) {
|
|
|
1264
1264
|
}));
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
1267
|
-
|
|
1267
|
+
Ie.prototype[e] = s(), Ie.prototype[e + "Form"] = s(!0);
|
|
1268
1268
|
});
|
|
1269
|
-
const
|
|
1270
|
-
class
|
|
1269
|
+
const Ae = Ie;
|
|
1270
|
+
class ft {
|
|
1271
1271
|
constructor(e) {
|
|
1272
1272
|
if (typeof e != "function")
|
|
1273
1273
|
throw new TypeError("executor must be a function.");
|
|
@@ -1328,23 +1328,23 @@ class ht {
|
|
|
1328
1328
|
static source() {
|
|
1329
1329
|
let e;
|
|
1330
1330
|
return {
|
|
1331
|
-
token: new
|
|
1331
|
+
token: new ft(function(r) {
|
|
1332
1332
|
e = r;
|
|
1333
1333
|
}),
|
|
1334
1334
|
cancel: e
|
|
1335
1335
|
};
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
|
-
const
|
|
1339
|
-
function
|
|
1338
|
+
const Pn = ft;
|
|
1339
|
+
function Bn(t) {
|
|
1340
1340
|
return function(s) {
|
|
1341
1341
|
return t.apply(null, s);
|
|
1342
1342
|
};
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function Mn(t) {
|
|
1345
1345
|
return c.isObject(t) && t.isAxiosError === !0;
|
|
1346
1346
|
}
|
|
1347
|
-
const
|
|
1347
|
+
const nt = {
|
|
1348
1348
|
Continue: 100,
|
|
1349
1349
|
SwitchingProtocols: 101,
|
|
1350
1350
|
Processing: 102,
|
|
@@ -1409,48 +1409,48 @@ const rt = {
|
|
|
1409
1409
|
NotExtended: 510,
|
|
1410
1410
|
NetworkAuthenticationRequired: 511
|
|
1411
1411
|
};
|
|
1412
|
-
Object.entries(
|
|
1413
|
-
|
|
1412
|
+
Object.entries(nt).forEach(([t, e]) => {
|
|
1413
|
+
nt[e] = t;
|
|
1414
1414
|
});
|
|
1415
|
-
const
|
|
1416
|
-
function
|
|
1417
|
-
const e = new
|
|
1418
|
-
return c.extend(s,
|
|
1419
|
-
return
|
|
1415
|
+
const Un = nt;
|
|
1416
|
+
function Xt(t) {
|
|
1417
|
+
const e = new Ae(t), s = jt(Ae.prototype.request, e);
|
|
1418
|
+
return c.extend(s, Ae.prototype, e, { allOwnKeys: !0 }), c.extend(s, e, null, { allOwnKeys: !0 }), s.create = function(r) {
|
|
1419
|
+
return Xt(ae(t, r));
|
|
1420
1420
|
}, s;
|
|
1421
1421
|
}
|
|
1422
|
-
const A =
|
|
1423
|
-
A.Axios =
|
|
1422
|
+
const A = Xt(ut);
|
|
1423
|
+
A.Axios = Ae;
|
|
1424
1424
|
A.CanceledError = ke;
|
|
1425
|
-
A.CancelToken =
|
|
1426
|
-
A.isCancel =
|
|
1427
|
-
A.VERSION =
|
|
1428
|
-
A.toFormData =
|
|
1425
|
+
A.CancelToken = Pn;
|
|
1426
|
+
A.isCancel = Kt;
|
|
1427
|
+
A.VERSION = Gt;
|
|
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 =
|
|
1434
|
+
A.spread = Bn;
|
|
1435
|
+
A.isAxiosError = Mn;
|
|
1436
1436
|
A.mergeConfig = ae;
|
|
1437
1437
|
A.AxiosHeaders = F;
|
|
1438
|
-
A.formToJSON = (t) =>
|
|
1439
|
-
A.HttpStatusCode =
|
|
1438
|
+
A.formToJSON = (t) => Wt(c.isHTMLForm(t) ? new FormData(t) : t);
|
|
1439
|
+
A.HttpStatusCode = Un;
|
|
1440
1440
|
A.default = A;
|
|
1441
|
-
const
|
|
1442
|
-
function
|
|
1441
|
+
const ht = A;
|
|
1442
|
+
function pt({ apiKey: t, options: e }) {
|
|
1443
1443
|
let s = {};
|
|
1444
|
-
return t &&
|
|
1444
|
+
return t && ws(s, ["headers", "Authorization"], `API-Key ${t}`), e && (s = At(s, e)), s;
|
|
1445
1445
|
}
|
|
1446
|
-
async function
|
|
1447
|
-
return await
|
|
1446
|
+
async function Yt({ url: t, apiKey: e, options: s }) {
|
|
1447
|
+
return await ht.get(t, pt({ apiKey: e, options: s }));
|
|
1448
1448
|
}
|
|
1449
|
-
async function
|
|
1450
|
-
return await
|
|
1449
|
+
async function Qt({ url: t, apiKey: e, options: s, payload: n = {} }) {
|
|
1450
|
+
return await ht.post(t, n, pt({ apiKey: e, options: s }));
|
|
1451
1451
|
}
|
|
1452
|
-
async function
|
|
1453
|
-
return await
|
|
1452
|
+
async function zn({ url: t, apiKey: e, options: s, payload: n }) {
|
|
1453
|
+
return await ht.put(t, n, pt({ apiKey: e, options: s }));
|
|
1454
1454
|
}
|
|
1455
1455
|
async function Se(t) {
|
|
1456
1456
|
try {
|
|
@@ -1459,11 +1459,10 @@ async function Se(t) {
|
|
|
1459
1459
|
return Promise.reject(e);
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
|
-
|
|
1463
|
-
async function Hn(t, e, s) {
|
|
1462
|
+
async function $n({ apiKey: t, apiHost: e }, s, n) {
|
|
1464
1463
|
return Se(async () => {
|
|
1465
|
-
const
|
|
1466
|
-
return
|
|
1464
|
+
const r = (await Qt({ url: `${e}/api/v1/images/book/${s}`, apiKey: t, payload: n })).data;
|
|
1465
|
+
return $r.parse(r);
|
|
1467
1466
|
});
|
|
1468
1467
|
}
|
|
1469
1468
|
var E;
|
|
@@ -1502,14 +1501,14 @@ var E;
|
|
|
1502
1501
|
}
|
|
1503
1502
|
t.joinValues = n, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
1504
1503
|
})(E || (E = {}));
|
|
1505
|
-
var
|
|
1504
|
+
var rt;
|
|
1506
1505
|
(function(t) {
|
|
1507
1506
|
t.mergeShapes = (e, s) => ({
|
|
1508
1507
|
...e,
|
|
1509
1508
|
...s
|
|
1510
1509
|
// second overwrites first
|
|
1511
1510
|
});
|
|
1512
|
-
})(
|
|
1511
|
+
})(rt || (rt = {}));
|
|
1513
1512
|
const p = E.arrayToEnum([
|
|
1514
1513
|
"string",
|
|
1515
1514
|
"nan",
|
|
@@ -1569,7 +1568,7 @@ const p = E.arrayToEnum([
|
|
|
1569
1568
|
"invalid_intersection_types",
|
|
1570
1569
|
"not_multiple_of",
|
|
1571
1570
|
"not_finite"
|
|
1572
|
-
]),
|
|
1571
|
+
]), Vn = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
1573
1572
|
class D extends Error {
|
|
1574
1573
|
constructor(e) {
|
|
1575
1574
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
@@ -1682,14 +1681,14 @@ const de = (t, e) => {
|
|
|
1682
1681
|
}
|
|
1683
1682
|
return { message: s };
|
|
1684
1683
|
};
|
|
1685
|
-
let
|
|
1686
|
-
function
|
|
1687
|
-
|
|
1684
|
+
let es = de;
|
|
1685
|
+
function Fn(t) {
|
|
1686
|
+
es = t;
|
|
1688
1687
|
}
|
|
1689
|
-
function
|
|
1690
|
-
return
|
|
1688
|
+
function je() {
|
|
1689
|
+
return es;
|
|
1691
1690
|
}
|
|
1692
|
-
const
|
|
1691
|
+
const Ze = (t) => {
|
|
1693
1692
|
const { data: e, path: s, errorMaps: n, issueData: r } = t, a = [...s, ...r.path || []], i = {
|
|
1694
1693
|
...r,
|
|
1695
1694
|
path: a
|
|
@@ -1703,16 +1702,16 @@ const Le = (t) => {
|
|
|
1703
1702
|
path: a,
|
|
1704
1703
|
message: r.message || o
|
|
1705
1704
|
};
|
|
1706
|
-
},
|
|
1705
|
+
}, Hn = [];
|
|
1707
1706
|
function m(t, e) {
|
|
1708
|
-
const s =
|
|
1707
|
+
const s = Ze({
|
|
1709
1708
|
issueData: e,
|
|
1710
1709
|
data: t.data,
|
|
1711
1710
|
path: t.path,
|
|
1712
1711
|
errorMaps: [
|
|
1713
1712
|
t.common.contextualErrorMap,
|
|
1714
1713
|
t.schemaErrorMap,
|
|
1715
|
-
|
|
1714
|
+
je(),
|
|
1716
1715
|
de
|
|
1717
1716
|
// then global default map
|
|
1718
1717
|
].filter((n) => !!n)
|
|
@@ -1733,7 +1732,7 @@ class R {
|
|
|
1733
1732
|
const n = [];
|
|
1734
1733
|
for (const r of s) {
|
|
1735
1734
|
if (r.status === "aborted")
|
|
1736
|
-
return
|
|
1735
|
+
return w;
|
|
1737
1736
|
r.status === "dirty" && e.dirty(), n.push(r.value);
|
|
1738
1737
|
}
|
|
1739
1738
|
return { status: e.value, value: n };
|
|
@@ -1752,15 +1751,15 @@ class R {
|
|
|
1752
1751
|
for (const r of s) {
|
|
1753
1752
|
const { key: a, value: i } = r;
|
|
1754
1753
|
if (a.status === "aborted" || i.status === "aborted")
|
|
1755
|
-
return
|
|
1754
|
+
return w;
|
|
1756
1755
|
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), (typeof i.value < "u" || r.alwaysSet) && (n[a.value] = i.value);
|
|
1757
1756
|
}
|
|
1758
1757
|
return { status: e.value, value: n };
|
|
1759
1758
|
}
|
|
1760
1759
|
}
|
|
1761
|
-
const
|
|
1760
|
+
const w = Object.freeze({
|
|
1762
1761
|
status: "aborted"
|
|
1763
|
-
}),
|
|
1762
|
+
}), ts = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), at = (t) => t.status === "aborted", it = (t) => t.status === "dirty", Le = (t) => t.status === "valid", De = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
1764
1763
|
var y;
|
|
1765
1764
|
(function(t) {
|
|
1766
1765
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
@@ -1773,8 +1772,8 @@ class U {
|
|
|
1773
1772
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1774
1773
|
}
|
|
1775
1774
|
}
|
|
1776
|
-
const
|
|
1777
|
-
if (
|
|
1775
|
+
const Et = (t, e) => {
|
|
1776
|
+
if (Le(e))
|
|
1778
1777
|
return { success: !0, data: e.value };
|
|
1779
1778
|
if (!t.common.issues.length)
|
|
1780
1779
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -1831,7 +1830,7 @@ class k {
|
|
|
1831
1830
|
}
|
|
1832
1831
|
_parseSync(e) {
|
|
1833
1832
|
const s = this._parse(e);
|
|
1834
|
-
if (
|
|
1833
|
+
if (De(s))
|
|
1835
1834
|
throw new Error("Synchronous parse encountered promise.");
|
|
1836
1835
|
return s;
|
|
1837
1836
|
}
|
|
@@ -1859,7 +1858,7 @@ class k {
|
|
|
1859
1858
|
data: e,
|
|
1860
1859
|
parsedType: K(e)
|
|
1861
1860
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
1862
|
-
return
|
|
1861
|
+
return Et(r, a);
|
|
1863
1862
|
}
|
|
1864
1863
|
async parseAsync(e, s) {
|
|
1865
1864
|
const n = await this.safeParseAsync(e, s);
|
|
@@ -1879,8 +1878,8 @@ class k {
|
|
|
1879
1878
|
parent: null,
|
|
1880
1879
|
data: e,
|
|
1881
1880
|
parsedType: K(e)
|
|
1882
|
-
}, r = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
1883
|
-
return
|
|
1881
|
+
}, r = this._parse({ data: e, path: n.path, parent: n }), a = await (De(r) ? r : Promise.resolve(r));
|
|
1882
|
+
return Et(n, a);
|
|
1884
1883
|
}
|
|
1885
1884
|
refine(e, s) {
|
|
1886
1885
|
const n = (r) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(r) : s;
|
|
@@ -1944,7 +1943,7 @@ class k {
|
|
|
1944
1943
|
});
|
|
1945
1944
|
}
|
|
1946
1945
|
brand() {
|
|
1947
|
-
return new
|
|
1946
|
+
return new ns({
|
|
1948
1947
|
typeName: v.ZodBranded,
|
|
1949
1948
|
type: this,
|
|
1950
1949
|
...x(this._def)
|
|
@@ -1952,7 +1951,7 @@ class k {
|
|
|
1952
1951
|
}
|
|
1953
1952
|
catch(e) {
|
|
1954
1953
|
const s = typeof e == "function" ? e : () => e;
|
|
1955
|
-
return new
|
|
1954
|
+
return new Ue({
|
|
1956
1955
|
...x(this._def),
|
|
1957
1956
|
innerType: this,
|
|
1958
1957
|
catchValue: s,
|
|
@@ -1967,7 +1966,7 @@ class k {
|
|
|
1967
1966
|
});
|
|
1968
1967
|
}
|
|
1969
1968
|
pipe(e) {
|
|
1970
|
-
return
|
|
1969
|
+
return Te.create(this, e);
|
|
1971
1970
|
}
|
|
1972
1971
|
isOptional() {
|
|
1973
1972
|
return this.safeParse(void 0).success;
|
|
@@ -1976,9 +1975,9 @@ class k {
|
|
|
1976
1975
|
return this.safeParse(null).success;
|
|
1977
1976
|
}
|
|
1978
1977
|
}
|
|
1979
|
-
const
|
|
1980
|
-
function
|
|
1981
|
-
return !!((e === "v4" || !e) &&
|
|
1978
|
+
const Jn = /^c[^\s-]{8,}$/i, Wn = /^[a-z][a-z0-9]*$/, Kn = /[0-9A-HJKMNP-TV-Z]{26}/, qn = /^([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, Gn = /^(([^<>()[\]\\.,;:\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,})+))$/, Xn = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u, Yn = /^(((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}))$/, Qn = /^(([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})))$/, er = (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$");
|
|
1979
|
+
function tr(t, e) {
|
|
1980
|
+
return !!((e === "v4" || !e) && Yn.test(t) || (e === "v6" || !e) && Qn.test(t));
|
|
1982
1981
|
}
|
|
1983
1982
|
class L extends k {
|
|
1984
1983
|
constructor() {
|
|
@@ -2008,7 +2007,7 @@ class L extends k {
|
|
|
2008
2007
|
received: a.parsedType
|
|
2009
2008
|
}
|
|
2010
2009
|
//
|
|
2011
|
-
),
|
|
2010
|
+
), w;
|
|
2012
2011
|
}
|
|
2013
2012
|
const n = new R();
|
|
2014
2013
|
let r;
|
|
@@ -2049,37 +2048,37 @@ class L extends k {
|
|
|
2049
2048
|
message: a.message
|
|
2050
2049
|
}), n.dirty());
|
|
2051
2050
|
} else if (a.kind === "email")
|
|
2052
|
-
|
|
2051
|
+
Gn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2053
2052
|
validation: "email",
|
|
2054
2053
|
code: h.invalid_string,
|
|
2055
2054
|
message: a.message
|
|
2056
2055
|
}), n.dirty());
|
|
2057
2056
|
else if (a.kind === "emoji")
|
|
2058
|
-
|
|
2057
|
+
Xn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2059
2058
|
validation: "emoji",
|
|
2060
2059
|
code: h.invalid_string,
|
|
2061
2060
|
message: a.message
|
|
2062
2061
|
}), n.dirty());
|
|
2063
2062
|
else if (a.kind === "uuid")
|
|
2064
|
-
|
|
2063
|
+
qn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2065
2064
|
validation: "uuid",
|
|
2066
2065
|
code: h.invalid_string,
|
|
2067
2066
|
message: a.message
|
|
2068
2067
|
}), n.dirty());
|
|
2069
2068
|
else if (a.kind === "cuid")
|
|
2070
|
-
|
|
2069
|
+
Jn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2071
2070
|
validation: "cuid",
|
|
2072
2071
|
code: h.invalid_string,
|
|
2073
2072
|
message: a.message
|
|
2074
2073
|
}), n.dirty());
|
|
2075
2074
|
else if (a.kind === "cuid2")
|
|
2076
|
-
|
|
2075
|
+
Wn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2077
2076
|
validation: "cuid2",
|
|
2078
2077
|
code: h.invalid_string,
|
|
2079
2078
|
message: a.message
|
|
2080
2079
|
}), n.dirty());
|
|
2081
2080
|
else if (a.kind === "ulid")
|
|
2082
|
-
|
|
2081
|
+
Kn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2083
2082
|
validation: "ulid",
|
|
2084
2083
|
code: h.invalid_string,
|
|
2085
2084
|
message: a.message
|
|
@@ -2111,11 +2110,11 @@ class L extends k {
|
|
|
2111
2110
|
code: h.invalid_string,
|
|
2112
2111
|
validation: { endsWith: a.value },
|
|
2113
2112
|
message: a.message
|
|
2114
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
2113
|
+
}), n.dirty()) : a.kind === "datetime" ? er(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2115
2114
|
code: h.invalid_string,
|
|
2116
2115
|
validation: "datetime",
|
|
2117
2116
|
message: a.message
|
|
2118
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
2117
|
+
}), n.dirty()) : a.kind === "ip" ? tr(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2119
2118
|
validation: "ip",
|
|
2120
2119
|
code: h.invalid_string,
|
|
2121
2120
|
message: a.message
|
|
@@ -2265,7 +2264,7 @@ L.create = (t) => {
|
|
|
2265
2264
|
...x(t)
|
|
2266
2265
|
});
|
|
2267
2266
|
};
|
|
2268
|
-
function
|
|
2267
|
+
function sr(t, e) {
|
|
2269
2268
|
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n, a = parseInt(t.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
|
|
2270
2269
|
return a % i / Math.pow(10, r);
|
|
2271
2270
|
}
|
|
@@ -2280,7 +2279,7 @@ class q extends k {
|
|
|
2280
2279
|
code: h.invalid_type,
|
|
2281
2280
|
expected: p.number,
|
|
2282
2281
|
received: a.parsedType
|
|
2283
|
-
}),
|
|
2282
|
+
}), w;
|
|
2284
2283
|
}
|
|
2285
2284
|
let n;
|
|
2286
2285
|
const r = new R();
|
|
@@ -2304,7 +2303,7 @@ class q extends k {
|
|
|
2304
2303
|
inclusive: a.inclusive,
|
|
2305
2304
|
exact: !1,
|
|
2306
2305
|
message: a.message
|
|
2307
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
2306
|
+
}), r.dirty()) : a.kind === "multipleOf" ? sr(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2308
2307
|
code: h.not_multiple_of,
|
|
2309
2308
|
multipleOf: a.value,
|
|
2310
2309
|
message: a.message
|
|
@@ -2452,7 +2451,7 @@ class G extends k {
|
|
|
2452
2451
|
code: h.invalid_type,
|
|
2453
2452
|
expected: p.bigint,
|
|
2454
2453
|
received: a.parsedType
|
|
2455
|
-
}),
|
|
2454
|
+
}), w;
|
|
2456
2455
|
}
|
|
2457
2456
|
let n;
|
|
2458
2457
|
const r = new R();
|
|
@@ -2577,7 +2576,7 @@ class fe extends k {
|
|
|
2577
2576
|
code: h.invalid_type,
|
|
2578
2577
|
expected: p.boolean,
|
|
2579
2578
|
received: n.parsedType
|
|
2580
|
-
}),
|
|
2579
|
+
}), w;
|
|
2581
2580
|
}
|
|
2582
2581
|
return I(e.data);
|
|
2583
2582
|
}
|
|
@@ -2595,13 +2594,13 @@ class Q extends k {
|
|
|
2595
2594
|
code: h.invalid_type,
|
|
2596
2595
|
expected: p.date,
|
|
2597
2596
|
received: a.parsedType
|
|
2598
|
-
}),
|
|
2597
|
+
}), w;
|
|
2599
2598
|
}
|
|
2600
2599
|
if (isNaN(e.data.getTime())) {
|
|
2601
2600
|
const a = this._getOrReturnCtx(e);
|
|
2602
2601
|
return m(a, {
|
|
2603
2602
|
code: h.invalid_date
|
|
2604
|
-
}),
|
|
2603
|
+
}), w;
|
|
2605
2604
|
}
|
|
2606
2605
|
const n = new R();
|
|
2607
2606
|
let r;
|
|
@@ -2665,7 +2664,7 @@ Q.create = (t) => new Q({
|
|
|
2665
2664
|
typeName: v.ZodDate,
|
|
2666
2665
|
...x(t)
|
|
2667
2666
|
});
|
|
2668
|
-
class
|
|
2667
|
+
class Pe extends k {
|
|
2669
2668
|
_parse(e) {
|
|
2670
2669
|
if (this._getType(e) !== p.symbol) {
|
|
2671
2670
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2673,12 +2672,12 @@ class Be extends k {
|
|
|
2673
2672
|
code: h.invalid_type,
|
|
2674
2673
|
expected: p.symbol,
|
|
2675
2674
|
received: n.parsedType
|
|
2676
|
-
}),
|
|
2675
|
+
}), w;
|
|
2677
2676
|
}
|
|
2678
2677
|
return I(e.data);
|
|
2679
2678
|
}
|
|
2680
2679
|
}
|
|
2681
|
-
|
|
2680
|
+
Pe.create = (t) => new Pe({
|
|
2682
2681
|
typeName: v.ZodSymbol,
|
|
2683
2682
|
...x(t)
|
|
2684
2683
|
});
|
|
@@ -2690,7 +2689,7 @@ class he extends k {
|
|
|
2690
2689
|
code: h.invalid_type,
|
|
2691
2690
|
expected: p.undefined,
|
|
2692
2691
|
received: n.parsedType
|
|
2693
|
-
}),
|
|
2692
|
+
}), w;
|
|
2694
2693
|
}
|
|
2695
2694
|
return I(e.data);
|
|
2696
2695
|
}
|
|
@@ -2707,7 +2706,7 @@ class pe extends k {
|
|
|
2707
2706
|
code: h.invalid_type,
|
|
2708
2707
|
expected: p.null,
|
|
2709
2708
|
received: n.parsedType
|
|
2710
|
-
}),
|
|
2709
|
+
}), w;
|
|
2711
2710
|
}
|
|
2712
2711
|
return I(e.data);
|
|
2713
2712
|
}
|
|
@@ -2747,14 +2746,14 @@ class J extends k {
|
|
|
2747
2746
|
code: h.invalid_type,
|
|
2748
2747
|
expected: p.never,
|
|
2749
2748
|
received: s.parsedType
|
|
2750
|
-
}),
|
|
2749
|
+
}), w;
|
|
2751
2750
|
}
|
|
2752
2751
|
}
|
|
2753
2752
|
J.create = (t) => new J({
|
|
2754
2753
|
typeName: v.ZodNever,
|
|
2755
2754
|
...x(t)
|
|
2756
2755
|
});
|
|
2757
|
-
class
|
|
2756
|
+
class Be extends k {
|
|
2758
2757
|
_parse(e) {
|
|
2759
2758
|
if (this._getType(e) !== p.undefined) {
|
|
2760
2759
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2762,12 +2761,12 @@ class Me extends k {
|
|
|
2762
2761
|
code: h.invalid_type,
|
|
2763
2762
|
expected: p.void,
|
|
2764
2763
|
received: n.parsedType
|
|
2765
|
-
}),
|
|
2764
|
+
}), w;
|
|
2766
2765
|
}
|
|
2767
2766
|
return I(e.data);
|
|
2768
2767
|
}
|
|
2769
2768
|
}
|
|
2770
|
-
|
|
2769
|
+
Be.create = (t) => new Be({
|
|
2771
2770
|
typeName: v.ZodVoid,
|
|
2772
2771
|
...x(t)
|
|
2773
2772
|
});
|
|
@@ -2779,7 +2778,7 @@ class P extends k {
|
|
|
2779
2778
|
code: h.invalid_type,
|
|
2780
2779
|
expected: p.array,
|
|
2781
2780
|
received: s.parsedType
|
|
2782
|
-
}),
|
|
2781
|
+
}), w;
|
|
2783
2782
|
if (r.exactLength !== null) {
|
|
2784
2783
|
const i = s.data.length > r.exactLength.value, o = s.data.length < r.exactLength.value;
|
|
2785
2784
|
(i || o) && (m(s, {
|
|
@@ -2878,7 +2877,7 @@ class N extends k {
|
|
|
2878
2877
|
code: h.invalid_type,
|
|
2879
2878
|
expected: p.object,
|
|
2880
2879
|
received: l.parsedType
|
|
2881
|
-
}),
|
|
2880
|
+
}), w;
|
|
2882
2881
|
}
|
|
2883
2882
|
const { status: n, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
2884
2883
|
if (!(this._def.catchall instanceof J && this._def.unknownKeys === "strip"))
|
|
@@ -3125,7 +3124,7 @@ class N extends k {
|
|
|
3125
3124
|
});
|
|
3126
3125
|
}
|
|
3127
3126
|
keyof() {
|
|
3128
|
-
return
|
|
3127
|
+
return ss(E.objectKeys(this.shape));
|
|
3129
3128
|
}
|
|
3130
3129
|
}
|
|
3131
3130
|
N.create = (t, e) => new N({
|
|
@@ -3163,7 +3162,7 @@ class me extends k {
|
|
|
3163
3162
|
return m(s, {
|
|
3164
3163
|
code: h.invalid_union,
|
|
3165
3164
|
unionErrors: i
|
|
3166
|
-
}),
|
|
3165
|
+
}), w;
|
|
3167
3166
|
}
|
|
3168
3167
|
if (s.common.async)
|
|
3169
3168
|
return Promise.all(n.map(async (a) => {
|
|
@@ -3210,7 +3209,7 @@ class me extends k {
|
|
|
3210
3209
|
return m(s, {
|
|
3211
3210
|
code: h.invalid_union,
|
|
3212
3211
|
unionErrors: o
|
|
3213
|
-
}),
|
|
3212
|
+
}), w;
|
|
3214
3213
|
}
|
|
3215
3214
|
}
|
|
3216
3215
|
get options() {
|
|
@@ -3222,8 +3221,8 @@ me.create = (t, e) => new me({
|
|
|
3222
3221
|
typeName: v.ZodUnion,
|
|
3223
3222
|
...x(e)
|
|
3224
3223
|
});
|
|
3225
|
-
const
|
|
3226
|
-
class
|
|
3224
|
+
const Re = (t) => t instanceof ve ? Re(t.schema) : t instanceof B ? Re(t.innerType()) : t instanceof _e ? [t.value] : t instanceof X ? t.options : t instanceof be ? Object.keys(t.enum) : t instanceof we ? Re(t._def.innerType) : t instanceof he ? [void 0] : t instanceof pe ? [null] : null;
|
|
3225
|
+
class Ke extends k {
|
|
3227
3226
|
_parse(e) {
|
|
3228
3227
|
const { ctx: s } = this._processInputParams(e);
|
|
3229
3228
|
if (s.parsedType !== p.object)
|
|
@@ -3231,7 +3230,7 @@ class qe extends k {
|
|
|
3231
3230
|
code: h.invalid_type,
|
|
3232
3231
|
expected: p.object,
|
|
3233
3232
|
received: s.parsedType
|
|
3234
|
-
}),
|
|
3233
|
+
}), w;
|
|
3235
3234
|
const n = this.discriminator, r = s.data[n], a = this.optionsMap.get(r);
|
|
3236
3235
|
return a ? s.common.async ? a._parseAsync({
|
|
3237
3236
|
data: s.data,
|
|
@@ -3245,7 +3244,7 @@ class qe extends k {
|
|
|
3245
3244
|
code: h.invalid_union_discriminator,
|
|
3246
3245
|
options: Array.from(this.optionsMap.keys()),
|
|
3247
3246
|
path: [n]
|
|
3248
|
-
}),
|
|
3247
|
+
}), w);
|
|
3249
3248
|
}
|
|
3250
3249
|
get discriminator() {
|
|
3251
3250
|
return this._def.discriminator;
|
|
@@ -3267,7 +3266,7 @@ class qe extends k {
|
|
|
3267
3266
|
static create(e, s, n) {
|
|
3268
3267
|
const r = /* @__PURE__ */ new Map();
|
|
3269
3268
|
for (const a of s) {
|
|
3270
|
-
const i =
|
|
3269
|
+
const i = Re(a.shape[e]);
|
|
3271
3270
|
if (!i)
|
|
3272
3271
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
3273
3272
|
for (const o of i) {
|
|
@@ -3276,7 +3275,7 @@ class qe extends k {
|
|
|
3276
3275
|
r.set(o, a);
|
|
3277
3276
|
}
|
|
3278
3277
|
}
|
|
3279
|
-
return new
|
|
3278
|
+
return new Ke({
|
|
3280
3279
|
typeName: v.ZodDiscriminatedUnion,
|
|
3281
3280
|
discriminator: e,
|
|
3282
3281
|
options: s,
|
|
@@ -3285,14 +3284,14 @@ class qe extends k {
|
|
|
3285
3284
|
});
|
|
3286
3285
|
}
|
|
3287
3286
|
}
|
|
3288
|
-
function
|
|
3287
|
+
function ot(t, e) {
|
|
3289
3288
|
const s = K(t), n = K(e);
|
|
3290
3289
|
if (t === e)
|
|
3291
3290
|
return { valid: !0, data: t };
|
|
3292
3291
|
if (s === p.object && n === p.object) {
|
|
3293
3292
|
const r = E.objectKeys(e), a = E.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = { ...t, ...e };
|
|
3294
3293
|
for (const o of a) {
|
|
3295
|
-
const u =
|
|
3294
|
+
const u = ot(t[o], e[o]);
|
|
3296
3295
|
if (!u.valid)
|
|
3297
3296
|
return { valid: !1 };
|
|
3298
3297
|
i[o] = u.data;
|
|
@@ -3303,7 +3302,7 @@ function lt(t, e) {
|
|
|
3303
3302
|
return { valid: !1 };
|
|
3304
3303
|
const r = [];
|
|
3305
3304
|
for (let a = 0; a < t.length; a++) {
|
|
3306
|
-
const i = t[a], o = e[a], u =
|
|
3305
|
+
const i = t[a], o = e[a], u = ot(i, o);
|
|
3307
3306
|
if (!u.valid)
|
|
3308
3307
|
return { valid: !1 };
|
|
3309
3308
|
r.push(u.data);
|
|
@@ -3315,12 +3314,12 @@ function lt(t, e) {
|
|
|
3315
3314
|
class ye extends k {
|
|
3316
3315
|
_parse(e) {
|
|
3317
3316
|
const { status: s, ctx: n } = this._processInputParams(e), r = (a, i) => {
|
|
3318
|
-
if (
|
|
3319
|
-
return
|
|
3320
|
-
const o =
|
|
3321
|
-
return o.valid ? ((
|
|
3317
|
+
if (at(a) || at(i))
|
|
3318
|
+
return w;
|
|
3319
|
+
const o = ot(a.value, i.value);
|
|
3320
|
+
return o.valid ? ((it(a) || it(i)) && s.dirty(), { status: s.value, value: o.data }) : (m(n, {
|
|
3322
3321
|
code: h.invalid_intersection_types
|
|
3323
|
-
}),
|
|
3322
|
+
}), w);
|
|
3324
3323
|
};
|
|
3325
3324
|
return n.common.async ? Promise.all([
|
|
3326
3325
|
this._def.left._parseAsync({
|
|
@@ -3358,7 +3357,7 @@ class z extends k {
|
|
|
3358
3357
|
code: h.invalid_type,
|
|
3359
3358
|
expected: p.array,
|
|
3360
3359
|
received: n.parsedType
|
|
3361
|
-
}),
|
|
3360
|
+
}), w;
|
|
3362
3361
|
if (n.data.length < this._def.items.length)
|
|
3363
3362
|
return m(n, {
|
|
3364
3363
|
code: h.too_small,
|
|
@@ -3366,7 +3365,7 @@ class z extends k {
|
|
|
3366
3365
|
inclusive: !0,
|
|
3367
3366
|
exact: !1,
|
|
3368
3367
|
type: "array"
|
|
3369
|
-
}),
|
|
3368
|
+
}), w;
|
|
3370
3369
|
!this._def.rest && n.data.length > this._def.items.length && (m(n, {
|
|
3371
3370
|
code: h.too_big,
|
|
3372
3371
|
maximum: this._def.items.length,
|
|
@@ -3414,7 +3413,7 @@ class ge extends k {
|
|
|
3414
3413
|
code: h.invalid_type,
|
|
3415
3414
|
expected: p.object,
|
|
3416
3415
|
received: n.parsedType
|
|
3417
|
-
}),
|
|
3416
|
+
}), w;
|
|
3418
3417
|
const r = [], a = this._def.keyType, i = this._def.valueType;
|
|
3419
3418
|
for (const o in n.data)
|
|
3420
3419
|
r.push({
|
|
@@ -3440,7 +3439,7 @@ class ge extends k {
|
|
|
3440
3439
|
});
|
|
3441
3440
|
}
|
|
3442
3441
|
}
|
|
3443
|
-
class
|
|
3442
|
+
class Me extends k {
|
|
3444
3443
|
_parse(e) {
|
|
3445
3444
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
3446
3445
|
if (n.parsedType !== p.map)
|
|
@@ -3448,7 +3447,7 @@ class Ue extends k {
|
|
|
3448
3447
|
code: h.invalid_type,
|
|
3449
3448
|
expected: p.map,
|
|
3450
3449
|
received: n.parsedType
|
|
3451
|
-
}),
|
|
3450
|
+
}), w;
|
|
3452
3451
|
const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, u], l) => ({
|
|
3453
3452
|
key: r._parse(new U(n, o, n.path, [l, "key"])),
|
|
3454
3453
|
value: a._parse(new U(n, u, n.path, [l, "value"]))
|
|
@@ -3459,7 +3458,7 @@ class Ue extends k {
|
|
|
3459
3458
|
for (const u of i) {
|
|
3460
3459
|
const l = await u.key, f = await u.value;
|
|
3461
3460
|
if (l.status === "aborted" || f.status === "aborted")
|
|
3462
|
-
return
|
|
3461
|
+
return w;
|
|
3463
3462
|
(l.status === "dirty" || f.status === "dirty") && s.dirty(), o.set(l.value, f.value);
|
|
3464
3463
|
}
|
|
3465
3464
|
return { status: s.value, value: o };
|
|
@@ -3469,14 +3468,14 @@ class Ue extends k {
|
|
|
3469
3468
|
for (const u of i) {
|
|
3470
3469
|
const l = u.key, f = u.value;
|
|
3471
3470
|
if (l.status === "aborted" || f.status === "aborted")
|
|
3472
|
-
return
|
|
3471
|
+
return w;
|
|
3473
3472
|
(l.status === "dirty" || f.status === "dirty") && s.dirty(), o.set(l.value, f.value);
|
|
3474
3473
|
}
|
|
3475
3474
|
return { status: s.value, value: o };
|
|
3476
3475
|
}
|
|
3477
3476
|
}
|
|
3478
3477
|
}
|
|
3479
|
-
|
|
3478
|
+
Me.create = (t, e, s) => new Me({
|
|
3480
3479
|
valueType: e,
|
|
3481
3480
|
keyType: t,
|
|
3482
3481
|
typeName: v.ZodMap,
|
|
@@ -3490,7 +3489,7 @@ class ee extends k {
|
|
|
3490
3489
|
code: h.invalid_type,
|
|
3491
3490
|
expected: p.set,
|
|
3492
3491
|
received: n.parsedType
|
|
3493
|
-
}),
|
|
3492
|
+
}), w;
|
|
3494
3493
|
const r = this._def;
|
|
3495
3494
|
r.minSize !== null && n.data.size < r.minSize.value && (m(n, {
|
|
3496
3495
|
code: h.too_small,
|
|
@@ -3512,7 +3511,7 @@ class ee extends k {
|
|
|
3512
3511
|
const l = /* @__PURE__ */ new Set();
|
|
3513
3512
|
for (const f of u) {
|
|
3514
3513
|
if (f.status === "aborted")
|
|
3515
|
-
return
|
|
3514
|
+
return w;
|
|
3516
3515
|
f.status === "dirty" && s.dirty(), l.add(f.value);
|
|
3517
3516
|
}
|
|
3518
3517
|
return { status: s.value, value: l };
|
|
@@ -3557,15 +3556,15 @@ class re extends k {
|
|
|
3557
3556
|
code: h.invalid_type,
|
|
3558
3557
|
expected: p.function,
|
|
3559
3558
|
received: s.parsedType
|
|
3560
|
-
}),
|
|
3559
|
+
}), w;
|
|
3561
3560
|
function n(o, u) {
|
|
3562
|
-
return
|
|
3561
|
+
return Ze({
|
|
3563
3562
|
data: o,
|
|
3564
3563
|
path: s.path,
|
|
3565
3564
|
errorMaps: [
|
|
3566
3565
|
s.common.contextualErrorMap,
|
|
3567
3566
|
s.schemaErrorMap,
|
|
3568
|
-
|
|
3567
|
+
je(),
|
|
3569
3568
|
de
|
|
3570
3569
|
].filter((l) => !!l),
|
|
3571
3570
|
issueData: {
|
|
@@ -3575,13 +3574,13 @@ class re extends k {
|
|
|
3575
3574
|
});
|
|
3576
3575
|
}
|
|
3577
3576
|
function r(o, u) {
|
|
3578
|
-
return
|
|
3577
|
+
return Ze({
|
|
3579
3578
|
data: o,
|
|
3580
3579
|
path: s.path,
|
|
3581
3580
|
errorMaps: [
|
|
3582
3581
|
s.common.contextualErrorMap,
|
|
3583
3582
|
s.schemaErrorMap,
|
|
3584
|
-
|
|
3583
|
+
je(),
|
|
3585
3584
|
de
|
|
3586
3585
|
].filter((l) => !!l),
|
|
3587
3586
|
issueData: {
|
|
@@ -3663,7 +3662,7 @@ class _e extends k {
|
|
|
3663
3662
|
received: s.data,
|
|
3664
3663
|
code: h.invalid_literal,
|
|
3665
3664
|
expected: this._def.value
|
|
3666
|
-
}),
|
|
3665
|
+
}), w;
|
|
3667
3666
|
}
|
|
3668
3667
|
return { status: "valid", value: e.data };
|
|
3669
3668
|
}
|
|
@@ -3676,7 +3675,7 @@ _e.create = (t, e) => new _e({
|
|
|
3676
3675
|
typeName: v.ZodLiteral,
|
|
3677
3676
|
...x(e)
|
|
3678
3677
|
});
|
|
3679
|
-
function
|
|
3678
|
+
function ss(t, e) {
|
|
3680
3679
|
return new X({
|
|
3681
3680
|
values: t,
|
|
3682
3681
|
typeName: v.ZodEnum,
|
|
@@ -3691,7 +3690,7 @@ class X extends k {
|
|
|
3691
3690
|
expected: E.joinValues(n),
|
|
3692
3691
|
received: s.parsedType,
|
|
3693
3692
|
code: h.invalid_type
|
|
3694
|
-
}),
|
|
3693
|
+
}), w;
|
|
3695
3694
|
}
|
|
3696
3695
|
if (this._def.values.indexOf(e.data) === -1) {
|
|
3697
3696
|
const s = this._getOrReturnCtx(e), n = this._def.values;
|
|
@@ -3699,7 +3698,7 @@ class X extends k {
|
|
|
3699
3698
|
received: s.data,
|
|
3700
3699
|
code: h.invalid_enum_value,
|
|
3701
3700
|
options: n
|
|
3702
|
-
}),
|
|
3701
|
+
}), w;
|
|
3703
3702
|
}
|
|
3704
3703
|
return I(e.data);
|
|
3705
3704
|
}
|
|
@@ -3731,7 +3730,7 @@ class X extends k {
|
|
|
3731
3730
|
return X.create(this.options.filter((s) => !e.includes(s)));
|
|
3732
3731
|
}
|
|
3733
3732
|
}
|
|
3734
|
-
X.create =
|
|
3733
|
+
X.create = ss;
|
|
3735
3734
|
class be extends k {
|
|
3736
3735
|
_parse(e) {
|
|
3737
3736
|
const s = E.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -3741,7 +3740,7 @@ class be extends k {
|
|
|
3741
3740
|
expected: E.joinValues(r),
|
|
3742
3741
|
received: n.parsedType,
|
|
3743
3742
|
code: h.invalid_type
|
|
3744
|
-
}),
|
|
3743
|
+
}), w;
|
|
3745
3744
|
}
|
|
3746
3745
|
if (s.indexOf(e.data) === -1) {
|
|
3747
3746
|
const r = E.objectValues(s);
|
|
@@ -3749,7 +3748,7 @@ class be extends k {
|
|
|
3749
3748
|
received: n.data,
|
|
3750
3749
|
code: h.invalid_enum_value,
|
|
3751
3750
|
options: r
|
|
3752
|
-
}),
|
|
3751
|
+
}), w;
|
|
3753
3752
|
}
|
|
3754
3753
|
return I(e.data);
|
|
3755
3754
|
}
|
|
@@ -3773,7 +3772,7 @@ class oe extends k {
|
|
|
3773
3772
|
code: h.invalid_type,
|
|
3774
3773
|
expected: p.promise,
|
|
3775
3774
|
received: s.parsedType
|
|
3776
|
-
}),
|
|
3775
|
+
}), w;
|
|
3777
3776
|
const n = s.parsedType === p.promise ? s.data : Promise.resolve(s.data);
|
|
3778
3777
|
return I(n.then((r) => this._def.type.parseAsync(r, {
|
|
3779
3778
|
path: s.path,
|
|
@@ -3830,9 +3829,9 @@ class B extends k {
|
|
|
3830
3829
|
path: n.path,
|
|
3831
3830
|
parent: n
|
|
3832
3831
|
});
|
|
3833
|
-
return o.status === "aborted" ?
|
|
3832
|
+
return o.status === "aborted" ? w : (o.status === "dirty" && s.dirty(), i(o.value), { status: s.value, value: o.value });
|
|
3834
3833
|
} else
|
|
3835
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ?
|
|
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(), i(o.value).then(() => ({ status: s.value, value: o.value }))));
|
|
3836
3835
|
}
|
|
3837
3836
|
if (r.type === "transform")
|
|
3838
3837
|
if (n.common.async === !1) {
|
|
@@ -3841,14 +3840,14 @@ class B extends k {
|
|
|
3841
3840
|
path: n.path,
|
|
3842
3841
|
parent: n
|
|
3843
3842
|
});
|
|
3844
|
-
if (!
|
|
3843
|
+
if (!Le(i))
|
|
3845
3844
|
return i;
|
|
3846
3845
|
const o = r.transform(i.value, a);
|
|
3847
3846
|
if (o instanceof Promise)
|
|
3848
3847
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3849
3848
|
return { status: s.value, value: o };
|
|
3850
3849
|
} else
|
|
3851
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
3850
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => Le(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: s.value, value: o })) : i);
|
|
3852
3851
|
E.assertNever(r);
|
|
3853
3852
|
}
|
|
3854
3853
|
}
|
|
@@ -3910,7 +3909,7 @@ we.create = (t, e) => new we({
|
|
|
3910
3909
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
3911
3910
|
...x(e)
|
|
3912
3911
|
});
|
|
3913
|
-
class
|
|
3912
|
+
class Ue extends k {
|
|
3914
3913
|
_parse(e) {
|
|
3915
3914
|
const { ctx: s } = this._processInputParams(e), n = {
|
|
3916
3915
|
...s,
|
|
@@ -3925,7 +3924,7 @@ class ze extends k {
|
|
|
3925
3924
|
...n
|
|
3926
3925
|
}
|
|
3927
3926
|
});
|
|
3928
|
-
return
|
|
3927
|
+
return De(r) ? r.then((a) => ({
|
|
3929
3928
|
status: "valid",
|
|
3930
3929
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
3931
3930
|
get error() {
|
|
@@ -3947,13 +3946,13 @@ class ze extends k {
|
|
|
3947
3946
|
return this._def.innerType;
|
|
3948
3947
|
}
|
|
3949
3948
|
}
|
|
3950
|
-
|
|
3949
|
+
Ue.create = (t, e) => new Ue({
|
|
3951
3950
|
innerType: t,
|
|
3952
3951
|
typeName: v.ZodCatch,
|
|
3953
3952
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
3954
3953
|
...x(e)
|
|
3955
3954
|
});
|
|
3956
|
-
class
|
|
3955
|
+
class ze extends k {
|
|
3957
3956
|
_parse(e) {
|
|
3958
3957
|
if (this._getType(e) !== p.nan) {
|
|
3959
3958
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3961,17 +3960,17 @@ class $e extends k {
|
|
|
3961
3960
|
code: h.invalid_type,
|
|
3962
3961
|
expected: p.nan,
|
|
3963
3962
|
received: n.parsedType
|
|
3964
|
-
}),
|
|
3963
|
+
}), w;
|
|
3965
3964
|
}
|
|
3966
3965
|
return { status: "valid", value: e.data };
|
|
3967
3966
|
}
|
|
3968
3967
|
}
|
|
3969
|
-
|
|
3968
|
+
ze.create = (t) => new ze({
|
|
3970
3969
|
typeName: v.ZodNaN,
|
|
3971
3970
|
...x(t)
|
|
3972
3971
|
});
|
|
3973
|
-
const
|
|
3974
|
-
class
|
|
3972
|
+
const nr = Symbol("zod_brand");
|
|
3973
|
+
class ns extends k {
|
|
3975
3974
|
_parse(e) {
|
|
3976
3975
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
3977
3976
|
return this._def.type._parse({
|
|
@@ -3984,7 +3983,7 @@ class rs extends k {
|
|
|
3984
3983
|
return this._def.type;
|
|
3985
3984
|
}
|
|
3986
3985
|
}
|
|
3987
|
-
class
|
|
3986
|
+
class Te extends k {
|
|
3988
3987
|
_parse(e) {
|
|
3989
3988
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
3990
3989
|
if (n.common.async)
|
|
@@ -3994,7 +3993,7 @@ class Ee extends k {
|
|
|
3994
3993
|
path: n.path,
|
|
3995
3994
|
parent: n
|
|
3996
3995
|
});
|
|
3997
|
-
return a.status === "aborted" ?
|
|
3996
|
+
return a.status === "aborted" ? w : a.status === "dirty" ? (s.dirty(), ts(a.value)) : this._def.out._parseAsync({
|
|
3998
3997
|
data: a.value,
|
|
3999
3998
|
path: n.path,
|
|
4000
3999
|
parent: n
|
|
@@ -4006,7 +4005,7 @@ class Ee extends k {
|
|
|
4006
4005
|
path: n.path,
|
|
4007
4006
|
parent: n
|
|
4008
4007
|
});
|
|
4009
|
-
return r.status === "aborted" ?
|
|
4008
|
+
return r.status === "aborted" ? w : r.status === "dirty" ? (s.dirty(), {
|
|
4010
4009
|
status: "dirty",
|
|
4011
4010
|
value: r.value
|
|
4012
4011
|
}) : this._def.out._parseSync({
|
|
@@ -4017,29 +4016,29 @@ class Ee extends k {
|
|
|
4017
4016
|
}
|
|
4018
4017
|
}
|
|
4019
4018
|
static create(e, s) {
|
|
4020
|
-
return new
|
|
4019
|
+
return new Te({
|
|
4021
4020
|
in: e,
|
|
4022
4021
|
out: s,
|
|
4023
4022
|
typeName: v.ZodPipeline
|
|
4024
4023
|
});
|
|
4025
4024
|
}
|
|
4026
4025
|
}
|
|
4027
|
-
const
|
|
4026
|
+
const rs = (t, e = {}, s) => t ? ie.create().superRefine((n, r) => {
|
|
4028
4027
|
var a, i;
|
|
4029
4028
|
if (!t(n)) {
|
|
4030
4029
|
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : s) !== null && i !== void 0 ? i : !0, l = typeof o == "string" ? { message: o } : o;
|
|
4031
4030
|
r.addIssue({ code: "custom", ...l, fatal: u });
|
|
4032
4031
|
}
|
|
4033
|
-
}) : ie.create(),
|
|
4032
|
+
}) : ie.create(), rr = {
|
|
4034
4033
|
object: N.lazycreate
|
|
4035
4034
|
};
|
|
4036
4035
|
var v;
|
|
4037
4036
|
(function(t) {
|
|
4038
4037
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline";
|
|
4039
4038
|
})(v || (v = {}));
|
|
4040
|
-
const
|
|
4039
|
+
const ar = (t, e = {
|
|
4041
4040
|
message: `Input not instance of ${t.name}`
|
|
4042
|
-
}) =>
|
|
4041
|
+
}) => rs((s) => s instanceof t, e), as = L.create, is = q.create, ir = ze.create, or = G.create, os = fe.create, lr = Q.create, cr = Pe.create, ur = he.create, dr = pe.create, fr = ie.create, hr = Y.create, pr = J.create, mr = Be.create, yr = P.create, gr = N.create, vr = N.strictCreate, _r = me.create, br = Ke.create, wr = ye.create, xr = z.create, kr = ge.create, Sr = Me.create, Tr = ee.create, Er = re.create, Or = ve.create, Nr = _e.create, Cr = X.create, Ar = be.create, Rr = oe.create, Ot = B.create, Ir = H.create, jr = te.create, Zr = B.createWithPreprocess, Lr = Te.create, Dr = () => as().optional(), Pr = () => is().optional(), Br = () => os().optional(), Mr = {
|
|
4043
4042
|
string: (t) => L.create({ ...t, coerce: !0 }),
|
|
4044
4043
|
number: (t) => q.create({ ...t, coerce: !0 }),
|
|
4045
4044
|
boolean: (t) => fe.create({
|
|
@@ -4048,28 +4047,28 @@ const lr = (t, e = {
|
|
|
4048
4047
|
}),
|
|
4049
4048
|
bigint: (t) => G.create({ ...t, coerce: !0 }),
|
|
4050
4049
|
date: (t) => Q.create({ ...t, coerce: !0 })
|
|
4051
|
-
},
|
|
4050
|
+
}, Ur = w;
|
|
4052
4051
|
var d = /* @__PURE__ */ Object.freeze({
|
|
4053
4052
|
__proto__: null,
|
|
4054
4053
|
defaultErrorMap: de,
|
|
4055
|
-
setErrorMap:
|
|
4056
|
-
getErrorMap:
|
|
4057
|
-
makeIssue:
|
|
4058
|
-
EMPTY_PATH:
|
|
4054
|
+
setErrorMap: Fn,
|
|
4055
|
+
getErrorMap: je,
|
|
4056
|
+
makeIssue: Ze,
|
|
4057
|
+
EMPTY_PATH: Hn,
|
|
4059
4058
|
addIssueToContext: m,
|
|
4060
4059
|
ParseStatus: R,
|
|
4061
|
-
INVALID:
|
|
4062
|
-
DIRTY:
|
|
4060
|
+
INVALID: w,
|
|
4061
|
+
DIRTY: ts,
|
|
4063
4062
|
OK: I,
|
|
4064
|
-
isAborted:
|
|
4065
|
-
isDirty:
|
|
4066
|
-
isValid:
|
|
4067
|
-
isAsync:
|
|
4063
|
+
isAborted: at,
|
|
4064
|
+
isDirty: it,
|
|
4065
|
+
isValid: Le,
|
|
4066
|
+
isAsync: De,
|
|
4068
4067
|
get util() {
|
|
4069
4068
|
return E;
|
|
4070
4069
|
},
|
|
4071
4070
|
get objectUtil() {
|
|
4072
|
-
return
|
|
4071
|
+
return rt;
|
|
4073
4072
|
},
|
|
4074
4073
|
ZodParsedType: p,
|
|
4075
4074
|
getParsedType: K,
|
|
@@ -4079,21 +4078,21 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
4079
4078
|
ZodBigInt: G,
|
|
4080
4079
|
ZodBoolean: fe,
|
|
4081
4080
|
ZodDate: Q,
|
|
4082
|
-
ZodSymbol:
|
|
4081
|
+
ZodSymbol: Pe,
|
|
4083
4082
|
ZodUndefined: he,
|
|
4084
4083
|
ZodNull: pe,
|
|
4085
4084
|
ZodAny: ie,
|
|
4086
4085
|
ZodUnknown: Y,
|
|
4087
4086
|
ZodNever: J,
|
|
4088
|
-
ZodVoid:
|
|
4087
|
+
ZodVoid: Be,
|
|
4089
4088
|
ZodArray: P,
|
|
4090
4089
|
ZodObject: N,
|
|
4091
4090
|
ZodUnion: me,
|
|
4092
|
-
ZodDiscriminatedUnion:
|
|
4091
|
+
ZodDiscriminatedUnion: Ke,
|
|
4093
4092
|
ZodIntersection: ye,
|
|
4094
4093
|
ZodTuple: z,
|
|
4095
4094
|
ZodRecord: ge,
|
|
4096
|
-
ZodMap:
|
|
4095
|
+
ZodMap: Me,
|
|
4097
4096
|
ZodSet: ee,
|
|
4098
4097
|
ZodFunction: re,
|
|
4099
4098
|
ZodLazy: ve,
|
|
@@ -4106,78 +4105,78 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
4106
4105
|
ZodOptional: H,
|
|
4107
4106
|
ZodNullable: te,
|
|
4108
4107
|
ZodDefault: we,
|
|
4109
|
-
ZodCatch:
|
|
4110
|
-
ZodNaN:
|
|
4111
|
-
BRAND:
|
|
4112
|
-
ZodBranded:
|
|
4113
|
-
ZodPipeline:
|
|
4114
|
-
custom:
|
|
4108
|
+
ZodCatch: Ue,
|
|
4109
|
+
ZodNaN: ze,
|
|
4110
|
+
BRAND: nr,
|
|
4111
|
+
ZodBranded: ns,
|
|
4112
|
+
ZodPipeline: Te,
|
|
4113
|
+
custom: rs,
|
|
4115
4114
|
Schema: k,
|
|
4116
4115
|
ZodSchema: k,
|
|
4117
|
-
late:
|
|
4116
|
+
late: rr,
|
|
4118
4117
|
get ZodFirstPartyTypeKind() {
|
|
4119
4118
|
return v;
|
|
4120
4119
|
},
|
|
4121
|
-
coerce:
|
|
4122
|
-
any:
|
|
4123
|
-
array:
|
|
4124
|
-
bigint:
|
|
4125
|
-
boolean:
|
|
4126
|
-
date:
|
|
4127
|
-
discriminatedUnion:
|
|
4128
|
-
effect:
|
|
4129
|
-
enum:
|
|
4130
|
-
function:
|
|
4131
|
-
instanceof:
|
|
4132
|
-
intersection:
|
|
4133
|
-
lazy:
|
|
4134
|
-
literal:
|
|
4135
|
-
map:
|
|
4136
|
-
nan:
|
|
4137
|
-
nativeEnum:
|
|
4138
|
-
never:
|
|
4139
|
-
null:
|
|
4140
|
-
nullable:
|
|
4141
|
-
number:
|
|
4142
|
-
object:
|
|
4143
|
-
oboolean:
|
|
4144
|
-
onumber:
|
|
4145
|
-
optional:
|
|
4146
|
-
ostring:
|
|
4147
|
-
pipeline:
|
|
4148
|
-
preprocess:
|
|
4149
|
-
promise:
|
|
4150
|
-
record:
|
|
4151
|
-
set:
|
|
4152
|
-
strictObject:
|
|
4153
|
-
string:
|
|
4154
|
-
symbol:
|
|
4155
|
-
transformer:
|
|
4156
|
-
tuple:
|
|
4157
|
-
undefined:
|
|
4158
|
-
union:
|
|
4159
|
-
unknown:
|
|
4160
|
-
void:
|
|
4161
|
-
NEVER:
|
|
4120
|
+
coerce: Mr,
|
|
4121
|
+
any: fr,
|
|
4122
|
+
array: yr,
|
|
4123
|
+
bigint: or,
|
|
4124
|
+
boolean: os,
|
|
4125
|
+
date: lr,
|
|
4126
|
+
discriminatedUnion: br,
|
|
4127
|
+
effect: Ot,
|
|
4128
|
+
enum: Cr,
|
|
4129
|
+
function: Er,
|
|
4130
|
+
instanceof: ar,
|
|
4131
|
+
intersection: wr,
|
|
4132
|
+
lazy: Or,
|
|
4133
|
+
literal: Nr,
|
|
4134
|
+
map: Sr,
|
|
4135
|
+
nan: ir,
|
|
4136
|
+
nativeEnum: Ar,
|
|
4137
|
+
never: pr,
|
|
4138
|
+
null: dr,
|
|
4139
|
+
nullable: jr,
|
|
4140
|
+
number: is,
|
|
4141
|
+
object: gr,
|
|
4142
|
+
oboolean: Br,
|
|
4143
|
+
onumber: Pr,
|
|
4144
|
+
optional: Ir,
|
|
4145
|
+
ostring: Dr,
|
|
4146
|
+
pipeline: Lr,
|
|
4147
|
+
preprocess: Zr,
|
|
4148
|
+
promise: Rr,
|
|
4149
|
+
record: kr,
|
|
4150
|
+
set: Tr,
|
|
4151
|
+
strictObject: vr,
|
|
4152
|
+
string: as,
|
|
4153
|
+
symbol: cr,
|
|
4154
|
+
transformer: Ot,
|
|
4155
|
+
tuple: xr,
|
|
4156
|
+
undefined: ur,
|
|
4157
|
+
union: _r,
|
|
4158
|
+
unknown: hr,
|
|
4159
|
+
void: mr,
|
|
4160
|
+
NEVER: Ur,
|
|
4162
4161
|
ZodIssueCode: h,
|
|
4163
|
-
quotelessJson:
|
|
4162
|
+
quotelessJson: Vn,
|
|
4164
4163
|
ZodError: D
|
|
4165
4164
|
});
|
|
4166
|
-
class
|
|
4165
|
+
class zr {
|
|
4167
4166
|
constructor(e, s) {
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
this.
|
|
4167
|
+
b(this, "client");
|
|
4168
|
+
b(this, "parentId");
|
|
4169
|
+
b(this, "images");
|
|
4170
|
+
b(this, "length");
|
|
4171
|
+
this.client = e, this.parentId = s, this.images = [], this.length = this.images.length;
|
|
4173
4172
|
}
|
|
4174
4173
|
async add(e) {
|
|
4175
|
-
return this.images.push(e), this.length = this.images.length, await
|
|
4174
|
+
return this.images.push(e), this.length = this.images.length, await $n(this.client, this.parentId, new Vr(e)), new Promise((s) => {
|
|
4176
4175
|
s(this.length);
|
|
4177
4176
|
});
|
|
4178
4177
|
}
|
|
4179
4178
|
}
|
|
4180
|
-
const
|
|
4179
|
+
const $r = d.object({
|
|
4181
4180
|
handle: d.string(),
|
|
4182
4181
|
url: d.string(),
|
|
4183
4182
|
width: d.number(),
|
|
@@ -4188,37 +4187,34 @@ const Hr = d.object({
|
|
|
4188
4187
|
camera: d.string().optional(),
|
|
4189
4188
|
filename: d.string()
|
|
4190
4189
|
});
|
|
4191
|
-
class
|
|
4190
|
+
class Vr {
|
|
4192
4191
|
constructor(e) {
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4192
|
+
b(this, "handle");
|
|
4193
|
+
b(this, "url");
|
|
4194
|
+
b(this, "width");
|
|
4195
|
+
b(this, "height");
|
|
4196
|
+
b(this, "orientation");
|
|
4197
|
+
b(this, "taken_at");
|
|
4198
|
+
b(this, "camera_make");
|
|
4199
|
+
b(this, "camera");
|
|
4200
|
+
b(this, "filename");
|
|
4202
4201
|
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;
|
|
4203
4202
|
}
|
|
4204
4203
|
}
|
|
4205
|
-
const
|
|
4204
|
+
const Fr = [
|
|
4206
4205
|
"new",
|
|
4207
4206
|
"ingesting",
|
|
4208
4207
|
"submitted",
|
|
4209
4208
|
"storyboarding",
|
|
4210
|
-
"
|
|
4209
|
+
"deduplication",
|
|
4210
|
+
"image selection",
|
|
4211
4211
|
"designing",
|
|
4212
|
-
"designing succeeded",
|
|
4213
4212
|
"layouting",
|
|
4214
|
-
"layouting succeeded",
|
|
4215
4213
|
"embellishing",
|
|
4216
|
-
"embellishing succeeded",
|
|
4217
4214
|
"polishing",
|
|
4218
|
-
"polishing succeeded",
|
|
4219
4215
|
"ready",
|
|
4220
4216
|
"error"
|
|
4221
|
-
],
|
|
4217
|
+
], ls = [
|
|
4222
4218
|
"baby",
|
|
4223
4219
|
"birthday",
|
|
4224
4220
|
"default",
|
|
@@ -4234,7 +4230,7 @@ const Wr = [
|
|
|
4234
4230
|
"travel",
|
|
4235
4231
|
"wedding",
|
|
4236
4232
|
"year-in-review"
|
|
4237
|
-
],
|
|
4233
|
+
], cs = {
|
|
4238
4234
|
1005: { slug: "modern-black-sfly" },
|
|
4239
4235
|
1101: { slug: "bon-voyage-sfly" },
|
|
4240
4236
|
1103: { slug: "fun-in-the-sun-sfly" },
|
|
@@ -4395,76 +4391,76 @@ const Wr = [
|
|
|
4395
4391
|
6097: { slug: "boho-wedding-sfly" },
|
|
4396
4392
|
6098: { slug: "black-and-white-rustic-sfly" },
|
|
4397
4393
|
6099: { slug: "bright-color-pop-sfly" }
|
|
4398
|
-
},
|
|
4394
|
+
}, us = ["8x8", "10x10", "12x12", "8x11", "11x8", "11x14"], ds = ["sc", "hc", "pl"], fs = ["sp", "sl", "dl"], hs = ["low", "medium", "high"], ps = ["best", "most", "all"], ms = ["none", "few", "lots"], ys = ["none", "few", "lots"], Hr = "https://zrrpg8wwbe.execute-api.us-east-1.amazonaws.com/sfly-sls", Jr = "wss://cwfzk5wg4m.execute-api.us-east-1.amazonaws.com/sfly-sls", Wr = parseInt("300000") || 3e5;
|
|
4399
4395
|
class Kr {
|
|
4400
4396
|
constructor(e) {
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4397
|
+
b(this, "occasion");
|
|
4398
|
+
b(this, "style");
|
|
4399
|
+
b(this, "book_size");
|
|
4400
|
+
b(this, "cover_type");
|
|
4401
|
+
b(this, "page_type");
|
|
4402
|
+
b(this, "image_density");
|
|
4403
|
+
b(this, "image_filtering_level");
|
|
4404
|
+
b(this, "embellishment_level");
|
|
4405
|
+
b(this, "text_sticker_level");
|
|
4410
4406
|
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;
|
|
4411
4407
|
}
|
|
4412
4408
|
}
|
|
4413
4409
|
const qr = d.object({
|
|
4414
|
-
occasion: d.enum(
|
|
4410
|
+
occasion: d.enum(ls),
|
|
4415
4411
|
style: d.string(),
|
|
4416
|
-
book_size: d.enum(
|
|
4417
|
-
cover_type: d.enum(
|
|
4418
|
-
page_type: d.enum(
|
|
4419
|
-
image_density: d.enum(
|
|
4420
|
-
image_filtering_level: d.enum(
|
|
4421
|
-
embellishment_level: d.enum(
|
|
4422
|
-
text_sticker_level: d.enum(
|
|
4423
|
-
}),
|
|
4412
|
+
book_size: d.enum(us),
|
|
4413
|
+
cover_type: d.enum(ds),
|
|
4414
|
+
page_type: d.enum(fs),
|
|
4415
|
+
image_density: d.enum(hs),
|
|
4416
|
+
image_filtering_level: d.enum(ps),
|
|
4417
|
+
embellishment_level: d.enum(ms),
|
|
4418
|
+
text_sticker_level: d.enum(ys)
|
|
4419
|
+
}), gs = d.object({
|
|
4424
4420
|
id: d.string(),
|
|
4425
4421
|
title: d.string(),
|
|
4426
4422
|
design_request: qr,
|
|
4427
|
-
state: d.enum(
|
|
4423
|
+
state: d.enum(Fr).optional(),
|
|
4428
4424
|
guid: d.string().optional()
|
|
4429
4425
|
});
|
|
4430
|
-
class
|
|
4426
|
+
class mt {
|
|
4431
4427
|
constructor(e) {
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4428
|
+
b(this, "id");
|
|
4429
|
+
b(this, "title");
|
|
4430
|
+
b(this, "design_request");
|
|
4431
|
+
b(this, "state");
|
|
4432
|
+
b(this, "guid");
|
|
4437
4433
|
this.id = e.id, this.title = e.title, this.design_request = new Kr(e.design_request), this.state = e.state, this.guid = e.guid;
|
|
4438
4434
|
}
|
|
4439
4435
|
}
|
|
4440
|
-
function
|
|
4441
|
-
const e =
|
|
4442
|
-
return s.style = e, new
|
|
4436
|
+
function Nt(t) {
|
|
4437
|
+
const e = cs[t.style].slug, s = Rt(JSON.parse(JSON.stringify(t)));
|
|
4438
|
+
return s.style = e, new mt({
|
|
4443
4439
|
id: t.parentId,
|
|
4444
4440
|
guid: t.guid,
|
|
4445
4441
|
title: t.title,
|
|
4446
4442
|
design_request: s
|
|
4447
4443
|
});
|
|
4448
4444
|
}
|
|
4449
|
-
const
|
|
4445
|
+
const Qe = d.object({
|
|
4450
4446
|
maxPageCount: d.number(),
|
|
4451
4447
|
minPageCount: d.number(),
|
|
4452
4448
|
maxImageCount: d.number(),
|
|
4453
4449
|
avgImageCount: d.number(),
|
|
4454
4450
|
minImageCount: d.number()
|
|
4455
4451
|
}), Gr = d.object({
|
|
4456
|
-
high:
|
|
4457
|
-
medium:
|
|
4458
|
-
low:
|
|
4452
|
+
high: Qe,
|
|
4453
|
+
medium: Qe,
|
|
4454
|
+
low: Qe
|
|
4459
4455
|
}), Xr = d.object({
|
|
4460
4456
|
densities: Gr
|
|
4461
4457
|
});
|
|
4462
|
-
async function Yr(t, e, s) {
|
|
4458
|
+
async function Yr({ apiKey: t, apiHost: e }, s, n) {
|
|
4463
4459
|
return Se(async () => {
|
|
4464
|
-
const
|
|
4465
|
-
{ url: `${
|
|
4466
|
-
),
|
|
4467
|
-
return Xr.parse(
|
|
4460
|
+
const r = await Yt(
|
|
4461
|
+
{ url: `${e}/api/v1/designoptions/booksize/${s}/imagecount/${n}`, apiKey: t }
|
|
4462
|
+
), a = It(r.data);
|
|
4463
|
+
return Xr.parse(a);
|
|
4468
4464
|
});
|
|
4469
4465
|
}
|
|
4470
4466
|
const Qr = d.object({
|
|
@@ -4517,7 +4513,7 @@ const Qr = d.object({
|
|
|
4517
4513
|
properties: d.array(sa)
|
|
4518
4514
|
}), ia = d.object({
|
|
4519
4515
|
backgroundId: d.string().nullable(),
|
|
4520
|
-
assets: d.array(na)
|
|
4516
|
+
assets: d.array(na).optional()
|
|
4521
4517
|
}), oa = d.object({
|
|
4522
4518
|
pageNum: d.number(),
|
|
4523
4519
|
type: d.string(),
|
|
@@ -4533,96 +4529,98 @@ const Qr = d.object({
|
|
|
4533
4529
|
magicShopBook: la,
|
|
4534
4530
|
reportingData: aa
|
|
4535
4531
|
});
|
|
4536
|
-
async function ua(t, e) {
|
|
4532
|
+
async function ua({ apiHost: t, apiKey: e }, s) {
|
|
4537
4533
|
return Se(async () => {
|
|
4538
|
-
const
|
|
4539
|
-
return
|
|
4534
|
+
const n = (await Qt({ url: `${t}/api/v1/books`, apiKey: e, payload: s })).data;
|
|
4535
|
+
return gs.safeParse(n), new mt(n);
|
|
4540
4536
|
});
|
|
4541
4537
|
}
|
|
4542
|
-
async function
|
|
4538
|
+
async function Ct({ apiHost: t, apiKey: e }, s) {
|
|
4543
4539
|
return Se(async () => {
|
|
4544
|
-
const
|
|
4545
|
-
return
|
|
4540
|
+
const n = (await zn({ url: `${t}/api/v1/books/${s.id}`, apiKey: e, payload: s })).data;
|
|
4541
|
+
return gs.safeParse(n), new mt(n);
|
|
4546
4542
|
});
|
|
4547
4543
|
}
|
|
4548
|
-
async function da(t, e) {
|
|
4544
|
+
async function da({ apiHost: t, apiKey: e }, s) {
|
|
4549
4545
|
return Se(async () => {
|
|
4550
|
-
const
|
|
4551
|
-
return ca.parse(
|
|
4546
|
+
const n = (await Yt({ url: `${t}/api/v1/books/${s}/format/galleon`, apiKey: e })).data;
|
|
4547
|
+
return ca.parse(n);
|
|
4552
4548
|
});
|
|
4553
4549
|
}
|
|
4554
4550
|
class fa {
|
|
4555
4551
|
constructor(e, s, n) {
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
this.
|
|
4552
|
+
b(this, "client");
|
|
4553
|
+
b(this, "parentId");
|
|
4554
|
+
b(this, "title");
|
|
4555
|
+
b(this, "occasion");
|
|
4556
|
+
b(this, "style");
|
|
4557
|
+
b(this, "bookSize");
|
|
4558
|
+
b(this, "coverType");
|
|
4559
|
+
b(this, "pageType");
|
|
4560
|
+
b(this, "imageDensity");
|
|
4561
|
+
b(this, "imageFilteringLevel");
|
|
4562
|
+
b(this, "embellishmentLevel");
|
|
4563
|
+
b(this, "textStickerLevel");
|
|
4564
|
+
b(this, "images");
|
|
4565
|
+
b(this, "guid");
|
|
4566
|
+
this.client = s, this.parentId = e, this.title = (n == null ? void 0 : n.title) || "", this.occasion = (n == null ? void 0 : n.occasion) || ls[0], this.style = (n == null ? void 0 : n.style) || parseInt(Object.keys(cs)[0]), this.bookSize = (n == null ? void 0 : n.bookSize) || us[0], this.coverType = (n == null ? void 0 : n.coverType) || ds[0], this.pageType = (n == null ? void 0 : n.pageType) || fs[0], this.imageDensity = (n == null ? void 0 : n.imageDensity) || hs[0], this.imageFilteringLevel = (n == null ? void 0 : n.imageFilteringLevel) || ps[0], this.embellishmentLevel = (n == null ? void 0 : n.embellishmentLevel) || ms[0], this.textStickerLevel = (n == null ? void 0 : n.textStickerLevel) || ys[0], this.images = new zr(this.client, this.parentId);
|
|
4571
4567
|
}
|
|
4572
4568
|
async getOptions(e) {
|
|
4573
|
-
return await Yr(this.
|
|
4569
|
+
return await Yr(this.client, this.bookSize, e || this.images.length);
|
|
4574
4570
|
}
|
|
4575
4571
|
async submit(e) {
|
|
4576
|
-
return e && Object.assign(this, e), this.getProgress(), await
|
|
4572
|
+
return e && Object.assign(this, e), this.getProgress(), await Ct(this.client, Nt(this)), this;
|
|
4577
4573
|
}
|
|
4578
4574
|
async setGuid(e) {
|
|
4579
|
-
return this.guid = e, await
|
|
4575
|
+
return this.guid = e, await Ct(this.client, Nt(this)), this.guid;
|
|
4580
4576
|
}
|
|
4581
4577
|
async getJSON() {
|
|
4582
|
-
return await da(this.
|
|
4578
|
+
return await da(this.client, this.parentId);
|
|
4583
4579
|
}
|
|
4584
4580
|
async getProgress() {
|
|
4585
4581
|
let e = "new";
|
|
4586
|
-
const s = new WebSocket(`${
|
|
4582
|
+
const s = new WebSocket(`${this.client.webSocketHost}/?book_id=${this.parentId}`), n = setTimeout(() => {
|
|
4587
4583
|
throw s.close(), new Error("Something went wrong. Please try again.");
|
|
4588
|
-
},
|
|
4584
|
+
}, Wr);
|
|
4589
4585
|
s.onmessage = (r) => {
|
|
4590
4586
|
const a = JSON.parse(r.data);
|
|
4591
4587
|
if (e !== a.state) {
|
|
4592
4588
|
e = a.state;
|
|
4593
4589
|
const i = new CustomEvent("MagicBook.designRequestUpdated", { detail: a });
|
|
4594
|
-
|
|
4590
|
+
["error", "ready"].includes(a.state) && (s.close(), clearTimeout(n)), window.dispatchEvent(i);
|
|
4595
4591
|
}
|
|
4596
4592
|
};
|
|
4597
4593
|
}
|
|
4598
4594
|
}
|
|
4599
4595
|
class pa {
|
|
4600
|
-
constructor(e) {
|
|
4601
|
-
|
|
4602
|
-
this
|
|
4596
|
+
constructor(e, s = Hr, n = Jr) {
|
|
4597
|
+
b(this, "apiKey");
|
|
4598
|
+
b(this, "apiHost");
|
|
4599
|
+
b(this, "webSocketHost");
|
|
4600
|
+
this.apiKey = e, this.apiHost = s, this.webSocketHost = n;
|
|
4603
4601
|
}
|
|
4604
4602
|
async createDesignRequest(e) {
|
|
4605
|
-
const s = await ua(this
|
|
4606
|
-
return new fa(s.id, this
|
|
4603
|
+
const s = await ua(this);
|
|
4604
|
+
return new fa(s.id, this, e);
|
|
4607
4605
|
}
|
|
4608
4606
|
}
|
|
4609
4607
|
export {
|
|
4610
4608
|
fa as DesignRequest,
|
|
4611
|
-
|
|
4612
|
-
|
|
4609
|
+
Vr as ImageServer,
|
|
4610
|
+
zr as Images,
|
|
4613
4611
|
pa as MagicBookClient,
|
|
4614
|
-
|
|
4615
|
-
|
|
4612
|
+
us as bookSizes,
|
|
4613
|
+
ds as coverTypes,
|
|
4616
4614
|
Xr as designOptionsSchema,
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4615
|
+
ms as embellishmentLevels,
|
|
4616
|
+
hs as imageDensities,
|
|
4617
|
+
Qe as imageDensityOptionSchema,
|
|
4620
4618
|
Gr as imageDensityOptionsSchema,
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4619
|
+
ps as imageFilteringLevels,
|
|
4620
|
+
$r as imageServerSchema,
|
|
4621
|
+
ls as occasions,
|
|
4622
|
+
fs as pageTypes,
|
|
4623
|
+
Fr as states,
|
|
4624
|
+
cs as styles,
|
|
4625
|
+
ys as textStickerLevels
|
|
4628
4626
|
};
|