@wix/bookings 1.0.1782 → 1.0.1784

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.
Files changed (53) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +32 -0
  2. package/build/cjs/context-booking-checkout.js +2002 -1762
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-my-booking.d.ts +2832 -0
  5. package/build/cjs/context-my-booking.js +592 -0
  6. package/build/cjs/context-my-booking.js.map +1 -0
  7. package/build/cjs/context-my-bookings.d.ts +2862 -0
  8. package/build/cjs/context-my-bookings.js +12885 -0
  9. package/build/cjs/context-my-bookings.js.map +1 -0
  10. package/build/cjs/context-service.d.ts +18 -24
  11. package/build/cjs/context-service.js +403 -396
  12. package/build/cjs/context-service.js.map +1 -1
  13. package/build/cjs/context-time-slots.d.ts +24 -7
  14. package/build/cjs/context-time-slots.js +82 -81
  15. package/build/cjs/context-time-slots.js.map +1 -1
  16. package/build/es/context-booking-checkout.d.mts +32 -0
  17. package/build/es/context-booking-checkout.mjs +2002 -1762
  18. package/build/es/context-booking-checkout.mjs.map +1 -1
  19. package/build/es/context-my-booking.d.mts +2832 -0
  20. package/build/es/context-my-booking.mjs +562 -0
  21. package/build/es/context-my-booking.mjs.map +1 -0
  22. package/build/es/context-my-bookings.d.mts +2862 -0
  23. package/build/es/context-my-bookings.mjs +12844 -0
  24. package/build/es/context-my-bookings.mjs.map +1 -0
  25. package/build/es/context-service.d.mts +18 -24
  26. package/build/es/context-service.mjs +403 -396
  27. package/build/es/context-service.mjs.map +1 -1
  28. package/build/es/context-time-slots.d.mts +24 -7
  29. package/build/es/context-time-slots.mjs +82 -81
  30. package/build/es/context-time-slots.mjs.map +1 -1
  31. package/build/internal/cjs/context-booking-checkout.d.ts +32 -0
  32. package/build/internal/cjs/context-my-booking.d.ts +2832 -0
  33. package/build/internal/cjs/context-my-bookings.d.ts +2862 -0
  34. package/build/internal/cjs/context-service.d.ts +18 -24
  35. package/build/internal/cjs/context-time-slots.d.ts +24 -7
  36. package/build/internal/es/context-booking-checkout.d.mts +32 -0
  37. package/build/internal/es/context-my-booking.d.mts +2832 -0
  38. package/build/internal/es/context-my-bookings.d.mts +2862 -0
  39. package/build/internal/es/context-service.d.mts +18 -24
  40. package/build/internal/es/context-time-slots.d.mts +24 -7
  41. package/context/my-booking/package.json +3 -0
  42. package/context/my-bookings/package.json +3 -0
  43. package/context-runtime/context-booking-checkout/runtime.d.ts +32 -0
  44. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  45. package/context-runtime/context-my-booking/runtime.d.ts +2832 -0
  46. package/context-runtime/context-my-booking/runtime.js +2 -0
  47. package/context-runtime/context-my-bookings/runtime.d.ts +2862 -0
  48. package/context-runtime/context-my-bookings/runtime.js +11 -0
  49. package/context-runtime/context-service/runtime.d.ts +18 -24
  50. package/context-runtime/context-service/runtime.js +3 -3
  51. package/context-runtime/context-time-slots/runtime.d.ts +24 -7
  52. package/context-runtime/context-time-slots/runtime.js +2 -2
  53. package/package.json +22 -6
@@ -20,13 +20,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // context-service.ts
21
21
  var context_service_exports = {};
22
22
  __export(context_service_exports, {
23
- SERVICE_CONTEXT_MISSING_PROVIDER_ERROR: () => zx,
24
- ServiceContextProvider: () => dS,
25
- default: () => dS,
26
- injectAccessTokenGetter: () => fS,
27
- resolveServiceTarget: () => Vx,
28
- serviceContext: () => Rx,
29
- useServiceContext: () => Bx
23
+ SERVICE_CONTEXT_MISSING_PROVIDER_ERROR: () => Bx,
24
+ ServiceContextProvider: () => fS,
25
+ default: () => fS,
26
+ injectAccessTokenGetter: () => pS,
27
+ resolveServiceTarget: () => Hx,
28
+ serviceContext: () => zx,
29
+ useServiceContext: () => Vx
30
30
  });
31
31
  module.exports = __toCommonJS(context_service_exports);
32
32
 
