@wix/bookings 1.0.1791 → 1.0.1793
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/build/cjs/context-booking-checkout.js +1 -1
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-service-addons.js +123 -134
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +16 -6
- package/build/cjs/context-service.js +728 -724
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.js +801 -812
- package/build/cjs/context-services.js.map +1 -1
- package/build/cjs/context-time-slots.js +1300 -1267
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.mjs +1 -1
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-service-addons.mjs +123 -134
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +16 -6
- package/build/es/context-service.mjs +728 -724
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.mjs +801 -812
- package/build/es/context-services.mjs.map +1 -1
- package/build/es/context-time-slots.mjs +1300 -1267
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-service.d.ts +16 -6
- package/build/internal/es/context-service.d.mts +16 -6
- package/context-runtime/context-booking-checkout/runtime.js +2 -2
- package/context-runtime/context-service/runtime.d.ts +16 -6
- package/context-runtime/context-service/runtime.js +2 -2
- package/context-runtime/context-service-addons/runtime.js +2 -2
- package/context-runtime/context-services/runtime.js +3 -3
- package/context-runtime/context-time-slots/runtime.js +3 -3
- package/package.json +3 -3
|
@@ -20,11 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-service-addons.ts
|
|
21
21
|
var context_service_addons_exports = {};
|
|
22
22
|
__export(context_service_addons_exports, {
|
|
23
|
-
ServiceAddOnsContextProvider: () =>
|
|
24
|
-
default: () =>
|
|
25
|
-
injectAccessTokenGetter: () =>
|
|
26
|
-
serviceAddOnsContext: () =>
|
|
27
|
-
useServiceAddOnsContext: () =>
|
|
23
|
+
ServiceAddOnsContextProvider: () => fc,
|
|
24
|
+
default: () => fc,
|
|
25
|
+
injectAccessTokenGetter: () => pc,
|
|
26
|
+
serviceAddOnsContext: () => lc,
|
|
27
|
+
useServiceAddOnsContext: () => uc
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(context_service_addons_exports);
|
|
30
30
|
|
|
@@ -2687,83 +2687,72 @@ function $o() {
|
|
|
2687
2687
|
return (0, import_services_manager_react.useService)(Qo).currency;
|
|
2688
2688
|
}
|
|
2689
2689
|
function es() {
|
|
2690
|
-
return
|
|
2690
|
+
return Xo(Ko)?.currency;
|
|
2691
2691
|
}
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
};
|
|
2696
|
-
let n2 = t2.navigation, r2 = true, i2 = () => queueMicrotask(() => {
|
|
2697
|
-
r2 && e5();
|
|
2698
|
-
});
|
|
2699
|
-
return n2?.addEventListener(`currententrychange`, i2), t2.addEventListener(`popstate`, e5), () => {
|
|
2700
|
-
r2 = false, n2?.removeEventListener(`currententrychange`, i2), t2.removeEventListener(`popstate`, e5);
|
|
2701
|
-
};
|
|
2692
|
+
var ts = /^[A-Z]{3}$/;
|
|
2693
|
+
function ns(e5) {
|
|
2694
|
+
return ts.test(e5) ? typeof Intl.supportedValuesOf != `function` || Intl.supportedValuesOf(`currency`).includes(e5) : false;
|
|
2702
2695
|
}
|
|
2703
|
-
var ns = /^[A-Z]{3}$/;
|
|
2704
2696
|
function rs(e5) {
|
|
2705
|
-
return ns.test(e5) ? typeof Intl.supportedValuesOf != `function` || Intl.supportedValuesOf(`currency`).includes(e5) : false;
|
|
2706
|
-
}
|
|
2707
|
-
function is(e5) {
|
|
2708
2697
|
let t2 = e5?.toUpperCase();
|
|
2709
|
-
return t2 &&
|
|
2698
|
+
return t2 && ns(t2) ? t2 : null;
|
|
2710
2699
|
}
|
|
2711
|
-
function
|
|
2712
|
-
let n2 =
|
|
2713
|
-
return n2 && n2 !==
|
|
2700
|
+
function is(e5, t2) {
|
|
2701
|
+
let n2 = rs(e5);
|
|
2702
|
+
return n2 && n2 !== rs(t2) ? n2 : null;
|
|
2714
2703
|
}
|
|
2715
|
-
function
|
|
2716
|
-
let e5 = (
|
|
2717
|
-
return (0, import_react.useDeferredValue)(
|
|
2704
|
+
function as() {
|
|
2705
|
+
let e5 = es(), t2 = $o();
|
|
2706
|
+
return (0, import_react.useDeferredValue)(is(e5, t2));
|
|
2718
2707
|
}
|
|
2708
|
+
var os = [];
|
|
2719
2709
|
var ss = [];
|
|
2720
|
-
var cs =
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
let r2 = { addOnGroups: ss, selected: cs, isLoading: e5, hasError: t2, toggleAddOn: () => {
|
|
2710
|
+
var cs = `useServiceAddOnsContext must be used within ServiceAddOnsContextProvider`;
|
|
2711
|
+
function ls({ isLoading: e5, hasError: t2, children: n2 }) {
|
|
2712
|
+
let r2 = { addOnGroups: os, selected: ss, isLoading: e5, hasError: t2, toggleAddOn: () => {
|
|
2724
2713
|
}, setAddOnQuantity: () => {
|
|
2725
2714
|
} };
|
|
2726
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2715
|
+
return (0, import_jsx_runtime.jsx)(lc.Provider, { value: r2, children: n2 });
|
|
2727
2716
|
}
|
|
2728
|
-
function
|
|
2729
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2717
|
+
function us({ children: e5 }) {
|
|
2718
|
+
return (0, import_jsx_runtime.jsx)(ls, { isLoading: true, hasError: false, children: e5 });
|
|
2730
2719
|
}
|
|
2731
|
-
function
|
|
2732
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2720
|
+
function ds({ children: e5 }) {
|
|
2721
|
+
return (0, import_jsx_runtime.jsx)(ls, { isLoading: false, hasError: true, children: e5 });
|
|
2733
2722
|
}
|
|
2734
|
-
function
|
|
2723
|
+
function fs(e5) {
|
|
2735
2724
|
if (!e5) return;
|
|
2736
2725
|
let t2 = ``;
|
|
2737
2726
|
return (e5.filename || e5.altText) && (t2 = `/${encodeURIComponent(e5.filename || e5.altText)}`), e5.id ? `wix:image://v1/${e5.id}${t2}#originWidth=${e5.width}&originHeight=${e5.height}` : e5.url;
|
|
2738
2727
|
}
|
|
2739
|
-
var
|
|
2740
|
-
function
|
|
2728
|
+
var ps = [{ path: `addOnGroupsDetails.addOns.mainMedia.image.urlExpirationDate` }];
|
|
2729
|
+
function ms(e5) {
|
|
2741
2730
|
return ai(Object.assign(e5, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
|
|
2742
2731
|
}
|
|
2743
|
-
var
|
|
2744
|
-
function
|
|
2732
|
+
var hs = `@wix/auto_sdk_bookings_services`;
|
|
2733
|
+
function gs(e5) {
|
|
2745
2734
|
function t2({ host: t3 }) {
|
|
2746
|
-
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId`, packageName:
|
|
2735
|
+
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId`, packageName: hs, migrationOptions: { optInTransformResponse: true }, url: ms({ protoPath: `/v2/services/add-on-groups/list-add-on-groups-by-service-id`, data: e5, host: t3 }), data: e5, transformResponse: (e6) => Lr(e6, [{ transformFn: wr, paths: ps }]) };
|
|
2747
2736
|
}
|
|
2748
2737
|
return t2;
|
|
2749
2738
|
}
|
|
2750
|
-
var
|
|
2751
|
-
async function
|
|
2752
|
-
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 =
|
|
2739
|
+
var _s = [{ path: `addOnGroupsDetails.addOns.mainMedia.image` }];
|
|
2740
|
+
async function vs(e5, t2) {
|
|
2741
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = gs(Sr({ serviceId: e5, groupIds: t2?.groupIds }));
|
|
2753
2742
|
r2?.onSiteCall?.();
|
|
2754
2743
|
try {
|
|
2755
2744
|
let e6 = await n2.request(i2);
|
|
2756
|
-
return r2?.onSuccess?.(e6), Cr(Lr(e6.data, [{ transformFn:
|
|
2745
|
+
return r2?.onSuccess?.(e6), Cr(Lr(e6.data, [{ transformFn: fs, paths: _s }]));
|
|
2757
2746
|
} catch (e6) {
|
|
2758
2747
|
let t3 = qr(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { serviceId: `$[0]`, groupIds: `$[1].groupIds` }, singleArgumentUnchanged: false }, [`serviceId`, `options`]);
|
|
2759
2748
|
throw r2?.onError?.(e6), t3;
|
|
2760
2749
|
}
|
|
2761
2750
|
}
|
|
2762
|
-
function
|
|
2763
|
-
return (t2, n2) =>
|
|
2751
|
+
function ys(e5) {
|
|
2752
|
+
return (t2, n2) => vs(t2, n2, { httpClient: e5 });
|
|
2764
2753
|
}
|
|
2765
|
-
var
|
|
2766
|
-
function
|
|
2754
|
+
var bs = ii(ys);
|
|
2755
|
+
function xs(e5, t2) {
|
|
2767
2756
|
let n2 = e5?.value, r2 = e5?.currency;
|
|
2768
2757
|
if (n2 == null || !r2) return null;
|
|
2769
2758
|
let i2 = Number(n2);
|
|
@@ -2771,10 +2760,10 @@ function Ss(e5, t2) {
|
|
|
2771
2760
|
let a2 = i2 % 1 == 0 ? 0 : 2;
|
|
2772
2761
|
return new Intl.NumberFormat(t2, { style: `currency`, currency: r2, currencyDisplay: `symbol`, maximumFractionDigits: a2, minimumFractionDigits: a2 }).format(i2).replace(/\p{Zs}/gu, `\xA0`);
|
|
2773
2762
|
}
|
|
2774
|
-
async function
|
|
2775
|
-
return (await
|
|
2763
|
+
async function Ss(e5) {
|
|
2764
|
+
return (await bs(e5)).addOnGroupsDetails ?? [];
|
|
2776
2765
|
}
|
|
2777
|
-
function
|
|
2766
|
+
function Cs(e5) {
|
|
2778
2767
|
if (!e5) return null;
|
|
2779
2768
|
try {
|
|
2780
2769
|
let { id: t2, url: n2, width: r2, height: i2 } = mr.getImageUrl(e5);
|
|
@@ -2783,64 +2772,64 @@ function ws(e5) {
|
|
|
2783
2772
|
return null;
|
|
2784
2773
|
}
|
|
2785
2774
|
}
|
|
2786
|
-
function
|
|
2775
|
+
function ws(e5, t2) {
|
|
2787
2776
|
let n2 = e5.price?.value == null ? null : Number(e5.price.value);
|
|
2788
|
-
return { addOnId: e5.addOnId ?? null, addOnName: e5.nameTranslated ?? e5.name ?? null, addOnPrice:
|
|
2777
|
+
return { addOnId: e5.addOnId ?? null, addOnName: e5.nameTranslated ?? e5.name ?? null, addOnPrice: xs(e5.price, t2), addOnPriceValue: n2 != null && Number.isFinite(n2) ? n2 : null, addOnCurrency: e5.price?.currency ?? null, durationInMinutes: e5.durationInMinutes ?? null, maxQuantity: e5.maxQuantity ?? null, addOnImage: Cs(e5.mainMedia?.image), isSelected: false, selectedQuantity: 0 };
|
|
2789
2778
|
}
|
|
2790
|
-
function
|
|
2791
|
-
return e5.map((e6) => ({ groupId: e6.groupId ?? null, groupName: e6.groupNameTranslated ?? e6.groupName ?? null, prompt: e6.promptTranslated ?? e6.prompt ?? null, maxNumberOfAddOns: e6.maxNumberOfAddOns ?? null, addOns: (e6.addOns ?? []).map((e7) =>
|
|
2779
|
+
function Ts(e5, t2) {
|
|
2780
|
+
return e5.map((e6) => ({ groupId: e6.groupId ?? null, groupName: e6.groupNameTranslated ?? e6.groupName ?? null, prompt: e6.promptTranslated ?? e6.prompt ?? null, maxNumberOfAddOns: e6.maxNumberOfAddOns ?? null, addOns: (e6.addOns ?? []).map((e7) => ws(e7, t2)), selectedCount: 0, canSelectMore: true }));
|
|
2792
2781
|
}
|
|
2793
|
-
var
|
|
2794
|
-
function
|
|
2782
|
+
var Es = `bookings-uou`;
|
|
2783
|
+
function Ds(e5) {
|
|
2795
2784
|
return e5 ? `:currency-${e5}` : ``;
|
|
2796
2785
|
}
|
|
2797
|
-
function
|
|
2798
|
-
return `${
|
|
2786
|
+
function Os(e5, t2, n2, r2) {
|
|
2787
|
+
return `${Es}:${e5}:addons:${n2}:${r2}${Ds(t2)}`;
|
|
2799
2788
|
}
|
|
2800
|
-
var
|
|
2801
|
-
var
|
|
2802
|
-
var
|
|
2803
|
-
var
|
|
2804
|
-
function
|
|
2789
|
+
var ks = 5e3;
|
|
2790
|
+
var As = 100;
|
|
2791
|
+
var js = `wix-warmup-data`;
|
|
2792
|
+
var Ms = null;
|
|
2793
|
+
function Ns(e5) {
|
|
2805
2794
|
if (typeof document < `u`) try {
|
|
2806
|
-
let t2 = document.getElementById(
|
|
2807
|
-
return t2 ? (
|
|
2795
|
+
let t2 = document.getElementById(js)?.textContent;
|
|
2796
|
+
return t2 ? (Ms?.text !== t2 && (Ms = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Ms.data[e5] ?? void 0) : void 0;
|
|
2808
2797
|
} catch {
|
|
2809
2798
|
return;
|
|
2810
2799
|
}
|
|
2811
2800
|
}
|
|
2812
|
-
var
|
|
2813
|
-
var
|
|
2801
|
+
var Ps = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
2802
|
+
var Fs = Ps();
|
|
2803
|
+
var Is = /* @__PURE__ */ new WeakMap();
|
|
2814
2804
|
var Ls = /* @__PURE__ */ new WeakMap();
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
return t2 || (t2 = Fs(), Ls.set(e5, t2)), t2;
|
|
2805
|
+
function Rs(e5) {
|
|
2806
|
+
if (!e5) return Fs;
|
|
2807
|
+
let t2 = Is.get(e5);
|
|
2808
|
+
return t2 || (t2 = Ps(), Is.set(e5, t2)), t2;
|
|
2820
2809
|
}
|
|
2821
|
-
function
|
|
2810
|
+
function zs({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
2822
2811
|
if (e5 === null) return n2();
|
|
2823
2812
|
if (typeof window > `u`) {
|
|
2824
2813
|
let r3 = () => n2().then((n3) => (t2.set(e5, n3), n3)), { scope: i3 } = t2;
|
|
2825
2814
|
if (!i3) return r3();
|
|
2826
|
-
let a3 =
|
|
2827
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
2815
|
+
let a3 = Ls.get(i3);
|
|
2816
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), Ls.set(i3, a3));
|
|
2828
2817
|
let o3 = a3.get(e5);
|
|
2829
2818
|
if (o3) return o3;
|
|
2830
2819
|
let s3 = r3();
|
|
2831
2820
|
return a3.set(e5, s3), s3.catch(() => a3.delete(e5)), s3;
|
|
2832
2821
|
}
|
|
2833
|
-
let i2 =
|
|
2822
|
+
let i2 = Rs(t2.scope), a2 = Date.now();
|
|
2834
2823
|
for (let [e6, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e6);
|
|
2835
2824
|
let o2 = i2.promises.get(e5);
|
|
2836
2825
|
if (o2 && !r2) return o2.promise;
|
|
2837
2826
|
r2 && i2.invalidatedWarmup.add(e5);
|
|
2838
2827
|
let s2 = !i2.invalidatedWarmup.has(e5);
|
|
2839
2828
|
if (s2) {
|
|
2840
|
-
let t3 =
|
|
2829
|
+
let t3 = Ns(e5);
|
|
2841
2830
|
if (t3 !== void 0) {
|
|
2842
2831
|
let n3 = zo(t3);
|
|
2843
|
-
return i2.promises.set(e5, { promise: n3, expiresAt: a2 +
|
|
2832
|
+
return i2.promises.set(e5, { promise: n3, expiresAt: a2 + ks }), n3;
|
|
2844
2833
|
}
|
|
2845
2834
|
}
|
|
2846
2835
|
let c2 = (async () => {
|
|
@@ -2850,37 +2839,37 @@ function Bs({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2850
2839
|
}
|
|
2851
2840
|
return n2();
|
|
2852
2841
|
})();
|
|
2853
|
-
i2.promises.size >=
|
|
2842
|
+
i2.promises.size >= As && i2.promises.delete(i2.promises.keys().next().value);
|
|
2854
2843
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
2855
2844
|
return i2.promises.set(e5, l2), c2.then(() => {
|
|
2856
|
-
l2.expiresAt = Date.now() +
|
|
2845
|
+
l2.expiresAt = Date.now() + ks;
|
|
2857
2846
|
}, () => {
|
|
2858
2847
|
i2.promises.get(e5) === l2 && i2.promises.delete(e5);
|
|
2859
2848
|
}), c2;
|
|
2860
2849
|
}
|
|
2861
|
-
function
|
|
2862
|
-
return Fo(`service-addons-context-load`, { feature: Mo.serviceAddOns, tags: { serviceId: e5 } },
|
|
2850
|
+
function Bs(e5, t2) {
|
|
2851
|
+
return Fo(`service-addons-context-load`, { feature: Mo.serviceAddOns, tags: { serviceId: e5 } }, Ss(e5)).then((e6) => Ts(e6, t2), (t3) => {
|
|
2863
2852
|
throw Po(t3, { feature: Mo.serviceAddOns, action: `fetch-add-on-groups`, level: `warning`, contexts: { service: { serviceId: e5 } } }), t3;
|
|
2864
2853
|
});
|
|
2865
2854
|
}
|
|
2866
|
-
function
|
|
2867
|
-
return
|
|
2855
|
+
function Vs({ serviceId: e5, locale: t2, language: n2, currency: r2, warmupData: i2 }) {
|
|
2856
|
+
return zs({ key: Os(n2, r2, e5, t2), warmupData: i2, fetchData: () => Bs(e5, t2) });
|
|
2868
2857
|
}
|
|
2869
|
-
var
|
|
2870
|
-
function
|
|
2858
|
+
var Hs = qo(`@wix/site-service-business-logger`);
|
|
2859
|
+
function Us(e5) {
|
|
2871
2860
|
return { evid: 32, src: 16, endpoint: ``, params: e5 };
|
|
2872
2861
|
}
|
|
2873
|
-
var
|
|
2874
|
-
var
|
|
2875
|
-
function
|
|
2876
|
-
let t2 = e5.searchParams.get(
|
|
2862
|
+
var Ws = $(`@wix/site-service-url`);
|
|
2863
|
+
var Gs = `appSectionParams`;
|
|
2864
|
+
function Ks(e5) {
|
|
2865
|
+
let t2 = e5.searchParams.get(Gs);
|
|
2877
2866
|
if (t2 === null) return e5;
|
|
2878
2867
|
let n2 = new URL(e5);
|
|
2879
|
-
n2.searchParams.delete(
|
|
2880
|
-
for (let [e6, r2] of Object.entries(
|
|
2868
|
+
n2.searchParams.delete(Gs);
|
|
2869
|
+
for (let [e6, r2] of Object.entries(qs(t2))) typeof r2 == `string` && !n2.searchParams.has(e6) && n2.searchParams.set(e6, r2);
|
|
2881
2870
|
return n2;
|
|
2882
2871
|
}
|
|
2883
|
-
function
|
|
2872
|
+
function qs(e5) {
|
|
2884
2873
|
try {
|
|
2885
2874
|
let t2 = JSON.parse(e5);
|
|
2886
2875
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
@@ -2888,16 +2877,16 @@ function Js(e5) {
|
|
|
2888
2877
|
return {};
|
|
2889
2878
|
}
|
|
2890
2879
|
}
|
|
2891
|
-
var
|
|
2892
|
-
var
|
|
2880
|
+
var Js = `bookings-uou:url-change`;
|
|
2881
|
+
var Ys = (e5) => {
|
|
2893
2882
|
let t2 = new URL(e5);
|
|
2894
2883
|
return t2.searchParams.sort(), t2.href;
|
|
2895
2884
|
};
|
|
2896
|
-
function
|
|
2885
|
+
function Xs(e5, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
2897
2886
|
let r2 = globalThis.window;
|
|
2898
2887
|
if (!r2?.history) return;
|
|
2899
2888
|
let i2 = new URL(r2.location.href);
|
|
2900
|
-
if (
|
|
2889
|
+
if (Ys(i2) === Ys(e5)) return;
|
|
2901
2890
|
let a2 = { scrollY: r2.scrollY };
|
|
2902
2891
|
if (n2) r2.history.replaceState(a2, ``, e5.href);
|
|
2903
2892
|
else {
|
|
@@ -2908,58 +2897,58 @@ function Zs(e5, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
|
2908
2897
|
return;
|
|
2909
2898
|
}
|
|
2910
2899
|
}
|
|
2911
|
-
r2.dispatchEvent(new Event(
|
|
2900
|
+
r2.dispatchEvent(new Event(Js));
|
|
2912
2901
|
}
|
|
2913
|
-
function
|
|
2902
|
+
function Zs(e5) {
|
|
2914
2903
|
let t2 = globalThis.window;
|
|
2915
|
-
return t2 ? (t2.addEventListener(
|
|
2916
|
-
t2.removeEventListener(
|
|
2904
|
+
return t2 ? (t2.addEventListener(Js, e5), t2.addEventListener(`popstate`, e5), () => {
|
|
2905
|
+
t2.removeEventListener(Js, e5), t2.removeEventListener(`popstate`, e5);
|
|
2917
2906
|
}) : () => {
|
|
2918
2907
|
};
|
|
2919
2908
|
}
|
|
2920
|
-
var
|
|
2909
|
+
var Qs = (e5) => {
|
|
2921
2910
|
try {
|
|
2922
2911
|
return decodeURIComponent(e5);
|
|
2923
2912
|
} catch {
|
|
2924
2913
|
return e5;
|
|
2925
2914
|
}
|
|
2926
2915
|
};
|
|
2927
|
-
function
|
|
2916
|
+
function $s(e5, t2) {
|
|
2928
2917
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
2929
|
-
return `./${
|
|
2918
|
+
return `./${Qs(new URL(e5).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
2930
2919
|
}
|
|
2931
|
-
function
|
|
2932
|
-
let e5 = (0, import_services_manager_react.useService)(
|
|
2933
|
-
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () =>
|
|
2920
|
+
function ec() {
|
|
2921
|
+
let e5 = (0, import_services_manager_react.useService)(Ws), t2 = (0, import_react.useCallback)(() => e5.currentUrl, [e5]), n2 = (0, import_react.useSyncExternalStore)(Zs, t2, t2), i2 = (0, import_react.useMemo)(() => Ks(new URL(n2)), [n2]), a2 = e5.siteUrl.replace(/\/$/, ``);
|
|
2922
|
+
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => Ks(new URL(e5.currentUrl)), getRelativeUrl: () => $s(e5.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: Xs };
|
|
2934
2923
|
}
|
|
2935
|
-
var
|
|
2924
|
+
var tc = function(e5) {
|
|
2936
2925
|
return e5.BOOK_ONLINE = `bookingsBookOnline`, e5.SERVICE_PAGE = `bookingsServicePage`, e5.CALENDAR_PAGE = `bookingsCalendar`, e5.FORM_PAGE = `bookingsForm`, e5;
|
|
2937
2926
|
}({});
|
|
2938
|
-
var
|
|
2939
|
-
|
|
2940
|
-
var
|
|
2941
|
-
var
|
|
2942
|
-
let { reportBi: t2 } = (0, import_services_manager_react.useService)(
|
|
2927
|
+
var nc = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
|
|
2928
|
+
tc.BOOK_ONLINE;
|
|
2929
|
+
var rc = `new_bookings_server`;
|
|
2930
|
+
var ic = (e5) => {
|
|
2931
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(Hs);
|
|
2943
2932
|
return (0, import_react.useCallback)((n2) => {
|
|
2944
|
-
t2({ widget_name: e5, bookingsPlatform:
|
|
2933
|
+
t2({ widget_name: e5, bookingsPlatform: rc, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
2945
2934
|
}, [t2, e5]);
|
|
2946
2935
|
};
|
|
2947
|
-
var
|
|
2948
|
-
let n2 =
|
|
2936
|
+
var ac = (e5, t2 = true) => {
|
|
2937
|
+
let n2 = ic(e5), { getParsedUrl: r2 } = ec(), i2 = (0, import_react.useRef)(false);
|
|
2949
2938
|
(0, import_react.useEffect)(() => {
|
|
2950
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
2939
|
+
t2 && !i2.current && (i2.current = true, n2(Us({ referralInfo: r2().searchParams.get(la.referral) ?? void 0 })));
|
|
2951
2940
|
}, [t2, n2, r2]);
|
|
2952
2941
|
};
|
|
2953
|
-
var
|
|
2954
|
-
var
|
|
2955
|
-
var
|
|
2956
|
-
var
|
|
2957
|
-
function
|
|
2958
|
-
let e5 = (0, import_react.useContext)(
|
|
2959
|
-
if (!e5) throw Error(
|
|
2942
|
+
var oc = zo({ addOnGroups: os, hasError: false });
|
|
2943
|
+
var sc = (e5) => ({ addOnGroups: e5, hasError: false });
|
|
2944
|
+
var cc = () => ({ addOnGroups: os, hasError: true });
|
|
2945
|
+
var lc = (0, import_react.createContext)(null);
|
|
2946
|
+
function uc() {
|
|
2947
|
+
let e5 = (0, import_react.useContext)(lc);
|
|
2948
|
+
if (!e5) throw Error(cs);
|
|
2960
2949
|
return e5;
|
|
2961
2950
|
}
|
|
2962
|
-
function
|
|
2951
|
+
function dc({ addOnsPromise: e5, isLoading: t2, pickedAddOns: n2, forwardToggleAddOn: i2, forwardSetAddOnQuantity: a2, children: o2 }) {
|
|
2963
2952
|
let { addOnGroups: l2, hasError: u2 } = Ro(e5), d2 = (0, import_react.useMemo)(() => H(l2, n2), [l2, n2]), f2 = (0, import_react.useMemo)(() => oa(l2, d2), [l2, d2]), m2 = (0, import_react.useRef)({ source: n2, picks: n2 });
|
|
2964
2953
|
m2.current.source !== n2 && (m2.current = { source: n2, picks: n2 });
|
|
2965
2954
|
let h2 = (e6) => {
|
|
@@ -2977,15 +2966,15 @@ function fc({ addOnsPromise: e5, isLoading: t2, pickedAddOns: n2, forwardToggleA
|
|
|
2977
2966
|
let i3 = H(l2, m2.current.picks), o3 = i3.find((t3) => t3.id === e6)?.quantity ?? 0, s2 = ca(r2, n3);
|
|
2978
2967
|
s2 === o3 || o3 === 0 && !sa(l2, i3, e6) || (g2(), a2(e6, s2), h2((t3) => fa(t3, e6, s2)));
|
|
2979
2968
|
}, [t2, l2, g2, a2]), y2 = (0, import_react.useMemo)(() => ({ addOnGroups: f2, selected: d2, isLoading: t2, hasError: u2, toggleAddOn: _2, setAddOnQuantity: v2 }), [f2, d2, t2, u2, _2, v2]);
|
|
2980
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2969
|
+
return (0, import_jsx_runtime.jsx)(lc.Provider, { value: y2, children: o2 });
|
|
2981
2970
|
}
|
|
2982
|
-
function
|
|
2971
|
+
function fc({ children: e5 }) {
|
|
2983
2972
|
let { service: n2, serviceId: r2, hasAddOns: i2, locale: a2, isLoading: o2, bookingsSettingsLoading: c2, selection: l2, toggleAddOn: d2, setAddOnQuantity: f2 } = (0, import_service.useServiceContext)();
|
|
2984
|
-
|
|
2985
|
-
let m2 = (0, import_react.useMemo)(() => U(l2), [l2]), h2 = Go(), g2 = Zo(), _2 =
|
|
2986
|
-
return (0, import_jsx_runtime.jsx)(Io, { fallback: (0, import_jsx_runtime.jsx)(
|
|
2973
|
+
ac(nc.SERVICE_ADD_ONS, !o2 && !c2);
|
|
2974
|
+
let m2 = (0, import_react.useMemo)(() => U(l2), [l2]), h2 = Go(), g2 = Zo(), _2 = as(), v2 = n2 && i2 && r2 ? r2 : null, y2 = (0, import_react.useMemo)(() => v2 ? Vo(Vs({ serviceId: v2, locale: a2, language: g2, currency: _2, warmupData: h2 }), sc, cc) : oc, [v2, a2, g2, _2]), b2 = !v2 && !!o2;
|
|
2975
|
+
return (0, import_jsx_runtime.jsx)(Io, { fallback: (0, import_jsx_runtime.jsx)(ds, { children: e5 }), feature: Mo.serviceAddOns, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(us, { children: e5 }), children: (0, import_jsx_runtime.jsx)(dc, { addOnsPromise: y2, isLoading: b2, pickedAddOns: m2, forwardToggleAddOn: d2, forwardSetAddOnQuantity: f2, children: e5 }) }) });
|
|
2987
2976
|
}
|
|
2988
|
-
var
|
|
2977
|
+
var pc = na(`bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8`);
|
|
2989
2978
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2990
2979
|
0 && (module.exports = {
|
|
2991
2980
|
ServiceAddOnsContextProvider,
|