@wix/bookings 1.0.1796 → 1.0.1797

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 (71) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +3 -37
  2. package/build/cjs/context-booking-checkout.js +1350 -1340
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-categories.d.ts +1 -3
  5. package/build/cjs/context-categories.js +20 -43
  6. package/build/cjs/context-categories.js.map +1 -1
  7. package/build/cjs/context-locations.d.ts +1 -1
  8. package/build/cjs/context-locations.js +20 -43
  9. package/build/cjs/context-locations.js.map +1 -1
  10. package/build/cjs/context-service-addons.d.ts +1 -15
  11. package/build/cjs/context-service-addons.js +20 -43
  12. package/build/cjs/context-service-addons.js.map +1 -1
  13. package/build/cjs/context-service.d.ts +1 -65
  14. package/build/cjs/context-service.js +363 -386
  15. package/build/cjs/context-service.js.map +1 -1
  16. package/build/cjs/context-services.d.ts +1 -23
  17. package/build/cjs/context-services.js +542 -566
  18. package/build/cjs/context-services.js.map +1 -1
  19. package/build/cjs/context-time-slots.d.ts +1 -21
  20. package/build/cjs/context-time-slots.js +588 -615
  21. package/build/cjs/context-time-slots.js.map +1 -1
  22. package/build/es/context-booking-checkout.d.mts +3 -37
  23. package/build/es/context-booking-checkout.mjs +1350 -1340
  24. package/build/es/context-booking-checkout.mjs.map +1 -1
  25. package/build/es/context-categories.d.mts +1 -3
  26. package/build/es/context-categories.mjs +20 -43
  27. package/build/es/context-categories.mjs.map +1 -1
  28. package/build/es/context-locations.d.mts +1 -1
  29. package/build/es/context-locations.mjs +20 -43
  30. package/build/es/context-locations.mjs.map +1 -1
  31. package/build/es/context-service-addons.d.mts +1 -15
  32. package/build/es/context-service-addons.mjs +20 -43
  33. package/build/es/context-service-addons.mjs.map +1 -1
  34. package/build/es/context-service.d.mts +1 -65
  35. package/build/es/context-service.mjs +363 -386
  36. package/build/es/context-service.mjs.map +1 -1
  37. package/build/es/context-services.d.mts +1 -23
  38. package/build/es/context-services.mjs +542 -566
  39. package/build/es/context-services.mjs.map +1 -1
  40. package/build/es/context-time-slots.d.mts +1 -21
  41. package/build/es/context-time-slots.mjs +588 -615
  42. package/build/es/context-time-slots.mjs.map +1 -1
  43. package/build/internal/cjs/context-booking-checkout.d.ts +3 -37
  44. package/build/internal/cjs/context-categories.d.ts +1 -3
  45. package/build/internal/cjs/context-locations.d.ts +1 -1
  46. package/build/internal/cjs/context-service-addons.d.ts +1 -15
  47. package/build/internal/cjs/context-service.d.ts +1 -65
  48. package/build/internal/cjs/context-services.d.ts +1 -23
  49. package/build/internal/cjs/context-time-slots.d.ts +1 -21
  50. package/build/internal/es/context-booking-checkout.d.mts +3 -37
  51. package/build/internal/es/context-categories.d.mts +1 -3
  52. package/build/internal/es/context-locations.d.mts +1 -1
  53. package/build/internal/es/context-service-addons.d.mts +1 -15
  54. package/build/internal/es/context-service.d.mts +1 -65
  55. package/build/internal/es/context-services.d.mts +1 -23
  56. package/build/internal/es/context-time-slots.d.mts +1 -21
  57. package/context-runtime/context-booking-checkout/runtime.d.ts +3 -38
  58. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  59. package/context-runtime/context-categories/runtime.d.ts +1 -4
  60. package/context-runtime/context-categories/runtime.js +2 -2
  61. package/context-runtime/context-locations/runtime.d.ts +1 -2
  62. package/context-runtime/context-locations/runtime.js +2 -2
  63. package/context-runtime/context-service/runtime.d.ts +1 -66
  64. package/context-runtime/context-service/runtime.js +3 -3
  65. package/context-runtime/context-service-addons/runtime.d.ts +1 -16
  66. package/context-runtime/context-service-addons/runtime.js +2 -2
  67. package/context-runtime/context-services/runtime.d.ts +1 -24
  68. package/context-runtime/context-services/runtime.js +3 -3
  69. package/context-runtime/context-time-slots/runtime.d.ts +1 -22
  70. package/context-runtime/context-time-slots/runtime.js +3 -3
  71. package/package.json +2 -2
@@ -192,7 +192,7 @@ function L(e2, t2, n2) {
192
192
  break;
193
193
  }
194
194
  let a2 = r2[e3 + 1];
195
- (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
195
+ t3 in i2 && i2[t3] != null && typeof i2[t3] == `object` && i2[t3] !== null || (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
196
196
  }
197
197
  return e2;
198
198
  }
@@ -259,11 +259,8 @@ var xe = class {
259
259
  return;
260
260
  }
261
261
  let a3 = Te(e3);
262
- if (a3 && a3 in t3) {
263
- r2.push(a3), n2 = t3[a3];
264
- return;
265
- }
266
- throw Error(`Cannot find key '${e3}' or its transformations at path ${this.buildPathString(r2)}`);
262
+ if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
263
+ else throw Error(`Cannot find key '${e3}' or its transformations at path ${this.buildPathString(r2)}`);
267
264
  }, o2 = (e3, t3) => {
268
265
  r2.push(e3), n2 = t3[e3];
269
266
  };
@@ -274,11 +271,7 @@ var xe = class {
274
271
  }
275
272
  if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e3}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
276
273
  let t3 = n2;
277
- if (e3 in n2) {
278
- o2(e3, t3);
279
- continue;
280
- }
281
- a2(e3, t3);
274
+ e3 in n2 ? o2(e3, t3) : a2(e3, t3);
282
275
  }
283
276
  return { [this.buildPathString(r2)]: n2 };
284
277
  }
@@ -424,30 +417,30 @@ function je(e2) {
424
417
  return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
425
418
  } } };
426
419
  }
427
- var Me = `X-Wix-Consistent`;
428
- function Ne(e2) {
420
+ var R = `X-Wix-Consistent`;
421
+ function Me(e2) {
429
422
  let t2 = e2.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e3) => Promise.resolve({ headers: {} }) }, r2 = e2.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e2.host), o2 = () => e2.fetch ?? fetch, s2 = async (n3, r3) => {
430
- let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Me]: t2[Me] } : {} }, l3 = e2.host?.getErrorHandler?.();
423
+ let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [R]: t2[R] } : {} }, l3 = e2.host?.getErrorHandler?.();
431
424
  try {
432
425
  if (typeof n3 == `string` || n3 instanceof URL) {
433
426
  let e3 = await i3(n3, { ...r3, headers: c3 });
434
427
  l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
435
- let a3 = Pe(e3);
436
- return a3 && (t2[Me] = a3), e3;
428
+ let a3 = Ne(e3);
429
+ return a3 && (t2[R] = a3), e3;
437
430
  }
438
431
  {
439
432
  for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
440
433
  let e3 = await i3(n3, r3);
441
434
  l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
442
- let a3 = Pe(e3);
443
- return a3 && (t2[Me] = a3), e3;
435
+ let a3 = Ne(e3);
436
+ return a3 && (t2[R] = a3), e3;
444
437
  }
445
438
  } catch (e3) {
446
439
  throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
447
440
  }
448
441
  }, { client: c2, initModule: l2 } = je(i2), { client: u2, initModule: d2 } = ke(i2), f2 = async (n3, r3) => {
449
- let i3 = o2(), s3 = await a2(), c3 = w(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Me]: t2[Me] } : {} } }), u3 = Pe(l3);
450
- return u3 && (t2[Me] = u3), l3;
442
+ let i3 = o2(), s3 = await a2(), c3 = w(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [R]: t2[R] } : {} } }), u3 = Ne(l3);
443
+ return u3 && (t2[R] = u3), l3;
451
444
  }, p2 = (t3, n3) => {
452
445
  if (De(t3)) return d2(t3);
453
446
  if (Ae(t3)) return l2(t3);
@@ -479,19 +472,19 @@ function Ne(e2) {
479
472
  return { data: o3 ?? {}, errors: s3 };
480
473
  }, webhooks: u2, servicePlugins: c2 };
481
474
  }