@@ -5433,7 +5433,7 @@ var hv = /* @__PURE__ */ new Set([`serviceId`, `slug`, `serviceType`, `scheduleI
5433
5433
  function gv(e5) {
5434
5434
  return Object.keys(e5).some((t2) => {
5435
5435
  if (hv.has(t2)) return false;
5436
- if (t2 === `resources`) return (e5.resources ?? []).some((t3) => t3.type === `staff` ? bv(e5) !== null : t3.ids.length > 0 || !!t3.anyResource);
5436
+ if (t2 === `resources`) return (e5.resources ?? []).some((t3) => t3.type === `staff` ? xv(e5) !== null : t3.ids.length > 0 || !!t3.anyResource);
5437
5437
  let n2 = e5[t2];
5438
5438
  return Array.isArray(n2) ? n2.length > 0 : n2 !== void 0;
5439
5439
  });
@@ -5443,20 +5443,26 @@ function _v(e5, t2) {
5443
5443
  return t2 ? { ...r2, wantsPromoCode: true } : r2;
5444
5444
  }
5445
5445
  function vv(e5, t2) {
5446
+ let n2 = av(e5), r2 = av(t2);
5447
+ if (!n2 || !r2) return e5 === t2;
5448
+ let i2 = (e6) => JSON.stringify({ ..._v(e6, false), mode: void 0 });
5449
+ return i2(n2) === i2(r2);
5450
+ }
5451
+ function yv(e5, t2) {
5446
5452
  let n2 = av(t2.searchParams.get(Rp.blob));
5447
5453
  return n2 ? mv(e5, n2) : e5;
5448
5454
  }
5449
- function yv(e5, t2) {
5455
+ function bv(e5, t2) {
5450
5456
  let n2 = { ...e5 };
5451
5457
  return t2.serviceType && (n2.serviceType = t2.serviceType), t2.scheduleId && (n2.scheduleId = t2.scheduleId), n2;
5452
5458
  }
5453
- function bv(e5) {
5459
+ function xv(e5) {
5454
5460
  let t2 = e5.resources?.find((e6) => e6.type === sv);
5455
5461
  if (!t2) return null;
5456
5462
  let n2 = t2.ids[0];
5457
5463
  return n2 ? { anyResource: false, staffMemberId: n2 } : t2.anyResource ? { anyResource: true } : null;
5458
5464
  }
5459
- function xv(e5, t2) {
5465
+ function Sv(e5, t2) {
5460
5466
  let n2 = (e5.resources ?? []).filter((e6) => e6.type !== sv);
5461
5467
  if (t2) {
5462
5468
  let { requestedGender: r2, ...i2 } = e5;
@@ -5464,141 +5470,141 @@ function xv(e5, t2) {
5464
5470
  }
5465
5471
  return { ...e5, resources: [...n2, { type: sv, ids: [], anyResource: true }] };
5466
5472
  }
5467
- function Sv(e5, t2) {
5468
- let n2 = xv(e5, null);
5473
+ function Cv(e5, t2) {
5474
+ let n2 = Sv(e5, null);
5469
5475
  return t2 ? n2.requestedGender = t2 : delete n2.requestedGender, n2;
5470
5476
  }
5471
- function Cv(e5) {
5477
+ function wv(e5) {
5472
5478
  let t2 = (e5.resources ?? []).filter((e6) => e6.type !== sv), { requestedGender: n2, ...r2 } = e5;
5473
5479
  return t2.length ? r2.resources = t2 : delete r2.resources, r2;
5474
5480
  }
5475
- function wv(e5) {
5481
+ function Tv(e5) {
5476
5482
  return e5.selectedVariants?.[0]?.choices ?? [];
5477
5483
  }
5478
- function Tv(e5, t2) {
5484
+ function Ev(e5, t2) {
5479
5485
  let n2 = { ...e5 };
5480
5486
  return delete n2.durationChoiceId, t2.length ? n2.selectedVariants = [{ choices: t2 }] : delete n2.selectedVariants, n2;
5481
5487
  }
5482
- function Ev(e5, t2) {
5488
+ function Dv(e5, t2) {
5483
5489
  let n2 = e5.selectedVariants?.find((e6) => e6.choices?.[0] === t2);
5484
5490
  return n2 ? n2.numberOfParticipants ?? 1 : 0;
5485
5491
  }
5486
- function Dv(e5) {
5492
+ function Ov(e5) {
5487
5493
  return (e5.selectedVariants ?? []).reduce((e6, t2) => e6 + (t2.numberOfParticipants ?? 1), 0);
5488
5494
  }
5489
- function Ov(e5, t2, n2) {
5490
- let r2 = e5.selectedVariants ?? [], i2 = r2.filter((e6) => e6.choices?.[0] !== t2), a2 = i2.length !== r2.length, o2 = n2 <= 0 ? i2 : a2 ? r2.map((e6) => e6.choices?.[0] === t2 ? { ...e6, numberOfParticipants: n2 } : e6) : [...r2, { choices: [t2], numberOfParticipants: n2 }], s2 = Tv(e5, []);
5495
+ function kv(e5, t2, n2) {
5496
+ let r2 = e5.selectedVariants ?? [], i2 = r2.filter((e6) => e6.choices?.[0] !== t2), a2 = i2.length !== r2.length, o2 = n2 <= 0 ? i2 : a2 ? r2.map((e6) => e6.choices?.[0] === t2 ? { ...e6, numberOfParticipants: n2 } : e6) : [...r2, { choices: [t2], numberOfParticipants: n2 }], s2 = Ev(e5, []);
5491
5497
  return o2.length && (s2.selectedVariants = o2), s2;
5492
5498
  }
5493
- function kv(e5, t2) {
5499
+ function Av(e5, t2) {
5494
5500
  let n2 = e5.selectedVariants ?? [], r2 = n2.filter((e6) => (e6.choices ?? []).every((e7) => t2.has(e7)));
5495
5501
  if (r2.length === n2.length) return e5;
5496
5502
  let i2 = { ...e5 };
5497
5503
  return r2.length ? i2.selectedVariants = r2 : delete i2.selectedVariants, i2;
5498
5504
  }
5499
- function Av(e5) {
5505
+ function jv(e5) {
5500
5506
  return e5.addOns ?? [];
5501
5507
  }
5502
- function jv(e5, t2) {
5508
+ function Mv(e5, t2) {
5503
5509
  let n2 = { ...e5 };
5504
5510
  return t2.length ? n2.addOns = t2 : delete n2.addOns, n2;
5505
5511
  }
5506
- function Mv(e5, t2) {
5507
- let n2 = Av(e5);
5508
- return jv(e5, n2.some((e6) => e6.id === t2) ? n2.filter((e6) => e6.id !== t2) : [...n2, { id: t2, quantity: 1 }]);
5512
+ function Nv(e5, t2) {
5513
+ let n2 = jv(e5);
5514
+ return Mv(e5, n2.some((e6) => e6.id === t2) ? n2.filter((e6) => e6.id !== t2) : [...n2, { id: t2, quantity: 1 }]);
5509
5515
  }
5510
- function Nv(e5, t2, n2) {
5511
- let r2 = Av(e5);
5512
- return n2 <= 0 ? jv(e5, r2.filter((e6) => e6.id !== t2)) : jv(e5, r2.some((e6) => e6.id === t2) ? r2.map((e6) => e6.id === t2 ? { ...e6, quantity: n2 } : e6) : [...r2, { id: t2, quantity: n2 }]);
5516
+ function Pv(e5, t2, n2) {
5517
+ let r2 = jv(e5);
5518
+ return n2 <= 0 ? Mv(e5, r2.filter((e6) => e6.id !== t2)) : Mv(e5, r2.some((e6) => e6.id === t2) ? r2.map((e6) => e6.id === t2 ? { ...e6, quantity: n2 } : e6) : [...r2, { id: t2, quantity: n2 }]);
5513
5519
  }
5514
- var Pv = [`slotStart`, `slotEnd`, `eventId`, `scheduleId`, `sessionId`, `locationId`];
5515
- function Fv(e5) {
5520
+ var Fv = [`slotStart`, `slotEnd`, `eventId`, `scheduleId`, `sessionId`, `locationId`];
5521
+ function Iv(e5) {
5516
5522
  return !!e5.slotStart && !!e5.slotEnd;
5517
5523
  }
5518
- function Iv(e5, t2) {
5524
+ function Lv(e5, t2) {
5519
5525
  let n2 = { ...e5 };
5520
- for (let e6 of Pv) {
5526
+ for (let e6 of Fv) {
5521
5527
  let r2 = t2[e6];
5522
5528
  r2 == null ? delete n2[e6] : n2[e6] = r2;
5523
5529
  }
5524
5530
  return t2.locationType == null ? delete n2.locationType : n2.locationType = t2.locationType, n2;
5525
5531
  }
5526
- function Lv(e5) {
5532
+ function Rv(e5) {
5527
5533
  let t2 = { ...e5 };
5528
- for (let e6 of Pv) e6 !== `locationId` && delete t2[e6];
5534
+ for (let e6 of Fv) e6 !== `locationId` && delete t2[e6];
5529
5535
  return t2;
5530
5536
  }
5531
- function Rv(e5, t2) {
5532
- let n2 = Lv(e5);
5537
+ function zv(e5, t2) {
5538
+ let n2 = Rv(e5);
5533
5539
  t2.locationId == null ? delete n2.locationId : n2.locationId = t2.locationId, t2.locationType == null ? delete n2.locationType : n2.locationType = t2.locationType, t2.requestedGender == null ? delete n2.requestedGender : n2.requestedGender = t2.requestedGender;
5534
5540
  let r2 = [...(e5.resources ?? []).filter((e6) => e6.type !== sv), ...(t2.resources ?? []).filter((e6) => e6.type === sv)];
5535
5541
  return r2.length ? n2.resources = r2 : delete n2.resources, n2;
5536
5542
  }
5537
- function zv(e5, t2, n2, r2 = false) {
5538
- return t2.length !== e5.services.length || t2.some((t3, n3) => t3.serviceId !== e5.services[n3].serviceId || !t3.localStartDate || !t3.localEndDate) ? null : { ...e5, ...n2 ? { timezone: n2 } : {}, services: e5.services.map((e6, n3) => Iv(r2 ? Bv(e6) : e6, { slotStart: t2[n3].localStartDate ?? void 0, slotEnd: t2[n3].localEndDate ?? void 0, scheduleId: t2[n3].scheduleId ?? void 0, locationId: e6.locationId, locationType: e6.locationType ?? `BUSINESS` })) };
5543
+ function Bv(e5, t2, n2, r2 = false) {
5544
+ return t2.length !== e5.services.length || t2.some((t3, n3) => t3.serviceId !== e5.services[n3].serviceId || !t3.localStartDate || !t3.localEndDate) ? null : { ...e5, ...n2 ? { timezone: n2 } : {}, services: e5.services.map((e6, n3) => Lv(r2 ? Vv(e6) : e6, { slotStart: t2[n3].localStartDate ?? void 0, slotEnd: t2[n3].localEndDate ?? void 0, scheduleId: t2[n3].scheduleId ?? void 0, locationId: e6.locationId, locationType: e6.locationType ?? `BUSINESS` })) };
5539
5545
  }
5540
- function Bv(e5) {
5546
+ function Vv(e5) {
5541
5547
  let { requestedGender: t2, ...n2 } = e5;
5542
5548
  return n2;
5543
5549
  }
5544
- function Vv(e5) {
5545
- return { ...e5, services: e5.services.map(Lv) };
5550
+ function Hv(e5) {
5551
+ return { ...e5, services: e5.services.map(Rv) };
5546
5552
  }
5547
- function Hv(e5, t2) {
5553
+ function Uv(e5, t2) {
5548
5554
  return _p(e5) ? t2 ?? void 0 : Gh(e5) ? void 0 : null;
5549
5555
  }
5550
- function Uv(e5) {
5551
- return { serviceId: e5.serviceId, staff: Gv(e5), variantChoiceId: wv(e5)[0], addOns: Av(e5).map((e6) => ({ addOnId: e6.id, quantity: e6.quantity ?? 1 })) };
5556
+ function Wv(e5) {
5557
+ return { serviceId: e5.serviceId, staff: Kv(e5), variantChoiceId: Tv(e5)[0], addOns: jv(e5).map((e6) => ({ addOnId: e6.id, quantity: e6.quantity ?? 1 })) };
5552
5558
  }
5553
- function Wv({ service: e5, pricingOption: t2, selection: n2, multiServiceAppointmentsEnabled: r2, basketSelections: i2, openAtBasket: a2 }) {
5554
- return { serviceId: e5?._id ?? void 0, service: e5 ?? void 0, variants: e5 ? Hv(e5, t2) : void 0, staff: Gv(n2), locationId: n2.locationId ?? void 0, variantChoiceId: wv(n2)[0], addOns: Av(n2).map((e6) => ({ addOnId: e6.id, quantity: e6.quantity ?? 1 })), multiServiceAppointmentsEnabled: r2, ...i2?.length ? { basket: i2.map(Uv) } : {}, ...a2 ? { openAtBasket: a2 } : {} };
5559
+ function Gv({ service: e5, pricingOption: t2, selection: n2, multiServiceAppointmentsEnabled: r2, basketSelections: i2, openAtBasket: a2 }) {
5560
+ return { serviceId: e5?._id ?? void 0, service: e5 ?? void 0, variants: e5 ? Uv(e5, t2) : void 0, staff: Kv(n2), locationId: n2.locationId ?? void 0, variantChoiceId: Tv(n2)[0], addOns: jv(n2).map((e6) => ({ addOnId: e6.id, quantity: e6.quantity ?? 1 })), multiServiceAppointmentsEnabled: r2, ...i2?.length ? { basket: i2.map(Wv) } : {}, ...a2 ? { openAtBasket: a2 } : {} };
5555
5561
  }
5556
- function Gv(e5) {
5557
- let t2 = bv(e5);
5562
+ function Kv(e5) {
5563
+ let t2 = xv(e5);
5558
5564
  if (t2) return t2.anyResource && e5.requestedGender ? { ...t2, requestedGender: e5.requestedGender } : t2;
5559
5565
  }
5560
- var Kv = Zo(`@wix/site-service-locale`);
5561
- var qv = ls(`@wix/viewer-service-multilingual`);
5562
- function Jv(e5) {
5566
+ var qv = Zo(`@wix/site-service-locale`);
5567
+ var Jv = ls(`@wix/viewer-service-multilingual`);
5568
+ function Yv(e5) {
5563
5569
  try {
5564
5570
  return (0, import_services_manager_react.useService)(e5);
5565
5571
  } catch {
5566
5572
  return null;
5567
5573
  }
5568
5574
  }
5569
- var Yv = `en`;
5570
- function Xv() {
5571
- let e5 = Jv(Kv), t2 = Jv(qv);
5572
- return t2?.multilingualEnabled && t2.currentLocale?.regionalFormat || e5?.locale || e5?.language || Yv;
5573
- }
5575
+ var Xv = `en`;
5574
5576
  function Zv() {
5577
+ let e5 = Yv(qv), t2 = Yv(Jv);
5578
+ return t2?.multilingualEnabled && t2.currentLocale?.regionalFormat || e5?.locale || e5?.language || Xv;
5579
+ }
5580
+ function Qv() {
5575
5581
  try {
5576
5582
  return Ho.getLanguage() ?? `en`;
5577
5583
  } catch {
5578
5584
  return `en`;
5579
5585
  }
5580
5586
  }
5581
- function Qv() {
5582
- let e5 = Jv(Kv), t2 = Jv(qv);
5583
- return t2?.multilingualEnabled && t2.currentLocale?.languageCode || e5?.language || Zv();
5587
+ function $v() {
5588
+ let e5 = Yv(qv), t2 = Yv(Jv);
5589
+ return t2?.multilingualEnabled && t2.currentLocale?.languageCode || e5?.language || Qv();
5584
5590
  }
5585
- var $v = Zo(`@wix/site-service-warmup-data`);
5586
- function ey() {
5591
+ var ey = Zo(`@wix/site-service-warmup-data`);
5592
+ function ty() {
5587
5593
  try {
5588
5594
  return (0, import_services_manager_react.useGetService)();
5589
5595
  } catch {
5590
5596
  return null;
5591
5597
  }
5592
5598
  }
5593
- function ty(e5) {
5599
+ function ny(e5) {
5594
5600
  try {
5595
- return e5 ? e5($v) : null;
5601
+ return e5 ? e5(ey) : null;
5596
5602
  } catch {
5597
5603
  return null;
5598
5604
  }
5599
5605
  }
5600
- function ny() {
5601
- let e5 = ty(ey()), t2 = typeof window > `u`;
5606
+ function ry() {
5607
+ let e5 = ny(ty()), t2 = typeof window > `u`;
5602
5608
  return { scope: e5 ?? void 0, get: async (n2) => {
5603
5609
  if (t2 || !e5) return null;
5604
5610
  try {
@@ -5613,72 +5619,72 @@ function ny() {
5613
5619
  }
5614
5620
  } };
5615
5621
  }
5616
- function ry() {
5622
+ function iy() {
5617
5623
  let [e5, t2] = (0, import_react.useState)(void 0);
5618
5624
  return (0, import_react.useEffect)(() => {
5619
5625
  (0, import_react.startTransition)(() => t2(Date.now()));
5620
5626
  }, []), e5;
5621
5627
  }
5622
- var iy = `bookings-uou`;
5623
- function ay(e5, t2, n2) {
5624
- return `${iy}:${e5}:service:${t2}:${n2}`;
5625
- }
5626
- function oy(e5, t2) {
5627
- return `${iy}:${e5}:multi-service-appointment:${encodeURIComponent(JSON.stringify(t2))}`;
5628
+ var ay = `bookings-uou`;
5629
+ function oy(e5, t2, n2) {
5630
+ return `${ay}:${e5}:service:${t2}:${n2}`;
5628
5631
  }
5629
- function sy(e5, t2, n2) {
5630
- return `${iy}:${e5}:service-variants:${t2}:refresh-${n2}`;
5632
+ function sy(e5, t2) {
5633
+ return `${ay}:${e5}:multi-service-appointment:${encodeURIComponent(JSON.stringify(t2))}`;
5631
5634
  }
5632
5635
  function cy(e5, t2, n2) {
5633
- return `${iy}:${e5}:services-variants:ids-${encodeURIComponent(JSON.stringify([...t2].sort()))}:refresh-${n2}`;
5636
+ return `${ay}:${e5}:service-variants:${t2}:refresh-${n2}`;
5637
+ }
5638
+ function ly(e5, t2, n2) {
5639
+ return `${ay}:${e5}:services-variants:ids-${encodeURIComponent(JSON.stringify([...t2].sort()))}:refresh-${n2}`;
5634
5640
  }
5635
- function ly() {
5636
- return `${iy}:bookings-settings`;
5641
+ function uy() {
5642
+ return `${ay}:bookings-settings`;
5637
5643
  }
5638
- var uy = 5e3;
5639
- var dy = 100;
5640
- var fy = `wix-warmup-data`;
5641
- var py = null;
5642
- function my(e5) {
5644
+ var dy = 5e3;
5645
+ var fy = 100;
5646
+ var py = `wix-warmup-data`;
5647
+ var my = null;
5648
+ function hy(e5) {
5643
5649
  if (typeof document < `u`) try {
5644
- let t2 = document.getElementById(fy)?.textContent;
5645
- return t2 ? (py?.text !== t2 && (py = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), py.data[e5] ?? void 0) : void 0;
5650
+ let t2 = document.getElementById(py)?.textContent;
5651
+ return t2 ? (my?.text !== t2 && (my = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), my.data[e5] ?? void 0) : void 0;
5646
5652
  } catch {
5647
5653
  return;
5648
5654
  }
5649
5655
  }
5650
- var hy = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
5651
- var gy = hy();
5652
- var _y = /* @__PURE__ */ new WeakMap();
5656
+ var gy = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
5657
+ var _y = gy();
5653
5658
  var vy = /* @__PURE__ */ new WeakMap();
5654
- function yy(e5) {
5655
- if (!e5) return gy;
5656
- let t2 = _y.get(e5);
5657
- return t2 || (t2 = hy(), _y.set(e5, t2)), t2;
5659
+ var yy = /* @__PURE__ */ new WeakMap();
5660
+ function by(e5) {
5661
+ if (!e5) return _y;
5662
+ let t2 = vy.get(e5);
5663
+ return t2 || (t2 = gy(), vy.set(e5, t2)), t2;
5658
5664
  }
5659
- function by({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
5665
+ function xy({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
5660
5666
  if (e5 === null) return n2();
5661
5667
  if (typeof window > `u`) {
5662
5668
  let r3 = () => n2().then((n3) => (t2.set(e5, n3), n3)), { scope: i3 } = t2;
5663
5669
  if (!i3) return r3();
5664
- let a3 = vy.get(i3);
5665
- a3 || (a3 = /* @__PURE__ */ new Map(), vy.set(i3, a3));
5670
+ let a3 = yy.get(i3);
5671
+ a3 || (a3 = /* @__PURE__ */ new Map(), yy.set(i3, a3));
5666
5672
  let o3 = a3.get(e5);
5667
5673
  if (o3) return o3;
5668
5674
  let s3 = r3();
5669
5675
  return a3.set(e5, s3), s3.catch(() => a3.delete(e5)), s3;
5670
5676
  }
5671
- let i2 = yy(t2.scope), a2 = Date.now();
5677
+ let i2 = by(t2.scope), a2 = Date.now();
5672
5678
  for (let [e6, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e6);
5673
5679
  let o2 = i2.promises.get(e5);
5674
5680
  if (o2 && !r2) return o2.promise;
5675
5681
  r2 && i2.invalidatedWarmup.add(e5);
5676
5682
  let s2 = !i2.invalidatedWarmup.has(e5);
5677
5683
  if (s2) {
5678
- let t3 = my(e5);
5684
+ let t3 = hy(e5);
5679
5685
  if (t3 !== void 0) {
5680
5686
  let n3 = hs(t3);
5681
- return i2.promises.set(e5, { promise: n3, expiresAt: a2 + uy }), n3;
5687
+ return i2.promises.set(e5, { promise: n3, expiresAt: a2 + dy }), n3;
5682
5688
  }
5683
5689
  }
5684
5690
  let c2 = (async () => {
@@ -5688,176 +5694,176 @@ function by({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
5688
5694
  }
5689
5695
  return n2();
5690
5696
  })();
5691
- i2.promises.size >= dy && i2.promises.delete(i2.promises.keys().next().value);
5697
+ i2.promises.size >= fy && i2.promises.delete(i2.promises.keys().next().value);
5692
5698
  let l2 = { promise: c2, expiresAt: 1 / 0 };
5693
5699
  return i2.promises.set(e5, l2), c2.then(() => {
5694
- l2.expiresAt = Date.now() + uy;
5700
+ l2.expiresAt = Date.now() + dy;
5695
5701
  }, () => {
5696
5702
  i2.promises.get(e5) === l2 && i2.promises.delete(e5);
5697
5703
  }), c2;
5698
5704
  }
5699
- var xy = Zo(`@wix/site-service-editor-context`);
5700
- var Sy = Zo(`@wix/site-service-router`);
5701
- var Cy = Zo(`@wix/site-service-renderer-configuration`);
5702
- var wy = `{{(.*?)}}`;
5703
- var Ty = `[{{}}]`;
5704
- var Ey = `([^/]+)`;
5705
- var Dy;
5705
+ var Sy = Zo(`@wix/site-service-editor-context`);
5706
+ var Cy = Zo(`@wix/site-service-router`);
5707
+ var wy = Zo(`@wix/site-service-renderer-configuration`);
5708
+ var Ty = `{{(.*?)}}`;
5709
+ var Ey = `[{{}}]`;
5710
+ var Dy = `([^/]+)`;
5711
+ var Oy;
5706
5712
  (function(e5) {
5707
5713
  e5.product_page = `product_page`, e5.blog = `blog`, e5.post = `post`, e5.forum = `forum`, e5.group = `group`, e5.bookings = `Booking Service Page`, e5.challenges = `challenge_page`;
5708
- })(Dy ||= {});
5714
+ })(Oy ||= {});
5709
5715
  var $;
5710
5716
  (function(e5) {
5711
5717
  e5.PRODUCT_PAGE = `wix.stores.sub_pages.product`, e5.BLOG_POST = `wix.blog.sub_pages.post`, e5.BLOG_POST_EDIT = `wix.blog.sub_pages.post.edit`, e5.BLOG_POST_PREVIEW = `wix.blog.sub_pages.post.preview`, e5.BLOG_CATEGORY = `wix.blog.sub_pages.category`, e5.FORUM_CATEGORY = `wix.forum.sub_pages.category`, e5.FORUM_CATEGORY_PAGINATION = `wix.forum.sub_pages.category.pagination`, e5.FORUM_CATEGORY_CREATE_POST = `wix.forum.sub_pages.category.create-post`, e5.FORUM_CATEGORY_CREATE_QUESTION = `wix.forum.sub_pages.category.create-question`, e5.FORUM_POST = `wix.forum.sub_pages.post`, e5.FORUM_POST_EDIT = `wix.forum.sub_pages.post.edit`, e5.FORUM_POST_PAGINATION = `wix.forum.sub_pages.post.pagination`, e5.FORUM_POST_DEEP_LINK_DATA = `wix.forum.sub_pages.post.deep-link-data`, e5.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA = `wix.forum.sub_pages.post.pagination-and-deep-link-data`, e5.GROUP = `wix.groups.sub_pages.group`, e5.GROUP_POST = `wix.groups.sub_pages.post`, e5.BOOKINGS_SERVICE = `wix.bookings.sub_pages.service_page`, e5.CHALLENGES_PAGE = `wix.online_programs.sub_pages.online_program`;
5712
5718
  })($ ||= {});
5713
- var Oy = {};
5714
- var ky = (Oy[$.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Oy);
5715
- var Ay = `{{main-mapping}}`;
5716
- var jy = {};
5717
- var My;
5718
- var Ny = (jy[$.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (My = {}, My[$.BLOG_POST_EDIT] = { defaultMapping: `${Ay}/edit` }, My[$.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${Ay}/preview/{{instance}}` }, My) }, jy);
5719
- var Py = {};
5720
- var Fy = (Py[$.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, Py);
5721
- var Iy = {};
5722
- var Ly;
5719
+ var ky = {};
5720
+ var Ay = (ky[$.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, ky);
5721
+ var jy = `{{main-mapping}}`;
5722
+ var My = {};
5723
+ var Ny;
5724
+ var Py = (My[$.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (Ny = {}, Ny[$.BLOG_POST_EDIT] = { defaultMapping: `${jy}/edit` }, Ny[$.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${jy}/preview/{{instance}}` }, Ny) }, My);
5725
+ var Fy = {};
5726
+ var Iy = (Fy[$.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, Fy);
5727
+ var Ly = {};
5723
5728
  var Ry;
5724
- var zy = (Iy[$.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (Ly = {}, Ly[$.FORUM_POST_EDIT] = { defaultMapping: `${Ay}/edit` }, Ly[$.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${Ay}/p-{{page}}` }, Ly[$.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${Ay}/dl-{{deepLinkData}}` }, Ly[$.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${Ay}/p-{{page}}/dl-{{deepLinkData}}` }, Ly) }, Iy[$.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (Ry = {}, Ry[$.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${Ay}/create-post` }, Ry[$.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${Ay}/create-question` }, Ry[$.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${Ay}/p-{{page}}` }, Ry) }, Iy);
5725
- var By = {};
5726
- var Vy = (By[$.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, By[$.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, By);
5727
- var Hy = {};
5728
- var Uy = (Hy[$.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, Hy);
5729
- var Wy = {};
5730
- var Gy = (Wy[$.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, Wy);
5731
- var Ky = {};
5732
- var qy = (Ky[Dy.product_page] = ky, Ky[Dy.post] = Ny, Ky[Dy.blog] = Fy, Ky[Dy.forum] = zy, Ky[Dy.group] = Vy, Ky[Dy.bookings] = Uy, Ky[Dy.challenges] = Gy, Ky);
5733
- var Jy = function(e5) {
5734
- return Object.values(Yy()).some(function(t2) {
5729
+ var zy;
5730
+ var By = (Ly[$.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (Ry = {}, Ry[$.FORUM_POST_EDIT] = { defaultMapping: `${jy}/edit` }, Ry[$.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${jy}/p-{{page}}` }, Ry[$.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${jy}/dl-{{deepLinkData}}` }, Ry[$.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${jy}/p-{{page}}/dl-{{deepLinkData}}` }, Ry) }, Ly[$.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (zy = {}, zy[$.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${jy}/create-post` }, zy[$.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${jy}/create-question` }, zy[$.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${jy}/p-{{page}}` }, zy) }, Ly);
5731
+ var Vy = {};
5732
+ var Hy = (Vy[$.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, Vy[$.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, Vy);
5733
+ var Uy = {};
5734
+ var Wy = (Uy[$.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, Uy);
5735
+ var Gy = {};
5736
+ var Ky = (Gy[$.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, Gy);
5737
+ var qy = {};
5738
+ var Jy = (qy[Oy.product_page] = Ay, qy[Oy.post] = Py, qy[Oy.blog] = Iy, qy[Oy.forum] = By, qy[Oy.group] = Hy, qy[Oy.bookings] = Wy, qy[Oy.challenges] = Ky, qy);
5739
+ var Yy = function(e5) {
5740
+ return Object.values(Xy()).some(function(t2) {
5735
5741
  return !!t2?.subMappings?.[e5];
5736
5742
  });
5737
5743
  };
5738
- var Yy = function() {
5739
- return Object.values(qy).reduce(function(e5, t2) {
5744
+ var Xy = function() {
5745
+ return Object.values(Jy).reduce(function(e5, t2) {
5740
5746
  return bo(bo({}, e5), t2);
5741
5747
  }, {}) || {};
5742
5748
  };
5743
- var Xy = function(e5) {
5744
- var t2 = Yy()[e5];
5745
- return !t2 && Jy(e5) && console.warn(`You cannot get variables schema for subMappings key (${e5}).`), t2;
5746
- };
5747
5749
  var Zy = function(e5) {
5748
- return Object.entries(qy).filter(function(t2) {
5750
+ var t2 = Xy()[e5];
5751
+ return !t2 && Yy(e5) && console.warn(`You cannot get variables schema for subMappings key (${e5}).`), t2;
5752
+ };
5753
+ var Qy = function(e5) {
5754
+ return Object.entries(Jy).filter(function(t2) {
5749
5755
  var n2 = So(t2, 2)[1];
5750
5756
  return Object.keys(n2).includes(e5);
5751
5757
  }).map(function(e6) {
5752
5758
  return So(e6, 1)[0];
5753
5759
  })[0];
5754
5760
  };
5755
- var Qy = function(e5) {
5756
- return Object.entries(Yy()).find(function(t2) {
5761
+ var $y = function(e5) {
5762
+ return Object.entries(Xy()).find(function(t2) {
5757
5763
  var n2 = So(t2, 2);
5758
5764
  return n2[0], !!n2[1]?.subMappings?.[e5];
5759
5765
  });
5760
5766
  };
5761
- var $y = function(e5) {
5767
+ var eb = function(e5) {
5762
5768
  var t2 = [];
5763
- if (Jy(e5)) {
5764
- var n2 = So(Qy(e5), 2);
5769
+ if (Yy(e5)) {
5770
+ var n2 = So($y(e5), 2);
5765
5771
  n2[0];
5766
5772
  var r2 = n2[1];
5767
5773
  t2.push.apply(t2, Co(Co([], So(r2?.required || []), false), So(r2?.subMappings?.[e5]?.required || []), false));
5768
- } else t2.push.apply(t2, Co([], So(Xy(e5)?.required || []), false));
5774
+ } else t2.push.apply(t2, Co([], So(Zy(e5)?.required || []), false));
5769
5775
  return t2;
5770
5776
  };
5771
- var eb = function(e5, t2) {
5777
+ var tb = function(e5, t2) {
5772
5778
  var n2;
5773
5779
  return t2 === void 0 && (t2 = ``), (n2 = e5?.main)?.find?.call(n2, function(e6) {
5774
5780
  return e6.key === t2;
5775
5781
  });
5776
5782
  };
5777
- var tb = function(e5, t2) {
5783
+ var nb = function(e5, t2) {
5778
5784
  return Error(`Url Mappings Error - [${e5}]: ${t2}`);
5779
5785
  };
5780
- var nb = Object.values($);
5781
- var rb = tb(`key`, `must be one of: ${nb.toString()}`);
5782
- var ib = function(e5) {
5783
- if (typeof e5 != `string` || !nb.includes(e5)) return rb;
5786
+ var rb = Object.values($);
5787
+ var ib = nb(`key`, `must be one of: ${rb.toString()}`);
5788
+ var ab = function(e5) {
5789
+ if (typeof e5 != `string` || !rb.includes(e5)) return ib;
5784
5790
  };
5785
- var ab = tb(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
5786
- var ob = function(e5) {
5791
+ var ob = nb(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
5792
+ var sb = function(e5) {
5787
5793
  if (typeof e5 != `object` || !e5 || !Object.values(e5).every(function(e6) {
5788
5794
  return typeof e6 == `string`;
5789
- }) || Array.isArray(e5)) return ab;
5795
+ }) || Array.isArray(e5)) return ob;
5790
5796
  };
5791
- var sb = tb(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
5792
- var cb = function(e5, t2) {
5797
+ var cb = nb(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
5798
+ var lb = function(e5, t2) {
5793
5799
  try {
5794
- var n2 = $y(e5);
5800
+ var n2 = eb(e5);
5795
5801
  if (!n2.every(function(e6) {
5796
5802
  return !!t2[e6];
5797
5803
  }) || !n2.length) throw Error();
5798
5804
  } catch {
5799
- return sb;
5805
+ return cb;
5800
5806
  }
5801
5807
  };
5802
- var lb = function(e5) {
5808
+ var ub = function(e5) {
5803
5809
  var t2 = e5.key, n2 = e5.itemData;
5804
- return [ib(t2), ob(n2), cb(t2, n2)].find(Boolean);
5810
+ return [ab(t2), sb(n2), lb(t2, n2)].find(Boolean);
5805
5811
  };
5806
- var ub = function(e5) {
5812
+ var db = function(e5) {
5807
5813
  return function(t2) {
5808
- var n2 = new RegExp(Ty, `g`), r2 = t2.replace(n2, ``);
5814
+ var n2 = new RegExp(Ey, `g`), r2 = t2.replace(n2, ``);
5809
5815
  return e5?.[r2];
5810
5816
  };
5811
5817
  };
5812
- var db = function(e5, t2, n2, r2) {
5818
+ var fb = function(e5, t2, n2, r2) {
5813
5819
  e5 === void 0 && (e5 = { main: [] }), r2 === void 0 && (r2 = {});
5814
- var i2 = lb({ key: t2, itemData: n2 });
5820
+ var i2 = ub({ key: t2, itemData: n2 });
5815
5821
  if (i2) throw i2;
5816
- var a2 = (eb(e5, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
5822
+ var a2 = (tb(e5, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
5817
5823
  if (o2 ??= ``, o2 = o2.endsWith(`/`) ? o2?.slice(0, -1) : o2, a2 && typeof a2 == `string`) {
5818
- var s2 = new RegExp(wy, `g`), c2 = a2.replace(s2, ub(n2));
5824
+ var s2 = new RegExp(Ty, `g`), c2 = a2.replace(s2, db(n2));
5819
5825
  return o2.concat(`/${c2}`);
5820
5826
  }
5821
5827
  };
5822
- var fb = /[.*+?^$()|]/g;
5823
- var pb = function(e5) {
5824
- var t2 = e5.replace(fb, `\\$&`).replace(new RegExp(wy, `g`), Ey);
5828
+ var pb = /[.*+?^$()|]/g;
5829
+ var mb = function(e5) {
5830
+ var t2 = e5.replace(pb, `\\$&`).replace(new RegExp(Ty, `g`), Dy);
5825
5831
  return RegExp(`^${t2}$`);
5826
5832
  };
5827
- var mb = function(e5, t2) {
5833
+ var hb = function(e5, t2) {
5828
5834
  return e5 === void 0 && (e5 = []), e5.find(function(e6) {
5829
- return pb(e6).test(t2);
5835
+ return mb(e6).test(t2);
5830
5836
  });
5831
5837
  };
5832
- tb(`url`, `Url must be a string`);
5833
- var hb = function(e5) {
5838
+ nb(`url`, `Url must be a string`);
5839
+ var gb = function(e5) {
5834
5840
  return [` `, ` `, `
5835
5841
  `].every(function(t2) {
5836
5842
  return !e5?.includes?.call(e5, t2);
5837
5843
  });
5838
5844
  };
5839
- var gb = function(e5) {
5840
- return e5?.length <= kb.MAX_URL_MAPPING_LENGTH;
5841
- };
5842
5845
  var _b = function(e5) {
5846
+ return e5?.length <= Ab.MAX_URL_MAPPING_LENGTH;
5847
+ };
5848
+ var vb = function(e5) {
5843
5849
  return e5?.split(`/`).every(Boolean);
5844
5850
  };
5845
- var vb = function(e5, t2) {
5851
+ var yb = function(e5, t2) {
5846
5852
  var n2 = t2.urlMappingKey;
5847
- return $y(n2)?.every(function(t3) {
5853
+ return eb(n2)?.every(function(t3) {
5848
5854
  return e5?.includes(`{{${t3}}}`);
5849
5855
  });
5850
5856
  };
5851
- var yb = function(e5) {
5852
- return (e5.match(new RegExp(wy, `g`))?.length || 0) <= 1;
5853
- };
5854
5857
  var bb = function(e5) {
5855
- return e5?.split(`/`).every(yb);
5858
+ return (e5.match(new RegExp(Ty, `g`))?.length || 0) <= 1;
5856
5859
  };
5857
5860
  var xb = function(e5) {
5861
+ return e5?.split(`/`).every(bb);
5862
+ };
5863
+ var Sb = function(e5) {
5858
5864
  return [e5.publishedPrefix, e5.savedPrefix].filter(Boolean);
5859
5865
  };
5860
- var Sb = function(e5, t2) {
5866
+ var Cb = function(e5, t2) {
5861
5867
  return t2 === void 0 && (t2 = []), function(n2, r2) {
5862
5868
  var i2 = n2.split(`/`), a2 = n2 === r2;
5863
5869
  if (i2.length < 1 || a2) return true;
@@ -5867,49 +5873,49 @@ var Sb = function(e5, t2) {
5867
5873
  });
5868
5874
  };
5869
5875
  };
5870
- var Cb = function(e5, t2) {
5876
+ var wb = function(e5, t2) {
5871
5877
  var n2 = t2.pathPrefixes;
5872
- return Sb(Object.values(n2).map(function(e6) {
5878
+ return Cb(Object.values(n2).map(function(e6) {
5873
5879
  return e6.publishedPrefix;
5874
- }).filter(Boolean), xb(t2.pathPrefix))(e5, t2.defaultMapping.defaultPublished);
5880
+ }).filter(Boolean), Sb(t2.pathPrefix))(e5, t2.defaultMapping.defaultPublished);
5875
5881
  };
5876
- var wb = function(e5, t2) {
5882
+ var Tb = function(e5, t2) {
5877
5883
  var n2 = t2.urlMappingKey, r2 = t2.urlMappings;
5878
- return !mb(r2.main?.filter(function(e6) {
5884
+ return !hb(r2.main?.filter(function(e6) {
5879
5885
  return n2 !== e6.key;
5880
5886
  }).map(function(e6) {
5881
5887
  return e6.mapping;
5882
5888
  }), e5);
5883
5889
  };
5884
- var Tb = function(e5) {
5885
- e5 = e5.replace(new RegExp(wy, `ig`), ``);
5890
+ var Eb = function(e5) {
5891
+ e5 = e5.replace(new RegExp(Ty, `ig`), ``);
5886
5892
  var t2 = new RegExp(/[^\]_.~!*'();:@&=+$,<>\\#^%?`"]/, `g`), n2 = !/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g.test(e5), r2 = !e5.replace(t2, ``);
5887
5893
  return n2 && r2;
5888
5894
  };
5889
- var Eb = function(e5) {
5895
+ var Db = function(e5) {
5890
5896
  var t2 = So(e5, 1)[0], n2 = e5.slice(-1);
5891
5897
  return t2 !== `/` && n2 !== `/`;
5892
5898
  };
5893
- var Db = function(e5, t2) {
5899
+ var Ob = function(e5, t2) {
5894
5900
  var n2 = t2.pathPrefixes;
5895
- return Sb(Object.values(n2).map(function(e6) {
5901
+ return Cb(Object.values(n2).map(function(e6) {
5896
5902
  return e6.savedPrefix;
5897
- }).filter(Boolean), xb(t2.pathPrefix))(e5, t2.defaultMapping.defaultSaved);
5903
+ }).filter(Boolean), Sb(t2.pathPrefix))(e5, t2.defaultMapping.defaultSaved);
5898
5904
  };
5899
- var Ob;
5905
+ var kb;
5900
5906
  (function(e5) {
5901
5907
  e5.MAX_LENGTH_ERROR = `MAX_LENGTH_ERROR`, e5.NO_SPACES_ERROR = `NO_SPACES_ERROR`, e5.NO_EMPTY_SEGMENT_ERROR = `NO_EMPTY_SEGMENT_ERROR`, e5.CONTAIN_MAIN_VARIABLE_ERROR = `CONTAIN_MAIN_VARIABLE_ERROR`, e5.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR = `ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR`, e5.ONLY_UNIQUE_PUBLISHED_URL_ERROR = `ONLY_UNIQUE_PUBLISHED_URL_ERROR`, e5.ONLY_UNIQUE_SAVED_URL_ERROR = `ONLY_UNIQUE_SAVED_URL_ERROR`, e5.ONLY_UNIQUE_MAPPING_ERROR = `ONLY_UNIQUE_MAPPING_ERROR`, e5.NO_INVALID_CHARACTERS_ERROR = `NO_INVALID_CHARACTERS_ERROR`, e5.NO_STARTING_OR_ENDING_SLASH_ERROR = `NO_STARTING_OR_ENDING_SLASH_ERROR`;
5902
- })(Ob ||= {});
5903
- var kb = function() {
5908
+ })(kb ||= {});
5909
+ var Ab = function() {
5904
5910
  function e5(e6) {
5905
5911
  var t2 = e6.urlMappingKey, n2 = e6.pathPrefixes, r2 = e6.urlMappings, i2 = this;
5906
5912
  this.initValidators = function() {
5907
- i2.validators = [[gb, Ob.MAX_LENGTH_ERROR], [hb, Ob.NO_SPACES_ERROR], [Eb, Ob.NO_STARTING_OR_ENDING_SLASH_ERROR], [_b, Ob.NO_EMPTY_SEGMENT_ERROR], [Tb, Ob.NO_INVALID_CHARACTERS_ERROR], [vb, Ob.CONTAIN_MAIN_VARIABLE_ERROR], [bb, Ob.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [Cb, Ob.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [Db, Ob.ONLY_UNIQUE_SAVED_URL_ERROR], [wb, Ob.ONLY_UNIQUE_MAPPING_ERROR]];
5908
- }, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = Ab(t2, this.pathPrefix), this.initValidators();
5913
+ i2.validators = [[_b, kb.MAX_LENGTH_ERROR], [gb, kb.NO_SPACES_ERROR], [Db, kb.NO_STARTING_OR_ENDING_SLASH_ERROR], [vb, kb.NO_EMPTY_SEGMENT_ERROR], [Eb, kb.NO_INVALID_CHARACTERS_ERROR], [yb, kb.CONTAIN_MAIN_VARIABLE_ERROR], [xb, kb.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [wb, kb.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [Ob, kb.ONLY_UNIQUE_SAVED_URL_ERROR], [Tb, kb.ONLY_UNIQUE_MAPPING_ERROR]];
5914
+ }, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = jb(t2, this.pathPrefix), this.initValidators();
5909
5915
  }
5910
5916
  return e5.prototype.getPathPrefix = function() {
5911
- var t2 = Zy(this.urlMappingKey);
5912
- if (!t2) throw Jy(this.urlMappingKey) ? Error(`Url Mapper Validator Error: Validator does not support sub mapping, please use the main url mapping key`) : Error(`Url Mapper Validator Error: Url mapping key is not supported (${this.urlMappingKey})`);
5917
+ var t2 = Qy(this.urlMappingKey);
5918
+ if (!t2) throw Yy(this.urlMappingKey) ? Error(`Url Mapper Validator Error: Validator does not support sub mapping, please use the main url mapping key`) : Error(`Url Mapper Validator Error: Url mapping key is not supported (${this.urlMappingKey})`);
5913
5919
  return this.pathPrefixes[t2] || e5.FALLBACK_PATH_PREFIX;
5914
5920
  }, Object.defineProperty(e5.prototype, "validatorProps", { get: function() {
5915
5921
  var e6 = this;
@@ -5931,59 +5937,59 @@ var kb = function() {
5931
5937
  }
5932
5938
  }
5933
5939
  return { isValid: true };
5934
- }, e5.errorArray = Object.values(Ob), e5.MAX_URL_MAPPING_LENGTH = 1e3, e5.FALLBACK_PATH_PREFIX = `unknown`, e5;
5940
+ }, e5.errorArray = Object.values(kb), e5.MAX_URL_MAPPING_LENGTH = 1e3, e5.FALLBACK_PATH_PREFIX = `unknown`, e5;
5935
5941
  }();
5936
- var Ab = function(e5, t2) {
5937
- var n2 = Yy()[e5] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
5938
- return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = kb.FALLBACK_PATH_PREFIX, a2.publishedPrefix = kb.FALLBACK_PATH_PREFIX), { defaultSaved: Co([a2.savedPrefix, i2], So(r2?.map(function(e6) {
5942
+ var jb = function(e5, t2) {
5943
+ var n2 = Xy()[e5] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
5944
+ return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = Ab.FALLBACK_PATH_PREFIX, a2.publishedPrefix = Ab.FALLBACK_PATH_PREFIX), { defaultSaved: Co([a2.savedPrefix, i2], So(r2?.map(function(e6) {
5939
5945
  return `{{${e6}}}`;
5940
5946
  })), false).filter(Boolean).join(`/`), defaultPublished: Co([a2.publishedPrefix, i2], So(r2?.map(function(e6) {
5941
5947
  return `{{${e6}}}`;
5942
5948
  })), false).filter(Boolean).join(`/`) };
5943
5949
  };
5944
- function jb(e5, t2) {
5945
- return t2 ? db(e5, $.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
5950
+ function Mb(e5, t2) {
5951
+ return t2 ? fb(e5, $.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
5946
5952
  }
5947
- var Mb = { courseNavigationTarget: `servicePage`, classAppointmentNavigationTarget: `servicePage` };
5948
- function Nb({ actionState: e5, serviceType: t2, config: n2 }) {
5953
+ var Nb = { courseNavigationTarget: `servicePage`, classAppointmentNavigationTarget: `servicePage` };
5954
+ function Pb({ actionState: e5, serviceType: t2, config: n2 }) {
5949
5955
  return e5 === Mh.VIEW_COURSE ? `servicePage` : gp(t2) ? n2.courseNavigationTarget : n2.classAppointmentNavigationTarget;
5950
5956
  }
5951
- function Pb(e5, t2, n2) {
5952
- return e5 === `bookingForm` && !gp(t2) && !Fv(n2);
5957
+ function Fb(e5, t2, n2) {
5958
+ return e5 === `bookingForm` && !gp(t2) && !Iv(n2);
5953
5959
  }
5954
- function Fb(e5, t2) {
5960
+ function Ib(e5, t2) {
5955
5961
  let n2 = e5(t2);
5956
5962
  return n2 ? n2.replace(/\/$/, ``) || `/` : null;
5957
5963
  }
5958
- function Ib(e5, t2, n2) {
5964
+ function Lb(e5, t2, n2) {
5959
5965
  let r2 = e5(t2);
5960
5966
  return !r2 || !n2 ? null : `${r2.replace(/\/$/, ``)}/${n2}`;
5961
5967
  }
5962
- function Lb(e5, t2) {
5968
+ function Rb(e5, t2) {
5963
5969
  switch (e5) {
5964
5970
  case `servicePage`:
5965
- return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? Ib(t2.appSectionUrl, lp.SERVICE_PAGE, t2.slug);
5971
+ return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? Lb(t2.appSectionUrl, lp.SERVICE_PAGE, t2.slug);
5966
5972
  case `bookingCalendar`:
5967
- return t2.isMultiService ? Fb(t2.appSectionUrl, lp.CALENDAR_PAGE) : Ib(t2.appSectionUrl, lp.CALENDAR_PAGE, t2.slug);
5973
+ return t2.isMultiService ? Ib(t2.appSectionUrl, lp.CALENDAR_PAGE) : Lb(t2.appSectionUrl, lp.CALENDAR_PAGE, t2.slug);
5968
5974
  case `bookingForm`:
5969
- return t2.serviceId ? Ib(t2.appSectionUrl, lp.FORM_PAGE, t2.slug) : null;
5975
+ return t2.serviceId ? Lb(t2.appSectionUrl, lp.FORM_PAGE, t2.slug) : null;
5970
5976
  default:
5971
5977
  return null;
5972
5978
  }
5973
5979
  }
5974
- var Rb = (e5) => e5.target === `_blank`;
5975
- var zb = (e5, t2) => t2 === `/` ? e5 : new URL(`.${t2}`, `${e5}/`).href;
5976
- var Bb = (e5, t2, n2) => n2 ? `.${t2}` : Vb(e5, t2);
5977
- var Vb = (e5, t2) => e5 ? zb(e5, t2) : t2;
5978
- var Hb = () => {
5979
- let { previewMode: e5 } = (0, import_services_manager_react.useService)(xy), t2 = (0, import_services_manager_react.useService)(Qo), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: r2 } = (0, import_services_manager_react.useService)(Sy), a2 = (0, import_services_manager_react.useService)(Cy), o2 = (0, import_services_manager_react.useGetService)(), s2 = (0, import_react.useCallback)(async (t3) => {
5980
- let i2 = Bb(n2, t3, e5);
5980
+ var zb = (e5) => e5.target === `_blank`;
5981
+ var Bb = (e5, t2) => t2 === `/` ? e5 : new URL(`.${t2}`, `${e5}/`).href;
5982
+ var Vb = (e5, t2, n2) => n2 ? `.${t2}` : Hb(e5, t2);
5983
+ var Hb = (e5, t2) => e5 ? Bb(e5, t2) : t2;
5984
+ var Ub = () => {
5985
+ let { previewMode: e5 } = (0, import_services_manager_react.useService)(Sy), t2 = (0, import_services_manager_react.useService)(Qo), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: r2 } = (0, import_services_manager_react.useService)(Cy), a2 = (0, import_services_manager_react.useService)(wy), o2 = (0, import_services_manager_react.useGetService)(), s2 = (0, import_react.useCallback)(async (t3) => {
5986
+ let i2 = Vb(n2, t3, e5);
5981
5987
  await r2({ href: i2 });
5982
5988
  }, [e5, n2, r2]), c2 = (0, import_react.useCallback)(async (e6) => {
5983
- await r2(Rb(e6) ? { href: e6.href, type: `ExternalLink`, target: `_blank` } : { href: e6.href });
5984
- }, [r2]), l2 = (0, import_react.useCallback)((e6) => Vb(n2, e6), [n2]), u2 = (0, import_react.useCallback)((e6) => t2.appSectionRelativeUrl(ap, e6), [t2]), p2 = (0, import_react.useCallback)((e6) => jb(a2.urlMappings, e6), [a2]), m2 = (0, import_react.useCallback)((e6, t3) => Lb(e6, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: p2 }), [u2, p2]), h2 = (0, import_react.useCallback)((e6, t3) => {
5989
+ await r2(zb(e6) ? { href: e6.href, type: `ExternalLink`, target: `_blank` } : { href: e6.href });
5990
+ }, [r2]), l2 = (0, import_react.useCallback)((e6) => Hb(n2, e6), [n2]), u2 = (0, import_react.useCallback)((e6) => t2.appSectionRelativeUrl(ap, e6), [t2]), p2 = (0, import_react.useCallback)((e6) => Mb(a2.urlMappings, e6), [a2]), m2 = (0, import_react.useCallback)((e6, t3) => Rb(e6, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: p2 }), [u2, p2]), h2 = (0, import_react.useCallback)((e6, t3) => {
5985
5991
  let r3 = m2(e6, t3);
5986
- return r3 && n2 ? zb(n2, r3) : null;
5992
+ return r3 && n2 ? Bb(n2, r3) : null;
5987
5993
  }, [m2, n2]), g2 = (0, import_react.useCallback)((e6, t3) => {
5988
5994
  let n3 = m2(e6, t3);
5989
5995
  n3 && s2(n3);
@@ -5993,7 +5999,7 @@ var Hb = () => {
5993
5999
  return t3 ? `${t3}/${e6}?origin=bookings` : void 0;
5994
6000
  }, [v2]) };
5995
6001
  };
5996
- function Ub(e5) {
6002
+ function Wb(e5) {
5997
6003
  (0, import_react.useEffect)(() => {
5998
6004
  let t2 = (t3) => {
5999
6005
  t3.persisted && e5();
@@ -6001,49 +6007,49 @@ function Ub(e5) {
6001
6007
  return window.addEventListener(`pageshow`, t2), () => window.removeEventListener(`pageshow`, t2);
6002
6008
  }, [e5]);
6003
6009
  }
6004
- function Wb(e5) {
6010
+ function Gb(e5) {
6005
6011
  let t2 = av(e5.get(Rp.blob));
6006
6012
  return t2?.services.length ? t2 : null;
6007
6013
  }
6008
- var Gb = { displayTimeZonePolicy: { basedOn: tp.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
6009
- async function Kb() {
6014
+ var Kb = { displayTimeZonePolicy: { basedOn: tp.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
6015
+ async function qb() {
6010
6016
  try {
6011
6017
  let e5 = await ip();
6012
6018
  return { displayTimeZonePolicy: { basedOn: e5.displayTimeZone?.basedOn ?? tp.BUSINESS_TIME_ZONE, customerCanChange: e5.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e5.multiServiceAppointments?.enabled ?? false };
6013
6019
  } catch (e5) {
6014
- return Jo(e5, { feature: Ko.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), Gb;
6020
+ return Jo(e5, { feature: Ko.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), Kb;
6015
6021
  }
6016
6022
  }
6017
- var qb = { isLoading: true };
6018
- var Jb = (0, import_react.createContext)(null);
6019
- var Yb = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
6020
- function Xb() {
6021
- let e5 = (0, import_react.useContext)(Jb);
6022
- if (!e5) throw Error(Yb);
6023
+ var Jb = { isLoading: true };
6024
+ var Yb = (0, import_react.createContext)(null);
6025
+ var Xb = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
6026
+ function Zb() {
6027
+ let e5 = (0, import_react.useContext)(Yb);
6028
+ if (!e5) throw Error(Xb);
6023
6029
  return e5;
6024
6030
  }
6025
- function Zb() {
6026
- return Xb().isLoading;
6031
+ function Qb() {
6032
+ return Zb().isLoading;
6027
6033
  }
6028
- function Qb({ children: e5 }) {
6029
- return (0, import_jsx_runtime.jsx)(Jb.Provider, { value: qb, children: e5 });
6034
+ function $b({ children: e5 }) {
6035
+ return (0, import_jsx_runtime.jsx)(Yb.Provider, { value: Jb, children: e5 });
6030
6036
  }
6031
- function $b(e5) {
6037
+ function ex(e5) {
6032
6038
  return e5.basedOn === tp.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
6033
6039
  }
6034
- function ex() {
6035
- let e5 = Xb();
6036
- return e5.isLoading ? void 0 : $b(e5.displayTimeZonePolicy);
6040
+ function tx() {
6041
+ let e5 = Zb();
6042
+ return e5.isLoading ? void 0 : ex(e5.displayTimeZonePolicy);
6037
6043
  }
6038
- function tx({ settingsPromise: e5, children: t2 }) {
6044
+ function nx({ settingsPromise: e5, children: t2 }) {
6039
6045
  let n2 = ms(e5), r2 = (0, import_react.useMemo)(() => ({ isLoading: false, ...n2 }), [n2]);
6040
- return (0, import_jsx_runtime.jsx)(Jb.Provider, { value: r2, children: t2 });
6046
+ return (0, import_jsx_runtime.jsx)(Yb.Provider, { value: r2, children: t2 });
6041
6047
  }
6042
- function nx({ bookingsSettings: e5, children: n2 }) {
6043
- let r2 = ny(), [i2] = (0, import_react.useState)(() => e5 ? null : by({ key: ly(), warmupData: r2, fetchData: Kb }));
6044
- return e5 ? (0, import_jsx_runtime.jsx)(Jb.Provider, { value: { isLoading: false, ...e5 }, children: n2 }) : (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Jb.Provider, { value: qb, children: n2 }), children: (0, import_jsx_runtime.jsx)(tx, { settingsPromise: i2, children: n2 }) });
6048
+ function rx({ bookingsSettings: e5, children: n2 }) {
6049
+ let r2 = ry(), [i2] = (0, import_react.useState)(() => e5 ? null : xy({ key: uy(), warmupData: r2, fetchData: qb }));
6050
+ return e5 ? (0, import_jsx_runtime.jsx)(Yb.Provider, { value: { isLoading: false, ...e5 }, children: n2 }) : (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Yb.Provider, { value: Jb, children: n2 }), children: (0, import_jsx_runtime.jsx)(nx, { settingsPromise: i2, children: n2 }) });
6045
6051
  }
6046
- function rx({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, rescheduleRequest: r2 = null, editingSurface: i2 = false, children: a2 }) {
6052
+ function ix({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, rescheduleRequest: r2 = null, editingSurface: i2 = false, children: a2 }) {
6047
6053
  let o2 = r2 ? { status: `loading`, booking: null, validUntil: null, planName: null } : null, s2 = { service: null, serviceName: null, serviceDescription: null, serviceTagLine: null, serviceDefaultDuration: null, serviceImage: null, serviceSlug: null, servicePageLink: null, serviceId: null, serviceType: null, servicePrice: zh, isVariedService: false, serviceOptionsAndVariants: null, pricingOption: null, isLoadingServiceOptionsAndVariants: e5, hasAddOns: false, isConferenceEnabled: false, offeredDays: [], courseAvailability: null, courseStartDate: null, courseEndDate: null, staffMembers: [], coverImage: void 0, gallery: [], serviceLocations: [], policyDescription: null, serviceBookability: { state: bh.AVAILABLE, isAvailableForBooking: false, bookingOpensAt: null }, displayTimeZone: `UTC`, isAvailableForBooking: () => false, hasPolicyDescription: () => false, hasCoverImage: () => false, hasGalleryImages: () => false, isVariantDuration: () => false, isLoading: e5, hasError: t2, locale: `en-US`, selectStaffMember: () => {
6048
6054
  }, clearSelection: () => {
6049
6055
  }, clearStaffMember: () => {
@@ -6059,90 +6065,90 @@ function rx({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, reschedu
6059
6065
  }, navigateToMultiServiceForm: () => {
6060
6066
  }, resolveNextPageHref: () => null, isNavigating: false, isWaitlistSlotSelected: false, siteId: ``, editingSurface: i2, openPreferences: () => Promise.resolve(), multiServiceAppointmentsEnabled: false, isMultiServiceAppointment: false, multiServiceAppointmentServices: [], multiServiceAppointmentSelections: [], multiServiceAppointmentOptionsAndVariants: {}, multiServiceAppointmentVariantsStatus: `ready`, bookingsSettingsLoading: n2, reschedule: o2, rescheduleBooking: async () => ({ outcome: `failed` }), goHomeAfterReschedule: () => {
6061
6067
  }, canRescheduleToPick: false };
6062
- return (0, import_jsx_runtime.jsx)(Rx.Provider, { value: s2, children: a2 });
6063
- }
6064
- function ix({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
6065
- return (0, import_jsx_runtime.jsx)(Qb, { children: (0, import_jsx_runtime.jsx)(rx, { isLoading: true, hasError: false, bookingsSettingsLoading: true, rescheduleRequest: e5, editingSurface: t2, children: n2 }) });
6068
+ return (0, import_jsx_runtime.jsx)(zx.Provider, { value: s2, children: a2 });
6066
6069
  }
6067
6070
  function ax({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
6068
- let r2 = Zb();
6069
- return (0, import_jsx_runtime.jsx)(rx, { isLoading: false, hasError: true, bookingsSettingsLoading: r2, rescheduleRequest: e5, editingSurface: t2, children: n2 });
6071
+ return (0, import_jsx_runtime.jsx)($b, { children: (0, import_jsx_runtime.jsx)(ix, { isLoading: true, hasError: false, bookingsSettingsLoading: true, rescheduleRequest: e5, editingSurface: t2, children: n2 }) });
6072
+ }
6073
+ function ox({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
6074
+ let r2 = Qb();
6075
+ return (0, import_jsx_runtime.jsx)(ix, { isLoading: false, hasError: true, bookingsSettingsLoading: r2, rescheduleRequest: e5, editingSurface: t2, children: n2 });
6070
6076
  }
6071
- var { RateType: ox } = Pc;
6072
- function sx(e5, t2) {
6077
+ var { RateType: sx } = Pc;
6078
+ function cx(e5, t2) {
6073
6079
  if (e5) return t2 ? em(e5, t2)?.toISOString() ?? e5 : e5;
6074
6080
  }
6075
- var cx = { BUSINESS: `OWNER_BUSINESS`, CUSTOM: `OWNER_CUSTOM`, CUSTOMER: `CUSTOM` };
6076
- function lx(e5) {
6077
- return e5 ? cx[e5] : cx.BUSINESS;
6081
+ var lx = { BUSINESS: `OWNER_BUSINESS`, CUSTOM: `OWNER_CUSTOM`, CUSTOMER: `CUSTOM` };
6082
+ function ux(e5) {
6083
+ return e5 ? lx[e5] : lx.BUSINESS;
6078
6084
  }
6079
- function ux(e5, t2) {
6080
- let n2 = bv(e5), r2 = n2 && !n2.anyResource ? n2.staffMemberId : null;
6081
- return { serviceId: e5.serviceId, scheduleId: e5.scheduleId, startDate: sx(e5.slotStart, t2), endDate: sx(e5.slotEnd, t2), timezone: t2, eventId: e5.eventId, sessionId: e5.sessionId, location: e5.locationId || e5.locationType ? { ...e5.locationId ? { _id: e5.locationId } : {}, locationType: lx(e5.locationType) } : void 0, resource: r2 ? { _id: r2 } : void 0, resourceSelections: !r2 && mp(e5.serviceType) ? [{ resourceTypeId: cp, selectionMethod: `ANY_RESOURCE`, ...n2?.anyResource && e5.requestedGender ? { requestedGender: { gender: e5.requestedGender } } : {} }] : void 0 };
6085
+ function dx(e5, t2) {
6086
+ let n2 = xv(e5), r2 = n2 && !n2.anyResource ? n2.staffMemberId : null;
6087
+ return { serviceId: e5.serviceId, scheduleId: e5.scheduleId, startDate: cx(e5.slotStart, t2), endDate: cx(e5.slotEnd, t2), timezone: t2, eventId: e5.eventId, sessionId: e5.sessionId, location: e5.locationId || e5.locationType ? { ...e5.locationId ? { _id: e5.locationId } : {}, locationType: ux(e5.locationType) } : void 0, resource: r2 ? { _id: r2 } : void 0, resourceSelections: !r2 && mp(e5.serviceType) ? [{ resourceTypeId: cp, selectionMethod: `ANY_RESOURCE`, ...n2?.anyResource && e5.requestedGender ? { requestedGender: { gender: e5.requestedGender } } : {} }] : void 0 };
6082
6088
  }
6083
- var dx = `manage_booking_standalone_page`;
6084
- function fx(e5) {
6089
+ var fx = `manage_booking_standalone_page`;
6090
+ function px(e5) {
6085
6091
  let t2 = e5.get(Rp.bookingId) || null, n2 = e5.get(Rp.token) || null;
6086
- return !t2 && !n2 ? null : { bookingId: t2, token: n2, fromManageBookingPage: e5.get(Rp.referral) === dx, redirectUrl: e5.get(Rp.rescheduleRedirectUrl) || null };
6092
+ return !t2 && !n2 ? null : { bookingId: t2, token: n2, fromManageBookingPage: e5.get(Rp.referral) === fx, redirectUrl: e5.get(Rp.rescheduleRedirectUrl) || null };
6087
6093
  }
6088
- function px(e5, t2, n2, r2 = null) {
6094
+ function mx(e5, t2, n2, r2 = null) {
6089
6095
  if (n2.kind === `class`) return { eventId: e5.eventId };
6090
- let { serviceId: i2, scheduleId: a2, startDate: o2, endDate: s2, location: c2, resource: l2, resourceSelections: u2 } = ux(e5, t2);
6096
+ let { serviceId: i2, scheduleId: a2, startDate: o2, endDate: s2, location: c2, resource: l2, resourceSelections: u2 } = dx(e5, t2);
6091
6097
  return { serviceId: i2, scheduleId: a2, startDate: o2, endDate: s2, timezone: t2, ...c2 ? { location: { ...c2._id ? { _id: c2._id } : {}, locationType: c2.locationType, ...n2.customAddress !== null && c2.locationType === `CUSTOM` ? { formattedAddress: n2.customAddress } : {} } } : {}, ...l2?._id ? { resource: { _id: l2._id } } : r2 ? { resource: { _id: r2 } } : u2 ? { resourceSelections: u2 } : {} };
6092
6098
  }
6093
- var mx = class extends Error {
6099
+ var hx = class extends Error {
6094
6100
  reason;
6095
6101
  cause;
6096
6102
  constructor(e5, t2) {
6097
6103
  super(`Booking to reschedule not loaded: ${e5}`), this.reason = e5, this.cause = t2;
6098
6104
  }
6099
6105
  };
6100
- var hx = (e5) => e5?.status;
6101
- function gx(e5) {
6106
+ var gx = (e5) => e5?.status;
6107
+ function _x(e5) {
6102
6108
  return e5?.includes(`INDIVIDUAL`) ? `appointment` : e5?.includes(`GROUP`) ? `class` : `other`;
6103
6109
  }
6104
- function _x({ totalParticipants: e5, participantsChoices: t2 }) {
6110
+ function vx({ totalParticipants: e5, participantsChoices: t2 }) {
6105
6111
  return e5 || (t2?.serviceChoices ?? []).reduce((e6, t3) => e6 + (t3.numberOfParticipants ?? 1), 0) || 1;
6106
6112
  }
6107
- function vx(e5) {
6113
+ function yx(e5) {
6108
6114
  if (!e5) return null;
6109
6115
  let t2 = new Date(e5);
6110
6116
  return Number.isNaN(t2.getTime()) ? null : t2.toISOString();
6111
6117
  }
6112
- function yx(e5, t2) {
6118
+ function bx(e5, t2) {
6113
6119
  let { slot: n2, schedule: r2, tags: i2 } = e5.bookedEntity ?? {}, a2 = n2?.location;
6114
- return { bookingId: t2, revision: e5.revision ?? null, serviceId: n2?.serviceId ?? r2?.serviceId ?? null, kind: gx(i2), startDate: vx(e5.startDate), participants: _x(e5), addOnIds: (e5.bookedAddOns ?? []).flatMap((e6) => e6._id ?? []), locationId: a2?._id ?? null, customAddress: a2?.locationType === `CUSTOM` ? a2.formattedAddress ?? `` : null };
6120
+ return { bookingId: t2, revision: e5.revision ?? null, serviceId: n2?.serviceId ?? r2?.serviceId ?? null, kind: _x(i2), startDate: yx(e5.startDate), participants: vx(e5), addOnIds: (e5.bookedAddOns ?? []).flatMap((e6) => e6._id ?? []), locationId: a2?._id ?? null, customAddress: a2?.locationType === `CUSTOM` ? a2.formattedAddress ?? `` : null };
6115
6121
  }
6116
- async function bx({ bookingId: e5, token: t2 }) {
6122
+ async function xx({ bookingId: e5, token: t2 }) {
6117
6123
  let n2;
6118
6124
  try {
6119
6125
  t2 ? n2 = (await Jf(t2)).booking : e5 && (n2 = (await Sc({ filter: { _id: e5 }, cursorPaging: { limit: 1 } }, {})).extendedBookings?.[0]?.booking);
6120
6126
  } catch (e6) {
6121
- let t3 = hx(e6);
6122
- throw t3 === 404 ? new mx(`notFound`, e6) : new mx(t3 === 403 ? `accessDenied` : `failed`, e6);
6127
+ let t3 = gx(e6);
6128
+ throw t3 === 404 ? new hx(`notFound`, e6) : new hx(t3 === 403 ? `accessDenied` : `failed`, e6);
6123
6129
  }
6124
6130
  let r2 = n2?._id;
6125
- if (!n2 || !r2) throw new mx(`notFound`);
6126
- let i2 = yx(n2, r2);
6131
+ if (!n2 || !r2) throw new hx(`notFound`);
6132
+ let i2 = bx(n2, r2);
6127
6133
  return t2 ? { ...i2, customAddress: null } : i2;
6128
6134
  }
6129
- function xx(e5) {
6135
+ function Sx(e5) {
6130
6136
  let t2 = e5?.bookedEntity?.slot;
6131
6137
  return { staffName: t2?.resource?.name || null, locationName: t2?.location?.name || t2?.location?.formattedAddress || null };
6132
6138
  }
6133
- async function Sx({ booking: e5, slot: t2, token: n2 }) {
6134
- return xx(n2 ? (await qf(n2, t2, { revision: e5.revision || `1` })).booking : (await Yf(e5.bookingId, t2, { revision: e5.revision ?? `` })).booking);
6139
+ async function Cx({ booking: e5, slot: t2, token: n2 }) {
6140
+ return Sx(n2 ? (await qf(n2, t2, { revision: e5.revision || `1` })).booking : (await Yf(e5.bookingId, t2, { revision: e5.revision ?? `` })).booking);
6135
6141
  }
6136
- var Cx = { validUntil: null, planName: null };
6137
- async function wx(e5) {
6142
+ var wx = { validUntil: null, planName: null };
6143
+ async function Tx(e5) {
6138
6144
  try {
6139
6145
  let t2 = (await Sc({ filter: { _id: e5 }, cursorPaging: { limit: 1 } }, { withEcomTransactions: true })).extendedBookings?.[0]?.transactions?.chargedMembershipPaymentDetails;
6140
- return t2 ? { validUntil: t2.expirationDate ? new Date(t2.expirationDate).toISOString() : null, planName: t2.name?.translated || t2.name?.original || null } : Cx;
6146
+ return t2 ? { validUntil: t2.expirationDate ? new Date(t2.expirationDate).toISOString() : null, planName: t2.name?.translated || t2.name?.original || null } : wx;
6141
6147
  } catch (e6) {
6142
- return Jo(e6, { feature: Ko.reschedule, action: `fetch-plan-valid-until`, level: `warning` }), Cx;
6148
+ return Jo(e6, { feature: Ko.reschedule, action: `fetch-plan-valid-until`, level: `warning` }), wx;
6143
6149
  }
6144
6150
  }
6145
- function Tx() {
6151
+ function Ex() {
6146
6152
  let e5 = ds();
6147
6153
  return (0, import_react.useCallback)(() => {
6148
6154
  if (!e5) return null;
@@ -6153,25 +6159,25 @@ function Tx() {
6153
6159
  }
6154
6160
  }, [e5]);
6155
6161
  }
6156
- var Ex = Zo(`@wix/viewer-service-site-members`);
6157
- function Dx() {
6162
+ var Dx = Zo(`@wix/viewer-service-site-members`);
6163
+ function Ox() {
6158
6164
  try {
6159
6165
  return (0, import_services_manager_react.useGetService)();
6160
6166
  } catch {
6161
6167
  return null;
6162
6168
  }
6163
6169
  }
6164
- function Ox(e5) {
6170
+ function kx(e5) {
6165
6171
  try {
6166
- return e5 ? e5(Ex) : null;
6172
+ return e5 ? e5(Dx) : null;
6167
6173
  } catch {
6168
6174
  return null;
6169
6175
  }
6170
6176
  }
6171
- function kx() {
6172
- return Ox(Dx());
6177
+ function Ax() {
6178
+ return kx(Ox());
6173
6179
  }
6174
- function Ax(e5) {
6180
+ function jx(e5) {
6175
6181
  if (!e5) return null;
6176
6182
  try {
6177
6183
  let t2 = new URL(e5);
@@ -6180,95 +6186,95 @@ function Ax(e5) {
6180
6186
  return null;
6181
6187
  }
6182
6188
  }
6183
- function jx(e5, { bookable: t2, staffChoiceRequired: n2, timezone: r2, validUntil: i2 }) {
6184
- if (!Fv(e5) || !t2) return false;
6185
- let a2 = bv(e5);
6189
+ function Mx(e5, { bookable: t2, staffChoiceRequired: n2, timezone: r2, validUntil: i2 }) {
6190
+ if (!Iv(e5) || !t2) return false;
6191
+ let a2 = xv(e5);
6186
6192
  if (n2 && (!a2 || a2.anyResource)) return false;
6187
6193
  let o2 = e5.slotStart ? em(e5.slotStart, r2) : null;
6188
6194
  return !i2 || !o2 || o2.getTime() <= Date.parse(i2);
6189
6195
  }
6190
- var Mx = { validUntil: null, planName: null };
6191
- var Nx = { status: `loading`, booking: null, ...Mx };
6192
- async function Px(e5) {
6196
+ var Nx = { validUntil: null, planName: null };
6197
+ var Px = { status: `loading`, booking: null, ...Nx };
6198
+ async function Fx(e5) {
6193
6199
  return e5.getMemberDetails ? !!await e5.getMemberDetails().catch(() => null) : !!e5.isInitiallyLoggedIn;
6194
6200
  }
6195
- async function Fx(e5, t2) {
6201
+ async function Ix(e5, t2) {
6196
6202
  let { bookingId: n2, token: r2 } = e5;
6197
- if (!r2 && !(t2 && await Px(t2)) && !(t2 && await t2.promptLogin({ mode: `login` }).then(() => true, () => false))) return { status: `loginRequired`, booking: null, ...Mx };
6203
+ if (!r2 && !(t2 && await Fx(t2)) && !(t2 && await t2.promptLogin({ mode: `login` }).then(() => true, () => false))) return { status: `loginRequired`, booking: null, ...Nx };
6198
6204
  try {
6199
- let [t3, i2] = await Promise.all([bx(e5), n2 && !r2 ? wx(n2) : Mx]);
6205
+ let [t3, i2] = await Promise.all([xx(e5), n2 && !r2 ? Tx(n2) : Nx]);
6200
6206
  return { status: `ready`, booking: t3, validUntil: i2.validUntil, planName: i2.planName };
6201
6207
  } catch (e6) {
6202
- return Jo(e6, { feature: Ko.reschedule, action: `fetch-booking` }), { status: e6 instanceof mx ? e6.reason : `failed`, booking: null, ...Mx };
6208
+ return Jo(e6, { feature: Ko.reschedule, action: `fetch-booking` }), { status: e6 instanceof hx ? e6.reason : `failed`, booking: null, ...Nx };
6203
6209
  }
6204
6210
  }
6205
- var Ix = /* @__PURE__ */ new Map();
6206
- function Lx(e5, t2, n2) {
6207
- let r2 = `${e5.bookingId ?? ``}|${e5.token ?? ``}`, i2 = Ix.get(r2) ?? { load: Fx(e5, t2), users: 0 };
6208
- return i2.users += 1, Ix.set(r2, i2), i2.load.then(n2), () => {
6209
- --i2.users, i2.users === 0 && Ix.get(r2) === i2 && Ix.delete(r2);
6211
+ var Lx = /* @__PURE__ */ new Map();
6212
+ function Rx(e5, t2, n2) {
6213
+ let r2 = `${e5.bookingId ?? ``}|${e5.token ?? ``}`, i2 = Lx.get(r2) ?? { load: Ix(e5, t2), users: 0 };
6214
+ return i2.users += 1, Lx.set(r2, i2), i2.load.then(n2), () => {
6215
+ --i2.users, i2.users === 0 && Lx.get(r2) === i2 && Lx.delete(r2);
6210
6216
  };
6211
6217
  }
6212
- var Rx = (0, import_react.createContext)(null);
6213
- var zx = `useServiceContext must be used within ServiceContextProvider`;
6214
- function Bx(e5 = false) {
6215
- let t2 = (0, import_react.useContext)(Rx);
6216
- if (!t2 && !e5) throw Error(zx);
6218
+ var zx = (0, import_react.createContext)(null);
6219
+ var Bx = `useServiceContext must be used within ServiceContextProvider`;
6220
+ function Vx(e5 = false) {
6221
+ let t2 = (0, import_react.useContext)(zx);
6222
+ if (!t2 && !e5) throw Error(Bx);
6217
6223
  return t2;
6218
6224
  }
6219
- function Vx(e5, t2, n2) {
6225
+ function Hx(e5, t2, n2) {
6220
6226
  if (e5) return { by: `slug`, value: e5 };
6221
6227
  let r2 = t2?.services ?? [];
6222
6228
  return ov(t2) ? { by: `multi`, serviceIds: r2.map(({ serviceId: e6 }) => e6) } : r2.length === 1 ? { by: `id`, value: r2[0].serviceId } : n2 ? { by: `id`, value: n2 } : { by: `none` };
6223
6229
  }
6224
- var Hx = (e5) => void 0;
6225
- var Ux = (e5, t2) => av(t2.get(Rp.blob))?.services.find((t3) => t3.serviceId === e5);
6226
- var Wx = (e5, t2) => {
6227
- let n2 = Ux(e5, t2) ?? uv(e5), r2 = Hx(e5);
6228
- return r2 === void 0 ? n2 : xv(n2, r2);
6229
- };
6230
+ var Ux = (e5) => void 0;
6231
+ var Wx = (e5, t2) => av(t2.get(Rp.blob))?.services.find((t3) => t3.serviceId === e5);
6230
6232
  var Gx = (e5, t2) => {
6231
- let n2 = Wx(e5, t2), r2 = t2.get(Rp.resource), i2 = Hx(e5) !== void 0 || !!Ux(e5, t2);
6232
- return r2 && !i2 ? xv(n2, r2) : n2;
6233
+ let n2 = Wx(e5, t2) ?? uv(e5), r2 = Ux(e5);
6234
+ return r2 === void 0 ? n2 : Sv(n2, r2);
6233
6235
  };
6234
- function Kx(e5, t2) {
6235
- return !e5 || !t2 || !e5.services.every(Fv) ? null : mv(t2, e5);
6236
+ var Kx = (e5, t2) => {
6237
+ let n2 = Gx(e5, t2), r2 = t2.get(Rp.resource), i2 = Ux(e5) !== void 0 || !!Wx(e5, t2);
6238
+ return r2 && !i2 ? Sv(n2, r2) : n2;
6239
+ };
6240
+ function qx(e5, t2) {
6241
+ return !e5 || !t2 || !e5.services.every(Iv) ? null : mv(t2, e5);
6236
6242
  }
6237
- var qx = [];
6238
- function Jx(e5) {
6243
+ var Jx = [];
6244
+ function Yx(e5) {
6239
6245
  return { min: 1, max: e5?.bookingPolicy?.participantsPolicy?.maxParticipantsPerBooking || 1 };
6240
6246
  }
6241
- function Yx(e5, { previous: t2, others: n2 }, { min: r2, max: i2 }) {
6247
+ function Xx(e5, { previous: t2, others: n2 }, { min: r2, max: i2 }) {
6242
6248
  let a2 = Math.max(0, Math.floor(e5)), o2 = Math.max(t2, i2 - n2), s2 = Math.min(a2, o2);
6243
6249
  return s2 > 0 && n2 + s2 < r2 ? Math.min(r2 - n2, o2) : s2;
6244
6250
  }
6245
- function Xx({ serviceCtaState: e5, courseAvailability: t2, serviceBookability: n2 }) {
6251
+ function Zx({ serviceCtaState: e5, courseAvailability: t2, serviceBookability: n2 }) {
6246
6252
  return `${e5}|${t2?.totalCapacity ?? `-`}|${t2?.remainingCapacity ?? `-`}|${t2 === null}|${n2.state}|${n2.isAvailableForBooking}`;
6247
6253
  }
6248
- var Zx = (e5) => ({ service: e5, hasError: false });
6249
- var Qx = () => ({ service: null, hasError: true });
6250
- var $x = { service: null, hasError: false };
6251
- var eS = (e5) => ({ ...$x, isMultiServiceAppointment: true, multiServiceAppointmentServices: e5 });
6252
- var tS = () => ({ ...Qx(), isMultiServiceAppointment: true });
6253
- var nS = [];
6254
+ var Qx = (e5) => ({ service: e5, hasError: false });
6255
+ var $x = () => ({ service: null, hasError: true });
6256
+ var eS = { service: null, hasError: false };
6257
+ var tS = (e5) => ({ ...eS, isMultiServiceAppointment: true, multiServiceAppointmentServices: e5 });
6258
+ var nS = () => ({ ...$x(), isMultiServiceAppointment: true });
6254
6259
  var rS = [];
6255
- var iS = {};
6256
- function aS({ servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2 = null, editingSurface: a2 = false, bookingsSettings: o2, children: s2 }) {
6257
- return (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(ix, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), children: (0, import_jsx_runtime.jsx)(nx, { bookingsSettings: o2, children: (0, import_jsx_runtime.jsx)(Xo, { fallback: (0, import_jsx_runtime.jsx)(ax, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), feature: Ko.service, children: (0, import_jsx_runtime.jsx)(lS, { servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2, editingSurface: a2, children: s2 }) }) }) });
6258
- }
6259
- var oS = (e5) => e5 ?? void 0;
6260
- var sS = () => void 0;
6261
- function cS(e5, t2) {
6260
+ var iS = [];
6261
+ var aS = {};
6262
+ function oS({ servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2 = null, editingSurface: a2 = false, bookingsSettings: o2, children: s2 }) {
6263
+ return (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(ax, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), children: (0, import_jsx_runtime.jsx)(rx, { bookingsSettings: o2, children: (0, import_jsx_runtime.jsx)(Xo, { fallback: (0, import_jsx_runtime.jsx)(ox, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), feature: Ko.service, children: (0, import_jsx_runtime.jsx)(uS, { servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2, editingSurface: a2, children: s2 }) }) }) });
6264
+ }
6265
+ var sS = (e5) => e5 ?? void 0;
6266
+ var cS = () => void 0;
6267
+ function lS(e5, t2) {
6262
6268
  Jo(e5, { feature: Ko.service, action: `fetch-service-variants`, level: `warning`, contexts: { service: { serviceId: t2 } } });
6263
6269
  }
6264
- function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, rescheduleRequest: a2 = null, editingSurface: u2 = false, children: d2 }) {
6265
- let f2 = n2 ? null : e5 ? ms(e5) : null, m2 = n2?.service ?? f2?.service ?? null, h2 = f2?.hasError ?? false, g2 = f2?.isMultiServiceAppointment ?? false, _2 = f2?.multiServiceAppointmentServices ?? nS, v2 = Xv(), y2 = Qv(), { navigate: b2, navigateToHref: x2, resolvePath: ee2, toHref: S2, getBookingFormPath: C2 } = Hb(), w2 = Tx(), T2 = Jp(zp.SERVICE), { getParsedUrl: E2, pushUrl: te2, searchParams: ne2 } = cs(), D2 = (0, import_react.useRef)(E2);
6270
+ function uS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, rescheduleRequest: a2 = null, editingSurface: u2 = false, children: d2 }) {
6271
+ let f2 = n2 ? null : e5 ? ms(e5) : null, m2 = n2?.service ?? f2?.service ?? null, h2 = f2?.hasError ?? false, g2 = f2?.isMultiServiceAppointment ?? false, _2 = f2?.multiServiceAppointmentServices ?? rS, v2 = Zv(), y2 = $v(), { navigate: b2, navigateToHref: x2, resolvePath: ee2, toHref: S2, getBookingFormPath: C2 } = Ub(), w2 = Ex(), T2 = Jp(zp.SERVICE), { getParsedUrl: E2, pushUrl: te2, searchParams: ne2 } = cs(), D2 = (0, import_react.useRef)(E2);
6266
6272
  D2.current = E2;
6267
6273
  let re2 = (0, import_react.useRef)(te2);
6268
6274
  re2.current = te2;
6269
- let O2 = ny(), k2 = (0, import_react.useRef)(O2);
6275
+ let O2 = ry(), k2 = (0, import_react.useRef)(O2);
6270
6276
  k2.current = O2;
6271
- let [A2, ie2] = (0, import_react.useState)(Nx), ae2 = kx(), oe2 = (e6, t3) => a2 ? uv(e6) : Wx(e6, t3), se2 = (0, import_react.useRef)(oe2);
6277
+ let [A2, ie2] = (0, import_react.useState)(Px), ae2 = Ax(), oe2 = (e6, t3) => a2 ? uv(e6) : Gx(e6, t3), se2 = (0, import_react.useRef)(oe2);
6272
6278
  se2.current = oe2;
6273
6279
  let [ce2, le2] = (0, import_react.useState)(() => oe2(m2?._id ?? ``, E2().searchParams)), j2 = (0, import_react.useRef)(ce2), ue2 = (0, import_react.useRef)(void 0), de2 = (0, import_react.useRef)(true), [fe2, pe2] = (0, import_react.useState)(false), me2 = rm(), he2 = (0, import_react.useRef)(false), ge2 = (0, import_react.useRef)(null), [_e2, ve2] = (0, import_react.useState)(null), ye2 = (0, import_react.useRef)(_e2), [be2, xe2] = (0, import_react.useState)(0), M2 = m2?._id ?? null, Se2 = (0, import_react.useMemo)(() => {
6274
6280
  if (!a2) return null;
@@ -6280,25 +6286,25 @@ function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6280
6286
  if (!m2) return null;
6281
6287
  let e6 = ee2(`servicePage`, { slug: m2.mainSlug?.name ?? null, serviceId: m2._id ?? null });
6282
6288
  return e6 ? { href: S2(e6), target: `_self` } : null;
6283
- }, [m2, ee2, S2]), [Ee2, De2] = (0, import_react.useState)(qx), Oe2 = n2 ? n2.masterEvents : Ee2, ke2 = ex(), Ae2 = Xb(), je2 = Ae2.isLoading, Me2 = !Ae2.isLoading && Ae2.multiServiceAppointmentsEnabled;
6289
+ }, [m2, ee2, S2]), [Ee2, De2] = (0, import_react.useState)(Jx), Oe2 = n2 ? n2.masterEvents : Ee2, ke2 = tx(), Ae2 = Zb(), je2 = Ae2.isLoading, Me2 = !Ae2.isLoading && Ae2.multiServiceAppointmentsEnabled;
6284
6290
  (0, import_react.useEffect)(() => {
6285
6291
  if (!a2 || je2) return;
6286
- let e6 = false, t3 = Lx(a2, ae2, (t4) => {
6292
+ let e6 = false, t3 = Rx(a2, ae2, (t4) => {
6287
6293
  e6 || ie2(t4);
6288
6294
  });
6289
6295
  return () => {
6290
6296
  e6 = true, t3();
6291
6297
  };
6292
6298
  }, [a2, je2, ae2]);
6293
- let Ne2 = !n2 && !!m2 && _p(m2), Pe2 = Ne2 && M2 ? sy(y2, M2, t2) : null, Fe2 = (typeof window > `u` && Pe2 && M2 && O2.scope && !je2 ? ms(_s(by({ key: Pe2, warmupData: O2, fetchData: () => xm(M2).catch((e6) => (cS(e6, M2), null)) }), oS, sS)) : void 0) ?? (Pe2 ? my(Pe2) : void 0), [Ie2, Le2] = (0, import_react.useState)(() => Fe2 ?? null), [Re2, ze2] = (0, import_react.useState)(() => Fe2 ? Pe2 : null), Be2 = Pe2 !== null && Re2 !== Pe2, Ve2 = n2 ? n2.serviceOptionsAndVariants : Ne2 ? Ie2 : null;
6299
+ let Ne2 = !n2 && !!m2 && _p(m2), Pe2 = Ne2 && M2 ? cy(y2, M2, t2) : null, Fe2 = (typeof window > `u` && Pe2 && M2 && O2.scope && !je2 ? ms(_s(xy({ key: Pe2, warmupData: O2, fetchData: () => xm(M2).catch((e6) => (lS(e6, M2), null)) }), sS, cS)) : void 0) ?? (Pe2 ? hy(Pe2) : void 0), [Ie2, Le2] = (0, import_react.useState)(() => Fe2 ?? null), [Re2, ze2] = (0, import_react.useState)(() => Fe2 ? Pe2 : null), Be2 = Pe2 !== null && Re2 !== Pe2, Ve2 = n2 ? n2.serviceOptionsAndVariants : Ne2 ? Ie2 : null;
6294
6300
  (0, import_react.useEffect)(() => {
6295
6301
  if (n2) return;
6296
6302
  let e6 = Ce2 && !mp(we2) ? Ce2 : null;
6297
- if ((!e6 || je2) && De2((e7) => e7.length === 0 ? e7 : qx), je2) return;
6303
+ if ((!e6 || je2) && De2((e7) => e7.length === 0 ? e7 : Jx), je2) return;
6298
6304
  let i2 = Ne2 ? M2 : null;
6299
6305
  if (!e6 && !i2) return;
6300
- let a3 = false, o2 = e6 ? ym([e6], ke2).catch(() => qx) : Promise.resolve(qx), s2 = i2 ? by({ key: sy(y2, i2, t2), warmupData: k2.current, fetchData: () => xm(i2) }).catch((e7) => {
6301
- cS(e7, i2);
6306
+ let a3 = false, o2 = e6 ? ym([e6], ke2).catch(() => Jx) : Promise.resolve(Jx), s2 = i2 ? xy({ key: cy(y2, i2, t2), warmupData: k2.current, fetchData: () => xm(i2) }).catch((e7) => {
6307
+ lS(e7, i2);
6302
6308
  }) : Promise.resolve(void 0);
6303
6309
  return Promise.all([o2, s2]).then(([e7, t3]) => {
6304
6310
  a3 || (0, import_react.startTransition)(() => {
@@ -6308,21 +6314,21 @@ function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6308
6314
  a3 = true;
6309
6315
  };
6310
6316
  }, [n2, Ce2, we2, ke2, je2, Ne2, M2, Pe2, y2]);
6311
- let He2 = a2 ? null : ne2.get(Rp.blob), Ue2 = (0, import_react.useMemo)(() => JSON.stringify([...new Set((av(He2)?.services ?? []).filter((e6) => wv(e6).length > 0).map(({ serviceId: e6 }) => e6))].sort()), [He2]), We2 = (0, import_react.useMemo)(() => {
6317
+ let He2 = a2 ? null : ne2.get(Rp.blob), Ue2 = (0, import_react.useMemo)(() => JSON.stringify([...new Set((av(He2)?.services ?? []).filter((e6) => Tv(e6).length > 0).map(({ serviceId: e6 }) => e6))].sort()), [He2]), We2 = (0, import_react.useMemo)(() => {
6312
6318
  let e6 = new Set(JSON.parse(Ue2));
6313
6319
  return [...new Set(_2.filter(_p).flatMap(({ _id: t3 }) => t3 && e6.has(t3) ? [t3] : []))];
6314
- }, [_2, Ue2]), N2 = (0, import_react.useMemo)(() => ({ serviceIds: We2, refreshSignal: t2, language: y2 }), [We2, t2, y2]), [P2, F2] = (0, import_react.useState)(null), Ge2 = P2?.request === N2 ? P2 : null, Ke2 = Ge2?.data ?? iS, qe2 = We2.length === 0 ? `ready` : je2 || !Ge2 ? `loading` : Ge2.data && We2.every((e6) => Ge2.data?.[e6]) ? `ready` : `error`;
6320
+ }, [_2, Ue2]), N2 = (0, import_react.useMemo)(() => ({ serviceIds: We2, refreshSignal: t2, language: y2 }), [We2, t2, y2]), [P2, F2] = (0, import_react.useState)(null), Ge2 = P2?.request === N2 ? P2 : null, Ke2 = Ge2?.data ?? aS, qe2 = We2.length === 0 ? `ready` : je2 || !Ge2 ? `loading` : Ge2.data && We2.every((e6) => Ge2.data?.[e6]) ? `ready` : `error`;
6315
6321
  (0, import_react.useEffect)(() => {
6316
6322
  let { serviceIds: e6, refreshSignal: t3, language: n3 } = N2;
6317
6323
  if (je2 || e6.length === 0) return;
6318
6324
  let i2 = false;
6319
- return by({ key: cy(n3, e6, t3), warmupData: k2.current, fetchData: () => Cm(e6) }).catch((e7) => (Jo(e7, { feature: Ko.service, action: `fetch-multi-service-variants`, level: `warning` }), null)).then((e7) => {
6325
+ return xy({ key: ly(n3, e6, t3), warmupData: k2.current, fetchData: () => Cm(e6) }).catch((e7) => (Jo(e7, { feature: Ko.service, action: `fetch-multi-service-variants`, level: `warning` }), null)).then((e7) => {
6320
6326
  i2 || (0, import_react.startTransition)(() => F2({ request: N2, data: e7 }));
6321
6327
  }), () => {
6322
6328
  i2 = true;
6323
6329
  };
6324
6330
  }, [je2, N2]);
6325
- let Je2 = Wh({ service: m2, masterEvents: Oe2, locale: v2, timeZone: ke2, now: ry() }), Ye2 = Xx(Je2), Xe2 = (0, import_react.useMemo)(() => Je2, [m2, Oe2, v2, ke2, Ye2]), Ze2 = (0, import_react.useRef)(null);
6331
+ let Je2 = Wh({ service: m2, masterEvents: Oe2, locale: v2, timeZone: ke2, now: iy() }), Ye2 = Zx(Je2), Xe2 = (0, import_react.useMemo)(() => Je2, [m2, Oe2, v2, ke2, Ye2]), Ze2 = (0, import_react.useRef)(null);
6326
6332
  (0, import_react.useEffect)(() => {
6327
6333
  if (Ze2.current !== null) {
6328
6334
  let e6 = se2.current(m2?._id ?? ``, D2.current().searchParams);
@@ -6333,46 +6339,47 @@ function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6333
6339
  let Qe2 = (0, import_react.useRef)(He2);
6334
6340
  (0, import_react.useEffect)(() => {
6335
6341
  if (He2 === Qe2.current) return;
6336
- Qe2.current = He2;
6337
- let e6 = se2.current(M2 ?? ``, D2.current().searchParams);
6338
- j2.current = e6, de2.current = true, pe2(false), he2.current = false, ge2.current = null, le2(e6), ye2.current = null, ve2(null), xe2((e7) => e7 + 1);
6342
+ let e6 = Qe2.current;
6343
+ if (Qe2.current = He2, vv(e6, He2)) return;
6344
+ let t3 = se2.current(M2 ?? ``, D2.current().searchParams);
6345
+ j2.current = t3, de2.current = true, pe2(false), he2.current = false, ge2.current = null, le2(t3), ye2.current = null, ve2(null), xe2((e7) => e7 + 1);
6339
6346
  }, [He2, M2]);
6340
6347
  let $e2 = (0, import_react.useRef)({});
6341
6348
  $e2.current = { serviceType: m2?.type ?? void 0, scheduleId: gp(m2?.type) || hp(m2?.type) ? m2?.schedule?._id ?? void 0 : void 0 };
6342
- let et2 = (0, import_react.useCallback)((e6, t3) => cv(e6, { currentUrl: D2.current(), entries: [yv(t3?.staffId === void 0 ? j2.current : xv(j2.current, t3.staffId), $e2.current)], policy: t3?.handoff ? `handoff` : `inPlace`, timezone: ue2.current }), []), I2 = (0, import_react.useCallback)((e6) => {
6349
+ let et2 = (0, import_react.useCallback)((e6, t3) => cv(e6, { currentUrl: D2.current(), entries: [bv(t3?.staffId === void 0 ? j2.current : Sv(j2.current, t3.staffId), $e2.current)], policy: t3?.handoff ? `handoff` : `inPlace`, timezone: ue2.current }), []), I2 = (0, import_react.useCallback)((e6) => {
6343
6350
  let t3 = e6(j2.current);
6344
6351
  j2.current = t3, le2(t3);
6345
6352
  }, []), L2 = (0, import_react.useCallback)((e6) => {
6346
6353
  I2(e6);
6347
- let t3 = D2.current(), n3 = e6(Wx(M2 ?? ``, t3.searchParams)), r2 = cv(`${t3.pathname}${t3.search}${t3.hash}`, { currentUrl: t3, entries: [yv(n3, $e2.current)], policy: `inPlace` }), i2 = new URL(r2, t3);
6354
+ let t3 = D2.current(), n3 = e6(Gx(M2 ?? ``, t3.searchParams)), r2 = cv(`${t3.pathname}${t3.search}${t3.hash}`, { currentUrl: t3, entries: [bv(n3, $e2.current)], policy: `inPlace` }), i2 = new URL(r2, t3);
6348
6355
  Qe2.current = i2.searchParams.get(Rp.blob), re2.current(i2, { disableScrollToTop: true, skipHistory: true });
6349
6356
  }, [I2, M2]), tt2 = av(He2)?.wantsPromoCode === true, R2 = (0, import_react.useCallback)((e6) => {
6350
6357
  let t3 = D2.current(), n3 = av(t3.searchParams.get(Rp.blob));
6351
6358
  if (!n3) return;
6352
6359
  let r2 = new URL(mv(`${t3.pathname}${t3.search}${t3.hash}`, _v(n3, e6)), t3);
6353
6360
  Qe2.current = r2.searchParams.get(Rp.blob), re2.current(r2, { disableScrollToTop: true, skipHistory: true });
6354
- }, []), nt2 = Am(Ve2), rt2 = (0, import_react.useCallback)((e6, t3) => nt2 ? Tv(e6, t3 ? [t3] : []) : e6, [nt2]), it2 = (0, import_react.useCallback)((e6) => I2((t3) => rt2(xv(t3, e6), e6)), [I2, rt2]), at2 = (0, import_react.useCallback)(() => I2((e6) => rt2(Cv(e6), null)), [I2, rt2]), ot2 = (0, import_react.useCallback)((e6) => I2((t3) => rt2(Sv(t3, e6), null)), [I2, rt2]), st2 = (0, import_react.useCallback)((e6) => L2((t3) => Tv(t3, e6)), [L2]), ct2 = (0, import_react.useMemo)(() => Jx(m2), [m2]), lt2 = (0, import_react.useMemo)(() => jm(Ve2, { locale: v2, staffMembers: m2 ? Mm(m2) : [], businessLocations: fp(m2) }), [Ve2, v2, m2]), ut2 = (0, import_react.useMemo)(() => new Set(jm(Ve2, { locale: v2 })?.choices.flatMap((e6) => e6.choiceId ? [e6.choiceId] : []) ?? []), [Ve2, v2]), dt2 = (0, import_react.useCallback)((e6) => {
6361
+ }, []), nt2 = Am(Ve2), rt2 = (0, import_react.useCallback)((e6, t3) => nt2 ? Ev(e6, t3 ? [t3] : []) : e6, [nt2]), it2 = (0, import_react.useCallback)((e6) => I2((t3) => rt2(Sv(t3, e6), e6)), [I2, rt2]), at2 = (0, import_react.useCallback)(() => I2((e6) => rt2(wv(e6), null)), [I2, rt2]), ot2 = (0, import_react.useCallback)((e6) => I2((t3) => rt2(Cv(t3, e6), null)), [I2, rt2]), st2 = (0, import_react.useCallback)((e6) => L2((t3) => Ev(t3, e6)), [L2]), ct2 = (0, import_react.useMemo)(() => Yx(m2), [m2]), lt2 = (0, import_react.useMemo)(() => jm(Ve2, { locale: v2, staffMembers: m2 ? Mm(m2) : [], businessLocations: fp(m2) }), [Ve2, v2, m2]), ut2 = (0, import_react.useMemo)(() => new Set(jm(Ve2, { locale: v2 })?.choices.flatMap((e6) => e6.choiceId ? [e6.choiceId] : []) ?? []), [Ve2, v2]), dt2 = (0, import_react.useCallback)((e6) => {
6355
6362
  let t3 = Object.entries(e6).filter(([e7, t4]) => ut2.has(e7) && Number.isFinite(t4));
6356
6363
  if (!t3.length) return;
6357
6364
  let n3 = (e7) => {
6358
- let n4 = kv(e7, ut2), r2 = ([e8, t4]) => t4 <= Ev(n4, e8), i2 = [...t3.filter(r2), ...t3.filter((e8) => !r2(e8))];
6365
+ let n4 = Av(e7, ut2), r2 = ([e8, t4]) => t4 <= Dv(n4, e8), i2 = [...t3.filter(r2), ...t3.filter((e8) => !r2(e8))];
6359
6366
  for (let [e8, t4] of i2) {
6360
- let r3 = Ev(n4, e8), i3 = Yx(t4, { previous: r3, others: Dv(n4) - r3 }, ct2);
6361
- i3 !== r3 && (n4 = Ov(n4, e8, i3));
6367
+ let r3 = Dv(n4, e8), i3 = Xx(t4, { previous: r3, others: Ov(n4) - r3 }, ct2);
6368
+ i3 !== r3 && (n4 = kv(n4, e8, i3));
6362
6369
  }
6363
6370
  return n4;
6364
6371
  };
6365
6372
  n3(j2.current) !== j2.current && L2(n3);
6366
- }, [ut2, ct2, L2]), ft2 = (0, import_react.useCallback)((e6) => L2((t3) => Mv(t3, e6)), [L2]), pt2 = (0, import_react.useCallback)((e6, t3) => L2((n3) => Nv(n3, e6, t3)), [L2]), mt2 = (0, import_react.useCallback)((e6, t3) => {
6373
+ }, [ut2, ct2, L2]), ft2 = (0, import_react.useCallback)((e6) => L2((t3) => Nv(t3, e6)), [L2]), pt2 = (0, import_react.useCallback)((e6, t3) => L2((n3) => Pv(n3, e6, t3)), [L2]), mt2 = (0, import_react.useCallback)((e6, t3) => {
6367
6374
  t3?.timezone && (ue2.current = t3.timezone), de2.current = t3?.bookable ?? true, pe2(!de2.current), he2.current = t3?.staffChoiceRequired ?? false, ge2.current = t3?.rescheduleStaffId ?? null, I2((n3) => {
6368
- let r2 = Iv(n3, e6);
6369
- return t3?.staffId === void 0 ? r2 : xv(r2, t3.staffId);
6375
+ let r2 = Lv(n3, e6);
6376
+ return t3?.staffId === void 0 ? r2 : Sv(r2, t3.staffId);
6370
6377
  });
6371
6378
  }, [I2]), ht2 = (0, import_react.useCallback)(() => {
6372
6379
  de2.current = true, pe2(false), he2.current = false, ge2.current = null;
6373
6380
  let e6 = se2.current(M2 ?? ``, D2.current().searchParams);
6374
6381
  I2((t3) => {
6375
- let n3 = Rv(t3, e6);
6382
+ let n3 = zv(t3, e6);
6376
6383
  if (!nt2) return n3;
6377
6384
  let { selectedVariants: r2, durationChoiceId: i2, ...a3 } = n3;
6378
6385
  return { ...a3, ...e6.selectedVariants ? { selectedVariants: e6.selectedVariants } : {}, ...e6.durationChoiceId ? { durationChoiceId: e6.durationChoiceId } : {} };
@@ -6380,18 +6387,18 @@ function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6380
6387
  }, [I2, M2, nt2]), gt2 = (0, import_react.useCallback)((e6) => {
6381
6388
  let t3 = ye2.current ?? av(D2.current().searchParams.get(Rp.blob)), n3 = t3 && e6(t3);
6382
6389
  return n3 ? (ye2.current = n3, ve2(n3), true) : false;
6383
- }, []), _t2 = (0, import_react.useCallback)((e6, t3) => gt2((n3) => zv(n3, e6, t3, jp())), [gt2]), vt2 = (0, import_react.useCallback)(() => {
6384
- gt2(Vv);
6385
- }, [gt2]), yt2 = Xe2.serviceCtaState, bt2 = (0, import_react.useMemo)(() => g2 ? (_e2 ?? av(He2))?.services ?? rS : rS, [g2, _e2, He2]), xt2 = (0, import_react.useMemo)(() => g2 ? Kx(_e2 ?? av(He2), C2()) : null, [g2, _e2, He2, C2]), St2 = (0, import_react.useCallback)((e6) => {
6390
+ }, []), _t2 = (0, import_react.useCallback)((e6, t3) => gt2((n3) => Bv(n3, e6, t3, jp())), [gt2]), vt2 = (0, import_react.useCallback)(() => {
6391
+ gt2(Hv);
6392
+ }, [gt2]), yt2 = Xe2.serviceCtaState, bt2 = (0, import_react.useMemo)(() => g2 ? (_e2 ?? av(He2))?.services ?? iS : iS, [g2, _e2, He2]), xt2 = (0, import_react.useMemo)(() => g2 ? qx(_e2 ?? av(He2), C2()) : null, [g2, _e2, He2, C2]), St2 = (0, import_react.useCallback)((e6) => {
6386
6393
  if (g2) return xt2 ? S2(xt2) : null;
6387
- let t3 = Nb({ actionState: yt2, serviceType: m2?.type ?? null, config: e6 ?? Mb });
6388
- if (Pb(t3, m2?.type ?? null, ce2)) return null;
6394
+ let t3 = Pb({ actionState: yt2, serviceType: m2?.type ?? null, config: e6 ?? Nb });
6395
+ if (Fb(t3, m2?.type ?? null, ce2)) return null;
6389
6396
  let n3 = ee2(t3, { slug: m2?.mainSlug?.name ?? null, serviceId: m2?._id ?? null });
6390
6397
  return n3 ? S2(n3) : null;
6391
6398
  }, [g2, xt2, yt2, m2, ce2, ee2, S2]), Ct2 = eg(), [wt2, Tt2] = (0, import_react.useState)(false), Et2 = (0, import_react.useRef)(false), Dt2 = (0, import_react.useCallback)(() => {
6392
6399
  Et2.current = false, Tt2(false);
6393
6400
  }, []);
6394
- Ub(Dt2);
6401
+ Wb(Dt2);
6395
6402
  let Ot2 = (0, import_react.useCallback)((e6) => {
6396
6403
  Et2.current = true, Tt2(true);
6397
6404
  let t3 = D2.current(), n3 = new URL(S2(e6), t3).pathname === t3.pathname;
@@ -6400,9 +6407,9 @@ function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6400
6407
  }, (e7) => {
6401
6408
  Jo(e7, { feature: Ko.serviceCta, action: `navigateToNextPage` }), Dt2();
6402
6409
  });
6403
- }, [b2, Dt2, S2]), kt2 = (0, import_react.useCallback)(() => Ct2.open(Xh(Wv({ service: m2, pricingOption: lt2 ?? void 0, selection: Gx(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: Me2 }))), [Ct2, m2, lt2, M2, Me2]), At2 = (0, import_react.useCallback)((e6) => {
6410
+ }, [b2, Dt2, S2]), kt2 = (0, import_react.useCallback)(() => Ct2.open(Xh(Gv({ service: m2, pricingOption: lt2 ?? void 0, selection: Kx(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: Me2 }))), [Ct2, m2, lt2, M2, Me2]), At2 = (0, import_react.useCallback)((e6) => {
6404
6411
  if (Et2.current) return;
6405
- let t3 = ye2.current ?? av(D2.current().searchParams.get(Rp.blob)), n3 = Kx(t3, C2());
6412
+ let t3 = ye2.current ?? av(D2.current().searchParams.get(Rp.blob)), n3 = qx(t3, C2());
6406
6413
  if (n3) {
6407
6414
  for (let n4 of t3?.services ?? []) e6(tm({ serviceId: n4.serviceId, serviceType: n4.serviceType ?? _2.find(({ _id: e7 }) => e7 === n4.serviceId)?.type ?? void 0, start: n4.slotStart, end: n4.slotEnd, timeZone: t3?.timezone ?? void 0, isEligibleForFlowCompletion: true }));
6408
6415
  Ot2(n3);
@@ -6413,8 +6420,8 @@ function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6413
6420
  At2(T2);
6414
6421
  return;
6415
6422
  }
6416
- let n3 = Nb({ actionState: yt2, serviceType: m2?.type ?? null, config: e6 ?? Mb });
6417
- if (Pb(n3, m2?.type ?? null, j2.current)) return;
6423
+ let n3 = Pb({ actionState: yt2, serviceType: m2?.type ?? null, config: e6 ?? Nb });
6424
+ if (Fb(n3, m2?.type ?? null, j2.current)) return;
6418
6425
  let r2 = n3 === `bookingForm` && !gp(m2?.type ?? null);
6419
6426
  if (r2 && !de2.current) return;
6420
6427
  let i2 = ee2(n3, { slug: m2?.mainSlug?.name ?? null, serviceId: m2?._id ?? null });
@@ -6422,7 +6429,7 @@ function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6422
6429
  T2(Xp({ service_id: m2?._id ?? void 0, type: m2?.type ?? void 0, isPendingApproval: m2 ? vp(m2) : void 0, referralInfo: t3, actionName: Up[n3] }));
6423
6430
  let o2 = n3 === `bookingForm`;
6424
6431
  if (!o2 && !gv(j2.current)) {
6425
- Ot2(vv(i2, D2.current()));
6432
+ Ot2(yv(i2, D2.current()));
6426
6433
  return;
6427
6434
  }
6428
6435
  Ot2(et2(i2, { handoff: o2 }));
@@ -6430,42 +6437,42 @@ function lS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6430
6437
  Nt2.current = Mt2;
6431
6438
  let Pt2 = (0, import_react.useCallback)(async () => {
6432
6439
  let e6 = Se2?.status === `ready` ? Se2.booking : null;
6433
- if (!Se2 || !a2 || !e6 || !jx(j2.current, Nt2.current())) return { outcome: `failed` };
6440
+ if (!Se2 || !a2 || !e6 || !Mx(j2.current, Nt2.current())) return { outcome: `failed` };
6434
6441
  T2(Qp({ component: Gp.RESCHEDULE_DIALOG, element: Kp.CONFIRM_BUTTON })), T2(Lp({ action: Wp, pageName: Kp.CONFIRM_BUTTON, referralInfo: D2.current().searchParams.get(Rp.referral) ?? void 0 }));
6435
- let t3 = yv(j2.current, $e2.current), n3;
6442
+ let t3 = bv(j2.current, $e2.current), n3;
6436
6443
  try {
6437
- n3 = await Sx({ booking: e6, slot: px(t3, ue2.current ?? null, e6, ge2.current), token: a2.token });
6444
+ n3 = await Cx({ booking: e6, slot: mx(t3, ue2.current ?? null, e6, ge2.current), token: a2.token });
6438
6445
  } catch (e7) {
6439
6446
  return Jo(e7, { feature: Ko.reschedule, action: `reschedule-booking` }), { outcome: `failed` };
6440
6447
  }
6441
6448
  T2(Zp({ bookingId: e6.bookingId }));
6442
6449
  let r2 = { outcome: `succeeded`, ...n3 };
6443
6450
  if (a2.fromManageBookingPage) return r2;
6444
- let i2 = Ax(a2.redirectUrl), o2 = i2 ? null : w2();
6451
+ let i2 = jx(a2.redirectUrl), o2 = i2 ? null : w2();
6445
6452
  if (!i2 && !o2) return r2;
6446
6453
  try {
6447
6454
  return i2 ? await x2({ href: i2 }) : o2 && await b2(o2), { outcome: `navigated` };
6448
6455
  } catch (e7) {
6449
6456
  return Jo(e7, { feature: Ko.reschedule, action: `return-after-reschedule` }), r2;
6450
6457
  }
6451
- }, [Se2, a2, w2, b2, x2, T2]), Ft2 = jx(ce2, Mt2()), It2 = (0, import_react.useCallback)(() => {
6458
+ }, [Se2, a2, w2, b2, x2, T2]), Ft2 = Mx(ce2, Mt2()), It2 = (0, import_react.useCallback)(() => {
6452
6459
  T2(Lp({ component: Kp.GO_TO_HOMEPAGE_BUTTON, action: Wp, pageName: qp })), b2(`/`).catch((e6) => Jo(e6, { feature: Ko.reschedule, action: `go-home` }));
6453
6460
  }, [b2, T2]), { serviceBookability: Lt2, policyDescription: Rt2, coverImage: zt2 } = Xe2, Bt2 = (0, import_react.useCallback)(() => Lt2.isAvailableForBooking, [Lt2]), Vt2 = (0, import_react.useCallback)(() => !!Rt2, [Rt2]), Ht2 = (0, import_react.useCallback)(() => !!zt2, [zt2]), Ut2 = (0, import_react.useCallback)(() => mh(m2), [m2]), Wt2 = (0, import_react.useCallback)(() => !!m2 && qh(m2), [m2]), Gt2 = (0, import_react.useMemo)(() => ({ ...Xe2, service: m2, servicePageLink: Te2, serviceOptionsAndVariants: Ve2, pricingOption: lt2, isLoadingServiceOptionsAndVariants: Be2, isAvailableForBooking: Bt2, hasPolicyDescription: Vt2, hasCoverImage: Ht2, hasGalleryImages: Ut2, isVariantDuration: Wt2, isLoading: false, hasError: h2, locale: v2, selectStaffMember: it2, clearSelection: ot2, clearStaffMember: at2, selection: ce2, selectionTimezone: ue2.current ?? ke2, setVariant: st2, setVariantCounts: dt2, maxParticipantsPerBooking: ct2.max, toggleAddOn: ft2, setAddOnQuantity: pt2, setSlot: mt2, clearSlot: ht2, setMultiServiceSlot: _t2, clearMultiServiceSlot: vt2, draftRevision: be2, wantsPromoCode: tt2, setWantsPromoCode: R2, withSelectionParam: et2, navigateToNextPage: jt2, navigateToMultiServiceForm: At2, resolveNextPageHref: St2, isNavigating: wt2, isWaitlistSlotSelected: fe2, siteId: me2, editingSurface: u2, openPreferences: kt2, multiServiceAppointmentsEnabled: Me2, isMultiServiceAppointment: g2, multiServiceAppointmentServices: _2, multiServiceAppointmentSelections: bt2, multiServiceAppointmentOptionsAndVariants: Ke2, multiServiceAppointmentVariantsStatus: qe2, bookingsSettingsLoading: je2, reschedule: Se2, rescheduleBooking: Pt2, goHomeAfterReschedule: It2, canRescheduleToPick: Ft2 }), [Xe2, m2, Te2, Ve2, lt2, Be2, Bt2, Vt2, Ht2, Ut2, Wt2, h2, v2, it2, ot2, at2, ce2, ke2, st2, dt2, ct2.max, ft2, pt2, mt2, ht2, _t2, vt2, be2, tt2, R2, et2, jt2, At2, St2, wt2, fe2, me2, u2, kt2, Me2, g2, _2, bt2, Ke2, qe2, je2, Se2, Pt2, It2, Ft2]);
6454
- return (0, import_jsx_runtime.jsx)(Rx.Provider, { value: Gt2, children: d2 });
6461
+ return (0, import_jsx_runtime.jsx)(zx.Provider, { value: Gt2, children: d2 });
6455
6462
  }
6456
- function uS({ routerSlug: e5, initialServiceId: t2, refreshSignal: n2, editingSurface: r2, children: i2 }) {
6463
+ function dS({ routerSlug: e5, initialServiceId: t2, refreshSignal: n2, editingSurface: r2, children: i2 }) {
6457
6464
  Yp(zp.SERVICE);
6458
- let a2 = ny(), o2 = Qv(), { getParsedUrl: s2 } = cs(), [c2] = (0, import_react.useState)(() => r2 ? null : fx(s2().searchParams)), [u2] = (0, import_react.useState)(() => {
6459
- let r3 = Vx(e5, c2 ? null : Wb(s2().searchParams), t2);
6460
- return r3.by === `none` ? hs($x) : r3.by === `multi` ? _s(by({ key: oy(o2, r3.serviceIds), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load-multi-service`, { feature: Ko.service }, wp(r3.serviceIds)) }), eS, tS) : _s(by({ key: ay(o2, r3.by, r3.value), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load`, { feature: Ko.service }, r3.by === `slug` ? Sp(r3.value) : Cp(r3.value)) }), Zx, Qx);
6465
+ let a2 = ry(), o2 = $v(), { getParsedUrl: s2 } = cs(), [c2] = (0, import_react.useState)(() => r2 ? null : px(s2().searchParams)), [u2] = (0, import_react.useState)(() => {
6466
+ let r3 = Hx(e5, c2 ? null : Gb(s2().searchParams), t2);
6467
+ return r3.by === `none` ? hs(eS) : r3.by === `multi` ? _s(xy({ key: sy(o2, r3.serviceIds), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load-multi-service`, { feature: Ko.service }, wp(r3.serviceIds)) }), tS, nS) : _s(xy({ key: oy(o2, r3.by, r3.value), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load`, { feature: Ko.service }, r3.by === `slug` ? Sp(r3.value) : Cp(r3.value)) }), Qx, $x);
6461
6468
  });
6462
- return (0, import_jsx_runtime.jsx)(aS, { servicePromise: u2, refreshSignal: n2, rescheduleRequest: c2, editingSurface: r2, children: i2 });
6469
+ return (0, import_jsx_runtime.jsx)(oS, { servicePromise: u2, refreshSignal: n2, rescheduleRequest: c2, editingSurface: r2, children: i2 });
6463
6470
  }
6464
- function dS({ serviceData: e5, servicePicker: t2, refreshSignal: n2 = 0, editingSurface: r2 = false, children: i2 }) {
6465
- let { pathname: a2 } = cs(), o2 = ps(), c2 = Qv(), l2 = t2?.serviceId?.$eq, u2 = e5?.service ?? null, d2 = (0, import_react.useMemo)(() => u2 ? { service: u2, masterEvents: e5?.masterEvents ?? qx, serviceOptionsAndVariants: e5?.serviceOptionsAndVariants ?? null, bookingsSettings: e5?.bookingsSettings } : null, [u2, e5?.masterEvents, e5?.serviceOptionsAndVariants, e5?.bookingsSettings]);
6466
- return d2 ? (0, import_jsx_runtime.jsx)(aS, { injected: d2, bookingsSettings: d2.bookingsSettings, editingSurface: r2, children: i2 }, `injected:${n2}`) : e5 ? (0, import_jsx_runtime.jsx)(aS, { bookingsSettings: e5.bookingsSettings, editingSurface: r2, children: i2 }) : (0, import_jsx_runtime.jsx)(uS, { routerSlug: o2, initialServiceId: l2, refreshSignal: n2, editingSurface: r2, children: i2 }, `fetch:${a2}:${o2 ?? ``}:${l2 ?? ``}:${n2}:${r2}:${c2}`);
6471
+ function fS({ serviceData: e5, servicePicker: t2, refreshSignal: n2 = 0, editingSurface: r2 = false, children: i2 }) {
6472
+ let { pathname: a2 } = cs(), o2 = ps(), c2 = $v(), l2 = t2?.serviceId?.$eq, u2 = e5?.service ?? null, d2 = (0, import_react.useMemo)(() => u2 ? { service: u2, masterEvents: e5?.masterEvents ?? Jx, serviceOptionsAndVariants: e5?.serviceOptionsAndVariants ?? null, bookingsSettings: e5?.bookingsSettings } : null, [u2, e5?.masterEvents, e5?.serviceOptionsAndVariants, e5?.bookingsSettings]);
6473
+ return d2 ? (0, import_jsx_runtime.jsx)(oS, { injected: d2, bookingsSettings: d2.bookingsSettings, editingSurface: r2, children: i2 }, `injected:${n2}`) : e5 ? (0, import_jsx_runtime.jsx)(oS, { bookingsSettings: e5.bookingsSettings, editingSurface: r2, children: i2 }) : (0, import_jsx_runtime.jsx)(dS, { routerSlug: o2, initialServiceId: l2, refreshSignal: n2, editingSurface: r2, children: i2 }, `fetch:${a2}:${o2 ?? ``}:${l2 ?? ``}:${n2}:${r2}:${c2}`);
6467
6474
  }
6468
- var fS = ma(`426941a1-1d08-4cf4-ae61-e433e800cde5`);
6475
+ var pS = ma(`426941a1-1d08-4cf4-ae61-e433e800cde5`);
6469
6476
  // Annotate the CommonJS export names for ESM import in node:
6470
6477
  0 && (module.exports = {
6471
6478
  SERVICE_CONTEXT_MISSING_PROVIDER_ERROR,