@sesamy/sesamy-js 1.113.2 → 1.115.0
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/bootstrap.iife.js +1 -0
- package/dist/bootstrap.mjs +37 -0
- package/dist/capsule-plugin.iife.js +1 -1
- package/dist/capsule-plugin.mjs +177 -103
- package/dist/sesamy-js.cjs +7 -7
- package/dist/sesamy-js.d.ts +14 -0
- package/dist/sesamy-js.iife.js +7 -7
- package/dist/sesamy-js.mjs +1210 -1112
- package/package.json +8 -4
package/dist/sesamy-js.mjs
CHANGED
|
@@ -2516,7 +2516,25 @@ function Zn(e) {
|
|
|
2516
2516
|
document.cookie = `${Yn}=${e}; path=/; max-age=${t}; SameSite=Lax${n}`;
|
|
2517
2517
|
} catch {}
|
|
2518
2518
|
}
|
|
2519
|
-
function Qn(
|
|
2519
|
+
function Qn() {
|
|
2520
|
+
try {
|
|
2521
|
+
let e = document.getElementById("sesamy-server-state");
|
|
2522
|
+
return e?.textContent ? JSON.parse(e.textContent) : null;
|
|
2523
|
+
} catch {
|
|
2524
|
+
return null;
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
function $n(e) {
|
|
2528
|
+
try {
|
|
2529
|
+
let t = e.split(".");
|
|
2530
|
+
if (t.length !== 3) return null;
|
|
2531
|
+
let n = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4);
|
|
2532
|
+
return JSON.parse(atob(r));
|
|
2533
|
+
} catch {
|
|
2534
|
+
return null;
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
function er(e = {}) {
|
|
2520
2538
|
let t = e.baseUrl ?? "", n = "", r = !1, i = null, a = null, o = "sesamy:userinfo";
|
|
2521
2539
|
function s() {
|
|
2522
2540
|
try {
|
|
@@ -2537,8 +2555,20 @@ function Qn(e = {}) {
|
|
|
2537
2555
|
} catch {}
|
|
2538
2556
|
}
|
|
2539
2557
|
async function l() {
|
|
2558
|
+
let e = window;
|
|
2559
|
+
if (!e.__sesamyBoot) return null;
|
|
2560
|
+
try {
|
|
2561
|
+
let t = await e.__sesamyBoot;
|
|
2562
|
+
return delete e.__sesamyBoot, t;
|
|
2563
|
+
} catch {
|
|
2564
|
+
return delete e.__sesamyBoot, null;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
async function u() {
|
|
2540
2568
|
let e = s();
|
|
2541
2569
|
if (e) return e;
|
|
2570
|
+
let n = await l();
|
|
2571
|
+
if (n) return n.authenticated && c(n), n;
|
|
2542
2572
|
try {
|
|
2543
2573
|
let e = await fetch(`${t}/auth/userinfo`, {
|
|
2544
2574
|
credentials: "include",
|
|
@@ -2551,10 +2581,27 @@ function Qn(e = {}) {
|
|
|
2551
2581
|
return q(`[cookie-auth] Failed to fetch userinfo: ${e.message}`), null;
|
|
2552
2582
|
}
|
|
2553
2583
|
}
|
|
2554
|
-
let
|
|
2584
|
+
let d = {
|
|
2555
2585
|
async init(e) {
|
|
2556
|
-
|
|
2557
|
-
|
|
2586
|
+
n = e.vendorId || e.clientId || "", q(`[cookie-auth] Initializing with baseUrl: ${t}`);
|
|
2587
|
+
let o = Qn(), s = e.idToken || o?.idToken;
|
|
2588
|
+
if (s) {
|
|
2589
|
+
let e = $n(s);
|
|
2590
|
+
if (e && typeof e.exp == "number" && e.exp > Date.now() / 1e3) {
|
|
2591
|
+
let t = {
|
|
2592
|
+
...e,
|
|
2593
|
+
authenticated: !0
|
|
2594
|
+
};
|
|
2595
|
+
i = !0, a = t, Zn(!0), c(t), q(`[cookie-auth] Using server-injected id-token for sub: ${e.sub}`), Wn(J.AUTHENTICATED, {
|
|
2596
|
+
sub: e.sub,
|
|
2597
|
+
appState: void 0
|
|
2598
|
+
}), r = !0, Wn(J.AUTH_INITIALIZED, {});
|
|
2599
|
+
return;
|
|
2600
|
+
}
|
|
2601
|
+
q("[cookie-auth] Server-injected id-token is expired or invalid — falling through");
|
|
2602
|
+
}
|
|
2603
|
+
if (Xn()) {
|
|
2604
|
+
let e = await u();
|
|
2558
2605
|
e === null ? q("[cookie-auth] userinfo fetch failed transiently; retaining session hint") : e.authenticated && e.sub ? (i = !0, a = e, Zn(!0), Wn(J.AUTHENTICATED, {
|
|
2559
2606
|
sub: e.sub,
|
|
2560
2607
|
appState: void 0
|
|
@@ -2565,7 +2612,7 @@ function Qn(e = {}) {
|
|
|
2565
2612
|
async isAuthenticated() {
|
|
2566
2613
|
if (!r) return !1;
|
|
2567
2614
|
if (i !== null) return i;
|
|
2568
|
-
let e = await
|
|
2615
|
+
let e = await u();
|
|
2569
2616
|
return e === null ? (q("[cookie-auth] userinfo fetch failed transiently in isAuthenticated; will retry"), !1) : (i = e.authenticated, i);
|
|
2570
2617
|
},
|
|
2571
2618
|
async getTokenSilently(e, t) {
|
|
@@ -2574,7 +2621,7 @@ function Qn(e = {}) {
|
|
|
2574
2621
|
async getUser() {
|
|
2575
2622
|
if (!r) return null;
|
|
2576
2623
|
if (a) return a;
|
|
2577
|
-
let e = await
|
|
2624
|
+
let e = await u();
|
|
2578
2625
|
return e?.authenticated && e.sub ? (a = e, a) : null;
|
|
2579
2626
|
},
|
|
2580
2627
|
async login(e) {
|
|
@@ -2583,10 +2630,10 @@ function Qn(e = {}) {
|
|
|
2583
2630
|
i.searchParams.set("return_to", r), window.location.href = i.toString();
|
|
2584
2631
|
},
|
|
2585
2632
|
async loginWithRedirect(e) {
|
|
2586
|
-
return
|
|
2633
|
+
return d.login(e);
|
|
2587
2634
|
},
|
|
2588
2635
|
async loginWithPopup(e) {
|
|
2589
|
-
return q("[cookie-auth] loginWithPopup called — falling back to redirect"),
|
|
2636
|
+
return q("[cookie-auth] loginWithPopup called — falling back to redirect"), d.login(e);
|
|
2590
2637
|
},
|
|
2591
2638
|
async logout(e) {
|
|
2592
2639
|
i = !1, a = null, Zn(!1), c(null), Wn(J.LOGOUT, {});
|
|
@@ -2594,51 +2641,51 @@ function Qn(e = {}) {
|
|
|
2594
2641
|
r.searchParams.set("return_to", n), e?.localOnly && r.searchParams.set("local_only", "true"), window.location.href = r.toString();
|
|
2595
2642
|
}
|
|
2596
2643
|
};
|
|
2597
|
-
return
|
|
2644
|
+
return d;
|
|
2598
2645
|
}
|
|
2599
2646
|
//#endregion
|
|
2600
2647
|
//#region src/services/auth/index.ts
|
|
2601
2648
|
zn();
|
|
2602
|
-
var
|
|
2603
|
-
function
|
|
2649
|
+
var tr = "sesamyAccessToken", nr = !1;
|
|
2650
|
+
function rr() {
|
|
2604
2651
|
let e = Jn();
|
|
2605
2652
|
if (!e) throw Error("[sesamy-js] No auth plugin registered. This should not happen.");
|
|
2606
2653
|
return e;
|
|
2607
2654
|
}
|
|
2608
|
-
async function
|
|
2655
|
+
async function ir(e) {
|
|
2609
2656
|
if (e.enabled === !1) {
|
|
2610
|
-
q("Auth disabled via config"),
|
|
2657
|
+
q("Auth disabled via config"), nr = !0;
|
|
2611
2658
|
return;
|
|
2612
2659
|
}
|
|
2613
|
-
e.useHttpCookies ? (q("useHttpCookies=true — using cookie-based BFF plugin"), qn(
|
|
2614
|
-
}
|
|
2615
|
-
async function rr() {
|
|
2616
|
-
return er ? tr().isAuthenticated() : !1;
|
|
2617
|
-
}
|
|
2618
|
-
async function ir(e = !0, t = !1) {
|
|
2619
|
-
return er ? tr().getTokenSilently(e, t) : null;
|
|
2660
|
+
e.useHttpCookies ? (q("useHttpCookies=true — using cookie-based BFF plugin"), qn(er())) : Jn() || (q("No auth plugin registered — falling back to cookie-based BFF plugin"), qn(er())), await rr().init(e), nr = !0;
|
|
2620
2661
|
}
|
|
2621
2662
|
async function ar() {
|
|
2622
|
-
return
|
|
2663
|
+
return nr ? rr().isAuthenticated() : !1;
|
|
2623
2664
|
}
|
|
2624
|
-
async function or(e) {
|
|
2625
|
-
return
|
|
2665
|
+
async function or(e = !0, t = !1) {
|
|
2666
|
+
return nr ? rr().getTokenSilently(e, t) : null;
|
|
2626
2667
|
}
|
|
2627
|
-
async function sr(
|
|
2628
|
-
return
|
|
2668
|
+
async function sr() {
|
|
2669
|
+
return nr ? rr().getUser() : null;
|
|
2629
2670
|
}
|
|
2630
2671
|
async function cr(e) {
|
|
2631
|
-
return
|
|
2672
|
+
return rr().login(e);
|
|
2632
2673
|
}
|
|
2633
|
-
async function lr(e
|
|
2634
|
-
return
|
|
2674
|
+
async function lr(e) {
|
|
2675
|
+
return rr().loginWithRedirect(e);
|
|
2635
2676
|
}
|
|
2636
2677
|
async function ur(e) {
|
|
2678
|
+
return rr().loginWithPopup(e);
|
|
2679
|
+
}
|
|
2680
|
+
async function dr(e = {}) {
|
|
2681
|
+
return rr().logout(e);
|
|
2682
|
+
}
|
|
2683
|
+
async function fr(e) {
|
|
2637
2684
|
let t = e.split(".");
|
|
2638
2685
|
if (t.length !== 3) throw Error("Invalid token");
|
|
2639
2686
|
let n = decodeURIComponent(atob(t[1].replace(/-/g, "+").replace(/_/g, "/")).split("").map((e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")), r = JSON.parse(n);
|
|
2640
2687
|
if (!r?.exp || r.exp < Date.now() / 1e3) throw Error("Invalid token");
|
|
2641
|
-
q("Set token"), localStorage.setItem(
|
|
2688
|
+
q("Set token"), localStorage.setItem(tr, e);
|
|
2642
2689
|
let { triggerEvent: i } = await Promise.resolve().then(() => (Gn(), Hn)), { Events: a } = await Promise.resolve().then(() => (Vn(), Bn));
|
|
2643
2690
|
i(a.AUTHENTICATED, {
|
|
2644
2691
|
...r,
|
|
@@ -2647,7 +2694,7 @@ async function ur(e) {
|
|
|
2647
2694
|
}
|
|
2648
2695
|
//#endregion
|
|
2649
2696
|
//#region ../../node_modules/.pnpm/wretch@2.11.1/node_modules/wretch/dist/middlewares/dedupe.js
|
|
2650
|
-
var
|
|
2697
|
+
var pr = (e, t) => t.skipDedupe || t.method !== "GET", mr = (e, t) => t.method + "@" + e, hr = (e) => e.clone(), gr = ({ skip: e = pr, key: t = mr, resolver: n = hr } = {}) => {
|
|
2651
2698
|
let r = /* @__PURE__ */ new Map();
|
|
2652
2699
|
return (i) => (a, o) => {
|
|
2653
2700
|
if (e(a, o)) return i(a, o);
|
|
@@ -2664,7 +2711,7 @@ var dr = (e, t) => t.skipDedupe || t.method !== "GET", fr = (e, t) => t.method +
|
|
|
2664
2711
|
return r.delete(s), Promise.reject(e);
|
|
2665
2712
|
}
|
|
2666
2713
|
};
|
|
2667
|
-
},
|
|
2714
|
+
}, _r = (e, t) => e * t, vr = (e) => e && e.ok, yr = ({ delayTimer: e = 500, delayRamp: t = _r, maxAttempts: n = 10, until: r = vr, onRetry: i = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: o = !1, skip: s } = {}) => (c) => (l, u) => {
|
|
2668
2715
|
let d = 0;
|
|
2669
2716
|
if (s && s(l, u)) return c(l, u);
|
|
2670
2717
|
let f = (s, p) => Promise.resolve(r(s, p)).then((r) => r ? s && o ? s : p ? Promise.reject(p) : s : (d++, !n || d <= n ? new Promise((n) => {
|
|
@@ -2687,7 +2734,7 @@ var dr = (e, t) => t.skipDedupe || t.method !== "GET", fr = (e, t) => t.method +
|
|
|
2687
2734
|
if (!a) throw e;
|
|
2688
2735
|
return f(null, e);
|
|
2689
2736
|
});
|
|
2690
|
-
},
|
|
2737
|
+
}, br = class e extends Error {
|
|
2691
2738
|
status;
|
|
2692
2739
|
statusText;
|
|
2693
2740
|
url;
|
|
@@ -2707,20 +2754,20 @@ var dr = (e, t) => t.skipDedupe || t.method !== "GET", fr = (e, t) => t.method +
|
|
|
2707
2754
|
isNotFoundError() {
|
|
2708
2755
|
return this.status === 404;
|
|
2709
2756
|
}
|
|
2710
|
-
},
|
|
2711
|
-
function
|
|
2757
|
+
}, xr = /* @__PURE__ */ ((e) => (e.BROWSER = "browser", e.NORMAL = "normal", e))(xr || {}), Sr = "application/json", Cr = "Content-Type", wr = Symbol(), Tr = Symbol();
|
|
2758
|
+
function Er(e = {}) {
|
|
2712
2759
|
let t = e instanceof Array ? Object.fromEntries(e) : e;
|
|
2713
|
-
return Object.entries(t).find(([e]) => e.toLowerCase() ===
|
|
2760
|
+
return Object.entries(t).find(([e]) => e.toLowerCase() === Cr.toLowerCase())?.[1];
|
|
2714
2761
|
}
|
|
2715
|
-
function
|
|
2762
|
+
function Dr(e) {
|
|
2716
2763
|
return /^application\/.*json.*/.test(e);
|
|
2717
2764
|
}
|
|
2718
|
-
var
|
|
2765
|
+
var Or = function(e, t, n = !1) {
|
|
2719
2766
|
return Object.entries(t).reduce((t, [r, i]) => {
|
|
2720
2767
|
let a = e[r];
|
|
2721
|
-
return Array.isArray(a) && Array.isArray(i) ? t[r] = n ? [...a, ...i] : i : typeof a == "object" && typeof i == "object" ? t[r] =
|
|
2768
|
+
return Array.isArray(a) && Array.isArray(i) ? t[r] = n ? [...a, ...i] : i : typeof a == "object" && typeof i == "object" ? t[r] = Or(a, i, n) : t[r] = i, t;
|
|
2722
2769
|
}, { ...e });
|
|
2723
|
-
},
|
|
2770
|
+
}, kr = {
|
|
2724
2771
|
options: {},
|
|
2725
2772
|
errorType: "text",
|
|
2726
2773
|
polyfills: {},
|
|
@@ -2730,23 +2777,23 @@ var Er = function(e, t, n = !1) {
|
|
|
2730
2777
|
return n && i ? new i(...r) : i;
|
|
2731
2778
|
}
|
|
2732
2779
|
};
|
|
2733
|
-
function
|
|
2734
|
-
|
|
2780
|
+
function Ar(e, t = !1) {
|
|
2781
|
+
kr.options = t ? e : Or(kr.options, e);
|
|
2735
2782
|
}
|
|
2736
|
-
function
|
|
2737
|
-
|
|
2783
|
+
function jr(e, t = !1) {
|
|
2784
|
+
kr.polyfills = t ? e : Or(kr.polyfills, e);
|
|
2738
2785
|
}
|
|
2739
|
-
function
|
|
2740
|
-
|
|
2786
|
+
function Mr(e) {
|
|
2787
|
+
kr.errorType = e;
|
|
2741
2788
|
}
|
|
2742
|
-
var
|
|
2789
|
+
var Nr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Pr = class extends Error {}, Fr = (e) => {
|
|
2743
2790
|
let t = /* @__PURE__ */ Object.create(null);
|
|
2744
2791
|
e = e._addons.reduce((n, r) => r.beforeRequest && r.beforeRequest(n, e._options, t) || n, e);
|
|
2745
|
-
let { _url: n, _options: r, _config: i, _catchers: a, _resolvers: o, _middlewares: s, _addons: c } = e, l = new Map(a), u =
|
|
2746
|
-
throw { [
|
|
2792
|
+
let { _url: n, _options: r, _config: i, _catchers: a, _resolvers: o, _middlewares: s, _addons: c } = e, l = new Map(a), u = Or(i.options, r), d = n, f = Nr(s)((e, t) => (d = e, i.polyfill("fetch")(e, t)))(n, u), p = /* @__PURE__ */ Error(), m = f.catch((e) => {
|
|
2793
|
+
throw { [wr]: e };
|
|
2747
2794
|
}).then((e) => {
|
|
2748
2795
|
if (!e.ok) {
|
|
2749
|
-
let t = new
|
|
2796
|
+
let t = new Pr();
|
|
2750
2797
|
if (t.cause = p, t.stack = t.stack + "\nCAUSE: " + p.stack, t.response = e, t.status = e.status, t.url = d, e.type === "opaque") throw t;
|
|
2751
2798
|
let n = i.errorType === "json" || e.headers.get("Content-Type")?.split(";")[0] === "application/json";
|
|
2752
2799
|
return (i.errorType ? n ? e.text() : e[i.errorType]() : Promise.resolve(e.body)).then((r) => {
|
|
@@ -2761,9 +2808,9 @@ var jr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Mr = class extends
|
|
|
2761
2808
|
}
|
|
2762
2809
|
return e;
|
|
2763
2810
|
}), h = (t) => t.catch((t) => {
|
|
2764
|
-
let n = Object.prototype.hasOwnProperty.call(t,
|
|
2811
|
+
let n = Object.prototype.hasOwnProperty.call(t, wr), r = n ? t[wr] : t, i = r?.status && l.get(r.status) || l.get(r?.name) || n && l.has(wr) && l.get(wr);
|
|
2765
2812
|
if (i) return i(r, e);
|
|
2766
|
-
let a = l.get(
|
|
2813
|
+
let a = l.get(Tr);
|
|
2767
2814
|
if (a) return a(r, e);
|
|
2768
2815
|
throw r;
|
|
2769
2816
|
}), g = (e) => (t) => h(e ? m.then((t) => t && t[e]()).then((e) => t ? t(e) : e) : m.then((e) => t ? t(e) : e)), _ = {
|
|
@@ -2798,17 +2845,17 @@ var jr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Mr = class extends
|
|
|
2798
2845
|
return this.error(500, e);
|
|
2799
2846
|
},
|
|
2800
2847
|
fetchError(e) {
|
|
2801
|
-
return this.error(
|
|
2848
|
+
return this.error(wr, e);
|
|
2802
2849
|
}
|
|
2803
2850
|
}, v = c.reduce((e, t) => ({
|
|
2804
2851
|
...e,
|
|
2805
2852
|
...typeof t.resolver == "function" ? t.resolver(e) : t.resolver
|
|
2806
2853
|
}), _);
|
|
2807
2854
|
return o.reduce((t, n) => n(t, e), v);
|
|
2808
|
-
},
|
|
2855
|
+
}, Ir = {
|
|
2809
2856
|
_url: "",
|
|
2810
2857
|
_options: {},
|
|
2811
|
-
_config:
|
|
2858
|
+
_config: kr,
|
|
2812
2859
|
_catchers: /* @__PURE__ */ new Map(),
|
|
2813
2860
|
_resolvers: [],
|
|
2814
2861
|
_deferred: [],
|
|
@@ -2835,7 +2882,7 @@ var jr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Mr = class extends
|
|
|
2835
2882
|
...this,
|
|
2836
2883
|
_config: {
|
|
2837
2884
|
...this._config,
|
|
2838
|
-
polyfills: t ? e :
|
|
2885
|
+
polyfills: t ? e : Or(this._config.polyfills, e)
|
|
2839
2886
|
}
|
|
2840
2887
|
};
|
|
2841
2888
|
},
|
|
@@ -2853,21 +2900,21 @@ var jr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Mr = class extends
|
|
|
2853
2900
|
options(e, t = !1) {
|
|
2854
2901
|
return {
|
|
2855
2902
|
...this,
|
|
2856
|
-
_options: t ? e :
|
|
2903
|
+
_options: t ? e : Or(this._options, e)
|
|
2857
2904
|
};
|
|
2858
2905
|
},
|
|
2859
2906
|
headers(e) {
|
|
2860
2907
|
let t = e ? Array.isArray(e) ? Object.fromEntries(e) : "entries" in e ? Object.fromEntries(e.entries()) : e : {};
|
|
2861
2908
|
return {
|
|
2862
2909
|
...this,
|
|
2863
|
-
_options:
|
|
2910
|
+
_options: Or(this._options, { headers: t })
|
|
2864
2911
|
};
|
|
2865
2912
|
},
|
|
2866
2913
|
accept(e) {
|
|
2867
2914
|
return this.headers({ Accept: e });
|
|
2868
2915
|
},
|
|
2869
2916
|
content(e) {
|
|
2870
|
-
return this.headers({ [
|
|
2917
|
+
return this.headers({ [Cr]: e });
|
|
2871
2918
|
},
|
|
2872
2919
|
auth(e) {
|
|
2873
2920
|
return this.headers({ Authorization: e });
|
|
@@ -2880,7 +2927,7 @@ var jr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Mr = class extends
|
|
|
2880
2927
|
};
|
|
2881
2928
|
},
|
|
2882
2929
|
catcherFallback(e) {
|
|
2883
|
-
return this.catcher(
|
|
2930
|
+
return this.catcher(Tr, e);
|
|
2884
2931
|
},
|
|
2885
2932
|
resolve(e, t = !1) {
|
|
2886
2933
|
return {
|
|
@@ -2901,8 +2948,8 @@ var jr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Mr = class extends
|
|
|
2901
2948
|
};
|
|
2902
2949
|
},
|
|
2903
2950
|
fetch(e = this._options.method, t = "", n = null) {
|
|
2904
|
-
let r = this.url(t).options({ method: e }), i =
|
|
2905
|
-
return r = n ? o ? r.json(n, i) : r.body(n) : r,
|
|
2951
|
+
let r = this.url(t).options({ method: e }), i = Er(r._options.headers), a = this._config.polyfill("FormData", !1), o = typeof n == "object" && !(a && n instanceof a) && (!r._options.headers || !i || Dr(i));
|
|
2952
|
+
return r = n ? o ? r.json(n, i) : r.body(n) : r, Fr(r._deferred.reduce((e, t) => t(e, e._url, e._options), r));
|
|
2906
2953
|
},
|
|
2907
2954
|
get(e = "") {
|
|
2908
2955
|
return this.fetch("GET", e);
|
|
@@ -2935,19 +2982,19 @@ var jr = (e) => (t) => e.reduceRight((e, t) => t(e), t) || t, Mr = class extends
|
|
|
2935
2982
|
};
|
|
2936
2983
|
},
|
|
2937
2984
|
json(e, t) {
|
|
2938
|
-
let n =
|
|
2939
|
-
return this.content(t ||
|
|
2985
|
+
let n = Er(this._options.headers);
|
|
2986
|
+
return this.content(t || Dr(n) && n || Sr).body(JSON.stringify(e));
|
|
2940
2987
|
}
|
|
2941
2988
|
};
|
|
2942
|
-
function
|
|
2989
|
+
function Lr(e = "", t = {}) {
|
|
2943
2990
|
return {
|
|
2944
|
-
...
|
|
2991
|
+
...Ir,
|
|
2945
2992
|
_url: e,
|
|
2946
2993
|
_options: t
|
|
2947
2994
|
};
|
|
2948
2995
|
}
|
|
2949
|
-
|
|
2950
|
-
var
|
|
2996
|
+
Lr.default = Lr, Lr.options = Ar, Lr.errorType = Mr, Lr.polyfills = jr, Lr.WretchError = Pr;
|
|
2997
|
+
var Rr = (e, t) => t.skipDedupe || t.method !== "GET", zr = (e, t) => t.method + "@" + e, Br = (e) => e.clone(), Vr = ({ skip: e = Rr, key: t = zr, resolver: n = Br } = {}) => {
|
|
2951
2998
|
let r = /* @__PURE__ */ new Map();
|
|
2952
2999
|
return (i) => (a, o) => {
|
|
2953
3000
|
if (e(a, o)) return i(a, o);
|
|
@@ -2964,7 +3011,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
2964
3011
|
return r.delete(s), Promise.reject(e);
|
|
2965
3012
|
}
|
|
2966
3013
|
};
|
|
2967
|
-
},
|
|
3014
|
+
}, Hr = (e, t) => t.skipCache || t.method !== "GET", Ur = (e, t) => t.method + "@" + e, Wr = () => !1, Gr = () => null, Kr = (e) => e.ok, qr = ({ throttle: e = 1e3, skip: t = Hr, key: n = Ur, clear: r = Wr, invalidate: i = Gr, condition: a = Kr, flagResponseOnCacheHit: o = "__cached" } = {}) => {
|
|
2968
3015
|
let s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = (t) => {
|
|
2969
3016
|
e && !l.has(t) && (l.add(t), setTimeout(() => {
|
|
2970
3017
|
l.delete(t);
|
|
@@ -2994,7 +3041,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
2994
3041
|
return d.cacheResponse = function(e, t) {
|
|
2995
3042
|
u(e), s.set(e, t);
|
|
2996
3043
|
}, d.cache = s, d.inflight = c, d.throttling = l, d;
|
|
2997
|
-
},
|
|
3044
|
+
}, Jr = (e, t) => e * t, Yr = (e) => e && e.ok, Xr = ({ delayTimer: e = 500, delayRamp: t = Jr, maxAttempts: n = 10, until: r = Yr, onRetry: i = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: o = !1, skip: s } = {}) => (c) => (l, u) => {
|
|
2998
3045
|
let d = 0;
|
|
2999
3046
|
if (s && s(l, u)) return c(l, u);
|
|
3000
3047
|
let f = (s, p) => Promise.resolve(r(s, p)).then((r) => r ? s && o ? s : p ? Promise.reject(p) : s : (d++, !n || d <= n ? new Promise((n) => {
|
|
@@ -3017,7 +3064,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3017
3064
|
if (!a) throw e;
|
|
3018
3065
|
return f(null, e);
|
|
3019
3066
|
});
|
|
3020
|
-
},
|
|
3067
|
+
}, Zr = "@sesamy/sdk", Qr = "1.28.0", $r = class {
|
|
3021
3068
|
cache = /* @__PURE__ */ new Map();
|
|
3022
3069
|
get(e) {
|
|
3023
3070
|
return this.cache.get(e) || null;
|
|
@@ -3031,12 +3078,12 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3031
3078
|
clear() {
|
|
3032
3079
|
this.cache.clear();
|
|
3033
3080
|
}
|
|
3034
|
-
},
|
|
3035
|
-
let { libraryName: t =
|
|
3081
|
+
}, ei = "sesamyCacheTimestamp", ti = (e) => {
|
|
3082
|
+
let { libraryName: t = Zr, libraryVersion: n = Qr, cache: r } = e, i = r?.storage || new $r(), a = [
|
|
3036
3083
|
(e) => async (t, n) => {
|
|
3037
|
-
if (r?.mode ===
|
|
3084
|
+
if (r?.mode === xr.BROWSER) {
|
|
3038
3085
|
let r;
|
|
3039
|
-
return typeof sessionStorage < "u" ? (r = sessionStorage.getItem(
|
|
3086
|
+
return typeof sessionStorage < "u" ? (r = sessionStorage.getItem(ei), r || (r = Date.now().toString(), sessionStorage.setItem(ei, r))) : (r = i.get(ei), r || (r = Date.now().toString(), i.set(ei, r))), e(t, {
|
|
3040
3087
|
...n,
|
|
3041
3088
|
headers: {
|
|
3042
3089
|
...n.headers,
|
|
@@ -3059,19 +3106,19 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3059
3106
|
}
|
|
3060
3107
|
});
|
|
3061
3108
|
},
|
|
3062
|
-
|
|
3109
|
+
Vr()
|
|
3063
3110
|
];
|
|
3064
|
-
r?.mode ===
|
|
3111
|
+
r?.mode === xr.NORMAL && a.push(qr({
|
|
3065
3112
|
throttle: 300 * 1e3,
|
|
3066
3113
|
skip: (e, t) => t.method !== "GET"
|
|
3067
|
-
})), a.push(
|
|
3114
|
+
})), a.push(Xr({
|
|
3068
3115
|
delayTimer: 1e3,
|
|
3069
3116
|
delayRamp: (e, t) => e * t,
|
|
3070
3117
|
maxAttempts: 3,
|
|
3071
3118
|
until: (e) => !!(e && (e.ok || e.status >= 400 && e.status < 500)),
|
|
3072
3119
|
retryOnNetworkError: !1
|
|
3073
3120
|
}));
|
|
3074
|
-
let o =
|
|
3121
|
+
let o = Lr(e.baseUrl).headers({
|
|
3075
3122
|
"Content-Type": "application/json",
|
|
3076
3123
|
"X-Sesamy-Client": `${t}/${n}`,
|
|
3077
3124
|
...e.headers
|
|
@@ -3105,19 +3152,19 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3105
3152
|
"patch",
|
|
3106
3153
|
"put",
|
|
3107
3154
|
"delete"
|
|
3108
|
-
].includes(i) &&
|
|
3155
|
+
].includes(i) && ni(), s.status === 204) return null;
|
|
3109
3156
|
if (!s.ok) {
|
|
3110
3157
|
let e = await s.text().catch(() => "Unknown error");
|
|
3111
|
-
throw new
|
|
3158
|
+
throw new br(s.status, s.statusText, s.url, `API Error ${s.status}: ${e}`, e);
|
|
3112
3159
|
}
|
|
3113
3160
|
return await s.json();
|
|
3114
3161
|
} catch (n) {
|
|
3115
|
-
if (n instanceof
|
|
3162
|
+
if (n instanceof br) throw n;
|
|
3116
3163
|
let r = n.status || 500;
|
|
3117
|
-
throw new
|
|
3164
|
+
throw new br(r, n.message || "Unknown error", `${e.baseUrl}${t}`, `API Error ${r}: ${n.message || "Unknown error"}`, n.message || "Unknown error");
|
|
3118
3165
|
}
|
|
3119
3166
|
} };
|
|
3120
|
-
},
|
|
3167
|
+
}, ni = () => (typeof sessionStorage < "u" && sessionStorage.removeItem(ei), "Cache cleared"), ri = {
|
|
3121
3168
|
get: async (e, t) => e.request(`/profile/${t}`),
|
|
3122
3169
|
update: async (e, t, n) => e.request(`/profile/${t}`, {
|
|
3123
3170
|
method: "PATCH",
|
|
@@ -3128,7 +3175,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3128
3175
|
delete: async (e) => {
|
|
3129
3176
|
await e.request("/profile", { method: "DELETE" });
|
|
3130
3177
|
}
|
|
3131
|
-
},
|
|
3178
|
+
}, ii = {
|
|
3132
3179
|
list: async (e, t) => {
|
|
3133
3180
|
let n = new URLSearchParams();
|
|
3134
3181
|
t?.type && n.append("type", t.type), t?.sku && n.append("sku", t.sku), t?.purchaseOptionId && n.append("purchase-option-id", t.purchaseOptionId), t?.waitForEntitlementAfter && n.append("wait-for-entitlement-after", t.waitForEntitlementAfter);
|
|
@@ -3137,20 +3184,20 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3137
3184
|
},
|
|
3138
3185
|
get: async (e, t) => e.request(`/entitlements/${t}`),
|
|
3139
3186
|
getAccess: async (e, t) => e.request(`/entitlements/${t}/access`)
|
|
3140
|
-
},
|
|
3187
|
+
}, ai = {
|
|
3141
3188
|
list: async (e) => e.request("/subscriptions"),
|
|
3142
3189
|
get: async (e, t) => e.request(`/subscriptions/${t}`)
|
|
3143
|
-
},
|
|
3190
|
+
}, oi = {
|
|
3144
3191
|
get: async (e, t) => e.request(`/products/${t}`),
|
|
3145
3192
|
autoOnboard: async (e, t) => e.request(`/products/${t}/auto-onboard`, { method: "POST" })
|
|
3146
|
-
},
|
|
3193
|
+
}, si = (e, t) => {
|
|
3147
3194
|
if (!e || !t) return e;
|
|
3148
3195
|
let n = new URL(e);
|
|
3149
3196
|
return n.hash = `access_token=${t}`, n.toString();
|
|
3150
|
-
},
|
|
3197
|
+
}, ci = (e, t) => !e.manageUrl || !t ? e : {
|
|
3151
3198
|
...e,
|
|
3152
|
-
manageUrl:
|
|
3153
|
-
},
|
|
3199
|
+
manageUrl: si(e.manageUrl, t)
|
|
3200
|
+
}, li = {
|
|
3154
3201
|
list: async (e) => e.request("/contracts"),
|
|
3155
3202
|
get: async (e, t) => e.request(`/contracts/${t}`),
|
|
3156
3203
|
cancel: async (e, t, n) => e.request(`/contracts/${t}/cancel`, {
|
|
@@ -3162,7 +3209,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3162
3209
|
body: JSON.stringify(n)
|
|
3163
3210
|
}),
|
|
3164
3211
|
confirmAmendment: async (e, t, n) => e.request(`/contracts/${t}/amendments/${n}/confirm`, { method: "POST" })
|
|
3165
|
-
},
|
|
3212
|
+
}, ui = {
|
|
3166
3213
|
get: async (e) => e.request("/user-metadata"),
|
|
3167
3214
|
set: async (e, t, n) => {
|
|
3168
3215
|
await e.request(`/user-metadata/${t}`, {
|
|
@@ -3173,7 +3220,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3173
3220
|
delete: async (e, t) => {
|
|
3174
3221
|
await e.request(`/user-metadata/${t}`, { method: "DELETE" });
|
|
3175
3222
|
}
|
|
3176
|
-
},
|
|
3223
|
+
}, di = {
|
|
3177
3224
|
list: async (e) => e.request("/tallies"),
|
|
3178
3225
|
get: async (e, t) => e.request(`/tallies/${t}`),
|
|
3179
3226
|
update: async (e, t, n) => e.request(`/tallies/${t}`, {
|
|
@@ -3195,7 +3242,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3195
3242
|
method: "POST",
|
|
3196
3243
|
body: JSON.stringify(n)
|
|
3197
3244
|
})
|
|
3198
|
-
},
|
|
3245
|
+
}, fi = {
|
|
3199
3246
|
list: async (e) => e.request("/tags"),
|
|
3200
3247
|
add: async (e, t) => {
|
|
3201
3248
|
await e.request("/tags", {
|
|
@@ -3206,7 +3253,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3206
3253
|
remove: async (e, t) => {
|
|
3207
3254
|
await e.request(`/tags/${t}`, { method: "DELETE" });
|
|
3208
3255
|
}
|
|
3209
|
-
},
|
|
3256
|
+
}, pi = {
|
|
3210
3257
|
generateCheckoutLink: (e, t) => {
|
|
3211
3258
|
let n = new URL(`${e.apiUrl}/checkouts`);
|
|
3212
3259
|
return t.items && n.searchParams.set("items", JSON.stringify(t.items)), t.email && n.searchParams.set("email", t.email), t.language && n.searchParams.set("lang", t.language), t.redirectUrl && n.searchParams.set("redirect-url", t.redirectUrl), t.giftMode && n.searchParams.set("gift-mode", "true"), t.payerEmail && n.searchParams.set("payer-email", t.payerEmail), t.requireAddress && n.searchParams.set("require-address", "true"), t.metadata && Object.entries(t.metadata).forEach(([e, t]) => {
|
|
@@ -3229,7 +3276,7 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3229
3276
|
let n = t.language || "en", r = new URL(`${e.baseUrl}/consume/${encodeURIComponent(n)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(t.sku)}`);
|
|
3230
3277
|
return t.episodeId ? r.href += `/${encodeURIComponent(t.episodeId)}` : r.href += "/listen", r.searchParams.set("sesamy-redirect-url", t.redirectUrl || "/"), r.toString();
|
|
3231
3278
|
}
|
|
3232
|
-
},
|
|
3279
|
+
}, mi = {
|
|
3233
3280
|
generateLink: (e, t) => {
|
|
3234
3281
|
let n = new URL(`${e.apiUrl}/checkouts`);
|
|
3235
3282
|
return t.items && n.searchParams.set("items", JSON.stringify(t.items)), t.email && n.searchParams.set("email", t.email), t.language && n.searchParams.set("lang", t.language), t.redirectUrl && n.searchParams.set("redirect-url", t.redirectUrl), t.giftMode && n.searchParams.set("gift-mode", "true"), t.payerEmail && n.searchParams.set("payer-email", t.payerEmail), t.requireAddress && n.searchParams.set("require-address", "true"), t.metadata && Object.entries(t.metadata).forEach(([e, t]) => {
|
|
@@ -3245,16 +3292,16 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3245
3292
|
method: "PATCH",
|
|
3246
3293
|
body: JSON.stringify(n)
|
|
3247
3294
|
})
|
|
3248
|
-
},
|
|
3295
|
+
}, hi = {
|
|
3249
3296
|
list: async (e) => e.request("/bills"),
|
|
3250
3297
|
get: async (e, t) => e.request(`/bills/${t}`)
|
|
3251
|
-
},
|
|
3298
|
+
}, gi = {
|
|
3252
3299
|
list: async (e) => e.request("/fulfillments"),
|
|
3253
3300
|
create: async (e, t) => e.request("/fulfillments", {
|
|
3254
3301
|
method: "POST",
|
|
3255
3302
|
body: JSON.stringify(t)
|
|
3256
3303
|
})
|
|
3257
|
-
},
|
|
3304
|
+
}, _i = {
|
|
3258
3305
|
get: async (e, t) => {
|
|
3259
3306
|
try {
|
|
3260
3307
|
return new URL(t), e.request(t);
|
|
@@ -3266,112 +3313,112 @@ var Ir = (e, t) => t.skipDedupe || t.method !== "GET", Lr = (e, t) => t.method +
|
|
|
3266
3313
|
method: "POST",
|
|
3267
3314
|
body: JSON.stringify(n)
|
|
3268
3315
|
})
|
|
3269
|
-
},
|
|
3316
|
+
}, vi = { list: async (e) => e.request("/payment-issues") }, yi = { content: async (e, t, n, r, i) => {
|
|
3270
3317
|
let a = new URLSearchParams({ url: t });
|
|
3271
3318
|
return n && a.append("selector", n), r && a.append("cache", r), e.request(`/proxy?${a.toString()}`, i);
|
|
3272
|
-
} },
|
|
3319
|
+
} }, bi = { list: async (e, t) => {
|
|
3273
3320
|
let n = (t ? new URLSearchParams({ q: t }) : new URLSearchParams()).toString(), r = n ? `/transactions?${n}` : "/transactions";
|
|
3274
3321
|
return e.request(r);
|
|
3275
|
-
} },
|
|
3322
|
+
} }, xi = {
|
|
3276
3323
|
get: async (e) => e.request("/vendor"),
|
|
3277
3324
|
list: async (e) => e.request("/vendors")
|
|
3278
|
-
},
|
|
3279
|
-
let t =
|
|
3325
|
+
}, Si = (e) => {
|
|
3326
|
+
let t = ti(e);
|
|
3280
3327
|
return {
|
|
3281
3328
|
profile: {
|
|
3282
|
-
get: (e) =>
|
|
3283
|
-
update: (e, n) =>
|
|
3284
|
-
checkSpotifyLink: () =>
|
|
3285
|
-
unlinkSpotify: () =>
|
|
3286
|
-
delete: () =>
|
|
3329
|
+
get: (e) => ri.get(t, e),
|
|
3330
|
+
update: (e, n) => ri.update(t, e, n),
|
|
3331
|
+
checkSpotifyLink: () => ri.checkSpotifyLink(t),
|
|
3332
|
+
unlinkSpotify: () => ri.unlinkSpotify(t),
|
|
3333
|
+
delete: () => ri.delete(t)
|
|
3287
3334
|
},
|
|
3288
3335
|
entitlements: {
|
|
3289
|
-
list: (e) =>
|
|
3290
|
-
get: (e) =>
|
|
3291
|
-
getAccess: (e) =>
|
|
3336
|
+
list: (e) => ii.list(t, e),
|
|
3337
|
+
get: (e) => ii.get(t, e),
|
|
3338
|
+
getAccess: (e) => ii.getAccess(t, e)
|
|
3292
3339
|
},
|
|
3293
3340
|
subscriptions: {
|
|
3294
|
-
list: () =>
|
|
3295
|
-
get: (e) =>
|
|
3341
|
+
list: () => ai.list(t),
|
|
3342
|
+
get: (e) => ai.get(t, e)
|
|
3296
3343
|
},
|
|
3297
3344
|
products: {
|
|
3298
|
-
get: (e) =>
|
|
3299
|
-
autoOnboard: (e) =>
|
|
3345
|
+
get: (e) => oi.get(t, e),
|
|
3346
|
+
autoOnboard: (e) => oi.autoOnboard(t, e)
|
|
3300
3347
|
},
|
|
3301
3348
|
contracts: {
|
|
3302
3349
|
list: async () => {
|
|
3303
|
-
let n = await
|
|
3350
|
+
let n = await li.list(t), r = await e.tokenProvider();
|
|
3304
3351
|
if (!r || !r.toLowerCase().startsWith("bearer ")) return n;
|
|
3305
3352
|
let i = r.substring(7);
|
|
3306
|
-
return n.map((e) =>
|
|
3353
|
+
return n.map((e) => ci(e, i));
|
|
3307
3354
|
},
|
|
3308
3355
|
get: async (n) => {
|
|
3309
|
-
let r = await
|
|
3310
|
-
return !i || !i.toLowerCase().startsWith("bearer ") ? r :
|
|
3356
|
+
let r = await li.get(t, n), i = await e.tokenProvider();
|
|
3357
|
+
return !i || !i.toLowerCase().startsWith("bearer ") ? r : ci(r, i.substring(7));
|
|
3311
3358
|
},
|
|
3312
|
-
cancel: (e, n) =>
|
|
3313
|
-
createAmendment: (e, n) =>
|
|
3314
|
-
confirmAmendment: (e, n) =>
|
|
3359
|
+
cancel: (e, n) => li.cancel(t, e, n),
|
|
3360
|
+
createAmendment: (e, n) => li.createAmendment(t, e, n),
|
|
3361
|
+
confirmAmendment: (e, n) => li.confirmAmendment(t, e, n)
|
|
3315
3362
|
},
|
|
3316
3363
|
userMetadata: {
|
|
3317
|
-
get: () =>
|
|
3318
|
-
set: (e, n) =>
|
|
3319
|
-
delete: (e) =>
|
|
3364
|
+
get: () => ui.get(t),
|
|
3365
|
+
set: (e, n) => ui.set(t, e, n),
|
|
3366
|
+
delete: (e) => ui.delete(t, e)
|
|
3320
3367
|
},
|
|
3321
3368
|
tallies: {
|
|
3322
|
-
list: () =>
|
|
3323
|
-
get: (e) =>
|
|
3324
|
-
update: (e, n) =>
|
|
3325
|
-
create: (e) =>
|
|
3326
|
-
delete: (e) =>
|
|
3327
|
-
push: (e, n) =>
|
|
3369
|
+
list: () => di.list(t),
|
|
3370
|
+
get: (e) => di.get(t, e),
|
|
3371
|
+
update: (e, n) => di.update(t, e, n),
|
|
3372
|
+
create: (e) => di.create(t, e),
|
|
3373
|
+
delete: (e) => di.delete(t, e),
|
|
3374
|
+
push: (e, n) => di.push(t, e, n)
|
|
3328
3375
|
},
|
|
3329
3376
|
tags: {
|
|
3330
|
-
list: () =>
|
|
3331
|
-
add: (e) =>
|
|
3332
|
-
remove: (e) =>
|
|
3377
|
+
list: () => fi.list(t),
|
|
3378
|
+
add: (e) => fi.add(t, e),
|
|
3379
|
+
remove: (e) => fi.remove(t, e)
|
|
3333
3380
|
},
|
|
3334
3381
|
checkouts: {
|
|
3335
|
-
generateLink: (e, t) =>
|
|
3336
|
-
create: (e) =>
|
|
3337
|
-
get: (e) =>
|
|
3338
|
-
update: (e, n) =>
|
|
3382
|
+
generateLink: (e, t) => pi.generateCheckoutLink(e, t),
|
|
3383
|
+
create: (e) => mi.create(t, e),
|
|
3384
|
+
get: (e) => mi.get(t, e),
|
|
3385
|
+
update: (e, n) => mi.update(t, e, n)
|
|
3339
3386
|
},
|
|
3340
3387
|
links: {
|
|
3341
|
-
generateCheckoutLink: (e, t) =>
|
|
3342
|
-
generateAccountLink: (e, t) =>
|
|
3343
|
-
generateChangePaymentLink: (e, t) =>
|
|
3344
|
-
generateChangePlanLink: (e, t) =>
|
|
3345
|
-
generateConsumeLink: (e, t) =>
|
|
3388
|
+
generateCheckoutLink: (e, t) => pi.generateCheckoutLink(e, t),
|
|
3389
|
+
generateAccountLink: (e, t) => pi.generateAccountLink(e, t),
|
|
3390
|
+
generateChangePaymentLink: (e, t) => pi.generateChangePaymentLink(e, t),
|
|
3391
|
+
generateChangePlanLink: (e, t) => pi.generateChangePlanLink(e, t),
|
|
3392
|
+
generateConsumeLink: (e, t) => pi.generateConsumeLink(e, t)
|
|
3346
3393
|
},
|
|
3347
3394
|
bills: {
|
|
3348
|
-
list: () =>
|
|
3349
|
-
get: (e) =>
|
|
3395
|
+
list: () => hi.list(t),
|
|
3396
|
+
get: (e) => hi.get(t, e)
|
|
3350
3397
|
},
|
|
3351
3398
|
fulfillments: {
|
|
3352
|
-
list: () =>
|
|
3353
|
-
create: (e) =>
|
|
3399
|
+
list: () => gi.list(t),
|
|
3400
|
+
create: (e) => gi.create(t, e)
|
|
3354
3401
|
},
|
|
3355
3402
|
paywalls: {
|
|
3356
|
-
get: (e) =>
|
|
3357
|
-
checkAccess: (e, n) =>
|
|
3403
|
+
get: (e) => _i.get(t, e),
|
|
3404
|
+
checkAccess: (e, n) => _i.checkAccess(t, e, n)
|
|
3358
3405
|
},
|
|
3359
|
-
paymentIssues: { list: () =>
|
|
3360
|
-
proxy: { content: (e, n, r, i) =>
|
|
3361
|
-
transactions: { list: (e) =>
|
|
3406
|
+
paymentIssues: { list: () => vi.list(t) },
|
|
3407
|
+
proxy: { content: (e, n, r, i) => yi.content(t, e, n, r, i) },
|
|
3408
|
+
transactions: { list: (e) => bi.list(t, e) },
|
|
3362
3409
|
vendor: {
|
|
3363
|
-
get: () =>
|
|
3364
|
-
list: () =>
|
|
3410
|
+
get: () => xi.get(t),
|
|
3411
|
+
list: () => xi.list(t)
|
|
3365
3412
|
}
|
|
3366
3413
|
};
|
|
3367
|
-
},
|
|
3368
|
-
function
|
|
3414
|
+
}, Ci = "sesamy.com", wi = "sesamy.dev", Ti = "https://sesa.my", Ei = "sesamyCacheTimestamp", Di = "sesamyContentReloaded", Oi = /* @__PURE__ */ "co.uk,com.au,co.nz,co.za,com.br,co.jp,gov.uk,ac.uk,org.uk,net.uk,com.sg,com.my,co.in,co.id,co.th,co.kr,com.mx,com.ar,com.co,com.pe,com.ph,com.pk,com.sa,com.eg,com.ng,co.ke,co.tz,co.zw,co.bw,co.mz,gov.au,edu.au,org.au,net.au,asn.au,id.au".split(",");
|
|
3415
|
+
function ki(e) {
|
|
3369
3416
|
try {
|
|
3370
3417
|
let t = new URL(e).hostname;
|
|
3371
3418
|
if (t.startsWith("[") || /^\d{1,3}(\.\d{1,3}){3}$/.test(t)) return t;
|
|
3372
3419
|
let n = t.split(".");
|
|
3373
3420
|
if (n.length <= 1) return t;
|
|
3374
|
-
for (let e of
|
|
3421
|
+
for (let e of Oi) if (t.endsWith(`.${e}`)) {
|
|
3375
3422
|
let t = e.split(".").length + 1;
|
|
3376
3423
|
return n.slice(-t).join(".");
|
|
3377
3424
|
}
|
|
@@ -3382,7 +3429,7 @@ function Di(e) {
|
|
|
3382
3429
|
}
|
|
3383
3430
|
//#endregion
|
|
3384
3431
|
//#region src/types/Cache.ts
|
|
3385
|
-
var
|
|
3432
|
+
var Ai = class {
|
|
3386
3433
|
get(e) {
|
|
3387
3434
|
return typeof sessionStorage > "u" ? null : sessionStorage.getItem(e);
|
|
3388
3435
|
}
|
|
@@ -3396,21 +3443,21 @@ var Oi = class {
|
|
|
3396
3443
|
};
|
|
3397
3444
|
//#endregion
|
|
3398
3445
|
//#region src/services/config/index.ts
|
|
3399
|
-
function
|
|
3400
|
-
return `${e}.${t === "dev" ?
|
|
3446
|
+
function ji(e, t) {
|
|
3447
|
+
return `${e}.${t === "dev" ? wi : Ci}`;
|
|
3401
3448
|
}
|
|
3402
|
-
function
|
|
3403
|
-
return `https://${
|
|
3449
|
+
function Mi(e, t) {
|
|
3450
|
+
return `https://${ji(e, t)}`;
|
|
3404
3451
|
}
|
|
3405
3452
|
//#endregion
|
|
3406
3453
|
//#region src/utils/language.ts
|
|
3407
|
-
function
|
|
3454
|
+
function Ni() {
|
|
3408
3455
|
let e = (document.documentElement.getAttribute("lang") ?? navigator.language ?? "en").split("-")[0]?.toLowerCase() ?? "en";
|
|
3409
3456
|
return e === "nn" && (e = "nb"), e;
|
|
3410
3457
|
}
|
|
3411
3458
|
//#endregion
|
|
3412
3459
|
//#region src/utils/links.ts
|
|
3413
|
-
function
|
|
3460
|
+
function Pi(e) {
|
|
3414
3461
|
let t;
|
|
3415
3462
|
try {
|
|
3416
3463
|
t = new URL(e);
|
|
@@ -3419,8 +3466,8 @@ function Mi(e) {
|
|
|
3419
3466
|
}
|
|
3420
3467
|
return t.protocol === "http:" || t.protocol === "https:";
|
|
3421
3468
|
}
|
|
3422
|
-
function
|
|
3423
|
-
if (
|
|
3469
|
+
function Fi(e, t) {
|
|
3470
|
+
if (Pi(e)) return { itemSrc: e };
|
|
3424
3471
|
let n = e.split(":");
|
|
3425
3472
|
if (n.length < 2) throw Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${n.length}`);
|
|
3426
3473
|
let [r, i, a] = n;
|
|
@@ -3430,17 +3477,17 @@ function Ni(e, t) {
|
|
|
3430
3477
|
purchaseOption: t || a
|
|
3431
3478
|
};
|
|
3432
3479
|
}
|
|
3433
|
-
function
|
|
3480
|
+
function Ii(e) {
|
|
3434
3481
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
3435
3482
|
}
|
|
3436
|
-
function
|
|
3437
|
-
if (!
|
|
3483
|
+
function Li(e, t) {
|
|
3484
|
+
if (!Pi(e) || !Pi(t)) return !1;
|
|
3438
3485
|
let n = new URL(e), r = new URL(t);
|
|
3439
|
-
return n.origin === r.origin &&
|
|
3486
|
+
return n.origin === r.origin && Ii(n.pathname) === Ii(r.pathname);
|
|
3440
3487
|
}
|
|
3441
3488
|
//#endregion
|
|
3442
3489
|
//#region src/services/consent/cmp-adapters.ts
|
|
3443
|
-
function
|
|
3490
|
+
function Ri(e) {
|
|
3444
3491
|
let t = window.Cookiebot;
|
|
3445
3492
|
t?.consent && e({
|
|
3446
3493
|
statistics: !!t.consent.statistics,
|
|
@@ -3455,25 +3502,25 @@ function Ii(e) {
|
|
|
3455
3502
|
};
|
|
3456
3503
|
window.addEventListener("CookiebotOnAccept", n), window.addEventListener("CookiebotOnDecline", n);
|
|
3457
3504
|
}
|
|
3458
|
-
function
|
|
3505
|
+
function zi() {
|
|
3459
3506
|
return window.Cookiebot !== void 0;
|
|
3460
3507
|
}
|
|
3461
|
-
function
|
|
3508
|
+
function Bi() {
|
|
3462
3509
|
let e = window.OptanonActiveGroups || "";
|
|
3463
3510
|
return {
|
|
3464
3511
|
statistics: e.includes("C0002"),
|
|
3465
3512
|
marketing: e.includes("C0004")
|
|
3466
3513
|
};
|
|
3467
3514
|
}
|
|
3468
|
-
function
|
|
3469
|
-
e(
|
|
3470
|
-
e(
|
|
3515
|
+
function Vi(e) {
|
|
3516
|
+
e(Bi()), window.addEventListener("OneTrustGroupsUpdated", () => {
|
|
3517
|
+
e(Bi());
|
|
3471
3518
|
});
|
|
3472
3519
|
}
|
|
3473
|
-
function
|
|
3520
|
+
function Hi() {
|
|
3474
3521
|
return window.OneTrust !== void 0;
|
|
3475
3522
|
}
|
|
3476
|
-
function
|
|
3523
|
+
function Ui() {
|
|
3477
3524
|
let e = window.dataLayer;
|
|
3478
3525
|
if (!e) return null;
|
|
3479
3526
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
@@ -3488,8 +3535,8 @@ function Vi() {
|
|
|
3488
3535
|
}
|
|
3489
3536
|
return null;
|
|
3490
3537
|
}
|
|
3491
|
-
function
|
|
3492
|
-
let t =
|
|
3538
|
+
function Wi(e) {
|
|
3539
|
+
let t = Ui();
|
|
3493
3540
|
t && e(t);
|
|
3494
3541
|
let n = window.dataLayer ??= [], r = n.push.bind(n);
|
|
3495
3542
|
n.push = (...t) => {
|
|
@@ -3504,46 +3551,46 @@ function Hi(e) {
|
|
|
3504
3551
|
return n;
|
|
3505
3552
|
};
|
|
3506
3553
|
}
|
|
3507
|
-
function
|
|
3554
|
+
function Gi() {
|
|
3508
3555
|
return Array.isArray(window.dataLayer);
|
|
3509
3556
|
}
|
|
3510
3557
|
//#endregion
|
|
3511
3558
|
//#region src/services/consent/index.ts
|
|
3512
3559
|
Vn();
|
|
3513
|
-
var
|
|
3560
|
+
var Ki = !1, qi = {
|
|
3514
3561
|
statistics: !1,
|
|
3515
3562
|
marketing: !1
|
|
3516
3563
|
};
|
|
3517
|
-
function
|
|
3518
|
-
return
|
|
3564
|
+
function Ji() {
|
|
3565
|
+
return Ki;
|
|
3519
3566
|
}
|
|
3520
|
-
function
|
|
3521
|
-
return { ...
|
|
3567
|
+
function Yi() {
|
|
3568
|
+
return { ...qi };
|
|
3522
3569
|
}
|
|
3523
|
-
function
|
|
3524
|
-
return
|
|
3570
|
+
function Xi(e) {
|
|
3571
|
+
return Ki ? qi[e] : !0;
|
|
3525
3572
|
}
|
|
3526
|
-
function
|
|
3527
|
-
let t = e.statistics !== void 0 && e.statistics !==
|
|
3528
|
-
e.statistics !== void 0 && (
|
|
3573
|
+
function Zi(e) {
|
|
3574
|
+
let t = e.statistics !== void 0 && e.statistics !== qi.statistics || e.marketing !== void 0 && e.marketing !== qi.marketing;
|
|
3575
|
+
e.statistics !== void 0 && (qi.statistics = e.statistics), e.marketing !== void 0 && (qi.marketing = e.marketing), t && window.dispatchEvent(new CustomEvent(J.CONSENT_CHANGED, { detail: Yi() }));
|
|
3529
3576
|
}
|
|
3530
|
-
function
|
|
3577
|
+
function Qi(e) {
|
|
3531
3578
|
if (!e?.enabled) return;
|
|
3532
|
-
|
|
3533
|
-
let t = (e) =>
|
|
3534
|
-
e.cmp === "cookiebot" ?
|
|
3579
|
+
Ki = !0, e.defaultConsent && (e.defaultConsent.statistics !== void 0 && (qi.statistics = e.defaultConsent.statistics), e.defaultConsent.marketing !== void 0 && (qi.marketing = e.defaultConsent.marketing));
|
|
3580
|
+
let t = (e) => Zi(e);
|
|
3581
|
+
e.cmp === "cookiebot" ? Ri(t) : e.cmp === "onetrust" ? Vi(t) : e.cmp === "google-consent-mode" ? Wi(t) : e.onConsentChange ? e.onConsentChange(t) : zi() ? Ri(t) : Hi() ? Vi(t) : Gi() && Wi(t);
|
|
3535
3582
|
}
|
|
3536
3583
|
//#endregion
|
|
3537
3584
|
//#region src/controllers/checkout.ts
|
|
3538
|
-
function
|
|
3539
|
-
let r = new URL(`${
|
|
3585
|
+
function $i(e, t, n) {
|
|
3586
|
+
let r = new URL(`${Mi("checkout3", e.environment)}`);
|
|
3540
3587
|
t.language && r.searchParams.set("lang", t.language);
|
|
3541
3588
|
let i = t.sku, a = t.purchaseOptionId, o = t.itemSrc;
|
|
3542
3589
|
if (t.itemSrc) {
|
|
3543
|
-
let e =
|
|
3590
|
+
let e = Fi(t.itemSrc, t.purchaseOptionId);
|
|
3544
3591
|
i = e.sku || i, a = e.purchaseOption || a, o = e.itemSrc;
|
|
3545
3592
|
}
|
|
3546
|
-
if (i ? (r.searchParams.set("sku", i), a && r.searchParams.set("po-id", a)) : o && r.searchParams.set("url", o), t.email && r.searchParams.set("email", t.email), t.business && r.searchParams.set("business", "true"), t.currency && r.searchParams.set("currency", t.currency), t.price && r.searchParams.set("price", t.price.toString()), t.discountCode && r.searchParams.set("discount-code", t.discountCode), t.attributionItemSrc ? r.searchParams.set("itemSrc", t.attributionItemSrc) : n.itemSrc && r.searchParams.set("itemSrc", n.itemSrc), t.attributionPublisherContentId ? r.searchParams.set("publisherContentId", t.attributionPublisherContentId) : n.publisherContentId && r.searchParams.set("publisherContentId", n.publisherContentId), t.utmSource ? r.searchParams.set("utm_source", t.utmSource) : n.utmSource && r.searchParams.set("utm_source", n.utmSource), t.utmMedium ? r.searchParams.set("utm_medium", t.utmMedium) : n.utmMedium && r.searchParams.set("utm_medium", n.utmMedium), t.utmCampaign ? r.searchParams.set("utm_campaign", t.utmCampaign) : n.utmCampaign && r.searchParams.set("utm_campaign", n.utmCampaign), t.utmTerm ? r.searchParams.set("utm_term", t.utmTerm) : n.utmTerm && r.searchParams.set("utm_term", n.utmTerm), t.utmContent ? r.searchParams.set("utm_content", t.utmContent) : n.utmContent && r.searchParams.set("utm_content", n.utmContent),
|
|
3593
|
+
if (i ? (r.searchParams.set("sku", i), a && r.searchParams.set("po-id", a)) : o && r.searchParams.set("url", o), t.email && r.searchParams.set("email", t.email), t.business && r.searchParams.set("business", "true"), t.currency && r.searchParams.set("currency", t.currency), t.price && r.searchParams.set("price", t.price.toString()), t.discountCode && r.searchParams.set("discount-code", t.discountCode), t.attributionItemSrc ? r.searchParams.set("itemSrc", t.attributionItemSrc) : n.itemSrc && r.searchParams.set("itemSrc", n.itemSrc), t.attributionPublisherContentId ? r.searchParams.set("publisherContentId", t.attributionPublisherContentId) : n.publisherContentId && r.searchParams.set("publisherContentId", n.publisherContentId), t.utmSource ? r.searchParams.set("utm_source", t.utmSource) : n.utmSource && r.searchParams.set("utm_source", n.utmSource), t.utmMedium ? r.searchParams.set("utm_medium", t.utmMedium) : n.utmMedium && r.searchParams.set("utm_medium", n.utmMedium), t.utmCampaign ? r.searchParams.set("utm_campaign", t.utmCampaign) : n.utmCampaign && r.searchParams.set("utm_campaign", n.utmCampaign), t.utmTerm ? r.searchParams.set("utm_term", t.utmTerm) : n.utmTerm && r.searchParams.set("utm_term", n.utmTerm), t.utmContent ? r.searchParams.set("utm_content", t.utmContent) : n.utmContent && r.searchParams.set("utm_content", n.utmContent), Xi("marketing")) {
|
|
3547
3594
|
let e = [
|
|
3548
3595
|
"_ga",
|
|
3549
3596
|
"_gid",
|
|
@@ -3573,18 +3620,18 @@ function Zi(e, t, n) {
|
|
|
3573
3620
|
//#endregion
|
|
3574
3621
|
//#region src/controllers/index.ts
|
|
3575
3622
|
zn();
|
|
3576
|
-
var
|
|
3577
|
-
function
|
|
3578
|
-
let e = sessionStorage.getItem(
|
|
3623
|
+
var ea = "sesamySignedURLs";
|
|
3624
|
+
function ta() {
|
|
3625
|
+
let e = sessionStorage.getItem(ea);
|
|
3579
3626
|
return e ? JSON.parse(e) : [];
|
|
3580
3627
|
}
|
|
3581
|
-
function
|
|
3582
|
-
let t =
|
|
3583
|
-
t.push(e), q(`Adding signed URL: ${e}`), sessionStorage.setItem(
|
|
3628
|
+
function na(e) {
|
|
3629
|
+
let t = ta();
|
|
3630
|
+
t.push(e), q(`Adding signed URL: ${e}`), sessionStorage.setItem(ea, JSON.stringify(t));
|
|
3584
3631
|
}
|
|
3585
3632
|
//#endregion
|
|
3586
3633
|
//#region src/utils/removeUndefined.ts
|
|
3587
|
-
function
|
|
3634
|
+
function ra(e) {
|
|
3588
3635
|
let t = {};
|
|
3589
3636
|
return Object.keys(e).forEach((n) => {
|
|
3590
3637
|
let r = e[n];
|
|
@@ -3594,8 +3641,8 @@ function ta(e) {
|
|
|
3594
3641
|
//#endregion
|
|
3595
3642
|
//#region src/controllers/attribution.ts
|
|
3596
3643
|
zn();
|
|
3597
|
-
var
|
|
3598
|
-
function
|
|
3644
|
+
var ia = "sesamyAttribution";
|
|
3645
|
+
function aa(e) {
|
|
3599
3646
|
let t = localStorage.getItem(e);
|
|
3600
3647
|
if (!t) return null;
|
|
3601
3648
|
try {
|
|
@@ -3604,7 +3651,7 @@ function ra(e) {
|
|
|
3604
3651
|
return console.error(`Failed to parse ${e}`), null;
|
|
3605
3652
|
}
|
|
3606
3653
|
}
|
|
3607
|
-
function
|
|
3654
|
+
function oa(e) {
|
|
3608
3655
|
return Object.keys(e).find((e) => e.startsWith("utm_")) ? {
|
|
3609
3656
|
utmSource: void 0,
|
|
3610
3657
|
utmMedium: void 0,
|
|
@@ -3612,23 +3659,23 @@ function ia(e) {
|
|
|
3612
3659
|
...e
|
|
3613
3660
|
} : e;
|
|
3614
3661
|
}
|
|
3615
|
-
function
|
|
3616
|
-
return
|
|
3662
|
+
function sa() {
|
|
3663
|
+
return aa(ia) || {};
|
|
3617
3664
|
}
|
|
3618
|
-
function
|
|
3619
|
-
if (e === null) localStorage.removeItem(
|
|
3665
|
+
function ca(e) {
|
|
3666
|
+
if (e === null) localStorage.removeItem(ia);
|
|
3620
3667
|
else {
|
|
3621
3668
|
q(`Setting attribution ${JSON.stringify(e)}`);
|
|
3622
|
-
let t =
|
|
3623
|
-
...
|
|
3624
|
-
...
|
|
3669
|
+
let t = ra({
|
|
3670
|
+
...sa() ?? {},
|
|
3671
|
+
...oa(e)
|
|
3625
3672
|
});
|
|
3626
|
-
localStorage.setItem(
|
|
3673
|
+
localStorage.setItem(ia, JSON.stringify({ value: t }));
|
|
3627
3674
|
}
|
|
3628
3675
|
}
|
|
3629
3676
|
//#endregion
|
|
3630
3677
|
//#region ../../node_modules/.pnpm/@analytics+type-utils@0.6.4/node_modules/@analytics/type-utils/dist/analytics-util-types.module.js
|
|
3631
|
-
var
|
|
3678
|
+
var la = /* @__PURE__ */ u((/* @__PURE__ */ s(((e, t) => {
|
|
3632
3679
|
(function(n, r) {
|
|
3633
3680
|
typeof e == "object" && t !== void 0 ? t.exports = function(e, t, n, r, i) {
|
|
3634
3681
|
for (t = t.split ? t.split(".") : t, r = 0; r < t.length; r++) e = e ? e[t[r]] : i;
|
|
@@ -3643,102 +3690,102 @@ var sa = /* @__PURE__ */ u((/* @__PURE__ */ s(((e, t) => {
|
|
|
3643
3690
|
return e === i ? n : e;
|
|
3644
3691
|
};
|
|
3645
3692
|
})(e);
|
|
3646
|
-
})))(), 1),
|
|
3647
|
-
|
|
3648
|
-
var Y = typeof document !==
|
|
3649
|
-
Y && window.location.hostname,
|
|
3650
|
-
function
|
|
3693
|
+
})))(), 1), ua = "function", da = "string", fa = "undefined", pa = "boolean", ma = "array", ha = "symbol", ga = "null", _a = function() {}, va = "form", ya = "input", ba = "button", xa = "select", Sa = typeof process < "u" ? process : {};
|
|
3694
|
+
Sa.env && Sa.env.NODE_ENV;
|
|
3695
|
+
var Y = typeof document !== fa;
|
|
3696
|
+
Y && window.location.hostname, Sa.versions != null && Sa.versions.node, typeof Deno < "u" && Deno.core, typeof self == "object" && self.constructor && self.constructor.name, Y && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
3697
|
+
function Ca(e, t) {
|
|
3651
3698
|
return t.charAt(0)[e]() + t.slice(1);
|
|
3652
3699
|
}
|
|
3653
|
-
var
|
|
3654
|
-
function
|
|
3655
|
-
return
|
|
3700
|
+
var wa = Ca.bind(null, "toUpperCase"), Ta = Ca.bind(null, "toLowerCase");
|
|
3701
|
+
function Ea(e) {
|
|
3702
|
+
return Na(e) ? wa(ga) : typeof e == "object" ? Ra(e) : Object.prototype.toString.call(e).slice(8, -1);
|
|
3656
3703
|
}
|
|
3657
|
-
function
|
|
3704
|
+
function Da(e, t) {
|
|
3658
3705
|
t === void 0 && (t = !0);
|
|
3659
|
-
var n =
|
|
3660
|
-
return t ?
|
|
3706
|
+
var n = Ea(e);
|
|
3707
|
+
return t ? Ta(n) : n;
|
|
3661
3708
|
}
|
|
3662
|
-
function
|
|
3709
|
+
function Oa(e, t) {
|
|
3663
3710
|
return typeof t === e;
|
|
3664
3711
|
}
|
|
3665
|
-
var
|
|
3666
|
-
|
|
3667
|
-
function
|
|
3712
|
+
var ka = Oa.bind(null, ua), Aa = Oa.bind(null, da), ja = Oa.bind(null, fa), Ma = Oa.bind(null, pa);
|
|
3713
|
+
Oa.bind(null, ha);
|
|
3714
|
+
function Na(e) {
|
|
3668
3715
|
return e === null;
|
|
3669
3716
|
}
|
|
3670
|
-
function
|
|
3671
|
-
return
|
|
3717
|
+
function Pa(e) {
|
|
3718
|
+
return Da(e) === "number" && !isNaN(e);
|
|
3672
3719
|
}
|
|
3673
|
-
function
|
|
3674
|
-
return
|
|
3720
|
+
function Fa(e) {
|
|
3721
|
+
return Da(e) === ma;
|
|
3675
3722
|
}
|
|
3676
|
-
function
|
|
3677
|
-
if (!
|
|
3723
|
+
function Ia(e) {
|
|
3724
|
+
if (!La(e)) return !1;
|
|
3678
3725
|
for (var t = e; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
|
|
3679
3726
|
return Object.getPrototypeOf(e) === t;
|
|
3680
3727
|
}
|
|
3681
|
-
function
|
|
3728
|
+
function La(e) {
|
|
3682
3729
|
return e && (typeof e == "object" || e !== null);
|
|
3683
3730
|
}
|
|
3684
|
-
function
|
|
3685
|
-
return
|
|
3731
|
+
function Ra(e) {
|
|
3732
|
+
return ka(e.constructor) ? e.constructor.name : null;
|
|
3686
3733
|
}
|
|
3687
|
-
function
|
|
3688
|
-
return e instanceof Error ||
|
|
3734
|
+
function za(e) {
|
|
3735
|
+
return e instanceof Error || Aa(e.message) && e.constructor && Pa(e.constructor.stackTraceLimit);
|
|
3689
3736
|
}
|
|
3690
|
-
function
|
|
3691
|
-
if (typeof t != "object" ||
|
|
3737
|
+
function Ba(e, t) {
|
|
3738
|
+
if (typeof t != "object" || Na(t)) return !1;
|
|
3692
3739
|
if (t instanceof e) return !0;
|
|
3693
|
-
var n =
|
|
3694
|
-
if (
|
|
3695
|
-
if (
|
|
3740
|
+
var n = Da(new e(""));
|
|
3741
|
+
if (za(t)) for (; t;) {
|
|
3742
|
+
if (Da(t) === n) return !0;
|
|
3696
3743
|
t = Object.getPrototypeOf(t);
|
|
3697
3744
|
}
|
|
3698
3745
|
return !1;
|
|
3699
3746
|
}
|
|
3700
|
-
|
|
3701
|
-
function
|
|
3747
|
+
Ba.bind(null, TypeError), Ba.bind(null, SyntaxError);
|
|
3748
|
+
function Va(e, t) {
|
|
3702
3749
|
var n = e instanceof Element || e instanceof HTMLDocument;
|
|
3703
|
-
return n && t ?
|
|
3750
|
+
return n && t ? Ha(e, t) : n;
|
|
3704
3751
|
}
|
|
3705
|
-
function
|
|
3752
|
+
function Ha(e, t) {
|
|
3706
3753
|
return t === void 0 && (t = ""), e && e.nodeName === t.toUpperCase();
|
|
3707
3754
|
}
|
|
3708
|
-
function
|
|
3755
|
+
function Ua(e) {
|
|
3709
3756
|
var t = [].slice.call(arguments, 1);
|
|
3710
3757
|
return function() {
|
|
3711
3758
|
return e.apply(void 0, [].slice.call(arguments).concat(t));
|
|
3712
3759
|
};
|
|
3713
3760
|
}
|
|
3714
|
-
Va
|
|
3715
|
-
function
|
|
3716
|
-
return e ?
|
|
3761
|
+
Ua(Va, va), Ua(Va, ba), Ua(Va, ya), Ua(Va, xa);
|
|
3762
|
+
function Wa(e) {
|
|
3763
|
+
return e ? Fa(e) ? e : [e] : [];
|
|
3717
3764
|
}
|
|
3718
3765
|
//#endregion
|
|
3719
3766
|
//#region ../../node_modules/.pnpm/analytics-utils@1.1.1_@types+dlv@1.1.5/node_modules/analytics-utils/dist/analytics-utils.module.js
|
|
3720
|
-
function
|
|
3767
|
+
function Ga(e) {
|
|
3721
3768
|
try {
|
|
3722
3769
|
return decodeURIComponent(e.replace(/\+/g, " "));
|
|
3723
3770
|
} catch {
|
|
3724
3771
|
return null;
|
|
3725
3772
|
}
|
|
3726
3773
|
}
|
|
3727
|
-
function
|
|
3774
|
+
function Ka() {
|
|
3728
3775
|
if (Y) {
|
|
3729
3776
|
var e = navigator, t = e.languages;
|
|
3730
3777
|
return e.userLanguage || (t && t.length ? t[0] : e.language);
|
|
3731
3778
|
}
|
|
3732
3779
|
}
|
|
3733
|
-
function
|
|
3780
|
+
function qa() {
|
|
3734
3781
|
try {
|
|
3735
3782
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
3736
3783
|
} catch {}
|
|
3737
3784
|
}
|
|
3738
|
-
function
|
|
3785
|
+
function Ja(e) {
|
|
3739
3786
|
return function(e) {
|
|
3740
3787
|
for (var t, n = Object.create(null), r = /([^&=]+)=?([^&]*)/g; t = r.exec(e);) {
|
|
3741
|
-
var i =
|
|
3788
|
+
var i = Ga(t[1]), a = Ga(t[2]);
|
|
3742
3789
|
if (i) if (i.substring(i.length - 2) === "[]") {
|
|
3743
3790
|
var o = n[i = i.substring(0, i.length - 2)] || (n[i] = []);
|
|
3744
3791
|
n[i] = Array.isArray(o) ? o : [], n[i].push(a);
|
|
@@ -3746,7 +3793,7 @@ function Ka(e) {
|
|
|
3746
3793
|
}
|
|
3747
3794
|
for (var s in n) {
|
|
3748
3795
|
var c = s.split("[");
|
|
3749
|
-
c.length > 1 && (
|
|
3796
|
+
c.length > 1 && (Ya(n, c.map(function(e) {
|
|
3750
3797
|
return e.replace(/[?[\]\\ ]/g, "");
|
|
3751
3798
|
}), n[s]), delete n[s]);
|
|
3752
3799
|
}
|
|
@@ -3759,7 +3806,7 @@ function Ka(e) {
|
|
|
3759
3806
|
return Y && window.location.search.substring(1);
|
|
3760
3807
|
}(e));
|
|
3761
3808
|
}
|
|
3762
|
-
function
|
|
3809
|
+
function Ya(e, t, n) {
|
|
3763
3810
|
for (var r = t.length - 1, i = 0; i < r; ++i) {
|
|
3764
3811
|
var a = t[i];
|
|
3765
3812
|
if (a === "__proto__" || a === "constructor") break;
|
|
@@ -3767,14 +3814,14 @@ function qa(e, t, n) {
|
|
|
3767
3814
|
}
|
|
3768
3815
|
e[t[r]] = n;
|
|
3769
3816
|
}
|
|
3770
|
-
function
|
|
3817
|
+
function Xa() {
|
|
3771
3818
|
for (var e = "", t = 0, n = 4294967295 * Math.random() | 0; t++ < 36;) {
|
|
3772
3819
|
var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t - 1], i = 15 & n;
|
|
3773
3820
|
e += r == "-" || r == "4" ? r : (r == "x" ? i : 3 & i | 8).toString(16), n = t % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4;
|
|
3774
3821
|
}
|
|
3775
3822
|
return e;
|
|
3776
3823
|
}
|
|
3777
|
-
function
|
|
3824
|
+
function Za(e, t) {
|
|
3778
3825
|
var n, r, i, a = null, o = 0, s = function() {
|
|
3779
3826
|
o = /* @__PURE__ */ new Date(), a = null, i = e.apply(n, r);
|
|
3780
3827
|
};
|
|
@@ -3787,37 +3834,37 @@ function Ya(e, t) {
|
|
|
3787
3834
|
}
|
|
3788
3835
|
//#endregion
|
|
3789
3836
|
//#region ../../node_modules/.pnpm/@analytics+global-storage-utils@0.1.9/node_modules/@analytics/global-storage-utils/dist/analytics-util-global-storage.module.js
|
|
3790
|
-
var
|
|
3791
|
-
function
|
|
3792
|
-
return
|
|
3837
|
+
var Qa = "global", $a = "__" + Qa + "__", eo = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
3838
|
+
function to(e) {
|
|
3839
|
+
return eo[$a][e];
|
|
3793
3840
|
}
|
|
3794
|
-
function
|
|
3795
|
-
return
|
|
3841
|
+
function no(e, t) {
|
|
3842
|
+
return eo[$a][e] = t;
|
|
3796
3843
|
}
|
|
3797
|
-
function
|
|
3798
|
-
delete
|
|
3844
|
+
function ro(e) {
|
|
3845
|
+
delete eo[$a][e];
|
|
3799
3846
|
}
|
|
3800
|
-
function
|
|
3847
|
+
function io(e, t, n) {
|
|
3801
3848
|
var r;
|
|
3802
3849
|
try {
|
|
3803
|
-
if (
|
|
3850
|
+
if (oo(e)) {
|
|
3804
3851
|
var i = window[e];
|
|
3805
3852
|
r = i[t].bind(i);
|
|
3806
3853
|
}
|
|
3807
3854
|
} catch {}
|
|
3808
3855
|
return r || n;
|
|
3809
3856
|
}
|
|
3810
|
-
|
|
3811
|
-
var
|
|
3812
|
-
function
|
|
3813
|
-
if (
|
|
3857
|
+
eo[$a] || (eo[$a] = {});
|
|
3858
|
+
var ao = {};
|
|
3859
|
+
function oo(e) {
|
|
3860
|
+
if (ao[e] !== void 0) return ao[e];
|
|
3814
3861
|
try {
|
|
3815
3862
|
var t = window[e];
|
|
3816
|
-
t.setItem(
|
|
3863
|
+
t.setItem(fa, fa), t.removeItem(fa);
|
|
3817
3864
|
} catch {
|
|
3818
|
-
return
|
|
3865
|
+
return ao[e] = !1;
|
|
3819
3866
|
}
|
|
3820
|
-
return
|
|
3867
|
+
return ao[e] = !0;
|
|
3821
3868
|
}
|
|
3822
3869
|
//#endregion
|
|
3823
3870
|
//#region ../../node_modules/.pnpm/@analytics+core@0.13.2_@types+dlv@1.1.5/node_modules/@analytics/core/dist/client/core.module.js
|
|
@@ -3830,16 +3877,16 @@ function X() {
|
|
|
3830
3877
|
return e;
|
|
3831
3878
|
}, X.apply(null, arguments);
|
|
3832
3879
|
}
|
|
3833
|
-
var
|
|
3834
|
-
return typeof Symbol ===
|
|
3835
|
-
}(),
|
|
3836
|
-
function
|
|
3880
|
+
var so = "function", co = "undefined", lo = "reducer", uo = "@@redux/", fo = uo + "INIT", po = uo + Math.random().toString(36), mo = /* @__PURE__ */ function() {
|
|
3881
|
+
return typeof Symbol === so && Symbol.observable || "@@observable";
|
|
3882
|
+
}(), ho = " != " + so;
|
|
3883
|
+
function go(e, t, n) {
|
|
3837
3884
|
var r;
|
|
3838
|
-
if (typeof t ===
|
|
3839
|
-
if (typeof n !==
|
|
3840
|
-
return n(
|
|
3885
|
+
if (typeof t === so && typeof n === co && (n = t, t = void 0), typeof n !== co) {
|
|
3886
|
+
if (typeof n !== so) throw Error("enhancer" + ho);
|
|
3887
|
+
return n(go)(e, t);
|
|
3841
3888
|
}
|
|
3842
|
-
if (typeof e !==
|
|
3889
|
+
if (typeof e !== so) throw Error(lo + ho);
|
|
3843
3890
|
var i = e, a = t, o = [], s = o, c = !1;
|
|
3844
3891
|
function l() {
|
|
3845
3892
|
s === o && (s = o.slice());
|
|
@@ -3848,7 +3895,7 @@ function mo(e, t, n) {
|
|
|
3848
3895
|
return a;
|
|
3849
3896
|
}
|
|
3850
3897
|
function d(e) {
|
|
3851
|
-
if (typeof e !==
|
|
3898
|
+
if (typeof e !== so) throw Error("Listener" + ho);
|
|
3852
3899
|
var t = !0;
|
|
3853
3900
|
return l(), s.push(e), function() {
|
|
3854
3901
|
if (t) {
|
|
@@ -3859,9 +3906,9 @@ function mo(e, t, n) {
|
|
|
3859
3906
|
};
|
|
3860
3907
|
}
|
|
3861
3908
|
function f(e) {
|
|
3862
|
-
if (!
|
|
3863
|
-
if (typeof e.type ===
|
|
3864
|
-
if (c) throw Error("Dispatch in " +
|
|
3909
|
+
if (!Ia(e)) throw Error("Act != obj");
|
|
3910
|
+
if (typeof e.type === co) throw Error("ActType " + co);
|
|
3911
|
+
if (c) throw Error("Dispatch in " + lo);
|
|
3865
3912
|
try {
|
|
3866
3913
|
c = !0, a = i(a, e);
|
|
3867
3914
|
} finally {
|
|
@@ -3870,15 +3917,15 @@ function mo(e, t, n) {
|
|
|
3870
3917
|
for (var t = o = s, n = 0; n < t.length; n++) (0, t[n])();
|
|
3871
3918
|
return e;
|
|
3872
3919
|
}
|
|
3873
|
-
return f({ type:
|
|
3920
|
+
return f({ type: fo }), (r = {
|
|
3874
3921
|
dispatch: f,
|
|
3875
3922
|
subscribe: d,
|
|
3876
3923
|
getState: u,
|
|
3877
3924
|
replaceReducer: function(e) {
|
|
3878
|
-
if (typeof e !==
|
|
3879
|
-
i = e, f({ type:
|
|
3925
|
+
if (typeof e !== so) throw Error("next " + lo + ho);
|
|
3926
|
+
i = e, f({ type: fo });
|
|
3880
3927
|
}
|
|
3881
|
-
})[
|
|
3928
|
+
})[mo] = function() {
|
|
3882
3929
|
var e, t = d;
|
|
3883
3930
|
return (e = { subscribe: function(e) {
|
|
3884
3931
|
if (typeof e != "object") throw TypeError("Observer != obj");
|
|
@@ -3886,16 +3933,16 @@ function mo(e, t, n) {
|
|
|
3886
3933
|
e.next && e.next(u());
|
|
3887
3934
|
}
|
|
3888
3935
|
return n(), { unsubscribe: t(n) };
|
|
3889
|
-
} })[
|
|
3936
|
+
} })[mo] = function() {
|
|
3890
3937
|
return this;
|
|
3891
3938
|
}, e;
|
|
3892
3939
|
}, r;
|
|
3893
3940
|
}
|
|
3894
|
-
function
|
|
3941
|
+
function _o(e, t) {
|
|
3895
3942
|
var n = t && t.type;
|
|
3896
|
-
return "action " + (n && n.toString() || "?") +
|
|
3943
|
+
return "action " + (n && n.toString() || "?") + lo + " " + e + " returns " + co;
|
|
3897
3944
|
}
|
|
3898
|
-
function
|
|
3945
|
+
function vo() {
|
|
3899
3946
|
var e = [].slice.call(arguments);
|
|
3900
3947
|
return e.length === 0 ? function(e) {
|
|
3901
3948
|
return e;
|
|
@@ -3905,7 +3952,7 @@ function go() {
|
|
|
3905
3952
|
};
|
|
3906
3953
|
});
|
|
3907
3954
|
}
|
|
3908
|
-
function
|
|
3955
|
+
function yo() {
|
|
3909
3956
|
var e = arguments;
|
|
3910
3957
|
return function(t) {
|
|
3911
3958
|
return function(n, r, i) {
|
|
@@ -3917,16 +3964,16 @@ function _o() {
|
|
|
3917
3964
|
};
|
|
3918
3965
|
return a = [].slice.call(e).map(function(e) {
|
|
3919
3966
|
return e(c);
|
|
3920
|
-
}), X({}, o, { dispatch: s =
|
|
3967
|
+
}), X({}, o, { dispatch: s = vo.apply(void 0, a)(o.dispatch) });
|
|
3921
3968
|
};
|
|
3922
3969
|
};
|
|
3923
3970
|
}
|
|
3924
|
-
var
|
|
3971
|
+
var bo = "__anon_id", xo = "__user_id", So = "__user_traits", Co = "analytics", wo = "userId", To = "anonymousId", Eo = /* @__PURE__ */ "bootstrap.params.campaign.initializeStart.initialize.initializeEnd.ready.resetStart.reset.resetEnd.pageStart.page.pageEnd.pageAborted.trackStart.track.trackEnd.trackAborted.identifyStart.identify.identifyEnd.identifyAborted.userIdChanged.registerPlugins.enablePlugin.disablePlugin.online.offline.setItemStart.setItem.setItemEnd.setItemAborted.removeItemStart.removeItem.removeItemEnd.removeItemAborted".split("."), Do = [
|
|
3925
3972
|
"name",
|
|
3926
3973
|
"EVENTS",
|
|
3927
3974
|
"config",
|
|
3928
3975
|
"loaded"
|
|
3929
|
-
], Z =
|
|
3976
|
+
], Z = Eo.reduce(function(e, t) {
|
|
3930
3977
|
return e[t] = t, e;
|
|
3931
3978
|
}, {
|
|
3932
3979
|
registerPluginType: function(e) {
|
|
@@ -3935,23 +3982,23 @@ var vo = "__anon_id", yo = "__user_id", bo = "__user_traits", xo = "analytics",
|
|
|
3935
3982
|
pluginReadyType: function(e) {
|
|
3936
3983
|
return "ready:" + e;
|
|
3937
3984
|
}
|
|
3938
|
-
}),
|
|
3939
|
-
function
|
|
3985
|
+
}), Oo = /^utm_/, ko = /^an_prop_/, Ao = /^an_trait_/;
|
|
3986
|
+
function jo(e) {
|
|
3940
3987
|
var t = e.storage.setItem;
|
|
3941
3988
|
return function(n) {
|
|
3942
3989
|
return function(r) {
|
|
3943
3990
|
return function(i) {
|
|
3944
3991
|
if (i.type === Z.bootstrap) {
|
|
3945
3992
|
var a = i.params, o = i.user, s = i.persistedUser, c = i.initialUser, l = s.userId === o.userId;
|
|
3946
|
-
s.anonymousId !== o.anonymousId && t(
|
|
3993
|
+
s.anonymousId !== o.anonymousId && t(bo, o.anonymousId), l || t(xo, o.userId), c.traits && t(So, X({}, l && s.traits ? s.traits : {}, c.traits));
|
|
3947
3994
|
var u = Object.keys(i.params);
|
|
3948
3995
|
if (u.length) {
|
|
3949
3996
|
var d = a.an_uid, f = a.an_event, p = u.reduce(function(e, t) {
|
|
3950
|
-
if (t.match(
|
|
3951
|
-
var n = t.replace(
|
|
3997
|
+
if (t.match(Oo) || t.match(/^(d|g)clid/)) {
|
|
3998
|
+
var n = t.replace(Oo, "");
|
|
3952
3999
|
e.campaign[n === "campaign" ? "name" : n] = a[t];
|
|
3953
4000
|
}
|
|
3954
|
-
return t.match(
|
|
4001
|
+
return t.match(ko) && (e.props[t.replace(ko, "")] = a[t]), t.match(Ao) && (e.traits[t.replace(Ao, "")] = a[t]), e;
|
|
3955
4002
|
}, {
|
|
3956
4003
|
campaign: {},
|
|
3957
4004
|
props: {},
|
|
@@ -3975,11 +4022,11 @@ function ko(e) {
|
|
|
3975
4022
|
};
|
|
3976
4023
|
};
|
|
3977
4024
|
}
|
|
3978
|
-
function
|
|
4025
|
+
function Mo(e) {
|
|
3979
4026
|
return function(t, n) {
|
|
3980
4027
|
if (t === void 0 && (t = {}), n === void 0 && (n = {}), n.type === Z.setItemEnd) {
|
|
3981
|
-
if (n.key ===
|
|
3982
|
-
if (n.key ===
|
|
4028
|
+
if (n.key === bo) return X({}, t, { anonymousId: n.value });
|
|
4029
|
+
if (n.key === xo) return X({}, t, { userId: n.value });
|
|
3983
4030
|
}
|
|
3984
4031
|
switch (n.type) {
|
|
3985
4032
|
case Z.identify: return Object.assign({}, t, {
|
|
@@ -3987,9 +4034,9 @@ function Ao(e) {
|
|
|
3987
4034
|
traits: X({}, t.traits, n.traits)
|
|
3988
4035
|
});
|
|
3989
4036
|
case Z.reset: return [
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
4037
|
+
xo,
|
|
4038
|
+
bo,
|
|
4039
|
+
So
|
|
3993
4040
|
].forEach(function(t) {
|
|
3994
4041
|
e.removeItem(t);
|
|
3995
4042
|
}), Object.assign({}, t, {
|
|
@@ -4001,37 +4048,37 @@ function Ao(e) {
|
|
|
4001
4048
|
}
|
|
4002
4049
|
};
|
|
4003
4050
|
}
|
|
4004
|
-
function
|
|
4051
|
+
function No(e) {
|
|
4005
4052
|
return {
|
|
4006
|
-
userId: e.getItem(
|
|
4007
|
-
anonymousId: e.getItem(
|
|
4008
|
-
traits: e.getItem(
|
|
4053
|
+
userId: e.getItem(xo),
|
|
4054
|
+
anonymousId: e.getItem(bo),
|
|
4055
|
+
traits: e.getItem(So)
|
|
4009
4056
|
};
|
|
4010
4057
|
}
|
|
4011
|
-
var
|
|
4058
|
+
var Po = function(e) {
|
|
4012
4059
|
return "__TEMP__" + e;
|
|
4013
4060
|
};
|
|
4014
|
-
function
|
|
4061
|
+
function Fo(e) {
|
|
4015
4062
|
var t = e.storage, n = t.setItem, r = t.removeItem, i = t.getItem;
|
|
4016
4063
|
return function(e) {
|
|
4017
4064
|
return function(t) {
|
|
4018
4065
|
return function(a) {
|
|
4019
4066
|
var o = a.userId, s = a.traits, c = a.options;
|
|
4020
4067
|
if (a.type === Z.reset && ([
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4068
|
+
xo,
|
|
4069
|
+
So,
|
|
4070
|
+
bo
|
|
4024
4071
|
].forEach(function(e) {
|
|
4025
4072
|
r(e);
|
|
4026
4073
|
}), [
|
|
4027
|
-
|
|
4028
|
-
|
|
4074
|
+
wo,
|
|
4075
|
+
To,
|
|
4029
4076
|
"traits"
|
|
4030
4077
|
].forEach(function(e) {
|
|
4031
|
-
|
|
4078
|
+
ro(Po(e));
|
|
4032
4079
|
})), a.type === Z.identify) {
|
|
4033
|
-
i(
|
|
4034
|
-
var l = i(
|
|
4080
|
+
i(bo) || n(bo, Xa());
|
|
4081
|
+
var l = i(xo), u = i(So) || {};
|
|
4035
4082
|
l && l !== o && e.dispatch({
|
|
4036
4083
|
type: Z.userIdChanged,
|
|
4037
4084
|
old: {
|
|
@@ -4043,30 +4090,30 @@ function No(e) {
|
|
|
4043
4090
|
traits: s
|
|
4044
4091
|
},
|
|
4045
4092
|
options: c
|
|
4046
|
-
}), o && n(
|
|
4093
|
+
}), o && n(xo, o), s && n(So, X({}, u, s));
|
|
4047
4094
|
}
|
|
4048
4095
|
return t(a);
|
|
4049
4096
|
};
|
|
4050
4097
|
};
|
|
4051
4098
|
};
|
|
4052
4099
|
}
|
|
4053
|
-
var
|
|
4054
|
-
function
|
|
4055
|
-
|
|
4100
|
+
var Io = {};
|
|
4101
|
+
function Lo(e, t) {
|
|
4102
|
+
Io[e] && ka(Io[e]) && (Io[e](t), delete Io[e]);
|
|
4056
4103
|
}
|
|
4057
|
-
function
|
|
4104
|
+
function Ro(e, t, n) {
|
|
4058
4105
|
return new Promise(function(r, i) {
|
|
4059
4106
|
return t() ? r(e) : n < 1 ? i(X({}, e, { queue: !0 })) : new Promise(function(e) {
|
|
4060
4107
|
return setTimeout(e, 10);
|
|
4061
4108
|
}).then(function(a) {
|
|
4062
|
-
return
|
|
4109
|
+
return Ro(e, t, n - 10).then(r, i);
|
|
4063
4110
|
});
|
|
4064
4111
|
});
|
|
4065
4112
|
}
|
|
4066
|
-
function
|
|
4113
|
+
function zo(e) {
|
|
4067
4114
|
return { abort: e };
|
|
4068
4115
|
}
|
|
4069
|
-
function
|
|
4116
|
+
function Bo(e, t, n) {
|
|
4070
4117
|
var r = {}, i = t(), a = e.getState(), o = a.plugins, s = a.queue, c = a.user;
|
|
4071
4118
|
if (!a.context.offline && s && s.actions && s.actions.length) {
|
|
4072
4119
|
var l = s.actions.reduce(function(e, t, n) {
|
|
@@ -4079,9 +4126,9 @@ function Ro(e, t, n) {
|
|
|
4079
4126
|
});
|
|
4080
4127
|
l.processIndex && l.processIndex.length && (l.processIndex.forEach(function(t) {
|
|
4081
4128
|
var a = s.actions[t], l = a.plugin, u = a.payload.type, d = i[l][u];
|
|
4082
|
-
if (d &&
|
|
4129
|
+
if (d && ka(d)) {
|
|
4083
4130
|
var f, p = function(e, t) {
|
|
4084
|
-
return e === void 0 && (e = {}), t === void 0 && (t = {}), [
|
|
4131
|
+
return e === void 0 && (e = {}), t === void 0 && (t = {}), [wo, To].reduce(function(n, r) {
|
|
4085
4132
|
return e.hasOwnProperty(r) && t[r] && t[r] !== e[r] && (n[r] = t[r]), n;
|
|
4086
4133
|
}, e);
|
|
4087
4134
|
}(a.payload, c), m = r[p.meta.rid];
|
|
@@ -4089,8 +4136,8 @@ function Ro(e, t, n) {
|
|
|
4089
4136
|
payload: p,
|
|
4090
4137
|
config: o[l].config,
|
|
4091
4138
|
instance: n,
|
|
4092
|
-
abort:
|
|
4093
|
-
})) &&
|
|
4139
|
+
abort: zo
|
|
4140
|
+
})) && Ia(f) && f.abort) return void (r[p.meta.rid] = !0);
|
|
4094
4141
|
if (!m) {
|
|
4095
4142
|
var h = u + ":" + l;
|
|
4096
4143
|
e.dispatch(X({}, p, {
|
|
@@ -4107,10 +4154,10 @@ function Ro(e, t, n) {
|
|
|
4107
4154
|
}));
|
|
4108
4155
|
}
|
|
4109
4156
|
}
|
|
4110
|
-
var
|
|
4157
|
+
var Vo = function(e) {
|
|
4111
4158
|
var t = e.data, n = e.action, r = e.instance, i = e.state, a = e.allPlugins, o = e.allMatches, s = e.store, c = e.EVENTS;
|
|
4112
4159
|
try {
|
|
4113
|
-
var l = i.plugins, u = i.context, d = n.type, f = d.match(
|
|
4160
|
+
var l = i.plugins, u = i.context, d = n.type, f = d.match(Ho), p = t.exact.map(function(e) {
|
|
4114
4161
|
return e.pluginName;
|
|
4115
4162
|
});
|
|
4116
4163
|
f && (p = o.during.map(function(e) {
|
|
@@ -4120,10 +4167,10 @@ var zo = function(e) {
|
|
|
4120
4167
|
return function(n, r, i) {
|
|
4121
4168
|
var a = r.config, o = r.name, s = o + "." + n.type;
|
|
4122
4169
|
i && (s = i.event);
|
|
4123
|
-
var c = n.type.match(
|
|
4170
|
+
var c = n.type.match(Ho) ? function(e, t, n, r, i) {
|
|
4124
4171
|
return function(a, o) {
|
|
4125
|
-
var s = r ? r.name : e, c = o &&
|
|
4126
|
-
if (r && (!(c = o &&
|
|
4172
|
+
var s = r ? r.name : e, c = o && Zo(o) ? o : n;
|
|
4173
|
+
if (r && (!(c = o && Zo(o) ? o : [e]).includes(e) || c.length !== 1)) throw Error("Method " + t + " can only abort " + e + " plugin. " + JSON.stringify(c) + " input valid");
|
|
4127
4174
|
return X({}, i, { abort: {
|
|
4128
4175
|
reason: a,
|
|
4129
4176
|
plugins: c,
|
|
@@ -4137,7 +4184,7 @@ var zo = function(e) {
|
|
|
4137
4184
|
};
|
|
4138
4185
|
}(n, s);
|
|
4139
4186
|
return {
|
|
4140
|
-
payload:
|
|
4187
|
+
payload: es(n),
|
|
4141
4188
|
instance: e,
|
|
4142
4189
|
config: a || {},
|
|
4143
4190
|
abort: c
|
|
@@ -4156,10 +4203,10 @@ var zo = function(e) {
|
|
|
4156
4203
|
var o = function() {
|
|
4157
4204
|
if (t.namespaced && t.namespaced[s]) return Promise.resolve(t.namespaced[s].reduce(function(e, t, n) {
|
|
4158
4205
|
return Promise.resolve(e).then(function(e) {
|
|
4159
|
-
return t.method &&
|
|
4160
|
-
var n =
|
|
4206
|
+
return t.method && ka(t.method) ? (function(e, t) {
|
|
4207
|
+
var n = $o(e);
|
|
4161
4208
|
if (n && n.name === t) {
|
|
4162
|
-
var r =
|
|
4209
|
+
var r = $o(n.method);
|
|
4163
4210
|
throw Error([
|
|
4164
4211
|
t + " plugin is calling method " + e,
|
|
4165
4212
|
"Plugins cant call self",
|
|
@@ -4177,10 +4224,10 @@ var zo = function(e) {
|
|
|
4177
4224
|
from: o || i
|
|
4178
4225
|
} });
|
|
4179
4226
|
}),
|
|
4180
|
-
config:
|
|
4227
|
+
config: Ko(t.pluginName, l, a),
|
|
4181
4228
|
plugins: l
|
|
4182
4229
|
})).then(function(t) {
|
|
4183
|
-
var n =
|
|
4230
|
+
var n = Ia(t) ? t : {};
|
|
4184
4231
|
return Promise.resolve(X({}, e, n));
|
|
4185
4232
|
})) : e;
|
|
4186
4233
|
var n, i, o;
|
|
@@ -4198,14 +4245,14 @@ var zo = function(e) {
|
|
|
4198
4245
|
var c = t.exact.length === o + 1, u = i.pluginName, p = a[u];
|
|
4199
4246
|
return Promise.resolve(n).then(function(t) {
|
|
4200
4247
|
var n = e[u] ? e[u] : {};
|
|
4201
|
-
if (f && (n = t),
|
|
4248
|
+
if (f && (n = t), Yo(n, u)) return Go({
|
|
4202
4249
|
data: n,
|
|
4203
4250
|
method: d,
|
|
4204
4251
|
instance: r,
|
|
4205
4252
|
pluginName: u,
|
|
4206
4253
|
store: s
|
|
4207
4254
|
}), Promise.resolve(t);
|
|
4208
|
-
if (
|
|
4255
|
+
if (Yo(t, u)) return c && Go({
|
|
4209
4256
|
data: t,
|
|
4210
4257
|
method: d,
|
|
4211
4258
|
instance: r,
|
|
@@ -4225,11 +4272,11 @@ var zo = function(e) {
|
|
|
4225
4272
|
abort: i.abort,
|
|
4226
4273
|
payload: n,
|
|
4227
4274
|
instance: r,
|
|
4228
|
-
config:
|
|
4275
|
+
config: Ko(u, l, a),
|
|
4229
4276
|
plugins: l
|
|
4230
4277
|
})).then(function(i) {
|
|
4231
|
-
var a =
|
|
4232
|
-
if (
|
|
4278
|
+
var a = Ia(i) ? i : {}, o = X({}, t, a), c = e[u];
|
|
4279
|
+
if (Yo(c, u)) Go({
|
|
4233
4280
|
data: c,
|
|
4234
4281
|
method: d,
|
|
4235
4282
|
instance: r,
|
|
@@ -4238,7 +4285,7 @@ var zo = function(e) {
|
|
|
4238
4285
|
});
|
|
4239
4286
|
else {
|
|
4240
4287
|
var l = d + ":" + u;
|
|
4241
|
-
(l.match(/:/g) || []).length < 2 && !d.match(
|
|
4288
|
+
(l.match(/:/g) || []).length < 2 && !d.match(Uo) && !d.match(Wo) && r.dispatch(X({}, f ? o : n, {
|
|
4242
4289
|
type: l,
|
|
4243
4290
|
_: {
|
|
4244
4291
|
called: l,
|
|
@@ -4253,14 +4300,14 @@ var zo = function(e) {
|
|
|
4253
4300
|
return Promise.reject(e);
|
|
4254
4301
|
}
|
|
4255
4302
|
}, Promise.resolve(n))).then(function(e) {
|
|
4256
|
-
if (!(d.match(
|
|
4303
|
+
if (!(d.match(Ho) || d.match(/^registerPlugin/) || d.match(Wo) || d.match(Uo) || d.match(/^params/) || d.match(/^userIdChanged/))) {
|
|
4257
4304
|
if (c.plugins.includes(d), e._ && e._.originalAction === d) return e;
|
|
4258
4305
|
var n = X({}, e, { _: {
|
|
4259
4306
|
originalAction: e.type,
|
|
4260
4307
|
called: e.type,
|
|
4261
4308
|
from: "engineEnd"
|
|
4262
4309
|
} });
|
|
4263
|
-
|
|
4310
|
+
Xo(e, t.exact.length) && !d.match(/End$/) && (n = X({}, n, { type: e.type + "Aborted" })), s.dispatch(n);
|
|
4264
4311
|
}
|
|
4265
4312
|
return e;
|
|
4266
4313
|
});
|
|
@@ -4268,8 +4315,8 @@ var zo = function(e) {
|
|
|
4268
4315
|
} catch (e) {
|
|
4269
4316
|
return Promise.reject(e);
|
|
4270
4317
|
}
|
|
4271
|
-
},
|
|
4272
|
-
function
|
|
4318
|
+
}, Ho = /Start$/, Uo = /^bootstrap/, Wo = /^ready/;
|
|
4319
|
+
function Go(e) {
|
|
4273
4320
|
var t = e.pluginName, n = e.method + "Aborted" + (t ? ":" + t : "");
|
|
4274
4321
|
e.store.dispatch(X({}, e.data, {
|
|
4275
4322
|
type: n,
|
|
@@ -4279,11 +4326,11 @@ function Uo(e) {
|
|
|
4279
4326
|
}
|
|
4280
4327
|
}));
|
|
4281
4328
|
}
|
|
4282
|
-
function
|
|
4329
|
+
function Ko(e, t, n) {
|
|
4283
4330
|
var r = t[e] || n[e];
|
|
4284
4331
|
return r && r.config ? r.config : {};
|
|
4285
4332
|
}
|
|
4286
|
-
function
|
|
4333
|
+
function qo(e, t) {
|
|
4287
4334
|
return t.reduce(function(t, n) {
|
|
4288
4335
|
return n[e] ? t.concat({
|
|
4289
4336
|
methodName: e,
|
|
@@ -4292,44 +4339,44 @@ function Go(e, t) {
|
|
|
4292
4339
|
}) : t;
|
|
4293
4340
|
}, []);
|
|
4294
4341
|
}
|
|
4295
|
-
function
|
|
4296
|
-
var n = e.replace(
|
|
4342
|
+
function Jo(e, t) {
|
|
4343
|
+
var n = e.replace(Ho, ""), r = t ? ":" + t : "";
|
|
4297
4344
|
return [
|
|
4298
4345
|
"" + e + r,
|
|
4299
4346
|
"" + n + r,
|
|
4300
4347
|
n + "End" + r
|
|
4301
4348
|
];
|
|
4302
4349
|
}
|
|
4303
|
-
function
|
|
4350
|
+
function Yo(e, t) {
|
|
4304
4351
|
var n = e.abort;
|
|
4305
|
-
return !!n && (!0 === n ||
|
|
4352
|
+
return !!n && (!0 === n || Qo(n, t) || n && Qo(n.plugins, t));
|
|
4306
4353
|
}
|
|
4307
|
-
function
|
|
4354
|
+
function Xo(e, t) {
|
|
4308
4355
|
var n = e.abort;
|
|
4309
4356
|
if (!n) return !1;
|
|
4310
|
-
if (!0 === n ||
|
|
4357
|
+
if (!0 === n || Aa(n)) return !0;
|
|
4311
4358
|
var r = n.plugins;
|
|
4312
|
-
return
|
|
4359
|
+
return Zo(n) && n.length === t || Zo(r) && r.length === t;
|
|
4313
4360
|
}
|
|
4314
|
-
function
|
|
4361
|
+
function Zo(e) {
|
|
4315
4362
|
return Array.isArray(e);
|
|
4316
4363
|
}
|
|
4317
|
-
function
|
|
4318
|
-
return !(!e || !
|
|
4364
|
+
function Qo(e, t) {
|
|
4365
|
+
return !(!e || !Zo(e)) && e.includes(t);
|
|
4319
4366
|
}
|
|
4320
|
-
function
|
|
4367
|
+
function $o(e) {
|
|
4321
4368
|
var t = e.match(/(.*):(.*)/);
|
|
4322
4369
|
return !!t && {
|
|
4323
4370
|
method: t[1],
|
|
4324
4371
|
name: t[2]
|
|
4325
4372
|
};
|
|
4326
4373
|
}
|
|
4327
|
-
function
|
|
4374
|
+
function es(e) {
|
|
4328
4375
|
return Object.keys(e).reduce(function(t, n) {
|
|
4329
|
-
return n === "type" || (t[n] =
|
|
4376
|
+
return n === "type" || (t[n] = Ia(e[n]) ? Object.assign({}, e[n]) : e[n]), t;
|
|
4330
4377
|
}, {});
|
|
4331
4378
|
}
|
|
4332
|
-
function
|
|
4379
|
+
function ts(e, t, n) {
|
|
4333
4380
|
var r = {};
|
|
4334
4381
|
return function(i) {
|
|
4335
4382
|
return function(a) {
|
|
@@ -4346,7 +4393,7 @@ function $o(e, t, n) {
|
|
|
4346
4393
|
fromEnable: !0,
|
|
4347
4394
|
meta: o.meta
|
|
4348
4395
|
}), l === Z.disablePlugin && setTimeout(function() {
|
|
4349
|
-
return
|
|
4396
|
+
return Lo(o.meta.rid, { payload: o });
|
|
4350
4397
|
}, 0), l === Z.initializeEnd) {
|
|
4351
4398
|
var f = t(), p = Object.keys(f), m = p.filter(function(e) {
|
|
4352
4399
|
return u.includes(e);
|
|
@@ -4354,14 +4401,14 @@ function $o(e, t, n) {
|
|
|
4354
4401
|
return f[e];
|
|
4355
4402
|
}), h = [], g = [], _ = o.disabled, v = m.map(function(e) {
|
|
4356
4403
|
var t = e.loaded, n = e.name, a = e.config;
|
|
4357
|
-
return
|
|
4404
|
+
return Ro(e, function() {
|
|
4358
4405
|
return t({ config: a });
|
|
4359
4406
|
}, 1e4).then(function(t) {
|
|
4360
4407
|
return r[n] || (i.dispatch({
|
|
4361
4408
|
type: Z.pluginReadyType(n),
|
|
4362
4409
|
name: n,
|
|
4363
4410
|
events: Object.keys(e).filter(function(e) {
|
|
4364
|
-
return !
|
|
4411
|
+
return !Do.includes(e);
|
|
4365
4412
|
})
|
|
4366
4413
|
}), r[n] = !0), h = h.concat(n), e;
|
|
4367
4414
|
}).catch(function(e) {
|
|
@@ -4382,14 +4429,14 @@ function $o(e, t, n) {
|
|
|
4382
4429
|
}
|
|
4383
4430
|
var y = function() {
|
|
4384
4431
|
if (l !== Z.bootstrap) return /^ready:([^:]*)$/.test(l) && setTimeout(function() {
|
|
4385
|
-
return
|
|
4432
|
+
return Bo(i, t, e);
|
|
4386
4433
|
}, 0), Promise.resolve(function(e, t, n, r, i) {
|
|
4387
4434
|
try {
|
|
4388
|
-
var a =
|
|
4435
|
+
var a = ka(t) ? t() : t, o = e.type, s = o.replace(Ho, "");
|
|
4389
4436
|
if (e._ && e._.called) return Promise.resolve(e);
|
|
4390
4437
|
var c = n.getState(), l = (f = a, (p = c.plugins) === void 0 && (p = {}), (m = e.options) === void 0 && (m = {}), Object.keys(f).filter(function(e) {
|
|
4391
4438
|
var t = m.plugins || {};
|
|
4392
|
-
return
|
|
4439
|
+
return Ma(t[e]) ? t[e] : !1 !== t.all && (!p[e] || !1 !== p[e].enabled);
|
|
4393
4440
|
}).map(function(e) {
|
|
4394
4441
|
return f[e];
|
|
4395
4442
|
}));
|
|
@@ -4402,12 +4449,12 @@ function $o(e, t, n) {
|
|
|
4402
4449
|
var u = l.map(function(e) {
|
|
4403
4450
|
return e.name;
|
|
4404
4451
|
}), d = function(e, t) {
|
|
4405
|
-
var n =
|
|
4406
|
-
return
|
|
4452
|
+
var n = Jo(e).map(function(e) {
|
|
4453
|
+
return qo(e, t);
|
|
4407
4454
|
});
|
|
4408
4455
|
return t.reduce(function(n, r) {
|
|
4409
|
-
var i = r.name, a =
|
|
4410
|
-
return
|
|
4456
|
+
var i = r.name, a = Jo(e, i).map(function(e) {
|
|
4457
|
+
return qo(e, t);
|
|
4411
4458
|
}), o = a[0], s = a[1], c = a[2];
|
|
4412
4459
|
return o.length && (n.beforeNS[i] = o), s.length && (n.duringNS[i] = s), c.length && (n.afterNS[i] = c), n;
|
|
4413
4460
|
}, {
|
|
@@ -4419,7 +4466,7 @@ function $o(e, t, n) {
|
|
|
4419
4466
|
afterNS: {}
|
|
4420
4467
|
});
|
|
4421
4468
|
}(o, l);
|
|
4422
|
-
return Promise.resolve(
|
|
4469
|
+
return Promise.resolve(Vo({
|
|
4423
4470
|
action: e,
|
|
4424
4471
|
data: {
|
|
4425
4472
|
exact: d.before,
|
|
@@ -4434,7 +4481,7 @@ function $o(e, t, n) {
|
|
|
4434
4481
|
})).then(function(e) {
|
|
4435
4482
|
function t() {
|
|
4436
4483
|
var t = function() {
|
|
4437
|
-
if (o.match(
|
|
4484
|
+
if (o.match(Ho)) return Promise.resolve(Vo({
|
|
4438
4485
|
action: X({}, l, { type: s + "End" }),
|
|
4439
4486
|
data: {
|
|
4440
4487
|
exact: d.after,
|
|
@@ -4447,16 +4494,16 @@ function $o(e, t, n) {
|
|
|
4447
4494
|
store: r,
|
|
4448
4495
|
EVENTS: i
|
|
4449
4496
|
})).then(function(e) {
|
|
4450
|
-
e.meta && e.meta.hasCallback &&
|
|
4497
|
+
e.meta && e.meta.hasCallback && Lo(e.meta.rid, { payload: e });
|
|
4451
4498
|
});
|
|
4452
4499
|
}();
|
|
4453
4500
|
return t && t.then ? t.then(function() {
|
|
4454
4501
|
return e;
|
|
4455
4502
|
}) : e;
|
|
4456
4503
|
}
|
|
4457
|
-
if (
|
|
4504
|
+
if (Xo(e, u.length)) return e;
|
|
4458
4505
|
var l, f = function() {
|
|
4459
|
-
if (o !== s) return Promise.resolve(
|
|
4506
|
+
if (o !== s) return Promise.resolve(Vo({
|
|
4460
4507
|
action: X({}, e, { type: s }),
|
|
4461
4508
|
data: {
|
|
4462
4509
|
exact: d.during,
|
|
@@ -4492,7 +4539,7 @@ function $o(e, t, n) {
|
|
|
4492
4539
|
};
|
|
4493
4540
|
};
|
|
4494
4541
|
}
|
|
4495
|
-
function
|
|
4542
|
+
function ns(e) {
|
|
4496
4543
|
return function(t) {
|
|
4497
4544
|
return function(t) {
|
|
4498
4545
|
return function(n) {
|
|
@@ -4506,7 +4553,7 @@ function es(e) {
|
|
|
4506
4553
|
};
|
|
4507
4554
|
};
|
|
4508
4555
|
}
|
|
4509
|
-
var
|
|
4556
|
+
var rs = function() {
|
|
4510
4557
|
var e = this;
|
|
4511
4558
|
this.before = [], this.after = [], this.addMiddleware = function(t, n) {
|
|
4512
4559
|
e[n] = e[n].concat(t);
|
|
@@ -4527,19 +4574,19 @@ var ts = function() {
|
|
|
4527
4574
|
}, o = e[t].map(function(e) {
|
|
4528
4575
|
return e(a);
|
|
4529
4576
|
});
|
|
4530
|
-
return
|
|
4577
|
+
return vo.apply(void 0, o)(r)(i);
|
|
4531
4578
|
};
|
|
4532
4579
|
};
|
|
4533
4580
|
};
|
|
4534
4581
|
};
|
|
4535
4582
|
};
|
|
4536
|
-
function
|
|
4583
|
+
function is(e) {
|
|
4537
4584
|
return function(t, n) {
|
|
4538
4585
|
t === void 0 && (t = {});
|
|
4539
4586
|
var r = {};
|
|
4540
4587
|
if (n.type === "initialize:aborted") return t;
|
|
4541
4588
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
4542
|
-
var i =
|
|
4589
|
+
var i = as(n.type, "registerPlugin"), a = e()[i];
|
|
4543
4590
|
if (!a || !i) return t;
|
|
4544
4591
|
var o = n.enabled, s = a.config;
|
|
4545
4592
|
return r[i] = {
|
|
@@ -4550,7 +4597,7 @@ function ns(e) {
|
|
|
4550
4597
|
}, X({}, t, r);
|
|
4551
4598
|
}
|
|
4552
4599
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
4553
|
-
var c =
|
|
4600
|
+
var c = as(n.type, Z.initialize), l = e()[c];
|
|
4554
4601
|
return l && c ? (r[c] = X({}, t[c], {
|
|
4555
4602
|
initialized: !0,
|
|
4556
4603
|
loaded: !!l.loaded({ config: l.config })
|
|
@@ -4558,35 +4605,35 @@ function ns(e) {
|
|
|
4558
4605
|
}
|
|
4559
4606
|
if (/^ready:([^:]*)$/.test(n.type)) return r[n.name] = X({}, t[n.name], { loaded: !0 }), X({}, t, r);
|
|
4560
4607
|
switch (n.type) {
|
|
4561
|
-
case Z.disablePlugin: return X({}, t,
|
|
4562
|
-
case Z.enablePlugin: return X({}, t,
|
|
4608
|
+
case Z.disablePlugin: return X({}, t, os(n.plugins, !1, t));
|
|
4609
|
+
case Z.enablePlugin: return X({}, t, os(n.plugins, !0, t));
|
|
4563
4610
|
default: return t;
|
|
4564
4611
|
}
|
|
4565
4612
|
};
|
|
4566
4613
|
}
|
|
4567
|
-
function
|
|
4614
|
+
function as(e, t) {
|
|
4568
4615
|
return e.substring(t.length + 1, e.length);
|
|
4569
4616
|
}
|
|
4570
|
-
function
|
|
4617
|
+
function os(e, t, n) {
|
|
4571
4618
|
return e.reduce(function(e, r) {
|
|
4572
4619
|
return e[r] = X({}, n[r], { enabled: t }), e;
|
|
4573
4620
|
}, n);
|
|
4574
4621
|
}
|
|
4575
|
-
function
|
|
4622
|
+
function ss(e) {
|
|
4576
4623
|
try {
|
|
4577
4624
|
return JSON.parse(JSON.stringify(e));
|
|
4578
4625
|
} catch {}
|
|
4579
4626
|
return e;
|
|
4580
4627
|
}
|
|
4581
|
-
var
|
|
4628
|
+
var cs = {
|
|
4582
4629
|
last: {},
|
|
4583
4630
|
history: []
|
|
4584
4631
|
};
|
|
4585
|
-
function
|
|
4586
|
-
e === void 0 && (e =
|
|
4632
|
+
function ls(e, t) {
|
|
4633
|
+
e === void 0 && (e = cs);
|
|
4587
4634
|
var n = t.options, r = t.meta;
|
|
4588
4635
|
if (t.type === Z.track) {
|
|
4589
|
-
var i =
|
|
4636
|
+
var i = ss(X({
|
|
4590
4637
|
event: t.event,
|
|
4591
4638
|
properties: t.properties
|
|
4592
4639
|
}, Object.keys(n).length && { options: n }, { meta: r }));
|
|
@@ -4597,9 +4644,9 @@ function ss(e, t) {
|
|
|
4597
4644
|
}
|
|
4598
4645
|
return e;
|
|
4599
4646
|
}
|
|
4600
|
-
var
|
|
4601
|
-
function
|
|
4602
|
-
e === void 0 && (e =
|
|
4647
|
+
var us = { actions: [] };
|
|
4648
|
+
function ds(e, t) {
|
|
4649
|
+
e === void 0 && (e = us);
|
|
4603
4650
|
var n = t.payload;
|
|
4604
4651
|
switch (t.type) {
|
|
4605
4652
|
case "queue":
|
|
@@ -4609,12 +4656,12 @@ function ls(e, t) {
|
|
|
4609
4656
|
default: return e;
|
|
4610
4657
|
}
|
|
4611
4658
|
}
|
|
4612
|
-
var
|
|
4613
|
-
function
|
|
4659
|
+
var fs = /#.*$/;
|
|
4660
|
+
function ps(e) {
|
|
4614
4661
|
var t = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);
|
|
4615
|
-
return "/" + (t && t[3] ? t[3].split("?")[0].replace(
|
|
4662
|
+
return "/" + (t && t[3] ? t[3].split("?")[0].replace(fs, "") : "");
|
|
4616
4663
|
}
|
|
4617
|
-
var
|
|
4664
|
+
var ms, hs, gs, _s, vs = function(e) {
|
|
4618
4665
|
if (e === void 0 && (e = {}), !Y) return e;
|
|
4619
4666
|
var t = document, n = t.title, r = t.referrer, i = window, a = i.location, o = i.innerWidth, s = i.innerHeight, c = a.hash, l = a.search, u = function(e) {
|
|
4620
4667
|
var t = function() {
|
|
@@ -4622,26 +4669,26 @@ var fs, ps, ms, hs, gs = function(e) {
|
|
|
4622
4669
|
for (var e, t = document.getElementsByTagName("link"), n = 0; e = t[n]; n++) if (e.getAttribute("rel") === "canonical") return e.getAttribute("href");
|
|
4623
4670
|
}
|
|
4624
4671
|
}();
|
|
4625
|
-
return t ? t.match(/\?/) ? t : t + e : window.location.href.replace(
|
|
4672
|
+
return t ? t.match(/\?/) ? t : t + e : window.location.href.replace(fs, "");
|
|
4626
4673
|
}(l), d = {
|
|
4627
4674
|
title: n,
|
|
4628
4675
|
url: u,
|
|
4629
|
-
path:
|
|
4676
|
+
path: ps(u),
|
|
4630
4677
|
hash: c,
|
|
4631
4678
|
search: l,
|
|
4632
4679
|
width: o,
|
|
4633
4680
|
height: s
|
|
4634
4681
|
};
|
|
4635
4682
|
return r && r !== "" && (d.referrer = r), X({}, d, e);
|
|
4636
|
-
},
|
|
4683
|
+
}, ys = {
|
|
4637
4684
|
last: {},
|
|
4638
4685
|
history: []
|
|
4639
4686
|
};
|
|
4640
|
-
function
|
|
4641
|
-
e === void 0 && (e =
|
|
4687
|
+
function bs(e, t) {
|
|
4688
|
+
e === void 0 && (e = ys);
|
|
4642
4689
|
var n = t.options;
|
|
4643
4690
|
if (t.type === Z.page) {
|
|
4644
|
-
var r =
|
|
4691
|
+
var r = ss(X({
|
|
4645
4692
|
properties: t.properties,
|
|
4646
4693
|
meta: t.meta
|
|
4647
4694
|
}, Object.keys(n).length && { options: n }));
|
|
@@ -4652,45 +4699,45 @@ function vs(e, t) {
|
|
|
4652
4699
|
}
|
|
4653
4700
|
return e;
|
|
4654
4701
|
}
|
|
4655
|
-
|
|
4702
|
+
ms = function() {
|
|
4656
4703
|
if (!Y) return !1;
|
|
4657
4704
|
var e = navigator.appVersion;
|
|
4658
4705
|
return ~e.indexOf("Win") ? "Windows" : ~e.indexOf("Mac") ? "MacOS" : ~e.indexOf("X11") ? "UNIX" : ~e.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
4659
|
-
}(),
|
|
4660
|
-
var
|
|
4706
|
+
}(), hs = Y ? document.referrer : null, gs = Ka(), _s = qa();
|
|
4707
|
+
var xs = {
|
|
4661
4708
|
initialized: !1,
|
|
4662
|
-
sessionId:
|
|
4709
|
+
sessionId: Xa(),
|
|
4663
4710
|
app: null,
|
|
4664
4711
|
version: null,
|
|
4665
4712
|
debug: !1,
|
|
4666
4713
|
offline: !!Y && !navigator.onLine,
|
|
4667
|
-
os: { name:
|
|
4714
|
+
os: { name: ms },
|
|
4668
4715
|
userAgent: Y ? navigator.userAgent : "node",
|
|
4669
4716
|
library: {
|
|
4670
|
-
name:
|
|
4717
|
+
name: Co,
|
|
4671
4718
|
version: "0.13.1"
|
|
4672
4719
|
},
|
|
4673
|
-
timezone:
|
|
4674
|
-
locale:
|
|
4720
|
+
timezone: _s,
|
|
4721
|
+
locale: gs,
|
|
4675
4722
|
campaign: {},
|
|
4676
|
-
referrer:
|
|
4723
|
+
referrer: hs
|
|
4677
4724
|
};
|
|
4678
|
-
function
|
|
4679
|
-
e === void 0 && (e =
|
|
4725
|
+
function Ss(e, t) {
|
|
4726
|
+
e === void 0 && (e = xs);
|
|
4680
4727
|
var n = e.initialized, r = t.campaign;
|
|
4681
4728
|
switch (t.type) {
|
|
4682
4729
|
case Z.campaign: return X({}, e, { campaign: r });
|
|
4683
4730
|
case Z.offline: return X({}, e, { offline: !0 });
|
|
4684
4731
|
case Z.online: return X({}, e, { offline: !1 });
|
|
4685
|
-
default: return n ? e : X({},
|
|
4732
|
+
default: return n ? e : X({}, xs, e, { initialized: !0 });
|
|
4686
4733
|
}
|
|
4687
4734
|
}
|
|
4688
|
-
var
|
|
4735
|
+
var Cs = [
|
|
4689
4736
|
"plugins",
|
|
4690
4737
|
"reducers",
|
|
4691
4738
|
"storage"
|
|
4692
4739
|
];
|
|
4693
|
-
function
|
|
4740
|
+
function ws(e, t, n) {
|
|
4694
4741
|
if (Y) {
|
|
4695
4742
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
4696
4743
|
e.split(" ").forEach(function(e) {
|
|
@@ -4698,37 +4745,37 @@ function Ss(e, t, n) {
|
|
|
4698
4745
|
});
|
|
4699
4746
|
}
|
|
4700
4747
|
}
|
|
4701
|
-
function
|
|
4702
|
-
var t =
|
|
4748
|
+
function Ts(e) {
|
|
4749
|
+
var t = ws.bind(null, "online offline", function(t) {
|
|
4703
4750
|
return Promise.resolve(!navigator.onLine).then(e);
|
|
4704
4751
|
});
|
|
4705
4752
|
return t(!0), function(e) {
|
|
4706
4753
|
return t(!1);
|
|
4707
4754
|
};
|
|
4708
4755
|
}
|
|
4709
|
-
function
|
|
4710
|
-
return
|
|
4756
|
+
function Es() {
|
|
4757
|
+
return no(Co, []), function(e) {
|
|
4711
4758
|
return function(t, n, r) {
|
|
4712
4759
|
var i = e(t, n, r), a = i.dispatch;
|
|
4713
4760
|
return Object.assign(i, { dispatch: function(e) {
|
|
4714
|
-
return
|
|
4761
|
+
return eo[$a][Co].push(e.action || e), a(e);
|
|
4715
4762
|
} });
|
|
4716
4763
|
};
|
|
4717
4764
|
};
|
|
4718
4765
|
}
|
|
4719
|
-
function
|
|
4766
|
+
function Ds(e) {
|
|
4720
4767
|
return function() {
|
|
4721
|
-
return
|
|
4768
|
+
return vo(vo.apply(null, arguments), Es());
|
|
4722
4769
|
};
|
|
4723
4770
|
}
|
|
4724
|
-
function
|
|
4725
|
-
return e ?
|
|
4771
|
+
function Os(e) {
|
|
4772
|
+
return e ? Fa(e) ? e : [e] : [];
|
|
4726
4773
|
}
|
|
4727
|
-
function
|
|
4774
|
+
function ks(e, t, n) {
|
|
4728
4775
|
e === void 0 && (e = {});
|
|
4729
|
-
var r, i, a =
|
|
4730
|
-
return t && (
|
|
4731
|
-
for (var t, n = e || Array.prototype.slice.call(arguments), r = 0; r < n.length; r++) if (
|
|
4776
|
+
var r, i, a = Xa();
|
|
4777
|
+
return t && (Io[a] = (r = t, i = function(e) {
|
|
4778
|
+
for (var t, n = e || Array.prototype.slice.call(arguments), r = 0; r < n.length; r++) if (ka(n[r])) {
|
|
4732
4779
|
t = n[r];
|
|
4733
4780
|
break;
|
|
4734
4781
|
}
|
|
@@ -4740,10 +4787,10 @@ function Ds(e, t, n) {
|
|
|
4740
4787
|
ts: (/* @__PURE__ */ new Date()).getTime()
|
|
4741
4788
|
}, t ? { hasCallback: !0 } : {});
|
|
4742
4789
|
}
|
|
4743
|
-
function
|
|
4790
|
+
function As(e) {
|
|
4744
4791
|
e === void 0 && (e = {});
|
|
4745
4792
|
var t = e.reducers || {}, n = e.initialUser || {}, r = (e.plugins || []).reduce(function(e, t) {
|
|
4746
|
-
if (
|
|
4793
|
+
if (ka(t)) return e.middlewares = e.middlewares.concat(t), e;
|
|
4747
4794
|
if (t.NAMESPACE && (t.name = t.NAMESPACE), !t.name) throw Error("https://lytics.dev/errors/1");
|
|
4748
4795
|
t.config ||= {};
|
|
4749
4796
|
var n = t.EVENTS ? Object.keys(t.EVENTS).map(function(e) {
|
|
@@ -4769,29 +4816,29 @@ function Os(e) {
|
|
|
4769
4816
|
middlewares: [],
|
|
4770
4817
|
events: []
|
|
4771
4818
|
}), i = e.storage ? e.storage : {
|
|
4772
|
-
getItem:
|
|
4773
|
-
setItem:
|
|
4774
|
-
removeItem:
|
|
4819
|
+
getItem: to,
|
|
4820
|
+
setItem: no,
|
|
4821
|
+
removeItem: ro
|
|
4775
4822
|
}, a = function(e) {
|
|
4776
4823
|
return function(t, n, r) {
|
|
4777
|
-
return n.getState("user")[t] || (r &&
|
|
4824
|
+
return n.getState("user")[t] || (r && Ia(r) && r[t] ? r[t] : No(e)[t] || to(Po(t)) || null);
|
|
4778
4825
|
};
|
|
4779
4826
|
}(i), o = r.plugins, s = r.events.filter(function(e) {
|
|
4780
|
-
return !
|
|
4781
|
-
}).sort(), c = new Set(s.concat(
|
|
4782
|
-
return !
|
|
4827
|
+
return !Do.includes(e);
|
|
4828
|
+
}).sort(), c = new Set(s.concat(Eo).filter(function(e) {
|
|
4829
|
+
return !Do.includes(e);
|
|
4783
4830
|
})), l = Array.from(c).sort(), u = function() {
|
|
4784
4831
|
return o;
|
|
4785
|
-
}, d = new
|
|
4832
|
+
}, d = new rs(), f = d.addMiddleware, p = d.removeMiddleware, m = d.dynamicMiddlewares, h = function() {
|
|
4786
4833
|
throw Error("Abort disabled inListener");
|
|
4787
|
-
}, g =
|
|
4788
|
-
v.anonymousId ||=
|
|
4834
|
+
}, g = Ja(), _ = No(i), v = X({}, _, n, g.an_uid ? { userId: g.an_uid } : {}, g.an_aid ? { anonymousId: g.an_aid } : {});
|
|
4835
|
+
v.anonymousId ||= Xa();
|
|
4789
4836
|
var y = X({
|
|
4790
4837
|
enable: function(e, t) {
|
|
4791
4838
|
return new Promise(function(n) {
|
|
4792
4839
|
A.dispatch({
|
|
4793
4840
|
type: Z.enablePlugin,
|
|
4794
|
-
plugins:
|
|
4841
|
+
plugins: Os(e),
|
|
4795
4842
|
_: { originalAction: Z.enablePlugin }
|
|
4796
4843
|
}, n, [t]);
|
|
4797
4844
|
});
|
|
@@ -4800,7 +4847,7 @@ function Os(e) {
|
|
|
4800
4847
|
return new Promise(function(n) {
|
|
4801
4848
|
A.dispatch({
|
|
4802
4849
|
type: Z.disablePlugin,
|
|
4803
|
-
plugins:
|
|
4850
|
+
plugins: Os(e),
|
|
4804
4851
|
_: { originalAction: Z.disablePlugin }
|
|
4805
4852
|
}, n, [t]);
|
|
4806
4853
|
});
|
|
@@ -4808,9 +4855,9 @@ function Os(e) {
|
|
|
4808
4855
|
}, r.methods), b = !1, x = {
|
|
4809
4856
|
identify: function(e, t, n, r) {
|
|
4810
4857
|
try {
|
|
4811
|
-
var i =
|
|
4812
|
-
|
|
4813
|
-
var l = i || o.userId || a(
|
|
4858
|
+
var i = Aa(e) ? e : null, o = Ia(e) ? e : t, s = n || {}, c = x.user();
|
|
4859
|
+
no(Po(wo), i);
|
|
4860
|
+
var l = i || o.userId || a(wo, x, o);
|
|
4814
4861
|
return Promise.resolve(new Promise(function(e) {
|
|
4815
4862
|
A.dispatch(X({
|
|
4816
4863
|
type: Z.identifyStart,
|
|
@@ -4830,17 +4877,17 @@ function Os(e) {
|
|
|
4830
4877
|
},
|
|
4831
4878
|
track: function(e, t, n, r) {
|
|
4832
4879
|
try {
|
|
4833
|
-
var i =
|
|
4834
|
-
if (!i || !
|
|
4835
|
-
var o =
|
|
4880
|
+
var i = Ia(e) ? e.event : e;
|
|
4881
|
+
if (!i || !Aa(i)) throw Error("EventMissing");
|
|
4882
|
+
var o = Ia(e) ? e : t || {}, s = Ia(n) ? n : {};
|
|
4836
4883
|
return Promise.resolve(new Promise(function(e) {
|
|
4837
4884
|
A.dispatch({
|
|
4838
4885
|
type: Z.trackStart,
|
|
4839
4886
|
event: i,
|
|
4840
4887
|
properties: o,
|
|
4841
4888
|
options: s,
|
|
4842
|
-
userId: a(
|
|
4843
|
-
anonymousId: a(
|
|
4889
|
+
userId: a(wo, x, t),
|
|
4890
|
+
anonymousId: a(To, x, t)
|
|
4844
4891
|
}, e, [
|
|
4845
4892
|
t,
|
|
4846
4893
|
n,
|
|
@@ -4853,14 +4900,14 @@ function Os(e) {
|
|
|
4853
4900
|
},
|
|
4854
4901
|
page: function(e, t, n) {
|
|
4855
4902
|
try {
|
|
4856
|
-
var r =
|
|
4903
|
+
var r = Ia(e) ? e : {}, i = Ia(t) ? t : {};
|
|
4857
4904
|
return Promise.resolve(new Promise(function(o) {
|
|
4858
4905
|
A.dispatch({
|
|
4859
4906
|
type: Z.pageStart,
|
|
4860
|
-
properties:
|
|
4907
|
+
properties: vs(r),
|
|
4861
4908
|
options: i,
|
|
4862
|
-
userId: a(
|
|
4863
|
-
anonymousId: a(
|
|
4909
|
+
userId: a(wo, x, r),
|
|
4910
|
+
anonymousId: a(To, x, r)
|
|
4864
4911
|
}, o, [
|
|
4865
4912
|
e,
|
|
4866
4913
|
t,
|
|
@@ -4872,10 +4919,10 @@ function Os(e) {
|
|
|
4872
4919
|
}
|
|
4873
4920
|
},
|
|
4874
4921
|
user: function(e) {
|
|
4875
|
-
if (e ===
|
|
4876
|
-
if (e ===
|
|
4922
|
+
if (e === wo || e === "id") return a(wo, x);
|
|
4923
|
+
if (e === To || e === "anonId") return a(To, x);
|
|
4877
4924
|
var t = x.getState("user");
|
|
4878
|
-
return e ? (0,
|
|
4925
|
+
return e ? (0, la.default)(t, e) : t;
|
|
4879
4926
|
},
|
|
4880
4927
|
reset: function(e) {
|
|
4881
4928
|
return new Promise(function(t) {
|
|
@@ -4891,7 +4938,7 @@ function Os(e) {
|
|
|
4891
4938
|
});
|
|
4892
4939
|
},
|
|
4893
4940
|
on: function(e, t) {
|
|
4894
|
-
if (!e || !
|
|
4941
|
+
if (!e || !ka(t)) return !1;
|
|
4895
4942
|
if (e === Z.bootstrap) throw Error(".on disabled for " + e);
|
|
4896
4943
|
var n = /Start$|Start:/;
|
|
4897
4944
|
if (e === "*") {
|
|
@@ -4916,11 +4963,11 @@ function Os(e) {
|
|
|
4916
4963
|
};
|
|
4917
4964
|
};
|
|
4918
4965
|
};
|
|
4919
|
-
return f(r,
|
|
4920
|
-
p(r,
|
|
4966
|
+
return f(r, js), f(i, Ms), function() {
|
|
4967
|
+
p(r, js), p(i, Ms);
|
|
4921
4968
|
};
|
|
4922
4969
|
}
|
|
4923
|
-
var a = e.match(n) ?
|
|
4970
|
+
var a = e.match(n) ? js : Ms, s = function(n) {
|
|
4924
4971
|
return function(n) {
|
|
4925
4972
|
return function(r) {
|
|
4926
4973
|
return r.type === e && t({
|
|
@@ -4937,7 +4984,7 @@ function Os(e) {
|
|
|
4937
4984
|
};
|
|
4938
4985
|
},
|
|
4939
4986
|
once: function(e, t) {
|
|
4940
|
-
if (!e || !
|
|
4987
|
+
if (!e || !ka(t)) return !1;
|
|
4941
4988
|
if (e === Z.bootstrap) throw Error(".once disabled for " + e);
|
|
4942
4989
|
var n = x.on(e, function(e) {
|
|
4943
4990
|
t({
|
|
@@ -4951,11 +4998,11 @@ function Os(e) {
|
|
|
4951
4998
|
},
|
|
4952
4999
|
getState: function(e) {
|
|
4953
5000
|
var t = A.getState();
|
|
4954
|
-
return e ? (0,
|
|
5001
|
+
return e ? (0, la.default)(t, e) : Object.assign({}, t);
|
|
4955
5002
|
},
|
|
4956
5003
|
dispatch: function(e) {
|
|
4957
|
-
var t =
|
|
4958
|
-
if (
|
|
5004
|
+
var t = Aa(e) ? { type: e } : e;
|
|
5005
|
+
if (Eo.includes(t.type)) throw Error("reserved action " + t.type);
|
|
4959
5006
|
var n = X({}, t, { _: X({ originalAction: t.type }, e._ || {}) });
|
|
4960
5007
|
A.dispatch(n);
|
|
4961
5008
|
},
|
|
@@ -4981,49 +5028,49 @@ function Os(e) {
|
|
|
4981
5028
|
}
|
|
4982
5029
|
},
|
|
4983
5030
|
setAnonymousId: function(e, t) {
|
|
4984
|
-
x.storage.setItem(
|
|
5031
|
+
x.storage.setItem(bo, e, t);
|
|
4985
5032
|
},
|
|
4986
5033
|
events: {
|
|
4987
|
-
core:
|
|
5034
|
+
core: Eo,
|
|
4988
5035
|
plugins: s
|
|
4989
5036
|
}
|
|
4990
5037
|
}, S = r.middlewares.concat([
|
|
4991
5038
|
function(e) {
|
|
4992
5039
|
return function(e) {
|
|
4993
5040
|
return function(t) {
|
|
4994
|
-
return t.meta ||=
|
|
5041
|
+
return t.meta ||= ks(), e(t);
|
|
4995
5042
|
};
|
|
4996
5043
|
};
|
|
4997
5044
|
},
|
|
4998
|
-
m(
|
|
4999
|
-
|
|
5045
|
+
m(js),
|
|
5046
|
+
ts(x, u, {
|
|
5000
5047
|
all: l,
|
|
5001
5048
|
plugins: s
|
|
5002
5049
|
}),
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
m(
|
|
5050
|
+
ns(i),
|
|
5051
|
+
jo(x),
|
|
5052
|
+
Fo(x),
|
|
5053
|
+
m(Ms)
|
|
5007
5054
|
]), C = {
|
|
5008
|
-
context:
|
|
5009
|
-
user:
|
|
5010
|
-
page:
|
|
5011
|
-
track:
|
|
5012
|
-
plugins:
|
|
5013
|
-
queue:
|
|
5014
|
-
}, w =
|
|
5055
|
+
context: Ss,
|
|
5056
|
+
user: Mo(i),
|
|
5057
|
+
page: bs,
|
|
5058
|
+
track: ls,
|
|
5059
|
+
plugins: is(u),
|
|
5060
|
+
queue: ds
|
|
5061
|
+
}, w = vo, T = vo;
|
|
5015
5062
|
if (Y && e.debug) {
|
|
5016
5063
|
var E = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
5017
5064
|
E && (w = E({
|
|
5018
5065
|
trace: !0,
|
|
5019
5066
|
traceLimit: 25
|
|
5020
5067
|
})), T = function() {
|
|
5021
|
-
return arguments.length === 0 ?
|
|
5068
|
+
return arguments.length === 0 ? Es() : Ia(typeof arguments[0]) ? Ds() : Ds().apply(null, arguments);
|
|
5022
5069
|
};
|
|
5023
5070
|
}
|
|
5024
5071
|
var D, O = function(e) {
|
|
5025
5072
|
return Object.keys(e).reduce(function(t, n) {
|
|
5026
|
-
return
|
|
5073
|
+
return Cs.includes(n) || (t[n] = e[n]), t;
|
|
5027
5074
|
}, {});
|
|
5028
5075
|
}(e), k = {
|
|
5029
5076
|
context: O,
|
|
@@ -5037,17 +5084,17 @@ function Os(e) {
|
|
|
5037
5084
|
config: i
|
|
5038
5085
|
}, e;
|
|
5039
5086
|
}, {})
|
|
5040
|
-
}, A =
|
|
5087
|
+
}, A = go(function(e) {
|
|
5041
5088
|
for (var t = Object.keys(e), n = {}, r = 0; r < t.length; r++) {
|
|
5042
5089
|
var i = t[r];
|
|
5043
|
-
typeof e[i] ===
|
|
5090
|
+
typeof e[i] === so && (n[i] = e[i]);
|
|
5044
5091
|
}
|
|
5045
5092
|
var a, o = Object.keys(n);
|
|
5046
5093
|
try {
|
|
5047
5094
|
(function(e) {
|
|
5048
5095
|
Object.keys(e).forEach(function(t) {
|
|
5049
5096
|
var n = e[t];
|
|
5050
|
-
if (typeof n(void 0, { type:
|
|
5097
|
+
if (typeof n(void 0, { type: fo }) === co || typeof n(void 0, { type: po }) === co) throw Error(lo + " " + t + " " + co);
|
|
5051
5098
|
});
|
|
5052
5099
|
})(n);
|
|
5053
5100
|
} catch (e) {
|
|
@@ -5057,17 +5104,17 @@ function Os(e) {
|
|
|
5057
5104
|
if (e === void 0 && (e = {}), a) throw a;
|
|
5058
5105
|
for (var r = !1, i = {}, s = 0; s < o.length; s++) {
|
|
5059
5106
|
var c = o[s], l = e[c], u = (0, n[c])(l, t);
|
|
5060
|
-
if (typeof u ===
|
|
5061
|
-
var d =
|
|
5107
|
+
if (typeof u === co) {
|
|
5108
|
+
var d = _o(c, t);
|
|
5062
5109
|
throw Error(d);
|
|
5063
5110
|
}
|
|
5064
5111
|
i[c] = u, r ||= u !== l;
|
|
5065
5112
|
}
|
|
5066
5113
|
return r ? i : e;
|
|
5067
5114
|
};
|
|
5068
|
-
}(X({}, C, t)), k, T(w(
|
|
5115
|
+
}(X({}, C, t)), k, T(w(yo.apply(void 0, S))));
|
|
5069
5116
|
A.dispatch = (D = A.dispatch, function(e, t, n) {
|
|
5070
|
-
var r = X({}, e, { meta:
|
|
5117
|
+
var r = X({}, e, { meta: ks(e.meta, t, Os(n)) });
|
|
5071
5118
|
return D.apply(null, [r]);
|
|
5072
5119
|
});
|
|
5073
5120
|
var j = Object.keys(o);
|
|
@@ -5091,7 +5138,7 @@ function Os(e) {
|
|
|
5091
5138
|
enabled: r.pluginEnabled
|
|
5092
5139
|
}), r.pluginsArray.map(function(e, t) {
|
|
5093
5140
|
var n = e.bootstrap, i = e.config, a = e.name;
|
|
5094
|
-
n &&
|
|
5141
|
+
n && ka(n) && n({
|
|
5095
5142
|
instance: x,
|
|
5096
5143
|
config: i,
|
|
5097
5144
|
payload: e
|
|
@@ -5105,64 +5152,64 @@ function Os(e) {
|
|
|
5105
5152
|
plugins: M,
|
|
5106
5153
|
disabled: N
|
|
5107
5154
|
});
|
|
5108
|
-
}),
|
|
5155
|
+
}), Ts(function(e) {
|
|
5109
5156
|
A.dispatch({ type: e ? Z.offline : Z.online });
|
|
5110
5157
|
}), function(e, t, n) {
|
|
5111
5158
|
setInterval(function() {
|
|
5112
|
-
return
|
|
5159
|
+
return Bo(e, t, n);
|
|
5113
5160
|
}, 3e3);
|
|
5114
5161
|
}(A, u, x), x;
|
|
5115
5162
|
}
|
|
5116
|
-
var
|
|
5117
|
-
function
|
|
5118
|
-
return
|
|
5163
|
+
var js = "before", Ms = "after", Ns = "cookie", Ps = Rs(), Fs = zs, Is = zs;
|
|
5164
|
+
function Ls(e) {
|
|
5165
|
+
return Ps ? zs(e, "", -1) : ro(e);
|
|
5119
5166
|
}
|
|
5120
|
-
function
|
|
5121
|
-
if (
|
|
5122
|
-
var e =
|
|
5167
|
+
function Rs() {
|
|
5168
|
+
if (Ps !== void 0) return Ps;
|
|
5169
|
+
var e = Ns + Ns;
|
|
5123
5170
|
try {
|
|
5124
|
-
|
|
5171
|
+
zs(e, e), Ps = document.cookie.indexOf(e) !== -1, Ls(e);
|
|
5125
5172
|
} catch {
|
|
5126
|
-
|
|
5173
|
+
Ps = !1;
|
|
5127
5174
|
}
|
|
5128
|
-
return
|
|
5175
|
+
return Ps;
|
|
5129
5176
|
}
|
|
5130
|
-
function
|
|
5177
|
+
function zs(e, t, n, r, i, a) {
|
|
5131
5178
|
if (typeof window < "u") {
|
|
5132
5179
|
var o = arguments.length > 1;
|
|
5133
|
-
return !1 ===
|
|
5180
|
+
return !1 === Ps && (o ? no(e, t) : to(e)), o ? document.cookie = e + "=" + encodeURIComponent(t) + (n ? "; expires=" + (/* @__PURE__ */ new Date(+/* @__PURE__ */ new Date() + 1e3 * n)).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (a ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + e + "=")[1] || "").split(";")[0]);
|
|
5134
5181
|
}
|
|
5135
5182
|
}
|
|
5136
5183
|
//#endregion
|
|
5137
5184
|
//#region ../../node_modules/.pnpm/@analytics+localstorage-utils@0.1.12/node_modules/@analytics/localstorage-utils/dist/analytics-util-localstorage.module.js
|
|
5138
|
-
var
|
|
5139
|
-
|
|
5185
|
+
var Bs = "localStorage", Vs = oo.bind(null, Bs);
|
|
5186
|
+
io(Bs, "getItem", to), io(Bs, "setItem", no), io(Bs, "removeItem", ro);
|
|
5140
5187
|
//#endregion
|
|
5141
5188
|
//#region ../../node_modules/.pnpm/@analytics+session-storage-utils@0.0.9/node_modules/@analytics/session-storage-utils/dist/analytics-util-session-storage.module.js
|
|
5142
|
-
var
|
|
5143
|
-
|
|
5189
|
+
var Hs = "sessionStorage", Us = oo.bind(null, Hs);
|
|
5190
|
+
io(Hs, "getItem", to), io(Hs, "setItem", no), io(Hs, "removeItem", ro);
|
|
5144
5191
|
//#endregion
|
|
5145
5192
|
//#region ../../node_modules/.pnpm/@analytics+storage-utils@0.4.4/node_modules/@analytics/storage-utils/dist/analytics-util-storage.module.js
|
|
5146
|
-
function
|
|
5193
|
+
function Ws(e) {
|
|
5147
5194
|
var t = e;
|
|
5148
5195
|
try {
|
|
5149
5196
|
if ((t = JSON.parse(e)) === "true") return !0;
|
|
5150
5197
|
if (t === "false") return !1;
|
|
5151
|
-
if (
|
|
5198
|
+
if (Ia(t)) return t;
|
|
5152
5199
|
parseFloat(t) === t && (t = parseFloat(t));
|
|
5153
5200
|
} catch {}
|
|
5154
5201
|
if (t !== null && t !== "") return t;
|
|
5155
5202
|
}
|
|
5156
|
-
var
|
|
5157
|
-
function
|
|
5203
|
+
var Gs = Vs(), Ks = Us(), qs = Rs();
|
|
5204
|
+
function Js(e, t) {
|
|
5158
5205
|
if (e) {
|
|
5159
|
-
var n =
|
|
5160
|
-
if (r && !
|
|
5161
|
-
var a =
|
|
5206
|
+
var n = Zs(t), r = !tc(n), i = Qs(n) ? Ws(localStorage.getItem(e)) : void 0;
|
|
5207
|
+
if (r && !ja(i)) return i;
|
|
5208
|
+
var a = $s(n) ? Ws(Fs(e)) : void 0;
|
|
5162
5209
|
if (r && a) return a;
|
|
5163
|
-
var o =
|
|
5210
|
+
var o = ec(n) ? Ws(sessionStorage.getItem(e)) : void 0;
|
|
5164
5211
|
if (r && o) return o;
|
|
5165
|
-
var s =
|
|
5212
|
+
var s = to(e);
|
|
5166
5213
|
return r ? s : {
|
|
5167
5214
|
localStorage: i,
|
|
5168
5215
|
sessionStorage: o,
|
|
@@ -5171,51 +5218,51 @@ function Ks(e, t) {
|
|
|
5171
5218
|
};
|
|
5172
5219
|
}
|
|
5173
5220
|
}
|
|
5174
|
-
function
|
|
5175
|
-
if (e && !
|
|
5176
|
-
var r = {}, i =
|
|
5177
|
-
return
|
|
5221
|
+
function Ys(e, t, n) {
|
|
5222
|
+
if (e && !ja(t)) {
|
|
5223
|
+
var r = {}, i = Zs(n), a = JSON.stringify(t), o = !tc(i);
|
|
5224
|
+
return Qs(i) && (r.localStorage = rc("localStorage", t, Ws(localStorage.getItem(e))), localStorage.setItem(e, a), o) ? r[Bs] : $s(i) && (r.cookie = rc("cookie", t, Ws(Fs(e))), Is(e, a), o) ? r[Ns] : ec(i) && (r.sessionStorage = rc("sessionStorage", t, Ws(sessionStorage.getItem(e))), sessionStorage.setItem(e, a), o) ? r[Hs] : (r[Qa] = rc(Qa, t, to(e)), no(e, t), o ? r[Qa] : r);
|
|
5178
5225
|
}
|
|
5179
5226
|
}
|
|
5180
|
-
function
|
|
5227
|
+
function Xs(e, t) {
|
|
5181
5228
|
if (e) {
|
|
5182
|
-
var n =
|
|
5183
|
-
return !
|
|
5229
|
+
var n = Zs(t), r = Js(e, "*"), i = {};
|
|
5230
|
+
return !ja(r.localStorage) && Qs(n) && (localStorage.removeItem(e), i.localStorage = r.localStorage), !ja(r.cookie) && $s(n) && (Ls(e), i.cookie = r.cookie), !ja(r.sessionStorage) && ec(n) && (sessionStorage.removeItem(e), i.sessionStorage = r.sessionStorage), !ja(r.global) && nc(n, "global") && (ro(e), i.global = r.global), i;
|
|
5184
5231
|
}
|
|
5185
5232
|
}
|
|
5186
|
-
function Ys(e) {
|
|
5187
|
-
return e ? Oa(e) ? e : e.storage : "any";
|
|
5188
|
-
}
|
|
5189
|
-
function Xs(e) {
|
|
5190
|
-
return Us && ec(e, "localStorage");
|
|
5191
|
-
}
|
|
5192
5233
|
function Zs(e) {
|
|
5193
|
-
return
|
|
5234
|
+
return e ? Aa(e) ? e : e.storage : "any";
|
|
5194
5235
|
}
|
|
5195
5236
|
function Qs(e) {
|
|
5196
|
-
return
|
|
5237
|
+
return Gs && nc(e, "localStorage");
|
|
5197
5238
|
}
|
|
5198
5239
|
function $s(e) {
|
|
5240
|
+
return qs && nc(e, "cookie");
|
|
5241
|
+
}
|
|
5242
|
+
function ec(e) {
|
|
5243
|
+
return Ks && nc(e, "sessionStorage");
|
|
5244
|
+
}
|
|
5245
|
+
function tc(e) {
|
|
5199
5246
|
return e === "*" || e === "all";
|
|
5200
5247
|
}
|
|
5201
|
-
function
|
|
5202
|
-
return e === "any" || e === t ||
|
|
5248
|
+
function nc(e, t) {
|
|
5249
|
+
return e === "any" || e === t || tc(e);
|
|
5203
5250
|
}
|
|
5204
|
-
function
|
|
5251
|
+
function rc(e, t, n) {
|
|
5205
5252
|
return {
|
|
5206
5253
|
location: e,
|
|
5207
5254
|
current: t,
|
|
5208
5255
|
previous: n
|
|
5209
5256
|
};
|
|
5210
5257
|
}
|
|
5211
|
-
var
|
|
5212
|
-
setItem:
|
|
5213
|
-
getItem:
|
|
5214
|
-
removeItem:
|
|
5258
|
+
var ic = {
|
|
5259
|
+
setItem: Ys,
|
|
5260
|
+
getItem: Js,
|
|
5261
|
+
removeItem: Xs
|
|
5215
5262
|
};
|
|
5216
5263
|
//#endregion
|
|
5217
5264
|
//#region ../../node_modules/.pnpm/analytics@0.8.19_@types+dlv@1.1.5/node_modules/analytics/lib/analytics.browser.es.js
|
|
5218
|
-
function
|
|
5265
|
+
function ac(e, t, n) {
|
|
5219
5266
|
return t in e ? Object.defineProperty(e, t, {
|
|
5220
5267
|
value: n,
|
|
5221
5268
|
enumerable: !0,
|
|
@@ -5223,7 +5270,7 @@ function rc(e, t, n) {
|
|
|
5223
5270
|
writable: !0
|
|
5224
5271
|
}) : e[t] = n, e;
|
|
5225
5272
|
}
|
|
5226
|
-
function
|
|
5273
|
+
function oc(e, t) {
|
|
5227
5274
|
var n = Object.keys(e);
|
|
5228
5275
|
if (Object.getOwnPropertySymbols) {
|
|
5229
5276
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -5233,27 +5280,27 @@ function ic(e, t) {
|
|
|
5233
5280
|
}
|
|
5234
5281
|
return n;
|
|
5235
5282
|
}
|
|
5236
|
-
function
|
|
5283
|
+
function sc(e) {
|
|
5237
5284
|
for (var t = 1; t < arguments.length; t++) {
|
|
5238
5285
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
5239
|
-
t % 2 ?
|
|
5240
|
-
|
|
5241
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
5286
|
+
t % 2 ? oc(Object(n), !0).forEach(function(t) {
|
|
5287
|
+
ac(e, t, n[t]);
|
|
5288
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : oc(Object(n)).forEach(function(t) {
|
|
5242
5289
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
5243
5290
|
});
|
|
5244
5291
|
}
|
|
5245
5292
|
return e;
|
|
5246
5293
|
}
|
|
5247
|
-
function
|
|
5294
|
+
function cc() {
|
|
5248
5295
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
5249
|
-
return
|
|
5296
|
+
return As(sc(sc({}, { storage: ic }), e));
|
|
5250
5297
|
}
|
|
5251
5298
|
//#endregion
|
|
5252
5299
|
//#region package.json
|
|
5253
|
-
var
|
|
5300
|
+
var lc = "@sesamy/sesamy-js", uc = "1.115.0";
|
|
5254
5301
|
//#endregion
|
|
5255
5302
|
//#region src/services/analytics/listeners/route.ts
|
|
5256
|
-
function
|
|
5303
|
+
function dc(e) {
|
|
5257
5304
|
if (typeof window > "u") return;
|
|
5258
5305
|
let { addEventListener: t, history: n, location: r } = window, i = r.pathname;
|
|
5259
5306
|
t("popstate", () => e(r.pathname)), ["push", "replace"].map((t) => {
|
|
@@ -5261,56 +5308,56 @@ function lc(e) {
|
|
|
5261
5308
|
if (r !== "pushState" && r !== "replaceState") return;
|
|
5262
5309
|
let a = n[r];
|
|
5263
5310
|
n[r] = function(...t) {
|
|
5264
|
-
let r = t[2]?.toString() || "", o =
|
|
5311
|
+
let r = t[2]?.toString() || "", o = pc(r);
|
|
5265
5312
|
return i !== o && (i = o, setTimeout(() => e(r), 0)), a.apply(n, t);
|
|
5266
5313
|
};
|
|
5267
5314
|
});
|
|
5268
5315
|
}
|
|
5269
|
-
function
|
|
5316
|
+
function fc(e, t) {
|
|
5270
5317
|
let n = e.indexOf(t);
|
|
5271
5318
|
return n > -1 ? e.slice(0, n) : e;
|
|
5272
5319
|
}
|
|
5273
|
-
function
|
|
5274
|
-
return ["#", "?"].forEach((t) => e =
|
|
5320
|
+
function pc(e) {
|
|
5321
|
+
return ["#", "?"].forEach((t) => e = fc(e, t)), e;
|
|
5275
5322
|
}
|
|
5276
|
-
function
|
|
5277
|
-
|
|
5278
|
-
|
|
5323
|
+
function mc() {
|
|
5324
|
+
dc(() => {
|
|
5325
|
+
eu();
|
|
5279
5326
|
});
|
|
5280
5327
|
}
|
|
5281
5328
|
//#endregion
|
|
5282
5329
|
//#region ../../node_modules/.pnpm/@analytics+scroll-utils@0.1.26_@types+dlv@1.1.5/node_modules/@analytics/scroll-utils/dist/analytics-util-scroll.module.js
|
|
5283
|
-
var
|
|
5284
|
-
function
|
|
5285
|
-
if (e === void 0 && (e = {}), !Y) return
|
|
5286
|
-
var t =
|
|
5287
|
-
if (!f.length) return
|
|
5330
|
+
var hc = "up", gc = "down";
|
|
5331
|
+
function _c(e) {
|
|
5332
|
+
if (e === void 0 && (e = {}), !Y) return _a;
|
|
5333
|
+
var t = xc(), n = vc(), r = bc(), i = Sc(r, t), a = Sc(n, t), o = [], s = [], c = [], l = r, u = i, d = a, f = Object.keys(e);
|
|
5334
|
+
if (!f.length) return _a;
|
|
5288
5335
|
var p = f.map(function(e) {
|
|
5289
5336
|
return Number(e);
|
|
5290
|
-
}), m =
|
|
5291
|
-
var t =
|
|
5337
|
+
}), m = Za(function() {
|
|
5338
|
+
var t = xc(), n = function(e, t) {
|
|
5292
5339
|
return t.map(function(t) {
|
|
5293
5340
|
return t === 100 ? e - 5 : t / 100 * e;
|
|
5294
5341
|
});
|
|
5295
|
-
}(t, p), r =
|
|
5342
|
+
}(t, p), r = vc(), i = bc(), f = Sc(i, t), m = Sc(r, t);
|
|
5296
5343
|
if (u = f > u ? f : u, d = m < d ? m : d, !(o.length >= p.length)) {
|
|
5297
|
-
var h = l === i, g =
|
|
5298
|
-
h ? g = "initial" : l <= i && (g =
|
|
5344
|
+
var h = l === i, g = hc;
|
|
5345
|
+
h ? g = "initial" : l <= i && (g = gc);
|
|
5299
5346
|
var _ = n, v = p;
|
|
5300
|
-
(g ===
|
|
5347
|
+
(g === hc || h) && (_ = n.slice().reverse(), v = p.slice().reverse());
|
|
5301
5348
|
var y = v.reduce(function(e, t, n) {
|
|
5302
5349
|
var r = _[n];
|
|
5303
5350
|
return c.includes(t) && i <= r && (c = c.filter(function(e) {
|
|
5304
5351
|
return e !== t;
|
|
5305
|
-
}), e.singleFunction = t), g ===
|
|
5352
|
+
}), e.singleFunction = t), g === gc && !o.includes(t) && i >= r && t > a ? (s.push(t), e.callbacks = e.callbacks.concat(t), e) : g === hc && !o.includes(t) && i <= r && t <= f ? (e.foundFunc = [t], e) : (h && i >= r && e.foundFunc.length === 0 && (e.foundFunc = [t]), !s.includes(t) && i >= r && (s.push(t), e.singleFunction ? c.push(t) : e.singleFunction = t), e);
|
|
5306
5353
|
}, {
|
|
5307
5354
|
foundFunc: [],
|
|
5308
5355
|
singleFunction: null,
|
|
5309
5356
|
callbacks: [],
|
|
5310
5357
|
direction: g
|
|
5311
5358
|
});
|
|
5312
|
-
if (l = i, g ===
|
|
5313
|
-
|
|
5359
|
+
if (l = i, g === gc && y.callbacks && y.callbacks.forEach(function(t) {
|
|
5360
|
+
ka(e[t]) && (e[t]({
|
|
5314
5361
|
trigger: t,
|
|
5315
5362
|
direction: g,
|
|
5316
5363
|
scrollMin: d,
|
|
@@ -5319,7 +5366,7 @@ function hc(e) {
|
|
|
5319
5366
|
}), o.push(t));
|
|
5320
5367
|
}), y.singleFunction) {
|
|
5321
5368
|
var b = y.singleFunction, x = y.direction;
|
|
5322
|
-
|
|
5369
|
+
ka(e[b]) && e[b]({
|
|
5323
5370
|
trigger: b,
|
|
5324
5371
|
direction: x,
|
|
5325
5372
|
scrollMin: d,
|
|
@@ -5333,47 +5380,47 @@ function hc(e) {
|
|
|
5333
5380
|
return window.removeEventListener("scroll", m);
|
|
5334
5381
|
};
|
|
5335
5382
|
}
|
|
5336
|
-
function
|
|
5383
|
+
function vc() {
|
|
5337
5384
|
return Y ? document.body.scrollTop || document.documentElement.scrollTop : 0;
|
|
5338
5385
|
}
|
|
5339
|
-
function
|
|
5386
|
+
function yc() {
|
|
5340
5387
|
return Y ? window.innerHeight || document.documentElement.clientHeight : 0;
|
|
5341
5388
|
}
|
|
5342
|
-
function
|
|
5343
|
-
return Math.round(
|
|
5389
|
+
function bc() {
|
|
5390
|
+
return Math.round(vc() + yc());
|
|
5344
5391
|
}
|
|
5345
|
-
function
|
|
5392
|
+
function xc() {
|
|
5346
5393
|
if (!Y) return 0;
|
|
5347
5394
|
var e = document.body, t = document.documentElement;
|
|
5348
5395
|
return Math.max(e.scrollHeight, e.offsetHeight, t.clientHeight, t.scrollHeight, t.offsetHeight);
|
|
5349
5396
|
}
|
|
5350
|
-
function
|
|
5397
|
+
function Sc(e, t) {
|
|
5351
5398
|
return Math.round(e / t * 100);
|
|
5352
5399
|
}
|
|
5353
5400
|
//#endregion
|
|
5354
5401
|
//#region ../../node_modules/.pnpm/@analytics+listener-utils@0.4.2/node_modules/@analytics/listener-utils/dist/analytics-util-listener.module.js
|
|
5355
|
-
var
|
|
5356
|
-
function
|
|
5402
|
+
var Cc = "Event", wc = Cc + "Listener";
|
|
5403
|
+
function Tc(e) {
|
|
5357
5404
|
return function(t, n, r, i) {
|
|
5358
|
-
var a = r ||
|
|
5405
|
+
var a = r || _a, o = i || !1;
|
|
5359
5406
|
if (!Y) return a;
|
|
5360
|
-
var s =
|
|
5407
|
+
var s = Ec(n), c = Ec(t, !0);
|
|
5361
5408
|
if (!c.length) throw Error("noElements");
|
|
5362
|
-
if (!s.length) throw Error("no" +
|
|
5409
|
+
if (!s.length) throw Error("no" + Cc);
|
|
5363
5410
|
var l = [];
|
|
5364
5411
|
return function e(t) {
|
|
5365
5412
|
t && (l = []);
|
|
5366
|
-
for (var n = t ? "add" +
|
|
5413
|
+
for (var n = t ? "add" + wc : "remove" + wc, r = 0; r < c.length; r++) {
|
|
5367
5414
|
var i = c[r];
|
|
5368
|
-
l[r] = t ? o && o.once ?
|
|
5415
|
+
l[r] = t ? o && o.once ? Dc(a) : a : l[r] || a;
|
|
5369
5416
|
for (var u = 0; u < s.length; u++) i[n] ? i["on" + s[u]] = t ? l[r] : null : i[n](s[u], l[r], o);
|
|
5370
5417
|
}
|
|
5371
5418
|
return e.bind(null, !t);
|
|
5372
5419
|
}(e);
|
|
5373
5420
|
};
|
|
5374
5421
|
}
|
|
5375
|
-
function
|
|
5376
|
-
if (
|
|
5422
|
+
function Ec(e, t) {
|
|
5423
|
+
if (Aa(e)) return t ? Ec(document.querySelectorAll(e)) : (n = e).split(n.indexOf(",") > -1 ? "," : " ").map(function(e) {
|
|
5377
5424
|
return e.trim();
|
|
5378
5425
|
});
|
|
5379
5426
|
var n;
|
|
@@ -5381,31 +5428,31 @@ function wc(e, t) {
|
|
|
5381
5428
|
for (var r = [], i = e.length >>> 0; i--;) r[i] = e[i];
|
|
5382
5429
|
return r;
|
|
5383
5430
|
}
|
|
5384
|
-
var a =
|
|
5431
|
+
var a = Wa(e);
|
|
5385
5432
|
return t ? a.map(function(e) {
|
|
5386
|
-
return
|
|
5433
|
+
return Aa(e) ? Ec(e, !0) : e;
|
|
5387
5434
|
}).flat() : a;
|
|
5388
5435
|
}
|
|
5389
|
-
function
|
|
5436
|
+
function Dc(e, t) {
|
|
5390
5437
|
var n;
|
|
5391
5438
|
return function() {
|
|
5392
5439
|
return e &&= (n = e.apply(t || this, arguments), null), n;
|
|
5393
5440
|
};
|
|
5394
5441
|
}
|
|
5395
|
-
var
|
|
5396
|
-
function
|
|
5397
|
-
return Y &&
|
|
5442
|
+
var Oc = Tc(Cc);
|
|
5443
|
+
function kc(e, t) {
|
|
5444
|
+
return Y && ka(window[e]) ? (n = window[e], r = t, (i = window) === void 0 && (i = null), ka(n) ? function() {
|
|
5398
5445
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
5399
5446
|
} : r) : window[e] = t;
|
|
5400
5447
|
var n, r, i;
|
|
5401
5448
|
}
|
|
5402
|
-
|
|
5449
|
+
kc.bind(null, "onerror"), kc.bind(null, "onload");
|
|
5403
5450
|
//#endregion
|
|
5404
5451
|
//#region ../../node_modules/.pnpm/analytics-plugin-tab-events@0.2.1/node_modules/analytics-plugin-tab-events/lib/analytics-plugin-tab-events.browser.es.js
|
|
5405
|
-
var
|
|
5406
|
-
function
|
|
5407
|
-
if (
|
|
5408
|
-
var t =
|
|
5452
|
+
var Ac = typeof window > "u", jc = "hidden";
|
|
5453
|
+
function Mc(e) {
|
|
5454
|
+
if (Ac) return !1;
|
|
5455
|
+
var t = Nc(), n = `${t.replace(/[H|h]idden/, "")}visibilitychange`, r = function() {
|
|
5409
5456
|
return e(!!document[t]);
|
|
5410
5457
|
}, i = function() {
|
|
5411
5458
|
return document.addEventListener(n, r);
|
|
@@ -5414,8 +5461,8 @@ function Ac(e) {
|
|
|
5414
5461
|
return document.removeEventListener(n, r), i;
|
|
5415
5462
|
};
|
|
5416
5463
|
}
|
|
5417
|
-
function
|
|
5418
|
-
return
|
|
5464
|
+
function Nc() {
|
|
5465
|
+
return Ac || "hidden" in document ? jc : [
|
|
5419
5466
|
"webkit",
|
|
5420
5467
|
"moz",
|
|
5421
5468
|
"ms",
|
|
@@ -5427,7 +5474,7 @@ function jc() {
|
|
|
5427
5474
|
}
|
|
5428
5475
|
//#endregion
|
|
5429
5476
|
//#region ../../node_modules/.pnpm/@analytics+activity-utils@0.1.16/node_modules/@analytics/activity-utils/dist/analytics-util-activity.module.js
|
|
5430
|
-
var
|
|
5477
|
+
var Pc = [
|
|
5431
5478
|
"mousemove",
|
|
5432
5479
|
"mousedown",
|
|
5433
5480
|
"touchmove",
|
|
@@ -5435,7 +5482,7 @@ var Mc = [
|
|
|
5435
5482
|
"touchend",
|
|
5436
5483
|
"keydown"
|
|
5437
5484
|
];
|
|
5438
|
-
function
|
|
5485
|
+
function Fc(e, t) {
|
|
5439
5486
|
t === void 0 && (t = {});
|
|
5440
5487
|
var n = function(e, t) {
|
|
5441
5488
|
var n = this, r = !1;
|
|
@@ -5446,11 +5493,11 @@ function Nc(e, t) {
|
|
|
5446
5493
|
};
|
|
5447
5494
|
}(e, t.throttle || 1e4), r = [];
|
|
5448
5495
|
function i() {
|
|
5449
|
-
return r = [
|
|
5496
|
+
return r = [Mc(function(e) {
|
|
5450
5497
|
e || n({ type: "tabVisible" });
|
|
5451
|
-
})].concat(
|
|
5452
|
-
return
|
|
5453
|
-
}),
|
|
5498
|
+
})].concat(Pc.map(function(e) {
|
|
5499
|
+
return Oc(document, e, n);
|
|
5500
|
+
}), Oc(window, "load", n), Oc(window, "scroll", n, {
|
|
5454
5501
|
capture: !0,
|
|
5455
5502
|
passive: !0
|
|
5456
5503
|
})), a;
|
|
@@ -5464,16 +5511,16 @@ function Nc(e, t) {
|
|
|
5464
5511
|
return a(), i;
|
|
5465
5512
|
};
|
|
5466
5513
|
}
|
|
5467
|
-
function
|
|
5514
|
+
function Ic(e) {
|
|
5468
5515
|
var t, n, r = e.onIdle, i = e.onWakeUp, a = e.onHeartbeat, o = e.timeout, s = o === void 0 ? 1e4 : o, c = e.throttle, l = c === void 0 ? 2e3 : c, u = !1, d = !1, f = /* @__PURE__ */ new Date(), p = function() {
|
|
5469
5516
|
return clearTimeout(t);
|
|
5470
5517
|
};
|
|
5471
5518
|
function m(e) {
|
|
5472
|
-
p(), a && !u && a(
|
|
5473
|
-
u = !0, r && (n = /* @__PURE__ */ new Date(), r(
|
|
5519
|
+
p(), a && !u && a(Lc(f), e), i && u && (u = !1, i(Lc(n), e), f = /* @__PURE__ */ new Date()), t = setTimeout(function() {
|
|
5520
|
+
u = !0, r && (n = /* @__PURE__ */ new Date(), r(Lc(f), e));
|
|
5474
5521
|
}, s);
|
|
5475
5522
|
}
|
|
5476
|
-
var h =
|
|
5523
|
+
var h = Fc(m, { throttle: l });
|
|
5477
5524
|
return {
|
|
5478
5525
|
disable: function() {
|
|
5479
5526
|
d = !0, u = !1, p();
|
|
@@ -5486,18 +5533,18 @@ function Pc(e) {
|
|
|
5486
5533
|
return {
|
|
5487
5534
|
isIdle: u,
|
|
5488
5535
|
isDisabled: d,
|
|
5489
|
-
active: u ? 0 :
|
|
5490
|
-
idle: u ?
|
|
5536
|
+
active: u ? 0 : Lc(f, d),
|
|
5537
|
+
idle: u ? Lc(n, d) : 0
|
|
5491
5538
|
};
|
|
5492
5539
|
}
|
|
5493
5540
|
};
|
|
5494
5541
|
}
|
|
5495
|
-
function
|
|
5542
|
+
function Lc(e, t) {
|
|
5496
5543
|
return t ? 0 : Math.round((/* @__PURE__ */ new Date() - e) / 1e3);
|
|
5497
5544
|
}
|
|
5498
5545
|
//#endregion
|
|
5499
5546
|
//#region src/services/analytics/element-tracker.ts
|
|
5500
|
-
var
|
|
5547
|
+
var Rc = 5e3, zc = class {
|
|
5501
5548
|
element;
|
|
5502
5549
|
isInViewport = !1;
|
|
5503
5550
|
isAwake = !1;
|
|
@@ -5514,11 +5561,11 @@ var Ic = 5e3, Lc = class {
|
|
|
5514
5561
|
e.forEach((e) => {
|
|
5515
5562
|
this.handleInViewPort(e.isIntersecting);
|
|
5516
5563
|
});
|
|
5517
|
-
}, { threshold: 0 }), this.observer.observe(this.element),
|
|
5564
|
+
}, { threshold: 0 }), this.observer.observe(this.element), Ic({
|
|
5518
5565
|
onIdle: (e) => this.handleAwake(!1, e),
|
|
5519
5566
|
onWakeUp: (e) => this.handleAwake(!0, e),
|
|
5520
|
-
timeout:
|
|
5521
|
-
}),
|
|
5567
|
+
timeout: Rc
|
|
5568
|
+
}), _c({
|
|
5522
5569
|
25: this.handleScroll.bind(this),
|
|
5523
5570
|
50: this.handleScroll.bind(this),
|
|
5524
5571
|
75: this.handleScroll.bind(this),
|
|
@@ -5533,7 +5580,7 @@ var Ic = 5e3, Lc = class {
|
|
|
5533
5580
|
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
|
|
5534
5581
|
}
|
|
5535
5582
|
handleAwake(e, t = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
|
|
5536
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - t *
|
|
5583
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - t * Rc : Date.now(), this.isInViewport && this.trackAwake(e, t);
|
|
5537
5584
|
}
|
|
5538
5585
|
handleScroll(e) {
|
|
5539
5586
|
this.scrollCallback && this.scrollCallback(e);
|
|
@@ -5552,17 +5599,17 @@ var Ic = 5e3, Lc = class {
|
|
|
5552
5599
|
};
|
|
5553
5600
|
//#endregion
|
|
5554
5601
|
//#region src/utils/onDomContentLoaded.ts
|
|
5555
|
-
function
|
|
5602
|
+
function Bc(e) {
|
|
5556
5603
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e();
|
|
5557
5604
|
}
|
|
5558
|
-
function
|
|
5605
|
+
function Vc() {
|
|
5559
5606
|
return new Promise((e) => {
|
|
5560
|
-
|
|
5607
|
+
Bc(() => e());
|
|
5561
5608
|
});
|
|
5562
5609
|
}
|
|
5563
5610
|
//#endregion
|
|
5564
5611
|
//#region ../../node_modules/.pnpm/saturated@1.0.0/node_modules/saturated/dist/saturated.mjs
|
|
5565
|
-
function
|
|
5612
|
+
function Hc(e, t) {
|
|
5566
5613
|
t ||= {};
|
|
5567
5614
|
var n, r, i = [], a = t.max || Infinity;
|
|
5568
5615
|
function o() {
|
|
@@ -5586,14 +5633,14 @@ function Bc(e, t) {
|
|
|
5586
5633
|
}
|
|
5587
5634
|
//#endregion
|
|
5588
5635
|
//#region src/services/analytics/session-id.ts
|
|
5589
|
-
var
|
|
5590
|
-
function
|
|
5591
|
-
let e = sessionStorage.getItem(
|
|
5592
|
-
return e || (e = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(
|
|
5636
|
+
var Uc = "sesamy_session_id";
|
|
5637
|
+
function Wc() {
|
|
5638
|
+
let e = sessionStorage.getItem(Uc);
|
|
5639
|
+
return e || (e = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(Uc, e)), e;
|
|
5593
5640
|
}
|
|
5594
5641
|
//#endregion
|
|
5595
5642
|
//#region src/utils/selector.ts
|
|
5596
|
-
function
|
|
5643
|
+
function Gc(e) {
|
|
5597
5644
|
function t(e) {
|
|
5598
5645
|
return e.id ? `#${e.id}` : e.classList.length > 0 ? Array.from(e.classList).map((e) => `.${e}`).join("") : null;
|
|
5599
5646
|
}
|
|
@@ -5617,12 +5664,12 @@ function Uc(e) {
|
|
|
5617
5664
|
}
|
|
5618
5665
|
//#endregion
|
|
5619
5666
|
//#region src/utils/cleanObject.ts
|
|
5620
|
-
function
|
|
5667
|
+
function Kc(e) {
|
|
5621
5668
|
return e ? Object.fromEntries(Object.entries(e).filter(([e, t]) => t !== void 0)) : {};
|
|
5622
5669
|
}
|
|
5623
5670
|
//#endregion
|
|
5624
5671
|
//#region src/services/content/index.ts
|
|
5625
|
-
function
|
|
5672
|
+
function qc(e) {
|
|
5626
5673
|
return e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
5627
5674
|
}
|
|
5628
5675
|
var Q = {
|
|
@@ -5667,8 +5714,8 @@ var Q = {
|
|
|
5667
5714
|
selector: "sesamy-article",
|
|
5668
5715
|
attribute: "paywall-url"
|
|
5669
5716
|
}
|
|
5670
|
-
},
|
|
5671
|
-
function
|
|
5717
|
+
}, Jc = [], Yc = !1, Xc;
|
|
5718
|
+
function Zc(e) {
|
|
5672
5719
|
try {
|
|
5673
5720
|
let t = new URL(e).pathname.split("/").filter(Boolean);
|
|
5674
5721
|
return t[t.length - 1] || e;
|
|
@@ -5676,9 +5723,9 @@ function Yc(e) {
|
|
|
5676
5723
|
return e;
|
|
5677
5724
|
}
|
|
5678
5725
|
}
|
|
5679
|
-
function
|
|
5726
|
+
function Qc() {
|
|
5680
5727
|
let e = window.location.pathname, t = new URLSearchParams(window.location.search), n = navigator.userAgent;
|
|
5681
|
-
return
|
|
5728
|
+
return Jc.find((r) => {
|
|
5682
5729
|
if (r.path && !e.includes(r.path) || r.queryParam && t.get(r.queryParam.key) !== r.queryParam.value) return !1;
|
|
5683
5730
|
if (r.headers) {
|
|
5684
5731
|
let e = r.headers.name.toLowerCase(), t = r.headers.contains.toLowerCase();
|
|
@@ -5689,26 +5736,26 @@ function Xc() {
|
|
|
5689
5736
|
return !(r.userAgentContains && !n.includes(r.userAgentContains));
|
|
5690
5737
|
});
|
|
5691
5738
|
}
|
|
5692
|
-
function
|
|
5693
|
-
return
|
|
5739
|
+
function $c() {
|
|
5740
|
+
return Qc();
|
|
5694
5741
|
}
|
|
5695
|
-
function
|
|
5696
|
-
|
|
5697
|
-
let n =
|
|
5742
|
+
function el(e, t) {
|
|
5743
|
+
Jc = e.content || [];
|
|
5744
|
+
let n = Qc();
|
|
5698
5745
|
n && n.type === "article" && (Q = {
|
|
5699
5746
|
...Q,
|
|
5700
|
-
...
|
|
5701
|
-
},
|
|
5747
|
+
...Kc(n.selectors)
|
|
5748
|
+
}, Yc = n.enablePaywallSettingsUrlFallback || !1), Xc = t;
|
|
5702
5749
|
}
|
|
5703
|
-
function
|
|
5750
|
+
function tl(e, t) {
|
|
5704
5751
|
let { selector: n, attribute: r } = t;
|
|
5705
5752
|
return n === Q.article.selector || r && e.hasAttribute(r) ? e : e.querySelector(n);
|
|
5706
5753
|
}
|
|
5707
|
-
function
|
|
5754
|
+
function nl(e, t, n = !1) {
|
|
5708
5755
|
if (e) {
|
|
5709
5756
|
if (t.attribute) {
|
|
5710
5757
|
if (t.attribute === "textContent") return e.textContent ?? void 0;
|
|
5711
|
-
let r = e.getAttribute(t.attribute), i =
|
|
5758
|
+
let r = e.getAttribute(t.attribute), i = nl(e.parentElement, t, n);
|
|
5712
5759
|
if (n) {
|
|
5713
5760
|
let e = [];
|
|
5714
5761
|
return r && e.push(...r.split(",").map((e) => e.trim()).filter(Boolean)), i && e.push(...i.split(",").map((e) => e.trim()).filter(Boolean)), e.length > 0 ? [...new Set(e)].join(",") : void 0;
|
|
@@ -5724,7 +5771,7 @@ function $(e) {
|
|
|
5724
5771
|
let n = document.head.querySelectorAll(`[name~='${e}'][content]`);
|
|
5725
5772
|
for (let e = 0; e < n.length; e += 1) if (n[e].content) return n[e].content;
|
|
5726
5773
|
}
|
|
5727
|
-
function
|
|
5774
|
+
function rl(e) {
|
|
5728
5775
|
let t = [];
|
|
5729
5776
|
return document.head.querySelectorAll(`[property~='${e}'][content]`).forEach((e) => {
|
|
5730
5777
|
e.content && t.push(e.content);
|
|
@@ -5732,8 +5779,47 @@ function tl(e) {
|
|
|
5732
5779
|
e.content && t.push(e.content);
|
|
5733
5780
|
}), t;
|
|
5734
5781
|
}
|
|
5735
|
-
|
|
5736
|
-
|
|
5782
|
+
function il(e) {
|
|
5783
|
+
try {
|
|
5784
|
+
let t = e.split(".");
|
|
5785
|
+
if (t.length !== 3) return null;
|
|
5786
|
+
let n = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4);
|
|
5787
|
+
return JSON.parse(atob(r));
|
|
5788
|
+
} catch {
|
|
5789
|
+
return null;
|
|
5790
|
+
}
|
|
5791
|
+
}
|
|
5792
|
+
var al = /* @__PURE__ */ new WeakMap();
|
|
5793
|
+
function ol(e) {
|
|
5794
|
+
if (al.has(e)) return al.get(e) ?? null;
|
|
5795
|
+
let t = e.querySelector("script.dca-manifest");
|
|
5796
|
+
if (!t?.textContent) return al.set(e, null), null;
|
|
5797
|
+
try {
|
|
5798
|
+
let n = JSON.parse(t.textContent), r = n.resourceJWT, i = {};
|
|
5799
|
+
n.resource?.resourceId && (i.id = String(n.resource.resourceId));
|
|
5800
|
+
let a = n.issuerData?.sesamy ?? n.issuers?.sesamy;
|
|
5801
|
+
if (a?.keyId && (i.pass = String(a.keyId)), r) {
|
|
5802
|
+
let e = il(r);
|
|
5803
|
+
if (e) {
|
|
5804
|
+
e.contentId && (i.id = String(e.contentId)), e.tier && (i.pass = String(e.tier)), e.url && (i.url = String(e.url));
|
|
5805
|
+
let t = e.meta;
|
|
5806
|
+
if (t) {
|
|
5807
|
+
if (t.price != null) {
|
|
5808
|
+
let e = parseFloat(String(t.price));
|
|
5809
|
+
Number.isNaN(e) || (i.price = e);
|
|
5810
|
+
}
|
|
5811
|
+
t.currency && (i.currency = String(t.currency)), t.title && (i.title = String(t.title)), t.image && (i.image = String(t.image)), t.excerpt && (i.excerpt = String(t.excerpt)), t.accessLevel && (i.accessLevel = String(t.accessLevel));
|
|
5812
|
+
}
|
|
5813
|
+
}
|
|
5814
|
+
}
|
|
5815
|
+
let o = Object.keys(i).length > 0 ? i : null;
|
|
5816
|
+
return al.set(e, o), al.get(e) ?? null;
|
|
5817
|
+
} catch {
|
|
5818
|
+
return al.set(e, null), null;
|
|
5819
|
+
}
|
|
5820
|
+
}
|
|
5821
|
+
var sl = null;
|
|
5822
|
+
function cl() {
|
|
5737
5823
|
let e = [], t = document.querySelectorAll("script[type=\"application/ld+json\"]");
|
|
5738
5824
|
for (let n of t) try {
|
|
5739
5825
|
let t = JSON.parse(n.textContent || "");
|
|
@@ -5741,19 +5827,19 @@ function rl() {
|
|
|
5741
5827
|
} catch {}
|
|
5742
5828
|
return e;
|
|
5743
5829
|
}
|
|
5744
|
-
function
|
|
5745
|
-
return
|
|
5830
|
+
function ll(e) {
|
|
5831
|
+
return cl().find((t) => !e || t["@type"] === e || Array.isArray(t["@type"]) && t["@type"].includes(e)) || null;
|
|
5746
5832
|
}
|
|
5747
|
-
function
|
|
5748
|
-
return
|
|
5833
|
+
function ul(e) {
|
|
5834
|
+
return cl().filter((t) => !e || t["@type"] === e || Array.isArray(t["@type"]) && t["@type"].includes(e));
|
|
5749
5835
|
}
|
|
5750
|
-
function
|
|
5836
|
+
function dl(e, t, n) {
|
|
5751
5837
|
if (!e || typeof e != "object") return typeof e == "string" ? e : void 0;
|
|
5752
5838
|
let r = e[t];
|
|
5753
5839
|
if (typeof r == "string") return r;
|
|
5754
5840
|
if (r && typeof r == "object" && n) return r[n];
|
|
5755
5841
|
}
|
|
5756
|
-
function
|
|
5842
|
+
function fl(e) {
|
|
5757
5843
|
if (!e) return;
|
|
5758
5844
|
let t = (Array.isArray(e) ? e : [e]).map((e) => {
|
|
5759
5845
|
if (typeof e == "string") return { name: e };
|
|
@@ -5762,7 +5848,7 @@ function sl(e) {
|
|
|
5762
5848
|
return n ? {
|
|
5763
5849
|
name: n,
|
|
5764
5850
|
url: t.url,
|
|
5765
|
-
image:
|
|
5851
|
+
image: dl(t, "image", "url"),
|
|
5766
5852
|
jobTitle: t.jobTitle,
|
|
5767
5853
|
sameAs: t.sameAs
|
|
5768
5854
|
} : null;
|
|
@@ -5771,22 +5857,22 @@ function sl(e) {
|
|
|
5771
5857
|
}).filter((e) => e !== null && !!e.name);
|
|
5772
5858
|
return t.length > 0 ? t : void 0;
|
|
5773
5859
|
}
|
|
5774
|
-
function
|
|
5860
|
+
function pl(e) {
|
|
5775
5861
|
if (Array.isArray(e)) return e.filter((e) => typeof e == "string");
|
|
5776
5862
|
if (typeof e == "string") {
|
|
5777
5863
|
let t = e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
5778
5864
|
return t.length > 0 ? t : void 0;
|
|
5779
5865
|
}
|
|
5780
5866
|
}
|
|
5781
|
-
function
|
|
5782
|
-
if (
|
|
5783
|
-
let e =
|
|
5784
|
-
return
|
|
5867
|
+
function ml() {
|
|
5868
|
+
if (sl) return sl;
|
|
5869
|
+
let e = ll("NewsArticle") || ll("Article") || ll("BlogPosting") || ll("WebPage"), t = (...e) => e.find((e) => e != null && e !== "") || void 0;
|
|
5870
|
+
return sl = Kc({
|
|
5785
5871
|
contentType: e ? Array.isArray(e["@type"]) ? e["@type"][0] : e["@type"] : void 0,
|
|
5786
|
-
authors:
|
|
5787
|
-
keywords: ((...e) => e.find((e) => e && e.length > 0))(
|
|
5788
|
-
tags:
|
|
5789
|
-
categories:
|
|
5872
|
+
authors: fl(e?.author) || (rl("article:author").length > 0 ? rl("article:author").map((e) => ({ name: e })) : void 0) || ($("author") ? [{ name: $("author") }] : void 0),
|
|
5873
|
+
keywords: ((...e) => e.find((e) => e && e.length > 0))(pl(e?.keywords), pl($("keywords"))),
|
|
5874
|
+
tags: rl("article:tag").length > 0 ? rl("article:tag") : void 0,
|
|
5875
|
+
categories: pl($("news_keywords")),
|
|
5790
5876
|
section: t(e?.articleSection, $("article:section")),
|
|
5791
5877
|
publishedAt: t(e?.datePublished, $("article:published_time")),
|
|
5792
5878
|
modifiedAt: t(e?.dateModified, $("article:modified_time")),
|
|
@@ -5797,28 +5883,28 @@ function ll() {
|
|
|
5797
5883
|
twitterSite: $("twitter:site"),
|
|
5798
5884
|
twitterCreator: $("twitter:creator"),
|
|
5799
5885
|
creator: t($("creator"), $("dc.creator")),
|
|
5800
|
-
mainEntityOfPage: e ?
|
|
5886
|
+
mainEntityOfPage: e ? dl(e.mainEntityOfPage, "@id") || (typeof e.mainEntityOfPage == "string" ? e.mainEntityOfPage : void 0) : void 0,
|
|
5801
5887
|
isAccessibleForFree: typeof e?.isAccessibleForFree == "boolean" ? e.isAccessibleForFree : void 0,
|
|
5802
5888
|
wordCount: typeof e?.wordCount == "number" ? e.wordCount : void 0,
|
|
5803
5889
|
publisher: e?.publisher && typeof e.publisher == "object" ? {
|
|
5804
5890
|
name: e.publisher.name || "",
|
|
5805
5891
|
url: e.publisher.url,
|
|
5806
|
-
logo:
|
|
5892
|
+
logo: dl(e.publisher, "logo", "url")
|
|
5807
5893
|
} : void 0
|
|
5808
|
-
}),
|
|
5894
|
+
}), sl;
|
|
5809
5895
|
}
|
|
5810
|
-
function
|
|
5811
|
-
|
|
5896
|
+
function hl() {
|
|
5897
|
+
sl = null, al = /* @__PURE__ */ new WeakMap();
|
|
5812
5898
|
}
|
|
5813
|
-
function
|
|
5899
|
+
function gl({ publisherContentId: e, key: t, defaultValue: n = "" }) {
|
|
5814
5900
|
let r = e ? document.body.querySelector(`sesamy-content-data[id='${e}']`) : null, i = t.replace(/-([a-z])/g, (e, t) => t.toUpperCase());
|
|
5815
5901
|
return r?.getAttribute(t) || $(`sesamy:${t}`) || $(`sesamy:${i}`) || $(`og:${t}`) || $(t) || n;
|
|
5816
5902
|
}
|
|
5817
|
-
function
|
|
5903
|
+
function _l() {
|
|
5818
5904
|
let e = document.querySelectorAll(Q.article.selector);
|
|
5819
|
-
return Array.from(e).map(
|
|
5905
|
+
return Array.from(e).map(vl).filter((e) => e !== null);
|
|
5820
5906
|
}
|
|
5821
|
-
function
|
|
5907
|
+
function vl(e) {
|
|
5822
5908
|
let t = typeof e == "string" ? document.querySelector(e) : e;
|
|
5823
5909
|
if (!t) return null;
|
|
5824
5910
|
let n = Q.article.selector;
|
|
@@ -5830,11 +5916,11 @@ function pl(e) {
|
|
|
5830
5916
|
} catch {}
|
|
5831
5917
|
let r = {
|
|
5832
5918
|
element: t,
|
|
5833
|
-
selector: typeof e == "string" ? e :
|
|
5919
|
+
selector: typeof e == "string" ? e : Gc(t)
|
|
5834
5920
|
}, i = (e, n, i, a) => {
|
|
5835
|
-
let { transform: o, collect: s = !1 } = a || {}, c =
|
|
5921
|
+
let { transform: o, collect: s = !1 } = a || {}, c = nl(tl(t, n), n, s), l = gl({
|
|
5836
5922
|
publisherContentId: i,
|
|
5837
|
-
key:
|
|
5923
|
+
key: qc(String(e))
|
|
5838
5924
|
}), u = c || l || void 0;
|
|
5839
5925
|
u && (r[e] = o ? o(u) : u);
|
|
5840
5926
|
};
|
|
@@ -5842,26 +5928,28 @@ function pl(e) {
|
|
|
5842
5928
|
let t = parseFloat(e);
|
|
5843
5929
|
return Number.isNaN(t) ? void 0 : t;
|
|
5844
5930
|
} }), i("currency", Q.currency, r.id), i("url", Q.url, r.id), i("pass", Q.pass, r.id, { collect: !0 }), i("paywallUrl", Q.paywallUrl, r.id), i("accessLevel", Q.accessLevel, r.id, { transform: (e) => e || "entitlement" });
|
|
5845
|
-
let a =
|
|
5846
|
-
|
|
5931
|
+
let a = ol(t);
|
|
5932
|
+
a && (a.id && !r.id && (r.id = a.id), a.title && !r.title && (r.title = a.title), a.excerpt && !r.excerpt && (r.excerpt = a.excerpt), a.image && !r.image && (r.image = a.image), a.price != null && !r.price && (r.price = a.price), a.currency && !r.currency && (r.currency = a.currency), a.url && !r.url && (r.url = a.url), a.pass && !r.pass && (r.pass = a.pass), a.accessLevel && !r.accessLevel && (r.accessLevel = a.accessLevel));
|
|
5933
|
+
let o = Qc();
|
|
5934
|
+
if (o && o.type === "article" && (o.pass && (r.pass = r.pass ? `${r.pass},${o.pass}` : o.pass), o.price && !r.price && (r.price = o.price.amount), o.price?.currency && !r.currency && (r.currency = o.price.currency), o.paywallUrl && !r.paywallUrl && (r.paywallUrl = o.paywallUrl)), Yc && !r.paywallUrl) {
|
|
5847
5935
|
let e = document.querySelector("sesamy-paywall");
|
|
5848
5936
|
if (e) {
|
|
5849
5937
|
let t = e.getAttribute("settings-url");
|
|
5850
5938
|
t && (r.paywallUrl = t);
|
|
5851
5939
|
}
|
|
5852
5940
|
}
|
|
5853
|
-
return r.url ||= window.location.href, r.metadata =
|
|
5941
|
+
return r.url ||= window.location.href, r.metadata = ml(), r;
|
|
5854
5942
|
}
|
|
5855
|
-
async function
|
|
5856
|
-
let t = e === void 0 ?
|
|
5943
|
+
async function yl(e) {
|
|
5944
|
+
let t = e === void 0 ? _l()[0] ?? null : vl(e);
|
|
5857
5945
|
if (!t) throw Error("Could not find article element");
|
|
5858
5946
|
if (t.accessLevel === "public") return !0;
|
|
5859
|
-
if (t.accessLevel === "logged-in" && !t.paywallUrl || t.paywallUrl && ((await
|
|
5947
|
+
if (t.accessLevel === "logged-in" && !t.paywallUrl || t.paywallUrl && ((await Xc.paywalls.get(t.paywallUrl)).settings.template === "LOGIN" ? "logged-in" : "entitlement") == "logged-in") return await Xc.auth.isAuthenticated() ? !0 : null;
|
|
5860
5948
|
if (!t.url) throw Error("Article must have a URL");
|
|
5861
|
-
let n = await
|
|
5949
|
+
let n = await Xc.entitlements.hasAccess(t.url, t.pass?.split(",") || []);
|
|
5862
5950
|
if (n) return n;
|
|
5863
5951
|
if (t.paywallUrl) {
|
|
5864
|
-
let e =
|
|
5952
|
+
let e = Zc(t.paywallUrl), n = await Xc.paywalls.checkAccess(e, {
|
|
5865
5953
|
publisherContentId: t.id || t.url,
|
|
5866
5954
|
url: t.url
|
|
5867
5955
|
});
|
|
@@ -5875,24 +5963,24 @@ async function ml(e) {
|
|
|
5875
5963
|
}
|
|
5876
5964
|
return null;
|
|
5877
5965
|
}
|
|
5878
|
-
async function
|
|
5966
|
+
async function bl(e, t) {
|
|
5879
5967
|
let n = typeof e == "string" ? document.querySelector(e) : e;
|
|
5880
5968
|
if (!n) throw Error("Could not find element");
|
|
5881
|
-
let r =
|
|
5969
|
+
let r = vl(n);
|
|
5882
5970
|
if (!r?.url) throw Error("Could not find content for element");
|
|
5883
|
-
let i = await
|
|
5971
|
+
let i = await Xc.entitlements.hasAccess(r.url, r.pass?.split(",") || []);
|
|
5884
5972
|
if (!i) throw Error("User does not have access to the content");
|
|
5885
5973
|
let a;
|
|
5886
5974
|
if (i.token) a = i.token;
|
|
5887
5975
|
else {
|
|
5888
|
-
let e = await
|
|
5976
|
+
let e = await Xc.entitlements.access(i.id);
|
|
5889
5977
|
if (!e.token) throw Error("Could not get access token");
|
|
5890
5978
|
a = e.token;
|
|
5891
5979
|
}
|
|
5892
|
-
let o = t ||
|
|
5893
|
-
return
|
|
5980
|
+
let o = t || Gc(n.parentElement || n);
|
|
5981
|
+
return Xc.proxy.getContent(a, r.url, o);
|
|
5894
5982
|
}
|
|
5895
|
-
function
|
|
5983
|
+
function xl(e, t = {}) {
|
|
5896
5984
|
let { closeOnBackdropClick: n = !0, closeOnEscape: r = !0, zIndex: i = 2147483647, backdropBlur: a = "5px", overlayBackground: o = "rgba(0,0,0,0.5)" } = t, s = document.createElement("div");
|
|
5897
5985
|
s.setAttribute("data-sesamy-modal", "true"), Object.assign(s.style, {
|
|
5898
5986
|
position: "fixed",
|
|
@@ -5921,7 +6009,7 @@ function gl(e, t = {}) {
|
|
|
5921
6009
|
close: l
|
|
5922
6010
|
};
|
|
5923
6011
|
}
|
|
5924
|
-
function
|
|
6012
|
+
function Sl(e, t = {}) {
|
|
5925
6013
|
let { position: n = "top", fixed: r = !0, zIndex: i = 2147483647, autoDismissMs: a, pushContent: o = !1, height: s, transitionDuration: c = "0.3s" } = t, l = document.createElement("div");
|
|
5926
6014
|
l.setAttribute("data-sesamy-notification-bar", "true"), l.setAttribute("data-sesamy-notification-position", n), Object.assign(l.style, {
|
|
5927
6015
|
position: r ? "fixed" : "absolute",
|
|
@@ -5951,8 +6039,8 @@ function _l(e, t = {}) {
|
|
|
5951
6039
|
}
|
|
5952
6040
|
//#endregion
|
|
5953
6041
|
//#region src/services/analytics/plugins/sesamy-logger.ts
|
|
5954
|
-
var
|
|
5955
|
-
function
|
|
6042
|
+
var Cl = !1, wl, Tl, El;
|
|
6043
|
+
function Dl(e) {
|
|
5956
6044
|
return JSON.stringify(e.map((e) => {
|
|
5957
6045
|
let { campaign: t, ...n } = e.properties || {};
|
|
5958
6046
|
return {
|
|
@@ -5960,11 +6048,11 @@ function Sl(e) {
|
|
|
5960
6048
|
userId: e.userId,
|
|
5961
6049
|
type: e.type,
|
|
5962
6050
|
properties: n,
|
|
5963
|
-
clientId:
|
|
6051
|
+
clientId: El,
|
|
5964
6052
|
requestId: Math.random().toString(36).slice(2, 9),
|
|
5965
|
-
sessionId:
|
|
6053
|
+
sessionId: Wc(),
|
|
5966
6054
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5967
|
-
version:
|
|
6055
|
+
version: uc,
|
|
5968
6056
|
event: e.event,
|
|
5969
6057
|
context: {
|
|
5970
6058
|
...e.context,
|
|
@@ -5977,17 +6065,17 @@ function Sl(e) {
|
|
|
5977
6065
|
},
|
|
5978
6066
|
campaign: t,
|
|
5979
6067
|
locale: navigator.language,
|
|
5980
|
-
library:
|
|
6068
|
+
library: lc,
|
|
5981
6069
|
userAgent: navigator.userAgent,
|
|
5982
|
-
clientId:
|
|
6070
|
+
clientId: El
|
|
5983
6071
|
}
|
|
5984
6072
|
};
|
|
5985
6073
|
}));
|
|
5986
6074
|
}
|
|
5987
|
-
var
|
|
6075
|
+
var Ol = Hc(async (e) => {
|
|
5988
6076
|
if (e.length > 0) {
|
|
5989
|
-
let t =
|
|
5990
|
-
|
|
6077
|
+
let t = Dl(e);
|
|
6078
|
+
Cl ? navigator.sendBeacon(Tl, t) : (await fetch(Tl, {
|
|
5991
6079
|
method: "POST",
|
|
5992
6080
|
body: t,
|
|
5993
6081
|
headers: { "Content-Type": "text/plain" }
|
|
@@ -5997,27 +6085,27 @@ var Cl = Bc(async (e) => {
|
|
|
5997
6085
|
max: 10,
|
|
5998
6086
|
interval: 3e3
|
|
5999
6087
|
});
|
|
6000
|
-
function
|
|
6088
|
+
function kl(e) {
|
|
6001
6089
|
if (e.anonymousId) if (e.properties?.flushing) {
|
|
6002
6090
|
let t = { ...e };
|
|
6003
|
-
delete t.properties.flushing, navigator.sendBeacon(
|
|
6004
|
-
} else
|
|
6091
|
+
delete t.properties.flushing, navigator.sendBeacon(Tl, Dl([t]));
|
|
6092
|
+
} else Ol.push(e);
|
|
6005
6093
|
}
|
|
6006
|
-
function
|
|
6007
|
-
return
|
|
6094
|
+
function Al() {
|
|
6095
|
+
return Cl = !0, Ol.flush();
|
|
6008
6096
|
}
|
|
6009
|
-
function
|
|
6010
|
-
|
|
6097
|
+
function jl(e) {
|
|
6098
|
+
kl(e);
|
|
6011
6099
|
}
|
|
6012
|
-
function
|
|
6013
|
-
|
|
6100
|
+
function Ml(e, t, n) {
|
|
6101
|
+
wl = t, Tl = `${Mi("logs", n)}/events`, El = e;
|
|
6014
6102
|
}
|
|
6015
|
-
var
|
|
6103
|
+
var Nl = {
|
|
6016
6104
|
name: "custom-analytics-plugin",
|
|
6017
6105
|
page: ({ payload: e }) => {
|
|
6018
|
-
if (!
|
|
6106
|
+
if (!wl) return;
|
|
6019
6107
|
let { properties: t, anonymousId: n, userId: r, event: i } = e;
|
|
6020
|
-
|
|
6108
|
+
kl({
|
|
6021
6109
|
anonymousId: n,
|
|
6022
6110
|
userId: r,
|
|
6023
6111
|
properties: t,
|
|
@@ -6026,9 +6114,9 @@ var Ol = {
|
|
|
6026
6114
|
});
|
|
6027
6115
|
},
|
|
6028
6116
|
track: ({ payload: e }) => {
|
|
6029
|
-
if (!
|
|
6117
|
+
if (!wl) return;
|
|
6030
6118
|
let { properties: t, anonymousId: n, userId: r, event: i } = e;
|
|
6031
|
-
|
|
6119
|
+
kl({
|
|
6032
6120
|
anonymousId: n,
|
|
6033
6121
|
userId: r,
|
|
6034
6122
|
properties: t,
|
|
@@ -6037,9 +6125,9 @@ var Ol = {
|
|
|
6037
6125
|
});
|
|
6038
6126
|
},
|
|
6039
6127
|
identify: ({ payload: e }) => {
|
|
6040
|
-
if (!
|
|
6128
|
+
if (!wl) return;
|
|
6041
6129
|
let { properties: t, anonymousId: n, userId: r } = e;
|
|
6042
|
-
|
|
6130
|
+
kl({
|
|
6043
6131
|
anonymousId: n,
|
|
6044
6132
|
userId: r,
|
|
6045
6133
|
properties: t,
|
|
@@ -6050,56 +6138,56 @@ var Ol = {
|
|
|
6050
6138
|
//#endregion
|
|
6051
6139
|
//#region src/services/analytics/plugins/attribution-tracker.ts
|
|
6052
6140
|
Vn();
|
|
6053
|
-
var
|
|
6141
|
+
var Pl = [
|
|
6054
6142
|
"source",
|
|
6055
6143
|
"medium",
|
|
6056
6144
|
"campaign",
|
|
6057
6145
|
"term",
|
|
6058
6146
|
"content"
|
|
6059
|
-
],
|
|
6060
|
-
function
|
|
6061
|
-
return e ? Date.now() - parseInt(e, 10) >
|
|
6147
|
+
], Fl = "utm_", Il = 1800 * 1e3, Ll = {};
|
|
6148
|
+
function Rl(e) {
|
|
6149
|
+
return e ? Date.now() - parseInt(e, 10) > Il : !0;
|
|
6062
6150
|
}
|
|
6063
|
-
function
|
|
6064
|
-
|
|
6151
|
+
function zl(e, t) {
|
|
6152
|
+
Xi("statistics") ? Ys(e, t) : Ll[e] = t;
|
|
6065
6153
|
}
|
|
6066
|
-
function
|
|
6067
|
-
return
|
|
6154
|
+
function Bl(e) {
|
|
6155
|
+
return Xi("statistics") ? Js(e) : Ll[e] || null;
|
|
6068
6156
|
}
|
|
6069
|
-
function
|
|
6070
|
-
for (let [e, t] of Object.entries(
|
|
6157
|
+
function Vl() {
|
|
6158
|
+
for (let [e, t] of Object.entries(Ll)) Ys(e, t);
|
|
6071
6159
|
}
|
|
6072
|
-
function
|
|
6160
|
+
function Hl() {
|
|
6073
6161
|
let e = document.referrer || "";
|
|
6074
|
-
e && (
|
|
6162
|
+
e && (Rl(Bl(`${Fl}set_at`)) || !Bl(`${Fl}referrer`)) && zl(`${Fl}referrer`, e);
|
|
6075
6163
|
}
|
|
6076
|
-
function
|
|
6164
|
+
function Ul() {
|
|
6077
6165
|
let e = () => {
|
|
6078
6166
|
let e = {};
|
|
6079
|
-
for (let t of
|
|
6080
|
-
let n =
|
|
6167
|
+
for (let t of Pl) {
|
|
6168
|
+
let n = Bl(`${Fl}${t}`);
|
|
6081
6169
|
n && (e[`utm_${t}`] = n);
|
|
6082
6170
|
}
|
|
6083
|
-
let t =
|
|
6171
|
+
let t = Bl(`${Fl}referrer`);
|
|
6084
6172
|
return t && (e.utm_referrer = t), e;
|
|
6085
6173
|
};
|
|
6086
6174
|
return {
|
|
6087
6175
|
name: "attribution-tracking",
|
|
6088
6176
|
initialize() {
|
|
6089
|
-
|
|
6090
|
-
|
|
6177
|
+
Hl(), typeof window < "u" && window.addEventListener(J.CONSENT_CHANGED, () => {
|
|
6178
|
+
Xi("statistics") && Vl();
|
|
6091
6179
|
});
|
|
6092
6180
|
},
|
|
6093
6181
|
campaign({ payload: e }) {
|
|
6094
|
-
let t = e?.campaign || {}, n =
|
|
6095
|
-
if (Object.keys(t).length > 0 &&
|
|
6096
|
-
for (let e of
|
|
6182
|
+
let t = e?.campaign || {}, n = Bl(`${Fl}set_at`);
|
|
6183
|
+
if (Object.keys(t).length > 0 && Rl(n)) {
|
|
6184
|
+
for (let e of Pl) {
|
|
6097
6185
|
let n = t[e];
|
|
6098
|
-
n &&
|
|
6186
|
+
n && zl(`${Fl}${e}`, n);
|
|
6099
6187
|
}
|
|
6100
|
-
|
|
6188
|
+
zl(`${Fl}set_at`, String(Date.now()));
|
|
6101
6189
|
}
|
|
6102
|
-
|
|
6190
|
+
Hl();
|
|
6103
6191
|
},
|
|
6104
6192
|
page({ payload: t }) {
|
|
6105
6193
|
return t.properties.campaign = e(), t;
|
|
@@ -6113,70 +6201,70 @@ function Rl() {
|
|
|
6113
6201
|
//#endregion
|
|
6114
6202
|
//#region src/services/analytics/index.ts
|
|
6115
6203
|
Vn();
|
|
6116
|
-
var
|
|
6117
|
-
function
|
|
6118
|
-
return `session:${
|
|
6204
|
+
var Wl = /* @__PURE__ */ new Map(), Gl = /* @__PURE__ */ new Map(), Kl = [];
|
|
6205
|
+
function ql() {
|
|
6206
|
+
return `session:${Wc()}`;
|
|
6119
6207
|
}
|
|
6120
|
-
function
|
|
6121
|
-
|
|
6122
|
-
anonymousId:
|
|
6208
|
+
function Jl(e) {
|
|
6209
|
+
jl({
|
|
6210
|
+
anonymousId: ql(),
|
|
6123
6211
|
userId: e.userId,
|
|
6124
6212
|
properties: e.properties || {},
|
|
6125
6213
|
event: e.event,
|
|
6126
6214
|
type: e.type
|
|
6127
6215
|
});
|
|
6128
6216
|
}
|
|
6129
|
-
function
|
|
6130
|
-
|
|
6131
|
-
|
|
6217
|
+
function Yl({ clientId: e, enabled: t = !0, environment: n }) {
|
|
6218
|
+
Ml(e, t, n), t && (window.addEventListener("beforeunload", () => {
|
|
6219
|
+
Gl.forEach((e, t) => {
|
|
6132
6220
|
e.bind(t)();
|
|
6133
|
-
}),
|
|
6221
|
+
}), Al();
|
|
6134
6222
|
}), window.addEventListener("visibilitychange", () => {
|
|
6135
|
-
document.visibilityState !== "visible" &&
|
|
6223
|
+
document.visibilityState !== "visible" && Wl.forEach((e, t) => {
|
|
6136
6224
|
e.bind(t)();
|
|
6137
6225
|
});
|
|
6138
|
-
}),
|
|
6139
|
-
let e = new
|
|
6226
|
+
}), mc(), Bc(() => {
|
|
6227
|
+
let e = new zc({
|
|
6140
6228
|
element: document.body,
|
|
6141
6229
|
viewCallback: () => {
|
|
6142
|
-
|
|
6230
|
+
eu();
|
|
6143
6231
|
},
|
|
6144
6232
|
activeDurationCallback: (e, t, n) => {
|
|
6145
|
-
|
|
6233
|
+
nu("activeDuration", {
|
|
6146
6234
|
duration: e,
|
|
6147
6235
|
durationStart: n,
|
|
6148
6236
|
flushing: t
|
|
6149
6237
|
});
|
|
6150
6238
|
},
|
|
6151
6239
|
idleDurationCallback: (e, t, n) => {
|
|
6152
|
-
|
|
6240
|
+
nu("idleDuration", {
|
|
6153
6241
|
duration: e,
|
|
6154
6242
|
durationStart: n,
|
|
6155
6243
|
flushing: t
|
|
6156
6244
|
});
|
|
6157
6245
|
},
|
|
6158
6246
|
scrollCallback: (e) => {
|
|
6159
|
-
|
|
6247
|
+
nu("scroll", { scroll: e.scrollMax });
|
|
6160
6248
|
}
|
|
6161
6249
|
});
|
|
6162
|
-
|
|
6250
|
+
Gl.set(document.body, () => {
|
|
6163
6251
|
e.flush();
|
|
6164
|
-
}),
|
|
6252
|
+
}), Wl.set(document.body, () => {
|
|
6165
6253
|
e.handleVisibilityChange();
|
|
6166
6254
|
});
|
|
6167
6255
|
}), window.addEventListener(J.AUTHENTICATED, async (e) => {
|
|
6168
6256
|
let t = e;
|
|
6169
|
-
if (
|
|
6257
|
+
if (Xl()) await Ql().identify(t.detail.sub);
|
|
6170
6258
|
else {
|
|
6171
6259
|
let e = {
|
|
6172
6260
|
type: "identify",
|
|
6173
6261
|
userId: t.detail.sub,
|
|
6174
6262
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6175
6263
|
};
|
|
6176
|
-
|
|
6264
|
+
Kl.push(e), Jl(e);
|
|
6177
6265
|
}
|
|
6178
6266
|
}), window.addEventListener(J.LOGOUT, async () => {
|
|
6179
|
-
if (
|
|
6267
|
+
if (Xl()) await Ql().track("logout", {}), await Ql().reset();
|
|
6180
6268
|
else {
|
|
6181
6269
|
let e = {
|
|
6182
6270
|
type: "track",
|
|
@@ -6184,50 +6272,50 @@ function Wl({ clientId: e, enabled: t = !0, environment: n }) {
|
|
|
6184
6272
|
properties: {},
|
|
6185
6273
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6186
6274
|
};
|
|
6187
|
-
|
|
6275
|
+
Kl.push(e), Jl(e);
|
|
6188
6276
|
}
|
|
6189
|
-
}),
|
|
6190
|
-
|
|
6277
|
+
}), Ji() && !Xi("statistics") && window.addEventListener(J.CONSENT_CHANGED, () => {
|
|
6278
|
+
Xi("statistics") && $l();
|
|
6191
6279
|
}));
|
|
6192
6280
|
}
|
|
6193
|
-
function
|
|
6194
|
-
return !
|
|
6195
|
-
}
|
|
6196
|
-
var
|
|
6197
|
-
function
|
|
6198
|
-
return
|
|
6199
|
-
app:
|
|
6200
|
-
version:
|
|
6201
|
-
plugins: [
|
|
6202
|
-
}),
|
|
6203
|
-
}
|
|
6204
|
-
function
|
|
6205
|
-
let e =
|
|
6206
|
-
for (let t of
|
|
6281
|
+
function Xl() {
|
|
6282
|
+
return !Ji() || Xi("statistics");
|
|
6283
|
+
}
|
|
6284
|
+
var Zl;
|
|
6285
|
+
function Ql() {
|
|
6286
|
+
return Zl ||= cc({
|
|
6287
|
+
app: lc,
|
|
6288
|
+
version: uc,
|
|
6289
|
+
plugins: [Ul(), Nl]
|
|
6290
|
+
}), Zl;
|
|
6291
|
+
}
|
|
6292
|
+
function $l() {
|
|
6293
|
+
let e = Ql().user().anonymousId;
|
|
6294
|
+
for (let t of Kl) jl({
|
|
6207
6295
|
anonymousId: e,
|
|
6208
6296
|
userId: t.userId,
|
|
6209
6297
|
properties: t.properties || {},
|
|
6210
6298
|
event: t.event,
|
|
6211
6299
|
type: t.type
|
|
6212
6300
|
});
|
|
6213
|
-
|
|
6301
|
+
Kl.length = 0;
|
|
6214
6302
|
}
|
|
6215
|
-
function
|
|
6216
|
-
if (
|
|
6303
|
+
function eu() {
|
|
6304
|
+
if (Xl()) Ql().page();
|
|
6217
6305
|
else {
|
|
6218
6306
|
let e = {
|
|
6219
6307
|
type: "page",
|
|
6220
6308
|
properties: {},
|
|
6221
6309
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6222
6310
|
};
|
|
6223
|
-
|
|
6311
|
+
Kl.push(e), Jl(e);
|
|
6224
6312
|
}
|
|
6225
6313
|
}
|
|
6226
|
-
function
|
|
6227
|
-
return
|
|
6314
|
+
function tu() {
|
|
6315
|
+
return Xl() ? Ql().user().anonymousId : ql();
|
|
6228
6316
|
}
|
|
6229
|
-
function
|
|
6230
|
-
if (
|
|
6317
|
+
function nu(e, t) {
|
|
6318
|
+
if (Xl()) Ql().track(e, t);
|
|
6231
6319
|
else {
|
|
6232
6320
|
let n = {
|
|
6233
6321
|
type: "track",
|
|
@@ -6235,70 +6323,70 @@ function Zl(e, t) {
|
|
|
6235
6323
|
properties: t,
|
|
6236
6324
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6237
6325
|
};
|
|
6238
|
-
|
|
6326
|
+
Kl.push(n), Jl(n);
|
|
6239
6327
|
}
|
|
6240
6328
|
}
|
|
6241
6329
|
//#endregion
|
|
6242
6330
|
//#region src/services/flags/index.ts
|
|
6243
6331
|
zn();
|
|
6244
|
-
var
|
|
6245
|
-
async function
|
|
6332
|
+
var ru = "sesamyFlags";
|
|
6333
|
+
async function iu(e) {
|
|
6246
6334
|
try {
|
|
6247
|
-
localStorage.setItem(
|
|
6335
|
+
localStorage.setItem(ru, JSON.stringify(e));
|
|
6248
6336
|
} catch {
|
|
6249
6337
|
q("Failed to save flags to localStorage");
|
|
6250
6338
|
}
|
|
6251
6339
|
}
|
|
6252
|
-
async function
|
|
6253
|
-
let n = await
|
|
6254
|
-
n[e] = t, await
|
|
6340
|
+
async function au(e, t) {
|
|
6341
|
+
let n = await cu();
|
|
6342
|
+
n[e] = t, await iu(n);
|
|
6255
6343
|
}
|
|
6256
|
-
async function
|
|
6257
|
-
return (await
|
|
6344
|
+
async function ou(e) {
|
|
6345
|
+
return (await cu())[e];
|
|
6258
6346
|
}
|
|
6259
|
-
async function
|
|
6260
|
-
let t = await
|
|
6261
|
-
e in t && (delete t[e], await
|
|
6347
|
+
async function su(e) {
|
|
6348
|
+
let t = await cu();
|
|
6349
|
+
e in t && (delete t[e], await iu(t));
|
|
6262
6350
|
}
|
|
6263
|
-
async function
|
|
6351
|
+
async function cu() {
|
|
6264
6352
|
try {
|
|
6265
|
-
let e = localStorage.getItem(
|
|
6353
|
+
let e = localStorage.getItem(ru);
|
|
6266
6354
|
return e ? JSON.parse(e) : {};
|
|
6267
6355
|
} catch {
|
|
6268
6356
|
return {};
|
|
6269
6357
|
}
|
|
6270
6358
|
}
|
|
6271
6359
|
Vn(), Gn();
|
|
6272
|
-
function
|
|
6273
|
-
let t = e.endpoint ??
|
|
6360
|
+
function lu(e) {
|
|
6361
|
+
let t = e.endpoint ?? Mi("api2", e.environment), n = (() => {
|
|
6274
6362
|
try {
|
|
6275
|
-
let e =
|
|
6363
|
+
let e = ki(new URL(t, window.location.origin).href), n = ki(window.location.href);
|
|
6276
6364
|
return e !== null && e === n;
|
|
6277
6365
|
} catch {
|
|
6278
6366
|
return !1;
|
|
6279
6367
|
}
|
|
6280
|
-
})(), r = e.useHttpCookies === !0, i =
|
|
6368
|
+
})(), r = e.useHttpCookies === !0, i = Si({
|
|
6281
6369
|
baseUrl: t,
|
|
6282
6370
|
tokenProvider: async () => {
|
|
6283
6371
|
if (r) return null;
|
|
6284
|
-
if (await
|
|
6285
|
-
let e = await
|
|
6372
|
+
if (await ar()) try {
|
|
6373
|
+
let e = await or(!1);
|
|
6286
6374
|
if (e) return `Bearer ${e}`;
|
|
6287
6375
|
if (n) return null;
|
|
6288
6376
|
} catch {}
|
|
6289
|
-
let t =
|
|
6377
|
+
let t = Xi("statistics") ? localStorage.getItem("__anon_id") : tu();
|
|
6290
6378
|
return `Basic ${btoa(`${e.vendorId || e.clientId}|${t}:`)}`;
|
|
6291
6379
|
},
|
|
6292
|
-
libraryName:
|
|
6293
|
-
libraryVersion:
|
|
6380
|
+
libraryName: lc,
|
|
6381
|
+
libraryVersion: uc,
|
|
6294
6382
|
vendorId: e.vendorId,
|
|
6295
6383
|
cache: {
|
|
6296
|
-
mode:
|
|
6297
|
-
storage: new
|
|
6384
|
+
mode: xr.BROWSER,
|
|
6385
|
+
storage: new Ai()
|
|
6298
6386
|
}
|
|
6299
6387
|
}), a = (e) => async (t, n) => {
|
|
6300
|
-
let r = sessionStorage.getItem(
|
|
6301
|
-
return r || (r = Date.now().toString(), sessionStorage.setItem(
|
|
6388
|
+
let r = sessionStorage.getItem(Ei);
|
|
6389
|
+
return r || (r = Date.now().toString(), sessionStorage.setItem(Ei, r)), e(t, {
|
|
6302
6390
|
...n,
|
|
6303
6391
|
headers: {
|
|
6304
6392
|
...n.headers,
|
|
@@ -6309,9 +6397,9 @@ function iu(e) {
|
|
|
6309
6397
|
...n,
|
|
6310
6398
|
credentials: "include"
|
|
6311
6399
|
}), s = (e = !0) => (t) => async (r, i) => {
|
|
6312
|
-
let a = await
|
|
6400
|
+
let a = await or(e);
|
|
6313
6401
|
if (!a) {
|
|
6314
|
-
if (n && await
|
|
6402
|
+
if (n && await ar()) return t(r, {
|
|
6315
6403
|
...i,
|
|
6316
6404
|
credentials: "include"
|
|
6317
6405
|
});
|
|
@@ -6325,11 +6413,11 @@ function iu(e) {
|
|
|
6325
6413
|
Authorization: `Bearer ${a}`
|
|
6326
6414
|
}
|
|
6327
6415
|
});
|
|
6328
|
-
}, c =
|
|
6416
|
+
}, c = Lr(t).headers({ "Content-Type": "application/json" }).middlewares([
|
|
6329
6417
|
a,
|
|
6330
6418
|
r ? o : s(),
|
|
6331
|
-
|
|
6332
|
-
|
|
6419
|
+
gr(),
|
|
6420
|
+
yr({
|
|
6333
6421
|
delayTimer: 1e3,
|
|
6334
6422
|
delayRamp: (e, t) => e * t,
|
|
6335
6423
|
maxAttempts: 3,
|
|
@@ -6338,27 +6426,27 @@ function iu(e) {
|
|
|
6338
6426
|
})
|
|
6339
6427
|
]);
|
|
6340
6428
|
async function l(e = {}) {
|
|
6341
|
-
let { waitForEntitlementAfter: t, includeSignedLinks: n = !0 } = e, r = await
|
|
6342
|
-
return n && r.push(
|
|
6429
|
+
let { waitForEntitlementAfter: t, includeSignedLinks: n = !0 } = e, r = await ar() ? await i.entitlements.list({ waitForEntitlementAfter: t?.toISOString() }) : [];
|
|
6430
|
+
return n && r.push(...ta()), r;
|
|
6343
6431
|
}
|
|
6344
6432
|
async function u(e, t = []) {
|
|
6345
6433
|
return (await l())?.find((n) => {
|
|
6346
6434
|
if (e) {
|
|
6347
|
-
let { sku: t, purchaseOption: r } =
|
|
6348
|
-
if ("sku" in n && t === n.sku || r && "purchaseOptionsId" in n && r === n.purchaseOptionsId ||
|
|
6435
|
+
let { sku: t, purchaseOption: r } = Fi(e);
|
|
6436
|
+
if ("sku" in n && t === n.sku || r && "purchaseOptionsId" in n && r === n.purchaseOptionsId || Li(e, n.url)) return !0;
|
|
6349
6437
|
}
|
|
6350
|
-
return !!t.some((e) =>
|
|
6438
|
+
return !!t.some((e) => Li(e, n.url));
|
|
6351
6439
|
});
|
|
6352
6440
|
}
|
|
6353
6441
|
async function d(e, n, i) {
|
|
6354
6442
|
let a = new URL(t, window.location.origin);
|
|
6355
6443
|
a.pathname = a.pathname.replace(/\/$/, "") + "/proxy", a.searchParams.set("url", n), i && a.searchParams.set("selector", i);
|
|
6356
|
-
let o =
|
|
6444
|
+
let o = Lr(a.toString());
|
|
6357
6445
|
return o = r ? o.options({ credentials: "include" }) : o.headers({ Authorization: `Bearer ${e}` }), o.get().text();
|
|
6358
6446
|
}
|
|
6359
6447
|
async function f(e) {
|
|
6360
6448
|
if (!e) throw Error("SKU is required to get fulfillments");
|
|
6361
|
-
return await
|
|
6449
|
+
return await ar() ? await c.get(`/fulfillments?sku=${encodeURIComponent(e)}`).json() : [];
|
|
6362
6450
|
}
|
|
6363
6451
|
async function p(e, t) {
|
|
6364
6452
|
if (!e || !t) throw Error("SKU and itemId are required to request delivery");
|
|
@@ -6375,11 +6463,11 @@ function iu(e) {
|
|
|
6375
6463
|
}
|
|
6376
6464
|
async function _(e) {
|
|
6377
6465
|
let t = await c.url(`/tags/${encodeURIComponent(e)}`).delete().res();
|
|
6378
|
-
return
|
|
6466
|
+
return ni(), t.ok;
|
|
6379
6467
|
}
|
|
6380
6468
|
async function v(e) {
|
|
6381
6469
|
let t = await c.url("/tags").post(encodeURIComponent(e)).res();
|
|
6382
|
-
return Wn(J.USER_ATTRIBUTE_CHANGED, {}),
|
|
6470
|
+
return Wn(J.USER_ATTRIBUTE_CHANGED, {}), ni(), t.ok;
|
|
6383
6471
|
}
|
|
6384
6472
|
async function y(e) {
|
|
6385
6473
|
return (await i.tallies.get(e)).value;
|
|
@@ -6396,11 +6484,11 @@ function iu(e) {
|
|
|
6396
6484
|
return await i.tallies.push(e, t);
|
|
6397
6485
|
}
|
|
6398
6486
|
async function C() {
|
|
6399
|
-
return !await
|
|
6487
|
+
return !await or(!1) && !await ar() ? null : await c.url("/profile").get().json();
|
|
6400
6488
|
}
|
|
6401
6489
|
async function w(e) {
|
|
6402
6490
|
let t = await c.url("/profile").patch(e).res();
|
|
6403
|
-
return
|
|
6491
|
+
return ni(), t.ok;
|
|
6404
6492
|
}
|
|
6405
6493
|
async function T() {
|
|
6406
6494
|
return (await c.url("/profile/spotify-link").get().json()).isSpotifyLinked;
|
|
@@ -6409,39 +6497,39 @@ function iu(e) {
|
|
|
6409
6497
|
return (await c.url("/profile/unlink-spotify").post().res()).ok;
|
|
6410
6498
|
}
|
|
6411
6499
|
async function D(t) {
|
|
6412
|
-
let n = await
|
|
6500
|
+
let n = await or(!1);
|
|
6413
6501
|
if (!n) throw Error("No access token available");
|
|
6414
|
-
let r = new URL(`${
|
|
6502
|
+
let r = new URL(`${Mi("access-sync", e.environment)}/spotify/sesamy-callback`);
|
|
6415
6503
|
r.searchParams.set("access_token", n), r.searchParams.set("state", t), window.location.href = r.toString();
|
|
6416
6504
|
}
|
|
6417
6505
|
async function O(e) {
|
|
6418
6506
|
let t = await c.url(`/products/${encodeURIComponent(e)}/auto-onboard`).post().json();
|
|
6419
|
-
return t.length &&
|
|
6507
|
+
return t.length && ni(), t;
|
|
6420
6508
|
}
|
|
6421
6509
|
async function k(e, t = 3600) {
|
|
6422
|
-
let { shortlink: n } = await
|
|
6510
|
+
let { shortlink: n } = await Lr(Ti).post({
|
|
6423
6511
|
url: e,
|
|
6424
6512
|
ttl: t
|
|
6425
6513
|
}).json();
|
|
6426
6514
|
return n;
|
|
6427
6515
|
}
|
|
6428
6516
|
async function A(t) {
|
|
6429
|
-
let n = await
|
|
6517
|
+
let n = await or(!1, !0), r, i = t.language || Ni(), a = sa();
|
|
6430
6518
|
switch (t.target) {
|
|
6431
6519
|
case "account":
|
|
6432
|
-
r = new URL(`${
|
|
6520
|
+
r = new URL(`${Mi("account", e.environment)}/${encodeURIComponent(t.language || i)}/subscriptions/${encodeURIComponent(e.vendorId || e.clientId)}${t.contractId ? `/${encodeURIComponent(t.contractId)}` : ""}`), r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
6433
6521
|
break;
|
|
6434
6522
|
case "change-payment":
|
|
6435
|
-
r = new URL(`${
|
|
6523
|
+
r = new URL(`${Mi("account", e.environment)}/${encodeURIComponent(t.language || i)}/subscriptions/${encodeURIComponent(e.vendorId || e.clientId)}/${encodeURIComponent(t.contractId)}/change-payment-method`), r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
6436
6524
|
break;
|
|
6437
6525
|
case "change-plan":
|
|
6438
|
-
r = new URL(`${
|
|
6526
|
+
r = new URL(`${Mi("account", e.environment)}/${encodeURIComponent(t.language || i)}/subscriptions/${encodeURIComponent(e.vendorId || e.clientId)}/${encodeURIComponent(t.contractId)}/edit-plan`), r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
6439
6527
|
break;
|
|
6440
6528
|
case "consume":
|
|
6441
|
-
r = new URL(`${
|
|
6529
|
+
r = new URL(`${Mi("consume", e.environment)}/${encodeURIComponent(t.language || i)}/@${encodeURIComponent(e.vendorId || e.clientId)}/${encodeURIComponent(t.sku)}`), t.episodeId ? r.href += `/${t.episodeId}` : r.href += "/listen", r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
6442
6530
|
break;
|
|
6443
6531
|
case "checkout":
|
|
6444
|
-
r =
|
|
6532
|
+
r = $i(e, {
|
|
6445
6533
|
language: i,
|
|
6446
6534
|
...t
|
|
6447
6535
|
}, a);
|
|
@@ -6451,12 +6539,12 @@ function iu(e) {
|
|
|
6451
6539
|
return n && (r.hash = `#access_token=${n}`), t.shorten ? k(r.href, t.ttl) : r.href;
|
|
6452
6540
|
}
|
|
6453
6541
|
async function j() {
|
|
6454
|
-
let t = await
|
|
6542
|
+
let t = await or(!1), n = new URL(`${Mi("account", e.environment)}/subscriptions/${e.vendorId || e.clientId}`);
|
|
6455
6543
|
t && (n.hash = `#access_token=${t}`), window.location.href = n.toString();
|
|
6456
6544
|
}
|
|
6457
6545
|
async function M(e) {
|
|
6458
|
-
let t =
|
|
6459
|
-
if (
|
|
6546
|
+
let t = sa();
|
|
6547
|
+
if (Xi("marketing")) {
|
|
6460
6548
|
let e = [
|
|
6461
6549
|
"_ga",
|
|
6462
6550
|
"_gid",
|
|
@@ -6469,7 +6557,7 @@ function iu(e) {
|
|
|
6469
6557
|
});
|
|
6470
6558
|
}
|
|
6471
6559
|
return i.checkouts.create({
|
|
6472
|
-
language:
|
|
6560
|
+
language: Ni(),
|
|
6473
6561
|
...e,
|
|
6474
6562
|
attribution: {
|
|
6475
6563
|
...t,
|
|
@@ -6486,21 +6574,21 @@ function iu(e) {
|
|
|
6486
6574
|
update: i.checkouts.update
|
|
6487
6575
|
},
|
|
6488
6576
|
content: {
|
|
6489
|
-
list:
|
|
6490
|
-
get:
|
|
6491
|
-
getLanguage:
|
|
6492
|
-
unlock:
|
|
6493
|
-
getPropertyFromHTML:
|
|
6577
|
+
list: _l,
|
|
6578
|
+
get: vl,
|
|
6579
|
+
getLanguage: Ni,
|
|
6580
|
+
unlock: bl,
|
|
6581
|
+
getPropertyFromHTML: gl
|
|
6494
6582
|
},
|
|
6495
6583
|
contracts: i.contracts,
|
|
6496
6584
|
deleteTag: _,
|
|
6497
6585
|
deleteTally: x,
|
|
6498
6586
|
entitlements: i.entitlements,
|
|
6499
6587
|
flags: {
|
|
6500
|
-
get:
|
|
6501
|
-
set:
|
|
6502
|
-
list:
|
|
6503
|
-
delete:
|
|
6588
|
+
get: ou,
|
|
6589
|
+
set: au,
|
|
6590
|
+
list: cu,
|
|
6591
|
+
delete: su
|
|
6504
6592
|
},
|
|
6505
6593
|
generateLink: A,
|
|
6506
6594
|
getProxyContent: d,
|
|
@@ -6531,16 +6619,16 @@ function iu(e) {
|
|
|
6531
6619
|
}
|
|
6532
6620
|
//#endregion
|
|
6533
6621
|
//#region src/services/browser/detect-adblock.ts
|
|
6534
|
-
var
|
|
6622
|
+
var uu = [
|
|
6535
6623
|
"AdHeader",
|
|
6536
6624
|
"AdContainer",
|
|
6537
6625
|
"AD_Top",
|
|
6538
6626
|
"homead",
|
|
6539
6627
|
"ad-lead"
|
|
6540
6628
|
];
|
|
6541
|
-
function
|
|
6629
|
+
function du() {
|
|
6542
6630
|
return new Promise((e) => {
|
|
6543
|
-
let t =
|
|
6631
|
+
let t = uu.map((e) => {
|
|
6544
6632
|
let t = document.createElement("div");
|
|
6545
6633
|
return t.innerHTML = " ", t.id = e, t.style.position = "absolute", document.body.appendChild(t), t;
|
|
6546
6634
|
});
|
|
@@ -6552,7 +6640,7 @@ function ou() {
|
|
|
6552
6640
|
}
|
|
6553
6641
|
//#endregion
|
|
6554
6642
|
//#region src/services/browser/in-app-browser.ts
|
|
6555
|
-
function
|
|
6643
|
+
function fu() {
|
|
6556
6644
|
let e = navigator.userAgent.toLowerCase();
|
|
6557
6645
|
for (let t of [
|
|
6558
6646
|
{
|
|
@@ -6617,20 +6705,20 @@ function su() {
|
|
|
6617
6705
|
}
|
|
6618
6706
|
//#endregion
|
|
6619
6707
|
//#region ../../node_modules/.pnpm/detectincognitojs@1.6.2/node_modules/detectincognitojs/dist/detectIncognito.esm.js
|
|
6620
|
-
var
|
|
6708
|
+
var pu = {
|
|
6621
6709
|
d: (e, t) => {
|
|
6622
|
-
for (var n in t)
|
|
6710
|
+
for (var n in t) pu.o(t, n) && !pu.o(e, n) && Object.defineProperty(e, n, {
|
|
6623
6711
|
enumerable: !0,
|
|
6624
6712
|
get: t[n]
|
|
6625
6713
|
});
|
|
6626
6714
|
},
|
|
6627
6715
|
o: (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
6628
|
-
},
|
|
6629
|
-
|
|
6630
|
-
A: () =>
|
|
6631
|
-
k: () =>
|
|
6716
|
+
}, mu = {};
|
|
6717
|
+
pu.d(mu, {
|
|
6718
|
+
A: () => vu,
|
|
6719
|
+
k: () => _u
|
|
6632
6720
|
});
|
|
6633
|
-
var
|
|
6721
|
+
var hu = function(e, t, n, r) {
|
|
6634
6722
|
return new (n ||= Promise)(function(i, a) {
|
|
6635
6723
|
function o(e) {
|
|
6636
6724
|
try {
|
|
@@ -6654,7 +6742,7 @@ var uu = function(e, t, n, r) {
|
|
|
6654
6742
|
}
|
|
6655
6743
|
c((r = r.apply(e, t || [])).next());
|
|
6656
6744
|
});
|
|
6657
|
-
},
|
|
6745
|
+
}, gu = function(e, t) {
|
|
6658
6746
|
var n, r, i, a, o = {
|
|
6659
6747
|
label: 0,
|
|
6660
6748
|
sent: function() {
|
|
@@ -6727,9 +6815,9 @@ var uu = function(e, t, n, r) {
|
|
|
6727
6815
|
};
|
|
6728
6816
|
}
|
|
6729
6817
|
};
|
|
6730
|
-
function
|
|
6731
|
-
return
|
|
6732
|
-
return
|
|
6818
|
+
function _u() {
|
|
6819
|
+
return hu(this, void 0, Promise, function() {
|
|
6820
|
+
return gu(this, function(e) {
|
|
6733
6821
|
switch (e.label) {
|
|
6734
6822
|
case 0: return [4, new Promise(function(e, t) {
|
|
6735
6823
|
var n = "Unknown", r = !1;
|
|
@@ -6749,9 +6837,9 @@ function fu() {
|
|
|
6749
6837
|
return e;
|
|
6750
6838
|
}
|
|
6751
6839
|
function o() {
|
|
6752
|
-
return
|
|
6840
|
+
return hu(this, void 0, void 0, function() {
|
|
6753
6841
|
var e, t;
|
|
6754
|
-
return
|
|
6842
|
+
return gu(this, function(n) {
|
|
6755
6843
|
switch (n.label) {
|
|
6756
6844
|
case 0: return n.trys.push([
|
|
6757
6845
|
0,
|
|
@@ -6767,8 +6855,8 @@ function fu() {
|
|
|
6767
6855
|
});
|
|
6768
6856
|
}
|
|
6769
6857
|
function s() {
|
|
6770
|
-
return
|
|
6771
|
-
return
|
|
6858
|
+
return hu(this, void 0, Promise, function() {
|
|
6859
|
+
return gu(this, function(e) {
|
|
6772
6860
|
switch (e.label) {
|
|
6773
6861
|
case 0: return typeof navigator.storage?.getDirectory == "function" ? [4, o()] : [3, 2];
|
|
6774
6862
|
case 1: return e.sent(), [3, 3];
|
|
@@ -6831,9 +6919,9 @@ function fu() {
|
|
|
6831
6919
|
});
|
|
6832
6920
|
}
|
|
6833
6921
|
function u() {
|
|
6834
|
-
return
|
|
6922
|
+
return hu(this, void 0, Promise, function() {
|
|
6835
6923
|
var e, t, n;
|
|
6836
|
-
return
|
|
6924
|
+
return gu(this, function(r) {
|
|
6837
6925
|
switch (r.label) {
|
|
6838
6926
|
case 0:
|
|
6839
6927
|
if (typeof navigator.storage?.getDirectory != "function") return [3, 5];
|
|
@@ -6858,8 +6946,8 @@ function fu() {
|
|
|
6858
6946
|
});
|
|
6859
6947
|
}
|
|
6860
6948
|
(function() {
|
|
6861
|
-
return
|
|
6862
|
-
return
|
|
6949
|
+
return hu(this, void 0, Promise, function() {
|
|
6950
|
+
return gu(this, function(e) {
|
|
6863
6951
|
switch (e.label) {
|
|
6864
6952
|
case 0: return a() !== 44 && a() !== 43 ? [3, 2] : (n = "Safari", [4, s()]);
|
|
6865
6953
|
case 1: return e.sent(), [3, 6];
|
|
@@ -6879,34 +6967,34 @@ function fu() {
|
|
|
6879
6967
|
});
|
|
6880
6968
|
});
|
|
6881
6969
|
}
|
|
6882
|
-
typeof window < "u" && (window.detectIncognito =
|
|
6883
|
-
var
|
|
6884
|
-
|
|
6885
|
-
var
|
|
6886
|
-
function
|
|
6970
|
+
typeof window < "u" && (window.detectIncognito = _u);
|
|
6971
|
+
var vu = _u;
|
|
6972
|
+
mu.A;
|
|
6973
|
+
var yu = mu.k, bu = "sesamy_incognito_mode";
|
|
6974
|
+
function xu() {
|
|
6887
6975
|
try {
|
|
6888
|
-
let e = sessionStorage.getItem(
|
|
6976
|
+
let e = sessionStorage.getItem(bu);
|
|
6889
6977
|
return e === null ? void 0 : e === "true";
|
|
6890
6978
|
} catch {
|
|
6891
6979
|
return;
|
|
6892
6980
|
}
|
|
6893
6981
|
}
|
|
6894
|
-
async function
|
|
6982
|
+
async function Su() {
|
|
6895
6983
|
try {
|
|
6896
|
-
let e = sessionStorage.getItem(
|
|
6984
|
+
let e = sessionStorage.getItem(bu);
|
|
6897
6985
|
if (e !== null) return e === "true";
|
|
6898
|
-
let { isPrivate: t } = await
|
|
6899
|
-
return sessionStorage.setItem(
|
|
6986
|
+
let { isPrivate: t } = await yu();
|
|
6987
|
+
return sessionStorage.setItem(bu, t.toString()), t;
|
|
6900
6988
|
} catch {
|
|
6901
6989
|
try {
|
|
6902
|
-
sessionStorage.setItem(
|
|
6990
|
+
sessionStorage.setItem(bu, "false");
|
|
6903
6991
|
} catch {}
|
|
6904
6992
|
return !1;
|
|
6905
6993
|
}
|
|
6906
6994
|
}
|
|
6907
6995
|
//#endregion
|
|
6908
6996
|
//#region src/services/events/index.ts
|
|
6909
|
-
function
|
|
6997
|
+
function Cu(e, t, n = !1) {
|
|
6910
6998
|
let r = {
|
|
6911
6999
|
name: e,
|
|
6912
7000
|
data: t
|
|
@@ -6915,7 +7003,7 @@ function vu(e, t, n = !1) {
|
|
|
6915
7003
|
cancelable: n,
|
|
6916
7004
|
bubbles: !0
|
|
6917
7005
|
});
|
|
6918
|
-
|
|
7006
|
+
nu(`event:${e}`, {
|
|
6919
7007
|
...t,
|
|
6920
7008
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
6921
7009
|
});
|
|
@@ -6925,55 +7013,58 @@ function vu(e, t, n = !1) {
|
|
|
6925
7013
|
message: r.cancellationMessage
|
|
6926
7014
|
} : { canceled: !1 };
|
|
6927
7015
|
}
|
|
6928
|
-
function
|
|
7016
|
+
function wu(e, t) {
|
|
6929
7017
|
e.cancelable && (e.detail.cancellationMessage = t, e.preventDefault());
|
|
6930
7018
|
}
|
|
6931
7019
|
//#endregion
|
|
6932
7020
|
//#region src/services/capsule/plugin.ts
|
|
6933
|
-
var
|
|
6934
|
-
function
|
|
6935
|
-
|
|
7021
|
+
var Tu = null;
|
|
7022
|
+
function Eu(e) {
|
|
7023
|
+
Tu = e;
|
|
6936
7024
|
}
|
|
6937
|
-
function
|
|
6938
|
-
return
|
|
7025
|
+
function Du() {
|
|
7026
|
+
return Tu;
|
|
6939
7027
|
}
|
|
6940
7028
|
zn(), Vn();
|
|
6941
|
-
var
|
|
6942
|
-
function
|
|
6943
|
-
return
|
|
7029
|
+
var Ou = null;
|
|
7030
|
+
function ku() {
|
|
7031
|
+
return Du()?.getDcaClient() ?? null;
|
|
6944
7032
|
}
|
|
6945
|
-
function
|
|
6946
|
-
let
|
|
6947
|
-
if (!
|
|
7033
|
+
function Au(e, t) {
|
|
7034
|
+
let n = Du();
|
|
7035
|
+
if (!n) {
|
|
6948
7036
|
q("[capsule] No capsule plugin registered — capsule disabled");
|
|
6949
7037
|
return;
|
|
6950
7038
|
}
|
|
6951
|
-
|
|
6952
|
-
|
|
7039
|
+
n.init(e, {
|
|
7040
|
+
getToken: or,
|
|
7041
|
+
apiEndpoint: t
|
|
7042
|
+
}), q("[capsule] DcaClient initialized"), window.addEventListener(J.AUTH_INITIALIZED, () => {
|
|
7043
|
+
ju();
|
|
6953
7044
|
});
|
|
6954
7045
|
}
|
|
6955
|
-
async function
|
|
6956
|
-
let e =
|
|
7046
|
+
async function ju() {
|
|
7047
|
+
let e = Du();
|
|
6957
7048
|
if (!e) return null;
|
|
6958
7049
|
let t = !1;
|
|
6959
7050
|
try {
|
|
6960
|
-
t = await
|
|
7051
|
+
t = await ar();
|
|
6961
7052
|
} catch (e) {
|
|
6962
|
-
return q(`[capsule] isAuthenticated error: ${e}`),
|
|
7053
|
+
return q(`[capsule] isAuthenticated error: ${e}`), Mu(), null;
|
|
6963
7054
|
}
|
|
6964
|
-
if (!t) return q("[capsule] User not authenticated — skipping unlock"),
|
|
7055
|
+
if (!t) return q("[capsule] User not authenticated — skipping unlock"), Mu(), null;
|
|
6965
7056
|
try {
|
|
6966
|
-
if (!await
|
|
7057
|
+
if (!await yl()) return q("[capsule] No access — skipping unlock"), Mu(), null;
|
|
6967
7058
|
} catch {}
|
|
6968
7059
|
try {
|
|
6969
7060
|
let t = await e.processPage();
|
|
6970
7061
|
return t && q(`[capsule] Decrypted ${Object.keys(t).length} content item(s)`), t;
|
|
6971
7062
|
} catch (e) {
|
|
6972
|
-
return q(`[capsule] Failed to process page: ${e}`),
|
|
7063
|
+
return q(`[capsule] Failed to process page: ${e}`), Mu(), null;
|
|
6973
7064
|
}
|
|
6974
7065
|
}
|
|
6975
|
-
function
|
|
6976
|
-
let e = document.querySelectorAll("script.dca-
|
|
7066
|
+
function Mu() {
|
|
7067
|
+
let e = document.querySelectorAll("script.dca-manifest");
|
|
6977
7068
|
for (let t of e) {
|
|
6978
7069
|
let e = t.closest("article[publisher-content-id]");
|
|
6979
7070
|
if (!e || e.querySelector("sesamy-paywall")) continue;
|
|
@@ -6990,55 +7081,55 @@ function Du() {
|
|
|
6990
7081
|
e.appendChild(n), q(`[capsule] Injected paywall for ${r}`);
|
|
6991
7082
|
}
|
|
6992
7083
|
}
|
|
6993
|
-
function
|
|
6994
|
-
|
|
6995
|
-
for (let t of e) for (let e of t.addedNodes) if (e instanceof HTMLElement && (e.matches?.("script.dca-
|
|
6996
|
-
|
|
7084
|
+
function Nu() {
|
|
7085
|
+
Ou || typeof MutationObserver > "u" || typeof document > "u" || !document.body || (Ou = new MutationObserver((e) => {
|
|
7086
|
+
for (let t of e) for (let e of t.addedNodes) if (e instanceof HTMLElement && (e.matches?.("script.dca-manifest") || e.querySelector?.("script.dca-manifest"))) {
|
|
7087
|
+
ju();
|
|
6997
7088
|
return;
|
|
6998
7089
|
}
|
|
6999
|
-
}),
|
|
7090
|
+
}), Ou.observe(document.body, {
|
|
7000
7091
|
childList: !0,
|
|
7001
7092
|
subtree: !0
|
|
7002
7093
|
}), q("[capsule] DCA MutationObserver started"));
|
|
7003
7094
|
}
|
|
7004
7095
|
//#endregion
|
|
7005
7096
|
//#region src/services/diagnostics/index.ts
|
|
7006
|
-
var
|
|
7097
|
+
var Pu = [
|
|
7007
7098
|
"sesamy",
|
|
7008
7099
|
"__sesamy",
|
|
7009
7100
|
"__anon_id",
|
|
7010
7101
|
"auth0",
|
|
7011
7102
|
"a0",
|
|
7012
7103
|
"_legacy_auth0"
|
|
7013
|
-
],
|
|
7104
|
+
], Fu = [
|
|
7014
7105
|
"access_token",
|
|
7015
7106
|
"id_token",
|
|
7016
7107
|
"refresh_token",
|
|
7017
7108
|
"token"
|
|
7018
7109
|
];
|
|
7019
|
-
function
|
|
7110
|
+
function Iu(e) {
|
|
7020
7111
|
let t = e.split(".");
|
|
7021
7112
|
return t.length === 3 ? `${t[0]}.${t[1]}.[REDACTED]` : e;
|
|
7022
7113
|
}
|
|
7023
|
-
function
|
|
7114
|
+
function Lu(e) {
|
|
7024
7115
|
let t = e.toLowerCase();
|
|
7025
|
-
return
|
|
7116
|
+
return Fu.some((e) => t.includes(e));
|
|
7026
7117
|
}
|
|
7027
|
-
function
|
|
7118
|
+
function Ru(e) {
|
|
7028
7119
|
let t = e.split(".");
|
|
7029
7120
|
return t.length === 3 && t.every((e) => e.length > 0);
|
|
7030
7121
|
}
|
|
7031
|
-
function
|
|
7122
|
+
function zu(e) {
|
|
7032
7123
|
let t = [];
|
|
7033
7124
|
for (let n = 0; n < e.length; n++) {
|
|
7034
7125
|
let r = e.key(n);
|
|
7035
|
-
if (r &&
|
|
7126
|
+
if (r && Pu.some((e) => r.toLowerCase().startsWith(e.toLowerCase()))) {
|
|
7036
7127
|
let n = e.getItem(r) || "", i = !1;
|
|
7037
|
-
(
|
|
7128
|
+
(Lu(r) || Ru(n)) && (n = Iu(n), i = !0);
|
|
7038
7129
|
try {
|
|
7039
7130
|
let e = JSON.parse(n);
|
|
7040
7131
|
if (typeof e == "object" && e) {
|
|
7041
|
-
let t =
|
|
7132
|
+
let t = Bu(e);
|
|
7042
7133
|
t.wasRedacted && (n = JSON.stringify(t.value), i = !0);
|
|
7043
7134
|
}
|
|
7044
7135
|
} catch {}
|
|
@@ -7051,13 +7142,13 @@ function Pu(e) {
|
|
|
7051
7142
|
}
|
|
7052
7143
|
return t;
|
|
7053
7144
|
}
|
|
7054
|
-
function
|
|
7145
|
+
function Bu(e) {
|
|
7055
7146
|
if (e == null) return {
|
|
7056
7147
|
value: e,
|
|
7057
7148
|
wasRedacted: !1
|
|
7058
7149
|
};
|
|
7059
|
-
if (typeof e == "string") return
|
|
7060
|
-
value:
|
|
7150
|
+
if (typeof e == "string") return Ru(e) ? {
|
|
7151
|
+
value: Iu(e),
|
|
7061
7152
|
wasRedacted: !0
|
|
7062
7153
|
} : {
|
|
7063
7154
|
value: e,
|
|
@@ -7067,7 +7158,7 @@ function Fu(e) {
|
|
|
7067
7158
|
let t = !1;
|
|
7068
7159
|
return {
|
|
7069
7160
|
value: e.map((e) => {
|
|
7070
|
-
let n =
|
|
7161
|
+
let n = Bu(e);
|
|
7071
7162
|
return n.wasRedacted && (t = !0), n.value;
|
|
7072
7163
|
}),
|
|
7073
7164
|
wasRedacted: t
|
|
@@ -7075,9 +7166,9 @@ function Fu(e) {
|
|
|
7075
7166
|
}
|
|
7076
7167
|
if (typeof e == "object") {
|
|
7077
7168
|
let t = !1, n = {};
|
|
7078
|
-
for (let [r, i] of Object.entries(e)) if (
|
|
7169
|
+
for (let [r, i] of Object.entries(e)) if (Lu(r) && typeof i == "string") n[r] = Iu(i), t = !0;
|
|
7079
7170
|
else {
|
|
7080
|
-
let e =
|
|
7171
|
+
let e = Bu(i);
|
|
7081
7172
|
e.wasRedacted && (t = !0), n[r] = e.value;
|
|
7082
7173
|
}
|
|
7083
7174
|
return {
|
|
@@ -7090,7 +7181,7 @@ function Fu(e) {
|
|
|
7090
7181
|
wasRedacted: !1
|
|
7091
7182
|
};
|
|
7092
7183
|
}
|
|
7093
|
-
function
|
|
7184
|
+
function Vu() {
|
|
7094
7185
|
let e = navigator;
|
|
7095
7186
|
return {
|
|
7096
7187
|
userAgent: e.userAgent,
|
|
@@ -7113,46 +7204,46 @@ function Iu() {
|
|
|
7113
7204
|
timezoneOffset: (/* @__PURE__ */ new Date()).getTimezoneOffset()
|
|
7114
7205
|
};
|
|
7115
7206
|
}
|
|
7116
|
-
async function
|
|
7117
|
-
await
|
|
7118
|
-
let [e] = await Promise.all([
|
|
7207
|
+
async function Hu() {
|
|
7208
|
+
await Su();
|
|
7209
|
+
let [e] = await Promise.all([du()]), t = fu();
|
|
7119
7210
|
return {
|
|
7120
7211
|
adBlockEnabled: e,
|
|
7121
|
-
incognitoMode:
|
|
7212
|
+
incognitoMode: xu() ?? !1,
|
|
7122
7213
|
inAppBrowser: t.isInAppBrowser
|
|
7123
7214
|
};
|
|
7124
7215
|
}
|
|
7125
|
-
async function
|
|
7216
|
+
async function Uu(e) {
|
|
7126
7217
|
let t = [], n = {
|
|
7127
7218
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7128
|
-
sdkVersion:
|
|
7219
|
+
sdkVersion: uc,
|
|
7129
7220
|
clientId: e.clientId,
|
|
7130
7221
|
fallbackId: e.fallbackId
|
|
7131
7222
|
};
|
|
7132
7223
|
n.pageUrl = window.location.href, n.pageTitle = document.title;
|
|
7133
7224
|
try {
|
|
7134
|
-
n.browser =
|
|
7225
|
+
n.browser = Vu();
|
|
7135
7226
|
} catch (e) {
|
|
7136
7227
|
t.push(`Browser info collection failed: ${e.message}`);
|
|
7137
7228
|
}
|
|
7138
7229
|
try {
|
|
7139
|
-
n.detection = await
|
|
7230
|
+
n.detection = await Hu();
|
|
7140
7231
|
} catch (e) {
|
|
7141
7232
|
t.push(`Detection collection failed: ${e.message}`);
|
|
7142
7233
|
}
|
|
7143
7234
|
try {
|
|
7144
|
-
n.localStorage =
|
|
7235
|
+
n.localStorage = zu(localStorage);
|
|
7145
7236
|
} catch (e) {
|
|
7146
7237
|
t.push(`LocalStorage collection failed: ${e.message}`);
|
|
7147
7238
|
}
|
|
7148
7239
|
try {
|
|
7149
|
-
n.sessionStorage =
|
|
7240
|
+
n.sessionStorage = zu(sessionStorage);
|
|
7150
7241
|
} catch (e) {
|
|
7151
7242
|
t.push(`SessionStorage collection failed: ${e.message}`);
|
|
7152
7243
|
}
|
|
7153
|
-
if (await
|
|
7244
|
+
if (await ar()) {
|
|
7154
7245
|
try {
|
|
7155
|
-
let e = await
|
|
7246
|
+
let e = await or(!1);
|
|
7156
7247
|
if (e) {
|
|
7157
7248
|
let t = e.split(".");
|
|
7158
7249
|
t.length >= 2 && (n.userId = JSON.parse(atob(t[1])).sub);
|
|
@@ -7188,10 +7279,10 @@ async function Ru(e) {
|
|
|
7188
7279
|
}
|
|
7189
7280
|
return t.length > 0 && (n.errors = t), n;
|
|
7190
7281
|
}
|
|
7191
|
-
async function
|
|
7192
|
-
let r = `${
|
|
7193
|
-
if (await
|
|
7194
|
-
let e = await
|
|
7282
|
+
async function Wu(e, t, n) {
|
|
7283
|
+
let r = `${Mi("api2", t)}/diagnostics`, i = { "Content-Type": "application/json" };
|
|
7284
|
+
if (await ar()) try {
|
|
7285
|
+
let e = await or(!1);
|
|
7195
7286
|
e && (i.Authorization = `Bearer ${e}`);
|
|
7196
7287
|
} catch {}
|
|
7197
7288
|
if (!i.Authorization && n) {
|
|
@@ -7212,11 +7303,11 @@ async function zu(e, t, n) {
|
|
|
7212
7303
|
//#endregion
|
|
7213
7304
|
//#region src/handlers/user-diagnostics.ts
|
|
7214
7305
|
zn();
|
|
7215
|
-
var
|
|
7216
|
-
function
|
|
7306
|
+
var Gu = "user-diagnostics", Ku = "diagnostics-id", qu = "\n .sesamy-diagnostics-modal {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;\n background: white;\n border-radius: 12px;\n padding: 24px;\n max-width: 400px;\n width: 90vw;\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);\n text-align: center;\n }\n\n .sesamy-diagnostics-modal h2 {\n margin: 0 0 12px;\n font-size: 20px;\n font-weight: 600;\n color: #1a1a1a;\n }\n\n .sesamy-diagnostics-modal p {\n margin: 0 0 20px;\n color: #666;\n font-size: 14px;\n line-height: 1.5;\n }\n\n .sesamy-diagnostics-modal .buttons {\n display: flex;\n gap: 12px;\n justify-content: center;\n }\n\n .sesamy-diagnostics-modal button {\n padding: 10px 20px;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n border: none;\n }\n\n .sesamy-diagnostics-modal .btn-primary {\n background: #2563eb;\n color: white;\n }\n\n .sesamy-diagnostics-modal .btn-primary:hover {\n background: #1d4ed8;\n }\n\n .sesamy-diagnostics-modal .btn-primary:disabled {\n background: #93c5fd;\n cursor: not-allowed;\n }\n\n .sesamy-diagnostics-modal .btn-secondary {\n background: #f3f4f6;\n color: #374151;\n }\n\n .sesamy-diagnostics-modal .btn-secondary:hover {\n background: #e5e7eb;\n }\n\n .sesamy-diagnostics-modal .status {\n margin-top: 16px;\n font-size: 13px;\n }\n\n .sesamy-diagnostics-modal .status.success {\n color: #059669;\n }\n\n .sesamy-diagnostics-modal .status.error {\n color: #dc2626;\n }\n\n .sesamy-diagnostics-modal .status.loading {\n color: #6b7280;\n }\n\n .sesamy-diagnostics-modal .spinner {\n display: inline-block;\n width: 14px;\n height: 14px;\n border: 2px solid #e5e7eb;\n border-top-color: #2563eb;\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n margin-right: 8px;\n vertical-align: middle;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n";
|
|
7307
|
+
function Ju() {
|
|
7217
7308
|
let e = document.createElement("div");
|
|
7218
7309
|
return e.className = "sesamy-diagnostics-modal", e.innerHTML = `
|
|
7219
|
-
<style>${
|
|
7310
|
+
<style>${qu}</style>
|
|
7220
7311
|
<h2>Send Diagnostics</h2>
|
|
7221
7312
|
<p>
|
|
7222
7313
|
Our support team has requested diagnostic information to help troubleshoot your issue.
|
|
@@ -7229,9 +7320,9 @@ function Uu() {
|
|
|
7229
7320
|
<div class="status" style="display: none;"></div>
|
|
7230
7321
|
`, e;
|
|
7231
7322
|
}
|
|
7232
|
-
function
|
|
7323
|
+
function Yu(e) {
|
|
7233
7324
|
return new Promise((t) => {
|
|
7234
|
-
let n =
|
|
7325
|
+
let n = Ju(), { close: r } = xl(n, {
|
|
7235
7326
|
closeOnBackdropClick: !1,
|
|
7236
7327
|
closeOnEscape: !0
|
|
7237
7328
|
}), i = n.querySelector("[data-action=\"cancel\"]"), a = n.querySelector("[data-action=\"send\"]"), o = n.querySelector(".status"), s = (e, t) => {
|
|
@@ -7242,9 +7333,9 @@ function Wu(e) {
|
|
|
7242
7333
|
}), a.addEventListener("click", async () => {
|
|
7243
7334
|
a.disabled = !0, i.disabled = !0, s("Collecting diagnostics...", "loading");
|
|
7244
7335
|
try {
|
|
7245
|
-
let n = await
|
|
7336
|
+
let n = await Uu(e);
|
|
7246
7337
|
s("Sending diagnostics...", "loading");
|
|
7247
|
-
let i = await
|
|
7338
|
+
let i = await Wu(n, e.environment, e.clientId);
|
|
7248
7339
|
s("Diagnostics sent successfully!", "success"), setTimeout(() => {
|
|
7249
7340
|
r(), t({
|
|
7250
7341
|
sent: !0,
|
|
@@ -7257,60 +7348,60 @@ function Wu(e) {
|
|
|
7257
7348
|
});
|
|
7258
7349
|
});
|
|
7259
7350
|
}
|
|
7260
|
-
async function
|
|
7351
|
+
async function Xu(e) {
|
|
7261
7352
|
let t = new URLSearchParams(window.location.search);
|
|
7262
|
-
if (t.get(
|
|
7263
|
-
let n = t.get(
|
|
7353
|
+
if (t.get(Gu)?.toLowerCase() !== "true") return;
|
|
7354
|
+
let n = t.get(Ku);
|
|
7264
7355
|
n && (e.fallbackId = n), q("User diagnostics requested via query parameter");
|
|
7265
7356
|
let r = new URL(window.location.href);
|
|
7266
|
-
r.searchParams.delete(
|
|
7267
|
-
let i = await
|
|
7357
|
+
r.searchParams.delete(Gu), r.searchParams.delete(Ku), window.history.replaceState(null, "", r);
|
|
7358
|
+
let i = await Yu(e);
|
|
7268
7359
|
i.sent ? q(`Diagnostics sent with ID: ${i.id}`) : q("User cancelled diagnostics");
|
|
7269
7360
|
}
|
|
7270
|
-
async function
|
|
7271
|
-
return
|
|
7361
|
+
async function Zu(e) {
|
|
7362
|
+
return Yu(e);
|
|
7272
7363
|
}
|
|
7273
7364
|
//#endregion
|
|
7274
7365
|
//#region src/javascript-api.ts
|
|
7275
7366
|
zn();
|
|
7276
|
-
function
|
|
7277
|
-
let { autoOnboardProduct: t, bills: n, checkouts: r, contracts: i, deleteTag: a, deleteTally: o, entitlements: s, generateLink: c, getEntitlements: l, getFulfillments: u, getProfile: d, getProxyContent: f, getSubscriptions: p, getTags: m, getTally: h, getTallies: g, getTransaction: _, hasAccess: v, isSpotifyLinked: y, linkSpotify: b, openHostedAccountPage: x, paywalls: S, paymentIssues: C, products: w, pushTally: T, requestDelivery: E, setTag: D, transactions: O, unlinkSpotify: k, updateProfile: A, userMetadata: j, vendor: M } =
|
|
7278
|
-
analytics: { track:
|
|
7367
|
+
function Qu(e) {
|
|
7368
|
+
let { autoOnboardProduct: t, bills: n, checkouts: r, contracts: i, deleteTag: a, deleteTally: o, entitlements: s, generateLink: c, getEntitlements: l, getFulfillments: u, getProfile: d, getProxyContent: f, getSubscriptions: p, getTags: m, getTally: h, getTallies: g, getTransaction: _, hasAccess: v, isSpotifyLinked: y, linkSpotify: b, openHostedAccountPage: x, paywalls: S, paymentIssues: C, products: w, pushTally: T, requestDelivery: E, setTag: D, transactions: O, unlinkSpotify: k, updateProfile: A, userMetadata: j, vendor: M } = lu(e), N = () => C.list(), P = {
|
|
7369
|
+
analytics: { track: nu },
|
|
7279
7370
|
attribution: {
|
|
7280
|
-
get:
|
|
7281
|
-
set:
|
|
7371
|
+
get: sa,
|
|
7372
|
+
set: ca
|
|
7282
7373
|
},
|
|
7283
7374
|
auth: {
|
|
7284
7375
|
getUser: d,
|
|
7285
|
-
getTokenSilently:
|
|
7286
|
-
isAuthenticated:
|
|
7287
|
-
loginWithRedirect:
|
|
7288
|
-
loginWithPopup:
|
|
7289
|
-
login:
|
|
7290
|
-
logout:
|
|
7291
|
-
setToken:
|
|
7376
|
+
getTokenSilently: or,
|
|
7377
|
+
isAuthenticated: ar,
|
|
7378
|
+
loginWithRedirect: lr,
|
|
7379
|
+
loginWithPopup: ur,
|
|
7380
|
+
login: cr,
|
|
7381
|
+
logout: dr,
|
|
7382
|
+
setToken: fr
|
|
7292
7383
|
},
|
|
7293
7384
|
bills: n,
|
|
7294
7385
|
browser: {
|
|
7295
|
-
detectAdblock:
|
|
7296
|
-
isInAppBrowser:
|
|
7297
|
-
isIncognito:
|
|
7386
|
+
detectAdblock: du,
|
|
7387
|
+
isInAppBrowser: fu,
|
|
7388
|
+
isIncognito: xu
|
|
7298
7389
|
},
|
|
7299
7390
|
checkouts: r,
|
|
7300
|
-
clearCache:
|
|
7391
|
+
clearCache: ni,
|
|
7301
7392
|
content: {
|
|
7302
|
-
list:
|
|
7303
|
-
get:
|
|
7304
|
-
getLanguage:
|
|
7305
|
-
hasAccess:
|
|
7306
|
-
unlock:
|
|
7307
|
-
getPropertyFromHTML:
|
|
7308
|
-
showModal:
|
|
7309
|
-
showNotificationBar:
|
|
7393
|
+
list: _l,
|
|
7394
|
+
get: vl,
|
|
7395
|
+
getLanguage: Ni,
|
|
7396
|
+
hasAccess: yl,
|
|
7397
|
+
unlock: bl,
|
|
7398
|
+
getPropertyFromHTML: gl,
|
|
7399
|
+
showModal: xl,
|
|
7400
|
+
showNotificationBar: Sl
|
|
7310
7401
|
},
|
|
7311
7402
|
contracts: i,
|
|
7312
7403
|
diagnostics: {
|
|
7313
|
-
send: (t) =>
|
|
7404
|
+
send: (t) => Zu({
|
|
7314
7405
|
clientId: e.clientId || e.vendorId,
|
|
7315
7406
|
environment: e.environment,
|
|
7316
7407
|
fallbackId: t,
|
|
@@ -7320,7 +7411,7 @@ function qu(e) {
|
|
|
7320
7411
|
getTags: () => m(),
|
|
7321
7412
|
getTallies: () => g()
|
|
7322
7413
|
}),
|
|
7323
|
-
collect: (t) =>
|
|
7414
|
+
collect: (t) => Uu({
|
|
7324
7415
|
clientId: e.clientId || e.vendorId,
|
|
7325
7416
|
environment: e.environment,
|
|
7326
7417
|
fallbackId: t,
|
|
@@ -7346,17 +7437,17 @@ function qu(e) {
|
|
|
7346
7437
|
},
|
|
7347
7438
|
hasAccess: v,
|
|
7348
7439
|
list: l,
|
|
7349
|
-
signedLinks:
|
|
7440
|
+
signedLinks: ta
|
|
7350
7441
|
},
|
|
7351
7442
|
events: {
|
|
7352
|
-
emit:
|
|
7353
|
-
cancel:
|
|
7443
|
+
emit: Cu,
|
|
7444
|
+
cancel: wu
|
|
7354
7445
|
},
|
|
7355
7446
|
flags: {
|
|
7356
|
-
get:
|
|
7357
|
-
set:
|
|
7358
|
-
list:
|
|
7359
|
-
delete:
|
|
7447
|
+
get: ou,
|
|
7448
|
+
set: au,
|
|
7449
|
+
list: cu,
|
|
7450
|
+
delete: su
|
|
7360
7451
|
},
|
|
7361
7452
|
fulfillments: {
|
|
7362
7453
|
list: u,
|
|
@@ -7364,8 +7455,8 @@ function qu(e) {
|
|
|
7364
7455
|
},
|
|
7365
7456
|
generateLink: c,
|
|
7366
7457
|
getPaymentIssues: N,
|
|
7367
|
-
getVersion:
|
|
7368
|
-
isReady: () =>
|
|
7458
|
+
getVersion: $u,
|
|
7459
|
+
isReady: () => Pd,
|
|
7369
7460
|
log: q,
|
|
7370
7461
|
paywalls: S,
|
|
7371
7462
|
paymentIssues: C,
|
|
@@ -7400,25 +7491,25 @@ function qu(e) {
|
|
|
7400
7491
|
},
|
|
7401
7492
|
userMetadata: j,
|
|
7402
7493
|
capsule: {
|
|
7403
|
-
getClient: () =>
|
|
7404
|
-
processPage:
|
|
7494
|
+
getClient: () => ku(),
|
|
7495
|
+
processPage: ju
|
|
7405
7496
|
},
|
|
7406
7497
|
consent: {
|
|
7407
|
-
get:
|
|
7408
|
-
set:
|
|
7409
|
-
has:
|
|
7498
|
+
get: Yi,
|
|
7499
|
+
set: Zi,
|
|
7500
|
+
has: Xi
|
|
7410
7501
|
},
|
|
7411
7502
|
vendor: M,
|
|
7412
|
-
setToken:
|
|
7503
|
+
setToken: fr
|
|
7413
7504
|
};
|
|
7414
7505
|
return e.namespace && typeof window < "u" && (window[e.namespace] = P), P;
|
|
7415
7506
|
}
|
|
7416
|
-
function
|
|
7417
|
-
return
|
|
7507
|
+
function $u() {
|
|
7508
|
+
return uc;
|
|
7418
7509
|
}
|
|
7419
7510
|
//#endregion
|
|
7420
7511
|
//#region src/services/transform/gradient.ts
|
|
7421
|
-
function
|
|
7512
|
+
function ed(e, t) {
|
|
7422
7513
|
e.style.position = "relative", e.style.height = "200px", e.style.overflow = "hidden";
|
|
7423
7514
|
let n = 0, r = Array.from(e.children);
|
|
7424
7515
|
for (let e of r) {
|
|
@@ -7441,7 +7532,7 @@ function Yu(e, t) {
|
|
|
7441
7532
|
}
|
|
7442
7533
|
//#endregion
|
|
7443
7534
|
//#region src/services/transform/helpers/fetch-content.ts
|
|
7444
|
-
async function
|
|
7535
|
+
async function td(e) {
|
|
7445
7536
|
try {
|
|
7446
7537
|
let t = await fetch(e);
|
|
7447
7538
|
return t.ok ? await t.text() : (console.error(`Failed to fetch content from ${e}: ${t.statusText}`), null);
|
|
@@ -7451,13 +7542,13 @@ async function Xu(e) {
|
|
|
7451
7542
|
}
|
|
7452
7543
|
//#endregion
|
|
7453
7544
|
//#region src/services/transform/helpers/get-content.ts
|
|
7454
|
-
async function
|
|
7545
|
+
async function nd(e) {
|
|
7455
7546
|
if (e.contentType === "selector" && e.content) {
|
|
7456
7547
|
let t = document.querySelector(e.content);
|
|
7457
7548
|
if (t) return t.innerHTML;
|
|
7458
7549
|
console.warn(`Source element for selector '${e.content}' not found`);
|
|
7459
7550
|
} else if (e.contentType === "url" && e.content) {
|
|
7460
|
-
let t = await
|
|
7551
|
+
let t = await td(e.content);
|
|
7461
7552
|
if (t) return t;
|
|
7462
7553
|
console.warn(`Failed to fetch content from URL '${e.content}'`);
|
|
7463
7554
|
} else if (e.content) return e.content;
|
|
@@ -7465,8 +7556,8 @@ async function Zu(e) {
|
|
|
7465
7556
|
}
|
|
7466
7557
|
//#endregion
|
|
7467
7558
|
//#region src/services/transform/insert.ts
|
|
7468
|
-
async function
|
|
7469
|
-
let n = t.insertionPoint || "inside", r = await
|
|
7559
|
+
async function rd(e, t) {
|
|
7560
|
+
let n = t.insertionPoint || "inside", r = await nd(t);
|
|
7470
7561
|
switch (n) {
|
|
7471
7562
|
case "before":
|
|
7472
7563
|
e.insertAdjacentHTML("beforebegin", r);
|
|
@@ -7481,38 +7572,38 @@ async function Qu(e, t) {
|
|
|
7481
7572
|
}
|
|
7482
7573
|
//#endregion
|
|
7483
7574
|
//#region src/services/transform/replace.ts
|
|
7484
|
-
async function
|
|
7485
|
-
e.innerHTML = await
|
|
7575
|
+
async function id(e, t) {
|
|
7576
|
+
e.innerHTML = await nd(t);
|
|
7486
7577
|
}
|
|
7487
7578
|
//#endregion
|
|
7488
7579
|
//#region src/services/transform/wrap.ts
|
|
7489
|
-
async function
|
|
7490
|
-
e.innerHTML = (await
|
|
7580
|
+
async function ad(e, t) {
|
|
7581
|
+
e.innerHTML = (await nd(t)).replace("${content}", e.innerHTML);
|
|
7491
7582
|
}
|
|
7492
7583
|
//#endregion
|
|
7493
7584
|
//#region src/services/transform/index.ts
|
|
7494
|
-
async function
|
|
7495
|
-
e &&
|
|
7496
|
-
let e = await
|
|
7585
|
+
async function od({ enabled: e = !1, rules: t }) {
|
|
7586
|
+
e && Bc(async () => {
|
|
7587
|
+
let e = await ar(), n = window.location.href;
|
|
7497
7588
|
for (let r of t) {
|
|
7498
7589
|
let t = document.querySelectorAll(r.selector);
|
|
7499
7590
|
if (!(r.path && !new RegExp(r.path).test(n))) for (let n of t) {
|
|
7500
7591
|
let t = n;
|
|
7501
7592
|
if (!(r.authenticated !== void 0 && r.authenticated !== e)) switch (r.transform) {
|
|
7502
7593
|
case "insert":
|
|
7503
|
-
await
|
|
7594
|
+
await rd(t, r);
|
|
7504
7595
|
break;
|
|
7505
7596
|
case "replace":
|
|
7506
|
-
await
|
|
7597
|
+
await id(t, r);
|
|
7507
7598
|
break;
|
|
7508
7599
|
case "remove":
|
|
7509
7600
|
n.remove();
|
|
7510
7601
|
break;
|
|
7511
7602
|
case "wrap":
|
|
7512
|
-
await
|
|
7603
|
+
await ad(t, r);
|
|
7513
7604
|
break;
|
|
7514
7605
|
case "gradient":
|
|
7515
|
-
|
|
7606
|
+
ed(t, r);
|
|
7516
7607
|
break;
|
|
7517
7608
|
default: console.warn(`Unknown transform type: ${r.transform}`);
|
|
7518
7609
|
}
|
|
@@ -7522,28 +7613,28 @@ async function td({ enabled: e = !1, rules: t }) {
|
|
|
7522
7613
|
}
|
|
7523
7614
|
//#endregion
|
|
7524
7615
|
//#region src/handlers/token.ts
|
|
7525
|
-
var
|
|
7526
|
-
function
|
|
7527
|
-
let e = new URLSearchParams(window.location.hash.substring(1)), t = e.get(
|
|
7616
|
+
var sd = "access_token";
|
|
7617
|
+
function cd() {
|
|
7618
|
+
let e = new URLSearchParams(window.location.hash.substring(1)), t = e.get(sd);
|
|
7528
7619
|
if (t) {
|
|
7529
|
-
|
|
7620
|
+
fr(t);
|
|
7530
7621
|
let n = new URL(window.location.href);
|
|
7531
|
-
e.delete(
|
|
7622
|
+
e.delete(sd), n.hash = e.toString(), window.history.replaceState(null, "", n);
|
|
7532
7623
|
}
|
|
7533
7624
|
}
|
|
7534
7625
|
//#endregion
|
|
7535
7626
|
//#region src/handlers/force-refresh.ts
|
|
7536
|
-
var
|
|
7537
|
-
function
|
|
7538
|
-
let e = new URLSearchParams(window.location.search), t = e.get(
|
|
7627
|
+
var ld = "sesamy-refresh", ud = "force-refetch-entitlements";
|
|
7628
|
+
function dd() {
|
|
7629
|
+
let e = new URLSearchParams(window.location.search), t = e.get(ud), n = e.get(ld);
|
|
7539
7630
|
if (t !== null || n !== null) {
|
|
7540
7631
|
let t = new URL(window.location.href);
|
|
7541
|
-
e.delete(
|
|
7632
|
+
e.delete(ud), e.delete(ld), t.search = e.toString(), ni(), window.history.replaceState(null, "", t);
|
|
7542
7633
|
}
|
|
7543
7634
|
}
|
|
7544
7635
|
//#endregion
|
|
7545
7636
|
//#region src/utils/jwt.ts
|
|
7546
|
-
function
|
|
7637
|
+
function fd(e) {
|
|
7547
7638
|
if (!e || typeof e != "string") throw Error("Invalid token: token must be a non-empty string");
|
|
7548
7639
|
let t = e.split(".");
|
|
7549
7640
|
if (t.length !== 3 && t.length !== 2) throw Error("Invalid JWT format: token must have 2 or 3 parts separated by dots");
|
|
@@ -7564,7 +7655,7 @@ function sd(e) {
|
|
|
7564
7655
|
//#endregion
|
|
7565
7656
|
//#region src/handlers/signed-links.ts
|
|
7566
7657
|
zn();
|
|
7567
|
-
function
|
|
7658
|
+
function pd(e) {
|
|
7568
7659
|
try {
|
|
7569
7660
|
let t = e.lastIndexOf(".");
|
|
7570
7661
|
if (t === -1) return {
|
|
@@ -7597,7 +7688,7 @@ function cd(e) {
|
|
|
7597
7688
|
};
|
|
7598
7689
|
}
|
|
7599
7690
|
}
|
|
7600
|
-
function
|
|
7691
|
+
function md(e, t) {
|
|
7601
7692
|
let n = /* @__PURE__ */ new Date(e.exp * 1e3);
|
|
7602
7693
|
return {
|
|
7603
7694
|
id: e.s?.toString() || "",
|
|
@@ -7614,7 +7705,7 @@ function ld(e, t) {
|
|
|
7614
7705
|
updatedAt: (/* @__PURE__ */ new Date(e.iat * 1e3)).toISOString()
|
|
7615
7706
|
};
|
|
7616
7707
|
}
|
|
7617
|
-
function
|
|
7708
|
+
function hd(e, t) {
|
|
7618
7709
|
let n = /* @__PURE__ */ new Date(e.exp * 1e3), r = e.meta;
|
|
7619
7710
|
return {
|
|
7620
7711
|
id: e.tid,
|
|
@@ -7631,76 +7722,76 @@ function ud(e, t) {
|
|
|
7631
7722
|
updatedAt: (/* @__PURE__ */ new Date(e.iat * 1e3)).toISOString()
|
|
7632
7723
|
};
|
|
7633
7724
|
}
|
|
7634
|
-
function
|
|
7725
|
+
function gd() {
|
|
7635
7726
|
let e = new URLSearchParams(window.location.search), t = e.get("sesamy_token") || e.get("sesamy-token") || e.get("token");
|
|
7636
7727
|
if (t) try {
|
|
7637
|
-
let e =
|
|
7638
|
-
e.valid && !e.expired ?
|
|
7728
|
+
let e = pd(t);
|
|
7729
|
+
e.valid && !e.expired ? na(hd(e.payload, t)) : e.valid ? e.expired && q("Share token has expired") : na(md(fd(t), t));
|
|
7639
7730
|
} catch (e) {
|
|
7640
7731
|
q(`Failed to extract signed link ${e}`);
|
|
7641
7732
|
}
|
|
7642
7733
|
}
|
|
7643
|
-
function
|
|
7644
|
-
|
|
7734
|
+
function _d() {
|
|
7735
|
+
gd();
|
|
7645
7736
|
let e = new URL(window.location.href), t = e.search;
|
|
7646
7737
|
e.searchParams.delete("ss"), e.searchParams.delete("se"), e.searchParams.delete("sp"), e.searchParams.delete("so"), e.searchParams.delete("token"), e.searchParams.delete("sesamy-token"), e.searchParams.delete("sesamy_token"), e.search !== t && window.history.replaceState(null, "", e);
|
|
7647
7738
|
}
|
|
7648
7739
|
//#endregion
|
|
7649
7740
|
//#region src/handlers/user.ts
|
|
7650
7741
|
zn();
|
|
7651
|
-
var
|
|
7652
|
-
async function
|
|
7653
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
7742
|
+
var vd = "sesamy-user";
|
|
7743
|
+
async function yd() {
|
|
7744
|
+
let e = new URLSearchParams(window.location.search).get(vd)?.toLowerCase();
|
|
7654
7745
|
if (!e) return;
|
|
7655
|
-
let t = await
|
|
7656
|
-
t?.email === e ? q(`Current user matches sesamy user: ${t?.email} === ${e}`) : (q(`Current user does not match sesamy user: ${t?.email} !== ${e}`),
|
|
7746
|
+
let t = await sr();
|
|
7747
|
+
t?.email === e ? q(`Current user matches sesamy user: ${t?.email} === ${e}`) : (q(`Current user does not match sesamy user: ${t?.email} !== ${e}`), ni(), lr({ authorizationParams: { login_hint: e } }));
|
|
7657
7748
|
let n = new URL(window.location.href);
|
|
7658
|
-
n.searchParams.delete(
|
|
7749
|
+
n.searchParams.delete(vd), window.history.replaceState(null, "", n);
|
|
7659
7750
|
}
|
|
7660
7751
|
zn(), Gn(), Vn();
|
|
7661
|
-
var
|
|
7662
|
-
function
|
|
7663
|
-
let e = new URLSearchParams(window.location.search), t = e.get(
|
|
7752
|
+
var bd = "sesamy-purchase";
|
|
7753
|
+
function xd() {
|
|
7754
|
+
let e = new URLSearchParams(window.location.search), t = e.get(bd);
|
|
7664
7755
|
if (t !== null) {
|
|
7665
7756
|
let n = new URL(window.location.href);
|
|
7666
|
-
e.delete(
|
|
7757
|
+
e.delete(bd), n.search = e.toString(), q(`Purchase ${t}`), Wn(J.PURCHASE, { itemSrc: t }), ni(), window.history.replaceState(null, "", n);
|
|
7667
7758
|
}
|
|
7668
7759
|
}
|
|
7669
7760
|
//#endregion
|
|
7670
7761
|
//#region src/handlers/login.ts
|
|
7671
|
-
var
|
|
7672
|
-
async function
|
|
7762
|
+
var Sd = "sesamy-login", Cd = "sesamy_login";
|
|
7763
|
+
async function wd() {
|
|
7673
7764
|
let e = new URLSearchParams(window.location.search);
|
|
7674
|
-
if (!(e.get(
|
|
7675
|
-
await
|
|
7765
|
+
if (!(e.get(Sd) || e.get(Cd))) return;
|
|
7766
|
+
await ar() || lr();
|
|
7676
7767
|
let t = new URL(window.location.href);
|
|
7677
|
-
t.searchParams.delete(
|
|
7768
|
+
t.searchParams.delete(Sd), window.history.replaceState(null, "", t);
|
|
7678
7769
|
}
|
|
7679
7770
|
//#endregion
|
|
7680
7771
|
//#region src/handlers/debug.ts
|
|
7681
7772
|
Rn();
|
|
7682
|
-
var
|
|
7683
|
-
async function
|
|
7684
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
7773
|
+
var Td = "sesamy-debug";
|
|
7774
|
+
async function Ed() {
|
|
7775
|
+
let e = new URLSearchParams(window.location.search).get(Td)?.toLowerCase();
|
|
7685
7776
|
if (!e) return;
|
|
7686
7777
|
Fn(e === "true");
|
|
7687
7778
|
let t = new URL(window.location.href);
|
|
7688
|
-
t.searchParams.delete(
|
|
7779
|
+
t.searchParams.delete(Td), window.history.replaceState(null, "", t);
|
|
7689
7780
|
}
|
|
7690
7781
|
//#endregion
|
|
7691
7782
|
//#region src/utils/browser.ts
|
|
7692
|
-
function
|
|
7783
|
+
function Dd() {
|
|
7693
7784
|
return typeof window < "u";
|
|
7694
7785
|
}
|
|
7695
7786
|
//#endregion
|
|
7696
7787
|
//#region src/handlers/attribution.ts
|
|
7697
|
-
function
|
|
7788
|
+
function Od() {
|
|
7698
7789
|
if (!document.referrer.length) return;
|
|
7699
7790
|
let e = new URL(document.referrer);
|
|
7700
7791
|
if (!(e.hostname === window.location.hostname || e.hostname.includes("sesamy"))) return console.log("handling referrer attribution:", document.referrer), document.referrer;
|
|
7701
7792
|
}
|
|
7702
|
-
async function
|
|
7703
|
-
if (!
|
|
7793
|
+
async function kd(e) {
|
|
7794
|
+
if (!Dd()) return;
|
|
7704
7795
|
let t = new URLSearchParams(window.location.search), n = {
|
|
7705
7796
|
utmSource: t.get("utm_source") ?? void 0,
|
|
7706
7797
|
utmMedium: t.get("utm_medium") ?? void 0,
|
|
@@ -7708,26 +7799,26 @@ async function wd(e) {
|
|
|
7708
7799
|
utmTerm: t.get("utm_term") ?? void 0,
|
|
7709
7800
|
utmContent: t.get("utm_content") ?? void 0,
|
|
7710
7801
|
ref: t.get("ref") ?? void 0,
|
|
7711
|
-
referrer:
|
|
7802
|
+
referrer: Od()
|
|
7712
7803
|
}, [r] = e.content.list();
|
|
7713
|
-
r?.url && (n.itemSrc = r.url, n.publisherContentId = r.id),
|
|
7804
|
+
r?.url && (n.itemSrc = r.url, n.publisherContentId = r.id), ca(n);
|
|
7714
7805
|
}
|
|
7715
7806
|
//#endregion
|
|
7716
7807
|
//#region src/handlers/login-reload.ts
|
|
7717
7808
|
zn();
|
|
7718
|
-
function
|
|
7809
|
+
function Ad() {
|
|
7719
7810
|
let e = new URLSearchParams(window.location.search), t = !1;
|
|
7720
7811
|
try {
|
|
7721
7812
|
t = !!window.opener && window.opener.location.origin === window.location.origin;
|
|
7722
7813
|
} catch {
|
|
7723
7814
|
t = !1;
|
|
7724
7815
|
}
|
|
7725
|
-
let n = sessionStorage.getItem(
|
|
7726
|
-
!t || n || (sessionStorage.setItem(
|
|
7816
|
+
let n = sessionStorage.getItem(Di) === "true", r = e.has("code") || e.has("error") || e.has("state");
|
|
7817
|
+
!t || n || (sessionStorage.setItem(Di, "true"), r || (q("Reloading page to get query params in incognito browser"), window.location.reload()));
|
|
7727
7818
|
}
|
|
7728
7819
|
//#endregion
|
|
7729
7820
|
//#region src/handlers/links.ts
|
|
7730
|
-
async function
|
|
7821
|
+
async function jd(e) {
|
|
7731
7822
|
let t = (e) => (t) => {
|
|
7732
7823
|
t.preventDefault();
|
|
7733
7824
|
try {
|
|
@@ -7752,7 +7843,7 @@ async function Ed(e) {
|
|
|
7752
7843
|
}
|
|
7753
7844
|
//#endregion
|
|
7754
7845
|
//#region src/handlers/visibility.ts
|
|
7755
|
-
async function
|
|
7846
|
+
async function Md(e) {
|
|
7756
7847
|
let t = await e.auth.isAuthenticated();
|
|
7757
7848
|
try {
|
|
7758
7849
|
document.querySelectorAll(`[sesamy-visibility="${t ? "not-logged-in" : "logged-in"}"]`).forEach((e) => {
|
|
@@ -7766,28 +7857,35 @@ async function Dd(e) {
|
|
|
7766
7857
|
}
|
|
7767
7858
|
//#endregion
|
|
7768
7859
|
//#region src/handlers/locked-content-redirect.ts
|
|
7769
|
-
async function
|
|
7860
|
+
async function Nd(e) {
|
|
7770
7861
|
let t = $("sesamy:locked-content-redirect-url");
|
|
7771
7862
|
if (!t) return;
|
|
7772
7863
|
let [n] = e.content.list();
|
|
7773
7864
|
n && (await e.entitlements.hasAccess(n.url || "", n.pass?.split(",") || []) || (location.href = t));
|
|
7774
7865
|
}
|
|
7775
7866
|
Gn(), Vn(), zn();
|
|
7776
|
-
var
|
|
7777
|
-
async function
|
|
7778
|
-
|
|
7867
|
+
var Pd = !1;
|
|
7868
|
+
async function Fd(e, t, n) {
|
|
7869
|
+
let r = e.auth?.idToken ? {
|
|
7870
|
+
...e,
|
|
7871
|
+
auth: {
|
|
7872
|
+
...e.auth,
|
|
7873
|
+
idToken: "<REDACTED>"
|
|
7874
|
+
}
|
|
7875
|
+
} : e;
|
|
7876
|
+
q(`Init with config: ${JSON.stringify(r)}`);
|
|
7779
7877
|
try {
|
|
7780
|
-
|
|
7878
|
+
Ad(), Qi(e.consent), Yl({
|
|
7781
7879
|
clientId: e.clientId,
|
|
7782
7880
|
environment: e.environment,
|
|
7783
7881
|
...e.analytics
|
|
7784
|
-
}), n && qn(n), await
|
|
7882
|
+
}), n && qn(n), await ir({
|
|
7785
7883
|
clientId: e.clientId,
|
|
7786
7884
|
vendorId: e.vendorId || e.clientId,
|
|
7787
7885
|
organization: e.organization,
|
|
7788
7886
|
environment: e.environment,
|
|
7789
7887
|
...e.auth
|
|
7790
|
-
}), await
|
|
7888
|
+
}), await Vc(), el(e, t), e.capsule?.enabled && (Au(e.capsule, e.api?.endpoint), gd(), e.capsule.autoProcess !== !1 && (await ju(), Nu())), e.transform && await od(e.transform), Su(), Ed(), Xu({
|
|
7791
7889
|
clientId: e.clientId || e.vendorId,
|
|
7792
7890
|
environment: e.environment,
|
|
7793
7891
|
getProfile: () => t.profile.get(),
|
|
@@ -7795,27 +7893,27 @@ async function Ad(e, t, n) {
|
|
|
7795
7893
|
getContracts: () => t.contracts.list(),
|
|
7796
7894
|
getTags: () => t.tags.list(),
|
|
7797
7895
|
getTallies: () => t.tallies.list()
|
|
7798
|
-
}),
|
|
7896
|
+
}), kd(t), cd(), dd(), _d(), await wd(), await yd(), xd(), await Md(t), await jd(t), await Nd(t), Pd = !0, Wn(J.READY, {});
|
|
7799
7897
|
} catch (e) {
|
|
7800
7898
|
q(`Failed to init ${e.message}`);
|
|
7801
7899
|
}
|
|
7802
7900
|
}
|
|
7803
|
-
async function
|
|
7901
|
+
async function Id(e, t) {
|
|
7804
7902
|
q("Initializing Sesamy");
|
|
7805
7903
|
let n = e.api?.namespace || "sesamy";
|
|
7806
|
-
if (
|
|
7904
|
+
if (Dd() && n in window) return q("Sesamy already initialized. This is likely due to a duplicate import"), Pd = !0, window[n];
|
|
7807
7905
|
let r = t?.authPlugin;
|
|
7808
|
-
if (!r && !Jn() &&
|
|
7906
|
+
if (!r && !Jn() && Dd()) {
|
|
7809
7907
|
let e = window;
|
|
7810
7908
|
typeof e.auth0Plugin?.createAuth0Plugin == "function" && (r = e.auth0Plugin.createAuth0Plugin());
|
|
7811
7909
|
}
|
|
7812
7910
|
let i = t?.capsulePlugin;
|
|
7813
|
-
if (!i && !
|
|
7911
|
+
if (!i && !Du() && Dd()) {
|
|
7814
7912
|
let e = window;
|
|
7815
7913
|
typeof e.capsulePlugin?.createCapsulePlugin == "function" && (i = e.capsulePlugin.createCapsulePlugin());
|
|
7816
7914
|
}
|
|
7817
|
-
i &&
|
|
7818
|
-
let a =
|
|
7915
|
+
i && Eu(i);
|
|
7916
|
+
let a = Qu({
|
|
7819
7917
|
clientId: e.clientId,
|
|
7820
7918
|
vendorId: e.vendorId,
|
|
7821
7919
|
environment: e.environment,
|
|
@@ -7823,15 +7921,15 @@ async function jd(e, t) {
|
|
|
7823
7921
|
...e.api,
|
|
7824
7922
|
namespace: n
|
|
7825
7923
|
});
|
|
7826
|
-
return
|
|
7924
|
+
return Dd() ? (e.awaitAllServices ? await Fd(e, a, r) : Fd(e, a, r), a) : (Pd = !0, a);
|
|
7827
7925
|
}
|
|
7828
|
-
if (
|
|
7926
|
+
if (Dd()) {
|
|
7829
7927
|
let e = document.getElementById("sesamy-js");
|
|
7830
7928
|
if (e?.textContent) try {
|
|
7831
|
-
|
|
7929
|
+
Id(JSON.parse(e.textContent));
|
|
7832
7930
|
} catch (e) {
|
|
7833
7931
|
console.error("Failed to parse config", e);
|
|
7834
7932
|
}
|
|
7835
7933
|
}
|
|
7836
7934
|
//#endregion
|
|
7837
|
-
export { J as Events,
|
|
7935
|
+
export { J as Events, hl as clearMetadataCache, ul as getAllLdJson, rl as getAllMetaTags, Yi as getConsent, $c as getContentConfig, ml as getContentMetadata, ku as getDcaClient, ll as getLdJson, Xi as hasConsent, Id as init, Pd as isInitialized, qn as registerAuthPlugin, Eu as registerCapsulePlugin, Zi as setConsent };
|