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