@feedmepos/mf-payment 1.2.19 → 1.2.21

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 (32) hide show
  1. package/dist/{PayoutAccount-CHo5q_Dd.js → PayoutAccount-BJO8qK63.js} +5 -5
  2. package/dist/{PayoutAccount-Dmb5P1u9.js → PayoutAccount-DsEqU8hK.js} +6 -6
  3. package/dist/{PayoutAccountSetting-DuAwoj07.js → PayoutAccountSetting-B9dt772M.js} +4 -4
  4. package/dist/{Restaurant-BHnCBvZS.js → Restaurant-Jvhky-xo.js} +4 -4
  5. package/dist/{RestaurantSetting-4JR7Czyw.js → RestaurantSetting-C1V2H96h.js} +3 -3
  6. package/dist/{Settlement-cs2AcekL.js → Settlement-BOcW6cys.js} +3 -3
  7. package/dist/{Settlement-YqktODxj.js → Settlement-DE7WPC6B.js} +3 -3
  8. package/dist/{SettlementTransactions-G8aYvQrK.js → SettlementTransactions-DF7gUi8D.js} +3 -3
  9. package/dist/{SettlementTransactions-5lb_JlGa.js → SettlementTransactions-DOH3dozr.js} +3 -3
  10. package/dist/{Terminal-Fz-rm976.js → Terminal-CQafwGHN.js} +5 -5
  11. package/dist/{TerminalSetting-DtBtbCgg.js → TerminalSetting-C7YmyFUO.js} +3 -3
  12. package/dist/{Transaction-BxQ57luw.js → Transaction-B0iwdCCm.js} +7 -7
  13. package/dist/{Transaction-BAenTmvf.js → Transaction-NiOW5uKS.js} +5 -5
  14. package/dist/{TransactionOld-Bjzhk4If.js → TransactionOld-CcWxcV1S.js} +4 -4
  15. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-DVhWh1xU.js → TransactionTable.vue_vue_type_script_setup_true_lang-Ci_3cerr.js} +3 -3
  16. package/dist/{app-DfiyNpuY.js → app-DeXX5bbm.js} +200 -200
  17. package/dist/app.js +1 -1
  18. package/dist/{assets-CRaSn41I.js → assets-CKuU57MG.js} +2 -2
  19. package/dist/{grafana-DmtnyZBB.js → grafana-D8JxKpJG.js} +1 -1
  20. package/dist/{index-CAb046uN.js → index-B5Wdro6B.js} +1 -1
  21. package/dist/{index-CLn5kALf.js → index-BdhRNPHY.js} +1 -1
  22. package/dist/{index-B01yftRl.js → index-CD9N19yB.js} +2 -2
  23. package/dist/{index-B5p6MHwE.js → index-CIwsFgto.js} +16 -16
  24. package/dist/{index-BkAkEvWy.js → index-D2Vrq0ZZ.js} +1 -1
  25. package/dist/{index-DnUbvPwz.js → index-D9bjLfdf.js} +2896 -2896
  26. package/dist/{index-CRjwV9Ky.js → index-UBd3b6lw.js} +1 -1
  27. package/dist/{index.vue_vue_type_script_setup_true_lang-DiGVFrc7.js → index.vue_vue_type_script_setup_true_lang-eDh_nfj1.js} +1 -1
  28. package/dist/package.json +1 -1
  29. package/dist/payout-account-CoxGghFG.js +1820 -0
  30. package/dist/tsconfig.app.tsbuildinfo +1 -1
  31. package/package.json +1 -1
  32. package/dist/payout-account-BzSfb1I-.js +0 -1953
