@laboratoria/sdk-js 7.2.0-beta.0 → 7.2.0-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/laboratoria-sdk-es.js +751 -730
- package/dist/laboratoria-sdk-umd.js +92 -92
- package/package.json +3 -3
@@ -30,7 +30,7 @@
|
|
30
30
|
* See the License for the specific language governing permissions and
|
31
31
|
* limitations under the License.
|
32
32
|
*/
|
33
|
-
const
|
33
|
+
const xt = function(n) {
|
34
34
|
const e = [];
|
35
35
|
let t = 0;
|
36
36
|
for (let r = 0; r < n.length; r++) {
|
@@ -38,7 +38,7 @@ const Wt = function(n) {
|
|
38
38
|
i < 128 ? e[t++] = i : i < 2048 ? (e[t++] = i >> 6 | 192, e[t++] = i & 63 | 128) : (i & 64512) === 55296 && r + 1 < n.length && (n.charCodeAt(r + 1) & 64512) === 56320 ? (i = 65536 + ((i & 1023) << 10) + (n.charCodeAt(++r) & 1023), e[t++] = i >> 18 | 240, e[t++] = i >> 12 & 63 | 128, e[t++] = i >> 6 & 63 | 128, e[t++] = i & 63 | 128) : (e[t++] = i >> 12 | 224, e[t++] = i >> 6 & 63 | 128, e[t++] = i & 63 | 128);
|
39
39
|
}
|
40
40
|
return e;
|
41
|
-
},
|
41
|
+
}, $n = function(n) {
|
42
42
|
const e = [];
|
43
43
|
let t = 0, r = 0;
|
44
44
|
for (; t < n.length; ) {
|
@@ -57,7 +57,7 @@ const Wt = function(n) {
|
|
57
57
|
}
|
58
58
|
}
|
59
59
|
return e.join("");
|
60
|
-
},
|
60
|
+
}, zt = {
|
61
61
|
/**
|
62
62
|
* Maps bytes to characters.
|
63
63
|
*/
|
@@ -117,8 +117,8 @@ const Wt = function(n) {
|
|
117
117
|
const t = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [];
|
118
118
|
for (let i = 0; i < n.length; i += 3) {
|
119
119
|
const s = n[i], o = i + 1 < n.length, c = o ? n[i + 1] : 0, a = i + 2 < n.length, u = a ? n[i + 2] : 0, y = s >> 2, b = (s & 3) << 4 | c >> 4;
|
120
|
-
let
|
121
|
-
a || (O = 64, o || (
|
120
|
+
let A = (c & 15) << 2 | u >> 6, O = u & 63;
|
121
|
+
a || (O = 64, o || (A = 64)), r.push(t[y], t[b], t[A], t[O]);
|
122
122
|
}
|
123
123
|
return r.join("");
|
124
124
|
},
|
@@ -131,7 +131,7 @@ const Wt = function(n) {
|
|
131
131
|
* @return The base64 encoded string.
|
132
132
|
*/
|
133
133
|
encodeString(n, e) {
|
134
|
-
return this.HAS_NATIVE_SUPPORT && !e ? btoa(n) : this.encodeByteArray(
|
134
|
+
return this.HAS_NATIVE_SUPPORT && !e ? btoa(n) : this.encodeByteArray(xt(n), e);
|
135
135
|
},
|
136
136
|
/**
|
137
137
|
* Base64-decode a string.
|
@@ -142,7 +142,7 @@ const Wt = function(n) {
|
|
142
142
|
* @return string representing the decoded value.
|
143
143
|
*/
|
144
144
|
decodeString(n, e) {
|
145
|
-
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) :
|
145
|
+
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) : $n(this.decodeStringToByteArray(n, e));
|
146
146
|
},
|
147
147
|
/**
|
148
148
|
* Base64-decode a string.
|
@@ -169,9 +169,9 @@ const Wt = function(n) {
|
|
169
169
|
++i;
|
170
170
|
const b = i < n.length ? t[n.charAt(i)] : 64;
|
171
171
|
if (++i, s == null || c == null || u == null || b == null)
|
172
|
-
throw new
|
173
|
-
const
|
174
|
-
if (r.push(
|
172
|
+
throw new Mn();
|
173
|
+
const A = s << 2 | c >> 4;
|
174
|
+
if (r.push(A), u !== 64) {
|
175
175
|
const O = c << 4 & 240 | u >> 2;
|
176
176
|
if (r.push(O), b !== 64) {
|
177
177
|
const N = u << 6 & 192 | b;
|
@@ -194,19 +194,19 @@ const Wt = function(n) {
|
|
194
194
|
}
|
195
195
|
}
|
196
196
|
};
|
197
|
-
class
|
197
|
+
class Mn extends Error {
|
198
198
|
constructor() {
|
199
199
|
super(...arguments), this.name = "DecodeBase64StringError";
|
200
200
|
}
|
201
201
|
}
|
202
|
-
const
|
203
|
-
const e =
|
204
|
-
return
|
205
|
-
}, zt = function(n) {
|
206
|
-
return Mn(n).replace(/\./g, "");
|
202
|
+
const Un = function(n) {
|
203
|
+
const e = xt(n);
|
204
|
+
return zt.encodeByteArray(e, !0);
|
207
205
|
}, qt = function(n) {
|
206
|
+
return Un(n).replace(/\./g, "");
|
207
|
+
}, Jt = function(n) {
|
208
208
|
try {
|
209
|
-
return
|
209
|
+
return zt.decodeString(n, !0);
|
210
210
|
} catch (e) {
|
211
211
|
console.error("base64Decode failed: ", e);
|
212
212
|
}
|
@@ -228,7 +228,7 @@ const Mn = function(n) {
|
|
228
228
|
* See the License for the specific language governing permissions and
|
229
229
|
* limitations under the License.
|
230
230
|
*/
|
231
|
-
function
|
231
|
+
function jn() {
|
232
232
|
if (typeof self < "u")
|
233
233
|
return self;
|
234
234
|
if (typeof window < "u")
|
@@ -253,13 +253,13 @@ function Un() {
|
|
253
253
|
* See the License for the specific language governing permissions and
|
254
254
|
* limitations under the License.
|
255
255
|
*/
|
256
|
-
const
|
256
|
+
const Bn = () => jn().__FIREBASE_DEFAULTS__, Fn = () => {
|
257
257
|
if (typeof process > "u" || typeof process.env > "u")
|
258
258
|
return;
|
259
259
|
const n = process.env.__FIREBASE_DEFAULTS__;
|
260
260
|
if (n)
|
261
261
|
return JSON.parse(n);
|
262
|
-
},
|
262
|
+
}, Vn = () => {
|
263
263
|
if (typeof document > "u")
|
264
264
|
return;
|
265
265
|
let n;
|
@@ -268,24 +268,24 @@ const jn = () => Un().__FIREBASE_DEFAULTS__, Bn = () => {
|
|
268
268
|
} catch {
|
269
269
|
return;
|
270
270
|
}
|
271
|
-
const e = n &&
|
271
|
+
const e = n && Jt(n[1]);
|
272
272
|
return e && JSON.parse(e);
|
273
|
-
},
|
273
|
+
}, rt = () => {
|
274
274
|
try {
|
275
|
-
return
|
275
|
+
return Bn() || Fn() || Vn();
|
276
276
|
} catch (n) {
|
277
277
|
console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);
|
278
278
|
return;
|
279
279
|
}
|
280
280
|
}, Hn = (n) => {
|
281
281
|
var e, t;
|
282
|
-
return (t = (e =
|
282
|
+
return (t = (e = rt()) === null || e === void 0 ? void 0 : e.emulatorHosts) === null || t === void 0 ? void 0 : t[n];
|
283
283
|
}, Gt = () => {
|
284
284
|
var n;
|
285
|
-
return (n =
|
286
|
-
},
|
285
|
+
return (n = rt()) === null || n === void 0 ? void 0 : n.config;
|
286
|
+
}, Kt = (n) => {
|
287
287
|
var e;
|
288
|
-
return (e =
|
288
|
+
return (e = rt()) === null || e === void 0 ? void 0 : e[`_${n}`];
|
289
289
|
};
|
290
290
|
/**
|
291
291
|
* @license
|
@@ -303,7 +303,7 @@ const jn = () => Un().__FIREBASE_DEFAULTS__, Bn = () => {
|
|
303
303
|
* See the License for the specific language governing permissions and
|
304
304
|
* limitations under the License.
|
305
305
|
*/
|
306
|
-
class
|
306
|
+
class Wn {
|
307
307
|
constructor() {
|
308
308
|
this.reject = () => {
|
309
309
|
}, this.resolve = () => {
|
@@ -342,19 +342,19 @@ class Vn {
|
|
342
342
|
function P() {
|
343
343
|
return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "";
|
344
344
|
}
|
345
|
-
function
|
345
|
+
function xn() {
|
346
346
|
return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window
|
347
347
|
// just to deal with this case would probably be a bad idea.
|
348
348
|
!!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(P());
|
349
349
|
}
|
350
|
-
function
|
350
|
+
function zn() {
|
351
351
|
const n = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
|
352
352
|
return typeof n == "object" && n.id !== void 0;
|
353
353
|
}
|
354
|
-
function
|
354
|
+
function qn() {
|
355
355
|
return typeof navigator == "object" && navigator.product === "ReactNative";
|
356
356
|
}
|
357
|
-
function
|
357
|
+
function Jn() {
|
358
358
|
const n = P();
|
359
359
|
return n.indexOf("MSIE ") >= 0 || n.indexOf("Trident/") >= 0;
|
360
360
|
}
|
@@ -365,7 +365,7 @@ function Gn() {
|
|
365
365
|
return !1;
|
366
366
|
}
|
367
367
|
}
|
368
|
-
function
|
368
|
+
function Kn() {
|
369
369
|
return new Promise((n, e) => {
|
370
370
|
try {
|
371
371
|
let t = !0;
|
@@ -399,10 +399,10 @@ function Jn() {
|
|
399
399
|
* See the License for the specific language governing permissions and
|
400
400
|
* limitations under the License.
|
401
401
|
*/
|
402
|
-
const
|
402
|
+
const Yn = "FirebaseError";
|
403
403
|
class Y extends Error {
|
404
404
|
constructor(e, t, r) {
|
405
|
-
super(t), this.code = e, this.customData = r, this.name =
|
405
|
+
super(t), this.code = e, this.customData = r, this.name = Yn, Object.setPrototypeOf(this, Y.prototype), Error.captureStackTrace && Error.captureStackTrace(this, _e.prototype.create);
|
406
406
|
}
|
407
407
|
}
|
408
408
|
class _e {
|
@@ -410,18 +410,18 @@ class _e {
|
|
410
410
|
this.service = e, this.serviceName = t, this.errors = r;
|
411
411
|
}
|
412
412
|
create(e, ...t) {
|
413
|
-
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], o = s ?
|
413
|
+
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], o = s ? Qn(s, r) : "Error", c = `${this.serviceName}: ${o} (${i}).`;
|
414
414
|
return new Y(i, c, r);
|
415
415
|
}
|
416
416
|
}
|
417
|
-
function
|
418
|
-
return n.replace(
|
417
|
+
function Qn(n, e) {
|
418
|
+
return n.replace(Xn, (t, r) => {
|
419
419
|
const i = e[r];
|
420
420
|
return i != null ? String(i) : `<${r}?>`;
|
421
421
|
});
|
422
422
|
}
|
423
|
-
const
|
424
|
-
function
|
423
|
+
const Xn = /\{\$([^}]+)}/g;
|
424
|
+
function Zn(n) {
|
425
425
|
for (const e in n)
|
426
426
|
if (Object.prototype.hasOwnProperty.call(n, e))
|
427
427
|
return !1;
|
@@ -435,7 +435,7 @@ function Pe(n, e) {
|
|
435
435
|
if (!r.includes(i))
|
436
436
|
return !1;
|
437
437
|
const s = n[i], o = e[i];
|
438
|
-
if (
|
438
|
+
if (gt(s) && gt(o)) {
|
439
439
|
if (!Pe(s, o))
|
440
440
|
return !1;
|
441
441
|
} else if (s !== o)
|
@@ -446,7 +446,7 @@ function Pe(n, e) {
|
|
446
446
|
return !1;
|
447
447
|
return !0;
|
448
448
|
}
|
449
|
-
function
|
449
|
+
function gt(n) {
|
450
450
|
return n !== null && typeof n == "object";
|
451
451
|
}
|
452
452
|
/**
|
@@ -489,11 +489,11 @@ function ue(n) {
|
|
489
489
|
const t = n.indexOf("#", e);
|
490
490
|
return n.substring(e, t > 0 ? t : void 0);
|
491
491
|
}
|
492
|
-
function
|
493
|
-
const t = new
|
492
|
+
function er(n, e) {
|
493
|
+
const t = new tr(n, e);
|
494
494
|
return t.subscribe.bind(t);
|
495
495
|
}
|
496
|
-
class
|
496
|
+
class tr {
|
497
497
|
/**
|
498
498
|
* @param executor Function which can make calls to a single Observer
|
499
499
|
* as a proxy.
|
@@ -531,7 +531,7 @@ class er {
|
|
531
531
|
let i;
|
532
532
|
if (e === void 0 && t === void 0 && r === void 0)
|
533
533
|
throw new Error("Missing Observer.");
|
534
|
-
|
534
|
+
nr(e, [
|
535
535
|
"next",
|
536
536
|
"error",
|
537
537
|
"complete"
|
@@ -577,7 +577,7 @@ class er {
|
|
577
577
|
}));
|
578
578
|
}
|
579
579
|
}
|
580
|
-
function
|
580
|
+
function nr(n, e) {
|
581
581
|
if (typeof n != "object" || n === null)
|
582
582
|
return !1;
|
583
583
|
for (const t of e)
|
@@ -603,7 +603,7 @@ function He() {
|
|
603
603
|
* See the License for the specific language governing permissions and
|
604
604
|
* limitations under the License.
|
605
605
|
*/
|
606
|
-
function
|
606
|
+
function V(n) {
|
607
607
|
return n && n._delegate ? n._delegate : n;
|
608
608
|
}
|
609
609
|
class ae {
|
@@ -662,7 +662,7 @@ const X = "[DEFAULT]";
|
|
662
662
|
* See the License for the specific language governing permissions and
|
663
663
|
* limitations under the License.
|
664
664
|
*/
|
665
|
-
class
|
665
|
+
class rr {
|
666
666
|
constructor(e, t) {
|
667
667
|
this.name = e, this.container = t, this.component = null, this.instances = /* @__PURE__ */ new Map(), this.instancesDeferred = /* @__PURE__ */ new Map(), this.instancesOptions = /* @__PURE__ */ new Map(), this.onInitCallbacks = /* @__PURE__ */ new Map();
|
668
668
|
}
|
@@ -673,7 +673,7 @@ class nr {
|
|
673
673
|
get(e) {
|
674
674
|
const t = this.normalizeInstanceIdentifier(e);
|
675
675
|
if (!this.instancesDeferred.has(t)) {
|
676
|
-
const r = new
|
676
|
+
const r = new Wn();
|
677
677
|
if (this.instancesDeferred.set(t, r), this.isInitialized(t) || this.shouldAutoInitialize())
|
678
678
|
try {
|
679
679
|
const i = this.getOrInitializeService({
|
@@ -713,7 +713,7 @@ class nr {
|
|
713
713
|
if (this.component)
|
714
714
|
throw Error(`Component for ${this.name} has already been provided`);
|
715
715
|
if (this.component = e, !!this.shouldAutoInitialize()) {
|
716
|
-
if (
|
716
|
+
if (sr(e))
|
717
717
|
try {
|
718
718
|
this.getOrInitializeService({ instanceIdentifier: X });
|
719
719
|
} catch {
|
@@ -800,7 +800,7 @@ class nr {
|
|
800
800
|
getOrInitializeService({ instanceIdentifier: e, options: t = {} }) {
|
801
801
|
let r = this.instances.get(e);
|
802
802
|
if (!r && this.component && (r = this.component.instanceFactory(this.container, {
|
803
|
-
instanceIdentifier:
|
803
|
+
instanceIdentifier: ir(e),
|
804
804
|
options: t
|
805
805
|
}), this.instances.set(e, r), this.instancesOptions.set(e, t), this.invokeOnInitCallbacks(r, e), this.component.onInstanceCreated))
|
806
806
|
try {
|
@@ -816,10 +816,10 @@ class nr {
|
|
816
816
|
return !!this.component && this.component.instantiationMode !== "EXPLICIT";
|
817
817
|
}
|
818
818
|
}
|
819
|
-
function
|
819
|
+
function ir(n) {
|
820
820
|
return n === X ? void 0 : n;
|
821
821
|
}
|
822
|
-
function
|
822
|
+
function sr(n) {
|
823
823
|
return n.instantiationMode === "EAGER";
|
824
824
|
}
|
825
825
|
/**
|
@@ -838,7 +838,7 @@ function ir(n) {
|
|
838
838
|
* See the License for the specific language governing permissions and
|
839
839
|
* limitations under the License.
|
840
840
|
*/
|
841
|
-
class
|
841
|
+
class or {
|
842
842
|
constructor(e) {
|
843
843
|
this.name = e, this.providers = /* @__PURE__ */ new Map();
|
844
844
|
}
|
@@ -870,7 +870,7 @@ class sr {
|
|
870
870
|
getProvider(e) {
|
871
871
|
if (this.providers.has(e))
|
872
872
|
return this.providers.get(e);
|
873
|
-
const t = new
|
873
|
+
const t = new rr(e, this);
|
874
874
|
return this.providers.set(e, t), t;
|
875
875
|
}
|
876
876
|
getProviders() {
|
@@ -897,29 +897,29 @@ var T;
|
|
897
897
|
(function(n) {
|
898
898
|
n[n.DEBUG = 0] = "DEBUG", n[n.VERBOSE = 1] = "VERBOSE", n[n.INFO = 2] = "INFO", n[n.WARN = 3] = "WARN", n[n.ERROR = 4] = "ERROR", n[n.SILENT = 5] = "SILENT";
|
899
899
|
})(T || (T = {}));
|
900
|
-
const
|
900
|
+
const ar = {
|
901
901
|
debug: T.DEBUG,
|
902
902
|
verbose: T.VERBOSE,
|
903
903
|
info: T.INFO,
|
904
904
|
warn: T.WARN,
|
905
905
|
error: T.ERROR,
|
906
906
|
silent: T.SILENT
|
907
|
-
},
|
907
|
+
}, cr = T.INFO, lr = {
|
908
908
|
[T.DEBUG]: "log",
|
909
909
|
[T.VERBOSE]: "log",
|
910
910
|
[T.INFO]: "info",
|
911
911
|
[T.WARN]: "warn",
|
912
912
|
[T.ERROR]: "error"
|
913
|
-
},
|
913
|
+
}, dr = (n, e, ...t) => {
|
914
914
|
if (e < n.logLevel)
|
915
915
|
return;
|
916
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), i =
|
916
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), i = lr[e];
|
917
917
|
if (i)
|
918
918
|
console[i](`[${r}] ${n.name}:`, ...t);
|
919
919
|
else
|
920
920
|
throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);
|
921
921
|
};
|
922
|
-
class
|
922
|
+
class Yt {
|
923
923
|
/**
|
924
924
|
* Gives you an instance of a Logger to capture messages according to
|
925
925
|
* Firebase's logging scheme.
|
@@ -927,7 +927,7 @@ class Kt {
|
|
927
927
|
* @param name The name that the logs will be associated with
|
928
928
|
*/
|
929
929
|
constructor(e) {
|
930
|
-
this.name = e, this._logLevel =
|
930
|
+
this.name = e, this._logLevel = cr, this._logHandler = dr, this._userLogHandler = null;
|
931
931
|
}
|
932
932
|
get logLevel() {
|
933
933
|
return this._logLevel;
|
@@ -939,7 +939,7 @@ class Kt {
|
|
939
939
|
}
|
940
940
|
// Workaround for setter/getter having to be the same type.
|
941
941
|
setLogLevel(e) {
|
942
|
-
this._logLevel = typeof e == "string" ?
|
942
|
+
this._logLevel = typeof e == "string" ? ar[e] : e;
|
943
943
|
}
|
944
944
|
get logHandler() {
|
945
945
|
return this._logHandler;
|
@@ -974,10 +974,10 @@ class Kt {
|
|
974
974
|
this._userLogHandler && this._userLogHandler(this, T.ERROR, ...e), this._logHandler(this, T.ERROR, ...e);
|
975
975
|
}
|
976
976
|
}
|
977
|
-
const
|
978
|
-
let
|
979
|
-
function
|
980
|
-
return
|
977
|
+
const ur = (n, e) => e.some((t) => n instanceof t);
|
978
|
+
let mt, yt;
|
979
|
+
function hr() {
|
980
|
+
return mt || (mt = [
|
981
981
|
IDBDatabase,
|
982
982
|
IDBObjectStore,
|
983
983
|
IDBIndex,
|
@@ -985,32 +985,32 @@ function ur() {
|
|
985
985
|
IDBTransaction
|
986
986
|
]);
|
987
987
|
}
|
988
|
-
function
|
989
|
-
return
|
988
|
+
function fr() {
|
989
|
+
return yt || (yt = [
|
990
990
|
IDBCursor.prototype.advance,
|
991
991
|
IDBCursor.prototype.continue,
|
992
992
|
IDBCursor.prototype.continuePrimaryKey
|
993
993
|
]);
|
994
994
|
}
|
995
|
-
const
|
996
|
-
function
|
995
|
+
const Qt = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap();
|
996
|
+
function pr(n) {
|
997
997
|
const e = new Promise((t, r) => {
|
998
998
|
const i = () => {
|
999
999
|
n.removeEventListener("success", s), n.removeEventListener("error", o);
|
1000
1000
|
}, s = () => {
|
1001
|
-
t(
|
1001
|
+
t(G(n.result)), i();
|
1002
1002
|
}, o = () => {
|
1003
1003
|
r(n.error), i();
|
1004
1004
|
};
|
1005
1005
|
n.addEventListener("success", s), n.addEventListener("error", o);
|
1006
1006
|
});
|
1007
1007
|
return e.then((t) => {
|
1008
|
-
t instanceof IDBCursor &&
|
1008
|
+
t instanceof IDBCursor && Qt.set(t, n);
|
1009
1009
|
}).catch(() => {
|
1010
|
-
}),
|
1010
|
+
}), it.set(e, n), e;
|
1011
1011
|
}
|
1012
|
-
function
|
1013
|
-
if (
|
1012
|
+
function gr(n) {
|
1013
|
+
if (Ke.has(n))
|
1014
1014
|
return;
|
1015
1015
|
const e = new Promise((t, r) => {
|
1016
1016
|
const i = () => {
|
@@ -1022,19 +1022,19 @@ function pr(n) {
|
|
1022
1022
|
};
|
1023
1023
|
n.addEventListener("complete", s), n.addEventListener("error", o), n.addEventListener("abort", o);
|
1024
1024
|
});
|
1025
|
-
|
1025
|
+
Ke.set(n, e);
|
1026
1026
|
}
|
1027
|
-
let
|
1027
|
+
let Ye = {
|
1028
1028
|
get(n, e, t) {
|
1029
1029
|
if (n instanceof IDBTransaction) {
|
1030
1030
|
if (e === "done")
|
1031
|
-
return
|
1031
|
+
return Ke.get(n);
|
1032
1032
|
if (e === "objectStoreNames")
|
1033
|
-
return n.objectStoreNames ||
|
1033
|
+
return n.objectStoreNames || Xt.get(n);
|
1034
1034
|
if (e === "store")
|
1035
1035
|
return t.objectStoreNames[1] ? void 0 : t.objectStore(t.objectStoreNames[0]);
|
1036
1036
|
}
|
1037
|
-
return
|
1037
|
+
return G(n[e]);
|
1038
1038
|
},
|
1039
1039
|
set(n, e, t) {
|
1040
1040
|
return n[e] = t, !0;
|
@@ -1043,35 +1043,35 @@ let Ke = {
|
|
1043
1043
|
return n instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in n;
|
1044
1044
|
}
|
1045
1045
|
};
|
1046
|
-
function gr(n) {
|
1047
|
-
Ke = n(Ke);
|
1048
|
-
}
|
1049
1046
|
function mr(n) {
|
1047
|
+
Ye = n(Ye);
|
1048
|
+
}
|
1049
|
+
function yr(n) {
|
1050
1050
|
return n === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...t) {
|
1051
|
-
const r = n.call(
|
1052
|
-
return
|
1053
|
-
} :
|
1054
|
-
return n.apply(
|
1051
|
+
const r = n.call(xe(this), e, ...t);
|
1052
|
+
return Xt.set(r, e.sort ? e.sort() : [e]), G(r);
|
1053
|
+
} : fr().includes(n) ? function(...e) {
|
1054
|
+
return n.apply(xe(this), e), G(Qt.get(this));
|
1055
1055
|
} : function(...e) {
|
1056
|
-
return
|
1056
|
+
return G(n.apply(xe(this), e));
|
1057
1057
|
};
|
1058
1058
|
}
|
1059
|
-
function
|
1060
|
-
return typeof n == "function" ?
|
1059
|
+
function _r(n) {
|
1060
|
+
return typeof n == "function" ? yr(n) : (n instanceof IDBTransaction && gr(n), ur(n, hr()) ? new Proxy(n, Ye) : n);
|
1061
1061
|
}
|
1062
|
-
function
|
1062
|
+
function G(n) {
|
1063
1063
|
if (n instanceof IDBRequest)
|
1064
|
-
return
|
1065
|
-
if (
|
1066
|
-
return
|
1067
|
-
const e =
|
1068
|
-
return e !== n && (
|
1069
|
-
}
|
1070
|
-
const
|
1071
|
-
function
|
1072
|
-
const o = indexedDB.open(n, e), c =
|
1064
|
+
return pr(n);
|
1065
|
+
if (We.has(n))
|
1066
|
+
return We.get(n);
|
1067
|
+
const e = _r(n);
|
1068
|
+
return e !== n && (We.set(n, e), it.set(e, n)), e;
|
1069
|
+
}
|
1070
|
+
const xe = (n) => it.get(n);
|
1071
|
+
function vr(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
1072
|
+
const o = indexedDB.open(n, e), c = G(o);
|
1073
1073
|
return r && o.addEventListener("upgradeneeded", (a) => {
|
1074
|
-
r(
|
1074
|
+
r(G(o.result), a.oldVersion, a.newVersion, G(o.transaction), a);
|
1075
1075
|
}), t && o.addEventListener("blocked", (a) => t(
|
1076
1076
|
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
1077
1077
|
a.oldVersion,
|
@@ -1082,16 +1082,16 @@ function _r(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
|
1082
1082
|
}).catch(() => {
|
1083
1083
|
}), c;
|
1084
1084
|
}
|
1085
|
-
const
|
1086
|
-
function
|
1085
|
+
const br = ["get", "getKey", "getAll", "getAllKeys", "count"], Ir = ["put", "add", "delete", "clear"], ze = /* @__PURE__ */ new Map();
|
1086
|
+
function _t(n, e) {
|
1087
1087
|
if (!(n instanceof IDBDatabase && !(e in n) && typeof e == "string"))
|
1088
1088
|
return;
|
1089
|
-
if (
|
1090
|
-
return
|
1091
|
-
const t = e.replace(/FromIndex$/, ""), r = e !== t, i =
|
1089
|
+
if (ze.get(e))
|
1090
|
+
return ze.get(e);
|
1091
|
+
const t = e.replace(/FromIndex$/, ""), r = e !== t, i = Ir.includes(t);
|
1092
1092
|
if (
|
1093
1093
|
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
1094
|
-
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i ||
|
1094
|
+
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i || br.includes(t))
|
1095
1095
|
)
|
1096
1096
|
return;
|
1097
1097
|
const s = async function(o, ...c) {
|
@@ -1102,12 +1102,12 @@ function yt(n, e) {
|
|
1102
1102
|
i && a.done
|
1103
1103
|
]))[0];
|
1104
1104
|
};
|
1105
|
-
return
|
1105
|
+
return ze.set(e, s), s;
|
1106
1106
|
}
|
1107
|
-
|
1107
|
+
mr((n) => ({
|
1108
1108
|
...n,
|
1109
|
-
get: (e, t, r) =>
|
1110
|
-
has: (e, t) => !!
|
1109
|
+
get: (e, t, r) => _t(e, t) || n.get(e, t, r),
|
1110
|
+
has: (e, t) => !!_t(e, t) || n.has(e, t)
|
1111
1111
|
}));
|
1112
1112
|
/**
|
1113
1113
|
* @license
|
@@ -1125,7 +1125,7 @@ gr((n) => ({
|
|
1125
1125
|
* See the License for the specific language governing permissions and
|
1126
1126
|
* limitations under the License.
|
1127
1127
|
*/
|
1128
|
-
class
|
1128
|
+
class wr {
|
1129
1129
|
constructor(e) {
|
1130
1130
|
this.container = e;
|
1131
1131
|
}
|
@@ -1133,7 +1133,7 @@ class Ir {
|
|
1133
1133
|
// auth token refresh, and installations will send this string.
|
1134
1134
|
getPlatformInfoString() {
|
1135
1135
|
return this.container.getProviders().map((t) => {
|
1136
|
-
if (
|
1136
|
+
if (Er(t)) {
|
1137
1137
|
const r = t.getImmediate();
|
1138
1138
|
return `${r.library}/${r.version}`;
|
1139
1139
|
} else
|
@@ -1141,11 +1141,11 @@ class Ir {
|
|
1141
1141
|
}).filter((t) => t).join(" ");
|
1142
1142
|
}
|
1143
1143
|
}
|
1144
|
-
function
|
1144
|
+
function Er(n) {
|
1145
1145
|
const e = n.getComponent();
|
1146
1146
|
return (e == null ? void 0 : e.type) === "VERSION";
|
1147
1147
|
}
|
1148
|
-
const
|
1148
|
+
const Qe = "@firebase/app", vt = "0.9.27";
|
1149
1149
|
/**
|
1150
1150
|
* @license
|
1151
1151
|
* Copyright 2019 Google LLC
|
@@ -1162,7 +1162,7 @@ const Ye = "@firebase/app", _t = "0.9.26";
|
|
1162
1162
|
* See the License for the specific language governing permissions and
|
1163
1163
|
* limitations under the License.
|
1164
1164
|
*/
|
1165
|
-
const ee = new
|
1165
|
+
const ee = new Yt("@firebase/app"), Tr = "@firebase/app-compat", Sr = "@firebase/analytics-compat", Ar = "@firebase/analytics", Cr = "@firebase/app-check-compat", Rr = "@firebase/app-check", Pr = "@firebase/auth", Or = "@firebase/auth-compat", kr = "@firebase/database", Nr = "@firebase/database-compat", Dr = "@firebase/functions", Lr = "@firebase/functions-compat", $r = "@firebase/installations", Mr = "@firebase/installations-compat", Ur = "@firebase/messaging", jr = "@firebase/messaging-compat", Br = "@firebase/performance", Fr = "@firebase/performance-compat", Vr = "@firebase/remote-config", Hr = "@firebase/remote-config-compat", Wr = "@firebase/storage", xr = "@firebase/storage-compat", zr = "@firebase/firestore", qr = "@firebase/firestore-compat", Jr = "firebase", Gr = "10.8.0";
|
1166
1166
|
/**
|
1167
1167
|
* @license
|
1168
1168
|
* Copyright 2019 Google LLC
|
@@ -1179,33 +1179,33 @@ const ee = new Kt("@firebase/app"), Er = "@firebase/app-compat", Tr = "@firebase
|
|
1179
1179
|
* See the License for the specific language governing permissions and
|
1180
1180
|
* limitations under the License.
|
1181
1181
|
*/
|
1182
|
-
const
|
1183
|
-
[
|
1184
|
-
[
|
1182
|
+
const Xe = "[DEFAULT]", Kr = {
|
1183
|
+
[Qe]: "fire-core",
|
1184
|
+
[Tr]: "fire-core-compat",
|
1185
1185
|
[Ar]: "fire-analytics",
|
1186
|
-
[
|
1187
|
-
[
|
1188
|
-
[
|
1189
|
-
[
|
1190
|
-
[
|
1191
|
-
[
|
1192
|
-
[
|
1193
|
-
[
|
1194
|
-
[
|
1195
|
-
[
|
1196
|
-
[
|
1197
|
-
[
|
1198
|
-
[
|
1199
|
-
[
|
1200
|
-
[
|
1201
|
-
[
|
1186
|
+
[Sr]: "fire-analytics-compat",
|
1187
|
+
[Rr]: "fire-app-check",
|
1188
|
+
[Cr]: "fire-app-check-compat",
|
1189
|
+
[Pr]: "fire-auth",
|
1190
|
+
[Or]: "fire-auth-compat",
|
1191
|
+
[kr]: "fire-rtdb",
|
1192
|
+
[Nr]: "fire-rtdb-compat",
|
1193
|
+
[Dr]: "fire-fn",
|
1194
|
+
[Lr]: "fire-fn-compat",
|
1195
|
+
[$r]: "fire-iid",
|
1196
|
+
[Mr]: "fire-iid-compat",
|
1197
|
+
[Ur]: "fire-fcm",
|
1198
|
+
[jr]: "fire-fcm-compat",
|
1199
|
+
[Br]: "fire-perf",
|
1200
|
+
[Fr]: "fire-perf-compat",
|
1201
|
+
[Vr]: "fire-rc",
|
1202
1202
|
[Hr]: "fire-rc-compat",
|
1203
|
-
[
|
1204
|
-
[
|
1205
|
-
[
|
1206
|
-
[
|
1203
|
+
[Wr]: "fire-gcs",
|
1204
|
+
[xr]: "fire-gcs-compat",
|
1205
|
+
[zr]: "fire-fst",
|
1206
|
+
[qr]: "fire-fst-compat",
|
1207
1207
|
"fire-js": "fire-js",
|
1208
|
-
[
|
1208
|
+
[Jr]: "fire-js-all"
|
1209
1209
|
};
|
1210
1210
|
/**
|
1211
1211
|
* @license
|
@@ -1223,8 +1223,8 @@ const Qe = "[DEFAULT]", Jr = {
|
|
1223
1223
|
* See the License for the specific language governing permissions and
|
1224
1224
|
* limitations under the License.
|
1225
1225
|
*/
|
1226
|
-
const Oe = /* @__PURE__ */ new Map(),
|
1227
|
-
function
|
1226
|
+
const Oe = /* @__PURE__ */ new Map(), Ze = /* @__PURE__ */ new Map();
|
1227
|
+
function Yr(n, e) {
|
1228
1228
|
try {
|
1229
1229
|
n.container.addComponent(e);
|
1230
1230
|
} catch (t) {
|
@@ -1233,14 +1233,14 @@ function Kr(n, e) {
|
|
1233
1233
|
}
|
1234
1234
|
function fe(n) {
|
1235
1235
|
const e = n.name;
|
1236
|
-
if (
|
1236
|
+
if (Ze.has(e))
|
1237
1237
|
return ee.debug(`There were multiple attempts to register component ${e}.`), !1;
|
1238
|
-
|
1238
|
+
Ze.set(e, n);
|
1239
1239
|
for (const t of Oe.values())
|
1240
|
-
|
1240
|
+
Yr(t, n);
|
1241
1241
|
return !0;
|
1242
1242
|
}
|
1243
|
-
function
|
1243
|
+
function Zt(n, e) {
|
1244
1244
|
const t = n.container.getProvider("heartbeat").getImmediate({ optional: !0 });
|
1245
1245
|
return t && t.triggerHeartbeat(), n.container.getProvider(e);
|
1246
1246
|
}
|
@@ -1260,7 +1260,7 @@ function Xt(n, e) {
|
|
1260
1260
|
* See the License for the specific language governing permissions and
|
1261
1261
|
* limitations under the License.
|
1262
1262
|
*/
|
1263
|
-
const
|
1263
|
+
const Qr = {
|
1264
1264
|
"no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
|
1265
1265
|
"bad-app-name": "Illegal App name: '{$appName}",
|
1266
1266
|
"duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
|
@@ -1272,7 +1272,7 @@ const Yr = {
|
|
1272
1272
|
"idb-get": "Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",
|
1273
1273
|
"idb-set": "Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",
|
1274
1274
|
"idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."
|
1275
|
-
}, K = new _e("app", "Firebase",
|
1275
|
+
}, K = new _e("app", "Firebase", Qr);
|
1276
1276
|
/**
|
1277
1277
|
* @license
|
1278
1278
|
* Copyright 2019 Google LLC
|
@@ -1289,7 +1289,7 @@ const Yr = {
|
|
1289
1289
|
* See the License for the specific language governing permissions and
|
1290
1290
|
* limitations under the License.
|
1291
1291
|
*/
|
1292
|
-
class
|
1292
|
+
class Xr {
|
1293
1293
|
constructor(e, t, r) {
|
1294
1294
|
this._isDeleted = !1, this._options = Object.assign({}, e), this._config = Object.assign({}, t), this._name = t.name, this._automaticDataCollectionEnabled = t.automaticDataCollectionEnabled, this._container = r, this.container.addComponent(new ae(
|
1295
1295
|
"app",
|
@@ -1348,10 +1348,10 @@ class Qr {
|
|
1348
1348
|
* limitations under the License.
|
1349
1349
|
*/
|
1350
1350
|
const be = Gr;
|
1351
|
-
function
|
1351
|
+
function en(n, e = {}) {
|
1352
1352
|
let t = n;
|
1353
1353
|
typeof e != "object" && (e = { name: e });
|
1354
|
-
const r = Object.assign({ name:
|
1354
|
+
const r = Object.assign({ name: Xe, automaticDataCollectionEnabled: !1 }, e), i = r.name;
|
1355
1355
|
if (typeof i != "string" || !i)
|
1356
1356
|
throw K.create("bad-app-name", {
|
1357
1357
|
appName: String(i)
|
@@ -1367,23 +1367,23 @@ function Zt(n, e = {}) {
|
|
1367
1367
|
return s;
|
1368
1368
|
throw K.create("duplicate-app", { appName: i });
|
1369
1369
|
}
|
1370
|
-
const o = new
|
1371
|
-
for (const a of
|
1370
|
+
const o = new or(i);
|
1371
|
+
for (const a of Ze.values())
|
1372
1372
|
o.addComponent(a);
|
1373
|
-
const c = new
|
1373
|
+
const c = new Xr(t, r, o);
|
1374
1374
|
return Oe.set(i, c), c;
|
1375
1375
|
}
|
1376
|
-
function
|
1376
|
+
function Zr(n = Xe) {
|
1377
1377
|
const e = Oe.get(n);
|
1378
|
-
if (!e && n ===
|
1379
|
-
return
|
1378
|
+
if (!e && n === Xe && Gt())
|
1379
|
+
return en();
|
1380
1380
|
if (!e)
|
1381
1381
|
throw K.create("no-app", { appName: n });
|
1382
1382
|
return e;
|
1383
1383
|
}
|
1384
1384
|
function ie(n, e, t) {
|
1385
1385
|
var r;
|
1386
|
-
let i = (r =
|
1386
|
+
let i = (r = Kr[n]) !== null && r !== void 0 ? r : n;
|
1387
1387
|
t && (i += `-${t}`);
|
1388
1388
|
const s = i.match(/\s|\//), o = e.match(/\s|\//);
|
1389
1389
|
if (s || o) {
|
@@ -1416,10 +1416,10 @@ function ie(n, e, t) {
|
|
1416
1416
|
* See the License for the specific language governing permissions and
|
1417
1417
|
* limitations under the License.
|
1418
1418
|
*/
|
1419
|
-
const
|
1420
|
-
let
|
1421
|
-
function
|
1422
|
-
return
|
1419
|
+
const ei = "firebase-heartbeat-database", ti = 1, pe = "firebase-heartbeat-store";
|
1420
|
+
let qe = null;
|
1421
|
+
function tn() {
|
1422
|
+
return qe || (qe = vr(ei, ti, {
|
1423
1423
|
upgrade: (n, e) => {
|
1424
1424
|
switch (e) {
|
1425
1425
|
case 0:
|
@@ -1434,11 +1434,12 @@ function en() {
|
|
1434
1434
|
throw K.create("idb-open", {
|
1435
1435
|
originalErrorMessage: n.message
|
1436
1436
|
});
|
1437
|
-
})),
|
1437
|
+
})), qe;
|
1438
1438
|
}
|
1439
|
-
async function
|
1439
|
+
async function ni(n) {
|
1440
1440
|
try {
|
1441
|
-
|
1441
|
+
const t = (await tn()).transaction(pe), r = await t.objectStore(pe).get(nn(n));
|
1442
|
+
return await t.done, r;
|
1442
1443
|
} catch (e) {
|
1443
1444
|
if (e instanceof Y)
|
1444
1445
|
ee.warn(e.message);
|
@@ -1450,10 +1451,10 @@ async function ti(n) {
|
|
1450
1451
|
}
|
1451
1452
|
}
|
1452
1453
|
}
|
1453
|
-
async function
|
1454
|
+
async function bt(n, e) {
|
1454
1455
|
try {
|
1455
|
-
const r = (await
|
1456
|
-
await r.objectStore(pe).put(e,
|
1456
|
+
const r = (await tn()).transaction(pe, "readwrite");
|
1457
|
+
await r.objectStore(pe).put(e, nn(n)), await r.done;
|
1457
1458
|
} catch (t) {
|
1458
1459
|
if (t instanceof Y)
|
1459
1460
|
ee.warn(t.message);
|
@@ -1465,7 +1466,7 @@ async function vt(n, e) {
|
|
1465
1466
|
}
|
1466
1467
|
}
|
1467
1468
|
}
|
1468
|
-
function
|
1469
|
+
function nn(n) {
|
1469
1470
|
return `${n.name}!${n.options.appId}`;
|
1470
1471
|
}
|
1471
1472
|
/**
|
@@ -1484,12 +1485,12 @@ function tn(n) {
|
|
1484
1485
|
* See the License for the specific language governing permissions and
|
1485
1486
|
* limitations under the License.
|
1486
1487
|
*/
|
1487
|
-
const
|
1488
|
-
class
|
1488
|
+
const ri = 1024, ii = 30 * 24 * 60 * 60 * 1e3;
|
1489
|
+
class si {
|
1489
1490
|
constructor(e) {
|
1490
1491
|
this.container = e, this._heartbeatsCache = null;
|
1491
1492
|
const t = this.container.getProvider("app").getImmediate();
|
1492
|
-
this._storage = new
|
1493
|
+
this._storage = new ai(t), this._heartbeatsCachePromise = this._storage.read().then((r) => (this._heartbeatsCache = r, r));
|
1493
1494
|
}
|
1494
1495
|
/**
|
1495
1496
|
* Called to report a heartbeat. The function will generate
|
@@ -1500,11 +1501,11 @@ class ii {
|
|
1500
1501
|
*/
|
1501
1502
|
async triggerHeartbeat() {
|
1502
1503
|
var e, t;
|
1503
|
-
const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), s =
|
1504
|
+
const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), s = It();
|
1504
1505
|
if (!(((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null && (this._heartbeatsCache = await this._heartbeatsCachePromise, ((t = this._heartbeatsCache) === null || t === void 0 ? void 0 : t.heartbeats) == null)) && !(this._heartbeatsCache.lastSentHeartbeatDate === s || this._heartbeatsCache.heartbeats.some((o) => o.date === s)))
|
1505
1506
|
return this._heartbeatsCache.heartbeats.push({ date: s, agent: i }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((o) => {
|
1506
1507
|
const c = new Date(o.date).valueOf();
|
1507
|
-
return Date.now() - c <=
|
1508
|
+
return Date.now() - c <= ii;
|
1508
1509
|
}), this._storage.overwrite(this._heartbeatsCache);
|
1509
1510
|
}
|
1510
1511
|
/**
|
@@ -1518,27 +1519,27 @@ class ii {
|
|
1518
1519
|
var e;
|
1519
1520
|
if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null || this._heartbeatsCache.heartbeats.length === 0)
|
1520
1521
|
return "";
|
1521
|
-
const t =
|
1522
|
+
const t = It(), { heartbeatsToSend: r, unsentEntries: i } = oi(this._heartbeatsCache.heartbeats), s = qt(JSON.stringify({ version: 2, heartbeats: r }));
|
1522
1523
|
return this._heartbeatsCache.lastSentHeartbeatDate = t, i.length > 0 ? (this._heartbeatsCache.heartbeats = i, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), s;
|
1523
1524
|
}
|
1524
1525
|
}
|
1525
|
-
function
|
1526
|
+
function It() {
|
1526
1527
|
return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
1527
1528
|
}
|
1528
|
-
function
|
1529
|
+
function oi(n, e = ri) {
|
1529
1530
|
const t = [];
|
1530
1531
|
let r = n.slice();
|
1531
1532
|
for (const i of n) {
|
1532
1533
|
const s = t.find((o) => o.agent === i.agent);
|
1533
1534
|
if (s) {
|
1534
|
-
if (s.dates.push(i.date),
|
1535
|
+
if (s.dates.push(i.date), wt(t) > e) {
|
1535
1536
|
s.dates.pop();
|
1536
1537
|
break;
|
1537
1538
|
}
|
1538
1539
|
} else if (t.push({
|
1539
1540
|
agent: i.agent,
|
1540
1541
|
dates: [i.date]
|
1541
|
-
}),
|
1542
|
+
}), wt(t) > e) {
|
1542
1543
|
t.pop();
|
1543
1544
|
break;
|
1544
1545
|
}
|
@@ -1549,19 +1550,19 @@ function si(n, e = ni) {
|
|
1549
1550
|
unsentEntries: r
|
1550
1551
|
};
|
1551
1552
|
}
|
1552
|
-
class
|
1553
|
+
class ai {
|
1553
1554
|
constructor(e) {
|
1554
1555
|
this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
|
1555
1556
|
}
|
1556
1557
|
async runIndexedDBEnvironmentCheck() {
|
1557
|
-
return Gn() ?
|
1558
|
+
return Gn() ? Kn().then(() => !0).catch(() => !1) : !1;
|
1558
1559
|
}
|
1559
1560
|
/**
|
1560
1561
|
* Read all heartbeats.
|
1561
1562
|
*/
|
1562
1563
|
async read() {
|
1563
1564
|
if (await this._canUseIndexedDBPromise) {
|
1564
|
-
const t = await
|
1565
|
+
const t = await ni(this.app);
|
1565
1566
|
return t != null && t.heartbeats ? t : { heartbeats: [] };
|
1566
1567
|
} else
|
1567
1568
|
return { heartbeats: [] };
|
@@ -1571,7 +1572,7 @@ class oi {
|
|
1571
1572
|
var t;
|
1572
1573
|
if (await this._canUseIndexedDBPromise) {
|
1573
1574
|
const i = await this.read();
|
1574
|
-
return
|
1575
|
+
return bt(this.app, {
|
1575
1576
|
lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
|
1576
1577
|
heartbeats: e.heartbeats
|
1577
1578
|
});
|
@@ -1583,7 +1584,7 @@ class oi {
|
|
1583
1584
|
var t;
|
1584
1585
|
if (await this._canUseIndexedDBPromise) {
|
1585
1586
|
const i = await this.read();
|
1586
|
-
return
|
1587
|
+
return bt(this.app, {
|
1587
1588
|
lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
|
1588
1589
|
heartbeats: [
|
1589
1590
|
...i.heartbeats,
|
@@ -1594,8 +1595,8 @@ class oi {
|
|
1594
1595
|
return;
|
1595
1596
|
}
|
1596
1597
|
}
|
1597
|
-
function
|
1598
|
-
return
|
1598
|
+
function wt(n) {
|
1599
|
+
return qt(
|
1599
1600
|
// heartbeatsCache wrapper properties
|
1600
1601
|
JSON.stringify({ version: 2, heartbeats: n })
|
1601
1602
|
).length;
|
@@ -1616,21 +1617,21 @@ function It(n) {
|
|
1616
1617
|
* See the License for the specific language governing permissions and
|
1617
1618
|
* limitations under the License.
|
1618
1619
|
*/
|
1619
|
-
function
|
1620
|
+
function ci(n) {
|
1620
1621
|
fe(new ae(
|
1621
1622
|
"platform-logger",
|
1622
|
-
(e) => new
|
1623
|
+
(e) => new wr(e),
|
1623
1624
|
"PRIVATE"
|
1624
1625
|
/* ComponentType.PRIVATE */
|
1625
1626
|
)), fe(new ae(
|
1626
1627
|
"heartbeat",
|
1627
|
-
(e) => new
|
1628
|
+
(e) => new si(e),
|
1628
1629
|
"PRIVATE"
|
1629
1630
|
/* ComponentType.PRIVATE */
|
1630
|
-
)), ie(
|
1631
|
+
)), ie(Qe, vt, n), ie(Qe, vt, "esm2017"), ie("fire-js", "");
|
1631
1632
|
}
|
1632
|
-
|
1633
|
-
var
|
1633
|
+
ci("");
|
1634
|
+
var li = "firebase", di = "10.8.0";
|
1634
1635
|
/**
|
1635
1636
|
* @license
|
1636
1637
|
* Copyright 2020 Google LLC
|
@@ -1647,8 +1648,8 @@ var ci = "firebase", li = "10.7.2";
|
|
1647
1648
|
* See the License for the specific language governing permissions and
|
1648
1649
|
* limitations under the License.
|
1649
1650
|
*/
|
1650
|
-
ie(
|
1651
|
-
function
|
1651
|
+
ie(li, di, "app");
|
1652
|
+
function st(n, e) {
|
1652
1653
|
var t = {};
|
1653
1654
|
for (var r in n)
|
1654
1655
|
Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
@@ -1657,12 +1658,12 @@ function it(n, e) {
|
|
1657
1658
|
e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[i]) && (t[r[i]] = n[r[i]]);
|
1658
1659
|
return t;
|
1659
1660
|
}
|
1660
|
-
function
|
1661
|
+
function rn() {
|
1661
1662
|
return {
|
1662
1663
|
"dependent-sdk-initialized-before-auth": "Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."
|
1663
1664
|
};
|
1664
1665
|
}
|
1665
|
-
const
|
1666
|
+
const ui = rn, sn = new _e("auth", "Firebase", rn());
|
1666
1667
|
/**
|
1667
1668
|
* @license
|
1668
1669
|
* Copyright 2020 Google LLC
|
@@ -1679,11 +1680,11 @@ const di = nn, rn = new _e("auth", "Firebase", nn());
|
|
1679
1680
|
* See the License for the specific language governing permissions and
|
1680
1681
|
* limitations under the License.
|
1681
1682
|
*/
|
1682
|
-
const ke = new
|
1683
|
-
function
|
1683
|
+
const ke = new Yt("@firebase/auth");
|
1684
|
+
function hi(n, ...e) {
|
1684
1685
|
ke.logLevel <= T.WARN && ke.warn(`Auth (${be}): ${n}`, ...e);
|
1685
1686
|
}
|
1686
|
-
function
|
1687
|
+
function Se(n, ...e) {
|
1687
1688
|
ke.logLevel <= T.ERROR && ke.error(`Auth (${be}): ${n}`, ...e);
|
1688
1689
|
}
|
1689
1690
|
/**
|
@@ -1703,31 +1704,31 @@ function Ae(n, ...e) {
|
|
1703
1704
|
* limitations under the License.
|
1704
1705
|
*/
|
1705
1706
|
function L(n, ...e) {
|
1706
|
-
throw
|
1707
|
+
throw ot(n, ...e);
|
1707
1708
|
}
|
1708
1709
|
function $(n, ...e) {
|
1709
|
-
return
|
1710
|
+
return ot(n, ...e);
|
1710
1711
|
}
|
1711
|
-
function
|
1712
|
-
const r = Object.assign(Object.assign({},
|
1712
|
+
function fi(n, e, t) {
|
1713
|
+
const r = Object.assign(Object.assign({}, ui()), { [e]: t });
|
1713
1714
|
return new _e("auth", "Firebase", r).create(e, {
|
1714
1715
|
appName: n.name
|
1715
1716
|
});
|
1716
1717
|
}
|
1717
|
-
function
|
1718
|
+
function ot(n, ...e) {
|
1718
1719
|
if (typeof n != "string") {
|
1719
1720
|
const t = e[0], r = [...e.slice(1)];
|
1720
1721
|
return r[0] && (r[0].appName = n.name), n._errorFactory.create(t, ...r);
|
1721
1722
|
}
|
1722
|
-
return
|
1723
|
+
return sn.create(n, ...e);
|
1723
1724
|
}
|
1724
1725
|
function _(n, e, ...t) {
|
1725
1726
|
if (!n)
|
1726
|
-
throw
|
1727
|
+
throw ot(e, ...t);
|
1727
1728
|
}
|
1728
1729
|
function j(n) {
|
1729
1730
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
1730
|
-
throw
|
1731
|
+
throw Se(e), new Error(e);
|
1731
1732
|
}
|
1732
1733
|
function F(n, e) {
|
1733
1734
|
n || j(e);
|
@@ -1748,14 +1749,14 @@ function F(n, e) {
|
|
1748
1749
|
* See the License for the specific language governing permissions and
|
1749
1750
|
* limitations under the License.
|
1750
1751
|
*/
|
1751
|
-
function
|
1752
|
+
function et() {
|
1752
1753
|
var n;
|
1753
1754
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
1754
1755
|
}
|
1755
|
-
function
|
1756
|
-
return
|
1756
|
+
function pi() {
|
1757
|
+
return Et() === "http:" || Et() === "https:";
|
1757
1758
|
}
|
1758
|
-
function
|
1759
|
+
function Et() {
|
1759
1760
|
var n;
|
1760
1761
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.protocol) || null;
|
1761
1762
|
}
|
@@ -1775,15 +1776,15 @@ function wt() {
|
|
1775
1776
|
* See the License for the specific language governing permissions and
|
1776
1777
|
* limitations under the License.
|
1777
1778
|
*/
|
1778
|
-
function
|
1779
|
+
function gi() {
|
1779
1780
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
1780
1781
|
// This is especially true for Cordova apps which have unreliable
|
1781
1782
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
1782
1783
|
// installed which overwrites the native navigator.onLine value and
|
1783
1784
|
// defines navigator.connection.
|
1784
|
-
(
|
1785
|
+
(pi() || zn() || "connection" in navigator) ? navigator.onLine : !0;
|
1785
1786
|
}
|
1786
|
-
function
|
1787
|
+
function mi() {
|
1787
1788
|
if (typeof navigator > "u")
|
1788
1789
|
return null;
|
1789
1790
|
const n = navigator;
|
@@ -1813,10 +1814,10 @@ function gi() {
|
|
1813
1814
|
*/
|
1814
1815
|
class Ie {
|
1815
1816
|
constructor(e, t) {
|
1816
|
-
this.shortDelay = e, this.longDelay = t, F(t > e, "Short delay should be less than long delay!"), this.isMobile =
|
1817
|
+
this.shortDelay = e, this.longDelay = t, F(t > e, "Short delay should be less than long delay!"), this.isMobile = xn() || qn();
|
1817
1818
|
}
|
1818
1819
|
get() {
|
1819
|
-
return
|
1820
|
+
return gi() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
1820
1821
|
}
|
1821
1822
|
}
|
1822
1823
|
/**
|
@@ -1835,7 +1836,7 @@ class Ie {
|
|
1835
1836
|
* See the License for the specific language governing permissions and
|
1836
1837
|
* limitations under the License.
|
1837
1838
|
*/
|
1838
|
-
function
|
1839
|
+
function at(n, e) {
|
1839
1840
|
F(n.emulator, "Emulator should always be set here");
|
1840
1841
|
const { url: t } = n.emulator;
|
1841
1842
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
@@ -1856,7 +1857,7 @@ function ot(n, e) {
|
|
1856
1857
|
* See the License for the specific language governing permissions and
|
1857
1858
|
* limitations under the License.
|
1858
1859
|
*/
|
1859
|
-
class
|
1860
|
+
class on {
|
1860
1861
|
static initialize(e, t, r) {
|
1861
1862
|
this.fetchImpl = e, t && (this.headersImpl = t), r && (this.responseImpl = r);
|
1862
1863
|
}
|
@@ -1910,7 +1911,7 @@ class sn {
|
|
1910
1911
|
* See the License for the specific language governing permissions and
|
1911
1912
|
* limitations under the License.
|
1912
1913
|
*/
|
1913
|
-
const
|
1914
|
+
const yi = {
|
1914
1915
|
// Custom token errors.
|
1915
1916
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
1916
1917
|
// This can only happen if the SDK sends a bad request.
|
@@ -2001,12 +2002,12 @@ const mi = {
|
|
2001
2002
|
* See the License for the specific language governing permissions and
|
2002
2003
|
* limitations under the License.
|
2003
2004
|
*/
|
2004
|
-
const
|
2005
|
+
const _i = new Ie(3e4, 6e4);
|
2005
2006
|
function Q(n, e) {
|
2006
2007
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
2007
2008
|
}
|
2008
|
-
async function
|
2009
|
-
return
|
2009
|
+
async function H(n, e, t, r, i = {}) {
|
2010
|
+
return an(n, i, async () => {
|
2010
2011
|
let s = {}, o = {};
|
2011
2012
|
r && (e === "GET" ? o = r : s = {
|
2012
2013
|
body: JSON.stringify(r)
|
@@ -2018,18 +2019,18 @@ async function V(n, e, t, r, i = {}) {
|
|
2018
2019
|
] = "application/json", n.languageCode && (a[
|
2019
2020
|
"X-Firebase-Locale"
|
2020
2021
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
2021
|
-
] = n.languageCode),
|
2022
|
+
] = n.languageCode), on.fetch()(cn(n, n.config.apiHost, t, c), Object.assign({
|
2022
2023
|
method: e,
|
2023
2024
|
headers: a,
|
2024
2025
|
referrerPolicy: "no-referrer"
|
2025
2026
|
}, s));
|
2026
2027
|
});
|
2027
2028
|
}
|
2028
|
-
async function
|
2029
|
+
async function an(n, e, t) {
|
2029
2030
|
n._canInitEmulator = !1;
|
2030
|
-
const r = Object.assign(Object.assign({},
|
2031
|
+
const r = Object.assign(Object.assign({}, yi), e);
|
2031
2032
|
try {
|
2032
|
-
const i = new
|
2033
|
+
const i = new bi(n), s = await Promise.race([
|
2033
2034
|
t(),
|
2034
2035
|
i.promise
|
2035
2036
|
]);
|
@@ -2049,7 +2050,7 @@ async function on(n, e, t) {
|
|
2049
2050
|
throw Te(n, "user-disabled", o);
|
2050
2051
|
const y = r[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
2051
2052
|
if (u)
|
2052
|
-
throw
|
2053
|
+
throw fi(n, y, u);
|
2053
2054
|
L(n, y);
|
2054
2055
|
}
|
2055
2056
|
} catch (i) {
|
@@ -2059,16 +2060,16 @@ async function on(n, e, t) {
|
|
2059
2060
|
}
|
2060
2061
|
}
|
2061
2062
|
async function Ue(n, e, t, r, i = {}) {
|
2062
|
-
const s = await
|
2063
|
+
const s = await H(n, e, t, r, i);
|
2063
2064
|
return "mfaPendingCredential" in s && L(n, "multi-factor-auth-required", {
|
2064
2065
|
_serverResponse: s
|
2065
2066
|
}), s;
|
2066
2067
|
}
|
2067
|
-
function
|
2068
|
+
function cn(n, e, t, r) {
|
2068
2069
|
const i = `${e}${t}?${r}`;
|
2069
|
-
return n.config.emulator ?
|
2070
|
+
return n.config.emulator ? at(n.config, i) : `${n.config.apiScheme}://${i}`;
|
2070
2071
|
}
|
2071
|
-
function
|
2072
|
+
function vi(n) {
|
2072
2073
|
switch (n) {
|
2073
2074
|
case "ENFORCE":
|
2074
2075
|
return "ENFORCE";
|
@@ -2080,14 +2081,14 @@ function _i(n) {
|
|
2080
2081
|
return "ENFORCEMENT_STATE_UNSPECIFIED";
|
2081
2082
|
}
|
2082
2083
|
}
|
2083
|
-
class
|
2084
|
+
class bi {
|
2084
2085
|
constructor(e) {
|
2085
2086
|
this.auth = e, this.timer = null, this.promise = new Promise((t, r) => {
|
2086
2087
|
this.timer = setTimeout(() => r($(
|
2087
2088
|
this.auth,
|
2088
2089
|
"network-request-failed"
|
2089
2090
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
2090
|
-
)),
|
2091
|
+
)), _i.get());
|
2091
2092
|
});
|
2092
2093
|
}
|
2093
2094
|
clearNetworkTimeout() {
|
@@ -2102,10 +2103,10 @@ function Te(n, e, t) {
|
|
2102
2103
|
const i = $(n, e, r);
|
2103
2104
|
return i.customData._tokenResponse = t, i;
|
2104
2105
|
}
|
2105
|
-
function
|
2106
|
+
function Tt(n) {
|
2106
2107
|
return n !== void 0 && n.enterprise !== void 0;
|
2107
2108
|
}
|
2108
|
-
class
|
2109
|
+
class Ii {
|
2109
2110
|
constructor(e) {
|
2110
2111
|
if (this.siteKey = "", this.recaptchaEnforcementState = [], e.recaptchaKey === void 0)
|
2111
2112
|
throw new Error("recaptchaKey undefined");
|
@@ -2122,7 +2123,7 @@ class bi {
|
|
2122
2123
|
return null;
|
2123
2124
|
for (const t of this.recaptchaEnforcementState)
|
2124
2125
|
if (t.provider && t.provider === e)
|
2125
|
-
return
|
2126
|
+
return vi(t.enforcementState);
|
2126
2127
|
return null;
|
2127
2128
|
}
|
2128
2129
|
/**
|
@@ -2135,8 +2136,8 @@ class bi {
|
|
2135
2136
|
return this.getProviderEnforcementState(e) === "ENFORCE" || this.getProviderEnforcementState(e) === "AUDIT";
|
2136
2137
|
}
|
2137
2138
|
}
|
2138
|
-
async function
|
2139
|
-
return
|
2139
|
+
async function wi(n, e) {
|
2140
|
+
return H(n, "GET", "/v2/recaptchaConfig", Q(n, e));
|
2140
2141
|
}
|
2141
2142
|
/**
|
2142
2143
|
* @license
|
@@ -2154,11 +2155,11 @@ async function Ii(n, e) {
|
|
2154
2155
|
* See the License for the specific language governing permissions and
|
2155
2156
|
* limitations under the License.
|
2156
2157
|
*/
|
2157
|
-
async function wi(n, e) {
|
2158
|
-
return V(n, "POST", "/v1/accounts:delete", e);
|
2159
|
-
}
|
2160
2158
|
async function Ei(n, e) {
|
2161
|
-
return
|
2159
|
+
return H(n, "POST", "/v1/accounts:delete", e);
|
2160
|
+
}
|
2161
|
+
async function Ti(n, e) {
|
2162
|
+
return H(n, "POST", "/v1/accounts:lookup", e);
|
2162
2163
|
}
|
2163
2164
|
/**
|
2164
2165
|
* @license
|
@@ -2185,8 +2186,8 @@ function he(n) {
|
|
2185
2186
|
} catch {
|
2186
2187
|
}
|
2187
2188
|
}
|
2188
|
-
async function
|
2189
|
-
const t =
|
2189
|
+
async function Si(n, e = !1) {
|
2190
|
+
const t = V(n), r = await t.getIdToken(e), i = ct(r);
|
2190
2191
|
_(
|
2191
2192
|
i && i.exp && i.auth_time && i.iat,
|
2192
2193
|
t.auth,
|
@@ -2197,29 +2198,29 @@ async function Ti(n, e = !1) {
|
|
2197
2198
|
return {
|
2198
2199
|
claims: i,
|
2199
2200
|
token: r,
|
2200
|
-
authTime: he(
|
2201
|
-
issuedAtTime: he(
|
2202
|
-
expirationTime: he(
|
2201
|
+
authTime: he(Je(i.auth_time)),
|
2202
|
+
issuedAtTime: he(Je(i.iat)),
|
2203
|
+
expirationTime: he(Je(i.exp)),
|
2203
2204
|
signInProvider: o || null,
|
2204
2205
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
2205
2206
|
};
|
2206
2207
|
}
|
2207
|
-
function
|
2208
|
+
function Je(n) {
|
2208
2209
|
return Number(n) * 1e3;
|
2209
2210
|
}
|
2210
|
-
function
|
2211
|
+
function ct(n) {
|
2211
2212
|
const [e, t, r] = n.split(".");
|
2212
2213
|
if (e === void 0 || t === void 0 || r === void 0)
|
2213
|
-
return
|
2214
|
+
return Se("JWT malformed, contained fewer than 3 sections"), null;
|
2214
2215
|
try {
|
2215
|
-
const i =
|
2216
|
-
return i ? JSON.parse(i) : (
|
2216
|
+
const i = Jt(t);
|
2217
|
+
return i ? JSON.parse(i) : (Se("Failed to decode base64 JWT payload"), null);
|
2217
2218
|
} catch (i) {
|
2218
|
-
return
|
2219
|
+
return Se("Caught error parsing JWT payload as JSON", i == null ? void 0 : i.toString()), null;
|
2219
2220
|
}
|
2220
2221
|
}
|
2221
2222
|
function Ai(n) {
|
2222
|
-
const e =
|
2223
|
+
const e = ct(n);
|
2223
2224
|
return _(
|
2224
2225
|
e,
|
2225
2226
|
"internal-error"
|
@@ -2256,10 +2257,10 @@ async function ge(n, e, t = !1) {
|
|
2256
2257
|
try {
|
2257
2258
|
return await e;
|
2258
2259
|
} catch (r) {
|
2259
|
-
throw r instanceof Y &&
|
2260
|
+
throw r instanceof Y && Ci(r) && n.auth.currentUser === n && await n.auth.signOut(), r;
|
2260
2261
|
}
|
2261
2262
|
}
|
2262
|
-
function
|
2263
|
+
function Ci({ code: n }) {
|
2263
2264
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
2264
2265
|
}
|
2265
2266
|
/**
|
@@ -2278,7 +2279,7 @@ function Si({ code: n }) {
|
|
2278
2279
|
* See the License for the specific language governing permissions and
|
2279
2280
|
* limitations under the License.
|
2280
2281
|
*/
|
2281
|
-
class
|
2282
|
+
class Ri {
|
2282
2283
|
constructor(e) {
|
2283
2284
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
2284
2285
|
}
|
@@ -2340,7 +2341,7 @@ class Ci {
|
|
2340
2341
|
* See the License for the specific language governing permissions and
|
2341
2342
|
* limitations under the License.
|
2342
2343
|
*/
|
2343
|
-
class
|
2344
|
+
class ln {
|
2344
2345
|
constructor(e, t) {
|
2345
2346
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
2346
2347
|
}
|
@@ -2375,7 +2376,7 @@ class cn {
|
|
2375
2376
|
*/
|
2376
2377
|
async function Ne(n) {
|
2377
2378
|
var e;
|
2378
|
-
const t = n.auth, r = await n.getIdToken(), i = await ge(n,
|
2379
|
+
const t = n.auth, r = await n.getIdToken(), i = await ge(n, Ti(t, { idToken: r }));
|
2379
2380
|
_(
|
2380
2381
|
i == null ? void 0 : i.users.length,
|
2381
2382
|
t,
|
@@ -2384,7 +2385,7 @@ async function Ne(n) {
|
|
2384
2385
|
);
|
2385
2386
|
const s = i.users[0];
|
2386
2387
|
n._notifyReloadListener(s);
|
2387
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
2388
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? ki(s.providerUserInfo) : [], c = Oi(n.providerData, o), a = n.isAnonymous, u = !(n.email && s.passwordHash) && !(c != null && c.length), y = a ? u : !1, b = {
|
2388
2389
|
uid: s.localId,
|
2389
2390
|
displayName: s.displayName || null,
|
2390
2391
|
photoURL: s.photoUrl || null,
|
@@ -2393,21 +2394,21 @@ async function Ne(n) {
|
|
2393
2394
|
phoneNumber: s.phoneNumber || null,
|
2394
2395
|
tenantId: s.tenantId || null,
|
2395
2396
|
providerData: c,
|
2396
|
-
metadata: new
|
2397
|
+
metadata: new ln(s.createdAt, s.lastLoginAt),
|
2397
2398
|
isAnonymous: y
|
2398
2399
|
};
|
2399
2400
|
Object.assign(n, b);
|
2400
2401
|
}
|
2401
|
-
async function
|
2402
|
-
const e =
|
2402
|
+
async function Pi(n) {
|
2403
|
+
const e = V(n);
|
2403
2404
|
await Ne(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
2404
2405
|
}
|
2405
|
-
function
|
2406
|
+
function Oi(n, e) {
|
2406
2407
|
return [...n.filter((r) => !e.some((i) => i.providerId === r.providerId)), ...e];
|
2407
2408
|
}
|
2408
|
-
function
|
2409
|
+
function ki(n) {
|
2409
2410
|
return n.map((e) => {
|
2410
|
-
var { providerId: t } = e, r =
|
2411
|
+
var { providerId: t } = e, r = st(e, ["providerId"]);
|
2411
2412
|
return {
|
2412
2413
|
providerId: t,
|
2413
2414
|
uid: r.rawId || "",
|
@@ -2434,16 +2435,16 @@ function Oi(n) {
|
|
2434
2435
|
* See the License for the specific language governing permissions and
|
2435
2436
|
* limitations under the License.
|
2436
2437
|
*/
|
2437
|
-
async function
|
2438
|
-
const t = await
|
2438
|
+
async function Ni(n, e) {
|
2439
|
+
const t = await an(n, {}, async () => {
|
2439
2440
|
const r = ve({
|
2440
2441
|
grant_type: "refresh_token",
|
2441
2442
|
refresh_token: e
|
2442
|
-
}).slice(1), { tokenApiHost: i, apiKey: s } = n.config, o =
|
2443
|
+
}).slice(1), { tokenApiHost: i, apiKey: s } = n.config, o = cn(n, i, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
2443
2444
|
return c[
|
2444
2445
|
"Content-Type"
|
2445
2446
|
/* HttpHeader.CONTENT_TYPE */
|
2446
|
-
] = "application/x-www-form-urlencoded",
|
2447
|
+
] = "application/x-www-form-urlencoded", on.fetch()(o, {
|
2447
2448
|
method: "POST",
|
2448
2449
|
headers: c,
|
2449
2450
|
body: r
|
@@ -2455,8 +2456,8 @@ async function ki(n, e) {
|
|
2455
2456
|
refreshToken: t.refresh_token
|
2456
2457
|
};
|
2457
2458
|
}
|
2458
|
-
async function
|
2459
|
-
return
|
2459
|
+
async function Di(n, e) {
|
2460
|
+
return H(n, "POST", "/v2/accounts:revokeToken", Q(n, e));
|
2460
2461
|
}
|
2461
2462
|
/**
|
2462
2463
|
* @license
|
@@ -2510,7 +2511,7 @@ class me {
|
|
2510
2511
|
this.refreshToken = null;
|
2511
2512
|
}
|
2512
2513
|
async refresh(e, t) {
|
2513
|
-
const { accessToken: r, refreshToken: i, expiresIn: s } = await
|
2514
|
+
const { accessToken: r, refreshToken: i, expiresIn: s } = await Ni(e, t);
|
2514
2515
|
this.updateTokensAndExpiration(r, i, Number(s));
|
2515
2516
|
}
|
2516
2517
|
updateTokensAndExpiration(e, t, r) {
|
@@ -2564,8 +2565,8 @@ function W(n, e) {
|
|
2564
2565
|
}
|
2565
2566
|
class Z {
|
2566
2567
|
constructor(e) {
|
2567
|
-
var { uid: t, auth: r, stsTokenManager: i } = e, s =
|
2568
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
2568
|
+
var { uid: t, auth: r, stsTokenManager: i } = e, s = st(e, ["uid", "auth", "stsTokenManager"]);
|
2569
|
+
this.providerId = "firebase", this.proactiveRefresh = new Ri(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = r, this.stsTokenManager = i, this.accessToken = i.accessToken, this.displayName = s.displayName || null, this.email = s.email || null, this.emailVerified = s.emailVerified || !1, this.phoneNumber = s.phoneNumber || null, this.photoURL = s.photoURL || null, this.isAnonymous = s.isAnonymous || !1, this.tenantId = s.tenantId || null, this.providerData = s.providerData ? [...s.providerData] : [], this.metadata = new ln(s.createdAt || void 0, s.lastLoginAt || void 0);
|
2569
2570
|
}
|
2570
2571
|
async getIdToken(e) {
|
2571
2572
|
const t = await ge(this, this.stsTokenManager.getToken(this.auth, e));
|
@@ -2577,10 +2578,10 @@ class Z {
|
|
2577
2578
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
2578
2579
|
}
|
2579
2580
|
getIdTokenResult(e) {
|
2580
|
-
return
|
2581
|
+
return Si(this, e);
|
2581
2582
|
}
|
2582
2583
|
reload() {
|
2583
|
-
return
|
2584
|
+
return Pi(this);
|
2584
2585
|
}
|
2585
2586
|
_assign(e) {
|
2586
2587
|
this !== e && (_(
|
@@ -2617,7 +2618,7 @@ class Z {
|
|
2617
2618
|
}
|
2618
2619
|
async delete() {
|
2619
2620
|
const e = await this.getIdToken();
|
2620
|
-
return await ge(this,
|
2621
|
+
return await ge(this, Ei(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
2621
2622
|
}
|
2622
2623
|
toJSON() {
|
2623
2624
|
return Object.assign(Object.assign({
|
@@ -2645,7 +2646,7 @@ class Z {
|
|
2645
2646
|
}
|
2646
2647
|
static _fromJSON(e, t) {
|
2647
2648
|
var r, i, s, o, c, a, u, y;
|
2648
|
-
const b = (r = t.displayName) !== null && r !== void 0 ? r : void 0,
|
2649
|
+
const b = (r = t.displayName) !== null && r !== void 0 ? r : void 0, A = (i = t.email) !== null && i !== void 0 ? i : void 0, O = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, N = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, v = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, I = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, k = (u = t.createdAt) !== null && u !== void 0 ? u : void 0, C = (y = t.lastLoginAt) !== null && y !== void 0 ? y : void 0, { uid: U, emailVerified: D, isAnonymous: l, providerData: m, stsTokenManager: d } = t;
|
2649
2650
|
_(
|
2650
2651
|
U && d,
|
2651
2652
|
e,
|
@@ -2658,7 +2659,7 @@ class Z {
|
|
2658
2659
|
e,
|
2659
2660
|
"internal-error"
|
2660
2661
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2661
|
-
), W(b, e.name), W(
|
2662
|
+
), W(b, e.name), W(A, e.name), _(
|
2662
2663
|
typeof D == "boolean",
|
2663
2664
|
e,
|
2664
2665
|
"internal-error"
|
@@ -2672,7 +2673,7 @@ class Z {
|
|
2672
2673
|
const E = new Z({
|
2673
2674
|
uid: U,
|
2674
2675
|
auth: e,
|
2675
|
-
email:
|
2676
|
+
email: A,
|
2676
2677
|
emailVerified: D,
|
2677
2678
|
displayName: b,
|
2678
2679
|
isAnonymous: l,
|
@@ -2683,7 +2684,7 @@ class Z {
|
|
2683
2684
|
createdAt: k,
|
2684
2685
|
lastLoginAt: C
|
2685
2686
|
});
|
2686
|
-
return m && Array.isArray(m) && (E.providerData = m.map((
|
2687
|
+
return m && Array.isArray(m) && (E.providerData = m.map((S) => Object.assign({}, S))), I && (E._redirectEventId = I), E;
|
2687
2688
|
}
|
2688
2689
|
/**
|
2689
2690
|
* Initialize a User from an idToken server response
|
@@ -2718,11 +2719,11 @@ class Z {
|
|
2718
2719
|
* See the License for the specific language governing permissions and
|
2719
2720
|
* limitations under the License.
|
2720
2721
|
*/
|
2721
|
-
const
|
2722
|
+
const St = /* @__PURE__ */ new Map();
|
2722
2723
|
function B(n) {
|
2723
2724
|
F(n instanceof Function, "Expected a class definition");
|
2724
|
-
let e =
|
2725
|
-
return e ? (F(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(),
|
2725
|
+
let e = St.get(n);
|
2726
|
+
return e ? (F(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), St.set(n, e), e);
|
2726
2727
|
}
|
2727
2728
|
/**
|
2728
2729
|
* @license
|
@@ -2740,7 +2741,7 @@ function B(n) {
|
|
2740
2741
|
* See the License for the specific language governing permissions and
|
2741
2742
|
* limitations under the License.
|
2742
2743
|
*/
|
2743
|
-
class
|
2744
|
+
class dn {
|
2744
2745
|
constructor() {
|
2745
2746
|
this.type = "NONE", this.storage = {};
|
2746
2747
|
}
|
@@ -2762,8 +2763,8 @@ class ln {
|
|
2762
2763
|
_removeListener(e, t) {
|
2763
2764
|
}
|
2764
2765
|
}
|
2765
|
-
|
2766
|
-
const At =
|
2766
|
+
dn.type = "NONE";
|
2767
|
+
const At = dn;
|
2767
2768
|
/**
|
2768
2769
|
* @license
|
2769
2770
|
* Copyright 2019 Google LLC
|
@@ -2780,14 +2781,14 @@ const At = ln;
|
|
2780
2781
|
* See the License for the specific language governing permissions and
|
2781
2782
|
* limitations under the License.
|
2782
2783
|
*/
|
2783
|
-
function
|
2784
|
+
function Ae(n, e, t) {
|
2784
2785
|
return `firebase:${n}:${e}:${t}`;
|
2785
2786
|
}
|
2786
2787
|
class se {
|
2787
2788
|
constructor(e, t, r) {
|
2788
2789
|
this.persistence = e, this.auth = t, this.userKey = r;
|
2789
2790
|
const { config: i, name: s } = this.auth;
|
2790
|
-
this.fullUserKey =
|
2791
|
+
this.fullUserKey = Ae(this.userKey, i.apiKey, s), this.fullPersistenceKey = Ae("persistence", i.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
2791
2792
|
}
|
2792
2793
|
setCurrentUser(e) {
|
2793
2794
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
@@ -2820,7 +2821,7 @@ class se {
|
|
2820
2821
|
return u;
|
2821
2822
|
}))).filter((u) => u);
|
2822
2823
|
let s = i[0] || B(At);
|
2823
|
-
const o =
|
2824
|
+
const o = Ae(r, e.config.apiKey, e.name);
|
2824
2825
|
let c = null;
|
2825
2826
|
for (const u of t)
|
2826
2827
|
try {
|
@@ -2858,29 +2859,29 @@ class se {
|
|
2858
2859
|
* See the License for the specific language governing permissions and
|
2859
2860
|
* limitations under the License.
|
2860
2861
|
*/
|
2861
|
-
function
|
2862
|
+
function Ct(n) {
|
2862
2863
|
const e = n.toLowerCase();
|
2863
2864
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
2864
2865
|
return "Opera";
|
2865
|
-
if (
|
2866
|
+
if (fn(e))
|
2866
2867
|
return "IEMobile";
|
2867
2868
|
if (e.includes("msie") || e.includes("trident/"))
|
2868
2869
|
return "IE";
|
2869
2870
|
if (e.includes("edge/"))
|
2870
2871
|
return "Edge";
|
2871
|
-
if (
|
2872
|
+
if (un(e))
|
2872
2873
|
return "Firefox";
|
2873
2874
|
if (e.includes("silk/"))
|
2874
2875
|
return "Silk";
|
2875
|
-
if (pn(e))
|
2876
|
-
return "Blackberry";
|
2877
2876
|
if (gn(e))
|
2877
|
+
return "Blackberry";
|
2878
|
+
if (mn(e))
|
2878
2879
|
return "Webos";
|
2879
|
-
if (
|
2880
|
+
if (lt(e))
|
2880
2881
|
return "Safari";
|
2881
|
-
if ((e.includes("chrome/") ||
|
2882
|
+
if ((e.includes("chrome/") || hn(e)) && !e.includes("edge/"))
|
2882
2883
|
return "Chrome";
|
2883
|
-
if (
|
2884
|
+
if (pn(e))
|
2884
2885
|
return "Android";
|
2885
2886
|
{
|
2886
2887
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, r = n.match(t);
|
@@ -2889,42 +2890,42 @@ function St(n) {
|
|
2889
2890
|
}
|
2890
2891
|
return "Other";
|
2891
2892
|
}
|
2892
|
-
function
|
2893
|
+
function un(n = P()) {
|
2893
2894
|
return /firefox\//i.test(n);
|
2894
2895
|
}
|
2895
|
-
function
|
2896
|
+
function lt(n = P()) {
|
2896
2897
|
const e = n.toLowerCase();
|
2897
2898
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
2898
2899
|
}
|
2899
|
-
function
|
2900
|
+
function hn(n = P()) {
|
2900
2901
|
return /crios\//i.test(n);
|
2901
2902
|
}
|
2902
|
-
function
|
2903
|
+
function fn(n = P()) {
|
2903
2904
|
return /iemobile/i.test(n);
|
2904
2905
|
}
|
2905
|
-
function
|
2906
|
+
function pn(n = P()) {
|
2906
2907
|
return /android/i.test(n);
|
2907
2908
|
}
|
2908
|
-
function
|
2909
|
+
function gn(n = P()) {
|
2909
2910
|
return /blackberry/i.test(n);
|
2910
2911
|
}
|
2911
|
-
function
|
2912
|
+
function mn(n = P()) {
|
2912
2913
|
return /webos/i.test(n);
|
2913
2914
|
}
|
2914
2915
|
function je(n = P()) {
|
2915
2916
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
2916
2917
|
}
|
2917
|
-
function
|
2918
|
+
function Li(n = P()) {
|
2918
2919
|
var e;
|
2919
2920
|
return je(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
2920
2921
|
}
|
2921
|
-
function
|
2922
|
-
return
|
2922
|
+
function $i() {
|
2923
|
+
return Jn() && document.documentMode === 10;
|
2923
2924
|
}
|
2924
|
-
function
|
2925
|
-
return je(n) ||
|
2925
|
+
function yn(n = P()) {
|
2926
|
+
return je(n) || pn(n) || mn(n) || gn(n) || /windows phone/i.test(n) || fn(n);
|
2926
2927
|
}
|
2927
|
-
function
|
2928
|
+
function Mi() {
|
2928
2929
|
try {
|
2929
2930
|
return !!(window && window !== window.top);
|
2930
2931
|
} catch {
|
@@ -2947,14 +2948,14 @@ function $i() {
|
|
2947
2948
|
* See the License for the specific language governing permissions and
|
2948
2949
|
* limitations under the License.
|
2949
2950
|
*/
|
2950
|
-
function
|
2951
|
+
function _n(n, e = []) {
|
2951
2952
|
let t;
|
2952
2953
|
switch (n) {
|
2953
2954
|
case "Browser":
|
2954
|
-
t =
|
2955
|
+
t = Ct(P());
|
2955
2956
|
break;
|
2956
2957
|
case "Worker":
|
2957
|
-
t = `${
|
2958
|
+
t = `${Ct(P())}-${n}`;
|
2958
2959
|
break;
|
2959
2960
|
default:
|
2960
2961
|
t = n;
|
@@ -2978,7 +2979,7 @@ function yn(n, e = []) {
|
|
2978
2979
|
* See the License for the specific language governing permissions and
|
2979
2980
|
* limitations under the License.
|
2980
2981
|
*/
|
2981
|
-
class
|
2982
|
+
class Ui {
|
2982
2983
|
constructor(e) {
|
2983
2984
|
this.auth = e, this.queue = [];
|
2984
2985
|
}
|
@@ -3033,8 +3034,8 @@ class Mi {
|
|
3033
3034
|
* See the License for the specific language governing permissions and
|
3034
3035
|
* limitations under the License.
|
3035
3036
|
*/
|
3036
|
-
async function
|
3037
|
-
return
|
3037
|
+
async function ji(n, e = {}) {
|
3038
|
+
return H(n, "GET", "/v2/passwordPolicy", Q(n, e));
|
3038
3039
|
}
|
3039
3040
|
/**
|
3040
3041
|
* @license
|
@@ -3052,12 +3053,12 @@ async function Ui(n, e = {}) {
|
|
3052
3053
|
* See the License for the specific language governing permissions and
|
3053
3054
|
* limitations under the License.
|
3054
3055
|
*/
|
3055
|
-
const
|
3056
|
-
class
|
3056
|
+
const Bi = 6;
|
3057
|
+
class Fi {
|
3057
3058
|
constructor(e) {
|
3058
3059
|
var t, r, i, s;
|
3059
3060
|
const o = e.customStrengthOptions;
|
3060
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
3061
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Bi, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (i = (r = e.allowedNonAlphanumericCharacters) === null || r === void 0 ? void 0 : r.join("")) !== null && i !== void 0 ? i : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
3061
3062
|
}
|
3062
3063
|
validatePassword(e) {
|
3063
3064
|
var t, r, i, s, o, c;
|
@@ -3140,9 +3141,9 @@ class Bi {
|
|
3140
3141
|
* See the License for the specific language governing permissions and
|
3141
3142
|
* limitations under the License.
|
3142
3143
|
*/
|
3143
|
-
class
|
3144
|
+
class Vi {
|
3144
3145
|
constructor(e, t, r, i) {
|
3145
|
-
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = r, this.config = i, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new
|
3146
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = r, this.config = i, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new Rt(this), this.idTokenSubscription = new Rt(this), this.beforeStateQueue = new Ui(this), this.redirectUser = null, this.isProactiveRefreshEnabled = !1, this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION = 1, this._canInitEmulator = !0, this._isInitialized = !1, this._deleted = !1, this._initializationPromise = null, this._popupRedirectResolver = null, this._errorFactory = sn, this._agentRecaptchaConfig = null, this._tenantRecaptchaConfigs = {}, this._projectPasswordPolicy = null, this._tenantPasswordPolicies = {}, this.lastNotifiedUid = void 0, this.languageCode = null, this.tenantId = null, this.settings = { appVerificationDisabledForTesting: !1 }, this.frameworks = [], this.name = e.name, this.clientVersion = i.sdkClientVersion;
|
3146
3147
|
}
|
3147
3148
|
_initializeWithPersistence(e, t) {
|
3148
3149
|
return t && (this._popupRedirectResolver = B(t)), this._initializationPromise = this.queue(async () => {
|
@@ -3222,13 +3223,13 @@ class Fi {
|
|
3222
3223
|
return this.directlySetCurrentUser(e);
|
3223
3224
|
}
|
3224
3225
|
useDeviceLanguage() {
|
3225
|
-
this.languageCode =
|
3226
|
+
this.languageCode = mi();
|
3226
3227
|
}
|
3227
3228
|
async _delete() {
|
3228
3229
|
this._deleted = !0;
|
3229
3230
|
}
|
3230
3231
|
async updateCurrentUser(e) {
|
3231
|
-
const t = e ?
|
3232
|
+
const t = e ? V(e) : null;
|
3232
3233
|
return t && _(
|
3233
3234
|
t.auth.config.apiKey === this.config.apiKey,
|
3234
3235
|
this,
|
@@ -3271,7 +3272,7 @@ class Fi {
|
|
3271
3272
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
3272
3273
|
}
|
3273
3274
|
async _updatePasswordPolicy() {
|
3274
|
-
const e = await
|
3275
|
+
const e = await ji(this), t = new Fi(e);
|
3275
3276
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
3276
3277
|
}
|
3277
3278
|
_getPersistence() {
|
@@ -3311,7 +3312,7 @@ class Fi {
|
|
3311
3312
|
token: e,
|
3312
3313
|
idToken: t
|
3313
3314
|
};
|
3314
|
-
this.tenantId != null && (r.tenantId = this.tenantId), await
|
3315
|
+
this.tenantId != null && (r.tenantId = this.tenantId), await Di(this, r);
|
3315
3316
|
}
|
3316
3317
|
}
|
3317
3318
|
toJSON() {
|
@@ -3424,7 +3425,7 @@ class Fi {
|
|
3424
3425
|
), this.persistenceManager;
|
3425
3426
|
}
|
3426
3427
|
_logFramework(e) {
|
3427
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
3428
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = _n(this.config.clientPlatform, this._getFrameworks()));
|
3428
3429
|
}
|
3429
3430
|
_getFrameworks() {
|
3430
3431
|
return this.frameworks;
|
@@ -3454,15 +3455,15 @@ class Fi {
|
|
3454
3455
|
async _getAppCheckToken() {
|
3455
3456
|
var e;
|
3456
3457
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
3457
|
-
return t != null && t.error &&
|
3458
|
+
return t != null && t.error && hi(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
3458
3459
|
}
|
3459
3460
|
}
|
3460
3461
|
function ne(n) {
|
3461
|
-
return
|
3462
|
+
return V(n);
|
3462
3463
|
}
|
3463
|
-
class
|
3464
|
+
class Rt {
|
3464
3465
|
constructor(e) {
|
3465
|
-
this.auth = e, this.observer = null, this.addObserver =
|
3466
|
+
this.auth = e, this.observer = null, this.addObserver = er((t) => this.observer = t);
|
3466
3467
|
}
|
3467
3468
|
get next() {
|
3468
3469
|
return _(
|
@@ -3489,34 +3490,38 @@ class Ct {
|
|
3489
3490
|
* See the License for the specific language governing permissions and
|
3490
3491
|
* limitations under the License.
|
3491
3492
|
*/
|
3492
|
-
|
3493
|
-
|
3494
|
-
|
3493
|
+
let Be = {
|
3494
|
+
async loadJS() {
|
3495
|
+
throw new Error("Unable to load external scripts");
|
3496
|
+
},
|
3497
|
+
recaptchaV2Script: "",
|
3498
|
+
recaptchaEnterpriseScript: "",
|
3499
|
+
gapiScript: ""
|
3500
|
+
};
|
3501
|
+
function Hi(n) {
|
3502
|
+
Be = n;
|
3495
3503
|
}
|
3496
|
-
function
|
3497
|
-
return
|
3498
|
-
const r = document.createElement("script");
|
3499
|
-
r.setAttribute("src", n), r.onload = e, r.onerror = (i) => {
|
3500
|
-
const s = $(
|
3501
|
-
"internal-error"
|
3502
|
-
/* AuthErrorCode.INTERNAL_ERROR */
|
3503
|
-
);
|
3504
|
-
s.customData = i, t(s);
|
3505
|
-
}, r.type = "text/javascript", r.charset = "UTF-8", Hi().appendChild(r);
|
3506
|
-
});
|
3504
|
+
function vn(n) {
|
3505
|
+
return Be.loadJS(n);
|
3507
3506
|
}
|
3508
|
-
function
|
3507
|
+
function Wi() {
|
3508
|
+
return Be.recaptchaEnterpriseScript;
|
3509
|
+
}
|
3510
|
+
function xi() {
|
3511
|
+
return Be.gapiScript;
|
3512
|
+
}
|
3513
|
+
function zi(n) {
|
3509
3514
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
3510
3515
|
}
|
3511
|
-
const
|
3512
|
-
class
|
3516
|
+
const qi = "recaptcha-enterprise", Ji = "NO_RECAPTCHA";
|
3517
|
+
class Gi {
|
3513
3518
|
/**
|
3514
3519
|
*
|
3515
3520
|
* @param authExtern - The corresponding Firebase {@link Auth} instance.
|
3516
3521
|
*
|
3517
3522
|
*/
|
3518
3523
|
constructor(e) {
|
3519
|
-
this.type =
|
3524
|
+
this.type = qi, this.auth = ne(e);
|
3520
3525
|
}
|
3521
3526
|
/**
|
3522
3527
|
* Executes the verification process.
|
@@ -3532,7 +3537,7 @@ class qi {
|
|
3532
3537
|
return s._tenantRecaptchaConfigs[s.tenantId].siteKey;
|
3533
3538
|
}
|
3534
3539
|
return new Promise(async (o, c) => {
|
3535
|
-
|
3540
|
+
wi(s, {
|
3536
3541
|
clientType: "CLIENT_TYPE_WEB",
|
3537
3542
|
version: "RECAPTCHA_ENTERPRISE"
|
3538
3543
|
/* RecaptchaVersion.ENTERPRISE */
|
@@ -3540,7 +3545,7 @@ class qi {
|
|
3540
3545
|
if (a.recaptchaKey === void 0)
|
3541
3546
|
c(new Error("recaptcha Enterprise site key undefined"));
|
3542
3547
|
else {
|
3543
|
-
const u = new
|
3548
|
+
const u = new Ii(a);
|
3544
3549
|
return s.tenantId == null ? s._agentRecaptchaConfig = u : s._tenantRecaptchaConfigs[s.tenantId] = u, o(u.siteKey);
|
3545
3550
|
}
|
3546
3551
|
}).catch((a) => {
|
@@ -3550,27 +3555,28 @@ class qi {
|
|
3550
3555
|
}
|
3551
3556
|
function i(s, o, c) {
|
3552
3557
|
const a = window.grecaptcha;
|
3553
|
-
|
3558
|
+
Tt(a) ? a.enterprise.ready(() => {
|
3554
3559
|
a.enterprise.execute(s, { action: e }).then((u) => {
|
3555
3560
|
o(u);
|
3556
3561
|
}).catch(() => {
|
3557
|
-
o(
|
3562
|
+
o(Ji);
|
3558
3563
|
});
|
3559
3564
|
}) : c(Error("No reCAPTCHA enterprise script loaded."));
|
3560
3565
|
}
|
3561
3566
|
return new Promise((s, o) => {
|
3562
3567
|
r(this.auth).then((c) => {
|
3563
|
-
if (!t &&
|
3568
|
+
if (!t && Tt(window.grecaptcha))
|
3564
3569
|
i(c, s, o);
|
3565
3570
|
else {
|
3566
3571
|
if (typeof window > "u") {
|
3567
3572
|
o(new Error("RecaptchaVerifier is only supported in browser"));
|
3568
3573
|
return;
|
3569
3574
|
}
|
3570
|
-
|
3575
|
+
let a = Wi();
|
3576
|
+
a.length !== 0 && (a += c), vn(a).then(() => {
|
3571
3577
|
i(c, s, o);
|
3572
|
-
}).catch((
|
3573
|
-
o(
|
3578
|
+
}).catch((u) => {
|
3579
|
+
o(u);
|
3574
3580
|
});
|
3575
3581
|
}
|
3576
3582
|
}).catch((c) => {
|
@@ -3579,8 +3585,8 @@ class qi {
|
|
3579
3585
|
});
|
3580
3586
|
}
|
3581
3587
|
}
|
3582
|
-
async function
|
3583
|
-
const i = new
|
3588
|
+
async function Pt(n, e, t, r = !1) {
|
3589
|
+
const i = new Gi(n);
|
3584
3590
|
let s;
|
3585
3591
|
try {
|
3586
3592
|
s = await i.verify(t);
|
@@ -3596,13 +3602,13 @@ async function Rt(n, e, t, r = !1) {
|
|
3596
3602
|
/* RecaptchaVersion.ENTERPRISE */
|
3597
3603
|
}), o;
|
3598
3604
|
}
|
3599
|
-
async function
|
3605
|
+
async function tt(n, e, t, r) {
|
3600
3606
|
var i;
|
3601
3607
|
if (!((i = n._getRecaptchaConfig()) === null || i === void 0) && i.isProviderEnabled(
|
3602
3608
|
"EMAIL_PASSWORD_PROVIDER"
|
3603
3609
|
/* RecaptchaProvider.EMAIL_PASSWORD_PROVIDER */
|
3604
3610
|
)) {
|
3605
|
-
const s = await
|
3611
|
+
const s = await Pt(
|
3606
3612
|
n,
|
3607
3613
|
e,
|
3608
3614
|
t,
|
@@ -3614,7 +3620,7 @@ async function et(n, e, t, r) {
|
|
3614
3620
|
return r(n, e).catch(async (s) => {
|
3615
3621
|
if (s.code === "auth/missing-recaptcha-token") {
|
3616
3622
|
console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);
|
3617
|
-
const o = await
|
3623
|
+
const o = await Pt(
|
3618
3624
|
n,
|
3619
3625
|
e,
|
3620
3626
|
t,
|
@@ -3642,8 +3648,8 @@ async function et(n, e, t, r) {
|
|
3642
3648
|
* See the License for the specific language governing permissions and
|
3643
3649
|
* limitations under the License.
|
3644
3650
|
*/
|
3645
|
-
function
|
3646
|
-
const t =
|
3651
|
+
function Ki(n, e) {
|
3652
|
+
const t = Zt(n, "auth");
|
3647
3653
|
if (t.isInitialized()) {
|
3648
3654
|
const i = t.getImmediate(), s = t.getOptions();
|
3649
3655
|
if (Pe(s, e ?? {}))
|
@@ -3656,11 +3662,11 @@ function Gi(n, e) {
|
|
3656
3662
|
}
|
3657
3663
|
return t.initialize({ options: e });
|
3658
3664
|
}
|
3659
|
-
function
|
3665
|
+
function Yi(n, e) {
|
3660
3666
|
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(B);
|
3661
3667
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(r, e == null ? void 0 : e.popupRedirectResolver);
|
3662
3668
|
}
|
3663
|
-
function
|
3669
|
+
function Qi(n, e, t) {
|
3664
3670
|
const r = ne(n);
|
3665
3671
|
_(
|
3666
3672
|
r._canInitEmulator,
|
@@ -3673,38 +3679,38 @@ function Ki(n, e, t) {
|
|
3673
3679
|
"invalid-emulator-scheme"
|
3674
3680
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
3675
3681
|
);
|
3676
|
-
const i = !!(t != null && t.disableWarnings), s =
|
3682
|
+
const i = !!(t != null && t.disableWarnings), s = bn(e), { host: o, port: c } = Xi(e), a = c === null ? "" : `:${c}`;
|
3677
3683
|
r.config.emulator = { url: `${s}//${o}${a}/` }, r.settings.appVerificationDisabledForTesting = !0, r.emulatorConfig = Object.freeze({
|
3678
3684
|
host: o,
|
3679
3685
|
port: c,
|
3680
3686
|
protocol: s.replace(":", ""),
|
3681
3687
|
options: Object.freeze({ disableWarnings: i })
|
3682
|
-
}), i ||
|
3688
|
+
}), i || Zi();
|
3683
3689
|
}
|
3684
|
-
function
|
3690
|
+
function bn(n) {
|
3685
3691
|
const e = n.indexOf(":");
|
3686
3692
|
return e < 0 ? "" : n.substr(0, e + 1);
|
3687
3693
|
}
|
3688
|
-
function
|
3689
|
-
const e =
|
3694
|
+
function Xi(n) {
|
3695
|
+
const e = bn(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
3690
3696
|
if (!t)
|
3691
3697
|
return { host: "", port: null };
|
3692
3698
|
const r = t[2].split("@").pop() || "", i = /^(\[[^\]]+\])(:|$)/.exec(r);
|
3693
3699
|
if (i) {
|
3694
3700
|
const s = i[1];
|
3695
|
-
return { host: s, port:
|
3701
|
+
return { host: s, port: Ot(r.substr(s.length + 1)) };
|
3696
3702
|
} else {
|
3697
3703
|
const [s, o] = r.split(":");
|
3698
|
-
return { host: s, port:
|
3704
|
+
return { host: s, port: Ot(o) };
|
3699
3705
|
}
|
3700
3706
|
}
|
3701
|
-
function
|
3707
|
+
function Ot(n) {
|
3702
3708
|
if (!n)
|
3703
3709
|
return null;
|
3704
3710
|
const e = Number(n);
|
3705
3711
|
return isNaN(e) ? null : e;
|
3706
3712
|
}
|
3707
|
-
function
|
3713
|
+
function Zi() {
|
3708
3714
|
function n() {
|
3709
3715
|
const e = document.createElement("p"), t = e.style;
|
3710
3716
|
e.innerText = "Running in emulator mode. Do not use with production credentials.", t.position = "fixed", t.width = "100%", t.backgroundColor = "#ffffff", t.border = ".1em solid #000000", t.color = "#b50000", t.bottom = "0px", t.left = "0px", t.margin = "0px", t.zIndex = "10000", t.textAlign = "center", e.classList.add("firebase-emulator-warning"), document.body.appendChild(e);
|
@@ -3727,7 +3733,7 @@ function Qi() {
|
|
3727
3733
|
* See the License for the specific language governing permissions and
|
3728
3734
|
* limitations under the License.
|
3729
3735
|
*/
|
3730
|
-
class
|
3736
|
+
class dt {
|
3731
3737
|
/** @internal */
|
3732
3738
|
constructor(e, t) {
|
3733
3739
|
this.providerId = e, this.signInMethod = t;
|
@@ -3753,8 +3759,8 @@ class lt {
|
|
3753
3759
|
return j("not implemented");
|
3754
3760
|
}
|
3755
3761
|
}
|
3756
|
-
async function
|
3757
|
-
return
|
3762
|
+
async function es(n, e) {
|
3763
|
+
return H(n, "POST", "/v1/accounts:signUp", e);
|
3758
3764
|
}
|
3759
3765
|
/**
|
3760
3766
|
* @license
|
@@ -3772,14 +3778,14 @@ async function Xi(n, e) {
|
|
3772
3778
|
* See the License for the specific language governing permissions and
|
3773
3779
|
* limitations under the License.
|
3774
3780
|
*/
|
3775
|
-
async function
|
3781
|
+
async function ts(n, e) {
|
3776
3782
|
return Ue(n, "POST", "/v1/accounts:signInWithPassword", Q(n, e));
|
3777
3783
|
}
|
3778
|
-
async function
|
3779
|
-
return
|
3784
|
+
async function ns(n, e) {
|
3785
|
+
return H(n, "POST", "/v1/accounts:sendOobCode", Q(n, e));
|
3780
3786
|
}
|
3781
|
-
async function
|
3782
|
-
return
|
3787
|
+
async function rs(n, e) {
|
3788
|
+
return ns(n, e);
|
3783
3789
|
}
|
3784
3790
|
/**
|
3785
3791
|
* @license
|
@@ -3797,10 +3803,10 @@ async function ts(n, e) {
|
|
3797
3803
|
* See the License for the specific language governing permissions and
|
3798
3804
|
* limitations under the License.
|
3799
3805
|
*/
|
3800
|
-
async function
|
3806
|
+
async function is(n, e) {
|
3801
3807
|
return Ue(n, "POST", "/v1/accounts:signInWithEmailLink", Q(n, e));
|
3802
3808
|
}
|
3803
|
-
async function
|
3809
|
+
async function ss(n, e) {
|
3804
3810
|
return Ue(n, "POST", "/v1/accounts:signInWithEmailLink", Q(n, e));
|
3805
3811
|
}
|
3806
3812
|
/**
|
@@ -3819,7 +3825,7 @@ async function rs(n, e) {
|
|
3819
3825
|
* See the License for the specific language governing permissions and
|
3820
3826
|
* limitations under the License.
|
3821
3827
|
*/
|
3822
|
-
class ye extends
|
3828
|
+
class ye extends dt {
|
3823
3829
|
/** @internal */
|
3824
3830
|
constructor(e, t, r, i = null) {
|
3825
3831
|
super("password", r), this._email = e, this._password = t, this._tenantId = i;
|
@@ -3875,9 +3881,9 @@ class ye extends lt {
|
|
3875
3881
|
clientType: "CLIENT_TYPE_WEB"
|
3876
3882
|
/* RecaptchaClientType.WEB */
|
3877
3883
|
};
|
3878
|
-
return
|
3884
|
+
return tt(e, t, "signInWithPassword", ts);
|
3879
3885
|
case "emailLink":
|
3880
|
-
return
|
3886
|
+
return is(e, {
|
3881
3887
|
email: this._email,
|
3882
3888
|
oobCode: this._password
|
3883
3889
|
});
|
@@ -3901,9 +3907,9 @@ class ye extends lt {
|
|
3901
3907
|
clientType: "CLIENT_TYPE_WEB"
|
3902
3908
|
/* RecaptchaClientType.WEB */
|
3903
3909
|
};
|
3904
|
-
return
|
3910
|
+
return tt(e, r, "signUpPassword", es);
|
3905
3911
|
case "emailLink":
|
3906
|
-
return
|
3912
|
+
return ss(e, {
|
3907
3913
|
idToken: t,
|
3908
3914
|
email: this._email,
|
3909
3915
|
oobCode: this._password
|
@@ -3956,8 +3962,8 @@ async function oe(n, e) {
|
|
3956
3962
|
* See the License for the specific language governing permissions and
|
3957
3963
|
* limitations under the License.
|
3958
3964
|
*/
|
3959
|
-
const
|
3960
|
-
class te extends
|
3965
|
+
const os = "http://localhost";
|
3966
|
+
class te extends dt {
|
3961
3967
|
constructor() {
|
3962
3968
|
super(...arguments), this.pendingToken = null;
|
3963
3969
|
}
|
@@ -3991,7 +3997,7 @@ class te extends lt {
|
|
3991
3997
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
3992
3998
|
*/
|
3993
3999
|
static fromJSON(e) {
|
3994
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s =
|
4000
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s = st(t, ["providerId", "signInMethod"]);
|
3995
4001
|
if (!r || !i)
|
3996
4002
|
return null;
|
3997
4003
|
const o = new te(r, i);
|
@@ -4014,7 +4020,7 @@ class te extends lt {
|
|
4014
4020
|
}
|
4015
4021
|
buildRequest() {
|
4016
4022
|
const e = {
|
4017
|
-
requestUri:
|
4023
|
+
requestUri: os,
|
4018
4024
|
returnSecureToken: !0
|
4019
4025
|
};
|
4020
4026
|
if (this.pendingToken)
|
@@ -4042,7 +4048,7 @@ class te extends lt {
|
|
4042
4048
|
* See the License for the specific language governing permissions and
|
4043
4049
|
* limitations under the License.
|
4044
4050
|
*/
|
4045
|
-
function
|
4051
|
+
function as(n) {
|
4046
4052
|
switch (n) {
|
4047
4053
|
case "recoverEmail":
|
4048
4054
|
return "RECOVER_EMAIL";
|
@@ -4060,11 +4066,11 @@ function ss(n) {
|
|
4060
4066
|
return null;
|
4061
4067
|
}
|
4062
4068
|
}
|
4063
|
-
function
|
4069
|
+
function cs(n) {
|
4064
4070
|
const e = de(ue(n)).link, t = e ? de(ue(e)).deep_link_id : null, r = de(ue(n)).deep_link_id;
|
4065
4071
|
return (r ? de(ue(r)).link : null) || r || t || e || n;
|
4066
4072
|
}
|
4067
|
-
class
|
4073
|
+
class ut {
|
4068
4074
|
/**
|
4069
4075
|
* @param actionLink - The link from which to extract the URL.
|
4070
4076
|
* @returns The {@link ActionCodeURL} object, or null if the link is invalid.
|
@@ -4073,7 +4079,7 @@ class dt {
|
|
4073
4079
|
*/
|
4074
4080
|
constructor(e) {
|
4075
4081
|
var t, r, i, s, o, c;
|
4076
|
-
const a = de(ue(e)), u = (t = a.apiKey) !== null && t !== void 0 ? t : null, y = (r = a.oobCode) !== null && r !== void 0 ? r : null, b =
|
4082
|
+
const a = de(ue(e)), u = (t = a.apiKey) !== null && t !== void 0 ? t : null, y = (r = a.oobCode) !== null && r !== void 0 ? r : null, b = as((i = a.mode) !== null && i !== void 0 ? i : null);
|
4077
4083
|
_(
|
4078
4084
|
u && y && b,
|
4079
4085
|
"argument-error"
|
@@ -4090,9 +4096,9 @@ class dt {
|
|
4090
4096
|
* @public
|
4091
4097
|
*/
|
4092
4098
|
static parseLink(e) {
|
4093
|
-
const t =
|
4099
|
+
const t = cs(e);
|
4094
4100
|
try {
|
4095
|
-
return new
|
4101
|
+
return new ut(t);
|
4096
4102
|
} catch {
|
4097
4103
|
return null;
|
4098
4104
|
}
|
@@ -4162,7 +4168,7 @@ class le {
|
|
4162
4168
|
* @returns - The auth provider credential.
|
4163
4169
|
*/
|
4164
4170
|
static credentialWithLink(e, t) {
|
4165
|
-
const r =
|
4171
|
+
const r = ut.parseLink(t);
|
4166
4172
|
return _(
|
4167
4173
|
r,
|
4168
4174
|
"argument-error"
|
@@ -4189,7 +4195,7 @@ le.EMAIL_LINK_SIGN_IN_METHOD = "emailLink";
|
|
4189
4195
|
* See the License for the specific language governing permissions and
|
4190
4196
|
* limitations under the License.
|
4191
4197
|
*/
|
4192
|
-
class
|
4198
|
+
class In {
|
4193
4199
|
/**
|
4194
4200
|
* Constructor for generic OAuth providers.
|
4195
4201
|
*
|
@@ -4242,7 +4248,7 @@ class bn {
|
|
4242
4248
|
* See the License for the specific language governing permissions and
|
4243
4249
|
* limitations under the License.
|
4244
4250
|
*/
|
4245
|
-
class we extends
|
4251
|
+
class we extends In {
|
4246
4252
|
constructor() {
|
4247
4253
|
super(...arguments), this.scopes = [];
|
4248
4254
|
}
|
@@ -4488,7 +4494,7 @@ q.PROVIDER_ID = "github.com";
|
|
4488
4494
|
* See the License for the specific language governing permissions and
|
4489
4495
|
* limitations under the License.
|
4490
4496
|
*/
|
4491
|
-
class
|
4497
|
+
class J extends we {
|
4492
4498
|
constructor() {
|
4493
4499
|
super(
|
4494
4500
|
"twitter.com"
|
@@ -4503,8 +4509,8 @@ class G extends we {
|
|
4503
4509
|
*/
|
4504
4510
|
static credential(e, t) {
|
4505
4511
|
return te._fromParams({
|
4506
|
-
providerId:
|
4507
|
-
signInMethod:
|
4512
|
+
providerId: J.PROVIDER_ID,
|
4513
|
+
signInMethod: J.TWITTER_SIGN_IN_METHOD,
|
4508
4514
|
oauthToken: e,
|
4509
4515
|
oauthTokenSecret: t
|
4510
4516
|
});
|
@@ -4515,7 +4521,7 @@ class G extends we {
|
|
4515
4521
|
* @param userCredential - The user credential.
|
4516
4522
|
*/
|
4517
4523
|
static credentialFromResult(e) {
|
4518
|
-
return
|
4524
|
+
return J.credentialFromTaggedObject(e);
|
4519
4525
|
}
|
4520
4526
|
/**
|
4521
4527
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
@@ -4524,7 +4530,7 @@ class G extends we {
|
|
4524
4530
|
* @param userCredential - The user credential.
|
4525
4531
|
*/
|
4526
4532
|
static credentialFromError(e) {
|
4527
|
-
return
|
4533
|
+
return J.credentialFromTaggedObject(e.customData || {});
|
4528
4534
|
}
|
4529
4535
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
4530
4536
|
if (!e)
|
@@ -4533,14 +4539,14 @@ class G extends we {
|
|
4533
4539
|
if (!t || !r)
|
4534
4540
|
return null;
|
4535
4541
|
try {
|
4536
|
-
return
|
4542
|
+
return J.credential(t, r);
|
4537
4543
|
} catch {
|
4538
4544
|
return null;
|
4539
4545
|
}
|
4540
4546
|
}
|
4541
4547
|
}
|
4542
|
-
|
4543
|
-
|
4548
|
+
J.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
4549
|
+
J.PROVIDER_ID = "twitter.com";
|
4544
4550
|
/**
|
4545
4551
|
* @license
|
4546
4552
|
* Copyright 2020 Google LLC
|
@@ -4562,7 +4568,7 @@ class ce {
|
|
4562
4568
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
4563
4569
|
}
|
4564
4570
|
static async _fromIdTokenResponse(e, t, r, i = !1) {
|
4565
|
-
const s = await Z._fromIdTokenResponse(e, r, i), o =
|
4571
|
+
const s = await Z._fromIdTokenResponse(e, r, i), o = kt(r);
|
4566
4572
|
return new ce({
|
4567
4573
|
user: s,
|
4568
4574
|
providerId: o,
|
@@ -4576,7 +4582,7 @@ class ce {
|
|
4576
4582
|
/* reload */
|
4577
4583
|
!0
|
4578
4584
|
);
|
4579
|
-
const i =
|
4585
|
+
const i = kt(r);
|
4580
4586
|
return new ce({
|
4581
4587
|
user: e,
|
4582
4588
|
providerId: i,
|
@@ -4585,7 +4591,7 @@ class ce {
|
|
4585
4591
|
});
|
4586
4592
|
}
|
4587
4593
|
}
|
4588
|
-
function
|
4594
|
+
function kt(n) {
|
4589
4595
|
return n.providerId ? n.providerId : "phoneNumber" in n ? "phone" : null;
|
4590
4596
|
}
|
4591
4597
|
/**
|
@@ -4618,12 +4624,12 @@ class De extends Y {
|
|
4618
4624
|
return new De(e, t, r, i);
|
4619
4625
|
}
|
4620
4626
|
}
|
4621
|
-
function
|
4627
|
+
function wn(n, e, t, r) {
|
4622
4628
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
4623
4629
|
throw s.code === "auth/multi-factor-auth-required" ? De._fromErrorAndOperation(n, s, e, r) : s;
|
4624
4630
|
});
|
4625
4631
|
}
|
4626
|
-
async function
|
4632
|
+
async function ls(n, e, t = !1) {
|
4627
4633
|
const r = await ge(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
4628
4634
|
return ce._forOperation(n, "link", r);
|
4629
4635
|
}
|
@@ -4643,17 +4649,17 @@ async function as(n, e, t = !1) {
|
|
4643
4649
|
* See the License for the specific language governing permissions and
|
4644
4650
|
* limitations under the License.
|
4645
4651
|
*/
|
4646
|
-
async function
|
4652
|
+
async function ds(n, e, t = !1) {
|
4647
4653
|
const { auth: r } = n, i = "reauthenticate";
|
4648
4654
|
try {
|
4649
|
-
const s = await ge(n,
|
4655
|
+
const s = await ge(n, wn(r, i, e, n), t);
|
4650
4656
|
_(
|
4651
4657
|
s.idToken,
|
4652
4658
|
r,
|
4653
4659
|
"internal-error"
|
4654
4660
|
/* AuthErrorCode.INTERNAL_ERROR */
|
4655
4661
|
);
|
4656
|
-
const o =
|
4662
|
+
const o = ct(s.idToken);
|
4657
4663
|
_(
|
4658
4664
|
o,
|
4659
4665
|
r,
|
@@ -4691,12 +4697,12 @@ async function cs(n, e, t = !1) {
|
|
4691
4697
|
* See the License for the specific language governing permissions and
|
4692
4698
|
* limitations under the License.
|
4693
4699
|
*/
|
4694
|
-
async function
|
4695
|
-
const r = "signIn", i = await
|
4700
|
+
async function En(n, e, t = !1) {
|
4701
|
+
const r = "signIn", i = await wn(n, r, e), s = await ce._fromIdTokenResponse(n, r, i);
|
4696
4702
|
return t || await n._updateCurrentUser(s.user), s;
|
4697
4703
|
}
|
4698
|
-
async function
|
4699
|
-
return
|
4704
|
+
async function us(n, e) {
|
4705
|
+
return En(ne(n), e);
|
4700
4706
|
}
|
4701
4707
|
/**
|
4702
4708
|
* @license
|
@@ -4714,7 +4720,7 @@ async function ls(n, e) {
|
|
4714
4720
|
* See the License for the specific language governing permissions and
|
4715
4721
|
* limitations under the License.
|
4716
4722
|
*/
|
4717
|
-
function
|
4723
|
+
function hs(n, e, t) {
|
4718
4724
|
var r;
|
4719
4725
|
_(
|
4720
4726
|
((r = t.url) === null || r === void 0 ? void 0 : r.length) > 0,
|
@@ -4754,35 +4760,35 @@ function ds(n, e, t) {
|
|
4754
4760
|
* See the License for the specific language governing permissions and
|
4755
4761
|
* limitations under the License.
|
4756
4762
|
*/
|
4757
|
-
async function
|
4763
|
+
async function fs(n) {
|
4758
4764
|
const e = ne(n);
|
4759
4765
|
e._getPasswordPolicyInternal() && await e._updatePasswordPolicy();
|
4760
4766
|
}
|
4761
|
-
async function
|
4767
|
+
async function ps(n, e, t) {
|
4762
4768
|
const r = ne(n), i = {
|
4763
4769
|
requestType: "PASSWORD_RESET",
|
4764
4770
|
email: e,
|
4765
4771
|
clientType: "CLIENT_TYPE_WEB"
|
4766
4772
|
/* RecaptchaClientType.WEB */
|
4767
4773
|
};
|
4768
|
-
t &&
|
4774
|
+
t && hs(r, i, t), await tt(r, i, "getOobCode", rs);
|
4769
4775
|
}
|
4770
|
-
function
|
4771
|
-
return
|
4772
|
-
throw r.code === "auth/password-does-not-meet-requirements" &&
|
4776
|
+
function gs(n, e, t) {
|
4777
|
+
return us(V(n), le.credential(e, t)).catch(async (r) => {
|
4778
|
+
throw r.code === "auth/password-does-not-meet-requirements" && fs(n), r;
|
4773
4779
|
});
|
4774
4780
|
}
|
4775
|
-
function
|
4776
|
-
return
|
4781
|
+
function ms(n, e, t, r) {
|
4782
|
+
return V(n).onIdTokenChanged(e, t, r);
|
4777
4783
|
}
|
4778
|
-
function
|
4779
|
-
return
|
4784
|
+
function ys(n, e, t) {
|
4785
|
+
return V(n).beforeAuthStateChanged(e, t);
|
4780
4786
|
}
|
4781
|
-
function
|
4782
|
-
return
|
4787
|
+
function _s(n, e, t, r) {
|
4788
|
+
return V(n).onAuthStateChanged(e, t, r);
|
4783
4789
|
}
|
4784
|
-
function
|
4785
|
-
return
|
4790
|
+
function vs(n) {
|
4791
|
+
return V(n).signOut();
|
4786
4792
|
}
|
4787
4793
|
const Le = "__sak";
|
4788
4794
|
/**
|
@@ -4801,7 +4807,7 @@ const Le = "__sak";
|
|
4801
4807
|
* See the License for the specific language governing permissions and
|
4802
4808
|
* limitations under the License.
|
4803
4809
|
*/
|
4804
|
-
class
|
4810
|
+
class Tn {
|
4805
4811
|
constructor(e, t) {
|
4806
4812
|
this.storageRetriever = e, this.type = t;
|
4807
4813
|
}
|
@@ -4842,18 +4848,18 @@ class En {
|
|
4842
4848
|
* See the License for the specific language governing permissions and
|
4843
4849
|
* limitations under the License.
|
4844
4850
|
*/
|
4845
|
-
function
|
4851
|
+
function bs() {
|
4846
4852
|
const n = P();
|
4847
|
-
return
|
4853
|
+
return lt(n) || je(n);
|
4848
4854
|
}
|
4849
|
-
const
|
4850
|
-
class
|
4855
|
+
const Is = 1e3, ws = 10;
|
4856
|
+
class Sn extends Tn {
|
4851
4857
|
constructor() {
|
4852
4858
|
super(
|
4853
4859
|
() => window.localStorage,
|
4854
4860
|
"LOCAL"
|
4855
4861
|
/* PersistenceType.LOCAL */
|
4856
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
4862
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = bs() && Mi(), this.fallbackToPolling = yn(), this._shouldAllowMigration = !0;
|
4857
4863
|
}
|
4858
4864
|
forAllChangedKeys(e) {
|
4859
4865
|
for (const t of Object.keys(this.listeners)) {
|
@@ -4880,7 +4886,7 @@ class Tn extends En {
|
|
4880
4886
|
const o = this.storage.getItem(r);
|
4881
4887
|
!t && this.localCache[r] === o || this.notifyListeners(r, o);
|
4882
4888
|
}, s = this.storage.getItem(r);
|
4883
|
-
|
4889
|
+
$i() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(i, ws) : i();
|
4884
4890
|
}
|
4885
4891
|
notifyListeners(e, t) {
|
4886
4892
|
this.localCache[e] = t;
|
@@ -4902,7 +4908,7 @@ class Tn extends En {
|
|
4902
4908
|
!0
|
4903
4909
|
);
|
4904
4910
|
});
|
4905
|
-
},
|
4911
|
+
}, Is);
|
4906
4912
|
}
|
4907
4913
|
stopPolling() {
|
4908
4914
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
@@ -4931,8 +4937,8 @@ class Tn extends En {
|
|
4931
4937
|
await super._remove(e), delete this.localCache[e];
|
4932
4938
|
}
|
4933
4939
|
}
|
4934
|
-
|
4935
|
-
const
|
4940
|
+
Sn.type = "LOCAL";
|
4941
|
+
const Es = Sn;
|
4936
4942
|
/**
|
4937
4943
|
* @license
|
4938
4944
|
* Copyright 2020 Google LLC
|
@@ -4949,7 +4955,7 @@ const Is = Tn;
|
|
4949
4955
|
* See the License for the specific language governing permissions and
|
4950
4956
|
* limitations under the License.
|
4951
4957
|
*/
|
4952
|
-
class An extends
|
4958
|
+
class An extends Tn {
|
4953
4959
|
constructor() {
|
4954
4960
|
super(
|
4955
4961
|
() => window.sessionStorage,
|
@@ -4963,7 +4969,7 @@ class An extends En {
|
|
4963
4969
|
}
|
4964
4970
|
}
|
4965
4971
|
An.type = "SESSION";
|
4966
|
-
const
|
4972
|
+
const Cn = An;
|
4967
4973
|
/**
|
4968
4974
|
* @license
|
4969
4975
|
* Copyright 2019 Google LLC
|
@@ -4980,7 +4986,7 @@ const Sn = An;
|
|
4980
4986
|
* See the License for the specific language governing permissions and
|
4981
4987
|
* limitations under the License.
|
4982
4988
|
*/
|
4983
|
-
function
|
4989
|
+
function Ts(n) {
|
4984
4990
|
return Promise.all(n.map(async (e) => {
|
4985
4991
|
try {
|
4986
4992
|
return {
|
@@ -5011,7 +5017,7 @@ function ws(n) {
|
|
5011
5017
|
* See the License for the specific language governing permissions and
|
5012
5018
|
* limitations under the License.
|
5013
5019
|
*/
|
5014
|
-
class
|
5020
|
+
class Fe {
|
5015
5021
|
constructor(e) {
|
5016
5022
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
5017
5023
|
}
|
@@ -5025,7 +5031,7 @@ class Be {
|
|
5025
5031
|
const t = this.receivers.find((i) => i.isListeningto(e));
|
5026
5032
|
if (t)
|
5027
5033
|
return t;
|
5028
|
-
const r = new
|
5034
|
+
const r = new Fe(e);
|
5029
5035
|
return this.receivers.push(r), r;
|
5030
5036
|
}
|
5031
5037
|
isListeningto(e) {
|
@@ -5050,7 +5056,7 @@ class Be {
|
|
5050
5056
|
eventId: r,
|
5051
5057
|
eventType: i
|
5052
5058
|
});
|
5053
|
-
const c = Array.from(o).map(async (u) => u(t.origin, s)), a = await
|
5059
|
+
const c = Array.from(o).map(async (u) => u(t.origin, s)), a = await Ts(c);
|
5054
5060
|
t.ports[0].postMessage({
|
5055
5061
|
status: "done",
|
5056
5062
|
eventId: r,
|
@@ -5079,7 +5085,7 @@ class Be {
|
|
5079
5085
|
this.handlersMap[e] && t && this.handlersMap[e].delete(t), (!t || this.handlersMap[e].size === 0) && delete this.handlersMap[e], Object.keys(this.handlersMap).length === 0 && this.eventTarget.removeEventListener("message", this.boundEventHandler);
|
5080
5086
|
}
|
5081
5087
|
}
|
5082
|
-
|
5088
|
+
Fe.receivers = [];
|
5083
5089
|
/**
|
5084
5090
|
* @license
|
5085
5091
|
* Copyright 2020 Google LLC
|
@@ -5096,7 +5102,7 @@ Be.receivers = [];
|
|
5096
5102
|
* See the License for the specific language governing permissions and
|
5097
5103
|
* limitations under the License.
|
5098
5104
|
*/
|
5099
|
-
function
|
5105
|
+
function ht(n = "", e = 10) {
|
5100
5106
|
let t = "";
|
5101
5107
|
for (let r = 0; r < e; r++)
|
5102
5108
|
t += Math.floor(Math.random() * 10);
|
@@ -5118,7 +5124,7 @@ function ut(n = "", e = 10) {
|
|
5118
5124
|
* See the License for the specific language governing permissions and
|
5119
5125
|
* limitations under the License.
|
5120
5126
|
*/
|
5121
|
-
class
|
5127
|
+
class Ss {
|
5122
5128
|
constructor(e) {
|
5123
5129
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
5124
5130
|
}
|
@@ -5152,7 +5158,7 @@ class Es {
|
|
5152
5158
|
);
|
5153
5159
|
let s, o;
|
5154
5160
|
return new Promise((c, a) => {
|
5155
|
-
const u =
|
5161
|
+
const u = ht("", 20);
|
5156
5162
|
i.port1.start();
|
5157
5163
|
const y = setTimeout(() => {
|
5158
5164
|
a(new Error(
|
@@ -5163,9 +5169,9 @@ class Es {
|
|
5163
5169
|
o = {
|
5164
5170
|
messageChannel: i,
|
5165
5171
|
onMessage(b) {
|
5166
|
-
const
|
5167
|
-
if (
|
5168
|
-
switch (
|
5172
|
+
const A = b;
|
5173
|
+
if (A.data.eventId === u)
|
5174
|
+
switch (A.data.status) {
|
5169
5175
|
case "ack":
|
5170
5176
|
clearTimeout(y), s = setTimeout(
|
5171
5177
|
() => {
|
@@ -5179,7 +5185,7 @@ class Es {
|
|
5179
5185
|
);
|
5180
5186
|
break;
|
5181
5187
|
case "done":
|
5182
|
-
clearTimeout(s), c(
|
5188
|
+
clearTimeout(s), c(A.data.response);
|
5183
5189
|
break;
|
5184
5190
|
default:
|
5185
5191
|
clearTimeout(y), clearTimeout(s), a(new Error(
|
@@ -5218,7 +5224,7 @@ class Es {
|
|
5218
5224
|
function M() {
|
5219
5225
|
return window;
|
5220
5226
|
}
|
5221
|
-
function
|
5227
|
+
function As(n) {
|
5222
5228
|
M().location.href = n;
|
5223
5229
|
}
|
5224
5230
|
/**
|
@@ -5237,10 +5243,10 @@ function Ts(n) {
|
|
5237
5243
|
* See the License for the specific language governing permissions and
|
5238
5244
|
* limitations under the License.
|
5239
5245
|
*/
|
5240
|
-
function
|
5246
|
+
function Rn() {
|
5241
5247
|
return typeof M().WorkerGlobalScope < "u" && typeof M().importScripts == "function";
|
5242
5248
|
}
|
5243
|
-
async function
|
5249
|
+
async function Cs() {
|
5244
5250
|
if (!(navigator != null && navigator.serviceWorker))
|
5245
5251
|
return null;
|
5246
5252
|
try {
|
@@ -5249,12 +5255,12 @@ async function As() {
|
|
5249
5255
|
return null;
|
5250
5256
|
}
|
5251
5257
|
}
|
5252
|
-
function
|
5258
|
+
function Rs() {
|
5253
5259
|
var n;
|
5254
5260
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
5255
5261
|
}
|
5256
|
-
function
|
5257
|
-
return
|
5262
|
+
function Ps() {
|
5263
|
+
return Rn() ? self : null;
|
5258
5264
|
}
|
5259
5265
|
/**
|
5260
5266
|
* @license
|
@@ -5272,7 +5278,7 @@ function Cs() {
|
|
5272
5278
|
* See the License for the specific language governing permissions and
|
5273
5279
|
* limitations under the License.
|
5274
5280
|
*/
|
5275
|
-
const
|
5281
|
+
const Pn = "firebaseLocalStorageDb", Os = 1, $e = "firebaseLocalStorage", On = "fbase_key";
|
5276
5282
|
class Ee {
|
5277
5283
|
constructor(e) {
|
5278
5284
|
this.request = e;
|
@@ -5287,55 +5293,55 @@ class Ee {
|
|
5287
5293
|
});
|
5288
5294
|
}
|
5289
5295
|
}
|
5290
|
-
function
|
5296
|
+
function Ve(n, e) {
|
5291
5297
|
return n.transaction([$e], e ? "readwrite" : "readonly").objectStore($e);
|
5292
5298
|
}
|
5293
|
-
function
|
5294
|
-
const n = indexedDB.deleteDatabase(
|
5299
|
+
function ks() {
|
5300
|
+
const n = indexedDB.deleteDatabase(Pn);
|
5295
5301
|
return new Ee(n).toPromise();
|
5296
5302
|
}
|
5297
|
-
function
|
5298
|
-
const n = indexedDB.open(
|
5303
|
+
function nt() {
|
5304
|
+
const n = indexedDB.open(Pn, Os);
|
5299
5305
|
return new Promise((e, t) => {
|
5300
5306
|
n.addEventListener("error", () => {
|
5301
5307
|
t(n.error);
|
5302
5308
|
}), n.addEventListener("upgradeneeded", () => {
|
5303
5309
|
const r = n.result;
|
5304
5310
|
try {
|
5305
|
-
r.createObjectStore($e, { keyPath:
|
5311
|
+
r.createObjectStore($e, { keyPath: On });
|
5306
5312
|
} catch (i) {
|
5307
5313
|
t(i);
|
5308
5314
|
}
|
5309
5315
|
}), n.addEventListener("success", async () => {
|
5310
5316
|
const r = n.result;
|
5311
|
-
r.objectStoreNames.contains($e) ? e(r) : (r.close(), await
|
5317
|
+
r.objectStoreNames.contains($e) ? e(r) : (r.close(), await ks(), e(await nt()));
|
5312
5318
|
});
|
5313
5319
|
});
|
5314
5320
|
}
|
5315
|
-
async function
|
5316
|
-
const r =
|
5317
|
-
[
|
5321
|
+
async function Nt(n, e, t) {
|
5322
|
+
const r = Ve(n, !0).put({
|
5323
|
+
[On]: e,
|
5318
5324
|
value: t
|
5319
5325
|
});
|
5320
5326
|
return new Ee(r).toPromise();
|
5321
5327
|
}
|
5322
|
-
async function
|
5323
|
-
const t =
|
5328
|
+
async function Ns(n, e) {
|
5329
|
+
const t = Ve(n, !1).get(e), r = await new Ee(t).toPromise();
|
5324
5330
|
return r === void 0 ? null : r.value;
|
5325
5331
|
}
|
5326
|
-
function
|
5327
|
-
const t =
|
5332
|
+
function Dt(n, e) {
|
5333
|
+
const t = Ve(n, !0).delete(e);
|
5328
5334
|
return new Ee(t).toPromise();
|
5329
5335
|
}
|
5330
|
-
const
|
5331
|
-
class
|
5336
|
+
const Ds = 800, Ls = 3;
|
5337
|
+
class kn {
|
5332
5338
|
constructor() {
|
5333
5339
|
this.type = "LOCAL", this._shouldAllowMigration = !0, this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.pendingWrites = 0, this.receiver = null, this.sender = null, this.serviceWorkerReceiverAvailable = !1, this.activeServiceWorker = null, this._workerInitializationPromise = this.initializeServiceWorkerMessaging().then(() => {
|
5334
5340
|
}, () => {
|
5335
5341
|
});
|
5336
5342
|
}
|
5337
5343
|
async _openDb() {
|
5338
|
-
return this.db ? this.db : (this.db = await
|
5344
|
+
return this.db ? this.db : (this.db = await nt(), this.db);
|
5339
5345
|
}
|
5340
5346
|
async _withRetries(e) {
|
5341
5347
|
let t = 0;
|
@@ -5344,7 +5350,7 @@ class On {
|
|
5344
5350
|
const r = await this._openDb();
|
5345
5351
|
return await e(r);
|
5346
5352
|
} catch (r) {
|
5347
|
-
if (t++ >
|
5353
|
+
if (t++ > Ls)
|
5348
5354
|
throw r;
|
5349
5355
|
this.db && (this.db.close(), this.db = void 0);
|
5350
5356
|
}
|
@@ -5354,13 +5360,13 @@ class On {
|
|
5354
5360
|
* postMessage interface to send these events to the worker ourselves.
|
5355
5361
|
*/
|
5356
5362
|
async initializeServiceWorkerMessaging() {
|
5357
|
-
return
|
5363
|
+
return Rn() ? this.initializeReceiver() : this.initializeSender();
|
5358
5364
|
}
|
5359
5365
|
/**
|
5360
5366
|
* As the worker we should listen to events from the main window.
|
5361
5367
|
*/
|
5362
5368
|
async initializeReceiver() {
|
5363
|
-
this.receiver =
|
5369
|
+
this.receiver = Fe._getInstance(Ps()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
5364
5370
|
keyProcessed: (await this._poll()).includes(t.key)
|
5365
5371
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
5366
5372
|
"keyChanged"
|
@@ -5376,9 +5382,9 @@ class On {
|
|
5376
5382
|
*/
|
5377
5383
|
async initializeSender() {
|
5378
5384
|
var e, t;
|
5379
|
-
if (this.activeServiceWorker = await
|
5385
|
+
if (this.activeServiceWorker = await Cs(), !this.activeServiceWorker)
|
5380
5386
|
return;
|
5381
|
-
this.sender = new
|
5387
|
+
this.sender = new Ss(this.activeServiceWorker);
|
5382
5388
|
const r = await this.sender._send(
|
5383
5389
|
"ping",
|
5384
5390
|
{},
|
@@ -5400,7 +5406,7 @@ class On {
|
|
5400
5406
|
* @param key - Storage key which changed.
|
5401
5407
|
*/
|
5402
5408
|
async notifyServiceWorker(e) {
|
5403
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
5409
|
+
if (!(!this.sender || !this.activeServiceWorker || Rs() !== this.activeServiceWorker))
|
5404
5410
|
try {
|
5405
5411
|
await this.sender._send(
|
5406
5412
|
"keyChanged",
|
@@ -5416,8 +5422,8 @@ class On {
|
|
5416
5422
|
try {
|
5417
5423
|
if (!indexedDB)
|
5418
5424
|
return !1;
|
5419
|
-
const e = await
|
5420
|
-
return await
|
5425
|
+
const e = await nt();
|
5426
|
+
return await Nt(e, Le, "1"), await Dt(e, Le), !0;
|
5421
5427
|
} catch {
|
5422
5428
|
}
|
5423
5429
|
return !1;
|
@@ -5431,18 +5437,18 @@ class On {
|
|
5431
5437
|
}
|
5432
5438
|
}
|
5433
5439
|
async _set(e, t) {
|
5434
|
-
return this._withPendingWrite(async () => (await this._withRetries((r) =>
|
5440
|
+
return this._withPendingWrite(async () => (await this._withRetries((r) => Nt(r, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
5435
5441
|
}
|
5436
5442
|
async _get(e) {
|
5437
|
-
const t = await this._withRetries((r) =>
|
5443
|
+
const t = await this._withRetries((r) => Ns(r, e));
|
5438
5444
|
return this.localCache[e] = t, t;
|
5439
5445
|
}
|
5440
5446
|
async _remove(e) {
|
5441
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
5447
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => Dt(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
5442
5448
|
}
|
5443
5449
|
async _poll() {
|
5444
5450
|
const e = await this._withRetries((i) => {
|
5445
|
-
const s =
|
5451
|
+
const s = Ve(i, !1).getAll();
|
5446
5452
|
return new Ee(s).toPromise();
|
5447
5453
|
});
|
5448
5454
|
if (!e)
|
@@ -5465,7 +5471,7 @@ class On {
|
|
5465
5471
|
i(t);
|
5466
5472
|
}
|
5467
5473
|
startPolling() {
|
5468
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
5474
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Ds);
|
5469
5475
|
}
|
5470
5476
|
stopPolling() {
|
5471
5477
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
@@ -5477,8 +5483,8 @@ class On {
|
|
5477
5483
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
5478
5484
|
}
|
5479
5485
|
}
|
5480
|
-
|
5481
|
-
const
|
5486
|
+
kn.type = "LOCAL";
|
5487
|
+
const $s = kn;
|
5482
5488
|
new Ie(3e4, 6e4);
|
5483
5489
|
/**
|
5484
5490
|
* @license
|
@@ -5496,7 +5502,7 @@ new Ie(3e4, 6e4);
|
|
5496
5502
|
* See the License for the specific language governing permissions and
|
5497
5503
|
* limitations under the License.
|
5498
5504
|
*/
|
5499
|
-
function
|
5505
|
+
function Ms(n, e) {
|
5500
5506
|
return e ? B(e) : (_(
|
5501
5507
|
n._popupRedirectResolver,
|
5502
5508
|
n,
|
@@ -5520,7 +5526,7 @@ function Ls(n, e) {
|
|
5520
5526
|
* See the License for the specific language governing permissions and
|
5521
5527
|
* limitations under the License.
|
5522
5528
|
*/
|
5523
|
-
class
|
5529
|
+
class ft extends dt {
|
5524
5530
|
constructor(e) {
|
5525
5531
|
super(
|
5526
5532
|
"custom",
|
@@ -5550,26 +5556,26 @@ class ht extends lt {
|
|
5550
5556
|
return e && (t.idToken = e), t;
|
5551
5557
|
}
|
5552
5558
|
}
|
5553
|
-
function
|
5554
|
-
return
|
5559
|
+
function Us(n) {
|
5560
|
+
return En(n.auth, new ft(n), n.bypassAuthState);
|
5555
5561
|
}
|
5556
|
-
function
|
5562
|
+
function js(n) {
|
5557
5563
|
const { auth: e, user: t } = n;
|
5558
5564
|
return _(
|
5559
5565
|
t,
|
5560
5566
|
e,
|
5561
5567
|
"internal-error"
|
5562
5568
|
/* AuthErrorCode.INTERNAL_ERROR */
|
5563
|
-
),
|
5569
|
+
), ds(t, new ft(n), n.bypassAuthState);
|
5564
5570
|
}
|
5565
|
-
async function
|
5571
|
+
async function Bs(n) {
|
5566
5572
|
const { auth: e, user: t } = n;
|
5567
5573
|
return _(
|
5568
5574
|
t,
|
5569
5575
|
e,
|
5570
5576
|
"internal-error"
|
5571
5577
|
/* AuthErrorCode.INTERNAL_ERROR */
|
5572
|
-
),
|
5578
|
+
), ls(t, new ft(n), n.bypassAuthState);
|
5573
5579
|
}
|
5574
5580
|
/**
|
5575
5581
|
* @license
|
@@ -5587,7 +5593,7 @@ async function Us(n) {
|
|
5587
5593
|
* See the License for the specific language governing permissions and
|
5588
5594
|
* limitations under the License.
|
5589
5595
|
*/
|
5590
|
-
class
|
5596
|
+
class Nn {
|
5591
5597
|
constructor(e, t, r, i, s = !1) {
|
5592
5598
|
this.auth = e, this.resolver = r, this.user = i, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
5593
5599
|
}
|
@@ -5629,13 +5635,13 @@ class kn {
|
|
5629
5635
|
switch (e) {
|
5630
5636
|
case "signInViaPopup":
|
5631
5637
|
case "signInViaRedirect":
|
5632
|
-
return
|
5638
|
+
return Us;
|
5633
5639
|
case "linkViaPopup":
|
5634
5640
|
case "linkViaRedirect":
|
5635
|
-
return
|
5641
|
+
return Bs;
|
5636
5642
|
case "reauthViaPopup":
|
5637
5643
|
case "reauthViaRedirect":
|
5638
|
-
return
|
5644
|
+
return js;
|
5639
5645
|
default:
|
5640
5646
|
L(
|
5641
5647
|
this.auth,
|
@@ -5670,8 +5676,8 @@ class kn {
|
|
5670
5676
|
* See the License for the specific language governing permissions and
|
5671
5677
|
* limitations under the License.
|
5672
5678
|
*/
|
5673
|
-
const
|
5674
|
-
class re extends
|
5679
|
+
const Fs = new Ie(2e3, 1e4);
|
5680
|
+
class re extends Nn {
|
5675
5681
|
constructor(e, t, r, i, s) {
|
5676
5682
|
super(e, t, i, s), this.provider = r, this.authWindow = null, this.pollId = null, re.currentPopupAction && re.currentPopupAction.cancel(), re.currentPopupAction = this;
|
5677
5683
|
}
|
@@ -5686,7 +5692,7 @@ class re extends kn {
|
|
5686
5692
|
}
|
5687
5693
|
async onExecution() {
|
5688
5694
|
F(this.filter.length === 1, "Popup operations only handle one event");
|
5689
|
-
const e =
|
5695
|
+
const e = ht();
|
5690
5696
|
this.authWindow = await this.resolver._openPopup(
|
5691
5697
|
this.auth,
|
5692
5698
|
this.provider,
|
@@ -5734,7 +5740,7 @@ class re extends kn {
|
|
5734
5740
|
);
|
5735
5741
|
return;
|
5736
5742
|
}
|
5737
|
-
this.pollId = window.setTimeout(e,
|
5743
|
+
this.pollId = window.setTimeout(e, Fs.get());
|
5738
5744
|
};
|
5739
5745
|
e();
|
5740
5746
|
}
|
@@ -5756,8 +5762,8 @@ re.currentPopupAction = null;
|
|
5756
5762
|
* See the License for the specific language governing permissions and
|
5757
5763
|
* limitations under the License.
|
5758
5764
|
*/
|
5759
|
-
const
|
5760
|
-
class
|
5765
|
+
const Vs = "pendingRedirect", Ce = /* @__PURE__ */ new Map();
|
5766
|
+
class Hs extends Nn {
|
5761
5767
|
constructor(e, t, r = !1) {
|
5762
5768
|
super(e, [
|
5763
5769
|
"signInViaRedirect",
|
@@ -5775,7 +5781,7 @@ class Fs extends kn {
|
|
5775
5781
|
let e = Ce.get(this.auth._key());
|
5776
5782
|
if (!e) {
|
5777
5783
|
try {
|
5778
|
-
const r = await
|
5784
|
+
const r = await Ws(this.resolver, this.auth) ? await super.execute() : null;
|
5779
5785
|
e = () => Promise.resolve(r);
|
5780
5786
|
} catch (t) {
|
5781
5787
|
e = () => Promise.reject(t);
|
@@ -5803,24 +5809,24 @@ class Fs extends kn {
|
|
5803
5809
|
cleanUp() {
|
5804
5810
|
}
|
5805
5811
|
}
|
5806
|
-
async function
|
5807
|
-
const t =
|
5812
|
+
async function Ws(n, e) {
|
5813
|
+
const t = qs(e), r = zs(n);
|
5808
5814
|
if (!await r._isAvailable())
|
5809
5815
|
return !1;
|
5810
5816
|
const i = await r._get(t) === "true";
|
5811
5817
|
return await r._remove(t), i;
|
5812
5818
|
}
|
5813
|
-
function
|
5819
|
+
function xs(n, e) {
|
5814
5820
|
Ce.set(n._key(), e);
|
5815
5821
|
}
|
5816
|
-
function
|
5822
|
+
function zs(n) {
|
5817
5823
|
return B(n._redirectPersistence);
|
5818
5824
|
}
|
5819
|
-
function
|
5820
|
-
return
|
5825
|
+
function qs(n) {
|
5826
|
+
return Ae(Vs, n.config.apiKey, n.name);
|
5821
5827
|
}
|
5822
|
-
async function
|
5823
|
-
const r = ne(n), i =
|
5828
|
+
async function Js(n, e, t = !1) {
|
5829
|
+
const r = ne(n), i = Ms(r, e), o = await new Hs(r, i, t).execute();
|
5824
5830
|
return o && !t && (delete o.user._redirectEventId, await r._persistUserIfCurrent(o.user), await r._setRedirectUser(null, e)), o;
|
5825
5831
|
}
|
5826
5832
|
/**
|
@@ -5839,8 +5845,8 @@ async function zs(n, e, t = !1) {
|
|
5839
5845
|
* See the License for the specific language governing permissions and
|
5840
5846
|
* limitations under the License.
|
5841
5847
|
*/
|
5842
|
-
const
|
5843
|
-
class
|
5848
|
+
const Gs = 10 * 60 * 1e3;
|
5849
|
+
class Ks {
|
5844
5850
|
constructor(e) {
|
5845
5851
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
5846
5852
|
}
|
@@ -5856,11 +5862,11 @@ class Gs {
|
|
5856
5862
|
let t = !1;
|
5857
5863
|
return this.consumers.forEach((r) => {
|
5858
5864
|
this.isEventForConsumer(e, r) && (t = !0, this.sendToConsumer(e, r), this.saveEventToCache(e));
|
5859
|
-
}), this.hasHandledPotentialRedirect || !
|
5865
|
+
}), this.hasHandledPotentialRedirect || !Ys(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
5860
5866
|
}
|
5861
5867
|
sendToConsumer(e, t) {
|
5862
5868
|
var r;
|
5863
|
-
if (e.error && !
|
5869
|
+
if (e.error && !Dn(e)) {
|
5864
5870
|
const i = ((r = e.error.code) === null || r === void 0 ? void 0 : r.split("auth/")[1]) || "internal-error";
|
5865
5871
|
t.onError($(this.auth, i));
|
5866
5872
|
} else
|
@@ -5871,26 +5877,26 @@ class Gs {
|
|
5871
5877
|
return t.filter.includes(e.type) && r;
|
5872
5878
|
}
|
5873
5879
|
hasEventBeenHandled(e) {
|
5874
|
-
return Date.now() - this.lastProcessedEventTime >=
|
5880
|
+
return Date.now() - this.lastProcessedEventTime >= Gs && this.cachedEventUids.clear(), this.cachedEventUids.has(Lt(e));
|
5875
5881
|
}
|
5876
5882
|
saveEventToCache(e) {
|
5877
|
-
this.cachedEventUids.add(
|
5883
|
+
this.cachedEventUids.add(Lt(e)), this.lastProcessedEventTime = Date.now();
|
5878
5884
|
}
|
5879
5885
|
}
|
5880
|
-
function
|
5886
|
+
function Lt(n) {
|
5881
5887
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
5882
5888
|
}
|
5883
|
-
function
|
5889
|
+
function Dn({ type: n, error: e }) {
|
5884
5890
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
5885
5891
|
}
|
5886
|
-
function
|
5892
|
+
function Ys(n) {
|
5887
5893
|
switch (n.type) {
|
5888
5894
|
case "signInViaRedirect":
|
5889
5895
|
case "linkViaRedirect":
|
5890
5896
|
case "reauthViaRedirect":
|
5891
5897
|
return !0;
|
5892
5898
|
case "unknown":
|
5893
|
-
return
|
5899
|
+
return Dn(n);
|
5894
5900
|
default:
|
5895
5901
|
return !1;
|
5896
5902
|
}
|
@@ -5911,8 +5917,8 @@ function Js(n) {
|
|
5911
5917
|
* See the License for the specific language governing permissions and
|
5912
5918
|
* limitations under the License.
|
5913
5919
|
*/
|
5914
|
-
async function
|
5915
|
-
return
|
5920
|
+
async function Qs(n, e = {}) {
|
5921
|
+
return H(n, "GET", "/v1/projects", e);
|
5916
5922
|
}
|
5917
5923
|
/**
|
5918
5924
|
* @license
|
@@ -5930,14 +5936,14 @@ async function Ks(n, e = {}) {
|
|
5930
5936
|
* See the License for the specific language governing permissions and
|
5931
5937
|
* limitations under the License.
|
5932
5938
|
*/
|
5933
|
-
const
|
5934
|
-
async function
|
5939
|
+
const Xs = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Zs = /^https?/;
|
5940
|
+
async function eo(n) {
|
5935
5941
|
if (n.config.emulator)
|
5936
5942
|
return;
|
5937
|
-
const { authorizedDomains: e } = await
|
5943
|
+
const { authorizedDomains: e } = await Qs(n);
|
5938
5944
|
for (const t of e)
|
5939
5945
|
try {
|
5940
|
-
if (
|
5946
|
+
if (to(t))
|
5941
5947
|
return;
|
5942
5948
|
} catch {
|
5943
5949
|
}
|
@@ -5947,15 +5953,15 @@ async function Xs(n) {
|
|
5947
5953
|
/* AuthErrorCode.INVALID_ORIGIN */
|
5948
5954
|
);
|
5949
5955
|
}
|
5950
|
-
function
|
5951
|
-
const e =
|
5956
|
+
function to(n) {
|
5957
|
+
const e = et(), { protocol: t, hostname: r } = new URL(e);
|
5952
5958
|
if (n.startsWith("chrome-extension://")) {
|
5953
5959
|
const o = new URL(n);
|
5954
5960
|
return o.hostname === "" && r === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === r;
|
5955
5961
|
}
|
5956
|
-
if (!
|
5962
|
+
if (!Zs.test(t))
|
5957
5963
|
return !1;
|
5958
|
-
if (
|
5964
|
+
if (Xs.test(n))
|
5959
5965
|
return r === n;
|
5960
5966
|
const i = n.replace(/\./g, "\\.");
|
5961
5967
|
return new RegExp("^(.+\\." + i + "|" + i + ")$", "i").test(r);
|
@@ -5976,8 +5982,8 @@ function Zs(n) {
|
|
5976
5982
|
* See the License for the specific language governing permissions and
|
5977
5983
|
* limitations under the License.
|
5978
5984
|
*/
|
5979
|
-
const
|
5980
|
-
function
|
5985
|
+
const no = new Ie(3e4, 6e4);
|
5986
|
+
function $t() {
|
5981
5987
|
const n = M().___jsl;
|
5982
5988
|
if (n != null && n.H) {
|
5983
5989
|
for (const e of Object.keys(n.H))
|
@@ -5986,22 +5992,22 @@ function Lt() {
|
|
5986
5992
|
n.CP[t] = null;
|
5987
5993
|
}
|
5988
5994
|
}
|
5989
|
-
function
|
5995
|
+
function ro(n) {
|
5990
5996
|
return new Promise((e, t) => {
|
5991
5997
|
var r, i, s;
|
5992
5998
|
function o() {
|
5993
|
-
|
5999
|
+
$t(), gapi.load("gapi.iframes", {
|
5994
6000
|
callback: () => {
|
5995
6001
|
e(gapi.iframes.getContext());
|
5996
6002
|
},
|
5997
6003
|
ontimeout: () => {
|
5998
|
-
|
6004
|
+
$t(), t($(
|
5999
6005
|
n,
|
6000
6006
|
"network-request-failed"
|
6001
6007
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
6002
6008
|
));
|
6003
6009
|
},
|
6004
|
-
timeout:
|
6010
|
+
timeout: no.get()
|
6005
6011
|
});
|
6006
6012
|
}
|
6007
6013
|
if (!((i = (r = M().gapi) === null || r === void 0 ? void 0 : r.iframes) === null || i === void 0) && i.Iframe)
|
@@ -6009,22 +6015,22 @@ function to(n) {
|
|
6009
6015
|
else if (!((s = M().gapi) === null || s === void 0) && s.load)
|
6010
6016
|
o();
|
6011
6017
|
else {
|
6012
|
-
const c =
|
6018
|
+
const c = zi("iframefcb");
|
6013
6019
|
return M()[c] = () => {
|
6014
6020
|
gapi.load ? o() : t($(
|
6015
6021
|
n,
|
6016
6022
|
"network-request-failed"
|
6017
6023
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
6018
6024
|
));
|
6019
|
-
},
|
6025
|
+
}, vn(`${xi()}?onload=${c}`).catch((a) => t(a));
|
6020
6026
|
}
|
6021
6027
|
}).catch((e) => {
|
6022
6028
|
throw Re = null, e;
|
6023
6029
|
});
|
6024
6030
|
}
|
6025
6031
|
let Re = null;
|
6026
|
-
function
|
6027
|
-
return Re = Re ||
|
6032
|
+
function io(n) {
|
6033
|
+
return Re = Re || ro(n), Re;
|
6028
6034
|
}
|
6029
6035
|
/**
|
6030
6036
|
* @license
|
@@ -6042,7 +6048,7 @@ function no(n) {
|
|
6042
6048
|
* See the License for the specific language governing permissions and
|
6043
6049
|
* limitations under the License.
|
6044
6050
|
*/
|
6045
|
-
const
|
6051
|
+
const so = new Ie(5e3, 15e3), oo = "__/auth/iframe", ao = "emulator/auth/iframe", co = {
|
6046
6052
|
style: {
|
6047
6053
|
position: "absolute",
|
6048
6054
|
top: "-100px",
|
@@ -6051,13 +6057,13 @@ const ro = new Ie(5e3, 15e3), io = "__/auth/iframe", so = "emulator/auth/iframe"
|
|
6051
6057
|
},
|
6052
6058
|
"aria-hidden": "true",
|
6053
6059
|
tabindex: "-1"
|
6054
|
-
},
|
6060
|
+
}, lo = /* @__PURE__ */ new Map([
|
6055
6061
|
["identitytoolkit.googleapis.com", "p"],
|
6056
6062
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
6057
6063
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
6058
6064
|
// test
|
6059
6065
|
]);
|
6060
|
-
function
|
6066
|
+
function uo(n) {
|
6061
6067
|
const e = n.config;
|
6062
6068
|
_(
|
6063
6069
|
e.authDomain,
|
@@ -6065,17 +6071,17 @@ function co(n) {
|
|
6065
6071
|
"auth-domain-config-required"
|
6066
6072
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
6067
6073
|
);
|
6068
|
-
const t = e.emulator ?
|
6074
|
+
const t = e.emulator ? at(e, ao) : `https://${n.config.authDomain}/${oo}`, r = {
|
6069
6075
|
apiKey: e.apiKey,
|
6070
6076
|
appName: n.name,
|
6071
6077
|
v: be
|
6072
|
-
}, i =
|
6078
|
+
}, i = lo.get(n.config.apiHost);
|
6073
6079
|
i && (r.eid = i);
|
6074
6080
|
const s = n._getFrameworks();
|
6075
6081
|
return s.length && (r.fw = s.join(",")), `${t}?${ve(r).slice(1)}`;
|
6076
6082
|
}
|
6077
|
-
async function
|
6078
|
-
const e = await
|
6083
|
+
async function ho(n) {
|
6084
|
+
const e = await io(n), t = M().gapi;
|
6079
6085
|
return _(
|
6080
6086
|
t,
|
6081
6087
|
n,
|
@@ -6083,9 +6089,9 @@ async function lo(n) {
|
|
6083
6089
|
/* AuthErrorCode.INTERNAL_ERROR */
|
6084
6090
|
), e.open({
|
6085
6091
|
where: document.body,
|
6086
|
-
url:
|
6092
|
+
url: uo(n),
|
6087
6093
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
6088
|
-
attributes:
|
6094
|
+
attributes: co,
|
6089
6095
|
dontclear: !0
|
6090
6096
|
}, (r) => new Promise(async (i, s) => {
|
6091
6097
|
await r.restyle({
|
@@ -6098,7 +6104,7 @@ async function lo(n) {
|
|
6098
6104
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
6099
6105
|
), c = M().setTimeout(() => {
|
6100
6106
|
s(o);
|
6101
|
-
},
|
6107
|
+
}, so.get());
|
6102
6108
|
function a() {
|
6103
6109
|
M().clearTimeout(c), i(r);
|
6104
6110
|
}
|
@@ -6123,13 +6129,13 @@ async function lo(n) {
|
|
6123
6129
|
* See the License for the specific language governing permissions and
|
6124
6130
|
* limitations under the License.
|
6125
6131
|
*/
|
6126
|
-
const
|
6132
|
+
const fo = {
|
6127
6133
|
location: "yes",
|
6128
6134
|
resizable: "yes",
|
6129
6135
|
statusbar: "yes",
|
6130
6136
|
toolbar: "no"
|
6131
|
-
},
|
6132
|
-
class
|
6137
|
+
}, po = 500, go = 600, mo = "_blank", yo = "http://localhost";
|
6138
|
+
class Mt {
|
6133
6139
|
constructor(e) {
|
6134
6140
|
this.window = e, this.associatedEvent = null;
|
6135
6141
|
}
|
@@ -6141,19 +6147,19 @@ class $t {
|
|
6141
6147
|
}
|
6142
6148
|
}
|
6143
6149
|
}
|
6144
|
-
function
|
6150
|
+
function _o(n, e, t, r = po, i = go) {
|
6145
6151
|
const s = Math.max((window.screen.availHeight - i) / 2, 0).toString(), o = Math.max((window.screen.availWidth - r) / 2, 0).toString();
|
6146
6152
|
let c = "";
|
6147
|
-
const a = Object.assign(Object.assign({},
|
6153
|
+
const a = Object.assign(Object.assign({}, fo), {
|
6148
6154
|
width: r.toString(),
|
6149
6155
|
height: i.toString(),
|
6150
6156
|
top: s,
|
6151
6157
|
left: o
|
6152
6158
|
}), u = P().toLowerCase();
|
6153
|
-
t && (c =
|
6154
|
-
const y = Object.entries(a).reduce((
|
6155
|
-
if (
|
6156
|
-
return
|
6159
|
+
t && (c = hn(u) ? mo : t), un(u) && (e = e || yo, a.scrollbars = "yes");
|
6160
|
+
const y = Object.entries(a).reduce((A, [O, N]) => `${A}${O}=${N},`, "");
|
6161
|
+
if (Li(u) && c !== "_self")
|
6162
|
+
return vo(e || "", c), new Mt(null);
|
6157
6163
|
const b = window.open(e || "", c, y);
|
6158
6164
|
_(
|
6159
6165
|
b,
|
@@ -6165,9 +6171,9 @@ function mo(n, e, t, r = ho, i = fo) {
|
|
6165
6171
|
b.focus();
|
6166
6172
|
} catch {
|
6167
6173
|
}
|
6168
|
-
return new
|
6174
|
+
return new Mt(b);
|
6169
6175
|
}
|
6170
|
-
function
|
6176
|
+
function vo(n, e) {
|
6171
6177
|
const t = document.createElement("a");
|
6172
6178
|
t.href = n, t.target = e;
|
6173
6179
|
const r = document.createEvent("MouseEvent");
|
@@ -6189,8 +6195,8 @@ function yo(n, e) {
|
|
6189
6195
|
* See the License for the specific language governing permissions and
|
6190
6196
|
* limitations under the License.
|
6191
6197
|
*/
|
6192
|
-
const
|
6193
|
-
async function
|
6198
|
+
const bo = "__/auth/handler", Io = "emulator/auth/handler", wo = encodeURIComponent("fac");
|
6199
|
+
async function Ut(n, e, t, r, i, s) {
|
6194
6200
|
_(
|
6195
6201
|
n.config.authDomain,
|
6196
6202
|
n,
|
@@ -6210,8 +6216,8 @@ async function Mt(n, e, t, r, i, s) {
|
|
6210
6216
|
v: be,
|
6211
6217
|
eventId: i
|
6212
6218
|
};
|
6213
|
-
if (e instanceof
|
6214
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
6219
|
+
if (e instanceof In) {
|
6220
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", Zn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
6215
6221
|
for (const [y, b] of Object.entries(s || {}))
|
6216
6222
|
o[y] = b;
|
6217
6223
|
}
|
@@ -6223,11 +6229,11 @@ async function Mt(n, e, t, r, i, s) {
|
|
6223
6229
|
const c = o;
|
6224
6230
|
for (const y of Object.keys(c))
|
6225
6231
|
c[y] === void 0 && delete c[y];
|
6226
|
-
const a = await n._getAppCheckToken(), u = a ? `#${
|
6227
|
-
return `${
|
6232
|
+
const a = await n._getAppCheckToken(), u = a ? `#${wo}=${encodeURIComponent(a)}` : "";
|
6233
|
+
return `${Eo(n)}?${ve(c).slice(1)}${u}`;
|
6228
6234
|
}
|
6229
|
-
function
|
6230
|
-
return n.emulator ?
|
6235
|
+
function Eo({ config: n }) {
|
6236
|
+
return n.emulator ? at(n, Io) : `https://${n.authDomain}/${bo}`;
|
6231
6237
|
}
|
6232
6238
|
/**
|
6233
6239
|
* @license
|
@@ -6246,22 +6252,22 @@ function Io({ config: n }) {
|
|
6246
6252
|
* limitations under the License.
|
6247
6253
|
*/
|
6248
6254
|
const Ge = "webStorageSupport";
|
6249
|
-
class
|
6255
|
+
class To {
|
6250
6256
|
constructor() {
|
6251
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
6257
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Cn, this._completeRedirectFn = Js, this._overrideRedirectResult = xs;
|
6252
6258
|
}
|
6253
6259
|
// Wrapping in async even though we don't await anywhere in order
|
6254
6260
|
// to make sure errors are raised as promise rejections
|
6255
6261
|
async _openPopup(e, t, r, i) {
|
6256
6262
|
var s;
|
6257
6263
|
F((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
6258
|
-
const o = await
|
6259
|
-
return
|
6264
|
+
const o = await Ut(e, t, r, et(), i);
|
6265
|
+
return _o(e, o, ht());
|
6260
6266
|
}
|
6261
6267
|
async _openRedirect(e, t, r, i) {
|
6262
6268
|
await this._originValidation(e);
|
6263
|
-
const s = await
|
6264
|
-
return
|
6269
|
+
const s = await Ut(e, t, r, et(), i);
|
6270
|
+
return As(s), new Promise(() => {
|
6265
6271
|
});
|
6266
6272
|
}
|
6267
6273
|
_initialize(e) {
|
@@ -6276,7 +6282,7 @@ class wo {
|
|
6276
6282
|
}), r;
|
6277
6283
|
}
|
6278
6284
|
async initAndGetManager(e) {
|
6279
|
-
const t = await
|
6285
|
+
const t = await ho(e), r = new Ks(e);
|
6280
6286
|
return t.register("authEvent", (i) => (_(
|
6281
6287
|
i == null ? void 0 : i.authEvent,
|
6282
6288
|
e,
|
@@ -6300,14 +6306,14 @@ class wo {
|
|
6300
6306
|
}
|
6301
6307
|
_originValidation(e) {
|
6302
6308
|
const t = e._key();
|
6303
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
6309
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = eo(e)), this.originValidationPromises[t];
|
6304
6310
|
}
|
6305
6311
|
get _shouldInitProactively() {
|
6306
|
-
return
|
6312
|
+
return yn() || lt() || je();
|
6307
6313
|
}
|
6308
6314
|
}
|
6309
|
-
const
|
6310
|
-
var
|
6315
|
+
const So = To;
|
6316
|
+
var jt = "@firebase/auth", Bt = "1.6.0";
|
6311
6317
|
/**
|
6312
6318
|
* @license
|
6313
6319
|
* Copyright 2020 Google LLC
|
@@ -6324,7 +6330,7 @@ var Ut = "@firebase/auth", jt = "1.5.1";
|
|
6324
6330
|
* See the License for the specific language governing permissions and
|
6325
6331
|
* limitations under the License.
|
6326
6332
|
*/
|
6327
|
-
class
|
6333
|
+
class Ao {
|
6328
6334
|
constructor(e) {
|
6329
6335
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
6330
6336
|
}
|
@@ -6375,7 +6381,7 @@ class To {
|
|
6375
6381
|
* See the License for the specific language governing permissions and
|
6376
6382
|
* limitations under the License.
|
6377
6383
|
*/
|
6378
|
-
function
|
6384
|
+
function Co(n) {
|
6379
6385
|
switch (n) {
|
6380
6386
|
case "Node":
|
6381
6387
|
return "node";
|
@@ -6385,11 +6391,13 @@ function Ao(n) {
|
|
6385
6391
|
return "webworker";
|
6386
6392
|
case "Cordova":
|
6387
6393
|
return "cordova";
|
6394
|
+
case "WebExtension":
|
6395
|
+
return "web-extension";
|
6388
6396
|
default:
|
6389
6397
|
return;
|
6390
6398
|
}
|
6391
6399
|
}
|
6392
|
-
function
|
6400
|
+
function Ro(n) {
|
6393
6401
|
fe(new ae(
|
6394
6402
|
"auth",
|
6395
6403
|
(e, { options: t }) => {
|
@@ -6402,9 +6410,9 @@ function So(n) {
|
|
6402
6410
|
apiHost: "identitytoolkit.googleapis.com",
|
6403
6411
|
tokenApiHost: "securetoken.googleapis.com",
|
6404
6412
|
apiScheme: "https",
|
6405
|
-
sdkClientVersion:
|
6406
|
-
}, u = new
|
6407
|
-
return
|
6413
|
+
sdkClientVersion: _n(n)
|
6414
|
+
}, u = new Vi(r, i, s, a);
|
6415
|
+
return Yi(u, t), u;
|
6408
6416
|
},
|
6409
6417
|
"PUBLIC"
|
6410
6418
|
/* ComponentType.PUBLIC */
|
@@ -6423,14 +6431,14 @@ function So(n) {
|
|
6423
6431
|
"auth"
|
6424
6432
|
/* _ComponentName.AUTH */
|
6425
6433
|
).getImmediate());
|
6426
|
-
return ((r) => new
|
6434
|
+
return ((r) => new Ao(r))(t);
|
6427
6435
|
},
|
6428
6436
|
"PRIVATE"
|
6429
6437
|
/* ComponentType.PRIVATE */
|
6430
6438
|
).setInstantiationMode(
|
6431
6439
|
"EXPLICIT"
|
6432
6440
|
/* InstantiationMode.EXPLICIT */
|
6433
|
-
)), ie(
|
6441
|
+
)), ie(jt, Bt, Co(n)), ie(jt, Bt, "esm2017");
|
6434
6442
|
}
|
6435
6443
|
/**
|
6436
6444
|
* @license
|
@@ -6448,48 +6456,69 @@ function So(n) {
|
|
6448
6456
|
* See the License for the specific language governing permissions and
|
6449
6457
|
* limitations under the License.
|
6450
6458
|
*/
|
6451
|
-
const
|
6452
|
-
let
|
6453
|
-
const
|
6459
|
+
const Po = 5 * 60, Oo = Kt("authIdTokenMaxAge") || Po;
|
6460
|
+
let Ft = null;
|
6461
|
+
const ko = (n) => async (e) => {
|
6454
6462
|
const t = e && await e.getIdTokenResult(), r = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
6455
|
-
if (r && r >
|
6463
|
+
if (r && r > Oo)
|
6456
6464
|
return;
|
6457
6465
|
const i = t == null ? void 0 : t.token;
|
6458
|
-
|
6466
|
+
Ft !== i && (Ft = i, await fetch(n, {
|
6459
6467
|
method: i ? "POST" : "DELETE",
|
6460
6468
|
headers: i ? {
|
6461
6469
|
Authorization: `Bearer ${i}`
|
6462
6470
|
} : {}
|
6463
6471
|
}));
|
6464
6472
|
};
|
6465
|
-
function
|
6466
|
-
const e =
|
6473
|
+
function No(n = Zr()) {
|
6474
|
+
const e = Zt(n, "auth");
|
6467
6475
|
if (e.isInitialized())
|
6468
6476
|
return e.getImmediate();
|
6469
|
-
const t =
|
6470
|
-
popupRedirectResolver:
|
6477
|
+
const t = Ki(n, {
|
6478
|
+
popupRedirectResolver: So,
|
6471
6479
|
persistence: [
|
6472
|
-
|
6473
|
-
|
6474
|
-
|
6480
|
+
$s,
|
6481
|
+
Es,
|
6482
|
+
Cn
|
6475
6483
|
]
|
6476
|
-
}), r =
|
6484
|
+
}), r = Kt("authTokenSyncURL");
|
6477
6485
|
if (r) {
|
6478
|
-
const s =
|
6479
|
-
|
6486
|
+
const s = ko(r);
|
6487
|
+
ys(t, s, () => s(t.currentUser)), ms(t, (o) => s(o));
|
6480
6488
|
}
|
6481
6489
|
const i = Hn("auth");
|
6482
|
-
return i &&
|
6490
|
+
return i && Qi(t, `http://${i}`), t;
|
6491
|
+
}
|
6492
|
+
function Do() {
|
6493
|
+
var n, e;
|
6494
|
+
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
6483
6495
|
}
|
6484
|
-
|
6496
|
+
Hi({
|
6497
|
+
loadJS(n) {
|
6498
|
+
return new Promise((e, t) => {
|
6499
|
+
const r = document.createElement("script");
|
6500
|
+
r.setAttribute("src", n), r.onload = e, r.onerror = (i) => {
|
6501
|
+
const s = $(
|
6502
|
+
"internal-error"
|
6503
|
+
/* AuthErrorCode.INTERNAL_ERROR */
|
6504
|
+
);
|
6505
|
+
s.customData = i, t(s);
|
6506
|
+
}, r.type = "text/javascript", r.charset = "UTF-8", Do().appendChild(r);
|
6507
|
+
});
|
6508
|
+
},
|
6509
|
+
gapiScript: "https://apis.google.com/js/api.js",
|
6510
|
+
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
6511
|
+
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
6512
|
+
});
|
6513
|
+
Ro(
|
6485
6514
|
"Browser"
|
6486
6515
|
/* ClientPlatform.BROWSER */
|
6487
6516
|
);
|
6488
|
-
var
|
6489
|
-
function
|
6517
|
+
var Lo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
6518
|
+
function $o(n) {
|
6490
6519
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
6491
6520
|
}
|
6492
|
-
var
|
6521
|
+
var Ln = { exports: {} };
|
6493
6522
|
(function(n) {
|
6494
6523
|
(function(e) {
|
6495
6524
|
function t(l, m) {
|
@@ -6499,26 +6528,26 @@ var Dn = { exports: {} };
|
|
6499
6528
|
function r(l, m) {
|
6500
6529
|
return l << m | l >>> 32 - m;
|
6501
6530
|
}
|
6502
|
-
function i(l, m, d, w, E,
|
6503
|
-
return t(r(t(t(m, l), t(w,
|
6531
|
+
function i(l, m, d, w, E, S) {
|
6532
|
+
return t(r(t(t(m, l), t(w, S)), E), d);
|
6504
6533
|
}
|
6505
|
-
function s(l, m, d, w, E,
|
6506
|
-
return i(m & d | ~m & w, l, m, E,
|
6534
|
+
function s(l, m, d, w, E, S, R) {
|
6535
|
+
return i(m & d | ~m & w, l, m, E, S, R);
|
6507
6536
|
}
|
6508
|
-
function o(l, m, d, w, E,
|
6509
|
-
return i(m & w | d & ~w, l, m, E,
|
6537
|
+
function o(l, m, d, w, E, S, R) {
|
6538
|
+
return i(m & w | d & ~w, l, m, E, S, R);
|
6510
6539
|
}
|
6511
|
-
function c(l, m, d, w, E,
|
6512
|
-
return i(m ^ d ^ w, l, m, E,
|
6540
|
+
function c(l, m, d, w, E, S, R) {
|
6541
|
+
return i(m ^ d ^ w, l, m, E, S, R);
|
6513
6542
|
}
|
6514
|
-
function a(l, m, d, w, E,
|
6515
|
-
return i(d ^ (m | ~w), l, m, E,
|
6543
|
+
function a(l, m, d, w, E, S, R) {
|
6544
|
+
return i(d ^ (m | ~w), l, m, E, S, R);
|
6516
6545
|
}
|
6517
6546
|
function u(l, m) {
|
6518
6547
|
l[m >> 5] |= 128 << m % 32, l[(m + 64 >>> 9 << 4) + 14] = m;
|
6519
|
-
var d, w, E,
|
6548
|
+
var d, w, E, S, R, h = 1732584193, f = -271733879, p = -1732584194, g = 271733878;
|
6520
6549
|
for (d = 0; d < l.length; d += 16)
|
6521
|
-
w = h, E = f,
|
6550
|
+
w = h, E = f, S = p, R = g, h = s(h, f, p, g, l[d], 7, -680876936), g = s(g, h, f, p, l[d + 1], 12, -389564586), p = s(p, g, h, f, l[d + 2], 17, 606105819), f = s(f, p, g, h, l[d + 3], 22, -1044525330), h = s(h, f, p, g, l[d + 4], 7, -176418897), g = s(g, h, f, p, l[d + 5], 12, 1200080426), p = s(p, g, h, f, l[d + 6], 17, -1473231341), f = s(f, p, g, h, l[d + 7], 22, -45705983), h = s(h, f, p, g, l[d + 8], 7, 1770035416), g = s(g, h, f, p, l[d + 9], 12, -1958414417), p = s(p, g, h, f, l[d + 10], 17, -42063), f = s(f, p, g, h, l[d + 11], 22, -1990404162), h = s(h, f, p, g, l[d + 12], 7, 1804603682), g = s(g, h, f, p, l[d + 13], 12, -40341101), p = s(p, g, h, f, l[d + 14], 17, -1502002290), f = s(f, p, g, h, l[d + 15], 22, 1236535329), h = o(h, f, p, g, l[d + 1], 5, -165796510), g = o(g, h, f, p, l[d + 6], 9, -1069501632), p = o(p, g, h, f, l[d + 11], 14, 643717713), f = o(f, p, g, h, l[d], 20, -373897302), h = o(h, f, p, g, l[d + 5], 5, -701558691), g = o(g, h, f, p, l[d + 10], 9, 38016083), p = o(p, g, h, f, l[d + 15], 14, -660478335), f = o(f, p, g, h, l[d + 4], 20, -405537848), h = o(h, f, p, g, l[d + 9], 5, 568446438), g = o(g, h, f, p, l[d + 14], 9, -1019803690), p = o(p, g, h, f, l[d + 3], 14, -187363961), f = o(f, p, g, h, l[d + 8], 20, 1163531501), h = o(h, f, p, g, l[d + 13], 5, -1444681467), g = o(g, h, f, p, l[d + 2], 9, -51403784), p = o(p, g, h, f, l[d + 7], 14, 1735328473), f = o(f, p, g, h, l[d + 12], 20, -1926607734), h = c(h, f, p, g, l[d + 5], 4, -378558), g = c(g, h, f, p, l[d + 8], 11, -2022574463), p = c(p, g, h, f, l[d + 11], 16, 1839030562), f = c(f, p, g, h, l[d + 14], 23, -35309556), h = c(h, f, p, g, l[d + 1], 4, -1530992060), g = c(g, h, f, p, l[d + 4], 11, 1272893353), p = c(p, g, h, f, l[d + 7], 16, -155497632), f = c(f, p, g, h, l[d + 10], 23, -1094730640), h = c(h, f, p, g, l[d + 13], 4, 681279174), g = c(g, h, f, p, l[d], 11, -358537222), p = c(p, g, h, f, l[d + 3], 16, -722521979), f = c(f, p, g, h, l[d + 6], 23, 76029189), h = c(h, f, p, g, l[d + 9], 4, -640364487), g = c(g, h, f, p, l[d + 12], 11, -421815835), p = c(p, g, h, f, l[d + 15], 16, 530742520), f = c(f, p, g, h, l[d + 2], 23, -995338651), h = a(h, f, p, g, l[d], 6, -198630844), g = a(g, h, f, p, l[d + 7], 10, 1126891415), p = a(p, g, h, f, l[d + 14], 15, -1416354905), f = a(f, p, g, h, l[d + 5], 21, -57434055), h = a(h, f, p, g, l[d + 12], 6, 1700485571), g = a(g, h, f, p, l[d + 3], 10, -1894986606), p = a(p, g, h, f, l[d + 10], 15, -1051523), f = a(f, p, g, h, l[d + 1], 21, -2054922799), h = a(h, f, p, g, l[d + 8], 6, 1873313359), g = a(g, h, f, p, l[d + 15], 10, -30611744), p = a(p, g, h, f, l[d + 6], 15, -1560198380), f = a(f, p, g, h, l[d + 13], 21, 1309151649), h = a(h, f, p, g, l[d + 4], 6, -145523070), g = a(g, h, f, p, l[d + 11], 10, -1120210379), p = a(p, g, h, f, l[d + 2], 15, 718787259), f = a(f, p, g, h, l[d + 9], 21, -343485551), h = t(h, w), f = t(f, E), p = t(p, S), g = t(g, R);
|
6522
6551
|
return [h, f, p, g];
|
6523
6552
|
}
|
6524
6553
|
function y(l) {
|
@@ -6536,14 +6565,14 @@ var Dn = { exports: {} };
|
|
6536
6565
|
d[m >> 5] |= (l.charCodeAt(m / 8) & 255) << m % 32;
|
6537
6566
|
return d;
|
6538
6567
|
}
|
6539
|
-
function
|
6568
|
+
function A(l) {
|
6540
6569
|
return y(u(b(l), l.length * 8));
|
6541
6570
|
}
|
6542
6571
|
function O(l, m) {
|
6543
|
-
var d, w = b(l), E = [],
|
6544
|
-
for (E[15] =
|
6545
|
-
E[d] = w[d] ^ 909522486,
|
6546
|
-
return R = u(E.concat(b(m)), 512 + m.length * 8), y(u(
|
6572
|
+
var d, w = b(l), E = [], S = [], R;
|
6573
|
+
for (E[15] = S[15] = void 0, w.length > 16 && (w = u(w, l.length * 8)), d = 0; d < 16; d += 1)
|
6574
|
+
E[d] = w[d] ^ 909522486, S[d] = w[d] ^ 1549556828;
|
6575
|
+
return R = u(E.concat(b(m)), 512 + m.length * 8), y(u(S.concat(R), 640));
|
6547
6576
|
}
|
6548
6577
|
function N(l) {
|
6549
6578
|
var m = "0123456789abcdef", d = "", w, E;
|
@@ -6555,7 +6584,7 @@ var Dn = { exports: {} };
|
|
6555
6584
|
return unescape(encodeURIComponent(l));
|
6556
6585
|
}
|
6557
6586
|
function I(l) {
|
6558
|
-
return
|
6587
|
+
return A(v(l));
|
6559
6588
|
}
|
6560
6589
|
function k(l) {
|
6561
6590
|
return N(I(l));
|
@@ -6570,10 +6599,10 @@ var Dn = { exports: {} };
|
|
6570
6599
|
return m ? d ? C(m, l) : U(m, l) : d ? I(l) : k(l);
|
6571
6600
|
}
|
6572
6601
|
n.exports ? n.exports = D : e.md5 = D;
|
6573
|
-
})(
|
6574
|
-
})(
|
6575
|
-
var
|
6576
|
-
const
|
6602
|
+
})(Lo);
|
6603
|
+
})(Ln);
|
6604
|
+
var Mo = Ln.exports;
|
6605
|
+
const Uo = /* @__PURE__ */ $o(Mo), pt = (n, e) => async (t, r = {}) => {
|
6577
6606
|
const i = e ? await e.getIdToken() : null, s = await fetch(`${n}${t}`, {
|
6578
6607
|
mode: "cors",
|
6579
6608
|
...r,
|
@@ -6591,7 +6620,7 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6591
6620
|
body: o
|
6592
6621
|
});
|
6593
6622
|
return o;
|
6594
|
-
},
|
6623
|
+
}, jo = (n) => {
|
6595
6624
|
const e = n.properties || {}, t = n.inputProps || Object.keys(e), r = (i, s) => {
|
6596
6625
|
const o = e[i] || {};
|
6597
6626
|
if ([null, void 0].includes(s))
|
@@ -6628,13 +6657,13 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6628
6657
|
),
|
6629
6658
|
validateAttr: r
|
6630
6659
|
};
|
6631
|
-
},
|
6660
|
+
}, Bo = (n = {}) => Object.keys(n).length ? `?q=${JSON.stringify(n)}` : "", Fo = (n) => [...n].reduce(
|
6632
6661
|
(e, t) => t === t.toUpperCase() ? `${e}-${t.toLowerCase()}` : `${e}${t}`,
|
6633
6662
|
""
|
6634
|
-
),
|
6635
|
-
const e =
|
6636
|
-
return (t, r) => `/${e}${t ? `/${encodeURIComponent(t)}` : ""}${
|
6637
|
-
},
|
6663
|
+
), Vo = (n) => `${n[0].toLowerCase()}${n.slice(1)}`, Ho = (n) => {
|
6664
|
+
const e = Fo(n);
|
6665
|
+
return (t, r) => `/${e}${t ? `/${encodeURIComponent(t)}` : ""}${Bo(r)}`;
|
6666
|
+
}, Vt = (n, e) => {
|
6638
6667
|
const t = Array.isArray(e.inputProps);
|
6639
6668
|
return Object.keys(n).reduce(
|
6640
6669
|
(r, i) => {
|
@@ -6648,12 +6677,12 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6648
6677
|
},
|
6649
6678
|
{}
|
6650
6679
|
);
|
6651
|
-
},
|
6680
|
+
}, Wo = ({ primaryKey: n, properties: e, ...t }) => ({
|
6652
6681
|
primaryKey: n || "id",
|
6653
6682
|
properties: Object.keys(e || {}).reduce(
|
6654
6683
|
(r, i) => {
|
6655
|
-
var b,
|
6656
|
-
const s = e[i] || {}, { type: o, isScalar: c, isRequired: a, isRef: u = !1 } = typeof s.type == "string" ? s.type === "array" ? s.enum ? { type: "string", isScalar: !1, isRequired: !1 } : (b = s.items) != null && b.$ref ? { type: s.items.$ref.split("/").pop(), isScalar: !1, isRequired: !1, isRef: !0 } : { type: (
|
6684
|
+
var b, A;
|
6685
|
+
const s = e[i] || {}, { type: o, isScalar: c, isRequired: a, isRef: u = !1 } = typeof s.type == "string" ? s.type === "array" ? s.enum ? { type: "string", isScalar: !1, isRequired: !1 } : (b = s.items) != null && b.$ref ? { type: s.items.$ref.split("/").pop(), isScalar: !1, isRequired: !1, isRef: !0 } : { type: (A = s.items) == null ? void 0 : A.type, isScalar: !1, isRequired: !1 } : { type: s.format === "date-time" ? "date" : s.type, isScalar: !0, isRequired: !0 } : Array.isArray(s.type) ? s.type.length === 2 ? { type: s.format === "date-time" ? "date" : s.type[0], isScalar: !0, isRequired: !1 } : { type: "json", isScalar: !0, isRequired: s.type.includes("null") } : s.$ref ? { type: s.$ref.split("/").pop(), isScalar: !0, isRequired: !0, isRef: !0 } : { type: s.anyOf[0].$ref.split("/").pop(), isScalar: !0, isRequired: !1, isRef: !0 }, y = s.inputType || (o === "integer" ? "number" : o);
|
6657
6686
|
return {
|
6658
6687
|
...r,
|
6659
6688
|
[i]: {
|
@@ -6669,15 +6698,15 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6669
6698
|
{}
|
6670
6699
|
),
|
6671
6700
|
...t
|
6672
|
-
}),
|
6673
|
-
const s =
|
6701
|
+
}), xo = (n, e, t, r = {}, i = {}) => {
|
6702
|
+
const s = Wo(r), { primaryKey: o, properties: c } = s, a = jo(s), u = Ho(t), y = (...v) => pt(n, e.authUser)(...v), b = ({ data: v, ...I }) => y(u(null, I), {
|
6674
6703
|
method: "POST",
|
6675
|
-
body:
|
6676
|
-
}),
|
6704
|
+
body: Vt(v, s)
|
6705
|
+
}), A = ({ data: v, ...I }) => {
|
6677
6706
|
const { where: k, ...C } = I;
|
6678
6707
|
return y(u(k[o], C), {
|
6679
6708
|
method: "PUT",
|
6680
|
-
body:
|
6709
|
+
body: Vt(v, s)
|
6681
6710
|
});
|
6682
6711
|
}, O = (v) => {
|
6683
6712
|
if (!v)
|
@@ -6687,13 +6716,13 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6687
6716
|
var E;
|
6688
6717
|
const U = c[C] || {}, { type: D, isScalar: l, isRef: m, format: d, items: w } = U;
|
6689
6718
|
if (m) {
|
6690
|
-
const
|
6719
|
+
const S = Vo(D);
|
6691
6720
|
return l ? {
|
6692
6721
|
...k,
|
6693
|
-
[C]: i[
|
6722
|
+
[C]: i[S].parse(v[C])
|
6694
6723
|
} : {
|
6695
6724
|
...k,
|
6696
|
-
[C]: typeof ((E = i[
|
6725
|
+
[C]: typeof ((E = i[S]) == null ? void 0 : E.parse) == "function" ? v[C].map((R) => i[S].parse(R)) : v[C]
|
6697
6726
|
};
|
6698
6727
|
}
|
6699
6728
|
return {
|
@@ -6738,8 +6767,8 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6738
6767
|
findMany: (v) => y(u(null, v)).then((I) => I.map(O)),
|
6739
6768
|
findById: (v, I) => y(u(v, I)).then(O),
|
6740
6769
|
create: b,
|
6741
|
-
update:
|
6742
|
-
upsert: (v) => v.where[o] ?
|
6770
|
+
update: A,
|
6771
|
+
upsert: (v) => v.where[o] ? A({ where: v.where, data: v.update }) : b({ data: v.create }),
|
6743
6772
|
delete: (v) => y(u(v), { method: "DELETE" }),
|
6744
6773
|
stats: () => y(u("_stats")),
|
6745
6774
|
search: (v, I = {}) => {
|
@@ -6749,10 +6778,10 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6749
6778
|
...w,
|
6750
6779
|
{
|
6751
6780
|
OR: k.reduce(
|
6752
|
-
(
|
6781
|
+
(S, R) => {
|
6753
6782
|
const h = R.split(".");
|
6754
6783
|
return [
|
6755
|
-
...
|
6784
|
+
...S,
|
6756
6785
|
h.reduceRight(
|
6757
6786
|
(f, p) => ({ [p]: f }),
|
6758
6787
|
{ contains: E, mode: "insensitive" }
|
@@ -6776,11 +6805,11 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6776
6805
|
}));
|
6777
6806
|
}
|
6778
6807
|
};
|
6779
|
-
},
|
6808
|
+
}, zo = (n, e, t) => Object.keys(t.properties).reduce(
|
6780
6809
|
(r, i) => {
|
6781
6810
|
const s = t.properties[i].$ref.split("/").pop();
|
6782
6811
|
return Object.assign(r, {
|
6783
|
-
[i]:
|
6812
|
+
[i]: xo(
|
6784
6813
|
n,
|
6785
6814
|
e,
|
6786
6815
|
t.definitions[s].plural || `${i}s`,
|
@@ -6790,7 +6819,7 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6790
6819
|
});
|
6791
6820
|
},
|
6792
6821
|
{}
|
6793
|
-
),
|
6822
|
+
), qo = (n, e) => Object.keys(n.definitions).reduce(
|
6794
6823
|
(t, r) => ({
|
6795
6824
|
...t,
|
6796
6825
|
[r]: e[r] ? {
|
@@ -6809,7 +6838,7 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
6809
6838
|
} : n.definitions[r]
|
6810
6839
|
}),
|
6811
6840
|
{}
|
6812
|
-
),
|
6841
|
+
), Jo = "http://json-schema.org/draft-07/schema#", Go = {
|
6813
6842
|
Country: {
|
6814
6843
|
type: "object",
|
6815
6844
|
properties: {
|
@@ -7130,12 +7159,6 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
7130
7159
|
items: {
|
7131
7160
|
$ref: "#/definitions/JobApplication"
|
7132
7161
|
}
|
7133
|
-
},
|
7134
|
-
studentProjecTeamMembers: {
|
7135
|
-
type: "array",
|
7136
|
-
items: {
|
7137
|
-
$ref: "#/definitions/StudentProjecTeamMember"
|
7138
|
-
}
|
7139
7162
|
}
|
7140
7163
|
}
|
7141
7164
|
},
|
@@ -7420,12 +7443,6 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
7420
7443
|
items: {
|
7421
7444
|
$ref: "#/definitions/JobApplication"
|
7422
7445
|
}
|
7423
|
-
},
|
7424
|
-
studentProjects: {
|
7425
|
-
type: "array",
|
7426
|
-
items: {
|
7427
|
-
$ref: "#/definitions/StudentProject"
|
7428
|
-
}
|
7429
7446
|
}
|
7430
7447
|
}
|
7431
7448
|
},
|
@@ -7460,6 +7477,12 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
7460
7477
|
},
|
7461
7478
|
user: {
|
7462
7479
|
$ref: "#/definitions/User"
|
7480
|
+
},
|
7481
|
+
projecTeamMembers: {
|
7482
|
+
type: "array",
|
7483
|
+
items: {
|
7484
|
+
$ref: "#/definitions/StudentProjecTeamMember"
|
7485
|
+
}
|
7463
7486
|
}
|
7464
7487
|
}
|
7465
7488
|
},
|
@@ -8069,9 +8092,6 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
8069
8092
|
projectVersion: {
|
8070
8093
|
type: "string"
|
8071
8094
|
},
|
8072
|
-
cohort: {
|
8073
|
-
$ref: "#/definitions/Cohort"
|
8074
|
-
},
|
8075
8095
|
links: {
|
8076
8096
|
type: "array",
|
8077
8097
|
items: {
|
@@ -8106,8 +8126,8 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
8106
8126
|
studentProject: {
|
8107
8127
|
$ref: "#/definitions/StudentProject"
|
8108
8128
|
},
|
8109
|
-
|
8110
|
-
$ref: "#/definitions/
|
8129
|
+
student: {
|
8130
|
+
$ref: "#/definitions/Student"
|
8111
8131
|
}
|
8112
8132
|
}
|
8113
8133
|
},
|
@@ -9035,7 +9055,7 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
9035
9055
|
}
|
9036
9056
|
}
|
9037
9057
|
}
|
9038
|
-
},
|
9058
|
+
}, Ko = "object", Yo = {
|
9039
9059
|
country: {
|
9040
9060
|
$ref: "#/definitions/Country"
|
9041
9061
|
},
|
@@ -9145,15 +9165,16 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
9145
9165
|
$ref: "#/definitions/JobCrawlerLocation"
|
9146
9166
|
}
|
9147
9167
|
}, Ht = {
|
9148
|
-
$schema:
|
9149
|
-
definitions:
|
9150
|
-
type:
|
9151
|
-
properties:
|
9152
|
-
},
|
9168
|
+
$schema: Jo,
|
9169
|
+
definitions: Go,
|
9170
|
+
type: Ko,
|
9171
|
+
properties: Yo
|
9172
|
+
}, Qo = 60 * 60 * 1e3, Wt = 24 * Qo, Xo = {
|
9153
9173
|
Country: {
|
9154
9174
|
primaryKey: "code",
|
9155
9175
|
plural: "countries",
|
9156
9176
|
searchProps: ["code", "name", "timeZone"],
|
9177
|
+
defaultProps: ["code", "name", "timeZone", "currency"],
|
9157
9178
|
getOptionLabel: ({ code: n, name: e }) => `${n} / ${e}`
|
9158
9179
|
},
|
9159
9180
|
ActivityLogEntry: {
|
@@ -9197,7 +9218,7 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
9197
9218
|
}
|
9198
9219
|
},
|
9199
9220
|
parse: (n) => {
|
9200
|
-
const e = n.github ? `https://github.com/${n.github}.png?size=` : `https://www.gravatar.com/avatar/${
|
9221
|
+
const e = n.github ? `https://github.com/${n.github}.png?size=` : `https://www.gravatar.com/avatar/${Uo(n.email)}?s=`;
|
9201
9222
|
return {
|
9202
9223
|
...n,
|
9203
9224
|
fullName: `${n.firstName || ""}${n.lastName ? ` ${n.lastName}` : ""}`,
|
@@ -9261,7 +9282,7 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
9261
9282
|
) < e ? t = "placement_ended" : n.placementStart < e && (t = "placement_started");
|
9262
9283
|
}
|
9263
9284
|
!t && n.end < e && (t = "ended"), !t && n.start < e && (t = "started");
|
9264
|
-
const r = n.admissionEnd ? +n.admissionEnd +
|
9285
|
+
const r = n.admissionEnd ? +n.admissionEnd + Wt : !1;
|
9265
9286
|
!t && r && r < e && (t = "admission_ended"), !t && n.admissionStart && n.admissionStart < e && (t = "admission_started"), !t && n.admissionStart && n.admissionEnd && (t = "planned"), t || (t = "draft");
|
9266
9287
|
const i = n.start > e && n.vacancies ? n.vacancies : ((s = n._count) == null ? void 0 : s.students) || ((o = n.students) == null ? void 0 : o.length) || 0;
|
9267
9288
|
return {
|
@@ -9407,7 +9428,7 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
9407
9428
|
return n;
|
9408
9429
|
const t = Date.now();
|
9409
9430
|
let r;
|
9410
|
-
return n.isReady ? r = "ready" : e && !n.bypassFilters ? r = "rejected" : n.createdAt < t - 90 *
|
9431
|
+
return n.isReady ? r = "ready" : e && !n.bypassFilters ? r = "rejected" : n.createdAt < t - 90 * Wt ? r = "expired" : ((o = n.cohort) == null ? void 0 : o.status) !== "admission_started" ? r = "admission_ended" : r = "active", {
|
9411
9432
|
...n,
|
9412
9433
|
status: r
|
9413
9434
|
};
|
@@ -9441,16 +9462,16 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
9441
9462
|
JobCrawlerQuery: {
|
9442
9463
|
plural: "jobCrawlerQueries"
|
9443
9464
|
}
|
9444
|
-
},
|
9445
|
-
...
|
9465
|
+
}, Zo = (n, e) => ({
|
9466
|
+
...zo(n, e, {
|
9446
9467
|
...Ht,
|
9447
|
-
definitions:
|
9468
|
+
definitions: qo(Ht, Xo)
|
9448
9469
|
}),
|
9449
9470
|
gcpLog: {
|
9450
|
-
getEntries: async (t) => await
|
9471
|
+
getEntries: async (t) => await pt(n, e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)
|
9451
9472
|
}
|
9452
|
-
}),
|
9453
|
-
const t =
|
9473
|
+
}), ea = (n, e) => {
|
9474
|
+
const t = pt(n, e.authUser);
|
9454
9475
|
return {
|
9455
9476
|
project: {
|
9456
9477
|
findMany: (r = {}) => t(`/projects?q=${JSON.stringify(r)}`),
|
@@ -9464,49 +9485,49 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
9464
9485
|
findMany: (r = {}) => t(`/learning-objectives?q=${JSON.stringify(r)}`)
|
9465
9486
|
}
|
9466
9487
|
};
|
9467
|
-
}, Me = (n) => n > 9 ? `${n}` : `0${n}`,
|
9488
|
+
}, Me = (n) => n > 9 ? `${n}` : `0${n}`, ta = (n) => `${Me(n.getUTCDate())}/${Me(n.getUTCMonth() + 1)}/${n.getUTCFullYear()}`, na = (n) => `${Me(n.getUTCHours())}:${Me(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`, sa = (n) => `${ta(n)} ${na(n)}`, ra = {
|
9468
9489
|
es: "es-ES",
|
9469
9490
|
pt: "pt-BR"
|
9470
|
-
},
|
9491
|
+
}, oa = (n, e = "es", t = !1) => new Intl.DateTimeFormat(ra[e], {
|
9471
9492
|
...t && {
|
9472
9493
|
year: "numeric"
|
9473
9494
|
},
|
9474
9495
|
month: "long",
|
9475
9496
|
day: "numeric",
|
9476
9497
|
timeZone: "UTC"
|
9477
|
-
}).format(new Date(n)),
|
9498
|
+
}).format(new Date(n)), aa = (n, e) => {
|
9478
9499
|
let t = e.getFullYear() - n.getFullYear();
|
9479
9500
|
const r = e.getMonth() - n.getMonth();
|
9480
9501
|
return (r < 0 || r === 0 && e.getDate() < n.getDate()) && t--, t;
|
9481
|
-
},
|
9502
|
+
}, ia = (n, e, t) => new Intl.NumberFormat(
|
9482
9503
|
`${n}-${e}`,
|
9483
9504
|
{ currency: t }
|
9484
|
-
),
|
9505
|
+
), ca = (n, e, t, r) => ia(
|
9485
9506
|
e,
|
9486
9507
|
t,
|
9487
9508
|
r
|
9488
|
-
).format(n),
|
9509
|
+
).format(n), la = (n) => parseInt(n.replace(/[,\.]/g, ""), 10), da = (n) => {
|
9489
9510
|
try {
|
9490
9511
|
return JSON.parse(window.localStorage.getItem(n));
|
9491
9512
|
} catch {
|
9492
9513
|
return null;
|
9493
9514
|
}
|
9494
|
-
},
|
9515
|
+
}, ua = ({
|
9495
9516
|
firebaseApiKey: n = "AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",
|
9496
9517
|
firebaseProject: e = "laboratoria-la",
|
9497
9518
|
coreApiUrl: t = "https://us-central1-outpost-272720.cloudfunctions.net/core-api"
|
9498
9519
|
} = {}) => {
|
9499
|
-
const r =
|
9520
|
+
const r = en({
|
9500
9521
|
apiKey: n,
|
9501
9522
|
authDomain: `${e}.firebaseapp.com`,
|
9502
9523
|
databaseURL: `https://${e}.firebaseio.com`,
|
9503
9524
|
projectId: e
|
9504
|
-
}), i =
|
9525
|
+
}), i = No(r), s = { authUser: void 0, user: void 0 }, o = Zo(t, s);
|
9505
9526
|
return {
|
9506
|
-
...
|
9527
|
+
...ea(t, s),
|
9507
9528
|
...o,
|
9508
9529
|
auth: {
|
9509
|
-
onChange: (u) =>
|
9530
|
+
onChange: (u) => _s(i, (y) => {
|
9510
9531
|
if (!y)
|
9511
9532
|
return Object.assign(s, { authUser: null, user: null }), u(s);
|
9512
9533
|
Object.assign(s, { authUser: y }), o.user.findById(y.uid).then((b) => {
|
@@ -9515,25 +9536,25 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
|
|
9515
9536
|
console.error(b), Object.assign(s, { authUser: null, user: null }), u(s);
|
9516
9537
|
});
|
9517
9538
|
}),
|
9518
|
-
signIn: (u, y) =>
|
9539
|
+
signIn: (u, y) => gs(
|
9519
9540
|
i,
|
9520
9541
|
u,
|
9521
9542
|
y
|
9522
9543
|
),
|
9523
|
-
signOut: () =>
|
9524
|
-
sendPasswordResetEmail: (u) =>
|
9544
|
+
signOut: () => vs(i),
|
9545
|
+
sendPasswordResetEmail: (u) => ps(i, u)
|
9525
9546
|
},
|
9526
9547
|
firebaseApp: r
|
9527
9548
|
};
|
9528
9549
|
};
|
9529
9550
|
export {
|
9530
|
-
|
9531
|
-
|
9532
|
-
|
9533
|
-
|
9534
|
-
|
9535
|
-
|
9536
|
-
|
9537
|
-
|
9538
|
-
|
9551
|
+
ua as createApp,
|
9552
|
+
ca as formatCurrency,
|
9553
|
+
ta as formatDate,
|
9554
|
+
sa as formatDateTime,
|
9555
|
+
oa as formatMonth,
|
9556
|
+
na as formatTime,
|
9557
|
+
aa as getAgeAt,
|
9558
|
+
da as loadFromLocalStorage,
|
9559
|
+
la as parseCurrency
|
9539
9560
|
};
|