@ozdao/prometheus-framework 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-561d6db3.js +1 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-9e474158.mjs +1945 -0
  3. package/dist/ButtonFollow-38d9a720.mjs +131 -0
  4. package/dist/ButtonFollow-9a33ab06.js +1 -0
  5. package/dist/CardOrganization-3049931d.mjs +230 -0
  6. package/dist/CardOrganization-8b376cbb.js +1 -0
  7. package/dist/Chips-03ff0c34.mjs +108 -0
  8. package/dist/Chips-4d8ac62e.js +1 -0
  9. package/dist/Feed-1d0d9853.js +1 -0
  10. package/dist/Feed-79839e67.mjs +368 -0
  11. package/dist/Feed-af94027c.js +1 -0
  12. package/dist/Feed-b616f102.mjs +439 -0
  13. package/dist/Image-75f5becb.js +9 -0
  14. package/dist/Image-be69af9c.mjs +477 -0
  15. package/dist/Popup-d7dbc670.mjs +76 -0
  16. package/dist/Popup-ee4bd834.js +1 -0
  17. package/dist/Product-8bee8d1c.mjs +838 -0
  18. package/dist/Product-a39f3ca3.js +7 -0
  19. package/dist/ProductEdit-052b0aef.mjs +350 -0
  20. package/dist/ProductEdit-a322f1ba.js +1 -0
  21. package/dist/ProfileBlogposts-08f784c3.mjs +64 -0
  22. package/dist/ProfileBlogposts-d6bba033.js +1 -0
  23. package/dist/ProfileComments-96f6cde8.mjs +44 -0
  24. package/dist/ProfileComments-dd923865.js +1 -0
  25. package/dist/ProfileEvents-1e0c1291.js +1 -0
  26. package/dist/ProfileEvents-26a72fe2.mjs +56 -0
  27. package/dist/ProfileLikes-b1060d1e.js +1 -0
  28. package/dist/ProfileLikes-c8dab14d.mjs +44 -0
  29. package/dist/ProfileOrganizations-3a879480.mjs +212 -0
  30. package/dist/ProfileOrganizations-78fef72e.js +1 -0
  31. package/dist/Publics-8bb9a680.js +1 -0
  32. package/dist/Publics-ffc08ad7.mjs +123 -0
  33. package/dist/UploadImage-6344f789.js +1 -0
  34. package/dist/UploadImage-f04e4bc0.mjs +83 -0
  35. package/dist/auth-60c81f40.mjs +1836 -0
  36. package/dist/auth-e8f6d979.js +8 -0
  37. package/dist/auth.client.cjs +4 -4
  38. package/dist/auth.client.js +247 -236
  39. package/dist/auth.server.js +72 -11
  40. package/dist/auth.server.mjs +72 -11
  41. package/dist/auth.validation-1d5f2990.mjs +20 -0
  42. package/dist/auth.validation-2dfb450f.js +1 -0
  43. package/dist/community.client.cjs +1 -1
  44. package/dist/community.client.js +11 -11
  45. package/dist/events.client.cjs +1 -1
  46. package/dist/events.client.js +9 -9
  47. package/dist/organizations-4157d81d.js +1 -0
  48. package/dist/organizations-52438d24.mjs +121 -0
  49. package/dist/organizations.client-16ee6b43.js +3 -0
  50. package/dist/organizations.client-cdbaf6aa.mjs +3017 -0
  51. package/dist/organizations.client.cjs +1 -1
  52. package/dist/organizations.client.js +11 -11
  53. package/dist/users.client.cjs +1 -1
  54. package/dist/users.client.js +258 -239
  55. package/dist/users.server.js +7 -0
  56. package/dist/users.server.mjs +7 -0
  57. package/package.json +1 -1
  58. package/src/components/CardHeader/CardHeader.vue +2 -1
  59. package/src/modules/auth/components/pages/SignIn.vue +48 -39
  60. package/src/modules/auth/controllers/auth.controller.js +42 -11
  61. package/src/modules/auth/store/auth.js +3 -10
  62. package/src/modules/auth/utils/server/verifyAppleIdToken.js +57 -0
  63. package/src/modules/users/components/pages/Profile.vue +20 -6
  64. package/src/modules/users/components/pages/ProfileEdit.vue +15 -5
  65. package/src/modules/users/models/user.model.js +9 -1
  66. package/src/modules/users/store/users.js +2 -1
