@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-beta.81
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-C9JWdPcg.js +761 -0
- package/dist/{App-SRz4257n.js → App-BVEfQEjU.js} +441 -420
- package/dist/AuditLogs-qbqxB_Oz.js +1887 -0
- package/dist/Bin-DPfStHeL.js +166 -0
- package/dist/{Broadcast-DmkrJGp2.js → Broadcast-CrQZDeiZ.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Fpcw9NWs.js} +14 -10
- package/dist/Card-d7rnO53X.js +905 -0
- package/dist/Collections-5rEy2lvX.js +464 -0
- package/dist/{Credit-CcNrq9qk.js → Credit-CHyEsV7R.js} +36 -34
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CLqubY_R.js +2182 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js → EffectSheet.vue_vue_type_style_index_0_lang-DEmIYpS6.js} +49 -49
- package/dist/{Experience-DNsQLzDH.js → Experience-DhDLyUFN.js} +32 -30
- package/dist/FileSaver.min-NlMItPOc.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/Game-CoOZBnN-.js +278 -0
- package/dist/Index-BxzvptzX.js +259 -0
- package/dist/Marketing-CwxJ5Upf.js +20071 -0
- package/dist/Member-D1SRjLZd.js +287 -0
- package/dist/MemberList-C-8mcfuk.js +1606 -0
- package/dist/MemberTransactions-C7uwJdn8.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js → MessageInput.vue_vue_type_script_setup_true_lang-ChQ3zuj7.js} +152 -137
- package/dist/Mission-CtF_zohU.js +296 -0
- package/dist/Overview-g9HqRUmv.js +1079 -0
- package/dist/{Point-Ck8EG_3k.js → Point-BrifiJTO.js} +55 -53
- package/dist/Promotion-D-VpO9Y1.js +289 -0
- package/dist/Queue-V6tLLO52.js +260 -0
- package/dist/Record-C_eSy9Pl.js +341 -0
- package/dist/Reward-BcS5W2o6.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B_g46hrr.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CFvxrx8L.js +1728 -0
- package/dist/Segment-B7JtvneQ.js +880 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BX-E0sDn.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPByAnL2.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DE7ROhd5.js +147 -0
- package/dist/Setting-1KOQwRHn.js +1932 -0
- package/dist/Store-Dj84K8ZK.js +1842 -0
- package/dist/StoreRewards-7rXn3J0B.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D7zdyg9d.js +1029 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D6T7vFXj.js} +1 -1
- package/dist/{Tier-CJ9-d8Zg.js → Tier-CwS_A8F5.js} +350 -334
- package/dist/{Title-DZCpvg4q.js → Title-YAj_vykl.js} +245 -222
- package/dist/{Transaction-DpnTxlbf.js → Transaction-CvbHHpIT.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CYXM679D.js +130 -0
- package/dist/Voucher-C0V9koK8.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DwfF_8uQ.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js → ZodTextField.vue_vue_type_script_setup_true_lang-D3mmtmvI.js} +1 -1
- package/dist/{app-DzAexOqx.js → app-D5BiHqr1.js} +2712 -1266
- package/dist/app-TANcLG-R.js +33357 -0
- package/dist/app.js +1 -1
- package/dist/business-DxNWLRXa.js +79 -0
- package/dist/{campaign-winsqufa.js → campaign-DhEbMRyc.js} +2 -2
- package/dist/campaign-DqFW5qoE.js +1810 -0
- package/dist/campaign.enum-DGpeHkL2.js +20 -0
- package/dist/campaign.fn-BqP9eKCL.js +758 -0
- package/dist/collectible.enum-CSFqER3H.js +19 -0
- package/dist/{collection.fn-CI5Llblg.js → collection.fn-CA112Q3U.js} +2 -2
- package/dist/dto-UeacqOxr.js +214 -0
- package/dist/{effect-CdkrIYgX.js → effect-CEB8v8KY.js} +33 -16
- package/dist/email-addresses-DLDeL77c.js +705 -0
- package/dist/{export-DGxfief1.js → export-B_8_zEGl.js} +5 -5
- package/dist/{helper-B8RqcTNu.js → helper-BN4JZQLv.js} +1 -1
- package/dist/index-B-O8sm9u.js +54 -0
- package/dist/index-B-WW-LtM.js +56 -0
- package/dist/index-BOQonmqm.js +32 -0
- package/dist/{index-9w43_U1v.js → index-CboHpXNN.js} +1506 -1480
- package/dist/{index-A34xEz20.js → index-CjJOf_Ko.js} +2246 -871
- package/dist/index-CsU66Lo8.js +115 -0
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/index-Csb4GQq-.js +29556 -0
- package/dist/{index-wzdbEEcZ.js → index-Cv54KpqR.js} +1 -1
- package/dist/{index-Cw_aXFH6.js → index-D-9zLobO.js} +269 -173
- package/dist/{index-HZC9LLAX.js → index-DLEuoM6n.js} +48 -4
- package/dist/{index-CZgQVRsm.js → index-DX1pCi2M.js} +1 -1
- package/dist/{index-OzicErwL.js → index-Dtvx0B0f.js} +24 -21
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{loading-DuEFUCwF.js → index-wwxalEHE.js} +4609 -4886
- package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-B8lg2TL9.js} +206 -206
- package/dist/loading-C7yV_Gjh.js +71 -0
- package/dist/{membership-nsMtWeTC.js → membership-DVqBNqdx.js} +80 -66
- package/dist/money-DlG5z_tl.js +15 -0
- package/dist/number-CEbwCzov.js +12 -0
- package/dist/objectid-Du3yg6Vv.js +145 -0
- package/dist/plugins-D_RKZlC6.js +208 -0
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-Bv14VitO.js +36 -0
- package/dist/{rule-CPIMqt1h.js → rule-BR5ZUIKH.js} +185 -178
- package/dist/{rule-builder-CSs5XRKP.js → rule-builder-CITle0qo.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CJZoYavu.js → template-ybPO7TWN.js} +5 -5
- package/dist/trigger-5C6n0ORq.js +144 -0
- package/dist/user-CP3tloTS.js +54 -0
- package/dist/vue-i18n-DGew8_SZ.js +2365 -0
- package/dist/{xlsx-BZlnYinX.js → xlsx-CsBnmxHp.js} +1 -1
- package/package.json +11 -7
- package/dist/Analytic-5QztrYSp.js +0 -622
- package/dist/Card-BsjFTVsH.js +0 -825
- package/dist/Collections-7wqZHOax.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js +0 -2813
- package/dist/Game-DlzDerT7.js +0 -255
- package/dist/Marketing-BqhpaG4o.js +0 -316
- package/dist/Member-AFgZcdtz.js +0 -69
- package/dist/MemberList-BKgrLz2C.js +0 -1733
- package/dist/MemberTransactions-BwT3zE2a.js +0 -38
- package/dist/Mission-BTAia7AS.js +0 -261
- package/dist/Promotion-0v3kvsK3.js +0 -247
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js +0 -1753
- package/dist/Segment-BenLupqV.js +0 -437
- package/dist/Setting-0fpREqpJ.js +0 -1901
- package/dist/Store-BDGwe4ar.js +0 -1511
- package/dist/StoreRewards-TDZt9H1V.js +0 -401
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js +0 -890
- package/dist/Voucher-DsP_rh8I.js +0 -490
- package/dist/app-Cg2pTZJK.js +0 -53428
- package/dist/business-Cw_qGw8y.js +0 -78
- package/dist/dto-ozu1smC3.js +0 -2770
- package/dist/index-BLACZ3-L.js +0 -206
- package/dist/index-BaozRfWB.js +0 -762
- package/dist/index-CjVmULNd.js +0 -99
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DAEmawcj.js +0 -298
- package/dist/index-Oxr-mU6h.js +0 -29193
- package/dist/money-BGZPFtUc.js +0 -15
- package/dist/number-4J0xvXP9.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
- package/dist/vue-i18n-CCyiVzOE.js +0 -2365
|
@@ -1,113 +1,127 @@
|
|
|
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
|
|
5
|
+
import { u as an } from "./business-DxNWLRXa.js";
|
|
6
|
+
import "./index-DX1pCi2M.js";
|
|
7
|
+
import { components as q, useSnackbar as cn, useDialog as ln } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as un } from "./vue-i18n-DGew8_SZ.js";
|
|
9
|
+
import { R as h } from "./app-D5BiHqr1.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-B8lg2TL9.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-Csb4GQq-.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
|
-
value:
|
|
21
|
+
value: h["$connect-ANALYTIC"]
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
24
|
label: e("connect.navigation.campaign"),
|
|
24
|
-
value:
|
|
25
|
+
value: h["$connect-CAMPAIGN"],
|
|
25
26
|
children: [
|
|
26
27
|
{
|
|
27
28
|
label: e("connect.navigation.promotion"),
|
|
28
|
-
value:
|
|
29
|
+
value: h["$connect-CAMPAIGN_PROMOTION"]
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
label: e("connect.navigation.voucher"),
|
|
32
|
-
value:
|
|
33
|
+
value: h["$connect-CAMPAIGN_VOUCHER"]
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
36
|
label: e("connect.navigation.broadcast"),
|
|
36
|
-
value:
|
|
37
|
+
value: h["$connect-CAMPAIGN_BROADCAST"]
|
|
37
38
|
}
|
|
38
39
|
]
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
label: e("connect.navigation.program"),
|
|
42
|
-
value:
|
|
43
|
+
value: h["$connect-PROGRAM"],
|
|
43
44
|
children: [
|
|
44
45
|
{
|
|
45
46
|
label: e("connect.navigation.tier"),
|
|
46
|
-
value:
|
|
47
|
+
value: h["$connect-PROGRAM_TIER"]
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
label: e("connect.navigation.title"),
|
|
50
|
-
value:
|
|
51
|
+
value: h["$connect-PROGRAM_TITLE"]
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
label: e("connect.navigation.experience"),
|
|
54
|
-
value:
|
|
55
|
+
value: h["$connect-PROGRAM_EXPERIENCE"]
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
label: e("connect.navigation.point"),
|
|
58
|
-
value:
|
|
59
|
-
badge: () =>
|
|
59
|
+
value: h["$connect-PROGRAM_POINT"],
|
|
60
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
label: e("connect.navigation.credit"),
|
|
63
|
-
value:
|
|
64
|
+
value: h["$connect-PROGRAM_CREDIT"]
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
67
|
label: e("connect.navigation.game"),
|
|
67
|
-
value:
|
|
68
|
-
badge: () =>
|
|
68
|
+
value: h["$connect-PROGRAM_GAME"],
|
|
69
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
72
|
label: "Mission",
|
|
72
|
-
value:
|
|
73
|
+
value: h["$connect-PROGRAM_MISSION"]
|
|
73
74
|
}
|
|
74
75
|
]
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
78
|
label: e("connect.navigation.loyalty"),
|
|
78
|
-
value:
|
|
79
|
+
value: h["$connect-LOYALTY"],
|
|
79
80
|
children: [
|
|
80
81
|
{
|
|
81
82
|
label: e("connect.navigation.member"),
|
|
82
|
-
value:
|
|
83
|
+
value: h["$connect-LOYALTY_MEMBER_LIST"]
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
86
|
label: e("connect.navigation.segments"),
|
|
86
|
-
value:
|
|
87
|
-
badge: () =>
|
|
87
|
+
value: h["$connect-LOYALTY_SEGMENT"],
|
|
88
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
label: e("connect.navigation.card"),
|
|
91
|
-
value:
|
|
92
|
-
badge: () =>
|
|
92
|
+
value: h["$connect-LOYALTY_CARD"],
|
|
93
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
93
94
|
}
|
|
94
95
|
]
|
|
95
96
|
},
|
|
97
|
+
{
|
|
98
|
+
label: e("connect.navigation.referral"),
|
|
99
|
+
value: h["$connect-REFERRAL"],
|
|
100
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
101
|
+
},
|
|
96
102
|
{
|
|
97
103
|
label: e("connect.navigation.store"),
|
|
98
|
-
value:
|
|
104
|
+
value: h["$connect-STORE"]
|
|
99
105
|
},
|
|
100
106
|
{
|
|
101
107
|
label: e("connect.navigation.transaction"),
|
|
102
|
-
value:
|
|
108
|
+
value: h["$connect-TRANSACTION"]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: "Marketing material",
|
|
112
|
+
value: h["$connect-MARKETING"]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: e("connect.navigation.auditLogs"),
|
|
116
|
+
value: h["$connect-AUDIT_LOGS"]
|
|
103
117
|
},
|
|
104
|
-
// {
|
|
105
|
-
// label: 'Marketing material',
|
|
106
|
-
// value: ROUTE_NAME['$connect-MARKETING'],
|
|
107
|
-
// },
|
|
108
118
|
{
|
|
109
119
|
label: e("connect.navigation.setting"),
|
|
110
|
-
value:
|
|
120
|
+
value: h["$connect-SETTING"]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: e("connect.navigation.bin"),
|
|
124
|
+
value: h["$connect-BIN"]
|
|
111
125
|
}
|
|
112
126
|
], r = nn(), s = ht(), o = i.reduce((a, l) => [...(l.children ?? []).map((d) => d.value), ...a, l.value], []);
|
|
113
127
|
ut(
|
|
@@ -122,18 +136,18 @@ const bn = /* @__PURE__ */ lt({
|
|
|
122
136
|
await r.push({ name: a });
|
|
123
137
|
}
|
|
124
138
|
return (a, l) => {
|
|
125
|
-
var
|
|
139
|
+
var f;
|
|
126
140
|
const d = Yt("FmCollapsibleTabs");
|
|
127
|
-
return
|
|
141
|
+
return ie(), dt(d, {
|
|
128
142
|
class: "border-fm-color-neutral-gray-100 border-r py-16 px-4",
|
|
129
|
-
"model-value": (
|
|
143
|
+
"model-value": (f = P(t)) == null ? void 0 : f.toString(),
|
|
130
144
|
items: i,
|
|
131
145
|
"onUpdate:modelValue": c
|
|
132
146
|
}, null, 8, ["model-value"]);
|
|
133
147
|
};
|
|
134
148
|
}
|
|
135
149
|
});
|
|
136
|
-
var
|
|
150
|
+
var An = "firebase", Cn = "10.12.4";
|
|
137
151
|
/**
|
|
138
152
|
* @license
|
|
139
153
|
* Copyright 2020 Google LLC
|
|
@@ -150,13 +164,13 @@ var Rn = "firebase", Pn = "10.12.4";
|
|
|
150
164
|
* See the License for the specific language governing permissions and
|
|
151
165
|
* limitations under the License.
|
|
152
166
|
*/
|
|
153
|
-
ye(
|
|
167
|
+
ye(An, Cn, "app");
|
|
154
168
|
function gt() {
|
|
155
169
|
return {
|
|
156
170
|
"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
171
|
};
|
|
158
172
|
}
|
|
159
|
-
const
|
|
173
|
+
const On = gt, _t = new Se("auth", "Firebase", gt());
|
|
160
174
|
/**
|
|
161
175
|
* @license
|
|
162
176
|
* Copyright 2020 Google LLC
|
|
@@ -173,12 +187,12 @@ const An = gt, _t = new be("auth", "Firebase", gt());
|
|
|
173
187
|
* See the License for the specific language governing permissions and
|
|
174
188
|
* limitations under the License.
|
|
175
189
|
*/
|
|
176
|
-
const
|
|
177
|
-
function
|
|
178
|
-
|
|
190
|
+
const ce = new hn("@firebase/auth");
|
|
191
|
+
function Nn(n, ...e) {
|
|
192
|
+
ce.logLevel <= mt.WARN && ce.warn(`Auth (${J}): ${n}`, ...e);
|
|
179
193
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
194
|
+
function re(n, ...e) {
|
|
195
|
+
ce.logLevel <= mt.ERROR && ce.error(`Auth (${J}): ${n}`, ...e);
|
|
182
196
|
}
|
|
183
197
|
/**
|
|
184
198
|
* @license
|
|
@@ -196,15 +210,15 @@ function ie(n, ...e) {
|
|
|
196
210
|
* See the License for the specific language governing permissions and
|
|
197
211
|
* limitations under the License.
|
|
198
212
|
*/
|
|
199
|
-
function
|
|
213
|
+
function b(n, ...e) {
|
|
200
214
|
throw Ae(n, ...e);
|
|
201
215
|
}
|
|
202
216
|
function I(n, ...e) {
|
|
203
217
|
return Ae(n, ...e);
|
|
204
218
|
}
|
|
205
219
|
function vt(n, e, t) {
|
|
206
|
-
const i = Object.assign(Object.assign({},
|
|
207
|
-
return new
|
|
220
|
+
const i = Object.assign(Object.assign({}, On()), { [e]: t });
|
|
221
|
+
return new Se("auth", "Firebase", i).create(e, {
|
|
208
222
|
appName: n.name
|
|
209
223
|
});
|
|
210
224
|
}
|
|
@@ -224,9 +238,9 @@ function u(n, e, ...t) {
|
|
|
224
238
|
}
|
|
225
239
|
function y(n) {
|
|
226
240
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
227
|
-
throw
|
|
241
|
+
throw re(e), new Error(e);
|
|
228
242
|
}
|
|
229
|
-
function
|
|
243
|
+
function S(n, e) {
|
|
230
244
|
n || y(e);
|
|
231
245
|
}
|
|
232
246
|
/**
|
|
@@ -249,7 +263,7 @@ function Ee() {
|
|
|
249
263
|
var n;
|
|
250
264
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
251
265
|
}
|
|
252
|
-
function
|
|
266
|
+
function Ln() {
|
|
253
267
|
return qe() === "http:" || qe() === "https:";
|
|
254
268
|
}
|
|
255
269
|
function qe() {
|
|
@@ -272,15 +286,15 @@ function qe() {
|
|
|
272
286
|
* See the License for the specific language governing permissions and
|
|
273
287
|
* limitations under the License.
|
|
274
288
|
*/
|
|
275
|
-
function
|
|
289
|
+
function Mn() {
|
|
276
290
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
277
291
|
// This is especially true for Cordova apps which have unreliable
|
|
278
292
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
279
293
|
// installed which overwrites the native navigator.onLine value and
|
|
280
294
|
// defines navigator.connection.
|
|
281
|
-
(
|
|
295
|
+
(Ln() || mn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
282
296
|
}
|
|
283
|
-
function
|
|
297
|
+
function Un() {
|
|
284
298
|
if (typeof navigator > "u")
|
|
285
299
|
return null;
|
|
286
300
|
const n = navigator;
|
|
@@ -308,12 +322,12 @@ function Ln() {
|
|
|
308
322
|
* See the License for the specific language governing permissions and
|
|
309
323
|
* limitations under the License.
|
|
310
324
|
*/
|
|
311
|
-
class
|
|
325
|
+
class X {
|
|
312
326
|
constructor(e, t) {
|
|
313
|
-
this.shortDelay = e, this.longDelay = t,
|
|
327
|
+
this.shortDelay = e, this.longDelay = t, S(t > e, "Short delay should be less than long delay!"), this.isMobile = fn() || pn();
|
|
314
328
|
}
|
|
315
329
|
get() {
|
|
316
|
-
return
|
|
330
|
+
return Mn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
317
331
|
}
|
|
318
332
|
}
|
|
319
333
|
/**
|
|
@@ -333,7 +347,7 @@ class J {
|
|
|
333
347
|
* limitations under the License.
|
|
334
348
|
*/
|
|
335
349
|
function Ce(n, e) {
|
|
336
|
-
|
|
350
|
+
S(n.emulator, "Emulator should always be set here");
|
|
337
351
|
const { url: t } = n.emulator;
|
|
338
352
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
339
353
|
}
|
|
@@ -407,7 +421,7 @@ class It {
|
|
|
407
421
|
* See the License for the specific language governing permissions and
|
|
408
422
|
* limitations under the License.
|
|
409
423
|
*/
|
|
410
|
-
const
|
|
424
|
+
const Dn = {
|
|
411
425
|
// Custom token errors.
|
|
412
426
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
413
427
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -498,8 +512,8 @@ const Mn = {
|
|
|
498
512
|
* See the License for the specific language governing permissions and
|
|
499
513
|
* limitations under the License.
|
|
500
514
|
*/
|
|
501
|
-
const
|
|
502
|
-
function
|
|
515
|
+
const Fn = new X(3e4, 6e4);
|
|
516
|
+
function fe(n, e) {
|
|
503
517
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
504
518
|
}
|
|
505
519
|
async function G(n, e, t, i, r = {}) {
|
|
@@ -508,7 +522,7 @@ async function G(n, e, t, i, r = {}) {
|
|
|
508
522
|
i && (e === "GET" ? o = i : s = {
|
|
509
523
|
body: JSON.stringify(i)
|
|
510
524
|
});
|
|
511
|
-
const c =
|
|
525
|
+
const c = Y(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
512
526
|
return a[
|
|
513
527
|
"Content-Type"
|
|
514
528
|
/* HttpHeader.CONTENT_TYPE */
|
|
@@ -524,40 +538,40 @@ async function G(n, e, t, i, r = {}) {
|
|
|
524
538
|
}
|
|
525
539
|
async function Tt(n, e, t) {
|
|
526
540
|
n._canInitEmulator = !1;
|
|
527
|
-
const i = Object.assign(Object.assign({},
|
|
541
|
+
const i = Object.assign(Object.assign({}, Dn), e);
|
|
528
542
|
try {
|
|
529
|
-
const r = new
|
|
543
|
+
const r = new xn(n), s = await Promise.race([
|
|
530
544
|
t(),
|
|
531
545
|
r.promise
|
|
532
546
|
]);
|
|
533
547
|
r.clearNetworkTimeout();
|
|
534
548
|
const o = await s.json();
|
|
535
549
|
if ("needConfirmation" in o)
|
|
536
|
-
throw
|
|
550
|
+
throw te(n, "account-exists-with-different-credential", o);
|
|
537
551
|
if (s.ok && !("errorMessage" in o))
|
|
538
552
|
return o;
|
|
539
553
|
{
|
|
540
554
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
541
555
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
542
|
-
throw
|
|
556
|
+
throw te(n, "credential-already-in-use", o);
|
|
543
557
|
if (a === "EMAIL_EXISTS")
|
|
544
|
-
throw
|
|
558
|
+
throw te(n, "email-already-in-use", o);
|
|
545
559
|
if (a === "USER_DISABLED")
|
|
546
|
-
throw
|
|
560
|
+
throw te(n, "user-disabled", o);
|
|
547
561
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
548
562
|
if (l)
|
|
549
563
|
throw vt(n, d, l);
|
|
550
|
-
|
|
564
|
+
b(n, d);
|
|
551
565
|
}
|
|
552
566
|
} catch (r) {
|
|
553
567
|
if (r instanceof Re)
|
|
554
568
|
throw r;
|
|
555
|
-
|
|
569
|
+
b(n, "network-request-failed", { message: String(r) });
|
|
556
570
|
}
|
|
557
571
|
}
|
|
558
572
|
async function wt(n, e, t, i, r = {}) {
|
|
559
573
|
const s = await G(n, e, t, i, r);
|
|
560
|
-
return "mfaPendingCredential" in s &&
|
|
574
|
+
return "mfaPendingCredential" in s && b(n, "multi-factor-auth-required", {
|
|
561
575
|
_serverResponse: s
|
|
562
576
|
}), s;
|
|
563
577
|
}
|
|
@@ -565,21 +579,21 @@ function yt(n, e, t, i) {
|
|
|
565
579
|
const r = `${e}${t}?${i}`;
|
|
566
580
|
return n.config.emulator ? Ce(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
567
581
|
}
|
|
568
|
-
class
|
|
582
|
+
class xn {
|
|
569
583
|
constructor(e) {
|
|
570
584
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
571
585
|
this.timer = setTimeout(() => i(I(
|
|
572
586
|
this.auth,
|
|
573
587
|
"network-request-failed"
|
|
574
588
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
575
|
-
)),
|
|
589
|
+
)), Fn.get());
|
|
576
590
|
});
|
|
577
591
|
}
|
|
578
592
|
clearNetworkTimeout() {
|
|
579
593
|
clearTimeout(this.timer);
|
|
580
594
|
}
|
|
581
595
|
}
|
|
582
|
-
function
|
|
596
|
+
function te(n, e, t) {
|
|
583
597
|
const i = {
|
|
584
598
|
appName: n.name
|
|
585
599
|
};
|
|
@@ -603,7 +617,7 @@ function ee(n, e, t) {
|
|
|
603
617
|
* See the License for the specific language governing permissions and
|
|
604
618
|
* limitations under the License.
|
|
605
619
|
*/
|
|
606
|
-
async function
|
|
620
|
+
async function Vn(n, e) {
|
|
607
621
|
return G(n, "POST", "/v1/accounts:delete", e);
|
|
608
622
|
}
|
|
609
623
|
async function Et(n, e) {
|
|
@@ -625,7 +639,7 @@ async function Et(n, e) {
|
|
|
625
639
|
* See the License for the specific language governing permissions and
|
|
626
640
|
* limitations under the License.
|
|
627
641
|
*/
|
|
628
|
-
function
|
|
642
|
+
function z(n) {
|
|
629
643
|
if (n)
|
|
630
644
|
try {
|
|
631
645
|
const e = new Date(Number(n));
|
|
@@ -634,7 +648,7 @@ function B(n) {
|
|
|
634
648
|
} catch {
|
|
635
649
|
}
|
|
636
650
|
}
|
|
637
|
-
async function
|
|
651
|
+
async function $n(n, e = !1) {
|
|
638
652
|
const t = j(n), i = await t.getIdToken(e), r = Oe(i);
|
|
639
653
|
u(
|
|
640
654
|
r && r.exp && r.auth_time && r.iat,
|
|
@@ -646,9 +660,9 @@ async function xn(n, e = !1) {
|
|
|
646
660
|
return {
|
|
647
661
|
claims: r,
|
|
648
662
|
token: i,
|
|
649
|
-
authTime:
|
|
650
|
-
issuedAtTime:
|
|
651
|
-
expirationTime:
|
|
663
|
+
authTime: z(Te(r.auth_time)),
|
|
664
|
+
issuedAtTime: z(Te(r.iat)),
|
|
665
|
+
expirationTime: z(Te(r.exp)),
|
|
652
666
|
signInProvider: o || null,
|
|
653
667
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
654
668
|
};
|
|
@@ -659,12 +673,12 @@ function Te(n) {
|
|
|
659
673
|
function Oe(n) {
|
|
660
674
|
const [e, t, i] = n.split(".");
|
|
661
675
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
662
|
-
return
|
|
676
|
+
return re("JWT malformed, contained fewer than 3 sections"), null;
|
|
663
677
|
try {
|
|
664
678
|
const r = Tn(t);
|
|
665
|
-
return r ? JSON.parse(r) : (
|
|
679
|
+
return r ? JSON.parse(r) : (re("Failed to decode base64 JWT payload"), null);
|
|
666
680
|
} catch (r) {
|
|
667
|
-
return
|
|
681
|
+
return re("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
668
682
|
}
|
|
669
683
|
}
|
|
670
684
|
function ze(n) {
|
|
@@ -699,16 +713,16 @@ function ze(n) {
|
|
|
699
713
|
* See the License for the specific language governing permissions and
|
|
700
714
|
* limitations under the License.
|
|
701
715
|
*/
|
|
702
|
-
async function
|
|
716
|
+
async function K(n, e, t = !1) {
|
|
703
717
|
if (t)
|
|
704
718
|
return e;
|
|
705
719
|
try {
|
|
706
720
|
return await e;
|
|
707
721
|
} catch (i) {
|
|
708
|
-
throw i instanceof Re &&
|
|
722
|
+
throw i instanceof Re && Hn(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
709
723
|
}
|
|
710
724
|
}
|
|
711
|
-
function
|
|
725
|
+
function Hn({ code: n }) {
|
|
712
726
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
713
727
|
}
|
|
714
728
|
/**
|
|
@@ -727,7 +741,7 @@ function Vn({ code: n }) {
|
|
|
727
741
|
* See the License for the specific language governing permissions and
|
|
728
742
|
* limitations under the License.
|
|
729
743
|
*/
|
|
730
|
-
class
|
|
744
|
+
class Wn {
|
|
731
745
|
constructor(e) {
|
|
732
746
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
733
747
|
}
|
|
@@ -794,7 +808,7 @@ class ke {
|
|
|
794
808
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
795
809
|
}
|
|
796
810
|
_initializeTime() {
|
|
797
|
-
this.lastSignInTime =
|
|
811
|
+
this.lastSignInTime = z(this.lastLoginAt), this.creationTime = z(this.createdAt);
|
|
798
812
|
}
|
|
799
813
|
_copy(e) {
|
|
800
814
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -822,9 +836,9 @@ class ke {
|
|
|
822
836
|
* See the License for the specific language governing permissions and
|
|
823
837
|
* limitations under the License.
|
|
824
838
|
*/
|
|
825
|
-
async function
|
|
839
|
+
async function le(n) {
|
|
826
840
|
var e;
|
|
827
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
841
|
+
const t = n.auth, i = await n.getIdToken(), r = await K(n, Et(t, { idToken: i }));
|
|
828
842
|
u(
|
|
829
843
|
r == null ? void 0 : r.users.length,
|
|
830
844
|
t,
|
|
@@ -833,7 +847,7 @@ async function ce(n) {
|
|
|
833
847
|
);
|
|
834
848
|
const s = r.users[0];
|
|
835
849
|
n._notifyReloadListener(s);
|
|
836
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? kt(s.providerUserInfo) : [], c =
|
|
850
|
+
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, f = {
|
|
837
851
|
uid: s.localId,
|
|
838
852
|
displayName: s.displayName || null,
|
|
839
853
|
photoURL: s.photoUrl || null,
|
|
@@ -845,13 +859,13 @@ async function ce(n) {
|
|
|
845
859
|
metadata: new ke(s.createdAt, s.lastLoginAt),
|
|
846
860
|
isAnonymous: d
|
|
847
861
|
};
|
|
848
|
-
Object.assign(n,
|
|
862
|
+
Object.assign(n, f);
|
|
849
863
|
}
|
|
850
|
-
async function
|
|
864
|
+
async function jn(n) {
|
|
851
865
|
const e = j(n);
|
|
852
|
-
await
|
|
866
|
+
await le(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
853
867
|
}
|
|
854
|
-
function
|
|
868
|
+
function Gn(n, e) {
|
|
855
869
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
856
870
|
}
|
|
857
871
|
function kt(n) {
|
|
@@ -883,9 +897,9 @@ function kt(n) {
|
|
|
883
897
|
* See the License for the specific language governing permissions and
|
|
884
898
|
* limitations under the License.
|
|
885
899
|
*/
|
|
886
|
-
async function
|
|
900
|
+
async function Bn(n, e) {
|
|
887
901
|
const t = await Tt(n, {}, async () => {
|
|
888
|
-
const i =
|
|
902
|
+
const i = Y({
|
|
889
903
|
grant_type: "refresh_token",
|
|
890
904
|
refresh_token: e
|
|
891
905
|
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = yt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
@@ -904,8 +918,8 @@ async function jn(n, e) {
|
|
|
904
918
|
refreshToken: t.refresh_token
|
|
905
919
|
};
|
|
906
920
|
}
|
|
907
|
-
async function
|
|
908
|
-
return G(n, "POST", "/v2/accounts:revokeToken",
|
|
921
|
+
async function qn(n, e) {
|
|
922
|
+
return G(n, "POST", "/v2/accounts:revokeToken", fe(n, e));
|
|
909
923
|
}
|
|
910
924
|
/**
|
|
911
925
|
* @license
|
|
@@ -923,7 +937,7 @@ async function Gn(n, e) {
|
|
|
923
937
|
* See the License for the specific language governing permissions and
|
|
924
938
|
* limitations under the License.
|
|
925
939
|
*/
|
|
926
|
-
class
|
|
940
|
+
class $ {
|
|
927
941
|
constructor() {
|
|
928
942
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
929
943
|
}
|
|
@@ -968,14 +982,14 @@ class H {
|
|
|
968
982
|
this.refreshToken = null;
|
|
969
983
|
}
|
|
970
984
|
async refresh(e, t) {
|
|
971
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
985
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await Bn(e, t);
|
|
972
986
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
973
987
|
}
|
|
974
988
|
updateTokensAndExpiration(e, t, i) {
|
|
975
989
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
976
990
|
}
|
|
977
991
|
static fromJSON(e, t) {
|
|
978
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
992
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new $();
|
|
979
993
|
return i && (u(typeof i == "string", "internal-error", {
|
|
980
994
|
appName: e
|
|
981
995
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -995,7 +1009,7 @@ class H {
|
|
|
995
1009
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
996
1010
|
}
|
|
997
1011
|
_clone() {
|
|
998
|
-
return Object.assign(new
|
|
1012
|
+
return Object.assign(new $(), this.toJSON());
|
|
999
1013
|
}
|
|
1000
1014
|
_performRefresh() {
|
|
1001
1015
|
return y("not implemented");
|
|
@@ -1023,10 +1037,10 @@ function R(n, e) {
|
|
|
1023
1037
|
class E {
|
|
1024
1038
|
constructor(e) {
|
|
1025
1039
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = Pe(e, ["uid", "auth", "stsTokenManager"]);
|
|
1026
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1040
|
+
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
1041
|
}
|
|
1028
1042
|
async getIdToken(e) {
|
|
1029
|
-
const t = await
|
|
1043
|
+
const t = await K(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1030
1044
|
return u(
|
|
1031
1045
|
t,
|
|
1032
1046
|
this.auth,
|
|
@@ -1035,10 +1049,10 @@ class E {
|
|
|
1035
1049
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1036
1050
|
}
|
|
1037
1051
|
getIdTokenResult(e) {
|
|
1038
|
-
return
|
|
1052
|
+
return $n(this, e);
|
|
1039
1053
|
}
|
|
1040
1054
|
reload() {
|
|
1041
|
-
return
|
|
1055
|
+
return jn(this);
|
|
1042
1056
|
}
|
|
1043
1057
|
_assign(e) {
|
|
1044
1058
|
this !== e && (u(
|
|
@@ -1071,13 +1085,13 @@ class E {
|
|
|
1071
1085
|
}
|
|
1072
1086
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1073
1087
|
let i = !1;
|
|
1074
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1088
|
+
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
1089
|
}
|
|
1076
1090
|
async delete() {
|
|
1077
1091
|
if (w(this.auth.app))
|
|
1078
1092
|
return Promise.reject(L(this.auth));
|
|
1079
1093
|
const e = await this.getIdToken();
|
|
1080
|
-
return await
|
|
1094
|
+
return await K(this, Vn(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1081
1095
|
}
|
|
1082
1096
|
toJSON() {
|
|
1083
1097
|
return Object.assign(Object.assign({
|
|
@@ -1105,20 +1119,20 @@ class E {
|
|
|
1105
1119
|
}
|
|
1106
1120
|
static _fromJSON(e, t) {
|
|
1107
1121
|
var i, r, s, o, c, a, l, d;
|
|
1108
|
-
const
|
|
1122
|
+
const f = (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
1123
|
u(
|
|
1110
|
-
|
|
1124
|
+
U && xe,
|
|
1111
1125
|
e,
|
|
1112
1126
|
"internal-error"
|
|
1113
1127
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1114
1128
|
);
|
|
1115
|
-
const Kt =
|
|
1129
|
+
const Kt = $.fromJSON(this.name, xe);
|
|
1116
1130
|
u(
|
|
1117
|
-
typeof
|
|
1131
|
+
typeof U == "string",
|
|
1118
1132
|
e,
|
|
1119
1133
|
"internal-error"
|
|
1120
1134
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1121
|
-
), R(
|
|
1135
|
+
), R(f, e.name), R(_, e.name), u(
|
|
1122
1136
|
typeof De == "boolean",
|
|
1123
1137
|
e,
|
|
1124
1138
|
"internal-error"
|
|
@@ -1128,22 +1142,22 @@ class E {
|
|
|
1128
1142
|
e,
|
|
1129
1143
|
"internal-error"
|
|
1130
1144
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1131
|
-
), R(
|
|
1145
|
+
), 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
1146
|
const Ie = new E({
|
|
1133
|
-
uid:
|
|
1147
|
+
uid: U,
|
|
1134
1148
|
auth: e,
|
|
1135
1149
|
email: _,
|
|
1136
1150
|
emailVerified: De,
|
|
1137
|
-
displayName:
|
|
1151
|
+
displayName: f,
|
|
1138
1152
|
isAnonymous: Fe,
|
|
1139
1153
|
photoURL: M,
|
|
1140
|
-
phoneNumber:
|
|
1141
|
-
tenantId:
|
|
1154
|
+
phoneNumber: x,
|
|
1155
|
+
tenantId: ee,
|
|
1142
1156
|
stsTokenManager: Kt,
|
|
1143
|
-
createdAt:
|
|
1144
|
-
lastLoginAt:
|
|
1157
|
+
createdAt: m,
|
|
1158
|
+
lastLoginAt: v
|
|
1145
1159
|
});
|
|
1146
|
-
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))),
|
|
1160
|
+
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))), p && (Ie._redirectEventId = p), Ie;
|
|
1147
1161
|
}
|
|
1148
1162
|
/**
|
|
1149
1163
|
* Initialize a User from an idToken server response
|
|
@@ -1151,7 +1165,7 @@ class E {
|
|
|
1151
1165
|
* @param idTokenResponse
|
|
1152
1166
|
*/
|
|
1153
1167
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1154
|
-
const r = new
|
|
1168
|
+
const r = new $();
|
|
1155
1169
|
r.updateFromServerResponse(t);
|
|
1156
1170
|
const s = new E({
|
|
1157
1171
|
uid: t.localId,
|
|
@@ -1159,7 +1173,7 @@ class E {
|
|
|
1159
1173
|
stsTokenManager: r,
|
|
1160
1174
|
isAnonymous: i
|
|
1161
1175
|
});
|
|
1162
|
-
return await
|
|
1176
|
+
return await le(s), s;
|
|
1163
1177
|
}
|
|
1164
1178
|
/**
|
|
1165
1179
|
* Initialize a User from an idToken server response
|
|
@@ -1173,7 +1187,7 @@ class E {
|
|
|
1173
1187
|
"internal-error"
|
|
1174
1188
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1175
1189
|
);
|
|
1176
|
-
const s = r.providerUserInfo !== void 0 ? kt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new
|
|
1190
|
+
const s = r.providerUserInfo !== void 0 ? kt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new $();
|
|
1177
1191
|
c.updateFromIdToken(i);
|
|
1178
1192
|
const a = new E({
|
|
1179
1193
|
uid: r.localId,
|
|
@@ -1213,9 +1227,9 @@ class E {
|
|
|
1213
1227
|
*/
|
|
1214
1228
|
const Ke = /* @__PURE__ */ new Map();
|
|
1215
1229
|
function k(n) {
|
|
1216
|
-
|
|
1230
|
+
S(n instanceof Function, "Expected a class definition");
|
|
1217
1231
|
let e = Ke.get(n);
|
|
1218
|
-
return e ? (
|
|
1232
|
+
return e ? (S(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), Ke.set(n, e), e);
|
|
1219
1233
|
}
|
|
1220
1234
|
/**
|
|
1221
1235
|
* @license
|
|
@@ -1233,7 +1247,7 @@ function k(n) {
|
|
|
1233
1247
|
* See the License for the specific language governing permissions and
|
|
1234
1248
|
* limitations under the License.
|
|
1235
1249
|
*/
|
|
1236
|
-
class
|
|
1250
|
+
class bt {
|
|
1237
1251
|
constructor() {
|
|
1238
1252
|
this.type = "NONE", this.storage = {};
|
|
1239
1253
|
}
|
|
@@ -1255,8 +1269,8 @@ class St {
|
|
|
1255
1269
|
_removeListener(e, t) {
|
|
1256
1270
|
}
|
|
1257
1271
|
}
|
|
1258
|
-
|
|
1259
|
-
const Je =
|
|
1272
|
+
bt.type = "NONE";
|
|
1273
|
+
const Je = bt;
|
|
1260
1274
|
/**
|
|
1261
1275
|
* @license
|
|
1262
1276
|
* Copyright 2019 Google LLC
|
|
@@ -1273,14 +1287,14 @@ const Je = St;
|
|
|
1273
1287
|
* See the License for the specific language governing permissions and
|
|
1274
1288
|
* limitations under the License.
|
|
1275
1289
|
*/
|
|
1276
|
-
function
|
|
1290
|
+
function se(n, e, t) {
|
|
1277
1291
|
return `firebase:${n}:${e}:${t}`;
|
|
1278
1292
|
}
|
|
1279
|
-
class
|
|
1293
|
+
class H {
|
|
1280
1294
|
constructor(e, t, i) {
|
|
1281
1295
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1282
1296
|
const { config: r, name: s } = this.auth;
|
|
1283
|
-
this.fullUserKey =
|
|
1297
|
+
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
1298
|
}
|
|
1285
1299
|
setCurrentUser(e) {
|
|
1286
1300
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
@@ -1307,32 +1321,32 @@ class $ {
|
|
|
1307
1321
|
}
|
|
1308
1322
|
static async create(e, t, i = "authUser") {
|
|
1309
1323
|
if (!t.length)
|
|
1310
|
-
return new
|
|
1324
|
+
return new H(k(Je), e, i);
|
|
1311
1325
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1312
1326
|
if (await l._isAvailable())
|
|
1313
1327
|
return l;
|
|
1314
1328
|
}))).filter((l) => l);
|
|
1315
1329
|
let s = r[0] || k(Je);
|
|
1316
|
-
const o =
|
|
1330
|
+
const o = se(i, e.config.apiKey, e.name);
|
|
1317
1331
|
let c = null;
|
|
1318
1332
|
for (const l of t)
|
|
1319
1333
|
try {
|
|
1320
1334
|
const d = await l._get(o);
|
|
1321
1335
|
if (d) {
|
|
1322
|
-
const
|
|
1323
|
-
l !== s && (c =
|
|
1336
|
+
const f = E._fromJSON(e, d);
|
|
1337
|
+
l !== s && (c = f), s = l;
|
|
1324
1338
|
break;
|
|
1325
1339
|
}
|
|
1326
1340
|
} catch {
|
|
1327
1341
|
}
|
|
1328
1342
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1329
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1343
|
+
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
1344
|
if (l !== s)
|
|
1331
1345
|
try {
|
|
1332
1346
|
await l._remove(o);
|
|
1333
1347
|
} catch {
|
|
1334
1348
|
}
|
|
1335
|
-
})), new
|
|
1349
|
+
})), new H(s, e, i));
|
|
1336
1350
|
}
|
|
1337
1351
|
}
|
|
1338
1352
|
/**
|
|
@@ -1361,7 +1375,7 @@ function Ye(n) {
|
|
|
1361
1375
|
return "IE";
|
|
1362
1376
|
if (e.includes("edge/"))
|
|
1363
1377
|
return "Edge";
|
|
1364
|
-
if (
|
|
1378
|
+
if (St(e))
|
|
1365
1379
|
return "Firefox";
|
|
1366
1380
|
if (e.includes("silk/"))
|
|
1367
1381
|
return "Silk";
|
|
@@ -1382,7 +1396,7 @@ function Ye(n) {
|
|
|
1382
1396
|
}
|
|
1383
1397
|
return "Other";
|
|
1384
1398
|
}
|
|
1385
|
-
function
|
|
1399
|
+
function St(n = g()) {
|
|
1386
1400
|
return /firefox\//i.test(n);
|
|
1387
1401
|
}
|
|
1388
1402
|
function Ne(n = g()) {
|
|
@@ -1404,20 +1418,20 @@ function Ct(n = g()) {
|
|
|
1404
1418
|
function Ot(n = g()) {
|
|
1405
1419
|
return /webos/i.test(n);
|
|
1406
1420
|
}
|
|
1407
|
-
function
|
|
1421
|
+
function pe(n = g()) {
|
|
1408
1422
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1409
1423
|
}
|
|
1410
|
-
function
|
|
1424
|
+
function zn(n = g()) {
|
|
1411
1425
|
var e;
|
|
1412
|
-
return
|
|
1426
|
+
return pe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1413
1427
|
}
|
|
1414
|
-
function
|
|
1428
|
+
function Kn() {
|
|
1415
1429
|
return wn() && document.documentMode === 10;
|
|
1416
1430
|
}
|
|
1417
1431
|
function Nt(n = g()) {
|
|
1418
|
-
return
|
|
1432
|
+
return pe(n) || At(n) || Ot(n) || Ct(n) || /windows phone/i.test(n) || Pt(n);
|
|
1419
1433
|
}
|
|
1420
|
-
function
|
|
1434
|
+
function Jn() {
|
|
1421
1435
|
try {
|
|
1422
1436
|
return !!(window && window !== window.top);
|
|
1423
1437
|
} catch {
|
|
@@ -1453,7 +1467,7 @@ function Lt(n, e = []) {
|
|
|
1453
1467
|
t = n;
|
|
1454
1468
|
}
|
|
1455
1469
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1456
|
-
return `${t}/JsCore/${
|
|
1470
|
+
return `${t}/JsCore/${J}/${i}`;
|
|
1457
1471
|
}
|
|
1458
1472
|
/**
|
|
1459
1473
|
* @license
|
|
@@ -1471,7 +1485,7 @@ function Lt(n, e = []) {
|
|
|
1471
1485
|
* See the License for the specific language governing permissions and
|
|
1472
1486
|
* limitations under the License.
|
|
1473
1487
|
*/
|
|
1474
|
-
class
|
|
1488
|
+
class Yn {
|
|
1475
1489
|
constructor(e) {
|
|
1476
1490
|
this.auth = e, this.queue = [];
|
|
1477
1491
|
}
|
|
@@ -1526,8 +1540,8 @@ class Kn {
|
|
|
1526
1540
|
* See the License for the specific language governing permissions and
|
|
1527
1541
|
* limitations under the License.
|
|
1528
1542
|
*/
|
|
1529
|
-
async function
|
|
1530
|
-
return G(n, "GET", "/v2/passwordPolicy",
|
|
1543
|
+
async function Xn(n, e = {}) {
|
|
1544
|
+
return G(n, "GET", "/v2/passwordPolicy", fe(n, e));
|
|
1531
1545
|
}
|
|
1532
1546
|
/**
|
|
1533
1547
|
* @license
|
|
@@ -1545,12 +1559,12 @@ async function Jn(n, e = {}) {
|
|
|
1545
1559
|
* See the License for the specific language governing permissions and
|
|
1546
1560
|
* limitations under the License.
|
|
1547
1561
|
*/
|
|
1548
|
-
const
|
|
1549
|
-
class
|
|
1562
|
+
const Qn = 6;
|
|
1563
|
+
class Zn {
|
|
1550
1564
|
constructor(e) {
|
|
1551
1565
|
var t, i, r, s;
|
|
1552
1566
|
const o = e.customStrengthOptions;
|
|
1553
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1567
|
+
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
1568
|
}
|
|
1555
1569
|
validatePassword(e) {
|
|
1556
1570
|
var t, i, r, s, o, c;
|
|
@@ -1633,14 +1647,14 @@ class Xn {
|
|
|
1633
1647
|
* See the License for the specific language governing permissions and
|
|
1634
1648
|
* limitations under the License.
|
|
1635
1649
|
*/
|
|
1636
|
-
class
|
|
1650
|
+
class ei {
|
|
1637
1651
|
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
|
|
1652
|
+
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
1653
|
}
|
|
1640
1654
|
_initializeWithPersistence(e, t) {
|
|
1641
1655
|
return t && (this._popupRedirectResolver = k(t)), this._initializationPromise = this.queue(async () => {
|
|
1642
1656
|
var i, r;
|
|
1643
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1657
|
+
if (!this._deleted && (this.persistenceManager = await H.create(this, e), !this._deleted)) {
|
|
1644
1658
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1645
1659
|
try {
|
|
1646
1660
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1721,7 +1735,7 @@ class Qn {
|
|
|
1721
1735
|
}
|
|
1722
1736
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1723
1737
|
try {
|
|
1724
|
-
await
|
|
1738
|
+
await le(e);
|
|
1725
1739
|
} catch (t) {
|
|
1726
1740
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1727
1741
|
return this.directlySetCurrentUser(null);
|
|
@@ -1729,7 +1743,7 @@ class Qn {
|
|
|
1729
1743
|
return this.directlySetCurrentUser(e);
|
|
1730
1744
|
}
|
|
1731
1745
|
useDeviceLanguage() {
|
|
1732
|
-
this.languageCode =
|
|
1746
|
+
this.languageCode = Un();
|
|
1733
1747
|
}
|
|
1734
1748
|
async _delete() {
|
|
1735
1749
|
this._deleted = !0;
|
|
@@ -1780,14 +1794,14 @@ class Qn {
|
|
|
1780
1794
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1781
1795
|
}
|
|
1782
1796
|
async _updatePasswordPolicy() {
|
|
1783
|
-
const e = await
|
|
1797
|
+
const e = await Xn(this), t = new Zn(e);
|
|
1784
1798
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1785
1799
|
}
|
|
1786
1800
|
_getPersistence() {
|
|
1787
1801
|
return this.assertedPersistence.persistence.type;
|
|
1788
1802
|
}
|
|
1789
1803
|
_updateErrorMap(e) {
|
|
1790
|
-
this._errorFactory = new
|
|
1804
|
+
this._errorFactory = new Se("auth", "Firebase", e());
|
|
1791
1805
|
}
|
|
1792
1806
|
onAuthStateChanged(e, t, i) {
|
|
1793
1807
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1820,7 +1834,7 @@ class Qn {
|
|
|
1820
1834
|
token: e,
|
|
1821
1835
|
idToken: t
|
|
1822
1836
|
};
|
|
1823
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1837
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await qn(this, i);
|
|
1824
1838
|
}
|
|
1825
1839
|
}
|
|
1826
1840
|
toJSON() {
|
|
@@ -1844,7 +1858,7 @@ class Qn {
|
|
|
1844
1858
|
this,
|
|
1845
1859
|
"argument-error"
|
|
1846
1860
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
1847
|
-
), this.redirectPersistenceManager = await
|
|
1861
|
+
), this.redirectPersistenceManager = await H.create(
|
|
1848
1862
|
this,
|
|
1849
1863
|
[k(t._redirectPersistence)],
|
|
1850
1864
|
"redirectUser"
|
|
@@ -1963,10 +1977,10 @@ class Qn {
|
|
|
1963
1977
|
async _getAppCheckToken() {
|
|
1964
1978
|
var e;
|
|
1965
1979
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1966
|
-
return t != null && t.error &&
|
|
1980
|
+
return t != null && t.error && Nn(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1967
1981
|
}
|
|
1968
1982
|
}
|
|
1969
|
-
function
|
|
1983
|
+
function me(n) {
|
|
1970
1984
|
return j(n);
|
|
1971
1985
|
}
|
|
1972
1986
|
class Xe {
|
|
@@ -2006,16 +2020,16 @@ let Le = {
|
|
|
2006
2020
|
recaptchaEnterpriseScript: "",
|
|
2007
2021
|
gapiScript: ""
|
|
2008
2022
|
};
|
|
2009
|
-
function
|
|
2023
|
+
function ti(n) {
|
|
2010
2024
|
Le = n;
|
|
2011
2025
|
}
|
|
2012
|
-
function
|
|
2026
|
+
function ni(n) {
|
|
2013
2027
|
return Le.loadJS(n);
|
|
2014
2028
|
}
|
|
2015
|
-
function
|
|
2029
|
+
function ii() {
|
|
2016
2030
|
return Le.gapiScript;
|
|
2017
2031
|
}
|
|
2018
|
-
function
|
|
2032
|
+
function ri(n) {
|
|
2019
2033
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2020
2034
|
}
|
|
2021
2035
|
/**
|
|
@@ -2034,13 +2048,13 @@ function ni(n) {
|
|
|
2034
2048
|
* See the License for the specific language governing permissions and
|
|
2035
2049
|
* limitations under the License.
|
|
2036
2050
|
*/
|
|
2037
|
-
function
|
|
2051
|
+
function si(n, e) {
|
|
2038
2052
|
const t = pt(n, "auth");
|
|
2039
2053
|
if (t.isInitialized()) {
|
|
2040
2054
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2041
2055
|
if (In(s, e ?? {}))
|
|
2042
2056
|
return r;
|
|
2043
|
-
|
|
2057
|
+
b(
|
|
2044
2058
|
r,
|
|
2045
2059
|
"already-initialized"
|
|
2046
2060
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2048,12 +2062,12 @@ function ii(n, e) {
|
|
|
2048
2062
|
}
|
|
2049
2063
|
return t.initialize({ options: e });
|
|
2050
2064
|
}
|
|
2051
|
-
function
|
|
2065
|
+
function oi(n, e) {
|
|
2052
2066
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(k);
|
|
2053
2067
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2054
2068
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const i =
|
|
2069
|
+
function ai(n, e, t) {
|
|
2070
|
+
const i = me(n);
|
|
2057
2071
|
u(
|
|
2058
2072
|
i._canInitEmulator,
|
|
2059
2073
|
i,
|
|
@@ -2065,19 +2079,19 @@ function si(n, e, t) {
|
|
|
2065
2079
|
"invalid-emulator-scheme"
|
|
2066
2080
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2067
2081
|
);
|
|
2068
|
-
const r = !1, s = Mt(e), { host: o, port: c } =
|
|
2082
|
+
const r = !1, s = Mt(e), { host: o, port: c } = ci(e), a = c === null ? "" : `:${c}`;
|
|
2069
2083
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2070
2084
|
host: o,
|
|
2071
2085
|
port: c,
|
|
2072
2086
|
protocol: s.replace(":", ""),
|
|
2073
2087
|
options: Object.freeze({ disableWarnings: r })
|
|
2074
|
-
}),
|
|
2088
|
+
}), li();
|
|
2075
2089
|
}
|
|
2076
2090
|
function Mt(n) {
|
|
2077
2091
|
const e = n.indexOf(":");
|
|
2078
2092
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2079
2093
|
}
|
|
2080
|
-
function
|
|
2094
|
+
function ci(n) {
|
|
2081
2095
|
const e = Mt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2082
2096
|
if (!t)
|
|
2083
2097
|
return { host: "", port: null };
|
|
@@ -2096,7 +2110,7 @@ function Qe(n) {
|
|
|
2096
2110
|
const e = Number(n);
|
|
2097
2111
|
return isNaN(e) ? null : e;
|
|
2098
2112
|
}
|
|
2099
|
-
function
|
|
2113
|
+
function li() {
|
|
2100
2114
|
function n() {
|
|
2101
2115
|
const e = document.createElement("p"), t = e.style;
|
|
2102
2116
|
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 +2176,7 @@ class Ut {
|
|
|
2162
2176
|
* limitations under the License.
|
|
2163
2177
|
*/
|
|
2164
2178
|
async function W(n, e) {
|
|
2165
|
-
return wt(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2179
|
+
return wt(n, "POST", "/v1/accounts:signInWithIdp", fe(n, e));
|
|
2166
2180
|
}
|
|
2167
2181
|
/**
|
|
2168
2182
|
* @license
|
|
@@ -2180,15 +2194,15 @@ async function W(n, e) {
|
|
|
2180
2194
|
* See the License for the specific language governing permissions and
|
|
2181
2195
|
* limitations under the License.
|
|
2182
2196
|
*/
|
|
2183
|
-
const
|
|
2184
|
-
class
|
|
2197
|
+
const ui = "http://localhost";
|
|
2198
|
+
class D extends Ut {
|
|
2185
2199
|
constructor() {
|
|
2186
2200
|
super(...arguments), this.pendingToken = null;
|
|
2187
2201
|
}
|
|
2188
2202
|
/** @internal */
|
|
2189
2203
|
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) :
|
|
2204
|
+
const t = new D(e.providerId, e.signInMethod);
|
|
2205
|
+
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
2206
|
"argument-error"
|
|
2193
2207
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2194
2208
|
), t;
|
|
@@ -2218,7 +2232,7 @@ class U extends Ut {
|
|
|
2218
2232
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = Pe(t, ["providerId", "signInMethod"]);
|
|
2219
2233
|
if (!i || !r)
|
|
2220
2234
|
return null;
|
|
2221
|
-
const o = new
|
|
2235
|
+
const o = new D(i, r);
|
|
2222
2236
|
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
2237
|
}
|
|
2224
2238
|
/** @internal */
|
|
@@ -2238,14 +2252,14 @@ class U extends Ut {
|
|
|
2238
2252
|
}
|
|
2239
2253
|
buildRequest() {
|
|
2240
2254
|
const e = {
|
|
2241
|
-
requestUri:
|
|
2255
|
+
requestUri: ui,
|
|
2242
2256
|
returnSecureToken: !0
|
|
2243
2257
|
};
|
|
2244
2258
|
if (this.pendingToken)
|
|
2245
2259
|
e.pendingToken = this.pendingToken;
|
|
2246
2260
|
else {
|
|
2247
2261
|
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 =
|
|
2262
|
+
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
2263
|
}
|
|
2250
2264
|
return e;
|
|
2251
2265
|
}
|
|
@@ -2319,7 +2333,7 @@ class Dt {
|
|
|
2319
2333
|
* See the License for the specific language governing permissions and
|
|
2320
2334
|
* limitations under the License.
|
|
2321
2335
|
*/
|
|
2322
|
-
class
|
|
2336
|
+
class Q extends Dt {
|
|
2323
2337
|
constructor() {
|
|
2324
2338
|
super(...arguments), this.scopes = [];
|
|
2325
2339
|
}
|
|
@@ -2354,7 +2368,7 @@ class Y extends Dt {
|
|
|
2354
2368
|
* See the License for the specific language governing permissions and
|
|
2355
2369
|
* limitations under the License.
|
|
2356
2370
|
*/
|
|
2357
|
-
class A extends
|
|
2371
|
+
class A extends Q {
|
|
2358
2372
|
constructor() {
|
|
2359
2373
|
super(
|
|
2360
2374
|
"facebook.com"
|
|
@@ -2374,7 +2388,7 @@ class A extends Y {
|
|
|
2374
2388
|
* @param accessToken - Facebook access token.
|
|
2375
2389
|
*/
|
|
2376
2390
|
static credential(e) {
|
|
2377
|
-
return
|
|
2391
|
+
return D._fromParams({
|
|
2378
2392
|
providerId: A.PROVIDER_ID,
|
|
2379
2393
|
signInMethod: A.FACEBOOK_SIGN_IN_METHOD,
|
|
2380
2394
|
accessToken: e
|
|
@@ -2425,7 +2439,7 @@ A.PROVIDER_ID = "facebook.com";
|
|
|
2425
2439
|
* See the License for the specific language governing permissions and
|
|
2426
2440
|
* limitations under the License.
|
|
2427
2441
|
*/
|
|
2428
|
-
class C extends
|
|
2442
|
+
class C extends Q {
|
|
2429
2443
|
constructor() {
|
|
2430
2444
|
super(
|
|
2431
2445
|
"google.com"
|
|
@@ -2446,7 +2460,7 @@ class C extends Y {
|
|
|
2446
2460
|
* @param accessToken - Google access token.
|
|
2447
2461
|
*/
|
|
2448
2462
|
static credential(e, t) {
|
|
2449
|
-
return
|
|
2463
|
+
return D._fromParams({
|
|
2450
2464
|
providerId: C.PROVIDER_ID,
|
|
2451
2465
|
signInMethod: C.GOOGLE_SIGN_IN_METHOD,
|
|
2452
2466
|
idToken: e,
|
|
@@ -2501,7 +2515,7 @@ C.PROVIDER_ID = "google.com";
|
|
|
2501
2515
|
* See the License for the specific language governing permissions and
|
|
2502
2516
|
* limitations under the License.
|
|
2503
2517
|
*/
|
|
2504
|
-
class O extends
|
|
2518
|
+
class O extends Q {
|
|
2505
2519
|
constructor() {
|
|
2506
2520
|
super(
|
|
2507
2521
|
"github.com"
|
|
@@ -2514,7 +2528,7 @@ class O extends Y {
|
|
|
2514
2528
|
* @param accessToken - Github access token.
|
|
2515
2529
|
*/
|
|
2516
2530
|
static credential(e) {
|
|
2517
|
-
return
|
|
2531
|
+
return D._fromParams({
|
|
2518
2532
|
providerId: O.PROVIDER_ID,
|
|
2519
2533
|
signInMethod: O.GITHUB_SIGN_IN_METHOD,
|
|
2520
2534
|
accessToken: e
|
|
@@ -2565,7 +2579,7 @@ O.PROVIDER_ID = "github.com";
|
|
|
2565
2579
|
* See the License for the specific language governing permissions and
|
|
2566
2580
|
* limitations under the License.
|
|
2567
2581
|
*/
|
|
2568
|
-
class N extends
|
|
2582
|
+
class N extends Q {
|
|
2569
2583
|
constructor() {
|
|
2570
2584
|
super(
|
|
2571
2585
|
"twitter.com"
|
|
@@ -2579,7 +2593,7 @@ class N extends Y {
|
|
|
2579
2593
|
* @param secret - Twitter secret.
|
|
2580
2594
|
*/
|
|
2581
2595
|
static credential(e, t) {
|
|
2582
|
-
return
|
|
2596
|
+
return D._fromParams({
|
|
2583
2597
|
providerId: N.PROVIDER_ID,
|
|
2584
2598
|
signInMethod: N.TWITTER_SIGN_IN_METHOD,
|
|
2585
2599
|
oauthToken: e,
|
|
@@ -2634,13 +2648,13 @@ N.PROVIDER_ID = "twitter.com";
|
|
|
2634
2648
|
* See the License for the specific language governing permissions and
|
|
2635
2649
|
* limitations under the License.
|
|
2636
2650
|
*/
|
|
2637
|
-
class
|
|
2651
|
+
class F {
|
|
2638
2652
|
constructor(e) {
|
|
2639
2653
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2640
2654
|
}
|
|
2641
2655
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2642
2656
|
const s = await E._fromIdTokenResponse(e, i, r), o = Ze(i);
|
|
2643
|
-
return new
|
|
2657
|
+
return new F({
|
|
2644
2658
|
user: s,
|
|
2645
2659
|
providerId: o,
|
|
2646
2660
|
_tokenResponse: i,
|
|
@@ -2654,7 +2668,7 @@ class D {
|
|
|
2654
2668
|
!0
|
|
2655
2669
|
);
|
|
2656
2670
|
const r = Ze(i);
|
|
2657
|
-
return new
|
|
2671
|
+
return new F({
|
|
2658
2672
|
user: e,
|
|
2659
2673
|
providerId: r,
|
|
2660
2674
|
_tokenResponse: i,
|
|
@@ -2681,10 +2695,10 @@ function Ze(n) {
|
|
|
2681
2695
|
* See the License for the specific language governing permissions and
|
|
2682
2696
|
* limitations under the License.
|
|
2683
2697
|
*/
|
|
2684
|
-
class
|
|
2698
|
+
class ue extends Re {
|
|
2685
2699
|
constructor(e, t, i, r) {
|
|
2686
2700
|
var s;
|
|
2687
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2701
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ue.prototype), this.customData = {
|
|
2688
2702
|
appName: e.name,
|
|
2689
2703
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2690
2704
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2692,17 +2706,17 @@ class le extends Re {
|
|
|
2692
2706
|
};
|
|
2693
2707
|
}
|
|
2694
2708
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2695
|
-
return new
|
|
2709
|
+
return new ue(e, t, i, r);
|
|
2696
2710
|
}
|
|
2697
2711
|
}
|
|
2698
2712
|
function Ft(n, e, t, i) {
|
|
2699
2713
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2700
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2714
|
+
throw s.code === "auth/multi-factor-auth-required" ? ue._fromErrorAndOperation(n, s, e, i) : s;
|
|
2701
2715
|
});
|
|
2702
2716
|
}
|
|
2703
|
-
async function
|
|
2704
|
-
const i = await
|
|
2705
|
-
return
|
|
2717
|
+
async function di(n, e, t = !1) {
|
|
2718
|
+
const i = await K(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2719
|
+
return F._forOperation(n, "link", i);
|
|
2706
2720
|
}
|
|
2707
2721
|
/**
|
|
2708
2722
|
* @license
|
|
@@ -2720,13 +2734,13 @@ async function li(n, e, t = !1) {
|
|
|
2720
2734
|
* See the License for the specific language governing permissions and
|
|
2721
2735
|
* limitations under the License.
|
|
2722
2736
|
*/
|
|
2723
|
-
async function
|
|
2737
|
+
async function hi(n, e, t = !1) {
|
|
2724
2738
|
const { auth: i } = n;
|
|
2725
2739
|
if (w(i.app))
|
|
2726
2740
|
return Promise.reject(L(i));
|
|
2727
2741
|
const r = "reauthenticate";
|
|
2728
2742
|
try {
|
|
2729
|
-
const s = await
|
|
2743
|
+
const s = await K(n, Ft(i, r, e, n), t);
|
|
2730
2744
|
u(
|
|
2731
2745
|
s.idToken,
|
|
2732
2746
|
i,
|
|
@@ -2746,9 +2760,9 @@ async function ui(n, e, t = !1) {
|
|
|
2746
2760
|
i,
|
|
2747
2761
|
"user-mismatch"
|
|
2748
2762
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2749
|
-
),
|
|
2763
|
+
), F._forOperation(n, r, s);
|
|
2750
2764
|
} catch (s) {
|
|
2751
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2765
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && b(
|
|
2752
2766
|
i,
|
|
2753
2767
|
"user-mismatch"
|
|
2754
2768
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2771,10 +2785,10 @@ async function ui(n, e, t = !1) {
|
|
|
2771
2785
|
* See the License for the specific language governing permissions and
|
|
2772
2786
|
* limitations under the License.
|
|
2773
2787
|
*/
|
|
2774
|
-
async function
|
|
2788
|
+
async function fi(n, e, t = !1) {
|
|
2775
2789
|
if (w(n.app))
|
|
2776
2790
|
return Promise.reject(L(n));
|
|
2777
|
-
const i = "signIn", r = await Ft(n, i, e), s = await
|
|
2791
|
+
const i = "signIn", r = await Ft(n, i, e), s = await F._fromIdTokenResponse(n, i, r);
|
|
2778
2792
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2779
2793
|
}
|
|
2780
2794
|
/**
|
|
@@ -2793,8 +2807,8 @@ async function di(n, e, t = !1) {
|
|
|
2793
2807
|
* See the License for the specific language governing permissions and
|
|
2794
2808
|
* limitations under the License.
|
|
2795
2809
|
*/
|
|
2796
|
-
async function
|
|
2797
|
-
return wt(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2810
|
+
async function pi(n, e) {
|
|
2811
|
+
return wt(n, "POST", "/v1/accounts:signInWithCustomToken", fe(n, e));
|
|
2798
2812
|
}
|
|
2799
2813
|
/**
|
|
2800
2814
|
* @license
|
|
@@ -2812,22 +2826,22 @@ async function hi(n, e) {
|
|
|
2812
2826
|
* See the License for the specific language governing permissions and
|
|
2813
2827
|
* limitations under the License.
|
|
2814
2828
|
*/
|
|
2815
|
-
async function
|
|
2829
|
+
async function mi(n, e) {
|
|
2816
2830
|
if (w(n.app))
|
|
2817
2831
|
return Promise.reject(L(n));
|
|
2818
|
-
const t =
|
|
2832
|
+
const t = me(n), i = await pi(t, {
|
|
2819
2833
|
token: e,
|
|
2820
2834
|
returnSecureToken: !0
|
|
2821
|
-
}), r = await
|
|
2835
|
+
}), r = await F._fromIdTokenResponse(t, "signIn", i);
|
|
2822
2836
|
return await t._updateCurrentUser(r.user), r;
|
|
2823
2837
|
}
|
|
2824
|
-
function
|
|
2838
|
+
function gi(n, e, t, i) {
|
|
2825
2839
|
return j(n).onIdTokenChanged(e, t, i);
|
|
2826
2840
|
}
|
|
2827
|
-
function
|
|
2841
|
+
function _i(n, e, t) {
|
|
2828
2842
|
return j(n).beforeAuthStateChanged(e, t);
|
|
2829
2843
|
}
|
|
2830
|
-
const
|
|
2844
|
+
const de = "__sak";
|
|
2831
2845
|
/**
|
|
2832
2846
|
* @license
|
|
2833
2847
|
* Copyright 2019 Google LLC
|
|
@@ -2850,7 +2864,7 @@ class xt {
|
|
|
2850
2864
|
}
|
|
2851
2865
|
_isAvailable() {
|
|
2852
2866
|
try {
|
|
2853
|
-
return this.storage ? (this.storage.setItem(
|
|
2867
|
+
return this.storage ? (this.storage.setItem(de, "1"), this.storage.removeItem(de), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2854
2868
|
} catch {
|
|
2855
2869
|
return Promise.resolve(!1);
|
|
2856
2870
|
}
|
|
@@ -2885,18 +2899,18 @@ class xt {
|
|
|
2885
2899
|
* See the License for the specific language governing permissions and
|
|
2886
2900
|
* limitations under the License.
|
|
2887
2901
|
*/
|
|
2888
|
-
function
|
|
2902
|
+
function vi() {
|
|
2889
2903
|
const n = g();
|
|
2890
|
-
return Ne(n) ||
|
|
2904
|
+
return Ne(n) || pe(n);
|
|
2891
2905
|
}
|
|
2892
|
-
const
|
|
2906
|
+
const Ii = 1e3, Ti = 10;
|
|
2893
2907
|
class Vt extends xt {
|
|
2894
2908
|
constructor() {
|
|
2895
2909
|
super(
|
|
2896
2910
|
() => window.localStorage,
|
|
2897
2911
|
"LOCAL"
|
|
2898
2912
|
/* PersistenceType.LOCAL */
|
|
2899
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
2913
|
+
), 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
2914
|
}
|
|
2901
2915
|
forAllChangedKeys(e) {
|
|
2902
2916
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2923,7 +2937,7 @@ class Vt extends xt {
|
|
|
2923
2937
|
const o = this.storage.getItem(i);
|
|
2924
2938
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2925
2939
|
}, s = this.storage.getItem(i);
|
|
2926
|
-
|
|
2940
|
+
Kn() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ti) : r();
|
|
2927
2941
|
}
|
|
2928
2942
|
notifyListeners(e, t) {
|
|
2929
2943
|
this.localCache[e] = t;
|
|
@@ -2945,7 +2959,7 @@ class Vt extends xt {
|
|
|
2945
2959
|
!0
|
|
2946
2960
|
);
|
|
2947
2961
|
});
|
|
2948
|
-
},
|
|
2962
|
+
}, Ii);
|
|
2949
2963
|
}
|
|
2950
2964
|
stopPolling() {
|
|
2951
2965
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -2975,7 +2989,7 @@ class Vt extends xt {
|
|
|
2975
2989
|
}
|
|
2976
2990
|
}
|
|
2977
2991
|
Vt.type = "LOCAL";
|
|
2978
|
-
const
|
|
2992
|
+
const wi = Vt;
|
|
2979
2993
|
/**
|
|
2980
2994
|
* @license
|
|
2981
2995
|
* Copyright 2020 Google LLC
|
|
@@ -2992,7 +3006,7 @@ const Ii = Vt;
|
|
|
2992
3006
|
* See the License for the specific language governing permissions and
|
|
2993
3007
|
* limitations under the License.
|
|
2994
3008
|
*/
|
|
2995
|
-
class
|
|
3009
|
+
class $t extends xt {
|
|
2996
3010
|
constructor() {
|
|
2997
3011
|
super(
|
|
2998
3012
|
() => window.sessionStorage,
|
|
@@ -3005,8 +3019,8 @@ class Ht extends xt {
|
|
|
3005
3019
|
_removeListener(e, t) {
|
|
3006
3020
|
}
|
|
3007
3021
|
}
|
|
3008
|
-
|
|
3009
|
-
const
|
|
3022
|
+
$t.type = "SESSION";
|
|
3023
|
+
const Ht = $t;
|
|
3010
3024
|
/**
|
|
3011
3025
|
* @license
|
|
3012
3026
|
* Copyright 2019 Google LLC
|
|
@@ -3023,7 +3037,7 @@ const $t = Ht;
|
|
|
3023
3037
|
* See the License for the specific language governing permissions and
|
|
3024
3038
|
* limitations under the License.
|
|
3025
3039
|
*/
|
|
3026
|
-
function
|
|
3040
|
+
function yi(n) {
|
|
3027
3041
|
return Promise.all(n.map(async (e) => {
|
|
3028
3042
|
try {
|
|
3029
3043
|
return {
|
|
@@ -3054,7 +3068,7 @@ function Ti(n) {
|
|
|
3054
3068
|
* See the License for the specific language governing permissions and
|
|
3055
3069
|
* limitations under the License.
|
|
3056
3070
|
*/
|
|
3057
|
-
class
|
|
3071
|
+
class ge {
|
|
3058
3072
|
constructor(e) {
|
|
3059
3073
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3060
3074
|
}
|
|
@@ -3068,7 +3082,7 @@ class me {
|
|
|
3068
3082
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3069
3083
|
if (t)
|
|
3070
3084
|
return t;
|
|
3071
|
-
const i = new
|
|
3085
|
+
const i = new ge(e);
|
|
3072
3086
|
return this.receivers.push(i), i;
|
|
3073
3087
|
}
|
|
3074
3088
|
isListeningto(e) {
|
|
@@ -3093,7 +3107,7 @@ class me {
|
|
|
3093
3107
|
eventId: i,
|
|
3094
3108
|
eventType: r
|
|
3095
3109
|
});
|
|
3096
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3110
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await yi(c);
|
|
3097
3111
|
t.ports[0].postMessage({
|
|
3098
3112
|
status: "done",
|
|
3099
3113
|
eventId: i,
|
|
@@ -3122,7 +3136,7 @@ class me {
|
|
|
3122
3136
|
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
3137
|
}
|
|
3124
3138
|
}
|
|
3125
|
-
|
|
3139
|
+
ge.receivers = [];
|
|
3126
3140
|
/**
|
|
3127
3141
|
* @license
|
|
3128
3142
|
* Copyright 2020 Google LLC
|
|
@@ -3161,7 +3175,7 @@ function Me(n = "", e = 10) {
|
|
|
3161
3175
|
* See the License for the specific language governing permissions and
|
|
3162
3176
|
* limitations under the License.
|
|
3163
3177
|
*/
|
|
3164
|
-
class
|
|
3178
|
+
class Ei {
|
|
3165
3179
|
constructor(e) {
|
|
3166
3180
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3167
3181
|
}
|
|
@@ -3205,8 +3219,8 @@ class wi {
|
|
|
3205
3219
|
}, i);
|
|
3206
3220
|
o = {
|
|
3207
3221
|
messageChannel: r,
|
|
3208
|
-
onMessage(
|
|
3209
|
-
const _ =
|
|
3222
|
+
onMessage(f) {
|
|
3223
|
+
const _ = f;
|
|
3210
3224
|
if (_.data.eventId === l)
|
|
3211
3225
|
switch (_.data.status) {
|
|
3212
3226
|
case "ack":
|
|
@@ -3261,7 +3275,7 @@ class wi {
|
|
|
3261
3275
|
function T() {
|
|
3262
3276
|
return window;
|
|
3263
3277
|
}
|
|
3264
|
-
function
|
|
3278
|
+
function ki(n) {
|
|
3265
3279
|
T().location.href = n;
|
|
3266
3280
|
}
|
|
3267
3281
|
/**
|
|
@@ -3283,7 +3297,7 @@ function yi(n) {
|
|
|
3283
3297
|
function Wt() {
|
|
3284
3298
|
return typeof T().WorkerGlobalScope < "u" && typeof T().importScripts == "function";
|
|
3285
3299
|
}
|
|
3286
|
-
async function
|
|
3300
|
+
async function bi() {
|
|
3287
3301
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3288
3302
|
return null;
|
|
3289
3303
|
try {
|
|
@@ -3292,11 +3306,11 @@ async function Ei() {
|
|
|
3292
3306
|
return null;
|
|
3293
3307
|
}
|
|
3294
3308
|
}
|
|
3295
|
-
function
|
|
3309
|
+
function Si() {
|
|
3296
3310
|
var n;
|
|
3297
3311
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3298
3312
|
}
|
|
3299
|
-
function
|
|
3313
|
+
function Ri() {
|
|
3300
3314
|
return Wt() ? self : null;
|
|
3301
3315
|
}
|
|
3302
3316
|
/**
|
|
@@ -3315,8 +3329,8 @@ function Si() {
|
|
|
3315
3329
|
* See the License for the specific language governing permissions and
|
|
3316
3330
|
* limitations under the License.
|
|
3317
3331
|
*/
|
|
3318
|
-
const jt = "firebaseLocalStorageDb",
|
|
3319
|
-
class
|
|
3332
|
+
const jt = "firebaseLocalStorageDb", Pi = 1, he = "firebaseLocalStorage", Gt = "fbase_key";
|
|
3333
|
+
class Z {
|
|
3320
3334
|
constructor(e) {
|
|
3321
3335
|
this.request = e;
|
|
3322
3336
|
}
|
|
@@ -3330,47 +3344,47 @@ class X {
|
|
|
3330
3344
|
});
|
|
3331
3345
|
}
|
|
3332
3346
|
}
|
|
3333
|
-
function
|
|
3334
|
-
return n.transaction([
|
|
3347
|
+
function _e(n, e) {
|
|
3348
|
+
return n.transaction([he], e ? "readwrite" : "readonly").objectStore(he);
|
|
3335
3349
|
}
|
|
3336
|
-
function
|
|
3350
|
+
function Ai() {
|
|
3337
3351
|
const n = indexedDB.deleteDatabase(jt);
|
|
3338
|
-
return new
|
|
3352
|
+
return new Z(n).toPromise();
|
|
3339
3353
|
}
|
|
3340
|
-
function
|
|
3341
|
-
const n = indexedDB.open(jt,
|
|
3354
|
+
function be() {
|
|
3355
|
+
const n = indexedDB.open(jt, Pi);
|
|
3342
3356
|
return new Promise((e, t) => {
|
|
3343
3357
|
n.addEventListener("error", () => {
|
|
3344
3358
|
t(n.error);
|
|
3345
3359
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3346
3360
|
const i = n.result;
|
|
3347
3361
|
try {
|
|
3348
|
-
i.createObjectStore(
|
|
3362
|
+
i.createObjectStore(he, { keyPath: Gt });
|
|
3349
3363
|
} catch (r) {
|
|
3350
3364
|
t(r);
|
|
3351
3365
|
}
|
|
3352
3366
|
}), n.addEventListener("success", async () => {
|
|
3353
3367
|
const i = n.result;
|
|
3354
|
-
i.objectStoreNames.contains(
|
|
3368
|
+
i.objectStoreNames.contains(he) ? e(i) : (i.close(), await Ai(), e(await be()));
|
|
3355
3369
|
});
|
|
3356
3370
|
});
|
|
3357
3371
|
}
|
|
3358
3372
|
async function et(n, e, t) {
|
|
3359
|
-
const i =
|
|
3373
|
+
const i = _e(n, !0).put({
|
|
3360
3374
|
[Gt]: e,
|
|
3361
3375
|
value: t
|
|
3362
3376
|
});
|
|
3363
|
-
return new
|
|
3377
|
+
return new Z(i).toPromise();
|
|
3364
3378
|
}
|
|
3365
|
-
async function
|
|
3366
|
-
const t =
|
|
3379
|
+
async function Ci(n, e) {
|
|
3380
|
+
const t = _e(n, !1).get(e), i = await new Z(t).toPromise();
|
|
3367
3381
|
return i === void 0 ? null : i.value;
|
|
3368
3382
|
}
|
|
3369
3383
|
function tt(n, e) {
|
|
3370
|
-
const t =
|
|
3371
|
-
return new
|
|
3384
|
+
const t = _e(n, !0).delete(e);
|
|
3385
|
+
return new Z(t).toPromise();
|
|
3372
3386
|
}
|
|
3373
|
-
const
|
|
3387
|
+
const Oi = 800, Ni = 3;
|
|
3374
3388
|
class Bt {
|
|
3375
3389
|
constructor() {
|
|
3376
3390
|
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 +3392,7 @@ class Bt {
|
|
|
3378
3392
|
});
|
|
3379
3393
|
}
|
|
3380
3394
|
async _openDb() {
|
|
3381
|
-
return this.db ? this.db : (this.db = await
|
|
3395
|
+
return this.db ? this.db : (this.db = await be(), this.db);
|
|
3382
3396
|
}
|
|
3383
3397
|
async _withRetries(e) {
|
|
3384
3398
|
let t = 0;
|
|
@@ -3387,7 +3401,7 @@ class Bt {
|
|
|
3387
3401
|
const i = await this._openDb();
|
|
3388
3402
|
return await e(i);
|
|
3389
3403
|
} catch (i) {
|
|
3390
|
-
if (t++ >
|
|
3404
|
+
if (t++ > Ni)
|
|
3391
3405
|
throw i;
|
|
3392
3406
|
this.db && (this.db.close(), this.db = void 0);
|
|
3393
3407
|
}
|
|
@@ -3403,7 +3417,7 @@ class Bt {
|
|
|
3403
3417
|
* As the worker we should listen to events from the main window.
|
|
3404
3418
|
*/
|
|
3405
3419
|
async initializeReceiver() {
|
|
3406
|
-
this.receiver =
|
|
3420
|
+
this.receiver = ge._getInstance(Ri()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3407
3421
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3408
3422
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3409
3423
|
"keyChanged"
|
|
@@ -3419,9 +3433,9 @@ class Bt {
|
|
|
3419
3433
|
*/
|
|
3420
3434
|
async initializeSender() {
|
|
3421
3435
|
var e, t;
|
|
3422
|
-
if (this.activeServiceWorker = await
|
|
3436
|
+
if (this.activeServiceWorker = await bi(), !this.activeServiceWorker)
|
|
3423
3437
|
return;
|
|
3424
|
-
this.sender = new
|
|
3438
|
+
this.sender = new Ei(this.activeServiceWorker);
|
|
3425
3439
|
const i = await this.sender._send(
|
|
3426
3440
|
"ping",
|
|
3427
3441
|
{},
|
|
@@ -3443,7 +3457,7 @@ class Bt {
|
|
|
3443
3457
|
* @param key - Storage key which changed.
|
|
3444
3458
|
*/
|
|
3445
3459
|
async notifyServiceWorker(e) {
|
|
3446
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3460
|
+
if (!(!this.sender || !this.activeServiceWorker || Si() !== this.activeServiceWorker))
|
|
3447
3461
|
try {
|
|
3448
3462
|
await this.sender._send(
|
|
3449
3463
|
"keyChanged",
|
|
@@ -3459,8 +3473,8 @@ class Bt {
|
|
|
3459
3473
|
try {
|
|
3460
3474
|
if (!indexedDB)
|
|
3461
3475
|
return !1;
|
|
3462
|
-
const e = await
|
|
3463
|
-
return await et(e,
|
|
3476
|
+
const e = await be();
|
|
3477
|
+
return await et(e, de, "1"), await tt(e, de), !0;
|
|
3464
3478
|
} catch {
|
|
3465
3479
|
}
|
|
3466
3480
|
return !1;
|
|
@@ -3477,7 +3491,7 @@ class Bt {
|
|
|
3477
3491
|
return this._withPendingWrite(async () => (await this._withRetries((i) => et(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3478
3492
|
}
|
|
3479
3493
|
async _get(e) {
|
|
3480
|
-
const t = await this._withRetries((i) =>
|
|
3494
|
+
const t = await this._withRetries((i) => Ci(i, e));
|
|
3481
3495
|
return this.localCache[e] = t, t;
|
|
3482
3496
|
}
|
|
3483
3497
|
async _remove(e) {
|
|
@@ -3485,8 +3499,8 @@ class Bt {
|
|
|
3485
3499
|
}
|
|
3486
3500
|
async _poll() {
|
|
3487
3501
|
const e = await this._withRetries((r) => {
|
|
3488
|
-
const s =
|
|
3489
|
-
return new
|
|
3502
|
+
const s = _e(r, !1).getAll();
|
|
3503
|
+
return new Z(s).toPromise();
|
|
3490
3504
|
});
|
|
3491
3505
|
if (!e)
|
|
3492
3506
|
return [];
|
|
@@ -3508,7 +3522,7 @@ class Bt {
|
|
|
3508
3522
|
r(t);
|
|
3509
3523
|
}
|
|
3510
3524
|
startPolling() {
|
|
3511
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3525
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Oi);
|
|
3512
3526
|
}
|
|
3513
3527
|
stopPolling() {
|
|
3514
3528
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3521,8 +3535,8 @@ class Bt {
|
|
|
3521
3535
|
}
|
|
3522
3536
|
}
|
|
3523
3537
|
Bt.type = "LOCAL";
|
|
3524
|
-
const
|
|
3525
|
-
new
|
|
3538
|
+
const Li = Bt;
|
|
3539
|
+
new X(3e4, 6e4);
|
|
3526
3540
|
/**
|
|
3527
3541
|
* @license
|
|
3528
3542
|
* Copyright 2021 Google LLC
|
|
@@ -3539,7 +3553,7 @@ new J(3e4, 6e4);
|
|
|
3539
3553
|
* See the License for the specific language governing permissions and
|
|
3540
3554
|
* limitations under the License.
|
|
3541
3555
|
*/
|
|
3542
|
-
function
|
|
3556
|
+
function Mi(n, e) {
|
|
3543
3557
|
return e ? k(e) : (u(
|
|
3544
3558
|
n._popupRedirectResolver,
|
|
3545
3559
|
n,
|
|
@@ -3593,26 +3607,26 @@ class Ue extends Ut {
|
|
|
3593
3607
|
return e && (t.idToken = e), t;
|
|
3594
3608
|
}
|
|
3595
3609
|
}
|
|
3596
|
-
function
|
|
3597
|
-
return
|
|
3610
|
+
function Ui(n) {
|
|
3611
|
+
return fi(n.auth, new Ue(n), n.bypassAuthState);
|
|
3598
3612
|
}
|
|
3599
|
-
function
|
|
3613
|
+
function Di(n) {
|
|
3600
3614
|
const { auth: e, user: t } = n;
|
|
3601
3615
|
return u(
|
|
3602
3616
|
t,
|
|
3603
3617
|
e,
|
|
3604
3618
|
"internal-error"
|
|
3605
3619
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3606
|
-
),
|
|
3620
|
+
), hi(t, new Ue(n), n.bypassAuthState);
|
|
3607
3621
|
}
|
|
3608
|
-
async function
|
|
3622
|
+
async function Fi(n) {
|
|
3609
3623
|
const { auth: e, user: t } = n;
|
|
3610
3624
|
return u(
|
|
3611
3625
|
t,
|
|
3612
3626
|
e,
|
|
3613
3627
|
"internal-error"
|
|
3614
3628
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3615
|
-
),
|
|
3629
|
+
), di(t, new Ue(n), n.bypassAuthState);
|
|
3616
3630
|
}
|
|
3617
3631
|
/**
|
|
3618
3632
|
* @license
|
|
@@ -3672,15 +3686,15 @@ class qt {
|
|
|
3672
3686
|
switch (e) {
|
|
3673
3687
|
case "signInViaPopup":
|
|
3674
3688
|
case "signInViaRedirect":
|
|
3675
|
-
return
|
|
3689
|
+
return Ui;
|
|
3676
3690
|
case "linkViaPopup":
|
|
3677
3691
|
case "linkViaRedirect":
|
|
3678
|
-
return
|
|
3692
|
+
return Fi;
|
|
3679
3693
|
case "reauthViaPopup":
|
|
3680
3694
|
case "reauthViaRedirect":
|
|
3681
|
-
return
|
|
3695
|
+
return Di;
|
|
3682
3696
|
default:
|
|
3683
|
-
|
|
3697
|
+
b(
|
|
3684
3698
|
this.auth,
|
|
3685
3699
|
"internal-error"
|
|
3686
3700
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3688,10 +3702,10 @@ class qt {
|
|
|
3688
3702
|
}
|
|
3689
3703
|
}
|
|
3690
3704
|
resolve(e) {
|
|
3691
|
-
|
|
3705
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3692
3706
|
}
|
|
3693
3707
|
reject(e) {
|
|
3694
|
-
|
|
3708
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3695
3709
|
}
|
|
3696
3710
|
unregisterAndCleanUp() {
|
|
3697
3711
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3713,7 +3727,7 @@ class qt {
|
|
|
3713
3727
|
* See the License for the specific language governing permissions and
|
|
3714
3728
|
* limitations under the License.
|
|
3715
3729
|
*/
|
|
3716
|
-
const
|
|
3730
|
+
const xi = new X(2e3, 1e4);
|
|
3717
3731
|
class V extends qt {
|
|
3718
3732
|
constructor(e, t, i, r, s) {
|
|
3719
3733
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, V.currentPopupAction && V.currentPopupAction.cancel(), V.currentPopupAction = this;
|
|
@@ -3728,7 +3742,7 @@ class V extends qt {
|
|
|
3728
3742
|
), e;
|
|
3729
3743
|
}
|
|
3730
3744
|
async onExecution() {
|
|
3731
|
-
|
|
3745
|
+
S(this.filter.length === 1, "Popup operations only handle one event");
|
|
3732
3746
|
const e = Me();
|
|
3733
3747
|
this.authWindow = await this.resolver._openPopup(
|
|
3734
3748
|
this.auth,
|
|
@@ -3777,7 +3791,7 @@ class V extends qt {
|
|
|
3777
3791
|
);
|
|
3778
3792
|
return;
|
|
3779
3793
|
}
|
|
3780
|
-
this.pollId = window.setTimeout(e,
|
|
3794
|
+
this.pollId = window.setTimeout(e, xi.get());
|
|
3781
3795
|
};
|
|
3782
3796
|
e();
|
|
3783
3797
|
}
|
|
@@ -3799,8 +3813,8 @@ V.currentPopupAction = null;
|
|
|
3799
3813
|
* See the License for the specific language governing permissions and
|
|
3800
3814
|
* limitations under the License.
|
|
3801
3815
|
*/
|
|
3802
|
-
const
|
|
3803
|
-
class
|
|
3816
|
+
const Vi = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
3817
|
+
class $i extends qt {
|
|
3804
3818
|
constructor(e, t, i = !1) {
|
|
3805
3819
|
super(e, [
|
|
3806
3820
|
"signInViaRedirect",
|
|
@@ -3815,17 +3829,17 @@ class xi extends qt {
|
|
|
3815
3829
|
* just return it.
|
|
3816
3830
|
*/
|
|
3817
3831
|
async execute() {
|
|
3818
|
-
let e =
|
|
3832
|
+
let e = oe.get(this.auth._key());
|
|
3819
3833
|
if (!e) {
|
|
3820
3834
|
try {
|
|
3821
|
-
const i = await
|
|
3835
|
+
const i = await Hi(this.resolver, this.auth) ? await super.execute() : null;
|
|
3822
3836
|
e = () => Promise.resolve(i);
|
|
3823
3837
|
} catch (t) {
|
|
3824
3838
|
e = () => Promise.reject(t);
|
|
3825
3839
|
}
|
|
3826
|
-
|
|
3840
|
+
oe.set(this.auth._key(), e);
|
|
3827
3841
|
}
|
|
3828
|
-
return this.bypassAuthState ||
|
|
3842
|
+
return this.bypassAuthState || oe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3829
3843
|
}
|
|
3830
3844
|
async onAuthEvent(e) {
|
|
3831
3845
|
if (e.type === "signInViaRedirect")
|
|
@@ -3846,26 +3860,26 @@ class xi extends qt {
|
|
|
3846
3860
|
cleanUp() {
|
|
3847
3861
|
}
|
|
3848
3862
|
}
|
|
3849
|
-
async function
|
|
3850
|
-
const t =
|
|
3863
|
+
async function Hi(n, e) {
|
|
3864
|
+
const t = Gi(e), i = ji(n);
|
|
3851
3865
|
if (!await i._isAvailable())
|
|
3852
3866
|
return !1;
|
|
3853
3867
|
const r = await i._get(t) === "true";
|
|
3854
3868
|
return await i._remove(t), r;
|
|
3855
3869
|
}
|
|
3856
|
-
function
|
|
3857
|
-
|
|
3870
|
+
function Wi(n, e) {
|
|
3871
|
+
oe.set(n._key(), e);
|
|
3858
3872
|
}
|
|
3859
|
-
function
|
|
3873
|
+
function ji(n) {
|
|
3860
3874
|
return k(n._redirectPersistence);
|
|
3861
3875
|
}
|
|
3862
|
-
function
|
|
3863
|
-
return
|
|
3876
|
+
function Gi(n) {
|
|
3877
|
+
return se(Vi, n.config.apiKey, n.name);
|
|
3864
3878
|
}
|
|
3865
|
-
async function
|
|
3879
|
+
async function Bi(n, e, t = !1) {
|
|
3866
3880
|
if (w(n.app))
|
|
3867
3881
|
return Promise.reject(L(n));
|
|
3868
|
-
const i =
|
|
3882
|
+
const i = me(n), r = Mi(i, e), o = await new $i(i, r, t).execute();
|
|
3869
3883
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3870
3884
|
}
|
|
3871
3885
|
/**
|
|
@@ -3884,8 +3898,8 @@ async function ji(n, e, t = !1) {
|
|
|
3884
3898
|
* See the License for the specific language governing permissions and
|
|
3885
3899
|
* limitations under the License.
|
|
3886
3900
|
*/
|
|
3887
|
-
const
|
|
3888
|
-
class
|
|
3901
|
+
const qi = 10 * 60 * 1e3;
|
|
3902
|
+
class zi {
|
|
3889
3903
|
constructor(e) {
|
|
3890
3904
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3891
3905
|
}
|
|
@@ -3901,7 +3915,7 @@ class Bi {
|
|
|
3901
3915
|
let t = !1;
|
|
3902
3916
|
return this.consumers.forEach((i) => {
|
|
3903
3917
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3904
|
-
}), this.hasHandledPotentialRedirect || !
|
|
3918
|
+
}), this.hasHandledPotentialRedirect || !Ki(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3905
3919
|
}
|
|
3906
3920
|
sendToConsumer(e, t) {
|
|
3907
3921
|
var i;
|
|
@@ -3916,7 +3930,7 @@ class Bi {
|
|
|
3916
3930
|
return t.filter.includes(e.type) && i;
|
|
3917
3931
|
}
|
|
3918
3932
|
hasEventBeenHandled(e) {
|
|
3919
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
3933
|
+
return Date.now() - this.lastProcessedEventTime >= qi && this.cachedEventUids.clear(), this.cachedEventUids.has(nt(e));
|
|
3920
3934
|
}
|
|
3921
3935
|
saveEventToCache(e) {
|
|
3922
3936
|
this.cachedEventUids.add(nt(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -3928,7 +3942,7 @@ function nt(n) {
|
|
|
3928
3942
|
function zt({ type: n, error: e }) {
|
|
3929
3943
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3930
3944
|
}
|
|
3931
|
-
function
|
|
3945
|
+
function Ki(n) {
|
|
3932
3946
|
switch (n.type) {
|
|
3933
3947
|
case "signInViaRedirect":
|
|
3934
3948
|
case "linkViaRedirect":
|
|
@@ -3956,7 +3970,7 @@ function qi(n) {
|
|
|
3956
3970
|
* See the License for the specific language governing permissions and
|
|
3957
3971
|
* limitations under the License.
|
|
3958
3972
|
*/
|
|
3959
|
-
async function
|
|
3973
|
+
async function Ji(n, e = {}) {
|
|
3960
3974
|
return G(n, "GET", "/v1/projects", e);
|
|
3961
3975
|
}
|
|
3962
3976
|
/**
|
|
@@ -3975,32 +3989,32 @@ async function zi(n, e = {}) {
|
|
|
3975
3989
|
* See the License for the specific language governing permissions and
|
|
3976
3990
|
* limitations under the License.
|
|
3977
3991
|
*/
|
|
3978
|
-
const
|
|
3979
|
-
async function
|
|
3992
|
+
const Yi = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Xi = /^https?/;
|
|
3993
|
+
async function Qi(n) {
|
|
3980
3994
|
if (n.config.emulator)
|
|
3981
3995
|
return;
|
|
3982
|
-
const { authorizedDomains: e } = await
|
|
3996
|
+
const { authorizedDomains: e } = await Ji(n);
|
|
3983
3997
|
for (const t of e)
|
|
3984
3998
|
try {
|
|
3985
|
-
if (
|
|
3999
|
+
if (Zi(t))
|
|
3986
4000
|
return;
|
|
3987
4001
|
} catch {
|
|
3988
4002
|
}
|
|
3989
|
-
|
|
4003
|
+
b(
|
|
3990
4004
|
n,
|
|
3991
4005
|
"unauthorized-domain"
|
|
3992
4006
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
3993
4007
|
);
|
|
3994
4008
|
}
|
|
3995
|
-
function
|
|
4009
|
+
function Zi(n) {
|
|
3996
4010
|
const e = Ee(), { protocol: t, hostname: i } = new URL(e);
|
|
3997
4011
|
if (n.startsWith("chrome-extension://")) {
|
|
3998
4012
|
const o = new URL(n);
|
|
3999
4013
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4000
4014
|
}
|
|
4001
|
-
if (!
|
|
4015
|
+
if (!Xi.test(t))
|
|
4002
4016
|
return !1;
|
|
4003
|
-
if (
|
|
4017
|
+
if (Yi.test(n))
|
|
4004
4018
|
return i === n;
|
|
4005
4019
|
const r = n.replace(/\./g, "\\.");
|
|
4006
4020
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4021,7 +4035,7 @@ function Xi(n) {
|
|
|
4021
4035
|
* See the License for the specific language governing permissions and
|
|
4022
4036
|
* limitations under the License.
|
|
4023
4037
|
*/
|
|
4024
|
-
const
|
|
4038
|
+
const er = new X(3e4, 6e4);
|
|
4025
4039
|
function it() {
|
|
4026
4040
|
const n = T().___jsl;
|
|
4027
4041
|
if (n != null && n.H) {
|
|
@@ -4031,7 +4045,7 @@ function it() {
|
|
|
4031
4045
|
n.CP[t] = null;
|
|
4032
4046
|
}
|
|
4033
4047
|
}
|
|
4034
|
-
function
|
|
4048
|
+
function tr(n) {
|
|
4035
4049
|
return new Promise((e, t) => {
|
|
4036
4050
|
var i, r, s;
|
|
4037
4051
|
function o() {
|
|
@@ -4046,7 +4060,7 @@ function Zi(n) {
|
|
|
4046
4060
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4047
4061
|
));
|
|
4048
4062
|
},
|
|
4049
|
-
timeout:
|
|
4063
|
+
timeout: er.get()
|
|
4050
4064
|
});
|
|
4051
4065
|
}
|
|
4052
4066
|
if (!((r = (i = T().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
@@ -4054,22 +4068,22 @@ function Zi(n) {
|
|
|
4054
4068
|
else if (!((s = T().gapi) === null || s === void 0) && s.load)
|
|
4055
4069
|
o();
|
|
4056
4070
|
else {
|
|
4057
|
-
const c =
|
|
4071
|
+
const c = ri("iframefcb");
|
|
4058
4072
|
return T()[c] = () => {
|
|
4059
4073
|
gapi.load ? o() : t(I(
|
|
4060
4074
|
n,
|
|
4061
4075
|
"network-request-failed"
|
|
4062
4076
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4063
4077
|
));
|
|
4064
|
-
},
|
|
4078
|
+
}, ni(`${ii()}?onload=${c}`).catch((a) => t(a));
|
|
4065
4079
|
}
|
|
4066
4080
|
}).catch((e) => {
|
|
4067
|
-
throw
|
|
4081
|
+
throw ae = null, e;
|
|
4068
4082
|
});
|
|
4069
4083
|
}
|
|
4070
|
-
let
|
|
4071
|
-
function
|
|
4072
|
-
return
|
|
4084
|
+
let ae = null;
|
|
4085
|
+
function nr(n) {
|
|
4086
|
+
return ae = ae || tr(n), ae;
|
|
4073
4087
|
}
|
|
4074
4088
|
/**
|
|
4075
4089
|
* @license
|
|
@@ -4087,7 +4101,7 @@ function er(n) {
|
|
|
4087
4101
|
* See the License for the specific language governing permissions and
|
|
4088
4102
|
* limitations under the License.
|
|
4089
4103
|
*/
|
|
4090
|
-
const
|
|
4104
|
+
const ir = new X(5e3, 15e3), rr = "__/auth/iframe", sr = "emulator/auth/iframe", or = {
|
|
4091
4105
|
style: {
|
|
4092
4106
|
position: "absolute",
|
|
4093
4107
|
top: "-100px",
|
|
@@ -4096,13 +4110,13 @@ const tr = new J(5e3, 15e3), nr = "__/auth/iframe", ir = "emulator/auth/iframe",
|
|
|
4096
4110
|
},
|
|
4097
4111
|
"aria-hidden": "true",
|
|
4098
4112
|
tabindex: "-1"
|
|
4099
|
-
},
|
|
4113
|
+
}, ar = /* @__PURE__ */ new Map([
|
|
4100
4114
|
["identitytoolkit.googleapis.com", "p"],
|
|
4101
4115
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4102
4116
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4103
4117
|
// test
|
|
4104
4118
|
]);
|
|
4105
|
-
function
|
|
4119
|
+
function cr(n) {
|
|
4106
4120
|
const e = n.config;
|
|
4107
4121
|
u(
|
|
4108
4122
|
e.authDomain,
|
|
@@ -4110,17 +4124,17 @@ function or(n) {
|
|
|
4110
4124
|
"auth-domain-config-required"
|
|
4111
4125
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4112
4126
|
);
|
|
4113
|
-
const t = e.emulator ? Ce(e,
|
|
4127
|
+
const t = e.emulator ? Ce(e, sr) : `https://${n.config.authDomain}/${rr}`, i = {
|
|
4114
4128
|
apiKey: e.apiKey,
|
|
4115
4129
|
appName: n.name,
|
|
4116
|
-
v:
|
|
4117
|
-
}, r =
|
|
4130
|
+
v: J
|
|
4131
|
+
}, r = ar.get(n.config.apiHost);
|
|
4118
4132
|
r && (i.eid = r);
|
|
4119
4133
|
const s = n._getFrameworks();
|
|
4120
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4134
|
+
return s.length && (i.fw = s.join(",")), `${t}?${Y(i).slice(1)}`;
|
|
4121
4135
|
}
|
|
4122
|
-
async function
|
|
4123
|
-
const e = await
|
|
4136
|
+
async function lr(n) {
|
|
4137
|
+
const e = await nr(n), t = T().gapi;
|
|
4124
4138
|
return u(
|
|
4125
4139
|
t,
|
|
4126
4140
|
n,
|
|
@@ -4128,9 +4142,9 @@ async function ar(n) {
|
|
|
4128
4142
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4129
4143
|
), e.open({
|
|
4130
4144
|
where: document.body,
|
|
4131
|
-
url:
|
|
4145
|
+
url: cr(n),
|
|
4132
4146
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4133
|
-
attributes:
|
|
4147
|
+
attributes: or,
|
|
4134
4148
|
dontclear: !0
|
|
4135
4149
|
}, (i) => new Promise(async (r, s) => {
|
|
4136
4150
|
await i.restyle({
|
|
@@ -4143,7 +4157,7 @@ async function ar(n) {
|
|
|
4143
4157
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4144
4158
|
), c = T().setTimeout(() => {
|
|
4145
4159
|
s(o);
|
|
4146
|
-
},
|
|
4160
|
+
}, ir.get());
|
|
4147
4161
|
function a() {
|
|
4148
4162
|
T().clearTimeout(c), r(i);
|
|
4149
4163
|
}
|
|
@@ -4168,12 +4182,12 @@ async function ar(n) {
|
|
|
4168
4182
|
* See the License for the specific language governing permissions and
|
|
4169
4183
|
* limitations under the License.
|
|
4170
4184
|
*/
|
|
4171
|
-
const
|
|
4185
|
+
const ur = {
|
|
4172
4186
|
location: "yes",
|
|
4173
4187
|
resizable: "yes",
|
|
4174
4188
|
statusbar: "yes",
|
|
4175
4189
|
toolbar: "no"
|
|
4176
|
-
},
|
|
4190
|
+
}, dr = 500, hr = 600, fr = "_blank", pr = "http://localhost";
|
|
4177
4191
|
class rt {
|
|
4178
4192
|
constructor(e) {
|
|
4179
4193
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4186,33 +4200,33 @@ class rt {
|
|
|
4186
4200
|
}
|
|
4187
4201
|
}
|
|
4188
4202
|
}
|
|
4189
|
-
function
|
|
4203
|
+
function mr(n, e, t, i = dr, r = hr) {
|
|
4190
4204
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4191
4205
|
let c = "";
|
|
4192
|
-
const a = Object.assign(Object.assign({},
|
|
4206
|
+
const a = Object.assign(Object.assign({}, ur), {
|
|
4193
4207
|
width: i.toString(),
|
|
4194
4208
|
height: r.toString(),
|
|
4195
4209
|
top: s,
|
|
4196
4210
|
left: o
|
|
4197
4211
|
}), l = g().toLowerCase();
|
|
4198
|
-
t && (c = Rt(l) ?
|
|
4199
|
-
const d = Object.entries(a).reduce((_, [
|
|
4200
|
-
if (
|
|
4201
|
-
return
|
|
4202
|
-
const
|
|
4212
|
+
t && (c = Rt(l) ? fr : t), St(l) && (e = e || pr, a.scrollbars = "yes");
|
|
4213
|
+
const d = Object.entries(a).reduce((_, [x, M]) => `${_}${x}=${M},`, "");
|
|
4214
|
+
if (zn(l) && c !== "_self")
|
|
4215
|
+
return gr(e || "", c), new rt(null);
|
|
4216
|
+
const f = window.open(e || "", c, d);
|
|
4203
4217
|
u(
|
|
4204
|
-
|
|
4218
|
+
f,
|
|
4205
4219
|
n,
|
|
4206
4220
|
"popup-blocked"
|
|
4207
4221
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
4208
4222
|
);
|
|
4209
4223
|
try {
|
|
4210
|
-
|
|
4224
|
+
f.focus();
|
|
4211
4225
|
} catch {
|
|
4212
4226
|
}
|
|
4213
|
-
return new rt(
|
|
4227
|
+
return new rt(f);
|
|
4214
4228
|
}
|
|
4215
|
-
function
|
|
4229
|
+
function gr(n, e) {
|
|
4216
4230
|
const t = document.createElement("a");
|
|
4217
4231
|
t.href = n, t.target = e;
|
|
4218
4232
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4234,7 +4248,7 @@ function pr(n, e) {
|
|
|
4234
4248
|
* See the License for the specific language governing permissions and
|
|
4235
4249
|
* limitations under the License.
|
|
4236
4250
|
*/
|
|
4237
|
-
const
|
|
4251
|
+
const _r = "__/auth/handler", vr = "emulator/auth/handler", Ir = encodeURIComponent("fac");
|
|
4238
4252
|
async function st(n, e, t, i, r, s) {
|
|
4239
4253
|
u(
|
|
4240
4254
|
n.config.authDomain,
|
|
@@ -4252,27 +4266,27 @@ async function st(n, e, t, i, r, s) {
|
|
|
4252
4266
|
appName: n.name,
|
|
4253
4267
|
authType: t,
|
|
4254
4268
|
redirectUrl: i,
|
|
4255
|
-
v:
|
|
4269
|
+
v: J,
|
|
4256
4270
|
eventId: r
|
|
4257
4271
|
};
|
|
4258
4272
|
if (e instanceof Dt) {
|
|
4259
4273
|
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", yn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4260
|
-
for (const [d,
|
|
4261
|
-
o[d] =
|
|
4274
|
+
for (const [d, f] of Object.entries({}))
|
|
4275
|
+
o[d] = f;
|
|
4262
4276
|
}
|
|
4263
|
-
if (e instanceof
|
|
4264
|
-
const d = e.getScopes().filter((
|
|
4277
|
+
if (e instanceof Q) {
|
|
4278
|
+
const d = e.getScopes().filter((f) => f !== "");
|
|
4265
4279
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4266
4280
|
}
|
|
4267
4281
|
n.tenantId && (o.tid = n.tenantId);
|
|
4268
4282
|
const c = o;
|
|
4269
4283
|
for (const d of Object.keys(c))
|
|
4270
4284
|
c[d] === void 0 && delete c[d];
|
|
4271
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4272
|
-
return `${
|
|
4285
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Ir}=${encodeURIComponent(a)}` : "";
|
|
4286
|
+
return `${Tr(n)}?${Y(c).slice(1)}${l}`;
|
|
4273
4287
|
}
|
|
4274
|
-
function
|
|
4275
|
-
return n.emulator ? Ce(n,
|
|
4288
|
+
function Tr({ config: n }) {
|
|
4289
|
+
return n.emulator ? Ce(n, vr) : `https://${n.authDomain}/${_r}`;
|
|
4276
4290
|
}
|
|
4277
4291
|
/**
|
|
4278
4292
|
* @license
|
|
@@ -4291,29 +4305,29 @@ function vr({ config: n }) {
|
|
|
4291
4305
|
* limitations under the License.
|
|
4292
4306
|
*/
|
|
4293
4307
|
const we = "webStorageSupport";
|
|
4294
|
-
class
|
|
4308
|
+
class wr {
|
|
4295
4309
|
constructor() {
|
|
4296
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4310
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Ht, this._completeRedirectFn = Bi, this._overrideRedirectResult = Wi;
|
|
4297
4311
|
}
|
|
4298
4312
|
// Wrapping in async even though we don't await anywhere in order
|
|
4299
4313
|
// to make sure errors are raised as promise rejections
|
|
4300
4314
|
async _openPopup(e, t, i, r) {
|
|
4301
4315
|
var s;
|
|
4302
|
-
|
|
4316
|
+
S((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4303
4317
|
const o = await st(e, t, i, Ee(), r);
|
|
4304
|
-
return
|
|
4318
|
+
return mr(e, o, Me());
|
|
4305
4319
|
}
|
|
4306
4320
|
async _openRedirect(e, t, i, r) {
|
|
4307
4321
|
await this._originValidation(e);
|
|
4308
4322
|
const s = await st(e, t, i, Ee(), r);
|
|
4309
|
-
return
|
|
4323
|
+
return ki(s), new Promise(() => {
|
|
4310
4324
|
});
|
|
4311
4325
|
}
|
|
4312
4326
|
_initialize(e) {
|
|
4313
4327
|
const t = e._key();
|
|
4314
4328
|
if (this.eventManagers[t]) {
|
|
4315
4329
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4316
|
-
return r ? Promise.resolve(r) : (
|
|
4330
|
+
return r ? Promise.resolve(r) : (S(s, "If manager is not set, promise should be"), s);
|
|
4317
4331
|
}
|
|
4318
4332
|
const i = this.initAndGetManager(e);
|
|
4319
4333
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4321,7 +4335,7 @@ class Ir {
|
|
|
4321
4335
|
}), i;
|
|
4322
4336
|
}
|
|
4323
4337
|
async initAndGetManager(e) {
|
|
4324
|
-
const t = await
|
|
4338
|
+
const t = await lr(e), i = new zi(e);
|
|
4325
4339
|
return t.register("authEvent", (r) => (u(
|
|
4326
4340
|
r == null ? void 0 : r.authEvent,
|
|
4327
4341
|
e,
|
|
@@ -4336,7 +4350,7 @@ class Ir {
|
|
|
4336
4350
|
this.iframes[e._key()].send(we, { type: we }, (r) => {
|
|
4337
4351
|
var s;
|
|
4338
4352
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[we];
|
|
4339
|
-
o !== void 0 && t(!!o),
|
|
4353
|
+
o !== void 0 && t(!!o), b(
|
|
4340
4354
|
e,
|
|
4341
4355
|
"internal-error"
|
|
4342
4356
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4345,13 +4359,13 @@ class Ir {
|
|
|
4345
4359
|
}
|
|
4346
4360
|
_originValidation(e) {
|
|
4347
4361
|
const t = e._key();
|
|
4348
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4362
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Qi(e)), this.originValidationPromises[t];
|
|
4349
4363
|
}
|
|
4350
4364
|
get _shouldInitProactively() {
|
|
4351
|
-
return Nt() || Ne() ||
|
|
4365
|
+
return Nt() || Ne() || pe();
|
|
4352
4366
|
}
|
|
4353
4367
|
}
|
|
4354
|
-
const
|
|
4368
|
+
const yr = wr;
|
|
4355
4369
|
var ot = "@firebase/auth", at = "1.7.5";
|
|
4356
4370
|
/**
|
|
4357
4371
|
* @license
|
|
@@ -4369,7 +4383,7 @@ var ot = "@firebase/auth", at = "1.7.5";
|
|
|
4369
4383
|
* See the License for the specific language governing permissions and
|
|
4370
4384
|
* limitations under the License.
|
|
4371
4385
|
*/
|
|
4372
|
-
class
|
|
4386
|
+
class Er {
|
|
4373
4387
|
constructor(e) {
|
|
4374
4388
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4375
4389
|
}
|
|
@@ -4420,7 +4434,7 @@ class wr {
|
|
|
4420
4434
|
* See the License for the specific language governing permissions and
|
|
4421
4435
|
* limitations under the License.
|
|
4422
4436
|
*/
|
|
4423
|
-
function
|
|
4437
|
+
function kr(n) {
|
|
4424
4438
|
switch (n) {
|
|
4425
4439
|
case "Node":
|
|
4426
4440
|
return "node";
|
|
@@ -4436,7 +4450,7 @@ function yr(n) {
|
|
|
4436
4450
|
return;
|
|
4437
4451
|
}
|
|
4438
4452
|
}
|
|
4439
|
-
function
|
|
4453
|
+
function br(n) {
|
|
4440
4454
|
je(new Ge(
|
|
4441
4455
|
"auth",
|
|
4442
4456
|
(e, { options: t }) => {
|
|
@@ -4450,8 +4464,8 @@ function Er(n) {
|
|
|
4450
4464
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4451
4465
|
apiScheme: "https",
|
|
4452
4466
|
sdkClientVersion: Lt(n)
|
|
4453
|
-
}, l = new
|
|
4454
|
-
return
|
|
4467
|
+
}, l = new ei(i, r, s, a);
|
|
4468
|
+
return oi(l, t), l;
|
|
4455
4469
|
},
|
|
4456
4470
|
"PUBLIC"
|
|
4457
4471
|
/* ComponentType.PUBLIC */
|
|
@@ -4466,18 +4480,18 @@ function Er(n) {
|
|
|
4466
4480
|
})), je(new Ge(
|
|
4467
4481
|
"auth-internal",
|
|
4468
4482
|
(e) => {
|
|
4469
|
-
const t =
|
|
4483
|
+
const t = me(e.getProvider(
|
|
4470
4484
|
"auth"
|
|
4471
4485
|
/* _ComponentName.AUTH */
|
|
4472
4486
|
).getImmediate());
|
|
4473
|
-
return ((i) => new
|
|
4487
|
+
return ((i) => new Er(i))(t);
|
|
4474
4488
|
},
|
|
4475
4489
|
"PRIVATE"
|
|
4476
4490
|
/* ComponentType.PRIVATE */
|
|
4477
4491
|
).setInstantiationMode(
|
|
4478
4492
|
"EXPLICIT"
|
|
4479
4493
|
/* InstantiationMode.EXPLICIT */
|
|
4480
|
-
)), ye(ot, at,
|
|
4494
|
+
)), ye(ot, at, kr(n)), ye(ot, at, "esm2017");
|
|
4481
4495
|
}
|
|
4482
4496
|
/**
|
|
4483
4497
|
* @license
|
|
@@ -4495,11 +4509,11 @@ function Er(n) {
|
|
|
4495
4509
|
* See the License for the specific language governing permissions and
|
|
4496
4510
|
* limitations under the License.
|
|
4497
4511
|
*/
|
|
4498
|
-
const
|
|
4512
|
+
const Sr = 5 * 60, Rr = ft("authIdTokenMaxAge") || Sr;
|
|
4499
4513
|
let ct = null;
|
|
4500
|
-
const
|
|
4514
|
+
const Pr = (n) => async (e) => {
|
|
4501
4515
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4502
|
-
if (i && i >
|
|
4516
|
+
if (i && i > Rr)
|
|
4503
4517
|
return;
|
|
4504
4518
|
const r = t == null ? void 0 : t.token;
|
|
4505
4519
|
ct !== r && (ct = r, await fetch(n, {
|
|
@@ -4509,33 +4523,33 @@ const br = (n) => async (e) => {
|
|
|
4509
4523
|
} : {}
|
|
4510
4524
|
}));
|
|
4511
4525
|
};
|
|
4512
|
-
function
|
|
4526
|
+
function Ar(n = vn()) {
|
|
4513
4527
|
const e = pt(n, "auth");
|
|
4514
4528
|
if (e.isInitialized())
|
|
4515
4529
|
return e.getImmediate();
|
|
4516
|
-
const t =
|
|
4517
|
-
popupRedirectResolver:
|
|
4530
|
+
const t = si(n, {
|
|
4531
|
+
popupRedirectResolver: yr,
|
|
4518
4532
|
persistence: [
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4533
|
+
Li,
|
|
4534
|
+
wi,
|
|
4535
|
+
Ht
|
|
4522
4536
|
]
|
|
4523
4537
|
}), i = ft("authTokenSyncURL");
|
|
4524
4538
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4525
4539
|
const s = new URL(i, location.origin);
|
|
4526
4540
|
if (location.origin === s.origin) {
|
|
4527
|
-
const o =
|
|
4528
|
-
|
|
4541
|
+
const o = Pr(s.toString());
|
|
4542
|
+
_i(t, o, () => o(t.currentUser)), gi(t, (c) => o(c));
|
|
4529
4543
|
}
|
|
4530
4544
|
}
|
|
4531
4545
|
const r = _n("auth");
|
|
4532
|
-
return r &&
|
|
4546
|
+
return r && ai(t, `http://${r}`), t;
|
|
4533
4547
|
}
|
|
4534
|
-
function
|
|
4548
|
+
function Cr() {
|
|
4535
4549
|
var n, e;
|
|
4536
4550
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4537
4551
|
}
|
|
4538
|
-
|
|
4552
|
+
ti({
|
|
4539
4553
|
loadJS(n) {
|
|
4540
4554
|
return new Promise((e, t) => {
|
|
4541
4555
|
const i = document.createElement("script");
|
|
@@ -4545,53 +4559,60 @@ Zn({
|
|
|
4545
4559
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4546
4560
|
);
|
|
4547
4561
|
s.customData = r, t(s);
|
|
4548
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4562
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", Cr().appendChild(i);
|
|
4549
4563
|
});
|
|
4550
4564
|
},
|
|
4551
4565
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4552
4566
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4553
4567
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4554
4568
|
});
|
|
4555
|
-
|
|
4569
|
+
br(
|
|
4556
4570
|
"Browser"
|
|
4557
4571
|
/* ClientPlatform.BROWSER */
|
|
4558
4572
|
);
|
|
4559
|
-
var
|
|
4560
|
-
const
|
|
4573
|
+
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", importFilesBucketUrl: "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", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" }, Lr = { mode: "development", appMode: "mf" };
|
|
4574
|
+
const Mr = {
|
|
4561
4575
|
key: 1,
|
|
4562
4576
|
class: "h-full w-full"
|
|
4563
|
-
},
|
|
4577
|
+
}, Ur = ["src"], Yr = /* @__PURE__ */ lt({
|
|
4564
4578
|
__name: "App",
|
|
4565
4579
|
setup(n) {
|
|
4566
|
-
const e = We(), t = on(), i = an(), r = cn(), s = ln(), o = ht(), c =
|
|
4580
|
+
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), f = Ve(() => i.version), _ = Ve(() => {
|
|
4567
4581
|
const p = e.currentCountry.value || "MY", m = Be.getIdToken(), v = l.value._id;
|
|
4568
|
-
return `${
|
|
4582
|
+
return `${Nr.marketingV1Portal}/b/${v}/marketing/overview?showHeader=false&country=${p}&token=${m}`;
|
|
4569
4583
|
});
|
|
4570
|
-
async function
|
|
4584
|
+
async function x() {
|
|
4571
4585
|
if (En().length) {
|
|
4572
4586
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4573
4587
|
return;
|
|
4574
4588
|
}
|
|
4575
|
-
const p = kn(
|
|
4576
|
-
await
|
|
4589
|
+
const p = kn(Or.firebase), m = await sn.getCustomToken(), v = Ar();
|
|
4590
|
+
await mi(v, m), bn(p), console.log("initFirebase", p);
|
|
4577
4591
|
}
|
|
4578
4592
|
const M = async () => {
|
|
4579
|
-
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value &&
|
|
4593
|
+
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value && f.value === "v2" ? e.registerSidebarComponent(Pn) : e.hideSidebarToggle(!0), await x(), a.value = !0, d.value = !0;
|
|
4580
4594
|
};
|
|
4595
|
+
async function ee() {
|
|
4596
|
+
var p;
|
|
4597
|
+
console.log("initRemyClient.."), await Rn.init({
|
|
4598
|
+
token: ((p = e.sessionUser.value) == null ? void 0 : p.token) || "",
|
|
4599
|
+
dev: Lr.mode === "development"
|
|
4600
|
+
});
|
|
4601
|
+
}
|
|
4581
4602
|
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"),
|
|
4603
|
+
if (Sn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4604
|
+
const p = document.getElementsByClassName("app-header")[0], m = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0], U = document.getElementsByTagName("main")[0];
|
|
4605
|
+
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
4606
|
}
|
|
4586
|
-
l.value != null && (console.log("App mounted, forceRerender"), M());
|
|
4607
|
+
l.value != null && (console.log("App mounted, forceRerender"), M()), ee();
|
|
4587
4608
|
}), ut(
|
|
4588
4609
|
() => e.currentBusiness.value,
|
|
4589
4610
|
async (p, m) => {
|
|
4590
4611
|
console.log("Current business changed"), p != null && p._id != m._id && (console.log("forceRerender when business changes", p, m), M());
|
|
4591
4612
|
}
|
|
4592
|
-
), (p, m) => (
|
|
4593
|
-
P(d) && P(
|
|
4594
|
-
P(d) && P(
|
|
4613
|
+
), (p, m) => (ie(), $e(Qt, null, [
|
|
4614
|
+
P(d) && P(f) === "v2" ? (ie(), dt(P(rn), { key: 0 })) : He("", !0),
|
|
4615
|
+
P(d) && P(f) !== "v2" ? (ie(), $e("div", Mr, [
|
|
4595
4616
|
Zt(dn, {
|
|
4596
4617
|
json: { url: P(_) }
|
|
4597
4618
|
}, null, 8, ["json"]),
|
|
@@ -4601,11 +4622,11 @@ const Or = {
|
|
|
4601
4622
|
height: "100%",
|
|
4602
4623
|
width: "100%",
|
|
4603
4624
|
src: P(_)
|
|
4604
|
-
}, null, 8,
|
|
4605
|
-
])) :
|
|
4625
|
+
}, null, 8, Ur)
|
|
4626
|
+
])) : He("", !0)
|
|
4606
4627
|
], 64));
|
|
4607
4628
|
}
|
|
4608
4629
|
});
|
|
4609
4630
|
export {
|
|
4610
|
-
|
|
4631
|
+
Yr as default
|
|
4611
4632
|
};
|