@magiclabs.ai/magicbook-client 0.4.8 → 0.5.0-dev
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 +2 -1
- package/data/design-request.d.ts +1 -1
- package/magicbook-client.js +638 -637
- package/magicbook-client.umd.cjs +3 -3
- package/models/book.d.ts +19 -15
- package/models/design-request/image.d.ts +2 -1
- package/models/design-request/index.d.ts +8 -5
- package/package.json +10 -10
- package/utils/engine-api/axios.d.ts +5 -5
- package/utils/engine-api/books.d.ts +4 -4
- package/utils/engine-api/design-options.d.ts +1 -1
- package/utils/engine-api/images.d.ts +1 -1
package/magicbook-client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var bs = Object.defineProperty;
|
|
2
|
+
var ws = (t, e, s) => e in t ? bs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var w = (t, e, s) => (ws(t, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
+
function xs(t, e, s) {
|
|
5
5
|
const n = e.pop() || "", r = e.reduce(
|
|
6
6
|
(a, i) => a[i] = a[i] || {},
|
|
7
7
|
t
|
|
@@ -13,21 +13,21 @@ function Rt(t, e) {
|
|
|
13
13
|
typeof t[s] == "object" && typeof e[s] == "object" ? Rt(t[s], e[s]) : t[s] = e[s];
|
|
14
14
|
}), t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function ks(t) {
|
|
17
17
|
return t.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
|
|
18
18
|
}
|
|
19
19
|
function It(t) {
|
|
20
20
|
return Object.keys(t).map((e) => {
|
|
21
|
-
const s =
|
|
21
|
+
const s = ks(e);
|
|
22
22
|
s.includes("_") && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] = It(t[s]));
|
|
23
23
|
}), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ss(t) {
|
|
26
26
|
return t.replace(/([-_][a-z])/g, (e) => e.toUpperCase().replace("-", "").replace("_", ""));
|
|
27
27
|
}
|
|
28
28
|
function jt(t) {
|
|
29
29
|
return Object.keys(t).map((e) => {
|
|
30
|
-
const s =
|
|
30
|
+
const s = Ss(e);
|
|
31
31
|
s !== e && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] = jt(t[s]));
|
|
32
32
|
}), t;
|
|
33
33
|
}
|
|
@@ -36,29 +36,29 @@ function Zt(t, e) {
|
|
|
36
36
|
return t.apply(e, arguments);
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
const { toString:
|
|
40
|
-
const s =
|
|
39
|
+
const { toString: Ts } = Object.prototype, { getPrototypeOf: ct } = Object, Ve = ((t) => (e) => {
|
|
40
|
+
const s = Ts.call(e);
|
|
41
41
|
return t[s] || (t[s] = s.slice(8, -1).toLowerCase());
|
|
42
|
-
})(/* @__PURE__ */ Object.create(null)), $ = (t) => (t = t.toLowerCase(), (e) => Ve(e) === t), Fe = (t) => (e) => typeof e === t, { isArray: le } = Array,
|
|
43
|
-
function
|
|
44
|
-
return t !== null && !
|
|
42
|
+
})(/* @__PURE__ */ Object.create(null)), $ = (t) => (t = t.toLowerCase(), (e) => Ve(e) === t), Fe = (t) => (e) => typeof e === t, { isArray: le } = Array, ue = Fe("undefined");
|
|
43
|
+
function Es(t) {
|
|
44
|
+
return t !== null && !ue(t) && t.constructor !== null && !ue(t.constructor) && j(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
function
|
|
46
|
+
const Lt = $("ArrayBuffer");
|
|
47
|
+
function Os(t) {
|
|
48
48
|
let e;
|
|
49
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer &&
|
|
49
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Lt(t.buffer), e;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const Ns = Fe("string"), j = Fe("function"), Dt = Fe("number"), He = (t) => t !== null && typeof t == "object", Cs = (t) => t === !0 || t === !1, Ne = (t) => {
|
|
52
52
|
if (Ve(t) !== "object")
|
|
53
53
|
return !1;
|
|
54
|
-
const e =
|
|
54
|
+
const e = ct(t);
|
|
55
55
|
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t);
|
|
56
|
-
},
|
|
56
|
+
}, As = $("Date"), Rs = $("File"), Is = $("Blob"), js = $("FileList"), Zs = (t) => He(t) && j(t.pipe), Ls = (t) => {
|
|
57
57
|
let e;
|
|
58
58
|
return t && (typeof FormData == "function" && t instanceof FormData || j(t.append) && ((e = Ve(t)) === "formdata" || // detect form-data instance
|
|
59
59
|
e === "object" && j(t.toString) && t.toString() === "[object FormData]"));
|
|
60
|
-
},
|
|
61
|
-
function
|
|
60
|
+
}, Ds = $("URLSearchParams"), Ps = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
61
|
+
function xe(t, e, { allOwnKeys: s = !1 } = {}) {
|
|
62
62
|
if (t === null || typeof t > "u")
|
|
63
63
|
return;
|
|
64
64
|
let n, r;
|
|
@@ -81,23 +81,23 @@ function Pt(t, e) {
|
|
|
81
81
|
return r;
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
|
-
const Bt = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Mt = (t) => !
|
|
85
|
-
function
|
|
84
|
+
const Bt = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Mt = (t) => !ue(t) && t !== Bt;
|
|
85
|
+
function tt() {
|
|
86
86
|
const { caseless: t } = Mt(this) && this || {}, e = {}, s = (n, r) => {
|
|
87
87
|
const a = t && Pt(e, r) || r;
|
|
88
|
-
Ne(e[a]) && Ne(n) ? e[a] =
|
|
88
|
+
Ne(e[a]) && Ne(n) ? e[a] = tt(e[a], n) : Ne(n) ? e[a] = tt({}, 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
|
-
arguments[n] &&
|
|
91
|
+
arguments[n] && xe(arguments[n], s);
|
|
92
92
|
return e;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const Bs = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, a) => {
|
|
95
95
|
s && j(r) ? t[a] = Zt(r, s) : t[a] = r;
|
|
96
|
-
}, { allOwnKeys: n }), t),
|
|
96
|
+
}, { allOwnKeys: n }), t), Ms = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Us = (t, e, s, n) => {
|
|
97
97
|
t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
98
98
|
value: e.prototype
|
|
99
99
|
}), s && Object.assign(t.prototype, s);
|
|
100
|
-
},
|
|
100
|
+
}, zs = (t, e, s, n) => {
|
|
101
101
|
let r, a, i;
|
|
102
102
|
const o = {};
|
|
103
103
|
if (e = e || {}, t == null)
|
|
@@ -105,49 +105,49 @@ const Ls = (t, e, s, { allOwnKeys: n } = {}) => (Te(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 && ct(t);
|
|
109
109
|
} while (t && (!s || s(t, e)) && t !== Object.prototype);
|
|
110
110
|
return e;
|
|
111
|
-
},
|
|
111
|
+
}, $s = (t, e, s) => {
|
|
112
112
|
t = String(t), (s === void 0 || s > t.length) && (s = t.length), s -= e.length;
|
|
113
113
|
const n = t.indexOf(e, s);
|
|
114
114
|
return n !== -1 && n === s;
|
|
115
|
-
},
|
|
115
|
+
}, Vs = (t) => {
|
|
116
116
|
if (!t)
|
|
117
117
|
return null;
|
|
118
118
|
if (le(t))
|
|
119
119
|
return t;
|
|
120
120
|
let e = t.length;
|
|
121
|
-
if (!
|
|
121
|
+
if (!Dt(e))
|
|
122
122
|
return null;
|
|
123
123
|
const s = new Array(e);
|
|
124
124
|
for (; e-- > 0; )
|
|
125
125
|
s[e] = t[e];
|
|
126
126
|
return s;
|
|
127
|
-
},
|
|
127
|
+
}, Fs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && ct(Uint8Array)), Hs = (t, e) => {
|
|
128
128
|
const n = (t && t[Symbol.iterator]).call(t);
|
|
129
129
|
let r;
|
|
130
130
|
for (; (r = n.next()) && !r.done; ) {
|
|
131
131
|
const a = r.value;
|
|
132
132
|
e.call(t, a[0], a[1]);
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, Js = (t, e) => {
|
|
135
135
|
let s;
|
|
136
136
|
const n = [];
|
|
137
137
|
for (; (s = t.exec(e)) !== null; )
|
|
138
138
|
n.push(s);
|
|
139
139
|
return n;
|
|
140
|
-
},
|
|
140
|
+
}, Ws = $("HTMLFormElement"), Ks = (t) => t.toLowerCase().replace(
|
|
141
141
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
142
142
|
function(s, n, r) {
|
|
143
143
|
return n.toUpperCase() + r;
|
|
144
144
|
}
|
|
145
|
-
),
|
|
145
|
+
), gt = (({ hasOwnProperty: t }) => (e, s) => t.call(e, s))(Object.prototype), qs = $("RegExp"), Ut = (t, e) => {
|
|
146
146
|
const s = Object.getOwnPropertyDescriptors(t), n = {};
|
|
147
|
-
|
|
147
|
+
xe(s, (r, a) => {
|
|
148
148
|
e(r, a, t) !== !1 && (n[a] = r);
|
|
149
149
|
}), Object.defineProperties(t, n);
|
|
150
|
-
},
|
|
150
|
+
}, Gs = (t) => {
|
|
151
151
|
Ut(t, (e, s) => {
|
|
152
152
|
if (j(t) && ["arguments", "caller", "callee"].indexOf(s) !== -1)
|
|
153
153
|
return !1;
|
|
@@ -162,29 +162,29 @@ const Ls = (t, e, s, { allOwnKeys: n } = {}) => (Te(e, (r, a) => {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
},
|
|
165
|
+
}, Xs = (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
|
+
}, Ys = () => {
|
|
173
|
+
}, Qs = (t, e) => (t = +t, Number.isFinite(t) ? t : e), Ge = "abcdefghijklmnopqrstuvwxyz", vt = "0123456789", zt = {
|
|
174
|
+
DIGIT: vt,
|
|
175
|
+
ALPHA: Ge,
|
|
176
|
+
ALPHA_DIGIT: Ge + Ge.toUpperCase() + vt
|
|
177
|
+
}, en = (t = 16, e = zt.ALPHA_DIGIT) => {
|
|
178
178
|
let s = "";
|
|
179
179
|
const { length: n } = e;
|
|
180
180
|
for (; t--; )
|
|
181
181
|
s += e[Math.random() * n | 0];
|
|
182
182
|
return s;
|
|
183
183
|
};
|
|
184
|
-
function
|
|
184
|
+
function tn(t) {
|
|
185
185
|
return !!(t && j(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const sn = (t) => {
|
|
188
188
|
const e = new Array(10), s = (n, r) => {
|
|
189
189
|
if (He(n)) {
|
|
190
190
|
if (e.indexOf(n) >= 0)
|
|
@@ -192,73 +192,73 @@ const en = (t) => {
|
|
|
192
192
|
if (!("toJSON" in n)) {
|
|
193
193
|
e[r] = n;
|
|
194
194
|
const a = le(n) ? [] : {};
|
|
195
|
-
return
|
|
195
|
+
return xe(n, (i, o) => {
|
|
196
196
|
const u = s(i, r + 1);
|
|
197
|
-
!
|
|
197
|
+
!ue(u) && (a[o] = u);
|
|
198
198
|
}), e[r] = void 0, a;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
return n;
|
|
202
202
|
};
|
|
203
203
|
return s(t, 0);
|
|
204
|
-
},
|
|
204
|
+
}, nn = $("AsyncFunction"), rn = (t) => t && (He(t) || j(t)) && j(t.then) && j(t.catch), c = {
|
|
205
205
|
isArray: le,
|
|
206
|
-
isArrayBuffer:
|
|
207
|
-
isBuffer:
|
|
208
|
-
isFormData:
|
|
209
|
-
isArrayBufferView:
|
|
210
|
-
isString:
|
|
211
|
-
isNumber:
|
|
212
|
-
isBoolean:
|
|
206
|
+
isArrayBuffer: Lt,
|
|
207
|
+
isBuffer: Es,
|
|
208
|
+
isFormData: Ls,
|
|
209
|
+
isArrayBufferView: Os,
|
|
210
|
+
isString: Ns,
|
|
211
|
+
isNumber: Dt,
|
|
212
|
+
isBoolean: Cs,
|
|
213
213
|
isObject: He,
|
|
214
214
|
isPlainObject: Ne,
|
|
215
|
-
isUndefined:
|
|
216
|
-
isDate:
|
|
217
|
-
isFile:
|
|
218
|
-
isBlob:
|
|
219
|
-
isRegExp:
|
|
215
|
+
isUndefined: ue,
|
|
216
|
+
isDate: As,
|
|
217
|
+
isFile: Rs,
|
|
218
|
+
isBlob: Is,
|
|
219
|
+
isRegExp: qs,
|
|
220
220
|
isFunction: j,
|
|
221
|
-
isStream:
|
|
222
|
-
isURLSearchParams:
|
|
223
|
-
isTypedArray:
|
|
224
|
-
isFileList:
|
|
225
|
-
forEach:
|
|
226
|
-
merge:
|
|
227
|
-
extend:
|
|
228
|
-
trim:
|
|
229
|
-
stripBOM:
|
|
230
|
-
inherits:
|
|
231
|
-
toFlatObject:
|
|
221
|
+
isStream: Zs,
|
|
222
|
+
isURLSearchParams: Ds,
|
|
223
|
+
isTypedArray: Fs,
|
|
224
|
+
isFileList: js,
|
|
225
|
+
forEach: xe,
|
|
226
|
+
merge: tt,
|
|
227
|
+
extend: Bs,
|
|
228
|
+
trim: Ps,
|
|
229
|
+
stripBOM: Ms,
|
|
230
|
+
inherits: Us,
|
|
231
|
+
toFlatObject: zs,
|
|
232
232
|
kindOf: Ve,
|
|
233
233
|
kindOfTest: $,
|
|
234
|
-
endsWith:
|
|
235
|
-
toArray:
|
|
236
|
-
forEachEntry:
|
|
237
|
-
matchAll:
|
|
238
|
-
isHTMLForm:
|
|
239
|
-
hasOwnProperty:
|
|
240
|
-
hasOwnProp:
|
|
234
|
+
endsWith: $s,
|
|
235
|
+
toArray: Vs,
|
|
236
|
+
forEachEntry: Hs,
|
|
237
|
+
matchAll: Js,
|
|
238
|
+
isHTMLForm: Ws,
|
|
239
|
+
hasOwnProperty: gt,
|
|
240
|
+
hasOwnProp: gt,
|
|
241
241
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
242
242
|
reduceDescriptors: Ut,
|
|
243
|
-
freezeMethods:
|
|
244
|
-
toObjectSet:
|
|
245
|
-
toCamelCase:
|
|
246
|
-
noop:
|
|
247
|
-
toFiniteNumber:
|
|
243
|
+
freezeMethods: Gs,
|
|
244
|
+
toObjectSet: Xs,
|
|
245
|
+
toCamelCase: Ks,
|
|
246
|
+
noop: Ys,
|
|
247
|
+
toFiniteNumber: Qs,
|
|
248
248
|
findKey: Pt,
|
|
249
249
|
global: Bt,
|
|
250
250
|
isContextDefined: Mt,
|
|
251
251
|
ALPHABET: zt,
|
|
252
|
-
generateString:
|
|
253
|
-
isSpecCompliantForm:
|
|
254
|
-
toJSONObject:
|
|
255
|
-
isAsyncFn:
|
|
256
|
-
isThenable:
|
|
252
|
+
generateString: en,
|
|
253
|
+
isSpecCompliantForm: tn,
|
|
254
|
+
toJSONObject: sn,
|
|
255
|
+
isAsyncFn: nn,
|
|
256
|
+
isThenable: rn
|
|
257
257
|
};
|
|
258
|
-
function
|
|
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);
|
|
260
260
|
}
|
|
261
|
-
c.inherits(
|
|
261
|
+
c.inherits(T, Error, {
|
|
262
262
|
toJSON: function() {
|
|
263
263
|
return {
|
|
264
264
|
// Standard
|
|
@@ -279,7 +279,7 @@ c.inherits(S, Error, {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
|
-
const $t =
|
|
282
|
+
const $t = T.prototype, Vt = {};
|
|
283
283
|
[
|
|
284
284
|
"ERR_BAD_OPTION_VALUE",
|
|
285
285
|
"ERR_BAD_OPTION",
|
|
@@ -297,30 +297,30 @@ const $t = S.prototype, Vt = {};
|
|
|
297
297
|
].forEach((t) => {
|
|
298
298
|
Vt[t] = { value: t };
|
|
299
299
|
});
|
|
300
|
-
Object.defineProperties(
|
|
300
|
+
Object.defineProperties(T, Vt);
|
|
301
301
|
Object.defineProperty($t, "isAxiosError", { value: !0 });
|
|
302
|
-
|
|
302
|
+
T.from = (t, e, s, n, r, a) => {
|
|
303
303
|
const i = Object.create($t);
|
|
304
304
|
return c.toFlatObject(t, i, function(u) {
|
|
305
305
|
return u !== Error.prototype;
|
|
306
|
-
}, (o) => o !== "isAxiosError"),
|
|
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 an = null;
|
|
309
|
+
function st(t) {
|
|
310
310
|
return c.isPlainObject(t) || c.isArray(t);
|
|
311
311
|
}
|
|
312
312
|
function Ft(t) {
|
|
313
313
|
return c.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function _t(t, e, s) {
|
|
316
316
|
return t ? t.concat(e).map(function(r, a) {
|
|
317
317
|
return r = Ft(r), !s && a ? "[" + r + "]" : r;
|
|
318
318
|
}).join(s ? "." : "") : e;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
return c.isArray(t) && !t.some(
|
|
320
|
+
function on(t) {
|
|
321
|
+
return c.isArray(t) && !t.some(st);
|
|
322
322
|
}
|
|
323
|
-
const
|
|
323
|
+
const ln = c.toFlatObject(c, {}, null, function(e) {
|
|
324
324
|
return /^is[A-Z]/.test(e);
|
|
325
325
|
});
|
|
326
326
|
function Je(t, e, s) {
|
|
@@ -330,8 +330,8 @@ function Je(t, e, s) {
|
|
|
330
330
|
metaTokens: !0,
|
|
331
331
|
dots: !1,
|
|
332
332
|
indexes: !1
|
|
333
|
-
}, !1, function(
|
|
334
|
-
return !c.isUndefined(V[
|
|
333
|
+
}, !1, function(S, V) {
|
|
334
|
+
return !c.isUndefined(V[S]);
|
|
335
335
|
});
|
|
336
336
|
const n = s.metaTokens, r = s.visitor || f, a = s.dots, i = s.indexes, u = (s.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(e);
|
|
337
337
|
if (!c.isFunction(r))
|
|
@@ -342,42 +342,42 @@ function Je(t, e, s) {
|
|
|
342
342
|
if (c.isDate(g))
|
|
343
343
|
return g.toISOString();
|
|
344
344
|
if (!u && c.isBlob(g))
|
|
345
|
-
throw new
|
|
345
|
+
throw new T("Blob is not supported. Use a Buffer instead.");
|
|
346
346
|
return c.isArrayBuffer(g) || c.isTypedArray(g) ? u && typeof Blob == "function" ? new Blob([g]) : Buffer.from(g) : g;
|
|
347
347
|
}
|
|
348
|
-
function f(g,
|
|
348
|
+
function f(g, S, V) {
|
|
349
349
|
let Z = g;
|
|
350
350
|
if (g && !V && typeof g == "object") {
|
|
351
|
-
if (c.endsWith(
|
|
352
|
-
|
|
353
|
-
else if (c.isArray(g) &&
|
|
354
|
-
return
|
|
351
|
+
if (c.endsWith(S, "{}"))
|
|
352
|
+
S = n ? S : S.slice(0, -2), g = JSON.stringify(g);
|
|
353
|
+
else if (c.isArray(g) && on(g) || (c.isFileList(g) || c.endsWith(S, "[]")) && (Z = c.toArray(g)))
|
|
354
|
+
return S = Ft(S), Z.forEach(function(Oe, _s) {
|
|
355
355
|
!(c.isUndefined(Oe) || Oe === null) && e.append(
|
|
356
356
|
// eslint-disable-next-line no-nested-ternary
|
|
357
|
-
i === !0 ?
|
|
357
|
+
i === !0 ? _t([S], _s, a) : i === null ? S : S + "[]",
|
|
358
358
|
l(Oe)
|
|
359
359
|
);
|
|
360
360
|
}), !1;
|
|
361
361
|
}
|
|
362
|
-
return
|
|
362
|
+
return st(g) ? !0 : (e.append(_t(V, S, a), l(g)), !1);
|
|
363
363
|
}
|
|
364
|
-
const _ = [], C = Object.assign(
|
|
364
|
+
const _ = [], C = Object.assign(ln, {
|
|
365
365
|
defaultVisitor: f,
|
|
366
366
|
convertValue: l,
|
|
367
|
-
isVisitable:
|
|
367
|
+
isVisitable: st
|
|
368
368
|
});
|
|
369
|
-
function O(g,
|
|
369
|
+
function O(g, S) {
|
|
370
370
|
if (!c.isUndefined(g)) {
|
|
371
371
|
if (_.indexOf(g) !== -1)
|
|
372
|
-
throw Error("Circular reference detected in " +
|
|
372
|
+
throw Error("Circular reference detected in " + S.join("."));
|
|
373
373
|
_.push(g), c.forEach(g, function(Z, se) {
|
|
374
374
|
(!(c.isUndefined(Z) || Z === null) && r.call(
|
|
375
375
|
e,
|
|
376
376
|
Z,
|
|
377
377
|
c.isString(se) ? se.trim() : se,
|
|
378
|
-
|
|
378
|
+
S,
|
|
379
379
|
C
|
|
380
|
-
)) === !0 && O(Z,
|
|
380
|
+
)) === !0 && O(Z, S ? S.concat(se) : [se]);
|
|
381
381
|
}), _.pop();
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -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 bt(t) {
|
|
389
389
|
const e = {
|
|
390
390
|
"!": "%21",
|
|
391
391
|
"'": "%27",
|
|
@@ -399,36 +399,36 @@ function xt(t) {
|
|
|
399
399
|
return e[n];
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function ut(t, e) {
|
|
403
403
|
this._pairs = [], t && Je(t, this, e);
|
|
404
404
|
}
|
|
405
|
-
const Ht =
|
|
405
|
+
const Ht = ut.prototype;
|
|
406
406
|
Ht.append = function(e, s) {
|
|
407
407
|
this._pairs.push([e, s]);
|
|
408
408
|
};
|
|
409
409
|
Ht.toString = function(e) {
|
|
410
410
|
const s = e ? function(n) {
|
|
411
|
-
return e.call(this, n,
|
|
412
|
-
} :
|
|
411
|
+
return e.call(this, n, bt);
|
|
412
|
+
} : bt;
|
|
413
413
|
return this._pairs.map(function(r) {
|
|
414
414
|
return s(r[0]) + "=" + s(r[1]);
|
|
415
415
|
}, "").join("&");
|
|
416
416
|
};
|
|
417
|
-
function
|
|
417
|
+
function cn(t) {
|
|
418
418
|
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
419
419
|
}
|
|
420
420
|
function Jt(t, e, s) {
|
|
421
421
|
if (!e)
|
|
422
422
|
return t;
|
|
423
|
-
const n = s && s.encode ||
|
|
423
|
+
const n = s && s.encode || cn, 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 ut(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 un {
|
|
432
432
|
constructor() {
|
|
433
433
|
this.handlers = [];
|
|
434
434
|
}
|
|
@@ -482,36 +482,36 @@ class ln {
|
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
const
|
|
485
|
+
const wt = un, Wt = {
|
|
486
486
|
silentJSONParsing: !0,
|
|
487
487
|
forcedJSONParsing: !0,
|
|
488
488
|
clarifyTimeoutError: !1
|
|
489
|
-
},
|
|
489
|
+
}, dn = typeof URLSearchParams < "u" ? URLSearchParams : ut, fn = typeof FormData < "u" ? FormData : null, hn = typeof Blob < "u" ? Blob : null, pn = (() => {
|
|
490
490
|
let t;
|
|
491
491
|
return typeof navigator < "u" && ((t = navigator.product) === "ReactNative" || t === "NativeScript" || t === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
492
|
-
})(),
|
|
492
|
+
})(), mn = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
493
493
|
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), M = {
|
|
494
494
|
isBrowser: !0,
|
|
495
495
|
classes: {
|
|
496
|
-
URLSearchParams:
|
|
497
|
-
FormData:
|
|
498
|
-
Blob:
|
|
496
|
+
URLSearchParams: dn,
|
|
497
|
+
FormData: fn,
|
|
498
|
+
Blob: hn
|
|
499
499
|
},
|
|
500
|
-
isStandardBrowserEnv:
|
|
501
|
-
isStandardBrowserWebWorkerEnv:
|
|
500
|
+
isStandardBrowserEnv: pn,
|
|
501
|
+
isStandardBrowserWebWorkerEnv: mn,
|
|
502
502
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
503
503
|
};
|
|
504
|
-
function
|
|
504
|
+
function yn(t, e) {
|
|
505
505
|
return Je(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 gn(t) {
|
|
512
512
|
return c.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function vn(t) {
|
|
515
515
|
const e = {}, s = Object.keys(t);
|
|
516
516
|
let n;
|
|
517
517
|
const r = s.length;
|
|
@@ -524,20 +524,20 @@ function Kt(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] = vn(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(gn(n), r, s, 0);
|
|
533
533
|
}), s;
|
|
534
534
|
}
|
|
535
535
|
return null;
|
|
536
536
|
}
|
|
537
|
-
const
|
|
537
|
+
const _n = {
|
|
538
538
|
"Content-Type": void 0
|
|
539
539
|
};
|
|
540
|
-
function
|
|
540
|
+
function bn(t, e, s) {
|
|
541
541
|
if (c.isString(t))
|
|
542
542
|
try {
|
|
543
543
|
return (e || JSON.parse)(t), c.trim(t);
|
|
@@ -563,7 +563,7 @@ 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 yn(e, this.formSerializer).toString();
|
|
567
567
|
if ((o = c.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
568
568
|
const u = this.env && this.env.FormData;
|
|
569
569
|
return Je(
|
|
@@ -573,7 +573,7 @@ const We = {
|
|
|
573
573
|
);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
return a || r ? (s.setContentType("application/json", !1),
|
|
576
|
+
return a || r ? (s.setContentType("application/json", !1), bn(e)) : e;
|
|
577
577
|
}],
|
|
578
578
|
transformResponse: [function(e) {
|
|
579
579
|
const s = this.transitional || We.transitional, n = s && s.forcedJSONParsing, r = this.responseType === "json";
|
|
@@ -583,7 +583,7 @@ const We = {
|
|
|
583
583
|
return JSON.parse(e);
|
|
584
584
|
} catch (o) {
|
|
585
585
|
if (i)
|
|
586
|
-
throw o.name === "SyntaxError" ?
|
|
586
|
+
throw o.name === "SyntaxError" ? T.from(o, T.ERR_BAD_RESPONSE, this, null, this.response) : o;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
return e;
|
|
@@ -614,9 +614,9 @@ c.forEach(["delete", "get", "head"], function(e) {
|
|
|
614
614
|
We.headers[e] = {};
|
|
615
615
|
});
|
|
616
616
|
c.forEach(["post", "put", "patch"], function(e) {
|
|
617
|
-
We.headers[e] = c.merge(
|
|
617
|
+
We.headers[e] = c.merge(_n);
|
|
618
618
|
});
|
|
619
|
-
const
|
|
619
|
+
const dt = We, wn = c.toObjectSet([
|
|
620
620
|
"age",
|
|
621
621
|
"authorization",
|
|
622
622
|
"content-length",
|
|
@@ -634,29 +634,29 @@ const ft = We, _n = c.toObjectSet([
|
|
|
634
634
|
"referer",
|
|
635
635
|
"retry-after",
|
|
636
636
|
"user-agent"
|
|
637
|
-
]),
|
|
637
|
+
]), xn = (t) => {
|
|
638
638
|
const e = {};
|
|
639
639
|
let s, n, r;
|
|
640
640
|
return t && t.split(`
|
|
641
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] && wn[s]) && (s === "set-cookie" ? e[s] ? e[s].push(n) : e[s] = [n] : e[s] = e[s] ? e[s] + ", " + n : n);
|
|
643
643
|
}), e;
|
|
644
|
-
},
|
|
645
|
-
function
|
|
644
|
+
}, xt = Symbol("internals");
|
|
645
|
+
function ce(t) {
|
|
646
646
|
return t && String(t).trim().toLowerCase();
|
|
647
647
|
}
|
|
648
648
|
function Ce(t) {
|
|
649
649
|
return t === !1 || t == null ? t : c.isArray(t) ? t.map(Ce) : String(t);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function kn(t) {
|
|
652
652
|
const e = /* @__PURE__ */ Object.create(null), s = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
653
653
|
let n;
|
|
654
654
|
for (; n = s.exec(t); )
|
|
655
655
|
e[n[1]] = n[2];
|
|
656
656
|
return e;
|
|
657
657
|
}
|
|
658
|
-
const
|
|
659
|
-
function
|
|
658
|
+
const Sn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
659
|
+
function Xe(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 Ye(t, e, s, n, r) {
|
|
|
666
666
|
return n.test(e);
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Tn(t) {
|
|
670
670
|
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, s, n) => s.toUpperCase() + n);
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function En(t, e) {
|
|
673
673
|
const s = c.toCamelCase(" " + e);
|
|
674
674
|
["get", "set", "has"].forEach((n) => {
|
|
675
675
|
Object.defineProperty(t, n + s, {
|
|
@@ -687,24 +687,24 @@ class Ke {
|
|
|
687
687
|
set(e, s, n) {
|
|
688
688
|
const r = this;
|
|
689
689
|
function a(o, u, l) {
|
|
690
|
-
const f =
|
|
690
|
+
const f = ce(u);
|
|
691
691
|
if (!f)
|
|
692
692
|
throw new Error("header name must be a non-empty string");
|
|
693
693
|
const _ = c.findKey(r, f);
|
|
694
694
|
(!_ || r[_] === void 0 || l === !0 || l === void 0 && r[_] !== !1) && (r[_ || u] = Ce(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()) && !Sn(e) ? i(xn(e), s) : e != null && a(s, e, n), this;
|
|
698
698
|
}
|
|
699
699
|
get(e, s) {
|
|
700
|
-
if (e =
|
|
700
|
+
if (e = ce(e), e) {
|
|
701
701
|
const n = c.findKey(this, e);
|
|
702
702
|
if (n) {
|
|
703
703
|
const r = this[n];
|
|
704
704
|
if (!s)
|
|
705
705
|
return r;
|
|
706
706
|
if (s === !0)
|
|
707
|
-
return
|
|
707
|
+
return kn(r);
|
|
708
708
|
if (c.isFunction(s))
|
|
709
709
|
return s.call(this, r, n);
|
|
710
710
|
if (c.isRegExp(s))
|
|
@@ -714,9 +714,9 @@ class Ke {
|
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
has(e, s) {
|
|
717
|
-
if (e =
|
|
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 || Xe(this, this[n], n, s)));
|
|
720
720
|
}
|
|
721
721
|
return !1;
|
|
722
722
|
}
|
|
@@ -724,9 +724,9 @@ class Ke {
|
|
|
724
724
|
const n = this;
|
|
725
725
|
let r = !1;
|
|
726
726
|
function a(i) {
|
|
727
|
-
if (i =
|
|
727
|
+
if (i = ce(i), i) {
|
|
728
728
|
const o = c.findKey(n, i);
|
|
729
|
-
o && (!s ||
|
|
729
|
+
o && (!s || Xe(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 || Xe(this, this[a], a, e, !0)) && (delete this[a], r = !0);
|
|
740
740
|
}
|
|
741
741
|
return r;
|
|
742
742
|
}
|
|
@@ -748,7 +748,7 @@ class Ke {
|
|
|
748
748
|
s[i] = Ce(r), delete s[a];
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
const o = e ?
|
|
751
|
+
const o = e ? Tn(a) : String(a).trim();
|
|
752
752
|
o !== a && delete s[a], s[o] = Ce(r), n[o] = !0;
|
|
753
753
|
}), this;
|
|
754
754
|
}
|
|
@@ -779,12 +779,12 @@ 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[xt] = this[xt] = {
|
|
783
783
|
accessors: {}
|
|
784
784
|
}).accessors, r = this.prototype;
|
|
785
785
|
function a(i) {
|
|
786
|
-
const o =
|
|
787
|
-
n[o] || (
|
|
786
|
+
const o = ce(i);
|
|
787
|
+
n[o] || (En(r, i), n[o] = !0);
|
|
788
788
|
}
|
|
789
789
|
return c.isArray(e) ? e.forEach(a) : a(e), this;
|
|
790
790
|
}
|
|
@@ -793,8 +793,8 @@ Ke.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "Use
|
|
|
793
793
|
c.freezeMethods(Ke.prototype);
|
|
794
794
|
c.freezeMethods(Ke);
|
|
795
795
|
const F = Ke;
|
|
796
|
-
function
|
|
797
|
-
const s = this ||
|
|
796
|
+
function Ye(t, e) {
|
|
797
|
+
const s = this || dt, 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);
|
|
@@ -803,23 +803,23 @@ function Qe(t, e) {
|
|
|
803
803
|
function qt(t) {
|
|
804
804
|
return !!(t && t.__CANCEL__);
|
|
805
805
|
}
|
|
806
|
-
function
|
|
807
|
-
|
|
806
|
+
function ke(t, e, s) {
|
|
807
|
+
T.call(this, t ?? "canceled", T.ERR_CANCELED, e, s), this.name = "CanceledError";
|
|
808
808
|
}
|
|
809
|
-
c.inherits(
|
|
809
|
+
c.inherits(ke, T, {
|
|
810
810
|
__CANCEL__: !0
|
|
811
811
|
});
|
|
812
|
-
function
|
|
812
|
+
function On(t, e, s) {
|
|
813
813
|
const n = s.config.validateStatus;
|
|
814
|
-
!s.status || !n || n(s.status) ? t(s) : e(new
|
|
814
|
+
!s.status || !n || n(s.status) ? t(s) : e(new T(
|
|
815
815
|
"Request failed with status code " + s.status,
|
|
816
|
-
[
|
|
816
|
+
[T.ERR_BAD_REQUEST, T.ERR_BAD_RESPONSE][Math.floor(s.status / 100) - 4],
|
|
817
817
|
s.config,
|
|
818
818
|
s.request,
|
|
819
819
|
s
|
|
820
820
|
));
|
|
821
821
|
}
|
|
822
|
-
const
|
|
822
|
+
const Nn = M.isStandardBrowserEnv ? (
|
|
823
823
|
// Standard browser envs support document.cookie
|
|
824
824
|
function() {
|
|
825
825
|
return {
|
|
@@ -850,16 +850,16 @@ const En = M.isStandardBrowserEnv ? (
|
|
|
850
850
|
};
|
|
851
851
|
}()
|
|
852
852
|
);
|
|
853
|
-
function
|
|
853
|
+
function Cn(t) {
|
|
854
854
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function An(t, e) {
|
|
857
857
|
return e ? t.replace(/\/+$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
858
858
|
}
|
|
859
859
|
function Gt(t, e) {
|
|
860
|
-
return t && !
|
|
860
|
+
return t && !Cn(e) ? An(t, e) : e;
|
|
861
861
|
}
|
|
862
|
-
const
|
|
862
|
+
const Rn = M.isStandardBrowserEnv ? (
|
|
863
863
|
// Standard browser envs have full support of the APIs needed to test
|
|
864
864
|
// whether the request URL is of the same origin as current location.
|
|
865
865
|
function() {
|
|
@@ -891,11 +891,11 @@ const Cn = M.isStandardBrowserEnv ? (
|
|
|
891
891
|
};
|
|
892
892
|
}()
|
|
893
893
|
);
|
|
894
|
-
function
|
|
894
|
+
function In(t) {
|
|
895
895
|
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
896
896
|
return e && e[1] || "";
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function jn(t, e) {
|
|
899
899
|
t = t || 10;
|
|
900
900
|
const s = new Array(t), n = new Array(t);
|
|
901
901
|
let r = 0, a = 0, i;
|
|
@@ -911,9 +911,9 @@ function Rn(t, e) {
|
|
|
911
911
|
return O ? Math.round(C * 1e3 / O) : void 0;
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function kt(t, e) {
|
|
915
915
|
let s = 0;
|
|
916
|
-
const n =
|
|
916
|
+
const n = jn(50, 250);
|
|
917
917
|
return (r) => {
|
|
918
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 St(t, e) {
|
|
|
929
929
|
f[e ? "download" : "upload"] = !0, t(f);
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
|
-
const
|
|
932
|
+
const Zn = typeof XMLHttpRequest < "u", Ln = Zn && function(t) {
|
|
933
933
|
return new Promise(function(s, n) {
|
|
934
934
|
let r = t.data;
|
|
935
935
|
const a = F.from(t.headers).normalize(), i = t.responseType;
|
|
@@ -950,7 +950,7 @@ const In = typeof XMLHttpRequest < "u", jn = In && function(t) {
|
|
|
950
950
|
return;
|
|
951
951
|
const O = F.from(
|
|
952
952
|
"getAllResponseHeaders" in l && l.getAllResponseHeaders()
|
|
953
|
-
),
|
|
953
|
+
), S = {
|
|
954
954
|
data: !i || i === "text" || i === "json" ? l.responseText : l.response,
|
|
955
955
|
status: l.status,
|
|
956
956
|
statusText: l.statusText,
|
|
@@ -958,46 +958,46 @@ const In = typeof XMLHttpRequest < "u", jn = In && function(t) {
|
|
|
958
958
|
config: t,
|
|
959
959
|
request: l
|
|
960
960
|
};
|
|
961
|
-
|
|
961
|
+
On(function(Z) {
|
|
962
962
|
s(Z), u();
|
|
963
963
|
}, function(Z) {
|
|
964
964
|
n(Z), u();
|
|
965
|
-
},
|
|
965
|
+
}, S), l = null;
|
|
966
966
|
}
|
|
967
967
|
if ("onloadend" in l ? l.onloadend = _ : l.onreadystatechange = function() {
|
|
968
968
|
!l || l.readyState !== 4 || l.status === 0 && !(l.responseURL && l.responseURL.indexOf("file:") === 0) || setTimeout(_);
|
|
969
969
|
}, l.onabort = function() {
|
|
970
|
-
l && (n(new
|
|
970
|
+
l && (n(new T("Request aborted", T.ECONNABORTED, t, l)), l = null);
|
|
971
971
|
}, l.onerror = function() {
|
|
972
|
-
n(new
|
|
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
|
|
976
|
-
t.timeoutErrorMessage && (g = t.timeoutErrorMessage), n(new
|
|
975
|
+
const S = t.transitional || Wt;
|
|
976
|
+
t.timeoutErrorMessage && (g = t.timeoutErrorMessage), n(new T(
|
|
977
977
|
g,
|
|
978
|
-
|
|
978
|
+
S.clarifyTimeoutError ? T.ETIMEDOUT : T.ECONNABORTED,
|
|
979
979
|
t,
|
|
980
980
|
l
|
|
981
981
|
)), l = null;
|
|
982
982
|
}, M.isStandardBrowserEnv) {
|
|
983
|
-
const O = (t.withCredentials ||
|
|
983
|
+
const O = (t.withCredentials || Rn(f)) && t.xsrfCookieName && Nn.read(t.xsrfCookieName);
|
|
984
984
|
O && a.set(t.xsrfHeaderName, O);
|
|
985
985
|
}
|
|
986
|
-
r === void 0 && a.setContentType(null), "setRequestHeader" in l && c.forEach(a.toJSON(), function(g,
|
|
987
|
-
l.setRequestHeader(
|
|
988
|
-
}), c.isUndefined(t.withCredentials) || (l.withCredentials = !!t.withCredentials), i && i !== "json" && (l.responseType = t.responseType), typeof t.onDownloadProgress == "function" && l.addEventListener("progress",
|
|
989
|
-
l && (n(!O || O.type ? new
|
|
986
|
+
r === void 0 && a.setContentType(null), "setRequestHeader" in l && c.forEach(a.toJSON(), function(g, S) {
|
|
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", kt(t.onDownloadProgress, !0)), typeof t.onUploadProgress == "function" && l.upload && l.upload.addEventListener("progress", kt(t.onUploadProgress)), (t.cancelToken || t.signal) && (o = (O) => {
|
|
989
|
+
l && (n(!O || O.type ? new ke(null, t, l) : O), l.abort(), l = null);
|
|
990
990
|
}, t.cancelToken && t.cancelToken.subscribe(o), t.signal && (t.signal.aborted ? o() : t.signal.addEventListener("abort", o)));
|
|
991
|
-
const C =
|
|
991
|
+
const C = In(f);
|
|
992
992
|
if (C && M.protocols.indexOf(C) === -1) {
|
|
993
|
-
n(new
|
|
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
998
|
}, Ae = {
|
|
999
|
-
http:
|
|
1000
|
-
xhr:
|
|
999
|
+
http: an,
|
|
1000
|
+
xhr: Ln
|
|
1001
1001
|
};
|
|
1002
1002
|
c.forEach(Ae, (t, e) => {
|
|
1003
1003
|
if (t) {
|
|
@@ -1008,7 +1008,7 @@ c.forEach(Ae, (t, e) => {
|
|
|
1008
1008
|
Object.defineProperty(t, "adapterName", { value: e });
|
|
1009
1009
|
}
|
|
1010
1010
|
});
|
|
1011
|
-
const
|
|
1011
|
+
const Dn = {
|
|
1012
1012
|
getAdapter: (t) => {
|
|
1013
1013
|
t = c.isArray(t) ? t : [t];
|
|
1014
1014
|
const { length: e } = t;
|
|
@@ -1016,7 +1016,7 @@ const Zn = {
|
|
|
1016
1016
|
for (let r = 0; r < e && (s = t[r], !(n = c.isString(s) ? Ae[s.toLowerCase()] : s)); r++)
|
|
1017
1017
|
;
|
|
1018
1018
|
if (!n)
|
|
1019
|
-
throw n === !1 ? new
|
|
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(
|
|
@@ -1028,29 +1028,29 @@ const Zn = {
|
|
|
1028
1028
|
},
|
|
1029
1029
|
adapters: Ae
|
|
1030
1030
|
};
|
|
1031
|
-
function
|
|
1031
|
+
function Qe(t) {
|
|
1032
1032
|
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1033
|
-
throw new
|
|
1033
|
+
throw new ke(null, t);
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return
|
|
1035
|
+
function St(t) {
|
|
1036
|
+
return Qe(t), t.headers = F.from(t.headers), t.data = Ye.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), Dn.getAdapter(t.adapter || dt.adapter)(t).then(function(n) {
|
|
1040
|
+
return Qe(t), n.data = Ye.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 qt(n) || (
|
|
1046
|
+
return qt(n) || (Qe(t), n && n.response && (n.response.data = Ye.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 Tt = (t) => t instanceof F ? t.toJSON() : t;
|
|
1054
1054
|
function ae(t, e) {
|
|
1055
1055
|
e = e || {};
|
|
1056
1056
|
const s = {};
|
|
@@ -1109,31 +1109,31 @@ 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(Tt(l), Tt(f), !0)
|
|
1113
1113
|
};
|
|
1114
1114
|
return c.forEach(Object.keys(Object.assign({}, t, e)), function(f) {
|
|
1115
1115
|
const _ = u[f] || r, C = _(t[f], e[f], f);
|
|
1116
1116
|
c.isUndefined(C) && _ !== o || (s[f] = C);
|
|
1117
1117
|
}), s;
|
|
1118
1118
|
}
|
|
1119
|
-
const Xt = "1.4.0",
|
|
1119
|
+
const Xt = "1.4.0", ft = {};
|
|
1120
1120
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1121
|
-
|
|
1121
|
+
ft[t] = function(n) {
|
|
1122
1122
|
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1123
1123
|
};
|
|
1124
1124
|
});
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1125
|
+
const Et = {};
|
|
1126
|
+
ft.transitional = function(e, s, n) {
|
|
1127
1127
|
function r(a, i) {
|
|
1128
1128
|
return "[Axios v" + Xt + "] Transitional option '" + a + "'" + i + (n ? ". " + n : "");
|
|
1129
1129
|
}
|
|
1130
1130
|
return (a, i, o) => {
|
|
1131
1131
|
if (e === !1)
|
|
1132
|
-
throw new
|
|
1132
|
+
throw new T(
|
|
1133
1133
|
r(i, " has been removed" + (s ? " in " + s : "")),
|
|
1134
|
-
|
|
1134
|
+
T.ERR_DEPRECATED
|
|
1135
1135
|
);
|
|
1136
|
-
return s && !
|
|
1136
|
+
return s && !Et[i] && (Et[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,9 +1141,9 @@ ht.transitional = function(e, s, n) {
|
|
|
1141
1141
|
)), e ? e(a, i, o) : !0;
|
|
1142
1142
|
};
|
|
1143
1143
|
};
|
|
1144
|
-
function
|
|
1144
|
+
function Pn(t, e, s) {
|
|
1145
1145
|
if (typeof t != "object")
|
|
1146
|
-
throw new
|
|
1146
|
+
throw new T("options must be an object", T.ERR_BAD_OPTION_VALUE);
|
|
1147
1147
|
const n = Object.keys(t);
|
|
1148
1148
|
let r = n.length;
|
|
1149
1149
|
for (; r-- > 0; ) {
|
|
@@ -1151,22 +1151,22 @@ function Dn(t, e, s) {
|
|
|
1151
1151
|
if (i) {
|
|
1152
1152
|
const o = t[a], u = o === void 0 || i(o, a, t);
|
|
1153
1153
|
if (u !== !0)
|
|
1154
|
-
throw new
|
|
1154
|
+
throw new T("option " + a + " must be " + u, T.ERR_BAD_OPTION_VALUE);
|
|
1155
1155
|
continue;
|
|
1156
1156
|
}
|
|
1157
1157
|
if (s !== !0)
|
|
1158
|
-
throw new
|
|
1158
|
+
throw new T("Unknown option " + a, T.ERR_BAD_OPTION);
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
|
-
const
|
|
1162
|
-
assertOptions:
|
|
1163
|
-
validators:
|
|
1164
|
-
}, W =
|
|
1161
|
+
const nt = {
|
|
1162
|
+
assertOptions: Pn,
|
|
1163
|
+
validators: ft
|
|
1164
|
+
}, W = nt.validators;
|
|
1165
1165
|
class je {
|
|
1166
1166
|
constructor(e) {
|
|
1167
1167
|
this.defaults = e, this.interceptors = {
|
|
1168
|
-
request: new
|
|
1169
|
-
response: new
|
|
1168
|
+
request: new wt(),
|
|
1169
|
+
response: new wt()
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
1172
|
/**
|
|
@@ -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 && nt.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
|
+
} : nt.assertOptions(r, {
|
|
1190
1190
|
encode: W.function,
|
|
1191
1191
|
serialize: W.function
|
|
1192
1192
|
}, !0)), s.method = (s.method || this.defaults.method || "get").toLowerCase();
|
|
@@ -1202,16 +1202,16 @@ class je {
|
|
|
1202
1202
|
), s.headers = F.concat(i, a);
|
|
1203
1203
|
const o = [];
|
|
1204
1204
|
let u = !0;
|
|
1205
|
-
this.interceptors.request.forEach(function(
|
|
1206
|
-
typeof
|
|
1205
|
+
this.interceptors.request.forEach(function(S) {
|
|
1206
|
+
typeof S.runWhen == "function" && S.runWhen(s) === !1 || (u = u && S.synchronous, o.unshift(S.fulfilled, S.rejected));
|
|
1207
1207
|
});
|
|
1208
1208
|
const l = [];
|
|
1209
|
-
this.interceptors.response.forEach(function(
|
|
1210
|
-
l.push(
|
|
1209
|
+
this.interceptors.response.forEach(function(S) {
|
|
1210
|
+
l.push(S.fulfilled, S.rejected);
|
|
1211
1211
|
});
|
|
1212
1212
|
let f, _ = 0, C;
|
|
1213
1213
|
if (!u) {
|
|
1214
|
-
const g = [
|
|
1214
|
+
const g = [St.bind(this), void 0];
|
|
1215
1215
|
for (g.unshift.apply(g, o), g.push.apply(g, l), C = g.length, f = Promise.resolve(s); _ < C; )
|
|
1216
1216
|
f = f.then(g[_++], g[_++]);
|
|
1217
1217
|
return f;
|
|
@@ -1219,16 +1219,16 @@ class je {
|
|
|
1219
1219
|
C = o.length;
|
|
1220
1220
|
let O = s;
|
|
1221
1221
|
for (_ = 0; _ < C; ) {
|
|
1222
|
-
const g = o[_++],
|
|
1222
|
+
const g = o[_++], S = o[_++];
|
|
1223
1223
|
try {
|
|
1224
1224
|
O = g(O);
|
|
1225
1225
|
} catch (V) {
|
|
1226
|
-
|
|
1226
|
+
S.call(this, V);
|
|
1227
1227
|
break;
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
1230
|
try {
|
|
1231
|
-
f =
|
|
1231
|
+
f = St.call(this, O);
|
|
1232
1232
|
} catch (g) {
|
|
1233
1233
|
return Promise.reject(g);
|
|
1234
1234
|
}
|
|
@@ -1267,7 +1267,7 @@ c.forEach(["post", "put", "patch"], function(e) {
|
|
|
1267
1267
|
je.prototype[e] = s(), je.prototype[e + "Form"] = s(!0);
|
|
1268
1268
|
});
|
|
1269
1269
|
const Re = je;
|
|
1270
|
-
class
|
|
1270
|
+
class ht {
|
|
1271
1271
|
constructor(e) {
|
|
1272
1272
|
if (typeof e != "function")
|
|
1273
1273
|
throw new TypeError("executor must be a function.");
|
|
@@ -1292,7 +1292,7 @@ class pt {
|
|
|
1292
1292
|
n.unsubscribe(a);
|
|
1293
1293
|
}, i;
|
|
1294
1294
|
}, e(function(a, i, o) {
|
|
1295
|
-
n.reason || (n.reason = new
|
|
1295
|
+
n.reason || (n.reason = new ke(a, i, o), s(n.reason));
|
|
1296
1296
|
});
|
|
1297
1297
|
}
|
|
1298
1298
|
/**
|
|
@@ -1328,23 +1328,23 @@ class pt {
|
|
|
1328
1328
|
static source() {
|
|
1329
1329
|
let e;
|
|
1330
1330
|
return {
|
|
1331
|
-
token: new
|
|
1331
|
+
token: new ht(function(r) {
|
|
1332
1332
|
e = r;
|
|
1333
1333
|
}),
|
|
1334
1334
|
cancel: e
|
|
1335
1335
|
};
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
|
-
const
|
|
1339
|
-
function
|
|
1338
|
+
const Bn = ht;
|
|
1339
|
+
function Mn(t) {
|
|
1340
1340
|
return function(s) {
|
|
1341
1341
|
return t.apply(null, s);
|
|
1342
1342
|
};
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function Un(t) {
|
|
1345
1345
|
return c.isObject(t) && t.isAxiosError === !0;
|
|
1346
1346
|
}
|
|
1347
|
-
const
|
|
1347
|
+
const rt = {
|
|
1348
1348
|
Continue: 100,
|
|
1349
1349
|
SwitchingProtocols: 101,
|
|
1350
1350
|
Processing: 102,
|
|
@@ -1409,61 +1409,61 @@ const at = {
|
|
|
1409
1409
|
NotExtended: 510,
|
|
1410
1410
|
NetworkAuthenticationRequired: 511
|
|
1411
1411
|
};
|
|
1412
|
-
Object.entries(
|
|
1413
|
-
|
|
1412
|
+
Object.entries(rt).forEach(([t, e]) => {
|
|
1413
|
+
rt[e] = t;
|
|
1414
1414
|
});
|
|
1415
|
-
const
|
|
1415
|
+
const zn = rt;
|
|
1416
1416
|
function Yt(t) {
|
|
1417
1417
|
const e = new Re(t), s = Zt(Re.prototype.request, e);
|
|
1418
1418
|
return c.extend(s, Re.prototype, e, { allOwnKeys: !0 }), c.extend(s, e, null, { allOwnKeys: !0 }), s.create = function(r) {
|
|
1419
1419
|
return Yt(ae(t, r));
|
|
1420
1420
|
}, s;
|
|
1421
1421
|
}
|
|
1422
|
-
const A = Yt(
|
|
1422
|
+
const A = Yt(dt);
|
|
1423
1423
|
A.Axios = Re;
|
|
1424
|
-
A.CanceledError =
|
|
1425
|
-
A.CancelToken =
|
|
1424
|
+
A.CanceledError = ke;
|
|
1425
|
+
A.CancelToken = Bn;
|
|
1426
1426
|
A.isCancel = qt;
|
|
1427
1427
|
A.VERSION = Xt;
|
|
1428
1428
|
A.toFormData = Je;
|
|
1429
|
-
A.AxiosError =
|
|
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 = Mn;
|
|
1435
|
+
A.isAxiosError = Un;
|
|
1436
1436
|
A.mergeConfig = ae;
|
|
1437
1437
|
A.AxiosHeaders = F;
|
|
1438
1438
|
A.formToJSON = (t) => Kt(c.isHTMLForm(t) ? new FormData(t) : t);
|
|
1439
|
-
A.HttpStatusCode =
|
|
1439
|
+
A.HttpStatusCode = zn;
|
|
1440
1440
|
A.default = A;
|
|
1441
|
-
const
|
|
1442
|
-
function
|
|
1441
|
+
const pt = A;
|
|
1442
|
+
function mt({ apiKey: t, options: e }) {
|
|
1443
1443
|
let s = {};
|
|
1444
|
-
return t &&
|
|
1444
|
+
return t && xs(s, ["headers", "Authorization"], `API-Key ${t}`), e && (s = Rt(s, e)), s;
|
|
1445
1445
|
}
|
|
1446
|
-
async function
|
|
1447
|
-
return await
|
|
1446
|
+
async function Qt({ url: t, apiKey: e, options: s }) {
|
|
1447
|
+
return await pt.get(t, mt({ apiKey: e, options: s }));
|
|
1448
1448
|
}
|
|
1449
|
-
async function
|
|
1450
|
-
return await
|
|
1449
|
+
async function es({ url: t, apiKey: e, options: s, payload: n = {} }) {
|
|
1450
|
+
return await pt.post(t, n, mt({ apiKey: e, options: s }));
|
|
1451
1451
|
}
|
|
1452
|
-
async function
|
|
1453
|
-
return await
|
|
1452
|
+
async function $n({ url: t, apiKey: e, options: s, payload: n }) {
|
|
1453
|
+
return await pt.put(t, n, mt({ apiKey: e, options: s }));
|
|
1454
1454
|
}
|
|
1455
|
-
async function
|
|
1455
|
+
async function Se(t) {
|
|
1456
1456
|
try {
|
|
1457
1457
|
return await t();
|
|
1458
1458
|
} catch (e) {
|
|
1459
1459
|
return Promise.reject(e);
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
|
-
const
|
|
1463
|
-
async function
|
|
1464
|
-
return
|
|
1465
|
-
const
|
|
1466
|
-
return
|
|
1462
|
+
const Te = "https://jmpuf4u3tj.execute-api.us-east-1.amazonaws.com/dev", Vn = "wss://7xapurynd7.execute-api.us-east-1.amazonaws.com/dev", Fn = "120000";
|
|
1463
|
+
async function Hn(t, e, s) {
|
|
1464
|
+
return Se(async () => {
|
|
1465
|
+
const n = (await es({ url: `${Te}/api/v1/images/book/${e}`, apiKey: t, payload: s })).data;
|
|
1466
|
+
return Hr.parse(n), n;
|
|
1467
1467
|
});
|
|
1468
1468
|
}
|
|
1469
1469
|
var E;
|
|
@@ -1502,14 +1502,14 @@ var E;
|
|
|
1502
1502
|
}
|
|
1503
1503
|
t.joinValues = n, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
1504
1504
|
})(E || (E = {}));
|
|
1505
|
-
var
|
|
1505
|
+
var at;
|
|
1506
1506
|
(function(t) {
|
|
1507
1507
|
t.mergeShapes = (e, s) => ({
|
|
1508
1508
|
...e,
|
|
1509
1509
|
...s
|
|
1510
1510
|
// second overwrites first
|
|
1511
1511
|
});
|
|
1512
|
-
})(
|
|
1512
|
+
})(at || (at = {}));
|
|
1513
1513
|
const p = E.arrayToEnum([
|
|
1514
1514
|
"string",
|
|
1515
1515
|
"nan",
|
|
@@ -1569,8 +1569,8 @@ const p = E.arrayToEnum([
|
|
|
1569
1569
|
"invalid_intersection_types",
|
|
1570
1570
|
"not_multiple_of",
|
|
1571
1571
|
"not_finite"
|
|
1572
|
-
]),
|
|
1573
|
-
class
|
|
1572
|
+
]), Jn = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
1573
|
+
class D extends Error {
|
|
1574
1574
|
constructor(e) {
|
|
1575
1575
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
1576
1576
|
this.issues = [...this.issues, n];
|
|
@@ -1625,8 +1625,8 @@ class L extends Error {
|
|
|
1625
1625
|
return this.flatten();
|
|
1626
1626
|
}
|
|
1627
1627
|
}
|
|
1628
|
-
|
|
1629
|
-
const
|
|
1628
|
+
D.create = (t) => new D(t);
|
|
1629
|
+
const de = (t, e) => {
|
|
1630
1630
|
let s;
|
|
1631
1631
|
switch (t.code) {
|
|
1632
1632
|
case h.invalid_type:
|
|
@@ -1682,14 +1682,14 @@ const he = (t, e) => {
|
|
|
1682
1682
|
}
|
|
1683
1683
|
return { message: s };
|
|
1684
1684
|
};
|
|
1685
|
-
let
|
|
1686
|
-
function
|
|
1687
|
-
|
|
1685
|
+
let ts = de;
|
|
1686
|
+
function Wn(t) {
|
|
1687
|
+
ts = t;
|
|
1688
1688
|
}
|
|
1689
1689
|
function Ze() {
|
|
1690
|
-
return
|
|
1690
|
+
return ts;
|
|
1691
1691
|
}
|
|
1692
|
-
const
|
|
1692
|
+
const Le = (t) => {
|
|
1693
1693
|
const { data: e, path: s, errorMaps: n, issueData: r } = t, a = [...s, ...r.path || []], i = {
|
|
1694
1694
|
...r,
|
|
1695
1695
|
path: a
|
|
@@ -1703,9 +1703,9 @@ const De = (t) => {
|
|
|
1703
1703
|
path: a,
|
|
1704
1704
|
message: r.message || o
|
|
1705
1705
|
};
|
|
1706
|
-
},
|
|
1706
|
+
}, Kn = [];
|
|
1707
1707
|
function m(t, e) {
|
|
1708
|
-
const s =
|
|
1708
|
+
const s = Le({
|
|
1709
1709
|
issueData: e,
|
|
1710
1710
|
data: t.data,
|
|
1711
1711
|
path: t.path,
|
|
@@ -1713,7 +1713,7 @@ function m(t, e) {
|
|
|
1713
1713
|
t.common.contextualErrorMap,
|
|
1714
1714
|
t.schemaErrorMap,
|
|
1715
1715
|
Ze(),
|
|
1716
|
-
|
|
1716
|
+
de
|
|
1717
1717
|
// then global default map
|
|
1718
1718
|
].filter((n) => !!n)
|
|
1719
1719
|
});
|
|
@@ -1760,7 +1760,7 @@ class R {
|
|
|
1760
1760
|
}
|
|
1761
1761
|
const b = Object.freeze({
|
|
1762
1762
|
status: "aborted"
|
|
1763
|
-
}),
|
|
1763
|
+
}), ss = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), it = (t) => t.status === "aborted", ot = (t) => t.status === "dirty", De = (t) => t.status === "valid", Pe = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
1764
1764
|
var y;
|
|
1765
1765
|
(function(t) {
|
|
1766
1766
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
@@ -1773,8 +1773,8 @@ class U {
|
|
|
1773
1773
|
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
1774
|
}
|
|
1775
1775
|
}
|
|
1776
|
-
const
|
|
1777
|
-
if (
|
|
1776
|
+
const Ot = (t, e) => {
|
|
1777
|
+
if (De(e))
|
|
1778
1778
|
return { success: !0, data: e.value };
|
|
1779
1779
|
if (!t.common.issues.length)
|
|
1780
1780
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -1783,12 +1783,12 @@ const Ct = (t, e) => {
|
|
|
1783
1783
|
get error() {
|
|
1784
1784
|
if (this._error)
|
|
1785
1785
|
return this._error;
|
|
1786
|
-
const s = new
|
|
1786
|
+
const s = new D(t.common.issues);
|
|
1787
1787
|
return this._error = s, this._error;
|
|
1788
1788
|
}
|
|
1789
1789
|
};
|
|
1790
1790
|
};
|
|
1791
|
-
function
|
|
1791
|
+
function x(t) {
|
|
1792
1792
|
if (!t)
|
|
1793
1793
|
return {};
|
|
1794
1794
|
const { errorMap: e, invalid_type_error: s, required_error: n, description: r } = t;
|
|
@@ -1859,7 +1859,7 @@ class k {
|
|
|
1859
1859
|
data: e,
|
|
1860
1860
|
parsedType: K(e)
|
|
1861
1861
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
1862
|
-
return
|
|
1862
|
+
return Ot(r, a);
|
|
1863
1863
|
}
|
|
1864
1864
|
async parseAsync(e, s) {
|
|
1865
1865
|
const n = await this.safeParseAsync(e, s);
|
|
@@ -1880,7 +1880,7 @@ class k {
|
|
|
1880
1880
|
data: e,
|
|
1881
1881
|
parsedType: K(e)
|
|
1882
1882
|
}, r = this._parse({ data: e, path: n.path, parent: n }), a = await (Pe(r) ? r : Promise.resolve(r));
|
|
1883
|
-
return
|
|
1883
|
+
return Ot(n, a);
|
|
1884
1884
|
}
|
|
1885
1885
|
refine(e, s) {
|
|
1886
1886
|
const n = (r) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(r) : s;
|
|
@@ -1921,14 +1921,14 @@ class k {
|
|
|
1921
1921
|
return oe.create(this, this._def);
|
|
1922
1922
|
}
|
|
1923
1923
|
or(e) {
|
|
1924
|
-
return
|
|
1924
|
+
return me.create([this, e], this._def);
|
|
1925
1925
|
}
|
|
1926
1926
|
and(e) {
|
|
1927
|
-
return
|
|
1927
|
+
return ye.create(this, e, this._def);
|
|
1928
1928
|
}
|
|
1929
1929
|
transform(e) {
|
|
1930
1930
|
return new B({
|
|
1931
|
-
...
|
|
1931
|
+
...x(this._def),
|
|
1932
1932
|
schema: this,
|
|
1933
1933
|
typeName: v.ZodEffects,
|
|
1934
1934
|
effect: { type: "transform", transform: e }
|
|
@@ -1936,24 +1936,24 @@ class k {
|
|
|
1936
1936
|
}
|
|
1937
1937
|
default(e) {
|
|
1938
1938
|
const s = typeof e == "function" ? e : () => e;
|
|
1939
|
-
return new
|
|
1940
|
-
...
|
|
1939
|
+
return new we({
|
|
1940
|
+
...x(this._def),
|
|
1941
1941
|
innerType: this,
|
|
1942
1942
|
defaultValue: s,
|
|
1943
1943
|
typeName: v.ZodDefault
|
|
1944
1944
|
});
|
|
1945
1945
|
}
|
|
1946
1946
|
brand() {
|
|
1947
|
-
return new
|
|
1947
|
+
return new rs({
|
|
1948
1948
|
typeName: v.ZodBranded,
|
|
1949
1949
|
type: this,
|
|
1950
|
-
...
|
|
1950
|
+
...x(this._def)
|
|
1951
1951
|
});
|
|
1952
1952
|
}
|
|
1953
1953
|
catch(e) {
|
|
1954
1954
|
const s = typeof e == "function" ? e : () => e;
|
|
1955
1955
|
return new ze({
|
|
1956
|
-
...
|
|
1956
|
+
...x(this._def),
|
|
1957
1957
|
innerType: this,
|
|
1958
1958
|
catchValue: s,
|
|
1959
1959
|
typeName: v.ZodCatch
|
|
@@ -1976,23 +1976,23 @@ class k {
|
|
|
1976
1976
|
return this.safeParse(null).success;
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
|
-
const
|
|
1980
|
-
function
|
|
1981
|
-
return !!((e === "v4" || !e) &&
|
|
1979
|
+
const qn = /^c[^\s-]{8,}$/i, Gn = /^[a-z][a-z0-9]*$/, Xn = /[0-9A-HJKMNP-TV-Z]{26}/, Yn = /^([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, Qn = /^(([^<>()[\]\\.,;:\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,})+))$/, er = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u, tr = /^(((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}))$/, sr = /^(([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})))$/, nr = (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$");
|
|
1980
|
+
function rr(t, e) {
|
|
1981
|
+
return !!((e === "v4" || !e) && tr.test(t) || (e === "v6" || !e) && sr.test(t));
|
|
1982
1982
|
}
|
|
1983
|
-
class
|
|
1983
|
+
class L extends k {
|
|
1984
1984
|
constructor() {
|
|
1985
1985
|
super(...arguments), this._regex = (e, s, n) => this.refinement((r) => e.test(r), {
|
|
1986
1986
|
validation: s,
|
|
1987
1987
|
code: h.invalid_string,
|
|
1988
1988
|
...y.errToObj(n)
|
|
1989
|
-
}), this.nonempty = (e) => this.min(1, y.errToObj(e)), this.trim = () => new
|
|
1989
|
+
}), this.nonempty = (e) => this.min(1, y.errToObj(e)), this.trim = () => new L({
|
|
1990
1990
|
...this._def,
|
|
1991
1991
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1992
|
-
}), this.toLowerCase = () => new
|
|
1992
|
+
}), this.toLowerCase = () => new L({
|
|
1993
1993
|
...this._def,
|
|
1994
1994
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1995
|
-
}), this.toUpperCase = () => new
|
|
1995
|
+
}), this.toUpperCase = () => new L({
|
|
1996
1996
|
...this._def,
|
|
1997
1997
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1998
1998
|
});
|
|
@@ -2049,37 +2049,37 @@ class D extends k {
|
|
|
2049
2049
|
message: a.message
|
|
2050
2050
|
}), n.dirty());
|
|
2051
2051
|
} else if (a.kind === "email")
|
|
2052
|
-
|
|
2052
|
+
Qn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2053
2053
|
validation: "email",
|
|
2054
2054
|
code: h.invalid_string,
|
|
2055
2055
|
message: a.message
|
|
2056
2056
|
}), n.dirty());
|
|
2057
2057
|
else if (a.kind === "emoji")
|
|
2058
|
-
|
|
2058
|
+
er.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2059
2059
|
validation: "emoji",
|
|
2060
2060
|
code: h.invalid_string,
|
|
2061
2061
|
message: a.message
|
|
2062
2062
|
}), n.dirty());
|
|
2063
2063
|
else if (a.kind === "uuid")
|
|
2064
|
-
|
|
2064
|
+
Yn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2065
2065
|
validation: "uuid",
|
|
2066
2066
|
code: h.invalid_string,
|
|
2067
2067
|
message: a.message
|
|
2068
2068
|
}), n.dirty());
|
|
2069
2069
|
else if (a.kind === "cuid")
|
|
2070
|
-
|
|
2070
|
+
qn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2071
2071
|
validation: "cuid",
|
|
2072
2072
|
code: h.invalid_string,
|
|
2073
2073
|
message: a.message
|
|
2074
2074
|
}), n.dirty());
|
|
2075
2075
|
else if (a.kind === "cuid2")
|
|
2076
|
-
|
|
2076
|
+
Gn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2077
2077
|
validation: "cuid2",
|
|
2078
2078
|
code: h.invalid_string,
|
|
2079
2079
|
message: a.message
|
|
2080
2080
|
}), n.dirty());
|
|
2081
2081
|
else if (a.kind === "ulid")
|
|
2082
|
-
|
|
2082
|
+
Xn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2083
2083
|
validation: "ulid",
|
|
2084
2084
|
code: h.invalid_string,
|
|
2085
2085
|
message: a.message
|
|
@@ -2111,11 +2111,11 @@ class D extends k {
|
|
|
2111
2111
|
code: h.invalid_string,
|
|
2112
2112
|
validation: { endsWith: a.value },
|
|
2113
2113
|
message: a.message
|
|
2114
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
2114
|
+
}), n.dirty()) : a.kind === "datetime" ? nr(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2115
2115
|
code: h.invalid_string,
|
|
2116
2116
|
validation: "datetime",
|
|
2117
2117
|
message: a.message
|
|
2118
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
2118
|
+
}), n.dirty()) : a.kind === "ip" ? rr(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2119
2119
|
validation: "ip",
|
|
2120
2120
|
code: h.invalid_string,
|
|
2121
2121
|
message: a.message
|
|
@@ -2123,7 +2123,7 @@ class D extends k {
|
|
|
2123
2123
|
return { status: n.value, value: e.data };
|
|
2124
2124
|
}
|
|
2125
2125
|
_addCheck(e) {
|
|
2126
|
-
return new
|
|
2126
|
+
return new L({
|
|
2127
2127
|
...this._def,
|
|
2128
2128
|
checks: [...this._def.checks, e]
|
|
2129
2129
|
});
|
|
@@ -2256,16 +2256,16 @@ class D extends k {
|
|
|
2256
2256
|
return e;
|
|
2257
2257
|
}
|
|
2258
2258
|
}
|
|
2259
|
-
|
|
2259
|
+
L.create = (t) => {
|
|
2260
2260
|
var e;
|
|
2261
|
-
return new
|
|
2261
|
+
return new L({
|
|
2262
2262
|
checks: [],
|
|
2263
2263
|
typeName: v.ZodString,
|
|
2264
2264
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
|
|
2265
|
-
...
|
|
2265
|
+
...x(t)
|
|
2266
2266
|
});
|
|
2267
2267
|
};
|
|
2268
|
-
function
|
|
2268
|
+
function ar(t, e) {
|
|
2269
2269
|
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
2270
|
return a % i / Math.pow(10, r);
|
|
2271
2271
|
}
|
|
@@ -2304,7 +2304,7 @@ class q extends k {
|
|
|
2304
2304
|
inclusive: a.inclusive,
|
|
2305
2305
|
exact: !1,
|
|
2306
2306
|
message: a.message
|
|
2307
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
2307
|
+
}), r.dirty()) : a.kind === "multipleOf" ? ar(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2308
2308
|
code: h.not_multiple_of,
|
|
2309
2309
|
multipleOf: a.value,
|
|
2310
2310
|
message: a.message
|
|
@@ -2439,7 +2439,7 @@ q.create = (t) => new q({
|
|
|
2439
2439
|
checks: [],
|
|
2440
2440
|
typeName: v.ZodNumber,
|
|
2441
2441
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2442
|
-
...
|
|
2442
|
+
...x(t)
|
|
2443
2443
|
});
|
|
2444
2444
|
class G extends k {
|
|
2445
2445
|
constructor() {
|
|
@@ -2566,10 +2566,10 @@ G.create = (t) => {
|
|
|
2566
2566
|
checks: [],
|
|
2567
2567
|
typeName: v.ZodBigInt,
|
|
2568
2568
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
|
|
2569
|
-
...
|
|
2569
|
+
...x(t)
|
|
2570
2570
|
});
|
|
2571
2571
|
};
|
|
2572
|
-
class
|
|
2572
|
+
class fe extends k {
|
|
2573
2573
|
_parse(e) {
|
|
2574
2574
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
|
|
2575
2575
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2582,10 +2582,10 @@ class pe extends k {
|
|
|
2582
2582
|
return I(e.data);
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
|
-
|
|
2585
|
+
fe.create = (t) => new fe({
|
|
2586
2586
|
typeName: v.ZodBoolean,
|
|
2587
2587
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2588
|
-
...
|
|
2588
|
+
...x(t)
|
|
2589
2589
|
});
|
|
2590
2590
|
class Q extends k {
|
|
2591
2591
|
_parse(e) {
|
|
@@ -2663,7 +2663,7 @@ Q.create = (t) => new Q({
|
|
|
2663
2663
|
checks: [],
|
|
2664
2664
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2665
2665
|
typeName: v.ZodDate,
|
|
2666
|
-
...
|
|
2666
|
+
...x(t)
|
|
2667
2667
|
});
|
|
2668
2668
|
class Be extends k {
|
|
2669
2669
|
_parse(e) {
|
|
@@ -2680,9 +2680,9 @@ class Be extends k {
|
|
|
2680
2680
|
}
|
|
2681
2681
|
Be.create = (t) => new Be({
|
|
2682
2682
|
typeName: v.ZodSymbol,
|
|
2683
|
-
...
|
|
2683
|
+
...x(t)
|
|
2684
2684
|
});
|
|
2685
|
-
class
|
|
2685
|
+
class he extends k {
|
|
2686
2686
|
_parse(e) {
|
|
2687
2687
|
if (this._getType(e) !== p.undefined) {
|
|
2688
2688
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2695,11 +2695,11 @@ class me extends k {
|
|
|
2695
2695
|
return I(e.data);
|
|
2696
2696
|
}
|
|
2697
2697
|
}
|
|
2698
|
-
|
|
2698
|
+
he.create = (t) => new he({
|
|
2699
2699
|
typeName: v.ZodUndefined,
|
|
2700
|
-
...
|
|
2700
|
+
...x(t)
|
|
2701
2701
|
});
|
|
2702
|
-
class
|
|
2702
|
+
class pe extends k {
|
|
2703
2703
|
_parse(e) {
|
|
2704
2704
|
if (this._getType(e) !== p.null) {
|
|
2705
2705
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2712,9 +2712,9 @@ class ye extends k {
|
|
|
2712
2712
|
return I(e.data);
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
|
|
2715
|
+
pe.create = (t) => new pe({
|
|
2716
2716
|
typeName: v.ZodNull,
|
|
2717
|
-
...
|
|
2717
|
+
...x(t)
|
|
2718
2718
|
});
|
|
2719
2719
|
class ie extends k {
|
|
2720
2720
|
constructor() {
|
|
@@ -2726,7 +2726,7 @@ class ie extends k {
|
|
|
2726
2726
|
}
|
|
2727
2727
|
ie.create = (t) => new ie({
|
|
2728
2728
|
typeName: v.ZodAny,
|
|
2729
|
-
...
|
|
2729
|
+
...x(t)
|
|
2730
2730
|
});
|
|
2731
2731
|
class Y extends k {
|
|
2732
2732
|
constructor() {
|
|
@@ -2738,7 +2738,7 @@ class Y extends k {
|
|
|
2738
2738
|
}
|
|
2739
2739
|
Y.create = (t) => new Y({
|
|
2740
2740
|
typeName: v.ZodUnknown,
|
|
2741
|
-
...
|
|
2741
|
+
...x(t)
|
|
2742
2742
|
});
|
|
2743
2743
|
class J extends k {
|
|
2744
2744
|
_parse(e) {
|
|
@@ -2752,7 +2752,7 @@ class J extends k {
|
|
|
2752
2752
|
}
|
|
2753
2753
|
J.create = (t) => new J({
|
|
2754
2754
|
typeName: v.ZodNever,
|
|
2755
|
-
...
|
|
2755
|
+
...x(t)
|
|
2756
2756
|
});
|
|
2757
2757
|
class Me extends k {
|
|
2758
2758
|
_parse(e) {
|
|
@@ -2769,7 +2769,7 @@ class Me extends k {
|
|
|
2769
2769
|
}
|
|
2770
2770
|
Me.create = (t) => new Me({
|
|
2771
2771
|
typeName: v.ZodVoid,
|
|
2772
|
-
...
|
|
2772
|
+
...x(t)
|
|
2773
2773
|
});
|
|
2774
2774
|
class P extends k {
|
|
2775
2775
|
_parse(e) {
|
|
@@ -2842,7 +2842,7 @@ P.create = (t, e) => new P({
|
|
|
2842
2842
|
maxLength: null,
|
|
2843
2843
|
exactLength: null,
|
|
2844
2844
|
typeName: v.ZodArray,
|
|
2845
|
-
...
|
|
2845
|
+
...x(e)
|
|
2846
2846
|
});
|
|
2847
2847
|
function ne(t) {
|
|
2848
2848
|
if (t instanceof N) {
|
|
@@ -3125,7 +3125,7 @@ class N extends k {
|
|
|
3125
3125
|
});
|
|
3126
3126
|
}
|
|
3127
3127
|
keyof() {
|
|
3128
|
-
return
|
|
3128
|
+
return ns(E.objectKeys(this.shape));
|
|
3129
3129
|
}
|
|
3130
3130
|
}
|
|
3131
3131
|
N.create = (t, e) => new N({
|
|
@@ -3133,23 +3133,23 @@ N.create = (t, e) => new N({
|
|
|
3133
3133
|
unknownKeys: "strip",
|
|
3134
3134
|
catchall: J.create(),
|
|
3135
3135
|
typeName: v.ZodObject,
|
|
3136
|
-
...
|
|
3136
|
+
...x(e)
|
|
3137
3137
|
});
|
|
3138
3138
|
N.strictCreate = (t, e) => new N({
|
|
3139
3139
|
shape: () => t,
|
|
3140
3140
|
unknownKeys: "strict",
|
|
3141
3141
|
catchall: J.create(),
|
|
3142
3142
|
typeName: v.ZodObject,
|
|
3143
|
-
...
|
|
3143
|
+
...x(e)
|
|
3144
3144
|
});
|
|
3145
3145
|
N.lazycreate = (t, e) => new N({
|
|
3146
3146
|
shape: t,
|
|
3147
3147
|
unknownKeys: "strip",
|
|
3148
3148
|
catchall: J.create(),
|
|
3149
3149
|
typeName: v.ZodObject,
|
|
3150
|
-
...
|
|
3150
|
+
...x(e)
|
|
3151
3151
|
});
|
|
3152
|
-
class
|
|
3152
|
+
class me extends k {
|
|
3153
3153
|
_parse(e) {
|
|
3154
3154
|
const { ctx: s } = this._processInputParams(e), n = this._def.options;
|
|
3155
3155
|
function r(a) {
|
|
@@ -3159,7 +3159,7 @@ class ge extends k {
|
|
|
3159
3159
|
for (const o of a)
|
|
3160
3160
|
if (o.result.status === "dirty")
|
|
3161
3161
|
return s.common.issues.push(...o.ctx.common.issues), o.result;
|
|
3162
|
-
const i = a.map((o) => new
|
|
3162
|
+
const i = a.map((o) => new D(o.ctx.common.issues));
|
|
3163
3163
|
return m(s, {
|
|
3164
3164
|
code: h.invalid_union,
|
|
3165
3165
|
unionErrors: i
|
|
@@ -3206,7 +3206,7 @@ class ge extends k {
|
|
|
3206
3206
|
}
|
|
3207
3207
|
if (a)
|
|
3208
3208
|
return s.common.issues.push(...a.ctx.common.issues), a.result;
|
|
3209
|
-
const o = i.map((u) => new
|
|
3209
|
+
const o = i.map((u) => new D(u));
|
|
3210
3210
|
return m(s, {
|
|
3211
3211
|
code: h.invalid_union,
|
|
3212
3212
|
unionErrors: o
|
|
@@ -3217,12 +3217,12 @@ class ge extends k {
|
|
|
3217
3217
|
return this._def.options;
|
|
3218
3218
|
}
|
|
3219
3219
|
}
|
|
3220
|
-
|
|
3220
|
+
me.create = (t, e) => new me({
|
|
3221
3221
|
options: t,
|
|
3222
3222
|
typeName: v.ZodUnion,
|
|
3223
|
-
...
|
|
3223
|
+
...x(e)
|
|
3224
3224
|
});
|
|
3225
|
-
const Ie = (t) => t instanceof
|
|
3225
|
+
const Ie = (t) => t instanceof ve ? Ie(t.schema) : t instanceof B ? Ie(t.innerType()) : t instanceof _e ? [t.value] : t instanceof X ? t.options : t instanceof be ? Object.keys(t.enum) : t instanceof we ? Ie(t._def.innerType) : t instanceof he ? [void 0] : t instanceof pe ? [null] : null;
|
|
3226
3226
|
class qe extends k {
|
|
3227
3227
|
_parse(e) {
|
|
3228
3228
|
const { ctx: s } = this._processInputParams(e);
|
|
@@ -3281,18 +3281,18 @@ class qe extends k {
|
|
|
3281
3281
|
discriminator: e,
|
|
3282
3282
|
options: s,
|
|
3283
3283
|
optionsMap: r,
|
|
3284
|
-
...
|
|
3284
|
+
...x(n)
|
|
3285
3285
|
});
|
|
3286
3286
|
}
|
|
3287
3287
|
}
|
|
3288
|
-
function
|
|
3288
|
+
function lt(t, e) {
|
|
3289
3289
|
const s = K(t), n = K(e);
|
|
3290
3290
|
if (t === e)
|
|
3291
3291
|
return { valid: !0, data: t };
|
|
3292
3292
|
if (s === p.object && n === p.object) {
|
|
3293
3293
|
const r = E.objectKeys(e), a = E.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = { ...t, ...e };
|
|
3294
3294
|
for (const o of a) {
|
|
3295
|
-
const u =
|
|
3295
|
+
const u = lt(t[o], e[o]);
|
|
3296
3296
|
if (!u.valid)
|
|
3297
3297
|
return { valid: !1 };
|
|
3298
3298
|
i[o] = u.data;
|
|
@@ -3303,7 +3303,7 @@ function ct(t, e) {
|
|
|
3303
3303
|
return { valid: !1 };
|
|
3304
3304
|
const r = [];
|
|
3305
3305
|
for (let a = 0; a < t.length; a++) {
|
|
3306
|
-
const i = t[a], o = e[a], u =
|
|
3306
|
+
const i = t[a], o = e[a], u = lt(i, o);
|
|
3307
3307
|
if (!u.valid)
|
|
3308
3308
|
return { valid: !1 };
|
|
3309
3309
|
r.push(u.data);
|
|
@@ -3312,13 +3312,13 @@ function ct(t, e) {
|
|
|
3312
3312
|
} else
|
|
3313
3313
|
return s === p.date && n === p.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
3314
3314
|
}
|
|
3315
|
-
class
|
|
3315
|
+
class ye extends k {
|
|
3316
3316
|
_parse(e) {
|
|
3317
3317
|
const { status: s, ctx: n } = this._processInputParams(e), r = (a, i) => {
|
|
3318
|
-
if (
|
|
3318
|
+
if (it(a) || it(i))
|
|
3319
3319
|
return b;
|
|
3320
|
-
const o =
|
|
3321
|
-
return o.valid ? ((
|
|
3320
|
+
const o = lt(a.value, i.value);
|
|
3321
|
+
return o.valid ? ((ot(a) || ot(i)) && s.dirty(), { status: s.value, value: o.data }) : (m(n, {
|
|
3322
3322
|
code: h.invalid_intersection_types
|
|
3323
3323
|
}), b);
|
|
3324
3324
|
};
|
|
@@ -3344,11 +3344,11 @@ class ve extends k {
|
|
|
3344
3344
|
}));
|
|
3345
3345
|
}
|
|
3346
3346
|
}
|
|
3347
|
-
|
|
3347
|
+
ye.create = (t, e, s) => new ye({
|
|
3348
3348
|
left: t,
|
|
3349
3349
|
right: e,
|
|
3350
3350
|
typeName: v.ZodIntersection,
|
|
3351
|
-
...
|
|
3351
|
+
...x(s)
|
|
3352
3352
|
});
|
|
3353
3353
|
class z extends k {
|
|
3354
3354
|
_parse(e) {
|
|
@@ -3397,10 +3397,10 @@ z.create = (t, e) => {
|
|
|
3397
3397
|
items: t,
|
|
3398
3398
|
typeName: v.ZodTuple,
|
|
3399
3399
|
rest: null,
|
|
3400
|
-
...
|
|
3400
|
+
...x(e)
|
|
3401
3401
|
});
|
|
3402
3402
|
};
|
|
3403
|
-
class
|
|
3403
|
+
class ge extends k {
|
|
3404
3404
|
get keySchema() {
|
|
3405
3405
|
return this._def.keyType;
|
|
3406
3406
|
}
|
|
@@ -3427,16 +3427,16 @@ class _e extends k {
|
|
|
3427
3427
|
return this._def.valueType;
|
|
3428
3428
|
}
|
|
3429
3429
|
static create(e, s, n) {
|
|
3430
|
-
return s instanceof k ? new
|
|
3430
|
+
return s instanceof k ? new ge({
|
|
3431
3431
|
keyType: e,
|
|
3432
3432
|
valueType: s,
|
|
3433
3433
|
typeName: v.ZodRecord,
|
|
3434
|
-
...
|
|
3435
|
-
}) : new
|
|
3436
|
-
keyType:
|
|
3434
|
+
...x(n)
|
|
3435
|
+
}) : new ge({
|
|
3436
|
+
keyType: L.create(),
|
|
3437
3437
|
valueType: e,
|
|
3438
3438
|
typeName: v.ZodRecord,
|
|
3439
|
-
...
|
|
3439
|
+
...x(s)
|
|
3440
3440
|
});
|
|
3441
3441
|
}
|
|
3442
3442
|
}
|
|
@@ -3480,7 +3480,7 @@ Ue.create = (t, e, s) => new Ue({
|
|
|
3480
3480
|
valueType: e,
|
|
3481
3481
|
keyType: t,
|
|
3482
3482
|
typeName: v.ZodMap,
|
|
3483
|
-
...
|
|
3483
|
+
...x(s)
|
|
3484
3484
|
});
|
|
3485
3485
|
class ee extends k {
|
|
3486
3486
|
_parse(e) {
|
|
@@ -3544,7 +3544,7 @@ ee.create = (t, e) => new ee({
|
|
|
3544
3544
|
minSize: null,
|
|
3545
3545
|
maxSize: null,
|
|
3546
3546
|
typeName: v.ZodSet,
|
|
3547
|
-
...
|
|
3547
|
+
...x(e)
|
|
3548
3548
|
});
|
|
3549
3549
|
class re extends k {
|
|
3550
3550
|
constructor() {
|
|
@@ -3559,14 +3559,14 @@ class re extends k {
|
|
|
3559
3559
|
received: s.parsedType
|
|
3560
3560
|
}), b;
|
|
3561
3561
|
function n(o, u) {
|
|
3562
|
-
return
|
|
3562
|
+
return Le({
|
|
3563
3563
|
data: o,
|
|
3564
3564
|
path: s.path,
|
|
3565
3565
|
errorMaps: [
|
|
3566
3566
|
s.common.contextualErrorMap,
|
|
3567
3567
|
s.schemaErrorMap,
|
|
3568
3568
|
Ze(),
|
|
3569
|
-
|
|
3569
|
+
de
|
|
3570
3570
|
].filter((l) => !!l),
|
|
3571
3571
|
issueData: {
|
|
3572
3572
|
code: h.invalid_arguments,
|
|
@@ -3575,14 +3575,14 @@ class re extends k {
|
|
|
3575
3575
|
});
|
|
3576
3576
|
}
|
|
3577
3577
|
function r(o, u) {
|
|
3578
|
-
return
|
|
3578
|
+
return Le({
|
|
3579
3579
|
data: o,
|
|
3580
3580
|
path: s.path,
|
|
3581
3581
|
errorMaps: [
|
|
3582
3582
|
s.common.contextualErrorMap,
|
|
3583
3583
|
s.schemaErrorMap,
|
|
3584
3584
|
Ze(),
|
|
3585
|
-
|
|
3585
|
+
de
|
|
3586
3586
|
].filter((l) => !!l),
|
|
3587
3587
|
issueData: {
|
|
3588
3588
|
code: h.invalid_return_type,
|
|
@@ -3592,7 +3592,7 @@ class re extends k {
|
|
|
3592
3592
|
}
|
|
3593
3593
|
const a = { errorMap: s.common.contextualErrorMap }, i = s.data;
|
|
3594
3594
|
return this._def.returns instanceof oe ? I(async (...o) => {
|
|
3595
|
-
const u = new
|
|
3595
|
+
const u = new D([]), l = await this._def.args.parseAsync(o, a).catch((C) => {
|
|
3596
3596
|
throw u.addIssue(n(o, C)), u;
|
|
3597
3597
|
}), f = await i(...l);
|
|
3598
3598
|
return await this._def.returns._def.type.parseAsync(f, a).catch((C) => {
|
|
@@ -3601,10 +3601,10 @@ class re extends k {
|
|
|
3601
3601
|
}) : I((...o) => {
|
|
3602
3602
|
const u = this._def.args.safeParse(o, a);
|
|
3603
3603
|
if (!u.success)
|
|
3604
|
-
throw new
|
|
3604
|
+
throw new D([n(o, u.error)]);
|
|
3605
3605
|
const l = i(...u.data), f = this._def.returns.safeParse(l, a);
|
|
3606
3606
|
if (!f.success)
|
|
3607
|
-
throw new
|
|
3607
|
+
throw new D([r(l, f.error)]);
|
|
3608
3608
|
return f.data;
|
|
3609
3609
|
});
|
|
3610
3610
|
}
|
|
@@ -3637,11 +3637,11 @@ class re extends k {
|
|
|
3637
3637
|
args: e || z.create([]).rest(Y.create()),
|
|
3638
3638
|
returns: s || Y.create(),
|
|
3639
3639
|
typeName: v.ZodFunction,
|
|
3640
|
-
...
|
|
3640
|
+
...x(n)
|
|
3641
3641
|
});
|
|
3642
3642
|
}
|
|
3643
3643
|
}
|
|
3644
|
-
class
|
|
3644
|
+
class ve extends k {
|
|
3645
3645
|
get schema() {
|
|
3646
3646
|
return this._def.getter();
|
|
3647
3647
|
}
|
|
@@ -3650,12 +3650,12 @@ class be extends k {
|
|
|
3650
3650
|
return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
|
|
3651
3651
|
}
|
|
3652
3652
|
}
|
|
3653
|
-
|
|
3653
|
+
ve.create = (t, e) => new ve({
|
|
3654
3654
|
getter: t,
|
|
3655
3655
|
typeName: v.ZodLazy,
|
|
3656
|
-
...
|
|
3656
|
+
...x(e)
|
|
3657
3657
|
});
|
|
3658
|
-
class
|
|
3658
|
+
class _e extends k {
|
|
3659
3659
|
_parse(e) {
|
|
3660
3660
|
if (e.data !== this._def.value) {
|
|
3661
3661
|
const s = this._getOrReturnCtx(e);
|
|
@@ -3671,16 +3671,16 @@ class we extends k {
|
|
|
3671
3671
|
return this._def.value;
|
|
3672
3672
|
}
|
|
3673
3673
|
}
|
|
3674
|
-
|
|
3674
|
+
_e.create = (t, e) => new _e({
|
|
3675
3675
|
value: t,
|
|
3676
3676
|
typeName: v.ZodLiteral,
|
|
3677
|
-
...
|
|
3677
|
+
...x(e)
|
|
3678
3678
|
});
|
|
3679
|
-
function
|
|
3679
|
+
function ns(t, e) {
|
|
3680
3680
|
return new X({
|
|
3681
3681
|
values: t,
|
|
3682
3682
|
typeName: v.ZodEnum,
|
|
3683
|
-
...
|
|
3683
|
+
...x(e)
|
|
3684
3684
|
});
|
|
3685
3685
|
}
|
|
3686
3686
|
class X extends k {
|
|
@@ -3731,8 +3731,8 @@ class X extends k {
|
|
|
3731
3731
|
return X.create(this.options.filter((s) => !e.includes(s)));
|
|
3732
3732
|
}
|
|
3733
3733
|
}
|
|
3734
|
-
X.create =
|
|
3735
|
-
class
|
|
3734
|
+
X.create = ns;
|
|
3735
|
+
class be extends k {
|
|
3736
3736
|
_parse(e) {
|
|
3737
3737
|
const s = E.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
3738
3738
|
if (n.parsedType !== p.string && n.parsedType !== p.number) {
|
|
@@ -3757,10 +3757,10 @@ class xe extends k {
|
|
|
3757
3757
|
return this._def.values;
|
|
3758
3758
|
}
|
|
3759
3759
|
}
|
|
3760
|
-
|
|
3760
|
+
be.create = (t, e) => new be({
|
|
3761
3761
|
values: t,
|
|
3762
3762
|
typeName: v.ZodNativeEnum,
|
|
3763
|
-
...
|
|
3763
|
+
...x(e)
|
|
3764
3764
|
});
|
|
3765
3765
|
class oe extends k {
|
|
3766
3766
|
unwrap() {
|
|
@@ -3784,7 +3784,7 @@ class oe extends k {
|
|
|
3784
3784
|
oe.create = (t, e) => new oe({
|
|
3785
3785
|
type: t,
|
|
3786
3786
|
typeName: v.ZodPromise,
|
|
3787
|
-
...
|
|
3787
|
+
...x(e)
|
|
3788
3788
|
});
|
|
3789
3789
|
class B extends k {
|
|
3790
3790
|
innerType() {
|
|
@@ -3841,14 +3841,14 @@ class B extends k {
|
|
|
3841
3841
|
path: n.path,
|
|
3842
3842
|
parent: n
|
|
3843
3843
|
});
|
|
3844
|
-
if (!
|
|
3844
|
+
if (!De(i))
|
|
3845
3845
|
return i;
|
|
3846
3846
|
const o = r.transform(i.value, a);
|
|
3847
3847
|
if (o instanceof Promise)
|
|
3848
3848
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3849
3849
|
return { status: s.value, value: o };
|
|
3850
3850
|
} else
|
|
3851
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
3851
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => De(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: s.value, value: o })) : i);
|
|
3852
3852
|
E.assertNever(r);
|
|
3853
3853
|
}
|
|
3854
3854
|
}
|
|
@@ -3856,13 +3856,13 @@ B.create = (t, e, s) => new B({
|
|
|
3856
3856
|
schema: t,
|
|
3857
3857
|
typeName: v.ZodEffects,
|
|
3858
3858
|
effect: e,
|
|
3859
|
-
...
|
|
3859
|
+
...x(s)
|
|
3860
3860
|
});
|
|
3861
3861
|
B.createWithPreprocess = (t, e, s) => new B({
|
|
3862
3862
|
schema: e,
|
|
3863
3863
|
effect: { type: "preprocess", transform: t },
|
|
3864
3864
|
typeName: v.ZodEffects,
|
|
3865
|
-
...
|
|
3865
|
+
...x(s)
|
|
3866
3866
|
});
|
|
3867
3867
|
class H extends k {
|
|
3868
3868
|
_parse(e) {
|
|
@@ -3875,7 +3875,7 @@ class H extends k {
|
|
|
3875
3875
|
H.create = (t, e) => new H({
|
|
3876
3876
|
innerType: t,
|
|
3877
3877
|
typeName: v.ZodOptional,
|
|
3878
|
-
...
|
|
3878
|
+
...x(e)
|
|
3879
3879
|
});
|
|
3880
3880
|
class te extends k {
|
|
3881
3881
|
_parse(e) {
|
|
@@ -3888,9 +3888,9 @@ class te extends k {
|
|
|
3888
3888
|
te.create = (t, e) => new te({
|
|
3889
3889
|
innerType: t,
|
|
3890
3890
|
typeName: v.ZodNullable,
|
|
3891
|
-
...
|
|
3891
|
+
...x(e)
|
|
3892
3892
|
});
|
|
3893
|
-
class
|
|
3893
|
+
class we extends k {
|
|
3894
3894
|
_parse(e) {
|
|
3895
3895
|
const { ctx: s } = this._processInputParams(e);
|
|
3896
3896
|
let n = s.data;
|
|
@@ -3904,11 +3904,11 @@ class ke extends k {
|
|
|
3904
3904
|
return this._def.innerType;
|
|
3905
3905
|
}
|
|
3906
3906
|
}
|
|
3907
|
-
|
|
3907
|
+
we.create = (t, e) => new we({
|
|
3908
3908
|
innerType: t,
|
|
3909
3909
|
typeName: v.ZodDefault,
|
|
3910
3910
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
3911
|
-
...
|
|
3911
|
+
...x(e)
|
|
3912
3912
|
});
|
|
3913
3913
|
class ze extends k {
|
|
3914
3914
|
_parse(e) {
|
|
@@ -3929,7 +3929,7 @@ class ze extends k {
|
|
|
3929
3929
|
status: "valid",
|
|
3930
3930
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
3931
3931
|
get error() {
|
|
3932
|
-
return new
|
|
3932
|
+
return new D(n.common.issues);
|
|
3933
3933
|
},
|
|
3934
3934
|
input: n.data
|
|
3935
3935
|
})
|
|
@@ -3937,7 +3937,7 @@ class ze extends k {
|
|
|
3937
3937
|
status: "valid",
|
|
3938
3938
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
3939
3939
|
get error() {
|
|
3940
|
-
return new
|
|
3940
|
+
return new D(n.common.issues);
|
|
3941
3941
|
},
|
|
3942
3942
|
input: n.data
|
|
3943
3943
|
})
|
|
@@ -3951,7 +3951,7 @@ ze.create = (t, e) => new ze({
|
|
|
3951
3951
|
innerType: t,
|
|
3952
3952
|
typeName: v.ZodCatch,
|
|
3953
3953
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
3954
|
-
...
|
|
3954
|
+
...x(e)
|
|
3955
3955
|
});
|
|
3956
3956
|
class $e extends k {
|
|
3957
3957
|
_parse(e) {
|
|
@@ -3968,10 +3968,10 @@ class $e extends k {
|
|
|
3968
3968
|
}
|
|
3969
3969
|
$e.create = (t) => new $e({
|
|
3970
3970
|
typeName: v.ZodNaN,
|
|
3971
|
-
...
|
|
3971
|
+
...x(t)
|
|
3972
3972
|
});
|
|
3973
|
-
const
|
|
3974
|
-
class
|
|
3973
|
+
const ir = Symbol("zod_brand");
|
|
3974
|
+
class rs extends k {
|
|
3975
3975
|
_parse(e) {
|
|
3976
3976
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
3977
3977
|
return this._def.type._parse({
|
|
@@ -3994,7 +3994,7 @@ class Ee extends k {
|
|
|
3994
3994
|
path: n.path,
|
|
3995
3995
|
parent: n
|
|
3996
3996
|
});
|
|
3997
|
-
return a.status === "aborted" ? b : a.status === "dirty" ? (s.dirty(),
|
|
3997
|
+
return a.status === "aborted" ? b : a.status === "dirty" ? (s.dirty(), ss(a.value)) : this._def.out._parseAsync({
|
|
3998
3998
|
data: a.value,
|
|
3999
3999
|
path: n.path,
|
|
4000
4000
|
parent: n
|
|
@@ -4024,159 +4024,160 @@ class Ee extends k {
|
|
|
4024
4024
|
});
|
|
4025
4025
|
}
|
|
4026
4026
|
}
|
|
4027
|
-
const
|
|
4027
|
+
const as = (t, e = {}, s) => t ? ie.create().superRefine((n, r) => {
|
|
4028
4028
|
var a, i;
|
|
4029
4029
|
if (!t(n)) {
|
|
4030
4030
|
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
4031
|
r.addIssue({ code: "custom", ...l, fatal: u });
|
|
4032
4032
|
}
|
|
4033
|
-
}) : ie.create(),
|
|
4033
|
+
}) : ie.create(), or = {
|
|
4034
4034
|
object: N.lazycreate
|
|
4035
4035
|
};
|
|
4036
4036
|
var v;
|
|
4037
4037
|
(function(t) {
|
|
4038
4038
|
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
4039
|
})(v || (v = {}));
|
|
4040
|
-
const
|
|
4040
|
+
const lr = (t, e = {
|
|
4041
4041
|
message: `Input not instance of ${t.name}`
|
|
4042
|
-
}) =>
|
|
4043
|
-
string: (t) =>
|
|
4042
|
+
}) => as((s) => s instanceof t, e), is = L.create, os = q.create, cr = $e.create, ur = G.create, ls = fe.create, dr = Q.create, fr = Be.create, hr = he.create, pr = pe.create, mr = ie.create, yr = Y.create, gr = J.create, vr = Me.create, _r = P.create, br = N.create, wr = N.strictCreate, xr = me.create, kr = qe.create, Sr = ye.create, Tr = z.create, Er = ge.create, Or = Ue.create, Nr = ee.create, Cr = re.create, Ar = ve.create, Rr = _e.create, Ir = X.create, jr = be.create, Zr = oe.create, Nt = B.create, Lr = H.create, Dr = te.create, Pr = B.createWithPreprocess, Br = Ee.create, Mr = () => is().optional(), Ur = () => os().optional(), zr = () => ls().optional(), $r = {
|
|
4043
|
+
string: (t) => L.create({ ...t, coerce: !0 }),
|
|
4044
4044
|
number: (t) => q.create({ ...t, coerce: !0 }),
|
|
4045
|
-
boolean: (t) =>
|
|
4045
|
+
boolean: (t) => fe.create({
|
|
4046
4046
|
...t,
|
|
4047
4047
|
coerce: !0
|
|
4048
4048
|
}),
|
|
4049
4049
|
bigint: (t) => G.create({ ...t, coerce: !0 }),
|
|
4050
4050
|
date: (t) => Q.create({ ...t, coerce: !0 })
|
|
4051
|
-
},
|
|
4051
|
+
}, Vr = b;
|
|
4052
4052
|
var d = /* @__PURE__ */ Object.freeze({
|
|
4053
4053
|
__proto__: null,
|
|
4054
|
-
defaultErrorMap:
|
|
4055
|
-
setErrorMap:
|
|
4054
|
+
defaultErrorMap: de,
|
|
4055
|
+
setErrorMap: Wn,
|
|
4056
4056
|
getErrorMap: Ze,
|
|
4057
|
-
makeIssue:
|
|
4058
|
-
EMPTY_PATH:
|
|
4057
|
+
makeIssue: Le,
|
|
4058
|
+
EMPTY_PATH: Kn,
|
|
4059
4059
|
addIssueToContext: m,
|
|
4060
4060
|
ParseStatus: R,
|
|
4061
4061
|
INVALID: b,
|
|
4062
|
-
DIRTY:
|
|
4062
|
+
DIRTY: ss,
|
|
4063
4063
|
OK: I,
|
|
4064
|
-
isAborted:
|
|
4065
|
-
isDirty:
|
|
4066
|
-
isValid:
|
|
4064
|
+
isAborted: it,
|
|
4065
|
+
isDirty: ot,
|
|
4066
|
+
isValid: De,
|
|
4067
4067
|
isAsync: Pe,
|
|
4068
4068
|
get util() {
|
|
4069
4069
|
return E;
|
|
4070
4070
|
},
|
|
4071
4071
|
get objectUtil() {
|
|
4072
|
-
return
|
|
4072
|
+
return at;
|
|
4073
4073
|
},
|
|
4074
4074
|
ZodParsedType: p,
|
|
4075
4075
|
getParsedType: K,
|
|
4076
4076
|
ZodType: k,
|
|
4077
|
-
ZodString:
|
|
4077
|
+
ZodString: L,
|
|
4078
4078
|
ZodNumber: q,
|
|
4079
4079
|
ZodBigInt: G,
|
|
4080
|
-
ZodBoolean:
|
|
4080
|
+
ZodBoolean: fe,
|
|
4081
4081
|
ZodDate: Q,
|
|
4082
4082
|
ZodSymbol: Be,
|
|
4083
|
-
ZodUndefined:
|
|
4084
|
-
ZodNull:
|
|
4083
|
+
ZodUndefined: he,
|
|
4084
|
+
ZodNull: pe,
|
|
4085
4085
|
ZodAny: ie,
|
|
4086
4086
|
ZodUnknown: Y,
|
|
4087
4087
|
ZodNever: J,
|
|
4088
4088
|
ZodVoid: Me,
|
|
4089
4089
|
ZodArray: P,
|
|
4090
4090
|
ZodObject: N,
|
|
4091
|
-
ZodUnion:
|
|
4091
|
+
ZodUnion: me,
|
|
4092
4092
|
ZodDiscriminatedUnion: qe,
|
|
4093
|
-
ZodIntersection:
|
|
4093
|
+
ZodIntersection: ye,
|
|
4094
4094
|
ZodTuple: z,
|
|
4095
|
-
ZodRecord:
|
|
4095
|
+
ZodRecord: ge,
|
|
4096
4096
|
ZodMap: Ue,
|
|
4097
4097
|
ZodSet: ee,
|
|
4098
4098
|
ZodFunction: re,
|
|
4099
|
-
ZodLazy:
|
|
4100
|
-
ZodLiteral:
|
|
4099
|
+
ZodLazy: ve,
|
|
4100
|
+
ZodLiteral: _e,
|
|
4101
4101
|
ZodEnum: X,
|
|
4102
|
-
ZodNativeEnum:
|
|
4102
|
+
ZodNativeEnum: be,
|
|
4103
4103
|
ZodPromise: oe,
|
|
4104
4104
|
ZodEffects: B,
|
|
4105
4105
|
ZodTransformer: B,
|
|
4106
4106
|
ZodOptional: H,
|
|
4107
4107
|
ZodNullable: te,
|
|
4108
|
-
ZodDefault:
|
|
4108
|
+
ZodDefault: we,
|
|
4109
4109
|
ZodCatch: ze,
|
|
4110
4110
|
ZodNaN: $e,
|
|
4111
|
-
BRAND:
|
|
4112
|
-
ZodBranded:
|
|
4111
|
+
BRAND: ir,
|
|
4112
|
+
ZodBranded: rs,
|
|
4113
4113
|
ZodPipeline: Ee,
|
|
4114
|
-
custom:
|
|
4114
|
+
custom: as,
|
|
4115
4115
|
Schema: k,
|
|
4116
4116
|
ZodSchema: k,
|
|
4117
|
-
late:
|
|
4117
|
+
late: or,
|
|
4118
4118
|
get ZodFirstPartyTypeKind() {
|
|
4119
4119
|
return v;
|
|
4120
4120
|
},
|
|
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:
|
|
4121
|
+
coerce: $r,
|
|
4122
|
+
any: mr,
|
|
4123
|
+
array: _r,
|
|
4124
|
+
bigint: ur,
|
|
4125
|
+
boolean: ls,
|
|
4126
|
+
date: dr,
|
|
4127
|
+
discriminatedUnion: kr,
|
|
4128
|
+
effect: Nt,
|
|
4129
|
+
enum: Ir,
|
|
4130
|
+
function: Cr,
|
|
4131
|
+
instanceof: lr,
|
|
4132
|
+
intersection: Sr,
|
|
4133
|
+
lazy: Ar,
|
|
4134
|
+
literal: Rr,
|
|
4135
|
+
map: Or,
|
|
4136
|
+
nan: cr,
|
|
4137
|
+
nativeEnum: jr,
|
|
4138
|
+
never: gr,
|
|
4139
|
+
null: pr,
|
|
4140
|
+
nullable: Dr,
|
|
4141
|
+
number: os,
|
|
4142
|
+
object: br,
|
|
4143
|
+
oboolean: zr,
|
|
4144
|
+
onumber: Ur,
|
|
4145
|
+
optional: Lr,
|
|
4146
|
+
ostring: Mr,
|
|
4147
|
+
pipeline: Br,
|
|
4148
|
+
preprocess: Pr,
|
|
4149
|
+
promise: Zr,
|
|
4150
|
+
record: Er,
|
|
4151
|
+
set: Nr,
|
|
4152
|
+
strictObject: wr,
|
|
4153
|
+
string: is,
|
|
4154
|
+
symbol: fr,
|
|
4155
|
+
transformer: Nt,
|
|
4156
|
+
tuple: Tr,
|
|
4157
|
+
undefined: hr,
|
|
4158
|
+
union: xr,
|
|
4159
|
+
unknown: yr,
|
|
4160
|
+
void: vr,
|
|
4161
|
+
NEVER: Vr,
|
|
4162
4162
|
ZodIssueCode: h,
|
|
4163
|
-
quotelessJson:
|
|
4164
|
-
ZodError:
|
|
4163
|
+
quotelessJson: Jn,
|
|
4164
|
+
ZodError: D
|
|
4165
4165
|
});
|
|
4166
|
-
class
|
|
4167
|
-
constructor(e) {
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
this
|
|
4166
|
+
class Fr {
|
|
4167
|
+
constructor(e, s) {
|
|
4168
|
+
w(this, "apiKey");
|
|
4169
|
+
w(this, "parentId");
|
|
4170
|
+
w(this, "images");
|
|
4171
|
+
w(this, "length");
|
|
4172
|
+
this.apiKey = s, this.parentId = e, this.images = [], this.length = this.images.length;
|
|
4172
4173
|
}
|
|
4173
4174
|
async add(e) {
|
|
4174
|
-
return this.images.push(e), this.length = this.images.length, await
|
|
4175
|
+
return this.images.push(e), this.length = this.images.length, await Hn(this.apiKey, this.parentId, new Jr(e)), new Promise((s) => {
|
|
4175
4176
|
s(this.length);
|
|
4176
4177
|
});
|
|
4177
4178
|
}
|
|
4178
4179
|
}
|
|
4179
|
-
const
|
|
4180
|
+
const Hr = d.object({
|
|
4180
4181
|
handle: d.string(),
|
|
4181
4182
|
url: d.string(),
|
|
4182
4183
|
width: d.number(),
|
|
@@ -4187,21 +4188,21 @@ const $r = d.object({
|
|
|
4187
4188
|
camera: d.string().optional(),
|
|
4188
4189
|
filename: d.string()
|
|
4189
4190
|
});
|
|
4190
|
-
class
|
|
4191
|
+
class Jr {
|
|
4191
4192
|
constructor(e) {
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4193
|
+
w(this, "handle");
|
|
4194
|
+
w(this, "url");
|
|
4195
|
+
w(this, "width");
|
|
4196
|
+
w(this, "height");
|
|
4197
|
+
w(this, "orientation");
|
|
4198
|
+
w(this, "taken_at");
|
|
4199
|
+
w(this, "camera_make");
|
|
4200
|
+
w(this, "camera");
|
|
4201
|
+
w(this, "filename");
|
|
4201
4202
|
this.handle = e.handle, this.url = e.url, this.width = e.width, this.height = e.height, this.orientation = e.rotation, this.taken_at = e.captureTime, this.camera_make = e.cameraMake, this.camera = e.cameraModel, this.filename = e.filename;
|
|
4202
4203
|
}
|
|
4203
4204
|
}
|
|
4204
|
-
const
|
|
4205
|
+
const Wr = [
|
|
4205
4206
|
"new",
|
|
4206
4207
|
"ingesting",
|
|
4207
4208
|
"submitted",
|
|
@@ -4217,7 +4218,7 @@ const Fr = [
|
|
|
4217
4218
|
"polishing succeeded",
|
|
4218
4219
|
"ready",
|
|
4219
4220
|
"error"
|
|
4220
|
-
],
|
|
4221
|
+
], cs = [
|
|
4221
4222
|
"baby",
|
|
4222
4223
|
"birthday",
|
|
4223
4224
|
"default",
|
|
@@ -4233,7 +4234,7 @@ const Fr = [
|
|
|
4233
4234
|
"travel",
|
|
4234
4235
|
"wedding",
|
|
4235
4236
|
"year-in-review"
|
|
4236
|
-
],
|
|
4237
|
+
], us = {
|
|
4237
4238
|
1005: { slug: "modern-black-sfly" },
|
|
4238
4239
|
1101: { slug: "bon-voyage-sfly" },
|
|
4239
4240
|
1103: { slug: "fun-in-the-sun-sfly" },
|
|
@@ -4394,84 +4395,88 @@ const Fr = [
|
|
|
4394
4395
|
6097: { slug: "boho-wedding-sfly" },
|
|
4395
4396
|
6098: { slug: "black-and-white-rustic-sfly" },
|
|
4396
4397
|
6099: { slug: "bright-color-pop-sfly" }
|
|
4397
|
-
},
|
|
4398
|
-
class
|
|
4398
|
+
}, ds = ["8x8", "10x10", "12x12", "8x11", "11x8", "11x14"], fs = ["sc", "hc", "pl"], hs = ["sp", "sl", "dl"], ps = ["low", "medium", "high"], ms = ["best", "most", "all"], ys = ["none", "few", "lots"], gs = ["none", "few", "lots"];
|
|
4399
|
+
class Kr {
|
|
4399
4400
|
constructor(e) {
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
this.occasion = e.occasion, this.style = e.style, this.book_size = e.book_size, this.cover_type = e.cover_type, this.page_type = e.page_type, this.image_density = e.image_density, this.
|
|
4401
|
+
w(this, "occasion");
|
|
4402
|
+
w(this, "style");
|
|
4403
|
+
w(this, "book_size");
|
|
4404
|
+
w(this, "cover_type");
|
|
4405
|
+
w(this, "page_type");
|
|
4406
|
+
w(this, "image_density");
|
|
4407
|
+
w(this, "image_filtering_level");
|
|
4408
|
+
w(this, "embellishment_level");
|
|
4409
|
+
w(this, "text_sticker_level");
|
|
4410
|
+
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;
|
|
4410
4411
|
}
|
|
4411
4412
|
}
|
|
4412
|
-
const
|
|
4413
|
-
occasion: d.enum(
|
|
4413
|
+
const qr = d.object({
|
|
4414
|
+
occasion: d.enum(cs),
|
|
4414
4415
|
style: d.string(),
|
|
4415
|
-
book_size: d.enum(
|
|
4416
|
-
cover_type: d.enum(
|
|
4417
|
-
page_type: d.enum(
|
|
4418
|
-
image_density: d.enum(
|
|
4419
|
-
|
|
4420
|
-
embellishment_level: d.enum(
|
|
4421
|
-
text_sticker_level: d.enum(
|
|
4422
|
-
}),
|
|
4416
|
+
book_size: d.enum(ds),
|
|
4417
|
+
cover_type: d.enum(fs),
|
|
4418
|
+
page_type: d.enum(hs),
|
|
4419
|
+
image_density: d.enum(ps),
|
|
4420
|
+
image_filtering_level: d.enum(ms),
|
|
4421
|
+
embellishment_level: d.enum(ys),
|
|
4422
|
+
text_sticker_level: d.enum(gs)
|
|
4423
|
+
}), vs = d.object({
|
|
4423
4424
|
id: d.string(),
|
|
4424
|
-
state: d.enum(Fr),
|
|
4425
4425
|
title: d.string(),
|
|
4426
|
-
design_request:
|
|
4426
|
+
design_request: qr,
|
|
4427
|
+
state: d.enum(Wr).optional(),
|
|
4428
|
+
guid: d.string().optional()
|
|
4427
4429
|
});
|
|
4428
|
-
class
|
|
4430
|
+
class yt {
|
|
4429
4431
|
constructor(e) {
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
this
|
|
4432
|
+
w(this, "id");
|
|
4433
|
+
w(this, "title");
|
|
4434
|
+
w(this, "design_request");
|
|
4435
|
+
w(this, "state");
|
|
4436
|
+
w(this, "guid");
|
|
4437
|
+
this.id = e.id, this.title = e.title, this.design_request = new Kr(e.design_request), this.state = e.state, this.guid = e.guid;
|
|
4435
4438
|
}
|
|
4436
4439
|
}
|
|
4437
|
-
function
|
|
4438
|
-
const e =
|
|
4439
|
-
return s.style = e, new
|
|
4440
|
+
function Ct(t) {
|
|
4441
|
+
const e = us[t.style].slug, s = It({ ...t });
|
|
4442
|
+
return s.style = e, new yt({
|
|
4440
4443
|
id: t.parentId,
|
|
4441
|
-
|
|
4444
|
+
guid: t.guid,
|
|
4442
4445
|
title: t.title,
|
|
4443
4446
|
design_request: s
|
|
4444
4447
|
});
|
|
4445
4448
|
}
|
|
4446
|
-
const
|
|
4449
|
+
const et = d.object({
|
|
4447
4450
|
maxPageCount: d.number(),
|
|
4448
4451
|
minPageCount: d.number(),
|
|
4449
4452
|
maxImageCount: d.number(),
|
|
4450
4453
|
avgImageCount: d.number(),
|
|
4451
4454
|
minImageCount: d.number()
|
|
4452
|
-
}),
|
|
4453
|
-
high:
|
|
4454
|
-
medium:
|
|
4455
|
-
low:
|
|
4456
|
-
}),
|
|
4457
|
-
densities:
|
|
4455
|
+
}), Gr = d.object({
|
|
4456
|
+
high: et,
|
|
4457
|
+
medium: et,
|
|
4458
|
+
low: et
|
|
4459
|
+
}), Xr = d.object({
|
|
4460
|
+
densities: Gr
|
|
4458
4461
|
});
|
|
4459
|
-
async function
|
|
4460
|
-
return
|
|
4461
|
-
const
|
|
4462
|
-
|
|
4462
|
+
async function Yr(t, e, s) {
|
|
4463
|
+
return Se(async () => {
|
|
4464
|
+
const n = await Qt(
|
|
4465
|
+
{ url: `${Te}/api/v1/designoptions/booksize/${e}/imagecount/${s}`, apiKey: t }
|
|
4466
|
+
), r = jt(n.data);
|
|
4467
|
+
return Xr.parse(r), r;
|
|
4463
4468
|
});
|
|
4464
4469
|
}
|
|
4465
|
-
const
|
|
4470
|
+
const Qr = d.object({
|
|
4466
4471
|
photoRefId: d.string(),
|
|
4467
4472
|
finalCrop: d.array(d.number())
|
|
4468
|
-
}),
|
|
4473
|
+
}), ea = d.object({
|
|
4469
4474
|
x: d.number(),
|
|
4470
4475
|
y: d.number(),
|
|
4471
4476
|
width: d.number().optional(),
|
|
4472
4477
|
height: d.number().optional(),
|
|
4473
4478
|
rotation: d.number()
|
|
4474
|
-
}),
|
|
4479
|
+
}), ta = d.object({
|
|
4475
4480
|
id: d.string(),
|
|
4476
4481
|
llx: d.number(),
|
|
4477
4482
|
lly: d.number(),
|
|
@@ -4485,13 +4490,13 @@ const Xr = d.object({
|
|
|
4485
4490
|
source: d.string(),
|
|
4486
4491
|
rotation: d.number(),
|
|
4487
4492
|
uploadTime: d.string()
|
|
4488
|
-
}),
|
|
4493
|
+
}), sa = d.object({
|
|
4489
4494
|
key: d.string(),
|
|
4490
4495
|
value: d.union([d.string(), d.number(), d.boolean()]).nullable()
|
|
4491
|
-
}),
|
|
4496
|
+
}), na = d.object({
|
|
4492
4497
|
type: d.string(),
|
|
4493
|
-
imageAssignment:
|
|
4494
|
-
position:
|
|
4498
|
+
imageAssignment: Qr.optional(),
|
|
4499
|
+
position: ea,
|
|
4495
4500
|
seqNum: d.number(),
|
|
4496
4501
|
z: d.number(),
|
|
4497
4502
|
id: d.string().optional(),
|
|
@@ -4502,126 +4507,122 @@ const Xr = d.object({
|
|
|
4502
4507
|
fontSize: d.number().optional(),
|
|
4503
4508
|
fontColor: d.string().optional(),
|
|
4504
4509
|
frame: d.string().optional()
|
|
4505
|
-
}),
|
|
4510
|
+
}), ra = d.object({
|
|
4506
4511
|
url: d.string(),
|
|
4507
4512
|
encryptId: d.string(),
|
|
4508
4513
|
photoRefId: d.string(),
|
|
4509
4514
|
photoId: d.string(),
|
|
4510
|
-
photoMetadata:
|
|
4511
|
-
}), na = d.object({
|
|
4512
|
-
properties: d.array(ea)
|
|
4513
|
-
}), ra = d.object({
|
|
4514
|
-
backgroundId: d.string().nullable(),
|
|
4515
|
-
assets: d.array(ta)
|
|
4515
|
+
photoMetadata: ta
|
|
4516
4516
|
}), aa = d.object({
|
|
4517
|
-
|
|
4518
|
-
type: d.string(),
|
|
4519
|
-
canvas: ra
|
|
4517
|
+
properties: d.array(sa)
|
|
4520
4518
|
}), ia = d.object({
|
|
4521
|
-
|
|
4522
|
-
|
|
4519
|
+
backgroundId: d.string().nullable(),
|
|
4520
|
+
assets: d.array(na)
|
|
4523
4521
|
}), oa = d.object({
|
|
4522
|
+
pageNum: d.number(),
|
|
4523
|
+
type: d.string(),
|
|
4524
|
+
canvas: ia
|
|
4525
|
+
}), la = d.object({
|
|
4526
|
+
pages: d.array(oa),
|
|
4527
|
+
photoStrip: d.array(ra)
|
|
4528
|
+
}), ca = d.object({
|
|
4524
4529
|
title: d.string(),
|
|
4525
4530
|
coverSpecId: d.string(),
|
|
4526
4531
|
styleId: d.number(),
|
|
4527
4532
|
userId: d.string(),
|
|
4528
|
-
magicShopBook:
|
|
4529
|
-
reportingData:
|
|
4533
|
+
magicShopBook: la,
|
|
4534
|
+
reportingData: aa
|
|
4530
4535
|
});
|
|
4531
|
-
async function
|
|
4532
|
-
return
|
|
4533
|
-
const
|
|
4534
|
-
return
|
|
4536
|
+
async function ua(t, e) {
|
|
4537
|
+
return Se(async () => {
|
|
4538
|
+
const s = (await es({ url: `${Te}/api/v1/books`, apiKey: t, payload: e })).data;
|
|
4539
|
+
return vs.safeParse(s), new yt(s);
|
|
4535
4540
|
});
|
|
4536
4541
|
}
|
|
4537
|
-
async function
|
|
4538
|
-
return
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
return vt.safeParse(e), new Ge(e);
|
|
4542
|
-
}
|
|
4543
|
-
);
|
|
4544
|
-
}
|
|
4545
|
-
async function ua(t) {
|
|
4546
|
-
return ce(async () => {
|
|
4547
|
-
const e = (await Un({ url: `${ue}/api/v1/books/${t.id}`, payload: t })).data;
|
|
4548
|
-
return vt.safeParse(e), new Ge(e);
|
|
4542
|
+
async function At(t, e) {
|
|
4543
|
+
return Se(async () => {
|
|
4544
|
+
const s = (await $n({ url: `${Te}/api/v1/books/${e.id}`, apiKey: t, payload: e })).data;
|
|
4545
|
+
return vs.safeParse(s), new yt(s);
|
|
4549
4546
|
});
|
|
4550
4547
|
}
|
|
4551
|
-
async function da(t) {
|
|
4552
|
-
return
|
|
4553
|
-
const
|
|
4554
|
-
return
|
|
4548
|
+
async function da(t, e) {
|
|
4549
|
+
return Se(async () => {
|
|
4550
|
+
const s = (await Qt({ url: `${Te}/api/v1/books/${e}/format/galleon`, apiKey: t })).data;
|
|
4551
|
+
return ca.parse(s), s;
|
|
4555
4552
|
});
|
|
4556
4553
|
}
|
|
4557
4554
|
class fa {
|
|
4558
|
-
constructor(e, s) {
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
this
|
|
4555
|
+
constructor(e, s, n) {
|
|
4556
|
+
w(this, "apiKey");
|
|
4557
|
+
w(this, "parentId");
|
|
4558
|
+
w(this, "title");
|
|
4559
|
+
w(this, "occasion");
|
|
4560
|
+
w(this, "style");
|
|
4561
|
+
w(this, "bookSize");
|
|
4562
|
+
w(this, "coverType");
|
|
4563
|
+
w(this, "pageType");
|
|
4564
|
+
w(this, "imageDensity");
|
|
4565
|
+
w(this, "imageFilteringLevel");
|
|
4566
|
+
w(this, "embellishmentLevel");
|
|
4567
|
+
w(this, "textStickerLevel");
|
|
4568
|
+
w(this, "images");
|
|
4569
|
+
w(this, "guid");
|
|
4570
|
+
this.apiKey = s, this.parentId = e, this.title = (n == null ? void 0 : n.title) || "", this.occasion = (n == null ? void 0 : n.occasion) || cs[0], this.style = (n == null ? void 0 : n.style) || parseInt(Object.keys(us)[0]), this.bookSize = (n == null ? void 0 : n.bookSize) || ds[0], this.coverType = (n == null ? void 0 : n.coverType) || fs[0], this.pageType = (n == null ? void 0 : n.pageType) || hs[0], this.imageDensity = (n == null ? void 0 : n.imageDensity) || ps[0], this.imageFilteringLevel = (n == null ? void 0 : n.imageFilteringLevel) || ms[0], this.embellishmentLevel = (n == null ? void 0 : n.embellishmentLevel) || ys[0], this.textStickerLevel = (n == null ? void 0 : n.textStickerLevel) || gs[0], this.images = new Fr(this.parentId, this.apiKey);
|
|
4572
4571
|
}
|
|
4573
4572
|
async getOptions(e) {
|
|
4574
|
-
return await
|
|
4573
|
+
return await Yr(this.apiKey, this.bookSize, e || this.images.length);
|
|
4575
4574
|
}
|
|
4576
4575
|
async submit(e) {
|
|
4577
|
-
return e && Object.assign(this, e), await
|
|
4576
|
+
return e && Object.assign(this, e), this.getProgress(), await At(this.apiKey, Ct(this)), this;
|
|
4577
|
+
}
|
|
4578
|
+
async setGuid(e) {
|
|
4579
|
+
return this.guid = e, await At(this.apiKey, Ct(this)), this.guid;
|
|
4578
4580
|
}
|
|
4579
4581
|
async getJSON() {
|
|
4580
|
-
return await da(this.parentId);
|
|
4582
|
+
return await da(this.apiKey, this.parentId);
|
|
4581
4583
|
}
|
|
4582
4584
|
async getProgress() {
|
|
4583
|
-
let e = "";
|
|
4584
|
-
const s =
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
window.dispatchEvent(r), ["error", "ready"].includes(n) && clearInterval(s);
|
|
4585
|
+
let e = "new";
|
|
4586
|
+
const s = new WebSocket(`${Vn}/?book_id=${this.parentId}`), n = setTimeout(() => {
|
|
4587
|
+
throw s.close(), new Error("Something went wrong. Please try again.");
|
|
4588
|
+
}, Fn);
|
|
4589
|
+
s.onmessage = (r) => {
|
|
4590
|
+
const a = JSON.parse(r.data);
|
|
4591
|
+
if (e !== a.state) {
|
|
4592
|
+
e = a.state;
|
|
4593
|
+
const i = new CustomEvent("MagicBook.designRequestUpdated", { detail: a });
|
|
4594
|
+
window.dispatchEvent(i), ["error", "ready"].includes(a.state) && (s.close(), clearTimeout(n));
|
|
4594
4595
|
}
|
|
4595
|
-
}
|
|
4596
|
+
};
|
|
4596
4597
|
}
|
|
4597
4598
|
}
|
|
4598
4599
|
class pa {
|
|
4599
4600
|
constructor(e) {
|
|
4600
|
-
|
|
4601
|
+
w(this, "apiKey");
|
|
4601
4602
|
this.apiKey = e;
|
|
4602
4603
|
}
|
|
4603
4604
|
async createDesignRequest(e) {
|
|
4604
|
-
const s = await
|
|
4605
|
-
return new fa(s.id, e);
|
|
4605
|
+
const s = await ua(this.apiKey);
|
|
4606
|
+
return new fa(s.id, this.apiKey, e);
|
|
4606
4607
|
}
|
|
4607
4608
|
}
|
|
4608
4609
|
export {
|
|
4609
4610
|
fa as DesignRequest,
|
|
4610
|
-
|
|
4611
|
-
|
|
4611
|
+
Jr as ImageServer,
|
|
4612
|
+
Fr as Images,
|
|
4612
4613
|
pa as MagicBookClient,
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4614
|
+
ds as bookSizes,
|
|
4615
|
+
fs as coverTypes,
|
|
4616
|
+
Xr as designOptionsSchema,
|
|
4617
|
+
ys as embellishmentLevels,
|
|
4618
|
+
ps as imageDensities,
|
|
4619
|
+
et as imageDensityOptionSchema,
|
|
4620
|
+
Gr as imageDensityOptionsSchema,
|
|
4621
|
+
ms as imageFilteringLevels,
|
|
4622
|
+
Hr as imageServerSchema,
|
|
4623
|
+
cs as occasions,
|
|
4624
|
+
hs as pageTypes,
|
|
4625
|
+
Wr as states,
|
|
4626
|
+
us as styles,
|
|
4627
|
+
gs as textStickerLevels
|
|
4627
4628
|
};
|