@shipengine/react-api 0.3.2 → 0.3.3

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.
Files changed (3) hide show
  1. package/index.js +12 -16
  2. package/index.mjs +509 -3131
  3. package/package.json +7 -4
package/index.mjs CHANGED
@@ -1,1276 +1,58 @@
1
- import { QueryClient as Rn, QueryClientProvider as xn, useMutation as I, useQuery as N, useQueryClient as Cn } from "react-query";
2
- import { jsx as Ue } from "react/jsx-runtime";
3
- import { createContext as Fn, useState as Nn, useContext as $n } from "react";
4
- class W {
5
- constructor(e, t) {
6
- this.errorCode = t?.errorCode ?? "unknown", this.errorSource = t?.errorSource ?? "client", this.errorType = t?.errorType ?? "unknown", this.message = e;
7
- }
8
- static fromObject({ message: e, ...t }) {
9
- return new W(e, t);
10
- }
11
- }
12
- var Bt = /* @__PURE__ */ ((r) => (r.AMERICAN_EXPRESS = "americanexpress", r.DISCOVER = "discover", r.MASTERCARD = "mastercard", r.VISA = "visa", r))(Bt || {}), Lt = /* @__PURE__ */ ((r) => (r.USD = "usd", r.CAD = "cad", r.AUD = "aud", r.GBP = "gbp", r.EUR = "eur", r.NZD = "nzd", r))(Lt || {}), Ut = /* @__PURE__ */ ((r) => (r.DELIVERY = "delivery", r.SIGNATURE = "signature", r.ADULT_SIGNATURE = "adult_signature", r.DIRECT_SIGNATURE = "direct_signature", r.VERBAL_CONFIRMATION = "verbal_confirmation", r.DELIVERY_MAILED = "delivery_mailed", r.NONE = "none", r))(Ut || {}), qt = /* @__PURE__ */ ((r) => (r.DOCUMENTS = "documents", r.GIFT = "gift", r.MERCHANDISE = "merchandise", r.RETURNED_GOODS = "returned_goods", r.SAMPLE = "sample", r))(qt || {}), Mt = /* @__PURE__ */ ((r) => (r.RETURN_TO_SENDER = "return_to_sender", r.TREAT_AS_ABANDONED = "treat_as_abandoned", r))(Mt || {}), zt = /* @__PURE__ */ ((r) => (r.SHIPSURANCE = "shipsurance", r.CARRIER = "carrier", r.THIRD_PARTY = "third_party", r.NONE = "none", r))(zt || {});
13
- const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14
- __proto__: null,
15
- CodedError: W,
16
- ConfirmationType: Ut,
17
- CreditCardVendor: Bt,
18
- Currency: Lt,
19
- CustomsContentsType: qt,
20
- CustomsNonDeliveryType: Mt,
21
- InsuranceProviderType: zt
22
- }, Symbol.toStringTag, { value: "Module" }));
23
- class _n {
24
- constructor(e) {
25
- this.client = e, this.get = () => this.client.get("/v1/account/settings"), this.update = (t) => this.client.put("/v1/account/settings", t), this.client = e;
26
- }
27
- }
28
- class Dn {
29
- constructor(e) {
30
- this.client = e, this.validate = (t) => this.client.post("/v1/addresses/validate", t), this.parse = (t, n) => this.client.put("/v1/addresses/recognize", {
31
- address: n,
32
- text: t
33
- }), this.client = e;
34
- }
35
- }
36
- var jt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
37
- function kn(r) {
38
- return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
39
- }
40
- function Tn(r) {
41
- if (r.__esModule)
42
- return r;
43
- var e = r.default;
44
- if (typeof e == "function") {
45
- var t = function n() {
46
- if (this instanceof n) {
47
- var a = [null];
48
- a.push.apply(a, arguments);
49
- var i = Function.bind.apply(e, a);
50
- return new i();
51
- }
52
- return e.apply(this, arguments);
53
- };
54
- t.prototype = e.prototype;
55
- } else
56
- t = {};
57
- return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(r).forEach(function(n) {
58
- var a = Object.getOwnPropertyDescriptor(r, n);
59
- Object.defineProperty(t, n, a.get ? a : {
60
- enumerable: !0,
61
- get: function() {
62
- return r[n];
63
- }
64
- });
65
- }), t;
66
- }
67
- var hr = {}, Bn = {
68
- get exports() {
69
- return hr;
70
- },
71
- set exports(r) {
72
- hr = r;
73
- }
74
- }, xe = {}, Ln = {
75
- get exports() {
76
- return xe;
77
- },
78
- set exports(r) {
79
- xe = r;
80
- }
81
- }, Wt = function(e, t) {
82
- return function() {
83
- for (var a = new Array(arguments.length), i = 0; i < a.length; i++)
84
- a[i] = arguments[i];
85
- return e.apply(t, a);
86
- };
87
- }, Un = Wt, X = Object.prototype.toString;
88
- function $r(r) {
89
- return Array.isArray(r);
90
- }
91
- function yr(r) {
92
- return typeof r > "u";
93
- }
94
- function qn(r) {
95
- return r !== null && !yr(r) && r.constructor !== null && !yr(r.constructor) && typeof r.constructor.isBuffer == "function" && r.constructor.isBuffer(r);
96
- }
97
- function Gt(r) {
98
- return X.call(r) === "[object ArrayBuffer]";
99
- }
100
- function Mn(r) {
101
- return X.call(r) === "[object FormData]";
102
- }
103
- function zn(r) {
104
- var e;
105
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(r) : e = r && r.buffer && Gt(r.buffer), e;
106
- }
107
- function jn(r) {
108
- return typeof r == "string";
109
- }
110
- function Wn(r) {
111
- return typeof r == "number";
112
- }
113
- function Kt(r) {
114
- return r !== null && typeof r == "object";
115
- }
116
- function Ie(r) {
117
- if (X.call(r) !== "[object Object]")
118
- return !1;
119
- var e = Object.getPrototypeOf(r);
120
- return e === null || e === Object.prototype;
121
- }
122
- function Gn(r) {
123
- return X.call(r) === "[object Date]";
124
- }
125
- function Kn(r) {
126
- return X.call(r) === "[object File]";
127
- }
128
- function Hn(r) {
129
- return X.call(r) === "[object Blob]";
130
- }
131
- function Ht(r) {
132
- return X.call(r) === "[object Function]";
133
- }
134
- function Vn(r) {
135
- return Kt(r) && Ht(r.pipe);
136
- }
137
- function Jn(r) {
138
- return X.call(r) === "[object URLSearchParams]";
139
- }
140
- function Qn(r) {
141
- return r.trim ? r.trim() : r.replace(/^\s+|\s+$/g, "");
142
- }
143
- function Xn() {
144
- return typeof navigator < "u" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS") ? !1 : typeof window < "u" && typeof document < "u";
145
- }
146
- function _r(r, e) {
147
- if (!(r === null || typeof r > "u"))
148
- if (typeof r != "object" && (r = [r]), $r(r))
149
- for (var t = 0, n = r.length; t < n; t++)
150
- e.call(null, r[t], t, r);
151
- else
152
- for (var a in r)
153
- Object.prototype.hasOwnProperty.call(r, a) && e.call(null, r[a], a, r);
154
- }
155
- function vr() {
156
- var r = {};
157
- function e(a, i) {
158
- Ie(r[i]) && Ie(a) ? r[i] = vr(r[i], a) : Ie(a) ? r[i] = vr({}, a) : $r(a) ? r[i] = a.slice() : r[i] = a;
159
- }
160
- for (var t = 0, n = arguments.length; t < n; t++)
161
- _r(arguments[t], e);
162
- return r;
163
- }
164
- function Yn(r, e, t) {
165
- return _r(e, function(a, i) {
166
- t && typeof a == "function" ? r[i] = Un(a, t) : r[i] = a;
167
- }), r;
168
- }
169
- function Zn(r) {
170
- return r.charCodeAt(0) === 65279 && (r = r.slice(1)), r;
171
- }
172
- var k = {
173
- isArray: $r,
174
- isArrayBuffer: Gt,
175
- isBuffer: qn,
176
- isFormData: Mn,
177
- isArrayBufferView: zn,
178
- isString: jn,
179
- isNumber: Wn,
180
- isObject: Kt,
181
- isPlainObject: Ie,
182
- isUndefined: yr,
183
- isDate: Gn,
184
- isFile: Kn,
185
- isBlob: Hn,
186
- isFunction: Ht,
187
- isStream: Vn,
188
- isURLSearchParams: Jn,
189
- isStandardBrowserEnv: Xn,
190
- forEach: _r,
191
- merge: vr,
192
- extend: Yn,
193
- trim: Qn,
194
- stripBOM: Zn
195
- }, ie = k;
196
- function Hr(r) {
197
- return encodeURIComponent(r).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
198
- }
199
- var Vt = function(e, t, n) {
200
- if (!t)
201
- return e;
202
- var a;
203
- if (n)
204
- a = n(t);
205
- else if (ie.isURLSearchParams(t))
206
- a = t.toString();
207
- else {
208
- var i = [];
209
- ie.forEach(t, function(c, d) {
210
- c === null || typeof c > "u" || (ie.isArray(c) ? d = d + "[]" : c = [c], ie.forEach(c, function(o) {
211
- ie.isDate(o) ? o = o.toISOString() : ie.isObject(o) && (o = JSON.stringify(o)), i.push(Hr(d) + "=" + Hr(o));
212
- }));
213
- }), a = i.join("&");
214
- }
215
- if (a) {
216
- var s = e.indexOf("#");
217
- s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + a;
218
- }
219
- return e;
220
- }, ea = k;
221
- function De() {
222
- this.handlers = [];
223
- }
224
- De.prototype.use = function(e, t, n) {
225
- return this.handlers.push({
226
- fulfilled: e,
227
- rejected: t,
228
- synchronous: n ? n.synchronous : !1,
229
- runWhen: n ? n.runWhen : null
230
- }), this.handlers.length - 1;
231
- };
232
- De.prototype.eject = function(e) {
233
- this.handlers[e] && (this.handlers[e] = null);
234
- };
235
- De.prototype.forEach = function(e) {
236
- ea.forEach(this.handlers, function(n) {
237
- n !== null && e(n);
238
- });
239
- };
240
- var ra = De, ta = k, na = function(e, t) {
241
- ta.forEach(e, function(a, i) {
242
- i !== t && i.toUpperCase() === t.toUpperCase() && (e[t] = a, delete e[i]);
243
- });
244
- }, Jt = function(e, t, n, a, i) {
245
- return e.config = t, n && (e.code = n), e.request = a, e.response = i, e.isAxiosError = !0, e.toJSON = function() {
246
- return {
247
- // Standard
248
- message: this.message,
249
- name: this.name,
250
- // Microsoft
251
- description: this.description,
252
- number: this.number,
253
- // Mozilla
254
- fileName: this.fileName,
255
- lineNumber: this.lineNumber,
256
- columnNumber: this.columnNumber,
257
- stack: this.stack,
258
- // Axios
259
- config: this.config,
260
- code: this.code,
261
- status: this.response && this.response.status ? this.response.status : null
262
- };
263
- }, e;
264
- }, Qt = {
265
- silentJSONParsing: !0,
266
- forcedJSONParsing: !0,
267
- clarifyTimeoutError: !1
268
- }, qe, Vr;
269
- function Xt() {
270
- if (Vr)
271
- return qe;
272
- Vr = 1;
273
- var r = Jt;
274
- return qe = function(t, n, a, i, s) {
275
- var l = new Error(t);
276
- return r(l, n, a, i, s);
277
- }, qe;
278
- }
279
- var Me, Jr;
280
- function aa() {
281
- if (Jr)
282
- return Me;
283
- Jr = 1;
284
- var r = Xt();
285
- return Me = function(t, n, a) {
286
- var i = a.config.validateStatus;
287
- !a.status || !i || i(a.status) ? t(a) : n(r(
288
- "Request failed with status code " + a.status,
289
- a.config,
290
- null,
291
- a.request,
292
- a
293
- ));
294
- }, Me;
295
- }
296
- var ze, Qr;
297
- function ia() {
298
- if (Qr)
299
- return ze;
300
- Qr = 1;
301
- var r = k;
302
- return ze = r.isStandardBrowserEnv() ? (
303
- // Standard browser envs support document.cookie
304
- function() {
305
- return {
306
- write: function(n, a, i, s, l, c) {
307
- var d = [];
308
- d.push(n + "=" + encodeURIComponent(a)), r.isNumber(i) && d.push("expires=" + new Date(i).toGMTString()), r.isString(s) && d.push("path=" + s), r.isString(l) && d.push("domain=" + l), c === !0 && d.push("secure"), document.cookie = d.join("; ");
309
- },
310
- read: function(n) {
311
- var a = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)"));
312
- return a ? decodeURIComponent(a[3]) : null;
313
- },
314
- remove: function(n) {
315
- this.write(n, "", Date.now() - 864e5);
316
- }
317
- };
318
- }()
319
- ) : (
320
- // Non standard browser env (web workers, react-native) lack needed support.
321
- function() {
322
- return {
323
- write: function() {
324
- },
325
- read: function() {
326
- return null;
327
- },
328
- remove: function() {
329
- }
330
- };
331
- }()
332
- ), ze;
333
- }
334
- var je, Xr;
335
- function oa() {
336
- return Xr || (Xr = 1, je = function(e) {
337
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
338
- }), je;
339
- }
340
- var We, Yr;
341
- function sa() {
342
- return Yr || (Yr = 1, We = function(e, t) {
343
- return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
344
- }), We;
345
- }
346
- var Ge, Zr;
347
- function ua() {
348
- if (Zr)
349
- return Ge;
350
- Zr = 1;
351
- var r = oa(), e = sa();
352
- return Ge = function(n, a) {
353
- return n && !r(a) ? e(n, a) : a;
354
- }, Ge;
355
- }
356
- var Ke, et;
357
- function la() {
358
- if (et)
359
- return Ke;
360
- et = 1;
361
- var r = k, e = [
362
- "age",
363
- "authorization",
364
- "content-length",
365
- "content-type",
366
- "etag",
367
- "expires",
368
- "from",
369
- "host",
370
- "if-modified-since",
371
- "if-unmodified-since",
372
- "last-modified",
373
- "location",
374
- "max-forwards",
375
- "proxy-authorization",
376
- "referer",
377
- "retry-after",
378
- "user-agent"
379
- ];
380
- return Ke = function(n) {
381
- var a = {}, i, s, l;
382
- return n && r.forEach(n.split(`
383
- `), function(d) {
384
- if (l = d.indexOf(":"), i = r.trim(d.substr(0, l)).toLowerCase(), s = r.trim(d.substr(l + 1)), i) {
385
- if (a[i] && e.indexOf(i) >= 0)
386
- return;
387
- i === "set-cookie" ? a[i] = (a[i] ? a[i] : []).concat([s]) : a[i] = a[i] ? a[i] + ", " + s : s;
388
- }
389
- }), a;
390
- }, Ke;
391
- }
392
- var He, rt;
393
- function ca() {
394
- if (rt)
395
- return He;
396
- rt = 1;
397
- var r = k;
398
- return He = r.isStandardBrowserEnv() ? (
399
- // Standard browser envs have full support of the APIs needed to test
400
- // whether the request URL is of the same origin as current location.
401
- function() {
402
- var t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a"), a;
403
- function i(s) {
404
- var l = s;
405
- return t && (n.setAttribute("href", l), l = n.href), n.setAttribute("href", l), {
406
- href: n.href,
407
- protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
408
- host: n.host,
409
- search: n.search ? n.search.replace(/^\?/, "") : "",
410
- hash: n.hash ? n.hash.replace(/^#/, "") : "",
411
- hostname: n.hostname,
412
- port: n.port,
413
- pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
414
- };
415
- }
416
- return a = i(window.location.href), function(l) {
417
- var c = r.isString(l) ? i(l) : l;
418
- return c.protocol === a.protocol && c.host === a.host;
419
- };
420
- }()
421
- ) : (
422
- // Non standard browser envs (web workers, react-native) lack needed support.
423
- function() {
424
- return function() {
425
- return !0;
426
- };
427
- }()
428
- ), He;
429
- }
430
- var Ve, tt;
431
- function ke() {
432
- if (tt)
433
- return Ve;
434
- tt = 1;
435
- function r(e) {
436
- this.message = e;
437
- }
438
- return r.prototype.toString = function() {
439
- return "Cancel" + (this.message ? ": " + this.message : "");
440
- }, r.prototype.__CANCEL__ = !0, Ve = r, Ve;
441
- }
442
- var Je, nt;
443
- function at() {
444
- if (nt)
445
- return Je;
446
- nt = 1;
447
- var r = k, e = aa(), t = ia(), n = Vt, a = ua(), i = la(), s = ca(), l = Xt(), c = Qt, d = ke();
448
- return Je = function(o) {
449
- return new Promise(function(p, y) {
450
- var v = o.data, m = o.headers, h = o.responseType, g;
451
- function A() {
452
- o.cancelToken && o.cancelToken.unsubscribe(g), o.signal && o.signal.removeEventListener("abort", g);
453
- }
454
- r.isFormData(v) && delete m["Content-Type"];
455
- var S = new XMLHttpRequest();
456
- if (o.auth) {
457
- var R = o.auth.username || "", q = o.auth.password ? unescape(encodeURIComponent(o.auth.password)) : "";
458
- m.Authorization = "Basic " + btoa(R + ":" + q);
459
- }
460
- var $ = a(o.baseURL, o.url);
461
- S.open(o.method.toUpperCase(), n($, o.params, o.paramsSerializer), !0), S.timeout = o.timeout;
462
- function V() {
463
- if (S) {
464
- var O = "getAllResponseHeaders" in S ? i(S.getAllResponseHeaders()) : null, _ = !h || h === "text" || h === "json" ? S.responseText : S.response, D = {
465
- data: _,
466
- status: S.status,
467
- statusText: S.statusText,
468
- headers: O,
469
- config: o,
470
- request: S
471
- };
472
- e(function(L) {
473
- p(L), A();
474
- }, function(L) {
475
- y(L), A();
476
- }, D), S = null;
477
- }
478
- }
479
- if ("onloadend" in S ? S.onloadend = V : S.onreadystatechange = function() {
480
- !S || S.readyState !== 4 || S.status === 0 && !(S.responseURL && S.responseURL.indexOf("file:") === 0) || setTimeout(V);
481
- }, S.onabort = function() {
482
- S && (y(l("Request aborted", o, "ECONNABORTED", S)), S = null);
483
- }, S.onerror = function() {
484
- y(l("Network Error", o, null, S)), S = null;
485
- }, S.ontimeout = function() {
486
- var _ = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded", D = o.transitional || c;
487
- o.timeoutErrorMessage && (_ = o.timeoutErrorMessage), y(l(
488
- _,
489
- o,
490
- D.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
491
- S
492
- )), S = null;
493
- }, r.isStandardBrowserEnv()) {
494
- var U = (o.withCredentials || s($)) && o.xsrfCookieName ? t.read(o.xsrfCookieName) : void 0;
495
- U && (m[o.xsrfHeaderName] = U);
496
- }
497
- "setRequestHeader" in S && r.forEach(m, function(_, D) {
498
- typeof v > "u" && D.toLowerCase() === "content-type" ? delete m[D] : S.setRequestHeader(D, _);
499
- }), r.isUndefined(o.withCredentials) || (S.withCredentials = !!o.withCredentials), h && h !== "json" && (S.responseType = o.responseType), typeof o.onDownloadProgress == "function" && S.addEventListener("progress", o.onDownloadProgress), typeof o.onUploadProgress == "function" && S.upload && S.upload.addEventListener("progress", o.onUploadProgress), (o.cancelToken || o.signal) && (g = function(O) {
500
- S && (y(!O || O && O.type ? new d("canceled") : O), S.abort(), S = null);
501
- }, o.cancelToken && o.cancelToken.subscribe(g), o.signal && (o.signal.aborted ? g() : o.signal.addEventListener("abort", g))), v || (v = null), S.send(v);
502
- });
503
- }, Je;
504
- }
505
- var C = k, it = na, fa = Jt, pa = Qt, da = {
506
- "Content-Type": "application/x-www-form-urlencoded"
507
- };
508
- function ot(r, e) {
509
- !C.isUndefined(r) && C.isUndefined(r["Content-Type"]) && (r["Content-Type"] = e);
510
- }
511
- function ha() {
512
- var r;
513
- return (typeof XMLHttpRequest < "u" || typeof process < "u" && Object.prototype.toString.call(process) === "[object process]") && (r = at()), r;
514
- }
515
- function ya(r, e, t) {
516
- if (C.isString(r))
517
- try {
518
- return (e || JSON.parse)(r), C.trim(r);
519
- } catch (n) {
520
- if (n.name !== "SyntaxError")
521
- throw n;
522
- }
523
- return (t || JSON.stringify)(r);
524
- }
525
- var Te = {
526
- transitional: pa,
527
- adapter: ha(),
528
- transformRequest: [function(e, t) {
529
- return it(t, "Accept"), it(t, "Content-Type"), C.isFormData(e) || C.isArrayBuffer(e) || C.isBuffer(e) || C.isStream(e) || C.isFile(e) || C.isBlob(e) ? e : C.isArrayBufferView(e) ? e.buffer : C.isURLSearchParams(e) ? (ot(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString()) : C.isObject(e) || t && t["Content-Type"] === "application/json" ? (ot(t, "application/json"), ya(e)) : e;
530
- }],
531
- transformResponse: [function(e) {
532
- var t = this.transitional || Te.transitional, n = t && t.silentJSONParsing, a = t && t.forcedJSONParsing, i = !n && this.responseType === "json";
533
- if (i || a && C.isString(e) && e.length)
534
- try {
535
- return JSON.parse(e);
536
- } catch (s) {
537
- if (i)
538
- throw s.name === "SyntaxError" ? fa(s, this, "E_JSON_PARSE") : s;
539
- }
540
- return e;
541
- }],
542
- /**
543
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
544
- * timeout is not created.
545
- */
546
- timeout: 0,
547
- xsrfCookieName: "XSRF-TOKEN",
548
- xsrfHeaderName: "X-XSRF-TOKEN",
549
- maxContentLength: -1,
550
- maxBodyLength: -1,
551
- validateStatus: function(e) {
552
- return e >= 200 && e < 300;
553
- },
554
- headers: {
555
- common: {
556
- Accept: "application/json, text/plain, */*"
557
- }
558
- }
559
- };
560
- C.forEach(["delete", "get", "head"], function(e) {
561
- Te.headers[e] = {};
562
- });
563
- C.forEach(["post", "put", "patch"], function(e) {
564
- Te.headers[e] = C.merge(da);
565
- });
566
- var Dr = Te, va = k, ma = Dr, ga = function(e, t, n) {
567
- var a = this || ma;
568
- return va.forEach(n, function(s) {
569
- e = s.call(a, e, t);
570
- }), e;
571
- }, Qe, st;
572
- function Yt() {
573
- return st || (st = 1, Qe = function(e) {
574
- return !!(e && e.__CANCEL__);
575
- }), Qe;
576
- }
577
- var ut = k, Xe = ga, Sa = Yt(), wa = Dr, ba = ke();
578
- function Ye(r) {
579
- if (r.cancelToken && r.cancelToken.throwIfRequested(), r.signal && r.signal.aborted)
580
- throw new ba("canceled");
581
- }
582
- var Ea = function(e) {
583
- Ye(e), e.headers = e.headers || {}, e.data = Xe.call(
584
- e,
585
- e.data,
586
- e.headers,
587
- e.transformRequest
588
- ), e.headers = ut.merge(
589
- e.headers.common || {},
590
- e.headers[e.method] || {},
591
- e.headers
592
- ), ut.forEach(
593
- ["delete", "get", "head", "post", "put", "patch", "common"],
594
- function(a) {
595
- delete e.headers[a];
596
- }
597
- );
598
- var t = e.adapter || wa.adapter;
599
- return t(e).then(function(a) {
600
- return Ye(e), a.data = Xe.call(
601
- e,
602
- a.data,
603
- a.headers,
604
- e.transformResponse
605
- ), a;
606
- }, function(a) {
607
- return Sa(a) || (Ye(e), a && a.response && (a.response.data = Xe.call(
608
- e,
609
- a.response.data,
610
- a.response.headers,
611
- e.transformResponse
612
- ))), Promise.reject(a);
613
- });
614
- }, T = k, Zt = function(e, t) {
615
- t = t || {};
616
- var n = {};
617
- function a(u, o) {
618
- return T.isPlainObject(u) && T.isPlainObject(o) ? T.merge(u, o) : T.isPlainObject(o) ? T.merge({}, o) : T.isArray(o) ? o.slice() : o;
619
- }
620
- function i(u) {
621
- if (T.isUndefined(t[u])) {
622
- if (!T.isUndefined(e[u]))
623
- return a(void 0, e[u]);
624
- } else
625
- return a(e[u], t[u]);
626
- }
627
- function s(u) {
628
- if (!T.isUndefined(t[u]))
629
- return a(void 0, t[u]);
630
- }
631
- function l(u) {
632
- if (T.isUndefined(t[u])) {
633
- if (!T.isUndefined(e[u]))
634
- return a(void 0, e[u]);
635
- } else
636
- return a(void 0, t[u]);
637
- }
638
- function c(u) {
639
- if (u in t)
640
- return a(e[u], t[u]);
641
- if (u in e)
642
- return a(void 0, e[u]);
643
- }
644
- var d = {
645
- url: s,
646
- method: s,
647
- data: s,
648
- baseURL: l,
649
- transformRequest: l,
650
- transformResponse: l,
651
- paramsSerializer: l,
652
- timeout: l,
653
- timeoutMessage: l,
654
- withCredentials: l,
655
- adapter: l,
656
- responseType: l,
657
- xsrfCookieName: l,
658
- xsrfHeaderName: l,
659
- onUploadProgress: l,
660
- onDownloadProgress: l,
661
- decompress: l,
662
- maxContentLength: l,
663
- maxBodyLength: l,
664
- transport: l,
665
- httpAgent: l,
666
- httpsAgent: l,
667
- cancelToken: l,
668
- socketPath: l,
669
- responseEncoding: l,
670
- validateStatus: c
671
- };
672
- return T.forEach(Object.keys(e).concat(Object.keys(t)), function(o) {
673
- var f = d[o] || i, p = f(o);
674
- T.isUndefined(p) && f !== c || (n[o] = p);
675
- }), n;
676
- }, Ze, lt;
677
- function en() {
678
- return lt || (lt = 1, Ze = {
679
- version: "0.26.1"
680
- }), Ze;
681
- }
682
- var Aa = en().version, kr = {};
683
- ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(r, e) {
684
- kr[r] = function(n) {
685
- return typeof n === r || "a" + (e < 1 ? "n " : " ") + r;
686
- };
687
- });
688
- var ct = {};
689
- kr.transitional = function(e, t, n) {
690
- function a(i, s) {
691
- return "[Axios v" + Aa + "] Transitional option '" + i + "'" + s + (n ? ". " + n : "");
692
- }
693
- return function(i, s, l) {
694
- if (e === !1)
695
- throw new Error(a(s, " has been removed" + (t ? " in " + t : "")));
696
- return t && !ct[s] && (ct[s] = !0, console.warn(
697
- a(
698
- s,
699
- " has been deprecated since v" + t + " and will be removed in the near future"
1
+ import { QueryClient as G, QueryClientProvider as x, useMutation as h, useQuery as y, useQueryClient as T } from "react-query";
2
+ import { jsx as O } from "react/jsx-runtime";
3
+ import { createContext as B, useState as U, useContext as D } from "react";
4
+ import { ShipEngineAPI as K, SE as W } from "@shipengine/js-api";
5
+ export * from "@shipengine/js-api";
6
+ const R = B(void 0), ne = ({ baseURL: e, children: r, headers: t, getToken: s }) => {
7
+ const [i, n] = U(() => {
8
+ const d = s();
9
+ if (typeof d == "string")
10
+ return new K(d, {
11
+ baseURL: e,
12
+ getToken: s,
13
+ headers: t ?? {}
14
+ });
15
+ d.then(
16
+ (a) => n(
17
+ new K(a, {
18
+ baseURL: e,
19
+ getToken: s,
20
+ headers: t ?? {}
21
+ })
700
22
  )
701
- )), e ? e(i, s, l) : !0;
702
- };
703
- };
704
- function Oa(r, e, t) {
705
- if (typeof r != "object")
706
- throw new TypeError("options must be an object");
707
- for (var n = Object.keys(r), a = n.length; a-- > 0; ) {
708
- var i = n[a], s = e[i];
709
- if (s) {
710
- var l = r[i], c = l === void 0 || s(l, i, r);
711
- if (c !== !0)
712
- throw new TypeError("option " + i + " must be " + c);
713
- continue;
714
- }
715
- if (t !== !0)
716
- throw Error("Unknown option " + i);
717
- }
718
- }
719
- var Pa = {
720
- assertOptions: Oa,
721
- validators: kr
722
- }, rn = k, Ia = Vt, ft = ra, pt = Ea, Be = Zt, tn = Pa, oe = tn.validators;
723
- function be(r) {
724
- this.defaults = r, this.interceptors = {
725
- request: new ft(),
726
- response: new ft()
727
- };
728
- }
729
- be.prototype.request = function(e, t) {
730
- typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t = Be(this.defaults, t), t.method ? t.method = t.method.toLowerCase() : this.defaults.method ? t.method = this.defaults.method.toLowerCase() : t.method = "get";
731
- var n = t.transitional;
732
- n !== void 0 && tn.assertOptions(n, {
733
- silentJSONParsing: oe.transitional(oe.boolean),
734
- forcedJSONParsing: oe.transitional(oe.boolean),
735
- clarifyTimeoutError: oe.transitional(oe.boolean)
736
- }, !1);
737
- var a = [], i = !0;
738
- this.interceptors.request.forEach(function(p) {
739
- typeof p.runWhen == "function" && p.runWhen(t) === !1 || (i = i && p.synchronous, a.unshift(p.fulfilled, p.rejected));
740
- });
741
- var s = [];
742
- this.interceptors.response.forEach(function(p) {
743
- s.push(p.fulfilled, p.rejected);
744
- });
745
- var l;
746
- if (!i) {
747
- var c = [pt, void 0];
748
- for (Array.prototype.unshift.apply(c, a), c = c.concat(s), l = Promise.resolve(t); c.length; )
749
- l = l.then(c.shift(), c.shift());
750
- return l;
751
- }
752
- for (var d = t; a.length; ) {
753
- var u = a.shift(), o = a.shift();
754
- try {
755
- d = u(d);
756
- } catch (f) {
757
- o(f);
758
- break;
759
- }
760
- }
761
- try {
762
- l = pt(d);
763
- } catch (f) {
764
- return Promise.reject(f);
765
- }
766
- for (; s.length; )
767
- l = l.then(s.shift(), s.shift());
768
- return l;
769
- };
770
- be.prototype.getUri = function(e) {
771
- return e = Be(this.defaults, e), Ia(e.url, e.params, e.paramsSerializer).replace(/^\?/, "");
772
- };
773
- rn.forEach(["delete", "get", "head", "options"], function(e) {
774
- be.prototype[e] = function(t, n) {
775
- return this.request(Be(n || {}, {
776
- method: e,
777
- url: t,
778
- data: (n || {}).data
779
- }));
780
- };
781
- });
782
- rn.forEach(["post", "put", "patch"], function(e) {
783
- be.prototype[e] = function(t, n, a) {
784
- return this.request(Be(a || {}, {
785
- method: e,
786
- url: t,
787
- data: n
788
- }));
789
- };
790
- });
791
- var Ra = be, er, dt;
792
- function xa() {
793
- if (dt)
794
- return er;
795
- dt = 1;
796
- var r = ke();
797
- function e(t) {
798
- if (typeof t != "function")
799
- throw new TypeError("executor must be a function.");
800
- var n;
801
- this.promise = new Promise(function(s) {
802
- n = s;
803
- });
804
- var a = this;
805
- this.promise.then(function(i) {
806
- if (a._listeners) {
807
- var s, l = a._listeners.length;
808
- for (s = 0; s < l; s++)
809
- a._listeners[s](i);
810
- a._listeners = null;
811
- }
812
- }), this.promise.then = function(i) {
813
- var s, l = new Promise(function(c) {
814
- a.subscribe(c), s = c;
815
- }).then(i);
816
- return l.cancel = function() {
817
- a.unsubscribe(s);
818
- }, l;
819
- }, t(function(s) {
820
- a.reason || (a.reason = new r(s), n(a.reason));
821
- });
822
- }
823
- return e.prototype.throwIfRequested = function() {
824
- if (this.reason)
825
- throw this.reason;
826
- }, e.prototype.subscribe = function(n) {
827
- if (this.reason) {
828
- n(this.reason);
829
- return;
830
- }
831
- this._listeners ? this._listeners.push(n) : this._listeners = [n];
832
- }, e.prototype.unsubscribe = function(n) {
833
- if (this._listeners) {
834
- var a = this._listeners.indexOf(n);
835
- a !== -1 && this._listeners.splice(a, 1);
23
+ );
24
+ }), o = new G();
25
+ return i ? /* @__PURE__ */ O(R.Provider, { value: { client: i }, children: /* @__PURE__ */ O(x, { client: o, children: r }) }) : /* @__PURE__ */ O(
26
+ "div",
27
+ {
28
+ style: {
29
+ alignItems: "center",
30
+ display: "flex",
31
+ height: "100%",
32
+ justifyContent: "center",
33
+ width: "100%"
34
+ },
35
+ children: "Loading..."
836
36
  }
837
- }, e.source = function() {
838
- var n, a = new e(function(s) {
839
- n = s;
840
- });
841
- return {
842
- token: a,
843
- cancel: n
844
- };
845
- }, er = e, er;
846
- }
847
- var rr, ht;
848
- function Ca() {
849
- return ht || (ht = 1, rr = function(e) {
850
- return function(n) {
851
- return e.apply(null, n);
852
- };
853
- }), rr;
854
- }
855
- var tr, yt;
856
- function Fa() {
857
- if (yt)
858
- return tr;
859
- yt = 1;
860
- var r = k;
861
- return tr = function(t) {
862
- return r.isObject(t) && t.isAxiosError === !0;
863
- }, tr;
864
- }
865
- var vt = k, Na = Wt, Re = Ra, $a = Zt, _a = Dr;
866
- function nn(r) {
867
- var e = new Re(r), t = Na(Re.prototype.request, e);
868
- return vt.extend(t, Re.prototype, e), vt.extend(t, e), t.create = function(a) {
869
- return nn($a(r, a));
870
- }, t;
871
- }
872
- var G = nn(_a);
873
- G.Axios = Re;
874
- G.Cancel = ke();
875
- G.CancelToken = xa();
876
- G.isCancel = Yt();
877
- G.VERSION = en().version;
878
- G.all = function(e) {
879
- return Promise.all(e);
880
- };
881
- G.spread = Ca();
882
- G.isAxiosError = Fa();
883
- Ln.exports = G;
884
- xe.default = G;
885
- (function(r) {
886
- r.exports = xe;
887
- })(Bn);
888
- const mr = /* @__PURE__ */ kn(hr);
889
- var Ce = {}, Da = {
890
- get exports() {
891
- return Ce;
892
- },
893
- set exports(r) {
894
- Ce = r;
895
- }
896
- };
897
- (function(r) {
898
- (function() {
899
- var e, t, n, a, i, s, l, c, d;
900
- t = {}, c = this, r !== null && r.exports ? r.exports = t : c.ipaddr = t, l = function(u, o, f, p) {
901
- var y, v;
902
- if (u.length !== o.length)
903
- throw new Error("ipaddr: cannot match CIDR for objects with different lengths");
904
- for (y = 0; p > 0; ) {
905
- if (v = f - p, v < 0 && (v = 0), u[y] >> v !== o[y] >> v)
906
- return !1;
907
- p -= f, y += 1;
908
- }
909
- return !0;
910
- }, t.subnetMatch = function(u, o, f) {
911
- var p, y, v, m, h;
912
- f == null && (f = "unicast");
913
- for (v in o)
914
- for (m = o[v], m[0] && !(m[0] instanceof Array) && (m = [m]), p = 0, y = m.length; p < y; p++)
915
- if (h = m[p], u.kind() === h[0].kind() && u.match.apply(u, h))
916
- return v;
917
- return f;
918
- }, t.IPv4 = function() {
919
- function u(o) {
920
- var f, p, y;
921
- if (o.length !== 4)
922
- throw new Error("ipaddr: ipv4 octet count should be 4");
923
- for (f = 0, p = o.length; f < p; f++)
924
- if (y = o[f], !(0 <= y && y <= 255))
925
- throw new Error("ipaddr: ipv4 octet should fit in 8 bits");
926
- this.octets = o;
927
- }
928
- return u.prototype.kind = function() {
929
- return "ipv4";
930
- }, u.prototype.toString = function() {
931
- return this.octets.join(".");
932
- }, u.prototype.toNormalizedString = function() {
933
- return this.toString();
934
- }, u.prototype.toByteArray = function() {
935
- return this.octets.slice(0);
936
- }, u.prototype.match = function(o, f) {
937
- var p;
938
- if (f === void 0 && (p = o, o = p[0], f = p[1]), o.kind() !== "ipv4")
939
- throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");
940
- return l(this.octets, o.octets, 8, f);
941
- }, u.prototype.SpecialRanges = {
942
- unspecified: [[new u([0, 0, 0, 0]), 8]],
943
- broadcast: [[new u([255, 255, 255, 255]), 32]],
944
- multicast: [[new u([224, 0, 0, 0]), 4]],
945
- linkLocal: [[new u([169, 254, 0, 0]), 16]],
946
- loopback: [[new u([127, 0, 0, 0]), 8]],
947
- carrierGradeNat: [[new u([100, 64, 0, 0]), 10]],
948
- private: [[new u([10, 0, 0, 0]), 8], [new u([172, 16, 0, 0]), 12], [new u([192, 168, 0, 0]), 16]],
949
- reserved: [[new u([192, 0, 0, 0]), 24], [new u([192, 0, 2, 0]), 24], [new u([192, 88, 99, 0]), 24], [new u([198, 51, 100, 0]), 24], [new u([203, 0, 113, 0]), 24], [new u([240, 0, 0, 0]), 4]]
950
- }, u.prototype.range = function() {
951
- return t.subnetMatch(this, this.SpecialRanges);
952
- }, u.prototype.toIPv4MappedAddress = function() {
953
- return t.IPv6.parse("::ffff:" + this.toString());
954
- }, u.prototype.prefixLengthFromSubnetMask = function() {
955
- var o, f, p, y, v, m, h;
956
- for (h = {
957
- 0: 8,
958
- 128: 7,
959
- 192: 6,
960
- 224: 5,
961
- 240: 4,
962
- 248: 3,
963
- 252: 2,
964
- 254: 1,
965
- 255: 0
966
- }, o = 0, v = !1, f = p = 3; p >= 0; f = p += -1)
967
- if (y = this.octets[f], y in h) {
968
- if (m = h[y], v && m !== 0)
969
- return null;
970
- m !== 8 && (v = !0), o += m;
971
- } else
972
- return null;
973
- return 32 - o;
974
- }, u;
975
- }(), n = "(0?\\d+|0x[a-f0-9]+)", a = {
976
- fourOctet: new RegExp("^" + n + "\\." + n + "\\." + n + "\\." + n + "$", "i"),
977
- longValue: new RegExp("^" + n + "$", "i")
978
- }, t.IPv4.parser = function(u) {
979
- var o, f, p, y, v;
980
- if (f = function(m) {
981
- return m[0] === "0" && m[1] !== "x" ? parseInt(m, 8) : parseInt(m);
982
- }, o = u.match(a.fourOctet))
983
- return function() {
984
- var m, h, g, A;
985
- for (g = o.slice(1, 6), A = [], m = 0, h = g.length; m < h; m++)
986
- p = g[m], A.push(f(p));
987
- return A;
988
- }();
989
- if (o = u.match(a.longValue)) {
990
- if (v = f(o[1]), v > 4294967295 || v < 0)
991
- throw new Error("ipaddr: address outside defined range");
992
- return function() {
993
- var m, h;
994
- for (h = [], y = m = 0; m <= 24; y = m += 8)
995
- h.push(v >> y & 255);
996
- return h;
997
- }().reverse();
998
- } else
999
- return null;
1000
- }, t.IPv6 = function() {
1001
- function u(o, f) {
1002
- var p, y, v, m, h, g;
1003
- if (o.length === 16)
1004
- for (this.parts = [], p = y = 0; y <= 14; p = y += 2)
1005
- this.parts.push(o[p] << 8 | o[p + 1]);
1006
- else if (o.length === 8)
1007
- this.parts = o;
1008
- else
1009
- throw new Error("ipaddr: ipv6 part count should be 8 or 16");
1010
- for (g = this.parts, v = 0, m = g.length; v < m; v++)
1011
- if (h = g[v], !(0 <= h && h <= 65535))
1012
- throw new Error("ipaddr: ipv6 part should fit in 16 bits");
1013
- f && (this.zoneId = f);
1014
- }
1015
- return u.prototype.kind = function() {
1016
- return "ipv6";
1017
- }, u.prototype.toString = function() {
1018
- return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::");
1019
- }, u.prototype.toRFC5952String = function() {
1020
- var o, f, p, y, v;
1021
- for (y = /((^|:)(0(:|$)){2,})/g, v = this.toNormalizedString(), o = 0, f = -1; p = y.exec(v); )
1022
- p[0].length > f && (o = p.index, f = p[0].length);
1023
- return f < 0 ? v : v.substring(0, o) + "::" + v.substring(o + f);
1024
- }, u.prototype.toByteArray = function() {
1025
- var o, f, p, y, v;
1026
- for (o = [], v = this.parts, f = 0, p = v.length; f < p; f++)
1027
- y = v[f], o.push(y >> 8), o.push(y & 255);
1028
- return o;
1029
- }, u.prototype.toNormalizedString = function() {
1030
- var o, f, p;
1031
- return o = function() {
1032
- var y, v, m, h;
1033
- for (m = this.parts, h = [], y = 0, v = m.length; y < v; y++)
1034
- f = m[y], h.push(f.toString(16));
1035
- return h;
1036
- }.call(this).join(":"), p = "", this.zoneId && (p = "%" + this.zoneId), o + p;
1037
- }, u.prototype.toFixedLengthString = function() {
1038
- var o, f, p;
1039
- return o = function() {
1040
- var y, v, m, h;
1041
- for (m = this.parts, h = [], y = 0, v = m.length; y < v; y++)
1042
- f = m[y], h.push(f.toString(16).padStart(4, "0"));
1043
- return h;
1044
- }.call(this).join(":"), p = "", this.zoneId && (p = "%" + this.zoneId), o + p;
1045
- }, u.prototype.match = function(o, f) {
1046
- var p;
1047
- if (f === void 0 && (p = o, o = p[0], f = p[1]), o.kind() !== "ipv6")
1048
- throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");
1049
- return l(this.parts, o.parts, 16, f);
1050
- }, u.prototype.SpecialRanges = {
1051
- unspecified: [new u([0, 0, 0, 0, 0, 0, 0, 0]), 128],
1052
- linkLocal: [new u([65152, 0, 0, 0, 0, 0, 0, 0]), 10],
1053
- multicast: [new u([65280, 0, 0, 0, 0, 0, 0, 0]), 8],
1054
- loopback: [new u([0, 0, 0, 0, 0, 0, 0, 1]), 128],
1055
- uniqueLocal: [new u([64512, 0, 0, 0, 0, 0, 0, 0]), 7],
1056
- ipv4Mapped: [new u([0, 0, 0, 0, 0, 65535, 0, 0]), 96],
1057
- rfc6145: [new u([0, 0, 0, 0, 65535, 0, 0, 0]), 96],
1058
- rfc6052: [new u([100, 65435, 0, 0, 0, 0, 0, 0]), 96],
1059
- "6to4": [new u([8194, 0, 0, 0, 0, 0, 0, 0]), 16],
1060
- teredo: [new u([8193, 0, 0, 0, 0, 0, 0, 0]), 32],
1061
- reserved: [[new u([8193, 3512, 0, 0, 0, 0, 0, 0]), 32]]
1062
- }, u.prototype.range = function() {
1063
- return t.subnetMatch(this, this.SpecialRanges);
1064
- }, u.prototype.isIPv4MappedAddress = function() {
1065
- return this.range() === "ipv4Mapped";
1066
- }, u.prototype.toIPv4Address = function() {
1067
- var o, f, p;
1068
- if (!this.isIPv4MappedAddress())
1069
- throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");
1070
- return p = this.parts.slice(-2), o = p[0], f = p[1], new t.IPv4([o >> 8, o & 255, f >> 8, f & 255]);
1071
- }, u.prototype.prefixLengthFromSubnetMask = function() {
1072
- var o, f, p, y, v, m, h;
1073
- for (h = {
1074
- 0: 16,
1075
- 32768: 15,
1076
- 49152: 14,
1077
- 57344: 13,
1078
- 61440: 12,
1079
- 63488: 11,
1080
- 64512: 10,
1081
- 65024: 9,
1082
- 65280: 8,
1083
- 65408: 7,
1084
- 65472: 6,
1085
- 65504: 5,
1086
- 65520: 4,
1087
- 65528: 3,
1088
- 65532: 2,
1089
- 65534: 1,
1090
- 65535: 0
1091
- }, o = 0, v = !1, f = p = 7; p >= 0; f = p += -1)
1092
- if (y = this.parts[f], y in h) {
1093
- if (m = h[y], v && m !== 0)
1094
- return null;
1095
- m !== 16 && (v = !0), o += m;
1096
- } else
1097
- return null;
1098
- return 128 - o;
1099
- }, u;
1100
- }(), i = "(?:[0-9a-f]+::?)+", d = "%[0-9a-z]{1,}", s = {
1101
- zoneIndex: new RegExp(d, "i"),
1102
- native: new RegExp("^(::)?(" + i + ")?([0-9a-f]+)?(::)?(" + d + ")?$", "i"),
1103
- transitional: new RegExp("^((?:" + i + ")|(?:::)(?:" + i + ")?)" + (n + "\\." + n + "\\." + n + "\\." + n) + ("(" + d + ")?$"), "i")
1104
- }, e = function(u, o) {
1105
- var f, p, y, v, m, h;
1106
- if (u.indexOf("::") !== u.lastIndexOf("::"))
1107
- return null;
1108
- for (h = (u.match(s.zoneIndex) || [])[0], h && (h = h.substring(1), u = u.replace(/%.+$/, "")), f = 0, p = -1; (p = u.indexOf(":", p + 1)) >= 0; )
1109
- f++;
1110
- if (u.substr(0, 2) === "::" && f--, u.substr(-2, 2) === "::" && f--, f > o)
1111
- return null;
1112
- for (m = o - f, v = ":"; m--; )
1113
- v += "0:";
1114
- return u = u.replace("::", v), u[0] === ":" && (u = u.slice(1)), u[u.length - 1] === ":" && (u = u.slice(0, -1)), o = function() {
1115
- var g, A, S, R;
1116
- for (S = u.split(":"), R = [], g = 0, A = S.length; g < A; g++)
1117
- y = S[g], R.push(parseInt(y, 16));
1118
- return R;
1119
- }(), {
1120
- parts: o,
1121
- zoneId: h
1122
- };
1123
- }, t.IPv6.parser = function(u) {
1124
- var o, f, p, y, v, m, h;
1125
- if (s.native.test(u))
1126
- return e(u, 8);
1127
- if ((y = u.match(s.transitional)) && (h = y[6] || "", o = e(y[1].slice(0, -1) + h, 6), o.parts)) {
1128
- for (m = [parseInt(y[2]), parseInt(y[3]), parseInt(y[4]), parseInt(y[5])], f = 0, p = m.length; f < p; f++)
1129
- if (v = m[f], !(0 <= v && v <= 255))
1130
- return null;
1131
- return o.parts.push(m[0] << 8 | m[1]), o.parts.push(m[2] << 8 | m[3]), {
1132
- parts: o.parts,
1133
- zoneId: o.zoneId
1134
- };
1135
- }
1136
- return null;
1137
- }, t.IPv4.isIPv4 = t.IPv6.isIPv6 = function(u) {
1138
- return this.parser(u) !== null;
1139
- }, t.IPv4.isValid = function(u) {
1140
- try {
1141
- return new this(this.parser(u)), !0;
1142
- } catch {
1143
- return !1;
1144
- }
1145
- }, t.IPv4.isValidFourPartDecimal = function(u) {
1146
- return !!(t.IPv4.isValid(u) && u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/));
1147
- }, t.IPv6.isValid = function(u) {
1148
- var o;
1149
- if (typeof u == "string" && u.indexOf(":") === -1)
1150
- return !1;
1151
- try {
1152
- return o = this.parser(u), new this(o.parts, o.zoneId), !0;
1153
- } catch {
1154
- return !1;
1155
- }
1156
- }, t.IPv4.parse = function(u) {
1157
- var o;
1158
- if (o = this.parser(u), o === null)
1159
- throw new Error("ipaddr: string is not formatted like ip address");
1160
- return new this(o);
1161
- }, t.IPv6.parse = function(u) {
1162
- var o;
1163
- if (o = this.parser(u), o.parts === null)
1164
- throw new Error("ipaddr: string is not formatted like ip address");
1165
- return new this(o.parts, o.zoneId);
1166
- }, t.IPv4.parseCIDR = function(u) {
1167
- var o, f, p;
1168
- if ((f = u.match(/^(.+)\/(\d+)$/)) && (o = parseInt(f[2]), o >= 0 && o <= 32))
1169
- return p = [this.parse(f[1]), o], Object.defineProperty(p, "toString", {
1170
- value: function() {
1171
- return this.join("/");
1172
- }
1173
- }), p;
1174
- throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range");
1175
- }, t.IPv4.subnetMaskFromPrefixLength = function(u) {
1176
- var o, f, p;
1177
- if (u = parseInt(u), u < 0 || u > 32)
1178
- throw new Error("ipaddr: invalid IPv4 prefix length");
1179
- for (p = [0, 0, 0, 0], f = 0, o = Math.floor(u / 8); f < o; )
1180
- p[f] = 255, f++;
1181
- return o < 4 && (p[o] = Math.pow(2, u % 8) - 1 << 8 - u % 8), new this(p);
1182
- }, t.IPv4.broadcastAddressFromCIDR = function(u) {
1183
- var o, f, p, y, v;
1184
- try {
1185
- for (o = this.parseCIDR(u), p = o[0].toByteArray(), v = this.subnetMaskFromPrefixLength(o[1]).toByteArray(), y = [], f = 0; f < 4; )
1186
- y.push(parseInt(p[f], 10) | parseInt(v[f], 10) ^ 255), f++;
1187
- return new this(y);
1188
- } catch {
1189
- throw new Error("ipaddr: the address does not have IPv4 CIDR format");
1190
- }
1191
- }, t.IPv4.networkAddressFromCIDR = function(u) {
1192
- var o, f, p, y, v;
1193
- try {
1194
- for (o = this.parseCIDR(u), p = o[0].toByteArray(), v = this.subnetMaskFromPrefixLength(o[1]).toByteArray(), y = [], f = 0; f < 4; )
1195
- y.push(parseInt(p[f], 10) & parseInt(v[f], 10)), f++;
1196
- return new this(y);
1197
- } catch {
1198
- throw new Error("ipaddr: the address does not have IPv4 CIDR format");
1199
- }
1200
- }, t.IPv6.parseCIDR = function(u) {
1201
- var o, f, p;
1202
- if ((f = u.match(/^(.+)\/(\d+)$/)) && (o = parseInt(f[2]), o >= 0 && o <= 128))
1203
- return p = [this.parse(f[1]), o], Object.defineProperty(p, "toString", {
1204
- value: function() {
1205
- return this.join("/");
1206
- }
1207
- }), p;
1208
- throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range");
1209
- }, t.isValid = function(u) {
1210
- return t.IPv6.isValid(u) || t.IPv4.isValid(u);
1211
- }, t.parse = function(u) {
1212
- if (t.IPv6.isValid(u))
1213
- return t.IPv6.parse(u);
1214
- if (t.IPv4.isValid(u))
1215
- return t.IPv4.parse(u);
1216
- throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
1217
- }, t.parseCIDR = function(u) {
1218
- try {
1219
- return t.IPv6.parseCIDR(u);
1220
- } catch {
1221
- try {
1222
- return t.IPv4.parseCIDR(u);
1223
- } catch {
1224
- throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
1225
- }
1226
- }
1227
- }, t.fromByteArray = function(u) {
1228
- var o;
1229
- if (o = u.length, o === 4)
1230
- return new t.IPv4(u);
1231
- if (o === 16)
1232
- return new t.IPv6(u);
1233
- throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
1234
- }, t.process = function(u) {
1235
- var o;
1236
- return o = this.parse(u), o.kind() === "ipv6" && o.isIPv4MappedAddress() ? o.toIPv4Address() : o;
1237
- };
1238
- }).call(jt);
1239
- })(Da);
1240
- const an = (r) => Array.isArray(r) && r.every((e) => on(e)), on = (r) => !!r.errorCode, ka = async () => {
1241
- try {
1242
- const r = await mr.get("https://api.ipify.org/?format=json");
1243
- return r.data.ip && Ce.isValid(r.data.ip) ? Ce.parse(r.data.ip).toString() : void 0;
1244
- } catch {
1245
- return;
1246
- }
1247
- };
1248
- class Ta {
1249
- constructor(e) {
1250
- this.client = e, this.list = () => this.client.get("/v1/carriers"), this.get = (t) => this.client.get(`/v1/carriers/${t}`), this.connect = async ({ carrierCode: t, ...n }) => {
1251
- const a = await ka();
1252
- return a ? await this.client.post(`/v1/registration/${t}`, {
1253
- ...n,
1254
- endUserIpAddress: a
1255
- }) : Promise.reject([new W("Unable to get IP address")]);
1256
- }, this.addFunds = (t, n) => this.client.put(`/v1/carriers/${t}/add_funds`, n), this.updateAutoFunding = (t, n) => this.client.post(
1257
- `/v1/carriers/${t}/auto_funding`,
1258
- n
1259
- ), this.getAutoFunding = (t) => this.client.get(
1260
- `/v1/carriers/${t}/auto_funding`
1261
- ), this.client = e;
1262
- }
1263
- }
1264
- var gr = { trace: 10, debug: 20, info: 30, warn: 40, error: 50, fatal: 60 }, Tr = {};
1265
- function nr(r) {
1266
- return typeof r == "string" ? gr[r.toLowerCase()] : r;
1267
- }
1268
- function Sr(r, e) {
1269
- return Sr = Object.setPrototypeOf || function(t, n) {
1270
- return t.__proto__ = n, t;
1271
- }, Sr(r, e);
1272
- }
1273
- function Ba() {
37
+ );
38
+ }, c = () => {
39
+ const e = D(R);
40
+ if (!e)
41
+ throw new Error("useShipEngine must be called within a ShipEngineProvider");
42
+ return e;
43
+ }, V = (e) => new Promise((r) => {
44
+ setTimeout(() => r(!0), e);
45
+ }), l = (e) => e.forEach(console.log);
46
+ var F = { trace: 10, debug: 20, info: 30, warn: 40, error: 50, fatal: 60 }, z = {};
47
+ function E(e) {
48
+ return typeof e == "string" ? F[e.toLowerCase()] : e;
49
+ }
50
+ function j(e, r) {
51
+ return j = Object.setPrototypeOf || function(t, s) {
52
+ return t.__proto__ = s, t;
53
+ }, j(e, r);
54
+ }
55
+ function I() {
1274
56
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1275
57
  return !1;
1276
58
  if (typeof Proxy == "function")
@@ -1282,110 +64,110 @@ function Ba() {
1282
64
  return !1;
1283
65
  }
1284
66
  }
1285
- function wr(r, e, t) {
1286
- return wr = Ba() ? Reflect.construct : function(n, a, i) {
1287
- var s = [null];
1288
- s.push.apply(s, a);
1289
- var l = new (Function.bind.apply(n, s))();
1290
- return i && Sr(l, i.prototype), l;
1291
- }, wr.apply(null, arguments);
67
+ function A(e, r, t) {
68
+ return A = I() ? Reflect.construct : function(s, i, n) {
69
+ var o = [null];
70
+ o.push.apply(o, i);
71
+ var d = new (Function.bind.apply(s, o))();
72
+ return n && j(d, n.prototype), d;
73
+ }, A.apply(null, arguments);
1292
74
  }
1293
- function re(r) {
1294
- if (r == null)
1295
- return r;
1296
- if (Array.isArray(r))
1297
- return r.slice();
1298
- if (typeof r == "object") {
1299
- var e = {};
1300
- return Object.keys(r).forEach(function(t) {
1301
- e[t] = r[t];
1302
- }), e;
75
+ function g(e) {
76
+ if (e == null)
77
+ return e;
78
+ if (Array.isArray(e))
79
+ return e.slice();
80
+ if (typeof e == "object") {
81
+ var r = {};
82
+ return Object.keys(e).forEach(function(t) {
83
+ r[t] = e[t];
84
+ }), r;
1303
85
  }
1304
- return r;
86
+ return e;
1305
87
  }
1306
- function br(r) {
1307
- return r === void 0 ? "undefined" : r === null ? "null" : Array.isArray(r) ? "[ " + r.map(function(e) {
1308
- return br(e);
1309
- }).join(", ") + " ]" : typeof r == "object" ? JSON.stringify(r) : typeof r == "function" ? "[Function: " + r.name + "]" : typeof r == "boolean" || typeof r == "number" ? r : "'" + r.toString() + "'";
88
+ function q(e) {
89
+ return e === void 0 ? "undefined" : e === null ? "null" : Array.isArray(e) ? "[ " + e.map(function(r) {
90
+ return q(r);
91
+ }).join(", ") + " ]" : typeof e == "object" ? JSON.stringify(e) : typeof e == "function" ? "[Function: " + e.name + "]" : typeof e == "boolean" || typeof e == "number" ? e : "'" + e.toString() + "'";
1310
92
  }
1311
- function Z(r) {
1312
- if (typeof r != "string") {
1313
- for (var e = new Array(arguments.length), t = 0; t < arguments.length; t++)
1314
- e[t] = br(arguments[t]);
1315
- return e.join(" ");
93
+ function p(e) {
94
+ if (typeof e != "string") {
95
+ for (var r = new Array(arguments.length), t = 0; t < arguments.length; t++)
96
+ r[t] = q(arguments[t]);
97
+ return r.join(" ");
1316
98
  }
1317
- for (var n = /%[sdj%]/g, a = 1, i = arguments, s = i.length, l = String(r).replace(n, function(d) {
1318
- if (d === "%%")
99
+ for (var s = /%[sdj%]/g, i = 1, n = arguments, o = n.length, d = String(e).replace(s, function(f) {
100
+ if (f === "%%")
1319
101
  return "%";
1320
- if (a >= s)
1321
- return d;
1322
- switch (d) {
102
+ if (i >= o)
103
+ return f;
104
+ switch (f) {
1323
105
  case "%s":
1324
- return String(i[a++]);
106
+ return String(n[i++]);
1325
107
  case "%d":
1326
- return Number(i[a++]);
108
+ return Number(n[i++]);
1327
109
  case "%j":
1328
110
  try {
1329
- return JSON.stringify(i[a++]);
111
+ return JSON.stringify(n[i++]);
1330
112
  } catch {
1331
113
  return "[Circular]";
1332
114
  }
1333
115
  default:
1334
- return d;
116
+ return f;
1335
117
  }
1336
- }), c = i[a]; a < s; c = i[++a])
1337
- l += c === null || typeof c != "object" ? " " + c : " " + br(c);
1338
- return l;
118
+ }), a = n[i]; i < o; a = n[++i])
119
+ d += a === null || typeof a != "object" ? " " + a : " " + q(a);
120
+ return d;
1339
121
  }
1340
- function La(r, e) {
1341
- var t = r.split(`
122
+ function J(e, r) {
123
+ var t = e.split(`
1342
124
  `);
1343
125
  t[0] && t[0].indexOf("call-stack-error") >= 0 && t.shift();
1344
- var n = t[e], a = null;
1345
- if (n) {
1346
- var i = /^\s*(at|.*@)\s*(.+)?$/.exec(n);
1347
- a = Array.isArray(i) && i[2] ? i[2] : n;
126
+ var s = t[r], i = null;
127
+ if (s) {
128
+ var n = /^\s*(at|.*@)\s*(.+)?$/.exec(s);
129
+ i = Array.isArray(n) && n[2] ? n[2] : s;
1348
130
  }
1349
- return a;
131
+ return i;
1350
132
  }
1351
- Object.keys(gr).forEach(function(r) {
1352
- Tr[gr[r]] = r;
133
+ Object.keys(F).forEach(function(e) {
134
+ z[F[e]] = e;
1353
135
  });
1354
- var Er = {};
1355
- function Ar(r, e) {
1356
- if (e) {
1357
- if (Er[e])
136
+ var C = {};
137
+ function k(e, r) {
138
+ if (r) {
139
+ if (C[r])
1358
140
  return;
1359
- Er[e] = !0;
141
+ C[r] = !0;
1360
142
  }
1361
- console.error(r + `
143
+ console.error(e + `
1362
144
  `);
1363
145
  }
1364
- function Ua(r) {
1365
- return Er[r];
146
+ function Q(e) {
147
+ return C[e];
1366
148
  }
1367
- function qa() {
1368
- var r = [];
1369
- return function(e, t) {
1370
- return t && typeof t == "object" ? r.indexOf(t) !== -1 ? "[Circular]" : (r.push(t), t) : t;
149
+ function H() {
150
+ var e = [];
151
+ return function(r, t) {
152
+ return t && typeof t == "object" ? e.indexOf(t) !== -1 ? "[Circular]" : (e.push(t), t) : t;
1371
153
  };
1372
154
  }
1373
- var Ma = /* @__PURE__ */ function() {
1374
- function r() {
155
+ var M = /* @__PURE__ */ function() {
156
+ function e() {
1375
157
  }
1376
- return r.prototype.write = function(e) {
1377
- e.level < 30 ? console.log(e) : e.level < 40 ? console.info(e) : e.level < 50 ? console.warn(e) : console.error(e), e.err && e.err.stack && console.error(e.err.stack), e.obj && console.log(e.obj);
1378
- }, r;
1379
- }(), ee = /* @__PURE__ */ function() {
1380
- function r(t, n, a) {
1381
- var i, s, l, c, d = this;
1382
- if (!(this instanceof r))
1383
- return new r(t, n);
1384
- if (n !== void 0 && (i = t, t = n, !(i instanceof r)))
158
+ return e.prototype.write = function(r) {
159
+ r.level < 30 ? console.log(r) : r.level < 40 ? console.info(r) : r.level < 50 ? console.warn(r) : console.error(r), r.err && r.err.stack && console.error(r.err.stack), r.obj && console.log(r.obj);
160
+ }, e;
161
+ }(), v = /* @__PURE__ */ function() {
162
+ function e(t, s, i) {
163
+ var n, o, d, a, f = this;
164
+ if (!(this instanceof e))
165
+ return new e(t, s);
166
+ if (s !== void 0 && (n = t, t = s, !(n instanceof e)))
1385
167
  throw new TypeError("invalid Logger creation: do not pass a second arg");
1386
168
  if (!t)
1387
169
  throw new TypeError("options (object) is required");
1388
- if (i) {
170
+ if (n) {
1389
171
  if (t.name)
1390
172
  throw new TypeError("invalid options.name: child cannot set logger name");
1391
173
  } else if (!t.name)
@@ -1396,1708 +178,326 @@ var Ma = /* @__PURE__ */ function() {
1396
178
  throw new TypeError("invalid options.streams: must be an array");
1397
179
  if (t.serializers && (typeof t.serializers != "object" || Array.isArray(t.serializers)))
1398
180
  throw new TypeError("invalid options.serializers: must be an object");
1399
- if (i && a) {
1400
- this._level = i._level, this.streams = i.streams, this.serializers = i.serializers, this.src = i.src, s = this.fields = {};
1401
- var u = Object.keys(i.fields);
1402
- for (c = 0; c < u.length; c++)
1403
- s[l = u[c]] = i.fields[l];
1404
- var o = Object.keys(t);
1405
- for (c = 0; c < o.length; c++)
1406
- s[l = o[c]] = t[l];
181
+ if (n && i) {
182
+ this._level = n._level, this.streams = n.streams, this.serializers = n.serializers, this.src = n.src, o = this.fields = {};
183
+ var m = Object.keys(n.fields);
184
+ for (a = 0; a < m.length; a++)
185
+ o[d = m[a]] = n.fields[d];
186
+ var u = Object.keys(t);
187
+ for (a = 0; a < u.length; a++)
188
+ o[d = u[a]] = t[d];
1407
189
  } else {
1408
- if (i) {
1409
- for (this._level = i._level, this.streams = [], c = 0; c < i.streams.length; c++) {
1410
- var f = re(i.streams[c]);
1411
- this.streams.push(f);
190
+ if (n) {
191
+ for (this._level = n._level, this.streams = [], a = 0; a < n.streams.length; a++) {
192
+ var b = g(n.streams[a]);
193
+ this.streams.push(b);
1412
194
  }
1413
- this.serializers = re(i.serializers), this.src = i.src, this.fields = re(i.fields), t.level && this.level(t.level);
195
+ this.serializers = g(n.serializers), this.src = n.src, this.fields = g(n.fields), t.level && this.level(t.level);
1414
196
  } else
1415
197
  this._level = Number.POSITIVE_INFINITY, this.streams = [], this.serializers = null, this.src = !1, this.fields = {};
1416
- t.stream ? this.addStream({ type: "stream", stream: t.stream, level: t.level }) : t.streams ? t.streams.forEach(function(p) {
1417
- d.addStream(p, t.level);
1418
- }) : i && t.level ? this.level(t.level) : i || this.addStream({ type: "raw", stream: new Ma(), level: t.level }), t.serializers && this.addSerializers(t.serializers), t.src && (this.src = !0), delete (s = re(t)).stream, delete s.level, delete s.streams, delete s.serializers, delete s.src, this.serializers && this._applySerializers(s), Object.keys(s).forEach(function(p) {
1419
- d.fields[p] = s[p];
198
+ t.stream ? this.addStream({ type: "stream", stream: t.stream, level: t.level }) : t.streams ? t.streams.forEach(function(w) {
199
+ f.addStream(w, t.level);
200
+ }) : n && t.level ? this.level(t.level) : n || this.addStream({ type: "raw", stream: new M(), level: t.level }), t.serializers && this.addSerializers(t.serializers), t.src && (this.src = !0), delete (o = g(t)).stream, delete o.level, delete o.streams, delete o.serializers, delete o.src, this.serializers && this._applySerializers(o), Object.keys(o).forEach(function(w) {
201
+ f.fields[w] = o[w];
1420
202
  });
1421
203
  }
1422
204
  }
1423
- var e = r.prototype;
1424
- return e.addStream = function(t, n) {
1425
- n === void 0 && (n = 30), (t = re(t)).type = "raw", t.level = nr(t.level || n), t.level < this._level && (this._level = t.level), this.streams.push(t), delete this.haveNonRawStreams;
1426
- }, e.addSerializers = function(t) {
1427
- var n = this;
1428
- this.serializers || (this.serializers = {}), Object.keys(t).forEach(function(a) {
1429
- var i = t[a];
1430
- if (typeof i != "function")
1431
- throw new TypeError(Z('invalid serializer for "%s" field: must be a function', a));
1432
- n.serializers[a] = i;
205
+ var r = e.prototype;
206
+ return r.addStream = function(t, s) {
207
+ s === void 0 && (s = 30), (t = g(t)).type = "raw", t.level = E(t.level || s), t.level < this._level && (this._level = t.level), this.streams.push(t), delete this.haveNonRawStreams;
208
+ }, r.addSerializers = function(t) {
209
+ var s = this;
210
+ this.serializers || (this.serializers = {}), Object.keys(t).forEach(function(i) {
211
+ var n = t[i];
212
+ if (typeof n != "function")
213
+ throw new TypeError(p('invalid serializer for "%s" field: must be a function', i));
214
+ s.serializers[i] = n;
1433
215
  });
1434
- }, e.child = function(t, n) {
1435
- return new this.constructor(this, t || {}, n);
1436
- }, e.level = function(t) {
216
+ }, r.child = function(t, s) {
217
+ return new this.constructor(this, t || {}, s);
218
+ }, r.level = function(t) {
1437
219
  if (t === void 0)
1438
220
  return this._level;
1439
- for (var n = nr(t), a = this.streams.length, i = 0; i < a; i++)
1440
- this.streams[i].level = n;
1441
- this._level = n;
1442
- }, e.levels = function(t, n) {
221
+ for (var s = E(t), i = this.streams.length, n = 0; n < i; n++)
222
+ this.streams[n].level = s;
223
+ this._level = s;
224
+ }, r.levels = function(t, s) {
1443
225
  if (t === void 0)
1444
- return this.streams.map(function(d) {
1445
- return d.level;
226
+ return this.streams.map(function(f) {
227
+ return f.level;
1446
228
  });
1447
- var a;
229
+ var i;
1448
230
  if (typeof t == "number") {
1449
- if ((a = this.streams[t]) === void 0)
231
+ if ((i = this.streams[t]) === void 0)
1450
232
  throw new Error("invalid stream index: " + t);
1451
233
  } else {
1452
- for (var i = this.streams.length, s = 0; s < i; s++) {
1453
- var l = this.streams[s];
1454
- if (l.name === t) {
1455
- a = l;
234
+ for (var n = this.streams.length, o = 0; o < n; o++) {
235
+ var d = this.streams[o];
236
+ if (d.name === t) {
237
+ i = d;
1456
238
  break;
1457
239
  }
1458
240
  }
1459
- if (!a)
1460
- throw new Error(Z('no stream with name "%s"', t));
1461
- }
1462
- if (n === void 0)
1463
- return a.level;
1464
- var c = nr(n);
1465
- a.level = c, c < this._level && (this._level = c);
1466
- }, e._applySerializers = function(t, n) {
1467
- var a = this;
1468
- Object.keys(this.serializers).forEach(function(i) {
1469
- if (!(t[i] === void 0 || n && n[i]))
241
+ if (!i)
242
+ throw new Error(p('no stream with name "%s"', t));
243
+ }
244
+ if (s === void 0)
245
+ return i.level;
246
+ var a = E(s);
247
+ i.level = a, a < this._level && (this._level = a);
248
+ }, r._applySerializers = function(t, s) {
249
+ var i = this;
250
+ Object.keys(this.serializers).forEach(function(n) {
251
+ if (!(t[n] === void 0 || s && s[n]))
1470
252
  try {
1471
- t[i] = a.serializers[i](t[i]);
1472
- } catch (s) {
1473
- Ar(Z(`bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bugin that serializer function.
1474
- %s`, i, s.stack || s)), t[i] = Z('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)', i);
253
+ t[n] = i.serializers[n](t[n]);
254
+ } catch (o) {
255
+ k(p(`bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bugin that serializer function.
256
+ %s`, n, o.stack || o)), t[n] = p('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)', n);
1475
257
  }
1476
258
  });
1477
- }, e._emit = function(t, n) {
1478
- var a, i;
259
+ }, r._emit = function(t, s) {
260
+ var i, n;
1479
261
  if (this.haveNonRawStreams === void 0) {
1480
- for (this.haveNonRawStreams = !1, a = 0; a < this.streams.length; a++)
1481
- if (!this.streams[a].raw) {
262
+ for (this.haveNonRawStreams = !1, i = 0; i < this.streams.length; i++)
263
+ if (!this.streams[i].raw) {
1482
264
  this.haveNonRawStreams = !0;
1483
265
  break;
1484
266
  }
1485
267
  }
1486
- if (n || this.haveNonRawStreams)
268
+ if (s || this.haveNonRawStreams)
1487
269
  try {
1488
- i = JSON.stringify(t, qa()) + `
270
+ n = JSON.stringify(t, H()) + `
1489
271
  `;
1490
- } catch (d) {
1491
- var s = d.stack.split(/\n/g, 2).join(`
272
+ } catch (f) {
273
+ var o = f.stack.split(/\n/g, 2).join(`
1492
274
  `);
1493
- Ar('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n' + function(u, o) {
1494
- return o || (o = " "), o + u.split(/\r?\n/g).join(`
1495
- ` + o);
1496
- }(Z(`%s
1497
- %s`, t, d.stack)), s), i = Z(`(Exception in JSON.stringify(rec): %j. See stderr for details.)
1498
- `, d.message);
275
+ k('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n' + function(m, u) {
276
+ return u || (u = " "), u + m.split(/\r?\n/g).join(`
277
+ ` + u);
278
+ }(p(`%s
279
+ %s`, t, f.stack)), o), n = p(`(Exception in JSON.stringify(rec): %j. See stderr for details.)
280
+ `, f.message);
1499
281
  }
1500
- if (n)
1501
- return i;
1502
- var l = t.level;
1503
- for (a = 0; a < this.streams.length; a++) {
1504
- var c = this.streams[a];
1505
- c.level <= l && c.stream.write(t);
282
+ if (s)
283
+ return n;
284
+ var d = t.level;
285
+ for (i = 0; i < this.streams.length; i++) {
286
+ var a = this.streams[i];
287
+ a.level <= d && a.stream.write(t);
1506
288
  }
1507
- return i;
1508
- }, r;
289
+ return n;
290
+ }, e;
1509
291
  }();
1510
- function se(r) {
292
+ function S(e) {
1511
293
  return function() {
1512
- var e = this;
1513
- function t(s) {
1514
- var l;
1515
- s[0] instanceof Error ? (n = { err: e.serializers && e.serializers.err ? e.serializers.err(s[0]) : Br.err(s[0]) }, l = { err: !0 }, a = s.length === 1 ? [n.err.message] : Array.prototype.slice.call(s, 1)) : typeof s[0] != "object" && s[0] !== null || Array.isArray(s[0]) ? (n = null, a = Array.prototype.slice.call(s)) : (n = s[0], a = s.length === 1 && n.err && n.err instanceof Error ? [n.err.message] : Array.prototype.slice.call(s, 1));
1516
- var c = re(e.fields);
1517
- c.level = r;
1518
- var d = n ? re(n) : null;
1519
- if (d && (e.serializers && e._applySerializers(d, l), Object.keys(d).forEach(function(o) {
1520
- c[o] = d[o];
1521
- })), c.levelName = Tr[r], c.msg = a.length ? Z.apply(e, a) : "", c.time || (c.time = new Date()), e.src && !c.src)
294
+ var r = this;
295
+ function t(o) {
296
+ var d;
297
+ o[0] instanceof Error ? (s = { err: r.serializers && r.serializers.err ? r.serializers.err(o[0]) : P.err(o[0]) }, d = { err: !0 }, i = o.length === 1 ? [s.err.message] : Array.prototype.slice.call(o, 1)) : typeof o[0] != "object" && o[0] !== null || Array.isArray(o[0]) ? (s = null, i = Array.prototype.slice.call(o)) : (s = o[0], i = o.length === 1 && s.err && s.err instanceof Error ? [s.err.message] : Array.prototype.slice.call(o, 1));
298
+ var a = g(r.fields);
299
+ a.level = e;
300
+ var f = s ? g(s) : null;
301
+ if (f && (r.serializers && r._applySerializers(f, d), Object.keys(f).forEach(function(u) {
302
+ a[u] = f[u];
303
+ })), a.levelName = z[e], a.msg = i.length ? p.apply(r, i) : "", a.time || (a.time = new Date()), r.src && !a.src)
1522
304
  try {
1523
305
  throw new Error("call-stack-error");
1524
- } catch (o) {
1525
- var u = o.stack ? La(o.stack, 2) : "";
1526
- u || Ua("src") || Ar("Unable to determine src line info", "src"), c.src = u || "";
306
+ } catch (u) {
307
+ var m = u.stack ? J(u.stack, 2) : "";
308
+ m || Q("src") || k("Unable to determine src line info", "src"), a.src = m || "";
1527
309
  }
1528
- return c.v = 1, c;
310
+ return a.v = 1, a;
1529
311
  }
1530
- var n = null, a = arguments, i = null;
312
+ var s = null, i = arguments, n = null;
1531
313
  if (arguments.length === 0)
1532
- return this._level <= r;
1533
- this._level > r || (i = t(a), this._emit(i));
314
+ return this._level <= e;
315
+ this._level > e || (n = t(i), this._emit(n));
1534
316
  };
1535
317
  }
1536
- function sn(r) {
1537
- var e = r.stack || r.toString();
1538
- if (r.cause && typeof r.cause == "function") {
1539
- var t = r.cause();
1540
- t && (e += `
1541
- Caused by: ` + sn(t));
1542
- }
1543
- return e;
1544
- }
1545
- ee.prototype.trace = se(10), ee.prototype.debug = se(20), ee.prototype.info = se(30), ee.prototype.warn = se(40), ee.prototype.error = se(50), ee.prototype.fatal = se(60);
1546
- var Br = { err: function(r) {
1547
- return r && r.stack ? { message: r.message, name: r.name, stack: sn(r), code: r.code, signal: r.signal } : r;
1548
- } };
1549
- function un() {
1550
- return wr(ee, [].slice.call(arguments));
1551
- }
1552
- var mt = { levels: { trace: "color: DeepPink", debug: "color: GoldenRod", info: "color: DarkTurquoise", warn: "color: Purple", error: "color: Crimson", fatal: "color: Black" }, def: "color: DimGray", msg: "color: SteelBlue", src: "color: DimGray; font-style: italic; font-size: 0.9em" }, ln = /* @__PURE__ */ function() {
1553
- function r(e) {
1554
- var t = e === void 0 ? {} : e, n = t.logByLevel, a = t.css, i = a === void 0 ? mt : a;
1555
- this.logByLevel = n !== void 0 && n, this.css = i;
1556
- }
1557
- return r.prototype.write = function(e) {
1558
- var t, n, a = this.css.def, i = this.css.msg, s = this.css.src, l = e.childName ? e.name + "/" + e.childName : e.name, c = Tr[e.level], d = (Array(6 - c.length).join(" ") + c).toUpperCase();
1559
- this.logByLevel ? (e.level === 10 ? c = "debug" : e.level === 60 && (c = "error"), n = typeof console[c] == "function" ? console[c] : console.log) : n = console.log, t = e.level < 20 ? this.css.levels.trace : e.level < 30 ? this.css.levels.debug : e.level < 40 ? this.css.levels.info : e.level < 50 ? this.css.levels.warn : e.level < 60 ? this.css.levels.error : this.css.levels.fatal;
1560
- var u = function(f, p) {
1561
- return Array(p + 1 - (f + "").length).join("0") + f;
1562
- }, o = [];
1563
- o.push("[%s:%s:%s:%s] %c%s%c: %s: %c%s " + (e.src ? "%c%s" : "")), o.push(u(e.time.getHours(), 2)), o.push(u(e.time.getMinutes(), 2)), o.push(u(e.time.getSeconds(), 2)), o.push(u(e.time.getMilliseconds(), 4)), o.push(t), o.push(d), o.push(a), o.push(l), o.push(i), o.push(e.msg), e.src && (o.push(s), o.push(e.src)), e.obj && (o.push(`
1564
- `), o.push(e.obj)), e.err && e.err.stack && (o.push(`
1565
- `), o.push(e.err.stack)), n.apply(console, o);
1566
- }, r.getDefaultCss = function() {
1567
- return mt;
1568
- }, r;
1569
- }(), me = {}, za = {
1570
- get exports() {
1571
- return me;
1572
- },
1573
- set exports(r) {
1574
- me = r;
1575
- }
1576
- };
1577
- (function(r) {
1578
- (function(e) {
1579
- var t = function(h, g, A) {
1580
- if (!d(g) || o(g) || f(g) || p(g) || c(g))
1581
- return g;
1582
- var S, R = 0, q = 0;
1583
- if (u(g))
1584
- for (S = [], q = g.length; R < q; R++)
1585
- S.push(t(h, g[R], A));
1586
- else {
1587
- S = {};
1588
- for (var $ in g)
1589
- Object.prototype.hasOwnProperty.call(g, $) && (S[h($, A)] = t(h, g[$], A));
1590
- }
1591
- return S;
1592
- }, n = function(h, g) {
1593
- g = g || {};
1594
- var A = g.separator || "_", S = g.split || /(?=[A-Z])/;
1595
- return h.split(S).join(A);
1596
- }, a = function(h) {
1597
- return y(h) ? h : (h = h.replace(/[\-_\s]+(.)?/g, function(g, A) {
1598
- return A ? A.toUpperCase() : "";
1599
- }), h.substr(0, 1).toLowerCase() + h.substr(1));
1600
- }, i = function(h) {
1601
- var g = a(h);
1602
- return g.substr(0, 1).toUpperCase() + g.substr(1);
1603
- }, s = function(h, g) {
1604
- return n(h, g).toLowerCase();
1605
- }, l = Object.prototype.toString, c = function(h) {
1606
- return typeof h == "function";
1607
- }, d = function(h) {
1608
- return h === Object(h);
1609
- }, u = function(h) {
1610
- return l.call(h) == "[object Array]";
1611
- }, o = function(h) {
1612
- return l.call(h) == "[object Date]";
1613
- }, f = function(h) {
1614
- return l.call(h) == "[object RegExp]";
1615
- }, p = function(h) {
1616
- return l.call(h) == "[object Boolean]";
1617
- }, y = function(h) {
1618
- return h = h - 0, h === h;
1619
- }, v = function(h, g) {
1620
- var A = g && "process" in g ? g.process : g;
1621
- return typeof A != "function" ? h : function(S, R) {
1622
- return A(S, h, R);
1623
- };
1624
- }, m = {
1625
- camelize: a,
1626
- decamelize: s,
1627
- pascalize: i,
1628
- depascalize: s,
1629
- camelizeKeys: function(h, g) {
1630
- return t(v(a, g), h);
1631
- },
1632
- decamelizeKeys: function(h, g) {
1633
- return t(v(s, g), h, g);
1634
- },
1635
- pascalizeKeys: function(h, g) {
1636
- return t(v(i, g), h);
1637
- },
1638
- depascalizeKeys: function() {
1639
- return this.decamelizeKeys.apply(this, arguments);
1640
- }
1641
- };
1642
- r.exports ? r.exports = m : e.humps = m;
1643
- })(jt);
1644
- })(za);
1645
- var ja = function() {
1646
- if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
1647
- return !1;
1648
- if (typeof Symbol.iterator == "symbol")
1649
- return !0;
1650
- var e = {}, t = Symbol("test"), n = Object(t);
1651
- if (typeof t == "string" || Object.prototype.toString.call(t) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
1652
- return !1;
1653
- var a = 42;
1654
- e[t] = a;
1655
- for (t in e)
1656
- return !1;
1657
- if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
1658
- return !1;
1659
- var i = Object.getOwnPropertySymbols(e);
1660
- if (i.length !== 1 || i[0] !== t || !Object.prototype.propertyIsEnumerable.call(e, t))
1661
- return !1;
1662
- if (typeof Object.getOwnPropertyDescriptor == "function") {
1663
- var s = Object.getOwnPropertyDescriptor(e, t);
1664
- if (s.value !== a || s.enumerable !== !0)
1665
- return !1;
1666
- }
1667
- return !0;
1668
- }, gt = typeof Symbol < "u" && Symbol, Wa = ja, Ga = function() {
1669
- return typeof gt != "function" || typeof Symbol != "function" || typeof gt("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Wa();
1670
- }, Ka = "Function.prototype.bind called on incompatible ", ar = Array.prototype.slice, Ha = Object.prototype.toString, Va = "[object Function]", Ja = function(e) {
1671
- var t = this;
1672
- if (typeof t != "function" || Ha.call(t) !== Va)
1673
- throw new TypeError(Ka + t);
1674
- for (var n = ar.call(arguments, 1), a, i = function() {
1675
- if (this instanceof a) {
1676
- var u = t.apply(
1677
- this,
1678
- n.concat(ar.call(arguments))
1679
- );
1680
- return Object(u) === u ? u : this;
1681
- } else
1682
- return t.apply(
1683
- e,
1684
- n.concat(ar.call(arguments))
1685
- );
1686
- }, s = Math.max(0, t.length - n.length), l = [], c = 0; c < s; c++)
1687
- l.push("$" + c);
1688
- if (a = Function("binder", "return function (" + l.join(",") + "){ return binder.apply(this,arguments); }")(i), t.prototype) {
1689
- var d = function() {
1690
- };
1691
- d.prototype = t.prototype, a.prototype = new d(), d.prototype = null;
1692
- }
1693
- return a;
1694
- }, Qa = Ja, Lr = Function.prototype.bind || Qa, Xa = Lr, Ya = Xa.call(Function.call, Object.prototype.hasOwnProperty), w, fe = SyntaxError, cn = Function, ce = TypeError, ir = function(r) {
1695
- try {
1696
- return cn('"use strict"; return (' + r + ").constructor;")();
1697
- } catch {
1698
- }
1699
- }, ne = Object.getOwnPropertyDescriptor;
1700
- if (ne)
1701
- try {
1702
- ne({}, "");
1703
- } catch {
1704
- ne = null;
1705
- }
1706
- var or = function() {
1707
- throw new ce();
1708
- }, Za = ne ? function() {
1709
- try {
1710
- return arguments.callee, or;
1711
- } catch {
1712
- try {
1713
- return ne(arguments, "callee").get;
1714
- } catch {
1715
- return or;
1716
- }
318
+ function _(e) {
319
+ var r = e.stack || e.toString();
320
+ if (e.cause && typeof e.cause == "function") {
321
+ var t = e.cause();
322
+ t && (r += `
323
+ Caused by: ` + _(t));
1717
324
  }
1718
- }() : or, ue = Ga(), z = Object.getPrototypeOf || function(r) {
1719
- return r.__proto__;
1720
- }, le = {}, ei = typeof Uint8Array > "u" ? w : z(Uint8Array), ae = {
1721
- "%AggregateError%": typeof AggregateError > "u" ? w : AggregateError,
1722
- "%Array%": Array,
1723
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? w : ArrayBuffer,
1724
- "%ArrayIteratorPrototype%": ue ? z([][Symbol.iterator]()) : w,
1725
- "%AsyncFromSyncIteratorPrototype%": w,
1726
- "%AsyncFunction%": le,
1727
- "%AsyncGenerator%": le,
1728
- "%AsyncGeneratorFunction%": le,
1729
- "%AsyncIteratorPrototype%": le,
1730
- "%Atomics%": typeof Atomics > "u" ? w : Atomics,
1731
- "%BigInt%": typeof BigInt > "u" ? w : BigInt,
1732
- "%BigInt64Array%": typeof BigInt64Array > "u" ? w : BigInt64Array,
1733
- "%BigUint64Array%": typeof BigUint64Array > "u" ? w : BigUint64Array,
1734
- "%Boolean%": Boolean,
1735
- "%DataView%": typeof DataView > "u" ? w : DataView,
1736
- "%Date%": Date,
1737
- "%decodeURI%": decodeURI,
1738
- "%decodeURIComponent%": decodeURIComponent,
1739
- "%encodeURI%": encodeURI,
1740
- "%encodeURIComponent%": encodeURIComponent,
1741
- "%Error%": Error,
1742
- "%eval%": eval,
1743
- // eslint-disable-line no-eval
1744
- "%EvalError%": EvalError,
1745
- "%Float32Array%": typeof Float32Array > "u" ? w : Float32Array,
1746
- "%Float64Array%": typeof Float64Array > "u" ? w : Float64Array,
1747
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? w : FinalizationRegistry,
1748
- "%Function%": cn,
1749
- "%GeneratorFunction%": le,
1750
- "%Int8Array%": typeof Int8Array > "u" ? w : Int8Array,
1751
- "%Int16Array%": typeof Int16Array > "u" ? w : Int16Array,
1752
- "%Int32Array%": typeof Int32Array > "u" ? w : Int32Array,
1753
- "%isFinite%": isFinite,
1754
- "%isNaN%": isNaN,
1755
- "%IteratorPrototype%": ue ? z(z([][Symbol.iterator]())) : w,
1756
- "%JSON%": typeof JSON == "object" ? JSON : w,
1757
- "%Map%": typeof Map > "u" ? w : Map,
1758
- "%MapIteratorPrototype%": typeof Map > "u" || !ue ? w : z((/* @__PURE__ */ new Map())[Symbol.iterator]()),
1759
- "%Math%": Math,
1760
- "%Number%": Number,
1761
- "%Object%": Object,
1762
- "%parseFloat%": parseFloat,
1763
- "%parseInt%": parseInt,
1764
- "%Promise%": typeof Promise > "u" ? w : Promise,
1765
- "%Proxy%": typeof Proxy > "u" ? w : Proxy,
1766
- "%RangeError%": RangeError,
1767
- "%ReferenceError%": ReferenceError,
1768
- "%Reflect%": typeof Reflect > "u" ? w : Reflect,
1769
- "%RegExp%": RegExp,
1770
- "%Set%": typeof Set > "u" ? w : Set,
1771
- "%SetIteratorPrototype%": typeof Set > "u" || !ue ? w : z((/* @__PURE__ */ new Set())[Symbol.iterator]()),
1772
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? w : SharedArrayBuffer,
1773
- "%String%": String,
1774
- "%StringIteratorPrototype%": ue ? z(""[Symbol.iterator]()) : w,
1775
- "%Symbol%": ue ? Symbol : w,
1776
- "%SyntaxError%": fe,
1777
- "%ThrowTypeError%": Za,
1778
- "%TypedArray%": ei,
1779
- "%TypeError%": ce,
1780
- "%Uint8Array%": typeof Uint8Array > "u" ? w : Uint8Array,
1781
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? w : Uint8ClampedArray,
1782
- "%Uint16Array%": typeof Uint16Array > "u" ? w : Uint16Array,
1783
- "%Uint32Array%": typeof Uint32Array > "u" ? w : Uint32Array,
1784
- "%URIError%": URIError,
1785
- "%WeakMap%": typeof WeakMap > "u" ? w : WeakMap,
1786
- "%WeakRef%": typeof WeakRef > "u" ? w : WeakRef,
1787
- "%WeakSet%": typeof WeakSet > "u" ? w : WeakSet
1788
- };
1789
- try {
1790
- null.error;
1791
- } catch (r) {
1792
- var ri = z(z(r));
1793
- ae["%Error.prototype%"] = ri;
1794
- }
1795
- var ti = function r(e) {
1796
- var t;
1797
- if (e === "%AsyncFunction%")
1798
- t = ir("async function () {}");
1799
- else if (e === "%GeneratorFunction%")
1800
- t = ir("function* () {}");
1801
- else if (e === "%AsyncGeneratorFunction%")
1802
- t = ir("async function* () {}");
1803
- else if (e === "%AsyncGenerator%") {
1804
- var n = r("%AsyncGeneratorFunction%");
1805
- n && (t = n.prototype);
1806
- } else if (e === "%AsyncIteratorPrototype%") {
1807
- var a = r("%AsyncGenerator%");
1808
- a && (t = z(a.prototype));
1809
- }
1810
- return ae[e] = t, t;
1811
- }, St = {
1812
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
1813
- "%ArrayPrototype%": ["Array", "prototype"],
1814
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
1815
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
1816
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
1817
- "%ArrayProto_values%": ["Array", "prototype", "values"],
1818
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
1819
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
1820
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
1821
- "%BooleanPrototype%": ["Boolean", "prototype"],
1822
- "%DataViewPrototype%": ["DataView", "prototype"],
1823
- "%DatePrototype%": ["Date", "prototype"],
1824
- "%ErrorPrototype%": ["Error", "prototype"],
1825
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
1826
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
1827
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
1828
- "%FunctionPrototype%": ["Function", "prototype"],
1829
- "%Generator%": ["GeneratorFunction", "prototype"],
1830
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
1831
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
1832
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
1833
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
1834
- "%JSONParse%": ["JSON", "parse"],
1835
- "%JSONStringify%": ["JSON", "stringify"],
1836
- "%MapPrototype%": ["Map", "prototype"],
1837
- "%NumberPrototype%": ["Number", "prototype"],
1838
- "%ObjectPrototype%": ["Object", "prototype"],
1839
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
1840
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
1841
- "%PromisePrototype%": ["Promise", "prototype"],
1842
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
1843
- "%Promise_all%": ["Promise", "all"],
1844
- "%Promise_reject%": ["Promise", "reject"],
1845
- "%Promise_resolve%": ["Promise", "resolve"],
1846
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
1847
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
1848
- "%RegExpPrototype%": ["RegExp", "prototype"],
1849
- "%SetPrototype%": ["Set", "prototype"],
1850
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
1851
- "%StringPrototype%": ["String", "prototype"],
1852
- "%SymbolPrototype%": ["Symbol", "prototype"],
1853
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
1854
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
1855
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
1856
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
1857
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
1858
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
1859
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
1860
- "%URIErrorPrototype%": ["URIError", "prototype"],
1861
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
1862
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
1863
- }, Ee = Lr, Fe = Ya, ni = Ee.call(Function.call, Array.prototype.concat), ai = Ee.call(Function.apply, Array.prototype.splice), wt = Ee.call(Function.call, String.prototype.replace), Ne = Ee.call(Function.call, String.prototype.slice), ii = Ee.call(Function.call, RegExp.prototype.exec), oi = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, si = /\\(\\)?/g, ui = function(e) {
1864
- var t = Ne(e, 0, 1), n = Ne(e, -1);
1865
- if (t === "%" && n !== "%")
1866
- throw new fe("invalid intrinsic syntax, expected closing `%`");
1867
- if (n === "%" && t !== "%")
1868
- throw new fe("invalid intrinsic syntax, expected opening `%`");
1869
- var a = [];
1870
- return wt(e, oi, function(i, s, l, c) {
1871
- a[a.length] = l ? wt(c, si, "$1") : s || i;
1872
- }), a;
1873
- }, li = function(e, t) {
1874
- var n = e, a;
1875
- if (Fe(St, n) && (a = St[n], n = "%" + a[0] + "%"), Fe(ae, n)) {
1876
- var i = ae[n];
1877
- if (i === le && (i = ti(n)), typeof i > "u" && !t)
1878
- throw new ce("intrinsic " + e + " exists, but is not available. Please file an issue!");
1879
- return {
1880
- alias: a,
1881
- name: n,
1882
- value: i
1883
- };
1884
- }
1885
- throw new fe("intrinsic " + e + " does not exist!");
1886
- }, Ur = function(e, t) {
1887
- if (typeof e != "string" || e.length === 0)
1888
- throw new ce("intrinsic name must be a non-empty string");
1889
- if (arguments.length > 1 && typeof t != "boolean")
1890
- throw new ce('"allowMissing" argument must be a boolean');
1891
- if (ii(/^%?[^%]*%?$/, e) === null)
1892
- throw new fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1893
- var n = ui(e), a = n.length > 0 ? n[0] : "", i = li("%" + a + "%", t), s = i.name, l = i.value, c = !1, d = i.alias;
1894
- d && (a = d[0], ai(n, ni([0, 1], d)));
1895
- for (var u = 1, o = !0; u < n.length; u += 1) {
1896
- var f = n[u], p = Ne(f, 0, 1), y = Ne(f, -1);
1897
- if ((p === '"' || p === "'" || p === "`" || y === '"' || y === "'" || y === "`") && p !== y)
1898
- throw new fe("property names with quotes must have matching quotes");
1899
- if ((f === "constructor" || !o) && (c = !0), a += "." + f, s = "%" + a + "%", Fe(ae, s))
1900
- l = ae[s];
1901
- else if (l != null) {
1902
- if (!(f in l)) {
1903
- if (!t)
1904
- throw new ce("base intrinsic for " + e + " exists, but the property is not available.");
1905
- return;
1906
- }
1907
- if (ne && u + 1 >= n.length) {
1908
- var v = ne(l, f);
1909
- o = !!v, o && "get" in v && !("originalValue" in v.get) ? l = v.get : l = l[f];
1910
- } else
1911
- o = Fe(l, f), l = l[f];
1912
- o && !c && (ae[s] = l);
1913
- }
1914
- }
1915
- return l;
1916
- }, Or = {}, ci = {
1917
- get exports() {
1918
- return Or;
1919
- },
1920
- set exports(r) {
1921
- Or = r;
1922
- }
1923
- };
1924
- (function(r) {
1925
- var e = Lr, t = Ur, n = t("%Function.prototype.apply%"), a = t("%Function.prototype.call%"), i = t("%Reflect.apply%", !0) || e.call(a, n), s = t("%Object.getOwnPropertyDescriptor%", !0), l = t("%Object.defineProperty%", !0), c = t("%Math.max%");
1926
- if (l)
1927
- try {
1928
- l({}, "a", { value: 1 });
1929
- } catch {
1930
- l = null;
1931
- }
1932
- r.exports = function(o) {
1933
- var f = i(e, a, arguments);
1934
- if (s && l) {
1935
- var p = s(f, "length");
1936
- p.configurable && l(
1937
- f,
1938
- "length",
1939
- { value: 1 + c(0, o.length - (arguments.length - 1)) }
1940
- );
1941
- }
1942
- return f;
1943
- };
1944
- var d = function() {
1945
- return i(e, n, arguments);
1946
- };
1947
- l ? l(r.exports, "apply", { value: d }) : r.exports.apply = d;
1948
- })(ci);
1949
- var fn = Ur, pn = Or, fi = pn(fn("String.prototype.indexOf")), pi = function(e, t) {
1950
- var n = fn(e, !!t);
1951
- return typeof n == "function" && fi(e, ".prototype.") > -1 ? pn(n) : n;
1952
- };
1953
- const di = {}, hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1954
- __proto__: null,
1955
- default: di
1956
- }, Symbol.toStringTag, { value: "Module" })), yi = /* @__PURE__ */ Tn(hi);
1957
- var qr = typeof Map == "function" && Map.prototype, sr = Object.getOwnPropertyDescriptor && qr ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, $e = qr && sr && typeof sr.get == "function" ? sr.get : null, bt = qr && Map.prototype.forEach, Mr = typeof Set == "function" && Set.prototype, ur = Object.getOwnPropertyDescriptor && Mr ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, _e = Mr && ur && typeof ur.get == "function" ? ur.get : null, Et = Mr && Set.prototype.forEach, vi = typeof WeakMap == "function" && WeakMap.prototype, ge = vi ? WeakMap.prototype.has : null, mi = typeof WeakSet == "function" && WeakSet.prototype, Se = mi ? WeakSet.prototype.has : null, gi = typeof WeakRef == "function" && WeakRef.prototype, At = gi ? WeakRef.prototype.deref : null, Si = Boolean.prototype.valueOf, wi = Object.prototype.toString, bi = Function.prototype.toString, Ei = String.prototype.match, zr = String.prototype.slice, Q = String.prototype.replace, Ai = String.prototype.toUpperCase, Ot = String.prototype.toLowerCase, dn = RegExp.prototype.test, Pt = Array.prototype.concat, j = Array.prototype.join, Oi = Array.prototype.slice, It = Math.floor, Pr = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, lr = Object.getOwnPropertySymbols, Ir = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, pe = typeof Symbol == "function" && typeof Symbol.iterator == "object", F = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === pe || "symbol") ? Symbol.toStringTag : null, hn = Object.prototype.propertyIsEnumerable, Rt = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(r) {
1958
- return r.__proto__;
1959
- } : null);
1960
- function xt(r, e) {
1961
- if (r === 1 / 0 || r === -1 / 0 || r !== r || r && r > -1e3 && r < 1e3 || dn.call(/e/, e))
1962
- return e;
1963
- var t = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
1964
- if (typeof r == "number") {
1965
- var n = r < 0 ? -It(-r) : It(r);
1966
- if (n !== r) {
1967
- var a = String(n), i = zr.call(e, a.length + 1);
1968
- return Q.call(a, t, "$&_") + "." + Q.call(Q.call(i, /([0-9]{3})/g, "$&_"), /_$/, "");
1969
- }
1970
- }
1971
- return Q.call(e, t, "$&_");
1972
- }
1973
- var Rr = yi, Ct = Rr.custom, Ft = vn(Ct) ? Ct : null, Pi = function r(e, t, n, a) {
1974
- var i = t || {};
1975
- if (J(i, "quoteStyle") && i.quoteStyle !== "single" && i.quoteStyle !== "double")
1976
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
1977
- if (J(i, "maxStringLength") && (typeof i.maxStringLength == "number" ? i.maxStringLength < 0 && i.maxStringLength !== 1 / 0 : i.maxStringLength !== null))
1978
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
1979
- var s = J(i, "customInspect") ? i.customInspect : !0;
1980
- if (typeof s != "boolean" && s !== "symbol")
1981
- throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
1982
- if (J(i, "indent") && i.indent !== null && i.indent !== " " && !(parseInt(i.indent, 10) === i.indent && i.indent > 0))
1983
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1984
- if (J(i, "numericSeparator") && typeof i.numericSeparator != "boolean")
1985
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1986
- var l = i.numericSeparator;
1987
- if (typeof e > "u")
1988
- return "undefined";
1989
- if (e === null)
1990
- return "null";
1991
- if (typeof e == "boolean")
1992
- return e ? "true" : "false";
1993
- if (typeof e == "string")
1994
- return gn(e, i);
1995
- if (typeof e == "number") {
1996
- if (e === 0)
1997
- return 1 / 0 / e > 0 ? "0" : "-0";
1998
- var c = String(e);
1999
- return l ? xt(e, c) : c;
2000
- }
2001
- if (typeof e == "bigint") {
2002
- var d = String(e) + "n";
2003
- return l ? xt(e, d) : d;
2004
- }
2005
- var u = typeof i.depth > "u" ? 5 : i.depth;
2006
- if (typeof n > "u" && (n = 0), n >= u && u > 0 && typeof e == "object")
2007
- return xr(e) ? "[Array]" : "[Object]";
2008
- var o = ji(i, n);
2009
- if (typeof a > "u")
2010
- a = [];
2011
- else if (mn(a, e) >= 0)
2012
- return "[Circular]";
2013
- function f(B, L, K) {
2014
- if (L && (a = Oi.call(a), a.push(L)), K) {
2015
- var ye = {
2016
- depth: i.depth
2017
- };
2018
- return J(i, "quoteStyle") && (ye.quoteStyle = i.quoteStyle), r(B, ye, n + 1, a);
2019
- }
2020
- return r(B, i, n + 1, a);
2021
- }
2022
- if (typeof e == "function" && !Nt(e)) {
2023
- var p = Di(e), y = Ae(e, f);
2024
- return "[Function" + (p ? ": " + p : " (anonymous)") + "]" + (y.length > 0 ? " { " + j.call(y, ", ") + " }" : "");
2025
- }
2026
- if (vn(e)) {
2027
- var v = pe ? Q.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Ir.call(e);
2028
- return typeof e == "object" && !pe ? ve(v) : v;
2029
- }
2030
- if (qi(e)) {
2031
- for (var m = "<" + Ot.call(String(e.nodeName)), h = e.attributes || [], g = 0; g < h.length; g++)
2032
- m += " " + h[g].name + "=" + yn(Ii(h[g].value), "double", i);
2033
- return m += ">", e.childNodes && e.childNodes.length && (m += "..."), m += "</" + Ot.call(String(e.nodeName)) + ">", m;
2034
- }
2035
- if (xr(e)) {
2036
- if (e.length === 0)
2037
- return "[]";
2038
- var A = Ae(e, f);
2039
- return o && !zi(A) ? "[" + Cr(A, o) + "]" : "[ " + j.call(A, ", ") + " ]";
2040
- }
2041
- if (xi(e)) {
2042
- var S = Ae(e, f);
2043
- return !("cause" in Error.prototype) && "cause" in e && !hn.call(e, "cause") ? "{ [" + String(e) + "] " + j.call(Pt.call("[cause]: " + f(e.cause), S), ", ") + " }" : S.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + j.call(S, ", ") + " }";
2044
- }
2045
- if (typeof e == "object" && s) {
2046
- if (Ft && typeof e[Ft] == "function" && Rr)
2047
- return Rr(e, { depth: u - n });
2048
- if (s !== "symbol" && typeof e.inspect == "function")
2049
- return e.inspect();
2050
- }
2051
- if (ki(e)) {
2052
- var R = [];
2053
- return bt && bt.call(e, function(B, L) {
2054
- R.push(f(L, e, !0) + " => " + f(B, e));
2055
- }), $t("Map", $e.call(e), R, o);
2056
- }
2057
- if (Li(e)) {
2058
- var q = [];
2059
- return Et && Et.call(e, function(B) {
2060
- q.push(f(B, e));
2061
- }), $t("Set", _e.call(e), q, o);
2062
- }
2063
- if (Ti(e))
2064
- return cr("WeakMap");
2065
- if (Ui(e))
2066
- return cr("WeakSet");
2067
- if (Bi(e))
2068
- return cr("WeakRef");
2069
- if (Fi(e))
2070
- return ve(f(Number(e)));
2071
- if ($i(e))
2072
- return ve(f(Pr.call(e)));
2073
- if (Ni(e))
2074
- return ve(Si.call(e));
2075
- if (Ci(e))
2076
- return ve(f(String(e)));
2077
- if (!Ri(e) && !Nt(e)) {
2078
- var $ = Ae(e, f), V = Rt ? Rt(e) === Object.prototype : e instanceof Object || e.constructor === Object, U = e instanceof Object ? "" : "null prototype", O = !V && F && Object(e) === e && F in e ? zr.call(Y(e), 8, -1) : U ? "Object" : "", _ = V || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", D = _ + (O || U ? "[" + j.call(Pt.call([], O || [], U || []), ": ") + "] " : "");
2079
- return $.length === 0 ? D + "{}" : o ? D + "{" + Cr($, o) + "}" : D + "{ " + j.call($, ", ") + " }";
2080
- }
2081
- return String(e);
2082
- };
2083
- function yn(r, e, t) {
2084
- var n = (t.quoteStyle || e) === "double" ? '"' : "'";
2085
- return n + r + n;
2086
- }
2087
- function Ii(r) {
2088
- return Q.call(String(r), /"/g, "&quot;");
2089
- }
2090
- function xr(r) {
2091
- return Y(r) === "[object Array]" && (!F || !(typeof r == "object" && F in r));
2092
- }
2093
- function Ri(r) {
2094
- return Y(r) === "[object Date]" && (!F || !(typeof r == "object" && F in r));
2095
- }
2096
- function Nt(r) {
2097
- return Y(r) === "[object RegExp]" && (!F || !(typeof r == "object" && F in r));
2098
- }
2099
- function xi(r) {
2100
- return Y(r) === "[object Error]" && (!F || !(typeof r == "object" && F in r));
2101
- }
2102
- function Ci(r) {
2103
- return Y(r) === "[object String]" && (!F || !(typeof r == "object" && F in r));
2104
- }
2105
- function Fi(r) {
2106
- return Y(r) === "[object Number]" && (!F || !(typeof r == "object" && F in r));
2107
- }
2108
- function Ni(r) {
2109
- return Y(r) === "[object Boolean]" && (!F || !(typeof r == "object" && F in r));
2110
- }
2111
- function vn(r) {
2112
- if (pe)
2113
- return r && typeof r == "object" && r instanceof Symbol;
2114
- if (typeof r == "symbol")
2115
- return !0;
2116
- if (!r || typeof r != "object" || !Ir)
2117
- return !1;
2118
- try {
2119
- return Ir.call(r), !0;
2120
- } catch {
2121
- }
2122
- return !1;
2123
- }
2124
- function $i(r) {
2125
- if (!r || typeof r != "object" || !Pr)
2126
- return !1;
2127
- try {
2128
- return Pr.call(r), !0;
2129
- } catch {
2130
- }
2131
- return !1;
2132
- }
2133
- var _i = Object.prototype.hasOwnProperty || function(r) {
2134
- return r in this;
2135
- };
2136
- function J(r, e) {
2137
- return _i.call(r, e);
2138
- }
2139
- function Y(r) {
2140
- return wi.call(r);
2141
- }
2142
- function Di(r) {
2143
- if (r.name)
2144
- return r.name;
2145
- var e = Ei.call(bi.call(r), /^function\s*([\w$]+)/);
2146
- return e ? e[1] : null;
2147
- }
2148
- function mn(r, e) {
2149
- if (r.indexOf)
2150
- return r.indexOf(e);
2151
- for (var t = 0, n = r.length; t < n; t++)
2152
- if (r[t] === e)
2153
- return t;
2154
- return -1;
2155
- }
2156
- function ki(r) {
2157
- if (!$e || !r || typeof r != "object")
2158
- return !1;
2159
- try {
2160
- $e.call(r);
2161
- try {
2162
- _e.call(r);
2163
- } catch {
2164
- return !0;
2165
- }
2166
- return r instanceof Map;
2167
- } catch {
2168
- }
2169
- return !1;
2170
- }
2171
- function Ti(r) {
2172
- if (!ge || !r || typeof r != "object")
2173
- return !1;
2174
- try {
2175
- ge.call(r, ge);
2176
- try {
2177
- Se.call(r, Se);
2178
- } catch {
2179
- return !0;
2180
- }
2181
- return r instanceof WeakMap;
2182
- } catch {
2183
- }
2184
- return !1;
2185
- }
2186
- function Bi(r) {
2187
- if (!At || !r || typeof r != "object")
2188
- return !1;
2189
- try {
2190
- return At.call(r), !0;
2191
- } catch {
2192
- }
2193
- return !1;
2194
- }
2195
- function Li(r) {
2196
- if (!_e || !r || typeof r != "object")
2197
- return !1;
2198
- try {
2199
- _e.call(r);
2200
- try {
2201
- $e.call(r);
2202
- } catch {
2203
- return !0;
2204
- }
2205
- return r instanceof Set;
2206
- } catch {
2207
- }
2208
- return !1;
2209
- }
2210
- function Ui(r) {
2211
- if (!Se || !r || typeof r != "object")
2212
- return !1;
2213
- try {
2214
- Se.call(r, Se);
2215
- try {
2216
- ge.call(r, ge);
2217
- } catch {
2218
- return !0;
2219
- }
2220
- return r instanceof WeakSet;
2221
- } catch {
2222
- }
2223
- return !1;
2224
- }
2225
- function qi(r) {
2226
- return !r || typeof r != "object" ? !1 : typeof HTMLElement < "u" && r instanceof HTMLElement ? !0 : typeof r.nodeName == "string" && typeof r.getAttribute == "function";
2227
- }
2228
- function gn(r, e) {
2229
- if (r.length > e.maxStringLength) {
2230
- var t = r.length - e.maxStringLength, n = "... " + t + " more character" + (t > 1 ? "s" : "");
2231
- return gn(zr.call(r, 0, e.maxStringLength), e) + n;
2232
- }
2233
- var a = Q.call(Q.call(r, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, Mi);
2234
- return yn(a, "single", e);
2235
- }
2236
- function Mi(r) {
2237
- var e = r.charCodeAt(0), t = {
2238
- 8: "b",
2239
- 9: "t",
2240
- 10: "n",
2241
- 12: "f",
2242
- 13: "r"
2243
- }[e];
2244
- return t ? "\\" + t : "\\x" + (e < 16 ? "0" : "") + Ai.call(e.toString(16));
2245
- }
2246
- function ve(r) {
2247
- return "Object(" + r + ")";
2248
- }
2249
- function cr(r) {
2250
- return r + " { ? }";
2251
- }
2252
- function $t(r, e, t, n) {
2253
- var a = n ? Cr(t, n) : j.call(t, ", ");
2254
- return r + " (" + e + ") {" + a + "}";
2255
- }
2256
- function zi(r) {
2257
- for (var e = 0; e < r.length; e++)
2258
- if (mn(r[e], `
2259
- `) >= 0)
2260
- return !1;
2261
- return !0;
2262
- }
2263
- function ji(r, e) {
2264
- var t;
2265
- if (r.indent === " ")
2266
- t = " ";
2267
- else if (typeof r.indent == "number" && r.indent > 0)
2268
- t = j.call(Array(r.indent + 1), " ");
2269
- else
2270
- return null;
2271
- return {
2272
- base: t,
2273
- prev: j.call(Array(e + 1), t)
2274
- };
2275
- }
2276
- function Cr(r, e) {
2277
- if (r.length === 0)
2278
- return "";
2279
- var t = `
2280
- ` + e.prev + e.base;
2281
- return t + j.call(r, "," + t) + `
2282
- ` + e.prev;
2283
- }
2284
- function Ae(r, e) {
2285
- var t = xr(r), n = [];
2286
- if (t) {
2287
- n.length = r.length;
2288
- for (var a = 0; a < r.length; a++)
2289
- n[a] = J(r, a) ? e(r[a], r) : "";
2290
- }
2291
- var i = typeof lr == "function" ? lr(r) : [], s;
2292
- if (pe) {
2293
- s = {};
2294
- for (var l = 0; l < i.length; l++)
2295
- s["$" + i[l]] = i[l];
2296
- }
2297
- for (var c in r)
2298
- J(r, c) && (t && String(Number(c)) === c && c < r.length || pe && s["$" + c] instanceof Symbol || (dn.call(/[^\w$]/, c) ? n.push(e(c, r) + ": " + e(r[c], r)) : n.push(c + ": " + e(r[c], r))));
2299
- if (typeof lr == "function")
2300
- for (var d = 0; d < i.length; d++)
2301
- hn.call(r, i[d]) && n.push("[" + e(i[d]) + "]: " + e(r[i[d]], r));
2302
- return n;
2303
- }
2304
- var jr = Ur, he = pi, Wi = Pi, Gi = jr("%TypeError%"), Oe = jr("%WeakMap%", !0), Pe = jr("%Map%", !0), Ki = he("WeakMap.prototype.get", !0), Hi = he("WeakMap.prototype.set", !0), Vi = he("WeakMap.prototype.has", !0), Ji = he("Map.prototype.get", !0), Qi = he("Map.prototype.set", !0), Xi = he("Map.prototype.has", !0), Wr = function(r, e) {
2305
- for (var t = r, n; (n = t.next) !== null; t = n)
2306
- if (n.key === e)
2307
- return t.next = n.next, n.next = r.next, r.next = n, n;
2308
- }, Yi = function(r, e) {
2309
- var t = Wr(r, e);
2310
- return t && t.value;
2311
- }, Zi = function(r, e, t) {
2312
- var n = Wr(r, e);
2313
- n ? n.value = t : r.next = {
2314
- // eslint-disable-line no-param-reassign
2315
- key: e,
2316
- next: r.next,
2317
- value: t
2318
- };
2319
- }, eo = function(r, e) {
2320
- return !!Wr(r, e);
2321
- }, ro = function() {
2322
- var e, t, n, a = {
2323
- assert: function(i) {
2324
- if (!a.has(i))
2325
- throw new Gi("Side channel does not contain " + Wi(i));
2326
- },
2327
- get: function(i) {
2328
- if (Oe && i && (typeof i == "object" || typeof i == "function")) {
2329
- if (e)
2330
- return Ki(e, i);
2331
- } else if (Pe) {
2332
- if (t)
2333
- return Ji(t, i);
2334
- } else if (n)
2335
- return Yi(n, i);
2336
- },
2337
- has: function(i) {
2338
- if (Oe && i && (typeof i == "object" || typeof i == "function")) {
2339
- if (e)
2340
- return Vi(e, i);
2341
- } else if (Pe) {
2342
- if (t)
2343
- return Xi(t, i);
2344
- } else if (n)
2345
- return eo(n, i);
2346
- return !1;
2347
- },
2348
- set: function(i, s) {
2349
- Oe && i && (typeof i == "object" || typeof i == "function") ? (e || (e = new Oe()), Hi(e, i, s)) : Pe ? (t || (t = new Pe()), Qi(t, i, s)) : (n || (n = { key: {}, next: null }), Zi(n, i, s));
2350
- }
2351
- };
2352
- return a;
2353
- }, to = String.prototype.replace, no = /%20/g, fr = {
2354
- RFC1738: "RFC1738",
2355
- RFC3986: "RFC3986"
2356
- }, Gr = {
2357
- default: fr.RFC3986,
2358
- formatters: {
2359
- RFC1738: function(r) {
2360
- return to.call(r, no, "+");
2361
- },
2362
- RFC3986: function(r) {
2363
- return String(r);
2364
- }
2365
- },
2366
- RFC1738: fr.RFC1738,
2367
- RFC3986: fr.RFC3986
2368
- }, ao = Gr, pr = Object.prototype.hasOwnProperty, te = Array.isArray, M = function() {
2369
- for (var r = [], e = 0; e < 256; ++e)
2370
- r.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
2371
325
  return r;
2372
- }(), io = function(e) {
2373
- for (; e.length > 1; ) {
2374
- var t = e.pop(), n = t.obj[t.prop];
2375
- if (te(n)) {
2376
- for (var a = [], i = 0; i < n.length; ++i)
2377
- typeof n[i] < "u" && a.push(n[i]);
2378
- t.obj[t.prop] = a;
2379
- }
2380
- }
2381
- }, Sn = function(e, t) {
2382
- for (var n = t && t.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = 0; a < e.length; ++a)
2383
- typeof e[a] < "u" && (n[a] = e[a]);
2384
- return n;
2385
- }, oo = function r(e, t, n) {
2386
- if (!t)
2387
- return e;
2388
- if (typeof t != "object") {
2389
- if (te(e))
2390
- e.push(t);
2391
- else if (e && typeof e == "object")
2392
- (n && (n.plainObjects || n.allowPrototypes) || !pr.call(Object.prototype, t)) && (e[t] = !0);
2393
- else
2394
- return [e, t];
2395
- return e;
2396
- }
2397
- if (!e || typeof e != "object")
2398
- return [e].concat(t);
2399
- var a = e;
2400
- return te(e) && !te(t) && (a = Sn(e, n)), te(e) && te(t) ? (t.forEach(function(i, s) {
2401
- if (pr.call(e, s)) {
2402
- var l = e[s];
2403
- l && typeof l == "object" && i && typeof i == "object" ? e[s] = r(l, i, n) : e.push(i);
2404
- } else
2405
- e[s] = i;
2406
- }), e) : Object.keys(t).reduce(function(i, s) {
2407
- var l = t[s];
2408
- return pr.call(i, s) ? i[s] = r(i[s], l, n) : i[s] = l, i;
2409
- }, a);
2410
- }, so = function(e, t) {
2411
- return Object.keys(t).reduce(function(n, a) {
2412
- return n[a] = t[a], n;
2413
- }, e);
2414
- }, uo = function(r, e, t) {
2415
- var n = r.replace(/\+/g, " ");
2416
- if (t === "iso-8859-1")
2417
- return n.replace(/%[0-9a-f]{2}/gi, unescape);
2418
- try {
2419
- return decodeURIComponent(n);
2420
- } catch {
2421
- return n;
2422
- }
2423
- }, lo = function(e, t, n, a, i) {
2424
- if (e.length === 0)
2425
- return e;
2426
- var s = e;
2427
- if (typeof e == "symbol" ? s = Symbol.prototype.toString.call(e) : typeof e != "string" && (s = String(e)), n === "iso-8859-1")
2428
- return escape(s).replace(/%u[0-9a-f]{4}/gi, function(u) {
2429
- return "%26%23" + parseInt(u.slice(2), 16) + "%3B";
2430
- });
2431
- for (var l = "", c = 0; c < s.length; ++c) {
2432
- var d = s.charCodeAt(c);
2433
- if (d === 45 || d === 46 || d === 95 || d === 126 || d >= 48 && d <= 57 || d >= 65 && d <= 90 || d >= 97 && d <= 122 || i === ao.RFC1738 && (d === 40 || d === 41)) {
2434
- l += s.charAt(c);
2435
- continue;
2436
- }
2437
- if (d < 128) {
2438
- l = l + M[d];
2439
- continue;
2440
- }
2441
- if (d < 2048) {
2442
- l = l + (M[192 | d >> 6] + M[128 | d & 63]);
2443
- continue;
2444
- }
2445
- if (d < 55296 || d >= 57344) {
2446
- l = l + (M[224 | d >> 12] + M[128 | d >> 6 & 63] + M[128 | d & 63]);
2447
- continue;
2448
- }
2449
- c += 1, d = 65536 + ((d & 1023) << 10 | s.charCodeAt(c) & 1023), l += M[240 | d >> 18] + M[128 | d >> 12 & 63] + M[128 | d >> 6 & 63] + M[128 | d & 63];
2450
- }
2451
- return l;
2452
- }, co = function(e) {
2453
- for (var t = [{ obj: { o: e }, prop: "o" }], n = [], a = 0; a < t.length; ++a)
2454
- for (var i = t[a], s = i.obj[i.prop], l = Object.keys(s), c = 0; c < l.length; ++c) {
2455
- var d = l[c], u = s[d];
2456
- typeof u == "object" && u !== null && n.indexOf(u) === -1 && (t.push({ obj: s, prop: d }), n.push(u));
2457
- }
2458
- return io(t), e;
2459
- }, fo = function(e) {
2460
- return Object.prototype.toString.call(e) === "[object RegExp]";
2461
- }, po = function(e) {
2462
- return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
2463
- }, ho = function(e, t) {
2464
- return [].concat(e, t);
2465
- }, yo = function(e, t) {
2466
- if (te(e)) {
2467
- for (var n = [], a = 0; a < e.length; a += 1)
2468
- n.push(t(e[a]));
2469
- return n;
2470
- }
2471
- return t(e);
2472
- }, wn = {
2473
- arrayToObject: Sn,
2474
- assign: so,
2475
- combine: ho,
2476
- compact: co,
2477
- decode: uo,
2478
- encode: lo,
2479
- isBuffer: po,
2480
- isRegExp: fo,
2481
- maybeMap: yo,
2482
- merge: oo
2483
- }, bn = ro, Fr = wn, we = Gr, vo = Object.prototype.hasOwnProperty, _t = {
2484
- brackets: function(e) {
2485
- return e + "[]";
2486
- },
2487
- comma: "comma",
2488
- indices: function(e, t) {
2489
- return e + "[" + t + "]";
2490
- },
2491
- repeat: function(e) {
2492
- return e;
2493
- }
2494
- }, H = Array.isArray, mo = String.prototype.split, go = Array.prototype.push, En = function(r, e) {
2495
- go.apply(r, H(e) ? e : [e]);
2496
- }, So = Date.prototype.toISOString, Dt = we.default, x = {
2497
- addQueryPrefix: !1,
2498
- allowDots: !1,
2499
- charset: "utf-8",
2500
- charsetSentinel: !1,
2501
- delimiter: "&",
2502
- encode: !0,
2503
- encoder: Fr.encode,
2504
- encodeValuesOnly: !1,
2505
- format: Dt,
2506
- formatter: we.formatters[Dt],
2507
- // deprecated
2508
- indices: !1,
2509
- serializeDate: function(e) {
2510
- return So.call(e);
2511
- },
2512
- skipNulls: !1,
2513
- strictNullHandling: !1
2514
- }, wo = function(e) {
2515
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
2516
- }, dr = {}, bo = function r(e, t, n, a, i, s, l, c, d, u, o, f, p, y, v, m) {
2517
- for (var h = e, g = m, A = 0, S = !1; (g = g.get(dr)) !== void 0 && !S; ) {
2518
- var R = g.get(e);
2519
- if (A += 1, typeof R < "u") {
2520
- if (R === A)
2521
- throw new RangeError("Cyclic object value");
2522
- S = !0;
2523
- }
2524
- typeof g.get(dr) > "u" && (A = 0);
2525
- }
2526
- if (typeof c == "function" ? h = c(t, h) : h instanceof Date ? h = o(h) : n === "comma" && H(h) && (h = Fr.maybeMap(h, function(Le) {
2527
- return Le instanceof Date ? o(Le) : Le;
2528
- })), h === null) {
2529
- if (i)
2530
- return l && !y ? l(t, x.encoder, v, "key", f) : t;
2531
- h = "";
2532
- }
2533
- if (wo(h) || Fr.isBuffer(h)) {
2534
- if (l) {
2535
- var q = y ? t : l(t, x.encoder, v, "key", f);
2536
- if (n === "comma" && y) {
2537
- for (var $ = mo.call(String(h), ","), V = "", U = 0; U < $.length; ++U)
2538
- V += (U === 0 ? "" : ",") + p(l($[U], x.encoder, v, "value", f));
2539
- return [p(q) + (a && H(h) && $.length === 1 ? "[]" : "") + "=" + V];
2540
- }
2541
- return [p(q) + "=" + p(l(h, x.encoder, v, "value", f))];
2542
- }
2543
- return [p(t) + "=" + p(String(h))];
2544
- }
2545
- var O = [];
2546
- if (typeof h > "u")
2547
- return O;
2548
- var _;
2549
- if (n === "comma" && H(h))
2550
- _ = [{ value: h.length > 0 ? h.join(",") || null : void 0 }];
2551
- else if (H(c))
2552
- _ = c;
2553
- else {
2554
- var D = Object.keys(h);
2555
- _ = d ? D.sort(d) : D;
2556
- }
2557
- for (var B = a && H(h) && h.length === 1 ? t + "[]" : t, L = 0; L < _.length; ++L) {
2558
- var K = _[L], ye = typeof K == "object" && typeof K.value < "u" ? K.value : h[K];
2559
- if (!(s && ye === null)) {
2560
- var In = H(h) ? typeof n == "function" ? n(B, K) : B : B + (u ? "." + K : "[" + K + "]");
2561
- m.set(e, A);
2562
- var Kr = bn();
2563
- Kr.set(dr, m), En(O, r(
2564
- ye,
2565
- In,
2566
- n,
2567
- a,
2568
- i,
2569
- s,
2570
- l,
2571
- c,
2572
- d,
2573
- u,
2574
- o,
2575
- f,
2576
- p,
2577
- y,
2578
- v,
2579
- Kr
2580
- ));
2581
- }
2582
- }
2583
- return O;
2584
- }, Eo = function(e) {
2585
- if (!e)
2586
- return x;
2587
- if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
2588
- throw new TypeError("Encoder has to be a function.");
2589
- var t = e.charset || x.charset;
2590
- if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
2591
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
2592
- var n = we.default;
2593
- if (typeof e.format < "u") {
2594
- if (!vo.call(we.formatters, e.format))
2595
- throw new TypeError("Unknown format option provided.");
2596
- n = e.format;
2597
- }
2598
- var a = we.formatters[n], i = x.filter;
2599
- return (typeof e.filter == "function" || H(e.filter)) && (i = e.filter), {
2600
- addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : x.addQueryPrefix,
2601
- allowDots: typeof e.allowDots > "u" ? x.allowDots : !!e.allowDots,
2602
- charset: t,
2603
- charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : x.charsetSentinel,
2604
- delimiter: typeof e.delimiter > "u" ? x.delimiter : e.delimiter,
2605
- encode: typeof e.encode == "boolean" ? e.encode : x.encode,
2606
- encoder: typeof e.encoder == "function" ? e.encoder : x.encoder,
2607
- encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : x.encodeValuesOnly,
2608
- filter: i,
2609
- format: n,
2610
- formatter: a,
2611
- serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : x.serializeDate,
2612
- skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : x.skipNulls,
2613
- sort: typeof e.sort == "function" ? e.sort : null,
2614
- strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : x.strictNullHandling
2615
- };
2616
- }, Ao = function(r, e) {
2617
- var t = r, n = Eo(e), a, i;
2618
- typeof n.filter == "function" ? (i = n.filter, t = i("", t)) : H(n.filter) && (i = n.filter, a = i);
2619
- var s = [];
2620
- if (typeof t != "object" || t === null)
2621
- return "";
2622
- var l;
2623
- e && e.arrayFormat in _t ? l = e.arrayFormat : e && "indices" in e ? l = e.indices ? "indices" : "repeat" : l = "indices";
2624
- var c = _t[l];
2625
- if (e && "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
2626
- throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
2627
- var d = c === "comma" && e && e.commaRoundTrip;
2628
- a || (a = Object.keys(t)), n.sort && a.sort(n.sort);
2629
- for (var u = bn(), o = 0; o < a.length; ++o) {
2630
- var f = a[o];
2631
- n.skipNulls && t[f] === null || En(s, bo(
2632
- t[f],
2633
- f,
2634
- c,
2635
- d,
2636
- n.strictNullHandling,
2637
- n.skipNulls,
2638
- n.encode ? n.encoder : null,
2639
- n.filter,
2640
- n.sort,
2641
- n.allowDots,
2642
- n.serializeDate,
2643
- n.format,
2644
- n.formatter,
2645
- n.encodeValuesOnly,
2646
- n.charset,
2647
- u
2648
- ));
2649
- }
2650
- var p = s.join(n.delimiter), y = n.addQueryPrefix === !0 ? "?" : "";
2651
- return n.charsetSentinel && (n.charset === "iso-8859-1" ? y += "utf8=%26%2310003%3B&" : y += "utf8=%E2%9C%93&"), p.length > 0 ? y + p : "";
2652
- }, de = wn, Nr = Object.prototype.hasOwnProperty, Oo = Array.isArray, P = {
2653
- allowDots: !1,
2654
- allowPrototypes: !1,
2655
- allowSparse: !1,
2656
- arrayLimit: 20,
2657
- charset: "utf-8",
2658
- charsetSentinel: !1,
2659
- comma: !1,
2660
- decoder: de.decode,
2661
- delimiter: "&",
2662
- depth: 5,
2663
- ignoreQueryPrefix: !1,
2664
- interpretNumericEntities: !1,
2665
- parameterLimit: 1e3,
2666
- parseArrays: !0,
2667
- plainObjects: !1,
2668
- strictNullHandling: !1
2669
- }, Po = function(r) {
2670
- return r.replace(/&#(\d+);/g, function(e, t) {
2671
- return String.fromCharCode(parseInt(t, 10));
2672
- });
2673
- }, An = function(r, e) {
2674
- return r && typeof r == "string" && e.comma && r.indexOf(",") > -1 ? r.split(",") : r;
2675
- }, Io = "utf8=%26%2310003%3B", Ro = "utf8=%E2%9C%93", xo = function(e, t) {
2676
- var n = {}, a = t.ignoreQueryPrefix ? e.replace(/^\?/, "") : e, i = t.parameterLimit === 1 / 0 ? void 0 : t.parameterLimit, s = a.split(t.delimiter, i), l = -1, c, d = t.charset;
2677
- if (t.charsetSentinel)
2678
- for (c = 0; c < s.length; ++c)
2679
- s[c].indexOf("utf8=") === 0 && (s[c] === Ro ? d = "utf-8" : s[c] === Io && (d = "iso-8859-1"), l = c, c = s.length);
2680
- for (c = 0; c < s.length; ++c)
2681
- if (c !== l) {
2682
- var u = s[c], o = u.indexOf("]="), f = o === -1 ? u.indexOf("=") : o + 1, p, y;
2683
- f === -1 ? (p = t.decoder(u, P.decoder, d, "key"), y = t.strictNullHandling ? null : "") : (p = t.decoder(u.slice(0, f), P.decoder, d, "key"), y = de.maybeMap(
2684
- An(u.slice(f + 1), t),
2685
- function(v) {
2686
- return t.decoder(v, P.decoder, d, "value");
2687
- }
2688
- )), y && t.interpretNumericEntities && d === "iso-8859-1" && (y = Po(y)), u.indexOf("[]=") > -1 && (y = Oo(y) ? [y] : y), Nr.call(n, p) ? n[p] = de.combine(n[p], y) : n[p] = y;
2689
- }
2690
- return n;
2691
- }, Co = function(r, e, t, n) {
2692
- for (var a = n ? e : An(e, t), i = r.length - 1; i >= 0; --i) {
2693
- var s, l = r[i];
2694
- if (l === "[]" && t.parseArrays)
2695
- s = [].concat(a);
2696
- else {
2697
- s = t.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
2698
- var c = l.charAt(0) === "[" && l.charAt(l.length - 1) === "]" ? l.slice(1, -1) : l, d = parseInt(c, 10);
2699
- !t.parseArrays && c === "" ? s = { 0: a } : !isNaN(d) && l !== c && String(d) === c && d >= 0 && t.parseArrays && d <= t.arrayLimit ? (s = [], s[d] = a) : c !== "__proto__" && (s[c] = a);
2700
- }
2701
- a = s;
2702
- }
2703
- return a;
2704
- }, Fo = function(e, t, n, a) {
2705
- if (e) {
2706
- var i = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, s = /(\[[^[\]]*])/, l = /(\[[^[\]]*])/g, c = n.depth > 0 && s.exec(i), d = c ? i.slice(0, c.index) : i, u = [];
2707
- if (d) {
2708
- if (!n.plainObjects && Nr.call(Object.prototype, d) && !n.allowPrototypes)
2709
- return;
2710
- u.push(d);
2711
- }
2712
- for (var o = 0; n.depth > 0 && (c = l.exec(i)) !== null && o < n.depth; ) {
2713
- if (o += 1, !n.plainObjects && Nr.call(Object.prototype, c[1].slice(1, -1)) && !n.allowPrototypes)
2714
- return;
2715
- u.push(c[1]);
2716
- }
2717
- return c && u.push("[" + i.slice(c.index) + "]"), Co(u, t, n, a);
2718
- }
2719
- }, No = function(e) {
2720
- if (!e)
2721
- return P;
2722
- if (e.decoder !== null && e.decoder !== void 0 && typeof e.decoder != "function")
2723
- throw new TypeError("Decoder has to be a function.");
2724
- if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
2725
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
2726
- var t = typeof e.charset > "u" ? P.charset : e.charset;
2727
- return {
2728
- allowDots: typeof e.allowDots > "u" ? P.allowDots : !!e.allowDots,
2729
- allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : P.allowPrototypes,
2730
- allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : P.allowSparse,
2731
- arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : P.arrayLimit,
2732
- charset: t,
2733
- charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : P.charsetSentinel,
2734
- comma: typeof e.comma == "boolean" ? e.comma : P.comma,
2735
- decoder: typeof e.decoder == "function" ? e.decoder : P.decoder,
2736
- delimiter: typeof e.delimiter == "string" || de.isRegExp(e.delimiter) ? e.delimiter : P.delimiter,
2737
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2738
- depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : P.depth,
2739
- ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
2740
- interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : P.interpretNumericEntities,
2741
- parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : P.parameterLimit,
2742
- parseArrays: e.parseArrays !== !1,
2743
- plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : P.plainObjects,
2744
- strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : P.strictNullHandling
2745
- };
2746
- }, $o = function(r, e) {
2747
- var t = No(e);
2748
- if (r === "" || r === null || typeof r > "u")
2749
- return t.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
2750
- for (var n = typeof r == "string" ? xo(r, t) : r, a = t.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, i = Object.keys(n), s = 0; s < i.length; ++s) {
2751
- var l = i[s], c = Fo(l, n[l], t, typeof r == "string");
2752
- a = de.merge(a, c, t);
2753
- }
2754
- return t.allowSparse === !0 ? a : de.compact(a);
2755
- }, _o = Ao, Do = $o, ko = Gr, To = {
2756
- formats: ko,
2757
- parse: Do,
2758
- stringify: _o
2759
- };
2760
- class Bo {
2761
- constructor(e) {
2762
- this.client = e, this.list = () => this.client.get("/v1/packages"), this.client = e;
2763
- }
2764
- }
2765
- class Lo {
2766
- constructor(e) {
2767
- this.client = e, this.get = (t) => this.client.get(`/v1/insurance/${t}/balance`), this.client = e;
2768
- }
2769
- }
2770
- class Uo {
2771
- constructor(e) {
2772
- this.client = e, this.get = (t) => this.client.get(`/v1/labels/${t}`), this.list = (t = {}) => this.client.get("/v1/labels", { params: t }), this.createByRateId = (t, n) => this.client.post(`/v1/labels/rates/${t}`, n), this.void = (t) => this.client.put(`/v1/labels/${t}/void`), this.client = e;
2773
- }
2774
- }
2775
- class qo {
2776
- constructor(e) {
2777
- this.client = e, this.list = () => this.client.get("/v-beta/order_sources"), this.get = (t) => this.client.get(`/v-beta/order_sources/${t}`), this.refresh = (t) => this.client.put(`/v-beta/order_sources/${t}/refresh`), this.client = e;
2778
- }
2779
- }
2780
- class Mo {
2781
- constructor(e) {
2782
- this.client = e, this.calculateByShipmentId = (t, n) => this.client.post("/v1/rates", {
2783
- rateOptions: n,
2784
- shipmentId: t
2785
- }), this.client = e;
2786
- }
2787
- }
2788
- class zo {
2789
- constructor(e) {
2790
- this.client = e, this.list = (t = {}) => this.client.post("/v-beta/shipments/list", t), this.get = (t) => this.client.get(`/v-beta/shipments/${t}`), this.create = (t, n) => this.client.post(
2791
- `/v-beta/shipments/sales_order/${t}`,
2792
- n
2793
- ), this.update = (t, n) => this.client.put(`/v-beta/shipments/${t}`, n), this.client = e;
2794
- }
2795
326
  }
2796
- class jo {
2797
- constructor(e) {
2798
- this.client = e, this.list = (t = {}) => this.client.get("/v-beta/sales_orders", { params: t }), this.get = (t) => this.client.get(`/v-beta/sales_orders/${t}`), this.notifyShipped = (t, n) => this.client.post(`/v-beta/sales_orders/${t}/notify`, n), this.client = e;
2799
- }
2800
- }
2801
- class Wo {
2802
- constructor(e) {
2803
- this.client = e, this.list = () => this.client.get("/v1/warehouses"), this.create = (t) => this.client.post("/v1/warehouses", t), this.update = (t, n) => this.client.put(`/v1/warehouses/${t}`, n), this.delete = (t) => this.client.delete(`/v1/warehouses/${t}`), this.client = e;
2804
- }
2805
- }
2806
- const kt = un({
2807
- name: "shipengine-api",
2808
- serializers: {
2809
- ...Br,
2810
- req: (r) => ({
2811
- headers: r.headers,
2812
- method: r.method,
2813
- url: r.url
2814
- }),
2815
- res: (r) => ({
2816
- data: r.data,
2817
- headers: r.config.headers,
2818
- method: r.config.method,
2819
- statusCode: r.status,
2820
- url: r.config.url
2821
- })
2822
- },
2823
- streams: [
2824
- {
2825
- stream: new ln()
2826
- }
2827
- ]
2828
- }), Go = (r) => !!r.errors && an(r.errors);
2829
- class Tt {
2830
- constructor(e, { baseURL: t, headers: n, getToken: a }) {
2831
- const i = mr.create({
2832
- baseURL: t,
2833
- headers: {
2834
- ...n,
2835
- Authorization: `Bearer ${e}`,
2836
- "Content-Type": "application/json"
2837
- },
2838
- paramsSerializer: (s) => To.stringify(me.decamelizeKeys(s), { arrayFormat: "brackets" }),
2839
- transformRequest: [(s) => me.decamelizeKeys(s), (s) => JSON.stringify(s)],
2840
- transformResponse: [
2841
- (s) => {
2842
- if (s)
2843
- return JSON.parse(s);
2844
- },
2845
- (s) => me.camelizeKeys(s)
2846
- ]
2847
- });
2848
- i.interceptors.response.use(
2849
- (s) => (kt.info(
2850
- { req: s.config, res: s },
2851
- "%s %s: %s %s",
2852
- s.config.method?.toUpperCase(),
2853
- s.config.url,
2854
- s.status,
2855
- s.statusText
2856
- ), s),
2857
- async (s) => {
2858
- if (kt.error(
2859
- { err: s, req: s.config, res: s.response },
2860
- "%s %s: %s %s - %s",
2861
- s.config?.method?.toUpperCase(),
2862
- s.config?.url,
2863
- s.response?.status,
2864
- s.response?.statusText,
2865
- s.message
2866
- ), s.response?.status === 401) {
2867
- const l = await a(), c = s.config;
2868
- return c && (c.headers ||= {}, c.headers.Authorization = `Bearer ${l}`), mr(c);
2869
- }
2870
- return s.response?.data ? Go(s.response.data) ? Promise.reject(
2871
- s.response.data.errors.map((l) => W.fromObject(l))
2872
- ) : an(s.response.data) ? Promise.reject(s.response.data.map((l) => W.fromObject(l))) : on(s.response.data) ? Promise.reject([W.fromObject(s.response.data)]) : Promise.reject([new W(s.response.data)]) : Promise.reject([new W(s.message)]);
2873
- }
2874
- ), this.client = i;
2875
- }
2876
- set token(e) {
2877
- this.client.defaults.headers.common.Authorization = `Bearer ${e}`;
2878
- }
2879
- get accountSettings() {
2880
- return new _n(this.client);
2881
- }
2882
- get addresses() {
2883
- return new Dn(this.client);
2884
- }
2885
- get carriers() {
2886
- return new Ta(this.client);
2887
- }
2888
- get customPackages() {
2889
- return new Bo(this.client);
2890
- }
2891
- get insurance() {
2892
- return new Lo(this.client);
2893
- }
2894
- get labels() {
2895
- return new Uo(this.client);
2896
- }
2897
- get orderSources() {
2898
- return new qo(this.client);
2899
- }
2900
- get rates() {
2901
- return new Mo(this.client);
2902
- }
2903
- get salesOrderShipments() {
2904
- return new zo(this.client);
2905
- }
2906
- get salesOrders() {
2907
- return new jo(this.client);
2908
- }
2909
- get warehouses() {
2910
- return new Wo(this.client);
2911
- }
2912
- }
2913
- const On = Fn(void 0), Zo = ({ baseURL: r, children: e, headers: t, getToken: n }) => {
2914
- const [a, i] = Nn(() => {
2915
- const l = n();
2916
- if (typeof l == "string")
2917
- return new Tt(l, {
2918
- baseURL: r,
2919
- getToken: n,
2920
- headers: t ?? {}
2921
- });
2922
- l.then(
2923
- (c) => i(
2924
- new Tt(c, {
2925
- baseURL: r,
2926
- getToken: n,
2927
- headers: t ?? {}
2928
- })
2929
- )
2930
- );
2931
- }), s = new Rn();
2932
- return a ? /* @__PURE__ */ Ue(On.Provider, { value: { client: a }, children: /* @__PURE__ */ Ue(xn, { client: s, children: e }) }) : /* @__PURE__ */ Ue(
2933
- "div",
2934
- {
2935
- style: {
2936
- alignItems: "center",
2937
- display: "flex",
2938
- height: "100%",
2939
- justifyContent: "center",
2940
- width: "100%"
2941
- },
2942
- children: "Loading..."
2943
- }
2944
- );
2945
- }, E = () => {
2946
- const r = $n(On);
2947
- if (!r)
2948
- throw new Error("useShipEngine must be called within a ShipEngineProvider");
2949
- return r;
2950
- }, Ko = (r) => new Promise((e) => {
2951
- setTimeout(() => e(!0), r);
2952
- }), b = (r) => r.forEach(console.log), Pn = [];
2953
- process.env.NODE_ENV === "production" && Pn.push({
2954
- stream: new ln()
327
+ v.prototype.trace = S(10), v.prototype.debug = S(20), v.prototype.info = S(30), v.prototype.warn = S(40), v.prototype.error = S(50), v.prototype.fatal = S(60);
328
+ var P = { err: function(e) {
329
+ return e && e.stack ? { message: e.message, name: e.name, stack: _(e), code: e.code, signal: e.signal } : e;
330
+ } };
331
+ function Y() {
332
+ return A(v, [].slice.call(arguments));
333
+ }
334
+ var L = { levels: { trace: "color: DeepPink", debug: "color: GoldenRod", info: "color: DarkTurquoise", warn: "color: Purple", error: "color: Crimson", fatal: "color: Black" }, def: "color: DimGray", msg: "color: SteelBlue", src: "color: DimGray; font-style: italic; font-size: 0.9em" }, $ = /* @__PURE__ */ function() {
335
+ function e(r) {
336
+ var t = r === void 0 ? {} : r, s = t.logByLevel, i = t.css, n = i === void 0 ? L : i;
337
+ this.logByLevel = s !== void 0 && s, this.css = n;
338
+ }
339
+ return e.prototype.write = function(r) {
340
+ var t, s, i = this.css.def, n = this.css.msg, o = this.css.src, d = r.childName ? r.name + "/" + r.childName : r.name, a = z[r.level], f = (Array(6 - a.length).join(" ") + a).toUpperCase();
341
+ this.logByLevel ? (r.level === 10 ? a = "debug" : r.level === 60 && (a = "error"), s = typeof console[a] == "function" ? console[a] : console.log) : s = console.log, t = r.level < 20 ? this.css.levels.trace : r.level < 30 ? this.css.levels.debug : r.level < 40 ? this.css.levels.info : r.level < 50 ? this.css.levels.warn : r.level < 60 ? this.css.levels.error : this.css.levels.fatal;
342
+ var m = function(b, w) {
343
+ return Array(w + 1 - (b + "").length).join("0") + b;
344
+ }, u = [];
345
+ u.push("[%s:%s:%s:%s] %c%s%c: %s: %c%s " + (r.src ? "%c%s" : "")), u.push(m(r.time.getHours(), 2)), u.push(m(r.time.getMinutes(), 2)), u.push(m(r.time.getSeconds(), 2)), u.push(m(r.time.getMilliseconds(), 4)), u.push(t), u.push(f), u.push(i), u.push(d), u.push(n), u.push(r.msg), r.src && (u.push(o), u.push(r.src)), r.obj && (u.push(`
346
+ `), u.push(r.obj)), r.err && r.err.stack && (u.push(`
347
+ `), u.push(r.err.stack)), s.apply(console, u);
348
+ }, e.getDefaultCss = function() {
349
+ return L;
350
+ }, e;
351
+ }();
352
+ const N = [];
353
+ process.env.NODE_ENV === "production" && N.push({
354
+ stream: new $()
2955
355
  });
2956
- const es = un({
356
+ const ie = Y({
2957
357
  name: "shipengine",
2958
358
  serializers: {
2959
- ...Br,
2960
- req: (r) => ({
2961
- headers: r.headers,
2962
- method: r.method,
2963
- url: r.url
359
+ ...P,
360
+ req: (e) => ({
361
+ headers: e.headers,
362
+ method: e.method,
363
+ url: e.url
2964
364
  }),
2965
- res: (r) => ({
2966
- data: r.data,
2967
- headers: r.config.headers,
2968
- method: r.config.method,
2969
- statusCode: r.status,
2970
- url: r.config.url
365
+ res: (e) => ({
366
+ data: e.data,
367
+ headers: e.config.headers,
368
+ method: e.config.method,
369
+ statusCode: e.status,
370
+ url: e.config.url
2971
371
  })
2972
372
  },
2973
- streams: Pn
2974
- }), Ho = (r, e = 10, t = 1e3) => Promise.resolve().then(r).catch(function n(a) {
2975
- if (e -= 1, e > 0)
2976
- return Ko(t).then(r).catch(n);
2977
- throw a;
2978
- }), rs = (r) => {
2979
- const { client: e } = E();
2980
- return I({
2981
- mutationFn: async (t) => (await e.carriers.addFunds(r, t)).data,
373
+ streams: N
374
+ }), X = (e, r = 10, t = 1e3) => Promise.resolve().then(e).catch(function s(i) {
375
+ if (r -= 1, r > 0)
376
+ return V(t).then(e).catch(s);
377
+ throw i;
378
+ }), ae = (e) => {
379
+ const { client: r } = c();
380
+ return h({
381
+ mutationFn: async (t) => (await r.carriers.addFunds(e, t)).data,
2982
382
  mutationKey: ["useAddFunds"],
2983
- onError: b
383
+ onError: l
2984
384
  });
2985
- }, ts = () => {
2986
- const { client: r } = E();
2987
- return I({
2988
- mutationFn: async ({ rateOptions: e, shipmentId: t }) => (await r.rates.calculateByShipmentId(t, e)).data,
385
+ }, oe = () => {
386
+ const { client: e } = c();
387
+ return h({
388
+ mutationFn: async ({ rateOptions: r, shipmentId: t }) => (await e.rates.calculateByShipmentId(t, r)).data,
2989
389
  mutationKey: ["useCalculateRates"],
2990
- onError: b
390
+ onError: l
2991
391
  });
2992
- }, ns = () => {
2993
- const { client: r } = E();
2994
- return I({
2995
- mutationFn: async (e) => (await r.carriers.connect(e)).data,
392
+ }, ue = () => {
393
+ const { client: e } = c();
394
+ return h({
395
+ mutationFn: async (r) => (await e.carriers.connect(r)).data,
2996
396
  mutationKey: ["useConnectCarrier"],
2997
- onError: b
397
+ onError: l
2998
398
  });
2999
- }, as = () => {
3000
- const { client: r } = E();
3001
- return I({
3002
- mutationFn: async ({ rateId: e, ...t }) => (await r.labels.createByRateId(e, t)).data,
399
+ }, le = () => {
400
+ const { client: e } = c();
401
+ return h({
402
+ mutationFn: async ({ rateId: r, ...t }) => (await e.labels.createByRateId(r, t)).data,
3003
403
  mutationKey: ["useCreateLabel"],
3004
- onError: b
404
+ onError: l
3005
405
  });
3006
- }, is = () => {
3007
- const { client: r } = E();
3008
- return I({
3009
- mutationFn: async ({ salesOrderId: e, ...t }) => (await r.salesOrderShipments.create(e, t)).data,
406
+ }, ce = () => {
407
+ const { client: e } = c();
408
+ return h({
409
+ mutationFn: async ({ salesOrderId: r, ...t }) => (await e.salesOrderShipments.create(r, t)).data,
3010
410
  mutationKey: ["useCreateSalesOrderShipment"],
3011
- onError: b
411
+ onError: l
3012
412
  });
3013
- }, os = () => {
3014
- const { client: r } = E();
3015
- return I({
3016
- mutationFn: async (e) => (await r.warehouses.create(e)).data,
413
+ }, de = () => {
414
+ const { client: e } = c();
415
+ return h({
416
+ mutationFn: async (r) => (await e.warehouses.create(r)).data,
3017
417
  mutationKey: ["useCreateWarehouse"],
3018
- onError: b
418
+ onError: l
3019
419
  });
3020
- }, ss = () => {
3021
- const { client: r } = E();
3022
- return I({
3023
- mutationFn: async ({ warehouseId: e }) => (await r.warehouses.delete(e)).data,
420
+ }, fe = () => {
421
+ const { client: e } = c();
422
+ return h({
423
+ mutationFn: async ({ warehouseId: r }) => (await e.warehouses.delete(r)).data,
3024
424
  mutationKey: ["useDeleteWarehouse"],
3025
- onError: b
425
+ onError: l
3026
426
  });
3027
- }, us = () => {
3028
- const { client: r } = E();
3029
- return N({
3030
- onError: b,
3031
- queryFn: () => r.accountSettings.get(),
427
+ }, he = () => {
428
+ const { client: e } = c();
429
+ return y({
430
+ onError: l,
431
+ queryFn: () => e.accountSettings.get(),
3032
432
  queryKey: ["getAccountSettings"],
3033
- select: (e) => e.data
3034
- });
3035
- }, ls = (r) => {
3036
- const { client: e } = E();
3037
- return N({
3038
- enabled: r !== void 0,
3039
- onError: b,
3040
- queryFn: () => r ? e.carriers.getAutoFunding(r) : Promise.reject(new Error("carrierId is required.")),
3041
- queryKey: ["useGetAutoFundingConfiguration", r],
433
+ select: (r) => r.data
434
+ });
435
+ }, ye = (e) => {
436
+ const { client: r } = c();
437
+ return y({
438
+ enabled: e !== void 0,
439
+ onError: l,
440
+ queryFn: () => e ? r.carriers.getAutoFunding(e) : Promise.reject(new Error("carrierId is required.")),
441
+ queryKey: ["useGetAutoFundingConfiguration", e],
3042
442
  select: (t) => t.data
3043
443
  });
3044
- }, cs = (r) => {
3045
- const { client: e } = E();
3046
- return N({
3047
- enabled: !!r,
3048
- onError: b,
3049
- queryFn: () => r ? e.carriers.get(r) : Promise.reject(new Error("carrierId is require")),
3050
- queryKey: ["useGetCarrierById", r],
444
+ }, me = (e) => {
445
+ const { client: r } = c();
446
+ return y({
447
+ enabled: !!e,
448
+ onError: l,
449
+ queryFn: () => e ? r.carriers.get(e) : Promise.reject(new Error("carrierId is require")),
450
+ queryKey: ["useGetCarrierById", e],
3051
451
  select: (t) => t.data,
3052
452
  // Fresh for 5 minutes
3053
453
  staleTime: 5 * 60 * 1e3
3054
454
  });
3055
- }, fs = (r) => {
3056
- const { client: e } = E();
3057
- return N({
3058
- enabled: r !== void 0,
3059
- onError: b,
3060
- queryFn: () => r ? e.insurance.get(r) : Promise.reject(new Error("insuranceProvider is required")),
3061
- queryKey: ["useGetInsuranceAccount", r],
455
+ }, pe = (e) => {
456
+ const { client: r } = c();
457
+ return y({
458
+ enabled: e !== void 0,
459
+ onError: l,
460
+ queryFn: () => e ? r.insurance.get(e) : Promise.reject(new Error("insuranceProvider is required")),
461
+ queryKey: ["useGetInsuranceAccount", e],
3062
462
  select: (t) => t.data
3063
463
  });
3064
- }, ps = (r) => {
3065
- const { client: e } = E();
3066
- return N({
3067
- enabled: r !== void 0,
3068
- onError: b,
3069
- queryFn: () => r ? e.labels.get(r) : Promise.reject(new Error("labelId is require")),
3070
- queryKey: ["useGetLabel", r],
464
+ }, ve = (e) => {
465
+ const { client: r } = c();
466
+ return y({
467
+ enabled: e !== void 0,
468
+ onError: l,
469
+ queryFn: () => e ? r.labels.get(e) : Promise.reject(new Error("labelId is require")),
470
+ queryKey: ["useGetLabel", e],
3071
471
  select: (t) => t.data
3072
472
  });
3073
- }, ds = (r) => {
3074
- const { client: e } = E();
3075
- return N({
3076
- enabled: r !== void 0,
3077
- onError: b,
3078
- queryFn: () => r ? e.salesOrders.get(r) : Promise.reject(new Error("salesOrderId is required")),
3079
- queryKey: ["useGetSalesOrder", r],
473
+ }, ge = (e) => {
474
+ const { client: r } = c();
475
+ return y({
476
+ enabled: e !== void 0,
477
+ onError: l,
478
+ queryFn: () => e ? r.salesOrders.get(e) : Promise.reject(new Error("salesOrderId is required")),
479
+ queryKey: ["useGetSalesOrder", e],
3080
480
  select: (t) => t.data
3081
481
  });
3082
- }, hs = (r) => {
3083
- const { client: e } = E();
3084
- return N({
3085
- enabled: r !== void 0,
3086
- onError: b,
3087
- queryFn: () => r ? e.salesOrderShipments.get(r) : Promise.reject(new Error("shipmentId is required")),
3088
- queryKey: ["useGetSalesOrderShipment", r],
482
+ }, we = (e) => {
483
+ const { client: r } = c();
484
+ return y({
485
+ enabled: e !== void 0,
486
+ onError: l,
487
+ queryFn: () => e ? r.salesOrderShipments.get(e) : Promise.reject(new Error("shipmentId is required")),
488
+ queryKey: ["useGetSalesOrderShipment", e],
3089
489
  select: (t) => t.data
3090
490
  });
3091
- }, ys = (r) => {
3092
- const { client: e } = E();
3093
- return N({
3094
- enabled: r !== void 0,
3095
- onError: b,
3096
- queryFn: () => r ? e.salesOrderShipments.get(r) : Promise.reject(new Error("shipmentId is required")),
3097
- queryKey: ["useGetShipment", r],
491
+ }, Se = (e) => {
492
+ const { client: r } = c();
493
+ return y({
494
+ enabled: e !== void 0,
495
+ onError: l,
496
+ queryFn: () => e ? r.salesOrderShipments.get(e) : Promise.reject(new Error("shipmentId is required")),
497
+ queryKey: ["useGetShipment", e],
3098
498
  select: (t) => t.data
3099
499
  });
3100
- }, vs = () => ({
500
+ }, be = () => ({
3101
501
  links: {
3102
502
  transactionHistoryReport: "http://link.to.entire.dataset.as.csv"
3103
503
  },
@@ -3126,216 +526,194 @@ const es = un({
3126
526
  transactionType: "purchase"
3127
527
  }
3128
528
  ]
3129
- }), ms = () => {
3130
- const { client: r } = E();
3131
- return N({
3132
- onError: b,
3133
- queryFn: () => r.carriers.list(),
529
+ }), Oe = () => {
530
+ const { client: e } = c();
531
+ return y({
532
+ onError: l,
533
+ queryFn: () => e.carriers.list(),
3134
534
  queryKey: ["useListCarriers"],
3135
- select: (e) => e.data.carriers
535
+ select: (r) => r.data.carriers
3136
536
  });
3137
- }, gs = () => {
3138
- const { client: r } = E();
3139
- return N({
3140
- onError: b,
3141
- queryFn: () => r.customPackages.list(),
537
+ }, Ee = () => {
538
+ const { client: e } = c();
539
+ return y({
540
+ onError: l,
541
+ queryFn: () => e.customPackages.list(),
3142
542
  queryKey: ["useListCustomPackageTypes"],
3143
- select: (e) => e.data.packages
3144
- });
3145
- }, Ss = (r) => {
3146
- const { client: e } = E();
3147
- return N({
3148
- enabled: r && Object.values(r).some((t) => t !== void 0),
3149
- onError: b,
3150
- queryFn: () => e.labels.list(r),
3151
- queryKey: ["useListLabels", r],
543
+ select: (r) => r.data.packages
544
+ });
545
+ }, Fe = (e) => {
546
+ const { client: r } = c();
547
+ return y({
548
+ enabled: e && Object.values(e).some((t) => t !== void 0),
549
+ onError: l,
550
+ queryFn: () => r.labels.list(e),
551
+ queryKey: ["useListLabels", e],
3152
552
  select: (t) => t.data.labels
3153
553
  });
3154
- }, ws = () => {
3155
- const { client: r } = E();
3156
- return N({
3157
- onError: b,
3158
- queryFn: () => r.orderSources.list(),
554
+ }, je = () => {
555
+ const { client: e } = c();
556
+ return y({
557
+ onError: l,
558
+ queryFn: () => e.orderSources.list(),
3159
559
  queryKey: ["useListOrderSources"],
3160
- select: (e) => e.data.orderSources
3161
- });
3162
- }, bs = (r) => {
3163
- const { client: e } = E();
3164
- return N({
3165
- enabled: r && Object.values(r).some((t) => t !== void 0),
3166
- onError: b,
3167
- queryFn: () => e.salesOrderShipments.list(r),
3168
- queryKey: ["useListSalesOrderShipments", r],
560
+ select: (r) => r.data.orderSources
561
+ });
562
+ }, Ae = (e) => {
563
+ const { client: r } = c();
564
+ return y({
565
+ enabled: e && Object.values(e).some((t) => t !== void 0),
566
+ onError: l,
567
+ queryFn: () => r.salesOrderShipments.list(e),
568
+ queryKey: ["useListSalesOrderShipments", e],
3169
569
  select: (t) => t.data.shipments
3170
570
  });
3171
- }, Es = (r = {}) => {
3172
- const { client: e } = E();
3173
- return N({
3174
- enabled: r && Object.values(r).some((t) => t !== void 0),
3175
- onError: b,
3176
- queryFn: () => e.salesOrders.list(r),
3177
- queryKey: ["useListSalesOrders", r],
571
+ }, qe = (e = {}) => {
572
+ const { client: r } = c();
573
+ return y({
574
+ enabled: e && Object.values(e).some((t) => t !== void 0),
575
+ onError: l,
576
+ queryFn: () => r.salesOrders.list(e),
577
+ queryKey: ["useListSalesOrders", e],
3178
578
  select: (t) => t.data.salesOrders
3179
579
  });
3180
- }, As = () => {
3181
- const { client: r } = E();
3182
- return N({
3183
- onError: b,
3184
- queryFn: () => r.warehouses.list(),
580
+ }, Ce = () => {
581
+ const { client: e } = c();
582
+ return y({
583
+ onError: l,
584
+ queryFn: () => e.warehouses.list(),
3185
585
  queryKey: ["useListWarehouses"],
3186
- select: (e) => e.data.warehouses
586
+ select: (r) => r.data.warehouses
3187
587
  });
3188
- }, Os = () => {
3189
- const { client: r } = E();
3190
- return I({
3191
- mutationFn: async ({ salesOrderId: e, ...t }) => (await r.salesOrders.notifyShipped(e, t)).data,
588
+ }, ke = () => {
589
+ const { client: e } = c();
590
+ return h({
591
+ mutationFn: async ({ salesOrderId: r, ...t }) => (await e.salesOrders.notifyShipped(r, t)).data,
3192
592
  mutationKey: ["useNotifySalesOrder"],
3193
- onError: b
593
+ onError: l
3194
594
  });
3195
- }, Ps = () => {
3196
- const { client: r } = E();
3197
- return I({
3198
- mutationFn: async ({ address: e, text: t }) => (await r.addresses.parse(t, e)).data,
595
+ }, ze = () => {
596
+ const { client: e } = c();
597
+ return h({
598
+ mutationFn: async ({ address: r, text: t }) => (await e.addresses.parse(t, r)).data,
3199
599
  mutationKey: ["useParseAddress"],
3200
- onError: b
600
+ onError: l
3201
601
  });
3202
- }, Vo = () => {
3203
- const { client: r } = E();
3204
- return I({
3205
- mutationFn: async (e) => (await r.orderSources.refresh(e)).data,
602
+ }, Z = () => {
603
+ const { client: e } = c();
604
+ return h({
605
+ mutationFn: async (r) => (await e.orderSources.refresh(r)).data,
3206
606
  mutationKey: ["useRefreshOrderSourceAsync"]
3207
607
  });
3208
- }, Is = () => {
3209
- const { client: r } = E(), { mutateAsync: e } = Vo();
3210
- return I({
3211
- mutationFn: async (t) => (await e(t), await Ho(async () => {
3212
- const { data: a } = await r.orderSources.get(t);
3213
- if (["preparing_update", "updating"].includes(a.refreshInfo.status))
3214
- throw new W("Order source is still refreshing");
3215
- return a;
608
+ }, Ke = () => {
609
+ const { client: e } = c(), { mutateAsync: r } = Z();
610
+ return h({
611
+ mutationFn: async (t) => (await r(t), await X(async () => {
612
+ const { data: i } = await e.orderSources.get(t);
613
+ if (["preparing_update", "updating"].includes(i.refreshInfo.status))
614
+ throw new W.CodedError("Order source is still refreshing");
615
+ return i;
3216
616
  }, 20)),
3217
617
  mutationKey: ["useRefreshOrderSource"],
3218
- onError: b
618
+ onError: l
3219
619
  });
3220
- }, Rs = () => I({
3221
- mutationFn: async (r) => (await Promise.resolve({
620
+ }, Le = () => h({
621
+ mutationFn: async (e) => (await Promise.resolve({
3222
622
  data: { defaultLabelLayout: "4x6", dimension: "inch", weight: "ounce" },
3223
623
  errors: [],
3224
624
  isLoading: !1,
3225
625
  isValidating: !1
3226
626
  })).data,
3227
627
  mutationKey: ["useUpdateAccountSettings"],
3228
- onError: b
3229
- }), xs = (r) => {
3230
- const { client: e } = E(), t = Cn();
3231
- return I({
3232
- mutationFn: async (n) => (await e.carriers.updateAutoFunding(r, n)).data,
628
+ onError: l
629
+ }), Re = (e) => {
630
+ const { client: r } = c(), t = T();
631
+ return h({
632
+ mutationFn: async (s) => (await r.carriers.updateAutoFunding(e, s)).data,
3233
633
  mutationKey: ["useUpdateAutoFunding"],
3234
- onError: b,
3235
- onSuccess: (n) => {
3236
- t.invalidateQueries(["useGetAutoFunding", r], { exact: !0 });
634
+ onError: l,
635
+ onSuccess: (s) => {
636
+ t.invalidateQueries(["useGetAutoFunding", e], { exact: !0 });
3237
637
  }
3238
638
  });
3239
- }, Cs = () => I({
3240
- mutationFn: async (r) => (await Promise.resolve({
639
+ }, _e = () => h({
640
+ mutationFn: async (e) => (await Promise.resolve({
3241
641
  data: {},
3242
642
  errors: [],
3243
643
  isLoading: !1,
3244
644
  isValidating: !1
3245
645
  })).data,
3246
646
  mutationKey: ["useUpdateBilling"],
3247
- onError: b
3248
- }), Fs = () => {
3249
- const { client: r } = E();
3250
- return I({
3251
- mutationFn: async ({ shipmentId: e, ...t }) => (await r.salesOrderShipments.update(e, t)).data,
647
+ onError: l
648
+ }), Pe = () => {
649
+ const { client: e } = c();
650
+ return h({
651
+ mutationFn: async ({ shipmentId: r, ...t }) => (await e.salesOrderShipments.update(r, t)).data,
3252
652
  mutationKey: ["useUpdateSalesOrderShipment"],
3253
- onError: b
653
+ onError: l
3254
654
  });
3255
- }, Ns = () => {
3256
- const { client: r } = E();
3257
- return I({
3258
- mutationFn: async ({ warehouseId: e, ...t }) => (await r.warehouses.update(e, t)).data,
655
+ }, Ne = () => {
656
+ const { client: e } = c();
657
+ return h({
658
+ mutationFn: async ({ warehouseId: r, ...t }) => (await e.warehouses.update(r, t)).data,
3259
659
  mutationKey: ["useUpdateWarehouse"],
3260
- onError: b
660
+ onError: l
3261
661
  });
3262
- }, $s = () => {
3263
- const { client: r } = E();
3264
- return I({
3265
- mutationFn: async (e) => (await r.addresses.validate(e)).data,
662
+ }, Ge = () => {
663
+ const { client: e } = c();
664
+ return h({
665
+ mutationFn: async (r) => (await e.addresses.validate(r)).data,
3266
666
  mutationKey: ["useValidateAddresses"],
3267
- onError: b
667
+ onError: l
3268
668
  });
3269
- }, _s = () => {
3270
- const { client: r } = E();
3271
- return I({
3272
- mutationFn: async (e) => (await r.labels.void(e)).data,
669
+ }, xe = () => {
670
+ const { client: e } = c();
671
+ return h({
672
+ mutationFn: async (r) => (await e.labels.void(r)).data,
3273
673
  mutationKey: ["useVoidLabel"],
3274
- onError: b
674
+ onError: l
3275
675
  });
3276
676
  };
3277
677
  export {
3278
- _n as AccountSettingsAPI,
3279
- Dn as AddressesAPI,
3280
- Ta as CarriersAPI,
3281
- W as CodedError,
3282
- Ut as ConfirmationType,
3283
- Bt as CreditCardVendor,
3284
- Lt as Currency,
3285
- Bo as CustomPackagesAPI,
3286
- qt as CustomsContentsType,
3287
- Mt as CustomsNonDeliveryType,
3288
- Lo as InsuranceAPI,
3289
- zt as InsuranceProviderType,
3290
- Uo as LabelsAPI,
3291
- qo as OrderSourcesAPI,
3292
- Mo as RatesAPI,
3293
- Yo as SE,
3294
- zo as SalesOrderShipmentsAPI,
3295
- jo as SalesOrdersAPI,
3296
- Zo as ShipEngine,
3297
- Tt as ShipEngineAPI,
3298
- On as ShipEngineContext,
3299
- Wo as WarehousesAPI,
3300
- Ko as delay,
3301
- on as isCodedError,
3302
- an as isCodedErrors,
3303
- es as logger,
3304
- b as onError,
3305
- Ho as retryUntil,
3306
- rs as useAddFunds,
3307
- ts as useCalculateRates,
3308
- ns as useConnectCarrier,
3309
- as as useCreateLabel,
3310
- is as useCreateSalesOrderShipment,
3311
- os as useCreateWarehouse,
3312
- ss as useDeleteWarehouse,
3313
- us as useGetAccountSettings,
3314
- ls as useGetAutoFundingConfiguration,
3315
- cs as useGetCarrierById,
3316
- fs as useGetInsuranceAccount,
3317
- ps as useGetLabel,
3318
- ds as useGetSalesOrder,
3319
- hs as useGetSalesOrderShipment,
3320
- ys as useGetShipment,
3321
- vs as useGetWalletTransactionHistory,
3322
- ms as useListCarriers,
3323
- gs as useListCustomPackageTypes,
3324
- Ss as useListLabels,
3325
- ws as useListOrderSources,
3326
- bs as useListSalesOrderShipments,
3327
- Es as useListSalesOrders,
3328
- As as useListWarehouses,
3329
- Os as useNotifySalesOrderShipped,
3330
- Ps as useParseAddress,
3331
- Is as useRefreshOrderSource,
3332
- Vo as useRefreshOrderSourceAsync,
3333
- E as useShipEngine,
3334
- Rs as useUpdateAccountSettings,
3335
- xs as useUpdateAutoFunding,
3336
- Cs as useUpdateBilling,
3337
- Fs as useUpdateSalesOrderShipment,
3338
- Ns as useUpdateWarehouse,
3339
- $s as useValidateAddresses,
3340
- _s as useVoidLabel
678
+ ne as ShipEngine,
679
+ R as ShipEngineContext,
680
+ V as delay,
681
+ ie as logger,
682
+ l as onError,
683
+ X as retryUntil,
684
+ ae as useAddFunds,
685
+ oe as useCalculateRates,
686
+ ue as useConnectCarrier,
687
+ le as useCreateLabel,
688
+ ce as useCreateSalesOrderShipment,
689
+ de as useCreateWarehouse,
690
+ fe as useDeleteWarehouse,
691
+ he as useGetAccountSettings,
692
+ ye as useGetAutoFundingConfiguration,
693
+ me as useGetCarrierById,
694
+ pe as useGetInsuranceAccount,
695
+ ve as useGetLabel,
696
+ ge as useGetSalesOrder,
697
+ we as useGetSalesOrderShipment,
698
+ Se as useGetShipment,
699
+ be as useGetWalletTransactionHistory,
700
+ Oe as useListCarriers,
701
+ Ee as useListCustomPackageTypes,
702
+ Fe as useListLabels,
703
+ je as useListOrderSources,
704
+ Ae as useListSalesOrderShipments,
705
+ qe as useListSalesOrders,
706
+ Ce as useListWarehouses,
707
+ ke as useNotifySalesOrderShipped,
708
+ ze as useParseAddress,
709
+ Ke as useRefreshOrderSource,
710
+ Z as useRefreshOrderSourceAsync,
711
+ c as useShipEngine,
712
+ Le as useUpdateAccountSettings,
713
+ Re as useUpdateAutoFunding,
714
+ _e as useUpdateBilling,
715
+ Pe as useUpdateSalesOrderShipment,
716
+ Ne as useUpdateWarehouse,
717
+ Ge as useValidateAddresses,
718
+ xe as useVoidLabel
3341
719
  };