@feedmepos/mf-connect 0.1.47-prod → 0.1.48-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-AnuRQDA4.js → Analytic-DrjBaKmx.js} +113 -113
- package/dist/{App-DP_jCyej.js → App-eIaytGsZ.js} +632 -622
- package/dist/{Bin-tL4lF6PB.js → Bin-CVp0eFwl.js} +9 -9
- package/dist/{Broadcast-T2a5tN8R.js → Broadcast-DBgBT6yz.js} +40 -40
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BgPJCH02.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CugJWeBo.js} +18 -18
- package/dist/{Card-Bi-ODgCc.js → Card-DkP6oJVn.js} +239 -239
- package/dist/{Collections-JHWotZ1I.js → Collections-DYb_aeTW.js} +31 -31
- package/dist/{Credit-DQQCXqS0.js → Credit-WVv_PL5D.js} +74 -74
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-hxuYl-OQ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Dt9c2kvf.js} +756 -753
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-ECkaQxuI.js → EffectSheet.vue_vue_type_style_index_0_lang-DT3y4k1C.js} +96 -96
- package/dist/{Experience-DzTV21vX.js → Experience-BdH44wBG.js} +41 -41
- package/dist/{Game-DUCx2Dl9.js → Game-C7jxRESY.js} +31 -31
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
- package/dist/{Index-zynxjOOr.js → Index-DYr1p4sh.js} +54 -54
- package/dist/{Marketing-BBHDVRkR.js → Marketing-Djl27fez.js} +24 -24
- package/dist/{Member-B09bj6C3.js → Member-CWXedfTG.js} +63 -63
- package/dist/MemberList-C2TvGi22.js +1606 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-DERMSs7o.js → MemberTransactions-BSUocGg9.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CAADF6vv.js → MessageInput.vue_vue_type_script_setup_true_lang-D8xPA6jM.js} +2286 -2220
- package/dist/{Mission-DAv0e_ZH.js → Mission-BVx9Cqi5.js} +20 -20
- package/dist/{Overview-D0rBTEtP.js → Overview-DyXF9zfB.js} +337 -337
- package/dist/{Point-BeBYi1BT.js → Point-ovkgTwZO.js} +41 -41
- package/dist/{Promotion-BSPU5hP9.js → Promotion-B0Q6GItP.js} +42 -42
- package/dist/{Queue-C5IFJ3iE.js → Queue-BAWG1Hh-.js} +12 -12
- package/dist/{Record-CoFSrv7j.js → Record-CTp80g4A.js} +10 -10
- package/dist/{Reward-COIOBOl-.js → Reward-_Jow1lJ7.js} +173 -173
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B9Tl7hqv.js → RewardGroup.vue_vue_type_script_setup_true_lang-BV8xCejA.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js → RuleGroup.vue_vue_type_script_setup_true_lang-DkDAuGY0.js} +381 -381
- package/dist/{Segment-DF5SrucQ.js → Segment-CsdJ1SjK.js} +327 -327
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BSSfQu3F.js → SelectItems.vue_vue_type_script_setup_true_lang-DH3oIm2t.js} +14 -14
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DoL_gTKy.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DvVrjpxR.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cijyol1Q.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D5gV89Xk.js} +3 -3
- package/dist/Setting-BZRA50LO.js +1936 -0
- package/dist/{Store-E2_0EIy8.js → Store-CFnCN_7-.js} +238 -238
- package/dist/StoreRewards-B_McpBz-.js +423 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DuatzcJ8.js → StoreTransactions.vue_vue_type_script_setup_true_lang-vL0vr-Xn.js} +185 -185
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C1ZlLdme.js} +1 -1
- package/dist/{Tier-CEEHsXkC.js → Tier-CCYFu6kJ.js} +106 -106
- package/dist/{Title-BMAWlGeW.js → Title-7Mg-Ml4z.js} +95 -95
- package/dist/{Transaction-CLsceq-O.js → Transaction-BqZrbpZi.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CFLekn9O.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C6ZwPUD4.js} +6 -6
- package/dist/{Voucher-Cd293WYY.js → Voucher-Yty_7SuS.js} +36 -36
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Bt12t3gB.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js → ZodTextField.vue_vue_type_script_setup_true_lang-C3NHrEIl.js} +1 -1
- package/dist/{app-aVXsWATU.js → app-2EJP4psh.js} +31 -31
- package/dist/app-Dzon--6x.js +57962 -0
- package/dist/app.js +1 -1
- package/dist/{business-DVlHPzaL.js → business-BehG4fR2.js} +1 -1
- package/dist/{campaign-l-u9A514.js → campaign-BpaiTG4f.js} +10 -10
- package/dist/{campaign-D9KeUWA7.js → campaign-CAcP56Sz.js} +2 -2
- package/dist/{campaign.enum-Cud82tES.js → campaign.enum-BWjI8Hop.js} +1 -1
- package/dist/{campaign.fn-C-UojhHv.js → campaign.fn-PVdB1-V1.js} +166 -166
- package/dist/{collectible.enum-PrlUDScv.js → collectible.enum-BYmuqayi.js} +1 -1
- package/dist/{collection.fn-yR-xnV4g.js → collection.fn-CbH8hbWW.js} +2 -2
- package/dist/{dto-Cua1OHMY.js → dto-Dd3Oc4QO.js} +4 -4
- package/dist/{effect-B5-eXNEr.js → effect-DvEQNEl0.js} +1 -1
- package/dist/{email-addresses-BeYh5fr5.js → email-addresses-C-9JrAi8.js} +1 -1
- package/dist/{export-BUF4_DUz.js → export-RWE9Cn-d.js} +4 -4
- package/dist/{helper-CGwOThAl.js → helper-Bl6LdWED.js} +1 -1
- package/dist/{index-Cl2iYM2F.js → index-1bU9cLqV.js} +1 -1
- package/dist/{index-1BGPM6Uy.js → index-BCQMVr1J.js} +1 -1
- package/dist/{index-BmL_b0IR.js → index-Bgnrbk5x.js} +1 -1
- package/dist/{index-knuJv0ti.js → index-Bjf5Z2QE.js} +4 -4
- package/dist/{index-ng2IXlL1.js → index-CFW9ogow.js} +1 -1
- package/dist/{index-DNTd-FNx.js → index-CfgczUMX.js} +2 -2
- package/dist/{index-C-d_4n-1.js → index-CzCqc7ph.js} +1 -1
- package/dist/{index-aMDi62-C.js → index-DX1X6Owa.js} +1 -1
- package/dist/{index-DlFVLRKG.js → index-DZN5WWgq.js} +3 -3
- package/dist/{index-D5KIp8ZB.js → index-DhUvELhc.js} +3 -3
- package/dist/{index-Cx8-ipee.js → index-DpoNuVc-.js} +6 -6
- package/dist/{index-BLdVWQId.js → index-G_XSbrXB.js} +3 -3
- package/dist/{index-hX2mE0gQ.js → index-VVy4GPzJ.js} +1 -1
- package/dist/{index-CB8iWT_p.js → index-wOExBjGo.js} +1 -1
- package/dist/{index.esm2017-D8stWFci.js → index.esm2017-DfgZFSqe.js} +1 -1
- package/dist/{loading-c4b7n9Xp.js → loading-qlqqYGF3.js} +1 -1
- package/dist/{membership-oBIs4sbL.js → membership-Bh_1iu5v.js} +3 -3
- package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
- package/dist/{money-AP24H0gk.js → money-DvTB_Fek.js} +1 -1
- package/dist/{number-CwsAYC_2.js → number-DJQ3gi1P.js} +1 -1
- package/dist/objectid-BKU0cEuv.js +145 -0
- package/dist/{plugins-Dn7JDHi7.js → plugins-DJpBrPbQ.js} +2 -2
- package/dist/{reward-4wdoZeXw.js → reward-DZ4KlN9B.js} +1 -1
- package/dist/{rule-_OJza6tn.js → rule-DV0yCGlq.js} +4 -4
- package/dist/{rule-builder-DmlhHAED.js → rule-builder-D6ihVPNO.js} +1 -1
- package/dist/{template-BSQLFHf4.js → template-ElP-JIFL.js} +63 -63
- package/dist/timezone-FaHjut_D.js +1150 -0
- package/dist/{trigger-DC9tDnI2.js → trigger-D8wnJVTA.js} +4 -4
- package/dist/usePagination-Ds-cuHop.js +223 -0
- package/dist/{user-CCVOptFD.js → user-NWV9KppR.js} +1 -1
- package/dist/{vue-i18n--_Wu1nMj.js → vue-i18n-CkbS-IDD.js} +112 -112
- package/dist/{xlsx-BVMaOi8M.js → xlsx-CdQE5RZi.js} +226 -226
- package/package.json +5 -4
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
- package/dist/MemberList-DLSLGQ02.js +0 -1606
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/Setting-Dt0sG_hk.js +0 -1936
- package/dist/StoreRewards-DuSsWnTE.js +0 -423
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Qc5cCqh5.js +0 -419
- package/dist/app-jRT7vsk_.js +0 -33357
- package/dist/objectid-CVDLTdni.js +0 -145
- package/dist/usePagination-JoYaROkV.js +0 -223
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { _ as
|
|
13
|
-
import {
|
|
14
|
-
|
|
1
|
+
import { defineComponent as ht, ref as te, h as G, computed as Ee, watch as ft, resolveComponent as Zt, openBlock as ne, createElementBlock as ke, createVNode as pt, unref as v, createElementVNode as ie, toDisplayString as We, onMounted as en, Fragment as tn, createBlock as nn, createCommentVNode as Be, nextTick as rn } from "vue";
|
|
2
|
+
import { useRouter as sn, useRoute as mt, RouterView as on } from "vue-router";
|
|
3
|
+
import { useCoreStore as be, FeedMeAuth as an } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as cn } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { u as ln } from "./business-BehG4fR2.js";
|
|
6
|
+
import "./index-1bU9cLqV.js";
|
|
7
|
+
import { components as z, useSnackbar as un, useDialog as dn } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as hn } from "./vue-i18n-CkbS-IDD.js";
|
|
9
|
+
import { C as Ge, m as fn } from "./timezone-FaHjut_D.js";
|
|
10
|
+
import { R as f } from "./app-2EJP4psh.js";
|
|
11
|
+
import { J as pn } from "./JsonViewer-v8_C7l5N.js";
|
|
12
|
+
import { r as Se, L as mn, g as gt, i as gn, a as _n, _ as ze, C as qe, b as vn, S as J, c as E, d as W, E as Ce, e as In, f as _t, h as Tn, j as yn, k as vt, l as _, m as wn, F as Oe, n as En, q as Y, o as kn, p as bn, s as Sn, t as Rn, u as Pn } from "./index.esm2017-DfgZFSqe.js";
|
|
13
|
+
import { _ as Ne } from "./tslib.es6-BCqqvLQ_.js";
|
|
14
|
+
import { S as Ke, c as An } from "./index-G_XSbrXB.js";
|
|
15
|
+
const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Nn = /* @__PURE__ */ ht({
|
|
15
16
|
__name: "NavigationTab",
|
|
16
17
|
setup(n) {
|
|
17
|
-
const { t: e } =
|
|
18
|
+
const { t: e } = hn(), t = te(), i = [
|
|
18
19
|
{
|
|
19
20
|
label: e("connect.navigation.analytic"),
|
|
20
21
|
value: f["$connect-ANALYTIC"]
|
|
@@ -56,7 +57,7 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
56
57
|
{
|
|
57
58
|
label: e("connect.navigation.point"),
|
|
58
59
|
value: f["$connect-PROGRAM_POINT"],
|
|
59
|
-
badge: () => G(
|
|
60
|
+
badge: () => G(z.FmPill, { variant: "premium" })
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
label: e("connect.navigation.credit"),
|
|
@@ -65,7 +66,7 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
65
66
|
{
|
|
66
67
|
label: e("connect.navigation.game"),
|
|
67
68
|
value: f["$connect-PROGRAM_GAME"],
|
|
68
|
-
badge: () => G(
|
|
69
|
+
badge: () => G(z.FmPill, { variant: "premium" })
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
72
|
label: "Mission",
|
|
@@ -84,19 +85,19 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
84
85
|
{
|
|
85
86
|
label: e("connect.navigation.segments"),
|
|
86
87
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
87
|
-
badge: () => G(
|
|
88
|
+
badge: () => G(z.FmPill, { variant: "premium" })
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
label: e("connect.navigation.card"),
|
|
91
92
|
value: f["$connect-LOYALTY_CARD"],
|
|
92
|
-
badge: () => G(
|
|
93
|
+
badge: () => G(z.FmPill, { variant: "premium" })
|
|
93
94
|
}
|
|
94
95
|
]
|
|
95
96
|
},
|
|
96
97
|
{
|
|
97
98
|
label: e("connect.navigation.referral"),
|
|
98
99
|
value: f["$connect-REFERRAL"],
|
|
99
|
-
badge: () => G(
|
|
100
|
+
badge: () => G(z.FmPill, { variant: "premium" })
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
103
|
label: e("connect.navigation.store"),
|
|
@@ -118,31 +119,40 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
118
119
|
label: e("connect.navigation.bin"),
|
|
119
120
|
value: f["$connect-BIN"]
|
|
120
121
|
}
|
|
121
|
-
], r =
|
|
122
|
-
|
|
122
|
+
], r = sn(), s = mt(), o = i.reduce((d, h) => [...(h.children ?? []).map((p) => p.value), ...d, h.value], []), c = be(), a = Ee(() => {
|
|
123
|
+
const d = c.currentCountry.value || "MY";
|
|
124
|
+
return console.log(`[MF] Timezone set to: ${Ge[d]}`), Ge[d];
|
|
125
|
+
});
|
|
126
|
+
ft(
|
|
123
127
|
() => s,
|
|
124
|
-
(
|
|
125
|
-
const
|
|
126
|
-
t.value =
|
|
128
|
+
(d) => {
|
|
129
|
+
const h = d.matched.map((p) => p.name).reverse();
|
|
130
|
+
t.value = h.find((p) => o.includes(p));
|
|
127
131
|
},
|
|
128
132
|
{ immediate: !0 }
|
|
129
133
|
);
|
|
130
|
-
async function
|
|
131
|
-
await r.push({ name:
|
|
134
|
+
async function l(d) {
|
|
135
|
+
await r.push({ name: d });
|
|
132
136
|
}
|
|
133
|
-
return (
|
|
134
|
-
var
|
|
135
|
-
const
|
|
136
|
-
return ne(),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
return (d, h) => {
|
|
138
|
+
var w;
|
|
139
|
+
const p = Zt("FmCollapsibleTabs");
|
|
140
|
+
return ne(), ke("div", Cn, [
|
|
141
|
+
pt(p, {
|
|
142
|
+
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
143
|
+
"model-value": (w = v(t)) == null ? void 0 : w.toString(),
|
|
144
|
+
items: i,
|
|
145
|
+
"onUpdate:modelValue": l
|
|
146
|
+
}, null, 8, ["model-value"]),
|
|
147
|
+
ie("div", On, [
|
|
148
|
+
ie("div", null, "Timezone: " + We(v(a).split("/")[1].replace("_", " ")), 1),
|
|
149
|
+
ie("div", null, "(UTC" + We(v(fn).tz(v(a)).format("Z")) + ")", 1)
|
|
150
|
+
])
|
|
151
|
+
]);
|
|
142
152
|
};
|
|
143
153
|
}
|
|
144
154
|
});
|
|
145
|
-
var
|
|
155
|
+
var Ln = "firebase", Mn = "10.12.4";
|
|
146
156
|
/**
|
|
147
157
|
* @license
|
|
148
158
|
* Copyright 2020 Google LLC
|
|
@@ -159,13 +169,13 @@ var Pn = "firebase", An = "10.12.4";
|
|
|
159
169
|
* See the License for the specific language governing permissions and
|
|
160
170
|
* limitations under the License.
|
|
161
171
|
*/
|
|
162
|
-
|
|
163
|
-
function
|
|
172
|
+
Se(Ln, Mn, "app");
|
|
173
|
+
function It() {
|
|
164
174
|
return {
|
|
165
175
|
"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."
|
|
166
176
|
};
|
|
167
177
|
}
|
|
168
|
-
const
|
|
178
|
+
const Un = It, Tt = new Ce("auth", "Firebase", It());
|
|
169
179
|
/**
|
|
170
180
|
* @license
|
|
171
181
|
* Copyright 2020 Google LLC
|
|
@@ -182,12 +192,12 @@ const Cn = gt, _t = new Se("auth", "Firebase", gt());
|
|
|
182
192
|
* See the License for the specific language governing permissions and
|
|
183
193
|
* limitations under the License.
|
|
184
194
|
*/
|
|
185
|
-
const
|
|
186
|
-
function
|
|
187
|
-
|
|
195
|
+
const ce = new mn("@firebase/auth");
|
|
196
|
+
function Dn(n, ...e) {
|
|
197
|
+
ce.logLevel <= vt.WARN && ce.warn(`Auth (${J}): ${n}`, ...e);
|
|
188
198
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
199
|
+
function re(n, ...e) {
|
|
200
|
+
ce.logLevel <= vt.ERROR && ce.error(`Auth (${J}): ${n}`, ...e);
|
|
191
201
|
}
|
|
192
202
|
/**
|
|
193
203
|
* @license
|
|
@@ -205,38 +215,38 @@ function ie(n, ...e) {
|
|
|
205
215
|
* See the License for the specific language governing permissions and
|
|
206
216
|
* limitations under the License.
|
|
207
217
|
*/
|
|
208
|
-
function
|
|
209
|
-
throw
|
|
218
|
+
function R(n, ...e) {
|
|
219
|
+
throw Le(n, ...e);
|
|
210
220
|
}
|
|
211
|
-
function
|
|
212
|
-
return
|
|
221
|
+
function T(n, ...e) {
|
|
222
|
+
return Le(n, ...e);
|
|
213
223
|
}
|
|
214
|
-
function
|
|
215
|
-
const i = Object.assign(Object.assign({},
|
|
216
|
-
return new
|
|
224
|
+
function yt(n, e, t) {
|
|
225
|
+
const i = Object.assign(Object.assign({}, Un()), { [e]: t });
|
|
226
|
+
return new Ce("auth", "Firebase", i).create(e, {
|
|
217
227
|
appName: n.name
|
|
218
228
|
});
|
|
219
229
|
}
|
|
220
|
-
function
|
|
221
|
-
return
|
|
230
|
+
function M(n) {
|
|
231
|
+
return yt(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
222
232
|
}
|
|
223
|
-
function
|
|
233
|
+
function Le(n, ...e) {
|
|
224
234
|
if (typeof n != "string") {
|
|
225
235
|
const t = e[0], i = [...e.slice(1)];
|
|
226
236
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
227
237
|
}
|
|
228
|
-
return
|
|
238
|
+
return Tt.create(n, ...e);
|
|
229
239
|
}
|
|
230
240
|
function u(n, e, ...t) {
|
|
231
241
|
if (!n)
|
|
232
|
-
throw
|
|
242
|
+
throw Le(e, ...t);
|
|
233
243
|
}
|
|
234
|
-
function
|
|
244
|
+
function k(n) {
|
|
235
245
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
236
|
-
throw
|
|
246
|
+
throw re(e), new Error(e);
|
|
237
247
|
}
|
|
238
|
-
function
|
|
239
|
-
n ||
|
|
248
|
+
function P(n, e) {
|
|
249
|
+
n || k(e);
|
|
240
250
|
}
|
|
241
251
|
/**
|
|
242
252
|
* @license
|
|
@@ -254,14 +264,14 @@ function S(n, e) {
|
|
|
254
264
|
* See the License for the specific language governing permissions and
|
|
255
265
|
* limitations under the License.
|
|
256
266
|
*/
|
|
257
|
-
function
|
|
267
|
+
function Re() {
|
|
258
268
|
var n;
|
|
259
269
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
260
270
|
}
|
|
261
|
-
function
|
|
262
|
-
return
|
|
271
|
+
function Fn() {
|
|
272
|
+
return Je() === "http:" || Je() === "https:";
|
|
263
273
|
}
|
|
264
|
-
function
|
|
274
|
+
function Je() {
|
|
265
275
|
var n;
|
|
266
276
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.protocol) || null;
|
|
267
277
|
}
|
|
@@ -281,15 +291,15 @@ function qe() {
|
|
|
281
291
|
* See the License for the specific language governing permissions and
|
|
282
292
|
* limitations under the License.
|
|
283
293
|
*/
|
|
284
|
-
function
|
|
294
|
+
function xn() {
|
|
285
295
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
286
296
|
// This is especially true for Cordova apps which have unreliable
|
|
287
297
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
288
298
|
// installed which overwrites the native navigator.onLine value and
|
|
289
299
|
// defines navigator.connection.
|
|
290
|
-
(
|
|
300
|
+
(Fn() || vn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
291
301
|
}
|
|
292
|
-
function
|
|
302
|
+
function Vn() {
|
|
293
303
|
if (typeof navigator > "u")
|
|
294
304
|
return null;
|
|
295
305
|
const n = navigator;
|
|
@@ -319,10 +329,10 @@ function Mn() {
|
|
|
319
329
|
*/
|
|
320
330
|
class X {
|
|
321
331
|
constructor(e, t) {
|
|
322
|
-
this.shortDelay = e, this.longDelay = t,
|
|
332
|
+
this.shortDelay = e, this.longDelay = t, P(t > e, "Short delay should be less than long delay!"), this.isMobile = gn() || _n();
|
|
323
333
|
}
|
|
324
334
|
get() {
|
|
325
|
-
return
|
|
335
|
+
return xn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
326
336
|
}
|
|
327
337
|
}
|
|
328
338
|
/**
|
|
@@ -341,8 +351,8 @@ class X {
|
|
|
341
351
|
* See the License for the specific language governing permissions and
|
|
342
352
|
* limitations under the License.
|
|
343
353
|
*/
|
|
344
|
-
function
|
|
345
|
-
|
|
354
|
+
function Me(n, e) {
|
|
355
|
+
P(n.emulator, "Emulator should always be set here");
|
|
346
356
|
const { url: t } = n.emulator;
|
|
347
357
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
348
358
|
}
|
|
@@ -362,7 +372,7 @@ function Ce(n, e) {
|
|
|
362
372
|
* See the License for the specific language governing permissions and
|
|
363
373
|
* limitations under the License.
|
|
364
374
|
*/
|
|
365
|
-
class
|
|
375
|
+
class wt {
|
|
366
376
|
static initialize(e, t, i) {
|
|
367
377
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
368
378
|
}
|
|
@@ -375,7 +385,7 @@ class It {
|
|
|
375
385
|
return globalThis.fetch;
|
|
376
386
|
if (typeof fetch < "u")
|
|
377
387
|
return fetch;
|
|
378
|
-
|
|
388
|
+
k("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
379
389
|
}
|
|
380
390
|
static headers() {
|
|
381
391
|
if (this.headersImpl)
|
|
@@ -386,7 +396,7 @@ class It {
|
|
|
386
396
|
return globalThis.Headers;
|
|
387
397
|
if (typeof Headers < "u")
|
|
388
398
|
return Headers;
|
|
389
|
-
|
|
399
|
+
k("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
390
400
|
}
|
|
391
401
|
static response() {
|
|
392
402
|
if (this.responseImpl)
|
|
@@ -397,7 +407,7 @@ class It {
|
|
|
397
407
|
return globalThis.Response;
|
|
398
408
|
if (typeof Response < "u")
|
|
399
409
|
return Response;
|
|
400
|
-
|
|
410
|
+
k("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
401
411
|
}
|
|
402
412
|
}
|
|
403
413
|
/**
|
|
@@ -416,7 +426,7 @@ class It {
|
|
|
416
426
|
* See the License for the specific language governing permissions and
|
|
417
427
|
* limitations under the License.
|
|
418
428
|
*/
|
|
419
|
-
const
|
|
429
|
+
const $n = {
|
|
420
430
|
// Custom token errors.
|
|
421
431
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
422
432
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -507,12 +517,12 @@ const Un = {
|
|
|
507
517
|
* See the License for the specific language governing permissions and
|
|
508
518
|
* limitations under the License.
|
|
509
519
|
*/
|
|
510
|
-
const
|
|
511
|
-
function
|
|
520
|
+
const Hn = new X(3e4, 6e4);
|
|
521
|
+
function fe(n, e) {
|
|
512
522
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
513
523
|
}
|
|
514
524
|
async function B(n, e, t, i, r = {}) {
|
|
515
|
-
return
|
|
525
|
+
return Et(n, r, async () => {
|
|
516
526
|
let s = {}, o = {};
|
|
517
527
|
i && (e === "GET" ? o = i : s = {
|
|
518
528
|
body: JSON.stringify(i)
|
|
@@ -524,18 +534,18 @@ async function B(n, e, t, i, r = {}) {
|
|
|
524
534
|
] = "application/json", n.languageCode && (a[
|
|
525
535
|
"X-Firebase-Locale"
|
|
526
536
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
527
|
-
] = n.languageCode),
|
|
537
|
+
] = n.languageCode), wt.fetch()(bt(n, n.config.apiHost, t, c), Object.assign({
|
|
528
538
|
method: e,
|
|
529
539
|
headers: a,
|
|
530
540
|
referrerPolicy: "no-referrer"
|
|
531
541
|
}, s));
|
|
532
542
|
});
|
|
533
543
|
}
|
|
534
|
-
async function
|
|
544
|
+
async function Et(n, e, t) {
|
|
535
545
|
n._canInitEmulator = !1;
|
|
536
|
-
const i = Object.assign(Object.assign({},
|
|
546
|
+
const i = Object.assign(Object.assign({}, $n), e);
|
|
537
547
|
try {
|
|
538
|
-
const r = new
|
|
548
|
+
const r = new jn(n), s = await Promise.race([
|
|
539
549
|
t(),
|
|
540
550
|
r.promise
|
|
541
551
|
]);
|
|
@@ -555,33 +565,33 @@ async function Tt(n, e, t) {
|
|
|
555
565
|
throw ee(n, "user-disabled", o);
|
|
556
566
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
557
567
|
if (l)
|
|
558
|
-
throw
|
|
559
|
-
|
|
568
|
+
throw yt(n, d, l);
|
|
569
|
+
R(n, d);
|
|
560
570
|
}
|
|
561
571
|
} catch (r) {
|
|
562
|
-
if (r instanceof
|
|
572
|
+
if (r instanceof Oe)
|
|
563
573
|
throw r;
|
|
564
|
-
|
|
574
|
+
R(n, "network-request-failed", { message: String(r) });
|
|
565
575
|
}
|
|
566
576
|
}
|
|
567
|
-
async function
|
|
577
|
+
async function kt(n, e, t, i, r = {}) {
|
|
568
578
|
const s = await B(n, e, t, i, r);
|
|
569
|
-
return "mfaPendingCredential" in s &&
|
|
579
|
+
return "mfaPendingCredential" in s && R(n, "multi-factor-auth-required", {
|
|
570
580
|
_serverResponse: s
|
|
571
581
|
}), s;
|
|
572
582
|
}
|
|
573
|
-
function
|
|
583
|
+
function bt(n, e, t, i) {
|
|
574
584
|
const r = `${e}${t}?${i}`;
|
|
575
|
-
return n.config.emulator ?
|
|
585
|
+
return n.config.emulator ? Me(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
576
586
|
}
|
|
577
|
-
class
|
|
587
|
+
class jn {
|
|
578
588
|
constructor(e) {
|
|
579
589
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
580
|
-
this.timer = setTimeout(() => i(
|
|
590
|
+
this.timer = setTimeout(() => i(T(
|
|
581
591
|
this.auth,
|
|
582
592
|
"network-request-failed"
|
|
583
593
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
584
|
-
)),
|
|
594
|
+
)), Hn.get());
|
|
585
595
|
});
|
|
586
596
|
}
|
|
587
597
|
clearNetworkTimeout() {
|
|
@@ -593,7 +603,7 @@ function ee(n, e, t) {
|
|
|
593
603
|
appName: n.name
|
|
594
604
|
};
|
|
595
605
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
596
|
-
const r =
|
|
606
|
+
const r = T(n, e, i);
|
|
597
607
|
return r.customData._tokenResponse = t, r;
|
|
598
608
|
}
|
|
599
609
|
/**
|
|
@@ -612,10 +622,10 @@ function ee(n, e, t) {
|
|
|
612
622
|
* See the License for the specific language governing permissions and
|
|
613
623
|
* limitations under the License.
|
|
614
624
|
*/
|
|
615
|
-
async function
|
|
625
|
+
async function Wn(n, e) {
|
|
616
626
|
return B(n, "POST", "/v1/accounts:delete", e);
|
|
617
627
|
}
|
|
618
|
-
async function
|
|
628
|
+
async function St(n, e) {
|
|
619
629
|
return B(n, "POST", "/v1/accounts:lookup", e);
|
|
620
630
|
}
|
|
621
631
|
/**
|
|
@@ -634,7 +644,7 @@ async function Et(n, e) {
|
|
|
634
644
|
* See the License for the specific language governing permissions and
|
|
635
645
|
* limitations under the License.
|
|
636
646
|
*/
|
|
637
|
-
function
|
|
647
|
+
function q(n) {
|
|
638
648
|
if (n)
|
|
639
649
|
try {
|
|
640
650
|
const e = new Date(Number(n));
|
|
@@ -643,8 +653,8 @@ function z(n) {
|
|
|
643
653
|
} catch {
|
|
644
654
|
}
|
|
645
655
|
}
|
|
646
|
-
async function
|
|
647
|
-
const t =
|
|
656
|
+
async function Bn(n, e = !1) {
|
|
657
|
+
const t = W(n), i = await t.getIdToken(e), r = Ue(i);
|
|
648
658
|
u(
|
|
649
659
|
r && r.exp && r.auth_time && r.iat,
|
|
650
660
|
t.auth,
|
|
@@ -655,29 +665,29 @@ async function Vn(n, e = !1) {
|
|
|
655
665
|
return {
|
|
656
666
|
claims: r,
|
|
657
667
|
token: i,
|
|
658
|
-
authTime:
|
|
659
|
-
issuedAtTime:
|
|
660
|
-
expirationTime:
|
|
668
|
+
authTime: q(ye(r.auth_time)),
|
|
669
|
+
issuedAtTime: q(ye(r.iat)),
|
|
670
|
+
expirationTime: q(ye(r.exp)),
|
|
661
671
|
signInProvider: o || null,
|
|
662
672
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
663
673
|
};
|
|
664
674
|
}
|
|
665
|
-
function
|
|
675
|
+
function ye(n) {
|
|
666
676
|
return Number(n) * 1e3;
|
|
667
677
|
}
|
|
668
|
-
function
|
|
678
|
+
function Ue(n) {
|
|
669
679
|
const [e, t, i] = n.split(".");
|
|
670
680
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
671
|
-
return
|
|
681
|
+
return re("JWT malformed, contained fewer than 3 sections"), null;
|
|
672
682
|
try {
|
|
673
|
-
const r =
|
|
674
|
-
return r ? JSON.parse(r) : (
|
|
683
|
+
const r = En(t);
|
|
684
|
+
return r ? JSON.parse(r) : (re("Failed to decode base64 JWT payload"), null);
|
|
675
685
|
} catch (r) {
|
|
676
|
-
return
|
|
686
|
+
return re("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
677
687
|
}
|
|
678
688
|
}
|
|
679
|
-
function
|
|
680
|
-
const e =
|
|
689
|
+
function Ye(n) {
|
|
690
|
+
const e = Ue(n);
|
|
681
691
|
return u(
|
|
682
692
|
e,
|
|
683
693
|
"internal-error"
|
|
@@ -714,10 +724,10 @@ async function K(n, e, t = !1) {
|
|
|
714
724
|
try {
|
|
715
725
|
return await e;
|
|
716
726
|
} catch (i) {
|
|
717
|
-
throw i instanceof
|
|
727
|
+
throw i instanceof Oe && Gn(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
718
728
|
}
|
|
719
729
|
}
|
|
720
|
-
function
|
|
730
|
+
function Gn({ code: n }) {
|
|
721
731
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
722
732
|
}
|
|
723
733
|
/**
|
|
@@ -736,7 +746,7 @@ function $n({ code: n }) {
|
|
|
736
746
|
* See the License for the specific language governing permissions and
|
|
737
747
|
* limitations under the License.
|
|
738
748
|
*/
|
|
739
|
-
class
|
|
749
|
+
class zn {
|
|
740
750
|
constructor(e) {
|
|
741
751
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
742
752
|
}
|
|
@@ -798,12 +808,12 @@ class Hn {
|
|
|
798
808
|
* See the License for the specific language governing permissions and
|
|
799
809
|
* limitations under the License.
|
|
800
810
|
*/
|
|
801
|
-
class
|
|
811
|
+
class Pe {
|
|
802
812
|
constructor(e, t) {
|
|
803
813
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
804
814
|
}
|
|
805
815
|
_initializeTime() {
|
|
806
|
-
this.lastSignInTime =
|
|
816
|
+
this.lastSignInTime = q(this.lastLoginAt), this.creationTime = q(this.createdAt);
|
|
807
817
|
}
|
|
808
818
|
_copy(e) {
|
|
809
819
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -831,9 +841,9 @@ class ke {
|
|
|
831
841
|
* See the License for the specific language governing permissions and
|
|
832
842
|
* limitations under the License.
|
|
833
843
|
*/
|
|
834
|
-
async function
|
|
844
|
+
async function le(n) {
|
|
835
845
|
var e;
|
|
836
|
-
const t = n.auth, i = await n.getIdToken(), r = await K(n,
|
|
846
|
+
const t = n.auth, i = await n.getIdToken(), r = await K(n, St(t, { idToken: i }));
|
|
837
847
|
u(
|
|
838
848
|
r == null ? void 0 : r.users.length,
|
|
839
849
|
t,
|
|
@@ -842,7 +852,7 @@ async function ce(n) {
|
|
|
842
852
|
);
|
|
843
853
|
const s = r.users[0];
|
|
844
854
|
n._notifyReloadListener(s);
|
|
845
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
855
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Rt(s.providerUserInfo) : [], c = Kn(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, h = {
|
|
846
856
|
uid: s.localId,
|
|
847
857
|
displayName: s.displayName || null,
|
|
848
858
|
photoURL: s.photoUrl || null,
|
|
@@ -851,21 +861,21 @@ async function ce(n) {
|
|
|
851
861
|
phoneNumber: s.phoneNumber || null,
|
|
852
862
|
tenantId: s.tenantId || null,
|
|
853
863
|
providerData: c,
|
|
854
|
-
metadata: new
|
|
864
|
+
metadata: new Pe(s.createdAt, s.lastLoginAt),
|
|
855
865
|
isAnonymous: d
|
|
856
866
|
};
|
|
857
867
|
Object.assign(n, h);
|
|
858
868
|
}
|
|
859
|
-
async function
|
|
860
|
-
const e =
|
|
861
|
-
await
|
|
869
|
+
async function qn(n) {
|
|
870
|
+
const e = W(n);
|
|
871
|
+
await le(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
862
872
|
}
|
|
863
|
-
function
|
|
873
|
+
function Kn(n, e) {
|
|
864
874
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
865
875
|
}
|
|
866
|
-
function
|
|
876
|
+
function Rt(n) {
|
|
867
877
|
return n.map((e) => {
|
|
868
|
-
var { providerId: t } = e, i =
|
|
878
|
+
var { providerId: t } = e, i = Ne(e, ["providerId"]);
|
|
869
879
|
return {
|
|
870
880
|
providerId: t,
|
|
871
881
|
uid: i.rawId || "",
|
|
@@ -892,16 +902,16 @@ function kt(n) {
|
|
|
892
902
|
* See the License for the specific language governing permissions and
|
|
893
903
|
* limitations under the License.
|
|
894
904
|
*/
|
|
895
|
-
async function
|
|
896
|
-
const t = await
|
|
905
|
+
async function Jn(n, e) {
|
|
906
|
+
const t = await Et(n, {}, async () => {
|
|
897
907
|
const i = Y({
|
|
898
908
|
grant_type: "refresh_token",
|
|
899
909
|
refresh_token: e
|
|
900
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
910
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = bt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
901
911
|
return c[
|
|
902
912
|
"Content-Type"
|
|
903
913
|
/* HttpHeader.CONTENT_TYPE */
|
|
904
|
-
] = "application/x-www-form-urlencoded",
|
|
914
|
+
] = "application/x-www-form-urlencoded", wt.fetch()(o, {
|
|
905
915
|
method: "POST",
|
|
906
916
|
headers: c,
|
|
907
917
|
body: i
|
|
@@ -913,8 +923,8 @@ async function Bn(n, e) {
|
|
|
913
923
|
refreshToken: t.refresh_token
|
|
914
924
|
};
|
|
915
925
|
}
|
|
916
|
-
async function
|
|
917
|
-
return B(n, "POST", "/v2/accounts:revokeToken",
|
|
926
|
+
async function Yn(n, e) {
|
|
927
|
+
return B(n, "POST", "/v2/accounts:revokeToken", fe(n, e));
|
|
918
928
|
}
|
|
919
929
|
/**
|
|
920
930
|
* @license
|
|
@@ -953,7 +963,7 @@ class $ {
|
|
|
953
963
|
"internal-error"
|
|
954
964
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
955
965
|
);
|
|
956
|
-
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) :
|
|
966
|
+
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : Ye(e.idToken);
|
|
957
967
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
|
958
968
|
}
|
|
959
969
|
updateFromIdToken(e) {
|
|
@@ -962,7 +972,7 @@ class $ {
|
|
|
962
972
|
"internal-error"
|
|
963
973
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
964
974
|
);
|
|
965
|
-
const t =
|
|
975
|
+
const t = Ye(e);
|
|
966
976
|
this.updateTokensAndExpiration(e, null, t);
|
|
967
977
|
}
|
|
968
978
|
async getToken(e, t = !1) {
|
|
@@ -977,7 +987,7 @@ class $ {
|
|
|
977
987
|
this.refreshToken = null;
|
|
978
988
|
}
|
|
979
989
|
async refresh(e, t) {
|
|
980
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
990
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await Jn(e, t);
|
|
981
991
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
982
992
|
}
|
|
983
993
|
updateTokensAndExpiration(e, t, i) {
|
|
@@ -1007,7 +1017,7 @@ class $ {
|
|
|
1007
1017
|
return Object.assign(new $(), this.toJSON());
|
|
1008
1018
|
}
|
|
1009
1019
|
_performRefresh() {
|
|
1010
|
-
return
|
|
1020
|
+
return k("not implemented");
|
|
1011
1021
|
}
|
|
1012
1022
|
}
|
|
1013
1023
|
/**
|
|
@@ -1026,13 +1036,13 @@ class $ {
|
|
|
1026
1036
|
* See the License for the specific language governing permissions and
|
|
1027
1037
|
* limitations under the License.
|
|
1028
1038
|
*/
|
|
1029
|
-
function
|
|
1039
|
+
function A(n, e) {
|
|
1030
1040
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1031
1041
|
}
|
|
1032
|
-
class
|
|
1042
|
+
class b {
|
|
1033
1043
|
constructor(e) {
|
|
1034
|
-
var { uid: t, auth: i, stsTokenManager: r } = e, s =
|
|
1035
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1044
|
+
var { uid: t, auth: i, stsTokenManager: r } = e, s = Ne(e, ["uid", "auth", "stsTokenManager"]);
|
|
1045
|
+
this.providerId = "firebase", this.proactiveRefresh = new zn(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = i, this.stsTokenManager = r, this.accessToken = r.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 Pe(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1036
1046
|
}
|
|
1037
1047
|
async getIdToken(e) {
|
|
1038
1048
|
const t = await K(this, this.stsTokenManager.getToken(this.auth, e));
|
|
@@ -1044,10 +1054,10 @@ class E {
|
|
|
1044
1054
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1045
1055
|
}
|
|
1046
1056
|
getIdTokenResult(e) {
|
|
1047
|
-
return
|
|
1057
|
+
return Bn(this, e);
|
|
1048
1058
|
}
|
|
1049
1059
|
reload() {
|
|
1050
|
-
return
|
|
1060
|
+
return qn(this);
|
|
1051
1061
|
}
|
|
1052
1062
|
_assign(e) {
|
|
1053
1063
|
this !== e && (u(
|
|
@@ -1058,7 +1068,7 @@ class E {
|
|
|
1058
1068
|
), this.displayName = e.displayName, this.photoURL = e.photoURL, this.email = e.email, this.emailVerified = e.emailVerified, this.phoneNumber = e.phoneNumber, this.isAnonymous = e.isAnonymous, this.tenantId = e.tenantId, this.providerData = e.providerData.map((t) => Object.assign({}, t)), this.metadata._copy(e.metadata), this.stsTokenManager._assign(e.stsTokenManager));
|
|
1059
1069
|
}
|
|
1060
1070
|
_clone(e) {
|
|
1061
|
-
const t = new
|
|
1071
|
+
const t = new b(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
1062
1072
|
return t.metadata._copy(this.metadata), t;
|
|
1063
1073
|
}
|
|
1064
1074
|
_onReload(e) {
|
|
@@ -1080,13 +1090,13 @@ class E {
|
|
|
1080
1090
|
}
|
|
1081
1091
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1082
1092
|
let i = !1;
|
|
1083
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1093
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await le(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1084
1094
|
}
|
|
1085
1095
|
async delete() {
|
|
1086
|
-
if (
|
|
1087
|
-
return Promise.reject(
|
|
1096
|
+
if (E(this.auth.app))
|
|
1097
|
+
return Promise.reject(M(this.auth));
|
|
1088
1098
|
const e = await this.getIdToken();
|
|
1089
|
-
return await K(this,
|
|
1099
|
+
return await K(this, Wn(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1090
1100
|
}
|
|
1091
1101
|
toJSON() {
|
|
1092
1102
|
return Object.assign(Object.assign({
|
|
@@ -1114,45 +1124,45 @@ class E {
|
|
|
1114
1124
|
}
|
|
1115
1125
|
static _fromJSON(e, t) {
|
|
1116
1126
|
var i, r, s, o, c, a, l, d;
|
|
1117
|
-
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0,
|
|
1127
|
+
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, p = (r = t.email) !== null && r !== void 0 ? r : void 0, w = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, U = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, m = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, g = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, I = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, x = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: ve, emailVerified: $e, isAnonymous: He, providerData: Ie, stsTokenManager: je } = t;
|
|
1118
1128
|
u(
|
|
1119
|
-
|
|
1129
|
+
ve && je,
|
|
1120
1130
|
e,
|
|
1121
1131
|
"internal-error"
|
|
1122
1132
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1123
1133
|
);
|
|
1124
|
-
const
|
|
1134
|
+
const Xt = $.fromJSON(this.name, je);
|
|
1125
1135
|
u(
|
|
1126
|
-
typeof
|
|
1136
|
+
typeof ve == "string",
|
|
1127
1137
|
e,
|
|
1128
1138
|
"internal-error"
|
|
1129
1139
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1130
|
-
),
|
|
1131
|
-
typeof
|
|
1140
|
+
), A(h, e.name), A(p, e.name), u(
|
|
1141
|
+
typeof $e == "boolean",
|
|
1132
1142
|
e,
|
|
1133
1143
|
"internal-error"
|
|
1134
1144
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1135
1145
|
), u(
|
|
1136
|
-
typeof
|
|
1146
|
+
typeof He == "boolean",
|
|
1137
1147
|
e,
|
|
1138
1148
|
"internal-error"
|
|
1139
1149
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1140
|
-
),
|
|
1141
|
-
const
|
|
1142
|
-
uid:
|
|
1150
|
+
), A(w, e.name), A(U, e.name), A(m, e.name), A(g, e.name), A(I, e.name), A(x, e.name);
|
|
1151
|
+
const Te = new b({
|
|
1152
|
+
uid: ve,
|
|
1143
1153
|
auth: e,
|
|
1144
|
-
email:
|
|
1145
|
-
emailVerified:
|
|
1154
|
+
email: p,
|
|
1155
|
+
emailVerified: $e,
|
|
1146
1156
|
displayName: h,
|
|
1147
|
-
isAnonymous:
|
|
1148
|
-
photoURL:
|
|
1149
|
-
phoneNumber:
|
|
1150
|
-
tenantId:
|
|
1151
|
-
stsTokenManager:
|
|
1152
|
-
createdAt:
|
|
1157
|
+
isAnonymous: He,
|
|
1158
|
+
photoURL: U,
|
|
1159
|
+
phoneNumber: w,
|
|
1160
|
+
tenantId: m,
|
|
1161
|
+
stsTokenManager: Xt,
|
|
1162
|
+
createdAt: I,
|
|
1153
1163
|
lastLoginAt: x
|
|
1154
1164
|
});
|
|
1155
|
-
return
|
|
1165
|
+
return Ie && Array.isArray(Ie) && (Te.providerData = Ie.map((Qt) => Object.assign({}, Qt))), g && (Te._redirectEventId = g), Te;
|
|
1156
1166
|
}
|
|
1157
1167
|
/**
|
|
1158
1168
|
* Initialize a User from an idToken server response
|
|
@@ -1162,13 +1172,13 @@ class E {
|
|
|
1162
1172
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1163
1173
|
const r = new $();
|
|
1164
1174
|
r.updateFromServerResponse(t);
|
|
1165
|
-
const s = new
|
|
1175
|
+
const s = new b({
|
|
1166
1176
|
uid: t.localId,
|
|
1167
1177
|
auth: e,
|
|
1168
1178
|
stsTokenManager: r,
|
|
1169
1179
|
isAnonymous: i
|
|
1170
1180
|
});
|
|
1171
|
-
return await
|
|
1181
|
+
return await le(s), s;
|
|
1172
1182
|
}
|
|
1173
1183
|
/**
|
|
1174
1184
|
* Initialize a User from an idToken server response
|
|
@@ -1182,9 +1192,9 @@ class E {
|
|
|
1182
1192
|
"internal-error"
|
|
1183
1193
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1184
1194
|
);
|
|
1185
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1195
|
+
const s = r.providerUserInfo !== void 0 ? Rt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new $();
|
|
1186
1196
|
c.updateFromIdToken(i);
|
|
1187
|
-
const a = new
|
|
1197
|
+
const a = new b({
|
|
1188
1198
|
uid: r.localId,
|
|
1189
1199
|
auth: e,
|
|
1190
1200
|
stsTokenManager: c,
|
|
@@ -1198,7 +1208,7 @@ class E {
|
|
|
1198
1208
|
phoneNumber: r.phoneNumber || null,
|
|
1199
1209
|
tenantId: r.tenantId || null,
|
|
1200
1210
|
providerData: s,
|
|
1201
|
-
metadata: new
|
|
1211
|
+
metadata: new Pe(r.createdAt, r.lastLoginAt),
|
|
1202
1212
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1203
1213
|
};
|
|
1204
1214
|
return Object.assign(a, l), a;
|
|
@@ -1220,11 +1230,11 @@ class E {
|
|
|
1220
1230
|
* See the License for the specific language governing permissions and
|
|
1221
1231
|
* limitations under the License.
|
|
1222
1232
|
*/
|
|
1223
|
-
const
|
|
1224
|
-
function
|
|
1225
|
-
|
|
1226
|
-
let e =
|
|
1227
|
-
return e ? (
|
|
1233
|
+
const Xe = /* @__PURE__ */ new Map();
|
|
1234
|
+
function S(n) {
|
|
1235
|
+
P(n instanceof Function, "Expected a class definition");
|
|
1236
|
+
let e = Xe.get(n);
|
|
1237
|
+
return e ? (P(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), Xe.set(n, e), e);
|
|
1228
1238
|
}
|
|
1229
1239
|
/**
|
|
1230
1240
|
* @license
|
|
@@ -1242,7 +1252,7 @@ function k(n) {
|
|
|
1242
1252
|
* See the License for the specific language governing permissions and
|
|
1243
1253
|
* limitations under the License.
|
|
1244
1254
|
*/
|
|
1245
|
-
class
|
|
1255
|
+
class Pt {
|
|
1246
1256
|
constructor() {
|
|
1247
1257
|
this.type = "NONE", this.storage = {};
|
|
1248
1258
|
}
|
|
@@ -1264,8 +1274,8 @@ class bt {
|
|
|
1264
1274
|
_removeListener(e, t) {
|
|
1265
1275
|
}
|
|
1266
1276
|
}
|
|
1267
|
-
|
|
1268
|
-
const
|
|
1277
|
+
Pt.type = "NONE";
|
|
1278
|
+
const Qe = Pt;
|
|
1269
1279
|
/**
|
|
1270
1280
|
* @license
|
|
1271
1281
|
* Copyright 2019 Google LLC
|
|
@@ -1282,21 +1292,21 @@ const Je = bt;
|
|
|
1282
1292
|
* See the License for the specific language governing permissions and
|
|
1283
1293
|
* limitations under the License.
|
|
1284
1294
|
*/
|
|
1285
|
-
function
|
|
1295
|
+
function se(n, e, t) {
|
|
1286
1296
|
return `firebase:${n}:${e}:${t}`;
|
|
1287
1297
|
}
|
|
1288
1298
|
class H {
|
|
1289
1299
|
constructor(e, t, i) {
|
|
1290
1300
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1291
1301
|
const { config: r, name: s } = this.auth;
|
|
1292
|
-
this.fullUserKey =
|
|
1302
|
+
this.fullUserKey = se(this.userKey, r.apiKey, s), this.fullPersistenceKey = se("persistence", r.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
1293
1303
|
}
|
|
1294
1304
|
setCurrentUser(e) {
|
|
1295
1305
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
1296
1306
|
}
|
|
1297
1307
|
async getCurrentUser() {
|
|
1298
1308
|
const e = await this.persistence._get(this.fullUserKey);
|
|
1299
|
-
return e ?
|
|
1309
|
+
return e ? b._fromJSON(this.auth, e) : null;
|
|
1300
1310
|
}
|
|
1301
1311
|
removeCurrentUser() {
|
|
1302
1312
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -1316,19 +1326,19 @@ class H {
|
|
|
1316
1326
|
}
|
|
1317
1327
|
static async create(e, t, i = "authUser") {
|
|
1318
1328
|
if (!t.length)
|
|
1319
|
-
return new H(
|
|
1329
|
+
return new H(S(Qe), e, i);
|
|
1320
1330
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1321
1331
|
if (await l._isAvailable())
|
|
1322
1332
|
return l;
|
|
1323
1333
|
}))).filter((l) => l);
|
|
1324
|
-
let s = r[0] ||
|
|
1325
|
-
const o =
|
|
1334
|
+
let s = r[0] || S(Qe);
|
|
1335
|
+
const o = se(i, e.config.apiKey, e.name);
|
|
1326
1336
|
let c = null;
|
|
1327
1337
|
for (const l of t)
|
|
1328
1338
|
try {
|
|
1329
1339
|
const d = await l._get(o);
|
|
1330
1340
|
if (d) {
|
|
1331
|
-
const h =
|
|
1341
|
+
const h = b._fromJSON(e, d);
|
|
1332
1342
|
l !== s && (c = h), s = l;
|
|
1333
1343
|
break;
|
|
1334
1344
|
}
|
|
@@ -1360,29 +1370,29 @@ class H {
|
|
|
1360
1370
|
* See the License for the specific language governing permissions and
|
|
1361
1371
|
* limitations under the License.
|
|
1362
1372
|
*/
|
|
1363
|
-
function
|
|
1373
|
+
function Ze(n) {
|
|
1364
1374
|
const e = n.toLowerCase();
|
|
1365
1375
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1366
1376
|
return "Opera";
|
|
1367
|
-
if (
|
|
1377
|
+
if (Ot(e))
|
|
1368
1378
|
return "IEMobile";
|
|
1369
1379
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1370
1380
|
return "IE";
|
|
1371
1381
|
if (e.includes("edge/"))
|
|
1372
1382
|
return "Edge";
|
|
1373
|
-
if (
|
|
1383
|
+
if (At(e))
|
|
1374
1384
|
return "Firefox";
|
|
1375
1385
|
if (e.includes("silk/"))
|
|
1376
1386
|
return "Silk";
|
|
1377
|
-
if (
|
|
1387
|
+
if (Lt(e))
|
|
1378
1388
|
return "Blackberry";
|
|
1379
|
-
if (
|
|
1389
|
+
if (Mt(e))
|
|
1380
1390
|
return "Webos";
|
|
1381
|
-
if (
|
|
1391
|
+
if (De(e))
|
|
1382
1392
|
return "Safari";
|
|
1383
|
-
if ((e.includes("chrome/") ||
|
|
1393
|
+
if ((e.includes("chrome/") || Ct(e)) && !e.includes("edge/"))
|
|
1384
1394
|
return "Chrome";
|
|
1385
|
-
if (
|
|
1395
|
+
if (Nt(e))
|
|
1386
1396
|
return "Android";
|
|
1387
1397
|
{
|
|
1388
1398
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1391,42 +1401,42 @@ function Ye(n) {
|
|
|
1391
1401
|
}
|
|
1392
1402
|
return "Other";
|
|
1393
1403
|
}
|
|
1394
|
-
function
|
|
1404
|
+
function At(n = _()) {
|
|
1395
1405
|
return /firefox\//i.test(n);
|
|
1396
1406
|
}
|
|
1397
|
-
function
|
|
1407
|
+
function De(n = _()) {
|
|
1398
1408
|
const e = n.toLowerCase();
|
|
1399
1409
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1400
1410
|
}
|
|
1401
|
-
function
|
|
1411
|
+
function Ct(n = _()) {
|
|
1402
1412
|
return /crios\//i.test(n);
|
|
1403
1413
|
}
|
|
1404
|
-
function
|
|
1414
|
+
function Ot(n = _()) {
|
|
1405
1415
|
return /iemobile/i.test(n);
|
|
1406
1416
|
}
|
|
1407
|
-
function
|
|
1417
|
+
function Nt(n = _()) {
|
|
1408
1418
|
return /android/i.test(n);
|
|
1409
1419
|
}
|
|
1410
|
-
function
|
|
1420
|
+
function Lt(n = _()) {
|
|
1411
1421
|
return /blackberry/i.test(n);
|
|
1412
1422
|
}
|
|
1413
|
-
function
|
|
1423
|
+
function Mt(n = _()) {
|
|
1414
1424
|
return /webos/i.test(n);
|
|
1415
1425
|
}
|
|
1416
|
-
function
|
|
1426
|
+
function pe(n = _()) {
|
|
1417
1427
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1418
1428
|
}
|
|
1419
|
-
function
|
|
1429
|
+
function Xn(n = _()) {
|
|
1420
1430
|
var e;
|
|
1421
|
-
return
|
|
1431
|
+
return pe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1422
1432
|
}
|
|
1423
|
-
function
|
|
1424
|
-
return
|
|
1433
|
+
function Qn() {
|
|
1434
|
+
return kn() && document.documentMode === 10;
|
|
1425
1435
|
}
|
|
1426
|
-
function
|
|
1427
|
-
return
|
|
1436
|
+
function Ut(n = _()) {
|
|
1437
|
+
return pe(n) || Nt(n) || Mt(n) || Lt(n) || /windows phone/i.test(n) || Ot(n);
|
|
1428
1438
|
}
|
|
1429
|
-
function
|
|
1439
|
+
function Zn() {
|
|
1430
1440
|
try {
|
|
1431
1441
|
return !!(window && window !== window.top);
|
|
1432
1442
|
} catch {
|
|
@@ -1449,14 +1459,14 @@ function Kn() {
|
|
|
1449
1459
|
* See the License for the specific language governing permissions and
|
|
1450
1460
|
* limitations under the License.
|
|
1451
1461
|
*/
|
|
1452
|
-
function
|
|
1462
|
+
function Dt(n, e = []) {
|
|
1453
1463
|
let t;
|
|
1454
1464
|
switch (n) {
|
|
1455
1465
|
case "Browser":
|
|
1456
|
-
t =
|
|
1466
|
+
t = Ze(_());
|
|
1457
1467
|
break;
|
|
1458
1468
|
case "Worker":
|
|
1459
|
-
t = `${
|
|
1469
|
+
t = `${Ze(_())}-${n}`;
|
|
1460
1470
|
break;
|
|
1461
1471
|
default:
|
|
1462
1472
|
t = n;
|
|
@@ -1480,7 +1490,7 @@ function Lt(n, e = []) {
|
|
|
1480
1490
|
* See the License for the specific language governing permissions and
|
|
1481
1491
|
* limitations under the License.
|
|
1482
1492
|
*/
|
|
1483
|
-
class
|
|
1493
|
+
class ei {
|
|
1484
1494
|
constructor(e) {
|
|
1485
1495
|
this.auth = e, this.queue = [];
|
|
1486
1496
|
}
|
|
@@ -1535,8 +1545,8 @@ class Jn {
|
|
|
1535
1545
|
* See the License for the specific language governing permissions and
|
|
1536
1546
|
* limitations under the License.
|
|
1537
1547
|
*/
|
|
1538
|
-
async function
|
|
1539
|
-
return B(n, "GET", "/v2/passwordPolicy",
|
|
1548
|
+
async function ti(n, e = {}) {
|
|
1549
|
+
return B(n, "GET", "/v2/passwordPolicy", fe(n, e));
|
|
1540
1550
|
}
|
|
1541
1551
|
/**
|
|
1542
1552
|
* @license
|
|
@@ -1554,12 +1564,12 @@ async function Yn(n, e = {}) {
|
|
|
1554
1564
|
* See the License for the specific language governing permissions and
|
|
1555
1565
|
* limitations under the License.
|
|
1556
1566
|
*/
|
|
1557
|
-
const
|
|
1558
|
-
class
|
|
1567
|
+
const ni = 6;
|
|
1568
|
+
class ii {
|
|
1559
1569
|
constructor(e) {
|
|
1560
1570
|
var t, i, r, s;
|
|
1561
1571
|
const o = e.customStrengthOptions;
|
|
1562
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1572
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : ni, 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 = (r = (i = e.allowedNonAlphanumericCharacters) === null || i === void 0 ? void 0 : i.join("")) !== null && r !== void 0 ? r : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
|
1563
1573
|
}
|
|
1564
1574
|
validatePassword(e) {
|
|
1565
1575
|
var t, i, r, s, o, c;
|
|
@@ -1642,12 +1652,12 @@ class Qn {
|
|
|
1642
1652
|
* See the License for the specific language governing permissions and
|
|
1643
1653
|
* limitations under the License.
|
|
1644
1654
|
*/
|
|
1645
|
-
class
|
|
1655
|
+
class ri {
|
|
1646
1656
|
constructor(e, t, i, r) {
|
|
1647
|
-
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new
|
|
1657
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new et(this), this.idTokenSubscription = new et(this), this.beforeStateQueue = new ei(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 = Tt, 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 = r.sdkClientVersion;
|
|
1648
1658
|
}
|
|
1649
1659
|
_initializeWithPersistence(e, t) {
|
|
1650
|
-
return t && (this._popupRedirectResolver =
|
|
1660
|
+
return t && (this._popupRedirectResolver = S(t)), this._initializationPromise = this.queue(async () => {
|
|
1651
1661
|
var i, r;
|
|
1652
1662
|
if (!this._deleted && (this.persistenceManager = await H.create(this, e), !this._deleted)) {
|
|
1653
1663
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
@@ -1680,7 +1690,7 @@ class Zn {
|
|
|
1680
1690
|
}
|
|
1681
1691
|
async initializeCurrentUserFromIdToken(e) {
|
|
1682
1692
|
try {
|
|
1683
|
-
const t = await
|
|
1693
|
+
const t = await St(this, { idToken: e }), i = await b._fromGetAccountInfoResponse(this, t, e);
|
|
1684
1694
|
await this.directlySetCurrentUser(i);
|
|
1685
1695
|
} catch (t) {
|
|
1686
1696
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1688,7 +1698,7 @@ class Zn {
|
|
|
1688
1698
|
}
|
|
1689
1699
|
async initializeCurrentUser(e) {
|
|
1690
1700
|
var t;
|
|
1691
|
-
if (
|
|
1701
|
+
if (E(this.app)) {
|
|
1692
1702
|
const o = this.app.settings.authIdToken;
|
|
1693
1703
|
return o ? new Promise((c) => {
|
|
1694
1704
|
setTimeout(() => this.initializeCurrentUserFromIdToken(o).then(c, c));
|
|
@@ -1730,7 +1740,7 @@ class Zn {
|
|
|
1730
1740
|
}
|
|
1731
1741
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1732
1742
|
try {
|
|
1733
|
-
await
|
|
1743
|
+
await le(e);
|
|
1734
1744
|
} catch (t) {
|
|
1735
1745
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1736
1746
|
return this.directlySetCurrentUser(null);
|
|
@@ -1738,15 +1748,15 @@ class Zn {
|
|
|
1738
1748
|
return this.directlySetCurrentUser(e);
|
|
1739
1749
|
}
|
|
1740
1750
|
useDeviceLanguage() {
|
|
1741
|
-
this.languageCode =
|
|
1751
|
+
this.languageCode = Vn();
|
|
1742
1752
|
}
|
|
1743
1753
|
async _delete() {
|
|
1744
1754
|
this._deleted = !0;
|
|
1745
1755
|
}
|
|
1746
1756
|
async updateCurrentUser(e) {
|
|
1747
|
-
if (
|
|
1748
|
-
return Promise.reject(
|
|
1749
|
-
const t = e ?
|
|
1757
|
+
if (E(this.app))
|
|
1758
|
+
return Promise.reject(M(this));
|
|
1759
|
+
const t = e ? W(e) : null;
|
|
1750
1760
|
return t && u(
|
|
1751
1761
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1752
1762
|
this,
|
|
@@ -1766,15 +1776,15 @@ class Zn {
|
|
|
1766
1776
|
});
|
|
1767
1777
|
}
|
|
1768
1778
|
async signOut() {
|
|
1769
|
-
return
|
|
1779
|
+
return E(this.app) ? Promise.reject(M(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1770
1780
|
null,
|
|
1771
1781
|
/* skipBeforeStateCallbacks */
|
|
1772
1782
|
!0
|
|
1773
1783
|
));
|
|
1774
1784
|
}
|
|
1775
1785
|
setPersistence(e) {
|
|
1776
|
-
return
|
|
1777
|
-
await this.assertedPersistence.setPersistence(
|
|
1786
|
+
return E(this.app) ? Promise.reject(M(this)) : this.queue(async () => {
|
|
1787
|
+
await this.assertedPersistence.setPersistence(S(e));
|
|
1778
1788
|
});
|
|
1779
1789
|
}
|
|
1780
1790
|
_getRecaptchaConfig() {
|
|
@@ -1789,14 +1799,14 @@ class Zn {
|
|
|
1789
1799
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1790
1800
|
}
|
|
1791
1801
|
async _updatePasswordPolicy() {
|
|
1792
|
-
const e = await
|
|
1802
|
+
const e = await ti(this), t = new ii(e);
|
|
1793
1803
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1794
1804
|
}
|
|
1795
1805
|
_getPersistence() {
|
|
1796
1806
|
return this.assertedPersistence.persistence.type;
|
|
1797
1807
|
}
|
|
1798
1808
|
_updateErrorMap(e) {
|
|
1799
|
-
this._errorFactory = new
|
|
1809
|
+
this._errorFactory = new Ce("auth", "Firebase", e());
|
|
1800
1810
|
}
|
|
1801
1811
|
onAuthStateChanged(e, t, i) {
|
|
1802
1812
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1829,7 +1839,7 @@ class Zn {
|
|
|
1829
1839
|
token: e,
|
|
1830
1840
|
idToken: t
|
|
1831
1841
|
};
|
|
1832
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1842
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await Yn(this, i);
|
|
1833
1843
|
}
|
|
1834
1844
|
}
|
|
1835
1845
|
toJSON() {
|
|
@@ -1847,7 +1857,7 @@ class Zn {
|
|
|
1847
1857
|
}
|
|
1848
1858
|
async getOrInitRedirectPersistenceManager(e) {
|
|
1849
1859
|
if (!this.redirectPersistenceManager) {
|
|
1850
|
-
const t = e &&
|
|
1860
|
+
const t = e && S(e) || this._popupRedirectResolver;
|
|
1851
1861
|
u(
|
|
1852
1862
|
t,
|
|
1853
1863
|
this,
|
|
@@ -1855,7 +1865,7 @@ class Zn {
|
|
|
1855
1865
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
1856
1866
|
), this.redirectPersistenceManager = await H.create(
|
|
1857
1867
|
this,
|
|
1858
|
-
[
|
|
1868
|
+
[S(t._redirectPersistence)],
|
|
1859
1869
|
"redirectUser"
|
|
1860
1870
|
/* KeyName.REDIRECT_USER */
|
|
1861
1871
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -1942,7 +1952,7 @@ class Zn {
|
|
|
1942
1952
|
), this.persistenceManager;
|
|
1943
1953
|
}
|
|
1944
1954
|
_logFramework(e) {
|
|
1945
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
1955
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Dt(this.config.clientPlatform, this._getFrameworks()));
|
|
1946
1956
|
}
|
|
1947
1957
|
_getFrameworks() {
|
|
1948
1958
|
return this.frameworks;
|
|
@@ -1972,15 +1982,15 @@ class Zn {
|
|
|
1972
1982
|
async _getAppCheckToken() {
|
|
1973
1983
|
var e;
|
|
1974
1984
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1975
|
-
return t != null && t.error &&
|
|
1985
|
+
return t != null && t.error && Dn(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1976
1986
|
}
|
|
1977
1987
|
}
|
|
1978
|
-
function
|
|
1979
|
-
return
|
|
1988
|
+
function me(n) {
|
|
1989
|
+
return W(n);
|
|
1980
1990
|
}
|
|
1981
|
-
class
|
|
1991
|
+
class et {
|
|
1982
1992
|
constructor(e) {
|
|
1983
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
1993
|
+
this.auth = e, this.observer = null, this.addObserver = In((t) => this.observer = t);
|
|
1984
1994
|
}
|
|
1985
1995
|
get next() {
|
|
1986
1996
|
return u(
|
|
@@ -2007,7 +2017,7 @@ class Xe {
|
|
|
2007
2017
|
* See the License for the specific language governing permissions and
|
|
2008
2018
|
* limitations under the License.
|
|
2009
2019
|
*/
|
|
2010
|
-
let
|
|
2020
|
+
let Fe = {
|
|
2011
2021
|
async loadJS() {
|
|
2012
2022
|
throw new Error("Unable to load external scripts");
|
|
2013
2023
|
},
|
|
@@ -2015,16 +2025,16 @@ let Le = {
|
|
|
2015
2025
|
recaptchaEnterpriseScript: "",
|
|
2016
2026
|
gapiScript: ""
|
|
2017
2027
|
};
|
|
2018
|
-
function
|
|
2019
|
-
|
|
2028
|
+
function si(n) {
|
|
2029
|
+
Fe = n;
|
|
2020
2030
|
}
|
|
2021
|
-
function
|
|
2022
|
-
return
|
|
2031
|
+
function oi(n) {
|
|
2032
|
+
return Fe.loadJS(n);
|
|
2023
2033
|
}
|
|
2024
|
-
function
|
|
2025
|
-
return
|
|
2034
|
+
function ai() {
|
|
2035
|
+
return Fe.gapiScript;
|
|
2026
2036
|
}
|
|
2027
|
-
function
|
|
2037
|
+
function ci(n) {
|
|
2028
2038
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2029
2039
|
}
|
|
2030
2040
|
/**
|
|
@@ -2043,13 +2053,13 @@ function ii(n) {
|
|
|
2043
2053
|
* See the License for the specific language governing permissions and
|
|
2044
2054
|
* limitations under the License.
|
|
2045
2055
|
*/
|
|
2046
|
-
function
|
|
2047
|
-
const t =
|
|
2056
|
+
function li(n, e) {
|
|
2057
|
+
const t = _t(n, "auth");
|
|
2048
2058
|
if (t.isInitialized()) {
|
|
2049
2059
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2050
|
-
if (
|
|
2060
|
+
if (wn(s, e ?? {}))
|
|
2051
2061
|
return r;
|
|
2052
|
-
|
|
2062
|
+
R(
|
|
2053
2063
|
r,
|
|
2054
2064
|
"already-initialized"
|
|
2055
2065
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2057,12 +2067,12 @@ function ri(n, e) {
|
|
|
2057
2067
|
}
|
|
2058
2068
|
return t.initialize({ options: e });
|
|
2059
2069
|
}
|
|
2060
|
-
function
|
|
2061
|
-
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(
|
|
2070
|
+
function ui(n, e) {
|
|
2071
|
+
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(S);
|
|
2062
2072
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2063
2073
|
}
|
|
2064
|
-
function
|
|
2065
|
-
const i =
|
|
2074
|
+
function di(n, e, t) {
|
|
2075
|
+
const i = me(n);
|
|
2066
2076
|
u(
|
|
2067
2077
|
i._canInitEmulator,
|
|
2068
2078
|
i,
|
|
@@ -2074,38 +2084,38 @@ function oi(n, e, t) {
|
|
|
2074
2084
|
"invalid-emulator-scheme"
|
|
2075
2085
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2076
2086
|
);
|
|
2077
|
-
const r = !1, s =
|
|
2087
|
+
const r = !1, s = Ft(e), { host: o, port: c } = hi(e), a = c === null ? "" : `:${c}`;
|
|
2078
2088
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2079
2089
|
host: o,
|
|
2080
2090
|
port: c,
|
|
2081
2091
|
protocol: s.replace(":", ""),
|
|
2082
2092
|
options: Object.freeze({ disableWarnings: r })
|
|
2083
|
-
}),
|
|
2093
|
+
}), fi();
|
|
2084
2094
|
}
|
|
2085
|
-
function
|
|
2095
|
+
function Ft(n) {
|
|
2086
2096
|
const e = n.indexOf(":");
|
|
2087
2097
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2088
2098
|
}
|
|
2089
|
-
function
|
|
2090
|
-
const e =
|
|
2099
|
+
function hi(n) {
|
|
2100
|
+
const e = Ft(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2091
2101
|
if (!t)
|
|
2092
2102
|
return { host: "", port: null };
|
|
2093
2103
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
2094
2104
|
if (r) {
|
|
2095
2105
|
const s = r[1];
|
|
2096
|
-
return { host: s, port:
|
|
2106
|
+
return { host: s, port: tt(i.substr(s.length + 1)) };
|
|
2097
2107
|
} else {
|
|
2098
2108
|
const [s, o] = i.split(":");
|
|
2099
|
-
return { host: s, port:
|
|
2109
|
+
return { host: s, port: tt(o) };
|
|
2100
2110
|
}
|
|
2101
2111
|
}
|
|
2102
|
-
function
|
|
2112
|
+
function tt(n) {
|
|
2103
2113
|
if (!n)
|
|
2104
2114
|
return null;
|
|
2105
2115
|
const e = Number(n);
|
|
2106
2116
|
return isNaN(e) ? null : e;
|
|
2107
2117
|
}
|
|
2108
|
-
function
|
|
2118
|
+
function fi() {
|
|
2109
2119
|
function n() {
|
|
2110
2120
|
const e = document.createElement("p"), t = e.style;
|
|
2111
2121
|
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);
|
|
@@ -2128,7 +2138,7 @@ function ci() {
|
|
|
2128
2138
|
* See the License for the specific language governing permissions and
|
|
2129
2139
|
* limitations under the License.
|
|
2130
2140
|
*/
|
|
2131
|
-
class
|
|
2141
|
+
class xt {
|
|
2132
2142
|
/** @internal */
|
|
2133
2143
|
constructor(e, t) {
|
|
2134
2144
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2139,19 +2149,19 @@ class Ut {
|
|
|
2139
2149
|
* @returns a JSON-serializable representation of this object.
|
|
2140
2150
|
*/
|
|
2141
2151
|
toJSON() {
|
|
2142
|
-
return
|
|
2152
|
+
return k("not implemented");
|
|
2143
2153
|
}
|
|
2144
2154
|
/** @internal */
|
|
2145
2155
|
_getIdTokenResponse(e) {
|
|
2146
|
-
return
|
|
2156
|
+
return k("not implemented");
|
|
2147
2157
|
}
|
|
2148
2158
|
/** @internal */
|
|
2149
2159
|
_linkToIdToken(e, t) {
|
|
2150
|
-
return
|
|
2160
|
+
return k("not implemented");
|
|
2151
2161
|
}
|
|
2152
2162
|
/** @internal */
|
|
2153
2163
|
_getReauthenticationResolver(e) {
|
|
2154
|
-
return
|
|
2164
|
+
return k("not implemented");
|
|
2155
2165
|
}
|
|
2156
2166
|
}
|
|
2157
2167
|
/**
|
|
@@ -2170,8 +2180,8 @@ class Ut {
|
|
|
2170
2180
|
* See the License for the specific language governing permissions and
|
|
2171
2181
|
* limitations under the License.
|
|
2172
2182
|
*/
|
|
2173
|
-
async function
|
|
2174
|
-
return
|
|
2183
|
+
async function j(n, e) {
|
|
2184
|
+
return kt(n, "POST", "/v1/accounts:signInWithIdp", fe(n, e));
|
|
2175
2185
|
}
|
|
2176
2186
|
/**
|
|
2177
2187
|
* @license
|
|
@@ -2189,15 +2199,15 @@ async function W(n, e) {
|
|
|
2189
2199
|
* See the License for the specific language governing permissions and
|
|
2190
2200
|
* limitations under the License.
|
|
2191
2201
|
*/
|
|
2192
|
-
const
|
|
2193
|
-
class
|
|
2202
|
+
const pi = "http://localhost";
|
|
2203
|
+
class D extends xt {
|
|
2194
2204
|
constructor() {
|
|
2195
2205
|
super(...arguments), this.pendingToken = null;
|
|
2196
2206
|
}
|
|
2197
2207
|
/** @internal */
|
|
2198
2208
|
static _fromParams(e) {
|
|
2199
|
-
const t = new
|
|
2200
|
-
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) :
|
|
2209
|
+
const t = new D(e.providerId, e.signInMethod);
|
|
2210
|
+
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) : R(
|
|
2201
2211
|
"argument-error"
|
|
2202
2212
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2203
2213
|
), t;
|
|
@@ -2224,30 +2234,30 @@ class U extends Ut {
|
|
|
2224
2234
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
|
2225
2235
|
*/
|
|
2226
2236
|
static fromJSON(e) {
|
|
2227
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s =
|
|
2237
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = Ne(t, ["providerId", "signInMethod"]);
|
|
2228
2238
|
if (!i || !r)
|
|
2229
2239
|
return null;
|
|
2230
|
-
const o = new
|
|
2240
|
+
const o = new D(i, r);
|
|
2231
2241
|
return o.idToken = s.idToken || void 0, o.accessToken = s.accessToken || void 0, o.secret = s.secret, o.nonce = s.nonce, o.pendingToken = s.pendingToken || null, o;
|
|
2232
2242
|
}
|
|
2233
2243
|
/** @internal */
|
|
2234
2244
|
_getIdTokenResponse(e) {
|
|
2235
2245
|
const t = this.buildRequest();
|
|
2236
|
-
return
|
|
2246
|
+
return j(e, t);
|
|
2237
2247
|
}
|
|
2238
2248
|
/** @internal */
|
|
2239
2249
|
_linkToIdToken(e, t) {
|
|
2240
2250
|
const i = this.buildRequest();
|
|
2241
|
-
return i.idToken = t,
|
|
2251
|
+
return i.idToken = t, j(e, i);
|
|
2242
2252
|
}
|
|
2243
2253
|
/** @internal */
|
|
2244
2254
|
_getReauthenticationResolver(e) {
|
|
2245
2255
|
const t = this.buildRequest();
|
|
2246
|
-
return t.autoCreate = !1,
|
|
2256
|
+
return t.autoCreate = !1, j(e, t);
|
|
2247
2257
|
}
|
|
2248
2258
|
buildRequest() {
|
|
2249
2259
|
const e = {
|
|
2250
|
-
requestUri:
|
|
2260
|
+
requestUri: pi,
|
|
2251
2261
|
returnSecureToken: !0
|
|
2252
2262
|
};
|
|
2253
2263
|
if (this.pendingToken)
|
|
@@ -2275,7 +2285,7 @@ class U extends Ut {
|
|
|
2275
2285
|
* See the License for the specific language governing permissions and
|
|
2276
2286
|
* limitations under the License.
|
|
2277
2287
|
*/
|
|
2278
|
-
class
|
|
2288
|
+
class Vt {
|
|
2279
2289
|
/**
|
|
2280
2290
|
* Constructor for generic OAuth providers.
|
|
2281
2291
|
*
|
|
@@ -2328,7 +2338,7 @@ class Dt {
|
|
|
2328
2338
|
* See the License for the specific language governing permissions and
|
|
2329
2339
|
* limitations under the License.
|
|
2330
2340
|
*/
|
|
2331
|
-
class Q extends
|
|
2341
|
+
class Q extends Vt {
|
|
2332
2342
|
constructor() {
|
|
2333
2343
|
super(...arguments), this.scopes = [];
|
|
2334
2344
|
}
|
|
@@ -2363,7 +2373,7 @@ class Q extends Dt {
|
|
|
2363
2373
|
* See the License for the specific language governing permissions and
|
|
2364
2374
|
* limitations under the License.
|
|
2365
2375
|
*/
|
|
2366
|
-
class
|
|
2376
|
+
class C extends Q {
|
|
2367
2377
|
constructor() {
|
|
2368
2378
|
super(
|
|
2369
2379
|
"facebook.com"
|
|
@@ -2383,9 +2393,9 @@ class A extends Q {
|
|
|
2383
2393
|
* @param accessToken - Facebook access token.
|
|
2384
2394
|
*/
|
|
2385
2395
|
static credential(e) {
|
|
2386
|
-
return
|
|
2387
|
-
providerId:
|
|
2388
|
-
signInMethod:
|
|
2396
|
+
return D._fromParams({
|
|
2397
|
+
providerId: C.PROVIDER_ID,
|
|
2398
|
+
signInMethod: C.FACEBOOK_SIGN_IN_METHOD,
|
|
2389
2399
|
accessToken: e
|
|
2390
2400
|
});
|
|
2391
2401
|
}
|
|
@@ -2395,7 +2405,7 @@ class A extends Q {
|
|
|
2395
2405
|
* @param userCredential - The user credential.
|
|
2396
2406
|
*/
|
|
2397
2407
|
static credentialFromResult(e) {
|
|
2398
|
-
return
|
|
2408
|
+
return C.credentialFromTaggedObject(e);
|
|
2399
2409
|
}
|
|
2400
2410
|
/**
|
|
2401
2411
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2404,20 +2414,20 @@ class A extends Q {
|
|
|
2404
2414
|
* @param userCredential - The user credential.
|
|
2405
2415
|
*/
|
|
2406
2416
|
static credentialFromError(e) {
|
|
2407
|
-
return
|
|
2417
|
+
return C.credentialFromTaggedObject(e.customData || {});
|
|
2408
2418
|
}
|
|
2409
2419
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2410
2420
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2411
2421
|
return null;
|
|
2412
2422
|
try {
|
|
2413
|
-
return
|
|
2423
|
+
return C.credential(e.oauthAccessToken);
|
|
2414
2424
|
} catch {
|
|
2415
2425
|
return null;
|
|
2416
2426
|
}
|
|
2417
2427
|
}
|
|
2418
2428
|
}
|
|
2419
|
-
|
|
2420
|
-
|
|
2429
|
+
C.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
2430
|
+
C.PROVIDER_ID = "facebook.com";
|
|
2421
2431
|
/**
|
|
2422
2432
|
* @license
|
|
2423
2433
|
* Copyright 2020 Google LLC
|
|
@@ -2434,7 +2444,7 @@ A.PROVIDER_ID = "facebook.com";
|
|
|
2434
2444
|
* See the License for the specific language governing permissions and
|
|
2435
2445
|
* limitations under the License.
|
|
2436
2446
|
*/
|
|
2437
|
-
class
|
|
2447
|
+
class O extends Q {
|
|
2438
2448
|
constructor() {
|
|
2439
2449
|
super(
|
|
2440
2450
|
"google.com"
|
|
@@ -2455,9 +2465,9 @@ class C extends Q {
|
|
|
2455
2465
|
* @param accessToken - Google access token.
|
|
2456
2466
|
*/
|
|
2457
2467
|
static credential(e, t) {
|
|
2458
|
-
return
|
|
2459
|
-
providerId:
|
|
2460
|
-
signInMethod:
|
|
2468
|
+
return D._fromParams({
|
|
2469
|
+
providerId: O.PROVIDER_ID,
|
|
2470
|
+
signInMethod: O.GOOGLE_SIGN_IN_METHOD,
|
|
2461
2471
|
idToken: e,
|
|
2462
2472
|
accessToken: t
|
|
2463
2473
|
});
|
|
@@ -2468,7 +2478,7 @@ class C extends Q {
|
|
|
2468
2478
|
* @param userCredential - The user credential.
|
|
2469
2479
|
*/
|
|
2470
2480
|
static credentialFromResult(e) {
|
|
2471
|
-
return
|
|
2481
|
+
return O.credentialFromTaggedObject(e);
|
|
2472
2482
|
}
|
|
2473
2483
|
/**
|
|
2474
2484
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2477,7 +2487,7 @@ class C extends Q {
|
|
|
2477
2487
|
* @param userCredential - The user credential.
|
|
2478
2488
|
*/
|
|
2479
2489
|
static credentialFromError(e) {
|
|
2480
|
-
return
|
|
2490
|
+
return O.credentialFromTaggedObject(e.customData || {});
|
|
2481
2491
|
}
|
|
2482
2492
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2483
2493
|
if (!e)
|
|
@@ -2486,14 +2496,14 @@ class C extends Q {
|
|
|
2486
2496
|
if (!t && !i)
|
|
2487
2497
|
return null;
|
|
2488
2498
|
try {
|
|
2489
|
-
return
|
|
2499
|
+
return O.credential(t, i);
|
|
2490
2500
|
} catch {
|
|
2491
2501
|
return null;
|
|
2492
2502
|
}
|
|
2493
2503
|
}
|
|
2494
2504
|
}
|
|
2495
|
-
|
|
2496
|
-
|
|
2505
|
+
O.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
2506
|
+
O.PROVIDER_ID = "google.com";
|
|
2497
2507
|
/**
|
|
2498
2508
|
* @license
|
|
2499
2509
|
* Copyright 2020 Google LLC
|
|
@@ -2510,7 +2520,7 @@ C.PROVIDER_ID = "google.com";
|
|
|
2510
2520
|
* See the License for the specific language governing permissions and
|
|
2511
2521
|
* limitations under the License.
|
|
2512
2522
|
*/
|
|
2513
|
-
class
|
|
2523
|
+
class N extends Q {
|
|
2514
2524
|
constructor() {
|
|
2515
2525
|
super(
|
|
2516
2526
|
"github.com"
|
|
@@ -2523,9 +2533,9 @@ class O extends Q {
|
|
|
2523
2533
|
* @param accessToken - Github access token.
|
|
2524
2534
|
*/
|
|
2525
2535
|
static credential(e) {
|
|
2526
|
-
return
|
|
2527
|
-
providerId:
|
|
2528
|
-
signInMethod:
|
|
2536
|
+
return D._fromParams({
|
|
2537
|
+
providerId: N.PROVIDER_ID,
|
|
2538
|
+
signInMethod: N.GITHUB_SIGN_IN_METHOD,
|
|
2529
2539
|
accessToken: e
|
|
2530
2540
|
});
|
|
2531
2541
|
}
|
|
@@ -2535,7 +2545,7 @@ class O extends Q {
|
|
|
2535
2545
|
* @param userCredential - The user credential.
|
|
2536
2546
|
*/
|
|
2537
2547
|
static credentialFromResult(e) {
|
|
2538
|
-
return
|
|
2548
|
+
return N.credentialFromTaggedObject(e);
|
|
2539
2549
|
}
|
|
2540
2550
|
/**
|
|
2541
2551
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2544,20 +2554,20 @@ class O extends Q {
|
|
|
2544
2554
|
* @param userCredential - The user credential.
|
|
2545
2555
|
*/
|
|
2546
2556
|
static credentialFromError(e) {
|
|
2547
|
-
return
|
|
2557
|
+
return N.credentialFromTaggedObject(e.customData || {});
|
|
2548
2558
|
}
|
|
2549
2559
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2550
2560
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2551
2561
|
return null;
|
|
2552
2562
|
try {
|
|
2553
|
-
return
|
|
2563
|
+
return N.credential(e.oauthAccessToken);
|
|
2554
2564
|
} catch {
|
|
2555
2565
|
return null;
|
|
2556
2566
|
}
|
|
2557
2567
|
}
|
|
2558
2568
|
}
|
|
2559
|
-
|
|
2560
|
-
|
|
2569
|
+
N.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
2570
|
+
N.PROVIDER_ID = "github.com";
|
|
2561
2571
|
/**
|
|
2562
2572
|
* @license
|
|
2563
2573
|
* Copyright 2020 Google LLC
|
|
@@ -2574,7 +2584,7 @@ O.PROVIDER_ID = "github.com";
|
|
|
2574
2584
|
* See the License for the specific language governing permissions and
|
|
2575
2585
|
* limitations under the License.
|
|
2576
2586
|
*/
|
|
2577
|
-
class
|
|
2587
|
+
class L extends Q {
|
|
2578
2588
|
constructor() {
|
|
2579
2589
|
super(
|
|
2580
2590
|
"twitter.com"
|
|
@@ -2588,9 +2598,9 @@ class N extends Q {
|
|
|
2588
2598
|
* @param secret - Twitter secret.
|
|
2589
2599
|
*/
|
|
2590
2600
|
static credential(e, t) {
|
|
2591
|
-
return
|
|
2592
|
-
providerId:
|
|
2593
|
-
signInMethod:
|
|
2601
|
+
return D._fromParams({
|
|
2602
|
+
providerId: L.PROVIDER_ID,
|
|
2603
|
+
signInMethod: L.TWITTER_SIGN_IN_METHOD,
|
|
2594
2604
|
oauthToken: e,
|
|
2595
2605
|
oauthTokenSecret: t
|
|
2596
2606
|
});
|
|
@@ -2601,7 +2611,7 @@ class N extends Q {
|
|
|
2601
2611
|
* @param userCredential - The user credential.
|
|
2602
2612
|
*/
|
|
2603
2613
|
static credentialFromResult(e) {
|
|
2604
|
-
return
|
|
2614
|
+
return L.credentialFromTaggedObject(e);
|
|
2605
2615
|
}
|
|
2606
2616
|
/**
|
|
2607
2617
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2610,7 +2620,7 @@ class N extends Q {
|
|
|
2610
2620
|
* @param userCredential - The user credential.
|
|
2611
2621
|
*/
|
|
2612
2622
|
static credentialFromError(e) {
|
|
2613
|
-
return
|
|
2623
|
+
return L.credentialFromTaggedObject(e.customData || {});
|
|
2614
2624
|
}
|
|
2615
2625
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2616
2626
|
if (!e)
|
|
@@ -2619,14 +2629,14 @@ class N extends Q {
|
|
|
2619
2629
|
if (!t || !i)
|
|
2620
2630
|
return null;
|
|
2621
2631
|
try {
|
|
2622
|
-
return
|
|
2632
|
+
return L.credential(t, i);
|
|
2623
2633
|
} catch {
|
|
2624
2634
|
return null;
|
|
2625
2635
|
}
|
|
2626
2636
|
}
|
|
2627
2637
|
}
|
|
2628
|
-
|
|
2629
|
-
|
|
2638
|
+
L.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
2639
|
+
L.PROVIDER_ID = "twitter.com";
|
|
2630
2640
|
/**
|
|
2631
2641
|
* @license
|
|
2632
2642
|
* Copyright 2020 Google LLC
|
|
@@ -2643,13 +2653,13 @@ N.PROVIDER_ID = "twitter.com";
|
|
|
2643
2653
|
* See the License for the specific language governing permissions and
|
|
2644
2654
|
* limitations under the License.
|
|
2645
2655
|
*/
|
|
2646
|
-
class
|
|
2656
|
+
class F {
|
|
2647
2657
|
constructor(e) {
|
|
2648
2658
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2649
2659
|
}
|
|
2650
2660
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2651
|
-
const s = await
|
|
2652
|
-
return new
|
|
2661
|
+
const s = await b._fromIdTokenResponse(e, i, r), o = nt(i);
|
|
2662
|
+
return new F({
|
|
2653
2663
|
user: s,
|
|
2654
2664
|
providerId: o,
|
|
2655
2665
|
_tokenResponse: i,
|
|
@@ -2662,8 +2672,8 @@ class D {
|
|
|
2662
2672
|
/* reload */
|
|
2663
2673
|
!0
|
|
2664
2674
|
);
|
|
2665
|
-
const r =
|
|
2666
|
-
return new
|
|
2675
|
+
const r = nt(i);
|
|
2676
|
+
return new F({
|
|
2667
2677
|
user: e,
|
|
2668
2678
|
providerId: r,
|
|
2669
2679
|
_tokenResponse: i,
|
|
@@ -2671,7 +2681,7 @@ class D {
|
|
|
2671
2681
|
});
|
|
2672
2682
|
}
|
|
2673
2683
|
}
|
|
2674
|
-
function
|
|
2684
|
+
function nt(n) {
|
|
2675
2685
|
return n.providerId ? n.providerId : "phoneNumber" in n ? "phone" : null;
|
|
2676
2686
|
}
|
|
2677
2687
|
/**
|
|
@@ -2690,10 +2700,10 @@ function Ze(n) {
|
|
|
2690
2700
|
* See the License for the specific language governing permissions and
|
|
2691
2701
|
* limitations under the License.
|
|
2692
2702
|
*/
|
|
2693
|
-
class
|
|
2703
|
+
class ue extends Oe {
|
|
2694
2704
|
constructor(e, t, i, r) {
|
|
2695
2705
|
var s;
|
|
2696
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2706
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ue.prototype), this.customData = {
|
|
2697
2707
|
appName: e.name,
|
|
2698
2708
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2699
2709
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2701,17 +2711,17 @@ class le extends Re {
|
|
|
2701
2711
|
};
|
|
2702
2712
|
}
|
|
2703
2713
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2704
|
-
return new
|
|
2714
|
+
return new ue(e, t, i, r);
|
|
2705
2715
|
}
|
|
2706
2716
|
}
|
|
2707
|
-
function
|
|
2717
|
+
function $t(n, e, t, i) {
|
|
2708
2718
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2709
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2719
|
+
throw s.code === "auth/multi-factor-auth-required" ? ue._fromErrorAndOperation(n, s, e, i) : s;
|
|
2710
2720
|
});
|
|
2711
2721
|
}
|
|
2712
|
-
async function
|
|
2722
|
+
async function mi(n, e, t = !1) {
|
|
2713
2723
|
const i = await K(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2714
|
-
return
|
|
2724
|
+
return F._forOperation(n, "link", i);
|
|
2715
2725
|
}
|
|
2716
2726
|
/**
|
|
2717
2727
|
* @license
|
|
@@ -2729,20 +2739,20 @@ async function ui(n, e, t = !1) {
|
|
|
2729
2739
|
* See the License for the specific language governing permissions and
|
|
2730
2740
|
* limitations under the License.
|
|
2731
2741
|
*/
|
|
2732
|
-
async function
|
|
2742
|
+
async function gi(n, e, t = !1) {
|
|
2733
2743
|
const { auth: i } = n;
|
|
2734
|
-
if (
|
|
2735
|
-
return Promise.reject(
|
|
2744
|
+
if (E(i.app))
|
|
2745
|
+
return Promise.reject(M(i));
|
|
2736
2746
|
const r = "reauthenticate";
|
|
2737
2747
|
try {
|
|
2738
|
-
const s = await K(n,
|
|
2748
|
+
const s = await K(n, $t(i, r, e, n), t);
|
|
2739
2749
|
u(
|
|
2740
2750
|
s.idToken,
|
|
2741
2751
|
i,
|
|
2742
2752
|
"internal-error"
|
|
2743
2753
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2744
2754
|
);
|
|
2745
|
-
const o =
|
|
2755
|
+
const o = Ue(s.idToken);
|
|
2746
2756
|
u(
|
|
2747
2757
|
o,
|
|
2748
2758
|
i,
|
|
@@ -2755,9 +2765,9 @@ async function di(n, e, t = !1) {
|
|
|
2755
2765
|
i,
|
|
2756
2766
|
"user-mismatch"
|
|
2757
2767
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2758
|
-
),
|
|
2768
|
+
), F._forOperation(n, r, s);
|
|
2759
2769
|
} catch (s) {
|
|
2760
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2770
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && R(
|
|
2761
2771
|
i,
|
|
2762
2772
|
"user-mismatch"
|
|
2763
2773
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2780,10 +2790,10 @@ async function di(n, e, t = !1) {
|
|
|
2780
2790
|
* See the License for the specific language governing permissions and
|
|
2781
2791
|
* limitations under the License.
|
|
2782
2792
|
*/
|
|
2783
|
-
async function
|
|
2784
|
-
if (
|
|
2785
|
-
return Promise.reject(
|
|
2786
|
-
const i = "signIn", r = await
|
|
2793
|
+
async function _i(n, e, t = !1) {
|
|
2794
|
+
if (E(n.app))
|
|
2795
|
+
return Promise.reject(M(n));
|
|
2796
|
+
const i = "signIn", r = await $t(n, i, e), s = await F._fromIdTokenResponse(n, i, r);
|
|
2787
2797
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2788
2798
|
}
|
|
2789
2799
|
/**
|
|
@@ -2802,8 +2812,8 @@ async function hi(n, e, t = !1) {
|
|
|
2802
2812
|
* See the License for the specific language governing permissions and
|
|
2803
2813
|
* limitations under the License.
|
|
2804
2814
|
*/
|
|
2805
|
-
async function
|
|
2806
|
-
return
|
|
2815
|
+
async function vi(n, e) {
|
|
2816
|
+
return kt(n, "POST", "/v1/accounts:signInWithCustomToken", fe(n, e));
|
|
2807
2817
|
}
|
|
2808
2818
|
/**
|
|
2809
2819
|
* @license
|
|
@@ -2821,22 +2831,22 @@ async function fi(n, e) {
|
|
|
2821
2831
|
* See the License for the specific language governing permissions and
|
|
2822
2832
|
* limitations under the License.
|
|
2823
2833
|
*/
|
|
2824
|
-
async function
|
|
2825
|
-
if (
|
|
2826
|
-
return Promise.reject(
|
|
2827
|
-
const t =
|
|
2834
|
+
async function Ii(n, e) {
|
|
2835
|
+
if (E(n.app))
|
|
2836
|
+
return Promise.reject(M(n));
|
|
2837
|
+
const t = me(n), i = await vi(t, {
|
|
2828
2838
|
token: e,
|
|
2829
2839
|
returnSecureToken: !0
|
|
2830
|
-
}), r = await
|
|
2840
|
+
}), r = await F._fromIdTokenResponse(t, "signIn", i);
|
|
2831
2841
|
return await t._updateCurrentUser(r.user), r;
|
|
2832
2842
|
}
|
|
2833
|
-
function
|
|
2834
|
-
return
|
|
2843
|
+
function Ti(n, e, t, i) {
|
|
2844
|
+
return W(n).onIdTokenChanged(e, t, i);
|
|
2835
2845
|
}
|
|
2836
|
-
function
|
|
2837
|
-
return
|
|
2846
|
+
function yi(n, e, t) {
|
|
2847
|
+
return W(n).beforeAuthStateChanged(e, t);
|
|
2838
2848
|
}
|
|
2839
|
-
const
|
|
2849
|
+
const de = "__sak";
|
|
2840
2850
|
/**
|
|
2841
2851
|
* @license
|
|
2842
2852
|
* Copyright 2019 Google LLC
|
|
@@ -2853,13 +2863,13 @@ const ue = "__sak";
|
|
|
2853
2863
|
* See the License for the specific language governing permissions and
|
|
2854
2864
|
* limitations under the License.
|
|
2855
2865
|
*/
|
|
2856
|
-
class
|
|
2866
|
+
class Ht {
|
|
2857
2867
|
constructor(e, t) {
|
|
2858
2868
|
this.storageRetriever = e, this.type = t;
|
|
2859
2869
|
}
|
|
2860
2870
|
_isAvailable() {
|
|
2861
2871
|
try {
|
|
2862
|
-
return this.storage ? (this.storage.setItem(
|
|
2872
|
+
return this.storage ? (this.storage.setItem(de, "1"), this.storage.removeItem(de), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2863
2873
|
} catch {
|
|
2864
2874
|
return Promise.resolve(!1);
|
|
2865
2875
|
}
|
|
@@ -2894,18 +2904,18 @@ class xt {
|
|
|
2894
2904
|
* See the License for the specific language governing permissions and
|
|
2895
2905
|
* limitations under the License.
|
|
2896
2906
|
*/
|
|
2897
|
-
function
|
|
2898
|
-
const n =
|
|
2899
|
-
return
|
|
2907
|
+
function wi() {
|
|
2908
|
+
const n = _();
|
|
2909
|
+
return De(n) || pe(n);
|
|
2900
2910
|
}
|
|
2901
|
-
const
|
|
2902
|
-
class
|
|
2911
|
+
const Ei = 1e3, ki = 10;
|
|
2912
|
+
class jt extends Ht {
|
|
2903
2913
|
constructor() {
|
|
2904
2914
|
super(
|
|
2905
2915
|
() => window.localStorage,
|
|
2906
2916
|
"LOCAL"
|
|
2907
2917
|
/* PersistenceType.LOCAL */
|
|
2908
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
2918
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = wi() && Zn(), this.fallbackToPolling = Ut(), this._shouldAllowMigration = !0;
|
|
2909
2919
|
}
|
|
2910
2920
|
forAllChangedKeys(e) {
|
|
2911
2921
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2932,7 +2942,7 @@ class Vt extends xt {
|
|
|
2932
2942
|
const o = this.storage.getItem(i);
|
|
2933
2943
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2934
2944
|
}, s = this.storage.getItem(i);
|
|
2935
|
-
|
|
2945
|
+
Qn() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, ki) : r();
|
|
2936
2946
|
}
|
|
2937
2947
|
notifyListeners(e, t) {
|
|
2938
2948
|
this.localCache[e] = t;
|
|
@@ -2954,7 +2964,7 @@ class Vt extends xt {
|
|
|
2954
2964
|
!0
|
|
2955
2965
|
);
|
|
2956
2966
|
});
|
|
2957
|
-
},
|
|
2967
|
+
}, Ei);
|
|
2958
2968
|
}
|
|
2959
2969
|
stopPolling() {
|
|
2960
2970
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -2983,8 +2993,8 @@ class Vt extends xt {
|
|
|
2983
2993
|
await super._remove(e), delete this.localCache[e];
|
|
2984
2994
|
}
|
|
2985
2995
|
}
|
|
2986
|
-
|
|
2987
|
-
const
|
|
2996
|
+
jt.type = "LOCAL";
|
|
2997
|
+
const bi = jt;
|
|
2988
2998
|
/**
|
|
2989
2999
|
* @license
|
|
2990
3000
|
* Copyright 2020 Google LLC
|
|
@@ -3001,7 +3011,7 @@ const Ti = Vt;
|
|
|
3001
3011
|
* See the License for the specific language governing permissions and
|
|
3002
3012
|
* limitations under the License.
|
|
3003
3013
|
*/
|
|
3004
|
-
class
|
|
3014
|
+
class Wt extends Ht {
|
|
3005
3015
|
constructor() {
|
|
3006
3016
|
super(
|
|
3007
3017
|
() => window.sessionStorage,
|
|
@@ -3014,8 +3024,8 @@ class $t extends xt {
|
|
|
3014
3024
|
_removeListener(e, t) {
|
|
3015
3025
|
}
|
|
3016
3026
|
}
|
|
3017
|
-
|
|
3018
|
-
const
|
|
3027
|
+
Wt.type = "SESSION";
|
|
3028
|
+
const Bt = Wt;
|
|
3019
3029
|
/**
|
|
3020
3030
|
* @license
|
|
3021
3031
|
* Copyright 2019 Google LLC
|
|
@@ -3032,7 +3042,7 @@ const Ht = $t;
|
|
|
3032
3042
|
* See the License for the specific language governing permissions and
|
|
3033
3043
|
* limitations under the License.
|
|
3034
3044
|
*/
|
|
3035
|
-
function
|
|
3045
|
+
function Si(n) {
|
|
3036
3046
|
return Promise.all(n.map(async (e) => {
|
|
3037
3047
|
try {
|
|
3038
3048
|
return {
|
|
@@ -3063,7 +3073,7 @@ function wi(n) {
|
|
|
3063
3073
|
* See the License for the specific language governing permissions and
|
|
3064
3074
|
* limitations under the License.
|
|
3065
3075
|
*/
|
|
3066
|
-
class
|
|
3076
|
+
class ge {
|
|
3067
3077
|
constructor(e) {
|
|
3068
3078
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3069
3079
|
}
|
|
@@ -3077,7 +3087,7 @@ class me {
|
|
|
3077
3087
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3078
3088
|
if (t)
|
|
3079
3089
|
return t;
|
|
3080
|
-
const i = new
|
|
3090
|
+
const i = new ge(e);
|
|
3081
3091
|
return this.receivers.push(i), i;
|
|
3082
3092
|
}
|
|
3083
3093
|
isListeningto(e) {
|
|
@@ -3102,7 +3112,7 @@ class me {
|
|
|
3102
3112
|
eventId: i,
|
|
3103
3113
|
eventType: r
|
|
3104
3114
|
});
|
|
3105
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3115
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Si(c);
|
|
3106
3116
|
t.ports[0].postMessage({
|
|
3107
3117
|
status: "done",
|
|
3108
3118
|
eventId: i,
|
|
@@ -3131,7 +3141,7 @@ class me {
|
|
|
3131
3141
|
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);
|
|
3132
3142
|
}
|
|
3133
3143
|
}
|
|
3134
|
-
|
|
3144
|
+
ge.receivers = [];
|
|
3135
3145
|
/**
|
|
3136
3146
|
* @license
|
|
3137
3147
|
* Copyright 2020 Google LLC
|
|
@@ -3148,7 +3158,7 @@ me.receivers = [];
|
|
|
3148
3158
|
* See the License for the specific language governing permissions and
|
|
3149
3159
|
* limitations under the License.
|
|
3150
3160
|
*/
|
|
3151
|
-
function
|
|
3161
|
+
function xe(n = "", e = 10) {
|
|
3152
3162
|
let t = "";
|
|
3153
3163
|
for (let i = 0; i < e; i++)
|
|
3154
3164
|
t += Math.floor(Math.random() * 10);
|
|
@@ -3170,7 +3180,7 @@ function Me(n = "", e = 10) {
|
|
|
3170
3180
|
* See the License for the specific language governing permissions and
|
|
3171
3181
|
* limitations under the License.
|
|
3172
3182
|
*/
|
|
3173
|
-
class
|
|
3183
|
+
class Ri {
|
|
3174
3184
|
constructor(e) {
|
|
3175
3185
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3176
3186
|
}
|
|
@@ -3204,7 +3214,7 @@ class yi {
|
|
|
3204
3214
|
);
|
|
3205
3215
|
let s, o;
|
|
3206
3216
|
return new Promise((c, a) => {
|
|
3207
|
-
const l =
|
|
3217
|
+
const l = xe("", 20);
|
|
3208
3218
|
r.port1.start();
|
|
3209
3219
|
const d = setTimeout(() => {
|
|
3210
3220
|
a(new Error(
|
|
@@ -3215,9 +3225,9 @@ class yi {
|
|
|
3215
3225
|
o = {
|
|
3216
3226
|
messageChannel: r,
|
|
3217
3227
|
onMessage(h) {
|
|
3218
|
-
const
|
|
3219
|
-
if (
|
|
3220
|
-
switch (
|
|
3228
|
+
const p = h;
|
|
3229
|
+
if (p.data.eventId === l)
|
|
3230
|
+
switch (p.data.status) {
|
|
3221
3231
|
case "ack":
|
|
3222
3232
|
clearTimeout(d), s = setTimeout(
|
|
3223
3233
|
() => {
|
|
@@ -3231,7 +3241,7 @@ class yi {
|
|
|
3231
3241
|
);
|
|
3232
3242
|
break;
|
|
3233
3243
|
case "done":
|
|
3234
|
-
clearTimeout(s), c(
|
|
3244
|
+
clearTimeout(s), c(p.data.response);
|
|
3235
3245
|
break;
|
|
3236
3246
|
default:
|
|
3237
3247
|
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
@@ -3267,11 +3277,11 @@ class yi {
|
|
|
3267
3277
|
* See the License for the specific language governing permissions and
|
|
3268
3278
|
* limitations under the License.
|
|
3269
3279
|
*/
|
|
3270
|
-
function
|
|
3280
|
+
function y() {
|
|
3271
3281
|
return window;
|
|
3272
3282
|
}
|
|
3273
|
-
function
|
|
3274
|
-
|
|
3283
|
+
function Pi(n) {
|
|
3284
|
+
y().location.href = n;
|
|
3275
3285
|
}
|
|
3276
3286
|
/**
|
|
3277
3287
|
* @license
|
|
@@ -3289,10 +3299,10 @@ function Ei(n) {
|
|
|
3289
3299
|
* See the License for the specific language governing permissions and
|
|
3290
3300
|
* limitations under the License.
|
|
3291
3301
|
*/
|
|
3292
|
-
function
|
|
3293
|
-
return typeof
|
|
3302
|
+
function Gt() {
|
|
3303
|
+
return typeof y().WorkerGlobalScope < "u" && typeof y().importScripts == "function";
|
|
3294
3304
|
}
|
|
3295
|
-
async function
|
|
3305
|
+
async function Ai() {
|
|
3296
3306
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3297
3307
|
return null;
|
|
3298
3308
|
try {
|
|
@@ -3301,12 +3311,12 @@ async function ki() {
|
|
|
3301
3311
|
return null;
|
|
3302
3312
|
}
|
|
3303
3313
|
}
|
|
3304
|
-
function
|
|
3314
|
+
function Ci() {
|
|
3305
3315
|
var n;
|
|
3306
3316
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3307
3317
|
}
|
|
3308
|
-
function
|
|
3309
|
-
return
|
|
3318
|
+
function Oi() {
|
|
3319
|
+
return Gt() ? self : null;
|
|
3310
3320
|
}
|
|
3311
3321
|
/**
|
|
3312
3322
|
* @license
|
|
@@ -3324,7 +3334,7 @@ function Si() {
|
|
|
3324
3334
|
* See the License for the specific language governing permissions and
|
|
3325
3335
|
* limitations under the License.
|
|
3326
3336
|
*/
|
|
3327
|
-
const
|
|
3337
|
+
const zt = "firebaseLocalStorageDb", Ni = 1, he = "firebaseLocalStorage", qt = "fbase_key";
|
|
3328
3338
|
class Z {
|
|
3329
3339
|
constructor(e) {
|
|
3330
3340
|
this.request = e;
|
|
@@ -3339,55 +3349,55 @@ class Z {
|
|
|
3339
3349
|
});
|
|
3340
3350
|
}
|
|
3341
3351
|
}
|
|
3342
|
-
function
|
|
3343
|
-
return n.transaction([
|
|
3352
|
+
function _e(n, e) {
|
|
3353
|
+
return n.transaction([he], e ? "readwrite" : "readonly").objectStore(he);
|
|
3344
3354
|
}
|
|
3345
|
-
function
|
|
3346
|
-
const n = indexedDB.deleteDatabase(
|
|
3355
|
+
function Li() {
|
|
3356
|
+
const n = indexedDB.deleteDatabase(zt);
|
|
3347
3357
|
return new Z(n).toPromise();
|
|
3348
3358
|
}
|
|
3349
|
-
function
|
|
3350
|
-
const n = indexedDB.open(
|
|
3359
|
+
function Ae() {
|
|
3360
|
+
const n = indexedDB.open(zt, Ni);
|
|
3351
3361
|
return new Promise((e, t) => {
|
|
3352
3362
|
n.addEventListener("error", () => {
|
|
3353
3363
|
t(n.error);
|
|
3354
3364
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3355
3365
|
const i = n.result;
|
|
3356
3366
|
try {
|
|
3357
|
-
i.createObjectStore(
|
|
3367
|
+
i.createObjectStore(he, { keyPath: qt });
|
|
3358
3368
|
} catch (r) {
|
|
3359
3369
|
t(r);
|
|
3360
3370
|
}
|
|
3361
3371
|
}), n.addEventListener("success", async () => {
|
|
3362
3372
|
const i = n.result;
|
|
3363
|
-
i.objectStoreNames.contains(
|
|
3373
|
+
i.objectStoreNames.contains(he) ? e(i) : (i.close(), await Li(), e(await Ae()));
|
|
3364
3374
|
});
|
|
3365
3375
|
});
|
|
3366
3376
|
}
|
|
3367
|
-
async function
|
|
3368
|
-
const i =
|
|
3369
|
-
[
|
|
3377
|
+
async function it(n, e, t) {
|
|
3378
|
+
const i = _e(n, !0).put({
|
|
3379
|
+
[qt]: e,
|
|
3370
3380
|
value: t
|
|
3371
3381
|
});
|
|
3372
3382
|
return new Z(i).toPromise();
|
|
3373
3383
|
}
|
|
3374
|
-
async function
|
|
3375
|
-
const t =
|
|
3384
|
+
async function Mi(n, e) {
|
|
3385
|
+
const t = _e(n, !1).get(e), i = await new Z(t).toPromise();
|
|
3376
3386
|
return i === void 0 ? null : i.value;
|
|
3377
3387
|
}
|
|
3378
|
-
function
|
|
3379
|
-
const t =
|
|
3388
|
+
function rt(n, e) {
|
|
3389
|
+
const t = _e(n, !0).delete(e);
|
|
3380
3390
|
return new Z(t).toPromise();
|
|
3381
3391
|
}
|
|
3382
|
-
const
|
|
3383
|
-
class
|
|
3392
|
+
const Ui = 800, Di = 3;
|
|
3393
|
+
class Kt {
|
|
3384
3394
|
constructor() {
|
|
3385
3395
|
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(() => {
|
|
3386
3396
|
}, () => {
|
|
3387
3397
|
});
|
|
3388
3398
|
}
|
|
3389
3399
|
async _openDb() {
|
|
3390
|
-
return this.db ? this.db : (this.db = await
|
|
3400
|
+
return this.db ? this.db : (this.db = await Ae(), this.db);
|
|
3391
3401
|
}
|
|
3392
3402
|
async _withRetries(e) {
|
|
3393
3403
|
let t = 0;
|
|
@@ -3396,7 +3406,7 @@ class Gt {
|
|
|
3396
3406
|
const i = await this._openDb();
|
|
3397
3407
|
return await e(i);
|
|
3398
3408
|
} catch (i) {
|
|
3399
|
-
if (t++ >
|
|
3409
|
+
if (t++ > Di)
|
|
3400
3410
|
throw i;
|
|
3401
3411
|
this.db && (this.db.close(), this.db = void 0);
|
|
3402
3412
|
}
|
|
@@ -3406,13 +3416,13 @@ class Gt {
|
|
|
3406
3416
|
* postMessage interface to send these events to the worker ourselves.
|
|
3407
3417
|
*/
|
|
3408
3418
|
async initializeServiceWorkerMessaging() {
|
|
3409
|
-
return
|
|
3419
|
+
return Gt() ? this.initializeReceiver() : this.initializeSender();
|
|
3410
3420
|
}
|
|
3411
3421
|
/**
|
|
3412
3422
|
* As the worker we should listen to events from the main window.
|
|
3413
3423
|
*/
|
|
3414
3424
|
async initializeReceiver() {
|
|
3415
|
-
this.receiver =
|
|
3425
|
+
this.receiver = ge._getInstance(Oi()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3416
3426
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3417
3427
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3418
3428
|
"keyChanged"
|
|
@@ -3428,9 +3438,9 @@ class Gt {
|
|
|
3428
3438
|
*/
|
|
3429
3439
|
async initializeSender() {
|
|
3430
3440
|
var e, t;
|
|
3431
|
-
if (this.activeServiceWorker = await
|
|
3441
|
+
if (this.activeServiceWorker = await Ai(), !this.activeServiceWorker)
|
|
3432
3442
|
return;
|
|
3433
|
-
this.sender = new
|
|
3443
|
+
this.sender = new Ri(this.activeServiceWorker);
|
|
3434
3444
|
const i = await this.sender._send(
|
|
3435
3445
|
"ping",
|
|
3436
3446
|
{},
|
|
@@ -3452,7 +3462,7 @@ class Gt {
|
|
|
3452
3462
|
* @param key - Storage key which changed.
|
|
3453
3463
|
*/
|
|
3454
3464
|
async notifyServiceWorker(e) {
|
|
3455
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3465
|
+
if (!(!this.sender || !this.activeServiceWorker || Ci() !== this.activeServiceWorker))
|
|
3456
3466
|
try {
|
|
3457
3467
|
await this.sender._send(
|
|
3458
3468
|
"keyChanged",
|
|
@@ -3468,8 +3478,8 @@ class Gt {
|
|
|
3468
3478
|
try {
|
|
3469
3479
|
if (!indexedDB)
|
|
3470
3480
|
return !1;
|
|
3471
|
-
const e = await
|
|
3472
|
-
return await
|
|
3481
|
+
const e = await Ae();
|
|
3482
|
+
return await it(e, de, "1"), await rt(e, de), !0;
|
|
3473
3483
|
} catch {
|
|
3474
3484
|
}
|
|
3475
3485
|
return !1;
|
|
@@ -3483,18 +3493,18 @@ class Gt {
|
|
|
3483
3493
|
}
|
|
3484
3494
|
}
|
|
3485
3495
|
async _set(e, t) {
|
|
3486
|
-
return this._withPendingWrite(async () => (await this._withRetries((i) =>
|
|
3496
|
+
return this._withPendingWrite(async () => (await this._withRetries((i) => it(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3487
3497
|
}
|
|
3488
3498
|
async _get(e) {
|
|
3489
|
-
const t = await this._withRetries((i) =>
|
|
3499
|
+
const t = await this._withRetries((i) => Mi(i, e));
|
|
3490
3500
|
return this.localCache[e] = t, t;
|
|
3491
3501
|
}
|
|
3492
3502
|
async _remove(e) {
|
|
3493
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
|
3503
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => rt(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
|
3494
3504
|
}
|
|
3495
3505
|
async _poll() {
|
|
3496
3506
|
const e = await this._withRetries((r) => {
|
|
3497
|
-
const s =
|
|
3507
|
+
const s = _e(r, !1).getAll();
|
|
3498
3508
|
return new Z(s).toPromise();
|
|
3499
3509
|
});
|
|
3500
3510
|
if (!e)
|
|
@@ -3517,7 +3527,7 @@ class Gt {
|
|
|
3517
3527
|
r(t);
|
|
3518
3528
|
}
|
|
3519
3529
|
startPolling() {
|
|
3520
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3530
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Ui);
|
|
3521
3531
|
}
|
|
3522
3532
|
stopPolling() {
|
|
3523
3533
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3529,8 +3539,8 @@ class Gt {
|
|
|
3529
3539
|
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();
|
|
3530
3540
|
}
|
|
3531
3541
|
}
|
|
3532
|
-
|
|
3533
|
-
const
|
|
3542
|
+
Kt.type = "LOCAL";
|
|
3543
|
+
const Fi = Kt;
|
|
3534
3544
|
new X(3e4, 6e4);
|
|
3535
3545
|
/**
|
|
3536
3546
|
* @license
|
|
@@ -3548,8 +3558,8 @@ new X(3e4, 6e4);
|
|
|
3548
3558
|
* See the License for the specific language governing permissions and
|
|
3549
3559
|
* limitations under the License.
|
|
3550
3560
|
*/
|
|
3551
|
-
function
|
|
3552
|
-
return e ?
|
|
3561
|
+
function xi(n, e) {
|
|
3562
|
+
return e ? S(e) : (u(
|
|
3553
3563
|
n._popupRedirectResolver,
|
|
3554
3564
|
n,
|
|
3555
3565
|
"argument-error"
|
|
@@ -3572,7 +3582,7 @@ function Li(n, e) {
|
|
|
3572
3582
|
* See the License for the specific language governing permissions and
|
|
3573
3583
|
* limitations under the License.
|
|
3574
3584
|
*/
|
|
3575
|
-
class
|
|
3585
|
+
class Ve extends xt {
|
|
3576
3586
|
constructor(e) {
|
|
3577
3587
|
super(
|
|
3578
3588
|
"custom",
|
|
@@ -3581,13 +3591,13 @@ class Ue extends Ut {
|
|
|
3581
3591
|
), this.params = e;
|
|
3582
3592
|
}
|
|
3583
3593
|
_getIdTokenResponse(e) {
|
|
3584
|
-
return
|
|
3594
|
+
return j(e, this._buildIdpRequest());
|
|
3585
3595
|
}
|
|
3586
3596
|
_linkToIdToken(e, t) {
|
|
3587
|
-
return
|
|
3597
|
+
return j(e, this._buildIdpRequest(t));
|
|
3588
3598
|
}
|
|
3589
3599
|
_getReauthenticationResolver(e) {
|
|
3590
|
-
return
|
|
3600
|
+
return j(e, this._buildIdpRequest());
|
|
3591
3601
|
}
|
|
3592
3602
|
_buildIdpRequest(e) {
|
|
3593
3603
|
const t = {
|
|
@@ -3602,26 +3612,26 @@ class Ue extends Ut {
|
|
|
3602
3612
|
return e && (t.idToken = e), t;
|
|
3603
3613
|
}
|
|
3604
3614
|
}
|
|
3605
|
-
function
|
|
3606
|
-
return
|
|
3615
|
+
function Vi(n) {
|
|
3616
|
+
return _i(n.auth, new Ve(n), n.bypassAuthState);
|
|
3607
3617
|
}
|
|
3608
|
-
function
|
|
3618
|
+
function $i(n) {
|
|
3609
3619
|
const { auth: e, user: t } = n;
|
|
3610
3620
|
return u(
|
|
3611
3621
|
t,
|
|
3612
3622
|
e,
|
|
3613
3623
|
"internal-error"
|
|
3614
3624
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3615
|
-
),
|
|
3625
|
+
), gi(t, new Ve(n), n.bypassAuthState);
|
|
3616
3626
|
}
|
|
3617
|
-
async function
|
|
3627
|
+
async function Hi(n) {
|
|
3618
3628
|
const { auth: e, user: t } = n;
|
|
3619
3629
|
return u(
|
|
3620
3630
|
t,
|
|
3621
3631
|
e,
|
|
3622
3632
|
"internal-error"
|
|
3623
3633
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3624
|
-
),
|
|
3634
|
+
), mi(t, new Ve(n), n.bypassAuthState);
|
|
3625
3635
|
}
|
|
3626
3636
|
/**
|
|
3627
3637
|
* @license
|
|
@@ -3639,7 +3649,7 @@ async function Di(n) {
|
|
|
3639
3649
|
* See the License for the specific language governing permissions and
|
|
3640
3650
|
* limitations under the License.
|
|
3641
3651
|
*/
|
|
3642
|
-
class
|
|
3652
|
+
class Jt {
|
|
3643
3653
|
constructor(e, t, i, r, s = !1) {
|
|
3644
3654
|
this.auth = e, this.resolver = i, this.user = r, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
|
3645
3655
|
}
|
|
@@ -3681,15 +3691,15 @@ class qt {
|
|
|
3681
3691
|
switch (e) {
|
|
3682
3692
|
case "signInViaPopup":
|
|
3683
3693
|
case "signInViaRedirect":
|
|
3684
|
-
return
|
|
3694
|
+
return Vi;
|
|
3685
3695
|
case "linkViaPopup":
|
|
3686
3696
|
case "linkViaRedirect":
|
|
3687
|
-
return
|
|
3697
|
+
return Hi;
|
|
3688
3698
|
case "reauthViaPopup":
|
|
3689
3699
|
case "reauthViaRedirect":
|
|
3690
|
-
return
|
|
3700
|
+
return $i;
|
|
3691
3701
|
default:
|
|
3692
|
-
|
|
3702
|
+
R(
|
|
3693
3703
|
this.auth,
|
|
3694
3704
|
"internal-error"
|
|
3695
3705
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3697,10 +3707,10 @@ class qt {
|
|
|
3697
3707
|
}
|
|
3698
3708
|
}
|
|
3699
3709
|
resolve(e) {
|
|
3700
|
-
|
|
3710
|
+
P(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3701
3711
|
}
|
|
3702
3712
|
reject(e) {
|
|
3703
|
-
|
|
3713
|
+
P(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3704
3714
|
}
|
|
3705
3715
|
unregisterAndCleanUp() {
|
|
3706
3716
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3722,8 +3732,8 @@ class qt {
|
|
|
3722
3732
|
* See the License for the specific language governing permissions and
|
|
3723
3733
|
* limitations under the License.
|
|
3724
3734
|
*/
|
|
3725
|
-
const
|
|
3726
|
-
class V extends
|
|
3735
|
+
const ji = new X(2e3, 1e4);
|
|
3736
|
+
class V extends Jt {
|
|
3727
3737
|
constructor(e, t, i, r, s) {
|
|
3728
3738
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, V.currentPopupAction && V.currentPopupAction.cancel(), V.currentPopupAction = this;
|
|
3729
3739
|
}
|
|
@@ -3737,8 +3747,8 @@ class V extends qt {
|
|
|
3737
3747
|
), e;
|
|
3738
3748
|
}
|
|
3739
3749
|
async onExecution() {
|
|
3740
|
-
|
|
3741
|
-
const e =
|
|
3750
|
+
P(this.filter.length === 1, "Popup operations only handle one event");
|
|
3751
|
+
const e = xe();
|
|
3742
3752
|
this.authWindow = await this.resolver._openPopup(
|
|
3743
3753
|
this.auth,
|
|
3744
3754
|
this.provider,
|
|
@@ -3748,7 +3758,7 @@ class V extends qt {
|
|
|
3748
3758
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3749
3759
|
this.reject(t);
|
|
3750
3760
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3751
|
-
t || this.reject(
|
|
3761
|
+
t || this.reject(T(
|
|
3752
3762
|
this.auth,
|
|
3753
3763
|
"web-storage-unsupported"
|
|
3754
3764
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3760,7 +3770,7 @@ class V extends qt {
|
|
|
3760
3770
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3761
3771
|
}
|
|
3762
3772
|
cancel() {
|
|
3763
|
-
this.reject(
|
|
3773
|
+
this.reject(T(
|
|
3764
3774
|
this.auth,
|
|
3765
3775
|
"cancelled-popup-request"
|
|
3766
3776
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
@@ -3775,7 +3785,7 @@ class V extends qt {
|
|
|
3775
3785
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3776
3786
|
this.pollId = window.setTimeout(
|
|
3777
3787
|
() => {
|
|
3778
|
-
this.pollId = null, this.reject(
|
|
3788
|
+
this.pollId = null, this.reject(T(
|
|
3779
3789
|
this.auth,
|
|
3780
3790
|
"popup-closed-by-user"
|
|
3781
3791
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3786,7 +3796,7 @@ class V extends qt {
|
|
|
3786
3796
|
);
|
|
3787
3797
|
return;
|
|
3788
3798
|
}
|
|
3789
|
-
this.pollId = window.setTimeout(e,
|
|
3799
|
+
this.pollId = window.setTimeout(e, ji.get());
|
|
3790
3800
|
};
|
|
3791
3801
|
e();
|
|
3792
3802
|
}
|
|
@@ -3808,8 +3818,8 @@ V.currentPopupAction = null;
|
|
|
3808
3818
|
* See the License for the specific language governing permissions and
|
|
3809
3819
|
* limitations under the License.
|
|
3810
3820
|
*/
|
|
3811
|
-
const
|
|
3812
|
-
class
|
|
3821
|
+
const Wi = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
3822
|
+
class Bi extends Jt {
|
|
3813
3823
|
constructor(e, t, i = !1) {
|
|
3814
3824
|
super(e, [
|
|
3815
3825
|
"signInViaRedirect",
|
|
@@ -3824,17 +3834,17 @@ class Vi extends qt {
|
|
|
3824
3834
|
* just return it.
|
|
3825
3835
|
*/
|
|
3826
3836
|
async execute() {
|
|
3827
|
-
let e =
|
|
3837
|
+
let e = oe.get(this.auth._key());
|
|
3828
3838
|
if (!e) {
|
|
3829
3839
|
try {
|
|
3830
|
-
const i = await
|
|
3840
|
+
const i = await Gi(this.resolver, this.auth) ? await super.execute() : null;
|
|
3831
3841
|
e = () => Promise.resolve(i);
|
|
3832
3842
|
} catch (t) {
|
|
3833
3843
|
e = () => Promise.reject(t);
|
|
3834
3844
|
}
|
|
3835
|
-
|
|
3845
|
+
oe.set(this.auth._key(), e);
|
|
3836
3846
|
}
|
|
3837
|
-
return this.bypassAuthState ||
|
|
3847
|
+
return this.bypassAuthState || oe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3838
3848
|
}
|
|
3839
3849
|
async onAuthEvent(e) {
|
|
3840
3850
|
if (e.type === "signInViaRedirect")
|
|
@@ -3855,26 +3865,26 @@ class Vi extends qt {
|
|
|
3855
3865
|
cleanUp() {
|
|
3856
3866
|
}
|
|
3857
3867
|
}
|
|
3858
|
-
async function
|
|
3859
|
-
const t =
|
|
3868
|
+
async function Gi(n, e) {
|
|
3869
|
+
const t = Ki(e), i = qi(n);
|
|
3860
3870
|
if (!await i._isAvailable())
|
|
3861
3871
|
return !1;
|
|
3862
3872
|
const r = await i._get(t) === "true";
|
|
3863
3873
|
return await i._remove(t), r;
|
|
3864
3874
|
}
|
|
3865
|
-
function
|
|
3866
|
-
|
|
3875
|
+
function zi(n, e) {
|
|
3876
|
+
oe.set(n._key(), e);
|
|
3867
3877
|
}
|
|
3868
|
-
function
|
|
3869
|
-
return
|
|
3878
|
+
function qi(n) {
|
|
3879
|
+
return S(n._redirectPersistence);
|
|
3870
3880
|
}
|
|
3871
|
-
function
|
|
3872
|
-
return
|
|
3881
|
+
function Ki(n) {
|
|
3882
|
+
return se(Wi, n.config.apiKey, n.name);
|
|
3873
3883
|
}
|
|
3874
|
-
async function
|
|
3875
|
-
if (
|
|
3876
|
-
return Promise.reject(
|
|
3877
|
-
const i =
|
|
3884
|
+
async function Ji(n, e, t = !1) {
|
|
3885
|
+
if (E(n.app))
|
|
3886
|
+
return Promise.reject(M(n));
|
|
3887
|
+
const i = me(n), r = xi(i, e), o = await new Bi(i, r, t).execute();
|
|
3878
3888
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3879
3889
|
}
|
|
3880
3890
|
/**
|
|
@@ -3893,8 +3903,8 @@ async function Bi(n, e, t = !1) {
|
|
|
3893
3903
|
* See the License for the specific language governing permissions and
|
|
3894
3904
|
* limitations under the License.
|
|
3895
3905
|
*/
|
|
3896
|
-
const
|
|
3897
|
-
class
|
|
3906
|
+
const Yi = 10 * 60 * 1e3;
|
|
3907
|
+
class Xi {
|
|
3898
3908
|
constructor(e) {
|
|
3899
3909
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3900
3910
|
}
|
|
@@ -3910,13 +3920,13 @@ class qi {
|
|
|
3910
3920
|
let t = !1;
|
|
3911
3921
|
return this.consumers.forEach((i) => {
|
|
3912
3922
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3913
|
-
}), this.hasHandledPotentialRedirect || !
|
|
3923
|
+
}), this.hasHandledPotentialRedirect || !Qi(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3914
3924
|
}
|
|
3915
3925
|
sendToConsumer(e, t) {
|
|
3916
3926
|
var i;
|
|
3917
|
-
if (e.error && !
|
|
3927
|
+
if (e.error && !Yt(e)) {
|
|
3918
3928
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
3919
|
-
t.onError(
|
|
3929
|
+
t.onError(T(this.auth, r));
|
|
3920
3930
|
} else
|
|
3921
3931
|
t.onAuthEvent(e);
|
|
3922
3932
|
}
|
|
@@ -3925,26 +3935,26 @@ class qi {
|
|
|
3925
3935
|
return t.filter.includes(e.type) && i;
|
|
3926
3936
|
}
|
|
3927
3937
|
hasEventBeenHandled(e) {
|
|
3928
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
3938
|
+
return Date.now() - this.lastProcessedEventTime >= Yi && this.cachedEventUids.clear(), this.cachedEventUids.has(st(e));
|
|
3929
3939
|
}
|
|
3930
3940
|
saveEventToCache(e) {
|
|
3931
|
-
this.cachedEventUids.add(
|
|
3941
|
+
this.cachedEventUids.add(st(e)), this.lastProcessedEventTime = Date.now();
|
|
3932
3942
|
}
|
|
3933
3943
|
}
|
|
3934
|
-
function
|
|
3944
|
+
function st(n) {
|
|
3935
3945
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
3936
3946
|
}
|
|
3937
|
-
function
|
|
3947
|
+
function Yt({ type: n, error: e }) {
|
|
3938
3948
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3939
3949
|
}
|
|
3940
|
-
function
|
|
3950
|
+
function Qi(n) {
|
|
3941
3951
|
switch (n.type) {
|
|
3942
3952
|
case "signInViaRedirect":
|
|
3943
3953
|
case "linkViaRedirect":
|
|
3944
3954
|
case "reauthViaRedirect":
|
|
3945
3955
|
return !0;
|
|
3946
3956
|
case "unknown":
|
|
3947
|
-
return
|
|
3957
|
+
return Yt(n);
|
|
3948
3958
|
default:
|
|
3949
3959
|
return !1;
|
|
3950
3960
|
}
|
|
@@ -3965,7 +3975,7 @@ function zi(n) {
|
|
|
3965
3975
|
* See the License for the specific language governing permissions and
|
|
3966
3976
|
* limitations under the License.
|
|
3967
3977
|
*/
|
|
3968
|
-
async function
|
|
3978
|
+
async function Zi(n, e = {}) {
|
|
3969
3979
|
return B(n, "GET", "/v1/projects", e);
|
|
3970
3980
|
}
|
|
3971
3981
|
/**
|
|
@@ -3984,32 +3994,32 @@ async function Ki(n, e = {}) {
|
|
|
3984
3994
|
* See the License for the specific language governing permissions and
|
|
3985
3995
|
* limitations under the License.
|
|
3986
3996
|
*/
|
|
3987
|
-
const
|
|
3988
|
-
async function
|
|
3997
|
+
const er = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, tr = /^https?/;
|
|
3998
|
+
async function nr(n) {
|
|
3989
3999
|
if (n.config.emulator)
|
|
3990
4000
|
return;
|
|
3991
|
-
const { authorizedDomains: e } = await
|
|
4001
|
+
const { authorizedDomains: e } = await Zi(n);
|
|
3992
4002
|
for (const t of e)
|
|
3993
4003
|
try {
|
|
3994
|
-
if (
|
|
4004
|
+
if (ir(t))
|
|
3995
4005
|
return;
|
|
3996
4006
|
} catch {
|
|
3997
4007
|
}
|
|
3998
|
-
|
|
4008
|
+
R(
|
|
3999
4009
|
n,
|
|
4000
4010
|
"unauthorized-domain"
|
|
4001
4011
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4002
4012
|
);
|
|
4003
4013
|
}
|
|
4004
|
-
function
|
|
4005
|
-
const e =
|
|
4014
|
+
function ir(n) {
|
|
4015
|
+
const e = Re(), { protocol: t, hostname: i } = new URL(e);
|
|
4006
4016
|
if (n.startsWith("chrome-extension://")) {
|
|
4007
4017
|
const o = new URL(n);
|
|
4008
4018
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4009
4019
|
}
|
|
4010
|
-
if (!
|
|
4020
|
+
if (!tr.test(t))
|
|
4011
4021
|
return !1;
|
|
4012
|
-
if (
|
|
4022
|
+
if (er.test(n))
|
|
4013
4023
|
return i === n;
|
|
4014
4024
|
const r = n.replace(/\./g, "\\.");
|
|
4015
4025
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4030,9 +4040,9 @@ function Qi(n) {
|
|
|
4030
4040
|
* See the License for the specific language governing permissions and
|
|
4031
4041
|
* limitations under the License.
|
|
4032
4042
|
*/
|
|
4033
|
-
const
|
|
4034
|
-
function
|
|
4035
|
-
const n =
|
|
4043
|
+
const rr = new X(3e4, 6e4);
|
|
4044
|
+
function ot() {
|
|
4045
|
+
const n = y().___jsl;
|
|
4036
4046
|
if (n != null && n.H) {
|
|
4037
4047
|
for (const e of Object.keys(n.H))
|
|
4038
4048
|
if (n.H[e].r = n.H[e].r || [], n.H[e].L = n.H[e].L || [], n.H[e].r = [...n.H[e].L], n.CP)
|
|
@@ -4040,45 +4050,45 @@ function it() {
|
|
|
4040
4050
|
n.CP[t] = null;
|
|
4041
4051
|
}
|
|
4042
4052
|
}
|
|
4043
|
-
function
|
|
4053
|
+
function sr(n) {
|
|
4044
4054
|
return new Promise((e, t) => {
|
|
4045
4055
|
var i, r, s;
|
|
4046
4056
|
function o() {
|
|
4047
|
-
|
|
4057
|
+
ot(), gapi.load("gapi.iframes", {
|
|
4048
4058
|
callback: () => {
|
|
4049
4059
|
e(gapi.iframes.getContext());
|
|
4050
4060
|
},
|
|
4051
4061
|
ontimeout: () => {
|
|
4052
|
-
|
|
4062
|
+
ot(), t(T(
|
|
4053
4063
|
n,
|
|
4054
4064
|
"network-request-failed"
|
|
4055
4065
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4056
4066
|
));
|
|
4057
4067
|
},
|
|
4058
|
-
timeout:
|
|
4068
|
+
timeout: rr.get()
|
|
4059
4069
|
});
|
|
4060
4070
|
}
|
|
4061
|
-
if (!((r = (i =
|
|
4071
|
+
if (!((r = (i = y().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4062
4072
|
e(gapi.iframes.getContext());
|
|
4063
|
-
else if (!((s =
|
|
4073
|
+
else if (!((s = y().gapi) === null || s === void 0) && s.load)
|
|
4064
4074
|
o();
|
|
4065
4075
|
else {
|
|
4066
|
-
const c =
|
|
4067
|
-
return
|
|
4068
|
-
gapi.load ? o() : t(
|
|
4076
|
+
const c = ci("iframefcb");
|
|
4077
|
+
return y()[c] = () => {
|
|
4078
|
+
gapi.load ? o() : t(T(
|
|
4069
4079
|
n,
|
|
4070
4080
|
"network-request-failed"
|
|
4071
4081
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4072
4082
|
));
|
|
4073
|
-
},
|
|
4083
|
+
}, oi(`${ai()}?onload=${c}`).catch((a) => t(a));
|
|
4074
4084
|
}
|
|
4075
4085
|
}).catch((e) => {
|
|
4076
|
-
throw
|
|
4086
|
+
throw ae = null, e;
|
|
4077
4087
|
});
|
|
4078
4088
|
}
|
|
4079
|
-
let
|
|
4080
|
-
function
|
|
4081
|
-
return
|
|
4089
|
+
let ae = null;
|
|
4090
|
+
function or(n) {
|
|
4091
|
+
return ae = ae || sr(n), ae;
|
|
4082
4092
|
}
|
|
4083
4093
|
/**
|
|
4084
4094
|
* @license
|
|
@@ -4096,7 +4106,7 @@ function tr(n) {
|
|
|
4096
4106
|
* See the License for the specific language governing permissions and
|
|
4097
4107
|
* limitations under the License.
|
|
4098
4108
|
*/
|
|
4099
|
-
const
|
|
4109
|
+
const ar = new X(5e3, 15e3), cr = "__/auth/iframe", lr = "emulator/auth/iframe", ur = {
|
|
4100
4110
|
style: {
|
|
4101
4111
|
position: "absolute",
|
|
4102
4112
|
top: "-100px",
|
|
@@ -4105,13 +4115,13 @@ const nr = new X(5e3, 15e3), ir = "__/auth/iframe", rr = "emulator/auth/iframe",
|
|
|
4105
4115
|
},
|
|
4106
4116
|
"aria-hidden": "true",
|
|
4107
4117
|
tabindex: "-1"
|
|
4108
|
-
},
|
|
4118
|
+
}, dr = /* @__PURE__ */ new Map([
|
|
4109
4119
|
["identitytoolkit.googleapis.com", "p"],
|
|
4110
4120
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4111
4121
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4112
4122
|
// test
|
|
4113
4123
|
]);
|
|
4114
|
-
function
|
|
4124
|
+
function hr(n) {
|
|
4115
4125
|
const e = n.config;
|
|
4116
4126
|
u(
|
|
4117
4127
|
e.authDomain,
|
|
@@ -4119,17 +4129,17 @@ function ar(n) {
|
|
|
4119
4129
|
"auth-domain-config-required"
|
|
4120
4130
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4121
4131
|
);
|
|
4122
|
-
const t = e.emulator ?
|
|
4132
|
+
const t = e.emulator ? Me(e, lr) : `https://${n.config.authDomain}/${cr}`, i = {
|
|
4123
4133
|
apiKey: e.apiKey,
|
|
4124
4134
|
appName: n.name,
|
|
4125
4135
|
v: J
|
|
4126
|
-
}, r =
|
|
4136
|
+
}, r = dr.get(n.config.apiHost);
|
|
4127
4137
|
r && (i.eid = r);
|
|
4128
4138
|
const s = n._getFrameworks();
|
|
4129
4139
|
return s.length && (i.fw = s.join(",")), `${t}?${Y(i).slice(1)}`;
|
|
4130
4140
|
}
|
|
4131
|
-
async function
|
|
4132
|
-
const e = await
|
|
4141
|
+
async function fr(n) {
|
|
4142
|
+
const e = await or(n), t = y().gapi;
|
|
4133
4143
|
return u(
|
|
4134
4144
|
t,
|
|
4135
4145
|
n,
|
|
@@ -4137,24 +4147,24 @@ async function cr(n) {
|
|
|
4137
4147
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4138
4148
|
), e.open({
|
|
4139
4149
|
where: document.body,
|
|
4140
|
-
url:
|
|
4150
|
+
url: hr(n),
|
|
4141
4151
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4142
|
-
attributes:
|
|
4152
|
+
attributes: ur,
|
|
4143
4153
|
dontclear: !0
|
|
4144
4154
|
}, (i) => new Promise(async (r, s) => {
|
|
4145
4155
|
await i.restyle({
|
|
4146
4156
|
// Prevent iframe from closing on mouse out.
|
|
4147
4157
|
setHideOnLeave: !1
|
|
4148
4158
|
});
|
|
4149
|
-
const o =
|
|
4159
|
+
const o = T(
|
|
4150
4160
|
n,
|
|
4151
4161
|
"network-request-failed"
|
|
4152
4162
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4153
|
-
), c =
|
|
4163
|
+
), c = y().setTimeout(() => {
|
|
4154
4164
|
s(o);
|
|
4155
|
-
},
|
|
4165
|
+
}, ar.get());
|
|
4156
4166
|
function a() {
|
|
4157
|
-
|
|
4167
|
+
y().clearTimeout(c), r(i);
|
|
4158
4168
|
}
|
|
4159
4169
|
i.ping(a).then(a, () => {
|
|
4160
4170
|
s(o);
|
|
@@ -4177,13 +4187,13 @@ async function cr(n) {
|
|
|
4177
4187
|
* See the License for the specific language governing permissions and
|
|
4178
4188
|
* limitations under the License.
|
|
4179
4189
|
*/
|
|
4180
|
-
const
|
|
4190
|
+
const pr = {
|
|
4181
4191
|
location: "yes",
|
|
4182
4192
|
resizable: "yes",
|
|
4183
4193
|
statusbar: "yes",
|
|
4184
4194
|
toolbar: "no"
|
|
4185
|
-
},
|
|
4186
|
-
class
|
|
4195
|
+
}, mr = 500, gr = 600, _r = "_blank", vr = "http://localhost";
|
|
4196
|
+
class at {
|
|
4187
4197
|
constructor(e) {
|
|
4188
4198
|
this.window = e, this.associatedEvent = null;
|
|
4189
4199
|
}
|
|
@@ -4195,19 +4205,19 @@ class rt {
|
|
|
4195
4205
|
}
|
|
4196
4206
|
}
|
|
4197
4207
|
}
|
|
4198
|
-
function
|
|
4208
|
+
function Ir(n, e, t, i = mr, r = gr) {
|
|
4199
4209
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4200
4210
|
let c = "";
|
|
4201
|
-
const a = Object.assign(Object.assign({},
|
|
4211
|
+
const a = Object.assign(Object.assign({}, pr), {
|
|
4202
4212
|
width: i.toString(),
|
|
4203
4213
|
height: r.toString(),
|
|
4204
4214
|
top: s,
|
|
4205
4215
|
left: o
|
|
4206
|
-
}), l =
|
|
4207
|
-
t && (c =
|
|
4208
|
-
const d = Object.entries(a).reduce((
|
|
4209
|
-
if (
|
|
4210
|
-
return
|
|
4216
|
+
}), l = _().toLowerCase();
|
|
4217
|
+
t && (c = Ct(l) ? _r : t), At(l) && (e = e || vr, a.scrollbars = "yes");
|
|
4218
|
+
const d = Object.entries(a).reduce((p, [w, U]) => `${p}${w}=${U},`, "");
|
|
4219
|
+
if (Xn(l) && c !== "_self")
|
|
4220
|
+
return Tr(e || "", c), new at(null);
|
|
4211
4221
|
const h = window.open(e || "", c, d);
|
|
4212
4222
|
u(
|
|
4213
4223
|
h,
|
|
@@ -4219,9 +4229,9 @@ function pr(n, e, t, i = ur, r = dr) {
|
|
|
4219
4229
|
h.focus();
|
|
4220
4230
|
} catch {
|
|
4221
4231
|
}
|
|
4222
|
-
return new
|
|
4232
|
+
return new at(h);
|
|
4223
4233
|
}
|
|
4224
|
-
function
|
|
4234
|
+
function Tr(n, e) {
|
|
4225
4235
|
const t = document.createElement("a");
|
|
4226
4236
|
t.href = n, t.target = e;
|
|
4227
4237
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4243,8 +4253,8 @@ function mr(n, e) {
|
|
|
4243
4253
|
* See the License for the specific language governing permissions and
|
|
4244
4254
|
* limitations under the License.
|
|
4245
4255
|
*/
|
|
4246
|
-
const
|
|
4247
|
-
async function
|
|
4256
|
+
const yr = "__/auth/handler", wr = "emulator/auth/handler", Er = encodeURIComponent("fac");
|
|
4257
|
+
async function ct(n, e, t, i, r, s) {
|
|
4248
4258
|
u(
|
|
4249
4259
|
n.config.authDomain,
|
|
4250
4260
|
n,
|
|
@@ -4264,8 +4274,8 @@ async function st(n, e, t, i, r, s) {
|
|
|
4264
4274
|
v: J,
|
|
4265
4275
|
eventId: r
|
|
4266
4276
|
};
|
|
4267
|
-
if (e instanceof
|
|
4268
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4277
|
+
if (e instanceof Vt) {
|
|
4278
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", bn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4269
4279
|
for (const [d, h] of Object.entries({}))
|
|
4270
4280
|
o[d] = h;
|
|
4271
4281
|
}
|
|
@@ -4277,11 +4287,11 @@ async function st(n, e, t, i, r, s) {
|
|
|
4277
4287
|
const c = o;
|
|
4278
4288
|
for (const d of Object.keys(c))
|
|
4279
4289
|
c[d] === void 0 && delete c[d];
|
|
4280
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4281
|
-
return `${
|
|
4290
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Er}=${encodeURIComponent(a)}` : "";
|
|
4291
|
+
return `${kr(n)}?${Y(c).slice(1)}${l}`;
|
|
4282
4292
|
}
|
|
4283
|
-
function
|
|
4284
|
-
return n.emulator ?
|
|
4293
|
+
function kr({ config: n }) {
|
|
4294
|
+
return n.emulator ? Me(n, wr) : `https://${n.authDomain}/${yr}`;
|
|
4285
4295
|
}
|
|
4286
4296
|
/**
|
|
4287
4297
|
* @license
|
|
@@ -4300,29 +4310,29 @@ function Ir({ config: n }) {
|
|
|
4300
4310
|
* limitations under the License.
|
|
4301
4311
|
*/
|
|
4302
4312
|
const we = "webStorageSupport";
|
|
4303
|
-
class
|
|
4313
|
+
class br {
|
|
4304
4314
|
constructor() {
|
|
4305
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4315
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Bt, this._completeRedirectFn = Ji, this._overrideRedirectResult = zi;
|
|
4306
4316
|
}
|
|
4307
4317
|
// Wrapping in async even though we don't await anywhere in order
|
|
4308
4318
|
// to make sure errors are raised as promise rejections
|
|
4309
4319
|
async _openPopup(e, t, i, r) {
|
|
4310
4320
|
var s;
|
|
4311
|
-
|
|
4312
|
-
const o = await
|
|
4313
|
-
return
|
|
4321
|
+
P((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4322
|
+
const o = await ct(e, t, i, Re(), r);
|
|
4323
|
+
return Ir(e, o, xe());
|
|
4314
4324
|
}
|
|
4315
4325
|
async _openRedirect(e, t, i, r) {
|
|
4316
4326
|
await this._originValidation(e);
|
|
4317
|
-
const s = await
|
|
4318
|
-
return
|
|
4327
|
+
const s = await ct(e, t, i, Re(), r);
|
|
4328
|
+
return Pi(s), new Promise(() => {
|
|
4319
4329
|
});
|
|
4320
4330
|
}
|
|
4321
4331
|
_initialize(e) {
|
|
4322
4332
|
const t = e._key();
|
|
4323
4333
|
if (this.eventManagers[t]) {
|
|
4324
4334
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4325
|
-
return r ? Promise.resolve(r) : (
|
|
4335
|
+
return r ? Promise.resolve(r) : (P(s, "If manager is not set, promise should be"), s);
|
|
4326
4336
|
}
|
|
4327
4337
|
const i = this.initAndGetManager(e);
|
|
4328
4338
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4330,7 +4340,7 @@ class Tr {
|
|
|
4330
4340
|
}), i;
|
|
4331
4341
|
}
|
|
4332
4342
|
async initAndGetManager(e) {
|
|
4333
|
-
const t = await
|
|
4343
|
+
const t = await fr(e), i = new Xi(e);
|
|
4334
4344
|
return t.register("authEvent", (r) => (u(
|
|
4335
4345
|
r == null ? void 0 : r.authEvent,
|
|
4336
4346
|
e,
|
|
@@ -4345,7 +4355,7 @@ class Tr {
|
|
|
4345
4355
|
this.iframes[e._key()].send(we, { type: we }, (r) => {
|
|
4346
4356
|
var s;
|
|
4347
4357
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[we];
|
|
4348
|
-
o !== void 0 && t(!!o),
|
|
4358
|
+
o !== void 0 && t(!!o), R(
|
|
4349
4359
|
e,
|
|
4350
4360
|
"internal-error"
|
|
4351
4361
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4354,14 +4364,14 @@ class Tr {
|
|
|
4354
4364
|
}
|
|
4355
4365
|
_originValidation(e) {
|
|
4356
4366
|
const t = e._key();
|
|
4357
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4367
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = nr(e)), this.originValidationPromises[t];
|
|
4358
4368
|
}
|
|
4359
4369
|
get _shouldInitProactively() {
|
|
4360
|
-
return
|
|
4370
|
+
return Ut() || De() || pe();
|
|
4361
4371
|
}
|
|
4362
4372
|
}
|
|
4363
|
-
const
|
|
4364
|
-
var
|
|
4373
|
+
const Sr = br;
|
|
4374
|
+
var lt = "@firebase/auth", ut = "1.7.5";
|
|
4365
4375
|
/**
|
|
4366
4376
|
* @license
|
|
4367
4377
|
* Copyright 2020 Google LLC
|
|
@@ -4378,7 +4388,7 @@ var ot = "@firebase/auth", at = "1.7.5";
|
|
|
4378
4388
|
* See the License for the specific language governing permissions and
|
|
4379
4389
|
* limitations under the License.
|
|
4380
4390
|
*/
|
|
4381
|
-
class
|
|
4391
|
+
class Rr {
|
|
4382
4392
|
constructor(e) {
|
|
4383
4393
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4384
4394
|
}
|
|
@@ -4429,7 +4439,7 @@ class yr {
|
|
|
4429
4439
|
* See the License for the specific language governing permissions and
|
|
4430
4440
|
* limitations under the License.
|
|
4431
4441
|
*/
|
|
4432
|
-
function
|
|
4442
|
+
function Pr(n) {
|
|
4433
4443
|
switch (n) {
|
|
4434
4444
|
case "Node":
|
|
4435
4445
|
return "node";
|
|
@@ -4445,8 +4455,8 @@ function Er(n) {
|
|
|
4445
4455
|
return;
|
|
4446
4456
|
}
|
|
4447
4457
|
}
|
|
4448
|
-
function
|
|
4449
|
-
|
|
4458
|
+
function Ar(n) {
|
|
4459
|
+
ze(new qe(
|
|
4450
4460
|
"auth",
|
|
4451
4461
|
(e, { options: t }) => {
|
|
4452
4462
|
const i = e.getProvider("app").getImmediate(), r = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: o, authDomain: c } = i.options;
|
|
@@ -4458,9 +4468,9 @@ function kr(n) {
|
|
|
4458
4468
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4459
4469
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4460
4470
|
apiScheme: "https",
|
|
4461
|
-
sdkClientVersion:
|
|
4462
|
-
}, l = new
|
|
4463
|
-
return
|
|
4471
|
+
sdkClientVersion: Dt(n)
|
|
4472
|
+
}, l = new ri(i, r, s, a);
|
|
4473
|
+
return ui(l, t), l;
|
|
4464
4474
|
},
|
|
4465
4475
|
"PUBLIC"
|
|
4466
4476
|
/* ComponentType.PUBLIC */
|
|
@@ -4472,21 +4482,21 @@ function kr(n) {
|
|
|
4472
4482
|
"auth-internal"
|
|
4473
4483
|
/* _ComponentName.AUTH_INTERNAL */
|
|
4474
4484
|
).initialize();
|
|
4475
|
-
})),
|
|
4485
|
+
})), ze(new qe(
|
|
4476
4486
|
"auth-internal",
|
|
4477
4487
|
(e) => {
|
|
4478
|
-
const t =
|
|
4488
|
+
const t = me(e.getProvider(
|
|
4479
4489
|
"auth"
|
|
4480
4490
|
/* _ComponentName.AUTH */
|
|
4481
4491
|
).getImmediate());
|
|
4482
|
-
return ((i) => new
|
|
4492
|
+
return ((i) => new Rr(i))(t);
|
|
4483
4493
|
},
|
|
4484
4494
|
"PRIVATE"
|
|
4485
4495
|
/* ComponentType.PRIVATE */
|
|
4486
4496
|
).setInstantiationMode(
|
|
4487
4497
|
"EXPLICIT"
|
|
4488
4498
|
/* InstantiationMode.EXPLICIT */
|
|
4489
|
-
)),
|
|
4499
|
+
)), Se(lt, ut, Pr(n)), Se(lt, ut, "esm2017");
|
|
4490
4500
|
}
|
|
4491
4501
|
/**
|
|
4492
4502
|
* @license
|
|
@@ -4504,117 +4514,117 @@ function kr(n) {
|
|
|
4504
4514
|
* See the License for the specific language governing permissions and
|
|
4505
4515
|
* limitations under the License.
|
|
4506
4516
|
*/
|
|
4507
|
-
const
|
|
4508
|
-
let
|
|
4509
|
-
const
|
|
4517
|
+
const Cr = 5 * 60, Or = gt("authIdTokenMaxAge") || Cr;
|
|
4518
|
+
let dt = null;
|
|
4519
|
+
const Nr = (n) => async (e) => {
|
|
4510
4520
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4511
|
-
if (i && i >
|
|
4521
|
+
if (i && i > Or)
|
|
4512
4522
|
return;
|
|
4513
4523
|
const r = t == null ? void 0 : t.token;
|
|
4514
|
-
|
|
4524
|
+
dt !== r && (dt = r, await fetch(n, {
|
|
4515
4525
|
method: r ? "POST" : "DELETE",
|
|
4516
4526
|
headers: r ? {
|
|
4517
4527
|
Authorization: `Bearer ${r}`
|
|
4518
4528
|
} : {}
|
|
4519
4529
|
}));
|
|
4520
4530
|
};
|
|
4521
|
-
function
|
|
4522
|
-
const e =
|
|
4531
|
+
function Lr(n = yn()) {
|
|
4532
|
+
const e = _t(n, "auth");
|
|
4523
4533
|
if (e.isInitialized())
|
|
4524
4534
|
return e.getImmediate();
|
|
4525
|
-
const t =
|
|
4526
|
-
popupRedirectResolver:
|
|
4535
|
+
const t = li(n, {
|
|
4536
|
+
popupRedirectResolver: Sr,
|
|
4527
4537
|
persistence: [
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4538
|
+
Fi,
|
|
4539
|
+
bi,
|
|
4540
|
+
Bt
|
|
4531
4541
|
]
|
|
4532
|
-
}), i =
|
|
4542
|
+
}), i = gt("authTokenSyncURL");
|
|
4533
4543
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4534
4544
|
const s = new URL(i, location.origin);
|
|
4535
4545
|
if (location.origin === s.origin) {
|
|
4536
|
-
const o =
|
|
4537
|
-
|
|
4546
|
+
const o = Nr(s.toString());
|
|
4547
|
+
yi(t, o, () => o(t.currentUser)), Ti(t, (c) => o(c));
|
|
4538
4548
|
}
|
|
4539
4549
|
}
|
|
4540
|
-
const r =
|
|
4541
|
-
return r &&
|
|
4550
|
+
const r = Tn("auth");
|
|
4551
|
+
return r && di(t, `http://${r}`), t;
|
|
4542
4552
|
}
|
|
4543
|
-
function
|
|
4553
|
+
function Mr() {
|
|
4544
4554
|
var n, e;
|
|
4545
4555
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4546
4556
|
}
|
|
4547
|
-
|
|
4557
|
+
si({
|
|
4548
4558
|
loadJS(n) {
|
|
4549
4559
|
return new Promise((e, t) => {
|
|
4550
4560
|
const i = document.createElement("script");
|
|
4551
4561
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4552
|
-
const s =
|
|
4562
|
+
const s = T(
|
|
4553
4563
|
"internal-error"
|
|
4554
4564
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4555
4565
|
);
|
|
4556
4566
|
s.customData = r, t(s);
|
|
4557
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4567
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", Mr().appendChild(i);
|
|
4558
4568
|
});
|
|
4559
4569
|
},
|
|
4560
4570
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4561
4571
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4562
4572
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4563
4573
|
});
|
|
4564
|
-
|
|
4574
|
+
Ar(
|
|
4565
4575
|
"Browser"
|
|
4566
4576
|
/* ClientPlatform.BROWSER */
|
|
4567
4577
|
);
|
|
4568
|
-
var
|
|
4569
|
-
const
|
|
4578
|
+
var Ur = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476" }, Dr = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
4579
|
+
const Fr = {
|
|
4570
4580
|
key: 1,
|
|
4571
4581
|
class: "h-full w-full"
|
|
4572
|
-
},
|
|
4582
|
+
}, xr = ["src"], Zr = /* @__PURE__ */ ht({
|
|
4573
4583
|
__name: "App",
|
|
4574
4584
|
setup(n) {
|
|
4575
|
-
const e =
|
|
4576
|
-
const
|
|
4577
|
-
return `${
|
|
4585
|
+
const e = be(), t = cn(), i = ln(), r = un(), s = dn(), o = mt(), c = te(o.query.showHeader !== "false"), a = te(!1), { currentBusiness: l } = be(), d = te(!1), h = Ee(() => i.version), p = Ee(() => {
|
|
4586
|
+
const m = e.currentCountry.value || "MY", g = Ke.getIdToken(), I = l.value._id;
|
|
4587
|
+
return `${Dr.marketingV1Portal}/b/${I}/marketing/overview?showHeader=false&country=${m}&token=${g}`;
|
|
4578
4588
|
});
|
|
4579
|
-
async function
|
|
4580
|
-
if (
|
|
4589
|
+
async function w() {
|
|
4590
|
+
if (Sn().length) {
|
|
4581
4591
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4582
4592
|
return;
|
|
4583
4593
|
}
|
|
4584
|
-
const
|
|
4585
|
-
await
|
|
4594
|
+
const m = Rn(Ur.firebase), g = await an.getCustomToken(), I = Lr();
|
|
4595
|
+
await Ii(I, g), Pn(m), console.log("initFirebase", m);
|
|
4586
4596
|
}
|
|
4587
|
-
const
|
|
4588
|
-
d.value = !1, await
|
|
4597
|
+
const U = async () => {
|
|
4598
|
+
d.value = !1, await rn(), console.log("forceRerender"), Ke.setBusinessId(l.value._id), await i.readPremium(), !a.value && h.value === "v2" ? e.registerSidebarComponent(Nn) : e.hideSidebarToggle(!0), await w(), a.value = !0, d.value = !0;
|
|
4589
4599
|
};
|
|
4590
|
-
return
|
|
4591
|
-
if (
|
|
4592
|
-
const
|
|
4593
|
-
|
|
4600
|
+
return en(() => {
|
|
4601
|
+
if (An.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4602
|
+
const m = document.getElementsByClassName("app-header")[0], g = document.getElementsByClassName("app-sidebar")[0], I = document.getElementsByClassName("app-container")[0], x = document.getElementsByTagName("main")[0];
|
|
4603
|
+
m == null || m.classList.add("!hidden"), g == null || g.classList.add("!pt-0"), I == null || I.classList.add("!pt-0"), x == null || x.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4594
4604
|
}
|
|
4595
|
-
l.value != null && (console.log("App mounted, forceRerender"),
|
|
4596
|
-
}),
|
|
4605
|
+
l.value != null && (console.log("App mounted, forceRerender"), U());
|
|
4606
|
+
}), ft(
|
|
4597
4607
|
() => e.currentBusiness.value,
|
|
4598
|
-
async (
|
|
4599
|
-
console.log("Current business changed"),
|
|
4608
|
+
async (m, g) => {
|
|
4609
|
+
console.log("Current business changed"), m != null && m._id != g._id && (console.log("forceRerender when business changes", m, g), U());
|
|
4600
4610
|
}
|
|
4601
|
-
), (
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
json: { url:
|
|
4611
|
+
), (m, g) => (ne(), ke(tn, null, [
|
|
4612
|
+
v(d) && v(h) === "v2" ? (ne(), nn(v(on), { key: 0 })) : Be("", !0),
|
|
4613
|
+
v(d) && v(h) !== "v2" ? (ne(), ke("div", Fr, [
|
|
4614
|
+
pt(pn, {
|
|
4615
|
+
json: { url: v(p) }
|
|
4606
4616
|
}, null, 8, ["json"]),
|
|
4607
|
-
|
|
4617
|
+
ie("iframe", {
|
|
4608
4618
|
allow: "clipboard-read; clipboard-write",
|
|
4609
4619
|
frameBorder: "0",
|
|
4610
4620
|
height: "100%",
|
|
4611
4621
|
width: "100%",
|
|
4612
|
-
src:
|
|
4613
|
-
}, null, 8,
|
|
4614
|
-
])) :
|
|
4622
|
+
src: v(p)
|
|
4623
|
+
}, null, 8, xr)
|
|
4624
|
+
])) : Be("", !0)
|
|
4615
4625
|
], 64));
|
|
4616
4626
|
}
|
|
4617
4627
|
});
|
|
4618
4628
|
export {
|
|
4619
|
-
|
|
4629
|
+
Zr as default
|
|
4620
4630
|
};
|