@feedmepos/mf-connect 0.1.122-prod → 0.1.123-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/dist/{App-BKnL7b6M.js → App-BHqbxq_5.js} +502 -493
- package/dist/AuditLogs-FB5BGl_F.js +2016 -0
- package/dist/{Bin-BqqQF1h_.js → Bin-Bc5C_yvE.js} +8 -8
- package/dist/{Broadcast-U5rJmhdd.js → Broadcast-CEJc8daU.js} +22 -21
- package/dist/{CampaignAnalytic-ClwXxxzE.js → CampaignAnalytic-wUhISw-Z.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DyeoWFcd.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BlLw8Tb5.js} +8 -9
- package/dist/{Card-DKikDYES.js → Card-uviAfIRX.js} +22 -22
- package/dist/{Collections-CD0xjFqI.js → Collections-COA2uZGw.js} +197 -185
- package/dist/{Credit-BWcvFlb2.js → Credit-Dh4GleW1.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B2RizWP8.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DM-uzm4_.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-9fDPd8x9.js +4439 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Hr10pgqD.js → EffectSheet.vue_vue_type_style_index_0_lang-DorkQcT5.js} +16 -16
- package/dist/{Experience-dqXYj1Fv.js → Experience-oOmPXIh-.js} +32 -31
- package/dist/{FileSaver.min-DdJMn696.js → FileSaver.min-_q7Dx4wn.js} +1 -1
- package/dist/{Game-BGQXqzck.js → Game-BTfpDAXf.js} +19 -18
- package/dist/{GiftCardSetup-C3MR25fp.js → GiftCardSetup-FhOKl3OA.js} +31 -31
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-9dL1kVPG.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-BWP_vdpd.js} +7 -7
- package/dist/{Goals-DA2jHEZa.js → Goals-A5qHITPJ.js} +4 -4
- package/dist/Grab-D7BOmVRB.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-_rlsNocb.js → ImageInput.vue_vue_type_script_setup_true_lang-CqkwVS2r.js} +1 -1
- package/dist/{Index-WOvryalE.js → Index-CuSQjKgG.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Bu1DjV9M.js → LocationPicker.vue_vue_type_script_setup_true_lang-D6bURd7V.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DiLtSIXt.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C3Nt5VLS.js} +1 -1
- package/dist/{LoyaltyDashboard-BKN2vBqc.js → LoyaltyDashboard-B66W2agI.js} +15 -15
- package/dist/{MainLayout-DizL-dxl.js → MainLayout-CguQ_XOG.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-El0YeLnE.js → MainLayout.vue_vue_type_script_setup_true_lang-ByHEOOgE.js} +3 -3
- package/dist/{Marketing-B77EoiCf.js → Marketing-DsRvHFfJ.js} +4 -4
- package/dist/{MarketingMaterialEdit-C_qFEur7.js → MarketingMaterialEdit-DLqupGle.js} +214 -211
- package/dist/{Member-TYDrU3Tk.js → Member-BlRWRmf7.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BuzMeXR9.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-GZ5gUgb8.js} +39 -47
- package/dist/{MemberImportHistory-l7dVJdEH.js → MemberImportHistory-DxpuDRx4.js} +7 -7
- package/dist/{MemberList-DiuyeJx_.js → MemberList-DnKQ0nCm.js} +103 -105
- package/dist/{MemberTransactions-BJ27Gd5P.js → MemberTransactions-bs3canOe.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-so7LWtlv.js → MessageInput.vue_vue_type_script_setup_true_lang-DRU6aeH8.js} +12 -12
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DgE7HPsT.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BYH3qzyb.js} +1 -1
- package/dist/{Mission-C63hh8Ra.js → Mission-DHXh7T93.js} +22 -21
- package/dist/{Overview-DP-4Kpuj.js → Overview-CVQBgphM.js} +145 -144
- package/dist/{Overview-CVdvQK6q.js → Overview-UAF9JSio.js} +20 -20
- package/dist/{Point-DXH4kJNQ.js → Point-C6wv1uzT.js} +22 -21
- package/dist/{Promotion-Cn-wAx6m.js → Promotion-CeZRHUed.js} +137 -131
- package/dist/{Queue-CEEUE-UT.js → Queue-BxTSJ6LA.js} +45 -45
- package/dist/{Record-BFIjLKJD.js → Record-DoOyOT7I.js} +9 -9
- package/dist/{Review-BMRfKri0.js → Review-BSpjwVxg.js} +2 -2
- package/dist/ReviewFacebookCallback-CMAQ_PXJ.js +225 -0
- package/dist/{ReviewGoogleCallback-Cflqv5Z5.js → ReviewGoogleCallback-D---BE3G.js} +5 -5
- package/dist/{Reward-C-qGtzpu.js → Reward-BC2PCxwA.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-kxJ5i8xe.js → RewardGroup.vue_vue_type_script_setup_true_lang-VV8I4Pnl.js} +13 -13
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DmOKmXkP.js +1923 -0
- package/dist/{Segment-Bx1pfw4Q.js → Segment-CcRapIdF.js} +303 -306
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-vuH9xdOi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D9Ino3uS.js} +14 -14
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CZHpyimI.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C42YDmfw.js} +4 -4
- package/dist/Setting-CTWV-j-u.js +574 -0
- package/dist/{SettingAdvertisements-CZlIQ5m_.js → SettingAdvertisements-1WCqp0FF.js} +12 -12
- package/dist/Settings-BxgqmIBl.js +286 -0
- package/dist/{Store-BhZulzuc.js → Store-uhCU5WYY.js} +28 -28
- package/dist/{StoreRewards-CvYgJVFU.js → StoreRewards-DjgbbZsB.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BgT5nChN.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BAUBxdV2.js +7007 -0
- package/dist/{Tier-BPPSaEe0.js → Tier-B6sp_dj5.js} +2575 -687
- package/dist/{Title-CccRUVZV.js → Title-Dew9vKN4.js} +95 -94
- package/dist/{Transaction-ULzAt-u7.js → Transaction-ITefNWob.js} +2 -2
- package/dist/Upselling-AMpfgEvH.js +1042 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CoqrSuWu.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B4LP8LZ-.js} +26 -26
- package/dist/{Voucher-Cz7IMRNl.js → Voucher-CRP6KY1f.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BaxHZN76.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BZEJecca.js} +12 -12
- package/dist/{WhatsappAccount-BsxVHiZZ.js → WhatsappAccount-MkutDvBs.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DJnkGMF1.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-vDLl0J7v.js} +1 -1
- package/dist/{WhatsappBot-sd6erVZk.js → WhatsappBot-B0m21qPb.js} +6 -6
- package/dist/{WhatsappBotLogs-DNbGWyOY.js → WhatsappBotLogs-BHyoUuef.js} +6 -6
- package/dist/{WhatsappBotSettings-DXa_e7-a.js → WhatsappBotSettings-BbiHQ3Qb.js} +4 -4
- package/dist/{WhatsappLayout-DvBPIB5f.js → WhatsappLayout-yq05I3IA.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CRDouGvj.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BrjbWgKf.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B6BvSACt.js → ZodTextField.vue_vue_type_script_setup_true_lang-CLiZ6jd6.js} +2 -2
- package/dist/{app-4x06ItoL.js → app-Ce3Q-VS4.js} +14861 -15017
- package/dist/app.js +4 -3
- package/dist/{base.export-DS0xThWi.js → base.export-Ds3PiiHA.js} +2 -2
- package/dist/{business-D0I7G-5H.js → business-CfxfaERu.js} +1 -1
- package/dist/{campaign-BuJCjEH-.js → campaign-COuKKIRA.js} +121 -94
- package/dist/{campaign-CC9U7rkr.js → campaign-CtX-q7KI.js} +34 -28
- package/dist/{campaign.enum-BqekIiiN.js → campaign.enum-Dx-Zo68Q.js} +2 -1
- package/dist/campaign.fn-oUqhH0SU.js +776 -0
- package/dist/{collection.fn-CUifllLR.js → collection.fn-PhjmENfo.js} +2 -2
- package/dist/{currency-BPhBDOpt.js → currency-DmSaw6iQ.js} +1 -1
- package/dist/duplicateCampaign-DzF45eaZ.js +51 -0
- package/dist/{effect-DKHOR-B3.js → effect-sAKjjlrO.js} +1 -1
- package/dist/{email-addresses-B-VEReRV.js → email-addresses-jSqlPLwS.js} +25 -25
- package/dist/{feature-flag-Cjl6gaO5.js → feature-flag-Dvz3D7kC.js} +171 -185
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-CBLh1PWR.js → helper-Dn6pU0yd.js} +1 -1
- package/dist/{index-DL_UYO4J.js → index--A062GN8.js} +380 -234
- package/dist/{index-DenQ8DV4.js → index-2B_HRy_7.js} +1 -1
- package/dist/{index-umYXnOWc.js → index-8wWIydMw.js} +608 -251
- package/dist/{index-C1QA2M4I.js → index-Aqx0Hc_6.js} +10 -10
- package/dist/{index-kClA31M9.js → index-B_GA0PSb.js} +10 -10
- package/dist/{index-bc7bIIVP.js → index-B_aWWeg9.js} +197 -197
- package/dist/{index-Djf4TpYV.js → index-BiBBY6Sk.js} +23 -23
- package/dist/{index-vqUiCeKb.js → index-BoFxBf97.js} +1 -1
- package/dist/{index-B_iKSOXp.js → index-BrqespAR.js} +1 -1
- package/dist/{index-BwgjSrwa.js → index-Bu2uqM4e.js} +2 -2
- package/dist/{index-BzKKNuLc.js → index-C4O-Fym0.js} +2 -2
- package/dist/{index-BBsqcXfJ.js → index-C8fp9YtA.js} +1 -1
- package/dist/{index-Ob5I-Sex.js → index-CRFiQOrt.js} +1 -1
- package/dist/{index-RMsQnHez.js → index-CUaL0i4I.js} +1 -1
- package/dist/{index-EpqQFMu2.js → index-Cgg1NNfN.js} +2699 -2614
- package/dist/{index-ZTC5k9Jb.js → index-CjAhwLNW.js} +19 -6
- package/dist/{index-CWJi_hw-.js → index-D6wQPKHc.js} +2 -2
- package/dist/{index-nnmfOPuw.js → index-DFAceV6T.js} +4 -4
- package/dist/{index-CGcWs8B5.js → index-bGITzW-d.js} +533 -462
- package/dist/{index-D3B392A3.js → index-pCmNLjIj.js} +3 -3
- package/dist/{index.esm2017-DMKkHR06.js → index.esm2017-ChJMTCyQ.js} +93 -93
- package/dist/{loading-Cb4RgEo7.js → loading-DhiMqWJA.js} +1 -1
- package/dist/{lodash-CMazTe9d.js → lodash-CCBK4pXz.js} +1 -1
- package/dist/{member-import-Df1y7FvX.js → member-import-BUvsg-Lu.js} +1 -1
- package/dist/{membership-yvDb2HS8.js → membership-7X3Uc50t.js} +2 -2
- package/dist/{money-rs9shyUy.js → money-D5EIeVr_.js} +1 -1
- package/dist/{number-Ecq6MjRx.js → number-Bj7X6VoA.js} +1 -1
- package/dist/objectid-CzFM8vy5.js +145 -0
- package/dist/{onboarding-DugmLfNG.js → onboarding-0mA1gXrv.js} +36 -36
- package/dist/{onboardingSetup-DMzNxJC4.js → onboardingSetup-BBPg-cAT.js} +2 -2
- package/dist/{plugins-CvhBJQEK.js → plugins-bprg7ahs.js} +3 -3
- package/dist/{reward-BGUOUKZn.js → reward-WTxymIQH.js} +1 -1
- package/dist/{rule-C87YbT3F.js → rule-hJuK8Yqw.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-wt4Q2S3f.js +227 -0
- package/dist/{timezone-uP_heouv.js → timezone-BWkDzpwA.js} +1 -1
- package/dist/{transaction.fn-CiGhIgzP.js → transaction.fn-DzwtEBIZ.js} +2 -2
- package/dist/{trigger-dOOSh-Yp.js → trigger-D6hitqvM.js} +9 -9
- package/dist/{useMarketingMaterialActions-BRenBblP.js → useMarketingMaterialActions-ByWwvQRt.js} +4 -4
- package/dist/{usePagination-DNOc8GFS.js → usePagination-Mr6qWVOa.js} +1 -1
- package/dist/{user-DTAGYy-F.js → user-Dpl2lhox.js} +1 -1
- package/dist/vue-i18n-BEFR04bc.js +2365 -0
- package/dist/{xlsx-BU0bDwTF.js → xlsx-Cu5ybiy4.js} +1 -1
- package/dist/{zod-mPFqdty8.js → zod-CcKqtEqX.js} +1 -1
- package/package.json +6 -2
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D38JB0FV.js +0 -3493
- package/dist/ReviewFacebookCallback-CPYIC3RS.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BlRmshrE.js +0 -1884
- package/dist/Setting-CEcpuE_O.js +0 -578
- package/dist/Settings-CPLibjQy.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dqj5zIgi.js +0 -1297
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang--Ii9ejFG.js +0 -142
- package/dist/Upselling-D2tSUTkE.js +0 -200
- package/dist/campaign.fn-CLUOgMgc.js +0 -776
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/objectid-BVri-Vim.js +0 -145
- package/dist/rule-builder-lzMi7irV.js +0 -102
- package/dist/template-BfFSbH04.js +0 -275
- package/dist/vue-i18n-D8wuxuA4.js +0 -2365
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var de = Object.defineProperty;
|
|
2
|
-
var ve = (
|
|
3
|
-
var
|
|
4
|
-
import { ref as ht, readonly as
|
|
5
|
-
import { c as
|
|
6
|
-
import { useCoreStore as
|
|
2
|
+
var ve = (m, u, d) => u in m ? de(m, u, { enumerable: !0, configurable: !0, writable: !0, value: d }) : m[u] = d;
|
|
3
|
+
var st = (m, u, d) => ve(m, typeof u != "symbol" ? u + "" : u, d);
|
|
4
|
+
import { ref as ht, readonly as Rt } from "vue";
|
|
5
|
+
import { c as lt } from "./app-Ce3Q-VS4.js";
|
|
6
|
+
import { useCoreStore as ae } from "@feedmepos/mf-common";
|
|
7
7
|
var Kt = { exports: {} };
|
|
8
|
-
(function(
|
|
8
|
+
(function(m, u) {
|
|
9
9
|
(function(d, v) {
|
|
10
10
|
v(u);
|
|
11
|
-
})(
|
|
11
|
+
})(lt, function(d) {
|
|
12
12
|
var v = { getItemSync: function(a) {
|
|
13
13
|
try {
|
|
14
14
|
return localStorage.getItem(a) || null;
|
|
@@ -41,24 +41,24 @@ var Kt = { exports: {} };
|
|
|
41
41
|
};
|
|
42
42
|
function T(a, e, t, i) {
|
|
43
43
|
return new (t || (t = Promise))(function(n, r) {
|
|
44
|
-
function o(
|
|
44
|
+
function o(f) {
|
|
45
45
|
try {
|
|
46
|
-
h(i.next(
|
|
46
|
+
h(i.next(f));
|
|
47
47
|
} catch (l) {
|
|
48
48
|
r(l);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
function c(
|
|
51
|
+
function c(f) {
|
|
52
52
|
try {
|
|
53
|
-
h(i.throw(
|
|
53
|
+
h(i.throw(f));
|
|
54
54
|
} catch (l) {
|
|
55
55
|
r(l);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function h(
|
|
58
|
+
function h(f) {
|
|
59
59
|
var l;
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
f.done ? n(f.value) : (l = f.value, l instanceof t ? l : new t(function(p) {
|
|
61
|
+
p(l);
|
|
62
62
|
})).then(o, c);
|
|
63
63
|
}
|
|
64
64
|
h((i = i.apply(a, [])).next());
|
|
@@ -73,7 +73,7 @@ var Kt = { exports: {} };
|
|
|
73
73
|
return this;
|
|
74
74
|
}), r;
|
|
75
75
|
function c(h) {
|
|
76
|
-
return function(
|
|
76
|
+
return function(f) {
|
|
77
77
|
return function(l) {
|
|
78
78
|
if (t) throw new TypeError("Generator is already executing.");
|
|
79
79
|
for (; o; ) try {
|
|
@@ -112,14 +112,14 @@ var Kt = { exports: {} };
|
|
|
112
112
|
continue;
|
|
113
113
|
}
|
|
114
114
|
l = e.call(a, o);
|
|
115
|
-
} catch (
|
|
116
|
-
l = [6,
|
|
115
|
+
} catch (p) {
|
|
116
|
+
l = [6, p], i = 0;
|
|
117
117
|
} finally {
|
|
118
118
|
t = n = 0;
|
|
119
119
|
}
|
|
120
120
|
if (5 & l[0]) throw l[1];
|
|
121
121
|
return { value: l[0] ? l[1] : void 0, done: !0 };
|
|
122
|
-
}([h,
|
|
122
|
+
}([h, f]);
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -127,7 +127,7 @@ var Kt = { exports: {} };
|
|
|
127
127
|
for (var i, n = 0, r = e.length; n < r; n++) !i && n in e || (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
|
|
128
128
|
return a.concat(i || Array.prototype.slice.call(e));
|
|
129
129
|
}
|
|
130
|
-
var
|
|
130
|
+
var it = function a(e, t) {
|
|
131
131
|
if (e === t) return !0;
|
|
132
132
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
133
133
|
if (e.constructor !== t.constructor) return !1;
|
|
@@ -153,13 +153,13 @@ var Kt = { exports: {} };
|
|
|
153
153
|
function _(a, e) {
|
|
154
154
|
var t = Object.keys(e || {}).filter(function(i) {
|
|
155
155
|
var n = a == null ? void 0 : a[i], r = e == null ? void 0 : e[i];
|
|
156
|
-
return !
|
|
156
|
+
return !it(n, r);
|
|
157
157
|
});
|
|
158
158
|
return Object.keys(a || {}).filter(function(i) {
|
|
159
159
|
Object.keys(e || {}).includes(i) || t.push(i);
|
|
160
160
|
}), Object.keys(t).length ? t : null;
|
|
161
161
|
}
|
|
162
|
-
var
|
|
162
|
+
var g, C;
|
|
163
163
|
function b(a, e, t) {
|
|
164
164
|
var i = "shortString", n = !0;
|
|
165
165
|
typeof t == "number" && (i = "javaDouble", n = !1), a[i] = a[i] || {}, a[i][e] = n ? t + "" : t;
|
|
@@ -167,69 +167,69 @@ var Kt = { exports: {} };
|
|
|
167
167
|
function G(a) {
|
|
168
168
|
return !!a && typeof a == "object" && a.value !== void 0;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function at(a) {
|
|
171
171
|
return Object.fromEntries(Object.entries(a).map(function(e) {
|
|
172
172
|
var t = e[0], i = e[1];
|
|
173
173
|
return [t, G(i) ? i : { value: i }];
|
|
174
174
|
}));
|
|
175
175
|
}
|
|
176
176
|
function dt(a) {
|
|
177
|
-
return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits:
|
|
177
|
+
return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits: at(a.identity.traits || {}) }) : void 0 });
|
|
178
178
|
}
|
|
179
179
|
(function(a) {
|
|
180
180
|
a.NONE = "NONE", a.DEFAULT_FLAGS = "DEFAULT_FLAGS", a.CACHE = "CACHE", a.SERVER = "SERVER";
|
|
181
|
-
})(
|
|
182
|
-
var vt, w = null, se = "FLAGSMITH_EVENT",
|
|
181
|
+
})(g || (g = {}));
|
|
182
|
+
var vt, w = null, se = "FLAGSMITH_EVENT", rt = se, Dt = "https://edge.api.flagsmith.com/api/v1/", Gt = "flagsmith_value_", Jt = "flagsmith_enabled_", Bt = "flagsmith_trait_", le = function() {
|
|
183
183
|
function a(e) {
|
|
184
184
|
var t = this;
|
|
185
185
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
186
186
|
var i = t, n = i.api, r = i.evaluationContext;
|
|
187
187
|
t.log("Get Flags"), t.isLoading = !0, t.loadingState.isFetching || t.setLoadingState(s(s({}, t.loadingState), { isFetching: !0 }));
|
|
188
188
|
var o = "".concat(t.getContext().identity), c = function(h) {
|
|
189
|
-
var
|
|
189
|
+
var f, l, p, F;
|
|
190
190
|
if (h && o === "".concat(t.getContext().identity)) {
|
|
191
|
-
var
|
|
191
|
+
var P = h.flags, O = h.traits, j = h.identifier;
|
|
192
192
|
t.isLoading = !1;
|
|
193
193
|
var I = {}, A = {};
|
|
194
|
-
O = O || [], (
|
|
195
|
-
I[
|
|
196
|
-
}), O.forEach(function(
|
|
197
|
-
A[
|
|
194
|
+
O = O || [], (P = P || []).forEach(function(y) {
|
|
195
|
+
I[y.feature.name.toLowerCase().replace(/ /g, "_")] = { id: y.feature.id, enabled: y.enabled, value: y.feature_state_value };
|
|
196
|
+
}), O.forEach(function(y) {
|
|
197
|
+
A[y.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: y.transient, value: y.trait_value };
|
|
198
198
|
}), t.oldFlags = s({}, t.flags);
|
|
199
|
-
var k = _(t.oldFlags, I), Q = _((
|
|
200
|
-
if ((j || Object.keys(A).length) && (t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: A }), j && (t.evaluationContext.identity.identifier = j)), t.flags = I, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: k, traitsChanged: Q }, t._loadedState(null,
|
|
199
|
+
var k = _(t.oldFlags, I), Q = _((f = t.evaluationContext.identity) === null || f === void 0 ? void 0 : f.traits, A);
|
|
200
|
+
if ((j || Object.keys(A).length) && (t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: A }), j && (t.evaluationContext.identity.identifier = j)), t.flags = I, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: k, traitsChanged: Q }, t._loadedState(null, g.SERVER)), t.datadogRum) try {
|
|
201
201
|
if (t.datadogRum.trackTraits) {
|
|
202
202
|
var W = {};
|
|
203
|
-
Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(
|
|
204
|
-
W[
|
|
203
|
+
Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(y) {
|
|
204
|
+
W[Bt + y] = t.getTrait(y);
|
|
205
205
|
});
|
|
206
|
-
var $ = s(s(s({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((
|
|
206
|
+
var $ = s(s(s({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((p = t.evaluationContext.identity) === null || p === void 0 ? void 0 : p.identifier) }), W);
|
|
207
207
|
t.log("Setting Datadog user", $), t.datadogRum.client.setUser($);
|
|
208
208
|
}
|
|
209
|
-
} catch (
|
|
210
|
-
console.error(
|
|
209
|
+
} catch (y) {
|
|
210
|
+
console.error(y);
|
|
211
211
|
}
|
|
212
212
|
if (t.dtrum) try {
|
|
213
213
|
var E = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
214
|
-
Object.keys(t.flags).map(function(
|
|
215
|
-
b(E,
|
|
216
|
-
}), Object.keys(((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.traits) || {}).map(function(
|
|
217
|
-
b(E,
|
|
214
|
+
Object.keys(t.flags).map(function(y) {
|
|
215
|
+
b(E, Gt + y, t.getValue(y, { skipAnalytics: !0 })), b(E, Jt + y, t.hasFeature(y, { skipAnalytics: !0 }));
|
|
216
|
+
}), Object.keys(((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.traits) || {}).map(function(y) {
|
|
217
|
+
b(E, Bt + y, t.getTrait(y));
|
|
218
218
|
}), t.log("Sending javaLongOrObject traits to dynatrace", E.javaLongOrObject), t.log("Sending date traits to dynatrace", E.date), t.log("Sending shortString traits to dynatrace", E.shortString), t.log("Sending javaDouble to dynatrace", E.javaDouble), t.dtrum.sendSessionProperties(E.javaLongOrObject, E.date, E.shortString, E.javaDouble);
|
|
219
|
-
} catch (
|
|
220
|
-
console.error(
|
|
219
|
+
} catch (y) {
|
|
220
|
+
console.error(y);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
return r.identity ? Promise.all([r.identity.traits && Object.keys(r.identity.traits).length || !r.identity.identifier ? t.getJSON(n + "identities/", "POST", JSON.stringify({ identifier: r.identity.identifier, transient: r.identity.transient, traits: Object.entries(r.identity.traits).map(function(h) {
|
|
225
|
-
var
|
|
226
|
-
return { trait_key:
|
|
225
|
+
var f = h[0], l = h[1];
|
|
226
|
+
return { trait_key: f, trait_value: l == null ? void 0 : l.value, transient: l == null ? void 0 : l.transient };
|
|
227
227
|
}).filter(function(h) {
|
|
228
228
|
return h.trait_value !== void 0 || (t.log("Warning - attempted to set an undefined trait value for key", h.trait_key), !1);
|
|
229
229
|
}) })) : t.getJSON(n + "identities/?identifier=" + encodeURIComponent(r.identity.identifier) + (r.identity.transient ? "&transient=true" : ""))]).then(function(h) {
|
|
230
230
|
return t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: {} }), c(h == null ? void 0 : h[0]);
|
|
231
231
|
}).catch(function(h) {
|
|
232
|
-
var
|
|
232
|
+
var f = h.message, l = new Error(f);
|
|
233
233
|
return Promise.reject(l);
|
|
234
234
|
}) : t.getJSON(n + "flags/").then(function(h) {
|
|
235
235
|
return c({ flags: h, traits: void 0 });
|
|
@@ -244,7 +244,7 @@ var Kt = { exports: {} };
|
|
|
244
244
|
}).catch(function(n) {
|
|
245
245
|
t.log("Exception fetching evaluationEvent", n);
|
|
246
246
|
}) : void 0;
|
|
247
|
-
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source:
|
|
247
|
+
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: g.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1, storageKey: void 0 }, this.getValue = function(i, n, r) {
|
|
248
248
|
var o = t.flags && t.flags[i.toLowerCase().replace(/ /g, "_")], c = null;
|
|
249
249
|
if (o && (c = o.value), n != null && n.skipAnalytics || r || t.evaluateFlag(i, "VALUE"), c === null && (n == null ? void 0 : n.fallback) !== void 0) return n.fallback;
|
|
250
250
|
if (n != null && n.json) try {
|
|
@@ -271,7 +271,7 @@ var Kt = { exports: {} };
|
|
|
271
271
|
return t.setContext(s(s({}, t.getContext()), i));
|
|
272
272
|
}, this.setTrait = function(i, n) {
|
|
273
273
|
var r;
|
|
274
|
-
if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (r = t.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits),
|
|
274
|
+
if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (r = t.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits), at(Object.fromEntries([[i, n]]))) }) }));
|
|
275
275
|
}, this.setTraits = function(i) {
|
|
276
276
|
var n;
|
|
277
277
|
if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (n = t.evaluationContext.identity) === null || n === void 0 ? void 0 : n.traits), Object.fromEntries(Object.entries(i).map(function(r) {
|
|
@@ -288,13 +288,13 @@ var Kt = { exports: {} };
|
|
|
288
288
|
}, this.getJSON = function(i, n, r) {
|
|
289
289
|
var o, c = t;
|
|
290
290
|
c.evaluationContext;
|
|
291
|
-
var h = c.headers,
|
|
292
|
-
t.evaluationContext.environment && (
|
|
291
|
+
var h = c.headers, f = { method: n || "GET", body: r, cache: "no-cache", headers: {} };
|
|
292
|
+
t.evaluationContext.environment && (f.headers["X-Environment-Key"] = t.evaluationContext.environment.apiKey), n && n !== "GET" && (f.headers["Content-Type"] = "application/json; charset=utf-8"), h && Object.assign(f.headers, h), C || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
293
293
|
var l = "".concat((o = t.evaluationContext.identity) === null || o === void 0 ? void 0 : o.identifier);
|
|
294
|
-
return C(i,
|
|
295
|
-
var F,
|
|
294
|
+
return C(i, f).then(function(p) {
|
|
295
|
+
var F, P, O = "".concat((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.identifier);
|
|
296
296
|
if (l === O) {
|
|
297
|
-
var j = (
|
|
297
|
+
var j = (P = p.headers) === null || P === void 0 ? void 0 : P.get("x-flagsmith-document-updated-at");
|
|
298
298
|
if (j) try {
|
|
299
299
|
var I = parseFloat(j);
|
|
300
300
|
if (isNaN(I)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
@@ -302,19 +302,19 @@ var Kt = { exports: {} };
|
|
|
302
302
|
} catch (A) {
|
|
303
303
|
t.log(A, "Failed to parse x-flagsmith-document-updated-at", j);
|
|
304
304
|
}
|
|
305
|
-
return t.log("Fetch response: " +
|
|
305
|
+
return t.log("Fetch response: " + p.status + " " + (n || "GET") + 0 + i), p.text().then(function(A) {
|
|
306
306
|
var k = A;
|
|
307
307
|
try {
|
|
308
308
|
k = JSON.parse(A);
|
|
309
309
|
} catch {
|
|
310
310
|
}
|
|
311
|
-
return !k &&
|
|
311
|
+
return !k && p.status && (k = "API Response: ".concat(p.status)), p.status && p.status >= 200 && p.status < 300 ? k : Promise.reject(new Error(k));
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(l, ", Current: ").concat(O));
|
|
315
315
|
});
|
|
316
316
|
}, this.evaluateFlag = function(i, n) {
|
|
317
|
-
if (t.datadogRum && (t.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? t.datadogRum.client.addFeatureFlagEvaluation(
|
|
317
|
+
if (t.datadogRum && (t.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? t.datadogRum.client.addFeatureFlagEvaluation(Gt + i, t.getValue(i, {}, !0)) : t.datadogRum.client.addFeatureFlagEvaluation(Jt + i, t.hasFeature(i, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), t.enableAnalytics) {
|
|
318
318
|
if (!t.evaluationEvent || !t.evaluationContext.environment) return;
|
|
319
319
|
t.evaluationEvent[t.evaluationContext.environment.apiKey] || (t.evaluationEvent[t.evaluationContext.environment.apiKey] = {}), t.evaluationEvent[t.evaluationContext.environment.apiKey][i] === void 0 && (t.evaluationEvent[t.evaluationContext.environment.apiKey][i] = 0), t.evaluationEvent[t.evaluationContext.environment.apiKey][i] += 1;
|
|
320
320
|
}
|
|
@@ -322,72 +322,72 @@ var Kt = { exports: {} };
|
|
|
322
322
|
}, this._onChange = function(i, n, r) {
|
|
323
323
|
var o, c;
|
|
324
324
|
t.setLoadingState(r), (o = t.onChange) === null || o === void 0 || o.call(t, i, n, t.loadingState), (c = t._trigger) === null || c === void 0 || c.call(t);
|
|
325
|
-
}, C = e.fetch ? e.fetch : typeof fetch < "u" ? fetch :
|
|
325
|
+
}, C = e.fetch ? e.fetch : typeof fetch < "u" ? fetch : lt === null || lt === void 0 ? void 0 : lt.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (vt = e.eventSource), e.AsyncStorage && (w = e.AsyncStorage);
|
|
326
326
|
}
|
|
327
327
|
return a.prototype.init = function(e) {
|
|
328
328
|
var t, i, n;
|
|
329
329
|
return T(this, void 0, void 0, function() {
|
|
330
|
-
var r, o, c, h,
|
|
330
|
+
var r, o, c, h, f, l, p, F, P, O, j, I, A, k, Q, W, $, E, y, ft, tt, Xt, q, pt, Zt, Yt, yt, Qt, mt, et, X, Wt, x = this;
|
|
331
331
|
return z(this, function(N) {
|
|
332
332
|
switch (N.label) {
|
|
333
333
|
case 0:
|
|
334
334
|
r = dt(e.evaluationContext || this.evaluationContext), N.label = 1;
|
|
335
335
|
case 1:
|
|
336
|
-
if (N.trys.push([1, 13, , 14]), o = e.environmentID, c = e.api, h = c === void 0 ?
|
|
336
|
+
if (N.trys.push([1, 13, , 14]), o = e.environmentID, c = e.api, h = c === void 0 ? Dt : c, f = e.headers, l = e.onChange, p = e.cacheFlags, F = e.datadogRum, P = e.onError, O = e.defaultFlags, j = e.fetch, I = e.preventFetch, A = e.enableLogs, k = e.enableDynatrace, Q = e.enableAnalytics, W = e.realtime, $ = e.eventSourceUrl, E = $ === void 0 ? "https://realtime.flagsmith.com/" : $, y = e.AsyncStorage, ft = e.identity, tt = e.traits, Xt = e.state, q = e.cacheOptions, pt = e.angularHttpClient, Zt = e._trigger, Yt = e._triggerLoadingState, r.environment = o ? { apiKey: o } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
337
337
|
if (r.identity = ft || tt ? { identifier: ft, traits: tt ? Object.fromEntries(Object.entries(tt).map(function(L) {
|
|
338
338
|
return [L[0], { value: L[1] }];
|
|
339
|
-
})) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers =
|
|
340
|
-
x.setLoadingState(s(s({}, x.loadingState), { isFetching: !1, isLoading: !1, error: L })),
|
|
341
|
-
}, this.enableLogs = A || !1, this.cacheOptions =
|
|
342
|
-
return function(
|
|
343
|
-
var
|
|
344
|
-
return new Promise(function(
|
|
339
|
+
})) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = f, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = l, yt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Zt || this._trigger, this._triggerLoadingState = Yt || this._triggerLoadingState, this.onError = function(L) {
|
|
340
|
+
x.setLoadingState(s(s({}, x.loadingState), { isFetching: !1, isLoading: !1, error: L })), P == null || P(L);
|
|
341
|
+
}, this.enableLogs = A || !1, this.cacheOptions = q ? { skipAPI: !!q.skipAPI, ttl: q.ttl || 0, storageKey: q.storageKey, loadStale: !!q.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), j && (C = j), this.enableAnalytics = Q || !1, this.flags = Object.assign({}, O) || {}, this.datadogRum = F || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = w !== void 0 && !!p, rt = "FLAGSMITH_EVENT_" + r.environment.apiKey, y && (w = y), W && typeof window < "u" && this.setupRealtime(E, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = s(s({}, this.loadingState), { isLoading: !1, source: g.DEFAULT_FLAGS })), this.setState(Xt), this.log("Initialising with properties", e, this), k && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), pt && (C = /* @__PURE__ */ function(L) {
|
|
342
|
+
return function(U, R) {
|
|
343
|
+
var B = R.headers, S = R.method, Z = R.body;
|
|
344
|
+
return new Promise(function(H) {
|
|
345
345
|
switch (S) {
|
|
346
346
|
case "GET":
|
|
347
|
-
return L.get(
|
|
348
|
-
|
|
347
|
+
return L.get(U, { headers: B }).subscribe(function(J) {
|
|
348
|
+
H({ ok: !0, text: function() {
|
|
349
349
|
return Promise.resolve(J);
|
|
350
350
|
} });
|
|
351
351
|
});
|
|
352
352
|
case "POST":
|
|
353
353
|
case "PUT":
|
|
354
|
-
return L.post(
|
|
355
|
-
|
|
354
|
+
return L.post(U, Z, { headers: B }).subscribe(function(J) {
|
|
355
|
+
H({ ok: !0, text: function() {
|
|
356
356
|
return Promise.resolve(J);
|
|
357
357
|
} });
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
361
|
};
|
|
362
|
-
}(pt)), w && this.canUseStorage && w.getItem(
|
|
362
|
+
}(pt)), w && this.canUseStorage && w.getItem(rt).then(function(L) {
|
|
363
363
|
try {
|
|
364
364
|
x.evaluationEvent = JSON.parse(L) || {};
|
|
365
365
|
} catch {
|
|
366
366
|
x.evaluationEvent = {};
|
|
367
367
|
}
|
|
368
368
|
x.analyticsInterval = setInterval(x.analyticsFlags, x.ticks);
|
|
369
|
-
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), w && this.canUseStorage && w.getItem(
|
|
370
|
-
if (
|
|
371
|
-
var
|
|
372
|
-
if (
|
|
373
|
-
var
|
|
374
|
-
x.log("Retrieved events from cache",
|
|
369
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), w && this.canUseStorage && w.getItem(rt, function(L, U) {
|
|
370
|
+
if (U && x.evaluationContext.environment) {
|
|
371
|
+
var R = JSON.parse(U);
|
|
372
|
+
if (R[x.evaluationContext.environment.apiKey]) {
|
|
373
|
+
var B = x.getState();
|
|
374
|
+
x.log("Retrieved events from cache", U), x.setState(s(s({}, B), { evaluationEvent: R[x.evaluationContext.environment.apiKey] }));
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
})), !
|
|
377
|
+
})), !p) return [3, 9];
|
|
378
378
|
if (!w || !this.canUseStorage) return [3, 8];
|
|
379
|
-
|
|
379
|
+
Qt = function(L, U) {
|
|
380
380
|
return T(x, void 0, void 0, function() {
|
|
381
|
-
var
|
|
381
|
+
var R, B, S, Z, H, J, St, te, Ct, bt, _t, Ft, Et, xt, wt, Ot, It, At, Lt, jt, Nt, Tt, Pt, kt, ee = this;
|
|
382
382
|
return z(this, function(V) {
|
|
383
383
|
switch (V.label) {
|
|
384
384
|
case 0:
|
|
385
|
-
if (!
|
|
386
|
-
|
|
385
|
+
if (!U) return [3, 7];
|
|
386
|
+
R = null, B = null, V.label = 1;
|
|
387
387
|
case 1:
|
|
388
|
-
return V.trys.push([1, 5, , 6]), S = JSON.parse(
|
|
389
|
-
var
|
|
390
|
-
(
|
|
388
|
+
return V.trys.push([1, 5, , 6]), S = JSON.parse(U), Z = !1, H = !1, S && S.api === this.api && ((bt = (Ct = S.evaluationContext) === null || Ct === void 0 ? void 0 : Ct.environment) === null || bt === void 0 ? void 0 : bt.apiKey) === ((_t = this.evaluationContext.environment) === null || _t === void 0 ? void 0 : _t.apiKey) && (J = !0, this.evaluationContext.identity && ((Et = (Ft = S.evaluationContext) === null || Ft === void 0 ? void 0 : Ft.identity) === null || Et === void 0 ? void 0 : Et.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((wt = (xt = S.evaluationContext) === null || xt === void 0 ? void 0 : xt.identity) === null || wt === void 0 ? void 0 : wt.identifier) + " to " + this.evaluationContext.identity.identifier), J = !1), this.cacheOptions.ttl && (!S.ts || (/* @__PURE__ */ new Date()).valueOf() - S.ts > this.cacheOptions.ttl) && (S.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), J = !1) : S.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), H = !0, J = !0)), J && (Z = !0, B = _((Ot = this.evaluationContext.identity) === null || Ot === void 0 ? void 0 : Ot.traits, (At = (It = S.evaluationContext) === null || It === void 0 ? void 0 : It.identity) === null || At === void 0 ? void 0 : At.traits), R = _(this.flags, S.flags), this.setState(s(s({}, S), { evaluationContext: dt(s(s({}, S.evaluationContext), { identity: !((Lt = S.evaluationContext) === null || Lt === void 0) && Lt.identity ? s(s({}, (jt = S.evaluationContext) === null || jt === void 0 ? void 0 : jt.identity), { traits: s(s({}, ((Tt = (Nt = S.evaluationContext) === null || Nt === void 0 ? void 0 : Nt.identity) === null || Tt === void 0 ? void 0 : Tt.traits) || {}), tt || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", S))), Z ? (St = !I && (!this.cacheOptions.skipAPI || H), this._onChange(null, { isFromServer: !1, flagsChanged: R, traitsChanged: B }, this._loadedState(null, g.CACHE, St)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Z && !H && this.log("Skipping API, using cache"), St && this.getFlags().catch(function(he) {
|
|
389
|
+
var Ut;
|
|
390
|
+
(Ut = ee.onError) === null || Ut === void 0 || Ut.call(ee, he);
|
|
391
391
|
}), [3, 4]) : [3, 2];
|
|
392
392
|
case 2:
|
|
393
393
|
return I ? [3, 4] : [4, this.getFlags()];
|
|
@@ -396,7 +396,7 @@ var Kt = { exports: {} };
|
|
|
396
396
|
case 4:
|
|
397
397
|
return [3, 6];
|
|
398
398
|
case 5:
|
|
399
|
-
return
|
|
399
|
+
return te = V.sent(), this.log("Exception fetching cached logs", te), [3, 6];
|
|
400
400
|
case 6:
|
|
401
401
|
return [3, 10];
|
|
402
402
|
case 7:
|
|
@@ -404,10 +404,10 @@ var Kt = { exports: {} };
|
|
|
404
404
|
case 8:
|
|
405
405
|
return V.sent(), [3, 10];
|
|
406
406
|
case 9:
|
|
407
|
-
if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (
|
|
407
|
+
if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Pt = this.evaluationContext.identity) === null || Pt === void 0 ? void 0 : Pt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
|
|
408
408
|
else {
|
|
409
409
|
if (!this.flags) throw new Error(yt);
|
|
410
|
-
this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (kt = this.evaluationContext.identity) === null || kt === void 0 ? void 0 : kt.traits) }, this._loadedState(null,
|
|
410
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (kt = this.evaluationContext.identity) === null || kt === void 0 ? void 0 : kt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
|
|
411
411
|
}
|
|
412
412
|
V.label = 10;
|
|
413
413
|
case 10:
|
|
@@ -423,7 +423,7 @@ var Kt = { exports: {} };
|
|
|
423
423
|
case 4:
|
|
424
424
|
mt = N.sent(), N.label = 5;
|
|
425
425
|
case 5:
|
|
426
|
-
return [4,
|
|
426
|
+
return [4, Qt(null, mt)];
|
|
427
427
|
case 6:
|
|
428
428
|
case 7:
|
|
429
429
|
return N.sent(), [3, 8];
|
|
@@ -434,13 +434,13 @@ var Kt = { exports: {} };
|
|
|
434
434
|
case 10:
|
|
435
435
|
return N.sent(), [3, 12];
|
|
436
436
|
case 11:
|
|
437
|
-
if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, O), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null,
|
|
438
|
-
else if (this.flags && (et = null, Object.keys(this.flags).length === 0 && (et = yt), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(et,
|
|
437
|
+
if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, O), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
|
|
438
|
+
else if (this.flags && (et = null, Object.keys(this.flags).length === 0 && (et = yt), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(et, g.DEFAULT_FLAGS)), et)) throw new Error(et);
|
|
439
439
|
N.label = 12;
|
|
440
440
|
case 12:
|
|
441
441
|
return [3, 14];
|
|
442
442
|
case 13:
|
|
443
|
-
throw
|
|
443
|
+
throw X = N.sent(), this.log("Error during initialisation ", X), Wt = X instanceof Error ? X : new Error("".concat(X)), (n = this.onError) === null || n === void 0 || n.call(this, Wt), X;
|
|
444
444
|
case 14:
|
|
445
445
|
return [2];
|
|
446
446
|
}
|
|
@@ -456,7 +456,7 @@ var Kt = { exports: {} };
|
|
|
456
456
|
}, a.prototype.getState = function() {
|
|
457
457
|
return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
|
|
458
458
|
}, a.prototype.setState = function(e) {
|
|
459
|
-
e && (this.initialised = !0, this.api = e.api || this.api ||
|
|
459
|
+
e && (this.initialised = !0, this.api = e.api || this.api || Dt, this.flags = e.flags || this.flags, this.evaluationContext = e.evaluationContext || this.evaluationContext, this.evaluationEvent = e.evaluationEvent || this.evaluationEvent, this.log("setState called", this));
|
|
460
460
|
}, a.prototype.logout = function() {
|
|
461
461
|
return this.evaluationContext.identity = null, this.initialised ? this.getFlags() : Promise.resolve();
|
|
462
462
|
}, a.prototype.startListening = function(e) {
|
|
@@ -477,13 +477,13 @@ var Kt = { exports: {} };
|
|
|
477
477
|
}, a.prototype.updateEventStorage = function() {
|
|
478
478
|
if (this.enableAnalytics) {
|
|
479
479
|
var e = JSON.stringify(this.getState().evaluationEvent);
|
|
480
|
-
w.setItem(
|
|
480
|
+
w.setItem(rt, e).catch(function(t) {
|
|
481
481
|
return console.error("Flagsmith: Error setting item in async storage", t);
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
}, a.prototype.setLoadingState = function(e) {
|
|
485
485
|
var t;
|
|
486
|
-
|
|
486
|
+
it(e, this.loadingState) || (this.loadingState = s({}, e), this.log("Loading state changed", e), (t = this._triggerLoadingState) === null || t === void 0 || t.call(this));
|
|
487
487
|
}, a.prototype.setupRealtime = function(e, t) {
|
|
488
488
|
var i = this, n = e + "sse/environments/" + t + "/stream";
|
|
489
489
|
vt ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new vt(n), this.eventSource.addEventListener("environment_updated", function(r) {
|
|
@@ -497,30 +497,30 @@ var Kt = { exports: {} };
|
|
|
497
497
|
})) : this.log("Error, EventSource is undefined");
|
|
498
498
|
}, a;
|
|
499
499
|
}();
|
|
500
|
-
function
|
|
500
|
+
function Vt(a) {
|
|
501
501
|
var e = a.fetch, t = a.AsyncStorage, i = a.eventSource;
|
|
502
502
|
return new le({ fetch: e, AsyncStorage: t, eventSource: i });
|
|
503
503
|
}
|
|
504
|
-
var
|
|
505
|
-
return
|
|
504
|
+
var ot, ue = (ot = function(a, e) {
|
|
505
|
+
return ot = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
|
|
506
506
|
t.__proto__ = i;
|
|
507
507
|
} || function(t, i) {
|
|
508
508
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
|
|
509
|
-
},
|
|
509
|
+
}, ot(a, e);
|
|
510
510
|
}, function(a, e) {
|
|
511
511
|
if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
512
512
|
function t() {
|
|
513
513
|
this.constructor = a;
|
|
514
514
|
}
|
|
515
|
-
|
|
516
|
-
}),
|
|
515
|
+
ot(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
|
|
516
|
+
}), zt = function(a) {
|
|
517
517
|
var e = typeof Symbol == "function" && Symbol.iterator, t = e && a[e], i = 0;
|
|
518
518
|
if (t) return t.call(a);
|
|
519
519
|
if (a && typeof a.length == "number") return { next: function() {
|
|
520
520
|
return a && i >= a.length && (a = void 0), { value: a && a[i++], done: !a };
|
|
521
521
|
} };
|
|
522
522
|
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
523
|
-
},
|
|
523
|
+
}, Ht = function(a, e) {
|
|
524
524
|
var t = typeof Symbol == "function" && a[Symbol.iterator];
|
|
525
525
|
if (!t) return a;
|
|
526
526
|
var i, n, r = t.call(a), o = [];
|
|
@@ -545,7 +545,7 @@ var Kt = { exports: {} };
|
|
|
545
545
|
Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
|
|
546
546
|
}
|
|
547
547
|
return ue(e, a), e;
|
|
548
|
-
}(Error),
|
|
548
|
+
}(Error), Mt = function() {
|
|
549
549
|
function a(e, t) {
|
|
550
550
|
var i = this;
|
|
551
551
|
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = t != null ? Object.assign({}, t) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = e.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function") throw new ce();
|
|
@@ -565,7 +565,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
565
565
|
i.onmessage(h);
|
|
566
566
|
};
|
|
567
567
|
try {
|
|
568
|
-
for (var r =
|
|
568
|
+
for (var r = zt(Object.keys(this._listeners)), o = r.next(); !o.done; o = r.next()) {
|
|
569
569
|
var c = o.value;
|
|
570
570
|
this._eventSource.addEventListener(c, this._onevent_wrapped);
|
|
571
571
|
}
|
|
@@ -594,7 +594,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
594
594
|
e && e.lastEventId && (this._lastEventId = e.lastEventId);
|
|
595
595
|
var n = this._listeners[e.type];
|
|
596
596
|
if (n != null) try {
|
|
597
|
-
for (var r =
|
|
597
|
+
for (var r = zt(gt([], Ht(n), !1)), o = r.next(); !o.done; o = r.next())
|
|
598
598
|
o.value.call(this, e);
|
|
599
599
|
} catch (c) {
|
|
600
600
|
t = { error: c };
|
|
@@ -614,7 +614,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
614
614
|
}, a.prototype.addEventListener = function(e, t, i) {
|
|
615
615
|
this._listeners[e] == null && (this._listeners[e] = [], this._eventSource != null && this._eventSource.addEventListener(e, this._onevent_wrapped));
|
|
616
616
|
var n = this._listeners[e];
|
|
617
|
-
n.includes(t) || (this._listeners[e] = gt(gt([],
|
|
617
|
+
n.includes(t) || (this._listeners[e] = gt(gt([], Ht(n), !1), [t], !1));
|
|
618
618
|
}, a.prototype.removeEventListener = function(e, t, i) {
|
|
619
619
|
var n = this._listeners[e];
|
|
620
620
|
this._listeners[e] = n.filter(function(r) {
|
|
@@ -623,7 +623,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
623
623
|
}, a;
|
|
624
624
|
}();
|
|
625
625
|
globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
|
|
626
|
-
var
|
|
626
|
+
var $t = function(a, e) {
|
|
627
627
|
return e = e || {}, new Promise(function(t, i) {
|
|
628
628
|
var n = new XMLHttpRequest(), r = [], o = [], c = {}, h = function() {
|
|
629
629
|
return { ok: (n.status / 100 | 0) == 2, statusText: n.statusText, status: n.status, url: n.responseURL, text: function() {
|
|
@@ -642,17 +642,17 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
642
642
|
return l.toLowerCase() in c;
|
|
643
643
|
} } };
|
|
644
644
|
};
|
|
645
|
-
for (var
|
|
646
|
-
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(l,
|
|
647
|
-
r.push(
|
|
645
|
+
for (var f in n.open(e.method || "get", a, !0), n.onload = function() {
|
|
646
|
+
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(l, p, F) {
|
|
647
|
+
r.push(p = p.toLowerCase()), o.push([p, F]), c[p] = c[p] ? c[p] + "," + F : F;
|
|
648
648
|
}), t(h());
|
|
649
|
-
}, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers) n.setRequestHeader(
|
|
649
|
+
}, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers) n.setRequestHeader(f, e.headers[f]);
|
|
650
650
|
n.send(e.body || null);
|
|
651
651
|
});
|
|
652
|
-
},
|
|
653
|
-
typeof window < "u" && (window.flagsmith =
|
|
654
|
-
return
|
|
655
|
-
}, d.default =
|
|
652
|
+
}, qt = Vt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
|
|
653
|
+
typeof window < "u" && (window.flagsmith = qt), d.createFlagsmithInstance = function() {
|
|
654
|
+
return Vt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
|
|
655
|
+
}, d.default = qt, Object.defineProperty(d, "__esModule", { value: !0 });
|
|
656
656
|
});
|
|
657
657
|
})(Kt, Kt.exports);
|
|
658
658
|
var ge = Kt.exports, fe = {
|
|
@@ -661,10 +661,10 @@ var ge = Kt.exports, fe = {
|
|
|
661
661
|
FETCH_FAILED: "Failed to fetch Flagsmith configuration",
|
|
662
662
|
NO_USER_CONTEXT: "User context not set. Call setUser() first.",
|
|
663
663
|
ALREADY_INITIALIZED: "FeatureFlag is already initialized."
|
|
664
|
-
},
|
|
664
|
+
}, ne = "business", K, pe = (K = class {
|
|
665
665
|
constructor() {
|
|
666
|
-
|
|
667
|
-
|
|
666
|
+
st(this, "flagsmithClient", null);
|
|
667
|
+
st(this, "userContext", null);
|
|
668
668
|
}
|
|
669
669
|
static getInstance() {
|
|
670
670
|
return K.instance || (K.instance = new K()), K.instance;
|
|
@@ -763,136 +763,122 @@ var ge = Kt.exports, fe = {
|
|
|
763
763
|
reset() {
|
|
764
764
|
this.flagsmithClient = null, this.userContext = null;
|
|
765
765
|
}
|
|
766
|
-
},
|
|
767
|
-
function me(
|
|
768
|
-
const u = () => nt.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), d = async (
|
|
766
|
+
}, st(K, "instance"), K), ye = pe.getInstance(), nt = ht(!1), ut = ht([]), Y = ht(null);
|
|
767
|
+
function me(m = ye) {
|
|
768
|
+
const u = () => nt.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), d = async (g, C = []) => {
|
|
769
769
|
if (nt.value) {
|
|
770
770
|
console.warn("FeatureFlag is already initialized.");
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
773
|
try {
|
|
774
|
-
await
|
|
774
|
+
await m.init(g, C), ut.value = await m.getFlags(), nt.value = !0, Y.value = null;
|
|
775
775
|
} catch (b) {
|
|
776
|
-
console.error("Failed to initialize feature flags:", b),
|
|
776
|
+
console.error("Failed to initialize feature flags:", b), Y.value = b;
|
|
777
777
|
}
|
|
778
|
-
}, v = async (
|
|
778
|
+
}, v = async (g) => {
|
|
779
779
|
if (u())
|
|
780
780
|
try {
|
|
781
|
-
await
|
|
781
|
+
await m.setUser(g), ut.value = await m.getFlags(), Y.value = null;
|
|
782
782
|
} catch (C) {
|
|
783
|
-
console.error("Failed to set user:", C),
|
|
783
|
+
console.error("Failed to set user:", C), Y.value = C;
|
|
784
784
|
}
|
|
785
|
-
}, s = async (
|
|
785
|
+
}, s = async (g) => v(`${ne}-${g}`), T = (g, C, b = null) => {
|
|
786
786
|
if (!u()) return b;
|
|
787
787
|
try {
|
|
788
|
-
return
|
|
788
|
+
return m.getFlagValue(g, C) ?? b;
|
|
789
789
|
} catch (G) {
|
|
790
|
-
return console.error(`Error getting flag value for ${
|
|
790
|
+
return console.error(`Error getting flag value for ${g}:`, G), b;
|
|
791
791
|
}
|
|
792
|
-
}, z = (
|
|
792
|
+
}, z = (g, C) => {
|
|
793
793
|
if (!u()) return C ?? null;
|
|
794
794
|
try {
|
|
795
|
-
return
|
|
795
|
+
return m.getFlag(g) ?? C ?? null;
|
|
796
796
|
} catch (b) {
|
|
797
|
-
return console.error(`Error getting flag for ${
|
|
797
|
+
return console.error(`Error getting flag for ${g}:`, b), C ?? null;
|
|
798
798
|
}
|
|
799
|
-
}, D = async (
|
|
799
|
+
}, D = async (g, C, b = null, G) => {
|
|
800
800
|
if (!u()) return b;
|
|
801
801
|
try {
|
|
802
|
-
return await
|
|
803
|
-
} catch (
|
|
804
|
-
return console.error(`Error getting user flag value for ${C}:`,
|
|
802
|
+
return await m.getUserFlagValue(g, C, b, G);
|
|
803
|
+
} catch (at) {
|
|
804
|
+
return console.error(`Error getting user flag value for ${C}:`, at), b;
|
|
805
805
|
}
|
|
806
|
-
},
|
|
806
|
+
}, it = async (g, C, b = null, G) => D(`${ne}-${g}`, C, b, G), _ = () => {
|
|
807
807
|
try {
|
|
808
|
-
|
|
809
|
-
} catch (
|
|
810
|
-
console.error("Error resetting feature flags:",
|
|
808
|
+
m.reset();
|
|
809
|
+
} catch (g) {
|
|
810
|
+
console.error("Error resetting feature flags:", g);
|
|
811
811
|
} finally {
|
|
812
|
-
|
|
812
|
+
ut.value = [], nt.value = !1, Y.value = null;
|
|
813
813
|
}
|
|
814
814
|
};
|
|
815
815
|
return {
|
|
816
|
-
flags:
|
|
817
|
-
isInitialized:
|
|
818
|
-
error:
|
|
816
|
+
flags: Rt(ut),
|
|
817
|
+
isInitialized: Rt(nt),
|
|
818
|
+
error: Rt(Y),
|
|
819
819
|
init: d,
|
|
820
820
|
setUser: v,
|
|
821
821
|
setBusiness: s,
|
|
822
822
|
getFlagValue: T,
|
|
823
823
|
getFlag: z,
|
|
824
824
|
getUserFlagValue: D,
|
|
825
|
-
getBusinessFlagValue:
|
|
825
|
+
getBusinessFlagValue: it,
|
|
826
826
|
reset: _
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
829
|
var Se = () => me();
|
|
830
|
-
function
|
|
831
|
-
if (!(
|
|
832
|
-
const d = (
|
|
830
|
+
function re(m, u) {
|
|
831
|
+
if (!(m != null && m.enabled)) return !1;
|
|
832
|
+
const d = (m.value ?? "").split(",").map((v) => v.trim().toUpperCase()).filter(Boolean);
|
|
833
833
|
return !d.length || d.includes("*") ? !0 : !!u && d.includes(u.toUpperCase());
|
|
834
834
|
}
|
|
835
|
-
var Ce = { firebase: { apiKey: "
|
|
836
|
-
const
|
|
835
|
+
var Ce = { 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" };
|
|
836
|
+
const ct = {
|
|
837
837
|
broadcastAppInbox: "connect_broadcast_app_inbox_countries",
|
|
838
838
|
broadcastPush: "connect_broadcast_push_countries",
|
|
839
839
|
broadcastWhatsapp: "connect_broadcast_whatsapp_countries",
|
|
840
|
-
whatsappBot: "connect_whatsapp_bot"
|
|
841
|
-
autoRevertReward: "connect_auto_revert_reward_countries"
|
|
840
|
+
whatsappBot: "connect_whatsapp_bot"
|
|
842
841
|
}, be = {
|
|
843
|
-
APP_INBOX:
|
|
844
|
-
PUSH:
|
|
845
|
-
WHATSAPP:
|
|
842
|
+
APP_INBOX: ct.broadcastAppInbox,
|
|
843
|
+
PUSH: ct.broadcastPush,
|
|
844
|
+
WHATSAPP: ct.broadcastWhatsapp
|
|
846
845
|
}, {
|
|
847
846
|
init: _e,
|
|
848
847
|
isInitialized: Fe,
|
|
849
848
|
setBusiness: Ee,
|
|
850
|
-
flags:
|
|
851
|
-
error:
|
|
852
|
-
} = Se(),
|
|
853
|
-
async function Ae(
|
|
854
|
-
|
|
849
|
+
flags: oe,
|
|
850
|
+
error: ie
|
|
851
|
+
} = Se(), M = ht("loading");
|
|
852
|
+
async function Ae(m) {
|
|
853
|
+
M.value = "loading";
|
|
855
854
|
try {
|
|
856
|
-
if (Fe.value || await _e({ apiKey: Ce.featureFlagApiKey }), await Ee(
|
|
857
|
-
|
|
855
|
+
if (Fe.value || await _e({ apiKey: Ce.featureFlagApiKey }), await Ee(m), ie.value) throw ie.value;
|
|
856
|
+
M.value = "ready";
|
|
858
857
|
} catch (u) {
|
|
859
|
-
|
|
858
|
+
M.value = "error", console.warn("CONNECT: loadBusinessFlags failed", u);
|
|
860
859
|
}
|
|
861
860
|
}
|
|
862
861
|
function Le() {
|
|
863
|
-
const
|
|
862
|
+
const m = ae();
|
|
864
863
|
return () => {
|
|
865
|
-
if (
|
|
866
|
-
if (
|
|
867
|
-
const u =
|
|
868
|
-
return
|
|
864
|
+
if (M.value === "loading") return "loading";
|
|
865
|
+
if (M.value === "error") return "off";
|
|
866
|
+
const u = oe.value.find((d) => d.feature.name === ct.whatsappBot);
|
|
867
|
+
return re(u, m.currentCountry.value) ? "on" : "off";
|
|
869
868
|
};
|
|
870
869
|
}
|
|
871
870
|
function je() {
|
|
872
|
-
const
|
|
871
|
+
const m = ae();
|
|
873
872
|
return (u) => {
|
|
874
873
|
const d = be[u];
|
|
875
|
-
return d ?
|
|
876
|
-
|
|
877
|
-
|
|
874
|
+
return d ? M.value === "loading" ? "loading" : M.value === "error" ? "off" : re(
|
|
875
|
+
oe.value.find((v) => v.feature.name === d),
|
|
876
|
+
m.currentCountry.value
|
|
878
877
|
) ? "on" : "off" : "on";
|
|
879
878
|
};
|
|
880
879
|
}
|
|
881
|
-
function Ne() {
|
|
882
|
-
const g = Dt();
|
|
883
|
-
return () => {
|
|
884
|
-
if (B.value === "loading") return "loading";
|
|
885
|
-
if (B.value === "error" || !g.currentCountry.value)
|
|
886
|
-
return "off";
|
|
887
|
-
const u = Jt.value.find(
|
|
888
|
-
(d) => d.feature.name === it.autoRevertReward
|
|
889
|
-
);
|
|
890
|
-
return typeof (u == null ? void 0 : u.value) == "string" && u.value.split(",").some((d) => d.trim()) && Gt(u, g.currentCountry.value) ? "on" : "off";
|
|
891
|
-
};
|
|
892
|
-
}
|
|
893
880
|
export {
|
|
894
881
|
je as a,
|
|
895
|
-
Ne as b,
|
|
896
882
|
Ae as l,
|
|
897
883
|
Le as u
|
|
898
884
|
};
|