@@ -0,0 +1,1820 @@
1
+ import { _ as Je, C as Qe, r as Ee, S as et, g as re, a as tt, b as nt, c as _e, F as rt, d as st, e as it } from "./app-DeXX5bbm.js";
2
+ import { c as ot, a as at, B as ut } from "./index-D9bjLfdf.js";
3
+ import { _ as Y } from "./index-CIwsFgto.js";
4
+ import { useCoreStore as ct } from "@feedmepos/mf-common";
5
+ /**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+ const xe = "firebasestorage.googleapis.com", Ce = "storageBucket", lt = 2 * 60 * 1e3, ht = 10 * 60 * 1e3;
22
+ /**
23
+ * @license
24
+ * Copyright 2017 Google LLC
25
+ *
26
+ * Licensed under the Apache License, Version 2.0 (the "License");
27
+ * you may not use this file except in compliance with the License.
28
+ * You may obtain a copy of the License at
29
+ *
30
+ * http://www.apache.org/licenses/LICENSE-2.0
31
+ *
32
+ * Unless required by applicable law or agreed to in writing, software
33
+ * distributed under the License is distributed on an "AS IS" BASIS,
34
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35
+ * See the License for the specific language governing permissions and
36
+ * limitations under the License.
37
+ */
38
+ class R extends rt {
39
+ /**
40
+ * @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and
41
+ * added to the end of the message.
42
+ * @param message - Error message.
43
+ * @param status_ - Corresponding HTTP Status Code
44
+ */
45
+ constructor(t, n, r = 0) {
46
+ super(de(t), `Firebase Storage: ${n} (${de(t)})`), this.status_ = r, this.customData = { serverResponse: null }, this._baseMessage = this.message, Object.setPrototypeOf(this, R.prototype);
47
+ }
48
+ get status() {
49
+ return this.status_;
50
+ }
51
+ set status(t) {
52
+ this.status_ = t;
53
+ }
54
+ /**
55
+ * Compares a `StorageErrorCode` against this error's code, filtering out the prefix.
56
+ */
57
+ _codeEquals(t) {
58
+ return de(t) === this.code;
59
+ }
60
+ /**
61
+ * Optional response message that was added by the server.
62
+ */
63
+ get serverResponse() {
64
+ return this.customData.serverResponse;
65
+ }
66
+ set serverResponse(t) {
67
+ this.customData.serverResponse = t, this.customData.serverResponse ? this.message = `${this._baseMessage}
68
+ ${this.customData.serverResponse}` : this.message = this._baseMessage;
69
+ }
70
+ }
71
+ var y;
72
+ (function(e) {
73
+ e.UNKNOWN = "unknown", e.OBJECT_NOT_FOUND = "object-not-found", e.BUCKET_NOT_FOUND = "bucket-not-found", e.PROJECT_NOT_FOUND = "project-not-found", e.QUOTA_EXCEEDED = "quota-exceeded", e.UNAUTHENTICATED = "unauthenticated", e.UNAUTHORIZED = "unauthorized", e.UNAUTHORIZED_APP = "unauthorized-app", e.RETRY_LIMIT_EXCEEDED = "retry-limit-exceeded", e.INVALID_CHECKSUM = "invalid-checksum", e.CANCELED = "canceled", e.INVALID_EVENT_NAME = "invalid-event-name", e.INVALID_URL = "invalid-url", e.INVALID_DEFAULT_BUCKET = "invalid-default-bucket", e.NO_DEFAULT_BUCKET = "no-default-bucket", e.CANNOT_SLICE_BLOB = "cannot-slice-blob", e.SERVER_FILE_WRONG_SIZE = "server-file-wrong-size", e.NO_DOWNLOAD_URL = "no-download-url", e.INVALID_ARGUMENT = "invalid-argument", e.INVALID_ARGUMENT_COUNT = "invalid-argument-count", e.APP_DELETED = "app-deleted", e.INVALID_ROOT_OPERATION = "invalid-root-operation", e.INVALID_FORMAT = "invalid-format", e.INTERNAL_ERROR = "internal-error", e.UNSUPPORTED_ENVIRONMENT = "unsupported-environment";
74
+ })(y || (y = {}));
75
+ function de(e) {
76
+ return "storage/" + e;
77
+ }
78
+ function be() {
79
+ const e = "An unknown error occurred, please check the error payload for server response.";
80
+ return new R(y.UNKNOWN, e);
81
+ }
82
+ function dt(e) {
83
+ return new R(y.OBJECT_NOT_FOUND, "Object '" + e + "' does not exist.");
84
+ }
85
+ function ft(e) {
86
+ return new R(y.QUOTA_EXCEEDED, "Quota for bucket '" + e + "' exceeded, please view quota on https://firebase.google.com/pricing/.");
87
+ }
88
+ function pt() {
89
+ const e = "User is not authenticated, please authenticate using Firebase Authentication and try again.";
90
+ return new R(y.UNAUTHENTICATED, e);
91
+ }
92
+ function _t() {
93
+ return new R(y.UNAUTHORIZED_APP, "This app does not have permission to access Firebase Storage on this project.");
94
+ }
95
+ function mt(e) {
96
+ return new R(y.UNAUTHORIZED, "User does not have permission to access '" + e + "'.");
97
+ }
98
+ function gt() {
99
+ return new R(y.RETRY_LIMIT_EXCEEDED, "Max retry time for operation exceeded, please try again.");
100
+ }
101
+ function bt() {
102
+ return new R(y.CANCELED, "User canceled the upload/download.");
103
+ }
104
+ function wt(e) {
105
+ return new R(y.INVALID_URL, "Invalid URL '" + e + "'.");
106
+ }
107
+ function Tt(e) {
108
+ return new R(y.INVALID_DEFAULT_BUCKET, "Invalid default bucket '" + e + "'.");
109
+ }
110
+ function yt() {
111
+ return new R(y.NO_DEFAULT_BUCKET, "No default bucket found. Did you set the '" + Ce + "' property when initializing the app?");
112
+ }
113
+ function Rt() {
114
+ return new R(y.CANNOT_SLICE_BLOB, "Cannot slice blob for upload. Please retry the upload.");
115
+ }
116
+ function kt() {
117
+ return new R(y.NO_DOWNLOAD_URL, "The given file does not have any download URLs.");
118
+ }
119
+ function Ot(e) {
120
+ return new R(y.UNSUPPORTED_ENVIRONMENT, `${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);
121
+ }
122
+ function me(e) {
123
+ return new R(y.INVALID_ARGUMENT, e);
124
+ }
125
+ function Me() {
126
+ return new R(y.APP_DELETED, "The Firebase app was deleted.");
127
+ }
128
+ function Et(e) {
129
+ return new R(y.INVALID_ROOT_OPERATION, "The operation '" + e + "' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').");
130
+ }
131
+ function te(e, t) {
132
+ return new R(y.INVALID_FORMAT, "String does not match format '" + e + "': " + t);
133
+ }
134
+ function ee(e) {
135
+ throw new R(y.INTERNAL_ERROR, "Internal error: " + e);
136
+ }
137
+ /**
138
+ * @license
139
+ * Copyright 2017 Google LLC
140
+ *
141
+ * Licensed under the Apache License, Version 2.0 (the "License");
142
+ * you may not use this file except in compliance with the License.
143
+ * You may obtain a copy of the License at
144
+ *
145
+ * http://www.apache.org/licenses/LICENSE-2.0
146
+ *
147
+ * Unless required by applicable law or agreed to in writing, software
148
+ * distributed under the License is distributed on an "AS IS" BASIS,
149
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
150
+ * See the License for the specific language governing permissions and
151
+ * limitations under the License.
152
+ */
153
+ class x {
154
+ constructor(t, n) {
155
+ this.bucket = t, this.path_ = n;
156
+ }
157
+ get path() {
158
+ return this.path_;
159
+ }
160
+ get isRoot() {
161
+ return this.path.length === 0;
162
+ }
163
+ fullServerUrl() {
164
+ const t = encodeURIComponent;
165
+ return "/b/" + t(this.bucket) + "/o/" + t(this.path);
166
+ }
167
+ bucketOnlyServerUrl() {
168
+ return "/b/" + encodeURIComponent(this.bucket) + "/o";
169
+ }
170
+ static makeFromBucketSpec(t, n) {
171
+ let r;
172
+ try {
173
+ r = x.makeFromUrl(t, n);
174
+ } catch {
175
+ return new x(t, "");
176
+ }
177
+ if (r.path === "")
178
+ return r;
179
+ throw Tt(t);
180
+ }
181
+ static makeFromUrl(t, n) {
182
+ let r = null;
183
+ const s = "([A-Za-z0-9.\\-_]+)";
184
+ function i($) {
185
+ $.path.charAt($.path.length - 1) === "/" && ($.path_ = $.path_.slice(0, -1));
186
+ }
187
+ const o = "(/(.*))?$", h = new RegExp("^gs://" + s + o, "i"), d = { bucket: 1, path: 3 };
188
+ function m($) {
189
+ $.path_ = decodeURIComponent($.path);
190
+ }
191
+ const T = "v[A-Za-z0-9_]+", b = n.replace(/[.]/g, "\\."), O = "(/([^?#]*).*)?$", E = new RegExp(`^https?://${b}/${T}/b/${s}/o${O}`, "i"), A = { bucket: 1, path: 3 }, F = n === xe ? "(?:storage.googleapis.com|storage.cloud.google.com)" : n, U = "([^?#]*)", H = new RegExp(`^https?://${F}/${s}/${U}`, "i"), P = [
192
+ { regex: h, indices: d, postModify: i },
193
+ {
194
+ regex: E,
195
+ indices: A,
196
+ postModify: m
197
+ },
198
+ {
199
+ regex: H,
200
+ indices: { bucket: 1, path: 2 },
201
+ postModify: m
202
+ }
203
+ ];
204
+ for (let $ = 0; $ < P.length; $++) {
205
+ const L = P[$], M = L.regex.exec(t);
206
+ if (M) {
207
+ const se = M[L.indices.bucket];
208
+ let q = M[L.indices.path];
209
+ q || (q = ""), r = new x(se, q), L.postModify(r);
210
+ break;
211
+ }
212
+ }
213
+ if (r == null)
214
+ throw wt(t);
215
+ return r;
216
+ }
217
+ }
218
+ class St {
219
+ constructor(t) {
220
+ this.promise_ = Promise.reject(t);
221
+ }
222
+ /** @inheritDoc */
223
+ getPromise() {
224
+ return this.promise_;
225
+ }
226
+ /** @inheritDoc */
227
+ cancel(t = !1) {
228
+ }
229
+ }
230
+ /**
231
+ * @license
232
+ * Copyright 2017 Google LLC
233
+ *
234
+ * Licensed under the Apache License, Version 2.0 (the "License");
235
+ * you may not use this file except in compliance with the License.
236
+ * You may obtain a copy of the License at
237
+ *
238
+ * http://www.apache.org/licenses/LICENSE-2.0
239
+ *
240
+ * Unless required by applicable law or agreed to in writing, software
241
+ * distributed under the License is distributed on an "AS IS" BASIS,
242
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
243
+ * See the License for the specific language governing permissions and
244
+ * limitations under the License.
245
+ */
246
+ function vt(e, t, n) {
247
+ let r = 1, s = null, i = null, o = !1, h = 0;
248
+ function d() {
249
+ return h === 2;
250
+ }
251
+ let m = !1;
252
+ function T(...U) {
253
+ m || (m = !0, t.apply(null, U));
254
+ }
255
+ function b(U) {
256
+ s = setTimeout(() => {
257
+ s = null, e(E, d());
258
+ }, U);
259
+ }
260
+ function O() {
261
+ i && clearTimeout(i);
262
+ }
263
+ function E(U, ...H) {
264
+ if (m) {
265
+ O();
266
+ return;
267
+ }
268
+ if (U) {
269
+ O(), T.call(null, U, ...H);
270
+ return;
271
+ }
272
+ if (d() || o) {
273
+ O(), T.call(null, U, ...H);
274
+ return;
275
+ }
276
+ r < 64 && (r *= 2);
277
+ let P;
278
+ h === 1 ? (h = 2, P = 0) : P = (r + Math.random()) * 1e3, b(P);
279
+ }
280
+ let A = !1;
281
+ function F(U) {
282
+ A || (A = !0, O(), !m && (s !== null ? (U || (h = 2), clearTimeout(s), b(0)) : U || (h = 1)));
283
+ }
284
+ return b(0), i = setTimeout(() => {
285
+ o = !0, F(!0);
286
+ }, n), F;
287
+ }
288
+ function At(e) {
289
+ e(!1);
290
+ }
291
+ /**
292
+ * @license
293
+ * Copyright 2017 Google LLC
294
+ *
295
+ * Licensed under the Apache License, Version 2.0 (the "License");
296
+ * you may not use this file except in compliance with the License.
297
+ * You may obtain a copy of the License at
298
+ *
299
+ * http://www.apache.org/licenses/LICENSE-2.0
300
+ *
301
+ * Unless required by applicable law or agreed to in writing, software
302
+ * distributed under the License is distributed on an "AS IS" BASIS,
303
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
304
+ * See the License for the specific language governing permissions and
305
+ * limitations under the License.
306
+ */
307
+ function Ut(e) {
308
+ return e !== void 0;
309
+ }
310
+ function $t(e) {
311
+ return typeof e == "object" && !Array.isArray(e);
312
+ }
313
+ function we(e) {
314
+ return typeof e == "string" || e instanceof String;
315
+ }
316
+ function Se(e) {
317
+ return Te() && e instanceof Blob;
318
+ }
319
+ function Te() {
320
+ return typeof Blob < "u";
321
+ }
322
+ function ve(e, t, n, r) {
323
+ if (r < t)
324
+ throw me(`Invalid value for '${e}'. Expected ${t} or greater.`);
325
+ if (r > n)
326
+ throw me(`Invalid value for '${e}'. Expected ${n} or less.`);
327
+ }
328
+ /**
329
+ * @license
330
+ * Copyright 2017 Google LLC
331
+ *
332
+ * Licensed under the Apache License, Version 2.0 (the "License");
333
+ * you may not use this file except in compliance with the License.
334
+ * You may obtain a copy of the License at
335
+ *
336
+ * http://www.apache.org/licenses/LICENSE-2.0
337
+ *
338
+ * Unless required by applicable law or agreed to in writing, software
339
+ * distributed under the License is distributed on an "AS IS" BASIS,
340
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
341
+ * See the License for the specific language governing permissions and
342
+ * limitations under the License.
343
+ */
344
+ function he(e, t, n) {
345
+ let r = t;
346
+ return n == null && (r = `https://${t}`), `${n}://${r}/v0${e}`;
347
+ }
348
+ function Le(e) {
349
+ const t = encodeURIComponent;
350
+ let n = "?";
351
+ for (const r in e)
352
+ if (e.hasOwnProperty(r)) {
353
+ const s = t(r) + "=" + t(e[r]);
354
+ n = n + s + "&";
355
+ }
356
+ return n = n.slice(0, -1), n;
357
+ }
358
+ var G;
359
+ (function(e) {
360
+ e[e.NO_ERROR = 0] = "NO_ERROR", e[e.NETWORK_ERROR = 1] = "NETWORK_ERROR", e[e.ABORT = 2] = "ABORT";
361
+ })(G || (G = {}));
362
+ /**
363
+ * @license
364
+ * Copyright 2022 Google LLC
365
+ *
366
+ * Licensed under the Apache License, Version 2.0 (the "License");
367
+ * you may not use this file except in compliance with the License.
368
+ * You may obtain a copy of the License at
369
+ *
370
+ * http://www.apache.org/licenses/LICENSE-2.0
371
+ *
372
+ * Unless required by applicable law or agreed to in writing, software
373
+ * distributed under the License is distributed on an "AS IS" BASIS,
374
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
375
+ * See the License for the specific language governing permissions and
376
+ * limitations under the License.
377
+ */
378
+ function Nt(e, t) {
379
+ const n = e >= 500 && e < 600, s = [
380
+ // Request Timeout: web server didn't receive full request in time.
381
+ 408,
382
+ // Too Many Requests: you're getting rate-limited, basically.
383
+ 429
384
+ ].indexOf(e) !== -1, i = t.indexOf(e) !== -1;
385
+ return n || s || i;
386
+ }
387
+ /**
388
+ * @license
389
+ * Copyright 2017 Google LLC
390
+ *
391
+ * Licensed under the Apache License, Version 2.0 (the "License");
392
+ * you may not use this file except in compliance with the License.
393
+ * You may obtain a copy of the License at
394
+ *
395
+ * http://www.apache.org/licenses/LICENSE-2.0
396
+ *
397
+ * Unless required by applicable law or agreed to in writing, software
398
+ * distributed under the License is distributed on an "AS IS" BASIS,
399
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
400
+ * See the License for the specific language governing permissions and
401
+ * limitations under the License.
402
+ */
403
+ class It {
404
+ constructor(t, n, r, s, i, o, h, d, m, T, b, O = !0) {
405
+ this.url_ = t, this.method_ = n, this.headers_ = r, this.body_ = s, this.successCodes_ = i, this.additionalRetryCodes_ = o, this.callback_ = h, this.errorCallback_ = d, this.timeout_ = m, this.progressCallback_ = T, this.connectionFactory_ = b, this.retry = O, this.pendingConnection_ = null, this.backoffId_ = null, this.canceled_ = !1, this.appDelete_ = !1, this.promise_ = new Promise((E, A) => {
406
+ this.resolve_ = E, this.reject_ = A, this.start_();
407
+ });
408
+ }
409
+ /**
410
+ * Actually starts the retry loop.
411
+ */
412
+ start_() {
413
+ const t = (r, s) => {
414
+ if (s) {
415
+ r(!1, new ue(!1, null, !0));
416
+ return;
417
+ }
418
+ const i = this.connectionFactory_();
419
+ this.pendingConnection_ = i;
420
+ const o = (h) => {
421
+ const d = h.loaded, m = h.lengthComputable ? h.total : -1;
422
+ this.progressCallback_ !== null && this.progressCallback_(d, m);
423
+ };
424
+ this.progressCallback_ !== null && i.addUploadProgressListener(o), i.send(this.url_, this.method_, this.body_, this.headers_).then(() => {
425
+ this.progressCallback_ !== null && i.removeUploadProgressListener(o), this.pendingConnection_ = null;
426
+ const h = i.getErrorCode() === G.NO_ERROR, d = i.getStatus();
427
+ if (!h || Nt(d, this.additionalRetryCodes_) && this.retry) {
428
+ const T = i.getErrorCode() === G.ABORT;
429
+ r(!1, new ue(!1, null, T));
430
+ return;
431
+ }
432
+ const m = this.successCodes_.indexOf(d) !== -1;
433
+ r(!0, new ue(m, i));
434
+ });
435
+ }, n = (r, s) => {
436
+ const i = this.resolve_, o = this.reject_, h = s.connection;
437
+ if (s.wasSuccessCode)
438
+ try {
439
+ const d = this.callback_(h, h.getResponse());
440
+ Ut(d) ? i(d) : i();
441
+ } catch (d) {
442
+ o(d);
443
+ }
444
+ else if (h !== null) {
445
+ const d = be();
446
+ d.serverResponse = h.getErrorText(), this.errorCallback_ ? o(this.errorCallback_(h, d)) : o(d);
447
+ } else if (s.canceled) {
448
+ const d = this.appDelete_ ? Me() : bt();
449
+ o(d);
450
+ } else {
451
+ const d = gt();
452
+ o(d);
453
+ }
454
+ };
455
+ this.canceled_ ? n(!1, new ue(!1, null, !0)) : this.backoffId_ = vt(t, n, this.timeout_);
456
+ }
457
+ /** @inheritDoc */
458
+ getPromise() {
459
+ return this.promise_;
460
+ }
461
+ /** @inheritDoc */
462
+ cancel(t) {
463
+ this.canceled_ = !0, this.appDelete_ = t || !1, this.backoffId_ !== null && At(this.backoffId_), this.pendingConnection_ !== null && this.pendingConnection_.abort();
464
+ }
465
+ }
466
+ class ue {
467
+ constructor(t, n, r) {
468
+ this.wasSuccessCode = t, this.connection = n, this.canceled = !!r;
469
+ }
470
+ }
471
+ function Pt(e, t) {
472
+ t !== null && t.length > 0 && (e.Authorization = "Firebase " + t);
473
+ }
474
+ function Dt(e, t) {
475
+ e["X-Firebase-Storage-Version"] = "webjs/" + (t ?? "AppManager");
476
+ }
477
+ function xt(e, t) {
478
+ t && (e["X-Firebase-GMPID"] = t);
479
+ }
480
+ function Ct(e, t) {
481
+ t !== null && (e["X-Firebase-AppCheck"] = t);
482
+ }
483
+ function Mt(e, t, n, r, s, i, o = !0) {
484
+ const h = Le(e.urlParams), d = e.url + h, m = Object.assign({}, e.headers);
485
+ return xt(m, t), Pt(m, n), Dt(m, i), Ct(m, r), new It(d, e.method, m, e.body, e.successCodes, e.additionalRetryCodes, e.handler, e.errorHandler, e.timeout, e.progressCallback, s, o);
486
+ }
487
+ /**
488
+ * @license
489
+ * Copyright 2017 Google LLC
490
+ *
491
+ * Licensed under the Apache License, Version 2.0 (the "License");
492
+ * you may not use this file except in compliance with the License.
493
+ * You may obtain a copy of the License at
494
+ *
495
+ * http://www.apache.org/licenses/LICENSE-2.0
496
+ *
497
+ * Unless required by applicable law or agreed to in writing, software
498
+ * distributed under the License is distributed on an "AS IS" BASIS,
499
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
500
+ * See the License for the specific language governing permissions and
501
+ * limitations under the License.
502
+ */
503
+ function Lt() {
504
+ return typeof BlobBuilder < "u" ? BlobBuilder : typeof WebKitBlobBuilder < "u" ? WebKitBlobBuilder : void 0;
505
+ }
506
+ function Bt(...e) {
507
+ const t = Lt();
508
+ if (t !== void 0) {
509
+ const n = new t();
510
+ for (let r = 0; r < e.length; r++)
511
+ n.append(e[r]);
512
+ return n.getBlob();
513
+ } else {
514
+ if (Te())
515
+ return new Blob(e);
516
+ throw new R(y.UNSUPPORTED_ENVIRONMENT, "This browser doesn't seem to support creating Blobs");
517
+ }
518
+ }
519
+ function Ft(e, t, n) {
520
+ return e.webkitSlice ? e.webkitSlice(t, n) : e.mozSlice ? e.mozSlice(t, n) : e.slice ? e.slice(t, n) : null;
521
+ }
522
+ /**
523
+ * @license
524
+ * Copyright 2021 Google LLC
525
+ *
526
+ * Licensed under the Apache License, Version 2.0 (the "License");
527
+ * you may not use this file except in compliance with the License.
528
+ * You may obtain a copy of the License at
529
+ *
530
+ * http://www.apache.org/licenses/LICENSE-2.0
531
+ *
532
+ * Unless required by applicable law or agreed to in writing, software
533
+ * distributed under the License is distributed on an "AS IS" BASIS,
534
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
535
+ * See the License for the specific language governing permissions and
536
+ * limitations under the License.
537
+ */
538
+ function jt(e) {
539
+ if (typeof atob > "u")
540
+ throw Ot("base-64");
541
+ return atob(e);
542
+ }
543
+ /**
544
+ * @license
545
+ * Copyright 2017 Google LLC
546
+ *
547
+ * Licensed under the Apache License, Version 2.0 (the "License");
548
+ * you may not use this file except in compliance with the License.
549
+ * You may obtain a copy of the License at
550
+ *
551
+ * http://www.apache.org/licenses/LICENSE-2.0
552
+ *
553
+ * Unless required by applicable law or agreed to in writing, software
554
+ * distributed under the License is distributed on an "AS IS" BASIS,
555
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
556
+ * See the License for the specific language governing permissions and
557
+ * limitations under the License.
558
+ */
559
+ const B = {
560
+ /**
561
+ * Indicates the string should be interpreted "raw", that is, as normal text.
562
+ * The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte
563
+ * sequence.
564
+ * Example: The string 'Hello! \\ud83d\\ude0a' becomes the byte sequence
565
+ * 48 65 6c 6c 6f 21 20 f0 9f 98 8a
566
+ */
567
+ RAW: "raw",
568
+ /**
569
+ * Indicates the string should be interpreted as base64-encoded data.
570
+ * Padding characters (trailing '='s) are optional.
571
+ * Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence
572
+ * ad 69 8e fb e1 3a b7 bf eb 97
573
+ */
574
+ BASE64: "base64",
575
+ /**
576
+ * Indicates the string should be interpreted as base64url-encoded data.
577
+ * Padding characters (trailing '='s) are optional.
578
+ * Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence
579
+ * ad 69 8e fb e1 3a b7 bf eb 97
580
+ */
581
+ BASE64URL: "base64url",
582
+ /**
583
+ * Indicates the string is a data URL, such as one obtained from
584
+ * canvas.toDataURL().
585
+ * Example: the string 'data:application/octet-stream;base64,aaaa'
586
+ * becomes the byte sequence
587
+ * 69 a6 9a
588
+ * (the content-type "application/octet-stream" is also applied, but can
589
+ * be overridden in the metadata object).
590
+ */
591
+ DATA_URL: "data_url"
592
+ };
593
+ class fe {
594
+ constructor(t, n) {
595
+ this.data = t, this.contentType = n || null;
596
+ }
597
+ }
598
+ function Ht(e, t) {
599
+ switch (e) {
600
+ case B.RAW:
601
+ return new fe(Be(t));
602
+ case B.BASE64:
603
+ case B.BASE64URL:
604
+ return new fe(Fe(e, t));
605
+ case B.DATA_URL:
606
+ return new fe(Vt(t), Yt(t));
607
+ }
608
+ throw be();
609
+ }
610
+ function Be(e) {
611
+ const t = [];
612
+ for (let n = 0; n < e.length; n++) {
613
+ let r = e.charCodeAt(n);
614
+ if (r <= 127)
615
+ t.push(r);
616
+ else if (r <= 2047)
617
+ t.push(192 | r >> 6, 128 | r & 63);
618
+ else if ((r & 64512) === 55296)
619
+ if (!(n < e.length - 1 && (e.charCodeAt(n + 1) & 64512) === 56320))
620
+ t.push(239, 191, 189);
621
+ else {
622
+ const i = r, o = e.charCodeAt(++n);
623
+ r = 65536 | (i & 1023) << 10 | o & 1023, t.push(240 | r >> 18, 128 | r >> 12 & 63, 128 | r >> 6 & 63, 128 | r & 63);
624
+ }
625
+ else
626
+ (r & 64512) === 56320 ? t.push(239, 191, 189) : t.push(224 | r >> 12, 128 | r >> 6 & 63, 128 | r & 63);
627
+ }
628
+ return new Uint8Array(t);
629
+ }
630
+ function Wt(e) {
631
+ let t;
632
+ try {
633
+ t = decodeURIComponent(e);
634
+ } catch {
635
+ throw te(B.DATA_URL, "Malformed data URL.");
636
+ }
637
+ return Be(t);
638
+ }
639
+ function Fe(e, t) {
640
+ switch (e) {
641
+ case B.BASE64: {
642
+ const s = t.indexOf("-") !== -1, i = t.indexOf("_") !== -1;
643
+ if (s || i)
644
+ throw te(e, "Invalid character '" + (s ? "-" : "_") + "' found: is it base64url encoded?");
645
+ break;
646
+ }
647
+ case B.BASE64URL: {
648
+ const s = t.indexOf("+") !== -1, i = t.indexOf("/") !== -1;
649
+ if (s || i)
650
+ throw te(e, "Invalid character '" + (s ? "+" : "/") + "' found: is it base64 encoded?");
651
+ t = t.replace(/-/g, "+").replace(/_/g, "/");
652
+ break;
653
+ }
654
+ }
655
+ let n;
656
+ try {
657
+ n = jt(t);
658
+ } catch (s) {
659
+ throw s.message.includes("polyfill") ? s : te(e, "Invalid character found");
660
+ }
661
+ const r = new Uint8Array(n.length);
662
+ for (let s = 0; s < n.length; s++)
663
+ r[s] = n.charCodeAt(s);
664
+ return r;
665
+ }
666
+ class je {
667
+ constructor(t) {
668
+ this.base64 = !1, this.contentType = null;
669
+ const n = t.match(/^data:([^,]+)?,/);
670
+ if (n === null)
671
+ throw te(B.DATA_URL, "Must be formatted 'data:[<mediatype>][;base64],<data>");
672
+ const r = n[1] || null;
673
+ r != null && (this.base64 = qt(r, ";base64"), this.contentType = this.base64 ? r.substring(0, r.length - 7) : r), this.rest = t.substring(t.indexOf(",") + 1);
674
+ }
675
+ }
676
+ function Vt(e) {
677
+ const t = new je(e);
678
+ return t.base64 ? Fe(B.BASE64, t.rest) : Wt(t.rest);
679
+ }
680
+ function Yt(e) {
681
+ return new je(e).contentType;
682
+ }
683
+ function qt(e, t) {
684
+ return e.length >= t.length ? e.substring(e.length - t.length) === t : !1;
685
+ }
686
+ /**
687
+ * @license
688
+ * Copyright 2017 Google LLC
689
+ *
690
+ * Licensed under the Apache License, Version 2.0 (the "License");
691
+ * you may not use this file except in compliance with the License.
692
+ * You may obtain a copy of the License at
693
+ *
694
+ * http://www.apache.org/licenses/LICENSE-2.0
695
+ *
696
+ * Unless required by applicable law or agreed to in writing, software
697
+ * distributed under the License is distributed on an "AS IS" BASIS,
698
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
699
+ * See the License for the specific language governing permissions and
700
+ * limitations under the License.
701
+ */
702
+ class V {
703
+ constructor(t, n) {
704
+ let r = 0, s = "";
705
+ Se(t) ? (this.data_ = t, r = t.size, s = t.type) : t instanceof ArrayBuffer ? (n ? this.data_ = new Uint8Array(t) : (this.data_ = new Uint8Array(t.byteLength), this.data_.set(new Uint8Array(t))), r = this.data_.length) : t instanceof Uint8Array && (n ? this.data_ = t : (this.data_ = new Uint8Array(t.length), this.data_.set(t)), r = t.length), this.size_ = r, this.type_ = s;
706
+ }
707
+ size() {
708
+ return this.size_;
709
+ }
710
+ type() {
711
+ return this.type_;
712
+ }
713
+ slice(t, n) {
714
+ if (Se(this.data_)) {
715
+ const r = this.data_, s = Ft(r, t, n);
716
+ return s === null ? null : new V(s);
717
+ } else {
718
+ const r = new Uint8Array(this.data_.buffer, t, n - t);
719
+ return new V(r, !0);
720
+ }
721
+ }
722
+ static getBlob(...t) {
723
+ if (Te()) {
724
+ const n = t.map((r) => r instanceof V ? r.data_ : r);
725
+ return new V(Bt.apply(null, n));
726
+ } else {
727
+ const n = t.map((o) => we(o) ? Ht(B.RAW, o).data : o.data_);
728
+ let r = 0;
729
+ n.forEach((o) => {
730
+ r += o.byteLength;
731
+ });
732
+ const s = new Uint8Array(r);
733
+ let i = 0;
734
+ return n.forEach((o) => {
735
+ for (let h = 0; h < o.length; h++)
736
+ s[i++] = o[h];
737
+ }), new V(s, !0);
738
+ }
739
+ }
740
+ uploadData() {
741
+ return this.data_;
742
+ }
743
+ }
744
+ /**
745
+ * @license
746
+ * Copyright 2017 Google LLC
747
+ *
748
+ * Licensed under the Apache License, Version 2.0 (the "License");
749
+ * you may not use this file except in compliance with the License.
750
+ * You may obtain a copy of the License at
751
+ *
752
+ * http://www.apache.org/licenses/LICENSE-2.0
753
+ *
754
+ * Unless required by applicable law or agreed to in writing, software
755
+ * distributed under the License is distributed on an "AS IS" BASIS,
756
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
757
+ * See the License for the specific language governing permissions and
758
+ * limitations under the License.
759
+ */
760
+ function He(e) {
761
+ let t;
762
+ try {
763
+ t = JSON.parse(e);
764
+ } catch {
765
+ return null;
766
+ }
767
+ return $t(t) ? t : null;
768
+ }
769
+ /**
770
+ * @license
771
+ * Copyright 2017 Google LLC
772
+ *
773
+ * Licensed under the Apache License, Version 2.0 (the "License");
774
+ * you may not use this file except in compliance with the License.
775
+ * You may obtain a copy of the License at
776
+ *
777
+ * http://www.apache.org/licenses/LICENSE-2.0
778
+ *
779
+ * Unless required by applicable law or agreed to in writing, software
780
+ * distributed under the License is distributed on an "AS IS" BASIS,
781
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
782
+ * See the License for the specific language governing permissions and
783
+ * limitations under the License.
784
+ */
785
+ function zt(e) {
786
+ if (e.length === 0)
787
+ return null;
788
+ const t = e.lastIndexOf("/");
789
+ return t === -1 ? "" : e.slice(0, t);
790
+ }
791
+ function Xt(e, t) {
792
+ const n = t.split("/").filter((r) => r.length > 0).join("/");
793
+ return e.length === 0 ? n : e + "/" + n;
794
+ }
795
+ function We(e) {
796
+ const t = e.lastIndexOf("/", e.length - 2);
797
+ return t === -1 ? e : e.slice(t + 1);
798
+ }
799
+ /**
800
+ * @license
801
+ * Copyright 2017 Google LLC
802
+ *
803
+ * Licensed under the Apache License, Version 2.0 (the "License");
804
+ * you may not use this file except in compliance with the License.
805
+ * You may obtain a copy of the License at
806
+ *
807
+ * http://www.apache.org/licenses/LICENSE-2.0
808
+ *
809
+ * Unless required by applicable law or agreed to in writing, software
810
+ * distributed under the License is distributed on an "AS IS" BASIS,
811
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
812
+ * See the License for the specific language governing permissions and
813
+ * limitations under the License.
814
+ */
815
+ function Gt(e, t) {
816
+ return t;
817
+ }
818
+ class I {
819
+ constructor(t, n, r, s) {
820
+ this.server = t, this.local = n || t, this.writable = !!r, this.xform = s || Gt;
821
+ }
822
+ }
823
+ let ce = null;
824
+ function Kt(e) {
825
+ return !we(e) || e.length < 2 ? e : We(e);
826
+ }
827
+ function Ve() {
828
+ if (ce)
829
+ return ce;
830
+ const e = [];
831
+ e.push(new I("bucket")), e.push(new I("generation")), e.push(new I("metageneration")), e.push(new I("name", "fullPath", !0));
832
+ function t(i, o) {
833
+ return Kt(o);
834
+ }
835
+ const n = new I("name");
836
+ n.xform = t, e.push(n);
837
+ function r(i, o) {
838
+ return o !== void 0 ? Number(o) : o;
839
+ }
840
+ const s = new I("size");
841
+ return s.xform = r, e.push(s), e.push(new I("timeCreated")), e.push(new I("updated")), e.push(new I("md5Hash", null, !0)), e.push(new I("cacheControl", null, !0)), e.push(new I("contentDisposition", null, !0)), e.push(new I("contentEncoding", null, !0)), e.push(new I("contentLanguage", null, !0)), e.push(new I("contentType", null, !0)), e.push(new I("metadata", "customMetadata", !0)), ce = e, ce;
842
+ }
843
+ function Zt(e, t) {
844
+ function n() {
845
+ const r = e.bucket, s = e.fullPath, i = new x(r, s);
846
+ return t._makeStorageReference(i);
847
+ }
848
+ Object.defineProperty(e, "ref", { get: n });
849
+ }
850
+ function Jt(e, t, n) {
851
+ const r = {};
852
+ r.type = "file";
853
+ const s = n.length;
854
+ for (let i = 0; i < s; i++) {
855
+ const o = n[i];
856
+ r[o.local] = o.xform(r, t[o.server]);
857
+ }
858
+ return Zt(r, e), r;
859
+ }
860
+ function Ye(e, t, n) {
861
+ const r = He(t);
862
+ return r === null ? null : Jt(e, r, n);
863
+ }
864
+ function Qt(e, t, n, r) {
865
+ const s = He(t);
866
+ if (s === null || !we(s.downloadTokens))
867
+ return null;
868
+ const i = s.downloadTokens;
869
+ if (i.length === 0)
870
+ return null;
871
+ const o = encodeURIComponent;
872
+ return i.split(",").map((m) => {
873
+ const T = e.bucket, b = e.fullPath, O = "/b/" + o(T) + "/o/" + o(b), E = he(O, n, r), A = Le({
874
+ alt: "media",
875
+ token: m
876
+ });
877
+ return E + A;
878
+ })[0];
879
+ }
880
+ function en(e, t) {
881
+ const n = {}, r = t.length;
882
+ for (let s = 0; s < r; s++) {
883
+ const i = t[s];
884
+ i.writable && (n[i.server] = e[i.local]);
885
+ }
886
+ return JSON.stringify(n);
887
+ }
888
+ class ye {
889
+ constructor(t, n, r, s) {
890
+ this.url = t, this.method = n, this.handler = r, this.timeout = s, this.urlParams = {}, this.headers = {}, this.body = null, this.errorHandler = null, this.progressCallback = null, this.successCodes = [200], this.additionalRetryCodes = [];
891
+ }
892
+ }
893
+ /**
894
+ * @license
895
+ * Copyright 2017 Google LLC
896
+ *
897
+ * Licensed under the Apache License, Version 2.0 (the "License");
898
+ * you may not use this file except in compliance with the License.
899
+ * You may obtain a copy of the License at
900
+ *
901
+ * http://www.apache.org/licenses/LICENSE-2.0
902
+ *
903
+ * Unless required by applicable law or agreed to in writing, software
904
+ * distributed under the License is distributed on an "AS IS" BASIS,
905
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
906
+ * See the License for the specific language governing permissions and
907
+ * limitations under the License.
908
+ */
909
+ function qe(e) {
910
+ if (!e)
911
+ throw be();
912
+ }
913
+ function tn(e, t) {
914
+ function n(r, s) {
915
+ const i = Ye(e, s, t);
916
+ return qe(i !== null), i;
917
+ }
918
+ return n;
919
+ }
920
+ function nn(e, t) {
921
+ function n(r, s) {
922
+ const i = Ye(e, s, t);
923
+ return qe(i !== null), Qt(i, s, e.host, e._protocol);
924
+ }
925
+ return n;
926
+ }
927
+ function ze(e) {
928
+ function t(n, r) {
929
+ let s;
930
+ return n.getStatus() === 401 ? /* This exact message string is the only consistent part of the */ /* server's error response that identifies it as an App Check error. */ n.getErrorText().includes("Firebase App Check token is invalid") ? s = _t() : s = pt() : n.getStatus() === 402 ? s = ft(e.bucket) : n.getStatus() === 403 ? s = mt(e.path) : s = r, s.status = n.getStatus(), s.serverResponse = r.serverResponse, s;
931
+ }
932
+ return t;
933
+ }
934
+ function Xe(e) {
935
+ const t = ze(e);
936
+ function n(r, s) {
937
+ let i = t(r, s);
938
+ return r.getStatus() === 404 && (i = dt(e.path)), i.serverResponse = s.serverResponse, i;
939
+ }
940
+ return n;
941
+ }
942
+ function rn(e, t, n) {
943
+ const r = t.fullServerUrl(), s = he(r, e.host, e._protocol), i = "GET", o = e.maxOperationRetryTime, h = new ye(s, i, nn(e, n), o);
944
+ return h.errorHandler = Xe(t), h;
945
+ }
946
+ function sn(e, t) {
947
+ const n = t.fullServerUrl(), r = he(n, e.host, e._protocol), s = "DELETE", i = e.maxOperationRetryTime;
948
+ function o(d, m) {
949
+ }
950
+ const h = new ye(r, s, o, i);
951
+ return h.successCodes = [200, 204], h.errorHandler = Xe(t), h;
952
+ }
953
+ function on(e, t) {
954
+ return e && e.contentType || t && t.type() || "application/octet-stream";
955
+ }
956
+ function an(e, t, n) {
957
+ const r = Object.assign({}, n);
958
+ return r.fullPath = e.path, r.size = t.size(), r.contentType || (r.contentType = on(null, t)), r;
959
+ }
960
+ function un(e, t, n, r, s) {
961
+ const i = t.bucketOnlyServerUrl(), o = {
962
+ "X-Goog-Upload-Protocol": "multipart"
963
+ };
964
+ function h() {
965
+ let P = "";
966
+ for (let $ = 0; $ < 2; $++)
967
+ P = P + Math.random().toString().slice(2);
968
+ return P;
969
+ }
970
+ const d = h();
971
+ o["Content-Type"] = "multipart/related; boundary=" + d;
972
+ const m = an(t, r, s), T = en(m, n), b = "--" + d + `\r
973
+ Content-Type: application/json; charset=utf-8\r
974
+ \r
975
+ ` + T + `\r
976
+ --` + d + `\r
977
+ Content-Type: ` + m.contentType + `\r
978
+ \r
979
+ `, O = `\r
980
+ --` + d + "--", E = V.getBlob(b, r, O);
981
+ if (E === null)
982
+ throw Rt();
983
+ const A = { name: m.fullPath }, F = he(i, e.host, e._protocol), U = "POST", H = e.maxUploadRetryTime, j = new ye(F, U, tn(e, n), H);
984
+ return j.urlParams = A, j.headers = o, j.body = E.uploadData(), j.errorHandler = ze(t), j;
985
+ }
986
+ class cn {
987
+ constructor() {
988
+ this.sent_ = !1, this.xhr_ = new XMLHttpRequest(), this.initXhr(), this.errorCode_ = G.NO_ERROR, this.sendPromise_ = new Promise((t) => {
989
+ this.xhr_.addEventListener("abort", () => {
990
+ this.errorCode_ = G.ABORT, t();
991
+ }), this.xhr_.addEventListener("error", () => {
992
+ this.errorCode_ = G.NETWORK_ERROR, t();
993
+ }), this.xhr_.addEventListener("load", () => {
994
+ t();
995
+ });
996
+ });
997
+ }
998
+ send(t, n, r, s) {
999
+ if (this.sent_)
1000
+ throw ee("cannot .send() more than once");
1001
+ if (this.sent_ = !0, this.xhr_.open(n, t, !0), s !== void 0)
1002
+ for (const i in s)
1003
+ s.hasOwnProperty(i) && this.xhr_.setRequestHeader(i, s[i].toString());
1004
+ return r !== void 0 ? this.xhr_.send(r) : this.xhr_.send(), this.sendPromise_;
1005
+ }
1006
+ getErrorCode() {
1007
+ if (!this.sent_)
1008
+ throw ee("cannot .getErrorCode() before sending");
1009
+ return this.errorCode_;
1010
+ }
1011
+ getStatus() {
1012
+ if (!this.sent_)
1013
+ throw ee("cannot .getStatus() before sending");
1014
+ try {
1015
+ return this.xhr_.status;
1016
+ } catch {
1017
+ return -1;
1018
+ }
1019
+ }
1020
+ getResponse() {
1021
+ if (!this.sent_)
1022
+ throw ee("cannot .getResponse() before sending");
1023
+ return this.xhr_.response;
1024
+ }
1025
+ getErrorText() {
1026
+ if (!this.sent_)
1027
+ throw ee("cannot .getErrorText() before sending");
1028
+ return this.xhr_.statusText;
1029
+ }
1030
+ /** Aborts the request. */
1031
+ abort() {
1032
+ this.xhr_.abort();
1033
+ }
1034
+ getResponseHeader(t) {
1035
+ return this.xhr_.getResponseHeader(t);
1036
+ }
1037
+ addUploadProgressListener(t) {
1038
+ this.xhr_.upload != null && this.xhr_.upload.addEventListener("progress", t);
1039
+ }
1040
+ removeUploadProgressListener(t) {
1041
+ this.xhr_.upload != null && this.xhr_.upload.removeEventListener("progress", t);
1042
+ }
1043
+ }
1044
+ class ln extends cn {
1045
+ initXhr() {
1046
+ this.xhr_.responseType = "text";
1047
+ }
1048
+ }
1049
+ function Re() {
1050
+ return new ln();
1051
+ }
1052
+ /**
1053
+ * @license
1054
+ * Copyright 2019 Google LLC
1055
+ *
1056
+ * Licensed under the Apache License, Version 2.0 (the "License");
1057
+ * you may not use this file except in compliance with the License.
1058
+ * You may obtain a copy of the License at
1059
+ *
1060
+ * http://www.apache.org/licenses/LICENSE-2.0
1061
+ *
1062
+ * Unless required by applicable law or agreed to in writing, software
1063
+ * distributed under the License is distributed on an "AS IS" BASIS,
1064
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1065
+ * See the License for the specific language governing permissions and
1066
+ * limitations under the License.
1067
+ */
1068
+ class K {
1069
+ constructor(t, n) {
1070
+ this._service = t, n instanceof x ? this._location = n : this._location = x.makeFromUrl(n, t.host);
1071
+ }
1072
+ /**
1073
+ * Returns the URL for the bucket and path this object references,
1074
+ * in the form gs://<bucket>/<object-path>
1075
+ * @override
1076
+ */
1077
+ toString() {
1078
+ return "gs://" + this._location.bucket + "/" + this._location.path;
1079
+ }
1080
+ _newRef(t, n) {
1081
+ return new K(t, n);
1082
+ }
1083
+ /**
1084
+ * A reference to the root of this object's bucket.
1085
+ */
1086
+ get root() {
1087
+ const t = new x(this._location.bucket, "");
1088
+ return this._newRef(this._service, t);
1089
+ }
1090
+ /**
1091
+ * The name of the bucket containing this reference's object.
1092
+ */
1093
+ get bucket() {
1094
+ return this._location.bucket;
1095
+ }
1096
+ /**
1097
+ * The full path of this object.
1098
+ */
1099
+ get fullPath() {
1100
+ return this._location.path;
1101
+ }
1102
+ /**
1103
+ * The short name of this object, which is the last component of the full path.
1104
+ * For example, if fullPath is 'full/path/image.png', name is 'image.png'.
1105
+ */
1106
+ get name() {
1107
+ return We(this._location.path);
1108
+ }
1109
+ /**
1110
+ * The `StorageService` instance this `StorageReference` is associated with.
1111
+ */
1112
+ get storage() {
1113
+ return this._service;
1114
+ }
1115
+ /**
1116
+ * A `StorageReference` pointing to the parent location of this `StorageReference`, or null if
1117
+ * this reference is the root.
1118
+ */
1119
+ get parent() {
1120
+ const t = zt(this._location.path);
1121
+ if (t === null)
1122
+ return null;
1123
+ const n = new x(this._location.bucket, t);
1124
+ return new K(this._service, n);
1125
+ }
1126
+ /**
1127
+ * Utility function to throw an error in methods that do not accept a root reference.
1128
+ */
1129
+ _throwIfRoot(t) {
1130
+ if (this._location.path === "")
1131
+ throw Et(t);
1132
+ }
1133
+ }
1134
+ function hn(e, t, n) {
1135
+ e._throwIfRoot("uploadBytes");
1136
+ const r = un(e.storage, e._location, Ve(), new V(t, !0), n);
1137
+ return e.storage.makeRequestWithTokens(r, Re).then((s) => ({
1138
+ metadata: s,
1139
+ ref: e
1140
+ }));
1141
+ }
1142
+ function dn(e) {
1143
+ e._throwIfRoot("getDownloadURL");
1144
+ const t = rn(e.storage, e._location, Ve());
1145
+ return e.storage.makeRequestWithTokens(t, Re).then((n) => {
1146
+ if (n === null)
1147
+ throw kt();
1148
+ return n;
1149
+ });
1150
+ }
1151
+ function fn(e) {
1152
+ e._throwIfRoot("deleteObject");
1153
+ const t = sn(e.storage, e._location);
1154
+ return e.storage.makeRequestWithTokens(t, Re);
1155
+ }
1156
+ function pn(e, t) {
1157
+ const n = Xt(e._location.path, t), r = new x(e._location.bucket, n);
1158
+ return new K(e.storage, r);
1159
+ }
1160
+ /**
1161
+ * @license
1162
+ * Copyright 2017 Google LLC
1163
+ *
1164
+ * Licensed under the Apache License, Version 2.0 (the "License");
1165
+ * you may not use this file except in compliance with the License.
1166
+ * You may obtain a copy of the License at
1167
+ *
1168
+ * http://www.apache.org/licenses/LICENSE-2.0
1169
+ *
1170
+ * Unless required by applicable law or agreed to in writing, software
1171
+ * distributed under the License is distributed on an "AS IS" BASIS,
1172
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1173
+ * See the License for the specific language governing permissions and
1174
+ * limitations under the License.
1175
+ */
1176
+ function _n(e) {
1177
+ return /^[A-Za-z]+:\/\//.test(e);
1178
+ }
1179
+ function mn(e, t) {
1180
+ return new K(e, t);
1181
+ }
1182
+ function Ge(e, t) {
1183
+ if (e instanceof ke) {
1184
+ const n = e;
1185
+ if (n._bucket == null)
1186
+ throw yt();
1187
+ const r = new K(n, n._bucket);
1188
+ return t != null ? Ge(r, t) : r;
1189
+ } else
1190
+ return t !== void 0 ? pn(e, t) : e;
1191
+ }
1192
+ function gn(e, t) {
1193
+ if (t && _n(t)) {
1194
+ if (e instanceof ke)
1195
+ return mn(e, t);
1196
+ throw me("To use ref(service, url), the first argument must be a Storage instance.");
1197
+ } else
1198
+ return Ge(e, t);
1199
+ }
1200
+ function Ae(e, t) {
1201
+ const n = t == null ? void 0 : t[Ce];
1202
+ return n == null ? null : x.makeFromBucketSpec(n, e);
1203
+ }
1204
+ function bn(e, t, n, r = {}) {
1205
+ e.host = `${t}:${n}`, e._protocol = "http";
1206
+ const { mockUserToken: s } = r;
1207
+ s && (e._overrideAuthToken = typeof s == "string" ? s : st(s, e.app.options.projectId));
1208
+ }
1209
+ class ke {
1210
+ constructor(t, n, r, s, i) {
1211
+ this.app = t, this._authProvider = n, this._appCheckProvider = r, this._url = s, this._firebaseVersion = i, this._bucket = null, this._host = xe, this._protocol = "https", this._appId = null, this._deleted = !1, this._maxOperationRetryTime = lt, this._maxUploadRetryTime = ht, this._requests = /* @__PURE__ */ new Set(), s != null ? this._bucket = x.makeFromBucketSpec(s, this._host) : this._bucket = Ae(this._host, this.app.options);
1212
+ }
1213
+ /**
1214
+ * The host string for this service, in the form of `host` or
1215
+ * `host:port`.
1216
+ */
1217
+ get host() {
1218
+ return this._host;
1219
+ }
1220
+ set host(t) {
1221
+ this._host = t, this._url != null ? this._bucket = x.makeFromBucketSpec(this._url, t) : this._bucket = Ae(t, this.app.options);
1222
+ }
1223
+ /**
1224
+ * The maximum time to retry uploads in milliseconds.
1225
+ */
1226
+ get maxUploadRetryTime() {
1227
+ return this._maxUploadRetryTime;
1228
+ }
1229
+ set maxUploadRetryTime(t) {
1230
+ ve(
1231
+ "time",
1232
+ /* minValue=*/
1233
+ 0,
1234
+ /* maxValue= */
1235
+ Number.POSITIVE_INFINITY,
1236
+ t
1237
+ ), this._maxUploadRetryTime = t;
1238
+ }
1239
+ /**
1240
+ * The maximum time to retry operations other than uploads or downloads in
1241
+ * milliseconds.
1242
+ */
1243
+ get maxOperationRetryTime() {
1244
+ return this._maxOperationRetryTime;
1245
+ }
1246
+ set maxOperationRetryTime(t) {
1247
+ ve(
1248
+ "time",
1249
+ /* minValue=*/
1250
+ 0,
1251
+ /* maxValue= */
1252
+ Number.POSITIVE_INFINITY,
1253
+ t
1254
+ ), this._maxOperationRetryTime = t;
1255
+ }
1256
+ async _getAuthToken() {
1257
+ if (this._overrideAuthToken)
1258
+ return this._overrideAuthToken;
1259
+ const t = this._authProvider.getImmediate({ optional: !0 });
1260
+ if (t) {
1261
+ const n = await t.getToken();
1262
+ if (n !== null)
1263
+ return n.accessToken;
1264
+ }
1265
+ return null;
1266
+ }
1267
+ async _getAppCheckToken() {
1268
+ const t = this._appCheckProvider.getImmediate({ optional: !0 });
1269
+ return t ? (await t.getToken()).token : null;
1270
+ }
1271
+ /**
1272
+ * Stop running requests and prevent more from being created.
1273
+ */
1274
+ _delete() {
1275
+ return this._deleted || (this._deleted = !0, this._requests.forEach((t) => t.cancel()), this._requests.clear()), Promise.resolve();
1276
+ }
1277
+ /**
1278
+ * Returns a new firebaseStorage.Reference object referencing this StorageService
1279
+ * at the given Location.
1280
+ */
1281
+ _makeStorageReference(t) {
1282
+ return new K(this, t);
1283
+ }
1284
+ /**
1285
+ * @param requestInfo - HTTP RequestInfo object
1286
+ * @param authToken - Firebase auth token
1287
+ */
1288
+ _makeRequest(t, n, r, s, i = !0) {
1289
+ if (this._deleted)
1290
+ return new St(Me());
1291
+ {
1292
+ const o = Mt(t, this._appId, r, s, n, this._firebaseVersion, i);
1293
+ return this._requests.add(o), o.getPromise().then(() => this._requests.delete(o), () => this._requests.delete(o)), o;
1294
+ }
1295
+ }
1296
+ async makeRequestWithTokens(t, n) {
1297
+ const [r, s] = await Promise.all([
1298
+ this._getAuthToken(),
1299
+ this._getAppCheckToken()
1300
+ ]);
1301
+ return this._makeRequest(t, n, r, s).getPromise();
1302
+ }
1303
+ }
1304
+ const Ue = "@firebase/storage", $e = "0.13.2";
1305
+ /**
1306
+ * @license
1307
+ * Copyright 2020 Google LLC
1308
+ *
1309
+ * Licensed under the Apache License, Version 2.0 (the "License");
1310
+ * you may not use this file except in compliance with the License.
1311
+ * You may obtain a copy of the License at
1312
+ *
1313
+ * http://www.apache.org/licenses/LICENSE-2.0
1314
+ *
1315
+ * Unless required by applicable law or agreed to in writing, software
1316
+ * distributed under the License is distributed on an "AS IS" BASIS,
1317
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1318
+ * See the License for the specific language governing permissions and
1319
+ * limitations under the License.
1320
+ */
1321
+ const Ke = "storage";
1322
+ function wn(e, t, n) {
1323
+ return e = re(e), hn(e, t, n);
1324
+ }
1325
+ function Tn(e) {
1326
+ return e = re(e), dn(e);
1327
+ }
1328
+ function yn(e) {
1329
+ return e = re(e), fn(e);
1330
+ }
1331
+ function Ne(e, t) {
1332
+ return e = re(e), gn(e, t);
1333
+ }
1334
+ function Ie(e = _e(), t) {
1335
+ e = re(e);
1336
+ const r = tt(e, Ke).getImmediate({
1337
+ identifier: t
1338
+ }), s = nt("storage");
1339
+ return s && Rn(r, ...s), r;
1340
+ }
1341
+ function Rn(e, t, n, r = {}) {
1342
+ bn(e, t, n, r);
1343
+ }
1344
+ function kn(e, { instanceIdentifier: t }) {
1345
+ const n = e.getProvider("app").getImmediate(), r = e.getProvider("auth-internal"), s = e.getProvider("app-check-internal");
1346
+ return new ke(n, r, s, t, et);
1347
+ }
1348
+ function On() {
1349
+ Je(new Qe(
1350
+ Ke,
1351
+ kn,
1352
+ "PUBLIC"
1353
+ /* ComponentType.PUBLIC */
1354
+ ).setMultipleInstances(!0)), Ee(Ue, $e, ""), Ee(Ue, $e, "esm2017");
1355
+ }
1356
+ On();
1357
+ const ne = {
1358
+ async update(e, t, n) {
1359
+ const r = Ie(_e(), n), s = Ne(r, e);
1360
+ return await wn(s, t), Tn(s);
1361
+ },
1362
+ async delete(e, t) {
1363
+ const n = Ie(_e(), t), r = Ne(n, e);
1364
+ await yn(r);
1365
+ }
1366
+ };
1367
+ var Ze = { exports: {} };
1368
+ (function(e, t) {
1369
+ (function(n, r) {
1370
+ e.exports = r();
1371
+ })(ot, function() {
1372
+ var n = 1e3, r = 6e4, s = 36e5, i = "millisecond", o = "second", h = "minute", d = "hour", m = "day", T = "week", b = "month", O = "quarter", E = "year", A = "date", F = "Invalid Date", U = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, H = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, j = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(f) {
1373
+ var c = ["th", "st", "nd", "rd"], a = f % 100;
1374
+ return "[" + f + (c[(a - 20) % 10] || c[a] || c[0]) + "]";
1375
+ } }, P = function(f, c, a) {
1376
+ var l = String(f);
1377
+ return !l || l.length >= c ? f : "" + Array(c + 1 - l.length).join(a) + f;
1378
+ }, $ = { s: P, z: function(f) {
1379
+ var c = -f.utcOffset(), a = Math.abs(c), l = Math.floor(a / 60), u = a % 60;
1380
+ return (c <= 0 ? "+" : "-") + P(l, 2, "0") + ":" + P(u, 2, "0");
1381
+ }, m: function f(c, a) {
1382
+ if (c.date() < a.date()) return -f(a, c);
1383
+ var l = 12 * (a.year() - c.year()) + (a.month() - c.month()), u = c.clone().add(l, b), p = a - u < 0, _ = c.clone().add(l + (p ? -1 : 1), b);
1384
+ return +(-(l + (a - u) / (p ? u - _ : _ - u)) || 0);
1385
+ }, a: function(f) {
1386
+ return f < 0 ? Math.ceil(f) || 0 : Math.floor(f);
1387
+ }, p: function(f) {
1388
+ return { M: b, y: E, w: T, d: m, D: A, h: d, m: h, s: o, ms: i, Q: O }[f] || String(f || "").toLowerCase().replace(/s$/, "");
1389
+ }, u: function(f) {
1390
+ return f === void 0;
1391
+ } }, L = "en", M = {};
1392
+ M[L] = j;
1393
+ var se = "$isDayjsObject", q = function(f) {
1394
+ return f instanceof oe || !(!f || !f[se]);
1395
+ }, ie = function f(c, a, l) {
1396
+ var u;
1397
+ if (!c) return L;
1398
+ if (typeof c == "string") {
1399
+ var p = c.toLowerCase();
1400
+ M[p] && (u = p), a && (M[p] = a, u = p);
1401
+ var _ = c.split("-");
1402
+ if (!u && _.length > 1) return f(_[0]);
1403
+ } else {
1404
+ var w = c.name;
1405
+ M[w] = c, u = w;
1406
+ }
1407
+ return !l && u && (L = u), u || !l && L;
1408
+ }, S = function(f, c) {
1409
+ if (q(f)) return f.clone();
1410
+ var a = typeof c == "object" ? c : {};
1411
+ return a.date = f, a.args = arguments, new oe(a);
1412
+ }, g = $;
1413
+ g.l = ie, g.i = q, g.w = function(f, c) {
1414
+ return S(f, { locale: c.$L, utc: c.$u, x: c.$x, $offset: c.$offset });
1415
+ };
1416
+ var oe = function() {
1417
+ function f(a) {
1418
+ this.$L = ie(a.locale, null, !0), this.parse(a), this.$x = this.$x || a.x || {}, this[se] = !0;
1419
+ }
1420
+ var c = f.prototype;
1421
+ return c.parse = function(a) {
1422
+ this.$d = function(l) {
1423
+ var u = l.date, p = l.utc;
1424
+ if (u === null) return /* @__PURE__ */ new Date(NaN);
1425
+ if (g.u(u)) return /* @__PURE__ */ new Date();
1426
+ if (u instanceof Date) return new Date(u);
1427
+ if (typeof u == "string" && !/Z$/i.test(u)) {
1428
+ var _ = u.match(U);
1429
+ if (_) {
1430
+ var w = _[2] - 1 || 0, k = (_[7] || "0").substring(0, 3);
1431
+ return p ? new Date(Date.UTC(_[1], w, _[3] || 1, _[4] || 0, _[5] || 0, _[6] || 0, k)) : new Date(_[1], w, _[3] || 1, _[4] || 0, _[5] || 0, _[6] || 0, k);
1432
+ }
1433
+ }
1434
+ return new Date(u);
1435
+ }(a), this.init();
1436
+ }, c.init = function() {
1437
+ var a = this.$d;
1438
+ this.$y = a.getFullYear(), this.$M = a.getMonth(), this.$D = a.getDate(), this.$W = a.getDay(), this.$H = a.getHours(), this.$m = a.getMinutes(), this.$s = a.getSeconds(), this.$ms = a.getMilliseconds();
1439
+ }, c.$utils = function() {
1440
+ return g;
1441
+ }, c.isValid = function() {
1442
+ return this.$d.toString() !== F;
1443
+ }, c.isSame = function(a, l) {
1444
+ var u = S(a);
1445
+ return this.startOf(l) <= u && u <= this.endOf(l);
1446
+ }, c.isAfter = function(a, l) {
1447
+ return S(a) < this.startOf(l);
1448
+ }, c.isBefore = function(a, l) {
1449
+ return this.endOf(l) < S(a);
1450
+ }, c.$g = function(a, l, u) {
1451
+ return g.u(a) ? this[l] : this.set(u, a);
1452
+ }, c.unix = function() {
1453
+ return Math.floor(this.valueOf() / 1e3);
1454
+ }, c.valueOf = function() {
1455
+ return this.$d.getTime();
1456
+ }, c.startOf = function(a, l) {
1457
+ var u = this, p = !!g.u(l) || l, _ = g.p(a), w = function(X, D) {
1458
+ var W = g.w(u.$u ? Date.UTC(u.$y, D, X) : new Date(u.$y, D, X), u);
1459
+ return p ? W : W.endOf(m);
1460
+ }, k = function(X, D) {
1461
+ return g.w(u.toDate()[X].apply(u.toDate("s"), (p ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(D)), u);
1462
+ }, v = this.$W, N = this.$M, C = this.$D, Z = "set" + (this.$u ? "UTC" : "");
1463
+ switch (_) {
1464
+ case E:
1465
+ return p ? w(1, 0) : w(31, 11);
1466
+ case b:
1467
+ return p ? w(1, N) : w(0, N + 1);
1468
+ case T:
1469
+ var z = this.$locale().weekStart || 0, J = (v < z ? v + 7 : v) - z;
1470
+ return w(p ? C - J : C + (6 - J), N);
1471
+ case m:
1472
+ case A:
1473
+ return k(Z + "Hours", 0);
1474
+ case d:
1475
+ return k(Z + "Minutes", 1);
1476
+ case h:
1477
+ return k(Z + "Seconds", 2);
1478
+ case o:
1479
+ return k(Z + "Milliseconds", 3);
1480
+ default:
1481
+ return this.clone();
1482
+ }
1483
+ }, c.endOf = function(a) {
1484
+ return this.startOf(a, !1);
1485
+ }, c.$set = function(a, l) {
1486
+ var u, p = g.p(a), _ = "set" + (this.$u ? "UTC" : ""), w = (u = {}, u[m] = _ + "Date", u[A] = _ + "Date", u[b] = _ + "Month", u[E] = _ + "FullYear", u[d] = _ + "Hours", u[h] = _ + "Minutes", u[o] = _ + "Seconds", u[i] = _ + "Milliseconds", u)[p], k = p === m ? this.$D + (l - this.$W) : l;
1487
+ if (p === b || p === E) {
1488
+ var v = this.clone().set(A, 1);
1489
+ v.$d[w](k), v.init(), this.$d = v.set(A, Math.min(this.$D, v.daysInMonth())).$d;
1490
+ } else w && this.$d[w](k);
1491
+ return this.init(), this;
1492
+ }, c.set = function(a, l) {
1493
+ return this.clone().$set(a, l);
1494
+ }, c.get = function(a) {
1495
+ return this[g.p(a)]();
1496
+ }, c.add = function(a, l) {
1497
+ var u, p = this;
1498
+ a = Number(a);
1499
+ var _ = g.p(l), w = function(N) {
1500
+ var C = S(p);
1501
+ return g.w(C.date(C.date() + Math.round(N * a)), p);
1502
+ };
1503
+ if (_ === b) return this.set(b, this.$M + a);
1504
+ if (_ === E) return this.set(E, this.$y + a);
1505
+ if (_ === m) return w(1);
1506
+ if (_ === T) return w(7);
1507
+ var k = (u = {}, u[h] = r, u[d] = s, u[o] = n, u)[_] || 1, v = this.$d.getTime() + a * k;
1508
+ return g.w(v, this);
1509
+ }, c.subtract = function(a, l) {
1510
+ return this.add(-1 * a, l);
1511
+ }, c.format = function(a) {
1512
+ var l = this, u = this.$locale();
1513
+ if (!this.isValid()) return u.invalidDate || F;
1514
+ var p = a || "YYYY-MM-DDTHH:mm:ssZ", _ = g.z(this), w = this.$H, k = this.$m, v = this.$M, N = u.weekdays, C = u.months, Z = u.meridiem, z = function(D, W, Q, ae) {
1515
+ return D && (D[W] || D(l, p)) || Q[W].slice(0, ae);
1516
+ }, J = function(D) {
1517
+ return g.s(w % 12 || 12, D, "0");
1518
+ }, X = Z || function(D, W, Q) {
1519
+ var ae = D < 12 ? "AM" : "PM";
1520
+ return Q ? ae.toLowerCase() : ae;
1521
+ };
1522
+ return p.replace(H, function(D, W) {
1523
+ return W || function(Q) {
1524
+ switch (Q) {
1525
+ case "YY":
1526
+ return String(l.$y).slice(-2);
1527
+ case "YYYY":
1528
+ return g.s(l.$y, 4, "0");
1529
+ case "M":
1530
+ return v + 1;
1531
+ case "MM":
1532
+ return g.s(v + 1, 2, "0");
1533
+ case "MMM":
1534
+ return z(u.monthsShort, v, C, 3);
1535
+ case "MMMM":
1536
+ return z(C, v);
1537
+ case "D":
1538
+ return l.$D;
1539
+ case "DD":
1540
+ return g.s(l.$D, 2, "0");
1541
+ case "d":
1542
+ return String(l.$W);
1543
+ case "dd":
1544
+ return z(u.weekdaysMin, l.$W, N, 2);
1545
+ case "ddd":
1546
+ return z(u.weekdaysShort, l.$W, N, 3);
1547
+ case "dddd":
1548
+ return N[l.$W];
1549
+ case "H":
1550
+ return String(w);
1551
+ case "HH":
1552
+ return g.s(w, 2, "0");
1553
+ case "h":
1554
+ return J(1);
1555
+ case "hh":
1556
+ return J(2);
1557
+ case "a":
1558
+ return X(w, k, !0);
1559
+ case "A":
1560
+ return X(w, k, !1);
1561
+ case "m":
1562
+ return String(k);
1563
+ case "mm":
1564
+ return g.s(k, 2, "0");
1565
+ case "s":
1566
+ return String(l.$s);
1567
+ case "ss":
1568
+ return g.s(l.$s, 2, "0");
1569
+ case "SSS":
1570
+ return g.s(l.$ms, 3, "0");
1571
+ case "Z":
1572
+ return _;
1573
+ }
1574
+ return null;
1575
+ }(D) || _.replace(":", "");
1576
+ });
1577
+ }, c.utcOffset = function() {
1578
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
1579
+ }, c.diff = function(a, l, u) {
1580
+ var p, _ = this, w = g.p(l), k = S(a), v = (k.utcOffset() - this.utcOffset()) * r, N = this - k, C = function() {
1581
+ return g.m(_, k);
1582
+ };
1583
+ switch (w) {
1584
+ case E:
1585
+ p = C() / 12;
1586
+ break;
1587
+ case b:
1588
+ p = C();
1589
+ break;
1590
+ case O:
1591
+ p = C() / 3;
1592
+ break;
1593
+ case T:
1594
+ p = (N - v) / 6048e5;
1595
+ break;
1596
+ case m:
1597
+ p = (N - v) / 864e5;
1598
+ break;
1599
+ case d:
1600
+ p = N / s;
1601
+ break;
1602
+ case h:
1603
+ p = N / r;
1604
+ break;
1605
+ case o:
1606
+ p = N / n;
1607
+ break;
1608
+ default:
1609
+ p = N;
1610
+ }
1611
+ return u ? p : g.a(p);
1612
+ }, c.daysInMonth = function() {
1613
+ return this.endOf(b).$D;
1614
+ }, c.$locale = function() {
1615
+ return M[this.$L];
1616
+ }, c.locale = function(a, l) {
1617
+ if (!a) return this.$L;
1618
+ var u = this.clone(), p = ie(a, l, !0);
1619
+ return p && (u.$L = p), u;
1620
+ }, c.clone = function() {
1621
+ return g.w(this.$d, this);
1622
+ }, c.toDate = function() {
1623
+ return new Date(this.valueOf());
1624
+ }, c.toJSON = function() {
1625
+ return this.isValid() ? this.toISOString() : null;
1626
+ }, c.toISOString = function() {
1627
+ return this.$d.toISOString();
1628
+ }, c.toString = function() {
1629
+ return this.$d.toUTCString();
1630
+ }, f;
1631
+ }(), Oe = oe.prototype;
1632
+ return S.prototype = Oe, [["$ms", i], ["$s", o], ["$m", h], ["$H", d], ["$W", m], ["$M", b], ["$y", E], ["$D", A]].forEach(function(f) {
1633
+ Oe[f[1]] = function(c) {
1634
+ return this.$g(c, f[0], f[1]);
1635
+ };
1636
+ }), S.extend = function(f, c) {
1637
+ return f.$i || (f(c, oe, S), f.$i = !0), S;
1638
+ }, S.locale = ie, S.isDayjs = q, S.unix = function(f) {
1639
+ return S(1e3 * f);
1640
+ }, S.en = M[L], S.Ls = M, S.p = {}, S;
1641
+ });
1642
+ })(Ze);
1643
+ var En = Ze.exports;
1644
+ const Sn = /* @__PURE__ */ at(En);
1645
+ function vn(e) {
1646
+ return e.toLowerCase();
1647
+ }
1648
+ var An = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g], Un = /[^A-Z0-9]+/gi;
1649
+ function $n(e, t) {
1650
+ t === void 0 && (t = {});
1651
+ for (var n = t.splitRegexp, r = n === void 0 ? An : n, s = t.stripRegexp, i = s === void 0 ? Un : s, o = t.transform, h = o === void 0 ? vn : o, d = t.delimiter, m = d === void 0 ? " " : d, T = Pe(Pe(e, r, "$1\0$2"), i, "\0"), b = 0, O = T.length; T.charAt(b) === "\0"; )
1652
+ b++;
1653
+ for (; T.charAt(O - 1) === "\0"; )
1654
+ O--;
1655
+ return T.slice(b, O).split("\0").map(h).join(m);
1656
+ }
1657
+ function Pe(e, t, n) {
1658
+ return t instanceof RegExp ? e.replace(t, n) : t.reduce(function(r, s) {
1659
+ return r.replace(s, n);
1660
+ }, e);
1661
+ }
1662
+ function Nn(e) {
1663
+ return e.charAt(0).toUpperCase() + e.substr(1);
1664
+ }
1665
+ function In(e, t) {
1666
+ var n = e.toLowerCase();
1667
+ return t === 0 ? Nn(n) : n;
1668
+ }
1669
+ function le(e, t) {
1670
+ return t === void 0 && (t = {}), $n(e, it({ delimiter: " ", transform: In }, t));
1671
+ }
1672
+ function Pn(e, t = []) {
1673
+ const n = JSON.parse(JSON.stringify(e));
1674
+ return t.length > 0 && t.forEach((r) => {
1675
+ n[r] !== void 0 && delete n[r];
1676
+ }), n;
1677
+ }
1678
+ function Dn(e, t) {
1679
+ var r, s, i, o, h, d, m;
1680
+ const n = t ? Pn(t) : void 0;
1681
+ return {
1682
+ _id: (n == null ? void 0 : n._id) ?? "",
1683
+ notifyUrl: (n == null ? void 0 : n.notifyUrl) ?? "",
1684
+ store: {
1685
+ id: (n == null ? void 0 : n.store.id) ?? "",
1686
+ event: (n == null ? void 0 : n.store.event) ?? Y.F_PAYOUT_FOR.Enum.ORDERING,
1687
+ bank: {
1688
+ name: ((r = n == null ? void 0 : n.store.bank) == null ? void 0 : r.name) ?? ge.bankNameOptions()[0].value,
1689
+ type: ((s = n == null ? void 0 : n.store.bank) == null ? void 0 : s.type) ?? ge.bankTypeOptions()[0].value,
1690
+ holderName: ((i = n == null ? void 0 : n.store.bank) == null ? void 0 : i.holderName) ?? "",
1691
+ accountNumber: ((o = n == null ? void 0 : n.store.bank) == null ? void 0 : o.accountNumber) ?? ""
1692
+ },
1693
+ keyPerson: {
1694
+ name: ((h = n == null ? void 0 : n.store.keyPerson) == null ? void 0 : h.name) ?? "",
1695
+ phone: ((d = n == null ? void 0 : n.store.keyPerson) == null ? void 0 : d.phone) ?? "",
1696
+ email: ((m = n == null ? void 0 : n.store.keyPerson) == null ? void 0 : m.email) ?? ""
1697
+ },
1698
+ ssm: (n == null ? void 0 : n.store.ssm) ?? "",
1699
+ bankStatement: (n == null ? void 0 : n.store.bankStatement) ?? "",
1700
+ exteriorPhoto: (n == null ? void 0 : n.store.exteriorPhoto) ?? ""
1701
+ },
1702
+ enable: (n == null ? void 0 : n.enable) ?? !1,
1703
+ methods: (n == null ? void 0 : n.methods) ?? [],
1704
+ status: (n == null ? void 0 : n.status) ?? Y.F_PAYOUT_ACCOUNT_STATUS.Enum.NEW,
1705
+ businessId: e
1706
+ };
1707
+ }
1708
+ function xn(e) {
1709
+ return e.reduce(
1710
+ (t, n) => ([Y.F_PAYOUT_ACCOUNT_STATUS.Enum.NEW].some((r) => r == n.status) ? t.NEW.push({
1711
+ ...n
1712
+ }) : t.EXISTED.push({
1713
+ ...n
1714
+ }), t),
1715
+ {
1716
+ NEW: [],
1717
+ EXISTED: []
1718
+ }
1719
+ );
1720
+ }
1721
+ async function pe(e) {
1722
+ await ne.delete(e);
1723
+ }
1724
+ async function De(e, t, n) {
1725
+ const r = Sn().toISOString();
1726
+ if (e.restaurantId)
1727
+ return await ne.update(
1728
+ `restaurant/${e.restaurantId}/documents/${t}/${r}.pdf`,
1729
+ n
1730
+ );
1731
+ if (e.businessId)
1732
+ return await ne.update(
1733
+ `business/${e.businessId}/documents/${t}/${r}.pdf`,
1734
+ n
1735
+ );
1736
+ throw "Not implemented";
1737
+ }
1738
+ async function Cn(e, t) {
1739
+ if (e.restaurantId)
1740
+ return await ne.update(
1741
+ `restaurant/${e.restaurantId}/exterior/photo`,
1742
+ t
1743
+ );
1744
+ if (e.businessId)
1745
+ return await ne.update(
1746
+ `business/${e.businessId}/exterior/photo`,
1747
+ t
1748
+ );
1749
+ throw "Not implemented";
1750
+ }
1751
+ async function Mn(e, t, n) {
1752
+ t.store.ssm && n.newSSM && await pe(t.store.ssm), t.store.bankStatement && n.newBankStatement && await pe(t.store.bankStatement), t.store.exteriorPhoto && n.newExteriorPhoto && await pe(t.store.exteriorPhoto);
1753
+ let r = t.methods;
1754
+ n.payoutSetting.methods.length > 0 && (r = n.payoutSetting.methods);
1755
+ let s = t.store.ssm || "";
1756
+ n.newSSM && (s = await De(e, "ssm", n.newSSM));
1757
+ let i = t.store.bankStatement || "";
1758
+ n.newBankStatement && (i = await De(
1759
+ e,
1760
+ "bankStatement",
1761
+ n.newBankStatement
1762
+ ));
1763
+ let o = t.store.exteriorPhoto || "";
1764
+ return n.newExteriorPhoto && (o = await Cn(
1765
+ e,
1766
+ n.newExteriorPhoto
1767
+ )), {
1768
+ ...t,
1769
+ methods: r,
1770
+ store: {
1771
+ ...t.store,
1772
+ id: n.payoutSetting.store.id,
1773
+ keyPerson: n.payoutSetting.store.keyPerson,
1774
+ bank: n.payoutSetting.store.bank,
1775
+ ssm: s,
1776
+ bankStatement: i,
1777
+ exteriorPhoto: o,
1778
+ event: n.payoutSetting.store.event
1779
+ },
1780
+ status: Y.F_PAYOUT_ACCOUNT_STATUS.Enum.PENDING,
1781
+ notifyUrl: n.payoutSetting.store.event === Y.F_PAYOUT_FOR.Enum.MARKETING ? "http://marketing-api-service:3000/customer/callback/store" : "http://order-backend:3000/backend/payment"
1782
+ };
1783
+ }
1784
+ const ge = {
1785
+ bankNameOptions() {
1786
+ const e = ct().currentCountry.value, t = ut(e).F_BANK_NAME;
1787
+ return Object.values(t).map((n) => ({
1788
+ label: le(n),
1789
+ value: n
1790
+ }));
1791
+ },
1792
+ bankTypeOptions() {
1793
+ return Object.values(Y.F_BANK_TYPE.Values).map((e) => ({
1794
+ label: le(e),
1795
+ value: e
1796
+ }));
1797
+ },
1798
+ storeEventOptions() {
1799
+ return Object.values(Y.F_PAYOUT_FOR.Values).map((e) => ({
1800
+ label: le(e),
1801
+ value: e
1802
+ }));
1803
+ },
1804
+ statusOptions() {
1805
+ return Object.values(Y.F_PAYOUT_ACCOUNT_STATUS.Values).map((e) => ({
1806
+ label: le(e),
1807
+ value: e
1808
+ }));
1809
+ }
1810
+ }, Hn = {
1811
+ mergeData: Mn,
1812
+ initPayoutAccount: Dn,
1813
+ groupByStatus: xn,
1814
+ PayoutConfig: ge
1815
+ };
1816
+ export {
1817
+ ge as P,
1818
+ Hn as a,
1819
+ Pn as c
1820
+ };