@feedmepos/mf-connect 0.1.113-prod → 0.1.114-dev
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/README.md +66 -1
- package/dist/{App-2J4yDonr.js → App-CIWTDYuZ.js} +700 -654
- package/dist/AuditLogs-BluLDXu9.js +2016 -0
- package/dist/{Bin-BU_hVuxJ.js → Bin-jS6pM4L3.js} +8 -8
- package/dist/Broadcast-DBqsSZ0S.js +306 -0
- package/dist/{CampaignAnalytic-DUUmFMvy.js → CampaignAnalytic-DJrjXD4H.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BZirReIy.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CzwigRLi.js} +9 -9
- package/dist/{Card-DS2K_LFv.js → Card-B10nLilL.js} +25 -24
- package/dist/{Collections-BFdRdPHR.js → Collections-BN42A73p.js} +197 -185
- package/dist/{Credit-CODfiox3.js → Credit-0SS26HGE.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B2T5G1hZ.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B3wozBFs.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BRd5RVYe.js +4442 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-KvZebiOu.js → EffectSheet.vue_vue_type_style_index_0_lang-zV9dLCWp.js} +32 -32
- package/dist/{Experience-BGBWc8Ep.js → Experience-D7qPzsrc.js} +32 -31
- package/dist/{FileSaver.min-DJAN3Eu0.js → FileSaver.min-BKWoklMK.js} +1 -1
- package/dist/{Game-6yyn0uAd.js → Game-BoYMwfog.js} +19 -18
- package/dist/{GiftCardSetup-B096bTm0.js → GiftCardSetup-B87O0xzo.js} +75 -75
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-ChvUXdF-.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-B3uGbEFY.js} +7 -7
- package/dist/{Goals-Db2mwbRo.js → Goals-CVxf3xCA.js} +4 -4
- package/dist/Grab-mGL1Mue_.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-xdEzwMcS.js → ImageInput.vue_vue_type_script_setup_true_lang-HipBZ1_T.js} +1 -1
- package/dist/{Index-580WNkG2.js → Index-Dptuy-6c.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BkAQXKNJ.js → LocationPicker.vue_vue_type_script_setup_true_lang-Cjc4UeKz.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CR6sSnx4.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bh0ari3f.js} +1 -1
- package/dist/{LoyaltyDashboard-Clr2aiUP.js → LoyaltyDashboard-BxhI6RAE.js} +15 -15
- package/dist/MainLayout-YfDxvZXl.js +4 -0
- package/dist/{MainLayout-_iCyT5mw.js → MainLayout.vue_vue_type_script_setup_true_lang-BgXpznbi.js} +5 -4
- package/dist/{Marketing-fq1wxANq.js → Marketing-C2cVJacf.js} +4 -4
- package/dist/MarketingMaterialEdit-DkOEy_L-.js +1037 -0
- package/dist/{Member-BfRy196y.js → Member-DufbKDOh.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BAR44Qcp.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CU8EmBxy.js} +43 -50
- package/dist/{MemberImportHistory-C4622Ivs.js → MemberImportHistory-DlFN-uQl.js} +7 -7
- package/dist/{MemberList-DqtsMN_N.js → MemberList-B344n8I4.js} +103 -105
- package/dist/{MemberTransactions-DsUoFg3z.js → MemberTransactions-BS7H640M.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CzFMUgXM.js → MessageInput.vue_vue_type_script_setup_true_lang-CxDtXvwd.js} +4228 -4176
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CVQYcuQ6.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lY0jlyOG.js} +1 -1
- package/dist/{Mission-B0GO4LiM.js → Mission-D2ed_oKn.js} +22 -21
- package/dist/{Overview-XpJJmHqs.js → Overview-CLh_T6YY.js} +145 -144
- package/dist/{Overview-CVITimwN.js → Overview-DJa-hXDC.js} +23 -22
- package/dist/{Point-B7aCrMkI.js → Point-DAPeg1VD.js} +22 -21
- package/dist/{Promotion-DfVcuXHy.js → Promotion-CPPCMMFl.js} +137 -131
- package/dist/{Queue-BT7O2cvj.js → Queue-BcPwCRcM.js} +47 -46
- package/dist/{Record-CAc030dz.js → Record-C5XKn--g.js} +9 -9
- package/dist/{Review-CyXo4GTY.js → Review-Cc51luIv.js} +2 -2
- package/dist/ReviewFacebookCallback-BSGInFB8.js +225 -0
- package/dist/{ReviewGoogleCallback-BxiFOl0B.js → ReviewGoogleCallback-C1gY4vcP.js} +5 -5
- package/dist/{Reward-ChfNtdwX.js → Reward-k1R3hLiF.js} +29 -29
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CpQu_QBQ.js → RewardGroup.vue_vue_type_script_setup_true_lang-BGbbGVK4.js} +16 -15
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Coh3L11L.js +1923 -0
- package/dist/{Segment-H2zBDZeh.js → Segment-DsBnIvje.js} +290 -291
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B0jCJ-Xq.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CMKpvXN-.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DW_ViNZM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-LyAtRMs8.js} +4 -4
- package/dist/Setting-BRueNgc4.js +574 -0
- package/dist/{SettingAdvertisements-DPQHP3-B.js → SettingAdvertisements-BrVcQyhF.js} +12 -12
- package/dist/Settings-fOvXd29Z.js +286 -0
- package/dist/{Store-B2f5HVQc.js → Store-rrh2pIHH.js} +661 -654
- package/dist/{StoreRewards-QxfaEt9f.js → StoreRewards-D-jivVKr.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CvQXsZbH.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DbnY9VE9.js +7007 -0
- package/dist/{Tier-BSk4rBm8.js → Tier-DJiLtw3M.js} +2576 -687
- package/dist/{Title-CIzpB8TT.js → Title-s0bzA7yZ.js} +94 -92
- package/dist/{Transaction-BjxxNEHa.js → Transaction-CQ-CJ_eh.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BMutYxOU.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bfy8SZH1.js} +26 -26
- package/dist/{Voucher-B2lFq21Y.js → Voucher-9vydRET7.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BWV631It.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Dq7veRL5.js} +16 -16
- package/dist/WhatsappAccount-D12Hvzfl.js +159 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js +39 -0
- package/dist/WhatsappBot-o5b_0CnB.js +629 -0
- package/dist/WhatsappBotLogs-CK_V_iT5.js +372 -0
- package/dist/WhatsappBotSettings-BooibLUg.js +694 -0
- package/dist/WhatsappLayout-bOyNHGUI.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js +253 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BCoB0Fsa.js → ZodTextField.vue_vue_type_script_setup_true_lang-96t_eUzk.js} +2 -2
- package/dist/{app-DgFVWdhA.js → app-DV3e2LkD.js} +10610 -8223
- package/dist/app.js +4 -3
- package/dist/{base.export-B6Rojjek.js → base.export-DQUUtGmy.js} +2 -2
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-C6ID0exl.js → business-BZ0boE-5.js} +1 -1
- package/dist/campaign-CsfFq2S-.js +400 -0
- package/dist/{campaign-BgSJXWdU.js → campaign-DMrtYWcs.js} +31 -25
- package/dist/{campaign.enum-CVvm0LMm.js → campaign.enum-Dx-Zo68Q.js} +3 -2
- package/dist/campaign.fn-C-CdNNdR.js +776 -0
- package/dist/{collectible.enum-DGQVW464.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-dV4F8R-j.js → collection.fn-C-rryKSc.js} +2 -2
- package/dist/{currency-DlHi_3WN.js → currency-BOd9iVZV.js} +1 -1
- package/dist/duplicateCampaign-ey_rW0Bz.js +51 -0
- package/dist/{effect-BJgmiWY4.js → effect-BP6Hkxmj.js} +1 -1
- package/dist/{email-addresses-3GTx_xTh.js → email-addresses-CO61QAq0.js} +2 -2
- package/dist/feature-flag-Bq1SgbYC.js +868 -0
- package/dist/feature-flag-lvPP0ED-.js +50 -0
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-BX0JQP06.js → helper-BRpts-M-.js} +1 -1
- package/dist/{index-BIpAzktM.js → index-03WIXl-H.js} +8 -7
- package/dist/{index-BeCKw7Y3.js → index-B0RavybO.js} +19 -6
- package/dist/{index-DeNbsrQx.js → index-BDNkoALK.js} +1 -1
- package/dist/{index-Bl5aHABH.js → index-BV5aPSYo.js} +11 -10
- package/dist/{index-Cnw0B8Lc.js → index-Bk20uvPY.js} +1 -1
- package/dist/index-Bn19rfby.js +14571 -0
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-nmw7_9ZE.js → index-Cj-eugzc.js} +1 -1
- package/dist/{index-uXgPJlic.js → index-CoROn5OA.js} +2700 -2613
- package/dist/{index-DdMVrWZy.js → index-CrBhcMaL.js} +8028 -10767
- package/dist/{index-2xed2K8D.js → index-CsBjAM3E.js} +4 -3
- package/dist/{index-CiFReW-F.js → index-D1t4_KaG.js} +1 -1
- package/dist/{index-DRNdJ_KC.js → index-D3wGTCWf.js} +8 -7
- package/dist/{index-CtBLnWVG.js → index-D41kjcrZ.js} +683 -581
- package/dist/{index-CNULhBPM.js → index-DIZLkVe0.js} +691 -230
- package/dist/{index-QaWLGgEC.js → index-DucKyzrD.js} +2 -2
- package/dist/{index-o2OQljHs.js → index-R5WS21OL.js} +4 -4
- package/dist/index-RwNlbTO8.js +115 -0
- package/dist/{index-R0qlOO6J.js → index-VYI0zWNC.js} +29 -15
- package/dist/index-ZRE89TKq.js +80 -0
- package/dist/{index-BHT6cvWA.js → index-_Cj-bsd_.js} +396 -232
- package/dist/{index-Y2Pu1YkB.js → index-mToWKHVs.js} +2 -2
- package/dist/{index.esm2017-Dum0onrS.js → index.esm2017-B_Sag8Pg.js} +209 -209
- package/dist/{loading-B2mSdkfy.js → loading-C5fVI0ry.js} +1 -1
- package/dist/{lodash-DtOypaKt.js → lodash-COo8_xCU.js} +1 -1
- package/dist/{member-import-C2pLnh44.js → member-import-I_pKwUfF.js} +6 -5
- package/dist/{membership-BWyBGF4n.js → membership-BgfH9Kva.js} +3 -3
- package/dist/{money-3lCCVCeP.js → money-Cr07YDlV.js} +1 -1
- package/dist/{number-zlqy2MLG.js → number-DFsj0dkh.js} +1 -1
- package/dist/objectid-Cu89BzwI.js +145 -0
- package/dist/{onboarding-BqD3B4M1.js → onboarding-DlkJCm-5.js} +25 -25
- package/dist/{onboardingSetup-CCQ90jg7.js → onboardingSetup-BEhVj613.js} +2 -2
- package/dist/{plugins-Bj3npYnL.js → plugins-CPTtiKqf.js} +3 -3
- package/dist/{MarketingMaterialEdit-0h7E0n5e.js → remy-icon-BhUGu2NI.js} +2 -1031
- package/dist/{reward-5dDuZEb7.js → reward-DqY0mQ_5.js} +1 -1
- package/dist/{rule-NqLeSyoO.js → rule-mJJ48eKw.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-C1QftpDG.js +188 -0
- package/dist/{timezone-B0lkgvh-.js → timezone-BBgBHels.js} +1 -1
- package/dist/{transaction.fn-CACuVUBe.js → transaction.fn-Sr0hj3kY.js} +2 -2
- package/dist/{trigger-BKJwKTJx.js → trigger-PUP0mwKM.js} +8 -8
- package/dist/{useMarketingMaterialActions-DERvOmen.js → useMarketingMaterialActions-faslwaHd.js} +3 -3
- package/dist/{usePagination-FkjroUq2.js → usePagination-Be6nIQ9y.js} +1 -1
- package/dist/{user-H9MnsLbu.js → user-DBSYzG_9.js} +1 -1
- package/dist/vue-i18n-C6c2jsH3.js +2365 -0
- package/dist/{xlsx-BVmtIl_i.js → xlsx-Bfo19lFv.js} +786 -786
- package/dist/{zod-DI7OBdxu.js → zod-CihbDg3N.js} +1 -1
- package/package.json +12 -3
- package/dist/Broadcast-CoirZUyr.js +0 -271
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DyIOw_HH.js +0 -2431
- package/dist/ReviewFacebookCallback--IcyheQA.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang--5K-qagY.js +0 -1883
- package/dist/Setting-D4XOHSHT.js +0 -2036
- package/dist/Settings-Dt_oLoGl.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Db2cd6ny.js +0 -1264
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D9L-AayN.js +0 -142
- package/dist/campaign-DDfFBFye.js +0 -228
- package/dist/campaign.fn-DRabv93K.js +0 -776
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/index-CmhDYsk6.js +0 -51
- package/dist/objectid-b2KGvMA7.js +0 -145
- package/dist/rule-builder-BzYwbbj4.js +0 -102
- package/dist/template-fjUz6xrU.js +0 -236
- package/dist/vue-i18n-DbJO6sZW.js +0 -2365
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { defineComponent as xe, ref as
|
|
2
|
-
import { useRouter as yt, useRoute as wt, RouterView as
|
|
3
|
-
import { useCoreStore as ge, FeedMeAuth as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { defineComponent as xe, ref as ne, h as U, Comment as ln, computed as X, watch as q, resolveComponent as te, openBlock as j, createElementBlock as me, createVNode as R, unref as _, createElementVNode as I, toDisplayString as A, createBlock as Oe, withCtx as ee, Fragment as It, renderList as un, onBeforeUnmount as dn, onMounted as hn, createCommentVNode as Pe, nextTick as fn } from "vue";
|
|
2
|
+
import { useRouter as yt, useRoute as wt, RouterView as pn } from "vue-router";
|
|
3
|
+
import { useCoreStore as ge, FeedMeAuth as mn } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as gn } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { u as _n } from "./business-BZ0boE-5.js";
|
|
6
|
+
import { u as Tt } from "./feature-flag-lvPP0ED-.js";
|
|
7
|
+
import { l as vn } from "./feature-flag-Bq1SgbYC.js";
|
|
8
|
+
import "./index-BDNkoALK.js";
|
|
9
|
+
import { components as W, useSnackbar as In, useDialog as yn } from "@feedmepos/ui-library";
|
|
10
|
+
import { u as kt } from "./vue-i18n-C6c2jsH3.js";
|
|
11
|
+
import { m as wn } from "./index-D1t4_KaG.js";
|
|
12
|
+
import { C as Xe } from "./timezone-BBgBHels.js";
|
|
13
|
+
import { u as Tn } from "./onboarding-DlkJCm-5.js";
|
|
14
|
+
import { R as p, A as kn, a as Qe } from "./app-DV3e2LkD.js";
|
|
15
|
+
import { J as bn } from "./JsonViewer-v8_C7l5N.js";
|
|
16
|
+
import { r as Le, L as En, g as bt, i as Sn, a as Rn, _ as Ze, C as et, b as An, S as se, c as P, d as Q, E as Fe, e as Pn, f as Et, h as Cn, j as Nn, k as St, l as k, m as On, F as Ve, n as Ln, q as oe, o as Mn, p as Un, s as Dn, t as xn, u as Fn } from "./index.esm2017-B_Sag8Pg.js";
|
|
15
17
|
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
16
|
-
import { S as tt, c as
|
|
17
|
-
const
|
|
18
|
+
import { S as tt, c as Vn } from "./index-03WIXl-H.js";
|
|
19
|
+
const $n = { class: "flex flex-col h-full justify-between py-16" }, Hn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Wn = /* @__PURE__ */ xe({
|
|
18
20
|
__name: "NavigationTab",
|
|
19
21
|
setup(n) {
|
|
20
|
-
const { t: e, locale: t } =
|
|
22
|
+
const { t: e, locale: t } = kt(), i = Tn(), r = Tt(), s = ne(), o = [
|
|
21
23
|
{
|
|
22
24
|
label: e("connect.navigation.analytic"),
|
|
23
25
|
value: p["$connect-ANALYTIC"]
|
|
@@ -37,6 +39,10 @@ const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class
|
|
|
37
39
|
{
|
|
38
40
|
label: e("connect.navigation.broadcast"),
|
|
39
41
|
value: p["$connect-CAMPAIGN_BROADCAST"]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: e("connect.navigation.grab"),
|
|
45
|
+
value: p["$connect-CAMPAIGN_GRAB"]
|
|
40
46
|
}
|
|
41
47
|
]
|
|
42
48
|
},
|
|
@@ -59,7 +65,7 @@ const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class
|
|
|
59
65
|
{
|
|
60
66
|
label: e("connect.navigation.point"),
|
|
61
67
|
value: p["$connect-PROGRAM_POINT"],
|
|
62
|
-
badge: () =>
|
|
68
|
+
badge: () => U(W.FmPill, { variant: "premium" })
|
|
63
69
|
},
|
|
64
70
|
{
|
|
65
71
|
label: e("connect.navigation.credit"),
|
|
@@ -68,7 +74,7 @@ const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class
|
|
|
68
74
|
{
|
|
69
75
|
label: e("connect.navigation.game"),
|
|
70
76
|
value: p["$connect-PROGRAM_GAME"],
|
|
71
|
-
badge: () =>
|
|
77
|
+
badge: () => U(W.FmPill, { variant: "premium" })
|
|
72
78
|
},
|
|
73
79
|
{
|
|
74
80
|
label: "Mission",
|
|
@@ -87,19 +93,24 @@ const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class
|
|
|
87
93
|
{
|
|
88
94
|
label: e("connect.navigation.segments"),
|
|
89
95
|
value: p["$connect-LOYALTY_SEGMENT"],
|
|
90
|
-
badge: () =>
|
|
96
|
+
badge: () => U(W.FmPill, { variant: "premium" })
|
|
91
97
|
},
|
|
92
98
|
{
|
|
93
99
|
label: e("connect.navigation.card"),
|
|
94
100
|
value: p["$connect-LOYALTY_CARD"],
|
|
95
|
-
badge: () =>
|
|
101
|
+
badge: () => U(W.FmPill, { variant: "premium" })
|
|
96
102
|
}
|
|
97
103
|
]
|
|
98
104
|
},
|
|
105
|
+
{
|
|
106
|
+
label: e("connect.navigation.whatsappBot"),
|
|
107
|
+
value: p["$connect-WHATSAPP"],
|
|
108
|
+
badge: () => U(W.FmPill, { variant: "beta" })
|
|
109
|
+
},
|
|
99
110
|
{
|
|
100
111
|
label: e("connect.navigation.referral"),
|
|
101
112
|
value: p["$connect-REFERRAL"],
|
|
102
|
-
badge: () =>
|
|
113
|
+
badge: () => U(W.FmPill, { variant: "premium" })
|
|
103
114
|
},
|
|
104
115
|
{
|
|
105
116
|
label: e("connect.navigation.store"),
|
|
@@ -113,6 +124,10 @@ const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class
|
|
|
113
124
|
label: e("connect.navigation.marketingMaterials"),
|
|
114
125
|
value: p["$connect-MARKETING"]
|
|
115
126
|
},
|
|
127
|
+
{
|
|
128
|
+
label: e("connect.navigation.auditLogs"),
|
|
129
|
+
value: p["$connect-AUDIT_LOGS"]
|
|
130
|
+
},
|
|
116
131
|
{
|
|
117
132
|
label: e("connect.navigation.review"),
|
|
118
133
|
value: p["$connect-REVIEW"]
|
|
@@ -120,11 +135,11 @@ const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class
|
|
|
120
135
|
{
|
|
121
136
|
label: e("connect.navigation.goals"),
|
|
122
137
|
value: p["$connect-GOALS"],
|
|
123
|
-
badge: () => i.goalsRemaining > 0 ?
|
|
138
|
+
badge: () => i.goalsRemaining > 0 ? U(W.FmBadge, {
|
|
124
139
|
variant: "numeric",
|
|
125
140
|
inline: !0,
|
|
126
141
|
value: i.goalsRemaining
|
|
127
|
-
}) :
|
|
142
|
+
}) : U(ln)
|
|
128
143
|
},
|
|
129
144
|
{
|
|
130
145
|
label: e("connect.navigation.setting"),
|
|
@@ -134,76 +149,80 @@ const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class
|
|
|
134
149
|
label: e("connect.navigation.bin"),
|
|
135
150
|
value: p["$connect-BIN"]
|
|
136
151
|
}
|
|
137
|
-
],
|
|
138
|
-
|
|
139
|
-
|
|
152
|
+
], c = X(
|
|
153
|
+
() => o.filter(
|
|
154
|
+
(f) => f.value !== p["$connect-WHATSAPP"] || r.whatsappBotEnabled
|
|
155
|
+
)
|
|
156
|
+
), a = yt(), l = wt(), h = o.reduce((f, w) => [...(w.children ?? []).map((d) => d.value), ...f, w.value], []), m = ge(), v = X(() => {
|
|
157
|
+
const f = m.currentCountry.value || "MY";
|
|
158
|
+
return console.log(`[MF] Timezone set to: ${Xe[f]}`), Xe[f];
|
|
140
159
|
});
|
|
141
|
-
|
|
160
|
+
q(
|
|
142
161
|
// Watch `route.matched`, not `route`: `useRoute()` returns a reactive object
|
|
143
162
|
// whose identity never changes, so watching it directly fired once via
|
|
144
163
|
// `immediate` and the highlight then stayed on whatever page loaded first.
|
|
145
|
-
() =>
|
|
146
|
-
(
|
|
147
|
-
const
|
|
148
|
-
|
|
164
|
+
() => l.matched,
|
|
165
|
+
(f) => {
|
|
166
|
+
const d = f.map((g) => g.name).reverse().find((g) => h.includes(g));
|
|
167
|
+
d && (s.value = d);
|
|
149
168
|
},
|
|
150
169
|
{ immediate: !0 }
|
|
151
|
-
),
|
|
170
|
+
), q(
|
|
152
171
|
[() => {
|
|
153
|
-
var
|
|
154
|
-
return (
|
|
155
|
-
}, () =>
|
|
156
|
-
([
|
|
157
|
-
|
|
172
|
+
var f;
|
|
173
|
+
return (f = m.currentBusiness.value) == null ? void 0 : f._id;
|
|
174
|
+
}, () => l.name, t],
|
|
175
|
+
([f]) => {
|
|
176
|
+
f && i.read(t.value, f);
|
|
158
177
|
},
|
|
159
178
|
{ immediate: !0 }
|
|
160
179
|
);
|
|
161
|
-
async function
|
|
162
|
-
await
|
|
180
|
+
async function y(f) {
|
|
181
|
+
await a.push({ name: f });
|
|
163
182
|
}
|
|
164
|
-
return (
|
|
165
|
-
var
|
|
166
|
-
const
|
|
167
|
-
return j(), me("div",
|
|
168
|
-
|
|
183
|
+
return (f, w) => {
|
|
184
|
+
var g;
|
|
185
|
+
const d = te("FmCollapsibleTabs");
|
|
186
|
+
return j(), me("div", $n, [
|
|
187
|
+
R(d, {
|
|
169
188
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
170
|
-
"model-value": (
|
|
171
|
-
items:
|
|
172
|
-
"onUpdate:modelValue":
|
|
173
|
-
}, null, 8, ["model-value"]),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
189
|
+
"model-value": (g = _(s)) == null ? void 0 : g.toString(),
|
|
190
|
+
items: _(c),
|
|
191
|
+
"onUpdate:modelValue": y
|
|
192
|
+
}, null, 8, ["model-value", "items"]),
|
|
193
|
+
I("div", Hn, [
|
|
194
|
+
I("div", null, "Timezone: " + A(_(v).split("/")[1].replace("_", " ")), 1),
|
|
195
|
+
I("div", null, "(UTC" + A(_(wn).tz(_(v)).format("Z")) + ")", 1)
|
|
177
196
|
])
|
|
178
197
|
]);
|
|
179
198
|
};
|
|
180
199
|
}
|
|
181
|
-
}),
|
|
182
|
-
function
|
|
200
|
+
}), Rt = "feedme_connect_marketing_promo_hidden";
|
|
201
|
+
function jn() {
|
|
183
202
|
try {
|
|
184
|
-
return localStorage.getItem(
|
|
203
|
+
return localStorage.getItem(Rt) !== null;
|
|
185
204
|
} catch {
|
|
186
205
|
return !1;
|
|
187
206
|
}
|
|
188
207
|
}
|
|
189
|
-
function
|
|
208
|
+
function Bn() {
|
|
190
209
|
try {
|
|
191
|
-
localStorage.setItem(
|
|
210
|
+
localStorage.setItem(Rt, (/* @__PURE__ */ new Date()).toISOString());
|
|
192
211
|
} catch {
|
|
193
212
|
}
|
|
194
213
|
}
|
|
195
|
-
const
|
|
214
|
+
const Gn = { class: "flex flex-col gap-12" }, zn = { class: "fm-corner-radius-xxl bg-fm-color-primary-oats flex items-start gap-4 self-start px-12 py-4" }, qn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, Kn = { class: "fm-typo-en-title-sm-800 max-w-[560px] leading-[42px]" }, Jn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary max-w-[600px]" }, Yn = { class: "flex flex-col gap-24 pb-8" }, Xn = { class: "grid grid-cols-1 gap-16 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-3" }, Qn = { class: "fm-corner-radius-sm bg-fm-color-primary-oats flex h-40 w-40 shrink-0 items-center justify-center" }, Zn = { class: "fm-typo-en-body-lg-600" }, ei = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, ti = { class: "shrink-0" }, ni = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ii = { class: "flex w-full flex-col gap-12 px-[16px]" }, ri = { class: "flex flex-wrap items-center gap-12" }, si = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, oi = /* @__PURE__ */ xe({
|
|
196
215
|
__name: "AiMarketingPromoDialog",
|
|
197
216
|
setup(n) {
|
|
198
217
|
let e = !1;
|
|
199
|
-
const { t } =
|
|
218
|
+
const { t } = kt(), i = yt(), { sessionUser: r, currentCountry: s } = ge(), o = ne(!1), c = [
|
|
200
219
|
{ key: "completeContent", icon: "layers" },
|
|
201
220
|
{ key: "realContext", icon: "storefront" },
|
|
202
221
|
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
203
|
-
], a =
|
|
204
|
-
var
|
|
205
|
-
const y = ((
|
|
206
|
-
return
|
|
222
|
+
], a = X(() => {
|
|
223
|
+
var f;
|
|
224
|
+
const y = ((f = r.value) == null ? void 0 : f.permissions) ?? [];
|
|
225
|
+
return kn(
|
|
207
226
|
[
|
|
208
227
|
{
|
|
209
228
|
action: Qe.Action.manage,
|
|
@@ -212,104 +231,104 @@ const jn = { class: "flex flex-col gap-12" }, Wn = { class: "fm-corner-radius-xx
|
|
|
212
231
|
],
|
|
213
232
|
y
|
|
214
233
|
).granted;
|
|
215
|
-
}), l =
|
|
234
|
+
}), l = X(
|
|
216
235
|
() => s.value === "MY" && a.value
|
|
217
236
|
);
|
|
218
|
-
let
|
|
219
|
-
|
|
237
|
+
let h = !1;
|
|
238
|
+
q(
|
|
220
239
|
l,
|
|
221
240
|
(y) => {
|
|
222
|
-
|
|
241
|
+
h || !y || (h = !0, !(jn() || e) && (e = !0, o.value = !0));
|
|
223
242
|
},
|
|
224
243
|
{ immediate: !0 }
|
|
225
244
|
);
|
|
226
245
|
async function m() {
|
|
227
246
|
o.value = !1, await i.push({ name: p["$connect-MARKETING"] });
|
|
228
247
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
248
|
+
function v() {
|
|
249
|
+
Bn(), o.value = !1;
|
|
231
250
|
}
|
|
232
|
-
return (y,
|
|
233
|
-
const
|
|
234
|
-
return j(), Oe(
|
|
251
|
+
return (y, f) => {
|
|
252
|
+
const w = te("FmIcon"), d = te("FmCard"), g = te("FmButton"), b = te("FmDialog");
|
|
253
|
+
return j(), Oe(b, {
|
|
235
254
|
modelValue: o.value,
|
|
236
|
-
"onUpdate:modelValue":
|
|
255
|
+
"onUpdate:modelValue": f[0] || (f[0] = (T) => o.value = T),
|
|
237
256
|
"min-width": "min(500px, calc(100% - 48px))",
|
|
238
257
|
"max-width": "min(860px, calc(100% - 48px))",
|
|
239
258
|
"max-height": "90vh",
|
|
240
259
|
"dismiss-away": ""
|
|
241
260
|
}, {
|
|
242
|
-
"dialog-header":
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
261
|
+
"dialog-header": ee(() => [
|
|
262
|
+
I("div", Gn, [
|
|
263
|
+
I("div", zn, [
|
|
264
|
+
R(w, {
|
|
246
265
|
name: "auto_awesome",
|
|
247
266
|
size: "sm",
|
|
248
267
|
color: "primary"
|
|
249
268
|
}),
|
|
250
|
-
|
|
269
|
+
I("span", qn, A(_(t)("connect.marketing.whatsNew.badge")), 1)
|
|
251
270
|
]),
|
|
252
|
-
|
|
253
|
-
|
|
271
|
+
I("h1", Kn, A(_(t)("connect.marketing.whatsNew.title")), 1),
|
|
272
|
+
I("p", Jn, A(_(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
254
273
|
])
|
|
255
274
|
]),
|
|
256
|
-
"dialog-footer":
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
275
|
+
"dialog-footer": ee(() => [
|
|
276
|
+
I("div", ii, [
|
|
277
|
+
I("div", ri, [
|
|
278
|
+
R(g, {
|
|
260
279
|
variant: "primary",
|
|
261
280
|
size: "lg",
|
|
262
|
-
label:
|
|
281
|
+
label: _(t)("connect.marketing.whatsNew.cta"),
|
|
263
282
|
"append-icon": "arrow_forward",
|
|
264
283
|
onClick: m
|
|
265
284
|
}, null, 8, ["label"]),
|
|
266
|
-
|
|
285
|
+
R(g, {
|
|
267
286
|
variant: "tertiary",
|
|
268
287
|
size: "lg",
|
|
269
|
-
label:
|
|
270
|
-
onClick:
|
|
288
|
+
label: _(t)("connect.marketing.whatsNew.dismiss"),
|
|
289
|
+
onClick: v
|
|
271
290
|
}, null, 8, ["label"])
|
|
272
291
|
]),
|
|
273
|
-
|
|
292
|
+
I("div", si, A(_(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
274
293
|
])
|
|
275
294
|
]),
|
|
276
|
-
default:
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
(j(), me(It, null,
|
|
280
|
-
key:
|
|
295
|
+
default: ee(() => [
|
|
296
|
+
I("div", Yn, [
|
|
297
|
+
I("div", Xn, [
|
|
298
|
+
(j(), me(It, null, un(c, (T) => R(d, {
|
|
299
|
+
key: T.key,
|
|
281
300
|
variant: "outlined",
|
|
282
301
|
class: "!h-full flex flex-col gap-8 p-16"
|
|
283
302
|
}, {
|
|
284
|
-
default:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
name:
|
|
303
|
+
default: ee(() => [
|
|
304
|
+
I("div", Qn, [
|
|
305
|
+
R(w, {
|
|
306
|
+
name: T.icon,
|
|
288
307
|
size: "md",
|
|
289
308
|
color: "primary"
|
|
290
309
|
}, null, 8, ["name"])
|
|
291
310
|
]),
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
`connect.marketing.whatsNew.benefits.${
|
|
311
|
+
I("div", Zn, A(_(t)(`connect.marketing.whatsNew.benefits.${T.key}.title`)), 1),
|
|
312
|
+
I("div", ei, A(_(t)(
|
|
313
|
+
`connect.marketing.whatsNew.benefits.${T.key}.description`
|
|
295
314
|
)), 1)
|
|
296
315
|
]),
|
|
297
316
|
_: 2
|
|
298
317
|
}, 1024)), 64))
|
|
299
318
|
]),
|
|
300
|
-
|
|
319
|
+
R(d, {
|
|
301
320
|
variant: "outlined",
|
|
302
321
|
class: "flex items-start gap-12 p-16"
|
|
303
322
|
}, {
|
|
304
|
-
default:
|
|
305
|
-
|
|
306
|
-
|
|
323
|
+
default: ee(() => [
|
|
324
|
+
I("div", ti, [
|
|
325
|
+
R(w, {
|
|
307
326
|
name: "lightbulb",
|
|
308
327
|
size: "md",
|
|
309
328
|
color: "primary"
|
|
310
329
|
})
|
|
311
330
|
]),
|
|
312
|
-
|
|
331
|
+
I("p", ni, A(_(t)("connect.marketing.whatsNew.callout")), 1)
|
|
313
332
|
]),
|
|
314
333
|
_: 1
|
|
315
334
|
})
|
|
@@ -320,7 +339,7 @@ const jn = { class: "flex flex-col gap-12" }, Wn = { class: "fm-corner-radius-xx
|
|
|
320
339
|
};
|
|
321
340
|
}
|
|
322
341
|
});
|
|
323
|
-
var
|
|
342
|
+
var ai = "firebase", ci = "10.12.4";
|
|
324
343
|
/**
|
|
325
344
|
* @license
|
|
326
345
|
* Copyright 2020 Google LLC
|
|
@@ -337,13 +356,13 @@ var ri = "firebase", si = "10.12.4";
|
|
|
337
356
|
* See the License for the specific language governing permissions and
|
|
338
357
|
* limitations under the License.
|
|
339
358
|
*/
|
|
340
|
-
Le(
|
|
341
|
-
function
|
|
359
|
+
Le(ai, ci, "app");
|
|
360
|
+
function At() {
|
|
342
361
|
return {
|
|
343
362
|
"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."
|
|
344
363
|
};
|
|
345
364
|
}
|
|
346
|
-
const
|
|
365
|
+
const li = At, Pt = new Fe("auth", "Firebase", At());
|
|
347
366
|
/**
|
|
348
367
|
* @license
|
|
349
368
|
* Copyright 2020 Google LLC
|
|
@@ -360,12 +379,12 @@ const oi = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
|
360
379
|
* See the License for the specific language governing permissions and
|
|
361
380
|
* limitations under the License.
|
|
362
381
|
*/
|
|
363
|
-
const _e = new
|
|
364
|
-
function
|
|
365
|
-
_e.logLevel <=
|
|
382
|
+
const _e = new En("@firebase/auth");
|
|
383
|
+
function ui(n, ...e) {
|
|
384
|
+
_e.logLevel <= St.WARN && _e.warn(`Auth (${se}): ${n}`, ...e);
|
|
366
385
|
}
|
|
367
|
-
function
|
|
368
|
-
_e.logLevel <=
|
|
386
|
+
function de(n, ...e) {
|
|
387
|
+
_e.logLevel <= St.ERROR && _e.error(`Auth (${se}): ${n}`, ...e);
|
|
369
388
|
}
|
|
370
389
|
/**
|
|
371
390
|
* @license
|
|
@@ -383,38 +402,38 @@ function ue(n, ...e) {
|
|
|
383
402
|
* See the License for the specific language governing permissions and
|
|
384
403
|
* limitations under the License.
|
|
385
404
|
*/
|
|
386
|
-
function
|
|
405
|
+
function L(n, ...e) {
|
|
387
406
|
throw He(n, ...e);
|
|
388
407
|
}
|
|
389
|
-
function
|
|
408
|
+
function E(n, ...e) {
|
|
390
409
|
return He(n, ...e);
|
|
391
410
|
}
|
|
392
|
-
function
|
|
393
|
-
const i = Object.assign(Object.assign({},
|
|
411
|
+
function Ct(n, e, t) {
|
|
412
|
+
const i = Object.assign(Object.assign({}, li()), { [e]: t });
|
|
394
413
|
return new Fe("auth", "Firebase", i).create(e, {
|
|
395
414
|
appName: n.name
|
|
396
415
|
});
|
|
397
416
|
}
|
|
398
|
-
function
|
|
399
|
-
return
|
|
417
|
+
function H(n) {
|
|
418
|
+
return Ct(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
400
419
|
}
|
|
401
420
|
function He(n, ...e) {
|
|
402
421
|
if (typeof n != "string") {
|
|
403
422
|
const t = e[0], i = [...e.slice(1)];
|
|
404
423
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
405
424
|
}
|
|
406
|
-
return
|
|
425
|
+
return Pt.create(n, ...e);
|
|
407
426
|
}
|
|
408
427
|
function u(n, e, ...t) {
|
|
409
428
|
if (!n)
|
|
410
429
|
throw He(e, ...t);
|
|
411
430
|
}
|
|
412
|
-
function
|
|
431
|
+
function C(n) {
|
|
413
432
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
414
|
-
throw
|
|
433
|
+
throw de(e), new Error(e);
|
|
415
434
|
}
|
|
416
|
-
function
|
|
417
|
-
n ||
|
|
435
|
+
function M(n, e) {
|
|
436
|
+
n || C(e);
|
|
418
437
|
}
|
|
419
438
|
/**
|
|
420
439
|
* @license
|
|
@@ -436,7 +455,7 @@ function Me() {
|
|
|
436
455
|
var n;
|
|
437
456
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
438
457
|
}
|
|
439
|
-
function
|
|
458
|
+
function di() {
|
|
440
459
|
return nt() === "http:" || nt() === "https:";
|
|
441
460
|
}
|
|
442
461
|
function nt() {
|
|
@@ -459,15 +478,15 @@ function nt() {
|
|
|
459
478
|
* See the License for the specific language governing permissions and
|
|
460
479
|
* limitations under the License.
|
|
461
480
|
*/
|
|
462
|
-
function
|
|
481
|
+
function hi() {
|
|
463
482
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
464
483
|
// This is especially true for Cordova apps which have unreliable
|
|
465
484
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
466
485
|
// installed which overwrites the native navigator.onLine value and
|
|
467
486
|
// defines navigator.connection.
|
|
468
|
-
(
|
|
487
|
+
(di() || An() || "connection" in navigator) ? navigator.onLine : !0;
|
|
469
488
|
}
|
|
470
|
-
function
|
|
489
|
+
function fi() {
|
|
471
490
|
if (typeof navigator > "u")
|
|
472
491
|
return null;
|
|
473
492
|
const n = navigator;
|
|
@@ -495,12 +514,12 @@ function ui() {
|
|
|
495
514
|
* See the License for the specific language governing permissions and
|
|
496
515
|
* limitations under the License.
|
|
497
516
|
*/
|
|
498
|
-
class
|
|
517
|
+
class ae {
|
|
499
518
|
constructor(e, t) {
|
|
500
|
-
this.shortDelay = e, this.longDelay = t,
|
|
519
|
+
this.shortDelay = e, this.longDelay = t, M(t > e, "Short delay should be less than long delay!"), this.isMobile = Sn() || Rn();
|
|
501
520
|
}
|
|
502
521
|
get() {
|
|
503
|
-
return
|
|
522
|
+
return hi() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
504
523
|
}
|
|
505
524
|
}
|
|
506
525
|
/**
|
|
@@ -519,8 +538,8 @@ class oe {
|
|
|
519
538
|
* See the License for the specific language governing permissions and
|
|
520
539
|
* limitations under the License.
|
|
521
540
|
*/
|
|
522
|
-
function
|
|
523
|
-
|
|
541
|
+
function We(n, e) {
|
|
542
|
+
M(n.emulator, "Emulator should always be set here");
|
|
524
543
|
const { url: t } = n.emulator;
|
|
525
544
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
526
545
|
}
|
|
@@ -540,7 +559,7 @@ function je(n, e) {
|
|
|
540
559
|
* See the License for the specific language governing permissions and
|
|
541
560
|
* limitations under the License.
|
|
542
561
|
*/
|
|
543
|
-
class
|
|
562
|
+
class Nt {
|
|
544
563
|
static initialize(e, t, i) {
|
|
545
564
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
546
565
|
}
|
|
@@ -553,7 +572,7 @@ class Ct {
|
|
|
553
572
|
return globalThis.fetch;
|
|
554
573
|
if (typeof fetch < "u")
|
|
555
574
|
return fetch;
|
|
556
|
-
|
|
575
|
+
C("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
557
576
|
}
|
|
558
577
|
static headers() {
|
|
559
578
|
if (this.headersImpl)
|
|
@@ -564,7 +583,7 @@ class Ct {
|
|
|
564
583
|
return globalThis.Headers;
|
|
565
584
|
if (typeof Headers < "u")
|
|
566
585
|
return Headers;
|
|
567
|
-
|
|
586
|
+
C("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
568
587
|
}
|
|
569
588
|
static response() {
|
|
570
589
|
if (this.responseImpl)
|
|
@@ -575,7 +594,7 @@ class Ct {
|
|
|
575
594
|
return globalThis.Response;
|
|
576
595
|
if (typeof Response < "u")
|
|
577
596
|
return Response;
|
|
578
|
-
|
|
597
|
+
C("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
579
598
|
}
|
|
580
599
|
}
|
|
581
600
|
/**
|
|
@@ -594,7 +613,7 @@ class Ct {
|
|
|
594
613
|
* See the License for the specific language governing permissions and
|
|
595
614
|
* limitations under the License.
|
|
596
615
|
*/
|
|
597
|
-
const
|
|
616
|
+
const pi = {
|
|
598
617
|
// Custom token errors.
|
|
599
618
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
600
619
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -685,93 +704,93 @@ const di = {
|
|
|
685
704
|
* See the License for the specific language governing permissions and
|
|
686
705
|
* limitations under the License.
|
|
687
706
|
*/
|
|
688
|
-
const
|
|
707
|
+
const mi = new ae(3e4, 6e4);
|
|
689
708
|
function Te(n, e) {
|
|
690
709
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
691
710
|
}
|
|
692
|
-
async function
|
|
693
|
-
return
|
|
711
|
+
async function Z(n, e, t, i, r = {}) {
|
|
712
|
+
return Ot(n, r, async () => {
|
|
694
713
|
let s = {}, o = {};
|
|
695
714
|
i && (e === "GET" ? o = i : s = {
|
|
696
715
|
body: JSON.stringify(i)
|
|
697
716
|
});
|
|
698
|
-
const c =
|
|
717
|
+
const c = oe(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
699
718
|
return a[
|
|
700
719
|
"Content-Type"
|
|
701
720
|
/* HttpHeader.CONTENT_TYPE */
|
|
702
721
|
] = "application/json", n.languageCode && (a[
|
|
703
722
|
"X-Firebase-Locale"
|
|
704
723
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
705
|
-
] = n.languageCode),
|
|
724
|
+
] = n.languageCode), Nt.fetch()(Mt(n, n.config.apiHost, t, c), Object.assign({
|
|
706
725
|
method: e,
|
|
707
726
|
headers: a,
|
|
708
727
|
referrerPolicy: "no-referrer"
|
|
709
728
|
}, s));
|
|
710
729
|
});
|
|
711
730
|
}
|
|
712
|
-
async function
|
|
731
|
+
async function Ot(n, e, t) {
|
|
713
732
|
n._canInitEmulator = !1;
|
|
714
|
-
const i = Object.assign(Object.assign({},
|
|
733
|
+
const i = Object.assign(Object.assign({}, pi), e);
|
|
715
734
|
try {
|
|
716
|
-
const r = new
|
|
735
|
+
const r = new gi(n), s = await Promise.race([
|
|
717
736
|
t(),
|
|
718
737
|
r.promise
|
|
719
738
|
]);
|
|
720
739
|
r.clearNetworkTimeout();
|
|
721
740
|
const o = await s.json();
|
|
722
741
|
if ("needConfirmation" in o)
|
|
723
|
-
throw
|
|
742
|
+
throw ue(n, "account-exists-with-different-credential", o);
|
|
724
743
|
if (s.ok && !("errorMessage" in o))
|
|
725
744
|
return o;
|
|
726
745
|
{
|
|
727
746
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
728
747
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
729
|
-
throw
|
|
748
|
+
throw ue(n, "credential-already-in-use", o);
|
|
730
749
|
if (a === "EMAIL_EXISTS")
|
|
731
|
-
throw
|
|
750
|
+
throw ue(n, "email-already-in-use", o);
|
|
732
751
|
if (a === "USER_DISABLED")
|
|
733
|
-
throw
|
|
734
|
-
const
|
|
752
|
+
throw ue(n, "user-disabled", o);
|
|
753
|
+
const h = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
735
754
|
if (l)
|
|
736
|
-
throw
|
|
737
|
-
|
|
755
|
+
throw Ct(n, h, l);
|
|
756
|
+
L(n, h);
|
|
738
757
|
}
|
|
739
758
|
} catch (r) {
|
|
740
759
|
if (r instanceof Ve)
|
|
741
760
|
throw r;
|
|
742
|
-
|
|
761
|
+
L(n, "network-request-failed", { message: String(r) });
|
|
743
762
|
}
|
|
744
763
|
}
|
|
745
|
-
async function
|
|
746
|
-
const s = await
|
|
747
|
-
return "mfaPendingCredential" in s &&
|
|
764
|
+
async function Lt(n, e, t, i, r = {}) {
|
|
765
|
+
const s = await Z(n, e, t, i, r);
|
|
766
|
+
return "mfaPendingCredential" in s && L(n, "multi-factor-auth-required", {
|
|
748
767
|
_serverResponse: s
|
|
749
768
|
}), s;
|
|
750
769
|
}
|
|
751
|
-
function
|
|
770
|
+
function Mt(n, e, t, i) {
|
|
752
771
|
const r = `${e}${t}?${i}`;
|
|
753
|
-
return n.config.emulator ?
|
|
772
|
+
return n.config.emulator ? We(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
754
773
|
}
|
|
755
|
-
class
|
|
774
|
+
class gi {
|
|
756
775
|
constructor(e) {
|
|
757
776
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
758
|
-
this.timer = setTimeout(() => i(
|
|
777
|
+
this.timer = setTimeout(() => i(E(
|
|
759
778
|
this.auth,
|
|
760
779
|
"network-request-failed"
|
|
761
780
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
762
|
-
)),
|
|
781
|
+
)), mi.get());
|
|
763
782
|
});
|
|
764
783
|
}
|
|
765
784
|
clearNetworkTimeout() {
|
|
766
785
|
clearTimeout(this.timer);
|
|
767
786
|
}
|
|
768
787
|
}
|
|
769
|
-
function
|
|
788
|
+
function ue(n, e, t) {
|
|
770
789
|
const i = {
|
|
771
790
|
appName: n.name
|
|
772
791
|
};
|
|
773
792
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
774
|
-
const r =
|
|
793
|
+
const r = E(n, e, i);
|
|
775
794
|
return r.customData._tokenResponse = t, r;
|
|
776
795
|
}
|
|
777
796
|
/**
|
|
@@ -790,11 +809,11 @@ function le(n, e, t) {
|
|
|
790
809
|
* See the License for the specific language governing permissions and
|
|
791
810
|
* limitations under the License.
|
|
792
811
|
*/
|
|
793
|
-
async function
|
|
794
|
-
return
|
|
812
|
+
async function _i(n, e) {
|
|
813
|
+
return Z(n, "POST", "/v1/accounts:delete", e);
|
|
795
814
|
}
|
|
796
|
-
async function
|
|
797
|
-
return
|
|
815
|
+
async function Ut(n, e) {
|
|
816
|
+
return Z(n, "POST", "/v1/accounts:lookup", e);
|
|
798
817
|
}
|
|
799
818
|
/**
|
|
800
819
|
* @license
|
|
@@ -812,7 +831,7 @@ async function Mt(n, e) {
|
|
|
812
831
|
* See the License for the specific language governing permissions and
|
|
813
832
|
* limitations under the License.
|
|
814
833
|
*/
|
|
815
|
-
function
|
|
834
|
+
function ie(n) {
|
|
816
835
|
if (n)
|
|
817
836
|
try {
|
|
818
837
|
const e = new Date(Number(n));
|
|
@@ -821,8 +840,8 @@ function te(n) {
|
|
|
821
840
|
} catch {
|
|
822
841
|
}
|
|
823
842
|
}
|
|
824
|
-
async function
|
|
825
|
-
const t =
|
|
843
|
+
async function vi(n, e = !1) {
|
|
844
|
+
const t = Q(n), i = await t.getIdToken(e), r = je(i);
|
|
826
845
|
u(
|
|
827
846
|
r && r.exp && r.auth_time && r.iat,
|
|
828
847
|
t.auth,
|
|
@@ -833,9 +852,9 @@ async function mi(n, e = !1) {
|
|
|
833
852
|
return {
|
|
834
853
|
claims: r,
|
|
835
854
|
token: i,
|
|
836
|
-
authTime:
|
|
837
|
-
issuedAtTime:
|
|
838
|
-
expirationTime:
|
|
855
|
+
authTime: ie(Ce(r.auth_time)),
|
|
856
|
+
issuedAtTime: ie(Ce(r.iat)),
|
|
857
|
+
expirationTime: ie(Ce(r.exp)),
|
|
839
858
|
signInProvider: o || null,
|
|
840
859
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
841
860
|
};
|
|
@@ -843,19 +862,19 @@ async function mi(n, e = !1) {
|
|
|
843
862
|
function Ce(n) {
|
|
844
863
|
return Number(n) * 1e3;
|
|
845
864
|
}
|
|
846
|
-
function
|
|
865
|
+
function je(n) {
|
|
847
866
|
const [e, t, i] = n.split(".");
|
|
848
867
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
849
|
-
return
|
|
868
|
+
return de("JWT malformed, contained fewer than 3 sections"), null;
|
|
850
869
|
try {
|
|
851
|
-
const r =
|
|
852
|
-
return r ? JSON.parse(r) : (
|
|
870
|
+
const r = Ln(t);
|
|
871
|
+
return r ? JSON.parse(r) : (de("Failed to decode base64 JWT payload"), null);
|
|
853
872
|
} catch (r) {
|
|
854
|
-
return
|
|
873
|
+
return de("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
855
874
|
}
|
|
856
875
|
}
|
|
857
876
|
function it(n) {
|
|
858
|
-
const e =
|
|
877
|
+
const e = je(n);
|
|
859
878
|
return u(
|
|
860
879
|
e,
|
|
861
880
|
"internal-error"
|
|
@@ -886,16 +905,16 @@ function it(n) {
|
|
|
886
905
|
* See the License for the specific language governing permissions and
|
|
887
906
|
* limitations under the License.
|
|
888
907
|
*/
|
|
889
|
-
async function
|
|
908
|
+
async function re(n, e, t = !1) {
|
|
890
909
|
if (t)
|
|
891
910
|
return e;
|
|
892
911
|
try {
|
|
893
912
|
return await e;
|
|
894
913
|
} catch (i) {
|
|
895
|
-
throw i instanceof Ve &&
|
|
914
|
+
throw i instanceof Ve && Ii(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
896
915
|
}
|
|
897
916
|
}
|
|
898
|
-
function
|
|
917
|
+
function Ii({ code: n }) {
|
|
899
918
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
900
919
|
}
|
|
901
920
|
/**
|
|
@@ -914,7 +933,7 @@ function gi({ code: n }) {
|
|
|
914
933
|
* See the License for the specific language governing permissions and
|
|
915
934
|
* limitations under the License.
|
|
916
935
|
*/
|
|
917
|
-
class
|
|
936
|
+
class yi {
|
|
918
937
|
constructor(e) {
|
|
919
938
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
920
939
|
}
|
|
@@ -981,7 +1000,7 @@ class Ue {
|
|
|
981
1000
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
982
1001
|
}
|
|
983
1002
|
_initializeTime() {
|
|
984
|
-
this.lastSignInTime =
|
|
1003
|
+
this.lastSignInTime = ie(this.lastLoginAt), this.creationTime = ie(this.createdAt);
|
|
985
1004
|
}
|
|
986
1005
|
_copy(e) {
|
|
987
1006
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -1011,7 +1030,7 @@ class Ue {
|
|
|
1011
1030
|
*/
|
|
1012
1031
|
async function ve(n) {
|
|
1013
1032
|
var e;
|
|
1014
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
1033
|
+
const t = n.auth, i = await n.getIdToken(), r = await re(n, Ut(t, { idToken: i }));
|
|
1015
1034
|
u(
|
|
1016
1035
|
r == null ? void 0 : r.users.length,
|
|
1017
1036
|
t,
|
|
@@ -1020,7 +1039,7 @@ async function ve(n) {
|
|
|
1020
1039
|
);
|
|
1021
1040
|
const s = r.users[0];
|
|
1022
1041
|
n._notifyReloadListener(s);
|
|
1023
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
1042
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Dt(s.providerUserInfo) : [], c = Ti(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), h = a ? l : !1, m = {
|
|
1024
1043
|
uid: s.localId,
|
|
1025
1044
|
displayName: s.displayName || null,
|
|
1026
1045
|
photoURL: s.photoUrl || null,
|
|
@@ -1030,18 +1049,18 @@ async function ve(n) {
|
|
|
1030
1049
|
tenantId: s.tenantId || null,
|
|
1031
1050
|
providerData: c,
|
|
1032
1051
|
metadata: new Ue(s.createdAt, s.lastLoginAt),
|
|
1033
|
-
isAnonymous:
|
|
1052
|
+
isAnonymous: h
|
|
1034
1053
|
};
|
|
1035
1054
|
Object.assign(n, m);
|
|
1036
1055
|
}
|
|
1037
|
-
async function
|
|
1038
|
-
const e =
|
|
1056
|
+
async function wi(n) {
|
|
1057
|
+
const e = Q(n);
|
|
1039
1058
|
await ve(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
1040
1059
|
}
|
|
1041
|
-
function
|
|
1060
|
+
function Ti(n, e) {
|
|
1042
1061
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
1043
1062
|
}
|
|
1044
|
-
function
|
|
1063
|
+
function Dt(n) {
|
|
1045
1064
|
return n.map((e) => {
|
|
1046
1065
|
var { providerId: t } = e, i = $e(e, ["providerId"]);
|
|
1047
1066
|
return {
|
|
@@ -1070,16 +1089,16 @@ function Ut(n) {
|
|
|
1070
1089
|
* See the License for the specific language governing permissions and
|
|
1071
1090
|
* limitations under the License.
|
|
1072
1091
|
*/
|
|
1073
|
-
async function
|
|
1074
|
-
const t = await
|
|
1075
|
-
const i =
|
|
1092
|
+
async function ki(n, e) {
|
|
1093
|
+
const t = await Ot(n, {}, async () => {
|
|
1094
|
+
const i = oe({
|
|
1076
1095
|
grant_type: "refresh_token",
|
|
1077
1096
|
refresh_token: e
|
|
1078
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
1097
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = Mt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
1079
1098
|
return c[
|
|
1080
1099
|
"Content-Type"
|
|
1081
1100
|
/* HttpHeader.CONTENT_TYPE */
|
|
1082
|
-
] = "application/x-www-form-urlencoded",
|
|
1101
|
+
] = "application/x-www-form-urlencoded", Nt.fetch()(o, {
|
|
1083
1102
|
method: "POST",
|
|
1084
1103
|
headers: c,
|
|
1085
1104
|
body: i
|
|
@@ -1091,8 +1110,8 @@ async function yi(n, e) {
|
|
|
1091
1110
|
refreshToken: t.refresh_token
|
|
1092
1111
|
};
|
|
1093
1112
|
}
|
|
1094
|
-
async function
|
|
1095
|
-
return
|
|
1113
|
+
async function bi(n, e) {
|
|
1114
|
+
return Z(n, "POST", "/v2/accounts:revokeToken", Te(n, e));
|
|
1096
1115
|
}
|
|
1097
1116
|
/**
|
|
1098
1117
|
* @license
|
|
@@ -1110,7 +1129,7 @@ async function wi(n, e) {
|
|
|
1110
1129
|
* See the License for the specific language governing permissions and
|
|
1111
1130
|
* limitations under the License.
|
|
1112
1131
|
*/
|
|
1113
|
-
class
|
|
1132
|
+
class K {
|
|
1114
1133
|
constructor() {
|
|
1115
1134
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
1116
1135
|
}
|
|
@@ -1155,14 +1174,14 @@ class q {
|
|
|
1155
1174
|
this.refreshToken = null;
|
|
1156
1175
|
}
|
|
1157
1176
|
async refresh(e, t) {
|
|
1158
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1177
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await ki(e, t);
|
|
1159
1178
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
1160
1179
|
}
|
|
1161
1180
|
updateTokensAndExpiration(e, t, i) {
|
|
1162
1181
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
1163
1182
|
}
|
|
1164
1183
|
static fromJSON(e, t) {
|
|
1165
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1184
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new K();
|
|
1166
1185
|
return i && (u(typeof i == "string", "internal-error", {
|
|
1167
1186
|
appName: e
|
|
1168
1187
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1182,10 +1201,10 @@ class q {
|
|
|
1182
1201
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1183
1202
|
}
|
|
1184
1203
|
_clone() {
|
|
1185
|
-
return Object.assign(new
|
|
1204
|
+
return Object.assign(new K(), this.toJSON());
|
|
1186
1205
|
}
|
|
1187
1206
|
_performRefresh() {
|
|
1188
|
-
return
|
|
1207
|
+
return C("not implemented");
|
|
1189
1208
|
}
|
|
1190
1209
|
}
|
|
1191
1210
|
/**
|
|
@@ -1204,16 +1223,16 @@ class q {
|
|
|
1204
1223
|
* See the License for the specific language governing permissions and
|
|
1205
1224
|
* limitations under the License.
|
|
1206
1225
|
*/
|
|
1207
|
-
function
|
|
1226
|
+
function D(n, e) {
|
|
1208
1227
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1209
1228
|
}
|
|
1210
|
-
class
|
|
1229
|
+
class N {
|
|
1211
1230
|
constructor(e) {
|
|
1212
1231
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1213
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1232
|
+
this.providerId = "firebase", this.proactiveRefresh = new yi(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 Ue(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1214
1233
|
}
|
|
1215
1234
|
async getIdToken(e) {
|
|
1216
|
-
const t = await
|
|
1235
|
+
const t = await re(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1217
1236
|
return u(
|
|
1218
1237
|
t,
|
|
1219
1238
|
this.auth,
|
|
@@ -1222,10 +1241,10 @@ class C {
|
|
|
1222
1241
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1223
1242
|
}
|
|
1224
1243
|
getIdTokenResult(e) {
|
|
1225
|
-
return
|
|
1244
|
+
return vi(this, e);
|
|
1226
1245
|
}
|
|
1227
1246
|
reload() {
|
|
1228
|
-
return
|
|
1247
|
+
return wi(this);
|
|
1229
1248
|
}
|
|
1230
1249
|
_assign(e) {
|
|
1231
1250
|
this !== e && (u(
|
|
@@ -1236,7 +1255,7 @@ class C {
|
|
|
1236
1255
|
), this.displayName = e.displayName, this.photoURL = e.photoURL, this.email = e.email, this.emailVerified = e.emailVerified, this.phoneNumber = e.phoneNumber, this.isAnonymous = e.isAnonymous, this.tenantId = e.tenantId, this.providerData = e.providerData.map((t) => Object.assign({}, t)), this.metadata._copy(e.metadata), this.stsTokenManager._assign(e.stsTokenManager));
|
|
1237
1256
|
}
|
|
1238
1257
|
_clone(e) {
|
|
1239
|
-
const t = new
|
|
1258
|
+
const t = new N(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
1240
1259
|
return t.metadata._copy(this.metadata), t;
|
|
1241
1260
|
}
|
|
1242
1261
|
_onReload(e) {
|
|
@@ -1261,10 +1280,10 @@ class C {
|
|
|
1261
1280
|
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await ve(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1262
1281
|
}
|
|
1263
1282
|
async delete() {
|
|
1264
|
-
if (
|
|
1265
|
-
return Promise.reject(
|
|
1283
|
+
if (P(this.auth.app))
|
|
1284
|
+
return Promise.reject(H(this.auth));
|
|
1266
1285
|
const e = await this.getIdToken();
|
|
1267
|
-
return await
|
|
1286
|
+
return await re(this, _i(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1268
1287
|
}
|
|
1269
1288
|
toJSON() {
|
|
1270
1289
|
return Object.assign(Object.assign({
|
|
@@ -1291,21 +1310,21 @@ class C {
|
|
|
1291
1310
|
return this.stsTokenManager.refreshToken || "";
|
|
1292
1311
|
}
|
|
1293
1312
|
static _fromJSON(e, t) {
|
|
1294
|
-
var i, r, s, o, c, a, l,
|
|
1295
|
-
const m = (i = t.displayName) !== null && i !== void 0 ? i : void 0,
|
|
1313
|
+
var i, r, s, o, c, a, l, h;
|
|
1314
|
+
const m = (i = t.displayName) !== null && i !== void 0 ? i : void 0, v = (r = t.email) !== null && r !== void 0 ? r : void 0, y = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, f = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, w = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, d = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, g = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, b = (h = t.lastLoginAt) !== null && h !== void 0 ? h : void 0, { uid: T, emailVerified: Ke, isAnonymous: Je, providerData: Re, stsTokenManager: Ye } = t;
|
|
1296
1315
|
u(
|
|
1297
|
-
|
|
1316
|
+
T && Ye,
|
|
1298
1317
|
e,
|
|
1299
1318
|
"internal-error"
|
|
1300
1319
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1301
1320
|
);
|
|
1302
|
-
const
|
|
1321
|
+
const an = K.fromJSON(this.name, Ye);
|
|
1303
1322
|
u(
|
|
1304
|
-
typeof
|
|
1323
|
+
typeof T == "string",
|
|
1305
1324
|
e,
|
|
1306
1325
|
"internal-error"
|
|
1307
1326
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1308
|
-
),
|
|
1327
|
+
), D(m, e.name), D(v, e.name), u(
|
|
1309
1328
|
typeof Ke == "boolean",
|
|
1310
1329
|
e,
|
|
1311
1330
|
"internal-error"
|
|
@@ -1315,22 +1334,22 @@ class C {
|
|
|
1315
1334
|
e,
|
|
1316
1335
|
"internal-error"
|
|
1317
1336
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1318
|
-
),
|
|
1319
|
-
const Ae = new
|
|
1320
|
-
uid:
|
|
1337
|
+
), D(y, e.name), D(f, e.name), D(w, e.name), D(d, e.name), D(g, e.name), D(b, e.name);
|
|
1338
|
+
const Ae = new N({
|
|
1339
|
+
uid: T,
|
|
1321
1340
|
auth: e,
|
|
1322
|
-
email:
|
|
1341
|
+
email: v,
|
|
1323
1342
|
emailVerified: Ke,
|
|
1324
1343
|
displayName: m,
|
|
1325
1344
|
isAnonymous: Je,
|
|
1326
|
-
photoURL:
|
|
1345
|
+
photoURL: f,
|
|
1327
1346
|
phoneNumber: y,
|
|
1328
|
-
tenantId:
|
|
1329
|
-
stsTokenManager:
|
|
1330
|
-
createdAt:
|
|
1331
|
-
lastLoginAt:
|
|
1347
|
+
tenantId: w,
|
|
1348
|
+
stsTokenManager: an,
|
|
1349
|
+
createdAt: g,
|
|
1350
|
+
lastLoginAt: b
|
|
1332
1351
|
});
|
|
1333
|
-
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((
|
|
1352
|
+
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((cn) => Object.assign({}, cn))), d && (Ae._redirectEventId = d), Ae;
|
|
1334
1353
|
}
|
|
1335
1354
|
/**
|
|
1336
1355
|
* Initialize a User from an idToken server response
|
|
@@ -1338,9 +1357,9 @@ class C {
|
|
|
1338
1357
|
* @param idTokenResponse
|
|
1339
1358
|
*/
|
|
1340
1359
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1341
|
-
const r = new
|
|
1360
|
+
const r = new K();
|
|
1342
1361
|
r.updateFromServerResponse(t);
|
|
1343
|
-
const s = new
|
|
1362
|
+
const s = new N({
|
|
1344
1363
|
uid: t.localId,
|
|
1345
1364
|
auth: e,
|
|
1346
1365
|
stsTokenManager: r,
|
|
@@ -1360,9 +1379,9 @@ class C {
|
|
|
1360
1379
|
"internal-error"
|
|
1361
1380
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1362
1381
|
);
|
|
1363
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1382
|
+
const s = r.providerUserInfo !== void 0 ? Dt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new K();
|
|
1364
1383
|
c.updateFromIdToken(i);
|
|
1365
|
-
const a = new
|
|
1384
|
+
const a = new N({
|
|
1366
1385
|
uid: r.localId,
|
|
1367
1386
|
auth: e,
|
|
1368
1387
|
stsTokenManager: c,
|
|
@@ -1399,10 +1418,10 @@ class C {
|
|
|
1399
1418
|
* limitations under the License.
|
|
1400
1419
|
*/
|
|
1401
1420
|
const rt = /* @__PURE__ */ new Map();
|
|
1402
|
-
function
|
|
1403
|
-
|
|
1421
|
+
function O(n) {
|
|
1422
|
+
M(n instanceof Function, "Expected a class definition");
|
|
1404
1423
|
let e = rt.get(n);
|
|
1405
|
-
return e ? (
|
|
1424
|
+
return e ? (M(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), rt.set(n, e), e);
|
|
1406
1425
|
}
|
|
1407
1426
|
/**
|
|
1408
1427
|
* @license
|
|
@@ -1420,7 +1439,7 @@ function N(n) {
|
|
|
1420
1439
|
* See the License for the specific language governing permissions and
|
|
1421
1440
|
* limitations under the License.
|
|
1422
1441
|
*/
|
|
1423
|
-
class
|
|
1442
|
+
class xt {
|
|
1424
1443
|
constructor() {
|
|
1425
1444
|
this.type = "NONE", this.storage = {};
|
|
1426
1445
|
}
|
|
@@ -1442,8 +1461,8 @@ class Dt {
|
|
|
1442
1461
|
_removeListener(e, t) {
|
|
1443
1462
|
}
|
|
1444
1463
|
}
|
|
1445
|
-
|
|
1446
|
-
const st =
|
|
1464
|
+
xt.type = "NONE";
|
|
1465
|
+
const st = xt;
|
|
1447
1466
|
/**
|
|
1448
1467
|
* @license
|
|
1449
1468
|
* Copyright 2019 Google LLC
|
|
@@ -1460,21 +1479,21 @@ const st = Dt;
|
|
|
1460
1479
|
* See the License for the specific language governing permissions and
|
|
1461
1480
|
* limitations under the License.
|
|
1462
1481
|
*/
|
|
1463
|
-
function
|
|
1482
|
+
function he(n, e, t) {
|
|
1464
1483
|
return `firebase:${n}:${e}:${t}`;
|
|
1465
1484
|
}
|
|
1466
|
-
class
|
|
1485
|
+
class J {
|
|
1467
1486
|
constructor(e, t, i) {
|
|
1468
1487
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1469
1488
|
const { config: r, name: s } = this.auth;
|
|
1470
|
-
this.fullUserKey =
|
|
1489
|
+
this.fullUserKey = he(this.userKey, r.apiKey, s), this.fullPersistenceKey = he("persistence", r.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
1471
1490
|
}
|
|
1472
1491
|
setCurrentUser(e) {
|
|
1473
1492
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
1474
1493
|
}
|
|
1475
1494
|
async getCurrentUser() {
|
|
1476
1495
|
const e = await this.persistence._get(this.fullUserKey);
|
|
1477
|
-
return e ?
|
|
1496
|
+
return e ? N._fromJSON(this.auth, e) : null;
|
|
1478
1497
|
}
|
|
1479
1498
|
removeCurrentUser() {
|
|
1480
1499
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -1494,32 +1513,32 @@ class K {
|
|
|
1494
1513
|
}
|
|
1495
1514
|
static async create(e, t, i = "authUser") {
|
|
1496
1515
|
if (!t.length)
|
|
1497
|
-
return new
|
|
1516
|
+
return new J(O(st), e, i);
|
|
1498
1517
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1499
1518
|
if (await l._isAvailable())
|
|
1500
1519
|
return l;
|
|
1501
1520
|
}))).filter((l) => l);
|
|
1502
|
-
let s = r[0] ||
|
|
1503
|
-
const o =
|
|
1521
|
+
let s = r[0] || O(st);
|
|
1522
|
+
const o = he(i, e.config.apiKey, e.name);
|
|
1504
1523
|
let c = null;
|
|
1505
1524
|
for (const l of t)
|
|
1506
1525
|
try {
|
|
1507
|
-
const
|
|
1508
|
-
if (
|
|
1509
|
-
const m =
|
|
1526
|
+
const h = await l._get(o);
|
|
1527
|
+
if (h) {
|
|
1528
|
+
const m = N._fromJSON(e, h);
|
|
1510
1529
|
l !== s && (c = m), s = l;
|
|
1511
1530
|
break;
|
|
1512
1531
|
}
|
|
1513
1532
|
} catch {
|
|
1514
1533
|
}
|
|
1515
1534
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1516
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1535
|
+
return !s._shouldAllowMigration || !a.length ? new J(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
1517
1536
|
if (l !== s)
|
|
1518
1537
|
try {
|
|
1519
1538
|
await l._remove(o);
|
|
1520
1539
|
} catch {
|
|
1521
1540
|
}
|
|
1522
|
-
})), new
|
|
1541
|
+
})), new J(s, e, i));
|
|
1523
1542
|
}
|
|
1524
1543
|
}
|
|
1525
1544
|
/**
|
|
@@ -1542,25 +1561,25 @@ function ot(n) {
|
|
|
1542
1561
|
const e = n.toLowerCase();
|
|
1543
1562
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1544
1563
|
return "Opera";
|
|
1545
|
-
if (
|
|
1564
|
+
if ($t(e))
|
|
1546
1565
|
return "IEMobile";
|
|
1547
1566
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1548
1567
|
return "IE";
|
|
1549
1568
|
if (e.includes("edge/"))
|
|
1550
1569
|
return "Edge";
|
|
1551
|
-
if (
|
|
1570
|
+
if (Ft(e))
|
|
1552
1571
|
return "Firefox";
|
|
1553
1572
|
if (e.includes("silk/"))
|
|
1554
1573
|
return "Silk";
|
|
1555
|
-
if (
|
|
1574
|
+
if (Wt(e))
|
|
1556
1575
|
return "Blackberry";
|
|
1557
1576
|
if (jt(e))
|
|
1558
1577
|
return "Webos";
|
|
1559
1578
|
if (Be(e))
|
|
1560
1579
|
return "Safari";
|
|
1561
|
-
if ((e.includes("chrome/") ||
|
|
1580
|
+
if ((e.includes("chrome/") || Vt(e)) && !e.includes("edge/"))
|
|
1562
1581
|
return "Chrome";
|
|
1563
|
-
if (
|
|
1582
|
+
if (Ht(e))
|
|
1564
1583
|
return "Android";
|
|
1565
1584
|
{
|
|
1566
1585
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1569,42 +1588,42 @@ function ot(n) {
|
|
|
1569
1588
|
}
|
|
1570
1589
|
return "Other";
|
|
1571
1590
|
}
|
|
1572
|
-
function
|
|
1591
|
+
function Ft(n = k()) {
|
|
1573
1592
|
return /firefox\//i.test(n);
|
|
1574
1593
|
}
|
|
1575
|
-
function Be(n =
|
|
1594
|
+
function Be(n = k()) {
|
|
1576
1595
|
const e = n.toLowerCase();
|
|
1577
1596
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1578
1597
|
}
|
|
1579
|
-
function
|
|
1598
|
+
function Vt(n = k()) {
|
|
1580
1599
|
return /crios\//i.test(n);
|
|
1581
1600
|
}
|
|
1582
|
-
function
|
|
1601
|
+
function $t(n = k()) {
|
|
1583
1602
|
return /iemobile/i.test(n);
|
|
1584
1603
|
}
|
|
1585
|
-
function
|
|
1604
|
+
function Ht(n = k()) {
|
|
1586
1605
|
return /android/i.test(n);
|
|
1587
1606
|
}
|
|
1588
|
-
function
|
|
1607
|
+
function Wt(n = k()) {
|
|
1589
1608
|
return /blackberry/i.test(n);
|
|
1590
1609
|
}
|
|
1591
|
-
function jt(n =
|
|
1610
|
+
function jt(n = k()) {
|
|
1592
1611
|
return /webos/i.test(n);
|
|
1593
1612
|
}
|
|
1594
|
-
function ke(n =
|
|
1613
|
+
function ke(n = k()) {
|
|
1595
1614
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1596
1615
|
}
|
|
1597
|
-
function
|
|
1616
|
+
function Ei(n = k()) {
|
|
1598
1617
|
var e;
|
|
1599
1618
|
return ke(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1600
1619
|
}
|
|
1601
|
-
function
|
|
1602
|
-
return
|
|
1620
|
+
function Si() {
|
|
1621
|
+
return Mn() && document.documentMode === 10;
|
|
1603
1622
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return ke(n) ||
|
|
1623
|
+
function Bt(n = k()) {
|
|
1624
|
+
return ke(n) || Ht(n) || jt(n) || Wt(n) || /windows phone/i.test(n) || $t(n);
|
|
1606
1625
|
}
|
|
1607
|
-
function
|
|
1626
|
+
function Ri() {
|
|
1608
1627
|
try {
|
|
1609
1628
|
return !!(window && window !== window.top);
|
|
1610
1629
|
} catch {
|
|
@@ -1627,20 +1646,20 @@ function bi() {
|
|
|
1627
1646
|
* See the License for the specific language governing permissions and
|
|
1628
1647
|
* limitations under the License.
|
|
1629
1648
|
*/
|
|
1630
|
-
function
|
|
1649
|
+
function Gt(n, e = []) {
|
|
1631
1650
|
let t;
|
|
1632
1651
|
switch (n) {
|
|
1633
1652
|
case "Browser":
|
|
1634
|
-
t = ot(
|
|
1653
|
+
t = ot(k());
|
|
1635
1654
|
break;
|
|
1636
1655
|
case "Worker":
|
|
1637
|
-
t = `${ot(
|
|
1656
|
+
t = `${ot(k())}-${n}`;
|
|
1638
1657
|
break;
|
|
1639
1658
|
default:
|
|
1640
1659
|
t = n;
|
|
1641
1660
|
}
|
|
1642
1661
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1643
|
-
return `${t}/JsCore/${
|
|
1662
|
+
return `${t}/JsCore/${se}/${i}`;
|
|
1644
1663
|
}
|
|
1645
1664
|
/**
|
|
1646
1665
|
* @license
|
|
@@ -1658,7 +1677,7 @@ function Bt(n, e = []) {
|
|
|
1658
1677
|
* See the License for the specific language governing permissions and
|
|
1659
1678
|
* limitations under the License.
|
|
1660
1679
|
*/
|
|
1661
|
-
class
|
|
1680
|
+
class Ai {
|
|
1662
1681
|
constructor(e) {
|
|
1663
1682
|
this.auth = e, this.queue = [];
|
|
1664
1683
|
}
|
|
@@ -1713,8 +1732,8 @@ class Ei {
|
|
|
1713
1732
|
* See the License for the specific language governing permissions and
|
|
1714
1733
|
* limitations under the License.
|
|
1715
1734
|
*/
|
|
1716
|
-
async function
|
|
1717
|
-
return
|
|
1735
|
+
async function Pi(n, e = {}) {
|
|
1736
|
+
return Z(n, "GET", "/v2/passwordPolicy", Te(n, e));
|
|
1718
1737
|
}
|
|
1719
1738
|
/**
|
|
1720
1739
|
* @license
|
|
@@ -1732,12 +1751,12 @@ async function Si(n, e = {}) {
|
|
|
1732
1751
|
* See the License for the specific language governing permissions and
|
|
1733
1752
|
* limitations under the License.
|
|
1734
1753
|
*/
|
|
1735
|
-
const
|
|
1736
|
-
class
|
|
1754
|
+
const Ci = 6;
|
|
1755
|
+
class Ni {
|
|
1737
1756
|
constructor(e) {
|
|
1738
1757
|
var t, i, r, s;
|
|
1739
1758
|
const o = e.customStrengthOptions;
|
|
1740
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1759
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Ci, 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;
|
|
1741
1760
|
}
|
|
1742
1761
|
validatePassword(e) {
|
|
1743
1762
|
var t, i, r, s, o, c;
|
|
@@ -1820,14 +1839,14 @@ class Ai {
|
|
|
1820
1839
|
* See the License for the specific language governing permissions and
|
|
1821
1840
|
* limitations under the License.
|
|
1822
1841
|
*/
|
|
1823
|
-
class
|
|
1842
|
+
class Oi {
|
|
1824
1843
|
constructor(e, t, i, r) {
|
|
1825
|
-
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 at(this), this.idTokenSubscription = new at(this), this.beforeStateQueue = new
|
|
1844
|
+
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 at(this), this.idTokenSubscription = new at(this), this.beforeStateQueue = new Ai(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 = Pt, 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;
|
|
1826
1845
|
}
|
|
1827
1846
|
_initializeWithPersistence(e, t) {
|
|
1828
|
-
return t && (this._popupRedirectResolver =
|
|
1847
|
+
return t && (this._popupRedirectResolver = O(t)), this._initializationPromise = this.queue(async () => {
|
|
1829
1848
|
var i, r;
|
|
1830
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1849
|
+
if (!this._deleted && (this.persistenceManager = await J.create(this, e), !this._deleted)) {
|
|
1831
1850
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1832
1851
|
try {
|
|
1833
1852
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1858,7 +1877,7 @@ class Pi {
|
|
|
1858
1877
|
}
|
|
1859
1878
|
async initializeCurrentUserFromIdToken(e) {
|
|
1860
1879
|
try {
|
|
1861
|
-
const t = await
|
|
1880
|
+
const t = await Ut(this, { idToken: e }), i = await N._fromGetAccountInfoResponse(this, t, e);
|
|
1862
1881
|
await this.directlySetCurrentUser(i);
|
|
1863
1882
|
} catch (t) {
|
|
1864
1883
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1866,7 +1885,7 @@ class Pi {
|
|
|
1866
1885
|
}
|
|
1867
1886
|
async initializeCurrentUser(e) {
|
|
1868
1887
|
var t;
|
|
1869
|
-
if (
|
|
1888
|
+
if (P(this.app)) {
|
|
1870
1889
|
const o = this.app.settings.authIdToken;
|
|
1871
1890
|
return o ? new Promise((c) => {
|
|
1872
1891
|
setTimeout(() => this.initializeCurrentUserFromIdToken(o).then(c, c));
|
|
@@ -1916,15 +1935,15 @@ class Pi {
|
|
|
1916
1935
|
return this.directlySetCurrentUser(e);
|
|
1917
1936
|
}
|
|
1918
1937
|
useDeviceLanguage() {
|
|
1919
|
-
this.languageCode =
|
|
1938
|
+
this.languageCode = fi();
|
|
1920
1939
|
}
|
|
1921
1940
|
async _delete() {
|
|
1922
1941
|
this._deleted = !0;
|
|
1923
1942
|
}
|
|
1924
1943
|
async updateCurrentUser(e) {
|
|
1925
|
-
if (
|
|
1926
|
-
return Promise.reject(
|
|
1927
|
-
const t = e ?
|
|
1944
|
+
if (P(this.app))
|
|
1945
|
+
return Promise.reject(H(this));
|
|
1946
|
+
const t = e ? Q(e) : null;
|
|
1928
1947
|
return t && u(
|
|
1929
1948
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1930
1949
|
this,
|
|
@@ -1944,15 +1963,15 @@ class Pi {
|
|
|
1944
1963
|
});
|
|
1945
1964
|
}
|
|
1946
1965
|
async signOut() {
|
|
1947
|
-
return
|
|
1966
|
+
return P(this.app) ? Promise.reject(H(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1948
1967
|
null,
|
|
1949
1968
|
/* skipBeforeStateCallbacks */
|
|
1950
1969
|
!0
|
|
1951
1970
|
));
|
|
1952
1971
|
}
|
|
1953
1972
|
setPersistence(e) {
|
|
1954
|
-
return
|
|
1955
|
-
await this.assertedPersistence.setPersistence(
|
|
1973
|
+
return P(this.app) ? Promise.reject(H(this)) : this.queue(async () => {
|
|
1974
|
+
await this.assertedPersistence.setPersistence(O(e));
|
|
1956
1975
|
});
|
|
1957
1976
|
}
|
|
1958
1977
|
_getRecaptchaConfig() {
|
|
@@ -1967,7 +1986,7 @@ class Pi {
|
|
|
1967
1986
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1968
1987
|
}
|
|
1969
1988
|
async _updatePasswordPolicy() {
|
|
1970
|
-
const e = await
|
|
1989
|
+
const e = await Pi(this), t = new Ni(e);
|
|
1971
1990
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1972
1991
|
}
|
|
1973
1992
|
_getPersistence() {
|
|
@@ -2007,7 +2026,7 @@ class Pi {
|
|
|
2007
2026
|
token: e,
|
|
2008
2027
|
idToken: t
|
|
2009
2028
|
};
|
|
2010
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
2029
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await bi(this, i);
|
|
2011
2030
|
}
|
|
2012
2031
|
}
|
|
2013
2032
|
toJSON() {
|
|
@@ -2025,15 +2044,15 @@ class Pi {
|
|
|
2025
2044
|
}
|
|
2026
2045
|
async getOrInitRedirectPersistenceManager(e) {
|
|
2027
2046
|
if (!this.redirectPersistenceManager) {
|
|
2028
|
-
const t = e &&
|
|
2047
|
+
const t = e && O(e) || this._popupRedirectResolver;
|
|
2029
2048
|
u(
|
|
2030
2049
|
t,
|
|
2031
2050
|
this,
|
|
2032
2051
|
"argument-error"
|
|
2033
2052
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2034
|
-
), this.redirectPersistenceManager = await
|
|
2053
|
+
), this.redirectPersistenceManager = await J.create(
|
|
2035
2054
|
this,
|
|
2036
|
-
[
|
|
2055
|
+
[O(t._redirectPersistence)],
|
|
2037
2056
|
"redirectUser"
|
|
2038
2057
|
/* KeyName.REDIRECT_USER */
|
|
2039
2058
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -2120,7 +2139,7 @@ class Pi {
|
|
|
2120
2139
|
), this.persistenceManager;
|
|
2121
2140
|
}
|
|
2122
2141
|
_logFramework(e) {
|
|
2123
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
2142
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Gt(this.config.clientPlatform, this._getFrameworks()));
|
|
2124
2143
|
}
|
|
2125
2144
|
_getFrameworks() {
|
|
2126
2145
|
return this.frameworks;
|
|
@@ -2150,15 +2169,15 @@ class Pi {
|
|
|
2150
2169
|
async _getAppCheckToken() {
|
|
2151
2170
|
var e;
|
|
2152
2171
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
2153
|
-
return t != null && t.error &&
|
|
2172
|
+
return t != null && t.error && ui(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
2154
2173
|
}
|
|
2155
2174
|
}
|
|
2156
2175
|
function be(n) {
|
|
2157
|
-
return
|
|
2176
|
+
return Q(n);
|
|
2158
2177
|
}
|
|
2159
2178
|
class at {
|
|
2160
2179
|
constructor(e) {
|
|
2161
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2180
|
+
this.auth = e, this.observer = null, this.addObserver = Pn((t) => this.observer = t);
|
|
2162
2181
|
}
|
|
2163
2182
|
get next() {
|
|
2164
2183
|
return u(
|
|
@@ -2193,16 +2212,16 @@ let Ge = {
|
|
|
2193
2212
|
recaptchaEnterpriseScript: "",
|
|
2194
2213
|
gapiScript: ""
|
|
2195
2214
|
};
|
|
2196
|
-
function
|
|
2215
|
+
function Li(n) {
|
|
2197
2216
|
Ge = n;
|
|
2198
2217
|
}
|
|
2199
|
-
function
|
|
2218
|
+
function Mi(n) {
|
|
2200
2219
|
return Ge.loadJS(n);
|
|
2201
2220
|
}
|
|
2202
|
-
function
|
|
2221
|
+
function Ui() {
|
|
2203
2222
|
return Ge.gapiScript;
|
|
2204
2223
|
}
|
|
2205
|
-
function
|
|
2224
|
+
function Di(n) {
|
|
2206
2225
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2207
2226
|
}
|
|
2208
2227
|
/**
|
|
@@ -2221,13 +2240,13 @@ function Li(n) {
|
|
|
2221
2240
|
* See the License for the specific language governing permissions and
|
|
2222
2241
|
* limitations under the License.
|
|
2223
2242
|
*/
|
|
2224
|
-
function
|
|
2225
|
-
const t =
|
|
2243
|
+
function xi(n, e) {
|
|
2244
|
+
const t = Et(n, "auth");
|
|
2226
2245
|
if (t.isInitialized()) {
|
|
2227
2246
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2228
|
-
if (
|
|
2247
|
+
if (On(s, e ?? {}))
|
|
2229
2248
|
return r;
|
|
2230
|
-
|
|
2249
|
+
L(
|
|
2231
2250
|
r,
|
|
2232
2251
|
"already-initialized"
|
|
2233
2252
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2235,11 +2254,11 @@ function Mi(n, e) {
|
|
|
2235
2254
|
}
|
|
2236
2255
|
return t.initialize({ options: e });
|
|
2237
2256
|
}
|
|
2238
|
-
function
|
|
2239
|
-
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(
|
|
2257
|
+
function Fi(n, e) {
|
|
2258
|
+
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(O);
|
|
2240
2259
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2241
2260
|
}
|
|
2242
|
-
function
|
|
2261
|
+
function Vi(n, e, t) {
|
|
2243
2262
|
const i = be(n);
|
|
2244
2263
|
u(
|
|
2245
2264
|
i._canInitEmulator,
|
|
@@ -2252,20 +2271,20 @@ function Di(n, e, t) {
|
|
|
2252
2271
|
"invalid-emulator-scheme"
|
|
2253
2272
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2254
2273
|
);
|
|
2255
|
-
const r = !1, s =
|
|
2274
|
+
const r = !1, s = zt(e), { host: o, port: c } = $i(e), a = c === null ? "" : `:${c}`;
|
|
2256
2275
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2257
2276
|
host: o,
|
|
2258
2277
|
port: c,
|
|
2259
2278
|
protocol: s.replace(":", ""),
|
|
2260
2279
|
options: Object.freeze({ disableWarnings: r })
|
|
2261
|
-
}),
|
|
2280
|
+
}), Hi();
|
|
2262
2281
|
}
|
|
2263
|
-
function
|
|
2282
|
+
function zt(n) {
|
|
2264
2283
|
const e = n.indexOf(":");
|
|
2265
2284
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2266
2285
|
}
|
|
2267
|
-
function
|
|
2268
|
-
const e =
|
|
2286
|
+
function $i(n) {
|
|
2287
|
+
const e = zt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2269
2288
|
if (!t)
|
|
2270
2289
|
return { host: "", port: null };
|
|
2271
2290
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
@@ -2283,7 +2302,7 @@ function ct(n) {
|
|
|
2283
2302
|
const e = Number(n);
|
|
2284
2303
|
return isNaN(e) ? null : e;
|
|
2285
2304
|
}
|
|
2286
|
-
function
|
|
2305
|
+
function Hi() {
|
|
2287
2306
|
function n() {
|
|
2288
2307
|
const e = document.createElement("p"), t = e.style;
|
|
2289
2308
|
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);
|
|
@@ -2306,7 +2325,7 @@ function Fi() {
|
|
|
2306
2325
|
* See the License for the specific language governing permissions and
|
|
2307
2326
|
* limitations under the License.
|
|
2308
2327
|
*/
|
|
2309
|
-
class
|
|
2328
|
+
class qt {
|
|
2310
2329
|
/** @internal */
|
|
2311
2330
|
constructor(e, t) {
|
|
2312
2331
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2317,19 +2336,19 @@ class zt {
|
|
|
2317
2336
|
* @returns a JSON-serializable representation of this object.
|
|
2318
2337
|
*/
|
|
2319
2338
|
toJSON() {
|
|
2320
|
-
return
|
|
2339
|
+
return C("not implemented");
|
|
2321
2340
|
}
|
|
2322
2341
|
/** @internal */
|
|
2323
2342
|
_getIdTokenResponse(e) {
|
|
2324
|
-
return
|
|
2343
|
+
return C("not implemented");
|
|
2325
2344
|
}
|
|
2326
2345
|
/** @internal */
|
|
2327
2346
|
_linkToIdToken(e, t) {
|
|
2328
|
-
return
|
|
2347
|
+
return C("not implemented");
|
|
2329
2348
|
}
|
|
2330
2349
|
/** @internal */
|
|
2331
2350
|
_getReauthenticationResolver(e) {
|
|
2332
|
-
return
|
|
2351
|
+
return C("not implemented");
|
|
2333
2352
|
}
|
|
2334
2353
|
}
|
|
2335
2354
|
/**
|
|
@@ -2348,8 +2367,8 @@ class zt {
|
|
|
2348
2367
|
* See the License for the specific language governing permissions and
|
|
2349
2368
|
* limitations under the License.
|
|
2350
2369
|
*/
|
|
2351
|
-
async function
|
|
2352
|
-
return
|
|
2370
|
+
async function Y(n, e) {
|
|
2371
|
+
return Lt(n, "POST", "/v1/accounts:signInWithIdp", Te(n, e));
|
|
2353
2372
|
}
|
|
2354
2373
|
/**
|
|
2355
2374
|
* @license
|
|
@@ -2367,15 +2386,15 @@ async function J(n, e) {
|
|
|
2367
2386
|
* See the License for the specific language governing permissions and
|
|
2368
2387
|
* limitations under the License.
|
|
2369
2388
|
*/
|
|
2370
|
-
const
|
|
2371
|
-
class
|
|
2389
|
+
const Wi = "http://localhost";
|
|
2390
|
+
class B extends qt {
|
|
2372
2391
|
constructor() {
|
|
2373
2392
|
super(...arguments), this.pendingToken = null;
|
|
2374
2393
|
}
|
|
2375
2394
|
/** @internal */
|
|
2376
2395
|
static _fromParams(e) {
|
|
2377
|
-
const t = new
|
|
2378
|
-
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) :
|
|
2396
|
+
const t = new B(e.providerId, e.signInMethod);
|
|
2397
|
+
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) : L(
|
|
2379
2398
|
"argument-error"
|
|
2380
2399
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2381
2400
|
), t;
|
|
@@ -2405,34 +2424,34 @@ class W extends zt {
|
|
|
2405
2424
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2406
2425
|
if (!i || !r)
|
|
2407
2426
|
return null;
|
|
2408
|
-
const o = new
|
|
2427
|
+
const o = new B(i, r);
|
|
2409
2428
|
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;
|
|
2410
2429
|
}
|
|
2411
2430
|
/** @internal */
|
|
2412
2431
|
_getIdTokenResponse(e) {
|
|
2413
2432
|
const t = this.buildRequest();
|
|
2414
|
-
return
|
|
2433
|
+
return Y(e, t);
|
|
2415
2434
|
}
|
|
2416
2435
|
/** @internal */
|
|
2417
2436
|
_linkToIdToken(e, t) {
|
|
2418
2437
|
const i = this.buildRequest();
|
|
2419
|
-
return i.idToken = t,
|
|
2438
|
+
return i.idToken = t, Y(e, i);
|
|
2420
2439
|
}
|
|
2421
2440
|
/** @internal */
|
|
2422
2441
|
_getReauthenticationResolver(e) {
|
|
2423
2442
|
const t = this.buildRequest();
|
|
2424
|
-
return t.autoCreate = !1,
|
|
2443
|
+
return t.autoCreate = !1, Y(e, t);
|
|
2425
2444
|
}
|
|
2426
2445
|
buildRequest() {
|
|
2427
2446
|
const e = {
|
|
2428
|
-
requestUri:
|
|
2447
|
+
requestUri: Wi,
|
|
2429
2448
|
returnSecureToken: !0
|
|
2430
2449
|
};
|
|
2431
2450
|
if (this.pendingToken)
|
|
2432
2451
|
e.pendingToken = this.pendingToken;
|
|
2433
2452
|
else {
|
|
2434
2453
|
const t = {};
|
|
2435
|
-
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 =
|
|
2454
|
+
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 = oe(t);
|
|
2436
2455
|
}
|
|
2437
2456
|
return e;
|
|
2438
2457
|
}
|
|
@@ -2453,7 +2472,7 @@ class W extends zt {
|
|
|
2453
2472
|
* See the License for the specific language governing permissions and
|
|
2454
2473
|
* limitations under the License.
|
|
2455
2474
|
*/
|
|
2456
|
-
class
|
|
2475
|
+
class Kt {
|
|
2457
2476
|
/**
|
|
2458
2477
|
* Constructor for generic OAuth providers.
|
|
2459
2478
|
*
|
|
@@ -2506,7 +2525,7 @@ class qt {
|
|
|
2506
2525
|
* See the License for the specific language governing permissions and
|
|
2507
2526
|
* limitations under the License.
|
|
2508
2527
|
*/
|
|
2509
|
-
class
|
|
2528
|
+
class ce extends Kt {
|
|
2510
2529
|
constructor() {
|
|
2511
2530
|
super(...arguments), this.scopes = [];
|
|
2512
2531
|
}
|
|
@@ -2541,7 +2560,7 @@ class ae extends qt {
|
|
|
2541
2560
|
* See the License for the specific language governing permissions and
|
|
2542
2561
|
* limitations under the License.
|
|
2543
2562
|
*/
|
|
2544
|
-
class
|
|
2563
|
+
class x extends ce {
|
|
2545
2564
|
constructor() {
|
|
2546
2565
|
super(
|
|
2547
2566
|
"facebook.com"
|
|
@@ -2561,9 +2580,9 @@ class D extends ae {
|
|
|
2561
2580
|
* @param accessToken - Facebook access token.
|
|
2562
2581
|
*/
|
|
2563
2582
|
static credential(e) {
|
|
2564
|
-
return
|
|
2565
|
-
providerId:
|
|
2566
|
-
signInMethod:
|
|
2583
|
+
return B._fromParams({
|
|
2584
|
+
providerId: x.PROVIDER_ID,
|
|
2585
|
+
signInMethod: x.FACEBOOK_SIGN_IN_METHOD,
|
|
2567
2586
|
accessToken: e
|
|
2568
2587
|
});
|
|
2569
2588
|
}
|
|
@@ -2573,7 +2592,7 @@ class D extends ae {
|
|
|
2573
2592
|
* @param userCredential - The user credential.
|
|
2574
2593
|
*/
|
|
2575
2594
|
static credentialFromResult(e) {
|
|
2576
|
-
return
|
|
2595
|
+
return x.credentialFromTaggedObject(e);
|
|
2577
2596
|
}
|
|
2578
2597
|
/**
|
|
2579
2598
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2582,20 +2601,20 @@ class D extends ae {
|
|
|
2582
2601
|
* @param userCredential - The user credential.
|
|
2583
2602
|
*/
|
|
2584
2603
|
static credentialFromError(e) {
|
|
2585
|
-
return
|
|
2604
|
+
return x.credentialFromTaggedObject(e.customData || {});
|
|
2586
2605
|
}
|
|
2587
2606
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2588
2607
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2589
2608
|
return null;
|
|
2590
2609
|
try {
|
|
2591
|
-
return
|
|
2610
|
+
return x.credential(e.oauthAccessToken);
|
|
2592
2611
|
} catch {
|
|
2593
2612
|
return null;
|
|
2594
2613
|
}
|
|
2595
2614
|
}
|
|
2596
2615
|
}
|
|
2597
|
-
|
|
2598
|
-
|
|
2616
|
+
x.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
2617
|
+
x.PROVIDER_ID = "facebook.com";
|
|
2599
2618
|
/**
|
|
2600
2619
|
* @license
|
|
2601
2620
|
* Copyright 2020 Google LLC
|
|
@@ -2612,7 +2631,7 @@ D.PROVIDER_ID = "facebook.com";
|
|
|
2612
2631
|
* See the License for the specific language governing permissions and
|
|
2613
2632
|
* limitations under the License.
|
|
2614
2633
|
*/
|
|
2615
|
-
class
|
|
2634
|
+
class F extends ce {
|
|
2616
2635
|
constructor() {
|
|
2617
2636
|
super(
|
|
2618
2637
|
"google.com"
|
|
@@ -2633,9 +2652,9 @@ class x extends ae {
|
|
|
2633
2652
|
* @param accessToken - Google access token.
|
|
2634
2653
|
*/
|
|
2635
2654
|
static credential(e, t) {
|
|
2636
|
-
return
|
|
2637
|
-
providerId:
|
|
2638
|
-
signInMethod:
|
|
2655
|
+
return B._fromParams({
|
|
2656
|
+
providerId: F.PROVIDER_ID,
|
|
2657
|
+
signInMethod: F.GOOGLE_SIGN_IN_METHOD,
|
|
2639
2658
|
idToken: e,
|
|
2640
2659
|
accessToken: t
|
|
2641
2660
|
});
|
|
@@ -2646,7 +2665,7 @@ class x extends ae {
|
|
|
2646
2665
|
* @param userCredential - The user credential.
|
|
2647
2666
|
*/
|
|
2648
2667
|
static credentialFromResult(e) {
|
|
2649
|
-
return
|
|
2668
|
+
return F.credentialFromTaggedObject(e);
|
|
2650
2669
|
}
|
|
2651
2670
|
/**
|
|
2652
2671
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2655,7 +2674,7 @@ class x extends ae {
|
|
|
2655
2674
|
* @param userCredential - The user credential.
|
|
2656
2675
|
*/
|
|
2657
2676
|
static credentialFromError(e) {
|
|
2658
|
-
return
|
|
2677
|
+
return F.credentialFromTaggedObject(e.customData || {});
|
|
2659
2678
|
}
|
|
2660
2679
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2661
2680
|
if (!e)
|
|
@@ -2664,14 +2683,14 @@ class x extends ae {
|
|
|
2664
2683
|
if (!t && !i)
|
|
2665
2684
|
return null;
|
|
2666
2685
|
try {
|
|
2667
|
-
return
|
|
2686
|
+
return F.credential(t, i);
|
|
2668
2687
|
} catch {
|
|
2669
2688
|
return null;
|
|
2670
2689
|
}
|
|
2671
2690
|
}
|
|
2672
2691
|
}
|
|
2673
|
-
|
|
2674
|
-
|
|
2692
|
+
F.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
2693
|
+
F.PROVIDER_ID = "google.com";
|
|
2675
2694
|
/**
|
|
2676
2695
|
* @license
|
|
2677
2696
|
* Copyright 2020 Google LLC
|
|
@@ -2688,7 +2707,7 @@ x.PROVIDER_ID = "google.com";
|
|
|
2688
2707
|
* See the License for the specific language governing permissions and
|
|
2689
2708
|
* limitations under the License.
|
|
2690
2709
|
*/
|
|
2691
|
-
class
|
|
2710
|
+
class V extends ce {
|
|
2692
2711
|
constructor() {
|
|
2693
2712
|
super(
|
|
2694
2713
|
"github.com"
|
|
@@ -2701,9 +2720,9 @@ class F extends ae {
|
|
|
2701
2720
|
* @param accessToken - Github access token.
|
|
2702
2721
|
*/
|
|
2703
2722
|
static credential(e) {
|
|
2704
|
-
return
|
|
2705
|
-
providerId:
|
|
2706
|
-
signInMethod:
|
|
2723
|
+
return B._fromParams({
|
|
2724
|
+
providerId: V.PROVIDER_ID,
|
|
2725
|
+
signInMethod: V.GITHUB_SIGN_IN_METHOD,
|
|
2707
2726
|
accessToken: e
|
|
2708
2727
|
});
|
|
2709
2728
|
}
|
|
@@ -2713,7 +2732,7 @@ class F extends ae {
|
|
|
2713
2732
|
* @param userCredential - The user credential.
|
|
2714
2733
|
*/
|
|
2715
2734
|
static credentialFromResult(e) {
|
|
2716
|
-
return
|
|
2735
|
+
return V.credentialFromTaggedObject(e);
|
|
2717
2736
|
}
|
|
2718
2737
|
/**
|
|
2719
2738
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2722,20 +2741,20 @@ class F extends ae {
|
|
|
2722
2741
|
* @param userCredential - The user credential.
|
|
2723
2742
|
*/
|
|
2724
2743
|
static credentialFromError(e) {
|
|
2725
|
-
return
|
|
2744
|
+
return V.credentialFromTaggedObject(e.customData || {});
|
|
2726
2745
|
}
|
|
2727
2746
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2728
2747
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2729
2748
|
return null;
|
|
2730
2749
|
try {
|
|
2731
|
-
return
|
|
2750
|
+
return V.credential(e.oauthAccessToken);
|
|
2732
2751
|
} catch {
|
|
2733
2752
|
return null;
|
|
2734
2753
|
}
|
|
2735
2754
|
}
|
|
2736
2755
|
}
|
|
2737
|
-
|
|
2738
|
-
|
|
2756
|
+
V.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
2757
|
+
V.PROVIDER_ID = "github.com";
|
|
2739
2758
|
/**
|
|
2740
2759
|
* @license
|
|
2741
2760
|
* Copyright 2020 Google LLC
|
|
@@ -2752,7 +2771,7 @@ F.PROVIDER_ID = "github.com";
|
|
|
2752
2771
|
* See the License for the specific language governing permissions and
|
|
2753
2772
|
* limitations under the License.
|
|
2754
2773
|
*/
|
|
2755
|
-
class
|
|
2774
|
+
class $ extends ce {
|
|
2756
2775
|
constructor() {
|
|
2757
2776
|
super(
|
|
2758
2777
|
"twitter.com"
|
|
@@ -2766,9 +2785,9 @@ class V extends ae {
|
|
|
2766
2785
|
* @param secret - Twitter secret.
|
|
2767
2786
|
*/
|
|
2768
2787
|
static credential(e, t) {
|
|
2769
|
-
return
|
|
2770
|
-
providerId:
|
|
2771
|
-
signInMethod:
|
|
2788
|
+
return B._fromParams({
|
|
2789
|
+
providerId: $.PROVIDER_ID,
|
|
2790
|
+
signInMethod: $.TWITTER_SIGN_IN_METHOD,
|
|
2772
2791
|
oauthToken: e,
|
|
2773
2792
|
oauthTokenSecret: t
|
|
2774
2793
|
});
|
|
@@ -2779,7 +2798,7 @@ class V extends ae {
|
|
|
2779
2798
|
* @param userCredential - The user credential.
|
|
2780
2799
|
*/
|
|
2781
2800
|
static credentialFromResult(e) {
|
|
2782
|
-
return
|
|
2801
|
+
return $.credentialFromTaggedObject(e);
|
|
2783
2802
|
}
|
|
2784
2803
|
/**
|
|
2785
2804
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2788,7 +2807,7 @@ class V extends ae {
|
|
|
2788
2807
|
* @param userCredential - The user credential.
|
|
2789
2808
|
*/
|
|
2790
2809
|
static credentialFromError(e) {
|
|
2791
|
-
return
|
|
2810
|
+
return $.credentialFromTaggedObject(e.customData || {});
|
|
2792
2811
|
}
|
|
2793
2812
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2794
2813
|
if (!e)
|
|
@@ -2797,14 +2816,14 @@ class V extends ae {
|
|
|
2797
2816
|
if (!t || !i)
|
|
2798
2817
|
return null;
|
|
2799
2818
|
try {
|
|
2800
|
-
return
|
|
2819
|
+
return $.credential(t, i);
|
|
2801
2820
|
} catch {
|
|
2802
2821
|
return null;
|
|
2803
2822
|
}
|
|
2804
2823
|
}
|
|
2805
2824
|
}
|
|
2806
|
-
|
|
2807
|
-
|
|
2825
|
+
$.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
2826
|
+
$.PROVIDER_ID = "twitter.com";
|
|
2808
2827
|
/**
|
|
2809
2828
|
* @license
|
|
2810
2829
|
* Copyright 2020 Google LLC
|
|
@@ -2821,13 +2840,13 @@ V.PROVIDER_ID = "twitter.com";
|
|
|
2821
2840
|
* See the License for the specific language governing permissions and
|
|
2822
2841
|
* limitations under the License.
|
|
2823
2842
|
*/
|
|
2824
|
-
class
|
|
2843
|
+
class G {
|
|
2825
2844
|
constructor(e) {
|
|
2826
2845
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2827
2846
|
}
|
|
2828
2847
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2829
|
-
const s = await
|
|
2830
|
-
return new
|
|
2848
|
+
const s = await N._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2849
|
+
return new G({
|
|
2831
2850
|
user: s,
|
|
2832
2851
|
providerId: o,
|
|
2833
2852
|
_tokenResponse: i,
|
|
@@ -2841,7 +2860,7 @@ class B {
|
|
|
2841
2860
|
!0
|
|
2842
2861
|
);
|
|
2843
2862
|
const r = lt(i);
|
|
2844
|
-
return new
|
|
2863
|
+
return new G({
|
|
2845
2864
|
user: e,
|
|
2846
2865
|
providerId: r,
|
|
2847
2866
|
_tokenResponse: i,
|
|
@@ -2882,14 +2901,14 @@ class Ie extends Ve {
|
|
|
2882
2901
|
return new Ie(e, t, i, r);
|
|
2883
2902
|
}
|
|
2884
2903
|
}
|
|
2885
|
-
function
|
|
2904
|
+
function Jt(n, e, t, i) {
|
|
2886
2905
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2887
2906
|
throw s.code === "auth/multi-factor-auth-required" ? Ie._fromErrorAndOperation(n, s, e, i) : s;
|
|
2888
2907
|
});
|
|
2889
2908
|
}
|
|
2890
|
-
async function
|
|
2891
|
-
const i = await
|
|
2892
|
-
return
|
|
2909
|
+
async function ji(n, e, t = !1) {
|
|
2910
|
+
const i = await re(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2911
|
+
return G._forOperation(n, "link", i);
|
|
2893
2912
|
}
|
|
2894
2913
|
/**
|
|
2895
2914
|
* @license
|
|
@@ -2907,20 +2926,20 @@ async function $i(n, e, t = !1) {
|
|
|
2907
2926
|
* See the License for the specific language governing permissions and
|
|
2908
2927
|
* limitations under the License.
|
|
2909
2928
|
*/
|
|
2910
|
-
async function
|
|
2929
|
+
async function Bi(n, e, t = !1) {
|
|
2911
2930
|
const { auth: i } = n;
|
|
2912
|
-
if (
|
|
2913
|
-
return Promise.reject(
|
|
2931
|
+
if (P(i.app))
|
|
2932
|
+
return Promise.reject(H(i));
|
|
2914
2933
|
const r = "reauthenticate";
|
|
2915
2934
|
try {
|
|
2916
|
-
const s = await
|
|
2935
|
+
const s = await re(n, Jt(i, r, e, n), t);
|
|
2917
2936
|
u(
|
|
2918
2937
|
s.idToken,
|
|
2919
2938
|
i,
|
|
2920
2939
|
"internal-error"
|
|
2921
2940
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2922
2941
|
);
|
|
2923
|
-
const o =
|
|
2942
|
+
const o = je(s.idToken);
|
|
2924
2943
|
u(
|
|
2925
2944
|
o,
|
|
2926
2945
|
i,
|
|
@@ -2933,9 +2952,9 @@ async function Hi(n, e, t = !1) {
|
|
|
2933
2952
|
i,
|
|
2934
2953
|
"user-mismatch"
|
|
2935
2954
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2936
|
-
),
|
|
2955
|
+
), G._forOperation(n, r, s);
|
|
2937
2956
|
} catch (s) {
|
|
2938
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2957
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && L(
|
|
2939
2958
|
i,
|
|
2940
2959
|
"user-mismatch"
|
|
2941
2960
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2958,10 +2977,10 @@ async function Hi(n, e, t = !1) {
|
|
|
2958
2977
|
* See the License for the specific language governing permissions and
|
|
2959
2978
|
* limitations under the License.
|
|
2960
2979
|
*/
|
|
2961
|
-
async function
|
|
2962
|
-
if (
|
|
2963
|
-
return Promise.reject(
|
|
2964
|
-
const i = "signIn", r = await
|
|
2980
|
+
async function Gi(n, e, t = !1) {
|
|
2981
|
+
if (P(n.app))
|
|
2982
|
+
return Promise.reject(H(n));
|
|
2983
|
+
const i = "signIn", r = await Jt(n, i, e), s = await G._fromIdTokenResponse(n, i, r);
|
|
2965
2984
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2966
2985
|
}
|
|
2967
2986
|
/**
|
|
@@ -2980,8 +2999,8 @@ async function ji(n, e, t = !1) {
|
|
|
2980
2999
|
* See the License for the specific language governing permissions and
|
|
2981
3000
|
* limitations under the License.
|
|
2982
3001
|
*/
|
|
2983
|
-
async function
|
|
2984
|
-
return
|
|
3002
|
+
async function zi(n, e) {
|
|
3003
|
+
return Lt(n, "POST", "/v1/accounts:signInWithCustomToken", Te(n, e));
|
|
2985
3004
|
}
|
|
2986
3005
|
/**
|
|
2987
3006
|
* @license
|
|
@@ -2999,20 +3018,20 @@ async function Wi(n, e) {
|
|
|
2999
3018
|
* See the License for the specific language governing permissions and
|
|
3000
3019
|
* limitations under the License.
|
|
3001
3020
|
*/
|
|
3002
|
-
async function
|
|
3003
|
-
if (
|
|
3004
|
-
return Promise.reject(
|
|
3005
|
-
const t = be(n), i = await
|
|
3021
|
+
async function qi(n, e) {
|
|
3022
|
+
if (P(n.app))
|
|
3023
|
+
return Promise.reject(H(n));
|
|
3024
|
+
const t = be(n), i = await zi(t, {
|
|
3006
3025
|
token: e,
|
|
3007
3026
|
returnSecureToken: !0
|
|
3008
|
-
}), r = await
|
|
3027
|
+
}), r = await G._fromIdTokenResponse(t, "signIn", i);
|
|
3009
3028
|
return await t._updateCurrentUser(r.user), r;
|
|
3010
3029
|
}
|
|
3011
|
-
function
|
|
3012
|
-
return
|
|
3030
|
+
function Ki(n, e, t, i) {
|
|
3031
|
+
return Q(n).onIdTokenChanged(e, t, i);
|
|
3013
3032
|
}
|
|
3014
|
-
function
|
|
3015
|
-
return
|
|
3033
|
+
function Ji(n, e, t) {
|
|
3034
|
+
return Q(n).beforeAuthStateChanged(e, t);
|
|
3016
3035
|
}
|
|
3017
3036
|
const ye = "__sak";
|
|
3018
3037
|
/**
|
|
@@ -3031,7 +3050,7 @@ const ye = "__sak";
|
|
|
3031
3050
|
* See the License for the specific language governing permissions and
|
|
3032
3051
|
* limitations under the License.
|
|
3033
3052
|
*/
|
|
3034
|
-
class
|
|
3053
|
+
class Yt {
|
|
3035
3054
|
constructor(e, t) {
|
|
3036
3055
|
this.storageRetriever = e, this.type = t;
|
|
3037
3056
|
}
|
|
@@ -3072,18 +3091,18 @@ class Jt {
|
|
|
3072
3091
|
* See the License for the specific language governing permissions and
|
|
3073
3092
|
* limitations under the License.
|
|
3074
3093
|
*/
|
|
3075
|
-
function
|
|
3076
|
-
const n =
|
|
3094
|
+
function Yi() {
|
|
3095
|
+
const n = k();
|
|
3077
3096
|
return Be(n) || ke(n);
|
|
3078
3097
|
}
|
|
3079
|
-
const
|
|
3080
|
-
class
|
|
3098
|
+
const Xi = 1e3, Qi = 10;
|
|
3099
|
+
class Xt extends Yt {
|
|
3081
3100
|
constructor() {
|
|
3082
3101
|
super(
|
|
3083
3102
|
() => window.localStorage,
|
|
3084
3103
|
"LOCAL"
|
|
3085
3104
|
/* PersistenceType.LOCAL */
|
|
3086
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
3105
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = Yi() && Ri(), this.fallbackToPolling = Bt(), this._shouldAllowMigration = !0;
|
|
3087
3106
|
}
|
|
3088
3107
|
forAllChangedKeys(e) {
|
|
3089
3108
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -3110,7 +3129,7 @@ class Yt extends Jt {
|
|
|
3110
3129
|
const o = this.storage.getItem(i);
|
|
3111
3130
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
3112
3131
|
}, s = this.storage.getItem(i);
|
|
3113
|
-
|
|
3132
|
+
Si() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Qi) : r();
|
|
3114
3133
|
}
|
|
3115
3134
|
notifyListeners(e, t) {
|
|
3116
3135
|
this.localCache[e] = t;
|
|
@@ -3132,7 +3151,7 @@ class Yt extends Jt {
|
|
|
3132
3151
|
!0
|
|
3133
3152
|
);
|
|
3134
3153
|
});
|
|
3135
|
-
},
|
|
3154
|
+
}, Xi);
|
|
3136
3155
|
}
|
|
3137
3156
|
stopPolling() {
|
|
3138
3157
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3161,8 +3180,8 @@ class Yt extends Jt {
|
|
|
3161
3180
|
await super._remove(e), delete this.localCache[e];
|
|
3162
3181
|
}
|
|
3163
3182
|
}
|
|
3164
|
-
|
|
3165
|
-
const
|
|
3183
|
+
Xt.type = "LOCAL";
|
|
3184
|
+
const Zi = Xt;
|
|
3166
3185
|
/**
|
|
3167
3186
|
* @license
|
|
3168
3187
|
* Copyright 2020 Google LLC
|
|
@@ -3179,7 +3198,7 @@ const Yi = Yt;
|
|
|
3179
3198
|
* See the License for the specific language governing permissions and
|
|
3180
3199
|
* limitations under the License.
|
|
3181
3200
|
*/
|
|
3182
|
-
class
|
|
3201
|
+
class Qt extends Yt {
|
|
3183
3202
|
constructor() {
|
|
3184
3203
|
super(
|
|
3185
3204
|
() => window.sessionStorage,
|
|
@@ -3192,8 +3211,8 @@ class Xt extends Jt {
|
|
|
3192
3211
|
_removeListener(e, t) {
|
|
3193
3212
|
}
|
|
3194
3213
|
}
|
|
3195
|
-
|
|
3196
|
-
const
|
|
3214
|
+
Qt.type = "SESSION";
|
|
3215
|
+
const Zt = Qt;
|
|
3197
3216
|
/**
|
|
3198
3217
|
* @license
|
|
3199
3218
|
* Copyright 2019 Google LLC
|
|
@@ -3210,7 +3229,7 @@ const Qt = Xt;
|
|
|
3210
3229
|
* See the License for the specific language governing permissions and
|
|
3211
3230
|
* limitations under the License.
|
|
3212
3231
|
*/
|
|
3213
|
-
function
|
|
3232
|
+
function er(n) {
|
|
3214
3233
|
return Promise.all(n.map(async (e) => {
|
|
3215
3234
|
try {
|
|
3216
3235
|
return {
|
|
@@ -3280,7 +3299,7 @@ class Ee {
|
|
|
3280
3299
|
eventId: i,
|
|
3281
3300
|
eventType: r
|
|
3282
3301
|
});
|
|
3283
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3302
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await er(c);
|
|
3284
3303
|
t.ports[0].postMessage({
|
|
3285
3304
|
status: "done",
|
|
3286
3305
|
eventId: i,
|
|
@@ -3348,7 +3367,7 @@ function ze(n = "", e = 10) {
|
|
|
3348
3367
|
* See the License for the specific language governing permissions and
|
|
3349
3368
|
* limitations under the License.
|
|
3350
3369
|
*/
|
|
3351
|
-
class
|
|
3370
|
+
class tr {
|
|
3352
3371
|
constructor(e) {
|
|
3353
3372
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3354
3373
|
}
|
|
@@ -3384,7 +3403,7 @@ class Qi {
|
|
|
3384
3403
|
return new Promise((c, a) => {
|
|
3385
3404
|
const l = ze("", 20);
|
|
3386
3405
|
r.port1.start();
|
|
3387
|
-
const
|
|
3406
|
+
const h = setTimeout(() => {
|
|
3388
3407
|
a(new Error(
|
|
3389
3408
|
"unsupported_event"
|
|
3390
3409
|
/* _MessageError.UNSUPPORTED_EVENT */
|
|
@@ -3393,11 +3412,11 @@ class Qi {
|
|
|
3393
3412
|
o = {
|
|
3394
3413
|
messageChannel: r,
|
|
3395
3414
|
onMessage(m) {
|
|
3396
|
-
const
|
|
3397
|
-
if (
|
|
3398
|
-
switch (
|
|
3415
|
+
const v = m;
|
|
3416
|
+
if (v.data.eventId === l)
|
|
3417
|
+
switch (v.data.status) {
|
|
3399
3418
|
case "ack":
|
|
3400
|
-
clearTimeout(
|
|
3419
|
+
clearTimeout(h), s = setTimeout(
|
|
3401
3420
|
() => {
|
|
3402
3421
|
a(new Error(
|
|
3403
3422
|
"timeout"
|
|
@@ -3409,10 +3428,10 @@ class Qi {
|
|
|
3409
3428
|
);
|
|
3410
3429
|
break;
|
|
3411
3430
|
case "done":
|
|
3412
|
-
clearTimeout(s), c(
|
|
3431
|
+
clearTimeout(s), c(v.data.response);
|
|
3413
3432
|
break;
|
|
3414
3433
|
default:
|
|
3415
|
-
clearTimeout(
|
|
3434
|
+
clearTimeout(h), clearTimeout(s), a(new Error(
|
|
3416
3435
|
"invalid_response"
|
|
3417
3436
|
/* _MessageError.INVALID_RESPONSE */
|
|
3418
3437
|
));
|
|
@@ -3445,11 +3464,11 @@ class Qi {
|
|
|
3445
3464
|
* See the License for the specific language governing permissions and
|
|
3446
3465
|
* limitations under the License.
|
|
3447
3466
|
*/
|
|
3448
|
-
function
|
|
3467
|
+
function S() {
|
|
3449
3468
|
return window;
|
|
3450
3469
|
}
|
|
3451
|
-
function
|
|
3452
|
-
|
|
3470
|
+
function nr(n) {
|
|
3471
|
+
S().location.href = n;
|
|
3453
3472
|
}
|
|
3454
3473
|
/**
|
|
3455
3474
|
* @license
|
|
@@ -3467,10 +3486,10 @@ function Zi(n) {
|
|
|
3467
3486
|
* See the License for the specific language governing permissions and
|
|
3468
3487
|
* limitations under the License.
|
|
3469
3488
|
*/
|
|
3470
|
-
function
|
|
3471
|
-
return typeof
|
|
3489
|
+
function en() {
|
|
3490
|
+
return typeof S().WorkerGlobalScope < "u" && typeof S().importScripts == "function";
|
|
3472
3491
|
}
|
|
3473
|
-
async function
|
|
3492
|
+
async function ir() {
|
|
3474
3493
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3475
3494
|
return null;
|
|
3476
3495
|
try {
|
|
@@ -3479,12 +3498,12 @@ async function er() {
|
|
|
3479
3498
|
return null;
|
|
3480
3499
|
}
|
|
3481
3500
|
}
|
|
3482
|
-
function
|
|
3501
|
+
function rr() {
|
|
3483
3502
|
var n;
|
|
3484
3503
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3485
3504
|
}
|
|
3486
|
-
function
|
|
3487
|
-
return
|
|
3505
|
+
function sr() {
|
|
3506
|
+
return en() ? self : null;
|
|
3488
3507
|
}
|
|
3489
3508
|
/**
|
|
3490
3509
|
* @license
|
|
@@ -3502,8 +3521,8 @@ function nr() {
|
|
|
3502
3521
|
* See the License for the specific language governing permissions and
|
|
3503
3522
|
* limitations under the License.
|
|
3504
3523
|
*/
|
|
3505
|
-
const
|
|
3506
|
-
class
|
|
3524
|
+
const tn = "firebaseLocalStorageDb", or = 1, we = "firebaseLocalStorage", nn = "fbase_key";
|
|
3525
|
+
class le {
|
|
3507
3526
|
constructor(e) {
|
|
3508
3527
|
this.request = e;
|
|
3509
3528
|
}
|
|
@@ -3520,45 +3539,45 @@ class ce {
|
|
|
3520
3539
|
function Se(n, e) {
|
|
3521
3540
|
return n.transaction([we], e ? "readwrite" : "readonly").objectStore(we);
|
|
3522
3541
|
}
|
|
3523
|
-
function
|
|
3524
|
-
const n = indexedDB.deleteDatabase(
|
|
3525
|
-
return new
|
|
3542
|
+
function ar() {
|
|
3543
|
+
const n = indexedDB.deleteDatabase(tn);
|
|
3544
|
+
return new le(n).toPromise();
|
|
3526
3545
|
}
|
|
3527
3546
|
function De() {
|
|
3528
|
-
const n = indexedDB.open(
|
|
3547
|
+
const n = indexedDB.open(tn, or);
|
|
3529
3548
|
return new Promise((e, t) => {
|
|
3530
3549
|
n.addEventListener("error", () => {
|
|
3531
3550
|
t(n.error);
|
|
3532
3551
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3533
3552
|
const i = n.result;
|
|
3534
3553
|
try {
|
|
3535
|
-
i.createObjectStore(we, { keyPath:
|
|
3554
|
+
i.createObjectStore(we, { keyPath: nn });
|
|
3536
3555
|
} catch (r) {
|
|
3537
3556
|
t(r);
|
|
3538
3557
|
}
|
|
3539
3558
|
}), n.addEventListener("success", async () => {
|
|
3540
3559
|
const i = n.result;
|
|
3541
|
-
i.objectStoreNames.contains(we) ? e(i) : (i.close(), await
|
|
3560
|
+
i.objectStoreNames.contains(we) ? e(i) : (i.close(), await ar(), e(await De()));
|
|
3542
3561
|
});
|
|
3543
3562
|
});
|
|
3544
3563
|
}
|
|
3545
3564
|
async function ut(n, e, t) {
|
|
3546
3565
|
const i = Se(n, !0).put({
|
|
3547
|
-
[
|
|
3566
|
+
[nn]: e,
|
|
3548
3567
|
value: t
|
|
3549
3568
|
});
|
|
3550
|
-
return new
|
|
3569
|
+
return new le(i).toPromise();
|
|
3551
3570
|
}
|
|
3552
|
-
async function
|
|
3553
|
-
const t = Se(n, !1).get(e), i = await new
|
|
3571
|
+
async function cr(n, e) {
|
|
3572
|
+
const t = Se(n, !1).get(e), i = await new le(t).toPromise();
|
|
3554
3573
|
return i === void 0 ? null : i.value;
|
|
3555
3574
|
}
|
|
3556
3575
|
function dt(n, e) {
|
|
3557
3576
|
const t = Se(n, !0).delete(e);
|
|
3558
|
-
return new
|
|
3577
|
+
return new le(t).toPromise();
|
|
3559
3578
|
}
|
|
3560
|
-
const
|
|
3561
|
-
class
|
|
3579
|
+
const lr = 800, ur = 3;
|
|
3580
|
+
class rn {
|
|
3562
3581
|
constructor() {
|
|
3563
3582
|
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(() => {
|
|
3564
3583
|
}, () => {
|
|
@@ -3574,7 +3593,7 @@ class nn {
|
|
|
3574
3593
|
const i = await this._openDb();
|
|
3575
3594
|
return await e(i);
|
|
3576
3595
|
} catch (i) {
|
|
3577
|
-
if (t++ >
|
|
3596
|
+
if (t++ > ur)
|
|
3578
3597
|
throw i;
|
|
3579
3598
|
this.db && (this.db.close(), this.db = void 0);
|
|
3580
3599
|
}
|
|
@@ -3584,13 +3603,13 @@ class nn {
|
|
|
3584
3603
|
* postMessage interface to send these events to the worker ourselves.
|
|
3585
3604
|
*/
|
|
3586
3605
|
async initializeServiceWorkerMessaging() {
|
|
3587
|
-
return
|
|
3606
|
+
return en() ? this.initializeReceiver() : this.initializeSender();
|
|
3588
3607
|
}
|
|
3589
3608
|
/**
|
|
3590
3609
|
* As the worker we should listen to events from the main window.
|
|
3591
3610
|
*/
|
|
3592
3611
|
async initializeReceiver() {
|
|
3593
|
-
this.receiver = Ee._getInstance(
|
|
3612
|
+
this.receiver = Ee._getInstance(sr()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3594
3613
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3595
3614
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3596
3615
|
"keyChanged"
|
|
@@ -3606,9 +3625,9 @@ class nn {
|
|
|
3606
3625
|
*/
|
|
3607
3626
|
async initializeSender() {
|
|
3608
3627
|
var e, t;
|
|
3609
|
-
if (this.activeServiceWorker = await
|
|
3628
|
+
if (this.activeServiceWorker = await ir(), !this.activeServiceWorker)
|
|
3610
3629
|
return;
|
|
3611
|
-
this.sender = new
|
|
3630
|
+
this.sender = new tr(this.activeServiceWorker);
|
|
3612
3631
|
const i = await this.sender._send(
|
|
3613
3632
|
"ping",
|
|
3614
3633
|
{},
|
|
@@ -3630,7 +3649,7 @@ class nn {
|
|
|
3630
3649
|
* @param key - Storage key which changed.
|
|
3631
3650
|
*/
|
|
3632
3651
|
async notifyServiceWorker(e) {
|
|
3633
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3652
|
+
if (!(!this.sender || !this.activeServiceWorker || rr() !== this.activeServiceWorker))
|
|
3634
3653
|
try {
|
|
3635
3654
|
await this.sender._send(
|
|
3636
3655
|
"keyChanged",
|
|
@@ -3664,7 +3683,7 @@ class nn {
|
|
|
3664
3683
|
return this._withPendingWrite(async () => (await this._withRetries((i) => ut(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3665
3684
|
}
|
|
3666
3685
|
async _get(e) {
|
|
3667
|
-
const t = await this._withRetries((i) =>
|
|
3686
|
+
const t = await this._withRetries((i) => cr(i, e));
|
|
3668
3687
|
return this.localCache[e] = t, t;
|
|
3669
3688
|
}
|
|
3670
3689
|
async _remove(e) {
|
|
@@ -3673,7 +3692,7 @@ class nn {
|
|
|
3673
3692
|
async _poll() {
|
|
3674
3693
|
const e = await this._withRetries((r) => {
|
|
3675
3694
|
const s = Se(r, !1).getAll();
|
|
3676
|
-
return new
|
|
3695
|
+
return new le(s).toPromise();
|
|
3677
3696
|
});
|
|
3678
3697
|
if (!e)
|
|
3679
3698
|
return [];
|
|
@@ -3695,7 +3714,7 @@ class nn {
|
|
|
3695
3714
|
r(t);
|
|
3696
3715
|
}
|
|
3697
3716
|
startPolling() {
|
|
3698
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3717
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), lr);
|
|
3699
3718
|
}
|
|
3700
3719
|
stopPolling() {
|
|
3701
3720
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3707,9 +3726,9 @@ class nn {
|
|
|
3707
3726
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
|
3708
3727
|
}
|
|
3709
3728
|
}
|
|
3710
|
-
|
|
3711
|
-
const
|
|
3712
|
-
new
|
|
3729
|
+
rn.type = "LOCAL";
|
|
3730
|
+
const dr = rn;
|
|
3731
|
+
new ae(3e4, 6e4);
|
|
3713
3732
|
/**
|
|
3714
3733
|
* @license
|
|
3715
3734
|
* Copyright 2021 Google LLC
|
|
@@ -3726,8 +3745,8 @@ new oe(3e4, 6e4);
|
|
|
3726
3745
|
* See the License for the specific language governing permissions and
|
|
3727
3746
|
* limitations under the License.
|
|
3728
3747
|
*/
|
|
3729
|
-
function
|
|
3730
|
-
return e ?
|
|
3748
|
+
function hr(n, e) {
|
|
3749
|
+
return e ? O(e) : (u(
|
|
3731
3750
|
n._popupRedirectResolver,
|
|
3732
3751
|
n,
|
|
3733
3752
|
"argument-error"
|
|
@@ -3750,7 +3769,7 @@ function lr(n, e) {
|
|
|
3750
3769
|
* See the License for the specific language governing permissions and
|
|
3751
3770
|
* limitations under the License.
|
|
3752
3771
|
*/
|
|
3753
|
-
class qe extends
|
|
3772
|
+
class qe extends qt {
|
|
3754
3773
|
constructor(e) {
|
|
3755
3774
|
super(
|
|
3756
3775
|
"custom",
|
|
@@ -3759,13 +3778,13 @@ class qe extends zt {
|
|
|
3759
3778
|
), this.params = e;
|
|
3760
3779
|
}
|
|
3761
3780
|
_getIdTokenResponse(e) {
|
|
3762
|
-
return
|
|
3781
|
+
return Y(e, this._buildIdpRequest());
|
|
3763
3782
|
}
|
|
3764
3783
|
_linkToIdToken(e, t) {
|
|
3765
|
-
return
|
|
3784
|
+
return Y(e, this._buildIdpRequest(t));
|
|
3766
3785
|
}
|
|
3767
3786
|
_getReauthenticationResolver(e) {
|
|
3768
|
-
return
|
|
3787
|
+
return Y(e, this._buildIdpRequest());
|
|
3769
3788
|
}
|
|
3770
3789
|
_buildIdpRequest(e) {
|
|
3771
3790
|
const t = {
|
|
@@ -3780,26 +3799,26 @@ class qe extends zt {
|
|
|
3780
3799
|
return e && (t.idToken = e), t;
|
|
3781
3800
|
}
|
|
3782
3801
|
}
|
|
3783
|
-
function
|
|
3784
|
-
return
|
|
3802
|
+
function fr(n) {
|
|
3803
|
+
return Gi(n.auth, new qe(n), n.bypassAuthState);
|
|
3785
3804
|
}
|
|
3786
|
-
function
|
|
3805
|
+
function pr(n) {
|
|
3787
3806
|
const { auth: e, user: t } = n;
|
|
3788
3807
|
return u(
|
|
3789
3808
|
t,
|
|
3790
3809
|
e,
|
|
3791
3810
|
"internal-error"
|
|
3792
3811
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3793
|
-
),
|
|
3812
|
+
), Bi(t, new qe(n), n.bypassAuthState);
|
|
3794
3813
|
}
|
|
3795
|
-
async function
|
|
3814
|
+
async function mr(n) {
|
|
3796
3815
|
const { auth: e, user: t } = n;
|
|
3797
3816
|
return u(
|
|
3798
3817
|
t,
|
|
3799
3818
|
e,
|
|
3800
3819
|
"internal-error"
|
|
3801
3820
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3802
|
-
),
|
|
3821
|
+
), ji(t, new qe(n), n.bypassAuthState);
|
|
3803
3822
|
}
|
|
3804
3823
|
/**
|
|
3805
3824
|
* @license
|
|
@@ -3817,7 +3836,7 @@ async function hr(n) {
|
|
|
3817
3836
|
* See the License for the specific language governing permissions and
|
|
3818
3837
|
* limitations under the License.
|
|
3819
3838
|
*/
|
|
3820
|
-
class
|
|
3839
|
+
class sn {
|
|
3821
3840
|
constructor(e, t, i, r, s = !1) {
|
|
3822
3841
|
this.auth = e, this.resolver = i, this.user = r, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
|
3823
3842
|
}
|
|
@@ -3859,15 +3878,15 @@ class rn {
|
|
|
3859
3878
|
switch (e) {
|
|
3860
3879
|
case "signInViaPopup":
|
|
3861
3880
|
case "signInViaRedirect":
|
|
3862
|
-
return
|
|
3881
|
+
return fr;
|
|
3863
3882
|
case "linkViaPopup":
|
|
3864
3883
|
case "linkViaRedirect":
|
|
3865
|
-
return
|
|
3884
|
+
return mr;
|
|
3866
3885
|
case "reauthViaPopup":
|
|
3867
3886
|
case "reauthViaRedirect":
|
|
3868
|
-
return
|
|
3887
|
+
return pr;
|
|
3869
3888
|
default:
|
|
3870
|
-
|
|
3889
|
+
L(
|
|
3871
3890
|
this.auth,
|
|
3872
3891
|
"internal-error"
|
|
3873
3892
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3875,10 +3894,10 @@ class rn {
|
|
|
3875
3894
|
}
|
|
3876
3895
|
}
|
|
3877
3896
|
resolve(e) {
|
|
3878
|
-
|
|
3897
|
+
M(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3879
3898
|
}
|
|
3880
3899
|
reject(e) {
|
|
3881
|
-
|
|
3900
|
+
M(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3882
3901
|
}
|
|
3883
3902
|
unregisterAndCleanUp() {
|
|
3884
3903
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3900,8 +3919,8 @@ class rn {
|
|
|
3900
3919
|
* See the License for the specific language governing permissions and
|
|
3901
3920
|
* limitations under the License.
|
|
3902
3921
|
*/
|
|
3903
|
-
const
|
|
3904
|
-
class z extends
|
|
3922
|
+
const gr = new ae(2e3, 1e4);
|
|
3923
|
+
class z extends sn {
|
|
3905
3924
|
constructor(e, t, i, r, s) {
|
|
3906
3925
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, z.currentPopupAction && z.currentPopupAction.cancel(), z.currentPopupAction = this;
|
|
3907
3926
|
}
|
|
@@ -3915,7 +3934,7 @@ class z extends rn {
|
|
|
3915
3934
|
), e;
|
|
3916
3935
|
}
|
|
3917
3936
|
async onExecution() {
|
|
3918
|
-
|
|
3937
|
+
M(this.filter.length === 1, "Popup operations only handle one event");
|
|
3919
3938
|
const e = ze();
|
|
3920
3939
|
this.authWindow = await this.resolver._openPopup(
|
|
3921
3940
|
this.auth,
|
|
@@ -3926,7 +3945,7 @@ class z extends rn {
|
|
|
3926
3945
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3927
3946
|
this.reject(t);
|
|
3928
3947
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3929
|
-
t || this.reject(
|
|
3948
|
+
t || this.reject(E(
|
|
3930
3949
|
this.auth,
|
|
3931
3950
|
"web-storage-unsupported"
|
|
3932
3951
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3938,7 +3957,7 @@ class z extends rn {
|
|
|
3938
3957
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3939
3958
|
}
|
|
3940
3959
|
cancel() {
|
|
3941
|
-
this.reject(
|
|
3960
|
+
this.reject(E(
|
|
3942
3961
|
this.auth,
|
|
3943
3962
|
"cancelled-popup-request"
|
|
3944
3963
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
@@ -3953,7 +3972,7 @@ class z extends rn {
|
|
|
3953
3972
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3954
3973
|
this.pollId = window.setTimeout(
|
|
3955
3974
|
() => {
|
|
3956
|
-
this.pollId = null, this.reject(
|
|
3975
|
+
this.pollId = null, this.reject(E(
|
|
3957
3976
|
this.auth,
|
|
3958
3977
|
"popup-closed-by-user"
|
|
3959
3978
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3964,7 +3983,7 @@ class z extends rn {
|
|
|
3964
3983
|
);
|
|
3965
3984
|
return;
|
|
3966
3985
|
}
|
|
3967
|
-
this.pollId = window.setTimeout(e,
|
|
3986
|
+
this.pollId = window.setTimeout(e, gr.get());
|
|
3968
3987
|
};
|
|
3969
3988
|
e();
|
|
3970
3989
|
}
|
|
@@ -3986,8 +4005,8 @@ z.currentPopupAction = null;
|
|
|
3986
4005
|
* See the License for the specific language governing permissions and
|
|
3987
4006
|
* limitations under the License.
|
|
3988
4007
|
*/
|
|
3989
|
-
const
|
|
3990
|
-
class
|
|
4008
|
+
const _r = "pendingRedirect", fe = /* @__PURE__ */ new Map();
|
|
4009
|
+
class vr extends sn {
|
|
3991
4010
|
constructor(e, t, i = !1) {
|
|
3992
4011
|
super(e, [
|
|
3993
4012
|
"signInViaRedirect",
|
|
@@ -4002,17 +4021,17 @@ class mr extends rn {
|
|
|
4002
4021
|
* just return it.
|
|
4003
4022
|
*/
|
|
4004
4023
|
async execute() {
|
|
4005
|
-
let e =
|
|
4024
|
+
let e = fe.get(this.auth._key());
|
|
4006
4025
|
if (!e) {
|
|
4007
4026
|
try {
|
|
4008
|
-
const i = await
|
|
4027
|
+
const i = await Ir(this.resolver, this.auth) ? await super.execute() : null;
|
|
4009
4028
|
e = () => Promise.resolve(i);
|
|
4010
4029
|
} catch (t) {
|
|
4011
4030
|
e = () => Promise.reject(t);
|
|
4012
4031
|
}
|
|
4013
|
-
|
|
4032
|
+
fe.set(this.auth._key(), e);
|
|
4014
4033
|
}
|
|
4015
|
-
return this.bypassAuthState ||
|
|
4034
|
+
return this.bypassAuthState || fe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
4016
4035
|
}
|
|
4017
4036
|
async onAuthEvent(e) {
|
|
4018
4037
|
if (e.type === "signInViaRedirect")
|
|
@@ -4033,26 +4052,26 @@ class mr extends rn {
|
|
|
4033
4052
|
cleanUp() {
|
|
4034
4053
|
}
|
|
4035
4054
|
}
|
|
4036
|
-
async function
|
|
4037
|
-
const t =
|
|
4055
|
+
async function Ir(n, e) {
|
|
4056
|
+
const t = Tr(e), i = wr(n);
|
|
4038
4057
|
if (!await i._isAvailable())
|
|
4039
4058
|
return !1;
|
|
4040
4059
|
const r = await i._get(t) === "true";
|
|
4041
4060
|
return await i._remove(t), r;
|
|
4042
4061
|
}
|
|
4043
|
-
function
|
|
4044
|
-
|
|
4062
|
+
function yr(n, e) {
|
|
4063
|
+
fe.set(n._key(), e);
|
|
4045
4064
|
}
|
|
4046
|
-
function
|
|
4047
|
-
return
|
|
4065
|
+
function wr(n) {
|
|
4066
|
+
return O(n._redirectPersistence);
|
|
4048
4067
|
}
|
|
4049
|
-
function
|
|
4050
|
-
return
|
|
4068
|
+
function Tr(n) {
|
|
4069
|
+
return he(_r, n.config.apiKey, n.name);
|
|
4051
4070
|
}
|
|
4052
|
-
async function
|
|
4053
|
-
if (
|
|
4054
|
-
return Promise.reject(
|
|
4055
|
-
const i = be(n), r =
|
|
4071
|
+
async function kr(n, e, t = !1) {
|
|
4072
|
+
if (P(n.app))
|
|
4073
|
+
return Promise.reject(H(n));
|
|
4074
|
+
const i = be(n), r = hr(i, e), o = await new vr(i, r, t).execute();
|
|
4056
4075
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
4057
4076
|
}
|
|
4058
4077
|
/**
|
|
@@ -4071,8 +4090,8 @@ async function yr(n, e, t = !1) {
|
|
|
4071
4090
|
* See the License for the specific language governing permissions and
|
|
4072
4091
|
* limitations under the License.
|
|
4073
4092
|
*/
|
|
4074
|
-
const
|
|
4075
|
-
class
|
|
4093
|
+
const br = 10 * 60 * 1e3;
|
|
4094
|
+
class Er {
|
|
4076
4095
|
constructor(e) {
|
|
4077
4096
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
4078
4097
|
}
|
|
@@ -4088,13 +4107,13 @@ class Tr {
|
|
|
4088
4107
|
let t = !1;
|
|
4089
4108
|
return this.consumers.forEach((i) => {
|
|
4090
4109
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
4091
|
-
}), this.hasHandledPotentialRedirect || !
|
|
4110
|
+
}), this.hasHandledPotentialRedirect || !Sr(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
4092
4111
|
}
|
|
4093
4112
|
sendToConsumer(e, t) {
|
|
4094
4113
|
var i;
|
|
4095
|
-
if (e.error && !
|
|
4114
|
+
if (e.error && !on(e)) {
|
|
4096
4115
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
4097
|
-
t.onError(
|
|
4116
|
+
t.onError(E(this.auth, r));
|
|
4098
4117
|
} else
|
|
4099
4118
|
t.onAuthEvent(e);
|
|
4100
4119
|
}
|
|
@@ -4103,7 +4122,7 @@ class Tr {
|
|
|
4103
4122
|
return t.filter.includes(e.type) && i;
|
|
4104
4123
|
}
|
|
4105
4124
|
hasEventBeenHandled(e) {
|
|
4106
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
4125
|
+
return Date.now() - this.lastProcessedEventTime >= br && this.cachedEventUids.clear(), this.cachedEventUids.has(ht(e));
|
|
4107
4126
|
}
|
|
4108
4127
|
saveEventToCache(e) {
|
|
4109
4128
|
this.cachedEventUids.add(ht(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -4112,17 +4131,17 @@ class Tr {
|
|
|
4112
4131
|
function ht(n) {
|
|
4113
4132
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
4114
4133
|
}
|
|
4115
|
-
function
|
|
4134
|
+
function on({ type: n, error: e }) {
|
|
4116
4135
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
4117
4136
|
}
|
|
4118
|
-
function
|
|
4137
|
+
function Sr(n) {
|
|
4119
4138
|
switch (n.type) {
|
|
4120
4139
|
case "signInViaRedirect":
|
|
4121
4140
|
case "linkViaRedirect":
|
|
4122
4141
|
case "reauthViaRedirect":
|
|
4123
4142
|
return !0;
|
|
4124
4143
|
case "unknown":
|
|
4125
|
-
return
|
|
4144
|
+
return on(n);
|
|
4126
4145
|
default:
|
|
4127
4146
|
return !1;
|
|
4128
4147
|
}
|
|
@@ -4143,8 +4162,8 @@ function kr(n) {
|
|
|
4143
4162
|
* See the License for the specific language governing permissions and
|
|
4144
4163
|
* limitations under the License.
|
|
4145
4164
|
*/
|
|
4146
|
-
async function
|
|
4147
|
-
return
|
|
4165
|
+
async function Rr(n, e = {}) {
|
|
4166
|
+
return Z(n, "GET", "/v1/projects", e);
|
|
4148
4167
|
}
|
|
4149
4168
|
/**
|
|
4150
4169
|
* @license
|
|
@@ -4162,32 +4181,32 @@ async function br(n, e = {}) {
|
|
|
4162
4181
|
* See the License for the specific language governing permissions and
|
|
4163
4182
|
* limitations under the License.
|
|
4164
4183
|
*/
|
|
4165
|
-
const
|
|
4166
|
-
async function
|
|
4184
|
+
const Ar = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Pr = /^https?/;
|
|
4185
|
+
async function Cr(n) {
|
|
4167
4186
|
if (n.config.emulator)
|
|
4168
4187
|
return;
|
|
4169
|
-
const { authorizedDomains: e } = await
|
|
4188
|
+
const { authorizedDomains: e } = await Rr(n);
|
|
4170
4189
|
for (const t of e)
|
|
4171
4190
|
try {
|
|
4172
|
-
if (
|
|
4191
|
+
if (Nr(t))
|
|
4173
4192
|
return;
|
|
4174
4193
|
} catch {
|
|
4175
4194
|
}
|
|
4176
|
-
|
|
4195
|
+
L(
|
|
4177
4196
|
n,
|
|
4178
4197
|
"unauthorized-domain"
|
|
4179
4198
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4180
4199
|
);
|
|
4181
4200
|
}
|
|
4182
|
-
function
|
|
4201
|
+
function Nr(n) {
|
|
4183
4202
|
const e = Me(), { protocol: t, hostname: i } = new URL(e);
|
|
4184
4203
|
if (n.startsWith("chrome-extension://")) {
|
|
4185
4204
|
const o = new URL(n);
|
|
4186
4205
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4187
4206
|
}
|
|
4188
|
-
if (!
|
|
4207
|
+
if (!Pr.test(t))
|
|
4189
4208
|
return !1;
|
|
4190
|
-
if (
|
|
4209
|
+
if (Ar.test(n))
|
|
4191
4210
|
return i === n;
|
|
4192
4211
|
const r = n.replace(/\./g, "\\.");
|
|
4193
4212
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4208,9 +4227,9 @@ function Ar(n) {
|
|
|
4208
4227
|
* See the License for the specific language governing permissions and
|
|
4209
4228
|
* limitations under the License.
|
|
4210
4229
|
*/
|
|
4211
|
-
const
|
|
4230
|
+
const Or = new ae(3e4, 6e4);
|
|
4212
4231
|
function ft() {
|
|
4213
|
-
const n =
|
|
4232
|
+
const n = S().___jsl;
|
|
4214
4233
|
if (n != null && n.H) {
|
|
4215
4234
|
for (const e of Object.keys(n.H))
|
|
4216
4235
|
if (n.H[e].r = n.H[e].r || [], n.H[e].L = n.H[e].L || [], n.H[e].r = [...n.H[e].L], n.CP)
|
|
@@ -4218,7 +4237,7 @@ function ft() {
|
|
|
4218
4237
|
n.CP[t] = null;
|
|
4219
4238
|
}
|
|
4220
4239
|
}
|
|
4221
|
-
function
|
|
4240
|
+
function Lr(n) {
|
|
4222
4241
|
return new Promise((e, t) => {
|
|
4223
4242
|
var i, r, s;
|
|
4224
4243
|
function o() {
|
|
@@ -4227,36 +4246,36 @@ function Cr(n) {
|
|
|
4227
4246
|
e(gapi.iframes.getContext());
|
|
4228
4247
|
},
|
|
4229
4248
|
ontimeout: () => {
|
|
4230
|
-
ft(), t(
|
|
4249
|
+
ft(), t(E(
|
|
4231
4250
|
n,
|
|
4232
4251
|
"network-request-failed"
|
|
4233
4252
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4234
4253
|
));
|
|
4235
4254
|
},
|
|
4236
|
-
timeout:
|
|
4255
|
+
timeout: Or.get()
|
|
4237
4256
|
});
|
|
4238
4257
|
}
|
|
4239
|
-
if (!((r = (i =
|
|
4258
|
+
if (!((r = (i = S().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4240
4259
|
e(gapi.iframes.getContext());
|
|
4241
|
-
else if (!((s =
|
|
4260
|
+
else if (!((s = S().gapi) === null || s === void 0) && s.load)
|
|
4242
4261
|
o();
|
|
4243
4262
|
else {
|
|
4244
|
-
const c =
|
|
4245
|
-
return
|
|
4246
|
-
gapi.load ? o() : t(
|
|
4263
|
+
const c = Di("iframefcb");
|
|
4264
|
+
return S()[c] = () => {
|
|
4265
|
+
gapi.load ? o() : t(E(
|
|
4247
4266
|
n,
|
|
4248
4267
|
"network-request-failed"
|
|
4249
4268
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4250
4269
|
));
|
|
4251
|
-
},
|
|
4270
|
+
}, Mi(`${Ui()}?onload=${c}`).catch((a) => t(a));
|
|
4252
4271
|
}
|
|
4253
4272
|
}).catch((e) => {
|
|
4254
|
-
throw
|
|
4273
|
+
throw pe = null, e;
|
|
4255
4274
|
});
|
|
4256
4275
|
}
|
|
4257
|
-
let
|
|
4258
|
-
function
|
|
4259
|
-
return
|
|
4276
|
+
let pe = null;
|
|
4277
|
+
function Mr(n) {
|
|
4278
|
+
return pe = pe || Lr(n), pe;
|
|
4260
4279
|
}
|
|
4261
4280
|
/**
|
|
4262
4281
|
* @license
|
|
@@ -4274,7 +4293,7 @@ function Nr(n) {
|
|
|
4274
4293
|
* See the License for the specific language governing permissions and
|
|
4275
4294
|
* limitations under the License.
|
|
4276
4295
|
*/
|
|
4277
|
-
const
|
|
4296
|
+
const Ur = new ae(5e3, 15e3), Dr = "__/auth/iframe", xr = "emulator/auth/iframe", Fr = {
|
|
4278
4297
|
style: {
|
|
4279
4298
|
position: "absolute",
|
|
4280
4299
|
top: "-100px",
|
|
@@ -4283,13 +4302,13 @@ const Or = new oe(5e3, 15e3), Lr = "__/auth/iframe", Mr = "emulator/auth/iframe"
|
|
|
4283
4302
|
},
|
|
4284
4303
|
"aria-hidden": "true",
|
|
4285
4304
|
tabindex: "-1"
|
|
4286
|
-
},
|
|
4305
|
+
}, Vr = /* @__PURE__ */ new Map([
|
|
4287
4306
|
["identitytoolkit.googleapis.com", "p"],
|
|
4288
4307
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4289
4308
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4290
4309
|
// test
|
|
4291
4310
|
]);
|
|
4292
|
-
function
|
|
4311
|
+
function $r(n) {
|
|
4293
4312
|
const e = n.config;
|
|
4294
4313
|
u(
|
|
4295
4314
|
e.authDomain,
|
|
@@ -4297,17 +4316,17 @@ function xr(n) {
|
|
|
4297
4316
|
"auth-domain-config-required"
|
|
4298
4317
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4299
4318
|
);
|
|
4300
|
-
const t = e.emulator ?
|
|
4319
|
+
const t = e.emulator ? We(e, xr) : `https://${n.config.authDomain}/${Dr}`, i = {
|
|
4301
4320
|
apiKey: e.apiKey,
|
|
4302
4321
|
appName: n.name,
|
|
4303
|
-
v:
|
|
4304
|
-
}, r =
|
|
4322
|
+
v: se
|
|
4323
|
+
}, r = Vr.get(n.config.apiHost);
|
|
4305
4324
|
r && (i.eid = r);
|
|
4306
4325
|
const s = n._getFrameworks();
|
|
4307
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4326
|
+
return s.length && (i.fw = s.join(",")), `${t}?${oe(i).slice(1)}`;
|
|
4308
4327
|
}
|
|
4309
|
-
async function
|
|
4310
|
-
const e = await
|
|
4328
|
+
async function Hr(n) {
|
|
4329
|
+
const e = await Mr(n), t = S().gapi;
|
|
4311
4330
|
return u(
|
|
4312
4331
|
t,
|
|
4313
4332
|
n,
|
|
@@ -4315,24 +4334,24 @@ async function Fr(n) {
|
|
|
4315
4334
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4316
4335
|
), e.open({
|
|
4317
4336
|
where: document.body,
|
|
4318
|
-
url:
|
|
4337
|
+
url: $r(n),
|
|
4319
4338
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4320
|
-
attributes:
|
|
4339
|
+
attributes: Fr,
|
|
4321
4340
|
dontclear: !0
|
|
4322
4341
|
}, (i) => new Promise(async (r, s) => {
|
|
4323
4342
|
await i.restyle({
|
|
4324
4343
|
// Prevent iframe from closing on mouse out.
|
|
4325
4344
|
setHideOnLeave: !1
|
|
4326
4345
|
});
|
|
4327
|
-
const o =
|
|
4346
|
+
const o = E(
|
|
4328
4347
|
n,
|
|
4329
4348
|
"network-request-failed"
|
|
4330
4349
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4331
|
-
), c =
|
|
4350
|
+
), c = S().setTimeout(() => {
|
|
4332
4351
|
s(o);
|
|
4333
|
-
},
|
|
4352
|
+
}, Ur.get());
|
|
4334
4353
|
function a() {
|
|
4335
|
-
|
|
4354
|
+
S().clearTimeout(c), r(i);
|
|
4336
4355
|
}
|
|
4337
4356
|
i.ping(a).then(a, () => {
|
|
4338
4357
|
s(o);
|
|
@@ -4355,12 +4374,12 @@ async function Fr(n) {
|
|
|
4355
4374
|
* See the License for the specific language governing permissions and
|
|
4356
4375
|
* limitations under the License.
|
|
4357
4376
|
*/
|
|
4358
|
-
const
|
|
4377
|
+
const Wr = {
|
|
4359
4378
|
location: "yes",
|
|
4360
4379
|
resizable: "yes",
|
|
4361
4380
|
statusbar: "yes",
|
|
4362
4381
|
toolbar: "no"
|
|
4363
|
-
},
|
|
4382
|
+
}, jr = 500, Br = 600, Gr = "_blank", zr = "http://localhost";
|
|
4364
4383
|
class pt {
|
|
4365
4384
|
constructor(e) {
|
|
4366
4385
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4373,20 +4392,20 @@ class pt {
|
|
|
4373
4392
|
}
|
|
4374
4393
|
}
|
|
4375
4394
|
}
|
|
4376
|
-
function
|
|
4395
|
+
function qr(n, e, t, i = jr, r = Br) {
|
|
4377
4396
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4378
4397
|
let c = "";
|
|
4379
|
-
const a = Object.assign(Object.assign({},
|
|
4398
|
+
const a = Object.assign(Object.assign({}, Wr), {
|
|
4380
4399
|
width: i.toString(),
|
|
4381
4400
|
height: r.toString(),
|
|
4382
4401
|
top: s,
|
|
4383
4402
|
left: o
|
|
4384
|
-
}), l =
|
|
4385
|
-
t && (c =
|
|
4386
|
-
const
|
|
4387
|
-
if (
|
|
4388
|
-
return
|
|
4389
|
-
const m = window.open(e || "", c,
|
|
4403
|
+
}), l = k().toLowerCase();
|
|
4404
|
+
t && (c = Vt(l) ? Gr : t), Ft(l) && (e = e || zr, a.scrollbars = "yes");
|
|
4405
|
+
const h = Object.entries(a).reduce((v, [y, f]) => `${v}${y}=${f},`, "");
|
|
4406
|
+
if (Ei(l) && c !== "_self")
|
|
4407
|
+
return Kr(e || "", c), new pt(null);
|
|
4408
|
+
const m = window.open(e || "", c, h);
|
|
4390
4409
|
u(
|
|
4391
4410
|
m,
|
|
4392
4411
|
n,
|
|
@@ -4399,7 +4418,7 @@ function Br(n, e, t, i = $r, r = Hr) {
|
|
|
4399
4418
|
}
|
|
4400
4419
|
return new pt(m);
|
|
4401
4420
|
}
|
|
4402
|
-
function
|
|
4421
|
+
function Kr(n, e) {
|
|
4403
4422
|
const t = document.createElement("a");
|
|
4404
4423
|
t.href = n, t.target = e;
|
|
4405
4424
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4421,7 +4440,7 @@ function Gr(n, e) {
|
|
|
4421
4440
|
* See the License for the specific language governing permissions and
|
|
4422
4441
|
* limitations under the License.
|
|
4423
4442
|
*/
|
|
4424
|
-
const
|
|
4443
|
+
const Jr = "__/auth/handler", Yr = "emulator/auth/handler", Xr = encodeURIComponent("fac");
|
|
4425
4444
|
async function mt(n, e, t, i, r, s) {
|
|
4426
4445
|
u(
|
|
4427
4446
|
n.config.authDomain,
|
|
@@ -4439,27 +4458,27 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4439
4458
|
appName: n.name,
|
|
4440
4459
|
authType: t,
|
|
4441
4460
|
redirectUrl: i,
|
|
4442
|
-
v:
|
|
4461
|
+
v: se,
|
|
4443
4462
|
eventId: r
|
|
4444
4463
|
};
|
|
4445
|
-
if (e instanceof
|
|
4446
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4447
|
-
for (const [
|
|
4448
|
-
o[
|
|
4464
|
+
if (e instanceof Kt) {
|
|
4465
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", Un(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4466
|
+
for (const [h, m] of Object.entries({}))
|
|
4467
|
+
o[h] = m;
|
|
4449
4468
|
}
|
|
4450
|
-
if (e instanceof
|
|
4451
|
-
const
|
|
4452
|
-
|
|
4469
|
+
if (e instanceof ce) {
|
|
4470
|
+
const h = e.getScopes().filter((m) => m !== "");
|
|
4471
|
+
h.length > 0 && (o.scopes = h.join(","));
|
|
4453
4472
|
}
|
|
4454
4473
|
n.tenantId && (o.tid = n.tenantId);
|
|
4455
4474
|
const c = o;
|
|
4456
|
-
for (const
|
|
4457
|
-
c[
|
|
4458
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4459
|
-
return `${
|
|
4475
|
+
for (const h of Object.keys(c))
|
|
4476
|
+
c[h] === void 0 && delete c[h];
|
|
4477
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Xr}=${encodeURIComponent(a)}` : "";
|
|
4478
|
+
return `${Qr(n)}?${oe(c).slice(1)}${l}`;
|
|
4460
4479
|
}
|
|
4461
|
-
function
|
|
4462
|
-
return n.emulator ?
|
|
4480
|
+
function Qr({ config: n }) {
|
|
4481
|
+
return n.emulator ? We(n, Yr) : `https://${n.authDomain}/${Jr}`;
|
|
4463
4482
|
}
|
|
4464
4483
|
/**
|
|
4465
4484
|
* @license
|
|
@@ -4478,29 +4497,29 @@ function Jr({ config: n }) {
|
|
|
4478
4497
|
* limitations under the License.
|
|
4479
4498
|
*/
|
|
4480
4499
|
const Ne = "webStorageSupport";
|
|
4481
|
-
class
|
|
4500
|
+
class Zr {
|
|
4482
4501
|
constructor() {
|
|
4483
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4502
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Zt, this._completeRedirectFn = kr, this._overrideRedirectResult = yr;
|
|
4484
4503
|
}
|
|
4485
4504
|
// Wrapping in async even though we don't await anywhere in order
|
|
4486
4505
|
// to make sure errors are raised as promise rejections
|
|
4487
4506
|
async _openPopup(e, t, i, r) {
|
|
4488
4507
|
var s;
|
|
4489
|
-
|
|
4508
|
+
M((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4490
4509
|
const o = await mt(e, t, i, Me(), r);
|
|
4491
|
-
return
|
|
4510
|
+
return qr(e, o, ze());
|
|
4492
4511
|
}
|
|
4493
4512
|
async _openRedirect(e, t, i, r) {
|
|
4494
4513
|
await this._originValidation(e);
|
|
4495
4514
|
const s = await mt(e, t, i, Me(), r);
|
|
4496
|
-
return
|
|
4515
|
+
return nr(s), new Promise(() => {
|
|
4497
4516
|
});
|
|
4498
4517
|
}
|
|
4499
4518
|
_initialize(e) {
|
|
4500
4519
|
const t = e._key();
|
|
4501
4520
|
if (this.eventManagers[t]) {
|
|
4502
4521
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4503
|
-
return r ? Promise.resolve(r) : (
|
|
4522
|
+
return r ? Promise.resolve(r) : (M(s, "If manager is not set, promise should be"), s);
|
|
4504
4523
|
}
|
|
4505
4524
|
const i = this.initAndGetManager(e);
|
|
4506
4525
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4508,7 +4527,7 @@ class Yr {
|
|
|
4508
4527
|
}), i;
|
|
4509
4528
|
}
|
|
4510
4529
|
async initAndGetManager(e) {
|
|
4511
|
-
const t = await
|
|
4530
|
+
const t = await Hr(e), i = new Er(e);
|
|
4512
4531
|
return t.register("authEvent", (r) => (u(
|
|
4513
4532
|
r == null ? void 0 : r.authEvent,
|
|
4514
4533
|
e,
|
|
@@ -4523,7 +4542,7 @@ class Yr {
|
|
|
4523
4542
|
this.iframes[e._key()].send(Ne, { type: Ne }, (r) => {
|
|
4524
4543
|
var s;
|
|
4525
4544
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
4526
|
-
o !== void 0 && t(!!o),
|
|
4545
|
+
o !== void 0 && t(!!o), L(
|
|
4527
4546
|
e,
|
|
4528
4547
|
"internal-error"
|
|
4529
4548
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4532,13 +4551,13 @@ class Yr {
|
|
|
4532
4551
|
}
|
|
4533
4552
|
_originValidation(e) {
|
|
4534
4553
|
const t = e._key();
|
|
4535
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4554
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Cr(e)), this.originValidationPromises[t];
|
|
4536
4555
|
}
|
|
4537
4556
|
get _shouldInitProactively() {
|
|
4538
|
-
return
|
|
4557
|
+
return Bt() || Be() || ke();
|
|
4539
4558
|
}
|
|
4540
4559
|
}
|
|
4541
|
-
const
|
|
4560
|
+
const es = Zr;
|
|
4542
4561
|
var gt = "@firebase/auth", _t = "1.7.5";
|
|
4543
4562
|
/**
|
|
4544
4563
|
* @license
|
|
@@ -4556,7 +4575,7 @@ var gt = "@firebase/auth", _t = "1.7.5";
|
|
|
4556
4575
|
* See the License for the specific language governing permissions and
|
|
4557
4576
|
* limitations under the License.
|
|
4558
4577
|
*/
|
|
4559
|
-
class
|
|
4578
|
+
class ts {
|
|
4560
4579
|
constructor(e) {
|
|
4561
4580
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4562
4581
|
}
|
|
@@ -4607,7 +4626,7 @@ class Qr {
|
|
|
4607
4626
|
* See the License for the specific language governing permissions and
|
|
4608
4627
|
* limitations under the License.
|
|
4609
4628
|
*/
|
|
4610
|
-
function
|
|
4629
|
+
function ns(n) {
|
|
4611
4630
|
switch (n) {
|
|
4612
4631
|
case "Node":
|
|
4613
4632
|
return "node";
|
|
@@ -4623,7 +4642,7 @@ function Zr(n) {
|
|
|
4623
4642
|
return;
|
|
4624
4643
|
}
|
|
4625
4644
|
}
|
|
4626
|
-
function
|
|
4645
|
+
function is(n) {
|
|
4627
4646
|
Ze(new et(
|
|
4628
4647
|
"auth",
|
|
4629
4648
|
(e, { options: t }) => {
|
|
@@ -4636,9 +4655,9 @@ function es(n) {
|
|
|
4636
4655
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4637
4656
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4638
4657
|
apiScheme: "https",
|
|
4639
|
-
sdkClientVersion:
|
|
4640
|
-
}, l = new
|
|
4641
|
-
return
|
|
4658
|
+
sdkClientVersion: Gt(n)
|
|
4659
|
+
}, l = new Oi(i, r, s, a);
|
|
4660
|
+
return Fi(l, t), l;
|
|
4642
4661
|
},
|
|
4643
4662
|
"PUBLIC"
|
|
4644
4663
|
/* ComponentType.PUBLIC */
|
|
@@ -4657,14 +4676,14 @@ function es(n) {
|
|
|
4657
4676
|
"auth"
|
|
4658
4677
|
/* _ComponentName.AUTH */
|
|
4659
4678
|
).getImmediate());
|
|
4660
|
-
return ((i) => new
|
|
4679
|
+
return ((i) => new ts(i))(t);
|
|
4661
4680
|
},
|
|
4662
4681
|
"PRIVATE"
|
|
4663
4682
|
/* ComponentType.PRIVATE */
|
|
4664
4683
|
).setInstantiationMode(
|
|
4665
4684
|
"EXPLICIT"
|
|
4666
4685
|
/* InstantiationMode.EXPLICIT */
|
|
4667
|
-
)), Le(gt, _t,
|
|
4686
|
+
)), Le(gt, _t, ns(n)), Le(gt, _t, "esm2017");
|
|
4668
4687
|
}
|
|
4669
4688
|
/**
|
|
4670
4689
|
* @license
|
|
@@ -4682,11 +4701,11 @@ function es(n) {
|
|
|
4682
4701
|
* See the License for the specific language governing permissions and
|
|
4683
4702
|
* limitations under the License.
|
|
4684
4703
|
*/
|
|
4685
|
-
const
|
|
4704
|
+
const rs = 5 * 60, ss = bt("authIdTokenMaxAge") || rs;
|
|
4686
4705
|
let vt = null;
|
|
4687
|
-
const
|
|
4706
|
+
const os = (n) => async (e) => {
|
|
4688
4707
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4689
|
-
if (i && i >
|
|
4708
|
+
if (i && i > ss)
|
|
4690
4709
|
return;
|
|
4691
4710
|
const r = t == null ? void 0 : t.token;
|
|
4692
4711
|
vt !== r && (vt = r, await fetch(n, {
|
|
@@ -4696,104 +4715,131 @@ const is = (n) => async (e) => {
|
|
|
4696
4715
|
} : {}
|
|
4697
4716
|
}));
|
|
4698
4717
|
};
|
|
4699
|
-
function
|
|
4700
|
-
const e =
|
|
4718
|
+
function as(n = Nn()) {
|
|
4719
|
+
const e = Et(n, "auth");
|
|
4701
4720
|
if (e.isInitialized())
|
|
4702
4721
|
return e.getImmediate();
|
|
4703
|
-
const t =
|
|
4704
|
-
popupRedirectResolver:
|
|
4722
|
+
const t = xi(n, {
|
|
4723
|
+
popupRedirectResolver: es,
|
|
4705
4724
|
persistence: [
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4725
|
+
dr,
|
|
4726
|
+
Zi,
|
|
4727
|
+
Zt
|
|
4709
4728
|
]
|
|
4710
|
-
}), i =
|
|
4729
|
+
}), i = bt("authTokenSyncURL");
|
|
4711
4730
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4712
4731
|
const s = new URL(i, location.origin);
|
|
4713
4732
|
if (location.origin === s.origin) {
|
|
4714
|
-
const o =
|
|
4715
|
-
|
|
4733
|
+
const o = os(s.toString());
|
|
4734
|
+
Ji(t, o, () => o(t.currentUser)), Ki(t, (c) => o(c));
|
|
4716
4735
|
}
|
|
4717
4736
|
}
|
|
4718
|
-
const r =
|
|
4719
|
-
return r &&
|
|
4737
|
+
const r = Cn("auth");
|
|
4738
|
+
return r && Vi(t, `http://${r}`), t;
|
|
4720
4739
|
}
|
|
4721
|
-
function
|
|
4740
|
+
function cs() {
|
|
4722
4741
|
var n, e;
|
|
4723
4742
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4724
4743
|
}
|
|
4725
|
-
|
|
4744
|
+
Li({
|
|
4726
4745
|
loadJS(n) {
|
|
4727
4746
|
return new Promise((e, t) => {
|
|
4728
4747
|
const i = document.createElement("script");
|
|
4729
4748
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4730
|
-
const s =
|
|
4749
|
+
const s = E(
|
|
4731
4750
|
"internal-error"
|
|
4732
4751
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4733
4752
|
);
|
|
4734
4753
|
s.customData = r, t(s);
|
|
4735
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4754
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", cs().appendChild(i);
|
|
4736
4755
|
});
|
|
4737
4756
|
},
|
|
4738
4757
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4739
4758
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4740
4759
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4741
4760
|
});
|
|
4742
|
-
|
|
4761
|
+
is(
|
|
4743
4762
|
"Browser"
|
|
4744
4763
|
/* ClientPlatform.BROWSER */
|
|
4745
4764
|
);
|
|
4746
|
-
var
|
|
4747
|
-
const
|
|
4765
|
+
var ls = { 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", featureFlagApiKey: "MaGoXrEWuEJNpWgKTqseee" }, us = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
|
|
4766
|
+
const ds = {
|
|
4748
4767
|
key: 2,
|
|
4749
4768
|
class: "h-full w-full"
|
|
4750
|
-
},
|
|
4769
|
+
}, hs = ["src"], Ns = /* @__PURE__ */ xe({
|
|
4751
4770
|
__name: "App",
|
|
4752
4771
|
setup(n) {
|
|
4753
|
-
const e = ge(), t =
|
|
4754
|
-
|
|
4755
|
-
|
|
4772
|
+
const e = ge(), t = gn(), i = _n(), r = Tt(), s = In(), o = yn(), c = wt(), a = ne(c.query.showHeader !== "false"), l = ne(!1), { currentBusiness: h } = ge();
|
|
4773
|
+
q(
|
|
4774
|
+
[
|
|
4775
|
+
() => {
|
|
4776
|
+
var d;
|
|
4777
|
+
return (d = h.value) == null ? void 0 : d._id;
|
|
4778
|
+
},
|
|
4779
|
+
() => e.currentCountry.value,
|
|
4780
|
+
() => {
|
|
4781
|
+
var d;
|
|
4782
|
+
return (d = e.sessionUser.value) == null ? void 0 : d.id;
|
|
4783
|
+
}
|
|
4784
|
+
],
|
|
4785
|
+
([d]) => {
|
|
4786
|
+
r.reset(), d && r.read(d);
|
|
4787
|
+
},
|
|
4788
|
+
{ immediate: !0, flush: "sync" }
|
|
4789
|
+
), dn(() => r.reset()), q(
|
|
4790
|
+
() => {
|
|
4791
|
+
var d;
|
|
4792
|
+
return (d = h.value) == null ? void 0 : d._id;
|
|
4793
|
+
},
|
|
4794
|
+
(d) => {
|
|
4795
|
+
d && vn(d);
|
|
4796
|
+
},
|
|
4797
|
+
{ immediate: !0 }
|
|
4798
|
+
);
|
|
4799
|
+
const m = ne(!1), v = X(() => i.version), y = X(() => {
|
|
4800
|
+
const d = e.currentCountry.value || "MY", g = tt.getIdToken(), b = h.value._id;
|
|
4801
|
+
return `${us.marketingV1Portal}/b/${b}/marketing/overview?showHeader=false&country=${d}&token=${g}`;
|
|
4756
4802
|
});
|
|
4757
|
-
async function
|
|
4758
|
-
if (
|
|
4803
|
+
async function f() {
|
|
4804
|
+
if (Dn().length) {
|
|
4759
4805
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4760
4806
|
return;
|
|
4761
4807
|
}
|
|
4762
|
-
const
|
|
4763
|
-
await
|
|
4808
|
+
const d = xn(ls.firebase), g = await mn.getCustomToken(), b = as();
|
|
4809
|
+
await qi(b, g), Fn(d), console.log("initFirebase", d);
|
|
4764
4810
|
}
|
|
4765
|
-
const
|
|
4766
|
-
|
|
4811
|
+
const w = async () => {
|
|
4812
|
+
m.value = !1, await fn(), console.log("forceRerender"), tt.setBusinessId(h.value._id), await i.readPremium(), !l.value && v.value === "v2" ? e.registerSidebarComponent(Wn) : e.hideSidebarToggle(!0), await f(), l.value = !0, m.value = !0;
|
|
4767
4813
|
};
|
|
4768
|
-
return
|
|
4769
|
-
if (
|
|
4770
|
-
const
|
|
4771
|
-
|
|
4814
|
+
return hn(() => {
|
|
4815
|
+
if (Vn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(s, o), !a.value) {
|
|
4816
|
+
const d = document.getElementsByClassName("app-header")[0], g = document.getElementsByClassName("app-sidebar")[0], b = document.getElementsByClassName("app-container")[0], T = document.getElementsByTagName("main")[0];
|
|
4817
|
+
d == null || d.classList.add("!hidden"), g == null || g.classList.add("!pt-0"), b == null || b.classList.add("!pt-0"), T == null || T.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4772
4818
|
}
|
|
4773
|
-
|
|
4774
|
-
}),
|
|
4819
|
+
h.value != null && (console.log("App mounted, forceRerender"), w());
|
|
4820
|
+
}), q(
|
|
4775
4821
|
() => e.currentBusiness.value,
|
|
4776
|
-
async (
|
|
4777
|
-
console.log("Current business changed"),
|
|
4822
|
+
async (d, g) => {
|
|
4823
|
+
console.log("Current business changed"), d != null && d._id != g._id && (console.log("forceRerender when business changes", d, g), w());
|
|
4778
4824
|
}
|
|
4779
|
-
), (
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
json: { url:
|
|
4825
|
+
), (d, g) => (j(), me(It, null, [
|
|
4826
|
+
_(m) && _(v) === "v2" ? (j(), Oe(_(pn), { key: 0 })) : Pe("", !0),
|
|
4827
|
+
_(m) && _(v) === "v2" && _(a) ? (j(), Oe(oi, { key: 1 })) : Pe("", !0),
|
|
4828
|
+
_(m) && _(v) !== "v2" ? (j(), me("div", ds, [
|
|
4829
|
+
R(bn, {
|
|
4830
|
+
json: { url: _(y) }
|
|
4785
4831
|
}, null, 8, ["json"]),
|
|
4786
|
-
|
|
4832
|
+
I("iframe", {
|
|
4787
4833
|
allow: "clipboard-read; clipboard-write",
|
|
4788
4834
|
frameBorder: "0",
|
|
4789
4835
|
height: "100%",
|
|
4790
4836
|
width: "100%",
|
|
4791
|
-
src:
|
|
4792
|
-
}, null, 8,
|
|
4837
|
+
src: _(y)
|
|
4838
|
+
}, null, 8, hs)
|
|
4793
4839
|
])) : Pe("", !0)
|
|
4794
4840
|
], 64));
|
|
4795
4841
|
}
|
|
4796
4842
|
});
|
|
4797
4843
|
export {
|
|
4798
|
-
|
|
4844
|
+
Ns as default
|
|
4799
4845
|
};
|