@@ -0,0 +1,1836 @@
1
+ import { ref as ae, openBlock as j, createElementBlock as D, Fragment as Kt, createElementVNode as w, normalizeClass as Gt, toDisplayString as qe, createCommentVNode as Q, createVNode as se, Transition as ie, withCtx as oe, withModifiers as Xt, renderSlot as Qt, createTextVNode as ne, reactive as Pt, watch as Ct } from "vue";
2
+ import { _ as Yt } from "./_plugin-vue_export-helper-dad06003.mjs";
3
+ import { s as J } from "./globals-96ba60e4.mjs";
4
+ const Zt = {
5
+ key: 0,
6
+ class: "t-transp mn-r-small"
7
+ }, er = { class: "w-100" }, tr = ["type", "value", "placeholder"], rr = ["value", "placeholder"], nr = {
8
+ key: 0,
9
+ class: "mn-t-thin mn-thin mn-b-thin invalid-feedback"
10
+ }, ar = {
11
+ __name: "Field",
12
+ props: {
13
+ label: null,
14
+ type: "text",
15
+ placeholder: "Enter something here",
16
+ field: null,
17
+ validation: !1,
18
+ disabled: !1
19
+ },
20
+ emits: ["update:field", "focus", "blur"],
21
+ setup(t, { emit: e }) {
22
+ const s = ae(t.field);
23
+ return (n, a) => (j(), D(Kt, null, [
24
+ w("div", {
25
+ class: Gt([[n.$attrs.class, { "bg-fourth-nano": t.validation }], "flex-center flex-nowrap flex"])
26
+ }, [
27
+ t.label ? (j(), D("div", Zt, [
28
+ w("span", null, qe(t.label), 1)
29
+ ])) : Q("", !0),
30
+ w("div", er, [
31
+ t.type !== "textarea" ? (j(), D("input", {
32
+ key: 0,
33
+ onInput: a[0] || (a[0] = (i) => s.value = e("update:field", i.target.value)),
34
+ onFocus: a[1] || (a[1] = (i) => e("focus", i)),
35
+ onBlur: a[2] || (a[2] = (i) => e("blur", i)),
36
+ type: t.type,
37
+ class: "w-100",
38
+ value: t.field,
39
+ placeholder: t.placeholder
40
+ }, null, 40, tr)) : (j(), D("textarea", {
41
+ key: 1,
42
+ onInput: a[3] || (a[3] = (i) => s.value = e("update:field", i.target.value)),
43
+ onFocus: a[4] || (a[4] = (i) => e("focus", i)),
44
+ onBlur: a[5] || (a[5] = (i) => e("blur", i)),
45
+ class: "w-100",
46
+ value: t.field,
47
+ placeholder: t.placeholder
48
+ }, null, 40, rr))
49
+ ])
50
+ ], 2),
51
+ se(ie, { name: "fade" }, {
52
+ default: oe(() => [
53
+ t.validation ? (j(), D("div", nr, " * " + qe(t.validation.message), 1)) : Q("", !0)
54
+ ]),
55
+ _: 1
56
+ })
57
+ ], 64));
58
+ }
59
+ }, Hn = /* @__PURE__ */ Yt(ar, [["__scopeId", "data-v-deecbd0c"]]);
60
+ const sr = ["onClick", "disabled"], ir = { key: 0 }, or = {
61
+ key: 0,
62
+ class: "loading"
63
+ }, ur = /* @__PURE__ */ w("span", null, [
64
+ /* @__PURE__ */ w("svg", {
65
+ class: "i-small",
66
+ width: "135",
67
+ height: "140",
68
+ viewBox: "0 0 135 140",
69
+ xmlns: "http://www.w3.org/2000/svg",
70
+ fill: "#fff"
71
+ }, [
72
+ /* @__PURE__ */ w("rect", {
73
+ y: "10",
74
+ width: "15",
75
+ height: "120",
76
+ rx: "6"
77
+ }, [
78
+ /* @__PURE__ */ w("animate", {
79
+ attributeName: "height",
80
+ begin: "0.5s",
81
+ dur: "1s",
82
+ values: "120;110;100;90;80;70;60;50;40;140;120",
83
+ calcMode: "linear",
84
+ repeatCount: "indefinite"
85
+ }),
86
+ /* @__PURE__ */ ne(),
87
+ /* @__PURE__ */ w("animate", {
88
+ attributeName: "y",
89
+ begin: "0.5s",
90
+ dur: "1s",
91
+ values: "10;15;20;25;30;35;40;45;50;0;10",
92
+ calcMode: "linear",
93
+ repeatCount: "indefinite"
94
+ })
95
+ ]),
96
+ /* @__PURE__ */ w("rect", {
97
+ x: "30",
98
+ y: "10",
99
+ width: "15",
100
+ height: "120",
101
+ rx: "6"
102
+ }, [
103
+ /* @__PURE__ */ w("animate", {
104
+ attributeName: "height",
105
+ begin: "0.25s",
106
+ dur: "1s",
107
+ values: "120;110;100;90;80;70;60;50;40;140;120",
108
+ calcMode: "linear",
109
+ repeatCount: "indefinite"
110
+ }),
111
+ /* @__PURE__ */ ne(),
112
+ /* @__PURE__ */ w("animate", {
113
+ attributeName: "y",
114
+ begin: "0.25s",
115
+ dur: "1s",
116
+ values: "10;15;20;25;30;35;40;45;50;0;10",
117
+ calcMode: "linear",
118
+ repeatCount: "indefinite"
119
+ })
120
+ ]),
121
+ /* @__PURE__ */ w("rect", {
122
+ x: "60",
123
+ width: "15",
124
+ height: "140",
125
+ rx: "6"
126
+ }, [
127
+ /* @__PURE__ */ w("animate", {
128
+ attributeName: "height",
129
+ begin: "0s",
130
+ dur: "1s",
131
+ values: "120;110;100;90;80;70;60;50;40;140;120",
132
+ calcMode: "linear",
133
+ repeatCount: "indefinite"
134
+ }),
135
+ /* @__PURE__ */ ne(),
136
+ /* @__PURE__ */ w("animate", {
137
+ attributeName: "y",
138
+ begin: "0s",
139
+ dur: "1s",
140
+ values: "10;15;20;25;30;35;40;45;50;0;10",
141
+ calcMode: "linear",
142
+ repeatCount: "indefinite"
143
+ })
144
+ ]),
145
+ /* @__PURE__ */ w("rect", {
146
+ x: "90",
147
+ y: "10",
148
+ width: "15",
149
+ height: "120",
150
+ rx: "6"
151
+ }, [
152
+ /* @__PURE__ */ w("animate", {
153
+ attributeName: "height",
154
+ begin: "0.25s",
155
+ dur: "1s",
156
+ values: "120;110;100;90;80;70;60;50;40;140;120",
157
+ calcMode: "linear",
158
+ repeatCount: "indefinite"
159
+ }),
160
+ /* @__PURE__ */ ne(),
161
+ /* @__PURE__ */ w("animate", {
162
+ attributeName: "y",
163
+ begin: "0.25s",
164
+ dur: "1s",
165
+ values: "10;15;20;25;30;35;40;45;50;0;10",
166
+ calcMode: "linear",
167
+ repeatCount: "indefinite"
168
+ })
169
+ ]),
170
+ /* @__PURE__ */ w("rect", {
171
+ x: "120",
172
+ y: "10",
173
+ width: "15",
174
+ height: "120",
175
+ rx: "6"
176
+ }, [
177
+ /* @__PURE__ */ w("animate", {
178
+ attributeName: "height",
179
+ begin: "0.5s",
180
+ dur: "1s",
181
+ values: "120;110;100;90;80;70;60;50;40;140;120",
182
+ calcMode: "linear",
183
+ repeatCount: "indefinite"
184
+ }),
185
+ /* @__PURE__ */ ne(),
186
+ /* @__PURE__ */ w("animate", {
187
+ attributeName: "y",
188
+ begin: "0.5s",
189
+ dur: "1s",
190
+ values: "10;15;20;25;30;35;40;45;50;0;10",
191
+ calcMode: "linear",
192
+ repeatCount: "indefinite"
193
+ })
194
+ ])
195
+ ])
196
+ ], -1), lr = [
197
+ ur
198
+ ], cr = {
199
+ key: 0,
200
+ class: "h4 loading"
201
+ }, dr = /* @__PURE__ */ w("span", { class: "p-small t-white" }, "✔", -1), fr = [
202
+ dr
203
+ ], pr = {
204
+ key: 0,
205
+ class: "error"
206
+ }, Wn = {
207
+ __name: "Button",
208
+ props: {
209
+ submit: {
210
+ type: Function,
211
+ default: async () => {
212
+ console.log("Button click.");
213
+ }
214
+ },
215
+ callback: {
216
+ type: Function,
217
+ default: async () => {
218
+ console.log("Button callback.");
219
+ }
220
+ },
221
+ callbackDelay: {
222
+ type: Number,
223
+ default: 750
224
+ },
225
+ validation: {
226
+ type: Boolean,
227
+ default: !1
228
+ }
229
+ },
230
+ setup(t) {
231
+ const e = t, r = ae(null), s = ae(null), n = ae(!1), a = ae(!1);
232
+ async function i() {
233
+ r.value.style["pointer-events"] = "none", s.value = null, n.value = !0;
234
+ try {
235
+ await e.submit(), r.value.classList.replace("bg-main", "bg-light-main"), n.value = !1, a.value = !0, setTimeout(() => {
236
+ r.value && (r.value.classList.replace("bg-light-main", "bg-main"), r.value.style.pointerEvents = "auto", n.value = !1, a.value = !1, s.value = null);
237
+ }, 500), e.callback && setTimeout(() => e.callback(), e.callbackDelay);
238
+ } catch {
239
+ r.value.classList.replace("bg-main", "bg-fourth-nano"), s.value = "❌", setTimeout(() => {
240
+ r.value.classList.replace("bg-fourth-nano", "bg-main"), r.value.style.pointerEvents = "auto", n.value = !1, a.value = !1, s.value = null;
241
+ }, 1330);
242
+ }
243
+ }
244
+ return (o, u) => (j(), D("button", {
245
+ onClick: Xt(i, ["stop"]),
246
+ disabled: t.validation,
247
+ ref_key: "button",
248
+ ref: r,
249
+ class: "w-100 bg-main button"
250
+ }, [
251
+ se(ie, {
252
+ mode: "out-in",
253
+ name: "fadeIn"
254
+ }, {
255
+ default: oe(() => [
256
+ !n.value && !s.value && !a.value ? (j(), D("span", ir, [
257
+ Qt(o.$slots, "default")
258
+ ])) : Q("", !0)
259
+ ]),
260
+ _: 3
261
+ }),
262
+ se(ie, {
263
+ mode: "out-in",
264
+ name: "fadeIn"
265
+ }, {
266
+ default: oe(() => [
267
+ n.value && !s.value ? (j(), D("div", or, lr)) : Q("", !0)
268
+ ]),
269
+ _: 1
270
+ }),
271
+ se(ie, {
272
+ mode: "out-in",
273
+ name: "fadeIn"
274
+ }, {
275
+ default: oe(() => [
276
+ a.value ? (j(), D("div", cr, fr)) : Q("", !0)
277
+ ]),
278
+ _: 1
279
+ }),
280
+ se(ie, {
281
+ mode: "out-in",
282
+ name: "fadeIn"
283
+ }, {
284
+ default: oe(() => [
285
+ s.value ? (j(), D("div", pr, [
286
+ w("span", null, qe(s.value), 1)
287
+ ])) : Q("", !0)
288
+ ]),
289
+ _: 1
290
+ })
291
+ ], 8, sr));
292
+ }
293
+ };
294
+ function Ot(t) {
295
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
296
+ }
297
+ var Me = { exports: {} }, Rt = function(e, r) {
298
+ return function() {
299
+ for (var n = new Array(arguments.length), a = 0; a < n.length; a++)
300
+ n[a] = arguments[a];
301
+ return e.apply(r, n);
302
+ };
303
+ }, hr = Rt, He = Object.prototype.toString, We = function(t) {
304
+ return function(e) {
305
+ var r = He.call(e);
306
+ return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
307
+ };
308
+ }(/* @__PURE__ */ Object.create(null));
309
+ function V(t) {
310
+ return t = t.toLowerCase(), function(r) {
311
+ return We(r) === t;
312
+ };
313
+ }
314
+ function Je(t) {
315
+ return Array.isArray(t);
316
+ }
317
+ function he(t) {
318
+ return typeof t > "u";
319
+ }
320
+ function mr(t) {
321
+ return t !== null && !he(t) && t.constructor !== null && !he(t.constructor) && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t);
322
+ }
323
+ var xt = V("ArrayBuffer");
324
+ function vr(t) {
325
+ var e;
326
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && xt(t.buffer), e;
327
+ }
328
+ function wr(t) {
329
+ return typeof t == "string";
330
+ }
331
+ function br(t) {
332
+ return typeof t == "number";
333
+ }
334
+ function _t(t) {
335
+ return t !== null && typeof t == "object";
336
+ }
337
+ function fe(t) {
338
+ if (We(t) !== "object")
339
+ return !1;
340
+ var e = Object.getPrototypeOf(t);
341
+ return e === null || e === Object.prototype;
342
+ }
343
+ var yr = V("Date"), gr = V("File"), Er = V("Blob"), Pr = V("FileList");
344
+ function Ve(t) {
345
+ return He.call(t) === "[object Function]";
346
+ }
347
+ function Cr(t) {
348
+ return _t(t) && Ve(t.pipe);
349
+ }
350
+ function Or(t) {
351
+ var e = "[object FormData]";
352
+ return t && (typeof FormData == "function" && t instanceof FormData || He.call(t) === e || Ve(t.toString) && t.toString() === e);
353
+ }
354
+ var Rr = V("URLSearchParams");
355
+ function xr(t) {
356
+ return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
357
+ }
358
+ function _r() {
359
+ return typeof navigator < "u" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS") ? !1 : typeof window < "u" && typeof document < "u";
360
+ }
361
+ function ze(t, e) {
362
+ if (!(t === null || typeof t > "u"))
363
+ if (typeof t != "object" && (t = [t]), Je(t))
364
+ for (var r = 0, s = t.length; r < s; r++)
365
+ e.call(null, t[r], r, t);
366
+ else
367
+ for (var n in t)
368
+ Object.prototype.hasOwnProperty.call(t, n) && e.call(null, t[n], n, t);
369
+ }
370
+ function Fe() {
371
+ var t = {};
372
+ function e(n, a) {
373
+ fe(t[a]) && fe(n) ? t[a] = Fe(t[a], n) : fe(n) ? t[a] = Fe({}, n) : Je(n) ? t[a] = n.slice() : t[a] = n;
374
+ }
375
+ for (var r = 0, s = arguments.length; r < s; r++)
376
+ ze(arguments[r], e);
377
+ return t;
378
+ }
379
+ function Sr(t, e, r) {
380
+ return ze(e, function(n, a) {
381
+ r && typeof n == "function" ? t[a] = hr(n, r) : t[a] = n;
382
+ }), t;
383
+ }
384
+ function Ar(t) {
385
+ return t.charCodeAt(0) === 65279 && (t = t.slice(1)), t;
386
+ }
387
+ function Lr(t, e, r, s) {
388
+ t.prototype = Object.create(e.prototype, s), t.prototype.constructor = t, r && Object.assign(t.prototype, r);
389
+ }
390
+ function Tr(t, e, r) {
391
+ var s, n, a, i = {};
392
+ e = e || {};
393
+ do {
394
+ for (s = Object.getOwnPropertyNames(t), n = s.length; n-- > 0; )
395
+ a = s[n], i[a] || (e[a] = t[a], i[a] = !0);
396
+ t = Object.getPrototypeOf(t);
397
+ } while (t && (!r || r(t, e)) && t !== Object.prototype);
398
+ return e;
399
+ }
400
+ function kr(t, e, r) {
401
+ t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length;
402
+ var s = t.indexOf(e, r);
403
+ return s !== -1 && s === r;
404
+ }
405
+ function Ur(t) {
406
+ if (!t)
407
+ return null;
408
+ var e = t.length;
409
+ if (he(e))
410
+ return null;
411
+ for (var r = new Array(e); e-- > 0; )
412
+ r[e] = t[e];
413
+ return r;
414
+ }
415
+ var Nr = function(t) {
416
+ return function(e) {
417
+ return t && e instanceof t;
418
+ };
419
+ }(typeof Uint8Array < "u" && Object.getPrototypeOf(Uint8Array)), E = {
420
+ isArray: Je,
421
+ isArrayBuffer: xt,
422
+ isBuffer: mr,
423
+ isFormData: Or,
424
+ isArrayBufferView: vr,
425
+ isString: wr,
426
+ isNumber: br,
427
+ isObject: _t,
428
+ isPlainObject: fe,
429
+ isUndefined: he,
430
+ isDate: yr,
431
+ isFile: gr,
432
+ isBlob: Er,
433
+ isFunction: Ve,
434
+ isStream: Cr,
435
+ isURLSearchParams: Rr,
436
+ isStandardBrowserEnv: _r,
437
+ forEach: ze,
438
+ merge: Fe,
439
+ extend: Sr,
440
+ trim: xr,
441
+ stripBOM: Ar,
442
+ inherits: Lr,
443
+ toFlatObject: Tr,
444
+ kindOf: We,
445
+ kindOfTest: V,
446
+ endsWith: kr,
447
+ toArray: Ur,
448
+ isTypedArray: Nr,
449
+ isFileList: Pr
450
+ }, G = E;
451
+ function Qe(t) {
452
+ return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
453
+ }
454
+ var St = function(e, r, s) {
455
+ if (!r)
456
+ return e;
457
+ var n;
458
+ if (s)
459
+ n = s(r);
460
+ else if (G.isURLSearchParams(r))
461
+ n = r.toString();
462
+ else {
463
+ var a = [];
464
+ G.forEach(r, function(u, c) {
465
+ u === null || typeof u > "u" || (G.isArray(u) ? c = c + "[]" : u = [u], G.forEach(u, function(d) {
466
+ G.isDate(d) ? d = d.toISOString() : G.isObject(d) && (d = JSON.stringify(d)), a.push(Qe(c) + "=" + Qe(d));
467
+ }));
468
+ }), n = a.join("&");
469
+ }
470
+ if (n) {
471
+ var i = e.indexOf("#");
472
+ i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + n;
473
+ }
474
+ return e;
475
+ }, jr = E;
476
+ function we() {
477
+ this.handlers = [];
478
+ }
479
+ we.prototype.use = function(e, r, s) {
480
+ return this.handlers.push({
481
+ fulfilled: e,
482
+ rejected: r,
483
+ synchronous: s ? s.synchronous : !1,
484
+ runWhen: s ? s.runWhen : null
485
+ }), this.handlers.length - 1;
486
+ };
487
+ we.prototype.eject = function(e) {
488
+ this.handlers[e] && (this.handlers[e] = null);
489
+ };
490
+ we.prototype.forEach = function(e) {
491
+ jr.forEach(this.handlers, function(s) {
492
+ s !== null && e(s);
493
+ });
494
+ };
495
+ var Dr = we, $r = E, Br = function(e, r) {
496
+ $r.forEach(e, function(n, a) {
497
+ a !== r && a.toUpperCase() === r.toUpperCase() && (e[r] = n, delete e[a]);
498
+ });
499
+ }, At = E;
500
+ function Y(t, e, r, s, n) {
501
+ Error.call(this), this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), s && (this.request = s), n && (this.response = n);
502
+ }
503
+ At.inherits(Y, Error, {
504
+ toJSON: function() {
505
+ return {
506
+ // Standard
507
+ message: this.message,
508
+ name: this.name,
509
+ // Microsoft
510
+ description: this.description,
511
+ number: this.number,
512
+ // Mozilla
513
+ fileName: this.fileName,
514
+ lineNumber: this.lineNumber,
515
+ columnNumber: this.columnNumber,
516
+ stack: this.stack,
517
+ // Axios
518
+ config: this.config,
519
+ code: this.code,
520
+ status: this.response && this.response.status ? this.response.status : null
521
+ };
522
+ }
523
+ });
524
+ var Lt = Y.prototype, Tt = {};
525
+ [
526
+ "ERR_BAD_OPTION_VALUE",
527
+ "ERR_BAD_OPTION",
528
+ "ECONNABORTED",
529
+ "ETIMEDOUT",
530
+ "ERR_NETWORK",
531
+ "ERR_FR_TOO_MANY_REDIRECTS",
532
+ "ERR_DEPRECATED",
533
+ "ERR_BAD_RESPONSE",
534
+ "ERR_BAD_REQUEST",
535
+ "ERR_CANCELED"
536
+ // eslint-disable-next-line func-names
537
+ ].forEach(function(t) {
538
+ Tt[t] = { value: t };
539
+ });
540
+ Object.defineProperties(Y, Tt);
541
+ Object.defineProperty(Lt, "isAxiosError", { value: !0 });
542
+ Y.from = function(t, e, r, s, n, a) {
543
+ var i = Object.create(Lt);
544
+ return At.toFlatObject(t, i, function(u) {
545
+ return u !== Error.prototype;
546
+ }), Y.call(i, t.message, e, r, s, n), i.name = t.name, a && Object.assign(i, a), i;
547
+ };
548
+ var te = Y, kt = {
549
+ silentJSONParsing: !0,
550
+ forcedJSONParsing: !0,
551
+ clarifyTimeoutError: !1
552
+ }, L = E;
553
+ function Ir(t, e) {
554
+ e = e || new FormData();
555
+ var r = [];
556
+ function s(a) {
557
+ return a === null ? "" : L.isDate(a) ? a.toISOString() : L.isArrayBuffer(a) || L.isTypedArray(a) ? typeof Blob == "function" ? new Blob([a]) : Buffer.from(a) : a;
558
+ }
559
+ function n(a, i) {
560
+ if (L.isPlainObject(a) || L.isArray(a)) {
561
+ if (r.indexOf(a) !== -1)
562
+ throw Error("Circular reference detected in " + i);
563
+ r.push(a), L.forEach(a, function(u, c) {
564
+ if (!L.isUndefined(u)) {
565
+ var f = i ? i + "." + c : c, d;
566
+ if (u && !i && typeof u == "object") {
567
+ if (L.endsWith(c, "{}"))
568
+ u = JSON.stringify(u);
569
+ else if (L.endsWith(c, "[]") && (d = L.toArray(u))) {
570
+ d.forEach(function(l) {
571
+ !L.isUndefined(l) && e.append(f, s(l));
572
+ });
573
+ return;
574
+ }
575
+ }
576
+ n(u, f);
577
+ }
578
+ }), r.pop();
579
+ } else
580
+ e.append(i, s(a));
581
+ }
582
+ return n(t), e;
583
+ }
584
+ var Ut = Ir, Ce, Ye;
585
+ function qr() {
586
+ if (Ye)
587
+ return Ce;
588
+ Ye = 1;
589
+ var t = te;
590
+ return Ce = function(r, s, n) {
591
+ var a = n.config.validateStatus;
592
+ !n.status || !a || a(n.status) ? r(n) : s(new t(
593
+ "Request failed with status code " + n.status,
594
+ [t.ERR_BAD_REQUEST, t.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
595
+ n.config,
596
+ n.request,
597
+ n
598
+ ));
599
+ }, Ce;
600
+ }
601
+ var Oe, Ze;
602
+ function Fr() {
603
+ if (Ze)
604
+ return Oe;
605
+ Ze = 1;
606
+ var t = E;
607
+ return Oe = t.isStandardBrowserEnv() ? (
608
+ // Standard browser envs support document.cookie
609
+ function() {
610
+ return {
611
+ write: function(s, n, a, i, o, u) {
612
+ var c = [];
613
+ c.push(s + "=" + encodeURIComponent(n)), t.isNumber(a) && c.push("expires=" + new Date(a).toGMTString()), t.isString(i) && c.push("path=" + i), t.isString(o) && c.push("domain=" + o), u === !0 && c.push("secure"), document.cookie = c.join("; ");
614
+ },
615
+ read: function(s) {
616
+ var n = document.cookie.match(new RegExp("(^|;\\s*)(" + s + ")=([^;]*)"));
617
+ return n ? decodeURIComponent(n[3]) : null;
618
+ },
619
+ remove: function(s) {
620
+ this.write(s, "", Date.now() - 864e5);
621
+ }
622
+ };
623
+ }()
624
+ ) : (
625
+ // Non standard browser env (web workers, react-native) lack needed support.
626
+ function() {
627
+ return {
628
+ write: function() {
629
+ },
630
+ read: function() {
631
+ return null;
632
+ },
633
+ remove: function() {
634
+ }
635
+ };
636
+ }()
637
+ ), Oe;
638
+ }
639
+ var Mr = function(e) {
640
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
641
+ }, Hr = function(e, r) {
642
+ return r ? e.replace(/\/+$/, "") + "/" + r.replace(/^\/+/, "") : e;
643
+ }, Wr = Mr, Jr = Hr, Nt = function(e, r) {
644
+ return e && !Wr(r) ? Jr(e, r) : r;
645
+ }, Re, et;
646
+ function Vr() {
647
+ if (et)
648
+ return Re;
649
+ et = 1;
650
+ var t = E, e = [
651
+ "age",
652
+ "authorization",
653
+ "content-length",
654
+ "content-type",
655
+ "etag",
656
+ "expires",
657
+ "from",
658
+ "host",
659
+ "if-modified-since",
660
+ "if-unmodified-since",
661
+ "last-modified",
662
+ "location",
663
+ "max-forwards",
664
+ "proxy-authorization",
665
+ "referer",
666
+ "retry-after",
667
+ "user-agent"
668
+ ];
669
+ return Re = function(s) {
670
+ var n = {}, a, i, o;
671
+ return s && t.forEach(s.split(`
672
+ `), function(c) {
673
+ if (o = c.indexOf(":"), a = t.trim(c.substr(0, o)).toLowerCase(), i = t.trim(c.substr(o + 1)), a) {
674
+ if (n[a] && e.indexOf(a) >= 0)
675
+ return;
676
+ a === "set-cookie" ? n[a] = (n[a] ? n[a] : []).concat([i]) : n[a] = n[a] ? n[a] + ", " + i : i;
677
+ }
678
+ }), n;
679
+ }, Re;
680
+ }
681
+ var xe, tt;
682
+ function zr() {
683
+ if (tt)
684
+ return xe;
685
+ tt = 1;
686
+ var t = E;
687
+ return xe = t.isStandardBrowserEnv() ? (
688
+ // Standard browser envs have full support of the APIs needed to test
689
+ // whether the request URL is of the same origin as current location.
690
+ function() {
691
+ var r = /(msie|trident)/i.test(navigator.userAgent), s = document.createElement("a"), n;
692
+ function a(i) {
693
+ var o = i;
694
+ return r && (s.setAttribute("href", o), o = s.href), s.setAttribute("href", o), {
695
+ href: s.href,
696
+ protocol: s.protocol ? s.protocol.replace(/:$/, "") : "",
697
+ host: s.host,
698
+ search: s.search ? s.search.replace(/^\?/, "") : "",
699
+ hash: s.hash ? s.hash.replace(/^#/, "") : "",
700
+ hostname: s.hostname,
701
+ port: s.port,
702
+ pathname: s.pathname.charAt(0) === "/" ? s.pathname : "/" + s.pathname
703
+ };
704
+ }
705
+ return n = a(window.location.href), function(o) {
706
+ var u = t.isString(o) ? a(o) : o;
707
+ return u.protocol === n.protocol && u.host === n.host;
708
+ };
709
+ }()
710
+ ) : (
711
+ // Non standard browser envs (web workers, react-native) lack needed support.
712
+ function() {
713
+ return function() {
714
+ return !0;
715
+ };
716
+ }()
717
+ ), xe;
718
+ }
719
+ var _e, rt;
720
+ function be() {
721
+ if (rt)
722
+ return _e;
723
+ rt = 1;
724
+ var t = te, e = E;
725
+ function r(s) {
726
+ t.call(this, s ?? "canceled", t.ERR_CANCELED), this.name = "CanceledError";
727
+ }
728
+ return e.inherits(r, t, {
729
+ __CANCEL__: !0
730
+ }), _e = r, _e;
731
+ }
732
+ var Se, nt;
733
+ function Kr() {
734
+ return nt || (nt = 1, Se = function(e) {
735
+ var r = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
736
+ return r && r[1] || "";
737
+ }), Se;
738
+ }
739
+ var Ae, at;
740
+ function st() {
741
+ if (at)
742
+ return Ae;
743
+ at = 1;
744
+ var t = E, e = qr(), r = Fr(), s = St, n = Nt, a = Vr(), i = zr(), o = kt, u = te, c = be(), f = Kr();
745
+ return Ae = function(l) {
746
+ return new Promise(function(_, y) {
747
+ var S = l.data, T = l.headers, W = l.responseType, I;
748
+ function z() {
749
+ l.cancelToken && l.cancelToken.unsubscribe(I), l.signal && l.signal.removeEventListener("abort", I);
750
+ }
751
+ t.isFormData(S) && t.isStandardBrowserEnv() && delete T["Content-Type"];
752
+ var p = new XMLHttpRequest();
753
+ if (l.auth) {
754
+ var Ee = l.auth.username || "", v = l.auth.password ? unescape(encodeURIComponent(l.auth.password)) : "";
755
+ T.Authorization = "Basic " + btoa(Ee + ":" + v);
756
+ }
757
+ var h = n(l.baseURL, l.url);
758
+ p.open(l.method.toUpperCase(), s(h, l.params, l.paramsSerializer), !0), p.timeout = l.timeout;
759
+ function $() {
760
+ if (p) {
761
+ var b = "getAllResponseHeaders" in p ? a(p.getAllResponseHeaders()) : null, q = !W || W === "text" || W === "json" ? p.responseText : p.response, B = {
762
+ data: q,
763
+ status: p.status,
764
+ statusText: p.statusText,
765
+ headers: b,
766
+ config: l,
767
+ request: p
768
+ };
769
+ e(function(K) {
770
+ _(K), z();
771
+ }, function(K) {
772
+ y(K), z();
773
+ }, B), p = null;
774
+ }
775
+ }
776
+ if ("onloadend" in p ? p.onloadend = $ : p.onreadystatechange = function() {
777
+ !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout($);
778
+ }, p.onabort = function() {
779
+ p && (y(new u("Request aborted", u.ECONNABORTED, l, p)), p = null);
780
+ }, p.onerror = function() {
781
+ y(new u("Network Error", u.ERR_NETWORK, l, p, p)), p = null;
782
+ }, p.ontimeout = function() {
783
+ var q = l.timeout ? "timeout of " + l.timeout + "ms exceeded" : "timeout exceeded", B = l.transitional || o;
784
+ l.timeoutErrorMessage && (q = l.timeoutErrorMessage), y(new u(
785
+ q,
786
+ B.clarifyTimeoutError ? u.ETIMEDOUT : u.ECONNABORTED,
787
+ l,
788
+ p
789
+ )), p = null;
790
+ }, t.isStandardBrowserEnv()) {
791
+ var k = (l.withCredentials || i(h)) && l.xsrfCookieName ? r.read(l.xsrfCookieName) : void 0;
792
+ k && (T[l.xsrfHeaderName] = k);
793
+ }
794
+ "setRequestHeader" in p && t.forEach(T, function(q, B) {
795
+ typeof S > "u" && B.toLowerCase() === "content-type" ? delete T[B] : p.setRequestHeader(B, q);
796
+ }), t.isUndefined(l.withCredentials) || (p.withCredentials = !!l.withCredentials), W && W !== "json" && (p.responseType = l.responseType), typeof l.onDownloadProgress == "function" && p.addEventListener("progress", l.onDownloadProgress), typeof l.onUploadProgress == "function" && p.upload && p.upload.addEventListener("progress", l.onUploadProgress), (l.cancelToken || l.signal) && (I = function(b) {
797
+ p && (y(!b || b && b.type ? new c() : b), p.abort(), p = null);
798
+ }, l.cancelToken && l.cancelToken.subscribe(I), l.signal && (l.signal.aborted ? I() : l.signal.addEventListener("abort", I))), S || (S = null);
799
+ var U = f(h);
800
+ if (U && ["http", "https", "file"].indexOf(U) === -1) {
801
+ y(new u("Unsupported protocol " + U + ":", u.ERR_BAD_REQUEST, l));
802
+ return;
803
+ }
804
+ p.send(S);
805
+ });
806
+ }, Ae;
807
+ }
808
+ var Le, it;
809
+ function Gr() {
810
+ return it || (it = 1, Le = null), Le;
811
+ }
812
+ var g = E, ot = Br, ut = te, Xr = kt, Qr = Ut, Yr = {
813
+ "Content-Type": "application/x-www-form-urlencoded"
814
+ };
815
+ function lt(t, e) {
816
+ !g.isUndefined(t) && g.isUndefined(t["Content-Type"]) && (t["Content-Type"] = e);
817
+ }
818
+ function Zr() {
819
+ var t;
820
+ return (typeof XMLHttpRequest < "u" || typeof process < "u" && Object.prototype.toString.call(process) === "[object process]") && (t = st()), t;
821
+ }
822
+ function en(t, e, r) {
823
+ if (g.isString(t))
824
+ try {
825
+ return (e || JSON.parse)(t), g.trim(t);
826
+ } catch (s) {
827
+ if (s.name !== "SyntaxError")
828
+ throw s;
829
+ }
830
+ return (r || JSON.stringify)(t);
831
+ }
832
+ var ye = {
833
+ transitional: Xr,
834
+ adapter: Zr(),
835
+ transformRequest: [function(e, r) {
836
+ if (ot(r, "Accept"), ot(r, "Content-Type"), g.isFormData(e) || g.isArrayBuffer(e) || g.isBuffer(e) || g.isStream(e) || g.isFile(e) || g.isBlob(e))
837
+ return e;
838
+ if (g.isArrayBufferView(e))
839
+ return e.buffer;
840
+ if (g.isURLSearchParams(e))
841
+ return lt(r, "application/x-www-form-urlencoded;charset=utf-8"), e.toString();
842
+ var s = g.isObject(e), n = r && r["Content-Type"], a;
843
+ if ((a = g.isFileList(e)) || s && n === "multipart/form-data") {
844
+ var i = this.env && this.env.FormData;
845
+ return Qr(a ? { "files[]": e } : e, i && new i());
846
+ } else if (s || n === "application/json")
847
+ return lt(r, "application/json"), en(e);
848
+ return e;
849
+ }],
850
+ transformResponse: [function(e) {
851
+ var r = this.transitional || ye.transitional, s = r && r.silentJSONParsing, n = r && r.forcedJSONParsing, a = !s && this.responseType === "json";
852
+ if (a || n && g.isString(e) && e.length)
853
+ try {
854
+ return JSON.parse(e);
855
+ } catch (i) {
856
+ if (a)
857
+ throw i.name === "SyntaxError" ? ut.from(i, ut.ERR_BAD_RESPONSE, this, null, this.response) : i;
858
+ }
859
+ return e;
860
+ }],
861
+ /**
862
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
863
+ * timeout is not created.
864
+ */
865
+ timeout: 0,
866
+ xsrfCookieName: "XSRF-TOKEN",
867
+ xsrfHeaderName: "X-XSRF-TOKEN",
868
+ maxContentLength: -1,
869
+ maxBodyLength: -1,
870
+ env: {
871
+ FormData: Gr()
872
+ },
873
+ validateStatus: function(e) {
874
+ return e >= 200 && e < 300;
875
+ },
876
+ headers: {
877
+ common: {
878
+ Accept: "application/json, text/plain, */*"
879
+ }
880
+ }
881
+ };
882
+ g.forEach(["delete", "get", "head"], function(e) {
883
+ ye.headers[e] = {};
884
+ });
885
+ g.forEach(["post", "put", "patch"], function(e) {
886
+ ye.headers[e] = g.merge(Yr);
887
+ });
888
+ var Ke = ye, tn = E, rn = Ke, nn = function(e, r, s) {
889
+ var n = this || rn;
890
+ return tn.forEach(s, function(i) {
891
+ e = i.call(n, e, r);
892
+ }), e;
893
+ }, Te, ct;
894
+ function jt() {
895
+ return ct || (ct = 1, Te = function(e) {
896
+ return !!(e && e.__CANCEL__);
897
+ }), Te;
898
+ }
899
+ var dt = E, ke = nn, an = jt(), sn = Ke, on = be();
900
+ function Ue(t) {
901
+ if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
902
+ throw new on();
903
+ }
904
+ var un = function(e) {
905
+ Ue(e), e.headers = e.headers || {}, e.data = ke.call(
906
+ e,
907
+ e.data,
908
+ e.headers,
909
+ e.transformRequest
910
+ ), e.headers = dt.merge(
911
+ e.headers.common || {},
912
+ e.headers[e.method] || {},
913
+ e.headers
914
+ ), dt.forEach(
915
+ ["delete", "get", "head", "post", "put", "patch", "common"],
916
+ function(n) {
917
+ delete e.headers[n];
918
+ }
919
+ );
920
+ var r = e.adapter || sn.adapter;
921
+ return r(e).then(function(n) {
922
+ return Ue(e), n.data = ke.call(
923
+ e,
924
+ n.data,
925
+ n.headers,
926
+ e.transformResponse
927
+ ), n;
928
+ }, function(n) {
929
+ return an(n) || (Ue(e), n && n.response && (n.response.data = ke.call(
930
+ e,
931
+ n.response.data,
932
+ n.response.headers,
933
+ e.transformResponse
934
+ ))), Promise.reject(n);
935
+ });
936
+ }, x = E, Dt = function(e, r) {
937
+ r = r || {};
938
+ var s = {};
939
+ function n(f, d) {
940
+ return x.isPlainObject(f) && x.isPlainObject(d) ? x.merge(f, d) : x.isPlainObject(d) ? x.merge({}, d) : x.isArray(d) ? d.slice() : d;
941
+ }
942
+ function a(f) {
943
+ if (x.isUndefined(r[f])) {
944
+ if (!x.isUndefined(e[f]))
945
+ return n(void 0, e[f]);
946
+ } else
947
+ return n(e[f], r[f]);
948
+ }
949
+ function i(f) {
950
+ if (!x.isUndefined(r[f]))
951
+ return n(void 0, r[f]);
952
+ }
953
+ function o(f) {
954
+ if (x.isUndefined(r[f])) {
955
+ if (!x.isUndefined(e[f]))
956
+ return n(void 0, e[f]);
957
+ } else
958
+ return n(void 0, r[f]);
959
+ }
960
+ function u(f) {
961
+ if (f in r)
962
+ return n(e[f], r[f]);
963
+ if (f in e)
964
+ return n(void 0, e[f]);
965
+ }
966
+ var c = {
967
+ url: i,
968
+ method: i,
969
+ data: i,
970
+ baseURL: o,
971
+ transformRequest: o,
972
+ transformResponse: o,
973
+ paramsSerializer: o,
974
+ timeout: o,
975
+ timeoutMessage: o,
976
+ withCredentials: o,
977
+ adapter: o,
978
+ responseType: o,
979
+ xsrfCookieName: o,
980
+ xsrfHeaderName: o,
981
+ onUploadProgress: o,
982
+ onDownloadProgress: o,
983
+ decompress: o,
984
+ maxContentLength: o,
985
+ maxBodyLength: o,
986
+ beforeRedirect: o,
987
+ transport: o,
988
+ httpAgent: o,
989
+ httpsAgent: o,
990
+ cancelToken: o,
991
+ socketPath: o,
992
+ responseEncoding: o,
993
+ validateStatus: u
994
+ };
995
+ return x.forEach(Object.keys(e).concat(Object.keys(r)), function(d) {
996
+ var l = c[d] || a, m = l(d);
997
+ x.isUndefined(m) && l !== u || (s[d] = m);
998
+ }), s;
999
+ }, Ne, ft;
1000
+ function $t() {
1001
+ return ft || (ft = 1, Ne = {
1002
+ version: "0.27.2"
1003
+ }), Ne;
1004
+ }
1005
+ var ln = $t().version, H = te, Ge = {};
1006
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(t, e) {
1007
+ Ge[t] = function(s) {
1008
+ return typeof s === t || "a" + (e < 1 ? "n " : " ") + t;
1009
+ };
1010
+ });
1011
+ var pt = {};
1012
+ Ge.transitional = function(e, r, s) {
1013
+ function n(a, i) {
1014
+ return "[Axios v" + ln + "] Transitional option '" + a + "'" + i + (s ? ". " + s : "");
1015
+ }
1016
+ return function(a, i, o) {
1017
+ if (e === !1)
1018
+ throw new H(
1019
+ n(i, " has been removed" + (r ? " in " + r : "")),
1020
+ H.ERR_DEPRECATED
1021
+ );
1022
+ return r && !pt[i] && (pt[i] = !0, console.warn(
1023
+ n(
1024
+ i,
1025
+ " has been deprecated since v" + r + " and will be removed in the near future"
1026
+ )
1027
+ )), e ? e(a, i, o) : !0;
1028
+ };
1029
+ };
1030
+ function cn(t, e, r) {
1031
+ if (typeof t != "object")
1032
+ throw new H("options must be an object", H.ERR_BAD_OPTION_VALUE);
1033
+ for (var s = Object.keys(t), n = s.length; n-- > 0; ) {
1034
+ var a = s[n], i = e[a];
1035
+ if (i) {
1036
+ var o = t[a], u = o === void 0 || i(o, a, t);
1037
+ if (u !== !0)
1038
+ throw new H("option " + a + " must be " + u, H.ERR_BAD_OPTION_VALUE);
1039
+ continue;
1040
+ }
1041
+ if (r !== !0)
1042
+ throw new H("Unknown option " + a, H.ERR_BAD_OPTION);
1043
+ }
1044
+ }
1045
+ var dn = {
1046
+ assertOptions: cn,
1047
+ validators: Ge
1048
+ }, Bt = E, fn = St, ht = Dr, mt = un, ge = Dt, pn = Nt, It = dn, X = It.validators;
1049
+ function Z(t) {
1050
+ this.defaults = t, this.interceptors = {
1051
+ request: new ht(),
1052
+ response: new ht()
1053
+ };
1054
+ }
1055
+ Z.prototype.request = function(e, r) {
1056
+ typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = ge(this.defaults, r), r.method ? r.method = r.method.toLowerCase() : this.defaults.method ? r.method = this.defaults.method.toLowerCase() : r.method = "get";
1057
+ var s = r.transitional;
1058
+ s !== void 0 && It.assertOptions(s, {
1059
+ silentJSONParsing: X.transitional(X.boolean),
1060
+ forcedJSONParsing: X.transitional(X.boolean),
1061
+ clarifyTimeoutError: X.transitional(X.boolean)
1062
+ }, !1);
1063
+ var n = [], a = !0;
1064
+ this.interceptors.request.forEach(function(m) {
1065
+ typeof m.runWhen == "function" && m.runWhen(r) === !1 || (a = a && m.synchronous, n.unshift(m.fulfilled, m.rejected));
1066
+ });
1067
+ var i = [];
1068
+ this.interceptors.response.forEach(function(m) {
1069
+ i.push(m.fulfilled, m.rejected);
1070
+ });
1071
+ var o;
1072
+ if (!a) {
1073
+ var u = [mt, void 0];
1074
+ for (Array.prototype.unshift.apply(u, n), u = u.concat(i), o = Promise.resolve(r); u.length; )
1075
+ o = o.then(u.shift(), u.shift());
1076
+ return o;
1077
+ }
1078
+ for (var c = r; n.length; ) {
1079
+ var f = n.shift(), d = n.shift();
1080
+ try {
1081
+ c = f(c);
1082
+ } catch (l) {
1083
+ d(l);
1084
+ break;
1085
+ }
1086
+ }
1087
+ try {
1088
+ o = mt(c);
1089
+ } catch (l) {
1090
+ return Promise.reject(l);
1091
+ }
1092
+ for (; i.length; )
1093
+ o = o.then(i.shift(), i.shift());
1094
+ return o;
1095
+ };
1096
+ Z.prototype.getUri = function(e) {
1097
+ e = ge(this.defaults, e);
1098
+ var r = pn(e.baseURL, e.url);
1099
+ return fn(r, e.params, e.paramsSerializer);
1100
+ };
1101
+ Bt.forEach(["delete", "get", "head", "options"], function(e) {
1102
+ Z.prototype[e] = function(r, s) {
1103
+ return this.request(ge(s || {}, {
1104
+ method: e,
1105
+ url: r,
1106
+ data: (s || {}).data
1107
+ }));
1108
+ };
1109
+ });
1110
+ Bt.forEach(["post", "put", "patch"], function(e) {
1111
+ function r(s) {
1112
+ return function(a, i, o) {
1113
+ return this.request(ge(o || {}, {
1114
+ method: e,
1115
+ headers: s ? {
1116
+ "Content-Type": "multipart/form-data"
1117
+ } : {},
1118
+ url: a,
1119
+ data: i
1120
+ }));
1121
+ };
1122
+ }
1123
+ Z.prototype[e] = r(), Z.prototype[e + "Form"] = r(!0);
1124
+ });
1125
+ var hn = Z, je, vt;
1126
+ function mn() {
1127
+ if (vt)
1128
+ return je;
1129
+ vt = 1;
1130
+ var t = be();
1131
+ function e(r) {
1132
+ if (typeof r != "function")
1133
+ throw new TypeError("executor must be a function.");
1134
+ var s;
1135
+ this.promise = new Promise(function(i) {
1136
+ s = i;
1137
+ });
1138
+ var n = this;
1139
+ this.promise.then(function(a) {
1140
+ if (n._listeners) {
1141
+ var i, o = n._listeners.length;
1142
+ for (i = 0; i < o; i++)
1143
+ n._listeners[i](a);
1144
+ n._listeners = null;
1145
+ }
1146
+ }), this.promise.then = function(a) {
1147
+ var i, o = new Promise(function(u) {
1148
+ n.subscribe(u), i = u;
1149
+ }).then(a);
1150
+ return o.cancel = function() {
1151
+ n.unsubscribe(i);
1152
+ }, o;
1153
+ }, r(function(i) {
1154
+ n.reason || (n.reason = new t(i), s(n.reason));
1155
+ });
1156
+ }
1157
+ return e.prototype.throwIfRequested = function() {
1158
+ if (this.reason)
1159
+ throw this.reason;
1160
+ }, e.prototype.subscribe = function(s) {
1161
+ if (this.reason) {
1162
+ s(this.reason);
1163
+ return;
1164
+ }
1165
+ this._listeners ? this._listeners.push(s) : this._listeners = [s];
1166
+ }, e.prototype.unsubscribe = function(s) {
1167
+ if (this._listeners) {
1168
+ var n = this._listeners.indexOf(s);
1169
+ n !== -1 && this._listeners.splice(n, 1);
1170
+ }
1171
+ }, e.source = function() {
1172
+ var s, n = new e(function(i) {
1173
+ s = i;
1174
+ });
1175
+ return {
1176
+ token: n,
1177
+ cancel: s
1178
+ };
1179
+ }, je = e, je;
1180
+ }
1181
+ var De, wt;
1182
+ function vn() {
1183
+ return wt || (wt = 1, De = function(e) {
1184
+ return function(s) {
1185
+ return e.apply(null, s);
1186
+ };
1187
+ }), De;
1188
+ }
1189
+ var $e, bt;
1190
+ function wn() {
1191
+ if (bt)
1192
+ return $e;
1193
+ bt = 1;
1194
+ var t = E;
1195
+ return $e = function(r) {
1196
+ return t.isObject(r) && r.isAxiosError === !0;
1197
+ }, $e;
1198
+ }
1199
+ var yt = E, bn = Rt, pe = hn, yn = Dt, gn = Ke;
1200
+ function qt(t) {
1201
+ var e = new pe(t), r = bn(pe.prototype.request, e);
1202
+ return yt.extend(r, pe.prototype, e), yt.extend(r, e), r.create = function(n) {
1203
+ return qt(yn(t, n));
1204
+ }, r;
1205
+ }
1206
+ var R = qt(gn);
1207
+ R.Axios = pe;
1208
+ R.CanceledError = be();
1209
+ R.CancelToken = mn();
1210
+ R.isCancel = jt();
1211
+ R.VERSION = $t().version;
1212
+ R.toFormData = Ut;
1213
+ R.AxiosError = te;
1214
+ R.Cancel = R.CanceledError;
1215
+ R.all = function(e) {
1216
+ return Promise.all(e);
1217
+ };
1218
+ R.spread = vn();
1219
+ R.isAxiosError = wn();
1220
+ Me.exports = R;
1221
+ Me.exports.default = R;
1222
+ var En = Me.exports, Pn = En;
1223
+ const Ft = /* @__PURE__ */ Ot(Pn);
1224
+ var Mt = { exports: {} };
1225
+ /*!
1226
+ * JavaScript Cookie v2.2.1
1227
+ * https://github.com/js-cookie/js-cookie
1228
+ *
1229
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
1230
+ * Released under the MIT license
1231
+ */
1232
+ (function(t, e) {
1233
+ (function(r) {
1234
+ var s;
1235
+ if (t.exports = r(), s = !0, !s) {
1236
+ var n = window.Cookies, a = window.Cookies = r();
1237
+ a.noConflict = function() {
1238
+ return window.Cookies = n, a;
1239
+ };
1240
+ }
1241
+ })(function() {
1242
+ function r() {
1243
+ for (var a = 0, i = {}; a < arguments.length; a++) {
1244
+ var o = arguments[a];
1245
+ for (var u in o)
1246
+ i[u] = o[u];
1247
+ }
1248
+ return i;
1249
+ }
1250
+ function s(a) {
1251
+ return a.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
1252
+ }
1253
+ function n(a) {
1254
+ function i() {
1255
+ }
1256
+ function o(c, f, d) {
1257
+ if (!(typeof document > "u")) {
1258
+ d = r({
1259
+ path: "/"
1260
+ }, i.defaults, d), typeof d.expires == "number" && (d.expires = new Date(/* @__PURE__ */ new Date() * 1 + d.expires * 864e5)), d.expires = d.expires ? d.expires.toUTCString() : "";
1261
+ try {
1262
+ var l = JSON.stringify(f);
1263
+ /^[\{\[]/.test(l) && (f = l);
1264
+ } catch {
1265
+ }
1266
+ f = a.write ? a.write(f, c) : encodeURIComponent(String(f)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), c = encodeURIComponent(String(c)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
1267
+ var m = "";
1268
+ for (var _ in d)
1269
+ d[_] && (m += "; " + _, d[_] !== !0 && (m += "=" + d[_].split(";")[0]));
1270
+ return document.cookie = c + "=" + f + m;
1271
+ }
1272
+ }
1273
+ function u(c, f) {
1274
+ if (!(typeof document > "u")) {
1275
+ for (var d = {}, l = document.cookie ? document.cookie.split("; ") : [], m = 0; m < l.length; m++) {
1276
+ var _ = l[m].split("="), y = _.slice(1).join("=");
1277
+ !f && y.charAt(0) === '"' && (y = y.slice(1, -1));
1278
+ try {
1279
+ var S = s(_[0]);
1280
+ if (y = (a.read || a)(y, S) || s(y), f)
1281
+ try {
1282
+ y = JSON.parse(y);
1283
+ } catch {
1284
+ }
1285
+ if (d[S] = y, c === S)
1286
+ break;
1287
+ } catch {
1288
+ }
1289
+ }
1290
+ return c ? d[c] : d;
1291
+ }
1292
+ }
1293
+ return i.set = o, i.get = function(c) {
1294
+ return u(
1295
+ c,
1296
+ !1
1297
+ /* read as raw */
1298
+ );
1299
+ }, i.getJSON = function(c) {
1300
+ return u(
1301
+ c,
1302
+ !0
1303
+ /* read as json */
1304
+ );
1305
+ }, i.remove = function(c, f) {
1306
+ o(c, "", r(f, {
1307
+ expires: -1
1308
+ }));
1309
+ }, i.defaults = {}, i.withConverter = n, i;
1310
+ }
1311
+ return n(function() {
1312
+ });
1313
+ });
1314
+ })(Mt);
1315
+ var Cn = Mt.exports;
1316
+ const me = /* @__PURE__ */ Ot(Cn);
1317
+ /*! Capacitor: https://capacitorjs.com/ - MIT License */
1318
+ const On = (t) => {
1319
+ const e = /* @__PURE__ */ new Map();
1320
+ e.set("web", { name: "web" });
1321
+ const r = t.CapacitorPlatforms || {
1322
+ currentPlatform: { name: "web" },
1323
+ platforms: e
1324
+ }, s = (a, i) => {
1325
+ r.platforms.set(a, i);
1326
+ }, n = (a) => {
1327
+ r.platforms.has(a) && (r.currentPlatform = r.platforms.get(a));
1328
+ };
1329
+ return r.addPlatform = s, r.setPlatform = n, r;
1330
+ }, Rn = (t) => t.CapacitorPlatforms = On(t), Ht = /* @__PURE__ */ Rn(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
1331
+ Ht.addPlatform;
1332
+ Ht.setPlatform;
1333
+ var ee;
1334
+ (function(t) {
1335
+ t.Unimplemented = "UNIMPLEMENTED", t.Unavailable = "UNAVAILABLE";
1336
+ })(ee || (ee = {}));
1337
+ class Be extends Error {
1338
+ constructor(e, r, s) {
1339
+ super(e), this.message = e, this.code = r, this.data = s;
1340
+ }
1341
+ }
1342
+ const xn = (t) => {
1343
+ var e, r;
1344
+ return t != null && t.androidBridge ? "android" : !((r = (e = t == null ? void 0 : t.webkit) === null || e === void 0 ? void 0 : e.messageHandlers) === null || r === void 0) && r.bridge ? "ios" : "web";
1345
+ }, _n = (t) => {
1346
+ var e, r, s, n, a;
1347
+ const i = t.CapacitorCustomPlatform || null, o = t.Capacitor || {}, u = o.Plugins = o.Plugins || {}, c = t.CapacitorPlatforms, f = () => i !== null ? i.name : xn(t), d = ((e = c == null ? void 0 : c.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || f, l = () => d() !== "web", m = ((r = c == null ? void 0 : c.currentPlatform) === null || r === void 0 ? void 0 : r.isNativePlatform) || l, _ = (v) => {
1348
+ const h = z.get(v);
1349
+ return !!(h != null && h.platforms.has(d()) || T(v));
1350
+ }, y = ((s = c == null ? void 0 : c.currentPlatform) === null || s === void 0 ? void 0 : s.isPluginAvailable) || _, S = (v) => {
1351
+ var h;
1352
+ return (h = o.PluginHeaders) === null || h === void 0 ? void 0 : h.find(($) => $.name === v);
1353
+ }, T = ((n = c == null ? void 0 : c.currentPlatform) === null || n === void 0 ? void 0 : n.getPluginHeader) || S, W = (v) => t.console.error(v), I = (v, h, $) => Promise.reject(`${$} does not have an implementation of "${h}".`), z = /* @__PURE__ */ new Map(), p = (v, h = {}) => {
1354
+ const $ = z.get(v);
1355
+ if ($)
1356
+ return console.warn(`Capacitor plugin "${v}" already registered. Cannot register plugins twice.`), $.proxy;
1357
+ const k = d(), U = T(v);
1358
+ let b;
1359
+ const q = async () => (!b && k in h ? b = typeof h[k] == "function" ? b = await h[k]() : b = h[k] : i !== null && !b && "web" in h && (b = typeof h.web == "function" ? b = await h.web() : b = h.web), b), B = (P, O) => {
1360
+ var N, F;
1361
+ if (U) {
1362
+ const M = U == null ? void 0 : U.methods.find((A) => O === A.name);
1363
+ if (M)
1364
+ return M.rtype === "promise" ? (A) => o.nativePromise(v, O.toString(), A) : (A, ce) => o.nativeCallback(v, O.toString(), A, ce);
1365
+ if (P)
1366
+ return (N = P[O]) === null || N === void 0 ? void 0 : N.bind(P);
1367
+ } else {
1368
+ if (P)
1369
+ return (F = P[O]) === null || F === void 0 ? void 0 : F.bind(P);
1370
+ throw new Be(`"${v}" plugin is not implemented on ${k}`, ee.Unimplemented);
1371
+ }
1372
+ }, re = (P) => {
1373
+ let O;
1374
+ const N = (...F) => {
1375
+ const M = q().then((A) => {
1376
+ const ce = B(A, P);
1377
+ if (ce) {
1378
+ const de = ce(...F);
1379
+ return O = de == null ? void 0 : de.remove, de;
1380
+ } else
1381
+ throw new Be(`"${v}.${P}()" is not implemented on ${k}`, ee.Unimplemented);
1382
+ });
1383
+ return P === "addListener" && (M.remove = async () => O()), M;
1384
+ };
1385
+ return N.toString = () => `${P.toString()}() { [capacitor code] }`, Object.defineProperty(N, "name", {
1386
+ value: P,
1387
+ writable: !1,
1388
+ configurable: !1
1389
+ }), N;
1390
+ }, K = re("addListener"), Xe = re("removeListener"), zt = (P, O) => {
1391
+ const N = K({ eventName: P }, O), F = async () => {
1392
+ const A = await N;
1393
+ Xe({
1394
+ eventName: P,
1395
+ callbackId: A
1396
+ }, O);
1397
+ }, M = new Promise((A) => N.then(() => A({ remove: F })));
1398
+ return M.remove = async () => {
1399
+ console.warn("Using addListener() without 'await' is deprecated."), await F();
1400
+ }, M;
1401
+ }, Pe = new Proxy({}, {
1402
+ get(P, O) {
1403
+ switch (O) {
1404
+ case "$$typeof":
1405
+ return;
1406
+ case "toJSON":
1407
+ return () => ({});
1408
+ case "addListener":
1409
+ return U ? zt : K;
1410
+ case "removeListener":
1411
+ return Xe;
1412
+ default:
1413
+ return re(O);
1414
+ }
1415
+ }
1416
+ });
1417
+ return u[v] = Pe, z.set(v, {
1418
+ name: v,
1419
+ proxy: Pe,
1420
+ platforms: /* @__PURE__ */ new Set([
1421
+ ...Object.keys(h),
1422
+ ...U ? [k] : []
1423
+ ])
1424
+ }), Pe;
1425
+ }, Ee = ((a = c == null ? void 0 : c.currentPlatform) === null || a === void 0 ? void 0 : a.registerPlugin) || p;
1426
+ return o.convertFileSrc || (o.convertFileSrc = (v) => v), o.getPlatform = d, o.handleError = W, o.isNativePlatform = m, o.isPluginAvailable = y, o.pluginMethodNoop = I, o.registerPlugin = Ee, o.Exception = Be, o.DEBUG = !!o.DEBUG, o.isLoggingEnabled = !!o.isLoggingEnabled, o.platform = o.getPlatform(), o.isNative = o.isNativePlatform(), o;
1427
+ }, Sn = (t) => t.Capacitor = _n(t), ve = /* @__PURE__ */ Sn(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), Wt = ve.registerPlugin;
1428
+ ve.Plugins;
1429
+ class Jt {
1430
+ constructor(e) {
1431
+ this.listeners = {}, this.windowListeners = {}, e && (console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`), this.config = e);
1432
+ }
1433
+ addListener(e, r) {
1434
+ this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(r);
1435
+ const n = this.windowListeners[e];
1436
+ n && !n.registered && this.addWindowListener(n);
1437
+ const a = async () => this.removeListener(e, r), i = Promise.resolve({ remove: a });
1438
+ return Object.defineProperty(i, "remove", {
1439
+ value: async () => {
1440
+ console.warn("Using addListener() without 'await' is deprecated."), await a();
1441
+ }
1442
+ }), i;
1443
+ }
1444
+ async removeAllListeners() {
1445
+ this.listeners = {};
1446
+ for (const e in this.windowListeners)
1447
+ this.removeWindowListener(this.windowListeners[e]);
1448
+ this.windowListeners = {};
1449
+ }
1450
+ notifyListeners(e, r) {
1451
+ const s = this.listeners[e];
1452
+ s && s.forEach((n) => n(r));
1453
+ }
1454
+ hasListeners(e) {
1455
+ return !!this.listeners[e].length;
1456
+ }
1457
+ registerWindowListener(e, r) {
1458
+ this.windowListeners[r] = {
1459
+ registered: !1,
1460
+ windowEventName: e,
1461
+ pluginEventName: r,
1462
+ handler: (s) => {
1463
+ this.notifyListeners(r, s);
1464
+ }
1465
+ };
1466
+ }
1467
+ unimplemented(e = "not implemented") {
1468
+ return new ve.Exception(e, ee.Unimplemented);
1469
+ }
1470
+ unavailable(e = "not available") {
1471
+ return new ve.Exception(e, ee.Unavailable);
1472
+ }
1473
+ async removeListener(e, r) {
1474
+ const s = this.listeners[e];
1475
+ if (!s)
1476
+ return;
1477
+ const n = s.indexOf(r);
1478
+ this.listeners[e].splice(n, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
1479
+ }
1480
+ addWindowListener(e) {
1481
+ window.addEventListener(e.windowEventName, e.handler), e.registered = !0;
1482
+ }
1483
+ removeWindowListener(e) {
1484
+ e && (window.removeEventListener(e.windowEventName, e.handler), e.registered = !1);
1485
+ }
1486
+ }
1487
+ const gt = (t) => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), Et = (t) => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
1488
+ class An extends Jt {
1489
+ async getCookies() {
1490
+ const e = document.cookie, r = {};
1491
+ return e.split(";").forEach((s) => {
1492
+ if (s.length <= 0)
1493
+ return;
1494
+ let [n, a] = s.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
1495
+ n = Et(n).trim(), a = Et(a).trim(), r[n] = a;
1496
+ }), r;
1497
+ }
1498
+ async setCookie(e) {
1499
+ try {
1500
+ const r = gt(e.key), s = gt(e.value), n = `; expires=${(e.expires || "").replace("expires=", "")}`, a = (e.path || "/").replace("path=", ""), i = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
1501
+ document.cookie = `${r}=${s || ""}${n}; path=${a}; ${i};`;
1502
+ } catch (r) {
1503
+ return Promise.reject(r);
1504
+ }
1505
+ }
1506
+ async deleteCookie(e) {
1507
+ try {
1508
+ document.cookie = `${e.key}=; Max-Age=0`;
1509
+ } catch (r) {
1510
+ return Promise.reject(r);
1511
+ }
1512
+ }
1513
+ async clearCookies() {
1514
+ try {
1515
+ const e = document.cookie.split(";") || [];
1516
+ for (const r of e)
1517
+ document.cookie = r.replace(/^ +/, "").replace(/=.*/, `=;expires=${(/* @__PURE__ */ new Date()).toUTCString()};path=/`);
1518
+ } catch (e) {
1519
+ return Promise.reject(e);
1520
+ }
1521
+ }
1522
+ async clearAllCookies() {
1523
+ try {
1524
+ await this.clearCookies();
1525
+ } catch (e) {
1526
+ return Promise.reject(e);
1527
+ }
1528
+ }
1529
+ }
1530
+ const Vt = Wt("CapacitorCookies", {
1531
+ web: () => new An()
1532
+ }), Ln = async (t) => new Promise((e, r) => {
1533
+ const s = new FileReader();
1534
+ s.onload = () => {
1535
+ const n = s.result;
1536
+ e(n.indexOf(",") >= 0 ? n.split(",")[1] : n);
1537
+ }, s.onerror = (n) => r(n), s.readAsDataURL(t);
1538
+ }), Tn = (t = {}) => {
1539
+ const e = Object.keys(t);
1540
+ return Object.keys(t).map((n) => n.toLocaleLowerCase()).reduce((n, a, i) => (n[a] = t[e[i]], n), {});
1541
+ }, kn = (t, e = !0) => t ? Object.entries(t).reduce((s, n) => {
1542
+ const [a, i] = n;
1543
+ let o, u;
1544
+ return Array.isArray(i) ? (u = "", i.forEach((c) => {
1545
+ o = e ? encodeURIComponent(c) : c, u += `${a}=${o}&`;
1546
+ }), u.slice(0, -1)) : (o = e ? encodeURIComponent(i) : i, u = `${a}=${o}`), `${s}&${u}`;
1547
+ }, "").substr(1) : null, Un = (t, e = {}) => {
1548
+ const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n = Tn(t.headers)["content-type"] || "";
1549
+ if (typeof t.data == "string")
1550
+ r.body = t.data;
1551
+ else if (n.includes("application/x-www-form-urlencoded")) {
1552
+ const a = new URLSearchParams();
1553
+ for (const [i, o] of Object.entries(t.data || {}))
1554
+ a.set(i, o);
1555
+ r.body = a.toString();
1556
+ } else if (n.includes("multipart/form-data")) {
1557
+ const a = new FormData();
1558
+ if (t.data instanceof FormData)
1559
+ t.data.forEach((o, u) => {
1560
+ a.append(u, o);
1561
+ });
1562
+ else
1563
+ for (const o of Object.keys(t.data))
1564
+ a.append(o, t.data[o]);
1565
+ r.body = a;
1566
+ const i = new Headers(r.headers);
1567
+ i.delete("content-type"), r.headers = i;
1568
+ } else
1569
+ (n.includes("application/json") || typeof t.data == "object") && (r.body = JSON.stringify(t.data));
1570
+ return r;
1571
+ };
1572
+ class Nn extends Jt {
1573
+ /**
1574
+ * Perform an Http request given a set of options
1575
+ * @param options Options to build the HTTP request
1576
+ */
1577
+ async request(e) {
1578
+ const r = Un(e, e.webFetchExtra), s = kn(e.params, e.shouldEncodeUrlParams), n = s ? `${e.url}?${s}` : e.url, a = await fetch(n, r), i = a.headers.get("content-type") || "";
1579
+ let { responseType: o = "text" } = a.ok ? e : {};
1580
+ i.includes("application/json") && (o = "json");
1581
+ let u, c;
1582
+ switch (o) {
1583
+ case "arraybuffer":
1584
+ case "blob":
1585
+ c = await a.blob(), u = await Ln(c);
1586
+ break;
1587
+ case "json":
1588
+ u = await a.json();
1589
+ break;
1590
+ case "document":
1591
+ case "text":
1592
+ default:
1593
+ u = await a.text();
1594
+ }
1595
+ const f = {};
1596
+ return a.headers.forEach((d, l) => {
1597
+ f[l] = d;
1598
+ }), {
1599
+ data: u,
1600
+ headers: f,
1601
+ status: a.status,
1602
+ url: a.url
1603
+ };
1604
+ }
1605
+ /**
1606
+ * Perform an Http GET request given a set of options
1607
+ * @param options Options to build the HTTP request
1608
+ */
1609
+ async get(e) {
1610
+ return this.request(Object.assign(Object.assign({}, e), { method: "GET" }));
1611
+ }
1612
+ /**
1613
+ * Perform an Http POST request given a set of options
1614
+ * @param options Options to build the HTTP request
1615
+ */
1616
+ async post(e) {
1617
+ return this.request(Object.assign(Object.assign({}, e), { method: "POST" }));
1618
+ }
1619
+ /**
1620
+ * Perform an Http PUT request given a set of options
1621
+ * @param options Options to build the HTTP request
1622
+ */
1623
+ async put(e) {
1624
+ return this.request(Object.assign(Object.assign({}, e), { method: "PUT" }));
1625
+ }
1626
+ /**
1627
+ * Perform an Http PATCH request given a set of options
1628
+ * @param options Options to build the HTTP request
1629
+ */
1630
+ async patch(e) {
1631
+ return this.request(Object.assign(Object.assign({}, e), { method: "PATCH" }));
1632
+ }
1633
+ /**
1634
+ * Perform an Http DELETE request given a set of options
1635
+ * @param options Options to build the HTTP request
1636
+ */
1637
+ async delete(e) {
1638
+ return this.request(Object.assign(Object.assign({}, e), { method: "DELETE" }));
1639
+ }
1640
+ }
1641
+ Wt("CapacitorHttp", {
1642
+ web: () => new Nn()
1643
+ });
1644
+ const jn = Ft.create({ baseURL: process.env.API_URL, withCredentials: !0 }), le = Pt({
1645
+ code: {
1646
+ value: "",
1647
+ type: "",
1648
+ method: "",
1649
+ isSended: !1,
1650
+ isValid: !1
1651
+ }
1652
+ });
1653
+ async function Dn(t, e, r) {
1654
+ return await jn.post("/api/twofa/sendcode", {
1655
+ phone: t.phone.number,
1656
+ email: t.email,
1657
+ method: e,
1658
+ type: r
1659
+ }).then(
1660
+ (s) => (le.code = s.data, le.code.isSended = !0, Promise.resolve(s.data)),
1661
+ (s) => (console.log(s), J(s), Promise.reject(s))
1662
+ );
1663
+ }
1664
+ Ct(le, (t, e) => {
1665
+ });
1666
+ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1667
+ __proto__: null,
1668
+ sendCode: Dn,
1669
+ state: le
1670
+ }, Symbol.toStringTag, { value: "Module" })), ue = Ft.create({ baseURL: process.env.API_URL, withCredentials: !0 }), C = Pt({
1671
+ user: {
1672
+ _id: "",
1673
+ username: "",
1674
+ email: "",
1675
+ phone: "",
1676
+ password: "",
1677
+ passwordRepeat: ""
1678
+ },
1679
+ access: {
1680
+ roles: null,
1681
+ token: null,
1682
+ status: !1
1683
+ }
1684
+ });
1685
+ if (me.get("user")) {
1686
+ const { _id: t, email: e, phone: r, roles: s, accessToken: n } = JSON.parse(me.get("user"));
1687
+ Object.assign(C.user, { _id: t, email: e, phone: r }), Object.assign(C.access, { token: n, roles: s, status: !!n }), ue.interceptors.request.use((a) => (n && (a.headers["x-access-token"] = n), a), (a) => Promise.reject(a));
1688
+ }
1689
+ const $n = {
1690
+ async login(t, e) {
1691
+ try {
1692
+ const r = await ue.post("/api/auth/signin", {
1693
+ ...t,
1694
+ type: e
1695
+ });
1696
+ return Ie("user", r.data), Object.assign(C.user, {
1697
+ ...r.data
1698
+ }), Object.assign(C.access, {
1699
+ token: r.data.accessToken,
1700
+ status: !0,
1701
+ roles: r.data.roles
1702
+ }), r.data;
1703
+ } catch (r) {
1704
+ return Object.assign(C.access, {
1705
+ token: null,
1706
+ status: !1,
1707
+ roles: null
1708
+ }), J(r), Promise.reject(r);
1709
+ }
1710
+ },
1711
+ async signup(t, e, r) {
1712
+ const { password: s, passwordRepeat: n } = C.user;
1713
+ if (s !== n) {
1714
+ const a = {
1715
+ response: {
1716
+ data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
1717
+ }
1718
+ };
1719
+ throw J(a), new Error(a.response.status);
1720
+ }
1721
+ try {
1722
+ t.phone = t.phone.number;
1723
+ const a = await ue.post("/api/auth/signup", {
1724
+ ...t,
1725
+ type: e,
1726
+ inviteCode: r
1727
+ });
1728
+ return a.data.accessToken && Ie("user", a.data), Object.assign(C.user, {
1729
+ ...a.data
1730
+ }), Object.assign(C.access, {
1731
+ token: a.data.accessToken,
1732
+ status: !0,
1733
+ roles: a.data.roles
1734
+ }), a.data;
1735
+ } catch (a) {
1736
+ throw J(a), console.log("Sign up falied"), a;
1737
+ }
1738
+ },
1739
+ logout() {
1740
+ In("user"), Object.assign(C.user, {
1741
+ email: "",
1742
+ phone: "",
1743
+ password: "",
1744
+ passwordRepeat: ""
1745
+ }), Object.assign(C.access, {
1746
+ token: null,
1747
+ status: !1
1748
+ });
1749
+ },
1750
+ async resetPassword(t, e) {
1751
+ try {
1752
+ const r = await ue.post("/api/auth/reset-password", {
1753
+ email: t.email,
1754
+ phone: t.phone.number,
1755
+ type: e
1756
+ });
1757
+ return Object.assign(le.code, {
1758
+ ...r.data,
1759
+ isSended: !0
1760
+ }), r.data;
1761
+ } catch (r) {
1762
+ return J(r), Promise.reject(r);
1763
+ }
1764
+ },
1765
+ async updatePassword(t, e) {
1766
+ const { password: r, passwordRepeat: s } = C.user;
1767
+ if (r !== s) {
1768
+ const n = {
1769
+ response: {
1770
+ data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
1771
+ }
1772
+ };
1773
+ throw J(n), new Error(n.response.status);
1774
+ }
1775
+ try {
1776
+ const n = await ue.post("/api/auth/update-password", {
1777
+ email: t.email,
1778
+ phone: t.phone.number,
1779
+ password: t.password,
1780
+ passwordRepeat: t.passwordRepeat,
1781
+ type: e
1782
+ });
1783
+ return n.data.accessToken && Ie("user", n.data), Object.assign(C.user, {
1784
+ ...n.data
1785
+ }), Object.assign(C.access, {
1786
+ token: n.data.accessToken,
1787
+ status: !0
1788
+ }), n.data;
1789
+ } catch (n) {
1790
+ return J(n), Promise.reject(n);
1791
+ }
1792
+ }
1793
+ }, Bn = {
1794
+ development: { secure: !1, expires: 1 },
1795
+ production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
1796
+ };
1797
+ function Ie(t, e, r = process.env.NODE_ENV) {
1798
+ process.env.MOBILE_APP ? Vt.setCookie({
1799
+ url: process.env.API_URL,
1800
+ // используйте ваш API_URL
1801
+ key: t,
1802
+ value: JSON.stringify(e)
1803
+ }) : me.set(t, JSON.stringify(e), Bn[r]);
1804
+ }
1805
+ function In(t, e = process.env.NODE_ENV) {
1806
+ if (process.env.MOBILE_APP)
1807
+ Vt.deleteCookie({
1808
+ url: process.env.API_URL,
1809
+ // используйте ваш API_URL
1810
+ key: t
1811
+ });
1812
+ else {
1813
+ const r = e === "production" ? { domain: process.env.API_URL } : {};
1814
+ me.remove(t, r);
1815
+ }
1816
+ }
1817
+ Ct(C, (t, e) => {
1818
+ });
1819
+ const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1820
+ __proto__: null,
1821
+ actions: $n,
1822
+ state: C
1823
+ }, Symbol.toStringTag, { value: "Module" }));
1824
+ export {
1825
+ me as C,
1826
+ Hn as F,
1827
+ Wn as _,
1828
+ Ft as a,
1829
+ $n as b,
1830
+ Dn as c,
1831
+ le as d,
1832
+ Vn as e,
1833
+ Ot as g,
1834
+ C as s,
1835
+ Jn as t
1836
+ };