@feedmepos/mf-connect 0.1.0-beta.2 → 0.1.0-beta.20
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-CRdCf6rP.js +424 -0
- package/dist/{App-D8a5eW51.js → App-CJ9oNLV2.js} +366 -354
- package/dist/{Broadcast-C8jgMe6g.js → Broadcast-CatMmvNa.js} +32 -32
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-pG8WvV4I.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYs2Sl5w.js} +8 -8
- package/dist/Card-C3D59N5q.js +685 -0
- package/dist/{Collections-lMrdPUuM.js → Collections-BuCo1O9x.js} +4 -4
- package/dist/{Credit-CJfU5tP4.js → Credit-Babu5EE5.js} +14 -14
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWJw6H-M.js +2198 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CzEtOmp0.js → EffectSheet.vue_vue_type_style_index_0_lang-DSEvgx4z.js} +8 -8
- package/dist/{Experience-Bp2ki8gU.js → Experience-XMGv8EGx.js} +8 -8
- package/dist/{Game-BpTf6ebE.js → Game-Cz7YHbx1.js} +15 -15
- package/dist/Index-CQ4S3D3g.js +218 -0
- package/dist/Marketing-8E28mxPt.js +20070 -0
- package/dist/{Member-BSWyy32a.js → Member-4y7vThK4.js} +4 -4
- package/dist/MemberList-DFoEZqv5.js +1045 -0
- package/dist/{MemberTransactions-BzHiXCnp.js → MemberTransactions-CEud4gEU.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-e-zWg08J.js → MessageInput.vue_vue_type_script_setup_true_lang-SVX4fpOu.js} +2 -2
- package/dist/{Mission-8IGT3T2C.js → Mission-ChRlRXfM.js} +16 -16
- package/dist/Overview-C2xrurYW.js +879 -0
- package/dist/{Point-CbbJ6ohd.js → Point-CLIcUoCI.js} +23 -23
- package/dist/{Promotion-BYXCJa_S.js → Promotion-BAimCBQb.js} +53 -47
- package/dist/Record-D9DGLK8k.js +178 -0
- package/dist/Reward-xaALJ6xT.js +399 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BbpCY-d1.js +151 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-wncxK2In.js +1597 -0
- package/dist/Segment-BbholIXr.js +567 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BiT1S0GE.js +181 -0
- package/dist/{Setting-CLpvvZTv.js → Setting-CuZ3rq-3.js} +8 -8
- package/dist/Store-C_BMTPfl.js +1745 -0
- package/dist/{StoreRewards-CUM2irXK.js → StoreRewards-D0W2z3Gq.js} +12 -12
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-E-QcGATx.js +957 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DEb4OBcX.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C-ogUCbh.js} +1 -1
- package/dist/{Tier-DZTDxWBo.js → Tier-BfST7Yfl.js} +15 -15
- package/dist/{Title-C2Dr5ceK.js → Title-CEdQyyyg.js} +15 -15
- package/dist/{Transaction-BL4mS29d.js → Transaction-CYbYZrpN.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Bgdt5pzT.js +130 -0
- package/dist/{Voucher-Cx0r2-df.js → Voucher-BGFUSHh3.js} +31 -31
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-jektdiG2.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js → ZodTextField.vue_vue_type_script_setup_true_lang-Cd752C-h.js} +1 -1
- package/dist/{app-B_xuZ5HB.js → app-DkwHJjXn.js} +1 -1
- package/dist/{app-wE5HTF_Y.js → app-TsBYmI-P.js} +1277 -1282
- package/dist/app.js +1 -1
- package/dist/{business-DSv8zM8C.js → business-ChsnaYdk.js} +1 -1
- package/dist/{campaign-7y5qquHZ.js → campaign-PnS10H-F.js} +2 -2
- package/dist/collectible.enum-BZIdjWua.js +19 -0
- package/dist/{collection.fn-BxVZQAx0.js → collection.fn-9np7--Dl.js} +2 -2
- package/dist/{dto-Ew1QwLci.js → dto-IypAMCcg.js} +12 -20
- package/dist/{effect-BzPh8fRI.js → effect-CCkvCD6X.js} +9 -9
- package/dist/email-addresses-CMJLhz7p.js +705 -0
- package/dist/{export-C9tDplkA.js → export-DkjOipRl.js} +3 -3
- package/dist/{helper-Sz7oQ0F4.js → helper-Bu93Ya_g.js} +1 -1
- package/dist/index-BRaG-yBl.js +53 -0
- package/dist/index-BX1M0DCt.js +1067 -0
- package/dist/{index-C3_4GUiI.js → index-Bzy8Sl5b.js} +7 -1
- package/dist/{index-DBMaUGYI.js → index-C-FIY2IU.js} +30 -26
- package/dist/index-CBMl7QZF.js +28997 -0
- package/dist/{index-z0IfdrZk.js → index-CUhBmJlv.js} +199 -195
- package/dist/{index-tv4t0Pnh.js → index-CZETB7DA.js} +1 -1
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-_3qBsogG.js → index-DLlCBYOm.js} +1500 -1479
- package/dist/{index-C0lpADCo.js → index-DXAQcXA8.js} +1 -1
- package/dist/index-De3DoZV3.js +38 -0
- package/dist/{index-C-SOz7jt.js → index-Dx6gloTe.js} +1 -1
- package/dist/{index-DH_1nOJ_.js → index-JFWJNgz4.js} +39 -35
- package/dist/{index-gIRszcHf.js → index-yNswuwm_.js} +1 -1
- package/dist/{index.esm2017-BnKJDxUo.js → index.esm2017-Df64qzkh.js} +33 -33
- package/dist/{loading-Ds-yFYhc.js → loading-CaxzDKHL.js} +591 -597
- package/dist/{membership-DaiVw9qF.js → membership-BArHVjNf.js} +51 -43
- package/dist/money-B411u9Co.js +15 -0
- package/dist/number-Cqu4G1FZ.js +12 -0
- package/dist/objectid-O8aKbYqY.js +145 -0
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-ikGToGDQ.js +36 -0
- package/dist/{rule-Cd2M6Ri2.js → rule-bi_56V_m.js} +180 -177
- package/dist/{rule-builder-B6og27Q1.js → rule-builder-DqVWht9g.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-DouRWBpv.js → template-CQVQWOPN.js} +5 -5
- package/dist/trigger-BEOn5QSl.js +114 -0
- package/dist/{vue-i18n-BTlOChXs.js → vue-i18n-CVFB09Jw.js} +2 -2
- package/dist/{xlsx-SahfXQ70.js → xlsx-DA3tIqnW.js} +1 -1
- package/package.json +8 -7
- package/dist/Analytic-DSD9TsKr.js +0 -622
- package/dist/Card-C1K7ULPo.js +0 -825
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js +0 -2809
- package/dist/Marketing-BiKE2gxA.js +0 -316
- package/dist/MemberList-CHlGREyR.js +0 -1733
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js +0 -1753
- package/dist/Segment-DXDNM0yd.js +0 -437
- package/dist/Store-C6-P6bwc.js +0 -1511
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-JaRdmqif.js +0 -890
- package/dist/index-BQm0C3Jm.js +0 -298
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-D-2nFLsg.js +0 -762
- package/dist/index-Dy4pmQpt.js +0 -29193
- package/dist/money-BHtBdZoz.js +0 -15
- package/dist/number-CZhcB8ef.js +0 -12
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as lt, ref as
|
|
1
|
+
import { defineComponent as lt, ref as ne, h as Z, watch as ut, resolveComponent as Yt, openBlock as ie, createBlock as dt, unref as P, computed as Ve, onMounted as Xt, createElementBlock as $e, Fragment as Qt, createCommentVNode as He, createVNode as Zt, createElementVNode as en, nextTick as tn } from "vue";
|
|
2
2
|
import { useRouter as nn, useRoute as ht, RouterView as rn } from "vue-router";
|
|
3
3
|
import { useCoreStore as We, FeedMeAuth as sn } from "@feedmepos/mf-common";
|
|
4
4
|
import { u as on } from "./app-wDQR6dpb.js";
|
|
5
|
-
import { u as an } from "./business-
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as un } from "./vue-i18n-
|
|
9
|
-
import { R as f } from "./app-
|
|
5
|
+
import { u as an } from "./business-ChsnaYdk.js";
|
|
6
|
+
import "./index-yNswuwm_.js";
|
|
7
|
+
import { components as ee, useSnackbar as cn, useDialog as ln } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as un } from "./vue-i18n-CVFB09Jw.js";
|
|
9
|
+
import { R as f } from "./app-TsBYmI-P.js";
|
|
10
10
|
import { J as dn } from "./JsonViewer-v8_C7l5N.js";
|
|
11
|
-
import { r as ye, L as hn, g as ft, i as fn, a as pn, _ as je, C as Ge, b as mn, S as z, c as w, d as j, E as
|
|
11
|
+
import { r as ye, L as hn, g as ft, i as fn, a as pn, _ as je, C as Ge, b as mn, S as z, c as w, d as j, E as Se, e as gn, f as pt, h as _n, j as vn, k as mt, l as g, m as In, F as Re, n as Tn, q as K, o as wn, p as yn, s as En, t as kn, u as bn } from "./index.esm2017-Df64qzkh.js";
|
|
12
12
|
import { _ as Pe } from "./tslib.es6-BCqqvLQ_.js";
|
|
13
|
-
import { S as Be } from "./index-
|
|
14
|
-
|
|
13
|
+
import { S as Be, c as Sn } from "./index-CBMl7QZF.js";
|
|
14
|
+
import { Y as Rn } from "./remy-vue-client-Cpppk9h-.js";
|
|
15
|
+
const Pn = /* @__PURE__ */ lt({
|
|
15
16
|
__name: "NavigationTab",
|
|
16
17
|
setup(n) {
|
|
17
|
-
const { t: e } = un(), t =
|
|
18
|
+
const { t: e } = un(), t = ne(), i = [
|
|
18
19
|
{
|
|
19
20
|
label: e("connect.navigation.analytic"),
|
|
20
21
|
value: f["$connect-ANALYTIC"]
|
|
@@ -56,7 +57,7 @@ const bn = /* @__PURE__ */ lt({
|
|
|
56
57
|
{
|
|
57
58
|
label: e("connect.navigation.point"),
|
|
58
59
|
value: f["$connect-PROGRAM_POINT"],
|
|
59
|
-
badge: () =>
|
|
60
|
+
badge: () => Z(ee.FmPill, { variant: "premium" })
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
label: e("connect.navigation.credit"),
|
|
@@ -65,7 +66,7 @@ const bn = /* @__PURE__ */ lt({
|
|
|
65
66
|
{
|
|
66
67
|
label: e("connect.navigation.game"),
|
|
67
68
|
value: f["$connect-PROGRAM_GAME"],
|
|
68
|
-
badge: () =>
|
|
69
|
+
badge: () => Z(ee.FmPill, { variant: "premium" })
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
72
|
label: "Mission",
|
|
@@ -84,15 +85,19 @@ const bn = /* @__PURE__ */ lt({
|
|
|
84
85
|
{
|
|
85
86
|
label: e("connect.navigation.segments"),
|
|
86
87
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
87
|
-
badge: () =>
|
|
88
|
+
badge: () => Z(ee.FmPill, { variant: "premium" })
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
label: e("connect.navigation.card"),
|
|
91
92
|
value: f["$connect-LOYALTY_CARD"],
|
|
92
|
-
badge: () =>
|
|
93
|
+
badge: () => Z(ee.FmPill, { variant: "premium" })
|
|
93
94
|
}
|
|
94
95
|
]
|
|
95
96
|
},
|
|
97
|
+
{
|
|
98
|
+
label: e("connect.navigation.referral"),
|
|
99
|
+
value: f["$connect-REFERRAL"]
|
|
100
|
+
},
|
|
96
101
|
{
|
|
97
102
|
label: e("connect.navigation.store"),
|
|
98
103
|
value: f["$connect-STORE"]
|
|
@@ -101,10 +106,10 @@ const bn = /* @__PURE__ */ lt({
|
|
|
101
106
|
label: e("connect.navigation.transaction"),
|
|
102
107
|
value: f["$connect-TRANSACTION"]
|
|
103
108
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
{
|
|
110
|
+
label: "Marketing material",
|
|
111
|
+
value: f["$connect-MARKETING"]
|
|
112
|
+
},
|
|
108
113
|
{
|
|
109
114
|
label: e("connect.navigation.setting"),
|
|
110
115
|
value: f["$connect-SETTING"]
|
|
@@ -124,7 +129,7 @@ const bn = /* @__PURE__ */ lt({
|
|
|
124
129
|
return (a, l) => {
|
|
125
130
|
var h;
|
|
126
131
|
const d = Yt("FmCollapsibleTabs");
|
|
127
|
-
return
|
|
132
|
+
return ie(), dt(d, {
|
|
128
133
|
class: "border-fm-color-neutral-gray-100 border-r py-16 px-4",
|
|
129
134
|
"model-value": (h = P(t)) == null ? void 0 : h.toString(),
|
|
130
135
|
items: i,
|
|
@@ -133,7 +138,7 @@ const bn = /* @__PURE__ */ lt({
|
|
|
133
138
|
};
|
|
134
139
|
}
|
|
135
140
|
});
|
|
136
|
-
var
|
|
141
|
+
var An = "firebase", Cn = "10.12.4";
|
|
137
142
|
/**
|
|
138
143
|
* @license
|
|
139
144
|
* Copyright 2020 Google LLC
|
|
@@ -150,13 +155,13 @@ var Rn = "firebase", Pn = "10.12.4";
|
|
|
150
155
|
* See the License for the specific language governing permissions and
|
|
151
156
|
* limitations under the License.
|
|
152
157
|
*/
|
|
153
|
-
ye(
|
|
158
|
+
ye(An, Cn, "app");
|
|
154
159
|
function gt() {
|
|
155
160
|
return {
|
|
156
161
|
"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."
|
|
157
162
|
};
|
|
158
163
|
}
|
|
159
|
-
const
|
|
164
|
+
const On = gt, _t = new Se("auth", "Firebase", gt());
|
|
160
165
|
/**
|
|
161
166
|
* @license
|
|
162
167
|
* Copyright 2020 Google LLC
|
|
@@ -173,12 +178,12 @@ const An = gt, _t = new be("auth", "Firebase", gt());
|
|
|
173
178
|
* See the License for the specific language governing permissions and
|
|
174
179
|
* limitations under the License.
|
|
175
180
|
*/
|
|
176
|
-
const
|
|
177
|
-
function
|
|
178
|
-
|
|
181
|
+
const ce = new hn("@firebase/auth");
|
|
182
|
+
function Nn(n, ...e) {
|
|
183
|
+
ce.logLevel <= mt.WARN && ce.warn(`Auth (${z}): ${n}`, ...e);
|
|
179
184
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
185
|
+
function re(n, ...e) {
|
|
186
|
+
ce.logLevel <= mt.ERROR && ce.error(`Auth (${z}): ${n}`, ...e);
|
|
182
187
|
}
|
|
183
188
|
/**
|
|
184
189
|
* @license
|
|
@@ -196,15 +201,15 @@ function ie(n, ...e) {
|
|
|
196
201
|
* See the License for the specific language governing permissions and
|
|
197
202
|
* limitations under the License.
|
|
198
203
|
*/
|
|
199
|
-
function
|
|
204
|
+
function b(n, ...e) {
|
|
200
205
|
throw Ae(n, ...e);
|
|
201
206
|
}
|
|
202
207
|
function I(n, ...e) {
|
|
203
208
|
return Ae(n, ...e);
|
|
204
209
|
}
|
|
205
210
|
function vt(n, e, t) {
|
|
206
|
-
const i = Object.assign(Object.assign({},
|
|
207
|
-
return new
|
|
211
|
+
const i = Object.assign(Object.assign({}, On()), { [e]: t });
|
|
212
|
+
return new Se("auth", "Firebase", i).create(e, {
|
|
208
213
|
appName: n.name
|
|
209
214
|
});
|
|
210
215
|
}
|
|
@@ -224,9 +229,9 @@ function u(n, e, ...t) {
|
|
|
224
229
|
}
|
|
225
230
|
function y(n) {
|
|
226
231
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
227
|
-
throw
|
|
232
|
+
throw re(e), new Error(e);
|
|
228
233
|
}
|
|
229
|
-
function
|
|
234
|
+
function S(n, e) {
|
|
230
235
|
n || y(e);
|
|
231
236
|
}
|
|
232
237
|
/**
|
|
@@ -249,7 +254,7 @@ function Ee() {
|
|
|
249
254
|
var n;
|
|
250
255
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
251
256
|
}
|
|
252
|
-
function
|
|
257
|
+
function Ln() {
|
|
253
258
|
return qe() === "http:" || qe() === "https:";
|
|
254
259
|
}
|
|
255
260
|
function qe() {
|
|
@@ -272,15 +277,15 @@ function qe() {
|
|
|
272
277
|
* See the License for the specific language governing permissions and
|
|
273
278
|
* limitations under the License.
|
|
274
279
|
*/
|
|
275
|
-
function
|
|
280
|
+
function Mn() {
|
|
276
281
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
277
282
|
// This is especially true for Cordova apps which have unreliable
|
|
278
283
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
279
284
|
// installed which overwrites the native navigator.onLine value and
|
|
280
285
|
// defines navigator.connection.
|
|
281
|
-
(
|
|
286
|
+
(Ln() || mn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
282
287
|
}
|
|
283
|
-
function
|
|
288
|
+
function Un() {
|
|
284
289
|
if (typeof navigator > "u")
|
|
285
290
|
return null;
|
|
286
291
|
const n = navigator;
|
|
@@ -310,10 +315,10 @@ function Ln() {
|
|
|
310
315
|
*/
|
|
311
316
|
class J {
|
|
312
317
|
constructor(e, t) {
|
|
313
|
-
this.shortDelay = e, this.longDelay = t,
|
|
318
|
+
this.shortDelay = e, this.longDelay = t, S(t > e, "Short delay should be less than long delay!"), this.isMobile = fn() || pn();
|
|
314
319
|
}
|
|
315
320
|
get() {
|
|
316
|
-
return
|
|
321
|
+
return Mn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
317
322
|
}
|
|
318
323
|
}
|
|
319
324
|
/**
|
|
@@ -333,7 +338,7 @@ class J {
|
|
|
333
338
|
* limitations under the License.
|
|
334
339
|
*/
|
|
335
340
|
function Ce(n, e) {
|
|
336
|
-
|
|
341
|
+
S(n.emulator, "Emulator should always be set here");
|
|
337
342
|
const { url: t } = n.emulator;
|
|
338
343
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
339
344
|
}
|
|
@@ -407,7 +412,7 @@ class It {
|
|
|
407
412
|
* See the License for the specific language governing permissions and
|
|
408
413
|
* limitations under the License.
|
|
409
414
|
*/
|
|
410
|
-
const
|
|
415
|
+
const Dn = {
|
|
411
416
|
// Custom token errors.
|
|
412
417
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
413
418
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -498,8 +503,8 @@ const Mn = {
|
|
|
498
503
|
* See the License for the specific language governing permissions and
|
|
499
504
|
* limitations under the License.
|
|
500
505
|
*/
|
|
501
|
-
const
|
|
502
|
-
function
|
|
506
|
+
const Fn = new J(3e4, 6e4);
|
|
507
|
+
function fe(n, e) {
|
|
503
508
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
504
509
|
}
|
|
505
510
|
async function G(n, e, t, i, r = {}) {
|
|
@@ -524,40 +529,40 @@ async function G(n, e, t, i, r = {}) {
|
|
|
524
529
|
}
|
|
525
530
|
async function Tt(n, e, t) {
|
|
526
531
|
n._canInitEmulator = !1;
|
|
527
|
-
const i = Object.assign(Object.assign({},
|
|
532
|
+
const i = Object.assign(Object.assign({}, Dn), e);
|
|
528
533
|
try {
|
|
529
|
-
const r = new
|
|
534
|
+
const r = new xn(n), s = await Promise.race([
|
|
530
535
|
t(),
|
|
531
536
|
r.promise
|
|
532
537
|
]);
|
|
533
538
|
r.clearNetworkTimeout();
|
|
534
539
|
const o = await s.json();
|
|
535
540
|
if ("needConfirmation" in o)
|
|
536
|
-
throw
|
|
541
|
+
throw te(n, "account-exists-with-different-credential", o);
|
|
537
542
|
if (s.ok && !("errorMessage" in o))
|
|
538
543
|
return o;
|
|
539
544
|
{
|
|
540
545
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
541
546
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
542
|
-
throw
|
|
547
|
+
throw te(n, "credential-already-in-use", o);
|
|
543
548
|
if (a === "EMAIL_EXISTS")
|
|
544
|
-
throw
|
|
549
|
+
throw te(n, "email-already-in-use", o);
|
|
545
550
|
if (a === "USER_DISABLED")
|
|
546
|
-
throw
|
|
551
|
+
throw te(n, "user-disabled", o);
|
|
547
552
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
548
553
|
if (l)
|
|
549
554
|
throw vt(n, d, l);
|
|
550
|
-
|
|
555
|
+
b(n, d);
|
|
551
556
|
}
|
|
552
557
|
} catch (r) {
|
|
553
558
|
if (r instanceof Re)
|
|
554
559
|
throw r;
|
|
555
|
-
|
|
560
|
+
b(n, "network-request-failed", { message: String(r) });
|
|
556
561
|
}
|
|
557
562
|
}
|
|
558
563
|
async function wt(n, e, t, i, r = {}) {
|
|
559
564
|
const s = await G(n, e, t, i, r);
|
|
560
|
-
return "mfaPendingCredential" in s &&
|
|
565
|
+
return "mfaPendingCredential" in s && b(n, "multi-factor-auth-required", {
|
|
561
566
|
_serverResponse: s
|
|
562
567
|
}), s;
|
|
563
568
|
}
|
|
@@ -565,21 +570,21 @@ function yt(n, e, t, i) {
|
|
|
565
570
|
const r = `${e}${t}?${i}`;
|
|
566
571
|
return n.config.emulator ? Ce(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
567
572
|
}
|
|
568
|
-
class
|
|
573
|
+
class xn {
|
|
569
574
|
constructor(e) {
|
|
570
575
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
571
576
|
this.timer = setTimeout(() => i(I(
|
|
572
577
|
this.auth,
|
|
573
578
|
"network-request-failed"
|
|
574
579
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
575
|
-
)),
|
|
580
|
+
)), Fn.get());
|
|
576
581
|
});
|
|
577
582
|
}
|
|
578
583
|
clearNetworkTimeout() {
|
|
579
584
|
clearTimeout(this.timer);
|
|
580
585
|
}
|
|
581
586
|
}
|
|
582
|
-
function
|
|
587
|
+
function te(n, e, t) {
|
|
583
588
|
const i = {
|
|
584
589
|
appName: n.name
|
|
585
590
|
};
|
|
@@ -603,7 +608,7 @@ function ee(n, e, t) {
|
|
|
603
608
|
* See the License for the specific language governing permissions and
|
|
604
609
|
* limitations under the License.
|
|
605
610
|
*/
|
|
606
|
-
async function
|
|
611
|
+
async function Vn(n, e) {
|
|
607
612
|
return G(n, "POST", "/v1/accounts:delete", e);
|
|
608
613
|
}
|
|
609
614
|
async function Et(n, e) {
|
|
@@ -634,7 +639,7 @@ function B(n) {
|
|
|
634
639
|
} catch {
|
|
635
640
|
}
|
|
636
641
|
}
|
|
637
|
-
async function
|
|
642
|
+
async function $n(n, e = !1) {
|
|
638
643
|
const t = j(n), i = await t.getIdToken(e), r = Oe(i);
|
|
639
644
|
u(
|
|
640
645
|
r && r.exp && r.auth_time && r.iat,
|
|
@@ -659,12 +664,12 @@ function Te(n) {
|
|
|
659
664
|
function Oe(n) {
|
|
660
665
|
const [e, t, i] = n.split(".");
|
|
661
666
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
662
|
-
return
|
|
667
|
+
return re("JWT malformed, contained fewer than 3 sections"), null;
|
|
663
668
|
try {
|
|
664
669
|
const r = Tn(t);
|
|
665
|
-
return r ? JSON.parse(r) : (
|
|
670
|
+
return r ? JSON.parse(r) : (re("Failed to decode base64 JWT payload"), null);
|
|
666
671
|
} catch (r) {
|
|
667
|
-
return
|
|
672
|
+
return re("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
668
673
|
}
|
|
669
674
|
}
|
|
670
675
|
function ze(n) {
|
|
@@ -705,10 +710,10 @@ async function q(n, e, t = !1) {
|
|
|
705
710
|
try {
|
|
706
711
|
return await e;
|
|
707
712
|
} catch (i) {
|
|
708
|
-
throw i instanceof Re &&
|
|
713
|
+
throw i instanceof Re && Hn(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
709
714
|
}
|
|
710
715
|
}
|
|
711
|
-
function
|
|
716
|
+
function Hn({ code: n }) {
|
|
712
717
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
713
718
|
}
|
|
714
719
|
/**
|
|
@@ -727,7 +732,7 @@ function Vn({ code: n }) {
|
|
|
727
732
|
* See the License for the specific language governing permissions and
|
|
728
733
|
* limitations under the License.
|
|
729
734
|
*/
|
|
730
|
-
class
|
|
735
|
+
class Wn {
|
|
731
736
|
constructor(e) {
|
|
732
737
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
733
738
|
}
|
|
@@ -822,7 +827,7 @@ class ke {
|
|
|
822
827
|
* See the License for the specific language governing permissions and
|
|
823
828
|
* limitations under the License.
|
|
824
829
|
*/
|
|
825
|
-
async function
|
|
830
|
+
async function le(n) {
|
|
826
831
|
var e;
|
|
827
832
|
const t = n.auth, i = await n.getIdToken(), r = await q(n, Et(t, { idToken: i }));
|
|
828
833
|
u(
|
|
@@ -833,7 +838,7 @@ async function ce(n) {
|
|
|
833
838
|
);
|
|
834
839
|
const s = r.users[0];
|
|
835
840
|
n._notifyReloadListener(s);
|
|
836
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? kt(s.providerUserInfo) : [], c =
|
|
841
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? kt(s.providerUserInfo) : [], c = Gn(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, h = {
|
|
837
842
|
uid: s.localId,
|
|
838
843
|
displayName: s.displayName || null,
|
|
839
844
|
photoURL: s.photoUrl || null,
|
|
@@ -847,11 +852,11 @@ async function ce(n) {
|
|
|
847
852
|
};
|
|
848
853
|
Object.assign(n, h);
|
|
849
854
|
}
|
|
850
|
-
async function
|
|
855
|
+
async function jn(n) {
|
|
851
856
|
const e = j(n);
|
|
852
|
-
await
|
|
857
|
+
await le(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
853
858
|
}
|
|
854
|
-
function
|
|
859
|
+
function Gn(n, e) {
|
|
855
860
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
856
861
|
}
|
|
857
862
|
function kt(n) {
|
|
@@ -883,7 +888,7 @@ function kt(n) {
|
|
|
883
888
|
* See the License for the specific language governing permissions and
|
|
884
889
|
* limitations under the License.
|
|
885
890
|
*/
|
|
886
|
-
async function
|
|
891
|
+
async function Bn(n, e) {
|
|
887
892
|
const t = await Tt(n, {}, async () => {
|
|
888
893
|
const i = K({
|
|
889
894
|
grant_type: "refresh_token",
|
|
@@ -904,8 +909,8 @@ async function jn(n, e) {
|
|
|
904
909
|
refreshToken: t.refresh_token
|
|
905
910
|
};
|
|
906
911
|
}
|
|
907
|
-
async function
|
|
908
|
-
return G(n, "POST", "/v2/accounts:revokeToken",
|
|
912
|
+
async function qn(n, e) {
|
|
913
|
+
return G(n, "POST", "/v2/accounts:revokeToken", fe(n, e));
|
|
909
914
|
}
|
|
910
915
|
/**
|
|
911
916
|
* @license
|
|
@@ -923,7 +928,7 @@ async function Gn(n, e) {
|
|
|
923
928
|
* See the License for the specific language governing permissions and
|
|
924
929
|
* limitations under the License.
|
|
925
930
|
*/
|
|
926
|
-
class
|
|
931
|
+
class $ {
|
|
927
932
|
constructor() {
|
|
928
933
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
929
934
|
}
|
|
@@ -968,14 +973,14 @@ class H {
|
|
|
968
973
|
this.refreshToken = null;
|
|
969
974
|
}
|
|
970
975
|
async refresh(e, t) {
|
|
971
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
976
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await Bn(e, t);
|
|
972
977
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
973
978
|
}
|
|
974
979
|
updateTokensAndExpiration(e, t, i) {
|
|
975
980
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
976
981
|
}
|
|
977
982
|
static fromJSON(e, t) {
|
|
978
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
983
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new $();
|
|
979
984
|
return i && (u(typeof i == "string", "internal-error", {
|
|
980
985
|
appName: e
|
|
981
986
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -995,7 +1000,7 @@ class H {
|
|
|
995
1000
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
996
1001
|
}
|
|
997
1002
|
_clone() {
|
|
998
|
-
return Object.assign(new
|
|
1003
|
+
return Object.assign(new $(), this.toJSON());
|
|
999
1004
|
}
|
|
1000
1005
|
_performRefresh() {
|
|
1001
1006
|
return y("not implemented");
|
|
@@ -1023,7 +1028,7 @@ function R(n, e) {
|
|
|
1023
1028
|
class E {
|
|
1024
1029
|
constructor(e) {
|
|
1025
1030
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = Pe(e, ["uid", "auth", "stsTokenManager"]);
|
|
1026
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1031
|
+
this.providerId = "firebase", this.proactiveRefresh = new Wn(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 ke(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1027
1032
|
}
|
|
1028
1033
|
async getIdToken(e) {
|
|
1029
1034
|
const t = await q(this, this.stsTokenManager.getToken(this.auth, e));
|
|
@@ -1035,10 +1040,10 @@ class E {
|
|
|
1035
1040
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1036
1041
|
}
|
|
1037
1042
|
getIdTokenResult(e) {
|
|
1038
|
-
return
|
|
1043
|
+
return $n(this, e);
|
|
1039
1044
|
}
|
|
1040
1045
|
reload() {
|
|
1041
|
-
return
|
|
1046
|
+
return jn(this);
|
|
1042
1047
|
}
|
|
1043
1048
|
_assign(e) {
|
|
1044
1049
|
this !== e && (u(
|
|
@@ -1071,13 +1076,13 @@ class E {
|
|
|
1071
1076
|
}
|
|
1072
1077
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1073
1078
|
let i = !1;
|
|
1074
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1079
|
+
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);
|
|
1075
1080
|
}
|
|
1076
1081
|
async delete() {
|
|
1077
1082
|
if (w(this.auth.app))
|
|
1078
1083
|
return Promise.reject(L(this.auth));
|
|
1079
1084
|
const e = await this.getIdToken();
|
|
1080
|
-
return await q(this,
|
|
1085
|
+
return await q(this, Vn(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1081
1086
|
}
|
|
1082
1087
|
toJSON() {
|
|
1083
1088
|
return Object.assign(Object.assign({
|
|
@@ -1105,16 +1110,16 @@ class E {
|
|
|
1105
1110
|
}
|
|
1106
1111
|
static _fromJSON(e, t) {
|
|
1107
1112
|
var i, r, s, o, c, a, l, d;
|
|
1108
|
-
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, _ = (r = t.email) !== null && r !== void 0 ? r : void 0,
|
|
1113
|
+
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, _ = (r = t.email) !== null && r !== void 0 ? r : void 0, x = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, M = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, Q = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, p = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, m = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, v = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: U, emailVerified: De, isAnonymous: Fe, providerData: ve, stsTokenManager: xe } = t;
|
|
1109
1114
|
u(
|
|
1110
|
-
|
|
1115
|
+
U && xe,
|
|
1111
1116
|
e,
|
|
1112
1117
|
"internal-error"
|
|
1113
1118
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1114
1119
|
);
|
|
1115
|
-
const Kt =
|
|
1120
|
+
const Kt = $.fromJSON(this.name, xe);
|
|
1116
1121
|
u(
|
|
1117
|
-
typeof
|
|
1122
|
+
typeof U == "string",
|
|
1118
1123
|
e,
|
|
1119
1124
|
"internal-error"
|
|
1120
1125
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -1128,22 +1133,22 @@ class E {
|
|
|
1128
1133
|
e,
|
|
1129
1134
|
"internal-error"
|
|
1130
1135
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1131
|
-
), R(
|
|
1136
|
+
), R(x, e.name), R(M, e.name), R(Q, e.name), R(p, e.name), R(m, e.name), R(v, e.name);
|
|
1132
1137
|
const Ie = new E({
|
|
1133
|
-
uid:
|
|
1138
|
+
uid: U,
|
|
1134
1139
|
auth: e,
|
|
1135
1140
|
email: _,
|
|
1136
1141
|
emailVerified: De,
|
|
1137
1142
|
displayName: h,
|
|
1138
1143
|
isAnonymous: Fe,
|
|
1139
1144
|
photoURL: M,
|
|
1140
|
-
phoneNumber:
|
|
1141
|
-
tenantId:
|
|
1145
|
+
phoneNumber: x,
|
|
1146
|
+
tenantId: Q,
|
|
1142
1147
|
stsTokenManager: Kt,
|
|
1143
|
-
createdAt:
|
|
1144
|
-
lastLoginAt:
|
|
1148
|
+
createdAt: m,
|
|
1149
|
+
lastLoginAt: v
|
|
1145
1150
|
});
|
|
1146
|
-
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))),
|
|
1151
|
+
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))), p && (Ie._redirectEventId = p), Ie;
|
|
1147
1152
|
}
|
|
1148
1153
|
/**
|
|
1149
1154
|
* Initialize a User from an idToken server response
|
|
@@ -1151,7 +1156,7 @@ class E {
|
|
|
1151
1156
|
* @param idTokenResponse
|
|
1152
1157
|
*/
|
|
1153
1158
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1154
|
-
const r = new
|
|
1159
|
+
const r = new $();
|
|
1155
1160
|
r.updateFromServerResponse(t);
|
|
1156
1161
|
const s = new E({
|
|
1157
1162
|
uid: t.localId,
|
|
@@ -1159,7 +1164,7 @@ class E {
|
|
|
1159
1164
|
stsTokenManager: r,
|
|
1160
1165
|
isAnonymous: i
|
|
1161
1166
|
});
|
|
1162
|
-
return await
|
|
1167
|
+
return await le(s), s;
|
|
1163
1168
|
}
|
|
1164
1169
|
/**
|
|
1165
1170
|
* Initialize a User from an idToken server response
|
|
@@ -1173,7 +1178,7 @@ class E {
|
|
|
1173
1178
|
"internal-error"
|
|
1174
1179
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1175
1180
|
);
|
|
1176
|
-
const s = r.providerUserInfo !== void 0 ? kt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new
|
|
1181
|
+
const s = r.providerUserInfo !== void 0 ? kt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new $();
|
|
1177
1182
|
c.updateFromIdToken(i);
|
|
1178
1183
|
const a = new E({
|
|
1179
1184
|
uid: r.localId,
|
|
@@ -1213,9 +1218,9 @@ class E {
|
|
|
1213
1218
|
*/
|
|
1214
1219
|
const Ke = /* @__PURE__ */ new Map();
|
|
1215
1220
|
function k(n) {
|
|
1216
|
-
|
|
1221
|
+
S(n instanceof Function, "Expected a class definition");
|
|
1217
1222
|
let e = Ke.get(n);
|
|
1218
|
-
return e ? (
|
|
1223
|
+
return e ? (S(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), Ke.set(n, e), e);
|
|
1219
1224
|
}
|
|
1220
1225
|
/**
|
|
1221
1226
|
* @license
|
|
@@ -1233,7 +1238,7 @@ function k(n) {
|
|
|
1233
1238
|
* See the License for the specific language governing permissions and
|
|
1234
1239
|
* limitations under the License.
|
|
1235
1240
|
*/
|
|
1236
|
-
class
|
|
1241
|
+
class bt {
|
|
1237
1242
|
constructor() {
|
|
1238
1243
|
this.type = "NONE", this.storage = {};
|
|
1239
1244
|
}
|
|
@@ -1255,8 +1260,8 @@ class St {
|
|
|
1255
1260
|
_removeListener(e, t) {
|
|
1256
1261
|
}
|
|
1257
1262
|
}
|
|
1258
|
-
|
|
1259
|
-
const Je =
|
|
1263
|
+
bt.type = "NONE";
|
|
1264
|
+
const Je = bt;
|
|
1260
1265
|
/**
|
|
1261
1266
|
* @license
|
|
1262
1267
|
* Copyright 2019 Google LLC
|
|
@@ -1273,14 +1278,14 @@ const Je = St;
|
|
|
1273
1278
|
* See the License for the specific language governing permissions and
|
|
1274
1279
|
* limitations under the License.
|
|
1275
1280
|
*/
|
|
1276
|
-
function
|
|
1281
|
+
function se(n, e, t) {
|
|
1277
1282
|
return `firebase:${n}:${e}:${t}`;
|
|
1278
1283
|
}
|
|
1279
|
-
class
|
|
1284
|
+
class H {
|
|
1280
1285
|
constructor(e, t, i) {
|
|
1281
1286
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1282
1287
|
const { config: r, name: s } = this.auth;
|
|
1283
|
-
this.fullUserKey =
|
|
1288
|
+
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);
|
|
1284
1289
|
}
|
|
1285
1290
|
setCurrentUser(e) {
|
|
1286
1291
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
@@ -1307,13 +1312,13 @@ class $ {
|
|
|
1307
1312
|
}
|
|
1308
1313
|
static async create(e, t, i = "authUser") {
|
|
1309
1314
|
if (!t.length)
|
|
1310
|
-
return new
|
|
1315
|
+
return new H(k(Je), e, i);
|
|
1311
1316
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1312
1317
|
if (await l._isAvailable())
|
|
1313
1318
|
return l;
|
|
1314
1319
|
}))).filter((l) => l);
|
|
1315
1320
|
let s = r[0] || k(Je);
|
|
1316
|
-
const o =
|
|
1321
|
+
const o = se(i, e.config.apiKey, e.name);
|
|
1317
1322
|
let c = null;
|
|
1318
1323
|
for (const l of t)
|
|
1319
1324
|
try {
|
|
@@ -1326,13 +1331,13 @@ class $ {
|
|
|
1326
1331
|
} catch {
|
|
1327
1332
|
}
|
|
1328
1333
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1329
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1334
|
+
return !s._shouldAllowMigration || !a.length ? new H(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
1330
1335
|
if (l !== s)
|
|
1331
1336
|
try {
|
|
1332
1337
|
await l._remove(o);
|
|
1333
1338
|
} catch {
|
|
1334
1339
|
}
|
|
1335
|
-
})), new
|
|
1340
|
+
})), new H(s, e, i));
|
|
1336
1341
|
}
|
|
1337
1342
|
}
|
|
1338
1343
|
/**
|
|
@@ -1361,7 +1366,7 @@ function Ye(n) {
|
|
|
1361
1366
|
return "IE";
|
|
1362
1367
|
if (e.includes("edge/"))
|
|
1363
1368
|
return "Edge";
|
|
1364
|
-
if (
|
|
1369
|
+
if (St(e))
|
|
1365
1370
|
return "Firefox";
|
|
1366
1371
|
if (e.includes("silk/"))
|
|
1367
1372
|
return "Silk";
|
|
@@ -1382,7 +1387,7 @@ function Ye(n) {
|
|
|
1382
1387
|
}
|
|
1383
1388
|
return "Other";
|
|
1384
1389
|
}
|
|
1385
|
-
function
|
|
1390
|
+
function St(n = g()) {
|
|
1386
1391
|
return /firefox\//i.test(n);
|
|
1387
1392
|
}
|
|
1388
1393
|
function Ne(n = g()) {
|
|
@@ -1404,20 +1409,20 @@ function Ct(n = g()) {
|
|
|
1404
1409
|
function Ot(n = g()) {
|
|
1405
1410
|
return /webos/i.test(n);
|
|
1406
1411
|
}
|
|
1407
|
-
function
|
|
1412
|
+
function pe(n = g()) {
|
|
1408
1413
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1409
1414
|
}
|
|
1410
|
-
function
|
|
1415
|
+
function zn(n = g()) {
|
|
1411
1416
|
var e;
|
|
1412
|
-
return
|
|
1417
|
+
return pe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1413
1418
|
}
|
|
1414
|
-
function
|
|
1419
|
+
function Kn() {
|
|
1415
1420
|
return wn() && document.documentMode === 10;
|
|
1416
1421
|
}
|
|
1417
1422
|
function Nt(n = g()) {
|
|
1418
|
-
return
|
|
1423
|
+
return pe(n) || At(n) || Ot(n) || Ct(n) || /windows phone/i.test(n) || Pt(n);
|
|
1419
1424
|
}
|
|
1420
|
-
function
|
|
1425
|
+
function Jn() {
|
|
1421
1426
|
try {
|
|
1422
1427
|
return !!(window && window !== window.top);
|
|
1423
1428
|
} catch {
|
|
@@ -1471,7 +1476,7 @@ function Lt(n, e = []) {
|
|
|
1471
1476
|
* See the License for the specific language governing permissions and
|
|
1472
1477
|
* limitations under the License.
|
|
1473
1478
|
*/
|
|
1474
|
-
class
|
|
1479
|
+
class Yn {
|
|
1475
1480
|
constructor(e) {
|
|
1476
1481
|
this.auth = e, this.queue = [];
|
|
1477
1482
|
}
|
|
@@ -1526,8 +1531,8 @@ class Kn {
|
|
|
1526
1531
|
* See the License for the specific language governing permissions and
|
|
1527
1532
|
* limitations under the License.
|
|
1528
1533
|
*/
|
|
1529
|
-
async function
|
|
1530
|
-
return G(n, "GET", "/v2/passwordPolicy",
|
|
1534
|
+
async function Xn(n, e = {}) {
|
|
1535
|
+
return G(n, "GET", "/v2/passwordPolicy", fe(n, e));
|
|
1531
1536
|
}
|
|
1532
1537
|
/**
|
|
1533
1538
|
* @license
|
|
@@ -1545,12 +1550,12 @@ async function Jn(n, e = {}) {
|
|
|
1545
1550
|
* See the License for the specific language governing permissions and
|
|
1546
1551
|
* limitations under the License.
|
|
1547
1552
|
*/
|
|
1548
|
-
const
|
|
1549
|
-
class
|
|
1553
|
+
const Qn = 6;
|
|
1554
|
+
class Zn {
|
|
1550
1555
|
constructor(e) {
|
|
1551
1556
|
var t, i, r, s;
|
|
1552
1557
|
const o = e.customStrengthOptions;
|
|
1553
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1558
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Qn, 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;
|
|
1554
1559
|
}
|
|
1555
1560
|
validatePassword(e) {
|
|
1556
1561
|
var t, i, r, s, o, c;
|
|
@@ -1633,14 +1638,14 @@ class Xn {
|
|
|
1633
1638
|
* See the License for the specific language governing permissions and
|
|
1634
1639
|
* limitations under the License.
|
|
1635
1640
|
*/
|
|
1636
|
-
class
|
|
1641
|
+
class ei {
|
|
1637
1642
|
constructor(e, t, i, r) {
|
|
1638
|
-
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 Xe(this), this.idTokenSubscription = new Xe(this), this.beforeStateQueue = new
|
|
1643
|
+
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 Xe(this), this.idTokenSubscription = new Xe(this), this.beforeStateQueue = new Yn(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 = _t, 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;
|
|
1639
1644
|
}
|
|
1640
1645
|
_initializeWithPersistence(e, t) {
|
|
1641
1646
|
return t && (this._popupRedirectResolver = k(t)), this._initializationPromise = this.queue(async () => {
|
|
1642
1647
|
var i, r;
|
|
1643
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1648
|
+
if (!this._deleted && (this.persistenceManager = await H.create(this, e), !this._deleted)) {
|
|
1644
1649
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1645
1650
|
try {
|
|
1646
1651
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1721,7 +1726,7 @@ class Qn {
|
|
|
1721
1726
|
}
|
|
1722
1727
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1723
1728
|
try {
|
|
1724
|
-
await
|
|
1729
|
+
await le(e);
|
|
1725
1730
|
} catch (t) {
|
|
1726
1731
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1727
1732
|
return this.directlySetCurrentUser(null);
|
|
@@ -1729,7 +1734,7 @@ class Qn {
|
|
|
1729
1734
|
return this.directlySetCurrentUser(e);
|
|
1730
1735
|
}
|
|
1731
1736
|
useDeviceLanguage() {
|
|
1732
|
-
this.languageCode =
|
|
1737
|
+
this.languageCode = Un();
|
|
1733
1738
|
}
|
|
1734
1739
|
async _delete() {
|
|
1735
1740
|
this._deleted = !0;
|
|
@@ -1780,14 +1785,14 @@ class Qn {
|
|
|
1780
1785
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1781
1786
|
}
|
|
1782
1787
|
async _updatePasswordPolicy() {
|
|
1783
|
-
const e = await
|
|
1788
|
+
const e = await Xn(this), t = new Zn(e);
|
|
1784
1789
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1785
1790
|
}
|
|
1786
1791
|
_getPersistence() {
|
|
1787
1792
|
return this.assertedPersistence.persistence.type;
|
|
1788
1793
|
}
|
|
1789
1794
|
_updateErrorMap(e) {
|
|
1790
|
-
this._errorFactory = new
|
|
1795
|
+
this._errorFactory = new Se("auth", "Firebase", e());
|
|
1791
1796
|
}
|
|
1792
1797
|
onAuthStateChanged(e, t, i) {
|
|
1793
1798
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1820,7 +1825,7 @@ class Qn {
|
|
|
1820
1825
|
token: e,
|
|
1821
1826
|
idToken: t
|
|
1822
1827
|
};
|
|
1823
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1828
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await qn(this, i);
|
|
1824
1829
|
}
|
|
1825
1830
|
}
|
|
1826
1831
|
toJSON() {
|
|
@@ -1844,7 +1849,7 @@ class Qn {
|
|
|
1844
1849
|
this,
|
|
1845
1850
|
"argument-error"
|
|
1846
1851
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
1847
|
-
), this.redirectPersistenceManager = await
|
|
1852
|
+
), this.redirectPersistenceManager = await H.create(
|
|
1848
1853
|
this,
|
|
1849
1854
|
[k(t._redirectPersistence)],
|
|
1850
1855
|
"redirectUser"
|
|
@@ -1963,10 +1968,10 @@ class Qn {
|
|
|
1963
1968
|
async _getAppCheckToken() {
|
|
1964
1969
|
var e;
|
|
1965
1970
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1966
|
-
return t != null && t.error &&
|
|
1971
|
+
return t != null && t.error && Nn(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1967
1972
|
}
|
|
1968
1973
|
}
|
|
1969
|
-
function
|
|
1974
|
+
function me(n) {
|
|
1970
1975
|
return j(n);
|
|
1971
1976
|
}
|
|
1972
1977
|
class Xe {
|
|
@@ -2006,16 +2011,16 @@ let Le = {
|
|
|
2006
2011
|
recaptchaEnterpriseScript: "",
|
|
2007
2012
|
gapiScript: ""
|
|
2008
2013
|
};
|
|
2009
|
-
function
|
|
2014
|
+
function ti(n) {
|
|
2010
2015
|
Le = n;
|
|
2011
2016
|
}
|
|
2012
|
-
function
|
|
2017
|
+
function ni(n) {
|
|
2013
2018
|
return Le.loadJS(n);
|
|
2014
2019
|
}
|
|
2015
|
-
function
|
|
2020
|
+
function ii() {
|
|
2016
2021
|
return Le.gapiScript;
|
|
2017
2022
|
}
|
|
2018
|
-
function
|
|
2023
|
+
function ri(n) {
|
|
2019
2024
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2020
2025
|
}
|
|
2021
2026
|
/**
|
|
@@ -2034,13 +2039,13 @@ function ni(n) {
|
|
|
2034
2039
|
* See the License for the specific language governing permissions and
|
|
2035
2040
|
* limitations under the License.
|
|
2036
2041
|
*/
|
|
2037
|
-
function
|
|
2042
|
+
function si(n, e) {
|
|
2038
2043
|
const t = pt(n, "auth");
|
|
2039
2044
|
if (t.isInitialized()) {
|
|
2040
2045
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2041
2046
|
if (In(s, e ?? {}))
|
|
2042
2047
|
return r;
|
|
2043
|
-
|
|
2048
|
+
b(
|
|
2044
2049
|
r,
|
|
2045
2050
|
"already-initialized"
|
|
2046
2051
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2048,12 +2053,12 @@ function ii(n, e) {
|
|
|
2048
2053
|
}
|
|
2049
2054
|
return t.initialize({ options: e });
|
|
2050
2055
|
}
|
|
2051
|
-
function
|
|
2056
|
+
function oi(n, e) {
|
|
2052
2057
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(k);
|
|
2053
2058
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2054
2059
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const i =
|
|
2060
|
+
function ai(n, e, t) {
|
|
2061
|
+
const i = me(n);
|
|
2057
2062
|
u(
|
|
2058
2063
|
i._canInitEmulator,
|
|
2059
2064
|
i,
|
|
@@ -2065,19 +2070,19 @@ function si(n, e, t) {
|
|
|
2065
2070
|
"invalid-emulator-scheme"
|
|
2066
2071
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2067
2072
|
);
|
|
2068
|
-
const r = !1, s = Mt(e), { host: o, port: c } =
|
|
2073
|
+
const r = !1, s = Mt(e), { host: o, port: c } = ci(e), a = c === null ? "" : `:${c}`;
|
|
2069
2074
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2070
2075
|
host: o,
|
|
2071
2076
|
port: c,
|
|
2072
2077
|
protocol: s.replace(":", ""),
|
|
2073
2078
|
options: Object.freeze({ disableWarnings: r })
|
|
2074
|
-
}),
|
|
2079
|
+
}), li();
|
|
2075
2080
|
}
|
|
2076
2081
|
function Mt(n) {
|
|
2077
2082
|
const e = n.indexOf(":");
|
|
2078
2083
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2079
2084
|
}
|
|
2080
|
-
function
|
|
2085
|
+
function ci(n) {
|
|
2081
2086
|
const e = Mt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2082
2087
|
if (!t)
|
|
2083
2088
|
return { host: "", port: null };
|
|
@@ -2096,7 +2101,7 @@ function Qe(n) {
|
|
|
2096
2101
|
const e = Number(n);
|
|
2097
2102
|
return isNaN(e) ? null : e;
|
|
2098
2103
|
}
|
|
2099
|
-
function
|
|
2104
|
+
function li() {
|
|
2100
2105
|
function n() {
|
|
2101
2106
|
const e = document.createElement("p"), t = e.style;
|
|
2102
2107
|
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);
|
|
@@ -2162,7 +2167,7 @@ class Ut {
|
|
|
2162
2167
|
* limitations under the License.
|
|
2163
2168
|
*/
|
|
2164
2169
|
async function W(n, e) {
|
|
2165
|
-
return wt(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2170
|
+
return wt(n, "POST", "/v1/accounts:signInWithIdp", fe(n, e));
|
|
2166
2171
|
}
|
|
2167
2172
|
/**
|
|
2168
2173
|
* @license
|
|
@@ -2180,15 +2185,15 @@ async function W(n, e) {
|
|
|
2180
2185
|
* See the License for the specific language governing permissions and
|
|
2181
2186
|
* limitations under the License.
|
|
2182
2187
|
*/
|
|
2183
|
-
const
|
|
2184
|
-
class
|
|
2188
|
+
const ui = "http://localhost";
|
|
2189
|
+
class D extends Ut {
|
|
2185
2190
|
constructor() {
|
|
2186
2191
|
super(...arguments), this.pendingToken = null;
|
|
2187
2192
|
}
|
|
2188
2193
|
/** @internal */
|
|
2189
2194
|
static _fromParams(e) {
|
|
2190
|
-
const t = new
|
|
2191
|
-
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) :
|
|
2195
|
+
const t = new D(e.providerId, e.signInMethod);
|
|
2196
|
+
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) : b(
|
|
2192
2197
|
"argument-error"
|
|
2193
2198
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2194
2199
|
), t;
|
|
@@ -2218,7 +2223,7 @@ class U extends Ut {
|
|
|
2218
2223
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = Pe(t, ["providerId", "signInMethod"]);
|
|
2219
2224
|
if (!i || !r)
|
|
2220
2225
|
return null;
|
|
2221
|
-
const o = new
|
|
2226
|
+
const o = new D(i, r);
|
|
2222
2227
|
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;
|
|
2223
2228
|
}
|
|
2224
2229
|
/** @internal */
|
|
@@ -2238,7 +2243,7 @@ class U extends Ut {
|
|
|
2238
2243
|
}
|
|
2239
2244
|
buildRequest() {
|
|
2240
2245
|
const e = {
|
|
2241
|
-
requestUri:
|
|
2246
|
+
requestUri: ui,
|
|
2242
2247
|
returnSecureToken: !0
|
|
2243
2248
|
};
|
|
2244
2249
|
if (this.pendingToken)
|
|
@@ -2374,7 +2379,7 @@ class A extends Y {
|
|
|
2374
2379
|
* @param accessToken - Facebook access token.
|
|
2375
2380
|
*/
|
|
2376
2381
|
static credential(e) {
|
|
2377
|
-
return
|
|
2382
|
+
return D._fromParams({
|
|
2378
2383
|
providerId: A.PROVIDER_ID,
|
|
2379
2384
|
signInMethod: A.FACEBOOK_SIGN_IN_METHOD,
|
|
2380
2385
|
accessToken: e
|
|
@@ -2446,7 +2451,7 @@ class C extends Y {
|
|
|
2446
2451
|
* @param accessToken - Google access token.
|
|
2447
2452
|
*/
|
|
2448
2453
|
static credential(e, t) {
|
|
2449
|
-
return
|
|
2454
|
+
return D._fromParams({
|
|
2450
2455
|
providerId: C.PROVIDER_ID,
|
|
2451
2456
|
signInMethod: C.GOOGLE_SIGN_IN_METHOD,
|
|
2452
2457
|
idToken: e,
|
|
@@ -2514,7 +2519,7 @@ class O extends Y {
|
|
|
2514
2519
|
* @param accessToken - Github access token.
|
|
2515
2520
|
*/
|
|
2516
2521
|
static credential(e) {
|
|
2517
|
-
return
|
|
2522
|
+
return D._fromParams({
|
|
2518
2523
|
providerId: O.PROVIDER_ID,
|
|
2519
2524
|
signInMethod: O.GITHUB_SIGN_IN_METHOD,
|
|
2520
2525
|
accessToken: e
|
|
@@ -2579,7 +2584,7 @@ class N extends Y {
|
|
|
2579
2584
|
* @param secret - Twitter secret.
|
|
2580
2585
|
*/
|
|
2581
2586
|
static credential(e, t) {
|
|
2582
|
-
return
|
|
2587
|
+
return D._fromParams({
|
|
2583
2588
|
providerId: N.PROVIDER_ID,
|
|
2584
2589
|
signInMethod: N.TWITTER_SIGN_IN_METHOD,
|
|
2585
2590
|
oauthToken: e,
|
|
@@ -2634,13 +2639,13 @@ N.PROVIDER_ID = "twitter.com";
|
|
|
2634
2639
|
* See the License for the specific language governing permissions and
|
|
2635
2640
|
* limitations under the License.
|
|
2636
2641
|
*/
|
|
2637
|
-
class
|
|
2642
|
+
class F {
|
|
2638
2643
|
constructor(e) {
|
|
2639
2644
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2640
2645
|
}
|
|
2641
2646
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2642
2647
|
const s = await E._fromIdTokenResponse(e, i, r), o = Ze(i);
|
|
2643
|
-
return new
|
|
2648
|
+
return new F({
|
|
2644
2649
|
user: s,
|
|
2645
2650
|
providerId: o,
|
|
2646
2651
|
_tokenResponse: i,
|
|
@@ -2654,7 +2659,7 @@ class D {
|
|
|
2654
2659
|
!0
|
|
2655
2660
|
);
|
|
2656
2661
|
const r = Ze(i);
|
|
2657
|
-
return new
|
|
2662
|
+
return new F({
|
|
2658
2663
|
user: e,
|
|
2659
2664
|
providerId: r,
|
|
2660
2665
|
_tokenResponse: i,
|
|
@@ -2681,10 +2686,10 @@ function Ze(n) {
|
|
|
2681
2686
|
* See the License for the specific language governing permissions and
|
|
2682
2687
|
* limitations under the License.
|
|
2683
2688
|
*/
|
|
2684
|
-
class
|
|
2689
|
+
class ue extends Re {
|
|
2685
2690
|
constructor(e, t, i, r) {
|
|
2686
2691
|
var s;
|
|
2687
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2692
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ue.prototype), this.customData = {
|
|
2688
2693
|
appName: e.name,
|
|
2689
2694
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2690
2695
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2692,17 +2697,17 @@ class le extends Re {
|
|
|
2692
2697
|
};
|
|
2693
2698
|
}
|
|
2694
2699
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2695
|
-
return new
|
|
2700
|
+
return new ue(e, t, i, r);
|
|
2696
2701
|
}
|
|
2697
2702
|
}
|
|
2698
2703
|
function Ft(n, e, t, i) {
|
|
2699
2704
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2700
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2705
|
+
throw s.code === "auth/multi-factor-auth-required" ? ue._fromErrorAndOperation(n, s, e, i) : s;
|
|
2701
2706
|
});
|
|
2702
2707
|
}
|
|
2703
|
-
async function
|
|
2708
|
+
async function di(n, e, t = !1) {
|
|
2704
2709
|
const i = await q(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2705
|
-
return
|
|
2710
|
+
return F._forOperation(n, "link", i);
|
|
2706
2711
|
}
|
|
2707
2712
|
/**
|
|
2708
2713
|
* @license
|
|
@@ -2720,7 +2725,7 @@ async function li(n, e, t = !1) {
|
|
|
2720
2725
|
* See the License for the specific language governing permissions and
|
|
2721
2726
|
* limitations under the License.
|
|
2722
2727
|
*/
|
|
2723
|
-
async function
|
|
2728
|
+
async function hi(n, e, t = !1) {
|
|
2724
2729
|
const { auth: i } = n;
|
|
2725
2730
|
if (w(i.app))
|
|
2726
2731
|
return Promise.reject(L(i));
|
|
@@ -2746,9 +2751,9 @@ async function ui(n, e, t = !1) {
|
|
|
2746
2751
|
i,
|
|
2747
2752
|
"user-mismatch"
|
|
2748
2753
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2749
|
-
),
|
|
2754
|
+
), F._forOperation(n, r, s);
|
|
2750
2755
|
} catch (s) {
|
|
2751
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2756
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && b(
|
|
2752
2757
|
i,
|
|
2753
2758
|
"user-mismatch"
|
|
2754
2759
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2771,10 +2776,10 @@ async function ui(n, e, t = !1) {
|
|
|
2771
2776
|
* See the License for the specific language governing permissions and
|
|
2772
2777
|
* limitations under the License.
|
|
2773
2778
|
*/
|
|
2774
|
-
async function
|
|
2779
|
+
async function fi(n, e, t = !1) {
|
|
2775
2780
|
if (w(n.app))
|
|
2776
2781
|
return Promise.reject(L(n));
|
|
2777
|
-
const i = "signIn", r = await Ft(n, i, e), s = await
|
|
2782
|
+
const i = "signIn", r = await Ft(n, i, e), s = await F._fromIdTokenResponse(n, i, r);
|
|
2778
2783
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2779
2784
|
}
|
|
2780
2785
|
/**
|
|
@@ -2793,8 +2798,8 @@ async function di(n, e, t = !1) {
|
|
|
2793
2798
|
* See the License for the specific language governing permissions and
|
|
2794
2799
|
* limitations under the License.
|
|
2795
2800
|
*/
|
|
2796
|
-
async function
|
|
2797
|
-
return wt(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2801
|
+
async function pi(n, e) {
|
|
2802
|
+
return wt(n, "POST", "/v1/accounts:signInWithCustomToken", fe(n, e));
|
|
2798
2803
|
}
|
|
2799
2804
|
/**
|
|
2800
2805
|
* @license
|
|
@@ -2812,22 +2817,22 @@ async function hi(n, e) {
|
|
|
2812
2817
|
* See the License for the specific language governing permissions and
|
|
2813
2818
|
* limitations under the License.
|
|
2814
2819
|
*/
|
|
2815
|
-
async function
|
|
2820
|
+
async function mi(n, e) {
|
|
2816
2821
|
if (w(n.app))
|
|
2817
2822
|
return Promise.reject(L(n));
|
|
2818
|
-
const t =
|
|
2823
|
+
const t = me(n), i = await pi(t, {
|
|
2819
2824
|
token: e,
|
|
2820
2825
|
returnSecureToken: !0
|
|
2821
|
-
}), r = await
|
|
2826
|
+
}), r = await F._fromIdTokenResponse(t, "signIn", i);
|
|
2822
2827
|
return await t._updateCurrentUser(r.user), r;
|
|
2823
2828
|
}
|
|
2824
|
-
function
|
|
2829
|
+
function gi(n, e, t, i) {
|
|
2825
2830
|
return j(n).onIdTokenChanged(e, t, i);
|
|
2826
2831
|
}
|
|
2827
|
-
function
|
|
2832
|
+
function _i(n, e, t) {
|
|
2828
2833
|
return j(n).beforeAuthStateChanged(e, t);
|
|
2829
2834
|
}
|
|
2830
|
-
const
|
|
2835
|
+
const de = "__sak";
|
|
2831
2836
|
/**
|
|
2832
2837
|
* @license
|
|
2833
2838
|
* Copyright 2019 Google LLC
|
|
@@ -2850,7 +2855,7 @@ class xt {
|
|
|
2850
2855
|
}
|
|
2851
2856
|
_isAvailable() {
|
|
2852
2857
|
try {
|
|
2853
|
-
return this.storage ? (this.storage.setItem(
|
|
2858
|
+
return this.storage ? (this.storage.setItem(de, "1"), this.storage.removeItem(de), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2854
2859
|
} catch {
|
|
2855
2860
|
return Promise.resolve(!1);
|
|
2856
2861
|
}
|
|
@@ -2885,18 +2890,18 @@ class xt {
|
|
|
2885
2890
|
* See the License for the specific language governing permissions and
|
|
2886
2891
|
* limitations under the License.
|
|
2887
2892
|
*/
|
|
2888
|
-
function
|
|
2893
|
+
function vi() {
|
|
2889
2894
|
const n = g();
|
|
2890
|
-
return Ne(n) ||
|
|
2895
|
+
return Ne(n) || pe(n);
|
|
2891
2896
|
}
|
|
2892
|
-
const
|
|
2897
|
+
const Ii = 1e3, Ti = 10;
|
|
2893
2898
|
class Vt extends xt {
|
|
2894
2899
|
constructor() {
|
|
2895
2900
|
super(
|
|
2896
2901
|
() => window.localStorage,
|
|
2897
2902
|
"LOCAL"
|
|
2898
2903
|
/* PersistenceType.LOCAL */
|
|
2899
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
2904
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = vi() && Jn(), this.fallbackToPolling = Nt(), this._shouldAllowMigration = !0;
|
|
2900
2905
|
}
|
|
2901
2906
|
forAllChangedKeys(e) {
|
|
2902
2907
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2923,7 +2928,7 @@ class Vt extends xt {
|
|
|
2923
2928
|
const o = this.storage.getItem(i);
|
|
2924
2929
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2925
2930
|
}, s = this.storage.getItem(i);
|
|
2926
|
-
|
|
2931
|
+
Kn() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ti) : r();
|
|
2927
2932
|
}
|
|
2928
2933
|
notifyListeners(e, t) {
|
|
2929
2934
|
this.localCache[e] = t;
|
|
@@ -2945,7 +2950,7 @@ class Vt extends xt {
|
|
|
2945
2950
|
!0
|
|
2946
2951
|
);
|
|
2947
2952
|
});
|
|
2948
|
-
},
|
|
2953
|
+
}, Ii);
|
|
2949
2954
|
}
|
|
2950
2955
|
stopPolling() {
|
|
2951
2956
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -2975,7 +2980,7 @@ class Vt extends xt {
|
|
|
2975
2980
|
}
|
|
2976
2981
|
}
|
|
2977
2982
|
Vt.type = "LOCAL";
|
|
2978
|
-
const
|
|
2983
|
+
const wi = Vt;
|
|
2979
2984
|
/**
|
|
2980
2985
|
* @license
|
|
2981
2986
|
* Copyright 2020 Google LLC
|
|
@@ -2992,7 +2997,7 @@ const Ii = Vt;
|
|
|
2992
2997
|
* See the License for the specific language governing permissions and
|
|
2993
2998
|
* limitations under the License.
|
|
2994
2999
|
*/
|
|
2995
|
-
class
|
|
3000
|
+
class $t extends xt {
|
|
2996
3001
|
constructor() {
|
|
2997
3002
|
super(
|
|
2998
3003
|
() => window.sessionStorage,
|
|
@@ -3005,8 +3010,8 @@ class Ht extends xt {
|
|
|
3005
3010
|
_removeListener(e, t) {
|
|
3006
3011
|
}
|
|
3007
3012
|
}
|
|
3008
|
-
|
|
3009
|
-
const
|
|
3013
|
+
$t.type = "SESSION";
|
|
3014
|
+
const Ht = $t;
|
|
3010
3015
|
/**
|
|
3011
3016
|
* @license
|
|
3012
3017
|
* Copyright 2019 Google LLC
|
|
@@ -3023,7 +3028,7 @@ const $t = Ht;
|
|
|
3023
3028
|
* See the License for the specific language governing permissions and
|
|
3024
3029
|
* limitations under the License.
|
|
3025
3030
|
*/
|
|
3026
|
-
function
|
|
3031
|
+
function yi(n) {
|
|
3027
3032
|
return Promise.all(n.map(async (e) => {
|
|
3028
3033
|
try {
|
|
3029
3034
|
return {
|
|
@@ -3054,7 +3059,7 @@ function Ti(n) {
|
|
|
3054
3059
|
* See the License for the specific language governing permissions and
|
|
3055
3060
|
* limitations under the License.
|
|
3056
3061
|
*/
|
|
3057
|
-
class
|
|
3062
|
+
class ge {
|
|
3058
3063
|
constructor(e) {
|
|
3059
3064
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3060
3065
|
}
|
|
@@ -3068,7 +3073,7 @@ class me {
|
|
|
3068
3073
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3069
3074
|
if (t)
|
|
3070
3075
|
return t;
|
|
3071
|
-
const i = new
|
|
3076
|
+
const i = new ge(e);
|
|
3072
3077
|
return this.receivers.push(i), i;
|
|
3073
3078
|
}
|
|
3074
3079
|
isListeningto(e) {
|
|
@@ -3093,7 +3098,7 @@ class me {
|
|
|
3093
3098
|
eventId: i,
|
|
3094
3099
|
eventType: r
|
|
3095
3100
|
});
|
|
3096
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3101
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await yi(c);
|
|
3097
3102
|
t.ports[0].postMessage({
|
|
3098
3103
|
status: "done",
|
|
3099
3104
|
eventId: i,
|
|
@@ -3122,7 +3127,7 @@ class me {
|
|
|
3122
3127
|
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);
|
|
3123
3128
|
}
|
|
3124
3129
|
}
|
|
3125
|
-
|
|
3130
|
+
ge.receivers = [];
|
|
3126
3131
|
/**
|
|
3127
3132
|
* @license
|
|
3128
3133
|
* Copyright 2020 Google LLC
|
|
@@ -3161,7 +3166,7 @@ function Me(n = "", e = 10) {
|
|
|
3161
3166
|
* See the License for the specific language governing permissions and
|
|
3162
3167
|
* limitations under the License.
|
|
3163
3168
|
*/
|
|
3164
|
-
class
|
|
3169
|
+
class Ei {
|
|
3165
3170
|
constructor(e) {
|
|
3166
3171
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3167
3172
|
}
|
|
@@ -3261,7 +3266,7 @@ class wi {
|
|
|
3261
3266
|
function T() {
|
|
3262
3267
|
return window;
|
|
3263
3268
|
}
|
|
3264
|
-
function
|
|
3269
|
+
function ki(n) {
|
|
3265
3270
|
T().location.href = n;
|
|
3266
3271
|
}
|
|
3267
3272
|
/**
|
|
@@ -3283,7 +3288,7 @@ function yi(n) {
|
|
|
3283
3288
|
function Wt() {
|
|
3284
3289
|
return typeof T().WorkerGlobalScope < "u" && typeof T().importScripts == "function";
|
|
3285
3290
|
}
|
|
3286
|
-
async function
|
|
3291
|
+
async function bi() {
|
|
3287
3292
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3288
3293
|
return null;
|
|
3289
3294
|
try {
|
|
@@ -3292,11 +3297,11 @@ async function Ei() {
|
|
|
3292
3297
|
return null;
|
|
3293
3298
|
}
|
|
3294
3299
|
}
|
|
3295
|
-
function
|
|
3300
|
+
function Si() {
|
|
3296
3301
|
var n;
|
|
3297
3302
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3298
3303
|
}
|
|
3299
|
-
function
|
|
3304
|
+
function Ri() {
|
|
3300
3305
|
return Wt() ? self : null;
|
|
3301
3306
|
}
|
|
3302
3307
|
/**
|
|
@@ -3315,7 +3320,7 @@ function Si() {
|
|
|
3315
3320
|
* See the License for the specific language governing permissions and
|
|
3316
3321
|
* limitations under the License.
|
|
3317
3322
|
*/
|
|
3318
|
-
const jt = "firebaseLocalStorageDb",
|
|
3323
|
+
const jt = "firebaseLocalStorageDb", Pi = 1, he = "firebaseLocalStorage", Gt = "fbase_key";
|
|
3319
3324
|
class X {
|
|
3320
3325
|
constructor(e) {
|
|
3321
3326
|
this.request = e;
|
|
@@ -3330,47 +3335,47 @@ class X {
|
|
|
3330
3335
|
});
|
|
3331
3336
|
}
|
|
3332
3337
|
}
|
|
3333
|
-
function
|
|
3334
|
-
return n.transaction([
|
|
3338
|
+
function _e(n, e) {
|
|
3339
|
+
return n.transaction([he], e ? "readwrite" : "readonly").objectStore(he);
|
|
3335
3340
|
}
|
|
3336
|
-
function
|
|
3341
|
+
function Ai() {
|
|
3337
3342
|
const n = indexedDB.deleteDatabase(jt);
|
|
3338
3343
|
return new X(n).toPromise();
|
|
3339
3344
|
}
|
|
3340
|
-
function
|
|
3341
|
-
const n = indexedDB.open(jt,
|
|
3345
|
+
function be() {
|
|
3346
|
+
const n = indexedDB.open(jt, Pi);
|
|
3342
3347
|
return new Promise((e, t) => {
|
|
3343
3348
|
n.addEventListener("error", () => {
|
|
3344
3349
|
t(n.error);
|
|
3345
3350
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3346
3351
|
const i = n.result;
|
|
3347
3352
|
try {
|
|
3348
|
-
i.createObjectStore(
|
|
3353
|
+
i.createObjectStore(he, { keyPath: Gt });
|
|
3349
3354
|
} catch (r) {
|
|
3350
3355
|
t(r);
|
|
3351
3356
|
}
|
|
3352
3357
|
}), n.addEventListener("success", async () => {
|
|
3353
3358
|
const i = n.result;
|
|
3354
|
-
i.objectStoreNames.contains(
|
|
3359
|
+
i.objectStoreNames.contains(he) ? e(i) : (i.close(), await Ai(), e(await be()));
|
|
3355
3360
|
});
|
|
3356
3361
|
});
|
|
3357
3362
|
}
|
|
3358
3363
|
async function et(n, e, t) {
|
|
3359
|
-
const i =
|
|
3364
|
+
const i = _e(n, !0).put({
|
|
3360
3365
|
[Gt]: e,
|
|
3361
3366
|
value: t
|
|
3362
3367
|
});
|
|
3363
3368
|
return new X(i).toPromise();
|
|
3364
3369
|
}
|
|
3365
|
-
async function
|
|
3366
|
-
const t =
|
|
3370
|
+
async function Ci(n, e) {
|
|
3371
|
+
const t = _e(n, !1).get(e), i = await new X(t).toPromise();
|
|
3367
3372
|
return i === void 0 ? null : i.value;
|
|
3368
3373
|
}
|
|
3369
3374
|
function tt(n, e) {
|
|
3370
|
-
const t =
|
|
3375
|
+
const t = _e(n, !0).delete(e);
|
|
3371
3376
|
return new X(t).toPromise();
|
|
3372
3377
|
}
|
|
3373
|
-
const
|
|
3378
|
+
const Oi = 800, Ni = 3;
|
|
3374
3379
|
class Bt {
|
|
3375
3380
|
constructor() {
|
|
3376
3381
|
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(() => {
|
|
@@ -3378,7 +3383,7 @@ class Bt {
|
|
|
3378
3383
|
});
|
|
3379
3384
|
}
|
|
3380
3385
|
async _openDb() {
|
|
3381
|
-
return this.db ? this.db : (this.db = await
|
|
3386
|
+
return this.db ? this.db : (this.db = await be(), this.db);
|
|
3382
3387
|
}
|
|
3383
3388
|
async _withRetries(e) {
|
|
3384
3389
|
let t = 0;
|
|
@@ -3387,7 +3392,7 @@ class Bt {
|
|
|
3387
3392
|
const i = await this._openDb();
|
|
3388
3393
|
return await e(i);
|
|
3389
3394
|
} catch (i) {
|
|
3390
|
-
if (t++ >
|
|
3395
|
+
if (t++ > Ni)
|
|
3391
3396
|
throw i;
|
|
3392
3397
|
this.db && (this.db.close(), this.db = void 0);
|
|
3393
3398
|
}
|
|
@@ -3403,7 +3408,7 @@ class Bt {
|
|
|
3403
3408
|
* As the worker we should listen to events from the main window.
|
|
3404
3409
|
*/
|
|
3405
3410
|
async initializeReceiver() {
|
|
3406
|
-
this.receiver =
|
|
3411
|
+
this.receiver = ge._getInstance(Ri()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3407
3412
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3408
3413
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3409
3414
|
"keyChanged"
|
|
@@ -3419,9 +3424,9 @@ class Bt {
|
|
|
3419
3424
|
*/
|
|
3420
3425
|
async initializeSender() {
|
|
3421
3426
|
var e, t;
|
|
3422
|
-
if (this.activeServiceWorker = await
|
|
3427
|
+
if (this.activeServiceWorker = await bi(), !this.activeServiceWorker)
|
|
3423
3428
|
return;
|
|
3424
|
-
this.sender = new
|
|
3429
|
+
this.sender = new Ei(this.activeServiceWorker);
|
|
3425
3430
|
const i = await this.sender._send(
|
|
3426
3431
|
"ping",
|
|
3427
3432
|
{},
|
|
@@ -3443,7 +3448,7 @@ class Bt {
|
|
|
3443
3448
|
* @param key - Storage key which changed.
|
|
3444
3449
|
*/
|
|
3445
3450
|
async notifyServiceWorker(e) {
|
|
3446
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3451
|
+
if (!(!this.sender || !this.activeServiceWorker || Si() !== this.activeServiceWorker))
|
|
3447
3452
|
try {
|
|
3448
3453
|
await this.sender._send(
|
|
3449
3454
|
"keyChanged",
|
|
@@ -3459,8 +3464,8 @@ class Bt {
|
|
|
3459
3464
|
try {
|
|
3460
3465
|
if (!indexedDB)
|
|
3461
3466
|
return !1;
|
|
3462
|
-
const e = await
|
|
3463
|
-
return await et(e,
|
|
3467
|
+
const e = await be();
|
|
3468
|
+
return await et(e, de, "1"), await tt(e, de), !0;
|
|
3464
3469
|
} catch {
|
|
3465
3470
|
}
|
|
3466
3471
|
return !1;
|
|
@@ -3477,7 +3482,7 @@ class Bt {
|
|
|
3477
3482
|
return this._withPendingWrite(async () => (await this._withRetries((i) => et(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3478
3483
|
}
|
|
3479
3484
|
async _get(e) {
|
|
3480
|
-
const t = await this._withRetries((i) =>
|
|
3485
|
+
const t = await this._withRetries((i) => Ci(i, e));
|
|
3481
3486
|
return this.localCache[e] = t, t;
|
|
3482
3487
|
}
|
|
3483
3488
|
async _remove(e) {
|
|
@@ -3485,7 +3490,7 @@ class Bt {
|
|
|
3485
3490
|
}
|
|
3486
3491
|
async _poll() {
|
|
3487
3492
|
const e = await this._withRetries((r) => {
|
|
3488
|
-
const s =
|
|
3493
|
+
const s = _e(r, !1).getAll();
|
|
3489
3494
|
return new X(s).toPromise();
|
|
3490
3495
|
});
|
|
3491
3496
|
if (!e)
|
|
@@ -3508,7 +3513,7 @@ class Bt {
|
|
|
3508
3513
|
r(t);
|
|
3509
3514
|
}
|
|
3510
3515
|
startPolling() {
|
|
3511
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3516
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Oi);
|
|
3512
3517
|
}
|
|
3513
3518
|
stopPolling() {
|
|
3514
3519
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3521,7 +3526,7 @@ class Bt {
|
|
|
3521
3526
|
}
|
|
3522
3527
|
}
|
|
3523
3528
|
Bt.type = "LOCAL";
|
|
3524
|
-
const
|
|
3529
|
+
const Li = Bt;
|
|
3525
3530
|
new J(3e4, 6e4);
|
|
3526
3531
|
/**
|
|
3527
3532
|
* @license
|
|
@@ -3539,7 +3544,7 @@ new J(3e4, 6e4);
|
|
|
3539
3544
|
* See the License for the specific language governing permissions and
|
|
3540
3545
|
* limitations under the License.
|
|
3541
3546
|
*/
|
|
3542
|
-
function
|
|
3547
|
+
function Mi(n, e) {
|
|
3543
3548
|
return e ? k(e) : (u(
|
|
3544
3549
|
n._popupRedirectResolver,
|
|
3545
3550
|
n,
|
|
@@ -3593,26 +3598,26 @@ class Ue extends Ut {
|
|
|
3593
3598
|
return e && (t.idToken = e), t;
|
|
3594
3599
|
}
|
|
3595
3600
|
}
|
|
3596
|
-
function
|
|
3597
|
-
return
|
|
3601
|
+
function Ui(n) {
|
|
3602
|
+
return fi(n.auth, new Ue(n), n.bypassAuthState);
|
|
3598
3603
|
}
|
|
3599
|
-
function
|
|
3604
|
+
function Di(n) {
|
|
3600
3605
|
const { auth: e, user: t } = n;
|
|
3601
3606
|
return u(
|
|
3602
3607
|
t,
|
|
3603
3608
|
e,
|
|
3604
3609
|
"internal-error"
|
|
3605
3610
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3606
|
-
),
|
|
3611
|
+
), hi(t, new Ue(n), n.bypassAuthState);
|
|
3607
3612
|
}
|
|
3608
|
-
async function
|
|
3613
|
+
async function Fi(n) {
|
|
3609
3614
|
const { auth: e, user: t } = n;
|
|
3610
3615
|
return u(
|
|
3611
3616
|
t,
|
|
3612
3617
|
e,
|
|
3613
3618
|
"internal-error"
|
|
3614
3619
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3615
|
-
),
|
|
3620
|
+
), di(t, new Ue(n), n.bypassAuthState);
|
|
3616
3621
|
}
|
|
3617
3622
|
/**
|
|
3618
3623
|
* @license
|
|
@@ -3672,15 +3677,15 @@ class qt {
|
|
|
3672
3677
|
switch (e) {
|
|
3673
3678
|
case "signInViaPopup":
|
|
3674
3679
|
case "signInViaRedirect":
|
|
3675
|
-
return
|
|
3680
|
+
return Ui;
|
|
3676
3681
|
case "linkViaPopup":
|
|
3677
3682
|
case "linkViaRedirect":
|
|
3678
|
-
return
|
|
3683
|
+
return Fi;
|
|
3679
3684
|
case "reauthViaPopup":
|
|
3680
3685
|
case "reauthViaRedirect":
|
|
3681
|
-
return
|
|
3686
|
+
return Di;
|
|
3682
3687
|
default:
|
|
3683
|
-
|
|
3688
|
+
b(
|
|
3684
3689
|
this.auth,
|
|
3685
3690
|
"internal-error"
|
|
3686
3691
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3688,10 +3693,10 @@ class qt {
|
|
|
3688
3693
|
}
|
|
3689
3694
|
}
|
|
3690
3695
|
resolve(e) {
|
|
3691
|
-
|
|
3696
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3692
3697
|
}
|
|
3693
3698
|
reject(e) {
|
|
3694
|
-
|
|
3699
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3695
3700
|
}
|
|
3696
3701
|
unregisterAndCleanUp() {
|
|
3697
3702
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3713,7 +3718,7 @@ class qt {
|
|
|
3713
3718
|
* See the License for the specific language governing permissions and
|
|
3714
3719
|
* limitations under the License.
|
|
3715
3720
|
*/
|
|
3716
|
-
const
|
|
3721
|
+
const xi = new J(2e3, 1e4);
|
|
3717
3722
|
class V extends qt {
|
|
3718
3723
|
constructor(e, t, i, r, s) {
|
|
3719
3724
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, V.currentPopupAction && V.currentPopupAction.cancel(), V.currentPopupAction = this;
|
|
@@ -3728,7 +3733,7 @@ class V extends qt {
|
|
|
3728
3733
|
), e;
|
|
3729
3734
|
}
|
|
3730
3735
|
async onExecution() {
|
|
3731
|
-
|
|
3736
|
+
S(this.filter.length === 1, "Popup operations only handle one event");
|
|
3732
3737
|
const e = Me();
|
|
3733
3738
|
this.authWindow = await this.resolver._openPopup(
|
|
3734
3739
|
this.auth,
|
|
@@ -3777,7 +3782,7 @@ class V extends qt {
|
|
|
3777
3782
|
);
|
|
3778
3783
|
return;
|
|
3779
3784
|
}
|
|
3780
|
-
this.pollId = window.setTimeout(e,
|
|
3785
|
+
this.pollId = window.setTimeout(e, xi.get());
|
|
3781
3786
|
};
|
|
3782
3787
|
e();
|
|
3783
3788
|
}
|
|
@@ -3799,8 +3804,8 @@ V.currentPopupAction = null;
|
|
|
3799
3804
|
* See the License for the specific language governing permissions and
|
|
3800
3805
|
* limitations under the License.
|
|
3801
3806
|
*/
|
|
3802
|
-
const
|
|
3803
|
-
class
|
|
3807
|
+
const Vi = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
3808
|
+
class $i extends qt {
|
|
3804
3809
|
constructor(e, t, i = !1) {
|
|
3805
3810
|
super(e, [
|
|
3806
3811
|
"signInViaRedirect",
|
|
@@ -3815,17 +3820,17 @@ class xi extends qt {
|
|
|
3815
3820
|
* just return it.
|
|
3816
3821
|
*/
|
|
3817
3822
|
async execute() {
|
|
3818
|
-
let e =
|
|
3823
|
+
let e = oe.get(this.auth._key());
|
|
3819
3824
|
if (!e) {
|
|
3820
3825
|
try {
|
|
3821
|
-
const i = await
|
|
3826
|
+
const i = await Hi(this.resolver, this.auth) ? await super.execute() : null;
|
|
3822
3827
|
e = () => Promise.resolve(i);
|
|
3823
3828
|
} catch (t) {
|
|
3824
3829
|
e = () => Promise.reject(t);
|
|
3825
3830
|
}
|
|
3826
|
-
|
|
3831
|
+
oe.set(this.auth._key(), e);
|
|
3827
3832
|
}
|
|
3828
|
-
return this.bypassAuthState ||
|
|
3833
|
+
return this.bypassAuthState || oe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3829
3834
|
}
|
|
3830
3835
|
async onAuthEvent(e) {
|
|
3831
3836
|
if (e.type === "signInViaRedirect")
|
|
@@ -3846,26 +3851,26 @@ class xi extends qt {
|
|
|
3846
3851
|
cleanUp() {
|
|
3847
3852
|
}
|
|
3848
3853
|
}
|
|
3849
|
-
async function
|
|
3850
|
-
const t =
|
|
3854
|
+
async function Hi(n, e) {
|
|
3855
|
+
const t = Gi(e), i = ji(n);
|
|
3851
3856
|
if (!await i._isAvailable())
|
|
3852
3857
|
return !1;
|
|
3853
3858
|
const r = await i._get(t) === "true";
|
|
3854
3859
|
return await i._remove(t), r;
|
|
3855
3860
|
}
|
|
3856
|
-
function
|
|
3857
|
-
|
|
3861
|
+
function Wi(n, e) {
|
|
3862
|
+
oe.set(n._key(), e);
|
|
3858
3863
|
}
|
|
3859
|
-
function
|
|
3864
|
+
function ji(n) {
|
|
3860
3865
|
return k(n._redirectPersistence);
|
|
3861
3866
|
}
|
|
3862
|
-
function
|
|
3863
|
-
return
|
|
3867
|
+
function Gi(n) {
|
|
3868
|
+
return se(Vi, n.config.apiKey, n.name);
|
|
3864
3869
|
}
|
|
3865
|
-
async function
|
|
3870
|
+
async function Bi(n, e, t = !1) {
|
|
3866
3871
|
if (w(n.app))
|
|
3867
3872
|
return Promise.reject(L(n));
|
|
3868
|
-
const i =
|
|
3873
|
+
const i = me(n), r = Mi(i, e), o = await new $i(i, r, t).execute();
|
|
3869
3874
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3870
3875
|
}
|
|
3871
3876
|
/**
|
|
@@ -3884,8 +3889,8 @@ async function ji(n, e, t = !1) {
|
|
|
3884
3889
|
* See the License for the specific language governing permissions and
|
|
3885
3890
|
* limitations under the License.
|
|
3886
3891
|
*/
|
|
3887
|
-
const
|
|
3888
|
-
class
|
|
3892
|
+
const qi = 10 * 60 * 1e3;
|
|
3893
|
+
class zi {
|
|
3889
3894
|
constructor(e) {
|
|
3890
3895
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3891
3896
|
}
|
|
@@ -3901,7 +3906,7 @@ class Bi {
|
|
|
3901
3906
|
let t = !1;
|
|
3902
3907
|
return this.consumers.forEach((i) => {
|
|
3903
3908
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3904
|
-
}), this.hasHandledPotentialRedirect || !
|
|
3909
|
+
}), this.hasHandledPotentialRedirect || !Ki(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3905
3910
|
}
|
|
3906
3911
|
sendToConsumer(e, t) {
|
|
3907
3912
|
var i;
|
|
@@ -3916,7 +3921,7 @@ class Bi {
|
|
|
3916
3921
|
return t.filter.includes(e.type) && i;
|
|
3917
3922
|
}
|
|
3918
3923
|
hasEventBeenHandled(e) {
|
|
3919
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
3924
|
+
return Date.now() - this.lastProcessedEventTime >= qi && this.cachedEventUids.clear(), this.cachedEventUids.has(nt(e));
|
|
3920
3925
|
}
|
|
3921
3926
|
saveEventToCache(e) {
|
|
3922
3927
|
this.cachedEventUids.add(nt(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -3928,7 +3933,7 @@ function nt(n) {
|
|
|
3928
3933
|
function zt({ type: n, error: e }) {
|
|
3929
3934
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3930
3935
|
}
|
|
3931
|
-
function
|
|
3936
|
+
function Ki(n) {
|
|
3932
3937
|
switch (n.type) {
|
|
3933
3938
|
case "signInViaRedirect":
|
|
3934
3939
|
case "linkViaRedirect":
|
|
@@ -3956,7 +3961,7 @@ function qi(n) {
|
|
|
3956
3961
|
* See the License for the specific language governing permissions and
|
|
3957
3962
|
* limitations under the License.
|
|
3958
3963
|
*/
|
|
3959
|
-
async function
|
|
3964
|
+
async function Ji(n, e = {}) {
|
|
3960
3965
|
return G(n, "GET", "/v1/projects", e);
|
|
3961
3966
|
}
|
|
3962
3967
|
/**
|
|
@@ -3975,32 +3980,32 @@ async function zi(n, e = {}) {
|
|
|
3975
3980
|
* See the License for the specific language governing permissions and
|
|
3976
3981
|
* limitations under the License.
|
|
3977
3982
|
*/
|
|
3978
|
-
const
|
|
3979
|
-
async function
|
|
3983
|
+
const Yi = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Xi = /^https?/;
|
|
3984
|
+
async function Qi(n) {
|
|
3980
3985
|
if (n.config.emulator)
|
|
3981
3986
|
return;
|
|
3982
|
-
const { authorizedDomains: e } = await
|
|
3987
|
+
const { authorizedDomains: e } = await Ji(n);
|
|
3983
3988
|
for (const t of e)
|
|
3984
3989
|
try {
|
|
3985
|
-
if (
|
|
3990
|
+
if (Zi(t))
|
|
3986
3991
|
return;
|
|
3987
3992
|
} catch {
|
|
3988
3993
|
}
|
|
3989
|
-
|
|
3994
|
+
b(
|
|
3990
3995
|
n,
|
|
3991
3996
|
"unauthorized-domain"
|
|
3992
3997
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
3993
3998
|
);
|
|
3994
3999
|
}
|
|
3995
|
-
function
|
|
4000
|
+
function Zi(n) {
|
|
3996
4001
|
const e = Ee(), { protocol: t, hostname: i } = new URL(e);
|
|
3997
4002
|
if (n.startsWith("chrome-extension://")) {
|
|
3998
4003
|
const o = new URL(n);
|
|
3999
4004
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4000
4005
|
}
|
|
4001
|
-
if (!
|
|
4006
|
+
if (!Xi.test(t))
|
|
4002
4007
|
return !1;
|
|
4003
|
-
if (
|
|
4008
|
+
if (Yi.test(n))
|
|
4004
4009
|
return i === n;
|
|
4005
4010
|
const r = n.replace(/\./g, "\\.");
|
|
4006
4011
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4021,7 +4026,7 @@ function Xi(n) {
|
|
|
4021
4026
|
* See the License for the specific language governing permissions and
|
|
4022
4027
|
* limitations under the License.
|
|
4023
4028
|
*/
|
|
4024
|
-
const
|
|
4029
|
+
const er = new J(3e4, 6e4);
|
|
4025
4030
|
function it() {
|
|
4026
4031
|
const n = T().___jsl;
|
|
4027
4032
|
if (n != null && n.H) {
|
|
@@ -4031,7 +4036,7 @@ function it() {
|
|
|
4031
4036
|
n.CP[t] = null;
|
|
4032
4037
|
}
|
|
4033
4038
|
}
|
|
4034
|
-
function
|
|
4039
|
+
function tr(n) {
|
|
4035
4040
|
return new Promise((e, t) => {
|
|
4036
4041
|
var i, r, s;
|
|
4037
4042
|
function o() {
|
|
@@ -4046,7 +4051,7 @@ function Zi(n) {
|
|
|
4046
4051
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4047
4052
|
));
|
|
4048
4053
|
},
|
|
4049
|
-
timeout:
|
|
4054
|
+
timeout: er.get()
|
|
4050
4055
|
});
|
|
4051
4056
|
}
|
|
4052
4057
|
if (!((r = (i = T().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
@@ -4054,22 +4059,22 @@ function Zi(n) {
|
|
|
4054
4059
|
else if (!((s = T().gapi) === null || s === void 0) && s.load)
|
|
4055
4060
|
o();
|
|
4056
4061
|
else {
|
|
4057
|
-
const c =
|
|
4062
|
+
const c = ri("iframefcb");
|
|
4058
4063
|
return T()[c] = () => {
|
|
4059
4064
|
gapi.load ? o() : t(I(
|
|
4060
4065
|
n,
|
|
4061
4066
|
"network-request-failed"
|
|
4062
4067
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4063
4068
|
));
|
|
4064
|
-
},
|
|
4069
|
+
}, ni(`${ii()}?onload=${c}`).catch((a) => t(a));
|
|
4065
4070
|
}
|
|
4066
4071
|
}).catch((e) => {
|
|
4067
|
-
throw
|
|
4072
|
+
throw ae = null, e;
|
|
4068
4073
|
});
|
|
4069
4074
|
}
|
|
4070
|
-
let
|
|
4071
|
-
function
|
|
4072
|
-
return
|
|
4075
|
+
let ae = null;
|
|
4076
|
+
function nr(n) {
|
|
4077
|
+
return ae = ae || tr(n), ae;
|
|
4073
4078
|
}
|
|
4074
4079
|
/**
|
|
4075
4080
|
* @license
|
|
@@ -4087,7 +4092,7 @@ function er(n) {
|
|
|
4087
4092
|
* See the License for the specific language governing permissions and
|
|
4088
4093
|
* limitations under the License.
|
|
4089
4094
|
*/
|
|
4090
|
-
const
|
|
4095
|
+
const ir = new J(5e3, 15e3), rr = "__/auth/iframe", sr = "emulator/auth/iframe", or = {
|
|
4091
4096
|
style: {
|
|
4092
4097
|
position: "absolute",
|
|
4093
4098
|
top: "-100px",
|
|
@@ -4096,13 +4101,13 @@ const tr = new J(5e3, 15e3), nr = "__/auth/iframe", ir = "emulator/auth/iframe",
|
|
|
4096
4101
|
},
|
|
4097
4102
|
"aria-hidden": "true",
|
|
4098
4103
|
tabindex: "-1"
|
|
4099
|
-
},
|
|
4104
|
+
}, ar = /* @__PURE__ */ new Map([
|
|
4100
4105
|
["identitytoolkit.googleapis.com", "p"],
|
|
4101
4106
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4102
4107
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4103
4108
|
// test
|
|
4104
4109
|
]);
|
|
4105
|
-
function
|
|
4110
|
+
function cr(n) {
|
|
4106
4111
|
const e = n.config;
|
|
4107
4112
|
u(
|
|
4108
4113
|
e.authDomain,
|
|
@@ -4110,17 +4115,17 @@ function or(n) {
|
|
|
4110
4115
|
"auth-domain-config-required"
|
|
4111
4116
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4112
4117
|
);
|
|
4113
|
-
const t = e.emulator ? Ce(e,
|
|
4118
|
+
const t = e.emulator ? Ce(e, sr) : `https://${n.config.authDomain}/${rr}`, i = {
|
|
4114
4119
|
apiKey: e.apiKey,
|
|
4115
4120
|
appName: n.name,
|
|
4116
4121
|
v: z
|
|
4117
|
-
}, r =
|
|
4122
|
+
}, r = ar.get(n.config.apiHost);
|
|
4118
4123
|
r && (i.eid = r);
|
|
4119
4124
|
const s = n._getFrameworks();
|
|
4120
4125
|
return s.length && (i.fw = s.join(",")), `${t}?${K(i).slice(1)}`;
|
|
4121
4126
|
}
|
|
4122
|
-
async function
|
|
4123
|
-
const e = await
|
|
4127
|
+
async function lr(n) {
|
|
4128
|
+
const e = await nr(n), t = T().gapi;
|
|
4124
4129
|
return u(
|
|
4125
4130
|
t,
|
|
4126
4131
|
n,
|
|
@@ -4128,9 +4133,9 @@ async function ar(n) {
|
|
|
4128
4133
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4129
4134
|
), e.open({
|
|
4130
4135
|
where: document.body,
|
|
4131
|
-
url:
|
|
4136
|
+
url: cr(n),
|
|
4132
4137
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4133
|
-
attributes:
|
|
4138
|
+
attributes: or,
|
|
4134
4139
|
dontclear: !0
|
|
4135
4140
|
}, (i) => new Promise(async (r, s) => {
|
|
4136
4141
|
await i.restyle({
|
|
@@ -4143,7 +4148,7 @@ async function ar(n) {
|
|
|
4143
4148
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4144
4149
|
), c = T().setTimeout(() => {
|
|
4145
4150
|
s(o);
|
|
4146
|
-
},
|
|
4151
|
+
}, ir.get());
|
|
4147
4152
|
function a() {
|
|
4148
4153
|
T().clearTimeout(c), r(i);
|
|
4149
4154
|
}
|
|
@@ -4168,12 +4173,12 @@ async function ar(n) {
|
|
|
4168
4173
|
* See the License for the specific language governing permissions and
|
|
4169
4174
|
* limitations under the License.
|
|
4170
4175
|
*/
|
|
4171
|
-
const
|
|
4176
|
+
const ur = {
|
|
4172
4177
|
location: "yes",
|
|
4173
4178
|
resizable: "yes",
|
|
4174
4179
|
statusbar: "yes",
|
|
4175
4180
|
toolbar: "no"
|
|
4176
|
-
},
|
|
4181
|
+
}, dr = 500, hr = 600, fr = "_blank", pr = "http://localhost";
|
|
4177
4182
|
class rt {
|
|
4178
4183
|
constructor(e) {
|
|
4179
4184
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4186,19 +4191,19 @@ class rt {
|
|
|
4186
4191
|
}
|
|
4187
4192
|
}
|
|
4188
4193
|
}
|
|
4189
|
-
function
|
|
4194
|
+
function mr(n, e, t, i = dr, r = hr) {
|
|
4190
4195
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4191
4196
|
let c = "";
|
|
4192
|
-
const a = Object.assign(Object.assign({},
|
|
4197
|
+
const a = Object.assign(Object.assign({}, ur), {
|
|
4193
4198
|
width: i.toString(),
|
|
4194
4199
|
height: r.toString(),
|
|
4195
4200
|
top: s,
|
|
4196
4201
|
left: o
|
|
4197
4202
|
}), l = g().toLowerCase();
|
|
4198
|
-
t && (c = Rt(l) ?
|
|
4199
|
-
const d = Object.entries(a).reduce((_, [
|
|
4200
|
-
if (
|
|
4201
|
-
return
|
|
4203
|
+
t && (c = Rt(l) ? fr : t), St(l) && (e = e || pr, a.scrollbars = "yes");
|
|
4204
|
+
const d = Object.entries(a).reduce((_, [x, M]) => `${_}${x}=${M},`, "");
|
|
4205
|
+
if (zn(l) && c !== "_self")
|
|
4206
|
+
return gr(e || "", c), new rt(null);
|
|
4202
4207
|
const h = window.open(e || "", c, d);
|
|
4203
4208
|
u(
|
|
4204
4209
|
h,
|
|
@@ -4212,7 +4217,7 @@ function fr(n, e, t, i = lr, r = ur) {
|
|
|
4212
4217
|
}
|
|
4213
4218
|
return new rt(h);
|
|
4214
4219
|
}
|
|
4215
|
-
function
|
|
4220
|
+
function gr(n, e) {
|
|
4216
4221
|
const t = document.createElement("a");
|
|
4217
4222
|
t.href = n, t.target = e;
|
|
4218
4223
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4234,7 +4239,7 @@ function pr(n, e) {
|
|
|
4234
4239
|
* See the License for the specific language governing permissions and
|
|
4235
4240
|
* limitations under the License.
|
|
4236
4241
|
*/
|
|
4237
|
-
const
|
|
4242
|
+
const _r = "__/auth/handler", vr = "emulator/auth/handler", Ir = encodeURIComponent("fac");
|
|
4238
4243
|
async function st(n, e, t, i, r, s) {
|
|
4239
4244
|
u(
|
|
4240
4245
|
n.config.authDomain,
|
|
@@ -4268,11 +4273,11 @@ async function st(n, e, t, i, r, s) {
|
|
|
4268
4273
|
const c = o;
|
|
4269
4274
|
for (const d of Object.keys(c))
|
|
4270
4275
|
c[d] === void 0 && delete c[d];
|
|
4271
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4272
|
-
return `${
|
|
4276
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Ir}=${encodeURIComponent(a)}` : "";
|
|
4277
|
+
return `${Tr(n)}?${K(c).slice(1)}${l}`;
|
|
4273
4278
|
}
|
|
4274
|
-
function
|
|
4275
|
-
return n.emulator ? Ce(n,
|
|
4279
|
+
function Tr({ config: n }) {
|
|
4280
|
+
return n.emulator ? Ce(n, vr) : `https://${n.authDomain}/${_r}`;
|
|
4276
4281
|
}
|
|
4277
4282
|
/**
|
|
4278
4283
|
* @license
|
|
@@ -4291,29 +4296,29 @@ function vr({ config: n }) {
|
|
|
4291
4296
|
* limitations under the License.
|
|
4292
4297
|
*/
|
|
4293
4298
|
const we = "webStorageSupport";
|
|
4294
|
-
class
|
|
4299
|
+
class wr {
|
|
4295
4300
|
constructor() {
|
|
4296
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4301
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Ht, this._completeRedirectFn = Bi, this._overrideRedirectResult = Wi;
|
|
4297
4302
|
}
|
|
4298
4303
|
// Wrapping in async even though we don't await anywhere in order
|
|
4299
4304
|
// to make sure errors are raised as promise rejections
|
|
4300
4305
|
async _openPopup(e, t, i, r) {
|
|
4301
4306
|
var s;
|
|
4302
|
-
|
|
4307
|
+
S((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4303
4308
|
const o = await st(e, t, i, Ee(), r);
|
|
4304
|
-
return
|
|
4309
|
+
return mr(e, o, Me());
|
|
4305
4310
|
}
|
|
4306
4311
|
async _openRedirect(e, t, i, r) {
|
|
4307
4312
|
await this._originValidation(e);
|
|
4308
4313
|
const s = await st(e, t, i, Ee(), r);
|
|
4309
|
-
return
|
|
4314
|
+
return ki(s), new Promise(() => {
|
|
4310
4315
|
});
|
|
4311
4316
|
}
|
|
4312
4317
|
_initialize(e) {
|
|
4313
4318
|
const t = e._key();
|
|
4314
4319
|
if (this.eventManagers[t]) {
|
|
4315
4320
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4316
|
-
return r ? Promise.resolve(r) : (
|
|
4321
|
+
return r ? Promise.resolve(r) : (S(s, "If manager is not set, promise should be"), s);
|
|
4317
4322
|
}
|
|
4318
4323
|
const i = this.initAndGetManager(e);
|
|
4319
4324
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4321,7 +4326,7 @@ class Ir {
|
|
|
4321
4326
|
}), i;
|
|
4322
4327
|
}
|
|
4323
4328
|
async initAndGetManager(e) {
|
|
4324
|
-
const t = await
|
|
4329
|
+
const t = await lr(e), i = new zi(e);
|
|
4325
4330
|
return t.register("authEvent", (r) => (u(
|
|
4326
4331
|
r == null ? void 0 : r.authEvent,
|
|
4327
4332
|
e,
|
|
@@ -4336,7 +4341,7 @@ class Ir {
|
|
|
4336
4341
|
this.iframes[e._key()].send(we, { type: we }, (r) => {
|
|
4337
4342
|
var s;
|
|
4338
4343
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[we];
|
|
4339
|
-
o !== void 0 && t(!!o),
|
|
4344
|
+
o !== void 0 && t(!!o), b(
|
|
4340
4345
|
e,
|
|
4341
4346
|
"internal-error"
|
|
4342
4347
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4345,13 +4350,13 @@ class Ir {
|
|
|
4345
4350
|
}
|
|
4346
4351
|
_originValidation(e) {
|
|
4347
4352
|
const t = e._key();
|
|
4348
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4353
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Qi(e)), this.originValidationPromises[t];
|
|
4349
4354
|
}
|
|
4350
4355
|
get _shouldInitProactively() {
|
|
4351
|
-
return Nt() || Ne() ||
|
|
4356
|
+
return Nt() || Ne() || pe();
|
|
4352
4357
|
}
|
|
4353
4358
|
}
|
|
4354
|
-
const
|
|
4359
|
+
const yr = wr;
|
|
4355
4360
|
var ot = "@firebase/auth", at = "1.7.5";
|
|
4356
4361
|
/**
|
|
4357
4362
|
* @license
|
|
@@ -4369,7 +4374,7 @@ var ot = "@firebase/auth", at = "1.7.5";
|
|
|
4369
4374
|
* See the License for the specific language governing permissions and
|
|
4370
4375
|
* limitations under the License.
|
|
4371
4376
|
*/
|
|
4372
|
-
class
|
|
4377
|
+
class Er {
|
|
4373
4378
|
constructor(e) {
|
|
4374
4379
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4375
4380
|
}
|
|
@@ -4420,7 +4425,7 @@ class wr {
|
|
|
4420
4425
|
* See the License for the specific language governing permissions and
|
|
4421
4426
|
* limitations under the License.
|
|
4422
4427
|
*/
|
|
4423
|
-
function
|
|
4428
|
+
function kr(n) {
|
|
4424
4429
|
switch (n) {
|
|
4425
4430
|
case "Node":
|
|
4426
4431
|
return "node";
|
|
@@ -4436,7 +4441,7 @@ function yr(n) {
|
|
|
4436
4441
|
return;
|
|
4437
4442
|
}
|
|
4438
4443
|
}
|
|
4439
|
-
function
|
|
4444
|
+
function br(n) {
|
|
4440
4445
|
je(new Ge(
|
|
4441
4446
|
"auth",
|
|
4442
4447
|
(e, { options: t }) => {
|
|
@@ -4450,8 +4455,8 @@ function Er(n) {
|
|
|
4450
4455
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4451
4456
|
apiScheme: "https",
|
|
4452
4457
|
sdkClientVersion: Lt(n)
|
|
4453
|
-
}, l = new
|
|
4454
|
-
return
|
|
4458
|
+
}, l = new ei(i, r, s, a);
|
|
4459
|
+
return oi(l, t), l;
|
|
4455
4460
|
},
|
|
4456
4461
|
"PUBLIC"
|
|
4457
4462
|
/* ComponentType.PUBLIC */
|
|
@@ -4466,18 +4471,18 @@ function Er(n) {
|
|
|
4466
4471
|
})), je(new Ge(
|
|
4467
4472
|
"auth-internal",
|
|
4468
4473
|
(e) => {
|
|
4469
|
-
const t =
|
|
4474
|
+
const t = me(e.getProvider(
|
|
4470
4475
|
"auth"
|
|
4471
4476
|
/* _ComponentName.AUTH */
|
|
4472
4477
|
).getImmediate());
|
|
4473
|
-
return ((i) => new
|
|
4478
|
+
return ((i) => new Er(i))(t);
|
|
4474
4479
|
},
|
|
4475
4480
|
"PRIVATE"
|
|
4476
4481
|
/* ComponentType.PRIVATE */
|
|
4477
4482
|
).setInstantiationMode(
|
|
4478
4483
|
"EXPLICIT"
|
|
4479
4484
|
/* InstantiationMode.EXPLICIT */
|
|
4480
|
-
)), ye(ot, at,
|
|
4485
|
+
)), ye(ot, at, kr(n)), ye(ot, at, "esm2017");
|
|
4481
4486
|
}
|
|
4482
4487
|
/**
|
|
4483
4488
|
* @license
|
|
@@ -4495,11 +4500,11 @@ function Er(n) {
|
|
|
4495
4500
|
* See the License for the specific language governing permissions and
|
|
4496
4501
|
* limitations under the License.
|
|
4497
4502
|
*/
|
|
4498
|
-
const
|
|
4503
|
+
const Sr = 5 * 60, Rr = ft("authIdTokenMaxAge") || Sr;
|
|
4499
4504
|
let ct = null;
|
|
4500
|
-
const
|
|
4505
|
+
const Pr = (n) => async (e) => {
|
|
4501
4506
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4502
|
-
if (i && i >
|
|
4507
|
+
if (i && i > Rr)
|
|
4503
4508
|
return;
|
|
4504
4509
|
const r = t == null ? void 0 : t.token;
|
|
4505
4510
|
ct !== r && (ct = r, await fetch(n, {
|
|
@@ -4509,33 +4514,33 @@ const br = (n) => async (e) => {
|
|
|
4509
4514
|
} : {}
|
|
4510
4515
|
}));
|
|
4511
4516
|
};
|
|
4512
|
-
function
|
|
4517
|
+
function Ar(n = vn()) {
|
|
4513
4518
|
const e = pt(n, "auth");
|
|
4514
4519
|
if (e.isInitialized())
|
|
4515
4520
|
return e.getImmediate();
|
|
4516
|
-
const t =
|
|
4517
|
-
popupRedirectResolver:
|
|
4521
|
+
const t = si(n, {
|
|
4522
|
+
popupRedirectResolver: yr,
|
|
4518
4523
|
persistence: [
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4524
|
+
Li,
|
|
4525
|
+
wi,
|
|
4526
|
+
Ht
|
|
4522
4527
|
]
|
|
4523
4528
|
}), i = ft("authTokenSyncURL");
|
|
4524
4529
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4525
4530
|
const s = new URL(i, location.origin);
|
|
4526
4531
|
if (location.origin === s.origin) {
|
|
4527
|
-
const o =
|
|
4528
|
-
|
|
4532
|
+
const o = Pr(s.toString());
|
|
4533
|
+
_i(t, o, () => o(t.currentUser)), gi(t, (c) => o(c));
|
|
4529
4534
|
}
|
|
4530
4535
|
}
|
|
4531
4536
|
const r = _n("auth");
|
|
4532
|
-
return r &&
|
|
4537
|
+
return r && ai(t, `http://${r}`), t;
|
|
4533
4538
|
}
|
|
4534
|
-
function
|
|
4539
|
+
function Cr() {
|
|
4535
4540
|
var n, e;
|
|
4536
4541
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4537
4542
|
}
|
|
4538
|
-
|
|
4543
|
+
ti({
|
|
4539
4544
|
loadJS(n) {
|
|
4540
4545
|
return new Promise((e, t) => {
|
|
4541
4546
|
const i = document.createElement("script");
|
|
@@ -4545,53 +4550,60 @@ Zn({
|
|
|
4545
4550
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4546
4551
|
);
|
|
4547
4552
|
s.customData = r, t(s);
|
|
4548
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4553
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", Cr().appendChild(i);
|
|
4549
4554
|
});
|
|
4550
4555
|
},
|
|
4551
4556
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4552
4557
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4553
4558
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4554
4559
|
});
|
|
4555
|
-
|
|
4560
|
+
br(
|
|
4556
4561
|
"Browser"
|
|
4557
4562
|
/* ClientPlatform.BROWSER */
|
|
4558
4563
|
);
|
|
4559
|
-
var
|
|
4560
|
-
const
|
|
4564
|
+
var Or = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" }, Nr = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedmedev.cc" }, Lr = { mode: "development", appMode: "mf" };
|
|
4565
|
+
const Mr = {
|
|
4561
4566
|
key: 1,
|
|
4562
4567
|
class: "h-full w-full"
|
|
4563
|
-
},
|
|
4568
|
+
}, Ur = ["src"], Yr = /* @__PURE__ */ lt({
|
|
4564
4569
|
__name: "App",
|
|
4565
4570
|
setup(n) {
|
|
4566
|
-
const e = We(), t = on(), i = an(), r = cn(), s = ln(), o = ht(), c =
|
|
4571
|
+
const e = We(), t = on(), i = an(), r = cn(), s = ln(), o = ht(), c = ne(o.query.showHeader !== "false"), a = ne(!1), { currentBusiness: l } = We(), d = ne(!1), h = Ve(() => i.version), _ = Ve(() => {
|
|
4567
4572
|
const p = e.currentCountry.value || "MY", m = Be.getIdToken(), v = l.value._id;
|
|
4568
|
-
return `${
|
|
4573
|
+
return `${Nr.marketingV1Portal}/b/${v}/marketing/overview?showHeader=false&country=${p}&token=${m}`;
|
|
4569
4574
|
});
|
|
4570
|
-
async function
|
|
4575
|
+
async function x() {
|
|
4571
4576
|
if (En().length) {
|
|
4572
4577
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4573
4578
|
return;
|
|
4574
4579
|
}
|
|
4575
|
-
const p = kn(
|
|
4576
|
-
await
|
|
4580
|
+
const p = kn(Or.firebase), m = await sn.getCustomToken(), v = Ar();
|
|
4581
|
+
await mi(v, m), bn(p), console.log("initFirebase", p);
|
|
4577
4582
|
}
|
|
4578
4583
|
const M = async () => {
|
|
4579
|
-
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value && h.value === "v2" ? e.registerSidebarComponent(
|
|
4584
|
+
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value && h.value === "v2" ? e.registerSidebarComponent(Pn) : e.hideSidebarToggle(!0), await x(), a.value = !0, d.value = !0;
|
|
4580
4585
|
};
|
|
4586
|
+
async function Q() {
|
|
4587
|
+
var p;
|
|
4588
|
+
console.log("initRemyClient.."), await Rn.init({
|
|
4589
|
+
token: ((p = e.sessionUser.value) == null ? void 0 : p.token) || "",
|
|
4590
|
+
dev: Lr.mode === "development"
|
|
4591
|
+
});
|
|
4592
|
+
}
|
|
4581
4593
|
return Xt(() => {
|
|
4582
|
-
if (t.initProvider(r, s), !c.value) {
|
|
4583
|
-
const p = document.getElementsByClassName("app-header")[0], m = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0],
|
|
4584
|
-
p == null || p.classList.add("!hidden"), m == null || m.classList.add("!pt-0"), v == null || v.classList.add("!pt-0"),
|
|
4594
|
+
if (Sn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4595
|
+
const p = document.getElementsByClassName("app-header")[0], m = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0], U = document.getElementsByTagName("main")[0];
|
|
4596
|
+
p == null || p.classList.add("!hidden"), m == null || m.classList.add("!pt-0"), v == null || v.classList.add("!pt-0"), U == null || U.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4585
4597
|
}
|
|
4586
|
-
l.value != null && (console.log("App mounted, forceRerender"), M());
|
|
4598
|
+
l.value != null && (console.log("App mounted, forceRerender"), M()), Q();
|
|
4587
4599
|
}), ut(
|
|
4588
4600
|
() => e.currentBusiness.value,
|
|
4589
4601
|
async (p, m) => {
|
|
4590
4602
|
console.log("Current business changed"), p != null && p._id != m._id && (console.log("forceRerender when business changes", p, m), M());
|
|
4591
4603
|
}
|
|
4592
|
-
), (p, m) => (
|
|
4593
|
-
P(d) && P(h) === "v2" ? (
|
|
4594
|
-
P(d) && P(h) !== "v2" ? (
|
|
4604
|
+
), (p, m) => (ie(), $e(Qt, null, [
|
|
4605
|
+
P(d) && P(h) === "v2" ? (ie(), dt(P(rn), { key: 0 })) : He("", !0),
|
|
4606
|
+
P(d) && P(h) !== "v2" ? (ie(), $e("div", Mr, [
|
|
4595
4607
|
Zt(dn, {
|
|
4596
4608
|
json: { url: P(_) }
|
|
4597
4609
|
}, null, 8, ["json"]),
|
|
@@ -4601,11 +4613,11 @@ const Or = {
|
|
|
4601
4613
|
height: "100%",
|
|
4602
4614
|
width: "100%",
|
|
4603
4615
|
src: P(_)
|
|
4604
|
-
}, null, 8,
|
|
4605
|
-
])) :
|
|
4616
|
+
}, null, 8, Ur)
|
|
4617
|
+
])) : He("", !0)
|
|
4606
4618
|
], 64));
|
|
4607
4619
|
}
|
|
4608
4620
|
});
|
|
4609
4621
|
export {
|
|
4610
|
-
|
|
4622
|
+
Yr as default
|
|
4611
4623
|
};
|