482
- function Pe(e2) {
475
+ function Ne(e2) {
483
476
  return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
484
477
  }
485
- var Fe = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
486
- var Ie = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
487
- function Le(e2, t2) {
478
+ var Pe = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
479
+ var Fe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
480
+ function Ie(e2, t2) {
488
481
  return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
489
482
  }
490
- var Re = `sort.fieldName`;
491
- function ze(e2, t2, n2) {
492
- return (e2 === Re || e2.endsWith(`.${Re}`)) && typeof t2 == `string` ? Le(t2, n2) : t2;
483
+ var Le = `sort.fieldName`;
484
+ function z(e2, t2, n2) {
485
+ return (e2 === Le || e2.endsWith(`.${Le}`)) && typeof t2 == `string` ? Ie(t2, n2) : t2;
493
486
  }
494
- function Be(e2, t2, n2) {
487
+ function Re(e2, t2, n2) {
495
488
  let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
496
489
  if (Array.isArray(e3)) e3.forEach((e4) => {
497
490
  i2(e4, n3);
@@ -501,24 +494,24 @@ function Be(e2, t2, n2) {
501
494
  Object.keys(a2).forEach((e4) => {
502
495
  let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
503
496
  if (r2(o2)) return;
504
- let s2 = Ve(e4, t2);
505
- s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = ze(o2, a2[s2], t2), i2(a2[s2], o2);
497
+ let s2 = ze(e4, t2);
498
+ s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = z(o2, a2[s2], t2), i2(a2[s2], o2);
506
499
  });
507
500
  }
508
501
  };
509
502
  return i2(e2, ``), e2;
510
503
  }
511
- function Ve(e2, t2) {
504
+ function ze(e2, t2) {
512
505
  let n2;
513
506
  return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
514
507
  }
515
- function R(e2, t2 = []) {
516
- return Be(e2, Fe, t2);
508
+ function Be(e2, t2 = []) {
509
+ return Re(e2, Pe, t2);
517
510
  }
518
- function He(e2, t2 = []) {
519
- return Be(e2, Ie, t2);
511
+ function Ve(e2, t2 = []) {
512
+ return Re(e2, Fe, t2);
520
513
  }
521
- function z(e2) {
514
+ function He(e2) {
522
515
  return e2?.toISOString();
523
516
  }
524
517
  function Ue(e2) {
@@ -532,29 +525,29 @@ function Ke(e2, t2) {
532
525
  let n2 = e2.get(t2);
533
526
  return n2 || (n2 = Ge(), e2.set(t2, n2)), n2;
534
527
  }
535
- function qe(e2, t2) {
528
+ function B(e2, t2) {
536
529
  return t2 === `*` ? (e2.anyField ??= Ge(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), Ke(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), Ke(e2.fields, t2));
537
530
  }
538
- function Je(e2) {
531
+ function qe(e2) {
539
532
  let t2 = Ge();
540
533
  for (let n2 of e2) {
541
- let e3 = n2.path.split(`.`).reduce(qe, t2);
534
+ let e3 = n2.path.split(`.`).reduce(B, t2);
542
535
  e3.leaves ??= [], e3.leaves.push(n2);
543
536
  }
544
537
  return t2;
545
538
  }
546
- function Ye(e2) {
539
+ function Je(e2) {
547
540
  let t2 = We.get(e2);
548
- return t2 || (t2 = Je(e2), We.set(e2, t2)), t2;
541
+ return t2 || (t2 = qe(e2), We.set(e2, t2)), t2;
549
542
  }
550
- function B(e2) {
543
+ function Ye(e2) {
551
544
  return typeof e2 == `object` && !!e2;
552
545
  }
553
546
  function Xe(e2, { isRepeated: t2, isMap: n2 }, r2) {
554
- return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? B(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
547
+ return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? Ye(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
555
548
  }
556
549
  function Ze(e2, t2, n2) {
557
- B(e2) && et(e2, t2, n2);
550
+ Ye(e2) && et(e2, t2, n2);
558
551
  }
559
552
  function Qe(e2, t2, n2) {
560
553
  for (let [r2, i2] of t2) {
@@ -567,25 +560,25 @@ function Qe(e2, t2, n2) {
567
560
  function $e(e2, t2, n2) {
568
561
  for (let [r2, i2] of t2) {
569
562
  let t3 = e2[r2];
570
- B(t3) && Object.values(t3).forEach((e3) => Ze(e3, i2, n2));
563
+ Ye(t3) && Object.values(t3).forEach((e3) => Ze(e3, i2, n2));
571
564
  }
572
565
  }
573
566
  function et(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
574
567
  t2 && Qe(e2, t2, i2), n2 && $e(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => Ze(e3, r2, i2));
575
568
  }
576
569
  function tt(e2, t2) {
577
- if (!B(e2)) return e2;
578
- for (let { paths: n2, transformFn: r2 } of t2) et(e2, Ye(n2), r2);
570
+ if (!Ye(e2)) return e2;
571
+ for (let { paths: n2, transformFn: r2 } of t2) et(e2, Je(n2), r2);
579
572
  return e2;
580
573
  }
581
574
  function nt(e2) {
582
- return st(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
575
+ return V(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
583
576
  }
584
577
  var rt = /([\p{Ll}\d])(\p{Lu})/gu;
585
578
  var it = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
586
579
  var at = `$1\0$2`;
587
580
  var ot = /[^\p{L}\d]+/giu;
588
- function st(e2) {
581
+ function V(e2) {
589
582
  let t2 = e2.trim();
590
583
  t2 = t2.replace(rt, at).replace(it, at), t2 = t2.replace(ot, `\0`);
591
584
  let n2 = 0, r2 = t2.length;
@@ -594,14 +587,14 @@ function st(e2) {
594
587
  for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
595
588
  return t2.slice(n2, r2).split(/\0/g);
596
589
  }
597
- var ct = (e2) => `validationError` in (e2.response?.data?.details ?? {});
598
- var lt = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
599
- var V = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
590
+ var st = (e2) => `validationError` in (e2.response?.data?.details ?? {});
591
+ var ct = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
592
+ var lt = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
600
593
  function ut(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
601
594
  if (typeof e2 != `object` || !e2) throw e2;
602
- if (ct(e2)) return dt(e2, t2, n2);
603
- if (lt(e2)) return pt(e2);
604
- if (V(e2)) {
595
+ if (st(e2)) return dt(e2, t2, n2);
596
+ if (ct(e2)) return pt(e2);
597
+ if (lt(e2)) {
605
598
  let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: nt(n3), data: {} }, requestId: e2.requestId };
606
599
  return ft(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
607
600
  }
@@ -681,25 +674,25 @@ function bt(e2, t2) {
681
674
  return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
682
675
  };
683
676
  }
684
- function xt(e2, t2 = false) {
677
+ function H(e2, t2 = false) {
685
678
  return bt(e2, t2);
686
679
  }
687
- function St(e2, t2) {
688
- let n2 = H(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
680
+ function xt(e2, t2) {
681
+ let n2 = Ct(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
689
682
  return t2 && r2 ? new URLSearchParams({ ".r": Tt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
690
683
  r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
691
684
  }), e3), new URLSearchParams());
692
685
  }
693
- function Ct(e2) {
686
+ function St(e2) {
694
687
  let t2 = Rt(It(e2.host), e2.domainToMappings);
695
- return qt(Wt(e2.protoPath, e2.data || {}), t2);
688
+ return Kt(Wt(e2.protoPath, e2.data || {}), t2);
696
689
  }
697
- function H(e2, t2 = ``) {
690
+ function Ct(e2, t2 = ``) {
698
691
  let n2 = {};
699
692
  return Object.entries(e2).forEach(([e3, r2]) => {
700
693
  let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = wt(t2, e3);
701
694
  if (i2) {
702
- let e4 = H(r2, a2);
695
+ let e4 = Ct(r2, a2);
703
696
  Object.assign(n2, e4);
704
697
  } else n2[a2] = r2;
705
698
  }), n2;
@@ -763,13 +756,13 @@ function Ht(e2) {
763
756
  }
764
757
  var Ut = `www._base_domain_`;
765
758
  function Wt(e2, t2) {
766
- return e2.split(`/`).map((e3) => Gt(e3, t2)).join(`/`);
759
+ return e2.split(`/`).map((e3) => U(e3, t2)).join(`/`);
767
760
  }
768
- function Gt(e2, t2) {
761
+ function U(e2, t2) {
769
762
  let n2 = e2.match(Nt) || [], r2 = n2[1];
770
- return r2 ? Kt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
763
+ return r2 ? Gt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
771
764
  }
772
- function Kt(e2, t2, n2, r2) {
765
+ function Gt(e2, t2, n2, r2) {
773
766
  let i2 = e2;
774
767
  for (let e3 of t2.split(`.`)) {
775
768
  if (!i2) return n2;
@@ -777,23 +770,23 @@ function Kt(e2, t2, n2, r2) {
777
770
  }
778
771
  return `${i2}${r2}`;
779
772
  }
780
- function qt(e2, t2) {
773
+ function Kt(e2, t2) {
781
774
  let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
782
775
  return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
783
776
  }
784
- function U(e2) {
777
+ function qt(e2) {
785
778
  return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
786
779
  }
787
780
  var Jt = `x-wix-currency`;
788
781
  var Yt = () => {
789
- let e2 = nn(`currency`);
782
+ let e2 = W(`currency`);
790
783
  if (e2) return { [Jt]: e2 };
791
784
  };
792
785
  var Xt = `x-wix-linguist`;
793
786
  var Zt = `00000000-0000-0000-0000-000000000000`;
794
787
  var Qt = `false`;
795
788
  var $t = () => {
796
- let e2 = nn(`language`), t2 = nn(`locale`);
789
+ let e2 = W(`language`), t2 = W(`locale`);
797
790
  if (e2) return { [Xt]: [e2, t2 || e2, Qt, Zt].join(`|`) };
798
791
  };
799
792
  function en() {
@@ -803,16 +796,16 @@ function en() {
803
796
  }), resolve: e2, reject: t2 };
804
797
  }
805
798
  var tn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
806
- var nn = (e2) => tn()?.[e2];
807
- var rn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
808
- let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = W();
809
- return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: nn(`language`), locale: nn(`locale`), get passThroughHeaders() {
799
+ var W = (e2) => tn()?.[e2];
800
+ var nn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
801
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = an();
802
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: W(`language`), locale: W(`locale`), get passThroughHeaders() {
810
803
  let e3 = { ...$t(), ...Yt() };
811
804
  return Object.keys(e3).length > 0 ? e3 : void 0;
812
805
  } } };
813
806
  }, auth: (e3) => {
814
807
  let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
815
- !e3 && an() && (e3 = t2?.getAccessTokenFunction?.());
808
+ !e3 && rn() && (e3 = t2?.getAccessTokenFunction?.());
816
809
  let n2 = false, { resolve: r2, promise: i2 } = en();
817
810
  return { getAuthHeaders: async () => {
818
811
  if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
@@ -821,10 +814,10 @@ var rn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
821
814
  r2(e4);
822
815
  }) };
823
816
  } });
824
- function an() {
817
+ function rn() {
825
818
  return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
826
819
  }
827
- function W() {
820
+ function an() {
828
821
  let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
829
822
  if (!e2) return;
830
823
  let t2 = new URL(e2);
@@ -837,7 +830,7 @@ var on = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace
837
830
  throw Error(`Not implemented`);
838
831
  }, observeState: () => ({ disconnect: () => {
839
832
  } }) });
840
- var sn = rn({ createHost: function(e2) {
833
+ var sn = nn({ createHost: function(e2) {
841
834
  let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
842
835
  if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
843
836
  return { channel: on({ clientSdk: t2, applicationId: n2 }), close: () => {
@@ -845,7 +838,7 @@ var sn = rn({ createHost: function(e2) {
845
838
  } });
846
839
  var cn = (e2, t2) => {
847
840
  let n2 = sn.host({ applicationId: e2, componentId: t2 }), r2 = sn.auth();
848
- return Ne({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
841
+ return Me({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
849
842
  };
850
843
  var ln = (e2) => cn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
851
844
  var un = [`ANY_FEMALE`, `ANY_MALE`];
@@ -861,10 +854,10 @@ var _n = ((e2) => {
861
854
  })(gn);
862
855
  var vn = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
863
856
  var G = String.fromCharCode.bind(String);
864
- var yn = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
865
- var bn = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
866
- var xn = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
867
- var Sn = (e2) => {
857
+ var K = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
858
+ var yn = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
859
+ var bn = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
860
+ var xn = (e2) => {
868
861
  let t2, n2, r2, i2, a2 = ``, o2 = e2.length % 3;
869
862
  for (let o3 = 0; o3 < e2.length; ) {
870
863
  if ((n2 = e2.charCodeAt(o3++)) > 255 || (r2 = e2.charCodeAt(o3++)) > 255 || (i2 = e2.charCodeAt(o3++)) > 255) throw TypeError(`invalid character found`);
@@ -872,14 +865,14 @@ var Sn = (e2) => {
872
865
  }
873
866
  return o2 ? a2.slice(0, o2 - 3) + `===`.substring(o2) : a2;
874
867
  };
875
- var Cn = typeof btoa == `function` ? (e2) => btoa(e2) : pn ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : Sn;
876
- var wn = pn ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
868
+ var Sn = typeof btoa == `function` ? (e2) => btoa(e2) : pn ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : xn;
869
+ var Cn = pn ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
877
870
  let t2 = 4096, n2 = [];
878
871
  for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(G.apply(null, e2.subarray(r2, r2 + t2)));
879
- return Cn(n2.join(``));
872
+ return Sn(n2.join(``));
880
873
  };
881
- var Tn = (e2, t2 = false) => t2 ? bn(wn(e2)) : wn(e2);
882
- var En = (e2) => {
874
+ var wn = (e2, t2 = false) => t2 ? yn(Cn(e2)) : Cn(e2);
875
+ var Tn = (e2) => {
883
876
  if (e2.length < 2) {
884
877
  var t2 = e2.charCodeAt(0);
885
878
  return t2 < 128 ? e2 : t2 < 2048 ? G(192 | t2 >>> 6) + G(128 | t2 & 63) : G(224 | t2 >>> 12 & 15) + G(128 | t2 >>> 6 & 63) + G(128 | t2 & 63);
@@ -887,12 +880,12 @@ var En = (e2) => {
887
880
  var t2 = 65536 + (e2.charCodeAt(0) - 55296) * 1024 + (e2.charCodeAt(1) - 56320);
888
881
  return G(240 | t2 >>> 18 & 7) + G(128 | t2 >>> 12 & 63) + G(128 | t2 >>> 6 & 63) + G(128 | t2 & 63);
889
882
  };
890
- var Dn = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
891
- var On = (e2) => e2.replace(Dn, En);
892
- var kn = pn ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : hn ? (e2) => wn(hn.encode(e2)) : (e2) => Cn(On(e2));
893
- var An = (e2, t2 = false) => t2 ? bn(kn(e2)) : kn(e2);
894
- var jn = (e2) => An(e2, true);
895
- var K = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
883
+ var En = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
884
+ var Dn = (e2) => e2.replace(En, Tn);
885
+ var On = pn ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : hn ? (e2) => Cn(hn.encode(e2)) : (e2) => Sn(Dn(e2));
886
+ var kn = (e2, t2 = false) => t2 ? yn(On(e2)) : On(e2);
887
+ var An = (e2) => kn(e2, true);
888
+ var jn = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
896
889
  var Mn = (e2) => {
897
890
  switch (e2.length) {
898
891
  case 4:
@@ -904,7 +897,7 @@ var Mn = (e2) => {
904
897
  return G((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
905
898
  }
906
899
  };
907
- var Nn = (e2) => e2.replace(K, Mn);
900
+ var Nn = (e2) => e2.replace(jn, Mn);
908
901
  var Pn = (e2) => {
909
902
  if (e2 = e2.replace(/\s+/g, ``), !vn.test(e2)) throw TypeError(`malformed base64.`);
910
903
  e2 += `==`.slice(2 - (e2.length & 3));
@@ -912,11 +905,11 @@ var Pn = (e2) => {
912
905
  for (let a2 = 0; a2 < e2.length; ) t2 = _n[e2.charAt(a2++)] << 18 | _n[e2.charAt(a2++)] << 12 | (n2 = _n[e2.charAt(a2++)]) << 6 | (r2 = _n[e2.charAt(a2++)]), n2 === 64 ? i2.push(G(t2 >> 16 & 255)) : r2 === 64 ? i2.push(G(t2 >> 16 & 255, t2 >> 8 & 255)) : i2.push(G(t2 >> 16 & 255, t2 >> 8 & 255, t2 & 255));
913
906
  return i2.join(``);
914
907
  };
915
- var Fn = typeof atob == `function` ? (e2) => atob(xn(e2)) : pn ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : Pn;
916
- var In = pn ? (e2) => yn(Buffer.from(e2, `base64`)) : (e2) => yn(Fn(e2).split(``).map((e3) => e3.charCodeAt(0)));
908
+ var Fn = typeof atob == `function` ? (e2) => atob(bn(e2)) : pn ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : Pn;
909
+ var In = pn ? (e2) => K(Buffer.from(e2, `base64`)) : (e2) => K(Fn(e2).split(``).map((e3) => e3.charCodeAt(0)));
917
910
  var Ln = (e2) => In(zn(e2));
918
911
  var Rn = pn ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : mn ? (e2) => mn.decode(In(e2)) : (e2) => Nn(Fn(e2));
919
- var zn = (e2) => xn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
912
+ var zn = (e2) => bn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
920
913
  var Bn = (e2) => Rn(zn(e2));
921
914
  var Vn = (e2) => {
922
915
  if (typeof e2 != `string`) return false;
@@ -929,11 +922,11 @@ var Un = function() {
929
922
  e2(`fromBase64`, function() {
930
923
  return Bn(this);
931
924
  }), e2(`toBase64`, function(e3) {
932
- return An(this, e3);
925
+ return kn(this, e3);
933
926
  }), e2(`toBase64URI`, function() {
934
- return An(this, true);
927
+ return kn(this, true);
935
928
  }), e2(`toBase64URL`, function() {
936
- return An(this, true);
929
+ return kn(this, true);
937
930
  }), e2(`toUint8Array`, function() {
938
931
  return Ln(this);
939
932
  });
@@ -941,14 +934,14 @@ var Un = function() {
941
934
  var Wn = function() {
942
935
  let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, Hn(t2));
943
936
  e2(`toBase64`, function(e3) {
944
- return Tn(this, e3);
937
+ return wn(this, e3);
945
938
  }), e2(`toBase64URI`, function() {
946
- return Tn(this, true);
939
+ return wn(this, true);
947
940
  }), e2(`toBase64URL`, function() {
948
- return Tn(this, true);
941
+ return wn(this, true);
949
942
  });
950
943
  };
951
- var Gn = { version: dn, VERSION: fn, atob: Fn, atobPolyfill: Pn, btoa: Cn, btoaPolyfill: Sn, fromBase64: Bn, toBase64: An, encode: An, encodeURI: jn, encodeURL: jn, utob: On, btou: Nn, decode: Bn, isValid: Vn, fromUint8Array: Tn, toUint8Array: Ln, extendString: Un, extendUint8Array: Wn, extendBuiltins: () => {
944
+ var Gn = { version: dn, VERSION: fn, atob: Fn, atobPolyfill: Pn, btoa: Sn, btoaPolyfill: xn, fromBase64: Bn, toBase64: kn, encode: kn, encodeURI: An, encodeURL: An, utob: Dn, btou: Nn, decode: Bn, isValid: Vn, fromUint8Array: wn, toUint8Array: Ln, extendString: Un, extendUint8Array: Wn, extendBuiltins: () => {
952
945
  Un(), Wn();
953
946
  } };
954
947
  var q = Uint8Array;
@@ -1537,22 +1530,22 @@ function ra(e2, t2) {
1537
1530
  var ia = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1538
1531
  var aa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1539
1532
  function oa(e2) {
1540
- return Ct(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1533
+ return St(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1541
1534
  }
1542
1535
  var sa = `@wix/auto_sdk_bookings_availability-time-slots`;
1543
1536
  function ca(e2) {
1544
1537
  function t2({ host: t3 }) {
1545
- let n2 = tt(e2, [{ transformFn: z, paths: ia }]);
1538
+ let n2 = tt(e2, [{ transformFn: He, paths: ia }]);
1546
1539
  return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName: sa, migrationOptions: { optInTransformResponse: true }, url: oa({ protoPath: `/v2/time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: aa }]) };
1547
1540
  }
1548
1541
  return t2;
1549
1542
  }
1550
1543
  async function la(e2) {
1551
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ca(R({ serviceId: e2?.serviceId, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, locations: e2?.locations, includeResourceTypeIds: e2?.includeResourceTypeIds, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging, customerChoices: e2?.customerChoices, resourceTypes: e2?.resourceTypes }));
1544
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ca(Be({ serviceId: e2?.serviceId, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, locations: e2?.locations, includeResourceTypeIds: e2?.includeResourceTypeIds, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging, customerChoices: e2?.customerChoices, resourceTypes: e2?.resourceTypes }));
1552
1545
  n2?.onSiteCall?.();
1553
1546
  try {
1554
1547
  let e3 = await t2.request(r2);
1555
- return n2?.onSuccess?.(e3), He(e3.data);
1548
+ return n2?.onSuccess?.(e3), Ve(e3.data);
1556
1549
  } catch (e3) {
1557
1550
  let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { serviceId: `$[0].serviceId`, fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, locations: `$[0].locations`, includeResourceTypeIds: `$[0].includeResourceTypeIds`, bookable: `$[0].bookable`, bookingPolicyViolations: `$[0].bookingPolicyViolations`, timeSlotsPerDay: `$[0].timeSlotsPerDay`, cursorPaging: `$[0].cursorPaging`, customerChoices: `$[0].customerChoices`, resourceTypes: `$[0].resourceTypes` }, singleArgumentUnchanged: false }, [`options`]);
1558
1551
  throw n2?.onError?.(e3), t3;
@@ -1561,26 +1554,26 @@ async function la(e2) {
1561
1554
  function ua(e2) {
1562
1555
  return (t2) => la(t2, { httpClient: e2 });
1563
1556
  }
1564
- var da = xt(ua);
1557
+ var da = H(ua);
1565
1558
  var fa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1566
1559
  var pa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }, { path: `schedulesInfo.firstSessionStart` }, { path: `schedulesInfo.lastSessionEnd` }, { path: `schedulesInfo.enrollmentViolations.earliestBookingDate` }];
1567
1560
  function ma(e2) {
1568
- return Ct(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1561
+ return St(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1569
1562
  }
1570
1563
  var ha = `@wix/auto_sdk_bookings_event-time-slots`;
1571
1564
  function ga(e2) {
1572
1565
  function t2({ host: t3 }) {
1573
- let n2 = tt(e2, [{ transformFn: z, paths: fa }]);
1566
+ let n2 = tt(e2, [{ transformFn: He, paths: fa }]);
1574
1567
  return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName: ha, migrationOptions: { optInTransformResponse: true }, url: ma({ protoPath: `/v2/time-slots/event`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: pa }]) };
1575
1568
  }
1576
1569
  return t2;
1577
1570
  }
1578
1571
  async function _a(e2) {
1579
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ga(R({ fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, serviceIds: e2?.serviceIds, includeNonBookable: e2?.includeNonBookable, minBookableCapacity: e2?.minBookableCapacity, eventFilter: e2?.eventFilter, maxSlotsPerDay: e2?.maxSlotsPerDay, cursorPaging: e2?.cursorPaging, bookingPolicyViolations: e2?.bookingPolicyViolations }));
1572
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ga(Be({ fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, serviceIds: e2?.serviceIds, includeNonBookable: e2?.includeNonBookable, minBookableCapacity: e2?.minBookableCapacity, eventFilter: e2?.eventFilter, maxSlotsPerDay: e2?.maxSlotsPerDay, cursorPaging: e2?.cursorPaging, bookingPolicyViolations: e2?.bookingPolicyViolations }));
1580
1573
  n2?.onSiteCall?.();
1581
1574
  try {
1582
1575
  let e3 = await t2.request(r2);
1583
- return n2?.onSuccess?.(e3), He(e3.data);
1576
+ return n2?.onSuccess?.(e3), Ve(e3.data);
1584
1577
  } catch (e3) {
1585
1578
  let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, serviceIds: `$[0].serviceIds`, includeNonBookable: `$[0].includeNonBookable`, minBookableCapacity: `$[0].minBookableCapacity`, eventFilter: `$[0].eventFilter`, maxSlotsPerDay: `$[0].maxSlotsPerDay`, cursorPaging: `$[0].cursorPaging`, bookingPolicyViolations: `$[0].bookingPolicyViolations` }, singleArgumentUnchanged: false }, [`options`]);
1586
1579
  throw n2?.onError?.(e3), t3;
@@ -1589,26 +1582,26 @@ async function _a(e2) {
1589
1582
  function va(e2) {
1590
1583
  return (t2) => _a(t2, { httpClient: e2 });
1591
1584
  }
1592
- var ya = xt(va);
1585
+ var ya = H(va);
1593
1586
  var ba = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1594
1587
  var xa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1595
1588
  function Sa(e2) {
1596
- return Ct(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1589
+ return St(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1597
1590
  }
1598
1591
  var Ca = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
1599
1592
  function wa(e2) {
1600
1593
  function t2({ host: t3 }) {
1601
- let n2 = tt(e2, [{ transformFn: z, paths: ba }]);
1594
+ let n2 = tt(e2, [{ transformFn: He, paths: ba }]);
1602
1595
  return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName: Ca, migrationOptions: { optInTransformResponse: true }, url: Sa({ protoPath: `/v2/multi-service-time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: xa }]) };
1603
1596
  }
1604
1597
  return t2;
1605
1598
  }
1606
1599
  async function Ta(e2) {
1607
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = wa(R({ services: e2?.services, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, location: e2?.location, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging }));
1600
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = wa(Be({ services: e2?.services, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, location: e2?.location, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging }));
1608
1601
  n2?.onSiteCall?.();
1609
1602
  try {
1610
1603
  let e3 = await t2.request(r2);
1611
- return n2?.onSuccess?.(e3), He(e3.data);
1604
+ return n2?.onSuccess?.(e3), Ve(e3.data);
1612
1605
  } catch (e3) {
1613
1606
  let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { services: `$[0].services`, fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, location: `$[0].location`, bookable: `$[0].bookable`, bookingPolicyViolations: `$[0].bookingPolicyViolations`, timeSlotsPerDay: `$[0].timeSlotsPerDay`, cursorPaging: `$[0].cursorPaging` }, singleArgumentUnchanged: false }, [`options`]);
1614
1607
  throw n2?.onError?.(e3), t3;
@@ -1617,28 +1610,28 @@ async function Ta(e2) {
1617
1610
  function Ea(e2) {
1618
1611
  return (t2) => Ta(t2, { httpClient: e2 });
1619
1612
  }
1620
- var Da = xt(Ea);
1613
+ var Da = H(Ea);
1621
1614
  var Oa = ((e2) => (e2.UNKNOWN = `UNKNOWN`, e2.CUSTOM = `CUSTOM`, e2.STAFF_MEMBER = `STAFF_MEMBER`, e2.DURATION = `DURATION`, e2.DATE_TIME = `DATE_TIME`, e2.NUMBER_OF_PARTICIPANTS = `NUMBER_OF_PARTICIPANTS`, e2.LOCATION = `LOCATION`, e2.DURATION_RANGE = `DURATION_RANGE`, e2))(Oa || {});
1622
1615
  var ka = ((e2) => (e2.APPOINTMENT = `APPOINTMENT`, e2.CLASS = `CLASS`, e2.COURSE = `COURSE`, e2))(ka || {});
1623
1616
  var Aa = ((e2) => (e2.FIXED = `FIXED`, e2.CUSTOM = `CUSTOM`, e2.VARIED = `VARIED`, e2.NO_FEE = `NO_FEE`, e2.SUBSCRIPTION = `SUBSCRIPTION`, e2))(Aa || {});
1624
1617
  var ja = ((e2) => (e2.CUSTOM = `CUSTOM`, e2.BUSINESS = `BUSINESS`, e2.CUSTOMER = `CUSTOMER`, e2))(ja || {});
1625
1618
  var Ma = [{ path: `timeSlotsConfiguration.createdDate` }, { path: `timeSlotsConfiguration.updatedDate` }];
1626
1619
  function Na(e2) {
1627
- return Ct(Object.assign(e2, { domainToMappings: { _: [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }] } }));
1620
+ return St(Object.assign(e2, { domainToMappings: { _: [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }] } }));
1628
1621
  }
1629
1622
  var Pa = `@wix/auto_sdk_bookings_time-slots-configuration`;
1630
1623
  function Fa(e2) {
1631
1624
  function t2({ host: t3 }) {
1632
- return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName: Pa, migrationOptions: { optInTransformResponse: true }, url: Na({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: St(e2), transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: Ma }]) };
1625
+ return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName: Pa, migrationOptions: { optInTransformResponse: true }, url: Na({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: xt(e2), transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: Ma }]) };
1633
1626
  }
1634
1627
  return t2;
1635
1628
  }
1636
1629
  async function Ia(e2) {
1637
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Fa(R({ appId: e2 }));
1630
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Fa(Be({ appId: e2 }));
1638
1631
  n2?.onSiteCall?.();
1639
1632
  try {
1640
1633
  let e3 = await t2.request(r2);
1641
- return n2?.onSuccess?.(e3), He(e3.data);
1634
+ return n2?.onSuccess?.(e3), Ve(e3.data);
1642
1635
  } catch (e3) {
1643
1636
  let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
1644
1637
  throw n2?.onError?.(e3), t3;
@@ -1647,26 +1640,26 @@ async function Ia(e2) {
1647
1640
  function La(e2) {
1648
1641
  return (t2) => Ia(t2, { httpClient: e2 });
1649
1642
  }
1650
- var Ra = xt(La);
1643
+ var Ra = H(La);
1651
1644
  var za = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
1652
1645
  var Ba = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
1653
1646
  function Va(e2) {
1654
- return Ct(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "dev._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], _: [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/bookings-settings`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }] } }));
1647
+ return St(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "dev._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], _: [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/bookings-settings`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }] } }));
1655
1648
  }
1656
1649
  var Ha = `@wix/auto_sdk_bookings_bookings-settings`;
1657
1650
  function Ua(e2) {
1658
1651
  function t2({ host: t3 }) {
1659
- return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Ha, migrationOptions: { optInTransformResponse: true }, url: Va({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: St(e2), transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: za }, { transformFn: U, paths: Ba }]), fallback: [{ method: `GET`, url: Va({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: St(e2) }] };
1652
+ return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Ha, migrationOptions: { optInTransformResponse: true }, url: Va({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: xt(e2), transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: za }, { transformFn: qt, paths: Ba }]), fallback: [{ method: `GET`, url: Va({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: xt(e2) }] };
1660
1653
  }
1661
1654
  return t2;
1662
1655
  }
1663
1656
  var Wa = ((e2) => (e2.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e2.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e2))(Wa || {});
1664
1657
  async function Ga() {
1665
- let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = Ua(R({}));
1658
+ let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = Ua(Be({}));
1666
1659
  t2?.onSiteCall?.();
1667
1660
  try {
1668
1661
  let r2 = await e2.request(n2);
1669
- return t2?.onSuccess?.(r2), He(r2.data)?.bookingsSettings;
1662
+ return t2?.onSuccess?.(r2), Ve(r2.data)?.bookingsSettings;
1670
1663
  } catch (e3) {
1671
1664
  let n3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
1672
1665
  throw t2?.onError?.(e3), n3;
@@ -1675,7 +1668,7 @@ async function Ga() {
1675
1668
  function Ka(e2) {
1676
1669
  return () => Ga({ httpClient: e2 });
1677
1670
  }
1678
- var qa = xt(Ka);
1671
+ var qa = H(Ka);
1679
1672
  function Ja(e2) {
1680
1673
  return e2.business?._id ?? null;
1681
1674
  }
@@ -1832,7 +1825,7 @@ var To = class {
1832
1825
  };
1833
1826
  var Eo = (e2) => new To(e2);
1834
1827
  var Do = wo({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : Eo(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
1835
- var $ = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule` };
1828
+ var $ = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule`, intakeForms: `intake-forms` };
1836
1829
  function Oo(e2) {
1837
1830
  try {
1838
1831
  let t2 = Do.getMonitoringClient?.();
@@ -1863,81 +1856,79 @@ function Mo(e2) {
1863
1856
  function No(e2) {
1864
1857
  return Mo({ bookableCapacity: e2.bookableCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false });
1865
1858
  }
1866
- var Po = (e2) => {
1867
- let t2 = (e3) => e3 < 10 ? `0${e3}` : `${e3}`;
1868
- return `${e2.getFullYear()}-${t2(e2.getMonth() + 1)}-${t2(e2.getDate())}`;
1869
- };
1870
- var Fo = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
1871
- var Io = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
1872
- var Lo = (e2) => `${Po(e2)}T00:00:00`;
1873
- var Ro = (e2) => `${Po(e2)}T23:59:59`;
1874
- function zo(e2, t2) {
1875
- return `${Io(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
1876
- }
1859
+ var Po = (e2) => e2 < 10 ? `0${e2}` : `${e2}`;
1860
+ var Fo = (e2) => `${e2.getFullYear()}-${Po(e2.getMonth() + 1)}-${Po(e2.getDate())}`;
1861
+ var Io = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
1862
+ var Lo = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
1863
+ var Ro = (e2) => `${Fo(e2)}T00:00:00`;
1864
+ var zo = (e2) => `${Fo(e2)}T23:59:59`;
1877
1865
  function Bo(e2, t2) {
1878
- let n2 = zo(new Date(Date.now()), t2);
1879
- return n2.slice(0, 10) === e2 ? n2 : `${e2}T00:00:00`;
1866
+ return `${Lo(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
1880
1867
  }
1881
- var Vo = /^\d{4}-\d{2}-\d{2}$/;
1882
- var Ho = 864e5;
1883
- function Uo(e2) {
1884
- if (typeof e2 != `string` || !Vo.test(e2)) return false;
1885
- let t2 = Fo(e2);
1886
- return !Number.isNaN(t2.getTime()) && Po(t2) === e2;
1868
+ function Vo(e2, t2) {
1869
+ let n2 = Bo(new Date(Date.now()), t2);
1870
+ return n2.slice(0, 10) === e2 ? n2 : `${e2}T00:00:00`;
1887
1871
  }
1872
+ var Ho = /^\d{4}-\d{2}-\d{2}$/;
1873
+ var Uo = 864e5;
1888
1874
  function Wo(e2) {
1875
+ if (typeof e2 != `string` || !Ho.test(e2)) return false;
1876
+ let t2 = Io(e2);
1877
+ return !Number.isNaN(t2.getTime()) && Fo(t2) === e2;
1878
+ }
1879
+ function Go(e2) {
1889
1880
  if (!e2 || typeof e2 != `object`) return false;
1890
1881
  let { startDate: t2, endDate: n2 } = e2;
1891
- return Uo(t2) && Uo(n2) && t2 <= n2;
1882
+ return Wo(t2) && Wo(n2) && t2 <= n2;
1892
1883
  }
1893
- function Go(e2, t2) {
1894
- let n2 = Fo(e2);
1895
- return n2.setDate(n2.getDate() + t2), Po(n2);
1884
+ function Ko(e2, t2) {
1885
+ let n2 = Io(e2);
1886
+ return n2.setDate(n2.getDate() + t2), Fo(n2);
1896
1887
  }
1897
- function Ko({ startDate: e2, endDate: t2 }) {
1898
- let n2 = Fo(t2).getTime() - Fo(e2).getTime();
1899
- return Math.round(n2 / Ho) + 1;
1888
+ function qo({ startDate: e2, endDate: t2 }) {
1889
+ let n2 = Io(t2).getTime() - Io(e2).getTime();
1890
+ return Math.round(n2 / Uo) + 1;
1900
1891
  }
1901
- function qo(e2) {
1902
- let t2 = Fo(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
1903
- return { startDate: Po(n2), endDate: Po(r2) };
1892
+ function Jo(e2) {
1893
+ let t2 = Io(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
1894
+ return { startDate: Fo(n2), endDate: Fo(r2) };
1904
1895
  }
1905
- function Jo(e2, t2) {
1896
+ function Yo(e2, t2) {
1906
1897
  return e2 >= t2.startDate && e2 <= t2.endDate;
1907
1898
  }
1908
- function Yo(e2) {
1909
- let t2 = Fo(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
1910
- return Po(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
1911
- }
1912
1899
  function Xo(e2) {
1900
+ let t2 = Io(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
1901
+ return Fo(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
1902
+ }
1903
+ function Zo(e2) {
1913
1904
  let t2 = [], n2 = e2.startDate;
1914
1905
  for (; n2 <= e2.endDate; ) {
1915
- let r2 = Go(Yo(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
1916
- t2.push({ startDate: n2, endDate: i2 }), n2 = Go(i2, 1);
1906
+ let r2 = Ko(Xo(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
1907
+ t2.push({ startDate: n2, endDate: i2 }), n2 = Ko(i2, 1);
1917
1908
  }
1918
1909
  return t2;
1919
1910
  }
1920
- function Zo({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
1911
+ function Qo({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
1921
1912
  return e2 && t2 !== `CUSTOMER_CANNOT_CHOOSE`;
1922
1913
  }
1923
- async function Qo() {
1914
+ async function $o() {
1924
1915
  let e2 = await Ra(Ur);
1925
1916
  return { businessTimeZone: e2.timeSlotsConfiguration?.displayTimeZone?.timeZone || null, staffSelectionStrategy: e2.timeSlotsConfiguration?.staffSelection?.strategy ?? null, allowGenderSelection: e2.timeSlotsConfiguration?.staffSelection?.allowGenderSelection ?? false };
1926
1917
  }
1927
- function $o(e2) {
1918
+ function es(e2) {
1928
1919
  let t2 = e2.location?._id || (e2.location?.locationType ? `${e2.location.locationType}:${e2.location.formattedAddress ?? ``}` : ``);
1929
1920
  return `${e2.localStartDate ?? ``}|${e2.localEndDate ?? ``}|${t2}`;
1930
1921
  }
1931
- function es(e2) {
1932
- return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
1933
- }
1934
1922
  function ts(e2) {
1935
- return `${$o(e2)}|${es(e2) ?? ``}`;
1923
+ return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
1936
1924
  }
1937
1925
  function ns(e2) {
1926
+ return `${es(e2)}|${ts(e2) ?? ``}`;
1927
+ }
1928
+ function rs(e2) {
1938
1929
  let t2 = /* @__PURE__ */ new Map();
1939
1930
  for (let n2 of e2) {
1940
- let e3 = $o(n2), r2 = t2.get(e3);
1931
+ let e3 = es(n2), r2 = t2.get(e3);
1941
1932
  r2 ? r2.push(n2) : t2.set(e3, [n2]);
1942
1933
  }
1943
1934
  return [...t2.values()].map((e3) => {
@@ -1946,132 +1937,132 @@ function ns(e2) {
1946
1937
  return { ...n2[0], availableResources: n2.flatMap((e4) => e4.availableResources ?? []) };
1947
1938
  });
1948
1939
  }
1949
- function rs(e2) {
1940
+ function is(e2) {
1950
1941
  return e2 ? { locations: [{ _id: e2, locationType: `BUSINESS` }] } : {};
1951
1942
  }
1952
- function is(e2) {
1943
+ function as(e2) {
1953
1944
  return e2 ? { resourceTypes: [{ resourceTypeId: Kr, resourceIds: [e2] }] } : {};
1954
1945
  }
1955
- function as(e2) {
1946
+ function os(e2) {
1956
1947
  let { requestedGender: t2, ...n2 } = e2;
1957
1948
  return Object.keys(n2).length ? n2 : void 0;
1958
1949
  }
1959
- function os(e2, t2) {
1950
+ function ss(e2, t2) {
1960
1951
  if (!e2) return {};
1961
- let n2 = t2 ? as(e2) : e2;
1952
+ let n2 = t2 ? os(e2) : e2;
1962
1953
  return n2 ? { customerChoices: n2 } : {};
1963
1954
  }
1964
- var ss = `REQUESTED_GENDER_NOT_ALLOWED`;
1965
- function cs(e2) {
1966
- return bo(e2) === ss;
1955
+ var cs = `REQUESTED_GENDER_NOT_ALLOWED`;
1956
+ function ls(e2) {
1957
+ return bo(e2) === cs;
1967
1958
  }
1968
- var ls = false;
1969
- var us = /* @__PURE__ */ new Set();
1970
- function ds() {
1971
- return ls;
1959
+ var us = false;
1960
+ var ds = /* @__PURE__ */ new Set();
1961
+ function fs() {
1962
+ return us;
1972
1963
  }
1973
- function fs(e2) {
1974
- return us.add(e2), () => us.delete(e2);
1964
+ function ps(e2) {
1965
+ return ds.add(e2), () => ds.delete(e2);
1975
1966
  }
1976
- function ps() {
1977
- ls || (ls = true, us.forEach((e2) => e2()));
1967
+ function ms() {
1968
+ us || (us = true, ds.forEach((e2) => e2()));
1978
1969
  }
1979
- async function ms(e2) {
1970
+ async function hs(e2) {
1980
1971
  let { customerChoices: t2, ...n2 } = e2, r2 = (e3) => {
1981
- let t3 = as(e3);
1972
+ let t3 = os(e3);
1982
1973
  return da({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
1983
1974
  };
1984
- if (ls && t2?.requestedGender) return r2(t2);
1975
+ if (us && t2?.requestedGender) return r2(t2);
1985
1976
  try {
1986
1977
  return await da(e2);
1987
1978
  } catch (e3) {
1988
- if (!t2?.requestedGender || !cs(e3)) throw e3;
1989
- return ko(e3, { feature: $.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ps(), r2(t2);
1979
+ if (!t2?.requestedGender || !ls(e3)) throw e3;
1980
+ return ko(e3, { feature: $.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ms(), r2(t2);
1990
1981
  }
1991
1982
  }
1992
- function hs(e2, t2, n2) {
1983
+ function gs(e2, t2, n2) {
1993
1984
  return { ...e2 ? { "location.id": e2 } : {}, ...t2 ? { "resources.id": { $hasSome: [t2] } } : {}, ...n2 ? { remainingCapacity: { $gte: n2 } } : {} };
1994
1985
  }
1995
- async function gs(e2) {
1986
+ async function _s(e2) {
1996
1987
  let t2 = await ya(e2);
1997
1988
  return { timeSlots: t2.timeSlots ?? [], timeZone: t2.timeZone ?? null, nextCursor: t2.pagingMetadata?.cursors?.next || null };
1998
1989
  }
1999
- function _s({ serviceId: e2, serviceType: t2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2 = false, customerChoices: c2, minRemainingCapacity: l2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) {
2000
- return Za(t2) ? vs({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : gs({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...hs(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
1990
+ function vs({ serviceId: e2, serviceType: t2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2 = false, customerChoices: c2, minRemainingCapacity: l2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) {
1991
+ return Za(t2) ? ys({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : _s({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...gs(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
2001
1992
  }
2002
- async function vs({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
2003
- let d2 = await ms({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...rs(i2), ...is(a2), ...os(s2, a2), includeResourceTypeIds: [Kr], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
1993
+ async function ys({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
1994
+ let d2 = await hs({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...is(i2), ...as(a2), ...ss(s2, a2), includeResourceTypeIds: [Kr], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
2004
1995
  return { timeSlots: d2.timeSlots ?? [], timeZone: d2.timeZone ?? null, nextCursor: d2.cursorPagingMetadata?.cursors?.next || null };
2005
1996
  }
2006
- var ys = 6;
2007
- var bs = 864e5;
2008
- function xs(e2) {
2009
- let t2 = e2 ? Fo(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + ys + 1, 1), r2 = new Date(n2.getTime() - bs);
2010
- return { fromLocalDate: Lo(t2), toLocalDate: Ro(r2) };
1997
+ var bs = 6;
1998
+ var xs = 864e5;
1999
+ function Ss(e2) {
2000
+ let t2 = e2 ? Io(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + bs + 1, 1), r2 = new Date(n2.getTime() - xs);
2001
+ return { fromLocalDate: Ro(t2), toLocalDate: zo(r2) };
2011
2002
  }
2012
- async function Ss({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
2013
- let { fromLocalDate: u2, toLocalDate: d2 } = xs(a2);
2003
+ async function Cs({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
2004
+ let { fromLocalDate: u2, toLocalDate: d2 } = Ss(a2);
2014
2005
  if (Qa(t2) || $a(t2)) {
2015
- let a3 = { ...$a(t2) ? { type: `COURSE` } : {}, ...hs(o2, s2, l2) }, c3 = await gs({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2006
+ let a3 = { ...$a(t2) ? { type: `COURSE` } : {}, ...gs(o2, s2, l2) }, c3 = await _s({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2016
2007
  return { timeSlots: c3.timeSlots, timeZone: c3.timeZone };
2017
2008
  }
2018
- let f2 = await ms({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...rs(o2), ...is(s2), ...os(c2, s2), includeResourceTypeIds: [Kr], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2009
+ let f2 = await hs({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...is(o2), ...as(s2), ...ss(c2, s2), includeResourceTypeIds: [Kr], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2019
2010
  return { timeSlots: f2.timeSlots ?? [], timeZone: f2.timeZone ?? null };
2020
2011
  }
2021
- var Cs = 1e3;
2022
- async function ws({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, keepWaitlistSlots: l2 = false, fromLocalDate: u2, toLocalDate: d2 }) {
2012
+ var ws = 1e3;
2013
+ async function Ts({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, keepWaitlistSlots: l2 = false, fromLocalDate: u2, toLocalDate: d2 }) {
2023
2014
  let f2 = `${n2}T00:00:00`, p2 = `${n2}T23:59:59`, m2 = $a(t2) ? `COURSE` : Qa(t2) ? `CLASS` : `APPOINTMENT`, h2 = l2 && i2 && m2 === `CLASS`, g2 = [], _2 = null, v2;
2024
2015
  do {
2025
- let t3 = await _s({ serviceId: e2, serviceType: m2, fromLocalDate: u2 && u2 > f2 ? u2 : f2, toLocalDate: d2 && d2 < p2 ? d2 : p2, timeZone: r2, locationId: a2, staffId: o2, onlyAvailableSlots: i2 && !h2, customerChoices: s2, minRemainingCapacity: c2, limit: Cs, cursor: v2 });
2016
+ let t3 = await vs({ serviceId: e2, serviceType: m2, fromLocalDate: u2 && u2 > f2 ? u2 : f2, toLocalDate: d2 && d2 < p2 ? d2 : p2, timeZone: r2, locationId: a2, staffId: o2, onlyAvailableSlots: i2 && !h2, customerChoices: s2, minRemainingCapacity: c2, limit: ws, cursor: v2 });
2026
2017
  g2.push(...h2 ? t3.timeSlots.filter((e3) => e3.bookable || No(e3)) : t3.timeSlots), _2 = t3.timeZone ?? _2, v2 = t3.nextCursor ?? void 0;
2027
2018
  } while (v2);
2028
2019
  return { timeSlots: g2, timeZone: _2 };
2029
2020
  }
2030
- function Ts(e2) {
2021
+ function Es(e2) {
2031
2022
  return { slotStart: e2.localStartDate, slotEnd: e2.localEndDate, eventId: e2.eventInfo?.eventId, scheduleId: e2.scheduleId ?? void 0, locationId: e2.location?._id ?? void 0, locationType: e2.location?.locationType ?? void 0 };
2032
2023
  }
2033
- function Es(e2) {
2024
+ function Ds(e2) {
2034
2025
  return e2?.options?.values?.[0]?.type === Oa.STAFF_MEMBER;
2035
2026
  }
2036
- function Ds(e2) {
2027
+ function Os(e2) {
2037
2028
  return e2.staffMemberDetails?.staffMembers ?? [];
2038
2029
  }
2039
- function Os(e2, t2) {
2030
+ function ks(e2, t2) {
2040
2031
  let n2 = e2.workingHoursLocationCoverage;
2041
2032
  return { staffMemberId: e2.staffMemberId ?? ``, name: e2.name ?? null, image: null, isSelected: t2 === e2.staffMemberId, ...n2 ? { locationCoverage: { availableAtAllLocations: n2.availableAtAllLocations ?? false, locationIds: n2.locationIds ?? [] } } : {} };
2042
2033
  }
2043
- function ks(e2, t2) {
2034
+ function As(e2, t2) {
2044
2035
  let n2 = e2.locationCoverage;
2045
2036
  return !n2 || n2.availableAtAllLocations || n2.locationIds.includes(t2);
2046
2037
  }
2047
- function As(e2, t2) {
2048
- return t2 ? e2.filter((e3) => ks(e3, t2)) : e2;
2049
- }
2050
2038
  function js(e2, t2) {
2039
+ return t2 ? e2.filter((e3) => As(e3, t2)) : e2;
2040
+ }
2041
+ function Ms(e2, t2) {
2051
2042
  let n2 = new Map(t2.map((e3) => [e3.staffMemberId, e3.locationCoverage]));
2052
2043
  return e2.choices.map((e3) => e3.choiceId).filter((e3) => e3 != null).map((e3) => ({ staffMemberId: e3, locationCoverage: n2.get(e3) }));
2053
2044
  }
2054
- function Ms(e2, t2, n2) {
2045
+ function Ns(e2, t2, n2) {
2055
2046
  if (e2?.type !== `STAFF_MEMBER` || !n2) return;
2056
- let r2 = As(js(e2, t2), n2);
2047
+ let r2 = js(Ms(e2, t2), n2);
2057
2048
  return r2.length === 1 ? r2[0].staffMemberId : void 0;
2058
2049
  }
2059
- function Ns(e2, t2) {
2050
+ function Ps(e2, t2) {
2060
2051
  if (t2.length === 0) return e2;
2061
- let n2 = e2.filter((e3) => As(t2, e3.id).length > 0);
2052
+ let n2 = e2.filter((e3) => js(t2, e3.id).length > 0);
2062
2053
  return n2.length > 0 ? n2 : e2;
2063
2054
  }
2064
- function Ps(e2) {
2065
- return Ds(e2).map((e3) => Os(e3, null));
2055
+ function Fs(e2) {
2056
+ return Os(e2).map((e3) => ks(e3, null));
2066
2057
  }
2067
- function Fs(e2, t2, n2 = false) {
2068
- let r2 = Is(e2), i2 = r2.length === 1 ? r2[0].id : void 0, a2 = n2 || !i2 || r2.some((e3) => e3.id === t2);
2058
+ function Is(e2, t2, n2 = false) {
2059
+ let r2 = Ls(e2), i2 = r2.length === 1 ? r2[0].id : void 0, a2 = n2 || !i2 || r2.some((e3) => e3.id === t2);
2069
2060
  return t2 && a2 ? t2 : i2;
2070
2061
  }
2071
- function Is(e2) {
2072
- return Ns(Xa(e2), Ps(e2));
2073
- }
2074
2062
  function Ls(e2) {
2063
+ return Ps(Xa(e2), Fs(e2));
2064
+ }
2065
+ function Rs(e2) {
2075
2066
  let t2 = e2;
2076
2067
  return t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
2077
2068
  t2.__state = { status: `fulfilled`, value: e3 };
@@ -2079,33 +2070,33 @@ function Ls(e2) {
2079
2070
  t2.__state = { status: `rejected`, reason: e3 };
2080
2071
  })), t2.__state;
2081
2072
  }
2082
- function Rs(e2) {
2083
- let t2 = Ls(e2);
2073
+ function zs(e2) {
2074
+ let t2 = Rs(e2);
2084
2075
  if (t2.status === `fulfilled`) return t2.value;
2085
2076
  throw t2.status === `rejected` ? t2.reason : e2;
2086
2077
  }
2087
- function zs(e2) {
2078
+ function Bs(e2) {
2088
2079
  let t2 = Promise.resolve(e2);
2089
2080
  return t2.__state = { status: `fulfilled`, value: e2 }, t2;
2090
2081
  }
2091
- var Bs = Lr(`@wix/site-service-warmup-data`);
2092
- function Vs() {
2082
+ var Vs = Lr(`@wix/site-service-warmup-data`);
2083
+ function Hs() {
2093
2084
  try {
2094
2085
  return f();
2095
2086
  } catch {
2096
2087
  return null;
2097
2088
  }
2098
2089
  }
2099
- function Hs(e2) {
2090
+ function Us(e2) {
2100
2091
  try {
2101
- return e2 ? e2(Bs) : null;
2092
+ return e2 ? e2(Vs) : null;
2102
2093
  } catch {
2103
2094
  return null;
2104
2095
  }
2105
2096
  }
2106
- function Us() {
2107
- let e2 = Hs(Vs()), t2 = typeof window > `u`;
2108
- return { scope: e2 ?? void 0, get: async (n2) => {
2097
+ function Ws() {
2098
+ let e2 = Us(Hs()), t2 = typeof window > `u`;
2099
+ return s(() => ({ scope: e2 ?? void 0, get: async (n2) => {
2109
2100
  if (t2 || !e2) return null;
2110
2101
  try {
2111
2102
  return await e2.get(n2);
@@ -2117,59 +2108,59 @@ function Us() {
2117
2108
  e2.set(n2, r2);
2118
2109
  } catch {
2119
2110
  }
2120
- } };
2121
- }
2122
- var Ws = `bookings-uou`;
2123
- function Gs() {
2124
- return `${Ws}:bookings-settings`;
2111
+ } }), [e2, t2]);
2125
2112
  }
2113
+ var Gs = `bookings-uou`;
2126
2114
  function Ks() {
2127
- return `${Ws}:time-slots-configuration`;
2115
+ return `${Gs}:bookings-settings`;
2116
+ }
2117
+ function qs() {
2118
+ return `${Gs}:time-slots-configuration`;
2128
2119
  }
2129
- var qs = 5e3;
2130
- var Js = 100;
2131
- var Ys = `wix-warmup-data`;
2132
- var Xs = null;
2133
- function Zs(e2) {
2120
+ var Js = 5e3;
2121
+ var Ys = 100;
2122
+ var Xs = `wix-warmup-data`;
2123
+ var Zs = null;
2124
+ function Qs(e2) {
2134
2125
  if (typeof document < `u`) try {
2135
- let t2 = document.getElementById(Ys)?.textContent;
2136
- return t2 ? (Xs?.text !== t2 && (Xs = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Xs.data[e2] ?? void 0) : void 0;
2126
+ let t2 = document.getElementById(Xs)?.textContent;
2127
+ return t2 ? (Zs?.text !== t2 && (Zs = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Zs.data[e2] ?? void 0) : void 0;
2137
2128
  } catch {
2138
2129
  return;
2139
2130
  }
2140
2131
  }
2141
- var Qs = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
2142
- var $s = Qs();
2143
- var ec = /* @__PURE__ */ new WeakMap();
2132
+ var $s = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
2133
+ var ec = $s();
2144
2134
  var tc = /* @__PURE__ */ new WeakMap();
2145
- function nc(e2) {
2146
- if (!e2) return $s;
2147
- let t2 = ec.get(e2);
2148
- return t2 || (t2 = Qs(), ec.set(e2, t2)), t2;
2135
+ var nc = /* @__PURE__ */ new WeakMap();
2136
+ function rc(e2) {
2137
+ if (!e2) return ec;
2138
+ let t2 = tc.get(e2);
2139
+ return t2 || (t2 = $s(), tc.set(e2, t2)), t2;
2149
2140
  }
2150
- function rc({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2141
+ function ic({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2151
2142
  if (e2 === null) return n2();
2152
2143
  if (typeof window > `u`) {
2153
2144
  let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
2154
2145
  if (!i3) return r3();
2155
- let a3 = tc.get(i3);
2156
- a3 || (a3 = /* @__PURE__ */ new Map(), tc.set(i3, a3));
2146
+ let a3 = nc.get(i3);
2147
+ a3 || (a3 = /* @__PURE__ */ new Map(), nc.set(i3, a3));
2157
2148
  let o3 = a3.get(e2);
2158
2149
  if (o3) return o3;
2159
2150
  let s3 = r3();
2160
2151
  return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
2161
2152
  }
2162
- let i2 = nc(t2.scope), a2 = Date.now();
2153
+ let i2 = rc(t2.scope), a2 = Date.now();
2163
2154
  for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
2164
2155
  let o2 = i2.promises.get(e2);
2165
2156
  if (o2 && !r2) return o2.promise;
2166
2157
  r2 && i2.invalidatedWarmup.add(e2);
2167
2158
  let s2 = !i2.invalidatedWarmup.has(e2);
2168
2159
  if (s2) {
2169
- let t3 = Zs(e2);
2160
+ let t3 = Qs(e2);
2170
2161
  if (t3 !== void 0) {
2171
- let n3 = zs(t3);
2172
- return i2.promises.set(e2, { promise: n3, expiresAt: a2 + qs }), n3;
2162
+ let n3 = Bs(t3);
2163
+ return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Js }), n3;
2173
2164
  }
2174
2165
  }
2175
2166
  let c2 = (async () => {
@@ -2179,48 +2170,48 @@ function rc({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2179
2170
  }
2180
2171
  return n2();
2181
2172
  })();
2182
- i2.promises.size >= Js && i2.promises.delete(i2.promises.keys().next().value);
2173
+ i2.promises.size >= Ys && i2.promises.delete(i2.promises.keys().next().value);
2183
2174
  let l2 = { promise: c2, expiresAt: 1 / 0 };
2184
2175
  return i2.promises.set(e2, l2), c2.then(() => {
2185
- l2.expiresAt = Date.now() + qs;
2176
+ l2.expiresAt = Date.now() + Js;
2186
2177
  }, () => {
2187
2178
  i2.promises.get(e2) === l2 && i2.promises.delete(e2);
2188
2179
  }), c2;
2189
2180
  }
2190
- var ic = { displayTimeZonePolicy: { basedOn: Wa.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
2191
- async function ac() {
2181
+ var ac = { displayTimeZonePolicy: { basedOn: Wa.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
2182
+ async function oc() {
2192
2183
  try {
2193
2184
  let e2 = await qa();
2194
2185
  return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? Wa.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
2195
2186
  } catch (e2) {
2196
- return ko(e2, { feature: $.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), ic;
2187
+ return ko(e2, { feature: $.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), ac;
2197
2188
  }
2198
2189
  }
2199
- var oc = { isLoading: true };
2200
- var sc = n(null);
2201
- var cc = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
2202
- function lc() {
2203
- let e2 = a(sc);
2204
- if (!e2) throw Error(cc);
2190
+ var sc = { isLoading: true };
2191
+ var cc = n(null);
2192
+ var lc = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
2193
+ function uc() {
2194
+ let e2 = a(cc);
2195
+ if (!e2) throw Error(lc);
2205
2196
  return e2;
2206
2197
  }
2207
- function uc(e2) {
2198
+ function dc(e2) {
2208
2199
  return e2.basedOn === Wa.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
2209
2200
  }
2210
- function dc() {
2211
- let e2 = lc();
2212
- return e2.isLoading ? void 0 : uc(e2.displayTimeZonePolicy);
2201
+ function fc() {
2202
+ let e2 = uc();
2203
+ return e2.isLoading ? void 0 : dc(e2.displayTimeZonePolicy);
2213
2204
  }
2214
- function fc({ settingsPromise: e2, children: t2 }) {
2215
- let n2 = Rs(e2), r2 = s(() => ({ isLoading: false, ...n2 }), [n2]);
2216
- return m(sc.Provider, { value: r2, children: t2 });
2205
+ function pc({ settingsPromise: e2, children: t2 }) {
2206
+ let n2 = zs(e2), r2 = s(() => ({ isLoading: false, ...n2 }), [n2]);
2207
+ return m(cc.Provider, { value: r2, children: t2 });
2217
2208
  }
2218
- function pc({ bookingsSettings: e2, children: n2 }) {
2219
- let r2 = Us(), [i2] = l(() => e2 ? null : rc({ key: Gs(), warmupData: r2, fetchData: ac }));
2220
- return e2 ? m(sc.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : m(t, { fallback: m(sc.Provider, { value: oc, children: n2 }), children: m(fc, { settingsPromise: i2, children: n2 }) });
2209
+ function mc({ bookingsSettings: e2, children: n2 }) {
2210
+ let r2 = Ws(), [i2] = l(() => e2 ? null : ic({ key: Ks(), warmupData: r2, fetchData: oc }));
2211
+ return e2 ? m(cc.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : m(t, { fallback: m(cc.Provider, { value: sc, children: n2 }), children: m(pc, { settingsPromise: i2, children: n2 }) });
2221
2212
  }
2222
- var mc = 1e3;
2223
- var hc = class extends e {
2213
+ var hc = 1e3;
2214
+ var gc = class extends e {
2224
2215
  state = { hasError: false };
2225
2216
  static getDerivedStateFromError() {
2226
2217
  return { hasError: true };
@@ -2232,16 +2223,16 @@ var hc = class extends e {
2232
2223
  return this.state.hasError ? this.props.fallback : this.props.children;
2233
2224
  }
2234
2225
  };
2235
- var gc = `appSectionParams`;
2236
- function _c(e2) {
2237
- let t2 = e2.searchParams.get(gc);
2226
+ var _c = `appSectionParams`;
2227
+ function vc(e2) {
2228
+ let t2 = e2.searchParams.get(_c);
2238
2229
  if (t2 === null) return e2;
2239
2230
  let n2 = new URL(e2);
2240
- n2.searchParams.delete(gc);
2241
- for (let [e3, r2] of Object.entries(vc(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
2231
+ n2.searchParams.delete(_c);
2232
+ for (let [e3, r2] of Object.entries(yc(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
2242
2233
  return n2;
2243
2234
  }
2244
- function vc(e2) {
2235
+ function yc(e2) {
2245
2236
  try {
2246
2237
  let t2 = JSON.parse(e2);
2247
2238
  return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
@@ -2249,16 +2240,16 @@ function vc(e2) {
2249
2240
  return {};
2250
2241
  }
2251
2242
  }
2252
- var yc = `bookings-uou:url-change`;
2253
- var bc = (e2) => {
2243
+ var bc = `bookings-uou:url-change`;
2244
+ var xc = (e2) => {
2254
2245
  let t2 = new URL(e2);
2255
2246
  return t2.searchParams.sort(), t2.href;
2256
2247
  };
2257
- function xc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2248
+ function Sc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2258
2249
  let r2 = globalThis.window;
2259
2250
  if (!r2?.history) return;
2260
2251
  let i2 = new URL(r2.location.href);
2261
- if (bc(i2) === bc(e2)) return;
2252
+ if (xc(i2) === xc(e2)) return;
2262
2253
  let a2 = { scrollY: r2.scrollY };
2263
2254
  if (n2) r2.history.replaceState(a2, ``, e2.href);
2264
2255
  else {
@@ -2269,110 +2260,110 @@ function xc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2269
2260
  return;
2270
2261
  }
2271
2262
  }
2272
- r2.dispatchEvent(new Event(yc));
2263
+ r2.dispatchEvent(new Event(bc));
2273
2264
  }
2274
- function Sc(e2) {
2265
+ function Cc(e2) {
2275
2266
  let t2 = globalThis.window;
2276
- return t2 ? (t2.addEventListener(yc, e2), t2.addEventListener(`popstate`, e2), () => {
2277
- t2.removeEventListener(yc, e2), t2.removeEventListener(`popstate`, e2);
2267
+ return t2 ? (t2.addEventListener(bc, e2), t2.addEventListener(`popstate`, e2), () => {
2268
+ t2.removeEventListener(bc, e2), t2.removeEventListener(`popstate`, e2);
2278
2269
  }) : () => {
2279
2270
  };
2280
2271
  }
2281
- var Cc = (e2) => {
2272
+ var wc = (e2) => {
2282
2273
  try {
2283
2274
  return decodeURIComponent(e2);
2284
2275
  } catch {
2285
2276
  return e2;
2286
2277
  }
2287
2278
  };
2288
- function wc(e2, t2) {
2279
+ function Tc(e2, t2) {
2289
2280
  let n2 = t2 ? new URL(t2).pathname : `/`;
2290
- return `./${Cc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
2281
+ return `./${wc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
2291
2282
  }
2292
- function Tc() {
2293
- let e2 = p(Vr), t2 = i(() => e2.currentUrl, [e2]), n2 = u(Sc, t2, t2), r2 = s(() => _c(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
2294
- return { pathname: r2.pathname, search: r2.search, searchParams: r2.searchParams, href: r2.href, getParsedUrl: () => _c(new URL(e2.currentUrl)), getRelativeUrl: () => wc(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: xc };
2283
+ function Ec() {
2284
+ let e2 = p(Vr), t2 = i(() => e2.currentUrl, [e2]), n2 = u(Cc, t2, t2), r2 = s(() => vc(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
2285
+ return { pathname: r2.pathname, search: r2.search, searchParams: r2.searchParams, href: r2.href, getParsedUrl: () => vc(new URL(e2.currentUrl)), getRelativeUrl: () => Tc(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: Sc };
2295
2286
  }
2296
- var Ec = () => () => {
2287
+ var Dc = () => () => {
2297
2288
  };
2298
- function Dc() {
2289
+ function Oc() {
2299
2290
  let e2;
2300
2291
  return { inBrowser: () => e2 ??= false, onServer: () => e2 ??= true };
2301
2292
  }
2302
- function Oc() {
2303
- let [e2] = l(Dc);
2304
- return u(Ec, e2.inBrowser, e2.onServer);
2305
- }
2306
- var kc = Symbol(`landing pending`);
2307
- function Ac() {
2308
- return !Oc();
2293
+ function kc() {
2294
+ let [e2] = l(Oc);
2295
+ return u(Dc, e2.inBrowser, e2.onServer);
2309
2296
  }
2297
+ var Ac = Symbol(`landing pending`);
2310
2298
  function jc() {
2311
- let { searchParams: e2 } = Tc(), t2 = Ac(), [n2, i2] = l(t2);
2299
+ return !kc();
2300
+ }
2301
+ function Mc() {
2302
+ let { searchParams: e2 } = Ec(), t2 = jc(), [n2, i2] = l(t2);
2312
2303
  return o(() => {
2313
2304
  r(() => i2(true));
2314
- }, []), n2 ? ro(e2) : kc;
2305
+ }, []), n2 ? ro(e2) : Ac;
2315
2306
  }
2316
- function Mc(e2) {
2317
- let t2 = jc();
2318
- return e2 || t2 === kc ? null : t2;
2307
+ function Nc(e2) {
2308
+ let t2 = Mc();
2309
+ return e2 || t2 === Ac ? null : t2;
2319
2310
  }
2320
- var Nc = Lr(`@wix/site-service-business-logger`);
2321
- function Pc(e2) {
2311
+ var Pc = Lr(`@wix/site-service-business-logger`);
2312
+ function Fc(e2) {
2322
2313
  return { evid: 32, src: 16, endpoint: ``, params: e2 };
2323
2314
  }
2324
- function Fc(e2) {
2315
+ function Ic(e2) {
2325
2316
  return { evid: 33, src: 16, endpoint: ``, params: e2 };
2326
2317
  }
2327
- function Ic(e2) {
2318
+ function Lc(e2) {
2328
2319
  return { evid: 34, src: 16, endpoint: ``, params: e2 };
2329
2320
  }
2330
- var Lc = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
2321
+ var Rc = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
2331
2322
  qr.BOOK_ONLINE;
2332
- var Rc = `new_bookings_server`;
2333
- var zc = { LOAD: `load`, LOCATION_CHOSEN: `location chosen`, STAFF_CHOSEN: `staff chosen`, VARIANT_SELECTED: `variant selected`, ADD_ON_SELECTED: `add on selected`, ADD_ON_UNSELECTED: `add on unselected`, BACK: `back`, CLOSE: `close`, STAY: `stay`, ADD_SERVICE: `add service`, EDIT_BASKET_ITEM: `edit basket item`, EDIT_BASKET_ITEM_FROM_CALENDAR: `edit basket item from calendar`, CHANGE_STAFF_MEMBER: `change staff member`, REMOVE_BASKET_ITEM: `remove basket item`, SELECT_SERVICE: `select service`, SEARCH: `search`, CLEAR_SEARCH: `clear search` };
2334
- var Bc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog`, JOIN_WAITLIST_DIALOG: `join_waitlist_dialog` };
2335
- var Vc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
2336
- var Hc = (e2) => {
2337
- let { reportBi: t2 } = p(Nc);
2323
+ var zc = `new_bookings_server`;
2324
+ var Bc = { LOAD: `load`, LOCATION_CHOSEN: `location chosen`, STAFF_CHOSEN: `staff chosen`, VARIANT_SELECTED: `variant selected`, ADD_ON_SELECTED: `add on selected`, ADD_ON_UNSELECTED: `add on unselected`, BACK: `back`, CLOSE: `close`, STAY: `stay`, ADD_SERVICE: `add service`, EDIT_BASKET_ITEM: `edit basket item`, EDIT_BASKET_ITEM_FROM_CALENDAR: `edit basket item from calendar`, CHANGE_STAFF_MEMBER: `change staff member`, REMOVE_BASKET_ITEM: `remove basket item`, SELECT_SERVICE: `select service`, SEARCH: `search`, CLEAR_SEARCH: `clear search` };
2325
+ var Vc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog`, JOIN_WAITLIST_DIALOG: `join_waitlist_dialog` };
2326
+ var Hc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
2327
+ var Uc = (e2) => {
2328
+ let { reportBi: t2 } = p(Pc);
2338
2329
  return i((n2) => {
2339
- t2({ widget_name: e2, bookingsPlatform: Rc, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
2330
+ t2({ widget_name: e2, bookingsPlatform: zc, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
2340
2331
  }, [t2, e2]);
2341
2332
  };
2342
- var Uc = (e2, t2 = true) => {
2343
- let n2 = Hc(e2), { getParsedUrl: r2 } = Tc(), i2 = c(false);
2333
+ var Wc = (e2, t2 = true) => {
2334
+ let n2 = Uc(e2), { getParsedUrl: r2 } = Ec(), i2 = c(false);
2344
2335
  o(() => {
2345
- t2 && !i2.current && (i2.current = true, n2(Pc({ referralInfo: r2().searchParams.get(no.referral) ?? void 0 })));
2336
+ t2 && !i2.current && (i2.current = true, n2(Fc({ referralInfo: r2().searchParams.get(no.referral) ?? void 0 })));
2346
2337
  }, [t2, n2, r2]);
2347
2338
  };
2348
- function Wc(e2) {
2339
+ function Gc(e2) {
2349
2340
  return { evid: 1177, src: 16, endpoint: `wixboost-ugc`, params: e2 };
2350
2341
  }
2351
- function Gc(e2) {
2342
+ function Kc(e2) {
2352
2343
  return { evid: 596, src: 16, endpoint: `wixboost-ugc`, params: e2 };
2353
2344
  }
2354
- function Kc(e2, t2) {
2345
+ function qc(e2, t2) {
2355
2346
  let n2 = new Intl.DateTimeFormat(`en-US`, { timeZone: t2, hourCycle: `h23`, year: `numeric`, month: `2-digit`, day: `2-digit`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).formatToParts(new Date(e2)), r2 = {};
2356
2347
  for (let e3 of n2) e3.type !== `literal` && (r2[e3.type] = Number(e3.value));
2357
2348
  return Date.UTC(r2.year, r2.month - 1, r2.day, r2.hour, r2.minute, r2.second) - e2;
2358
2349
  }
2359
- function qc(e2, t2) {
2350
+ function Jc(e2, t2) {
2360
2351
  let n2 = e2.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?/);
2361
2352
  if (!n2) return null;
2362
2353
  let [, r2, i2, a2, o2, s2, c2] = n2, l2 = Date.UTC(Number(r2), Number(i2) - 1, Number(a2), Number(o2), Number(s2), c2 ? Number(c2) : 0);
2363
2354
  if (Number.isNaN(l2)) return null;
2364
2355
  try {
2365
- let e3 = l2 - Kc(l2, t2);
2366
- return new Date(l2 - Kc(e3, t2));
2356
+ let e3 = l2 - qc(l2, t2);
2357
+ return new Date(l2 - qc(e3, t2));
2367
2358
  } catch {
2368
2359
  return null;
2369
2360
  }
2370
2361
  }
2371
- function Jc({ start: e2, end: t2, timeZone: n2, ...r2 }) {
2372
- let i2 = (e3) => e3 && n2 ? qc(e3, n2)?.getTime() : void 0;
2373
- return Ic({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
2362
+ function Yc({ start: e2, end: t2, timeZone: n2, ...r2 }) {
2363
+ let i2 = (e3) => e3 && n2 ? Jc(e3, n2)?.getTime() : void 0;
2364
+ return Lc({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
2374
2365
  }
2375
- function Yc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
2366
+ function Xc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
2376
2367
  let i2 = n2 ? `loadFailed` : null, a2 = d(true), o2 = a2?.reschedule != null, s2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false, selectDate: async () => {
2377
2368
  }, setDaysAvailabilityRange: async () => {
2378
2369
  }, goToNextAvailableDate: async () => `cancelled`, canChangeTimeZone: false, isMultiService: false, isSelectionPending: a2?.isSelectionPending ?? false, availabilityRequestKey: null, needsServiceChoice: false, isRescheduling: o2, rescheduleValidUntil: null, staffFilterOptions: [], locationFilterOptions: [], selectedStaffFilter: null, requestedGender: null, genderSelectionAllowed: false, selectedLocationFilter: null, setStaffFilter: () => {
@@ -2386,115 +2377,115 @@ function Yc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children
2386
2377
  }, navigateToBookingForm: () => {
2387
2378
  }, timeSlotLimitPerDay: null, daysWithMore: /* @__PURE__ */ new Set(), loadingDate: null, loadAllTimeSlotsForDay: async () => {
2388
2379
  } };
2389
- return m(su.Provider, { value: s2, children: r2 });
2390
- }
2391
- function Xc({ nextAvailableSlotsCount: e2, children: t2 }) {
2392
- return m(Yc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
2380
+ return m(du.Provider, { value: s2, children: r2 });
2393
2381
  }
2394
2382
  function Zc({ nextAvailableSlotsCount: e2, children: t2 }) {
2395
- return m(Yc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
2383
+ return m(Xc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
2384
+ }
2385
+ function Qc({ nextAvailableSlotsCount: e2, children: t2 }) {
2386
+ return m(Xc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
2396
2387
  }
2397
- var Qc = 1e3;
2398
- function $c(e2, t2, { waitlistAvailable: n2 = false } = {}) {
2388
+ var $c = 1e3;
2389
+ function el(e2, t2, { waitlistAvailable: n2 = false } = {}) {
2399
2390
  let r2 = /* @__PURE__ */ new Map();
2400
2391
  for (let e3 of t2) {
2401
2392
  let t3 = e3.localStartDate?.slice(0, 10);
2402
2393
  t3 && (e3.bookable || n2 && No(e3) ? r2.set(t3, `available`) : r2.has(t3) || r2.set(t3, `unavailable`));
2403
2394
  }
2404
- let i2 = [], a2 = Ko(e2);
2395
+ let i2 = [], a2 = qo(e2);
2405
2396
  for (let t3 = 0; t3 < a2; t3 += 1) {
2406
- let n3 = Go(e2.startDate, t3);
2397
+ let n3 = Ko(e2.startDate, t3);
2407
2398
  i2.push({ date: n3, availability: r2.get(n3) ?? `none` });
2408
2399
  }
2409
2400
  return i2;
2410
2401
  }
2411
- function el(e2, t2) {
2412
- return { fromLocalDate: Bo(e2.startDate, t2), toLocalDate: Ro(Fo(e2.endDate)) };
2402
+ function tl(e2, t2) {
2403
+ return { fromLocalDate: Vo(e2.startDate, t2), toLocalDate: zo(Io(e2.endDate)) };
2413
2404
  }
2414
- async function tl(e2, t2, n2, r2, i2, a2) {
2415
- return (await ms({ serviceId: e2, ...el(n2, t2), timeZone: t2, ...rs(r2), ...is(i2), ...os(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Ko(n2), Qc) } })).timeSlots ?? [];
2405
+ async function nl(e2, t2, n2, r2, i2, a2) {
2406
+ return (await hs({ serviceId: e2, ...tl(n2, t2), timeZone: t2, ...is(r2), ...as(i2), ...ss(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(qo(n2), $c) } })).timeSlots ?? [];
2416
2407
  }
2417
- async function nl(e2, t2, n2, r2, i2, a2, o2 = false) {
2418
- let s2 = { serviceIds: [e2], ...el(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...hs(r2, i2, a2) } };
2419
- if (!o2) return (await gs({ ...s2, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(Ko(n2), Qc) } })).timeSlots;
2408
+ async function rl(e2, t2, n2, r2, i2, a2, o2 = false) {
2409
+ let s2 = { serviceIds: [e2], ...tl(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...gs(r2, i2, a2) } };
2410
+ if (!o2) return (await _s({ ...s2, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(qo(n2), $c) } })).timeSlots;
2420
2411
  let c2 = [], l2;
2421
2412
  do {
2422
- let e3 = await gs({ ...s2, cursorPaging: { limit: Qc, ...l2 ? { cursor: l2 } : {} } });
2413
+ let e3 = await _s({ ...s2, cursorPaging: { limit: $c, ...l2 ? { cursor: l2 } : {} } });
2423
2414
  c2.push(...e3.timeSlots), l2 = e3.nextCursor ?? void 0;
2424
2415
  } while (l2);
2425
2416
  return c2;
2426
2417
  }
2427
- async function rl({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, keepWaitlistSlots: l2 = false }) {
2428
- if ($a(t2) || n2.endDate < r2) return $c(n2, []);
2429
- let u2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, d2 = Qa(t2) ? Xo(u2) : [u2];
2430
- return $c(n2, (await Promise.all(d2.map((n3) => Qa(t2) ? nl(e2, i2, n3, a2, o2, c2, l2) : tl(e2, i2, n3, a2, o2, s2)))).flat(), { waitlistAvailable: l2 && Qa(t2) });
2418
+ async function il({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, keepWaitlistSlots: l2 = false }) {
2419
+ if ($a(t2) || n2.endDate < r2) return el(n2, []);
2420
+ let u2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, d2 = Qa(t2) ? Zo(u2) : [u2];
2421
+ return el(n2, (await Promise.all(d2.map((n3) => Qa(t2) ? rl(e2, i2, n3, a2, o2, c2, l2) : nl(e2, i2, n3, a2, o2, s2)))).flat(), { waitlistAvailable: l2 && Qa(t2) });
2431
2422
  }
2432
- function il({ serviceId: e2, staff: t2, customerChoices: n2 }) {
2423
+ function al({ serviceId: e2, staff: t2, customerChoices: n2 }) {
2433
2424
  let r2 = t2 && !t2.anyResource ? t2.staffMemberId : void 0;
2434
- return { serviceId: e2, ...os(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Kr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Kr, resourceIds: [r2] }] } : {} };
2425
+ return { serviceId: e2, ...ss(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Kr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Kr, resourceIds: [r2] }] } : {} };
2435
2426
  }
2436
- function al({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
2437
- return { services: e2.map(il), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
2427
+ function ol({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
2428
+ return { services: e2.map(al), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
2438
2429
  }
2439
- function ol(e2) {
2440
- let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? as(t2) : void 0;
2430
+ function sl(e2) {
2431
+ let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? os(t2) : void 0;
2441
2432
  return r2 ? { ...n2, customerChoices: r2 } : n2;
2442
2433
  }
2443
- async function sl(e2) {
2444
- let t2 = e2.services ?? [], n2 = () => Da({ ...e2, services: t2.map(ol) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
2445
- if (r2 && ds()) return n2();
2434
+ async function cl(e2) {
2435
+ let t2 = e2.services ?? [], n2 = () => Da({ ...e2, services: t2.map(sl) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
2436
+ if (r2 && fs()) return n2();
2446
2437
  try {
2447
2438
  return await Da(e2);
2448
2439
  } catch (e3) {
2449
- if (!r2 || !cs(e3)) throw e3;
2450
- return ko(e3, { feature: $.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ps(), n2();
2440
+ if (!r2 || !ls(e3)) throw e3;
2441
+ return ko(e3, { feature: $.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ms(), n2();
2451
2442
  }
2452
2443
  }
2453
- var cl = 1e3;
2454
- async function ll({ range: e2, fromDate: t2, ...n2 }) {
2455
- if (e2.endDate < t2) return $c(e2, []);
2444
+ var ll = 1e3;
2445
+ async function ul({ range: e2, fromDate: t2, ...n2 }) {
2446
+ if (e2.endDate < t2) return el(e2, []);
2456
2447
  let r2 = { startDate: e2.startDate < t2 ? t2 : e2.startDate, endDate: e2.endDate };
2457
- return $c(e2, (await sl({ ...al(n2), fromLocalDate: Bo(r2.startDate, n2.timeZone), toLocalDate: Ro(Fo(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Ko(r2), cl) } })).timeSlots ?? []);
2448
+ return el(e2, (await cl({ ...ol(n2), fromLocalDate: Vo(r2.startDate, n2.timeZone), toLocalDate: zo(Io(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(qo(r2), ll) } })).timeSlots ?? []);
2458
2449
  }
2459
- async function ul({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
2450
+ async function dl({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
2460
2451
  let i2 = `${e2}T00:00:00`, a2 = [], o2 = null, s2;
2461
2452
  do {
2462
- let c2 = await sl({ ...al(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: cl, ...s2 ? { cursor: s2 } : {} } });
2453
+ let c2 = await cl({ ...ol(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: ll, ...s2 ? { cursor: s2 } : {} } });
2463
2454
  a2.push(...c2.timeSlots ?? []), o2 = c2.timeZone ?? o2, s2 = c2.cursorPagingMetadata?.cursors?.next || void 0;
2464
2455
  } while (s2);
2465
2456
  return { timeSlots: a2, timeZone: o2 };
2466
2457
  }
2467
- async function dl({ fromDate: e2, ...t2 }) {
2468
- let n2 = await sl({ ...al(t2), ...xs(e2), bookable: true, cursorPaging: { limit: 1 } });
2458
+ async function fl({ fromDate: e2, ...t2 }) {
2459
+ let n2 = await cl({ ...ol(t2), ...Ss(e2), bookable: true, cursorPaging: { limit: 1 } });
2469
2460
  return { timeSlots: n2.timeSlots ?? [], timeZone: n2.timeZone ?? null };
2470
2461
  }
2471
- var fl = Lr(`@wix/site-service-experiments`);
2472
- function pl(e2) {
2462
+ var pl = Lr(`@wix/site-service-experiments`);
2463
+ function ml(e2) {
2473
2464
  try {
2474
2465
  return p(e2);
2475
2466
  } catch {
2476
2467
  return null;
2477
2468
  }
2478
2469
  }
2479
- function ml(e2, t2) {
2470
+ function hl(e2, t2) {
2480
2471
  try {
2481
2472
  return e2?.isOpen(t2) ?? false;
2482
2473
  } catch {
2483
2474
  return false;
2484
2475
  }
2485
2476
  }
2486
- function hl(e2) {
2487
- return ml(pl(fl), e2);
2477
+ function gl(e2) {
2478
+ return hl(ml(pl), e2);
2488
2479
  }
2489
- var gl = [];
2490
- function _l({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: u2, locationId: f2, staffId: p2, loadInitially: m2, customerChoices: h2, minRemainingCapacity: g2, onlyAvailableSlots: _2 }) {
2491
- let { service: v2 } = d(), y2 = hl(`bookingsUouWaitlistInAvailableSlots`) && _2 && v2?.bookingPolicy?.waitlistPolicy?.enabled === true, [b2, x2] = l(null), [S2, C2] = l(m2), [w2, T2] = l(gl), [E2, D2] = l(false), [ee2, O2] = l(false), k2 = c(0);
2480
+ var _l = [];
2481
+ function vl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: u2, locationId: f2, staffId: p2, loadInitially: m2, customerChoices: h2, minRemainingCapacity: g2, onlyAvailableSlots: _2 }) {
2482
+ let { service: v2 } = d(), y2 = gl(`bookingsUouWaitlistInAvailableSlots`) && _2 && v2?.bookingPolicy?.waitlistPolicy?.enabled === true, [b2, x2] = l(null), [S2, C2] = l(m2), [w2, T2] = l(_l), [E2, D2] = l(false), [ee2, O2] = l(false), k2 = c(0);
2492
2483
  o(() => {
2493
- b2 === null && u2 && x2(qo(u2));
2484
+ b2 === null && u2 && x2(Jo(u2));
2494
2485
  }, [b2, u2]), o(() => {
2495
2486
  if (!S2 || !e2 || !(t2 || r2) || !a2 || !u2 || !b2 || !r2 && $a(n2)) return;
2496
2487
  let i2 = ++k2.current;
2497
- return D2(true), (r2 ? ll({ ...r2, range: b2, fromDate: u2, timeZone: a2 }) : rl({ serviceId: t2, serviceType: n2, range: b2, fromDate: u2, timeZone: a2, locationId: f2 ?? void 0, staffId: p2 ?? void 0, customerChoices: h2, minRemainingCapacity: g2, keepWaitlistSlots: y2 })).then((e3) => {
2488
+ return D2(true), (r2 ? ul({ ...r2, range: b2, fromDate: u2, timeZone: a2 }) : il({ serviceId: t2, serviceType: n2, range: b2, fromDate: u2, timeZone: a2, locationId: f2 ?? void 0, staffId: p2 ?? void 0, customerChoices: h2, minRemainingCapacity: g2, keepWaitlistSlots: y2 })).then((e3) => {
2498
2489
  i2 === k2.current && (T2(e3), O2(false), D2(false));
2499
2490
  }).catch((e3) => {
2500
2491
  i2 === k2.current && (ko(e3, { feature: $.timeSlots, action: `fetch-days-availability`, level: `warning` }), O2(true), D2(false));
@@ -2503,12 +2494,12 @@ function _l({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
2503
2494
  };
2504
2495
  }, [S2, e2, t2, n2, r2, a2, u2, b2, f2, p2, h2, g2, y2]);
2505
2496
  let A2 = i(async (e3) => {
2506
- Wo(e3) && (x2(e3), C2(true));
2497
+ Go(e3) && (x2(e3), C2(true));
2507
2498
  }, []);
2508
2499
  return { range: b2, daysAvailability: s(() => _2 ? w2.map((e3) => e3.availability === `unavailable` ? { ...e3, availability: `none` } : e3) : w2, [w2, _2]), isLoading: E2, hasError: ee2, setRange: A2 };
2509
2500
  }
2510
- function vl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: s2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
2511
- let g2 = hl(`bookingsUouWaitlistInAvailableSlots`), [_2, v2] = l(null), [y2, b2] = l(0), [x2, S2] = l(null), [C2, w2] = l(null), [T2, E2] = l(null), [D2, ee2] = l(false), O2 = c(0), k2 = c(0), A2 = c(0), j2 = i(() => {
2501
+ function yl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: s2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
2502
+ let g2 = gl(`bookingsUouWaitlistInAvailableSlots`), [_2, v2] = l(null), [y2, b2] = l(0), [x2, S2] = l(null), [C2, w2] = l(null), [T2, E2] = l(null), [D2, ee2] = l(false), O2 = c(0), k2 = c(0), A2 = c(0), j2 = i(() => {
2512
2503
  k2.current += 1, ee2(false);
2513
2504
  }, []);
2514
2505
  o(() => {
@@ -2524,18 +2515,14 @@ function vl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
2524
2515
  return;
2525
2516
  }
2526
2517
  if (!e2 || !(t2 || r2) || !a2) return;
2527
- if (s2 && _2.date < s2) {
2528
- v2(null);
2529
- return;
2530
- }
2531
- if (!r2 && $a(n2)) {
2518
+ if (s2 && _2.date < s2 || !r2 && $a(n2)) {
2532
2519
  v2(null);
2533
2520
  return;
2534
2521
  }
2535
- let i2 = zo(new Date(Date.now()), a2), o2 = ++O2.current;
2522
+ let i2 = Bo(new Date(Date.now()), a2), o2 = ++O2.current;
2536
2523
  S2(null), w2(null), E2(null);
2537
2524
  let c2 = i2.slice(0, 10) === _2.date ? i2 : void 0;
2538
- return (r2 ? ul({ ...r2, date: _2.date, timeZone: a2, onlyAvailableSlots: m2, fromLocalDate: c2 }) : ws({ serviceId: t2, serviceType: n2, date: _2.date, timeZone: a2, onlyAvailableSlots: m2, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2, keepWaitlistSlots: g2, fromLocalDate: c2 })).then((e3) => {
2525
+ return (r2 ? dl({ ...r2, date: _2.date, timeZone: a2, onlyAvailableSlots: m2, fromLocalDate: c2 }) : Ts({ serviceId: t2, serviceType: n2, date: _2.date, timeZone: a2, onlyAvailableSlots: m2, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2, keepWaitlistSlots: g2, fromLocalDate: c2 })).then((e3) => {
2539
2526
  o2 === O2.current && S2({ timeSlots: e3.timeSlots, timeZone: e3.timeZone ?? a2 });
2540
2527
  }).catch((e3) => {
2541
2528
  o2 === O2.current && (ko(e3, { feature: $.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), w2(`timeSlotsLoadFailed`));
@@ -2544,14 +2531,14 @@ function vl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
2544
2531
  };
2545
2532
  }, [_2, y2, e2, t2, h2, n2, r2, a2, s2, u2, d2, f2, p2, m2, g2, M2]);
2546
2533
  let te2 = i(async (e3) => {
2547
- !r2 && $a(n2) || !Uo(e3) || s2 && e3 < s2 || (j2(), b2((e4) => e4 + 1), v2({ kind: `day`, date: e3 }));
2534
+ !r2 && $a(n2) || !Wo(e3) || s2 && e3 < s2 || (j2(), b2((e4) => e4 + 1), v2({ kind: `day`, date: e3 }));
2548
2535
  }, [n2, r2, s2, j2]), N2 = _2?.date ?? null, ne2 = i(async () => {
2549
2536
  let i2 = !!(t2 || r2);
2550
2537
  if (!r2 && $a(n2) || !e2 || !i2 || !a2) return { outcome: `none` };
2551
2538
  let o2 = O2.current, c2 = ++k2.current, l2 = ++A2.current, m3 = () => o2 === O2.current && c2 === k2.current;
2552
2539
  ee2(true), E2(null);
2553
2540
  try {
2554
- let e3 = N2 ?? s2 ?? void 0, i3 = r2 ? await dl({ ...r2, timeZone: a2, fromDate: e3 }) : await Ss({ serviceId: t2, serviceType: n2, timeZone: a2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
2541
+ let e3 = N2 ?? s2 ?? void 0, i3 = r2 ? await fl({ ...r2, timeZone: a2, fromDate: e3 }) : await Cs({ serviceId: t2, serviceType: n2, timeZone: a2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
2555
2542
  if (!m3()) return { outcome: `cancelled` };
2556
2543
  let o3 = i3.timeSlots[0]?.localStartDate?.slice(0, 10) ?? null;
2557
2544
  return o3 ? { outcome: `found`, date: o3 } : { outcome: `none` };
@@ -2563,38 +2550,38 @@ function vl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
2563
2550
  }, [e2, t2, n2, r2, a2, s2, u2, d2, f2, p2, N2]), P2 = T2 ?? C2;
2564
2551
  return { query: _2, selectedDate: N2, timeSlots: x2?.timeSlots ?? null, timeZone: x2?.timeZone ?? null, isLoading: D2 || _2 !== null && x2 === null && C2 === null, error: P2, selectDate: te2, findNextAvailableDate: ne2 };
2565
2552
  }
2566
- var yl = (e2) => e2?.type === `DATE_TIME`;
2567
- function bl(e2) {
2553
+ var bl = (e2) => e2?.type === `DATE_TIME`;
2554
+ function xl(e2) {
2568
2555
  let t2 = e2.schedule?.availabilityConstraints?.durations;
2569
2556
  if (!Za(e2.type) || !Array.isArray(t2)) return false;
2570
2557
  let n2 = t2.map((e3) => typeof e3 == `number` ? e3 : e3?.minutes);
2571
2558
  return new Set(n2).size > 1;
2572
2559
  }
2573
- function xl({ service: e2, multiServiceAppointmentsEnabled: t2, variants: n2, locationId: r2 }) {
2560
+ function Sl({ service: e2, multiServiceAppointmentsEnabled: t2, variants: n2, locationId: r2 }) {
2574
2561
  if (!Za(e2.type)) return false;
2575
- if (t2 || bl(e2) || to(e2)) return true;
2576
- if (!eo(e2) || yl(n2)) return false;
2577
- let i2 = Fs(e2, r2);
2578
- return r2 && i2 !== r2 ? true : !Ms(n2, Ps(e2), i2);
2562
+ if (t2 || xl(e2) || to(e2)) return true;
2563
+ if (!eo(e2) || bl(n2)) return false;
2564
+ let i2 = Is(e2, r2);
2565
+ return r2 && i2 !== r2 ? true : !Ns(n2, Fs(e2), i2);
2579
2566
  }
2580
- function Sl(e2, t2) {
2567
+ function Cl(e2, t2) {
2581
2568
  return !!Ir(e2)?.services.some((e3) => e3.serviceId === t2);
2582
2569
  }
2583
- function Cl({ blobParam: e2, ...t2 }) {
2584
- return !t2.service._id || Sl(e2, t2.service._id) ? false : xl({ ...t2, multiServiceAppointmentsEnabled: false });
2570
+ function wl({ blobParam: e2, ...t2 }) {
2571
+ return !t2.service._id || Cl(e2, t2.service._id) ? false : Sl({ ...t2, multiServiceAppointmentsEnabled: false });
2585
2572
  }
2586
- function wl(e2) {
2573
+ function Tl(e2) {
2587
2574
  return !!e2?._id;
2588
2575
  }
2589
- function Tl() {
2576
+ function El() {
2590
2577
  try {
2591
2578
  return f();
2592
2579
  } catch {
2593
2580
  return null;
2594
2581
  }
2595
2582
  }
2596
- function El() {
2597
- let e2 = Tl();
2583
+ function Dl() {
2584
+ let e2 = El();
2598
2585
  return i((t2) => {
2599
2586
  if (!e2) return false;
2600
2587
  try {
@@ -2605,71 +2592,95 @@ function El() {
2605
2592
  }
2606
2593
  }, [e2]);
2607
2594
  }
2608
- function Dl(e2) {
2609
- let { service: t2, isLoading: n2, hasError: r2, bookingsSettingsLoading: i2, isLoadingServiceOptionsAndVariants: a2, pricingOption: s2, multiServiceAppointmentsEnabled: l2, isMultiServiceAppointment: u2, reschedule: f2, selection: p2, isSelectionPending: m2, openPreferences: h2, editingSurface: g2 } = d(), _2 = El(), v2 = Hc(Lc.PREFERENCES), y2 = c(false), b2 = e2 && !m2 && !g2 && !n2 && !r2 && !i2 && !a2 && f2 == null && !u2 && wl(t2), x2 = p2.locationId ?? void 0, S2 = Mc(m2);
2595
+ function Ol(e2) {
2596
+ let { service: t2, isLoading: n2, hasError: r2, bookingsSettingsLoading: i2, isLoadingServiceOptionsAndVariants: a2, pricingOption: s2, multiServiceAppointmentsEnabled: l2, isMultiServiceAppointment: u2, reschedule: f2, selection: p2, isSelectionPending: m2, openPreferences: h2, editingSurface: g2 } = d(), _2 = Dl(), v2 = Uc(Rc.PREFERENCES), y2 = c(false), b2 = e2 && !m2 && !g2 && !n2 && !r2 && !i2 && !a2 && f2 == null && !u2 && Tl(t2), x2 = p2.locationId ?? void 0, S2 = Nc(m2);
2610
2597
  o(() => {
2611
- !y2.current && b2 && (y2.current = true, _2(qr.CALENDAR_PAGE) && Cl({ service: t2, multiServiceAppointmentsEnabled: l2, variants: s2, locationId: x2, blobParam: S2 }) && (jo({ message: `Calendar opens the preferences modal`, category: `navigation`, feature: $.timeSlots, data: { serviceId: t2._id ?? null, serviceType: t2.type ?? null } }), v2(Wc({ action: zc.EDIT_BASKET_ITEM_FROM_CALENDAR, numberOfServices: 1, isMultiFlow: l2 })), h2().then(() => Ao(`Preferences modal opened`, { feature: $.timeSlots, action: `auto-open-preferences`, tags: { serviceType: t2.type ?? `unknown` } }), (e3) => ko(e3, { feature: $.timeSlots, action: `open-preferences-lightbox` }))));
2598
+ !y2.current && b2 && (y2.current = true, _2(qr.CALENDAR_PAGE) && wl({ service: t2, multiServiceAppointmentsEnabled: l2, variants: s2, locationId: x2, blobParam: S2 }) && (jo({ message: `Calendar opens the preferences modal`, category: `navigation`, feature: $.timeSlots, data: { serviceId: t2._id ?? null, serviceType: t2.type ?? null } }), v2(Gc({ action: Bc.EDIT_BASKET_ITEM_FROM_CALENDAR, numberOfServices: 1, isMultiFlow: l2 })), h2().then(() => Ao(`Preferences modal opened`, { feature: $.timeSlots, action: `auto-open-preferences`, tags: { serviceType: t2.type ?? `unknown` } }), (e3) => ko(e3, { feature: $.timeSlots, action: `open-preferences-lightbox` }))));
2612
2599
  }, [b2, t2, l2, s2, x2, S2, _2, v2, h2]);
2613
2600
  }
2614
- function Ol(e2, t2) {
2601
+ function kl({ ready: e2, answer: t2, run: n2, rerunsOn: r2 }) {
2602
+ let [a2, s2] = l(false), [u2, d2] = l(0), f2 = c([]), p2 = c(false), m2 = c(0), h2 = c({ ready: e2, answer: t2, run: n2, rerunsOn: r2 });
2603
+ h2.current = { ready: e2, answer: t2, run: n2, rerunsOn: r2 };
2604
+ let g2 = i(() => {
2605
+ s2(false);
2606
+ let e3 = f2.current;
2607
+ return f2.current = [], e3;
2608
+ }, []), _2 = i((e3) => {
2609
+ let t3 = m2.current;
2610
+ p2.current = true, h2.current.run().then((n3) => {
2611
+ p2.current = false, h2.current.rerunsOn?.(n3) && t3 === m2.current ? (f2.current.unshift(...e3), s2(true)) : e3.forEach((e4) => e4(n3)), d2((e4) => e4 + 1);
2612
+ });
2613
+ }, []), v2 = i(() => {
2614
+ let { ready: e3, answer: t3 } = h2.current;
2615
+ return t3 === void 0 ? new Promise((t4) => {
2616
+ e3 && !p2.current ? _2([...g2(), t4]) : (f2.current.push(t4), s2(true));
2617
+ }) : Promise.resolve(t3);
2618
+ }, [_2, g2]), y2 = i((e3) => {
2619
+ m2.current += 1, g2().forEach((t3) => t3(e3));
2620
+ }, [g2]);
2621
+ return o(() => {
2622
+ a2 && !p2.current && (t2 === void 0 ? e2 && _2(g2()) : g2().forEach((e3) => e3(t2)));
2623
+ }, [a2, u2, e2, t2, _2, g2]), { request: v2, cancel: y2, held: a2 };
2624
+ }
2625
+ function Al(e2, t2) {
2615
2626
  return t2 === void 0 ? false : !e2 || new Date(e2).getTime() <= t2;
2616
2627
  }
2617
- var kl = 864e5;
2618
- function Al({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
2619
- let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: zo(new Date(i2), r2) };
2620
- return Qa(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : $a(t2) ? !n2 || Ol(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: zo(new Date(new Date(n2).getTime() + kl), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: xs().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
2628
+ var jl = 864e5;
2629
+ function Ml({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
2630
+ let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: Bo(new Date(i2), r2) };
2631
+ return Qa(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : $a(t2) ? !n2 || Al(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: Bo(new Date(new Date(n2).getTime() + jl), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: Ss().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
2621
2632
  }
2622
- function jl({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
2633
+ function Nl({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
2623
2634
  return e2 && t2 > 1 && !n2 && !i2 && (a2 !== `CUSTOMER_MUST_CHOOSE` || r2);
2624
2635
  }
2625
- function Ml(e2, t2) {
2636
+ function Pl(e2, t2) {
2626
2637
  return e2.length ? e2.length === 1 ? { anyResource: false, staffMemberId: e2[0] } : t2 ? { anyResource: true } : null : null;
2627
2638
  }
2628
- function Nl(e2, t2, n2) {
2639
+ function Fl(e2, t2, n2) {
2629
2640
  return t2 && !t2.anyResource && e2.includes(t2.staffMemberId) ? { isComplete: true, resourceId: t2.staffMemberId } : t2?.anyResource && n2 ? { isComplete: true, resourceId: void 0 } : e2.length <= 1 ? { isComplete: true, resourceId: e2[0] } : { isComplete: n2, resourceId: void 0 };
2630
2641
  }
2631
- var Pl = { staff: null, requestedGender: null, locationId: null };
2632
- function Fl({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
2633
- if (!e2) return Pl;
2642
+ var Il = { staff: null, requestedGender: null, locationId: null };
2643
+ function Ll({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
2644
+ if (!e2) return Il;
2634
2645
  let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? lo(e2) : null;
2635
- if (!l2) return { ...Pl, locationId: c2 };
2636
- if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...Pl, locationId: c2 };
2646
+ if (!l2) return { ...Il, locationId: c2 };
2647
+ if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...Il, locationId: c2 };
2637
2648
  let u2 = a2 ? e2.requestedGender ?? null : null;
2638
- return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...Pl, locationId: c2 };
2649
+ return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...Il, locationId: c2 };
2639
2650
  }
2640
- var Il = [];
2641
- function Ll({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
2642
- let s2 = Kl(ql(e2, r2)), c2 = n2 ? ql(i2 ? ns(n2) : n2, r2) : Il;
2643
- return { rows: t2 ? c2 : Jl(s2, a2, o2), slotIdOf: t2 ? $o : ts, daysWithMore: Gl(s2, a2, o2) };
2651
+ var Rl = [];
2652
+ function zl({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
2653
+ let s2 = Jl(Yl(e2, r2)), c2 = n2 ? Yl(i2 ? rs(n2) : n2, r2) : Rl;
2654
+ return { rows: t2 ? c2 : Xl(s2, a2, o2), slotIdOf: t2 ? es : ns, daysWithMore: ql(s2, a2, o2) };
2644
2655
  }
2645
- function Rl({ rows: e2, slotIdOf: t2 }, n2) {
2646
- return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => Wl(t3) - Wl(e3))[0] ?? null;
2656
+ function Bl({ rows: e2, slotIdOf: t2 }, n2) {
2657
+ return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => Kl(t3) - Kl(e3))[0] ?? null;
2647
2658
  }
2648
- function zl(e2, t2, n2, r2) {
2649
- return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes: Ul(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Bl(e2) };
2659
+ function Vl(e2, t2, n2, r2) {
2660
+ return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes: Gl(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Hl(e2) };
2650
2661
  }
2651
- function Bl(e2) {
2662
+ function Hl(e2) {
2652
2663
  let t2 = /* @__PURE__ */ new Map();
2653
2664
  for (let n2 of e2.availableResources ?? []) if (n2.resourceTypeId === `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`) for (let e3 of n2.resources ?? []) e3._id && !t2.has(e3._id) && t2.set(e3._id, e3.name ?? ``);
2654
2665
  return [...t2].map(([e3, t3]) => ({ staffMemberId: e3, name: t3 }));
2655
2666
  }
2656
- function Vl(e2) {
2657
- let t2 = Bl(e2);
2667
+ function Ul(e2) {
2668
+ let t2 = Hl(e2);
2658
2669
  if (t2.length) return t2.length === 1 ? t2[0].staffMemberId : null;
2659
2670
  }
2660
- function Hl(e2) {
2661
- return Bl(e2).map((e3) => e3.staffMemberId);
2671
+ function Wl(e2) {
2672
+ return Hl(e2).map((e3) => e3.staffMemberId);
2662
2673
  }
2663
- function Ul(e2, t2) {
2674
+ function Gl(e2, t2) {
2664
2675
  if (!e2.localStartDate || !e2.localEndDate) return null;
2665
- let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = qc(e2.localStartDate, n2), i2 = qc(e2.localEndDate, n2);
2676
+ let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = Jc(e2.localStartDate, n2), i2 = Jc(e2.localEndDate, n2);
2666
2677
  return !r2 || !i2 || i2 < r2 ? null : Math.round((i2.getTime() - r2.getTime()) / 6e4);
2667
2678
  }
2668
- function Wl(e2) {
2679
+ function Kl(e2) {
2669
2680
  let t2 = e2.bookableCapacity ?? e2.remainingCapacity;
2670
2681
  return (e2.eventInfo?.waitingList?.remainingCapacity ?? 0) > 0 && (t2 ?? 0) <= 0 ? 1 : e2.bookable ? 2 : 0;
2671
2682
  }
2672
- function Gl(e2, t2, n2) {
2683
+ function ql(e2, t2, n2) {
2673
2684
  let r2 = /* @__PURE__ */ new Map();
2674
2685
  for (let t3 of e2) {
2675
2686
  let e3 = (t3.localStartDate ?? ``).slice(0, 10);
@@ -2677,16 +2688,16 @@ function Gl(e2, t2, n2) {
2677
2688
  }
2678
2689
  return new Set([...r2].filter(([e3, r3]) => r3 > t2 && !n2.has(e3)).map(([e3]) => e3));
2679
2690
  }
2680
- function Kl(e2) {
2691
+ function Jl(e2) {
2681
2692
  return e2.flatMap((e3) => {
2682
2693
  let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === Kr), n2 = t2?.resources ?? [];
2683
2694
  return n2.length <= 1 ? [e3] : n2.map((n3) => ({ ...e3, availableResources: [{ ...t2, resources: [n3] }] }));
2684
2695
  });
2685
2696
  }
2686
- function ql(e2, t2) {
2697
+ function Yl(e2, t2) {
2687
2698
  return t2 ? e2.map((e3) => ({ ...e3, availableResources: e3.availableResources?.map((e4) => e4.resourceTypeId === `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155` ? { ...e4, resources: e4.resources?.filter((e5) => e5._id === t2) } : e4) })) : e2;
2688
2699
  }
2689
- function Jl(e2, t2, n2) {
2700
+ function Xl(e2, t2, n2) {
2690
2701
  let r2 = /* @__PURE__ */ new Map();
2691
2702
  return e2.filter((e3) => {
2692
2703
  let i2 = (e3.localStartDate ?? ``).slice(0, 10);
@@ -2695,21 +2706,21 @@ function Jl(e2, t2, n2) {
2695
2706
  return r2.set(i2, a2 + 1), a2 < t2;
2696
2707
  });
2697
2708
  }
2698
- async function Yl() {
2709
+ async function Zl() {
2699
2710
  try {
2700
- return await Qo();
2711
+ return await $o();
2701
2712
  } catch (e2) {
2702
2713
  return ko(e2, { feature: $.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
2703
2714
  }
2704
2715
  }
2705
- function Xl(e2) {
2706
- return rc({ key: Ks(), warmupData: e2, fetchData: Yl });
2716
+ function Ql(e2) {
2717
+ return ic({ key: qs(), warmupData: e2, fetchData: Zl });
2707
2718
  }
2708
- function Zl(e2) {
2719
+ function $l(e2) {
2709
2720
  return (e2.localStartDate ?? ``).slice(0, 10);
2710
2721
  }
2711
- var Ql = [];
2712
- function $l(e2, t2) {
2722
+ var eu = [];
2723
+ function tu(e2, t2) {
2713
2724
  let { serviceId: n2 = ``, serviceType: r2 = `CLASS`, fromLocalDate: i2 = ``, toLocalDate: a2, timeZone: s2, locationId: u2, staffId: d2, onlyAvailableSlots: f2 = false, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2 } = t2 ?? {}, [g2, _2] = l([]), [v2, y2] = l([]), [b2, x2] = l(1), [S2, C2] = l(!!n2), [w2, T2] = l(null), [E2, D2] = l(null), [ee2, O2] = l(/* @__PURE__ */ new Set()), [k2, A2] = l(null), j2 = c(null), M2 = c(null);
2714
2725
  o(() => {
2715
2726
  if (_2([]), y2([]), x2(1), D2(null), T2(null), O2(/* @__PURE__ */ new Set()), A2(null), C2(!!n2), !n2) return;
@@ -2727,7 +2738,7 @@ function $l(e2, t2) {
2727
2738
  let o3 = [], b3 = null, S3 = v4 ?? void 0, C3 = /* @__PURE__ */ new Set();
2728
2739
  do {
2729
2740
  S3 && C3.add(S3);
2730
- let c3 = await _s({ serviceId: n2, serviceType: r2, fromLocalDate: i2, toLocalDate: a2, timeZone: s2, locationId: u2, staffId: d2, onlyAvailableSlots: f2, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2, limit: e2, cursor: S3 });
2741
+ let c3 = await vs({ serviceId: n2, serviceType: r2, fromLocalDate: i2, toLocalDate: a2, timeZone: s2, locationId: u2, staffId: d2, onlyAvailableSlots: f2, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2, limit: e2, cursor: S3 });
2731
2742
  if (t3) return;
2732
2743
  if (o3.push(...c3.timeSlots), b3 = c3.nextCursor, b3 && C3.has(b3)) throw Error(`The session API repeated a page cursor`);
2733
2744
  S3 = b3 ?? void 0, D2(c3.timeZone ?? s2 ?? null);
@@ -2743,24 +2754,23 @@ function $l(e2, t2) {
2743
2754
  }
2744
2755
  async function v3(e3) {
2745
2756
  if (!(t3 || o2)) {
2746
- if (h2 == null) {
2747
- O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2748
- return;
2749
- }
2750
- o2 = true, A2(e3), T2(null);
2751
- try {
2752
- let o3 = await ws({ serviceId: n2, serviceType: r2, date: e3, timeZone: s2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: a2 });
2753
- if (t3) return;
2754
- let l3 = o3.timeSlots.filter((t4) => Zl(t4) === e3), h3 = Math.max(0, c2.findIndex((t4) => t4.some((t5) => Zl(t5) === e3)));
2755
- c2 = c2.map((t4, n3) => {
2756
- let r3 = t4.filter((t5) => Zl(t5) !== e3);
2757
- return n3 === h3 ? [...r3, ...l3] : r3;
2758
- }), _2(c2), O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2759
- } catch (e4) {
2760
- if (t3) return;
2761
- ko(e4, { feature: $.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
2762
- } finally {
2763
- o2 = false, t3 || A2(null);
2757
+ if (h2 == null) O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2758
+ else {
2759
+ o2 = true, A2(e3), T2(null);
2760
+ try {
2761
+ let o3 = await Ts({ serviceId: n2, serviceType: r2, date: e3, timeZone: s2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: a2 });
2762
+ if (t3) return;
2763
+ let l3 = o3.timeSlots.filter((t4) => $l(t4) === e3), h3 = Math.max(0, c2.findIndex((t4) => t4.some((t5) => $l(t5) === e3)));
2764
+ c2 = c2.map((t4, n3) => {
2765
+ let r3 = t4.filter((t5) => $l(t5) !== e3);
2766
+ return n3 === h3 ? [...r3, ...l3] : r3;
2767
+ }), _2(c2), O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2768
+ } catch (e4) {
2769
+ if (t3) return;
2770
+ ko(e4, { feature: $.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
2771
+ } finally {
2772
+ o2 = false, t3 || A2(null);
2773
+ }
2764
2774
  }
2765
2775
  }
2766
2776
  }
@@ -2768,7 +2778,7 @@ function $l(e2, t2) {
2768
2778
  t3 = true, j2.current = null, M2.current = null;
2769
2779
  };
2770
2780
  }, [n2, r2, i2, a2, s2, u2, d2, f2, p2, m2, h2, e2]);
2771
- let te2 = [...g2[b2 - 1] ?? Ql].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), N2 = g2[b2], ne2 = N2 ? N2.length > 0 : v2[b2 - 1] != null, P2 = b2 > 1;
2781
+ let te2 = [...g2[b2 - 1] ?? eu].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), N2 = g2[b2], ne2 = N2 ? N2.length > 0 : v2[b2 - 1] != null, P2 = b2 > 1;
2772
2782
  async function re2() {
2773
2783
  ne2 && !S2 && await j2.current?.(b2 + 1);
2774
2784
  }
@@ -2780,174 +2790,137 @@ function $l(e2, t2) {
2780
2790
  }
2781
2791
  return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone: E2, sessions: te2, pageSize: e2, currentPage: b2, hasNextPage: ne2, hasPreviousPage: P2, nextPage: re2, previousPage: ie2, expandedDates: ee2, loadingDate: k2, loadAllSessionsForDay: ae2 };
2782
2792
  }
2783
- var eu = (e2) => e2?.onlineBooking?.enabled === true;
2784
- function tu(e2, t2) {
2793
+ var nu = (e2) => e2?.onlineBooking?.enabled === true;
2794
+ function ru(e2, t2) {
2785
2795
  return e2 ? e2.anyResource ? t2 ?? `` : e2.staffMemberId : null;
2786
2796
  }
2787
- var nu = [];
2788
- var ru = [];
2789
- var iu = un.map((e2) => ({ id: e2, gender: e2 }));
2790
- var au = () => {
2797
+ var iu = [];
2798
+ var au = [];
2799
+ var ou = un.map((e2) => ({ id: e2, gender: e2 }));
2800
+ var su = () => {
2791
2801
  };
2792
- var ou = async () => {
2802
+ var cu = async () => {
2793
2803
  };
2794
- var su = n(null);
2795
- function cu() {
2796
- let e2 = a(su);
2804
+ var lu = () => Promise.resolve();
2805
+ var uu = (e2) => e2 === `cancelled`;
2806
+ var du = n(null);
2807
+ function fu() {
2808
+ let e2 = a(du);
2797
2809
  if (!e2) throw Error(`useTimeSlotsContext must be used within TimeSlotsContextProvider`);
2798
2810
  return e2;
2799
2811
  }
2800
- function lu(e2, t2, n2) {
2812
+ function pu(e2, t2, n2) {
2801
2813
  e2 ? t2() : n2();
2802
2814
  }
2803
- var uu = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
2804
- function du(e2 = 3) {
2805
- return Math.min(Math.max(e2, 1), mc);
2815
+ var mu = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
2816
+ function hu(e2 = 3) {
2817
+ return Math.min(Math.max(e2, 1), hc);
2806
2818
  }
2807
- function fu(e2) {
2819
+ function gu(e2) {
2808
2820
  let { isLoading: n2, bookingsSettingsLoading: r2 } = d();
2809
- Uc(Lc.TIME_SLOTS, !n2 && !r2);
2810
- let i2 = Us(), [a2] = l(() => Xl(i2));
2811
- return m(pc, { children: m(t, { fallback: m(Xc, { nextAvailableSlotsCount: du(e2.nextAvailableSlotsCount), children: e2.children }), children: m(mu, { ...e2, configurationPromise: a2 }) }) });
2821
+ Wc(Rc.TIME_SLOTS, !n2 && !r2);
2822
+ let i2 = Ws(), [a2] = l(() => Ql(i2));
2823
+ return m(mc, { children: m(t, { fallback: m(Zc, { nextAvailableSlotsCount: hu(e2.nextAvailableSlotsCount), children: e2.children }), children: m(vu, { ...e2, configurationPromise: a2 }) }) });
2812
2824
  }
2813
- function pu(e2) {
2825
+ function _u(e2) {
2814
2826
  let [t2, n2] = l({ serviceId: e2, key: 0 });
2815
2827
  return e2 !== t2.serviceId && n2({ serviceId: e2, key: t2.serviceId ? t2.key + 1 : t2.key }), t2.key;
2816
2828
  }
2817
- function mu({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: a2 }) {
2818
- let s2 = lc().isLoading, { searchParams: c2 } = Tc(), { reschedule: f2, isSelectionPending: p2 } = d(), [h2] = l(() => ({ locationId: c2.get(no.location), staffId: c2.get(no.resource), timeZone: c2.get(no.timezone) })), g2 = Mc(p2), _2 = () => (f2 ? null : Ir(g2)?.timezone) ?? null, [v2, y2] = l(() => _2() ?? h2.timeZone), [b2, x2] = l(p2);
2829
+ function vu({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: a2 }) {
2830
+ let s2 = uc().isLoading, { searchParams: c2 } = Ec(), { reschedule: f2, isSelectionPending: p2 } = d(), [h2] = l(() => ({ locationId: c2.get(no.location), staffId: c2.get(no.resource), timeZone: c2.get(no.timezone) })), g2 = Nc(p2), _2 = () => (f2 ? null : Ir(g2)?.timezone) ?? null, [v2, y2] = l(() => _2() ?? h2.timeZone), [b2, x2] = l(p2);
2819
2831
  if (b2 && !p2) {
2820
2832
  x2(false);
2821
2833
  let e3 = _2();
2822
2834
  e3 && y2(e3);
2823
2835
  }
2824
- let S2 = du(t2), [C2, w2] = l(false);
2836
+ let S2 = hu(t2), [C2, w2] = l(false);
2825
2837
  o(() => w2(true), []);
2826
2838
  let T2 = C2 && !s2 && !p2;
2827
- Dl(T2);
2828
- let E2 = Rs(i2), D2 = u(fs, ds, () => false), { serviceId: ee2 } = d(), O2 = pu(ee2), k2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
2829
- return m(hc, { fallback: m(Zc, { nextAvailableSlotsCount: S2, children: a2 }), feature: $.timeSlots, children: m(hu, { onlyAvailableSlots: e2, selectedTimeZone: v2, setSelectedTimeZone: y2, enabled: T2, nextAvailableSlotsCount: S2, loadDaysAvailabilityInitially: n2, timeSlotLimitPerDay: k2, landingLocationId: h2.locationId, landingStaffId: h2.staffId, businessTimeZone: E2.businessTimeZone, staffSelectionStrategy: E2.staffSelectionStrategy, allowGenderSelection: E2.allowGenderSelection, requestedGenderRejected: D2, children: a2 }) }, O2);
2830
- }
2831
- function hu({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone: n2, enabled: r2, nextAvailableSlotsCount: a2, loadDaysAvailabilityInitially: u2, timeSlotLimitPerDay: f2, landingLocationId: p2, landingStaffId: h2, businessTimeZone: g2, staffSelectionStrategy: _2, allowGenderSelection: v2, requestedGenderRejected: y2, children: b2 }) {
2832
- let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: E2, clearMultiServiceSlot: D2, draftRevision: ee2, navigateToMultiServiceForm: O2, selection: k2, selectStaffMember: A2, clearSelection: j2, clearStaffMember: M2, withSelectionParam: te2, staffMembers: N2, serviceOptionsAndVariants: ne2, isLoading: P2, hasError: re2, multiServiceAppointmentServices: ie2 = ru, reschedule: ae2, isSelectionPending: oe2 } = d(), F2 = ae2 != null, se2 = F2 && ae2.status !== `ready`, ce2 = F2 && ae2.status === `loading`, le2 = F2 ? uu[ae2.status] : void 0, ue2 = se2 ? null : ae2?.booking ?? null, de2 = ue2 ? ae2.validUntil : null, fe2 = wl(x2) && !eu(x2), I2 = fe2 || se2 ? null : S2, pe2 = Mc(oe2), me2 = F2 ? null : pe2, he2 = !F2 && oe2, ge2 = s(() => so(Ir(me2)), [me2]), L2 = !S2 && !P2 && !re2 && (ge2.valid || ge2.reason !== `too-few-services`), _e2 = L2 && ge2.valid && ie2.some((e3) => !eu(e3) && ge2.services.some((t3) => t3.serviceId === e3._id)), ve2 = fe2 || _e2, ye2 = L2 && ge2.valid && !_e2 ? ge2.requestKey : null, be2 = s(() => ye2 && ge2.valid ? { services: ge2.services, locationId: ge2.locationId, locationType: ge2.locationType } : null, [ye2]), xe2 = !!I2 || be2 !== null, Se2 = I2 || ye2, Ce2 = r2 && !P2 && !re2 && !xe2 && !ce2, we2 = dc(), Te2 = lc(), { navigate: Ee2, resolvePath: De2 } = yo(), [Oe2, ke2] = l(null), [Ae2, je2] = l(false), Me2 = c([]), Ne2 = c(false), Pe2 = i(() => (je2(true), Ne2.current ? Promise.resolve() : new Promise((e3) => {
2833
- Me2.current.push(e3);
2834
- })), []), Fe2 = r2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Ie2 = Xa(x2), Le2 = c(null), Re2 = lo(k2), ze2 = c(Re2);
2835
- ze2.current = Re2;
2836
- let Be2 = Re2 && !Re2.anyResource ? Re2.staffMemberId : null, Ve2 = k2.requestedGender ?? null, R2 = !Qa(C2) && !$a(C2), He2 = R2 && !L2 && Es(ne2), z2 = L2 || R2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, Ue2 = _2 !== void 0, We2 = Zo({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && R2 && !L2 && !He2, Ge2 = We2 && !y2, Ke2 = s(() => I2 ? Ir(me2)?.services.find((e3) => e3.serviceId === I2) ?? null : null, [me2, I2]), qe2 = (N2 ?? []).map((e3) => e3.staffMemberId).join(`,`), Je2 = Ie2.map((e3) => e3.id).join(`,`), Ye2 = s(() => Fl({ entry: Ke2, appointmentLike: R2, staffChoiceHidden: z2, staffPriced: He2, staffSelectionStrategy: _2, genderAllowed: Ge2, staffMemberIds: qe2.split(`,`), locationIds: Je2.split(`,`) }), [Ke2, R2, z2, He2, _2, Ge2, qe2, Je2]), B2 = Ye2.staff, Xe2 = Ye2.locationId, Ze2 = z2 || B2 !== null, [Qe2, $e2] = l(null), [et2, tt2] = l(p2 !== null || F2), nt2 = s(() => x2 ? Ps(x2) : [], [x2]), rt2 = B2 && !B2.anyResource ? B2.staffMemberId : null, it2 = s(() => {
2837
- if (!rt2) return nt2;
2838
- let e3 = nt2.find((e4) => e4.staffMemberId === rt2);
2839
- return e3 ? [e3] : nt2;
2840
- }, [nt2, rt2]), at2 = ue2?.locationId ?? null, ot2 = s(() => {
2841
- let e3 = Ns(Ie2, it2);
2842
- return !at2 || e3.some((e4) => e4.id === at2) ? e3 : Ie2.filter((t3) => t3.id === at2 || e3.some((e4) => e4.id === t3.id));
2843
- }, [x2, it2, at2]), st2 = (e3) => !!e3 && ot2.some((t3) => t3.id === e3), ct2 = Qe2 ?? (et2 ? st2(at2) ? at2 : p2 : null), lt2 = Ie2.length > 1 && ot2.length === 1 ? ot2[0].id : null, V2 = Xe2 ?? (st2(ct2) ? ct2 : lt2), ut2 = s(() => Xe2 ? [] : ot2.map((e3) => ({ id: e3.id, name: e3.label })), [ot2, Xe2]), dt2 = s(() => new Map(nt2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [nt2]), ft2 = i((e3, t3) => As([{ staffMemberId: e3, locationCoverage: dt2.get(e3) }], t3).length === 1, [dt2]), pt2 = s(() => Ze2 ? [] : (N2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [N2, Ze2]), mt2 = s(() => V2 ? pt2.filter((e3) => ft2(e3.id, V2)) : pt2, [pt2, V2, ft2]), ht2 = R2 && !Ue2 ? nu : mt2, gt2 = R2 && !Ue2 ? 0 : pt2.length, _t2 = Ge2 && gt2 > 1, vt2 = s(() => _t2 ? [...iu, ...ht2] : ht2, [_t2, ht2]), [yt2, bt2] = l(null), [xt2, St2] = l(h2 !== null);
2844
- xt2 && h2 !== null && V2 !== null && !ft2(h2, V2) && St2(false);
2845
- let Ct2 = yt2 ?? (xt2 ? h2 : null), H2 = B2 ? B2.anyResource ? null : B2.staffMemberId : Ct2 !== null && mt2.some((e3) => e3.id === Ct2) ? Ct2 : null, wt2 = Re2?.anyResource ? Ve2 : null, [Tt2, Et2] = l(wt2), [Dt2, Ot2] = l(wt2);
2846
- !y2 && Re2?.anyResource && Ve2 !== Dt2 && (Ot2(Ve2), Et2(Ve2));
2847
- let kt2 = B2 ? Ye2.requestedGender : We2 && gt2 > 1 && H2 === null ? Tt2 : null, At2 = y2 ? null : kt2, jt2 = i((e3) => {
2848
- ze2.current = e3, e3 ? e3.anyResource ? j2(At2 ?? void 0) : A2(e3.staffMemberId) : M2();
2849
- }, [M2, j2, A2, At2]), Mt2 = i((e3) => jt2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [jt2]), Nt2 = (ue2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), Pt2 = ue2 && Qa(C2) ? ue2.participants : null, Ft2 = R2 ? io(k2) : null, { addOnIds: It2, ...Lt2 } = Ft2 ?? {}, Rt2 = R2 && ue2 ? Nt2.length ? { ...Lt2, addOnIds: Nt2 } : Lt2 : Ft2, zt2 = Rt2 ? as(Rt2) : void 0, Bt2 = JSON.stringify(kt2 ? { ...zt2, requestedGender: { gender: kt2 } } : zt2 ?? null), Vt2 = s(() => JSON.parse(Bt2), [Bt2]), Ht2 = B2?.anyResource === true, Ut2 = i((e3) => Ht2 || _2 !== void 0 && jl({ isAppointment: R2, staffOnSlotCount: e3, hasStaffFilter: H2 !== null, hasRequestedGender: At2 !== null, hasStaffPricedVariants: He2, staffSelectionStrategy: _2 }), [Ht2, R2, _2, H2, At2, He2]), Wt2 = i((e3) => B2 ?? (z2 ? null : e3), [B2, z2]), Gt2 = i((e3) => {
2850
- let t3 = e3 === null ? null : vt2.find((t4) => t4.id === e3);
2851
- t3 !== void 0 && (St2(false), bt2(t3 && !t3.gender ? t3.id : null), Et2(t3?.gender ?? null));
2852
- }, [vt2]), Kt2 = i((e3) => {
2853
- (e3 === null || ot2.some((t3) => t3.id === e3)) && (tt2(false), $e2(e3), Ct2 !== null && e3 !== null && !ft2(Ct2, e3) && (bt2(null), St2(false)));
2854
- }, [ot2, Ct2, ft2]), qt2 = !!(r2 && !Te2.isLoading && Te2.displayTimeZonePolicy.customerCanChange && g2 && Fe2 && g2 !== Fe2), U2 = r2 ? qt2 && t2 && (t2 === g2 || t2 === Fe2) ? t2 : we2 ?? g2 ?? Fe2 : null, Jt2 = i((e3) => {
2855
- qt2 && (e3 === g2 || e3 === Fe2) && n2(e3);
2856
- }, [qt2, g2, Fe2, n2]), Yt2 = s(() => r2 && !P2 && xe2 ? Date.now() : void 0, [r2, P2, I2, be2, U2]), Xt2 = Yt2 !== void 0 && U2 ? Io(new Date(Yt2), U2) : null, { range: Zt2, daysAvailability: Qt2, isLoading: $t2, hasError: en2, setRange: tn2 } = _l({ enabled: r2, serviceId: I2, serviceType: C2, multiServiceRequest: be2, timeZone: U2, today: Xt2, locationId: V2, staffId: H2, customerChoices: Vt2, minRemainingCapacity: Pt2, loadInitially: u2, onlyAvailableSlots: e2 }), nn2 = de2?.slice(0, 10) ?? null, rn2 = s(() => nn2 ? Qt2.map((e3) => e3.date > nn2 ? { ...e3, availability: `none` } : e3) : Qt2, [Qt2, nn2]), an2 = de2 && U2 ? zo(new Date(de2), U2) : null, { query: W2, selectedDate: on2, timeSlots: sn2, isLoading: cn2, error: ln2, selectDate: un2, findNextAvailableDate: dn2 } = vl({ enabled: r2, serviceId: I2, serviceType: C2, multiServiceRequest: be2, timeZone: U2, today: Xt2, locationId: V2, staffId: H2, customerChoices: Vt2, minRemainingCapacity: Pt2, onlyAvailableSlots: e2, serviceLoading: P2 || ce2 }), fn2 = c(true), pn2 = c(null);
2857
- o(() => {
2858
- if (fn2.current) {
2859
- fn2.current = false;
2860
- return;
2861
- }
2862
- ke2(null), Le2.current && lu(I2, T2, D2), Le2.current = null, pn2.current = null;
2863
- }, [W2, be2, U2, V2, H2, Vt2, Pt2, e2, a2, f2, ee2]);
2864
- let mn2 = i(async () => {
2865
- let e3 = await dn2();
2866
- return e3.outcome === `found` ? nn2 && e3.date > nn2 ? `none` : (await Promise.all([un2(e3.date), Zt2 && Jo(e3.date, Zt2) ? Promise.resolve() : tn2(qo(e3.date))]), `found`) : e3.outcome;
2867
- }, [dn2, nn2, un2, Zt2, tn2]), hn2 = !!(r2 && !P2 && xe2 && U2 && Xt2), gn2 = r2 && !P2 && !ce2 && !xe2, [_n2, vn2] = l(false), [G2, yn2] = l(0), bn2 = c(false), xn2 = c([]), Sn2 = c(0), Cn2 = i(() => {
2868
- vn2(false);
2869
- let e3 = xn2.current;
2870
- return xn2.current = [], e3;
2871
- }, []), wn2 = i(() => {
2872
- Sn2.current += 1, Cn2().forEach((e3) => e3(`cancelled`));
2873
- }, [Cn2]), Tn2 = i((e3) => (wn2(), un2(e3)), [wn2, un2]), En2 = i((e3) => {
2874
- let t3 = Sn2.current;
2875
- bn2.current = true, mn2().then((n3) => {
2876
- bn2.current = false, n3 === `cancelled` && t3 === Sn2.current ? (xn2.current.unshift(...e3), vn2(true)) : e3.forEach((e4) => e4(n3)), yn2((e4) => e4 + 1);
2877
- });
2878
- }, [mn2]), Dn2 = i(() => gn2 ? Promise.resolve(`none`) : new Promise((e3) => {
2879
- if (hn2 && !bn2.current) {
2880
- En2([...Cn2(), e3]);
2881
- return;
2882
- }
2883
- xn2.current.push(e3), vn2(true);
2884
- }), [gn2, hn2, En2, Cn2]);
2839
+ Ol(T2);
2840
+ let E2 = zs(i2), D2 = u(ps, fs, () => false), { serviceId: ee2 } = d(), O2 = _u(ee2), k2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
2841
+ return m(gc, { fallback: m(Qc, { nextAvailableSlotsCount: S2, children: a2 }), feature: $.timeSlots, children: m(yu, { onlyAvailableSlots: e2, selectedTimeZone: v2, setSelectedTimeZone: y2, enabled: T2, nextAvailableSlotsCount: S2, loadDaysAvailabilityInitially: n2, timeSlotLimitPerDay: k2, landingLocationId: h2.locationId, landingStaffId: h2.staffId, businessTimeZone: E2.businessTimeZone, staffSelectionStrategy: E2.staffSelectionStrategy, allowGenderSelection: E2.allowGenderSelection, requestedGenderRejected: D2, children: a2 }) }, O2);
2842
+ }
2843
+ function yu({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone: n2, enabled: r2, nextAvailableSlotsCount: a2, loadDaysAvailabilityInitially: u2, timeSlotLimitPerDay: f2, landingLocationId: p2, landingStaffId: h2, businessTimeZone: g2, staffSelectionStrategy: _2, allowGenderSelection: v2, requestedGenderRejected: y2, children: b2 }) {
2844
+ let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: E2, clearMultiServiceSlot: D2, draftRevision: ee2, navigateToMultiServiceForm: O2, selection: k2, selectStaffMember: A2, clearSelection: j2, clearStaffMember: M2, withSelectionParam: te2, staffMembers: N2, serviceOptionsAndVariants: ne2, isLoading: P2, hasError: re2, multiServiceAppointmentServices: ie2 = au, reschedule: ae2, isSelectionPending: oe2 } = d(), F2 = ae2 != null, se2 = F2 && ae2.status !== `ready`, ce2 = F2 && ae2.status === `loading`, le2 = F2 ? mu[ae2.status] : void 0, ue2 = se2 ? null : ae2?.booking ?? null, de2 = ue2 ? ae2.validUntil : null, fe2 = Tl(x2) && !nu(x2), I2 = fe2 || se2 ? null : S2, pe2 = Nc(oe2), me2 = F2 ? null : pe2, he2 = !F2 && oe2, ge2 = s(() => so(Ir(me2)), [me2]), L2 = !S2 && !P2 && !re2 && (ge2.valid || ge2.reason !== `too-few-services`), _e2 = L2 && ge2.valid && ie2.some((e3) => !nu(e3) && ge2.services.some((t3) => t3.serviceId === e3._id)), ve2 = fe2 || _e2, ye2 = L2 && ge2.valid && !_e2 ? ge2.requestKey : null, be2 = s(() => ye2 && ge2.valid ? { services: ge2.services, locationId: ge2.locationId, locationType: ge2.locationType } : null, [ye2]), xe2 = !!I2 || be2 !== null, Se2 = I2 || ye2, Ce2 = r2 && !P2 && !re2 && !xe2 && !ce2, we2 = fc(), Te2 = uc(), { navigate: Ee2, resolvePath: De2 } = yo(), [Oe2, ke2] = l(null), [Ae2, je2] = l(false), R2 = r2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Me2 = Xa(x2), Ne2 = c(null), Pe2 = lo(k2), Fe2 = c(Pe2);
2845
+ Fe2.current = Pe2;
2846
+ let Ie2 = Pe2 && !Pe2.anyResource ? Pe2.staffMemberId : null, Le2 = k2.requestedGender ?? null, z2 = !Qa(C2) && !$a(C2), Re2 = z2 && !L2 && Ds(ne2), ze2 = L2 || z2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, Be2 = _2 !== void 0, Ve2 = Qo({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && z2 && !L2 && !Re2, He2 = Ve2 && !y2, Ue2 = s(() => I2 ? Ir(me2)?.services.find((e3) => e3.serviceId === I2) ?? null : null, [me2, I2]), We2 = (N2 ?? []).map((e3) => e3.staffMemberId).join(`,`), Ge2 = Me2.map((e3) => e3.id).join(`,`), Ke2 = s(() => Ll({ entry: Ue2, appointmentLike: z2, staffChoiceHidden: ze2, staffPriced: Re2, staffSelectionStrategy: _2, genderAllowed: He2, staffMemberIds: We2.split(`,`), locationIds: Ge2.split(`,`) }), [Ue2, z2, ze2, Re2, _2, He2, We2, Ge2]), B2 = Ke2.staff, qe2 = Ke2.locationId, Je2 = ze2 || B2 !== null, [Ye2, Xe2] = l(null), [Ze2, Qe2] = l(p2 !== null || F2), $e2 = s(() => x2 ? Fs(x2) : [], [x2]), et2 = B2 && !B2.anyResource ? B2.staffMemberId : null, tt2 = s(() => {
2847
+ if (!et2) return $e2;
2848
+ let e3 = $e2.find((e4) => e4.staffMemberId === et2);
2849
+ return e3 ? [e3] : $e2;
2850
+ }, [$e2, et2]), nt2 = ue2?.locationId ?? null, rt2 = s(() => {
2851
+ let e3 = Ps(Me2, tt2);
2852
+ return !nt2 || e3.some((e4) => e4.id === nt2) ? e3 : Me2.filter((t3) => t3.id === nt2 || e3.some((e4) => e4.id === t3.id));
2853
+ }, [x2, tt2, nt2]), it2 = (e3) => !!e3 && rt2.some((t3) => t3.id === e3), at2 = Ye2 ?? (Ze2 ? it2(nt2) ? nt2 : p2 : null), ot2 = Me2.length > 1 && rt2.length === 1 ? rt2[0].id : null, V2 = qe2 ?? (it2(at2) ? at2 : ot2), st2 = s(() => qe2 ? [] : rt2.map((e3) => ({ id: e3.id, name: e3.label })), [rt2, qe2]), ct2 = s(() => new Map($e2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [$e2]), lt2 = i((e3, t3) => js([{ staffMemberId: e3, locationCoverage: ct2.get(e3) }], t3).length === 1, [ct2]), ut2 = s(() => Je2 ? [] : (N2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [N2, Je2]), dt2 = s(() => V2 ? ut2.filter((e3) => lt2(e3.id, V2)) : ut2, [ut2, V2, lt2]), ft2 = z2 && !Be2 ? iu : dt2, pt2 = z2 && !Be2 ? 0 : ut2.length, mt2 = He2 && pt2 > 1, ht2 = s(() => mt2 ? [...ou, ...ft2] : ft2, [mt2, ft2]), [gt2, _t2] = l(null), [vt2, yt2] = l(h2 !== null);
2854
+ vt2 && h2 !== null && V2 !== null && !lt2(h2, V2) && yt2(false);
2855
+ let bt2 = gt2 ?? (vt2 ? h2 : null), H2 = B2 ? B2.anyResource ? null : B2.staffMemberId : bt2 !== null && dt2.some((e3) => e3.id === bt2) ? bt2 : null, xt2 = Pe2?.anyResource ? Le2 : null, [St2, Ct2] = l(xt2), [wt2, Tt2] = l(xt2);
2856
+ !y2 && Pe2?.anyResource && Le2 !== wt2 && (Tt2(Le2), Ct2(Le2));
2857
+ let Et2 = B2 ? Ke2.requestedGender : Ve2 && pt2 > 1 && H2 === null ? St2 : null, Dt2 = y2 ? null : Et2, Ot2 = i((e3) => {
2858
+ Fe2.current = e3, e3 ? e3.anyResource ? j2(Dt2 ?? void 0) : A2(e3.staffMemberId) : M2();
2859
+ }, [M2, j2, A2, Dt2]), kt2 = i((e3) => Ot2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [Ot2]), At2 = (ue2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), jt2 = ue2 && Qa(C2) ? ue2.participants : null, Mt2 = z2 ? io(k2) : null, { addOnIds: Nt2, ...Pt2 } = Mt2 ?? {}, Ft2 = z2 && ue2 ? At2.length ? { ...Pt2, addOnIds: At2 } : Pt2 : Mt2, It2 = Ft2 ? os(Ft2) : void 0, Lt2 = JSON.stringify(Et2 ? { ...It2, requestedGender: { gender: Et2 } } : It2 ?? null), Rt2 = s(() => JSON.parse(Lt2), [Lt2]), zt2 = B2?.anyResource === true, Bt2 = i((e3) => zt2 || _2 !== void 0 && Nl({ isAppointment: z2, staffOnSlotCount: e3, hasStaffFilter: H2 !== null, hasRequestedGender: Dt2 !== null, hasStaffPricedVariants: Re2, staffSelectionStrategy: _2 }), [zt2, z2, _2, H2, Dt2, Re2]), Vt2 = i((e3) => B2 ?? (ze2 ? null : e3), [B2, ze2]), Ht2 = i((e3) => {
2860
+ let t3 = e3 === null ? null : ht2.find((t4) => t4.id === e3);
2861
+ t3 !== void 0 && (yt2(false), _t2(t3 && !t3.gender ? t3.id : null), Ct2(t3?.gender ?? null));
2862
+ }, [ht2]), Ut2 = i((e3) => {
2863
+ (e3 === null || rt2.some((t3) => t3.id === e3)) && (Qe2(false), Xe2(e3), bt2 !== null && e3 !== null && !lt2(bt2, e3) && (_t2(null), yt2(false)));
2864
+ }, [rt2, bt2, lt2]), Wt2 = !!(r2 && !Te2.isLoading && Te2.displayTimeZonePolicy.customerCanChange && g2 && R2 && g2 !== R2), U2 = r2 ? Wt2 && t2 && (t2 === g2 || t2 === R2) ? t2 : we2 ?? g2 ?? R2 : null, Gt2 = i((e3) => {
2865
+ Wt2 && (e3 === g2 || e3 === R2) && n2(e3);
2866
+ }, [Wt2, g2, R2, n2]), Kt2 = s(() => r2 && !P2 && xe2 ? Date.now() : void 0, [r2, P2, I2, be2, U2]), qt2 = Kt2 !== void 0 && U2 ? Lo(new Date(Kt2), U2) : null, { range: Jt2, daysAvailability: Yt2, isLoading: Xt2, hasError: Zt2, setRange: Qt2 } = vl({ enabled: r2, serviceId: I2, serviceType: C2, multiServiceRequest: be2, timeZone: U2, today: qt2, locationId: V2, staffId: H2, customerChoices: Rt2, minRemainingCapacity: jt2, loadInitially: u2, onlyAvailableSlots: e2 }), $t2 = de2?.slice(0, 10) ?? null, en2 = s(() => $t2 ? Yt2.map((e3) => e3.date > $t2 ? { ...e3, availability: `none` } : e3) : Yt2, [Yt2, $t2]), tn2 = de2 && U2 ? Bo(new Date(de2), U2) : null, { query: W2, selectedDate: nn2, timeSlots: rn2, isLoading: an2, error: on2, selectDate: sn2, findNextAvailableDate: cn2 } = yl({ enabled: r2, serviceId: I2, serviceType: C2, multiServiceRequest: be2, timeZone: U2, today: qt2, locationId: V2, staffId: H2, customerChoices: Rt2, minRemainingCapacity: jt2, onlyAvailableSlots: e2, serviceLoading: P2 || ce2 }), ln2 = c(true), un2 = c(null);
2885
2867
  o(() => {
2886
- if (_n2 && !bn2.current) {
2887
- if (gn2) {
2888
- Cn2().forEach((e3) => e3(`none`));
2889
- return;
2890
- }
2891
- hn2 && En2(Cn2());
2892
- }
2893
- }, [_n2, G2, hn2, gn2, En2, Cn2]);
2894
- let On2 = x2?.schedule?.lastSessionEnd, kn2 = R2 || Qa(C2) || $a(C2) && !Ol(On2, Yt2), An2 = !!(Ae2 && r2 && !P2 && I2 && U2 && Yt2 !== void 0), jn2 = An2 && I2 && U2 && Yt2 !== void 0 ? Al({ serviceId: I2, serviceType: C2, lastSessionEnd: On2, timeZone: U2, now: Yt2, onlyAvailableSlots: e2, locationId: V2, staffId: H2, timeSlotLimitPerDay: f2, customerChoices: Vt2, minRemainingCapacity: Pt2 }) : void 0, K2 = $l(a2, jn2), Mn2 = Ae2 && I2 && kn2 && !(Ae2 && I2 && kn2 && (!r2 || P2)) && !U2, Nn2 = ve2 ? `onlineBookingOff` : le2 ?? (K2.error === null ? Mn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), Pn2 = W2 !== null, Fn2 = s(() => Ll({ sessions: K2.sessions, dayQuery: Pn2, daySlots: sn2, staffFilter: H2, appointmentLike: R2, limitPerDay: f2, expandedDates: K2.expandedDates }), [K2.sessions, Pn2, sn2, H2, R2, f2, K2.expandedDates]), { slotIdOf: In2 } = Fn2, Ln2 = Ae2 && (jn2 ? K2.firstPageSettled : An2 || r2 && !P2 && !I2 || Mn2);
2895
- Ne2.current = Ln2, o(() => {
2896
- if (!Ln2) return;
2897
- let e3 = Me2.current;
2898
- Me2.current = [], e3.forEach((e4) => e4());
2899
- }, [Ln2]);
2900
- let Rn2 = Ae2 && !Ln2 || K2.isLoadingPage, zn2 = Nn2 !== null, Bn2 = W2 ? cn2 : Rn2 || cn2 || !r2 || xe2 && !U2 || _n2 || ce2, Vn2 = W2 ? ln2 : ln2 ?? Nn2, Hn2 = W2 ? ln2 !== null : zn2 || ln2 !== null, Un2 = Hc(Lc.TIME_SLOTS), Wn2 = c(false), Gn2 = i((e3, t3) => {
2868
+ ln2.current ? ln2.current = false : (ke2(null), Ne2.current && pu(I2, T2, D2), Ne2.current = null, un2.current = null);
2869
+ }, [W2, be2, U2, V2, H2, Rt2, jt2, e2, a2, f2, ee2]);
2870
+ let dn2 = i(async () => {
2871
+ let e3 = await cn2();
2872
+ return e3.outcome === `found` ? $t2 && e3.date > $t2 ? `none` : (await Promise.all([sn2(e3.date), Jt2 && Yo(e3.date, Jt2) ? Promise.resolve() : Qt2(Jo(e3.date))]), `found`) : e3.outcome;
2873
+ }, [cn2, $t2, sn2, Jt2, Qt2]), { request: fn2, cancel: pn2, held: mn2 } = kl({ ready: !!(r2 && !P2 && xe2 && U2 && qt2), answer: r2 && !P2 && !ce2 && !xe2 ? `none` : void 0, run: dn2, rerunsOn: uu }), hn2 = i((e3) => (pn2(`cancelled`), sn2(e3)), [pn2, sn2]), gn2 = x2?.schedule?.lastSessionEnd, _n2 = z2 || Qa(C2) || $a(C2) && !Al(gn2, Kt2), vn2 = !!(Ae2 && r2 && !P2 && I2 && U2 && Kt2 !== void 0), G2 = vn2 && I2 && U2 && Kt2 !== void 0 ? Ml({ serviceId: I2, serviceType: C2, lastSessionEnd: gn2, timeZone: U2, now: Kt2, onlyAvailableSlots: e2, locationId: V2, staffId: H2, timeSlotLimitPerDay: f2, customerChoices: Rt2, minRemainingCapacity: jt2 }) : void 0, K2 = tu(a2, G2), yn2 = Ae2 && I2 && _n2 && !(Ae2 && I2 && _n2 && (!r2 || P2)) && !U2, bn2 = ve2 ? `onlineBookingOff` : le2 ?? (K2.error === null ? yn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), xn2 = W2 !== null, Sn2 = s(() => zl({ sessions: K2.sessions, dayQuery: xn2, daySlots: rn2, staffFilter: H2, appointmentLike: z2, limitPerDay: f2, expandedDates: K2.expandedDates }), [K2.sessions, xn2, rn2, H2, z2, f2, K2.expandedDates]), { slotIdOf: Cn2 } = Sn2, wn2 = Ae2 && (G2 ? K2.firstPageSettled : vn2 || r2 && !P2 && !I2 || yn2), { request: Tn2 } = kl({ ready: wn2, run: lu }), En2 = i(() => (je2(true), Tn2()), [Tn2]), Dn2 = Ae2 && !wn2 || K2.isLoadingPage, On2 = bn2 !== null, kn2 = W2 ? an2 : Dn2 || an2 || !r2 || xe2 && !U2 || mn2 || ce2, An2 = W2 ? on2 : on2 ?? bn2, jn2 = W2 ? on2 !== null : On2 || on2 !== null, Mn2 = Uc(Rc.TIME_SLOTS), Nn2 = c(false), Pn2 = i((e3, t3) => {
2901
2874
  if (!t3.bookable) {
2902
- pn2.current = null;
2875
+ un2.current = null;
2903
2876
  return;
2904
2877
  }
2905
- if (e3 === pn2.current) return;
2906
- pn2.current = e3;
2878
+ if (e3 === un2.current) return;
2879
+ un2.current = e3;
2907
2880
  let n3 = I2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r3 = C2 ?? ie2.find((e4) => e4._id === n3)?.type ?? void 0;
2908
- !Wn2.current && !F2 && Un2(Fc({ bookingsServiceId: n3, serviceType: r3, isEligibleForFlowCompletion: true })), Wn2.current = true, Un2(Gc({ component: Bc.TIME_PICKER, element: Vc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
2909
- }, [Un2, I2, C2, ie2, F2]), q2 = i((e3) => {
2881
+ !Nn2.current && !F2 && Mn2(Ic({ bookingsServiceId: n3, serviceType: r3, isEligibleForFlowCompletion: true })), Nn2.current = true, Mn2(Kc({ component: Vc.TIME_PICKER, element: Hc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
2882
+ }, [Mn2, I2, C2, ie2, F2]), Fn2 = i((e3) => {
2910
2883
  if (e3 === null) {
2911
- let e4 = Le2.current !== null;
2912
- Le2.current = null, pn2.current = null, ke2(null), e4 && lu(I2, T2, D2);
2884
+ let e4 = Ne2.current !== null;
2885
+ Ne2.current = null, un2.current = null, ke2(null), e4 && pu(I2, T2, D2);
2913
2886
  return;
2914
2887
  }
2915
- let t3 = Rl(Fn2, e3);
2888
+ let t3 = Bl(Sn2, e3);
2916
2889
  if (!t3) return;
2917
2890
  if (L2) {
2918
2891
  if (!E2(t3.nestedTimeSlots ?? [], U2 ?? void 0)) return;
2919
- Le2.current = t3, ke2(t3), Gn2(e3, t3);
2892
+ Ne2.current = t3, ke2(t3), Pn2(e3, t3);
2920
2893
  return;
2921
2894
  }
2922
- Le2.current = t3, ke2(t3), Gn2(e3, t3);
2923
- let n3 = Hl(t3);
2924
- if (w2(Ts(t3), { staffId: R2 ? void 0 : Vl(t3), timezone: U2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: R2 && Ue2 && !z2 && n3.length > 1 && !Ut2(n3.length), rescheduleStaffId: R2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Ut2(n3.length)) ? n3[0] : void 0 }), !R2) return;
2925
- let r3 = ze2.current, i2;
2926
- i2 = B2 || (H2 && n3.includes(H2) ? { anyResource: false, staffMemberId: H2 } : At2 !== null && Ut2(n3.length) ? { anyResource: true } : Ml(n3, Ue2 && Ut2(n3.length))), tu(i2, At2) !== tu(r3, Ve2) && jt2(i2);
2927
- }, [L2, I2, T2, D2, E2, w2, Fn2, Gn2, U2, R2, Ue2, _2, z2, Ut2, B2, H2, At2, Ve2, jt2]), Kn2 = i(() => {
2928
- let e3 = Le2.current;
2895
+ Ne2.current = t3, ke2(t3), Pn2(e3, t3);
2896
+ let n3 = Wl(t3);
2897
+ if (w2(Es(t3), { staffId: z2 ? void 0 : Ul(t3), timezone: U2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: z2 && Be2 && !ze2 && n3.length > 1 && !Bt2(n3.length), rescheduleStaffId: z2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Bt2(n3.length)) ? n3[0] : void 0 }), !z2) return;
2898
+ let r3 = Fe2.current, i2;
2899
+ i2 = B2 || (H2 && n3.includes(H2) ? { anyResource: false, staffMemberId: H2 } : Dt2 !== null && Bt2(n3.length) ? { anyResource: true } : Pl(n3, Be2 && Bt2(n3.length))), ru(i2, Dt2) !== ru(r3, Le2) && Ot2(i2);
2900
+ }, [L2, I2, T2, D2, E2, w2, Sn2, Pn2, U2, z2, Be2, _2, ze2, Bt2, B2, H2, Dt2, Le2, Ot2]), In2 = i(() => {
2901
+ let e3 = Ne2.current;
2929
2902
  if (!e3 || F2 || !e3.bookable) return;
2930
2903
  if (L2) {
2931
- O2(Un2);
2904
+ O2(Mn2);
2932
2905
  return;
2933
2906
  }
2934
2907
  if (!I2) return;
2935
2908
  let t3;
2936
- if (R2) {
2937
- let n4 = Hl(e3), r3 = Nl(n4, Wt2(ze2.current), Ut2(n4.length));
2909
+ if (z2) {
2910
+ let n4 = Wl(e3), r3 = Fl(n4, Vt2(Fe2.current), Bt2(n4.length));
2938
2911
  t3 = (r3.isComplete ? r3.resourceId : n4[0]) ?? (n4.length ? null : void 0);
2939
2912
  }
2940
2913
  let n3 = De2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: I2 });
2941
- Un2(Jc({ serviceId: I2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: U2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && Ee2(te2(n3, { handoff: true, staffId: t3 }));
2942
- }, [Un2, L2, O2, U2, I2, C2, x2, R2, Wt2, Ut2, Ee2, De2, te2, F2]), qn2 = Oe2 ? Hl(Oe2) : null, Jn2 = qn2 ? L2 || !R2 || Nl(qn2, Wt2(Re2), Ut2(qn2.length)).isComplete : false, Yn2 = qn2 ? Ut2(qn2.length) : false, Xn2 = s(() => !Oe2 || Ze2 ? [] : Bl(Oe2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === Be2 })), [Oe2, Ze2, Be2]), Zn2 = s(() => ({ isMultiService: L2, isSelectionPending: he2, availabilityRequestKey: Se2, needsServiceChoice: Ce2, isRescheduling: F2, rescheduleValidUntil: an2, businessTimeZone: g2, canChangeTimeZone: qt2, setTimeZone: Jt2, locationFilterOptions: ut2, selectedLocationFilter: V2, setLocationFilter: Kt2, staffFilterOptions: vt2, selectedStaffFilter: H2, setStaffFilter: Gt2, requestedGender: At2, genderSelectionAllowed: Ge2, currentTimeSlotsPage: W2 ? 1 : K2.currentPage, hasNextTimeSlotsPage: !W2 && K2.hasNextPage, hasPreviousTimeSlotsPage: !W2 && K2.hasPreviousPage, nextTimeSlotsPage: W2 ? ou : K2.nextPage, loadUpcomingTimeSlots: Pe2, upcomingTimeSlotsRequested: Ae2, previousTimeSlotsPage: W2 ? au : K2.previousPage, timeSlots: Fn2.rows.map((e3) => zl(e3, U2, In2, z2)), isLoading: Bn2, hasError: Hn2, errorCode: Vn2, selectedDate: on2, daysAvailabilityRange: Zt2, daysAvailability: rn2, daysAvailabilityLoading: $t2, daysAvailabilityHasError: en2, selectDate: Tn2, setDaysAvailabilityRange: tn2, goToNextAvailableDate: Dn2, nextAvailableSlotsCount: a2, timeZone: U2, staffFromSlots: Xn2, selectedResourceId: Be2, setSelectedResource: Mt2, canAutoAssignStaff: Yn2, isComplete: Jn2, selectedTimeSlot: Oe2 ? zl(Oe2, U2, In2, z2) : null, selectTimeSlot: q2, navigateToBookingForm: Kn2, timeSlotLimitPerDay: f2, daysWithMore: Fn2.daysWithMore, loadingDate: K2.loadingDate, loadAllTimeSlotsForDay: K2.loadAllSessionsForDay }), [L2, he2, Se2, Ce2, F2, an2, g2, U2, qt2, Jt2, K2, Pe2, Ae2, ut2, V2, Kt2, vt2, H2, Gt2, At2, Ge2, W2, Bn2, Vn2, Hn2, Fn2, on2, Zt2, rn2, $t2, en2, Tn2, tn2, Dn2, a2, Xn2, Be2, Mt2, Yn2, Jn2, Oe2, q2, Kn2, f2, In2, z2]);
2943
- return m(su.Provider, { value: Zn2, children: b2 });
2914
+ Mn2(Yc({ serviceId: I2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: U2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && Ee2(te2(n3, { handoff: true, staffId: t3 }));
2915
+ }, [Mn2, L2, O2, U2, I2, C2, x2, z2, Vt2, Bt2, Ee2, De2, te2, F2]), Ln2 = Oe2 ? Wl(Oe2) : null, Rn2 = Ln2 ? L2 || !z2 || Fl(Ln2, Vt2(Pe2), Bt2(Ln2.length)).isComplete : false, zn2 = Ln2 ? Bt2(Ln2.length) : false, Bn2 = s(() => !Oe2 || Je2 ? [] : Hl(Oe2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === Ie2 })), [Oe2, Je2, Ie2]), Vn2 = s(() => ({ isMultiService: L2, isSelectionPending: he2, availabilityRequestKey: Se2, needsServiceChoice: Ce2, isRescheduling: F2, rescheduleValidUntil: tn2, businessTimeZone: g2, canChangeTimeZone: Wt2, setTimeZone: Gt2, locationFilterOptions: st2, selectedLocationFilter: V2, setLocationFilter: Ut2, staffFilterOptions: ht2, selectedStaffFilter: H2, setStaffFilter: Ht2, requestedGender: Dt2, genderSelectionAllowed: He2, currentTimeSlotsPage: W2 ? 1 : K2.currentPage, hasNextTimeSlotsPage: !W2 && K2.hasNextPage, hasPreviousTimeSlotsPage: !W2 && K2.hasPreviousPage, nextTimeSlotsPage: W2 ? cu : K2.nextPage, loadUpcomingTimeSlots: En2, upcomingTimeSlotsRequested: Ae2, previousTimeSlotsPage: W2 ? su : K2.previousPage, timeSlots: Sn2.rows.map((e3) => Vl(e3, U2, Cn2, ze2)), isLoading: kn2, hasError: jn2, errorCode: An2, selectedDate: nn2, daysAvailabilityRange: Jt2, daysAvailability: en2, daysAvailabilityLoading: Xt2, daysAvailabilityHasError: Zt2, selectDate: hn2, setDaysAvailabilityRange: Qt2, goToNextAvailableDate: fn2, nextAvailableSlotsCount: a2, timeZone: U2, staffFromSlots: Bn2, selectedResourceId: Ie2, setSelectedResource: kt2, canAutoAssignStaff: zn2, isComplete: Rn2, selectedTimeSlot: Oe2 ? Vl(Oe2, U2, Cn2, ze2) : null, selectTimeSlot: Fn2, navigateToBookingForm: In2, timeSlotLimitPerDay: f2, daysWithMore: Sn2.daysWithMore, loadingDate: K2.loadingDate, loadAllTimeSlotsForDay: K2.loadAllSessionsForDay }), [L2, he2, Se2, Ce2, F2, tn2, g2, U2, Wt2, Gt2, K2, En2, Ae2, st2, V2, Ut2, ht2, H2, Ht2, Dt2, He2, W2, kn2, An2, jn2, Sn2, nn2, Jt2, en2, Xt2, Zt2, hn2, Qt2, fn2, a2, Bn2, Ie2, kt2, zn2, Rn2, Oe2, Fn2, In2, f2, Cn2, ze2]);
2916
+ return m(du.Provider, { value: Vn2, children: b2 });
2944
2917
  }
2945
- var gu = ln(`4936242d-905c-48bf-80ce-5f56d075de4f`);
2918
+ var bu = ln(`4936242d-905c-48bf-80ce-5f56d075de4f`);
2946
2919
  export {
2947
- fu as TimeSlotsContextProvider,
2948
- fu as default,
2949
- gu as injectAccessTokenGetter,
2950
- su as timeSlotsContext,
2951
- cu as useTimeSlotsContext
2920
+ gu as TimeSlotsContextProvider,
2921
+ gu as default,
2922
+ bu as injectAccessTokenGetter,
2923
+ du as timeSlotsContext,
2924
+ fu as useTimeSlotsContext
2952
2925
  };
2953
2926
  //# sourceMappingURL=context-time-slots.mjs.map