@feedmepos/mf-settings 0.0.76 → 0.0.77-dev.1

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.
@@ -1,3147 +0,0 @@
1
- import { ref as ot } from "vue";
2
- /**
3
- * @license
4
- * Copyright 2017 Google LLC
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- /**
19
- * @license
20
- * Copyright 2017 Google LLC
21
- *
22
- * Licensed under the Apache License, Version 2.0 (the "License");
23
- * you may not use this file except in compliance with the License.
24
- * You may obtain a copy of the License at
25
- *
26
- * http://www.apache.org/licenses/LICENSE-2.0
27
- *
28
- * Unless required by applicable law or agreed to in writing, software
29
- * distributed under the License is distributed on an "AS IS" BASIS,
30
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
- * See the License for the specific language governing permissions and
32
- * limitations under the License.
33
- */
34
- const Be = function(t) {
35
- const e = [];
36
- let n = 0;
37
- for (let r = 0; r < t.length; r++) {
38
- let s = t.charCodeAt(r);
39
- s < 128 ? e[n++] = s : s < 2048 ? (e[n++] = s >> 6 | 192, e[n++] = s & 63 | 128) : (s & 64512) === 55296 && r + 1 < t.length && (t.charCodeAt(r + 1) & 64512) === 56320 ? (s = 65536 + ((s & 1023) << 10) + (t.charCodeAt(++r) & 1023), e[n++] = s >> 18 | 240, e[n++] = s >> 12 & 63 | 128, e[n++] = s >> 6 & 63 | 128, e[n++] = s & 63 | 128) : (e[n++] = s >> 12 | 224, e[n++] = s >> 6 & 63 | 128, e[n++] = s & 63 | 128);
40
- }
41
- return e;
42
- }, it = function(t) {
43
- const e = [];
44
- let n = 0, r = 0;
45
- for (; n < t.length; ) {
46
- const s = t[n++];
47
- if (s < 128)
48
- e[r++] = String.fromCharCode(s);
49
- else if (s > 191 && s < 224) {
50
- const o = t[n++];
51
- e[r++] = String.fromCharCode((s & 31) << 6 | o & 63);
52
- } else if (s > 239 && s < 365) {
53
- const o = t[n++], i = t[n++], a = t[n++], c = ((s & 7) << 18 | (o & 63) << 12 | (i & 63) << 6 | a & 63) - 65536;
54
- e[r++] = String.fromCharCode(55296 + (c >> 10)), e[r++] = String.fromCharCode(56320 + (c & 1023));
55
- } else {
56
- const o = t[n++], i = t[n++];
57
- e[r++] = String.fromCharCode((s & 15) << 12 | (o & 63) << 6 | i & 63);
58
- }
59
- }
60
- return e.join("");
61
- }, xe = {
62
- /**
63
- * Maps bytes to characters.
64
- */
65
- byteToCharMap_: null,
66
- /**
67
- * Maps characters to bytes.
68
- */
69
- charToByteMap_: null,
70
- /**
71
- * Maps bytes to websafe characters.
72
- * @private
73
- */
74
- byteToCharMapWebSafe_: null,
75
- /**
76
- * Maps websafe characters to bytes.
77
- * @private
78
- */
79
- charToByteMapWebSafe_: null,
80
- /**
81
- * Our default alphabet, shared between
82
- * ENCODED_VALS and ENCODED_VALS_WEBSAFE
83
- */
84
- ENCODED_VALS_BASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
85
- /**
86
- * Our default alphabet. Value 64 (=) is special; it means "nothing."
87
- */
88
- get ENCODED_VALS() {
89
- return this.ENCODED_VALS_BASE + "+/=";
90
- },
91
- /**
92
- * Our websafe alphabet.
93
- */
94
- get ENCODED_VALS_WEBSAFE() {
95
- return this.ENCODED_VALS_BASE + "-_.";
96
- },
97
- /**
98
- * Whether this browser supports the atob and btoa functions. This extension
99
- * started at Mozilla but is now implemented by many browsers. We use the
100
- * ASSUME_* variables to avoid pulling in the full useragent detection library
101
- * but still allowing the standard per-browser compilations.
102
- *
103
- */
104
- HAS_NATIVE_SUPPORT: typeof atob == "function",
105
- /**
106
- * Base64-encode an array of bytes.
107
- *
108
- * @param input An array of bytes (numbers with
109
- * value in [0, 255]) to encode.
110
- * @param webSafe Boolean indicating we should use the
111
- * alternative alphabet.
112
- * @return The base64 encoded string.
113
- */
114
- encodeByteArray(t, e) {
115
- if (!Array.isArray(t))
116
- throw Error("encodeByteArray takes an array as a parameter");
117
- this.init_();
118
- const n = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [];
119
- for (let s = 0; s < t.length; s += 3) {
120
- const o = t[s], i = s + 1 < t.length, a = i ? t[s + 1] : 0, c = s + 2 < t.length, l = c ? t[s + 2] : 0, g = o >> 2, f = (o & 3) << 4 | a >> 4;
121
- let p = (a & 15) << 2 | l >> 6, m = l & 63;
122
- c || (m = 64, i || (p = 64)), r.push(n[g], n[f], n[p], n[m]);
123
- }
124
- return r.join("");
125
- },
126
- /**
127
- * Base64-encode a string.
128
- *
129
- * @param input A string to encode.
130
- * @param webSafe If true, we should use the
131
- * alternative alphabet.
132
- * @return The base64 encoded string.
133
- */
134
- encodeString(t, e) {
135
- return this.HAS_NATIVE_SUPPORT && !e ? btoa(t) : this.encodeByteArray(Be(t), e);
136
- },
137
- /**
138
- * Base64-decode a string.
139
- *
140
- * @param input to decode.
141
- * @param webSafe True if we should use the
142
- * alternative alphabet.
143
- * @return string representing the decoded value.
144
- */
145
- decodeString(t, e) {
146
- return this.HAS_NATIVE_SUPPORT && !e ? atob(t) : it(this.decodeStringToByteArray(t, e));
147
- },
148
- /**
149
- * Base64-decode a string.
150
- *
151
- * In base-64 decoding, groups of four characters are converted into three
152
- * bytes. If the encoder did not apply padding, the input length may not
153
- * be a multiple of 4.
154
- *
155
- * In this case, the last group will have fewer than 4 characters, and
156
- * padding will be inferred. If the group has one or two characters, it decodes
157
- * to one byte. If the group has three characters, it decodes to two bytes.
158
- *
159
- * @param input Input to decode.
160
- * @param webSafe True if we should use the web-safe alphabet.
161
- * @return bytes representing the decoded value.
162
- */
163
- decodeStringToByteArray(t, e) {
164
- this.init_();
165
- const n = e ? this.charToByteMapWebSafe_ : this.charToByteMap_, r = [];
166
- for (let s = 0; s < t.length; ) {
167
- const o = n[t.charAt(s++)], a = s < t.length ? n[t.charAt(s)] : 0;
168
- ++s;
169
- const l = s < t.length ? n[t.charAt(s)] : 64;
170
- ++s;
171
- const f = s < t.length ? n[t.charAt(s)] : 64;
172
- if (++s, o == null || a == null || l == null || f == null)
173
- throw new at();
174
- const p = o << 2 | a >> 4;
175
- if (r.push(p), l !== 64) {
176
- const m = a << 4 & 240 | l >> 2;
177
- if (r.push(m), f !== 64) {
178
- const w = l << 6 & 192 | f;
179
- r.push(w);
180
- }
181
- }
182
- }
183
- return r;
184
- },
185
- /**
186
- * Lazy static initialization function. Called before
187
- * accessing any of the static map variables.
188
- * @private
189
- */
190
- init_() {
191
- if (!this.byteToCharMap_) {
192
- this.byteToCharMap_ = {}, this.charToByteMap_ = {}, this.byteToCharMapWebSafe_ = {}, this.charToByteMapWebSafe_ = {};
193
- for (let t = 0; t < this.ENCODED_VALS.length; t++)
194
- this.byteToCharMap_[t] = this.ENCODED_VALS.charAt(t), this.charToByteMap_[this.byteToCharMap_[t]] = t, this.byteToCharMapWebSafe_[t] = this.ENCODED_VALS_WEBSAFE.charAt(t), this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]] = t, t >= this.ENCODED_VALS_BASE.length && (this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)] = t, this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)] = t);
195
- }
196
- }
197
- };
198
- class at extends Error {
199
- constructor() {
200
- super(...arguments), this.name = "DecodeBase64StringError";
201
- }
202
- }
203
- const ct = function(t) {
204
- const e = Be(t);
205
- return xe.encodeByteArray(e, !0);
206
- }, q = function(t) {
207
- return ct(t).replace(/\./g, "");
208
- }, lt = function(t) {
209
- try {
210
- return xe.decodeString(t, !0);
211
- } catch (e) {
212
- console.error("base64Decode failed: ", e);
213
- }
214
- return null;
215
- };
216
- /**
217
- * @license
218
- * Copyright 2022 Google LLC
219
- *
220
- * Licensed under the Apache License, Version 2.0 (the "License");
221
- * you may not use this file except in compliance with the License.
222
- * You may obtain a copy of the License at
223
- *
224
- * http://www.apache.org/licenses/LICENSE-2.0
225
- *
226
- * Unless required by applicable law or agreed to in writing, software
227
- * distributed under the License is distributed on an "AS IS" BASIS,
228
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
229
- * See the License for the specific language governing permissions and
230
- * limitations under the License.
231
- */
232
- function ut() {
233
- if (typeof self < "u")
234
- return self;
235
- if (typeof window < "u")
236
- return window;
237
- if (typeof global < "u")
238
- return global;
239
- throw new Error("Unable to locate global object.");
240
- }
241
- /**
242
- * @license
243
- * Copyright 2022 Google LLC
244
- *
245
- * Licensed under the Apache License, Version 2.0 (the "License");
246
- * you may not use this file except in compliance with the License.
247
- * You may obtain a copy of the License at
248
- *
249
- * http://www.apache.org/licenses/LICENSE-2.0
250
- *
251
- * Unless required by applicable law or agreed to in writing, software
252
- * distributed under the License is distributed on an "AS IS" BASIS,
253
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
- * See the License for the specific language governing permissions and
255
- * limitations under the License.
256
- */
257
- const ht = () => ut().__FIREBASE_DEFAULTS__, dt = () => {
258
- if (typeof process > "u" || typeof process.env > "u")
259
- return;
260
- const t = process.env.__FIREBASE_DEFAULTS__;
261
- if (t)
262
- return JSON.parse(t);
263
- }, ft = () => {
264
- if (typeof document > "u")
265
- return;
266
- let t;
267
- try {
268
- t = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/);
269
- } catch {
270
- return;
271
- }
272
- const e = t && lt(t[1]);
273
- return e && JSON.parse(e);
274
- }, K = () => {
275
- try {
276
- return ht() || dt() || ft();
277
- } catch (t) {
278
- console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);
279
- return;
280
- }
281
- }, pt = (t) => {
282
- var e, n;
283
- return (n = (e = K()) === null || e === void 0 ? void 0 : e.emulatorHosts) === null || n === void 0 ? void 0 : n[t];
284
- }, gt = (t) => {
285
- const e = pt(t);
286
- if (!e)
287
- return;
288
- const n = e.lastIndexOf(":");
289
- if (n <= 0 || n + 1 === e.length)
290
- throw new Error(`Invalid host ${e} with no separate hostname and port!`);
291
- const r = parseInt(e.substring(n + 1), 10);
292
- return e[0] === "[" ? [e.substring(1, n - 1), r] : [e.substring(0, n), r];
293
- }, Ue = () => {
294
- var t;
295
- return (t = K()) === null || t === void 0 ? void 0 : t.config;
296
- }, Zr = (t) => {
297
- var e;
298
- return (e = K()) === null || e === void 0 ? void 0 : e[`_${t}`];
299
- };
300
- /**
301
- * @license
302
- * Copyright 2017 Google LLC
303
- *
304
- * Licensed under the Apache License, Version 2.0 (the "License");
305
- * you may not use this file except in compliance with the License.
306
- * You may obtain a copy of the License at
307
- *
308
- * http://www.apache.org/licenses/LICENSE-2.0
309
- *
310
- * Unless required by applicable law or agreed to in writing, software
311
- * distributed under the License is distributed on an "AS IS" BASIS,
312
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
313
- * See the License for the specific language governing permissions and
314
- * limitations under the License.
315
- */
316
- class mt {
317
- constructor() {
318
- this.reject = () => {
319
- }, this.resolve = () => {
320
- }, this.promise = new Promise((e, n) => {
321
- this.resolve = e, this.reject = n;
322
- });
323
- }
324
- /**
325
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
326
- * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
327
- * and returns a node-style callback which will resolve or reject the Deferred's promise.
328
- */
329
- wrapCallback(e) {
330
- return (n, r) => {
331
- n ? this.reject(n) : this.resolve(r), typeof e == "function" && (this.promise.catch(() => {
332
- }), e.length === 1 ? e(n) : e(n, r));
333
- };
334
- }
335
- }
336
- /**
337
- * @license
338
- * Copyright 2021 Google LLC
339
- *
340
- * Licensed under the Apache License, Version 2.0 (the "License");
341
- * you may not use this file except in compliance with the License.
342
- * You may obtain a copy of the License at
343
- *
344
- * http://www.apache.org/licenses/LICENSE-2.0
345
- *
346
- * Unless required by applicable law or agreed to in writing, software
347
- * distributed under the License is distributed on an "AS IS" BASIS,
348
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
349
- * See the License for the specific language governing permissions and
350
- * limitations under the License.
351
- */
352
- function _t(t, e) {
353
- if (t.uid)
354
- throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');
355
- const n = {
356
- alg: "none",
357
- type: "JWT"
358
- }, r = e || "demo-project", s = t.iat || 0, o = t.sub || t.user_id;
359
- if (!o)
360
- throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");
361
- const i = Object.assign({
362
- // Set all required fields to decent defaults
363
- iss: `https://securetoken.google.com/${r}`,
364
- aud: r,
365
- iat: s,
366
- exp: s + 3600,
367
- auth_time: s,
368
- sub: o,
369
- user_id: o,
370
- firebase: {
371
- sign_in_provider: "custom",
372
- identities: {}
373
- }
374
- }, t), a = "";
375
- return [
376
- q(JSON.stringify(n)),
377
- q(JSON.stringify(i)),
378
- a
379
- ].join(".");
380
- }
381
- /**
382
- * @license
383
- * Copyright 2017 Google LLC
384
- *
385
- * Licensed under the Apache License, Version 2.0 (the "License");
386
- * you may not use this file except in compliance with the License.
387
- * You may obtain a copy of the License at
388
- *
389
- * http://www.apache.org/licenses/LICENSE-2.0
390
- *
391
- * Unless required by applicable law or agreed to in writing, software
392
- * distributed under the License is distributed on an "AS IS" BASIS,
393
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
394
- * See the License for the specific language governing permissions and
395
- * limitations under the License.
396
- */
397
- function Pe() {
398
- return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "";
399
- }
400
- function Qr() {
401
- return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window
402
- // just to deal with this case would probably be a bad idea.
403
- !!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Pe());
404
- }
405
- function bt() {
406
- var t;
407
- const e = (t = K()) === null || t === void 0 ? void 0 : t.forceEnvironment;
408
- if (e === "node")
409
- return !0;
410
- if (e === "browser")
411
- return !1;
412
- try {
413
- return Object.prototype.toString.call(global.process) === "[object process]";
414
- } catch {
415
- return !1;
416
- }
417
- }
418
- function es() {
419
- const t = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
420
- return typeof t == "object" && t.id !== void 0;
421
- }
422
- function ts() {
423
- return typeof navigator == "object" && navigator.product === "ReactNative";
424
- }
425
- function ns() {
426
- const t = Pe();
427
- return t.indexOf("MSIE ") >= 0 || t.indexOf("Trident/") >= 0;
428
- }
429
- function yt() {
430
- try {
431
- return typeof indexedDB == "object";
432
- } catch {
433
- return !1;
434
- }
435
- }
436
- function Et() {
437
- return new Promise((t, e) => {
438
- try {
439
- let n = !0;
440
- const r = "validate-browser-context-for-indexeddb-analytics-module", s = self.indexedDB.open(r);
441
- s.onsuccess = () => {
442
- s.result.close(), n || self.indexedDB.deleteDatabase(r), t(!0);
443
- }, s.onupgradeneeded = () => {
444
- n = !1;
445
- }, s.onerror = () => {
446
- var o;
447
- e(((o = s.error) === null || o === void 0 ? void 0 : o.message) || "");
448
- };
449
- } catch (n) {
450
- e(n);
451
- }
452
- });
453
- }
454
- /**
455
- * @license
456
- * Copyright 2017 Google LLC
457
- *
458
- * Licensed under the Apache License, Version 2.0 (the "License");
459
- * you may not use this file except in compliance with the License.
460
- * You may obtain a copy of the License at
461
- *
462
- * http://www.apache.org/licenses/LICENSE-2.0
463
- *
464
- * Unless required by applicable law or agreed to in writing, software
465
- * distributed under the License is distributed on an "AS IS" BASIS,
466
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
467
- * See the License for the specific language governing permissions and
468
- * limitations under the License.
469
- */
470
- const wt = "FirebaseError";
471
- class x extends Error {
472
- constructor(e, n, r) {
473
- super(n), this.code = e, this.customData = r, this.name = wt, Object.setPrototypeOf(this, x.prototype), Error.captureStackTrace && Error.captureStackTrace(this, Le.prototype.create);
474
- }
475
- }
476
- class Le {
477
- constructor(e, n, r) {
478
- this.service = e, this.serviceName = n, this.errors = r;
479
- }
480
- create(e, ...n) {
481
- const r = n[0] || {}, s = `${this.service}/${e}`, o = this.errors[e], i = o ? It(o, r) : "Error", a = `${this.serviceName}: ${i} (${s}).`;
482
- return new x(s, a, r);
483
- }
484
- }
485
- function It(t, e) {
486
- return t.replace(Rt, (n, r) => {
487
- const s = e[r];
488
- return s != null ? String(s) : `<${r}?>`;
489
- });
490
- }
491
- const Rt = /\{\$([^}]+)}/g;
492
- function rs(t) {
493
- for (const e in t)
494
- if (Object.prototype.hasOwnProperty.call(t, e))
495
- return !1;
496
- return !0;
497
- }
498
- function oe(t, e) {
499
- if (t === e)
500
- return !0;
501
- const n = Object.keys(t), r = Object.keys(e);
502
- for (const s of n) {
503
- if (!r.includes(s))
504
- return !1;
505
- const o = t[s], i = e[s];
506
- if (Ee(o) && Ee(i)) {
507
- if (!oe(o, i))
508
- return !1;
509
- } else if (o !== i)
510
- return !1;
511
- }
512
- for (const s of r)
513
- if (!n.includes(s))
514
- return !1;
515
- return !0;
516
- }
517
- function Ee(t) {
518
- return t !== null && typeof t == "object";
519
- }
520
- /**
521
- * @license
522
- * Copyright 2017 Google LLC
523
- *
524
- * Licensed under the Apache License, Version 2.0 (the "License");
525
- * you may not use this file except in compliance with the License.
526
- * You may obtain a copy of the License at
527
- *
528
- * http://www.apache.org/licenses/LICENSE-2.0
529
- *
530
- * Unless required by applicable law or agreed to in writing, software
531
- * distributed under the License is distributed on an "AS IS" BASIS,
532
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
533
- * See the License for the specific language governing permissions and
534
- * limitations under the License.
535
- */
536
- function ss(t) {
537
- const e = [];
538
- for (const [n, r] of Object.entries(t))
539
- Array.isArray(r) ? r.forEach((s) => {
540
- e.push(encodeURIComponent(n) + "=" + encodeURIComponent(s));
541
- }) : e.push(encodeURIComponent(n) + "=" + encodeURIComponent(r));
542
- return e.length ? "&" + e.join("&") : "";
543
- }
544
- function os(t, e) {
545
- const n = new Tt(t, e);
546
- return n.subscribe.bind(n);
547
- }
548
- class Tt {
549
- /**
550
- * @param executor Function which can make calls to a single Observer
551
- * as a proxy.
552
- * @param onNoObservers Callback when count of Observers goes to zero.
553
- */
554
- constructor(e, n) {
555
- this.observers = [], this.unsubscribes = [], this.observerCount = 0, this.task = Promise.resolve(), this.finalized = !1, this.onNoObservers = n, this.task.then(() => {
556
- e(this);
557
- }).catch((r) => {
558
- this.error(r);
559
- });
560
- }
561
- next(e) {
562
- this.forEachObserver((n) => {
563
- n.next(e);
564
- });
565
- }
566
- error(e) {
567
- this.forEachObserver((n) => {
568
- n.error(e);
569
- }), this.close(e);
570
- }
571
- complete() {
572
- this.forEachObserver((e) => {
573
- e.complete();
574
- }), this.close();
575
- }
576
- /**
577
- * Subscribe function that can be used to add an Observer to the fan-out list.
578
- *
579
- * - We require that no event is sent to a subscriber sychronously to their
580
- * call to subscribe().
581
- */
582
- subscribe(e, n, r) {
583
- let s;
584
- if (e === void 0 && n === void 0 && r === void 0)
585
- throw new Error("Missing Observer.");
586
- At(e, [
587
- "next",
588
- "error",
589
- "complete"
590
- ]) ? s = e : s = {
591
- next: e,
592
- error: n,
593
- complete: r
594
- }, s.next === void 0 && (s.next = Z), s.error === void 0 && (s.error = Z), s.complete === void 0 && (s.complete = Z);
595
- const o = this.unsubscribeOne.bind(this, this.observers.length);
596
- return this.finalized && this.task.then(() => {
597
- try {
598
- this.finalError ? s.error(this.finalError) : s.complete();
599
- } catch {
600
- }
601
- }), this.observers.push(s), o;
602
- }
603
- // Unsubscribe is synchronous - we guarantee that no events are sent to
604
- // any unsubscribed Observer.
605
- unsubscribeOne(e) {
606
- this.observers === void 0 || this.observers[e] === void 0 || (delete this.observers[e], this.observerCount -= 1, this.observerCount === 0 && this.onNoObservers !== void 0 && this.onNoObservers(this));
607
- }
608
- forEachObserver(e) {
609
- if (!this.finalized)
610
- for (let n = 0; n < this.observers.length; n++)
611
- this.sendOne(n, e);
612
- }
613
- // Call the Observer via one of it's callback function. We are careful to
614
- // confirm that the observe has not been unsubscribed since this asynchronous
615
- // function had been queued.
616
- sendOne(e, n) {
617
- this.task.then(() => {
618
- if (this.observers !== void 0 && this.observers[e] !== void 0)
619
- try {
620
- n(this.observers[e]);
621
- } catch (r) {
622
- typeof console < "u" && console.error && console.error(r);
623
- }
624
- });
625
- }
626
- close(e) {
627
- this.finalized || (this.finalized = !0, e !== void 0 && (this.finalError = e), this.task.then(() => {
628
- this.observers = void 0, this.onNoObservers = void 0;
629
- }));
630
- }
631
- }
632
- function At(t, e) {
633
- if (typeof t != "object" || t === null)
634
- return !1;
635
- for (const n of e)
636
- if (n in t && typeof t[n] == "function")
637
- return !0;
638
- return !1;
639
- }
640
- function Z() {
641
- }
642
- /**
643
- * @license
644
- * Copyright 2021 Google LLC
645
- *
646
- * Licensed under the Apache License, Version 2.0 (the "License");
647
- * you may not use this file except in compliance with the License.
648
- * You may obtain a copy of the License at
649
- *
650
- * http://www.apache.org/licenses/LICENSE-2.0
651
- *
652
- * Unless required by applicable law or agreed to in writing, software
653
- * distributed under the License is distributed on an "AS IS" BASIS,
654
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
655
- * See the License for the specific language governing permissions and
656
- * limitations under the License.
657
- */
658
- function U(t) {
659
- return t && t._delegate ? t._delegate : t;
660
- }
661
- class $ {
662
- /**
663
- *
664
- * @param name The public service name, e.g. app, auth, firestore, database
665
- * @param instanceFactory Service factory responsible for creating the public interface
666
- * @param type whether the service provided by the component is public or private
667
- */
668
- constructor(e, n, r) {
669
- this.name = e, this.instanceFactory = n, this.type = r, this.multipleInstances = !1, this.serviceProps = {}, this.instantiationMode = "LAZY", this.onInstanceCreated = null;
670
- }
671
- setInstantiationMode(e) {
672
- return this.instantiationMode = e, this;
673
- }
674
- setMultipleInstances(e) {
675
- return this.multipleInstances = e, this;
676
- }
677
- setServiceProps(e) {
678
- return this.serviceProps = e, this;
679
- }
680
- setInstanceCreatedCallback(e) {
681
- return this.onInstanceCreated = e, this;
682
- }
683
- }
684
- /**
685
- * @license
686
- * Copyright 2019 Google LLC
687
- *
688
- * Licensed under the Apache License, Version 2.0 (the "License");
689
- * you may not use this file except in compliance with the License.
690
- * You may obtain a copy of the License at
691
- *
692
- * http://www.apache.org/licenses/LICENSE-2.0
693
- *
694
- * Unless required by applicable law or agreed to in writing, software
695
- * distributed under the License is distributed on an "AS IS" BASIS,
696
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
697
- * See the License for the specific language governing permissions and
698
- * limitations under the License.
699
- */
700
- const C = "[DEFAULT]";
701
- /**
702
- * @license
703
- * Copyright 2019 Google LLC
704
- *
705
- * Licensed under the Apache License, Version 2.0 (the "License");
706
- * you may not use this file except in compliance with the License.
707
- * You may obtain a copy of the License at
708
- *
709
- * http://www.apache.org/licenses/LICENSE-2.0
710
- *
711
- * Unless required by applicable law or agreed to in writing, software
712
- * distributed under the License is distributed on an "AS IS" BASIS,
713
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
714
- * See the License for the specific language governing permissions and
715
- * limitations under the License.
716
- */
717
- class vt {
718
- constructor(e, n) {
719
- this.name = e, this.container = n, this.component = null, this.instances = /* @__PURE__ */ new Map(), this.instancesDeferred = /* @__PURE__ */ new Map(), this.instancesOptions = /* @__PURE__ */ new Map(), this.onInitCallbacks = /* @__PURE__ */ new Map();
720
- }
721
- /**
722
- * @param identifier A provider can provide mulitple instances of a service
723
- * if this.component.multipleInstances is true.
724
- */
725
- get(e) {
726
- const n = this.normalizeInstanceIdentifier(e);
727
- if (!this.instancesDeferred.has(n)) {
728
- const r = new mt();
729
- if (this.instancesDeferred.set(n, r), this.isInitialized(n) || this.shouldAutoInitialize())
730
- try {
731
- const s = this.getOrInitializeService({
732
- instanceIdentifier: n
733
- });
734
- s && r.resolve(s);
735
- } catch {
736
- }
737
- }
738
- return this.instancesDeferred.get(n).promise;
739
- }
740
- getImmediate(e) {
741
- var n;
742
- const r = this.normalizeInstanceIdentifier(e == null ? void 0 : e.identifier), s = (n = e == null ? void 0 : e.optional) !== null && n !== void 0 ? n : !1;
743
- if (this.isInitialized(r) || this.shouldAutoInitialize())
744
- try {
745
- return this.getOrInitializeService({
746
- instanceIdentifier: r
747
- });
748
- } catch (o) {
749
- if (s)
750
- return null;
751
- throw o;
752
- }
753
- else {
754
- if (s)
755
- return null;
756
- throw Error(`Service ${this.name} is not available`);
757
- }
758
- }
759
- getComponent() {
760
- return this.component;
761
- }
762
- setComponent(e) {
763
- if (e.name !== this.name)
764
- throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);
765
- if (this.component)
766
- throw Error(`Component for ${this.name} has already been provided`);
767
- if (this.component = e, !!this.shouldAutoInitialize()) {
768
- if (Ct(e))
769
- try {
770
- this.getOrInitializeService({ instanceIdentifier: C });
771
- } catch {
772
- }
773
- for (const [n, r] of this.instancesDeferred.entries()) {
774
- const s = this.normalizeInstanceIdentifier(n);
775
- try {
776
- const o = this.getOrInitializeService({
777
- instanceIdentifier: s
778
- });
779
- r.resolve(o);
780
- } catch {
781
- }
782
- }
783
- }
784
- }
785
- clearInstance(e = C) {
786
- this.instancesDeferred.delete(e), this.instancesOptions.delete(e), this.instances.delete(e);
787
- }
788
- // app.delete() will call this method on every provider to delete the services
789
- // TODO: should we mark the provider as deleted?
790
- async delete() {
791
- const e = Array.from(this.instances.values());
792
- await Promise.all([
793
- ...e.filter((n) => "INTERNAL" in n).map((n) => n.INTERNAL.delete()),
794
- ...e.filter((n) => "_delete" in n).map((n) => n._delete())
795
- ]);
796
- }
797
- isComponentSet() {
798
- return this.component != null;
799
- }
800
- isInitialized(e = C) {
801
- return this.instances.has(e);
802
- }
803
- getOptions(e = C) {
804
- return this.instancesOptions.get(e) || {};
805
- }
806
- initialize(e = {}) {
807
- const { options: n = {} } = e, r = this.normalizeInstanceIdentifier(e.instanceIdentifier);
808
- if (this.isInitialized(r))
809
- throw Error(`${this.name}(${r}) has already been initialized`);
810
- if (!this.isComponentSet())
811
- throw Error(`Component ${this.name} has not been registered yet`);
812
- const s = this.getOrInitializeService({
813
- instanceIdentifier: r,
814
- options: n
815
- });
816
- for (const [o, i] of this.instancesDeferred.entries()) {
817
- const a = this.normalizeInstanceIdentifier(o);
818
- r === a && i.resolve(s);
819
- }
820
- return s;
821
- }
822
- /**
823
- *
824
- * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize().
825
- * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.
826
- *
827
- * @param identifier An optional instance identifier
828
- * @returns a function to unregister the callback
829
- */
830
- onInit(e, n) {
831
- var r;
832
- const s = this.normalizeInstanceIdentifier(n), o = (r = this.onInitCallbacks.get(s)) !== null && r !== void 0 ? r : /* @__PURE__ */ new Set();
833
- o.add(e), this.onInitCallbacks.set(s, o);
834
- const i = this.instances.get(s);
835
- return i && e(i, s), () => {
836
- o.delete(e);
837
- };
838
- }
839
- /**
840
- * Invoke onInit callbacks synchronously
841
- * @param instance the service instance`
842
- */
843
- invokeOnInitCallbacks(e, n) {
844
- const r = this.onInitCallbacks.get(n);
845
- if (r)
846
- for (const s of r)
847
- try {
848
- s(e, n);
849
- } catch {
850
- }
851
- }
852
- getOrInitializeService({ instanceIdentifier: e, options: n = {} }) {
853
- let r = this.instances.get(e);
854
- if (!r && this.component && (r = this.component.instanceFactory(this.container, {
855
- instanceIdentifier: Dt(e),
856
- options: n
857
- }), this.instances.set(e, r), this.instancesOptions.set(e, n), this.invokeOnInitCallbacks(r, e), this.component.onInstanceCreated))
858
- try {
859
- this.component.onInstanceCreated(this.container, e, r);
860
- } catch {
861
- }
862
- return r || null;
863
- }
864
- normalizeInstanceIdentifier(e = C) {
865
- return this.component ? this.component.multipleInstances ? e : C : e;
866
- }
867
- shouldAutoInitialize() {
868
- return !!this.component && this.component.instantiationMode !== "EXPLICIT";
869
- }
870
- }
871
- function Dt(t) {
872
- return t === C ? void 0 : t;
873
- }
874
- function Ct(t) {
875
- return t.instantiationMode === "EAGER";
876
- }
877
- /**
878
- * @license
879
- * Copyright 2019 Google LLC
880
- *
881
- * Licensed under the Apache License, Version 2.0 (the "License");
882
- * you may not use this file except in compliance with the License.
883
- * You may obtain a copy of the License at
884
- *
885
- * http://www.apache.org/licenses/LICENSE-2.0
886
- *
887
- * Unless required by applicable law or agreed to in writing, software
888
- * distributed under the License is distributed on an "AS IS" BASIS,
889
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
890
- * See the License for the specific language governing permissions and
891
- * limitations under the License.
892
- */
893
- class Ot {
894
- constructor(e) {
895
- this.name = e, this.providers = /* @__PURE__ */ new Map();
896
- }
897
- /**
898
- *
899
- * @param component Component being added
900
- * @param overwrite When a component with the same name has already been registered,
901
- * if overwrite is true: overwrite the existing component with the new component and create a new
902
- * provider with the new component. It can be useful in tests where you want to use different mocks
903
- * for different tests.
904
- * if overwrite is false: throw an exception
905
- */
906
- addComponent(e) {
907
- const n = this.getProvider(e.name);
908
- if (n.isComponentSet())
909
- throw new Error(`Component ${e.name} has already been registered with ${this.name}`);
910
- n.setComponent(e);
911
- }
912
- addOrOverwriteComponent(e) {
913
- this.getProvider(e.name).isComponentSet() && this.providers.delete(e.name), this.addComponent(e);
914
- }
915
- /**
916
- * getProvider provides a type safe interface where it can only be called with a field name
917
- * present in NameServiceMapping interface.
918
- *
919
- * Firebase SDKs providing services should extend NameServiceMapping interface to register
920
- * themselves.
921
- */
922
- getProvider(e) {
923
- if (this.providers.has(e))
924
- return this.providers.get(e);
925
- const n = new vt(e, this);
926
- return this.providers.set(e, n), n;
927
- }
928
- getProviders() {
929
- return Array.from(this.providers.values());
930
- }
931
- }
932
- /**
933
- * @license
934
- * Copyright 2017 Google LLC
935
- *
936
- * Licensed under the Apache License, Version 2.0 (the "License");
937
- * you may not use this file except in compliance with the License.
938
- * You may obtain a copy of the License at
939
- *
940
- * http://www.apache.org/licenses/LICENSE-2.0
941
- *
942
- * Unless required by applicable law or agreed to in writing, software
943
- * distributed under the License is distributed on an "AS IS" BASIS,
944
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
945
- * See the License for the specific language governing permissions and
946
- * limitations under the License.
947
- */
948
- var u;
949
- (function(t) {
950
- t[t.DEBUG = 0] = "DEBUG", t[t.VERBOSE = 1] = "VERBOSE", t[t.INFO = 2] = "INFO", t[t.WARN = 3] = "WARN", t[t.ERROR = 4] = "ERROR", t[t.SILENT = 5] = "SILENT";
951
- })(u || (u = {}));
952
- const St = {
953
- debug: u.DEBUG,
954
- verbose: u.VERBOSE,
955
- info: u.INFO,
956
- warn: u.WARN,
957
- error: u.ERROR,
958
- silent: u.SILENT
959
- }, Nt = u.INFO, kt = {
960
- [u.DEBUG]: "log",
961
- [u.VERBOSE]: "log",
962
- [u.INFO]: "info",
963
- [u.WARN]: "warn",
964
- [u.ERROR]: "error"
965
- }, Bt = (t, e, ...n) => {
966
- if (e < t.logLevel)
967
- return;
968
- const r = (/* @__PURE__ */ new Date()).toISOString(), s = kt[e];
969
- if (s)
970
- console[s](`[${r}] ${t.name}:`, ...n);
971
- else
972
- throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);
973
- };
974
- class xt {
975
- /**
976
- * Gives you an instance of a Logger to capture messages according to
977
- * Firebase's logging scheme.
978
- *
979
- * @param name The name that the logs will be associated with
980
- */
981
- constructor(e) {
982
- this.name = e, this._logLevel = Nt, this._logHandler = Bt, this._userLogHandler = null;
983
- }
984
- get logLevel() {
985
- return this._logLevel;
986
- }
987
- set logLevel(e) {
988
- if (!(e in u))
989
- throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);
990
- this._logLevel = e;
991
- }
992
- // Workaround for setter/getter having to be the same type.
993
- setLogLevel(e) {
994
- this._logLevel = typeof e == "string" ? St[e] : e;
995
- }
996
- get logHandler() {
997
- return this._logHandler;
998
- }
999
- set logHandler(e) {
1000
- if (typeof e != "function")
1001
- throw new TypeError("Value assigned to `logHandler` must be a function");
1002
- this._logHandler = e;
1003
- }
1004
- get userLogHandler() {
1005
- return this._userLogHandler;
1006
- }
1007
- set userLogHandler(e) {
1008
- this._userLogHandler = e;
1009
- }
1010
- /**
1011
- * The functions below are all based on the `console` interface
1012
- */
1013
- debug(...e) {
1014
- this._userLogHandler && this._userLogHandler(this, u.DEBUG, ...e), this._logHandler(this, u.DEBUG, ...e);
1015
- }
1016
- log(...e) {
1017
- this._userLogHandler && this._userLogHandler(this, u.VERBOSE, ...e), this._logHandler(this, u.VERBOSE, ...e);
1018
- }
1019
- info(...e) {
1020
- this._userLogHandler && this._userLogHandler(this, u.INFO, ...e), this._logHandler(this, u.INFO, ...e);
1021
- }
1022
- warn(...e) {
1023
- this._userLogHandler && this._userLogHandler(this, u.WARN, ...e), this._logHandler(this, u.WARN, ...e);
1024
- }
1025
- error(...e) {
1026
- this._userLogHandler && this._userLogHandler(this, u.ERROR, ...e), this._logHandler(this, u.ERROR, ...e);
1027
- }
1028
- }
1029
- const Ut = (t, e) => e.some((n) => t instanceof n);
1030
- let we, Ie;
1031
- function Pt() {
1032
- return we || (we = [
1033
- IDBDatabase,
1034
- IDBObjectStore,
1035
- IDBIndex,
1036
- IDBCursor,
1037
- IDBTransaction
1038
- ]);
1039
- }
1040
- function Lt() {
1041
- return Ie || (Ie = [
1042
- IDBCursor.prototype.advance,
1043
- IDBCursor.prototype.continue,
1044
- IDBCursor.prototype.continuePrimaryKey
1045
- ]);
1046
- }
1047
- const Me = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap();
1048
- function Mt(t) {
1049
- const e = new Promise((n, r) => {
1050
- const s = () => {
1051
- t.removeEventListener("success", o), t.removeEventListener("error", i);
1052
- }, o = () => {
1053
- n(A(t.result)), s();
1054
- }, i = () => {
1055
- r(t.error), s();
1056
- };
1057
- t.addEventListener("success", o), t.addEventListener("error", i);
1058
- });
1059
- return e.then((n) => {
1060
- n instanceof IDBCursor && Me.set(n, t);
1061
- }).catch(() => {
1062
- }), fe.set(e, t), e;
1063
- }
1064
- function $t(t) {
1065
- if (ie.has(t))
1066
- return;
1067
- const e = new Promise((n, r) => {
1068
- const s = () => {
1069
- t.removeEventListener("complete", o), t.removeEventListener("error", i), t.removeEventListener("abort", i);
1070
- }, o = () => {
1071
- n(), s();
1072
- }, i = () => {
1073
- r(t.error || new DOMException("AbortError", "AbortError")), s();
1074
- };
1075
- t.addEventListener("complete", o), t.addEventListener("error", i), t.addEventListener("abort", i);
1076
- });
1077
- ie.set(t, e);
1078
- }
1079
- let ae = {
1080
- get(t, e, n) {
1081
- if (t instanceof IDBTransaction) {
1082
- if (e === "done")
1083
- return ie.get(t);
1084
- if (e === "objectStoreNames")
1085
- return t.objectStoreNames || $e.get(t);
1086
- if (e === "store")
1087
- return n.objectStoreNames[1] ? void 0 : n.objectStore(n.objectStoreNames[0]);
1088
- }
1089
- return A(t[e]);
1090
- },
1091
- set(t, e, n) {
1092
- return t[e] = n, !0;
1093
- },
1094
- has(t, e) {
1095
- return t instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in t;
1096
- }
1097
- };
1098
- function Ft(t) {
1099
- ae = t(ae);
1100
- }
1101
- function Ht(t) {
1102
- return t === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...n) {
1103
- const r = t.call(ee(this), e, ...n);
1104
- return $e.set(r, e.sort ? e.sort() : [e]), A(r);
1105
- } : Lt().includes(t) ? function(...e) {
1106
- return t.apply(ee(this), e), A(Me.get(this));
1107
- } : function(...e) {
1108
- return A(t.apply(ee(this), e));
1109
- };
1110
- }
1111
- function jt(t) {
1112
- return typeof t == "function" ? Ht(t) : (t instanceof IDBTransaction && $t(t), Ut(t, Pt()) ? new Proxy(t, ae) : t);
1113
- }
1114
- function A(t) {
1115
- if (t instanceof IDBRequest)
1116
- return Mt(t);
1117
- if (Q.has(t))
1118
- return Q.get(t);
1119
- const e = jt(t);
1120
- return e !== t && (Q.set(t, e), fe.set(e, t)), e;
1121
- }
1122
- const ee = (t) => fe.get(t);
1123
- function Vt(t, e, { blocked: n, upgrade: r, blocking: s, terminated: o } = {}) {
1124
- const i = indexedDB.open(t, e), a = A(i);
1125
- return r && i.addEventListener("upgradeneeded", (c) => {
1126
- r(A(i.result), c.oldVersion, c.newVersion, A(i.transaction), c);
1127
- }), n && i.addEventListener("blocked", (c) => n(
1128
- // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
1129
- c.oldVersion,
1130
- c.newVersion,
1131
- c
1132
- )), a.then((c) => {
1133
- o && c.addEventListener("close", () => o()), s && c.addEventListener("versionchange", (l) => s(l.oldVersion, l.newVersion, l));
1134
- }).catch(() => {
1135
- }), a;
1136
- }
1137
- const zt = ["get", "getKey", "getAll", "getAllKeys", "count"], Wt = ["put", "add", "delete", "clear"], te = /* @__PURE__ */ new Map();
1138
- function Re(t, e) {
1139
- if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string"))
1140
- return;
1141
- if (te.get(e))
1142
- return te.get(e);
1143
- const n = e.replace(/FromIndex$/, ""), r = e !== n, s = Wt.includes(n);
1144
- if (
1145
- // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
1146
- !(n in (r ? IDBIndex : IDBObjectStore).prototype) || !(s || zt.includes(n))
1147
- )
1148
- return;
1149
- const o = async function(i, ...a) {
1150
- const c = this.transaction(i, s ? "readwrite" : "readonly");
1151
- let l = c.store;
1152
- return r && (l = l.index(a.shift())), (await Promise.all([
1153
- l[n](...a),
1154
- s && c.done
1155
- ]))[0];
1156
- };
1157
- return te.set(e, o), o;
1158
- }
1159
- Ft((t) => ({
1160
- ...t,
1161
- get: (e, n, r) => Re(e, n) || t.get(e, n, r),
1162
- has: (e, n) => !!Re(e, n) || t.has(e, n)
1163
- }));
1164
- /**
1165
- * @license
1166
- * Copyright 2019 Google LLC
1167
- *
1168
- * Licensed under the Apache License, Version 2.0 (the "License");
1169
- * you may not use this file except in compliance with the License.
1170
- * You may obtain a copy of the License at
1171
- *
1172
- * http://www.apache.org/licenses/LICENSE-2.0
1173
- *
1174
- * Unless required by applicable law or agreed to in writing, software
1175
- * distributed under the License is distributed on an "AS IS" BASIS,
1176
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1177
- * See the License for the specific language governing permissions and
1178
- * limitations under the License.
1179
- */
1180
- class qt {
1181
- constructor(e) {
1182
- this.container = e;
1183
- }
1184
- // In initial implementation, this will be called by installations on
1185
- // auth token refresh, and installations will send this string.
1186
- getPlatformInfoString() {
1187
- return this.container.getProviders().map((n) => {
1188
- if (Gt(n)) {
1189
- const r = n.getImmediate();
1190
- return `${r.library}/${r.version}`;
1191
- } else
1192
- return null;
1193
- }).filter((n) => n).join(" ");
1194
- }
1195
- }
1196
- function Gt(t) {
1197
- const e = t.getComponent();
1198
- return (e == null ? void 0 : e.type) === "VERSION";
1199
- }
1200
- const ce = "@firebase/app", Te = "0.9.13";
1201
- /**
1202
- * @license
1203
- * Copyright 2019 Google LLC
1204
- *
1205
- * Licensed under the Apache License, Version 2.0 (the "License");
1206
- * you may not use this file except in compliance with the License.
1207
- * You may obtain a copy of the License at
1208
- *
1209
- * http://www.apache.org/licenses/LICENSE-2.0
1210
- *
1211
- * Unless required by applicable law or agreed to in writing, software
1212
- * distributed under the License is distributed on an "AS IS" BASIS,
1213
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
- * See the License for the specific language governing permissions and
1215
- * limitations under the License.
1216
- */
1217
- const S = new xt("@firebase/app"), Kt = "@firebase/app-compat", Xt = "@firebase/analytics-compat", Jt = "@firebase/analytics", Yt = "@firebase/app-check-compat", Zt = "@firebase/app-check", Qt = "@firebase/auth", en = "@firebase/auth-compat", tn = "@firebase/database", nn = "@firebase/database-compat", rn = "@firebase/functions", sn = "@firebase/functions-compat", on = "@firebase/installations", an = "@firebase/installations-compat", cn = "@firebase/messaging", ln = "@firebase/messaging-compat", un = "@firebase/performance", hn = "@firebase/performance-compat", dn = "@firebase/remote-config", fn = "@firebase/remote-config-compat", pn = "@firebase/storage", gn = "@firebase/storage-compat", mn = "@firebase/firestore", _n = "@firebase/firestore-compat", bn = "firebase", yn = "9.23.0";
1218
- /**
1219
- * @license
1220
- * Copyright 2019 Google LLC
1221
- *
1222
- * Licensed under the Apache License, Version 2.0 (the "License");
1223
- * you may not use this file except in compliance with the License.
1224
- * You may obtain a copy of the License at
1225
- *
1226
- * http://www.apache.org/licenses/LICENSE-2.0
1227
- *
1228
- * Unless required by applicable law or agreed to in writing, software
1229
- * distributed under the License is distributed on an "AS IS" BASIS,
1230
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1231
- * See the License for the specific language governing permissions and
1232
- * limitations under the License.
1233
- */
1234
- const le = "[DEFAULT]", En = {
1235
- [ce]: "fire-core",
1236
- [Kt]: "fire-core-compat",
1237
- [Jt]: "fire-analytics",
1238
- [Xt]: "fire-analytics-compat",
1239
- [Zt]: "fire-app-check",
1240
- [Yt]: "fire-app-check-compat",
1241
- [Qt]: "fire-auth",
1242
- [en]: "fire-auth-compat",
1243
- [tn]: "fire-rtdb",
1244
- [nn]: "fire-rtdb-compat",
1245
- [rn]: "fire-fn",
1246
- [sn]: "fire-fn-compat",
1247
- [on]: "fire-iid",
1248
- [an]: "fire-iid-compat",
1249
- [cn]: "fire-fcm",
1250
- [ln]: "fire-fcm-compat",
1251
- [un]: "fire-perf",
1252
- [hn]: "fire-perf-compat",
1253
- [dn]: "fire-rc",
1254
- [fn]: "fire-rc-compat",
1255
- [pn]: "fire-gcs",
1256
- [gn]: "fire-gcs-compat",
1257
- [mn]: "fire-fst",
1258
- [_n]: "fire-fst-compat",
1259
- "fire-js": "fire-js",
1260
- [bn]: "fire-js-all"
1261
- };
1262
- /**
1263
- * @license
1264
- * Copyright 2019 Google LLC
1265
- *
1266
- * Licensed under the Apache License, Version 2.0 (the "License");
1267
- * you may not use this file except in compliance with the License.
1268
- * You may obtain a copy of the License at
1269
- *
1270
- * http://www.apache.org/licenses/LICENSE-2.0
1271
- *
1272
- * Unless required by applicable law or agreed to in writing, software
1273
- * distributed under the License is distributed on an "AS IS" BASIS,
1274
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1275
- * See the License for the specific language governing permissions and
1276
- * limitations under the License.
1277
- */
1278
- const F = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map();
1279
- function wn(t, e) {
1280
- try {
1281
- t.container.addComponent(e);
1282
- } catch (n) {
1283
- S.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`, n);
1284
- }
1285
- }
1286
- function G(t) {
1287
- const e = t.name;
1288
- if (ue.has(e))
1289
- return S.debug(`There were multiple attempts to register component ${e}.`), !1;
1290
- ue.set(e, t);
1291
- for (const n of F.values())
1292
- wn(n, t);
1293
- return !0;
1294
- }
1295
- function In(t, e) {
1296
- const n = t.container.getProvider("heartbeat").getImmediate({ optional: !0 });
1297
- return n && n.triggerHeartbeat(), t.container.getProvider(e);
1298
- }
1299
- /**
1300
- * @license
1301
- * Copyright 2019 Google LLC
1302
- *
1303
- * Licensed under the Apache License, Version 2.0 (the "License");
1304
- * you may not use this file except in compliance with the License.
1305
- * You may obtain a copy of the License at
1306
- *
1307
- * http://www.apache.org/licenses/LICENSE-2.0
1308
- *
1309
- * Unless required by applicable law or agreed to in writing, software
1310
- * distributed under the License is distributed on an "AS IS" BASIS,
1311
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1312
- * See the License for the specific language governing permissions and
1313
- * limitations under the License.
1314
- */
1315
- const Rn = {
1316
- "no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
1317
- "bad-app-name": "Illegal App name: '{$appName}",
1318
- "duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
1319
- "app-deleted": "Firebase App named '{$appName}' already deleted",
1320
- "no-options": "Need to provide options, when not being deployed to hosting via source.",
1321
- "invalid-app-argument": "firebase.{$appName}() takes either no argument or a Firebase App instance.",
1322
- "invalid-log-argument": "First argument to `onLog` must be null or a function.",
1323
- "idb-open": "Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",
1324
- "idb-get": "Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",
1325
- "idb-set": "Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",
1326
- "idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."
1327
- }, v = new Le("app", "Firebase", Rn);
1328
- /**
1329
- * @license
1330
- * Copyright 2019 Google LLC
1331
- *
1332
- * Licensed under the Apache License, Version 2.0 (the "License");
1333
- * you may not use this file except in compliance with the License.
1334
- * You may obtain a copy of the License at
1335
- *
1336
- * http://www.apache.org/licenses/LICENSE-2.0
1337
- *
1338
- * Unless required by applicable law or agreed to in writing, software
1339
- * distributed under the License is distributed on an "AS IS" BASIS,
1340
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1341
- * See the License for the specific language governing permissions and
1342
- * limitations under the License.
1343
- */
1344
- class Tn {
1345
- constructor(e, n, r) {
1346
- this._isDeleted = !1, this._options = Object.assign({}, e), this._config = Object.assign({}, n), this._name = n.name, this._automaticDataCollectionEnabled = n.automaticDataCollectionEnabled, this._container = r, this.container.addComponent(new $(
1347
- "app",
1348
- () => this,
1349
- "PUBLIC"
1350
- /* ComponentType.PUBLIC */
1351
- ));
1352
- }
1353
- get automaticDataCollectionEnabled() {
1354
- return this.checkDestroyed(), this._automaticDataCollectionEnabled;
1355
- }
1356
- set automaticDataCollectionEnabled(e) {
1357
- this.checkDestroyed(), this._automaticDataCollectionEnabled = e;
1358
- }
1359
- get name() {
1360
- return this.checkDestroyed(), this._name;
1361
- }
1362
- get options() {
1363
- return this.checkDestroyed(), this._options;
1364
- }
1365
- get config() {
1366
- return this.checkDestroyed(), this._config;
1367
- }
1368
- get container() {
1369
- return this._container;
1370
- }
1371
- get isDeleted() {
1372
- return this._isDeleted;
1373
- }
1374
- set isDeleted(e) {
1375
- this._isDeleted = e;
1376
- }
1377
- /**
1378
- * This function will throw an Error if the App has already been deleted -
1379
- * use before performing API actions on the App.
1380
- */
1381
- checkDestroyed() {
1382
- if (this.isDeleted)
1383
- throw v.create("app-deleted", { appName: this._name });
1384
- }
1385
- }
1386
- /**
1387
- * @license
1388
- * Copyright 2019 Google LLC
1389
- *
1390
- * Licensed under the Apache License, Version 2.0 (the "License");
1391
- * you may not use this file except in compliance with the License.
1392
- * You may obtain a copy of the License at
1393
- *
1394
- * http://www.apache.org/licenses/LICENSE-2.0
1395
- *
1396
- * Unless required by applicable law or agreed to in writing, software
1397
- * distributed under the License is distributed on an "AS IS" BASIS,
1398
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1399
- * See the License for the specific language governing permissions and
1400
- * limitations under the License.
1401
- */
1402
- const An = yn;
1403
- function vn(t, e = {}) {
1404
- let n = t;
1405
- typeof e != "object" && (e = { name: e });
1406
- const r = Object.assign({ name: le, automaticDataCollectionEnabled: !1 }, e), s = r.name;
1407
- if (typeof s != "string" || !s)
1408
- throw v.create("bad-app-name", {
1409
- appName: String(s)
1410
- });
1411
- if (n || (n = Ue()), !n)
1412
- throw v.create(
1413
- "no-options"
1414
- /* AppError.NO_OPTIONS */
1415
- );
1416
- const o = F.get(s);
1417
- if (o) {
1418
- if (oe(n, o.options) && oe(r, o.config))
1419
- return o;
1420
- throw v.create("duplicate-app", { appName: s });
1421
- }
1422
- const i = new Ot(s);
1423
- for (const c of ue.values())
1424
- i.addComponent(c);
1425
- const a = new Tn(n, r, i);
1426
- return F.set(s, a), a;
1427
- }
1428
- function Dn(t = le) {
1429
- const e = F.get(t);
1430
- if (!e && t === le && Ue())
1431
- return vn();
1432
- if (!e)
1433
- throw v.create("no-app", { appName: t });
1434
- return e;
1435
- }
1436
- function is() {
1437
- return Array.from(F.values());
1438
- }
1439
- function L(t, e, n) {
1440
- var r;
1441
- let s = (r = En[t]) !== null && r !== void 0 ? r : t;
1442
- n && (s += `-${n}`);
1443
- const o = s.match(/\s|\//), i = e.match(/\s|\//);
1444
- if (o || i) {
1445
- const a = [
1446
- `Unable to register library "${s}" with version "${e}":`
1447
- ];
1448
- o && a.push(`library name "${s}" contains illegal characters (whitespace or "/")`), o && i && a.push("and"), i && a.push(`version name "${e}" contains illegal characters (whitespace or "/")`), S.warn(a.join(" "));
1449
- return;
1450
- }
1451
- G(new $(
1452
- `${s}-version`,
1453
- () => ({ library: s, version: e }),
1454
- "VERSION"
1455
- /* ComponentType.VERSION */
1456
- ));
1457
- }
1458
- /**
1459
- * @license
1460
- * Copyright 2021 Google LLC
1461
- *
1462
- * Licensed under the Apache License, Version 2.0 (the "License");
1463
- * you may not use this file except in compliance with the License.
1464
- * You may obtain a copy of the License at
1465
- *
1466
- * http://www.apache.org/licenses/LICENSE-2.0
1467
- *
1468
- * Unless required by applicable law or agreed to in writing, software
1469
- * distributed under the License is distributed on an "AS IS" BASIS,
1470
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1471
- * See the License for the specific language governing permissions and
1472
- * limitations under the License.
1473
- */
1474
- const Cn = "firebase-heartbeat-database", On = 1, H = "firebase-heartbeat-store";
1475
- let ne = null;
1476
- function Fe() {
1477
- return ne || (ne = Vt(Cn, On, {
1478
- upgrade: (t, e) => {
1479
- switch (e) {
1480
- case 0:
1481
- t.createObjectStore(H);
1482
- }
1483
- }
1484
- }).catch((t) => {
1485
- throw v.create("idb-open", {
1486
- originalErrorMessage: t.message
1487
- });
1488
- })), ne;
1489
- }
1490
- async function Sn(t) {
1491
- try {
1492
- return await (await Fe()).transaction(H).objectStore(H).get(He(t));
1493
- } catch (e) {
1494
- if (e instanceof x)
1495
- S.warn(e.message);
1496
- else {
1497
- const n = v.create("idb-get", {
1498
- originalErrorMessage: e == null ? void 0 : e.message
1499
- });
1500
- S.warn(n.message);
1501
- }
1502
- }
1503
- }
1504
- async function Ae(t, e) {
1505
- try {
1506
- const r = (await Fe()).transaction(H, "readwrite");
1507
- await r.objectStore(H).put(e, He(t)), await r.done;
1508
- } catch (n) {
1509
- if (n instanceof x)
1510
- S.warn(n.message);
1511
- else {
1512
- const r = v.create("idb-set", {
1513
- originalErrorMessage: n == null ? void 0 : n.message
1514
- });
1515
- S.warn(r.message);
1516
- }
1517
- }
1518
- }
1519
- function He(t) {
1520
- return `${t.name}!${t.options.appId}`;
1521
- }
1522
- /**
1523
- * @license
1524
- * Copyright 2021 Google LLC
1525
- *
1526
- * Licensed under the Apache License, Version 2.0 (the "License");
1527
- * you may not use this file except in compliance with the License.
1528
- * You may obtain a copy of the License at
1529
- *
1530
- * http://www.apache.org/licenses/LICENSE-2.0
1531
- *
1532
- * Unless required by applicable law or agreed to in writing, software
1533
- * distributed under the License is distributed on an "AS IS" BASIS,
1534
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1535
- * See the License for the specific language governing permissions and
1536
- * limitations under the License.
1537
- */
1538
- const Nn = 1024, kn = 30 * 24 * 60 * 60 * 1e3;
1539
- class Bn {
1540
- constructor(e) {
1541
- this.container = e, this._heartbeatsCache = null;
1542
- const n = this.container.getProvider("app").getImmediate();
1543
- this._storage = new Un(n), this._heartbeatsCachePromise = this._storage.read().then((r) => (this._heartbeatsCache = r, r));
1544
- }
1545
- /**
1546
- * Called to report a heartbeat. The function will generate
1547
- * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
1548
- * to IndexedDB.
1549
- * Note that we only store one heartbeat per day. So if a heartbeat for today is
1550
- * already logged, subsequent calls to this function in the same day will be ignored.
1551
- */
1552
- async triggerHeartbeat() {
1553
- const n = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), r = ve();
1554
- if (this._heartbeatsCache === null && (this._heartbeatsCache = await this._heartbeatsCachePromise), !(this._heartbeatsCache.lastSentHeartbeatDate === r || this._heartbeatsCache.heartbeats.some((s) => s.date === r)))
1555
- return this._heartbeatsCache.heartbeats.push({ date: r, agent: n }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((s) => {
1556
- const o = new Date(s.date).valueOf();
1557
- return Date.now() - o <= kn;
1558
- }), this._storage.overwrite(this._heartbeatsCache);
1559
- }
1560
- /**
1561
- * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
1562
- * It also clears all heartbeats from memory as well as in IndexedDB.
1563
- *
1564
- * NOTE: Consuming product SDKs should not send the header if this method
1565
- * returns an empty string.
1566
- */
1567
- async getHeartbeatsHeader() {
1568
- if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, this._heartbeatsCache === null || this._heartbeatsCache.heartbeats.length === 0)
1569
- return "";
1570
- const e = ve(), { heartbeatsToSend: n, unsentEntries: r } = xn(this._heartbeatsCache.heartbeats), s = q(JSON.stringify({ version: 2, heartbeats: n }));
1571
- return this._heartbeatsCache.lastSentHeartbeatDate = e, r.length > 0 ? (this._heartbeatsCache.heartbeats = r, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), s;
1572
- }
1573
- }
1574
- function ve() {
1575
- return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
1576
- }
1577
- function xn(t, e = Nn) {
1578
- const n = [];
1579
- let r = t.slice();
1580
- for (const s of t) {
1581
- const o = n.find((i) => i.agent === s.agent);
1582
- if (o) {
1583
- if (o.dates.push(s.date), De(n) > e) {
1584
- o.dates.pop();
1585
- break;
1586
- }
1587
- } else if (n.push({
1588
- agent: s.agent,
1589
- dates: [s.date]
1590
- }), De(n) > e) {
1591
- n.pop();
1592
- break;
1593
- }
1594
- r = r.slice(1);
1595
- }
1596
- return {
1597
- heartbeatsToSend: n,
1598
- unsentEntries: r
1599
- };
1600
- }
1601
- class Un {
1602
- constructor(e) {
1603
- this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
1604
- }
1605
- async runIndexedDBEnvironmentCheck() {
1606
- return yt() ? Et().then(() => !0).catch(() => !1) : !1;
1607
- }
1608
- /**
1609
- * Read all heartbeats.
1610
- */
1611
- async read() {
1612
- return await this._canUseIndexedDBPromise ? await Sn(this.app) || { heartbeats: [] } : { heartbeats: [] };
1613
- }
1614
- // overwrite the storage with the provided heartbeats
1615
- async overwrite(e) {
1616
- var n;
1617
- if (await this._canUseIndexedDBPromise) {
1618
- const s = await this.read();
1619
- return Ae(this.app, {
1620
- lastSentHeartbeatDate: (n = e.lastSentHeartbeatDate) !== null && n !== void 0 ? n : s.lastSentHeartbeatDate,
1621
- heartbeats: e.heartbeats
1622
- });
1623
- } else
1624
- return;
1625
- }
1626
- // add heartbeats
1627
- async add(e) {
1628
- var n;
1629
- if (await this._canUseIndexedDBPromise) {
1630
- const s = await this.read();
1631
- return Ae(this.app, {
1632
- lastSentHeartbeatDate: (n = e.lastSentHeartbeatDate) !== null && n !== void 0 ? n : s.lastSentHeartbeatDate,
1633
- heartbeats: [
1634
- ...s.heartbeats,
1635
- ...e.heartbeats
1636
- ]
1637
- });
1638
- } else
1639
- return;
1640
- }
1641
- }
1642
- function De(t) {
1643
- return q(
1644
- // heartbeatsCache wrapper properties
1645
- JSON.stringify({ version: 2, heartbeats: t })
1646
- ).length;
1647
- }
1648
- /**
1649
- * @license
1650
- * Copyright 2019 Google LLC
1651
- *
1652
- * Licensed under the Apache License, Version 2.0 (the "License");
1653
- * you may not use this file except in compliance with the License.
1654
- * You may obtain a copy of the License at
1655
- *
1656
- * http://www.apache.org/licenses/LICENSE-2.0
1657
- *
1658
- * Unless required by applicable law or agreed to in writing, software
1659
- * distributed under the License is distributed on an "AS IS" BASIS,
1660
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1661
- * See the License for the specific language governing permissions and
1662
- * limitations under the License.
1663
- */
1664
- function Pn(t) {
1665
- G(new $(
1666
- "platform-logger",
1667
- (e) => new qt(e),
1668
- "PRIVATE"
1669
- /* ComponentType.PRIVATE */
1670
- )), G(new $(
1671
- "heartbeat",
1672
- (e) => new Bn(e),
1673
- "PRIVATE"
1674
- /* ComponentType.PRIVATE */
1675
- )), L(ce, Te, t), L(ce, Te, "esm2017"), L("fire-js", "");
1676
- }
1677
- Pn("");
1678
- /**
1679
- * @license
1680
- * Copyright 2017 Google LLC
1681
- *
1682
- * Licensed under the Apache License, Version 2.0 (the "License");
1683
- * you may not use this file except in compliance with the License.
1684
- * You may obtain a copy of the License at
1685
- *
1686
- * http://www.apache.org/licenses/LICENSE-2.0
1687
- *
1688
- * Unless required by applicable law or agreed to in writing, software
1689
- * distributed under the License is distributed on an "AS IS" BASIS,
1690
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1691
- * See the License for the specific language governing permissions and
1692
- * limitations under the License.
1693
- */
1694
- const je = "firebasestorage.googleapis.com", Ve = "storageBucket", Ln = 2 * 60 * 1e3, Mn = 10 * 60 * 1e3;
1695
- /**
1696
- * @license
1697
- * Copyright 2017 Google LLC
1698
- *
1699
- * Licensed under the Apache License, Version 2.0 (the "License");
1700
- * you may not use this file except in compliance with the License.
1701
- * You may obtain a copy of the License at
1702
- *
1703
- * http://www.apache.org/licenses/LICENSE-2.0
1704
- *
1705
- * Unless required by applicable law or agreed to in writing, software
1706
- * distributed under the License is distributed on an "AS IS" BASIS,
1707
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1708
- * See the License for the specific language governing permissions and
1709
- * limitations under the License.
1710
- */
1711
- class d extends x {
1712
- /**
1713
- * @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and
1714
- * added to the end of the message.
1715
- * @param message - Error message.
1716
- * @param status_ - Corresponding HTTP Status Code
1717
- */
1718
- constructor(e, n, r = 0) {
1719
- super(re(e), `Firebase Storage: ${n} (${re(e)})`), this.status_ = r, this.customData = { serverResponse: null }, this._baseMessage = this.message, Object.setPrototypeOf(this, d.prototype);
1720
- }
1721
- get status() {
1722
- return this.status_;
1723
- }
1724
- set status(e) {
1725
- this.status_ = e;
1726
- }
1727
- /**
1728
- * Compares a `StorageErrorCode` against this error's code, filtering out the prefix.
1729
- */
1730
- _codeEquals(e) {
1731
- return re(e) === this.code;
1732
- }
1733
- /**
1734
- * Optional response message that was added by the server.
1735
- */
1736
- get serverResponse() {
1737
- return this.customData.serverResponse;
1738
- }
1739
- set serverResponse(e) {
1740
- this.customData.serverResponse = e, this.customData.serverResponse ? this.message = `${this._baseMessage}
1741
- ${this.customData.serverResponse}` : this.message = this._baseMessage;
1742
- }
1743
- }
1744
- var h;
1745
- (function(t) {
1746
- t.UNKNOWN = "unknown", t.OBJECT_NOT_FOUND = "object-not-found", t.BUCKET_NOT_FOUND = "bucket-not-found", t.PROJECT_NOT_FOUND = "project-not-found", t.QUOTA_EXCEEDED = "quota-exceeded", t.UNAUTHENTICATED = "unauthenticated", t.UNAUTHORIZED = "unauthorized", t.UNAUTHORIZED_APP = "unauthorized-app", t.RETRY_LIMIT_EXCEEDED = "retry-limit-exceeded", t.INVALID_CHECKSUM = "invalid-checksum", t.CANCELED = "canceled", t.INVALID_EVENT_NAME = "invalid-event-name", t.INVALID_URL = "invalid-url", t.INVALID_DEFAULT_BUCKET = "invalid-default-bucket", t.NO_DEFAULT_BUCKET = "no-default-bucket", t.CANNOT_SLICE_BLOB = "cannot-slice-blob", t.SERVER_FILE_WRONG_SIZE = "server-file-wrong-size", t.NO_DOWNLOAD_URL = "no-download-url", t.INVALID_ARGUMENT = "invalid-argument", t.INVALID_ARGUMENT_COUNT = "invalid-argument-count", t.APP_DELETED = "app-deleted", t.INVALID_ROOT_OPERATION = "invalid-root-operation", t.INVALID_FORMAT = "invalid-format", t.INTERNAL_ERROR = "internal-error", t.UNSUPPORTED_ENVIRONMENT = "unsupported-environment";
1747
- })(h || (h = {}));
1748
- function re(t) {
1749
- return "storage/" + t;
1750
- }
1751
- function pe() {
1752
- const t = "An unknown error occurred, please check the error payload for server response.";
1753
- return new d(h.UNKNOWN, t);
1754
- }
1755
- function $n(t) {
1756
- return new d(h.OBJECT_NOT_FOUND, "Object '" + t + "' does not exist.");
1757
- }
1758
- function Fn(t) {
1759
- return new d(h.QUOTA_EXCEEDED, "Quota for bucket '" + t + "' exceeded, please view quota on https://firebase.google.com/pricing/.");
1760
- }
1761
- function Hn() {
1762
- const t = "User is not authenticated, please authenticate using Firebase Authentication and try again.";
1763
- return new d(h.UNAUTHENTICATED, t);
1764
- }
1765
- function jn() {
1766
- return new d(h.UNAUTHORIZED_APP, "This app does not have permission to access Firebase Storage on this project.");
1767
- }
1768
- function Vn(t) {
1769
- return new d(h.UNAUTHORIZED, "User does not have permission to access '" + t + "'.");
1770
- }
1771
- function zn() {
1772
- return new d(h.RETRY_LIMIT_EXCEEDED, "Max retry time for operation exceeded, please try again.");
1773
- }
1774
- function Wn() {
1775
- return new d(h.CANCELED, "User canceled the upload/download.");
1776
- }
1777
- function qn(t) {
1778
- return new d(h.INVALID_URL, "Invalid URL '" + t + "'.");
1779
- }
1780
- function Gn(t) {
1781
- return new d(h.INVALID_DEFAULT_BUCKET, "Invalid default bucket '" + t + "'.");
1782
- }
1783
- function Kn() {
1784
- return new d(h.NO_DEFAULT_BUCKET, "No default bucket found. Did you set the '" + Ve + "' property when initializing the app?");
1785
- }
1786
- function Xn() {
1787
- return new d(h.CANNOT_SLICE_BLOB, "Cannot slice blob for upload. Please retry the upload.");
1788
- }
1789
- function Jn() {
1790
- return new d(h.NO_DOWNLOAD_URL, "The given file does not have any download URLs.");
1791
- }
1792
- function Yn(t) {
1793
- return new d(h.UNSUPPORTED_ENVIRONMENT, `${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);
1794
- }
1795
- function he(t) {
1796
- return new d(h.INVALID_ARGUMENT, t);
1797
- }
1798
- function ze() {
1799
- return new d(h.APP_DELETED, "The Firebase app was deleted.");
1800
- }
1801
- function Zn(t) {
1802
- return new d(h.INVALID_ROOT_OPERATION, "The operation '" + t + "' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').");
1803
- }
1804
- function M(t, e) {
1805
- return new d(h.INVALID_FORMAT, "String does not match format '" + t + "': " + e);
1806
- }
1807
- function P(t) {
1808
- throw new d(h.INTERNAL_ERROR, "Internal error: " + t);
1809
- }
1810
- /**
1811
- * @license
1812
- * Copyright 2017 Google LLC
1813
- *
1814
- * Licensed under the Apache License, Version 2.0 (the "License");
1815
- * you may not use this file except in compliance with the License.
1816
- * You may obtain a copy of the License at
1817
- *
1818
- * http://www.apache.org/licenses/LICENSE-2.0
1819
- *
1820
- * Unless required by applicable law or agreed to in writing, software
1821
- * distributed under the License is distributed on an "AS IS" BASIS,
1822
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1823
- * See the License for the specific language governing permissions and
1824
- * limitations under the License.
1825
- */
1826
- class E {
1827
- constructor(e, n) {
1828
- this.bucket = e, this.path_ = n;
1829
- }
1830
- get path() {
1831
- return this.path_;
1832
- }
1833
- get isRoot() {
1834
- return this.path.length === 0;
1835
- }
1836
- fullServerUrl() {
1837
- const e = encodeURIComponent;
1838
- return "/b/" + e(this.bucket) + "/o/" + e(this.path);
1839
- }
1840
- bucketOnlyServerUrl() {
1841
- return "/b/" + encodeURIComponent(this.bucket) + "/o";
1842
- }
1843
- static makeFromBucketSpec(e, n) {
1844
- let r;
1845
- try {
1846
- r = E.makeFromUrl(e, n);
1847
- } catch {
1848
- return new E(e, "");
1849
- }
1850
- if (r.path === "")
1851
- return r;
1852
- throw Gn(e);
1853
- }
1854
- static makeFromUrl(e, n) {
1855
- let r = null;
1856
- const s = "([A-Za-z0-9.\\-_]+)";
1857
- function o(y) {
1858
- y.path.charAt(y.path.length - 1) === "/" && (y.path_ = y.path_.slice(0, -1));
1859
- }
1860
- const i = "(/(.*))?$", a = new RegExp("^gs://" + s + i, "i"), c = { bucket: 1, path: 3 };
1861
- function l(y) {
1862
- y.path_ = decodeURIComponent(y.path);
1863
- }
1864
- const g = "v[A-Za-z0-9_]+", f = n.replace(/[.]/g, "\\."), p = "(/([^?#]*).*)?$", m = new RegExp(`^https?://${f}/${g}/b/${s}/o${p}`, "i"), w = { bucket: 1, path: 3 }, k = n === je ? "(?:storage.googleapis.com|storage.cloud.google.com)" : n, b = "([^?#]*)", B = new RegExp(`^https?://${k}/${s}/${b}`, "i"), I = [
1865
- { regex: a, indices: c, postModify: o },
1866
- {
1867
- regex: m,
1868
- indices: w,
1869
- postModify: l
1870
- },
1871
- {
1872
- regex: B,
1873
- indices: { bucket: 1, path: 2 },
1874
- postModify: l
1875
- }
1876
- ];
1877
- for (let y = 0; y < I.length; y++) {
1878
- const V = I[y], J = V.regex.exec(e);
1879
- if (J) {
1880
- const st = J[V.indices.bucket];
1881
- let Y = J[V.indices.path];
1882
- Y || (Y = ""), r = new E(st, Y), V.postModify(r);
1883
- break;
1884
- }
1885
- }
1886
- if (r == null)
1887
- throw qn(e);
1888
- return r;
1889
- }
1890
- }
1891
- class Qn {
1892
- constructor(e) {
1893
- this.promise_ = Promise.reject(e);
1894
- }
1895
- /** @inheritDoc */
1896
- getPromise() {
1897
- return this.promise_;
1898
- }
1899
- /** @inheritDoc */
1900
- cancel(e = !1) {
1901
- }
1902
- }
1903
- /**
1904
- * @license
1905
- * Copyright 2017 Google LLC
1906
- *
1907
- * Licensed under the Apache License, Version 2.0 (the "License");
1908
- * you may not use this file except in compliance with the License.
1909
- * You may obtain a copy of the License at
1910
- *
1911
- * http://www.apache.org/licenses/LICENSE-2.0
1912
- *
1913
- * Unless required by applicable law or agreed to in writing, software
1914
- * distributed under the License is distributed on an "AS IS" BASIS,
1915
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1916
- * See the License for the specific language governing permissions and
1917
- * limitations under the License.
1918
- */
1919
- function er(t, e, n) {
1920
- let r = 1, s = null, o = null, i = !1, a = 0;
1921
- function c() {
1922
- return a === 2;
1923
- }
1924
- let l = !1;
1925
- function g(...b) {
1926
- l || (l = !0, e.apply(null, b));
1927
- }
1928
- function f(b) {
1929
- s = setTimeout(() => {
1930
- s = null, t(m, c());
1931
- }, b);
1932
- }
1933
- function p() {
1934
- o && clearTimeout(o);
1935
- }
1936
- function m(b, ...B) {
1937
- if (l) {
1938
- p();
1939
- return;
1940
- }
1941
- if (b) {
1942
- p(), g.call(null, b, ...B);
1943
- return;
1944
- }
1945
- if (c() || i) {
1946
- p(), g.call(null, b, ...B);
1947
- return;
1948
- }
1949
- r < 64 && (r *= 2);
1950
- let I;
1951
- a === 1 ? (a = 2, I = 0) : I = (r + Math.random()) * 1e3, f(I);
1952
- }
1953
- let w = !1;
1954
- function k(b) {
1955
- w || (w = !0, p(), !l && (s !== null ? (b || (a = 2), clearTimeout(s), f(0)) : b || (a = 1)));
1956
- }
1957
- return f(0), o = setTimeout(() => {
1958
- i = !0, k(!0);
1959
- }, n), k;
1960
- }
1961
- function tr(t) {
1962
- t(!1);
1963
- }
1964
- /**
1965
- * @license
1966
- * Copyright 2017 Google LLC
1967
- *
1968
- * Licensed under the Apache License, Version 2.0 (the "License");
1969
- * you may not use this file except in compliance with the License.
1970
- * You may obtain a copy of the License at
1971
- *
1972
- * http://www.apache.org/licenses/LICENSE-2.0
1973
- *
1974
- * Unless required by applicable law or agreed to in writing, software
1975
- * distributed under the License is distributed on an "AS IS" BASIS,
1976
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1977
- * See the License for the specific language governing permissions and
1978
- * limitations under the License.
1979
- */
1980
- function nr(t) {
1981
- return t !== void 0;
1982
- }
1983
- function rr(t) {
1984
- return typeof t == "object" && !Array.isArray(t);
1985
- }
1986
- function ge(t) {
1987
- return typeof t == "string" || t instanceof String;
1988
- }
1989
- function Ce(t) {
1990
- return me() && t instanceof Blob;
1991
- }
1992
- function me() {
1993
- return typeof Blob < "u" && !bt();
1994
- }
1995
- function Oe(t, e, n, r) {
1996
- if (r < e)
1997
- throw he(`Invalid value for '${t}'. Expected ${e} or greater.`);
1998
- if (r > n)
1999
- throw he(`Invalid value for '${t}'. Expected ${n} or less.`);
2000
- }
2001
- /**
2002
- * @license
2003
- * Copyright 2017 Google LLC
2004
- *
2005
- * Licensed under the Apache License, Version 2.0 (the "License");
2006
- * you may not use this file except in compliance with the License.
2007
- * You may obtain a copy of the License at
2008
- *
2009
- * http://www.apache.org/licenses/LICENSE-2.0
2010
- *
2011
- * Unless required by applicable law or agreed to in writing, software
2012
- * distributed under the License is distributed on an "AS IS" BASIS,
2013
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2014
- * See the License for the specific language governing permissions and
2015
- * limitations under the License.
2016
- */
2017
- function j(t, e, n) {
2018
- let r = e;
2019
- return n == null && (r = `https://${e}`), `${n}://${r}/v0${t}`;
2020
- }
2021
- function We(t) {
2022
- const e = encodeURIComponent;
2023
- let n = "?";
2024
- for (const r in t)
2025
- if (t.hasOwnProperty(r)) {
2026
- const s = e(r) + "=" + e(t[r]);
2027
- n = n + s + "&";
2028
- }
2029
- return n = n.slice(0, -1), n;
2030
- }
2031
- /**
2032
- * @license
2033
- * Copyright 2017 Google LLC
2034
- *
2035
- * Licensed under the Apache License, Version 2.0 (the "License");
2036
- * you may not use this file except in compliance with the License.
2037
- * You may obtain a copy of the License at
2038
- *
2039
- * http://www.apache.org/licenses/LICENSE-2.0
2040
- *
2041
- * Unless required by applicable law or agreed to in writing, software
2042
- * distributed under the License is distributed on an "AS IS" BASIS,
2043
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2044
- * See the License for the specific language governing permissions and
2045
- * limitations under the License.
2046
- */
2047
- var O;
2048
- (function(t) {
2049
- t[t.NO_ERROR = 0] = "NO_ERROR", t[t.NETWORK_ERROR = 1] = "NETWORK_ERROR", t[t.ABORT = 2] = "ABORT";
2050
- })(O || (O = {}));
2051
- /**
2052
- * @license
2053
- * Copyright 2022 Google LLC
2054
- *
2055
- * Licensed under the Apache License, Version 2.0 (the "License");
2056
- * you may not use this file except in compliance with the License.
2057
- * You may obtain a copy of the License at
2058
- *
2059
- * http://www.apache.org/licenses/LICENSE-2.0
2060
- *
2061
- * Unless required by applicable law or agreed to in writing, software
2062
- * distributed under the License is distributed on an "AS IS" BASIS,
2063
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2064
- * See the License for the specific language governing permissions and
2065
- * limitations under the License.
2066
- */
2067
- function sr(t, e) {
2068
- const n = t >= 500 && t < 600, s = [
2069
- // Request Timeout: web server didn't receive full request in time.
2070
- 408,
2071
- // Too Many Requests: you're getting rate-limited, basically.
2072
- 429
2073
- ].indexOf(t) !== -1, o = e.indexOf(t) !== -1;
2074
- return n || s || o;
2075
- }
2076
- /**
2077
- * @license
2078
- * Copyright 2017 Google LLC
2079
- *
2080
- * Licensed under the Apache License, Version 2.0 (the "License");
2081
- * you may not use this file except in compliance with the License.
2082
- * You may obtain a copy of the License at
2083
- *
2084
- * http://www.apache.org/licenses/LICENSE-2.0
2085
- *
2086
- * Unless required by applicable law or agreed to in writing, software
2087
- * distributed under the License is distributed on an "AS IS" BASIS,
2088
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2089
- * See the License for the specific language governing permissions and
2090
- * limitations under the License.
2091
- */
2092
- class or {
2093
- constructor(e, n, r, s, o, i, a, c, l, g, f, p = !0) {
2094
- this.url_ = e, this.method_ = n, this.headers_ = r, this.body_ = s, this.successCodes_ = o, this.additionalRetryCodes_ = i, this.callback_ = a, this.errorCallback_ = c, this.timeout_ = l, this.progressCallback_ = g, this.connectionFactory_ = f, this.retry = p, this.pendingConnection_ = null, this.backoffId_ = null, this.canceled_ = !1, this.appDelete_ = !1, this.promise_ = new Promise((m, w) => {
2095
- this.resolve_ = m, this.reject_ = w, this.start_();
2096
- });
2097
- }
2098
- /**
2099
- * Actually starts the retry loop.
2100
- */
2101
- start_() {
2102
- const e = (r, s) => {
2103
- if (s) {
2104
- r(!1, new z(!1, null, !0));
2105
- return;
2106
- }
2107
- const o = this.connectionFactory_();
2108
- this.pendingConnection_ = o;
2109
- const i = (a) => {
2110
- const c = a.loaded, l = a.lengthComputable ? a.total : -1;
2111
- this.progressCallback_ !== null && this.progressCallback_(c, l);
2112
- };
2113
- this.progressCallback_ !== null && o.addUploadProgressListener(i), o.send(this.url_, this.method_, this.body_, this.headers_).then(() => {
2114
- this.progressCallback_ !== null && o.removeUploadProgressListener(i), this.pendingConnection_ = null;
2115
- const a = o.getErrorCode() === O.NO_ERROR, c = o.getStatus();
2116
- if (!a || sr(c, this.additionalRetryCodes_) && this.retry) {
2117
- const g = o.getErrorCode() === O.ABORT;
2118
- r(!1, new z(!1, null, g));
2119
- return;
2120
- }
2121
- const l = this.successCodes_.indexOf(c) !== -1;
2122
- r(!0, new z(l, o));
2123
- });
2124
- }, n = (r, s) => {
2125
- const o = this.resolve_, i = this.reject_, a = s.connection;
2126
- if (s.wasSuccessCode)
2127
- try {
2128
- const c = this.callback_(a, a.getResponse());
2129
- nr(c) ? o(c) : o();
2130
- } catch (c) {
2131
- i(c);
2132
- }
2133
- else if (a !== null) {
2134
- const c = pe();
2135
- c.serverResponse = a.getErrorText(), this.errorCallback_ ? i(this.errorCallback_(a, c)) : i(c);
2136
- } else if (s.canceled) {
2137
- const c = this.appDelete_ ? ze() : Wn();
2138
- i(c);
2139
- } else {
2140
- const c = zn();
2141
- i(c);
2142
- }
2143
- };
2144
- this.canceled_ ? n(!1, new z(!1, null, !0)) : this.backoffId_ = er(e, n, this.timeout_);
2145
- }
2146
- /** @inheritDoc */
2147
- getPromise() {
2148
- return this.promise_;
2149
- }
2150
- /** @inheritDoc */
2151
- cancel(e) {
2152
- this.canceled_ = !0, this.appDelete_ = e || !1, this.backoffId_ !== null && tr(this.backoffId_), this.pendingConnection_ !== null && this.pendingConnection_.abort();
2153
- }
2154
- }
2155
- class z {
2156
- constructor(e, n, r) {
2157
- this.wasSuccessCode = e, this.connection = n, this.canceled = !!r;
2158
- }
2159
- }
2160
- function ir(t, e) {
2161
- e !== null && e.length > 0 && (t.Authorization = "Firebase " + e);
2162
- }
2163
- function ar(t, e) {
2164
- t["X-Firebase-Storage-Version"] = "webjs/" + (e ?? "AppManager");
2165
- }
2166
- function cr(t, e) {
2167
- e && (t["X-Firebase-GMPID"] = e);
2168
- }
2169
- function lr(t, e) {
2170
- e !== null && (t["X-Firebase-AppCheck"] = e);
2171
- }
2172
- function ur(t, e, n, r, s, o, i = !0) {
2173
- const a = We(t.urlParams), c = t.url + a, l = Object.assign({}, t.headers);
2174
- return cr(l, e), ir(l, n), ar(l, o), lr(l, r), new or(c, t.method, l, t.body, t.successCodes, t.additionalRetryCodes, t.handler, t.errorHandler, t.timeout, t.progressCallback, s, i);
2175
- }
2176
- /**
2177
- * @license
2178
- * Copyright 2017 Google LLC
2179
- *
2180
- * Licensed under the Apache License, Version 2.0 (the "License");
2181
- * you may not use this file except in compliance with the License.
2182
- * You may obtain a copy of the License at
2183
- *
2184
- * http://www.apache.org/licenses/LICENSE-2.0
2185
- *
2186
- * Unless required by applicable law or agreed to in writing, software
2187
- * distributed under the License is distributed on an "AS IS" BASIS,
2188
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2189
- * See the License for the specific language governing permissions and
2190
- * limitations under the License.
2191
- */
2192
- function hr() {
2193
- return typeof BlobBuilder < "u" ? BlobBuilder : typeof WebKitBlobBuilder < "u" ? WebKitBlobBuilder : void 0;
2194
- }
2195
- function dr(...t) {
2196
- const e = hr();
2197
- if (e !== void 0) {
2198
- const n = new e();
2199
- for (let r = 0; r < t.length; r++)
2200
- n.append(t[r]);
2201
- return n.getBlob();
2202
- } else {
2203
- if (me())
2204
- return new Blob(t);
2205
- throw new d(h.UNSUPPORTED_ENVIRONMENT, "This browser doesn't seem to support creating Blobs");
2206
- }
2207
- }
2208
- function fr(t, e, n) {
2209
- return t.webkitSlice ? t.webkitSlice(e, n) : t.mozSlice ? t.mozSlice(e, n) : t.slice ? t.slice(e, n) : null;
2210
- }
2211
- /**
2212
- * @license
2213
- * Copyright 2021 Google LLC
2214
- *
2215
- * Licensed under the Apache License, Version 2.0 (the "License");
2216
- * you may not use this file except in compliance with the License.
2217
- * You may obtain a copy of the License at
2218
- *
2219
- * http://www.apache.org/licenses/LICENSE-2.0
2220
- *
2221
- * Unless required by applicable law or agreed to in writing, software
2222
- * distributed under the License is distributed on an "AS IS" BASIS,
2223
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2224
- * See the License for the specific language governing permissions and
2225
- * limitations under the License.
2226
- */
2227
- function pr(t) {
2228
- if (typeof atob > "u")
2229
- throw Yn("base-64");
2230
- return atob(t);
2231
- }
2232
- /**
2233
- * @license
2234
- * Copyright 2017 Google LLC
2235
- *
2236
- * Licensed under the Apache License, Version 2.0 (the "License");
2237
- * you may not use this file except in compliance with the License.
2238
- * You may obtain a copy of the License at
2239
- *
2240
- * http://www.apache.org/licenses/LICENSE-2.0
2241
- *
2242
- * Unless required by applicable law or agreed to in writing, software
2243
- * distributed under the License is distributed on an "AS IS" BASIS,
2244
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2245
- * See the License for the specific language governing permissions and
2246
- * limitations under the License.
2247
- */
2248
- const R = {
2249
- /**
2250
- * Indicates the string should be interpreted "raw", that is, as normal text.
2251
- * The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte
2252
- * sequence.
2253
- * Example: The string 'Hello! \\ud83d\\ude0a' becomes the byte sequence
2254
- * 48 65 6c 6c 6f 21 20 f0 9f 98 8a
2255
- */
2256
- RAW: "raw",
2257
- /**
2258
- * Indicates the string should be interpreted as base64-encoded data.
2259
- * Padding characters (trailing '='s) are optional.
2260
- * Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence
2261
- * ad 69 8e fb e1 3a b7 bf eb 97
2262
- */
2263
- BASE64: "base64",
2264
- /**
2265
- * Indicates the string should be interpreted as base64url-encoded data.
2266
- * Padding characters (trailing '='s) are optional.
2267
- * Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence
2268
- * ad 69 8e fb e1 3a b7 bf eb 97
2269
- */
2270
- BASE64URL: "base64url",
2271
- /**
2272
- * Indicates the string is a data URL, such as one obtained from
2273
- * canvas.toDataURL().
2274
- * Example: the string 'data:application/octet-stream;base64,aaaa'
2275
- * becomes the byte sequence
2276
- * 69 a6 9a
2277
- * (the content-type "application/octet-stream" is also applied, but can
2278
- * be overridden in the metadata object).
2279
- */
2280
- DATA_URL: "data_url"
2281
- };
2282
- class se {
2283
- constructor(e, n) {
2284
- this.data = e, this.contentType = n || null;
2285
- }
2286
- }
2287
- function gr(t, e) {
2288
- switch (t) {
2289
- case R.RAW:
2290
- return new se(qe(e));
2291
- case R.BASE64:
2292
- case R.BASE64URL:
2293
- return new se(Ge(t, e));
2294
- case R.DATA_URL:
2295
- return new se(_r(e), br(e));
2296
- }
2297
- throw pe();
2298
- }
2299
- function qe(t) {
2300
- const e = [];
2301
- for (let n = 0; n < t.length; n++) {
2302
- let r = t.charCodeAt(n);
2303
- if (r <= 127)
2304
- e.push(r);
2305
- else if (r <= 2047)
2306
- e.push(192 | r >> 6, 128 | r & 63);
2307
- else if ((r & 64512) === 55296)
2308
- if (!(n < t.length - 1 && (t.charCodeAt(n + 1) & 64512) === 56320))
2309
- e.push(239, 191, 189);
2310
- else {
2311
- const o = r, i = t.charCodeAt(++n);
2312
- r = 65536 | (o & 1023) << 10 | i & 1023, e.push(240 | r >> 18, 128 | r >> 12 & 63, 128 | r >> 6 & 63, 128 | r & 63);
2313
- }
2314
- else
2315
- (r & 64512) === 56320 ? e.push(239, 191, 189) : e.push(224 | r >> 12, 128 | r >> 6 & 63, 128 | r & 63);
2316
- }
2317
- return new Uint8Array(e);
2318
- }
2319
- function mr(t) {
2320
- let e;
2321
- try {
2322
- e = decodeURIComponent(t);
2323
- } catch {
2324
- throw M(R.DATA_URL, "Malformed data URL.");
2325
- }
2326
- return qe(e);
2327
- }
2328
- function Ge(t, e) {
2329
- switch (t) {
2330
- case R.BASE64: {
2331
- const s = e.indexOf("-") !== -1, o = e.indexOf("_") !== -1;
2332
- if (s || o)
2333
- throw M(t, "Invalid character '" + (s ? "-" : "_") + "' found: is it base64url encoded?");
2334
- break;
2335
- }
2336
- case R.BASE64URL: {
2337
- const s = e.indexOf("+") !== -1, o = e.indexOf("/") !== -1;
2338
- if (s || o)
2339
- throw M(t, "Invalid character '" + (s ? "+" : "/") + "' found: is it base64 encoded?");
2340
- e = e.replace(/-/g, "+").replace(/_/g, "/");
2341
- break;
2342
- }
2343
- }
2344
- let n;
2345
- try {
2346
- n = pr(e);
2347
- } catch (s) {
2348
- throw s.message.includes("polyfill") ? s : M(t, "Invalid character found");
2349
- }
2350
- const r = new Uint8Array(n.length);
2351
- for (let s = 0; s < n.length; s++)
2352
- r[s] = n.charCodeAt(s);
2353
- return r;
2354
- }
2355
- class Ke {
2356
- constructor(e) {
2357
- this.base64 = !1, this.contentType = null;
2358
- const n = e.match(/^data:([^,]+)?,/);
2359
- if (n === null)
2360
- throw M(R.DATA_URL, "Must be formatted 'data:[<mediatype>][;base64],<data>");
2361
- const r = n[1] || null;
2362
- r != null && (this.base64 = yr(r, ";base64"), this.contentType = this.base64 ? r.substring(0, r.length - 7) : r), this.rest = e.substring(e.indexOf(",") + 1);
2363
- }
2364
- }
2365
- function _r(t) {
2366
- const e = new Ke(t);
2367
- return e.base64 ? Ge(R.BASE64, e.rest) : mr(e.rest);
2368
- }
2369
- function br(t) {
2370
- return new Ke(t).contentType;
2371
- }
2372
- function yr(t, e) {
2373
- return t.length >= e.length ? t.substring(t.length - e.length) === e : !1;
2374
- }
2375
- /**
2376
- * @license
2377
- * Copyright 2017 Google LLC
2378
- *
2379
- * Licensed under the Apache License, Version 2.0 (the "License");
2380
- * you may not use this file except in compliance with the License.
2381
- * You may obtain a copy of the License at
2382
- *
2383
- * http://www.apache.org/licenses/LICENSE-2.0
2384
- *
2385
- * Unless required by applicable law or agreed to in writing, software
2386
- * distributed under the License is distributed on an "AS IS" BASIS,
2387
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2388
- * See the License for the specific language governing permissions and
2389
- * limitations under the License.
2390
- */
2391
- class T {
2392
- constructor(e, n) {
2393
- let r = 0, s = "";
2394
- Ce(e) ? (this.data_ = e, r = e.size, s = e.type) : e instanceof ArrayBuffer ? (n ? this.data_ = new Uint8Array(e) : (this.data_ = new Uint8Array(e.byteLength), this.data_.set(new Uint8Array(e))), r = this.data_.length) : e instanceof Uint8Array && (n ? this.data_ = e : (this.data_ = new Uint8Array(e.length), this.data_.set(e)), r = e.length), this.size_ = r, this.type_ = s;
2395
- }
2396
- size() {
2397
- return this.size_;
2398
- }
2399
- type() {
2400
- return this.type_;
2401
- }
2402
- slice(e, n) {
2403
- if (Ce(this.data_)) {
2404
- const r = this.data_, s = fr(r, e, n);
2405
- return s === null ? null : new T(s);
2406
- } else {
2407
- const r = new Uint8Array(this.data_.buffer, e, n - e);
2408
- return new T(r, !0);
2409
- }
2410
- }
2411
- static getBlob(...e) {
2412
- if (me()) {
2413
- const n = e.map((r) => r instanceof T ? r.data_ : r);
2414
- return new T(dr.apply(null, n));
2415
- } else {
2416
- const n = e.map((i) => ge(i) ? gr(R.RAW, i).data : i.data_);
2417
- let r = 0;
2418
- n.forEach((i) => {
2419
- r += i.byteLength;
2420
- });
2421
- const s = new Uint8Array(r);
2422
- let o = 0;
2423
- return n.forEach((i) => {
2424
- for (let a = 0; a < i.length; a++)
2425
- s[o++] = i[a];
2426
- }), new T(s, !0);
2427
- }
2428
- }
2429
- uploadData() {
2430
- return this.data_;
2431
- }
2432
- }
2433
- /**
2434
- * @license
2435
- * Copyright 2017 Google LLC
2436
- *
2437
- * Licensed under the Apache License, Version 2.0 (the "License");
2438
- * you may not use this file except in compliance with the License.
2439
- * You may obtain a copy of the License at
2440
- *
2441
- * http://www.apache.org/licenses/LICENSE-2.0
2442
- *
2443
- * Unless required by applicable law or agreed to in writing, software
2444
- * distributed under the License is distributed on an "AS IS" BASIS,
2445
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2446
- * See the License for the specific language governing permissions and
2447
- * limitations under the License.
2448
- */
2449
- function Xe(t) {
2450
- let e;
2451
- try {
2452
- e = JSON.parse(t);
2453
- } catch {
2454
- return null;
2455
- }
2456
- return rr(e) ? e : null;
2457
- }
2458
- /**
2459
- * @license
2460
- * Copyright 2017 Google LLC
2461
- *
2462
- * Licensed under the Apache License, Version 2.0 (the "License");
2463
- * you may not use this file except in compliance with the License.
2464
- * You may obtain a copy of the License at
2465
- *
2466
- * http://www.apache.org/licenses/LICENSE-2.0
2467
- *
2468
- * Unless required by applicable law or agreed to in writing, software
2469
- * distributed under the License is distributed on an "AS IS" BASIS,
2470
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2471
- * See the License for the specific language governing permissions and
2472
- * limitations under the License.
2473
- */
2474
- function Er(t) {
2475
- if (t.length === 0)
2476
- return null;
2477
- const e = t.lastIndexOf("/");
2478
- return e === -1 ? "" : t.slice(0, e);
2479
- }
2480
- function wr(t, e) {
2481
- const n = e.split("/").filter((r) => r.length > 0).join("/");
2482
- return t.length === 0 ? n : t + "/" + n;
2483
- }
2484
- function Je(t) {
2485
- const e = t.lastIndexOf("/", t.length - 2);
2486
- return e === -1 ? t : t.slice(e + 1);
2487
- }
2488
- /**
2489
- * @license
2490
- * Copyright 2017 Google LLC
2491
- *
2492
- * Licensed under the Apache License, Version 2.0 (the "License");
2493
- * you may not use this file except in compliance with the License.
2494
- * You may obtain a copy of the License at
2495
- *
2496
- * http://www.apache.org/licenses/LICENSE-2.0
2497
- *
2498
- * Unless required by applicable law or agreed to in writing, software
2499
- * distributed under the License is distributed on an "AS IS" BASIS,
2500
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2501
- * See the License for the specific language governing permissions and
2502
- * limitations under the License.
2503
- */
2504
- function Ir(t, e) {
2505
- return e;
2506
- }
2507
- class _ {
2508
- constructor(e, n, r, s) {
2509
- this.server = e, this.local = n || e, this.writable = !!r, this.xform = s || Ir;
2510
- }
2511
- }
2512
- let W = null;
2513
- function Rr(t) {
2514
- return !ge(t) || t.length < 2 ? t : Je(t);
2515
- }
2516
- function Ye() {
2517
- if (W)
2518
- return W;
2519
- const t = [];
2520
- t.push(new _("bucket")), t.push(new _("generation")), t.push(new _("metageneration")), t.push(new _("name", "fullPath", !0));
2521
- function e(o, i) {
2522
- return Rr(i);
2523
- }
2524
- const n = new _("name");
2525
- n.xform = e, t.push(n);
2526
- function r(o, i) {
2527
- return i !== void 0 ? Number(i) : i;
2528
- }
2529
- const s = new _("size");
2530
- return s.xform = r, t.push(s), t.push(new _("timeCreated")), t.push(new _("updated")), t.push(new _("md5Hash", null, !0)), t.push(new _("cacheControl", null, !0)), t.push(new _("contentDisposition", null, !0)), t.push(new _("contentEncoding", null, !0)), t.push(new _("contentLanguage", null, !0)), t.push(new _("contentType", null, !0)), t.push(new _("metadata", "customMetadata", !0)), W = t, W;
2531
- }
2532
- function Tr(t, e) {
2533
- function n() {
2534
- const r = t.bucket, s = t.fullPath, o = new E(r, s);
2535
- return e._makeStorageReference(o);
2536
- }
2537
- Object.defineProperty(t, "ref", { get: n });
2538
- }
2539
- function Ar(t, e, n) {
2540
- const r = {};
2541
- r.type = "file";
2542
- const s = n.length;
2543
- for (let o = 0; o < s; o++) {
2544
- const i = n[o];
2545
- r[i.local] = i.xform(r, e[i.server]);
2546
- }
2547
- return Tr(r, t), r;
2548
- }
2549
- function Ze(t, e, n) {
2550
- const r = Xe(e);
2551
- return r === null ? null : Ar(t, r, n);
2552
- }
2553
- function vr(t, e, n, r) {
2554
- const s = Xe(e);
2555
- if (s === null || !ge(s.downloadTokens))
2556
- return null;
2557
- const o = s.downloadTokens;
2558
- if (o.length === 0)
2559
- return null;
2560
- const i = encodeURIComponent;
2561
- return o.split(",").map((l) => {
2562
- const g = t.bucket, f = t.fullPath, p = "/b/" + i(g) + "/o/" + i(f), m = j(p, n, r), w = We({
2563
- alt: "media",
2564
- token: l
2565
- });
2566
- return m + w;
2567
- })[0];
2568
- }
2569
- function Dr(t, e) {
2570
- const n = {}, r = e.length;
2571
- for (let s = 0; s < r; s++) {
2572
- const o = e[s];
2573
- o.writable && (n[o.server] = t[o.local]);
2574
- }
2575
- return JSON.stringify(n);
2576
- }
2577
- class X {
2578
- constructor(e, n, r, s) {
2579
- this.url = e, 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 = [];
2580
- }
2581
- }
2582
- /**
2583
- * @license
2584
- * Copyright 2017 Google LLC
2585
- *
2586
- * Licensed under the Apache License, Version 2.0 (the "License");
2587
- * you may not use this file except in compliance with the License.
2588
- * You may obtain a copy of the License at
2589
- *
2590
- * http://www.apache.org/licenses/LICENSE-2.0
2591
- *
2592
- * Unless required by applicable law or agreed to in writing, software
2593
- * distributed under the License is distributed on an "AS IS" BASIS,
2594
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2595
- * See the License for the specific language governing permissions and
2596
- * limitations under the License.
2597
- */
2598
- function Qe(t) {
2599
- if (!t)
2600
- throw pe();
2601
- }
2602
- function Cr(t, e) {
2603
- function n(r, s) {
2604
- const o = Ze(t, s, e);
2605
- return Qe(o !== null), o;
2606
- }
2607
- return n;
2608
- }
2609
- function Or(t, e) {
2610
- function n(r, s) {
2611
- const o = Ze(t, s, e);
2612
- return Qe(o !== null), vr(o, s, t.host, t._protocol);
2613
- }
2614
- return n;
2615
- }
2616
- function et(t) {
2617
- function e(n, r) {
2618
- let s;
2619
- 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 = jn() : s = Hn() : n.getStatus() === 402 ? s = Fn(t.bucket) : n.getStatus() === 403 ? s = Vn(t.path) : s = r, s.status = n.getStatus(), s.serverResponse = r.serverResponse, s;
2620
- }
2621
- return e;
2622
- }
2623
- function _e(t) {
2624
- const e = et(t);
2625
- function n(r, s) {
2626
- let o = e(r, s);
2627
- return r.getStatus() === 404 && (o = $n(t.path)), o.serverResponse = s.serverResponse, o;
2628
- }
2629
- return n;
2630
- }
2631
- function Sr(t, e, n) {
2632
- const r = e.fullServerUrl(), s = j(r, t.host, t._protocol) + "?alt=media", o = "GET", i = t.maxOperationRetryTime, a = new X(s, o, (c, l) => l, i);
2633
- return a.errorHandler = _e(e), n !== void 0 && (a.headers.Range = `bytes=0-${n}`, a.successCodes = [
2634
- 200,
2635
- 206
2636
- /* Partial Content */
2637
- ]), a;
2638
- }
2639
- function Nr(t, e, n) {
2640
- const r = e.fullServerUrl(), s = j(r, t.host, t._protocol), o = "GET", i = t.maxOperationRetryTime, a = new X(s, o, Or(t, n), i);
2641
- return a.errorHandler = _e(e), a;
2642
- }
2643
- function kr(t, e) {
2644
- const n = e.fullServerUrl(), r = j(n, t.host, t._protocol), s = "DELETE", o = t.maxOperationRetryTime;
2645
- function i(c, l) {
2646
- }
2647
- const a = new X(r, s, i, o);
2648
- return a.successCodes = [200, 204], a.errorHandler = _e(e), a;
2649
- }
2650
- function Br(t, e) {
2651
- return t && t.contentType || e && e.type() || "application/octet-stream";
2652
- }
2653
- function xr(t, e, n) {
2654
- const r = Object.assign({}, n);
2655
- return r.fullPath = t.path, r.size = e.size(), r.contentType || (r.contentType = Br(null, e)), r;
2656
- }
2657
- function Ur(t, e, n, r, s) {
2658
- const o = e.bucketOnlyServerUrl(), i = {
2659
- "X-Goog-Upload-Protocol": "multipart"
2660
- };
2661
- function a() {
2662
- let I = "";
2663
- for (let y = 0; y < 2; y++)
2664
- I = I + Math.random().toString().slice(2);
2665
- return I;
2666
- }
2667
- const c = a();
2668
- i["Content-Type"] = "multipart/related; boundary=" + c;
2669
- const l = xr(e, r, s), g = Dr(l, n), f = "--" + c + `\r
2670
- Content-Type: application/json; charset=utf-8\r
2671
- \r
2672
- ` + g + `\r
2673
- --` + c + `\r
2674
- Content-Type: ` + l.contentType + `\r
2675
- \r
2676
- `, p = `\r
2677
- --` + c + "--", m = T.getBlob(f, r, p);
2678
- if (m === null)
2679
- throw Xn();
2680
- const w = { name: l.fullPath }, k = j(o, t.host, t._protocol), b = "POST", B = t.maxUploadRetryTime, D = new X(k, b, Cr(t, n), B);
2681
- return D.urlParams = w, D.headers = i, D.body = m.uploadData(), D.errorHandler = et(e), D;
2682
- }
2683
- class tt {
2684
- constructor() {
2685
- this.sent_ = !1, this.xhr_ = new XMLHttpRequest(), this.initXhr(), this.errorCode_ = O.NO_ERROR, this.sendPromise_ = new Promise((e) => {
2686
- this.xhr_.addEventListener("abort", () => {
2687
- this.errorCode_ = O.ABORT, e();
2688
- }), this.xhr_.addEventListener("error", () => {
2689
- this.errorCode_ = O.NETWORK_ERROR, e();
2690
- }), this.xhr_.addEventListener("load", () => {
2691
- e();
2692
- });
2693
- });
2694
- }
2695
- send(e, n, r, s) {
2696
- if (this.sent_)
2697
- throw P("cannot .send() more than once");
2698
- if (this.sent_ = !0, this.xhr_.open(n, e, !0), s !== void 0)
2699
- for (const o in s)
2700
- s.hasOwnProperty(o) && this.xhr_.setRequestHeader(o, s[o].toString());
2701
- return r !== void 0 ? this.xhr_.send(r) : this.xhr_.send(), this.sendPromise_;
2702
- }
2703
- getErrorCode() {
2704
- if (!this.sent_)
2705
- throw P("cannot .getErrorCode() before sending");
2706
- return this.errorCode_;
2707
- }
2708
- getStatus() {
2709
- if (!this.sent_)
2710
- throw P("cannot .getStatus() before sending");
2711
- try {
2712
- return this.xhr_.status;
2713
- } catch {
2714
- return -1;
2715
- }
2716
- }
2717
- getResponse() {
2718
- if (!this.sent_)
2719
- throw P("cannot .getResponse() before sending");
2720
- return this.xhr_.response;
2721
- }
2722
- getErrorText() {
2723
- if (!this.sent_)
2724
- throw P("cannot .getErrorText() before sending");
2725
- return this.xhr_.statusText;
2726
- }
2727
- /** Aborts the request. */
2728
- abort() {
2729
- this.xhr_.abort();
2730
- }
2731
- getResponseHeader(e) {
2732
- return this.xhr_.getResponseHeader(e);
2733
- }
2734
- addUploadProgressListener(e) {
2735
- this.xhr_.upload != null && this.xhr_.upload.addEventListener("progress", e);
2736
- }
2737
- removeUploadProgressListener(e) {
2738
- this.xhr_.upload != null && this.xhr_.upload.removeEventListener("progress", e);
2739
- }
2740
- }
2741
- class Pr extends tt {
2742
- initXhr() {
2743
- this.xhr_.responseType = "text";
2744
- }
2745
- }
2746
- function be() {
2747
- return new Pr();
2748
- }
2749
- class Lr extends tt {
2750
- initXhr() {
2751
- this.xhr_.responseType = "blob";
2752
- }
2753
- }
2754
- function Mr() {
2755
- return new Lr();
2756
- }
2757
- /**
2758
- * @license
2759
- * Copyright 2019 Google LLC
2760
- *
2761
- * Licensed under the Apache License, Version 2.0 (the "License");
2762
- * you may not use this file except in compliance with the License.
2763
- * You may obtain a copy of the License at
2764
- *
2765
- * http://www.apache.org/licenses/LICENSE-2.0
2766
- *
2767
- * Unless required by applicable law or agreed to in writing, software
2768
- * distributed under the License is distributed on an "AS IS" BASIS,
2769
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2770
- * See the License for the specific language governing permissions and
2771
- * limitations under the License.
2772
- */
2773
- class N {
2774
- constructor(e, n) {
2775
- this._service = e, n instanceof E ? this._location = n : this._location = E.makeFromUrl(n, e.host);
2776
- }
2777
- /**
2778
- * Returns the URL for the bucket and path this object references,
2779
- * in the form gs://<bucket>/<object-path>
2780
- * @override
2781
- */
2782
- toString() {
2783
- return "gs://" + this._location.bucket + "/" + this._location.path;
2784
- }
2785
- _newRef(e, n) {
2786
- return new N(e, n);
2787
- }
2788
- /**
2789
- * A reference to the root of this object's bucket.
2790
- */
2791
- get root() {
2792
- const e = new E(this._location.bucket, "");
2793
- return this._newRef(this._service, e);
2794
- }
2795
- /**
2796
- * The name of the bucket containing this reference's object.
2797
- */
2798
- get bucket() {
2799
- return this._location.bucket;
2800
- }
2801
- /**
2802
- * The full path of this object.
2803
- */
2804
- get fullPath() {
2805
- return this._location.path;
2806
- }
2807
- /**
2808
- * The short name of this object, which is the last component of the full path.
2809
- * For example, if fullPath is 'full/path/image.png', name is 'image.png'.
2810
- */
2811
- get name() {
2812
- return Je(this._location.path);
2813
- }
2814
- /**
2815
- * The `StorageService` instance this `StorageReference` is associated with.
2816
- */
2817
- get storage() {
2818
- return this._service;
2819
- }
2820
- /**
2821
- * A `StorageReference` pointing to the parent location of this `StorageReference`, or null if
2822
- * this reference is the root.
2823
- */
2824
- get parent() {
2825
- const e = Er(this._location.path);
2826
- if (e === null)
2827
- return null;
2828
- const n = new E(this._location.bucket, e);
2829
- return new N(this._service, n);
2830
- }
2831
- /**
2832
- * Utility function to throw an error in methods that do not accept a root reference.
2833
- */
2834
- _throwIfRoot(e) {
2835
- if (this._location.path === "")
2836
- throw Zn(e);
2837
- }
2838
- }
2839
- function $r(t, e) {
2840
- t._throwIfRoot("getBlob");
2841
- const n = Sr(t.storage, t._location, e);
2842
- return t.storage.makeRequestWithTokens(n, Mr).then((r) => e !== void 0 ? (
2843
- // GCS may not honor the Range header for small files
2844
- r.slice(0, e)
2845
- ) : r);
2846
- }
2847
- function Fr(t, e, n) {
2848
- t._throwIfRoot("uploadBytes");
2849
- const r = Ur(t.storage, t._location, Ye(), new T(e, !0), n);
2850
- return t.storage.makeRequestWithTokens(r, be).then((s) => ({
2851
- metadata: s,
2852
- ref: t
2853
- }));
2854
- }
2855
- function Hr(t) {
2856
- t._throwIfRoot("getDownloadURL");
2857
- const e = Nr(t.storage, t._location, Ye());
2858
- return t.storage.makeRequestWithTokens(e, be).then((n) => {
2859
- if (n === null)
2860
- throw Jn();
2861
- return n;
2862
- });
2863
- }
2864
- function jr(t) {
2865
- t._throwIfRoot("deleteObject");
2866
- const e = kr(t.storage, t._location);
2867
- return t.storage.makeRequestWithTokens(e, be);
2868
- }
2869
- function Vr(t, e) {
2870
- const n = wr(t._location.path, e), r = new E(t._location.bucket, n);
2871
- return new N(t.storage, r);
2872
- }
2873
- /**
2874
- * @license
2875
- * Copyright 2017 Google LLC
2876
- *
2877
- * Licensed under the Apache License, Version 2.0 (the "License");
2878
- * you may not use this file except in compliance with the License.
2879
- * You may obtain a copy of the License at
2880
- *
2881
- * http://www.apache.org/licenses/LICENSE-2.0
2882
- *
2883
- * Unless required by applicable law or agreed to in writing, software
2884
- * distributed under the License is distributed on an "AS IS" BASIS,
2885
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2886
- * See the License for the specific language governing permissions and
2887
- * limitations under the License.
2888
- */
2889
- function zr(t) {
2890
- return /^[A-Za-z]+:\/\//.test(t);
2891
- }
2892
- function Wr(t, e) {
2893
- return new N(t, e);
2894
- }
2895
- function nt(t, e) {
2896
- if (t instanceof ye) {
2897
- const n = t;
2898
- if (n._bucket == null)
2899
- throw Kn();
2900
- const r = new N(n, n._bucket);
2901
- return e != null ? nt(r, e) : r;
2902
- } else
2903
- return e !== void 0 ? Vr(t, e) : t;
2904
- }
2905
- function qr(t, e) {
2906
- if (e && zr(e)) {
2907
- if (t instanceof ye)
2908
- return Wr(t, e);
2909
- throw he("To use ref(service, url), the first argument must be a Storage instance.");
2910
- } else
2911
- return nt(t, e);
2912
- }
2913
- function Se(t, e) {
2914
- const n = e == null ? void 0 : e[Ve];
2915
- return n == null ? null : E.makeFromBucketSpec(n, t);
2916
- }
2917
- function Gr(t, e, n, r = {}) {
2918
- t.host = `${e}:${n}`, t._protocol = "http";
2919
- const { mockUserToken: s } = r;
2920
- s && (t._overrideAuthToken = typeof s == "string" ? s : _t(s, t.app.options.projectId));
2921
- }
2922
- class ye {
2923
- constructor(e, n, r, s, o) {
2924
- this.app = e, this._authProvider = n, this._appCheckProvider = r, this._url = s, this._firebaseVersion = o, this._bucket = null, this._host = je, this._protocol = "https", this._appId = null, this._deleted = !1, this._maxOperationRetryTime = Ln, this._maxUploadRetryTime = Mn, this._requests = /* @__PURE__ */ new Set(), s != null ? this._bucket = E.makeFromBucketSpec(s, this._host) : this._bucket = Se(this._host, this.app.options);
2925
- }
2926
- /**
2927
- * The host string for this service, in the form of `host` or
2928
- * `host:port`.
2929
- */
2930
- get host() {
2931
- return this._host;
2932
- }
2933
- set host(e) {
2934
- this._host = e, this._url != null ? this._bucket = E.makeFromBucketSpec(this._url, e) : this._bucket = Se(e, this.app.options);
2935
- }
2936
- /**
2937
- * The maximum time to retry uploads in milliseconds.
2938
- */
2939
- get maxUploadRetryTime() {
2940
- return this._maxUploadRetryTime;
2941
- }
2942
- set maxUploadRetryTime(e) {
2943
- Oe(
2944
- "time",
2945
- /* minValue=*/
2946
- 0,
2947
- /* maxValue= */
2948
- Number.POSITIVE_INFINITY,
2949
- e
2950
- ), this._maxUploadRetryTime = e;
2951
- }
2952
- /**
2953
- * The maximum time to retry operations other than uploads or downloads in
2954
- * milliseconds.
2955
- */
2956
- get maxOperationRetryTime() {
2957
- return this._maxOperationRetryTime;
2958
- }
2959
- set maxOperationRetryTime(e) {
2960
- Oe(
2961
- "time",
2962
- /* minValue=*/
2963
- 0,
2964
- /* maxValue= */
2965
- Number.POSITIVE_INFINITY,
2966
- e
2967
- ), this._maxOperationRetryTime = e;
2968
- }
2969
- async _getAuthToken() {
2970
- if (this._overrideAuthToken)
2971
- return this._overrideAuthToken;
2972
- const e = this._authProvider.getImmediate({ optional: !0 });
2973
- if (e) {
2974
- const n = await e.getToken();
2975
- if (n !== null)
2976
- return n.accessToken;
2977
- }
2978
- return null;
2979
- }
2980
- async _getAppCheckToken() {
2981
- const e = this._appCheckProvider.getImmediate({ optional: !0 });
2982
- return e ? (await e.getToken()).token : null;
2983
- }
2984
- /**
2985
- * Stop running requests and prevent more from being created.
2986
- */
2987
- _delete() {
2988
- return this._deleted || (this._deleted = !0, this._requests.forEach((e) => e.cancel()), this._requests.clear()), Promise.resolve();
2989
- }
2990
- /**
2991
- * Returns a new firebaseStorage.Reference object referencing this StorageService
2992
- * at the given Location.
2993
- */
2994
- _makeStorageReference(e) {
2995
- return new N(this, e);
2996
- }
2997
- /**
2998
- * @param requestInfo - HTTP RequestInfo object
2999
- * @param authToken - Firebase auth token
3000
- */
3001
- _makeRequest(e, n, r, s, o = !0) {
3002
- if (this._deleted)
3003
- return new Qn(ze());
3004
- {
3005
- const i = ur(e, this._appId, r, s, n, this._firebaseVersion, o);
3006
- return this._requests.add(i), i.getPromise().then(() => this._requests.delete(i), () => this._requests.delete(i)), i;
3007
- }
3008
- }
3009
- async makeRequestWithTokens(e, n) {
3010
- const [r, s] = await Promise.all([
3011
- this._getAuthToken(),
3012
- this._getAppCheckToken()
3013
- ]);
3014
- return this._makeRequest(e, n, r, s).getPromise();
3015
- }
3016
- }
3017
- const Ne = "@firebase/storage", ke = "0.11.2";
3018
- /**
3019
- * @license
3020
- * Copyright 2020 Google LLC
3021
- *
3022
- * Licensed under the Apache License, Version 2.0 (the "License");
3023
- * you may not use this file except in compliance with the License.
3024
- * You may obtain a copy of the License at
3025
- *
3026
- * http://www.apache.org/licenses/LICENSE-2.0
3027
- *
3028
- * Unless required by applicable law or agreed to in writing, software
3029
- * distributed under the License is distributed on an "AS IS" BASIS,
3030
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3031
- * See the License for the specific language governing permissions and
3032
- * limitations under the License.
3033
- */
3034
- const rt = "storage";
3035
- function as(t, e, n) {
3036
- return t = U(t), Fr(t, e, n);
3037
- }
3038
- function cs(t) {
3039
- return t = U(t), Hr(t);
3040
- }
3041
- function ls(t) {
3042
- return t = U(t), jr(t);
3043
- }
3044
- function us(t, e) {
3045
- return t = U(t), qr(t, e);
3046
- }
3047
- function hs(t = Dn(), e) {
3048
- t = U(t);
3049
- const r = In(t, rt).getImmediate({
3050
- identifier: e
3051
- }), s = gt("storage");
3052
- return s && Kr(r, ...s), r;
3053
- }
3054
- function Kr(t, e, n, r = {}) {
3055
- Gr(t, e, n, r);
3056
- }
3057
- /**
3058
- * @license
3059
- * Copyright 2021 Google LLC
3060
- *
3061
- * Licensed under the Apache License, Version 2.0 (the "License");
3062
- * you may not use this file except in compliance with the License.
3063
- * You may obtain a copy of the License at
3064
- *
3065
- * http://www.apache.org/licenses/LICENSE-2.0
3066
- *
3067
- * Unless required by applicable law or agreed to in writing, software
3068
- * distributed under the License is distributed on an "AS IS" BASIS,
3069
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3070
- * See the License for the specific language governing permissions and
3071
- * limitations under the License.
3072
- */
3073
- function ds(t, e) {
3074
- return t = U(t), $r(t, e);
3075
- }
3076
- function Xr(t, { instanceIdentifier: e }) {
3077
- const n = t.getProvider("app").getImmediate(), r = t.getProvider("auth-internal"), s = t.getProvider("app-check-internal");
3078
- return new ye(n, r, s, e, An);
3079
- }
3080
- function Jr() {
3081
- G(new $(
3082
- rt,
3083
- Xr,
3084
- "PUBLIC"
3085
- /* ComponentType.PUBLIC */
3086
- ).setMultipleInstances(!0)), L(Ne, ke, ""), L(Ne, ke, "esm2017");
3087
- }
3088
- Jr();
3089
- const de = ot(null), fs = () => de.value;
3090
- function ps(t) {
3091
- de.value || (de.value = t);
3092
- }
3093
- const gs = Object.freeze({
3094
- jb: {
3095
- lat: 1.492659,
3096
- lng: 103.7413591
3097
- }
3098
- });
3099
- function ms(t) {
3100
- return [t.lng, t.lat];
3101
- }
3102
- function _s(t) {
3103
- if (t.length !== 2)
3104
- throw Error("Invalid coordinate array");
3105
- return {
3106
- lat: t[1],
3107
- lng: t[0]
3108
- };
3109
- }
3110
- export {
3111
- ls as A,
3112
- gs as B,
3113
- $ as C,
3114
- _s as D,
3115
- Le as E,
3116
- x as F,
3117
- ms as G,
3118
- u as L,
3119
- An as S,
3120
- G as _,
3121
- ts as a,
3122
- es as b,
3123
- U as c,
3124
- os as d,
3125
- In as e,
3126
- pt as f,
3127
- Zr as g,
3128
- Dn as h,
3129
- Qr as i,
3130
- Pe as j,
3131
- oe as k,
3132
- xt as l,
3133
- lt as m,
3134
- ns as n,
3135
- rs as o,
3136
- is as p,
3137
- ss as q,
3138
- L as r,
3139
- vn as s,
3140
- hs as t,
3141
- fs as u,
3142
- ps as v,
3143
- us as w,
3144
- ds as x,
3145
- as as y,
3146
- cs as z
3147
- };