@feedmepos/mf-miniprogram-v2 0.2.8-dev.1 → 0.2.8-dev.3
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-B7Mai_6F.js → App-h0NGA3Bx.js} +287 -297
- package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-BeNabALJ.js +270 -0
- package/dist/{BrandFontPicker-JHyoGusq.js → BrandFontPicker-sTKNoOX3.js} +1 -1
- package/dist/{BrandKitView-Dlt_ifI0.js → BrandKitView-DpeuJ5Mj.js} +2 -2
- package/dist/{ControlPlaneView-CBGNMsPT.js → ControlPlaneView-7i6SXbEK.js} +7641 -7395
- package/dist/{EcosystemView-Cy0N2qNK.js → EcosystemView-BUG7Dp_e.js} +5 -5
- package/dist/MobileProjectsView-DP_MBdDX.js +400 -0
- package/dist/ModuleCenterView-DdExY27I.js +165 -0
- package/dist/{ModuleDetailView-CSfMF0Uo.js → ModuleDetailView-2ZG2PgWE.js} +1 -1
- package/dist/{PagesView-DQCIwpnL.js → PagesView-CNnihrLK.js} +2 -2
- package/dist/{PlatformUnavailableView-DY2ntpNw.js → PlatformUnavailableView-ChSD6P3O.js} +1 -1
- package/dist/{PortalSettingsView-Cz566Ccd.js → PortalSettingsView-tEQ8--VB.js} +9 -9
- package/dist/TemplateCenterView-BjuZj_3I.js +515 -0
- package/dist/{WorkspaceEntryView-B28ASSit.js → WorkspaceEntryView-aesHR5VT.js} +2 -2
- package/dist/adminAccess-Bud1ltTs.js +61 -0
- package/dist/app.js +12 -12
- package/dist/{controlPlane-sXaC6pAh.js → controlPlane--Q2ulw38.js} +7 -7
- package/dist/package.json +1 -1
- package/dist/{portalContext-DV-6uUwp.js → portalContext-CzdVaxBH.js} +2 -2
- package/dist/portalNavigation-L5VwKlps.js +42 -0
- package/dist/{routes-CeuodIgg.js → routes-CJa85dEy.js} +14 -3
- package/dist/style.css +1 -1
- package/dist/{useBrandKit-CXLIXo5j.js → useBrandKit-Cw3bBugv.js} +1 -1
- package/dist/{useModuleCatalog-Cep-pzWO.js → useModuleCatalog-n2zRBLFf.js} +2 -2
- package/package.json +1 -1
- package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-LE_aKvfg.js +0 -198
- package/dist/MobileProjectsView-CvMvePvm.js +0 -333
- package/dist/ModuleCenterView-C6mCPATr.js +0 -147
- package/dist/TemplateCenterView-DqZLthqh.js +0 -426
- package/dist/adminAccess-oXC0xjvK.js +0 -48
- package/dist/portalNavigation-BBORm5cp.js +0 -34
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var ke = Object.defineProperty;
|
|
2
|
-
var je = (
|
|
3
|
-
var
|
|
4
|
-
import { readonly as
|
|
2
|
+
var je = (p, s, f) => s in p ? ke(p, s, { enumerable: !0, configurable: !0, writable: !0, value: f }) : p[s] = f;
|
|
3
|
+
var wt = (p, s, f) => je(p, typeof s != "symbol" ? s + "" : s, f);
|
|
4
|
+
import { readonly as te, ref as Z, watch as Ee, defineComponent as Te, computed as bt, onMounted as Pe, onBeforeUnmount as Ne, resolveComponent as Ot, openBlock as J, createElementBlock as Y, Fragment as ee, createElementVNode as C, normalizeClass as ne, createVNode as P, renderList as ye, unref as _, withCtx as ut, toDisplayString as ct, createBlock as be, createCommentVNode as ie } from "vue";
|
|
5
5
|
import { useCoreStore as we } from "@feedmepos/mf-common";
|
|
6
|
-
import { useRoute as Re, useRouter as
|
|
7
|
-
import { P as
|
|
8
|
-
import { r as
|
|
9
|
-
import { c as
|
|
10
|
-
import { p as De } from "./portalContext-
|
|
11
|
-
import { e as Ge, p as
|
|
6
|
+
import { useRoute as Re, useRouter as Ke, RouterView as Ue } from "vue-router";
|
|
7
|
+
import { P as St } from "./PortalIcon-DO0VrIoY.js";
|
|
8
|
+
import { r as Se, u as Me, w as Ce } from "./adminAccess-Bud1ltTs.js";
|
|
9
|
+
import { c as It } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
10
|
+
import { p as De } from "./portalContext-CzdVaxBH.js";
|
|
11
|
+
import { e as Ge, p as dt } from "./portalNavigation-L5VwKlps.js";
|
|
12
12
|
import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
-
var
|
|
14
|
-
(function(
|
|
15
|
-
(function(
|
|
13
|
+
var ae = { exports: {} };
|
|
14
|
+
(function(p, s) {
|
|
15
|
+
(function(f, v) {
|
|
16
16
|
v(s);
|
|
17
|
-
})(
|
|
17
|
+
})(It, function(f) {
|
|
18
18
|
var v = { getItemSync: function(a) {
|
|
19
19
|
try {
|
|
20
20
|
return localStorage.getItem(a) || null;
|
|
@@ -63,8 +63,8 @@ var re = { exports: {} };
|
|
|
63
63
|
}
|
|
64
64
|
function d(y) {
|
|
65
65
|
var u;
|
|
66
|
-
y.done ? n(y.value) : (u = y.value, u instanceof t ? u : new t(function(
|
|
67
|
-
|
|
66
|
+
y.done ? n(y.value) : (u = y.value, u instanceof t ? u : new t(function(b) {
|
|
67
|
+
b(u);
|
|
68
68
|
})).then(l, c);
|
|
69
69
|
}
|
|
70
70
|
d((i = i.apply(a, [])).next());
|
|
@@ -118,8 +118,8 @@ var re = { exports: {} };
|
|
|
118
118
|
continue;
|
|
119
119
|
}
|
|
120
120
|
u = e.call(a, l);
|
|
121
|
-
} catch (
|
|
122
|
-
u = [6,
|
|
121
|
+
} catch (b) {
|
|
122
|
+
u = [6, b], i = 0;
|
|
123
123
|
} finally {
|
|
124
124
|
t = n = 0;
|
|
125
125
|
}
|
|
@@ -133,7 +133,7 @@ var re = { exports: {} };
|
|
|
133
133
|
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]);
|
|
134
134
|
return a.concat(i || Array.prototype.slice.call(e));
|
|
135
135
|
}
|
|
136
|
-
var
|
|
136
|
+
var Q = function a(e, t) {
|
|
137
137
|
if (e === t) return !0;
|
|
138
138
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
139
139
|
if (e.constructor !== t.constructor) return !1;
|
|
@@ -159,13 +159,13 @@ var re = { exports: {} };
|
|
|
159
159
|
function F(a, e) {
|
|
160
160
|
var t = Object.keys(e || {}).filter(function(i) {
|
|
161
161
|
var n = a == null ? void 0 : a[i], r = e == null ? void 0 : e[i];
|
|
162
|
-
return !
|
|
162
|
+
return !Q(n, r);
|
|
163
163
|
});
|
|
164
164
|
return Object.keys(a || {}).filter(function(i) {
|
|
165
165
|
Object.keys(e || {}).includes(i) || t.push(i);
|
|
166
166
|
}), Object.keys(t).length ? t : null;
|
|
167
167
|
}
|
|
168
|
-
var
|
|
168
|
+
var h, m;
|
|
169
169
|
function E(a, e, t) {
|
|
170
170
|
var i = "shortString", n = !0;
|
|
171
171
|
typeof t == "number" && (i = "javaDouble", n = !1), a[i] = a[i] || {}, a[i][e] = n ? t + "" : t;
|
|
@@ -179,51 +179,51 @@ var re = { exports: {} };
|
|
|
179
179
|
return [t, D(i) ? i : { value: i }];
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function gt(a) {
|
|
183
183
|
return o(o({}, a), { identity: a.identity ? o(o({}, a.identity), { traits: it(a.identity.traits || {}) }) : void 0 });
|
|
184
184
|
}
|
|
185
185
|
(function(a) {
|
|
186
186
|
a.NONE = "NONE", a.DEFAULT_FLAGS = "DEFAULT_FLAGS", a.CACHE = "CACHE", a.SERVER = "SERVER";
|
|
187
|
-
})(
|
|
188
|
-
var
|
|
187
|
+
})(h || (h = {}));
|
|
188
|
+
var at, A = null, et = "FLAGSMITH_EVENT", g = et, N = "https://edge.api.flagsmith.com/api/v1/", ht = "flagsmith_value_", Ft = "flagsmith_enabled_", xt = "flagsmith_trait_", L = function() {
|
|
189
189
|
function a(e) {
|
|
190
190
|
var t = this;
|
|
191
191
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
192
192
|
var i = t, n = i.api, r = i.evaluationContext;
|
|
193
193
|
t.log("Get Flags"), t.isLoading = !0, t.loadingState.isFetching || t.setLoadingState(o(o({}, t.loadingState), { isFetching: !0 }));
|
|
194
194
|
var l = "".concat(t.getContext().identity), c = function(d) {
|
|
195
|
-
var y, u,
|
|
195
|
+
var y, u, b, k;
|
|
196
196
|
if (d && l === "".concat(t.getContext().identity)) {
|
|
197
|
-
var
|
|
197
|
+
var V = d.flags, R = d.traits, G = d.identifier;
|
|
198
198
|
t.isLoading = !1;
|
|
199
|
-
var
|
|
200
|
-
R = R || [], (
|
|
201
|
-
|
|
202
|
-
}), R.forEach(function(
|
|
203
|
-
|
|
199
|
+
var K = {}, U = {};
|
|
200
|
+
R = R || [], (V = V || []).forEach(function(S) {
|
|
201
|
+
K[S.feature.name.toLowerCase().replace(/ /g, "_")] = { id: S.feature.id, enabled: S.enabled, value: S.feature_state_value };
|
|
202
|
+
}), R.forEach(function(S) {
|
|
203
|
+
U[S.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: S.transient, value: S.trait_value };
|
|
204
204
|
}), t.oldFlags = o({}, t.flags);
|
|
205
|
-
var q = F(t.oldFlags,
|
|
206
|
-
if ((G || Object.keys(
|
|
205
|
+
var q = F(t.oldFlags, K), ft = F((y = t.evaluationContext.identity) === null || y === void 0 ? void 0 : y.traits, U);
|
|
206
|
+
if ((G || Object.keys(U).length) && (t.evaluationContext.identity = o(o({}, t.evaluationContext.identity), { traits: U }), G && (t.evaluationContext.identity.identifier = G)), t.flags = K, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: q, traitsChanged: ft }, t._loadedState(null, h.SERVER)), t.datadogRum) try {
|
|
207
207
|
if (t.datadogRum.trackTraits) {
|
|
208
208
|
var pt = {};
|
|
209
|
-
Object.keys(((u = t.evaluationContext.identity) === null || u === void 0 ? void 0 : u.traits) || {}).map(function(
|
|
210
|
-
pt[
|
|
209
|
+
Object.keys(((u = t.evaluationContext.identity) === null || u === void 0 ? void 0 : u.traits) || {}).map(function(S) {
|
|
210
|
+
pt[xt + S] = t.getTrait(S);
|
|
211
211
|
});
|
|
212
|
-
var
|
|
213
|
-
t.log("Setting Datadog user",
|
|
212
|
+
var rt = o(o(o({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((b = t.evaluationContext.identity) === null || b === void 0 ? void 0 : b.identifier) }), pt);
|
|
213
|
+
t.log("Setting Datadog user", rt), t.datadogRum.client.setUser(rt);
|
|
214
214
|
}
|
|
215
|
-
} catch (
|
|
216
|
-
console.error(
|
|
215
|
+
} catch (S) {
|
|
216
|
+
console.error(S);
|
|
217
217
|
}
|
|
218
218
|
if (t.dtrum) try {
|
|
219
219
|
var j = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
220
|
-
Object.keys(t.flags).map(function(
|
|
221
|
-
E(j,
|
|
222
|
-
}), Object.keys(((k = t.evaluationContext.identity) === null || k === void 0 ? void 0 : k.traits) || {}).map(function(
|
|
223
|
-
E(j,
|
|
220
|
+
Object.keys(t.flags).map(function(S) {
|
|
221
|
+
E(j, ht + S, t.getValue(S, { skipAnalytics: !0 })), E(j, Ft + S, t.hasFeature(S, { skipAnalytics: !0 }));
|
|
222
|
+
}), Object.keys(((k = t.evaluationContext.identity) === null || k === void 0 ? void 0 : k.traits) || {}).map(function(S) {
|
|
223
|
+
E(j, xt + S, t.getTrait(S));
|
|
224
224
|
}), t.log("Sending javaLongOrObject traits to dynatrace", j.javaLongOrObject), t.log("Sending date traits to dynatrace", j.date), t.log("Sending shortString traits to dynatrace", j.shortString), t.log("Sending javaDouble to dynatrace", j.javaDouble), t.dtrum.sendSessionProperties(j.javaLongOrObject, j.date, j.shortString, j.javaDouble);
|
|
225
|
-
} catch (
|
|
226
|
-
console.error(
|
|
225
|
+
} catch (S) {
|
|
226
|
+
console.error(S);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
};
|
|
@@ -250,7 +250,7 @@ var re = { exports: {} };
|
|
|
250
250
|
}).catch(function(n) {
|
|
251
251
|
t.log("Exception fetching evaluationEvent", n);
|
|
252
252
|
}) : void 0;
|
|
253
|
-
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source:
|
|
253
|
+
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: h.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) {
|
|
254
254
|
var l = t.flags && t.flags[i.toLowerCase().replace(/ /g, "_")], c = null;
|
|
255
255
|
if (l && (c = l.value), n != null && n.skipAnalytics || r || t.evaluateFlag(i, "VALUE"), c === null && (n == null ? void 0 : n.fallback) !== void 0) return n.fallback;
|
|
256
256
|
if (n != null && n.json) try {
|
|
@@ -269,7 +269,7 @@ var re = { exports: {} };
|
|
|
269
269
|
return [r, l == null ? void 0 : l.value];
|
|
270
270
|
}));
|
|
271
271
|
}, this.setContext = function(i) {
|
|
272
|
-
var n =
|
|
272
|
+
var n = gt(i);
|
|
273
273
|
return t.evaluationContext = o(o({}, n), { environment: n.environment || t.evaluationContext.environment }), t.initialised ? t.getFlags() : Promise.resolve();
|
|
274
274
|
}, this.getContext = function() {
|
|
275
275
|
return t.evaluationContext;
|
|
@@ -297,30 +297,30 @@ var re = { exports: {} };
|
|
|
297
297
|
var d = c.headers, y = { method: n || "GET", body: r, cache: "no-cache", headers: {} };
|
|
298
298
|
t.evaluationContext.environment && (y.headers["X-Environment-Key"] = t.evaluationContext.environment.apiKey), n && n !== "GET" && (y.headers["Content-Type"] = "application/json; charset=utf-8"), d && Object.assign(y.headers, d), m || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
299
299
|
var u = "".concat((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.identifier);
|
|
300
|
-
return m(i, y).then(function(
|
|
301
|
-
var k,
|
|
300
|
+
return m(i, y).then(function(b) {
|
|
301
|
+
var k, V, R = "".concat((k = t.evaluationContext.identity) === null || k === void 0 ? void 0 : k.identifier);
|
|
302
302
|
if (u === R) {
|
|
303
|
-
var G = (
|
|
303
|
+
var G = (V = b.headers) === null || V === void 0 ? void 0 : V.get("x-flagsmith-document-updated-at");
|
|
304
304
|
if (G) try {
|
|
305
|
-
var
|
|
306
|
-
if (isNaN(
|
|
307
|
-
t.timestamp =
|
|
308
|
-
} catch (
|
|
309
|
-
t.log(
|
|
305
|
+
var K = parseFloat(G);
|
|
306
|
+
if (isNaN(K)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
307
|
+
t.timestamp = K;
|
|
308
|
+
} catch (U) {
|
|
309
|
+
t.log(U, "Failed to parse x-flagsmith-document-updated-at", G);
|
|
310
310
|
}
|
|
311
|
-
return t.log("Fetch response: " +
|
|
312
|
-
var q =
|
|
311
|
+
return t.log("Fetch response: " + b.status + " " + (n || "GET") + 0 + i), b.text().then(function(U) {
|
|
312
|
+
var q = U;
|
|
313
313
|
try {
|
|
314
|
-
q = JSON.parse(
|
|
314
|
+
q = JSON.parse(U);
|
|
315
315
|
} catch {
|
|
316
316
|
}
|
|
317
|
-
return !q &&
|
|
317
|
+
return !q && b.status && (q = "API Response: ".concat(b.status)), b.status && b.status >= 200 && b.status < 300 ? q : Promise.reject(new Error(q));
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
320
|
t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(u, ", Current: ").concat(R));
|
|
321
321
|
});
|
|
322
322
|
}, this.evaluateFlag = function(i, n) {
|
|
323
|
-
if (t.datadogRum && (t.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? t.datadogRum.client.addFeatureFlagEvaluation(
|
|
323
|
+
if (t.datadogRum && (t.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? t.datadogRum.client.addFeatureFlagEvaluation(ht + i, t.getValue(i, {}, !0)) : t.datadogRum.client.addFeatureFlagEvaluation(Ft + i, t.hasFeature(i, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), t.enableAnalytics) {
|
|
324
324
|
if (!t.evaluationEvent || !t.evaluationContext.environment) return;
|
|
325
325
|
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;
|
|
326
326
|
}
|
|
@@ -328,36 +328,36 @@ var re = { exports: {} };
|
|
|
328
328
|
}, this._onChange = function(i, n, r) {
|
|
329
329
|
var l, c;
|
|
330
330
|
t.setLoadingState(r), (l = t.onChange) === null || l === void 0 || l.call(t, i, n, t.loadingState), (c = t._trigger) === null || c === void 0 || c.call(t);
|
|
331
|
-
}, m = e.fetch ? e.fetch : typeof fetch < "u" ? fetch :
|
|
331
|
+
}, m = e.fetch ? e.fetch : typeof fetch < "u" ? fetch : It === null || It === void 0 ? void 0 : It.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (at = e.eventSource), e.AsyncStorage && (A = e.AsyncStorage);
|
|
332
332
|
}
|
|
333
333
|
return a.prototype.init = function(e) {
|
|
334
334
|
var t, i, n;
|
|
335
335
|
return w(this, void 0, void 0, function() {
|
|
336
|
-
var r, l, c, d, y, u,
|
|
336
|
+
var r, l, c, d, y, u, b, k, V, R, G, K, U, q, ft, pt, rt, j, S, jt, mt, de, ot, Tt, ve, ge, Pt, he, Nt, yt, lt, fe, T = this;
|
|
337
337
|
return I(this, function(B) {
|
|
338
338
|
switch (B.label) {
|
|
339
339
|
case 0:
|
|
340
|
-
r =
|
|
340
|
+
r = gt(e.evaluationContext || this.evaluationContext), B.label = 1;
|
|
341
341
|
case 1:
|
|
342
|
-
if (B.trys.push([1, 13, , 14]), l = e.environmentID, c = e.api, d = c === void 0 ?
|
|
343
|
-
if (r.identity =
|
|
342
|
+
if (B.trys.push([1, 13, , 14]), l = e.environmentID, c = e.api, d = c === void 0 ? N : c, y = e.headers, u = e.onChange, b = e.cacheFlags, k = e.datadogRum, V = e.onError, R = e.defaultFlags, G = e.fetch, K = e.preventFetch, U = e.enableLogs, q = e.enableDynatrace, ft = e.enableAnalytics, pt = e.realtime, rt = e.eventSourceUrl, j = rt === void 0 ? "https://realtime.flagsmith.com/" : rt, S = e.AsyncStorage, jt = e.identity, mt = e.traits, de = e.state, ot = e.cacheOptions, Tt = e.angularHttpClient, ve = e._trigger, ge = e._triggerLoadingState, r.environment = l ? { apiKey: l } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
343
|
+
if (r.identity = jt || mt ? { identifier: jt, traits: mt ? Object.fromEntries(Object.entries(mt).map(function(M) {
|
|
344
344
|
return [M[0], { value: M[1] }];
|
|
345
|
-
})) : {} } : r.identity, this.evaluationContext = r, this.api = d, this.headers = y, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = u,
|
|
346
|
-
|
|
347
|
-
}, this.enableLogs =
|
|
348
|
-
return function(
|
|
349
|
-
var
|
|
345
|
+
})) : {} } : r.identity, this.evaluationContext = r, this.api = d, this.headers = y, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = u, Pt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = ve || this._trigger, this._triggerLoadingState = ge || this._triggerLoadingState, this.onError = function(M) {
|
|
346
|
+
T.setLoadingState(o(o({}, T.loadingState), { isFetching: !1, isLoading: !1, error: M })), V == null || V(M);
|
|
347
|
+
}, this.enableLogs = U || !1, this.cacheOptions = ot ? { skipAPI: !!ot.skipAPI, ttl: ot.ttl || 0, storageKey: ot.storageKey, loadStale: !!ot.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."), G && (m = G), this.enableAnalytics = ft || !1, this.flags = Object.assign({}, R) || {}, this.datadogRum = k || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = A !== void 0 && !!b, g = "FLAGSMITH_EVENT_" + r.environment.apiKey, S && (A = S), pt && typeof window < "u" && this.setupRealtime(j, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = o(o({}, this.loadingState), { isLoading: !1, source: h.DEFAULT_FLAGS })), this.setState(de), this.log("Initialising with properties", e, this), q && (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), Tt && (m = /* @__PURE__ */ function(M) {
|
|
348
|
+
return function(z, $) {
|
|
349
|
+
var W = $.headers, x = $.method, st = $.body;
|
|
350
350
|
return new Promise(function(nt) {
|
|
351
351
|
switch (x) {
|
|
352
352
|
case "GET":
|
|
353
|
-
return M.get(
|
|
353
|
+
return M.get(z, { headers: W }).subscribe(function(X) {
|
|
354
354
|
nt({ ok: !0, text: function() {
|
|
355
355
|
return Promise.resolve(X);
|
|
356
356
|
} });
|
|
357
357
|
});
|
|
358
358
|
case "POST":
|
|
359
359
|
case "PUT":
|
|
360
|
-
return M.post(
|
|
360
|
+
return M.post(z, st, { headers: W }).subscribe(function(X) {
|
|
361
361
|
nt({ ok: !0, text: function() {
|
|
362
362
|
return Promise.resolve(X);
|
|
363
363
|
} });
|
|
@@ -365,57 +365,57 @@ var re = { exports: {} };
|
|
|
365
365
|
}
|
|
366
366
|
});
|
|
367
367
|
};
|
|
368
|
-
}(Tt)), A && this.canUseStorage && A.getItem(
|
|
368
|
+
}(Tt)), A && this.canUseStorage && A.getItem(g).then(function(M) {
|
|
369
369
|
try {
|
|
370
|
-
|
|
370
|
+
T.evaluationEvent = JSON.parse(M) || {};
|
|
371
371
|
} catch {
|
|
372
|
-
|
|
372
|
+
T.evaluationEvent = {};
|
|
373
373
|
}
|
|
374
|
-
|
|
375
|
-
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), A && this.canUseStorage && A.getItem(
|
|
376
|
-
if (
|
|
377
|
-
var
|
|
378
|
-
if (
|
|
379
|
-
var
|
|
380
|
-
|
|
374
|
+
T.analyticsInterval = setInterval(T.analyticsFlags, T.ticks);
|
|
375
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), A && this.canUseStorage && A.getItem(g, function(M, z) {
|
|
376
|
+
if (z && T.evaluationContext.environment) {
|
|
377
|
+
var $ = JSON.parse(z);
|
|
378
|
+
if ($[T.evaluationContext.environment.apiKey]) {
|
|
379
|
+
var W = T.getState();
|
|
380
|
+
T.log("Retrieved events from cache", z), T.setState(o(o({}, W), { evaluationEvent: $[T.evaluationContext.environment.apiKey] }));
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
})), !
|
|
383
|
+
})), !b) return [3, 9];
|
|
384
384
|
if (!A || !this.canUseStorage) return [3, 8];
|
|
385
|
-
he = function(M,
|
|
386
|
-
return w(
|
|
387
|
-
var
|
|
388
|
-
return I(this, function(
|
|
389
|
-
switch (
|
|
385
|
+
he = function(M, z) {
|
|
386
|
+
return w(T, void 0, void 0, function() {
|
|
387
|
+
var $, W, x, st, nt, X, Rt, pe, Kt, Ut, Mt, Dt, Gt, Bt, Jt, Vt, qt, zt, $t, Ht, Xt, Yt, Zt, Qt, me = this;
|
|
388
|
+
return I(this, function(tt) {
|
|
389
|
+
switch (tt.label) {
|
|
390
390
|
case 0:
|
|
391
|
-
if (
|
|
392
|
-
|
|
391
|
+
if (!z) return [3, 7];
|
|
392
|
+
$ = null, W = null, tt.label = 1;
|
|
393
393
|
case 1:
|
|
394
|
-
return
|
|
395
|
-
var
|
|
396
|
-
(
|
|
394
|
+
return tt.trys.push([1, 5, , 6]), x = JSON.parse(z), st = !1, nt = !1, x && x.api === this.api && ((Ut = (Kt = x.evaluationContext) === null || Kt === void 0 ? void 0 : Kt.environment) === null || Ut === void 0 ? void 0 : Ut.apiKey) === ((Mt = this.evaluationContext.environment) === null || Mt === void 0 ? void 0 : Mt.apiKey) && (X = !0, this.evaluationContext.identity && ((Gt = (Dt = x.evaluationContext) === null || Dt === void 0 ? void 0 : Dt.identity) === null || Gt === void 0 ? void 0 : Gt.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Jt = (Bt = x.evaluationContext) === null || Bt === void 0 ? void 0 : Bt.identity) === null || Jt === void 0 ? void 0 : Jt.identifier) + " to " + this.evaluationContext.identity.identifier), X = !1), this.cacheOptions.ttl && (!x.ts || (/* @__PURE__ */ new Date()).valueOf() - x.ts > this.cacheOptions.ttl) && (x.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), X = !1) : x.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), nt = !0, X = !0)), X && (st = !0, W = F((Vt = this.evaluationContext.identity) === null || Vt === void 0 ? void 0 : Vt.traits, (zt = (qt = x.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || zt === void 0 ? void 0 : zt.traits), $ = F(this.flags, x.flags), this.setState(o(o({}, x), { evaluationContext: gt(o(o({}, x.evaluationContext), { identity: !(($t = x.evaluationContext) === null || $t === void 0) && $t.identity ? o(o({}, (Ht = x.evaluationContext) === null || Ht === void 0 ? void 0 : Ht.identity), { traits: o(o({}, ((Yt = (Xt = x.evaluationContext) === null || Xt === void 0 ? void 0 : Xt.identity) === null || Yt === void 0 ? void 0 : Yt.traits) || {}), mt || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", x))), st ? (Rt = !K && (!this.cacheOptions.skipAPI || nt), this._onChange(null, { isFromServer: !1, flagsChanged: $, traitsChanged: W }, this._loadedState(null, h.CACHE, Rt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && st && !nt && this.log("Skipping API, using cache"), Rt && this.getFlags().catch(function(Ae) {
|
|
395
|
+
var Wt;
|
|
396
|
+
(Wt = me.onError) === null || Wt === void 0 || Wt.call(me, Ae);
|
|
397
397
|
}), [3, 4]) : [3, 2];
|
|
398
398
|
case 2:
|
|
399
|
-
return
|
|
399
|
+
return K ? [3, 4] : [4, this.getFlags()];
|
|
400
400
|
case 3:
|
|
401
|
-
|
|
401
|
+
tt.sent(), tt.label = 4;
|
|
402
402
|
case 4:
|
|
403
403
|
return [3, 6];
|
|
404
404
|
case 5:
|
|
405
|
-
return pe =
|
|
405
|
+
return pe = tt.sent(), this.log("Exception fetching cached logs", pe), [3, 6];
|
|
406
406
|
case 6:
|
|
407
407
|
return [3, 10];
|
|
408
408
|
case 7:
|
|
409
|
-
return
|
|
409
|
+
return K ? [3, 9] : [4, this.getFlags()];
|
|
410
410
|
case 8:
|
|
411
|
-
return
|
|
411
|
+
return tt.sent(), [3, 10];
|
|
412
412
|
case 9:
|
|
413
|
-
if (R) this._onChange(null, { isFromServer: !1, flagsChanged: F({}, this.flags), traitsChanged: F({}, (Zt = this.evaluationContext.identity) === null || Zt === void 0 ? void 0 : Zt.traits) }, this._loadedState(null,
|
|
413
|
+
if (R) this._onChange(null, { isFromServer: !1, flagsChanged: F({}, this.flags), traitsChanged: F({}, (Zt = this.evaluationContext.identity) === null || Zt === void 0 ? void 0 : Zt.traits) }, this._loadedState(null, h.DEFAULT_FLAGS));
|
|
414
414
|
else {
|
|
415
|
-
if (!this.flags) throw new Error(
|
|
416
|
-
this._onChange(null, { isFromServer: !1, flagsChanged: F({}, this.flags), traitsChanged: F({}, (
|
|
415
|
+
if (!this.flags) throw new Error(Pt);
|
|
416
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: F({}, this.flags), traitsChanged: F({}, (Qt = this.evaluationContext.identity) === null || Qt === void 0 ? void 0 : Qt.traits) }, this._loadedState(null, h.DEFAULT_FLAGS));
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
tt.label = 10;
|
|
419
419
|
case 10:
|
|
420
420
|
return [2];
|
|
421
421
|
}
|
|
@@ -423,30 +423,30 @@ var re = { exports: {} };
|
|
|
423
423
|
});
|
|
424
424
|
}, B.label = 2;
|
|
425
425
|
case 2:
|
|
426
|
-
return B.trys.push([2, 7, , 8]), A.getItemSync ? (
|
|
426
|
+
return B.trys.push([2, 7, , 8]), A.getItemSync ? (Nt = A.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
|
|
427
427
|
case 3:
|
|
428
428
|
return [4, A.getItem(this.getStorageKey())];
|
|
429
429
|
case 4:
|
|
430
|
-
|
|
430
|
+
Nt = B.sent(), B.label = 5;
|
|
431
431
|
case 5:
|
|
432
|
-
return [4, he(null,
|
|
432
|
+
return [4, he(null, Nt)];
|
|
433
433
|
case 6:
|
|
434
434
|
case 7:
|
|
435
435
|
return B.sent(), [3, 8];
|
|
436
436
|
case 8:
|
|
437
437
|
return [3, 12];
|
|
438
438
|
case 9:
|
|
439
|
-
return
|
|
439
|
+
return K ? [3, 11] : [4, this.getFlags()];
|
|
440
440
|
case 10:
|
|
441
441
|
return B.sent(), [3, 12];
|
|
442
442
|
case 11:
|
|
443
|
-
if (R) this._onChange(null, { isFromServer: !1, flagsChanged: F({}, R), traitsChanged: F({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null,
|
|
444
|
-
else if (this.flags && (yt = null, Object.keys(this.flags).length === 0 && (yt =
|
|
443
|
+
if (R) this._onChange(null, { isFromServer: !1, flagsChanged: F({}, R), traitsChanged: F({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, h.DEFAULT_FLAGS));
|
|
444
|
+
else if (this.flags && (yt = null, Object.keys(this.flags).length === 0 && (yt = Pt), this._onChange(null, { isFromServer: !1, flagsChanged: F({}, this.flags), traitsChanged: F({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(yt, h.DEFAULT_FLAGS)), yt)) throw new Error(yt);
|
|
445
445
|
B.label = 12;
|
|
446
446
|
case 12:
|
|
447
447
|
return [3, 14];
|
|
448
448
|
case 13:
|
|
449
|
-
throw
|
|
449
|
+
throw lt = B.sent(), this.log("Error during initialisation ", lt), fe = lt instanceof Error ? lt : new Error("".concat(lt)), (n = this.onError) === null || n === void 0 || n.call(this, fe), lt;
|
|
450
450
|
case 14:
|
|
451
451
|
return [2];
|
|
452
452
|
}
|
|
@@ -462,7 +462,7 @@ var re = { exports: {} };
|
|
|
462
462
|
}, a.prototype.getState = function() {
|
|
463
463
|
return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
|
|
464
464
|
}, a.prototype.setState = function(e) {
|
|
465
|
-
e && (this.initialised = !0, this.api = e.api || this.api ||
|
|
465
|
+
e && (this.initialised = !0, this.api = e.api || this.api || N, this.flags = e.flags || this.flags, this.evaluationContext = e.evaluationContext || this.evaluationContext, this.evaluationEvent = e.evaluationEvent || this.evaluationEvent, this.log("setState called", this));
|
|
466
466
|
}, a.prototype.logout = function() {
|
|
467
467
|
return this.evaluationContext.identity = null, this.initialised ? this.getFlags() : Promise.resolve();
|
|
468
468
|
}, a.prototype.startListening = function(e) {
|
|
@@ -483,16 +483,16 @@ var re = { exports: {} };
|
|
|
483
483
|
}, a.prototype.updateEventStorage = function() {
|
|
484
484
|
if (this.enableAnalytics) {
|
|
485
485
|
var e = JSON.stringify(this.getState().evaluationEvent);
|
|
486
|
-
A.setItem(
|
|
486
|
+
A.setItem(g, e).catch(function(t) {
|
|
487
487
|
return console.error("Flagsmith: Error setting item in async storage", t);
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
490
|
}, a.prototype.setLoadingState = function(e) {
|
|
491
491
|
var t;
|
|
492
|
-
|
|
492
|
+
Q(e, this.loadingState) || (this.loadingState = o({}, e), this.log("Loading state changed", e), (t = this._triggerLoadingState) === null || t === void 0 || t.call(this));
|
|
493
493
|
}, a.prototype.setupRealtime = function(e, t) {
|
|
494
494
|
var i = this, n = e + "sse/environments/" + t + "/stream";
|
|
495
|
-
|
|
495
|
+
at ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new at(n), this.eventSource.addEventListener("environment_updated", function(r) {
|
|
496
496
|
var l;
|
|
497
497
|
try {
|
|
498
498
|
l = JSON.parse(r.data).updated_at;
|
|
@@ -503,22 +503,22 @@ var re = { exports: {} };
|
|
|
503
503
|
})) : this.log("Error, EventSource is undefined");
|
|
504
504
|
}, a;
|
|
505
505
|
}();
|
|
506
|
-
function
|
|
506
|
+
function re(a) {
|
|
507
507
|
var e = a.fetch, t = a.AsyncStorage, i = a.eventSource;
|
|
508
|
-
return new
|
|
508
|
+
return new L({ fetch: e, AsyncStorage: t, eventSource: i });
|
|
509
509
|
}
|
|
510
|
-
var
|
|
511
|
-
return
|
|
510
|
+
var Et, Ie = (Et = function(a, e) {
|
|
511
|
+
return Et = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
|
|
512
512
|
t.__proto__ = i;
|
|
513
513
|
} || function(t, i) {
|
|
514
514
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
|
|
515
|
-
},
|
|
515
|
+
}, Et(a, e);
|
|
516
516
|
}, function(a, e) {
|
|
517
517
|
if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
518
518
|
function t() {
|
|
519
519
|
this.constructor = a;
|
|
520
520
|
}
|
|
521
|
-
|
|
521
|
+
Et(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
|
|
522
522
|
}), oe = function(a) {
|
|
523
523
|
var e = typeof Symbol == "function" && Symbol.iterator, t = e && a[e], i = 0;
|
|
524
524
|
if (t) return t.call(a);
|
|
@@ -542,7 +542,7 @@ var re = { exports: {} };
|
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
return l;
|
|
545
|
-
},
|
|
545
|
+
}, kt = function(a, e, t) {
|
|
546
546
|
if (arguments.length === 2) 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]);
|
|
547
547
|
return a.concat(i || Array.prototype.slice.call(e));
|
|
548
548
|
}, Le = function(a) {
|
|
@@ -600,7 +600,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
600
600
|
e && e.lastEventId && (this._lastEventId = e.lastEventId);
|
|
601
601
|
var n = this._listeners[e.type];
|
|
602
602
|
if (n != null) try {
|
|
603
|
-
for (var r = oe(
|
|
603
|
+
for (var r = oe(kt([], le(n), !1)), l = r.next(); !l.done; l = r.next())
|
|
604
604
|
l.value.call(this, e);
|
|
605
605
|
} catch (c) {
|
|
606
606
|
t = { error: c };
|
|
@@ -620,7 +620,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
620
620
|
}, a.prototype.addEventListener = function(e, t, i) {
|
|
621
621
|
this._listeners[e] == null && (this._listeners[e] = [], this._eventSource != null && this._eventSource.addEventListener(e, this._onevent_wrapped));
|
|
622
622
|
var n = this._listeners[e];
|
|
623
|
-
n.includes(t) || (this._listeners[e] =
|
|
623
|
+
n.includes(t) || (this._listeners[e] = kt(kt([], le(n), !1), [t], !1));
|
|
624
624
|
}, a.prototype.removeEventListener = function(e, t, i) {
|
|
625
625
|
var n = this._listeners[e];
|
|
626
626
|
this._listeners[e] = n.filter(function(r) {
|
|
@@ -649,37 +649,37 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
649
649
|
} } };
|
|
650
650
|
};
|
|
651
651
|
for (var y in n.open(e.method || "get", a, !0), n.onload = function() {
|
|
652
|
-
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(u,
|
|
653
|
-
r.push(
|
|
652
|
+
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(u, b, k) {
|
|
653
|
+
r.push(b = b.toLowerCase()), l.push([b, k]), c[b] = c[b] ? c[b] + "," + k : k;
|
|
654
654
|
}), t(d());
|
|
655
655
|
}, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers) n.setRequestHeader(y, e.headers[y]);
|
|
656
656
|
n.send(e.body || null);
|
|
657
657
|
});
|
|
658
|
-
}, ce =
|
|
659
|
-
typeof window < "u" && (window.flagsmith = ce),
|
|
660
|
-
return
|
|
661
|
-
},
|
|
658
|
+
}, ce = re({ AsyncStorage: v, fetch: ue, eventSource: se });
|
|
659
|
+
typeof window < "u" && (window.flagsmith = ce), f.createFlagsmithInstance = function() {
|
|
660
|
+
return re({ AsyncStorage: v, fetch: ue, eventSource: se });
|
|
661
|
+
}, f.default = ce, Object.defineProperty(f, "__esModule", { value: !0 });
|
|
662
662
|
});
|
|
663
|
-
})(
|
|
664
|
-
var Je =
|
|
663
|
+
})(ae, ae.exports);
|
|
664
|
+
var Je = ae.exports, Ve = {
|
|
665
665
|
NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first."
|
|
666
|
-
}, _e = "business",
|
|
666
|
+
}, _e = "business", H, qe = (H = class {
|
|
667
667
|
constructor() {
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
wt(this, "flagsmithClient", null);
|
|
669
|
+
wt(this, "userContext", null);
|
|
670
670
|
}
|
|
671
671
|
static getInstance() {
|
|
672
|
-
return
|
|
672
|
+
return H.instance || (H.instance = new H()), H.instance;
|
|
673
673
|
}
|
|
674
674
|
ensureInitialized() {
|
|
675
675
|
if (!this.flagsmithClient)
|
|
676
676
|
throw new Error(Ve.NOT_INITIALIZED);
|
|
677
677
|
}
|
|
678
|
-
async init(s,
|
|
678
|
+
async init(s, f = []) {
|
|
679
679
|
if (!this.flagsmithClient)
|
|
680
680
|
try {
|
|
681
681
|
this.flagsmithClient = Je.createFlagsmithInstance();
|
|
682
|
-
const v =
|
|
682
|
+
const v = f.reduce((o, w) => (o[w.feature.name] = w, o), {});
|
|
683
683
|
await this.flagsmithClient.init({
|
|
684
684
|
environmentID: s.apiKey,
|
|
685
685
|
api: (s == null ? void 0 : s.url) ?? "https://feature-flag-proxy.feedme.farm/api/v1/",
|
|
@@ -709,11 +709,11 @@ var Je = re.exports, Ve = {
|
|
|
709
709
|
async getFlags() {
|
|
710
710
|
this.ensureInitialized();
|
|
711
711
|
const s = this.flagsmithClient.getAllFlags();
|
|
712
|
-
return Object.entries(s).map(([
|
|
712
|
+
return Object.entries(s).map(([f, v]) => {
|
|
713
713
|
var o;
|
|
714
714
|
return {
|
|
715
715
|
feature: {
|
|
716
|
-
name:
|
|
716
|
+
name: f,
|
|
717
717
|
id: (v == null ? void 0 : v.id) ?? 0
|
|
718
718
|
},
|
|
719
719
|
enabled: v.enabled,
|
|
@@ -721,22 +721,22 @@ var Je = re.exports, Ve = {
|
|
|
721
721
|
};
|
|
722
722
|
});
|
|
723
723
|
}
|
|
724
|
-
getFlagValue(s,
|
|
724
|
+
getFlagValue(s, f) {
|
|
725
725
|
this.ensureInitialized();
|
|
726
726
|
const v = this.flagsmithClient.getValue(s);
|
|
727
727
|
if (v == null)
|
|
728
728
|
return null;
|
|
729
729
|
try {
|
|
730
730
|
const o = v.toString();
|
|
731
|
-
return
|
|
731
|
+
return f ? f(o) : typeof {} == "number" ? isNaN(Number(o)) ? null : Number(o) : typeof {} == "boolean" ? o.toLowerCase() === "true" : o;
|
|
732
732
|
} catch (o) {
|
|
733
733
|
return console.error("Error transforming flag value:", o), null;
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
getFlag(s) {
|
|
737
737
|
this.ensureInitialized();
|
|
738
|
-
const
|
|
739
|
-
if (
|
|
738
|
+
const f = this.flagsmithClient.getValue(s);
|
|
739
|
+
if (f == null) return null;
|
|
740
740
|
const v = this.flagsmithClient.hasFeature(s);
|
|
741
741
|
return {
|
|
742
742
|
feature: {
|
|
@@ -744,16 +744,16 @@ var Je = re.exports, Ve = {
|
|
|
744
744
|
id: 0
|
|
745
745
|
},
|
|
746
746
|
enabled: v,
|
|
747
|
-
value:
|
|
747
|
+
value: f.toString()
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
|
-
async getUserFlagValue(s,
|
|
750
|
+
async getUserFlagValue(s, f, v = null, o) {
|
|
751
751
|
var I;
|
|
752
752
|
const w = this.userContext;
|
|
753
753
|
try {
|
|
754
|
-
return await this.setUser(s), this.getFlagValue(
|
|
754
|
+
return await this.setUser(s), this.getFlagValue(f, o) ?? v;
|
|
755
755
|
} catch (O) {
|
|
756
|
-
return console.error(`Error getting user flag value for ${
|
|
756
|
+
return console.error(`Error getting user flag value for ${f}:`, O), v;
|
|
757
757
|
} finally {
|
|
758
758
|
try {
|
|
759
759
|
await ((I = this.flagsmithClient) == null ? void 0 : I.logout()), this.userContext = null, w && await this.setUser(w.identifier);
|
|
@@ -765,66 +765,66 @@ var Je = re.exports, Ve = {
|
|
|
765
765
|
reset() {
|
|
766
766
|
this.flagsmithClient = null, this.userContext = null;
|
|
767
767
|
}
|
|
768
|
-
},
|
|
769
|
-
function $e(
|
|
770
|
-
const s = () => Ct.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1),
|
|
768
|
+
}, wt(H, "instance"), H), ze = qe.getInstance(), Ct = Z(!1), Lt = Z([]), vt = Z(null);
|
|
769
|
+
function $e(p = ze) {
|
|
770
|
+
const s = () => Ct.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), f = async (h, m = []) => {
|
|
771
771
|
if (Ct.value) {
|
|
772
772
|
console.warn("FeatureFlag is already initialized.");
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
775
|
try {
|
|
776
|
-
await
|
|
776
|
+
await p.init(h, m), Lt.value = await p.getFlags(), Ct.value = !0, vt.value = null;
|
|
777
777
|
} catch (E) {
|
|
778
|
-
console.error("Failed to initialize feature flags:", E),
|
|
778
|
+
console.error("Failed to initialize feature flags:", E), vt.value = E;
|
|
779
779
|
}
|
|
780
|
-
}, v = async (
|
|
780
|
+
}, v = async (h) => {
|
|
781
781
|
if (s())
|
|
782
782
|
try {
|
|
783
|
-
await
|
|
783
|
+
await p.setUser(h), Lt.value = await p.getFlags(), vt.value = null;
|
|
784
784
|
} catch (m) {
|
|
785
|
-
console.error("Failed to set user:", m),
|
|
785
|
+
console.error("Failed to set user:", m), vt.value = m;
|
|
786
786
|
}
|
|
787
|
-
}, o = async (
|
|
787
|
+
}, o = async (h) => v(`${_e}-${h}`), w = (h, m, E = null) => {
|
|
788
788
|
if (!s()) return E;
|
|
789
789
|
try {
|
|
790
|
-
return
|
|
790
|
+
return p.getFlagValue(h, m) ?? E;
|
|
791
791
|
} catch (D) {
|
|
792
|
-
return console.error(`Error getting flag value for ${
|
|
792
|
+
return console.error(`Error getting flag value for ${h}:`, D), E;
|
|
793
793
|
}
|
|
794
|
-
}, I = (
|
|
794
|
+
}, I = (h, m) => {
|
|
795
795
|
if (!s()) return m ?? null;
|
|
796
796
|
try {
|
|
797
|
-
return
|
|
797
|
+
return p.getFlag(h) ?? m ?? null;
|
|
798
798
|
} catch (E) {
|
|
799
|
-
return console.error(`Error getting flag for ${
|
|
799
|
+
return console.error(`Error getting flag for ${h}:`, E), m ?? null;
|
|
800
800
|
}
|
|
801
|
-
}, O = async (
|
|
801
|
+
}, O = async (h, m, E = null, D) => {
|
|
802
802
|
if (!s()) return E;
|
|
803
803
|
try {
|
|
804
|
-
return await
|
|
804
|
+
return await p.getUserFlagValue(h, m, E, D);
|
|
805
805
|
} catch (it) {
|
|
806
806
|
return console.error(`Error getting user flag value for ${m}:`, it), E;
|
|
807
807
|
}
|
|
808
|
-
},
|
|
808
|
+
}, Q = async (h, m, E = null, D) => O(`${_e}-${h}`, m, E, D), F = () => {
|
|
809
809
|
try {
|
|
810
|
-
|
|
811
|
-
} catch (
|
|
812
|
-
console.error("Error resetting feature flags:",
|
|
810
|
+
p.reset();
|
|
811
|
+
} catch (h) {
|
|
812
|
+
console.error("Error resetting feature flags:", h);
|
|
813
813
|
} finally {
|
|
814
|
-
|
|
814
|
+
Lt.value = [], Ct.value = !1, vt.value = null;
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
817
|
return {
|
|
818
|
-
flags:
|
|
819
|
-
isInitialized:
|
|
820
|
-
error:
|
|
821
|
-
init:
|
|
818
|
+
flags: te(Lt),
|
|
819
|
+
isInitialized: te(Ct),
|
|
820
|
+
error: te(vt),
|
|
821
|
+
init: f,
|
|
822
822
|
setUser: v,
|
|
823
823
|
setBusiness: o,
|
|
824
824
|
getFlagValue: w,
|
|
825
825
|
getFlag: I,
|
|
826
826
|
getUserFlagValue: O,
|
|
827
|
-
getBusinessFlagValue:
|
|
827
|
+
getBusinessFlagValue: Q,
|
|
828
828
|
reset: F
|
|
829
829
|
};
|
|
830
830
|
}
|
|
@@ -833,13 +833,13 @@ const Fe = {
|
|
|
833
833
|
dev: "MaGoXrEWuEJNpWgKTqseee",
|
|
834
834
|
prod: "6GhcttsJ9Rj9cTevcdrpin"
|
|
835
835
|
}, He = "order_miniprogram_v2", xe = 1e4, _t = Z("pending");
|
|
836
|
-
let
|
|
837
|
-
function
|
|
838
|
-
if (
|
|
839
|
-
const { init: s } = Oe(),
|
|
836
|
+
let At = null;
|
|
837
|
+
function Xe(p) {
|
|
838
|
+
if (At) return At;
|
|
839
|
+
const { init: s } = Oe(), f = p === "prod" ? Fe.prod : Fe.dev;
|
|
840
840
|
let v;
|
|
841
|
-
return
|
|
842
|
-
s({ apiKey:
|
|
841
|
+
return At = Promise.race([
|
|
842
|
+
s({ apiKey: f }),
|
|
843
843
|
new Promise((o, w) => {
|
|
844
844
|
v = setTimeout(() => w(new Error(`Flagsmith init exceeded ${xe}ms`)), xe);
|
|
845
845
|
})
|
|
@@ -849,23 +849,23 @@ function Ye(f) {
|
|
|
849
849
|
_t.value = "failed", console.warn("[FeatureFlag] init failed:", o);
|
|
850
850
|
}).finally(() => {
|
|
851
851
|
clearTimeout(v);
|
|
852
|
-
}),
|
|
852
|
+
}), At;
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function Ye(p) {
|
|
855
855
|
try {
|
|
856
|
-
const s = typeof
|
|
856
|
+
const s = typeof p == "string" ? JSON.parse(p) : p;
|
|
857
857
|
return s === !0 || s === "true" || (s == null ? void 0 : s.enabled) === !0 || (s == null ? void 0 : s.enabled) === "true";
|
|
858
858
|
} catch {
|
|
859
|
-
return
|
|
859
|
+
return p === !0 || p === "true";
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function Ze(p, s, f) {
|
|
863
863
|
const v = we(), { getBusinessFlagValue: o } = Oe(), w = Z(s), I = Z(!0);
|
|
864
864
|
let O = 0;
|
|
865
|
-
async function
|
|
865
|
+
async function Q() {
|
|
866
866
|
var m;
|
|
867
|
-
const F = ++O,
|
|
868
|
-
if (!
|
|
867
|
+
const F = ++O, h = (m = v.currentBusiness.value) == null ? void 0 : m._id;
|
|
868
|
+
if (!h || _t.value === "failed") {
|
|
869
869
|
w.value = s, I.value = !1;
|
|
870
870
|
return;
|
|
871
871
|
}
|
|
@@ -875,9 +875,9 @@ function Qe(f, s, p) {
|
|
|
875
875
|
}
|
|
876
876
|
I.value = !0;
|
|
877
877
|
try {
|
|
878
|
-
const E = await o(
|
|
878
|
+
const E = await o(h, p, s);
|
|
879
879
|
if (F !== O) return;
|
|
880
|
-
w.value =
|
|
880
|
+
w.value = f ? f(E) : E;
|
|
881
881
|
} catch {
|
|
882
882
|
if (F !== O) return;
|
|
883
883
|
w.value = s;
|
|
@@ -888,233 +888,223 @@ function Qe(f, s, p) {
|
|
|
888
888
|
return Ee([() => {
|
|
889
889
|
var F;
|
|
890
890
|
return (F = v.currentBusiness.value) == null ? void 0 : F._id;
|
|
891
|
-
}, _t],
|
|
891
|
+
}, _t], Q, { immediate: !0 }), { value: w, loading: I };
|
|
892
892
|
}
|
|
893
|
-
function
|
|
894
|
-
const { value:
|
|
895
|
-
return { enabled:
|
|
893
|
+
function Qe() {
|
|
894
|
+
const { value: p, loading: s } = Ze(He, !1, Ye);
|
|
895
|
+
return { enabled: p, loading: s };
|
|
896
896
|
}
|
|
897
|
-
const We =
|
|
898
|
-
function tn() {
|
|
899
|
-
if (typeof window > "u") return !1;
|
|
900
|
-
try {
|
|
901
|
-
const f = new URLSearchParams(window.location.search).get(We);
|
|
902
|
-
return f !== null && f !== "0" && f !== "false";
|
|
903
|
-
} catch {
|
|
904
|
-
return !1;
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
const en = {
|
|
897
|
+
const We = {
|
|
908
898
|
key: 0,
|
|
909
899
|
class: "portal-sidebar",
|
|
910
900
|
"aria-label": "Mini Program navigation"
|
|
911
|
-
},
|
|
901
|
+
}, tn = ["aria-expanded", "aria-label"], en = {
|
|
912
902
|
id: "miniprogram-navigation",
|
|
913
903
|
class: "portal-nav"
|
|
914
|
-
},
|
|
904
|
+
}, nn = { class: "portal-nav-label" }, an = { class: "portal-nav-label" }, rn = { class: "portal-main" }, on = {
|
|
915
905
|
key: 0,
|
|
916
906
|
class: "portal-breadcrumb",
|
|
917
907
|
"aria-label": "Breadcrumb"
|
|
918
|
-
},
|
|
908
|
+
}, ln = {
|
|
919
909
|
id: "miniprogram-content",
|
|
920
910
|
class: "portal-content",
|
|
921
911
|
tabindex: "-1"
|
|
922
|
-
},
|
|
912
|
+
}, sn = {
|
|
923
913
|
key: 0,
|
|
924
914
|
class: "portal-empty"
|
|
925
|
-
},
|
|
915
|
+
}, un = {
|
|
926
916
|
key: 1,
|
|
927
917
|
class: "portal-loading",
|
|
928
918
|
role: "status"
|
|
929
|
-
},
|
|
919
|
+
}, cn = {
|
|
930
920
|
key: 2,
|
|
931
921
|
class: "portal-empty"
|
|
932
|
-
},
|
|
922
|
+
}, dn = {
|
|
933
923
|
key: 3,
|
|
934
924
|
class: "portal-empty",
|
|
935
925
|
role: "alert"
|
|
936
|
-
},
|
|
926
|
+
}, vn = /* @__PURE__ */ Te({
|
|
937
927
|
__name: "App",
|
|
938
|
-
setup(
|
|
939
|
-
const s = Re(),
|
|
940
|
-
Ee(o.businessId, async (
|
|
941
|
-
const N = Ge(s,
|
|
928
|
+
setup(p) {
|
|
929
|
+
const s = Re(), f = Ke(), v = we(), o = De(), w = Z(!1);
|
|
930
|
+
Ee(o.businessId, async (et, g) => {
|
|
931
|
+
const N = Ge(s, g, et);
|
|
942
932
|
if (N) {
|
|
943
933
|
w.value = !0;
|
|
944
934
|
try {
|
|
945
|
-
await
|
|
935
|
+
await f.replace(N);
|
|
946
936
|
} finally {
|
|
947
937
|
w.value = !1;
|
|
948
938
|
}
|
|
949
939
|
}
|
|
950
|
-
}),
|
|
951
|
-
const I =
|
|
952
|
-
|
|
940
|
+
}), Xe(v.namespace.value);
|
|
941
|
+
const I = Qe(), O = bt(() => s.name === "miniprogram-v2-project"), Q = bt(() => I.loading.value || I.enabled.value), F = Z(
|
|
942
|
+
Se(
|
|
953
943
|
"mpv2:portal-collapsed",
|
|
954
944
|
typeof window < "u" && window.matchMedia("(max-width: 1000px)").matches
|
|
955
945
|
)
|
|
956
|
-
),
|
|
946
|
+
), h = Z(Se("mpv2:editor-collapsed", !0)), m = bt(() => O.value ? h.value : F.value), E = bt(
|
|
957
947
|
() => {
|
|
958
|
-
var
|
|
959
|
-
return O.value ? (
|
|
948
|
+
var et;
|
|
949
|
+
return O.value ? (et = o.context.value) == null ? void 0 : et.project.name : String(s.meta.title ?? "Ecosystem");
|
|
960
950
|
}
|
|
961
951
|
), D = [
|
|
962
952
|
{ name: "miniprogram-v2-ecosystem", label: "Ecosystem", icon: "ecosystem" },
|
|
963
953
|
{ name: "miniprogram-v2-brand-kit", label: "Brand Kit", icon: "brand" },
|
|
964
954
|
{ name: "miniprogram-v2-pages", label: "Pages", icon: "pages" }
|
|
965
|
-
], it =
|
|
966
|
-
let
|
|
967
|
-
|
|
968
|
-
|
|
955
|
+
], it = bt(() => ({ name: "miniprogram-v2-mobile-projects", query: dt(s.query) })), gt = Me();
|
|
956
|
+
let at = !1;
|
|
957
|
+
Pe(() => {
|
|
958
|
+
at = v.hideSidebar.value, v.hideSidebar.value = !0;
|
|
969
959
|
}), Ne(() => {
|
|
970
|
-
v.hideSidebar.value =
|
|
960
|
+
v.hideSidebar.value = at;
|
|
971
961
|
});
|
|
972
|
-
function
|
|
973
|
-
O.value ? (
|
|
962
|
+
function A() {
|
|
963
|
+
O.value ? (h.value = !h.value, Ce("mpv2:editor-collapsed", h.value)) : (F.value = !F.value, Ce("mpv2:portal-collapsed", F.value));
|
|
974
964
|
}
|
|
975
|
-
return (
|
|
976
|
-
const N =
|
|
977
|
-
return J(),
|
|
978
|
-
|
|
965
|
+
return (et, g) => {
|
|
966
|
+
const N = Ot("RouterLink"), ht = Ot("FmIcon"), Ft = Ot("FmCircularProgress"), xt = Ot("FmButton");
|
|
967
|
+
return J(), Y(ee, null, [
|
|
968
|
+
g[14] || (g[14] = C("link", {
|
|
979
969
|
href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0..1,0",
|
|
980
970
|
rel: "stylesheet"
|
|
981
971
|
}, null, -1)),
|
|
982
972
|
C("div", {
|
|
983
|
-
class:
|
|
973
|
+
class: ne(["mpv2-app portal-shell", { "portal-shell--collapsed": m.value }])
|
|
984
974
|
}, [
|
|
985
|
-
|
|
975
|
+
g[13] || (g[13] = C("a", {
|
|
986
976
|
class: "portal-skip",
|
|
987
977
|
href: "#miniprogram-content"
|
|
988
978
|
}, "Skip to content", -1)),
|
|
989
|
-
|
|
979
|
+
Q.value ? (J(), Y("aside", We, [
|
|
990
980
|
C("button", {
|
|
991
981
|
class: "portal-sidebar-toggle",
|
|
992
982
|
type: "button",
|
|
993
983
|
"aria-expanded": !m.value,
|
|
994
984
|
"aria-controls": "miniprogram-navigation",
|
|
995
985
|
"aria-label": m.value ? "Expand navigation" : "Collapse navigation",
|
|
996
|
-
onClick:
|
|
986
|
+
onClick: A
|
|
997
987
|
}, [
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
], 8,
|
|
1001
|
-
C("nav",
|
|
1002
|
-
(J(),
|
|
988
|
+
P(St, { name: "collapse" }),
|
|
989
|
+
g[0] || (g[0] = C("span", { class: "portal-nav-label" }, "Mini Program", -1))
|
|
990
|
+
], 8, tn),
|
|
991
|
+
C("nav", en, [
|
|
992
|
+
(J(), Y(ee, null, ye(D, (L) => P(N, {
|
|
1003
993
|
key: L.name,
|
|
1004
|
-
to: { name: L.name, query: _(
|
|
994
|
+
to: { name: L.name, query: _(dt)(_(s).query) },
|
|
1005
995
|
class: "portal-nav-item",
|
|
1006
996
|
title: L.label,
|
|
1007
997
|
"aria-label": L.label,
|
|
1008
998
|
"aria-current": _(s).name === L.name ? "page" : void 0
|
|
1009
999
|
}, {
|
|
1010
|
-
default:
|
|
1011
|
-
|
|
1000
|
+
default: ut(() => [
|
|
1001
|
+
P(St, {
|
|
1012
1002
|
name: L.icon
|
|
1013
1003
|
}, null, 8, ["name"]),
|
|
1014
|
-
C("span",
|
|
1004
|
+
C("span", nn, ct(L.label), 1)
|
|
1015
1005
|
]),
|
|
1016
1006
|
_: 2
|
|
1017
1007
|
}, 1032, ["to", "title", "aria-label", "aria-current"])), 64)),
|
|
1018
|
-
|
|
1019
|
-
|
|
1008
|
+
g[4] || (g[4] = C("p", { class: "portal-nav-caption" }, "Platforms", -1)),
|
|
1009
|
+
P(N, {
|
|
1020
1010
|
to: it.value,
|
|
1021
|
-
class:
|
|
1011
|
+
class: ne(["portal-nav-item", { "router-link-active": O.value }]),
|
|
1022
1012
|
title: "Mobile Ordering",
|
|
1023
1013
|
"aria-label": "Mobile Ordering",
|
|
1024
1014
|
"aria-current": O.value ? "page" : void 0
|
|
1025
1015
|
}, {
|
|
1026
|
-
default:
|
|
1027
|
-
|
|
1028
|
-
|
|
1016
|
+
default: ut(() => [
|
|
1017
|
+
P(St, { name: "mobile" }),
|
|
1018
|
+
g[1] || (g[1] = C("span", { class: "portal-nav-label" }, "Mobile Ordering", -1))
|
|
1029
1019
|
]),
|
|
1030
1020
|
_: 1
|
|
1031
1021
|
}, 8, ["to", "class", "aria-current"]),
|
|
1032
|
-
(J(),
|
|
1022
|
+
(J(), Y(ee, null, ye(["tablet", "kiosk"], (L) => P(N, {
|
|
1033
1023
|
key: L,
|
|
1034
|
-
to: { name: `miniprogram-v2-${L}`, query: _(
|
|
1024
|
+
to: { name: `miniprogram-v2-${L}`, query: _(dt)(_(s).query) },
|
|
1035
1025
|
class: "portal-nav-item",
|
|
1036
1026
|
title: L === "tablet" ? "Tablet" : "Kiosk",
|
|
1037
1027
|
"aria-label": L === "tablet" ? "Tablet" : "Kiosk"
|
|
1038
1028
|
}, {
|
|
1039
|
-
default:
|
|
1040
|
-
|
|
1041
|
-
C("span",
|
|
1029
|
+
default: ut(() => [
|
|
1030
|
+
P(St, { name: L }, null, 8, ["name"]),
|
|
1031
|
+
C("span", an, ct(L === "tablet" ? "Tablet" : "Kiosk"), 1)
|
|
1042
1032
|
]),
|
|
1043
1033
|
_: 2
|
|
1044
1034
|
}, 1032, ["to", "title", "aria-label"])), 64)),
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
to: { name: "miniprogram-v2-module-center", query: _(
|
|
1048
|
-
class:
|
|
1035
|
+
g[5] || (g[5] = C("div", { class: "portal-nav-divider" }, null, -1)),
|
|
1036
|
+
P(N, {
|
|
1037
|
+
to: { name: "miniprogram-v2-module-center", query: _(dt)(_(s).query) },
|
|
1038
|
+
class: ne(["portal-nav-item", { "router-link-active": _(s).name === "miniprogram-v2-module-detail" }]),
|
|
1049
1039
|
title: "Module library",
|
|
1050
1040
|
"aria-label": "Module library"
|
|
1051
1041
|
}, {
|
|
1052
|
-
default:
|
|
1053
|
-
|
|
1042
|
+
default: ut(() => [
|
|
1043
|
+
P(ht, {
|
|
1054
1044
|
name: "widgets",
|
|
1055
1045
|
size: "md"
|
|
1056
1046
|
}),
|
|
1057
|
-
|
|
1047
|
+
g[2] || (g[2] = C("span", { class: "portal-nav-label" }, "Module library", -1))
|
|
1058
1048
|
]),
|
|
1059
1049
|
_: 1
|
|
1060
1050
|
}, 8, ["to", "class"]),
|
|
1061
|
-
_(
|
|
1051
|
+
_(gt) ? (J(), be(N, {
|
|
1062
1052
|
key: 0,
|
|
1063
|
-
to: { name: "miniprogram-v2-template-center", query: _(
|
|
1053
|
+
to: { name: "miniprogram-v2-template-center", query: _(dt)(_(s).query) },
|
|
1064
1054
|
class: "portal-nav-item",
|
|
1065
1055
|
title: "Template library",
|
|
1066
1056
|
"aria-label": "Template library"
|
|
1067
1057
|
}, {
|
|
1068
|
-
default:
|
|
1069
|
-
|
|
1058
|
+
default: ut(() => [
|
|
1059
|
+
P(ht, {
|
|
1070
1060
|
name: "dashboard_customize",
|
|
1071
1061
|
size: "md"
|
|
1072
1062
|
}),
|
|
1073
|
-
|
|
1063
|
+
g[3] || (g[3] = C("span", { class: "portal-nav-label" }, "Template library", -1))
|
|
1074
1064
|
]),
|
|
1075
1065
|
_: 1
|
|
1076
|
-
}, 8, ["to"])) :
|
|
1066
|
+
}, 8, ["to"])) : ie("", !0)
|
|
1077
1067
|
]),
|
|
1078
|
-
|
|
1079
|
-
to: { name: "miniprogram-v2-settings", query: _(
|
|
1068
|
+
P(N, {
|
|
1069
|
+
to: { name: "miniprogram-v2-settings", query: _(dt)(_(s).query) },
|
|
1080
1070
|
class: "portal-nav-item portal-settings-link",
|
|
1081
1071
|
title: "Settings",
|
|
1082
1072
|
"aria-label": "Settings"
|
|
1083
1073
|
}, {
|
|
1084
|
-
default:
|
|
1085
|
-
|
|
1086
|
-
|
|
1074
|
+
default: ut(() => [
|
|
1075
|
+
P(St, { name: "settings" }),
|
|
1076
|
+
g[6] || (g[6] = C("span", { class: "portal-nav-label" }, "Settings", -1))
|
|
1087
1077
|
]),
|
|
1088
1078
|
_: 1
|
|
1089
1079
|
}, 8, ["to"])
|
|
1090
|
-
])) :
|
|
1091
|
-
C("div",
|
|
1092
|
-
O.value ?
|
|
1093
|
-
C("span", null,
|
|
1094
|
-
|
|
1095
|
-
C("span", null,
|
|
1096
|
-
|
|
1080
|
+
])) : ie("", !0),
|
|
1081
|
+
C("div", rn, [
|
|
1082
|
+
O.value ? ie("", !0) : (J(), Y("header", on, [
|
|
1083
|
+
C("span", null, ct(_(o).businessName.value), 1),
|
|
1084
|
+
g[7] || (g[7] = C("span", { "aria-hidden": "true" }, "/", -1)),
|
|
1085
|
+
C("span", null, ct(E.value), 1),
|
|
1086
|
+
g[8] || (g[8] = C("div", {
|
|
1097
1087
|
id: "portal-page-actions",
|
|
1098
1088
|
class: "portal-page-actions"
|
|
1099
1089
|
}, null, -1))
|
|
1100
1090
|
])),
|
|
1101
|
-
C("div",
|
|
1102
|
-
_(o).businessId.value ? _(o).loading.value || _(I).loading.value || w.value ? (J(),
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
])) : _(I).enabled.value ? _(o).error.value ? (J(),
|
|
1106
|
-
|
|
1107
|
-
C("p", null,
|
|
1108
|
-
|
|
1091
|
+
C("div", ln, [
|
|
1092
|
+
_(o).businessId.value ? _(o).loading.value || _(I).loading.value || w.value ? (J(), Y("div", un, [
|
|
1093
|
+
P(Ft, { size: "xl" }),
|
|
1094
|
+
g[10] || (g[10] = C("span", null, "Loading your Mini Program…", -1))
|
|
1095
|
+
])) : _(I).enabled.value ? _(o).error.value ? (J(), Y("section", dn, [
|
|
1096
|
+
g[12] || (g[12] = C("h1", null, "Could not open this Mini Program", -1)),
|
|
1097
|
+
C("p", null, ct(_(o).error.value), 1),
|
|
1098
|
+
P(xt, {
|
|
1109
1099
|
label: "Try again",
|
|
1110
1100
|
onClick: _(o).refresh
|
|
1111
1101
|
}, null, 8, ["onClick"])
|
|
1112
|
-
])) : (J(),
|
|
1113
|
-
key: `${_(o).businessId.value}:${_(s).params.projectId ?? String(_(s).name)}`
|
|
1114
|
-
})) : (J(),
|
|
1115
|
-
|
|
1116
|
-
C("p", null, " It is still rolling out. Your FeedMe contact can enable it for " +
|
|
1117
|
-
])) : (J(),
|
|
1102
|
+
])) : (J(), be(_(Ue), {
|
|
1103
|
+
key: `${_(o).businessId.value}:${_(s).params.projectId ?? String(_(s).name)}:${_(s).query.tpl === "1"}`
|
|
1104
|
+
})) : (J(), Y("section", cn, [
|
|
1105
|
+
g[11] || (g[11] = C("h1", null, "Mini Program is not available for this business", -1)),
|
|
1106
|
+
C("p", null, " It is still rolling out. Your FeedMe contact can enable it for " + ct(_(o).businessName.value) + ". ", 1)
|
|
1107
|
+
])) : (J(), Y("section", sn, [...g[9] || (g[9] = [
|
|
1118
1108
|
C("h1", null, "Select a business", -1),
|
|
1119
1109
|
C("p", null, "Choose a business in the Portal header to open its Mini Program.", -1)
|
|
1120
1110
|
])]))
|
|
@@ -1124,7 +1114,7 @@ const en = {
|
|
|
1124
1114
|
], 64);
|
|
1125
1115
|
};
|
|
1126
1116
|
}
|
|
1127
|
-
}),
|
|
1117
|
+
}), Fn = /* @__PURE__ */ Be(vn, [["__scopeId", "data-v-c8bbad9a"]]);
|
|
1128
1118
|
export {
|
|
1129
|
-
|
|
1119
|
+
Fn as default
|
|
1130
1120
|
};
|