@wix/bookings 1.0.1776 → 1.0.1778

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 +243 -108
  2. package/build/cjs/context-booking-checkout.js +177 -183
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-categories.d.ts +16 -143
  5. package/build/cjs/context-categories.js +412 -412
  6. package/build/cjs/context-categories.js.map +1 -1
  7. package/build/cjs/context-locations.d.ts +16 -287
  8. package/build/cjs/context-locations.js +336 -336
  9. package/build/cjs/context-locations.js.map +1 -1
  10. package/build/cjs/context-service-addons.d.ts +2 -2
  11. package/build/cjs/context-service-addons.js +1 -1
  12. package/build/cjs/context-service-addons.js.map +1 -1
  13. package/build/cjs/context-service.d.ts +71 -33
  14. package/build/cjs/context-service.js +98 -96
  15. package/build/cjs/context-service.js.map +1 -1
  16. package/build/cjs/context-services.js +1 -1
  17. package/build/cjs/context-services.js.map +1 -1
  18. package/build/cjs/context-time-slots.d.ts +10 -0
  19. package/build/cjs/context-time-slots.js +2 -2
  20. package/build/cjs/context-time-slots.js.map +1 -1
  21. package/build/es/context-booking-checkout.d.mts +243 -108
  22. package/build/es/context-booking-checkout.mjs +177 -180
  23. package/build/es/context-booking-checkout.mjs.map +1 -1
  24. package/build/es/context-categories.d.mts +16 -143
  25. package/build/es/context-categories.mjs +412 -412
  26. package/build/es/context-categories.mjs.map +1 -1
  27. package/build/es/context-locations.d.mts +16 -287
  28. package/build/es/context-locations.mjs +336 -336
  29. package/build/es/context-locations.mjs.map +1 -1
  30. package/build/es/context-service-addons.d.mts +2 -2
  31. package/build/es/context-service-addons.mjs +1 -1
  32. package/build/es/context-service-addons.mjs.map +1 -1
  33. package/build/es/context-service.d.mts +71 -33
  34. package/build/es/context-service.mjs +98 -96
  35. package/build/es/context-service.mjs.map +1 -1
  36. package/build/es/context-services.mjs +1 -1
  37. package/build/es/context-services.mjs.map +1 -1
  38. package/build/es/context-time-slots.d.mts +10 -0
  39. package/build/es/context-time-slots.mjs +2 -2
  40. package/build/es/context-time-slots.mjs.map +1 -1
  41. package/build/internal/cjs/context-booking-checkout.d.ts +243 -108
  42. package/build/internal/cjs/context-categories.d.ts +16 -143
  43. package/build/internal/cjs/context-locations.d.ts +16 -287
  44. package/build/internal/cjs/context-service-addons.d.ts +2 -2
  45. package/build/internal/cjs/context-service.d.ts +71 -33
  46. package/build/internal/cjs/context-time-slots.d.ts +10 -0
  47. package/build/internal/es/context-booking-checkout.d.mts +243 -108
  48. package/build/internal/es/context-categories.d.mts +16 -143
  49. package/build/internal/es/context-locations.d.mts +16 -287
  50. package/build/internal/es/context-service-addons.d.mts +2 -2
  51. package/build/internal/es/context-service.d.mts +71 -33
  52. package/build/internal/es/context-time-slots.d.mts +10 -0
  53. package/{_sdk-exports → context-runtime}/context-booking-checkout/runtime.d.ts +243 -108
  54. package/context-runtime/context-booking-checkout/runtime.js +3 -0
  55. package/{_sdk-exports → context-runtime}/context-categories/runtime.d.ts +16 -143
  56. package/context-runtime/context-categories/runtime.js +2 -0
  57. package/context-runtime/context-locations/runtime.d.ts +195 -0
  58. package/context-runtime/context-locations/runtime.js +2 -0
  59. package/{_sdk-exports → context-runtime}/context-service/runtime.d.ts +71 -33
  60. package/{_sdk-exports → context-runtime}/context-service/runtime.js +3 -3
  61. package/{_sdk-exports → context-runtime}/context-service-addons/runtime.d.ts +2 -2
  62. package/{_sdk-exports → context-runtime}/context-time-slots/runtime.d.ts +10 -0
  63. package/{_sdk-exports → context-runtime}/context-time-slots/runtime.js +2 -2
  64. package/package.json +8 -8
  65. package/_sdk-exports/context-booking-checkout/runtime.js +0 -3
  66. package/_sdk-exports/context-categories/runtime.js +0 -2
  67. package/_sdk-exports/context-locations/runtime.d.ts +0 -466
  68. package/_sdk-exports/context-locations/runtime.js +0 -2
  69. /package/{_sdk-exports → context-runtime}/context-service-addons/runtime.js +0 -0
  70. /package/{_sdk-exports → context-runtime}/context-services/runtime.d.ts +0 -0
  71. /package/{_sdk-exports → context-runtime}/context-services/runtime.js +0 -0
@@ -1,4 +1,4 @@
1
- // _sdk-exports/context-booking-checkout/runtime.js
1
+ // context-runtime/context-booking-checkout/runtime.js
2
2
  import { createContext as e, useCallback as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o, useSyncExternalStore as s } from "react";
3
3
  import { useGetService as c, useService as l } from "@wix/services-manager-react";
4
4
  import { jsx as u } from "react/jsx-runtime";
@@ -23,11 +23,11 @@ var h = f(() => {
23
23
  function g(e2, t2 = false, n2 = (e3) => e3) {
24
24
  return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
25
25
  }
26
- var ee;
27
- var _ = f(() => {
28
- ee = { ASC: `ASC`, DESC: `DESC` }, { ...ee };
26
+ var _;
27
+ var v = f(() => {
28
+ _ = { ASC: `ASC`, DESC: `DESC` }, { ..._ };
29
29
  });
30
- var v = (e2) => {
30
+ var y = (e2) => {
31
31
  switch (e2) {
32
32
  case `get`:
33
33
  case `GET`:
@@ -54,11 +54,11 @@ var v = (e2) => {
54
54
  throw Error(`Unknown method: ${e2}`);
55
55
  }
56
56
  };
57
- var te = (e2) => (t2) => async (n2) => {
57
+ var ee = (e2) => (t2) => async (n2) => {
58
58
  let r2, i2 = (t3) => {
59
59
  if (r2 = e2(n2)(t3), r2.url === void 0) throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);
60
60
  let { method: i3, url: a2, params: o2 } = r2;
61
- return { ...r2, method: v(i3), url: a2, data: r2.data, params: o2 };
61
+ return { ...r2, method: y(i3), url: a2, data: r2.data, params: o2 };
62
62
  };
63
63
  try {
64
64
  let e3 = await t2.request(i2);
@@ -71,10 +71,10 @@ var te = (e2) => (t2) => async (n2) => {
71
71
  throw typeof e3 == `object` && e3 && `response` in e3 && typeof e3.response == `object` && e3.response !== null && `data` in e3.response ? e3.response.data : e3;
72
72
  }
73
73
  };
74
- var ne = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
75
- var re = `__metadata`;
76
- var ie = `edge.wixapis.com`;
77
- var ae = class extends Error {
74
+ var te = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
75
+ var ne = `__metadata`;
76
+ var re = `edge.wixapis.com`;
77
+ var ie = class extends Error {
78
78
  message;
79
79
  response;
80
80
  constructor(e2, t2) {
@@ -82,25 +82,25 @@ var ae = class extends Error {
82
82
  }
83
83
  async details() {
84
84
  let e2 = await this.response.json();
85
- return oe(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
85
+ return ae(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
86
86
  }
87
87
  };
88
- var oe = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
89
- var se = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
90
- var y = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
91
- var ce = (e2) => e2.__type === `host`;
92
- function le(e2, t2) {
88
+ var ae = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
89
+ var oe = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
90
+ var b = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
91
+ var se = (e2) => e2.__type === `host`;
92
+ function ce(e2, t2) {
93
93
  return e2.create(t2);
94
94
  }
95
- var ue = `x-wix-bi-gateway`;
96
- function de(e2, t2, n2) {
97
- return { [ue]: fe({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
95
+ var le = `x-wix-bi-gateway`;
96
+ function ue(e2, t2, n2) {
97
+ return { [le]: de({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
98
98
  }
99
- function fe(e2) {
99
+ function de(e2) {
100
100
  return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
101
101
  }
102
102
  h();
103
- function pe(e2) {
103
+ function fe(e2) {
104
104
  let t2 = globalThis.__wix_context__, n2 = { client: m.client, elevatedClient: m.elevatedClient }, r2;
105
105
  globalThis.__wix_context__ = void 0, m.client = void 0, m.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
106
106
  try {
@@ -109,60 +109,60 @@ function pe(e2) {
109
109
  globalThis.__wix_context__ = t2, m.client = n2.client, m.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
110
110
  }
111
111
  }
112
- var me = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
113
- function b(e2) {
114
- return ve(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
112
+ var pe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
113
+ function x(e2) {
114
+ return _e(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
115
115
  }
116
- var he = /([\p{Ll}\d])(\p{Lu})/gu;
117
- var ge = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
118
- var _e = `$1\0$2`;
119
- var x = /[^\p{L}\d]+/giu;
120
- function ve(e2) {
116
+ var me = /([\p{Ll}\d])(\p{Lu})/gu;
117
+ var he = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
118
+ var ge = `$1\0$2`;
119
+ var S = /[^\p{L}\d]+/giu;
120
+ function _e(e2) {
121
121
  let t2 = e2.trim();
122
- t2 = t2.replace(he, _e).replace(ge, _e), t2 = t2.replace(x, `\0`);
122
+ t2 = t2.replace(me, ge).replace(he, ge), t2 = t2.replace(S, `\0`);
123
123
  let n2 = 0, r2 = t2.length;
124
124
  for (; t2.charAt(n2) === `\0`; ) n2++;
125
125
  if (n2 === r2) return [];
126
126
  for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
127
127
  return t2.slice(n2, r2).split(/\0/g);
128
128
  }
129
- var ye = (e2) => `validationError` in (e2.response?.data?.details ?? {});
130
- var be = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
131
- var S = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
132
- function xe(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
129
+ var C = (e2) => `validationError` in (e2.response?.data?.details ?? {});
130
+ var ve = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
131
+ var ye = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
132
+ function be(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
133
133
  if (typeof e2 != `object` || !e2) throw e2;
134
- if (ye(e2)) return Se(e2, t2, n2);
135
- if (be(e2)) return we(e2);
136
- if (S(e2)) {
137
- let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: b(n3), data: {} }, requestId: e2.requestId };
138
- return Ce(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
134
+ if (C(e2)) return xe(e2, t2, n2);
135
+ if (ve(e2)) return Ce(e2);
136
+ if (ye(e2)) {
137
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: x(n3), data: {} }, requestId: e2.requestId };
138
+ return Se(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
139
139
  }
140
- return Te(e2);
140
+ return we(e2);
141
141
  }
142
- var Se = (e2, t2, n2) => {
143
- let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Ee(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
144
- return Ce(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
142
+ var xe = (e2, t2, n2) => {
143
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Te(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
144
+ return Se(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
145
145
  };
146
- var Ce = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
147
- var we = (e2) => {
148
- let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? b(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
149
- return Ce(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
146
+ var Se = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
147
+ var Ce = (e2) => {
148
+ let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? x(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
149
+ return Se(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
150
150
  };
151
- var Te = (e2) => Ce(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: b(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
152
- var Ee = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
151
+ var we = (e2) => Se(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: x(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
152
+ var Te = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
153
153
  let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
154
154
  return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
155
155
  let r3 = t2[e3.field];
156
- if (r3) return { ...e3, field: C(r3, i2) };
156
+ if (r3) return { ...e3, field: Ee(r3, i2) };
157
157
  let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
158
158
  if (s2) {
159
159
  let t3 = a2[s2];
160
- if (t3) return { ...e3, field: e3.field.replace(s2, C(t3, i2)) };
160
+ if (t3) return { ...e3, field: e3.field.replace(s2, Ee(t3, i2)) };
161
161
  }
162
162
  return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
163
163
  });
164
164
  };
165
- var C = (e2, t2) => {
165
+ var Ee = (e2, t2) => {
166
166
  let n2 = De(e2);
167
167
  return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
168
168
  };
@@ -171,20 +171,20 @@ var De = (e2) => {
171
171
  return t2 && t2.groups && Number(t2.groups.argIndex);
172
172
  };
173
173
  function Oe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
174
- return pe(() => e2({ request: async (e3) => {
174
+ return fe(() => e2({ request: async (e3) => {
175
175
  let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
176
176
  a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
177
- let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? ie : o3}${a3.url}`;
177
+ let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? re : o3}${a3.url}`;
178
178
  a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
179
179
  try {
180
- let e4 = de(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
180
+ let e4 = ue(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
181
181
  if (s3.status !== 200) {
182
182
  let e5 = null;
183
183
  try {
184
184
  e5 = await s3.json();
185
185
  } catch {
186
186
  }
187
- let t3 = Ae(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = xe(t3);
187
+ let t3 = Ae(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = be(t3);
188
188
  throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
189
189
  }
190
190
  let l3 = await s3.json();
@@ -274,7 +274,7 @@ var Le = class {
274
274
  if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
275
275
  r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
276
276
  }, a2 = (e3, t3) => {
277
- let i3 = e3 in me ? me[e3] : void 0;
277
+ let i3 = e3 in pe ? pe[e3] : void 0;
278
278
  if (i3 && i3 in t3) {
279
279
  r2.push(i3), n2 = t3[i3];
280
280
  return;
@@ -351,7 +351,7 @@ function He() {
351
351
  };
352
352
  } };
353
353
  }
354
- _();
354
+ v();
355
355
  var Ue = (e2) => e2.__type === `event-definition`;
356
356
  function We(e2, t2, n2, r2) {
357
357
  let i2;
@@ -446,7 +446,7 @@ function qe(e2) {
446
446
  return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
447
447
  } } };
448
448
  }
449
- h(), _();
449
+ h(), v();
450
450
  var Je = `X-Wix-Consistent`;
451
451
  function Ye(e2) {
452
452
  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) => {
@@ -469,21 +469,21 @@ function Ye(e2) {
469
469
  throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
470
470
  }
471
471
  }, { client: c2, initModule: l2 } = qe(i2), { client: u2, initModule: d2 } = Ge(i2), f2 = async (n3, r3) => {
472
- let i3 = o2(), s3 = await a2(), c3 = se(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Je]: t2[Je] } : {} } }), u3 = Xe(l3);
472
+ let i3 = o2(), s3 = await a2(), c3 = oe(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Je]: t2[Je] } : {} } }), u3 = Xe(l3);
473
473
  return u3 && (t2[Je] = u3), l3;
474
474
  }, p2 = (t3, n3) => {
475
475
  if (Ue(t3)) return d2(t3);
476
476
  if (Ke(t3)) return l2(t3);
477
- if (ce(t3) && e2.host) return le(t3, e2.host);
477
+ if (se(t3) && e2.host) return ce(t3, e2.host);
478
478
  if (typeof t3 == `function`) {
479
479
  if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
480
480
  let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
481
- return Oe(pe(() => ne(t3)) ? te(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
481
+ return Oe(fe(() => te(t3)) ? ee(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
482
482
  let n4 = new URL(e3, `https://${r3}`);
483
483
  return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
484
484
  }, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
485
485
  }
486
- return y(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[re])])) : t3;
486
+ return b(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[ne])])) : t3;
487
487
  }, h2 = (e3) => {
488
488
  for (let n3 in e3) t2[n3] = e3[n3];
489
489
  };
@@ -497,7 +497,7 @@ function Ye(e2) {
497
497
  return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
498
498
  }, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
499
499
  let i3 = e2?.host?.apiBaseUrl ?? `www.wixapis.com`, a3 = await f2(`https://${i3}/graphql/${r3.apiVersion}`, { method: `POST`, headers: { "Content-Type": `application/json` }, body: JSON.stringify({ query: t3, variables: n3 }) });
500
- if (a3.status !== 200) throw new ae(`GraphQL request failed with status ${a3.status}`, a3);
500
+ if (a3.status !== 200) throw new ie(`GraphQL request failed with status ${a3.status}`, a3);
501
501
  let { data: o3, errors: s3 } = await a3.json();
502
502
  return { data: o3 ?? {}, errors: s3 };
503
503
  }, webhooks: u2, servicePlugins: c2 };
@@ -2300,82 +2300,82 @@ var yc = function(e2, t2, n2, r2) {
2300
2300
  var r3 = new B(Math.max(t3 * 2, e3));
2301
2301
  r3.set(n2), n2 = r3;
2302
2302
  }
2303
- }, u2 = t2.f || 0, d2 = t2.p || 0, f2 = t2.b || 0, p2 = t2.l, m2 = t2.d, h2 = t2.m, g2 = t2.n, ee2 = i2 * 8;
2303
+ }, u2 = t2.f || 0, d2 = t2.p || 0, f2 = t2.b || 0, p2 = t2.l, m2 = t2.d, h2 = t2.m, g2 = t2.n, _2 = i2 * 8;
2304
2304
  do {
2305
2305
  if (!p2) {
2306
2306
  u2 = H(e2, d2, 1);
2307
- var _2 = H(e2, d2 + 1, 3);
2308
- if (d2 += 3, !_2) {
2309
- var v2 = gc(d2) + 4, te2 = e2[v2 - 4] | e2[v2 - 3] << 8, ne2 = v2 + te2;
2310
- if (ne2 > i2) {
2307
+ var v2 = H(e2, d2 + 1, 3);
2308
+ if (d2 += 3, !v2) {
2309
+ var y2 = gc(d2) + 4, ee2 = e2[y2 - 4] | e2[y2 - 3] << 8, te2 = y2 + ee2;
2310
+ if (te2 > i2) {
2311
2311
  c2 && U(0);
2312
2312
  break;
2313
2313
  }
2314
- s2 && l2(f2 + te2), n2.set(e2.subarray(v2, ne2), f2), t2.b = f2 += te2, t2.p = d2 = ne2 * 8, t2.f = u2;
2314
+ s2 && l2(f2 + ee2), n2.set(e2.subarray(y2, te2), f2), t2.b = f2 += ee2, t2.p = d2 = te2 * 8, t2.f = u2;
2315
2315
  continue;
2316
2316
  }
2317
- if (_2 == 1) p2 = fc, m2 = pc, h2 = 9, g2 = 5;
2318
- else if (_2 == 2) {
2319
- var re2 = H(e2, d2, 31) + 257, ie2 = H(e2, d2 + 10, 15) + 4, ae2 = re2 + H(e2, d2 + 5, 31) + 1;
2317
+ if (v2 == 1) p2 = fc, m2 = pc, h2 = 9, g2 = 5;
2318
+ else if (v2 == 2) {
2319
+ var ne2 = H(e2, d2, 31) + 257, re2 = H(e2, d2 + 10, 15) + 4, ie2 = ne2 + H(e2, d2 + 5, 31) + 1;
2320
2320
  d2 += 14;
2321
- for (var oe2 = new B(ae2), se2 = new B(19), y2 = 0; y2 < ie2; ++y2) se2[ec[y2]] = H(e2, d2 + y2 * 3, 7);
2322
- d2 += ie2 * 3;
2323
- for (var ce2 = mc(se2), le2 = (1 << ce2) - 1, ue2 = lc(se2, ce2, 1), y2 = 0; y2 < ae2; ) {
2324
- var de2 = ue2[H(e2, d2, le2)];
2325
- d2 += de2 & 15;
2326
- var v2 = de2 >> 4;
2327
- if (v2 < 16) oe2[y2++] = v2;
2321
+ for (var ae2 = new B(ie2), oe2 = new B(19), b2 = 0; b2 < re2; ++b2) oe2[ec[b2]] = H(e2, d2 + b2 * 3, 7);
2322
+ d2 += re2 * 3;
2323
+ for (var se2 = mc(oe2), ce2 = (1 << se2) - 1, le2 = lc(oe2, se2, 1), b2 = 0; b2 < ie2; ) {
2324
+ var ue2 = le2[H(e2, d2, ce2)];
2325
+ d2 += ue2 & 15;
2326
+ var y2 = ue2 >> 4;
2327
+ if (y2 < 16) ae2[b2++] = y2;
2328
2328
  else {
2329
- var fe2 = 0, pe2 = 0;
2330
- for (v2 == 16 ? (pe2 = 3 + H(e2, d2, 3), d2 += 2, fe2 = oe2[y2 - 1]) : v2 == 17 ? (pe2 = 3 + H(e2, d2, 7), d2 += 3) : v2 == 18 && (pe2 = 11 + H(e2, d2, 127), d2 += 7); pe2--; ) oe2[y2++] = fe2;
2329
+ var de2 = 0, fe2 = 0;
2330
+ for (y2 == 16 ? (fe2 = 3 + H(e2, d2, 3), d2 += 2, de2 = ae2[b2 - 1]) : y2 == 17 ? (fe2 = 3 + H(e2, d2, 7), d2 += 3) : y2 == 18 && (fe2 = 11 + H(e2, d2, 127), d2 += 7); fe2--; ) ae2[b2++] = de2;
2331
2331
  }
2332
2332
  }
2333
- var me2 = oe2.subarray(0, re2), b2 = oe2.subarray(re2);
2334
- h2 = mc(me2), g2 = mc(b2), p2 = lc(me2, h2, 1), m2 = lc(b2, g2, 1);
2333
+ var pe2 = ae2.subarray(0, ne2), x2 = ae2.subarray(ne2);
2334
+ h2 = mc(pe2), g2 = mc(x2), p2 = lc(pe2, h2, 1), m2 = lc(x2, g2, 1);
2335
2335
  } else U(1);
2336
- if (d2 > ee2) {
2336
+ if (d2 > _2) {
2337
2337
  c2 && U(0);
2338
2338
  break;
2339
2339
  }
2340
2340
  }
2341
2341
  s2 && l2(f2 + 131072);
2342
- for (var he2 = (1 << h2) - 1, ge2 = (1 << g2) - 1, _e2 = d2; ; _e2 = d2) {
2343
- var fe2 = p2[hc(e2, d2) & he2], x2 = fe2 >> 4;
2344
- if (d2 += fe2 & 15, d2 > ee2) {
2342
+ for (var me2 = (1 << h2) - 1, he2 = (1 << g2) - 1, ge2 = d2; ; ge2 = d2) {
2343
+ var de2 = p2[hc(e2, d2) & me2], S2 = de2 >> 4;
2344
+ if (d2 += de2 & 15, d2 > _2) {
2345
2345
  c2 && U(0);
2346
2346
  break;
2347
2347
  }
2348
- if (fe2 || U(2), x2 < 256) n2[f2++] = x2;
2349
- else if (x2 == 256) {
2350
- _e2 = d2, p2 = null;
2348
+ if (de2 || U(2), S2 < 256) n2[f2++] = S2;
2349
+ else if (S2 == 256) {
2350
+ ge2 = d2, p2 = null;
2351
2351
  break;
2352
2352
  } else {
2353
- var ve2 = x2 - 254;
2354
- if (x2 > 264) {
2355
- var y2 = x2 - 257, ye2 = Qs[y2];
2356
- ve2 = H(e2, d2, (1 << ye2) - 1) + rc[y2], d2 += ye2;
2353
+ var _e2 = S2 - 254;
2354
+ if (S2 > 264) {
2355
+ var b2 = S2 - 257, C2 = Qs[b2];
2356
+ _e2 = H(e2, d2, (1 << C2) - 1) + rc[b2], d2 += C2;
2357
2357
  }
2358
- var be2 = m2[hc(e2, d2) & ge2], S2 = be2 >> 4;
2359
- be2 || U(3), d2 += be2 & 15;
2360
- var b2 = oc[S2];
2361
- if (S2 > 3) {
2362
- var ye2 = $s[S2];
2363
- b2 += hc(e2, d2) & (1 << ye2) - 1, d2 += ye2;
2358
+ var ve2 = m2[hc(e2, d2) & he2], ye2 = ve2 >> 4;
2359
+ ve2 || U(3), d2 += ve2 & 15;
2360
+ var x2 = oc[ye2];
2361
+ if (ye2 > 3) {
2362
+ var C2 = $s[ye2];
2363
+ x2 += hc(e2, d2) & (1 << C2) - 1, d2 += C2;
2364
2364
  }
2365
- if (d2 > ee2) {
2365
+ if (d2 > _2) {
2366
2366
  c2 && U(0);
2367
2367
  break;
2368
2368
  }
2369
2369
  s2 && l2(f2 + 131072);
2370
- var xe2 = f2 + ve2;
2371
- if (f2 < b2) {
2372
- var Se2 = a2 - b2, Ce2 = Math.min(b2, xe2);
2373
- for (Se2 + f2 < 0 && U(3); f2 < Ce2; ++f2) n2[f2] = r2[Se2 + f2];
2370
+ var be2 = f2 + _e2;
2371
+ if (f2 < x2) {
2372
+ var xe2 = a2 - x2, Se2 = Math.min(x2, be2);
2373
+ for (xe2 + f2 < 0 && U(3); f2 < Se2; ++f2) n2[f2] = r2[xe2 + f2];
2374
2374
  }
2375
- for (; f2 < xe2; ++f2) n2[f2] = n2[f2 - b2];
2375
+ for (; f2 < be2; ++f2) n2[f2] = n2[f2 - x2];
2376
2376
  }
2377
2377
  }
2378
- t2.l = p2, t2.p = _e2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
2378
+ t2.l = p2, t2.p = ge2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
2379
2379
  } while (!u2);
2380
2380
  return f2 != n2.length && o2 ? _c(n2, 0, f2) : n2.subarray(0, f2);
2381
2381
  };
@@ -2476,8 +2476,8 @@ function Fc(e2) {
2476
2476
  h2 && (n2.durationChoiceId = h2);
2477
2477
  let g2 = Dc(e2.dm);
2478
2478
  g2 !== void 0 && Number.isInteger(g2) && g2 > 0 && (n2.durationInMinutes = g2);
2479
- let ee2 = W(e2.rg);
2480
- return ee2 !== void 0 && Ec.has(ee2) && (n2.requestedGender = ee2), n2;
2479
+ let _2 = W(e2.rg);
2480
+ return _2 !== void 0 && Ec.has(_2) && (n2.requestedGender = _2), n2;
2481
2481
  }
2482
2482
  function Ic(e2) {
2483
2483
  if (!Ac(e2)) return null;
@@ -2508,7 +2508,7 @@ function zc(e2) {
2508
2508
  }
2509
2509
  var Bc = ((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))(Bc || {});
2510
2510
  var Vc = p({ Action: () => Fu, Actor: () => xu, AddOnPaymentOptions: () => Ql, AggregationType: () => Mu, BookingStatus: () => _u, ChargeType: () => $l, CloneErrors: () => Lu, CompletionRequirement: () => au, CrudType: () => Bu, DayOfWeek: () => Hu, DurationUnitType: () => hu, Event: () => zu, FirstChargeDateType: () => Zl, FrequencyType: () => Xl, IdentityType: () => Su, Interval: () => ju, InvalidSlugError: () => Iu, LocationType: () => fu, LocationTypeEnumLocationType: () => eu, MissingValues: () => Ou, Mode: () => Nu, MultiServiceBookingType: () => uu, NestedAggregationType: () => Au, PaymentStatus: () => vu, PlacementType: () => Vu, Platform: () => bu, PricingPlanOutcome: () => tu, RankingOrder: () => nu, RateType: () => Yl, RequestedFields: () => Pu, RequestedGender: () => mu, ResolutionMethod: () => Uu, ResourceTransparency: () => du, ScalarType: () => ku, SelectedPaymentOption: () => yu, SelectionMethod: () => pu, ServiceType: () => Jl, SortDirection: () => Du, SortOrder: () => Tu, SortType: () => Eu, SortingMethodType: () => ru, Status: () => Ru, TaxableAddressType: () => lu, TimeBoundariesType: () => su, Timing: () => iu, UnitType: () => ou, V2RequestedFields: () => wu, ValueType: () => gu, WebhookIdentityType: () => Cu, WorkingHoursMode: () => cu, bulkCreateServices: () => sf, bulkDeleteServices: () => pf, bulkDeleteServicesByFilter: () => mf, bulkUpdateServices: () => uf, bulkUpdateServicesByFilter: () => df, cloneService: () => Ef, countServices: () => vf, createAddOnGroup: () => Df, createService: () => of, deleteAddOnGroup: () => Of, deleteService: () => ff, disablePricingPlansForService: () => Cf, enablePricingPlansForService: () => Sf, getService: () => cf, listAddOnGroupsByServiceId: () => Af, onServiceCreated: () => Nf, onServiceDeleted: () => Pf, onServiceUpdated: () => Ff, queryBookingForms: () => _f, queryCategories: () => bf, queryLocations: () => yf, queryPolicies: () => gf, queryServices: () => Mf, searchServices: () => hf, setAddOnsForGroup: () => jf, setCustomSlug: () => wf, setServiceLocations: () => xf, updateAddOnGroup: () => kf, updateService: () => lf, utils: () => td, validateSlug: () => Tf });
2511
- dt(), jn(), Hr(), ni(), ft(), Tt(), _(), Gt(), yr(), En(), kn(), sr(), Er(), ei(), On(), Br();
2511
+ dt(), jn(), Hr(), ni(), ft(), Tt(), v(), Gt(), yr(), En(), kn(), sr(), Er(), ei(), On(), Br();
2512
2512
  var Hc = [{ path: `service.createdDate` }, { path: `service.updatedDate` }, { path: `service.media.items.image.urlExpirationDate` }, { path: `service.media.mainMedia.image.urlExpirationDate` }, { path: `service.media.coverMedia.image.urlExpirationDate` }, { path: `service.payment.subscription.recurringStartDate` }, { path: `service.bookingPolicy.createdDate` }, { path: `service.bookingPolicy.updatedDate` }, { path: `service.schedule.firstSessionStart` }, { path: `service.schedule.lastSessionEnd` }, { path: `service.staffMembers.mainMedia.image.urlExpirationDate` }, { path: `service.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate` }, { path: `service.supportedSlugs.createdDate` }, { path: `service.mainSlug.createdDate` }];
2513
2513
  var G = [{ path: `service.locations.business.address.geocode.latitude` }, { path: `service.locations.business.address.geocode.longitude` }, { path: `service.locations.custom.address.geocode.latitude` }, { path: `service.locations.custom.address.geocode.longitude` }, { path: `service.locations.calculatedAddress.geocode.latitude` }, { path: `service.locations.calculatedAddress.geocode.longitude` }];
2514
2514
  var Uc = [{ path: `services.createdDate` }, { path: `services.updatedDate` }, { path: `services.media.items.image.urlExpirationDate` }, { path: `services.media.mainMedia.image.urlExpirationDate` }, { path: `services.media.coverMedia.image.urlExpirationDate` }, { path: `services.payment.subscription.recurringStartDate` }, { path: `services.bookingPolicy.createdDate` }, { path: `services.bookingPolicy.updatedDate` }, { path: `services.schedule.firstSessionStart` }, { path: `services.schedule.lastSessionEnd` }, { path: `services.staffMembers.mainMedia.image.urlExpirationDate` }, { path: `services.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate` }, { path: `services.supportedSlugs.createdDate` }, { path: `services.mainSlug.createdDate` }];
@@ -3849,11 +3849,11 @@ var kh = () => {
3849
3849
  }, [m2, r2]), g2 = t((e3, t2) => {
3850
3850
  let n3 = m2(e3, t2);
3851
3851
  n3 && s2(n3);
3852
- }, [m2, s2]), ee2 = t(() => f2(Ho.FORM_PAGE) || void 0, [f2]), _2 = t((e3) => Object.values(o2(rr).pages).some((t2) => t2.appPageId === e3 && (!t2.appDefinitionId || t2.appDefinitionId === `1380b703-ce81-ff05-f115-39571d94dfcd`)) && n2.appSectionRelativeUrl(`1380b703-ce81-ff05-f115-39571d94dfcd`, e3) || void 0, [n2, o2]);
3853
- return { navigate: s2, navigateToHref: u2, resolvePath: m2, toHref: d2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: ee2, getCartPagePath: t(() => _2(zo), [_2]), getThankYouPagePath: t((e3) => {
3854
- let t2 = _2(Bo);
3852
+ }, [m2, s2]), _2 = t(() => f2(Ho.FORM_PAGE) || void 0, [f2]), v2 = t((e3) => Object.values(o2(rr).pages).some((t2) => t2.appPageId === e3 && (!t2.appDefinitionId || t2.appDefinitionId === `1380b703-ce81-ff05-f115-39571d94dfcd`)) && n2.appSectionRelativeUrl(`1380b703-ce81-ff05-f115-39571d94dfcd`, e3) || void 0, [n2, o2]);
3853
+ return { navigate: s2, navigateToHref: u2, resolvePath: m2, toHref: d2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: t(() => v2(zo), [v2]), getThankYouPagePath: t((e3) => {
3854
+ let t2 = v2(Bo);
3855
3855
  return t2 ? `${t2}/${e3}?origin=bookings` : void 0;
3856
- }, [_2]) };
3856
+ }, [v2]) };
3857
3857
  };
3858
3858
  function Ah(e2) {
3859
3859
  r(() => {
@@ -3912,105 +3912,105 @@ function Vh(e2) {
3912
3912
  return t2 && !ip(e2).valid ? false : e2.services.every((n2) => n2.serviceType ? ep(n2.serviceType) ? !t2 && !!n2.scheduleId : !cp(n2) || !e2.timezone ? false : t2 ? !!n2.scheduleId : !!(n2.scheduleId || n2.sessionId) : false);
3913
3913
  }
3914
3914
  function Hh() {
3915
- let { search: e2, href: n2, getRelativeUrl: s2 } = Fo(), l2 = i(() => zc(new URLSearchParams(e2)), [e2]), u2 = l2 ? JSON.stringify({ timezone: l2.timezone, services: l2.services }) : null, d2 = a(null), [f2, p2] = o(false), [m2, h2] = o(false), [g2, ee2] = o(null), _2 = t((e3, t2) => {
3915
+ let { search: e2, href: n2, getRelativeUrl: s2 } = Fo(), l2 = i(() => zc(new URLSearchParams(e2)), [e2]), u2 = l2 ? JSON.stringify({ timezone: l2.timezone, services: l2.services }) : null, d2 = a(null), [f2, p2] = o(false), [m2, h2] = o(false), [g2, _2] = o(null), v2 = t((e3, t2) => {
3916
3916
  let n3 = { selectionKey: u2, options: e3, isPlanAndBookBlocked: t2 };
3917
- return ee2(n3), () => ee2((e4) => e4 === n3 ? null : e4);
3918
- }, [u2]), v2 = t((e3) => {
3917
+ return _2(n3), () => _2((e4) => e4 === n3 ? null : e4);
3918
+ }, [u2]), y2 = t((e3) => {
3919
3919
  d2.current = e3, p2(e3 !== null), h2(e3?.hasCartConflict === true);
3920
- }, []), te2 = u2 && g2?.selectionKey === u2 ? g2 : null, ne2 = te2?.options ?? null, re2 = te2 !== null && te2.options === null, ie2 = $p(ne2, te2?.isPlanAndBookBlocked ?? false), ae2 = Vh(l2) && f2, [oe2, se2] = o(null), y2 = t((e3) => {
3921
- se2((t2) => JSON.stringify(t2) === JSON.stringify(e3) ? t2 : e3);
3922
- }, []), [ce2, le2] = o(false), [ue2, de2] = o(1), fe2 = t((e3) => {
3923
- de2(Rh(e3));
3924
- }, []), [pe2, me2] = o(false), [b2, he2] = o(null), [ge2, _e2] = o(null), x2 = JSON.stringify([u2, ue2]), ve2 = a({ key: x2, count: 0 });
3925
- ve2.current.key !== x2 && (ve2.current = { key: x2, count: ve2.current.count + 1 }), r(() => {
3926
- he2(null), _e2(null);
3927
- }, [x2]);
3928
- let [ye2, be2] = o(null), S2 = a(false), xe2 = a(/* @__PURE__ */ new Map()), Se2 = c(), Ce2 = t((e3, t2 = []) => Se2(Co).callPublicApi(Ro, e3, t2), [Se2]), we2 = t(async () => {
3920
+ }, []), ee2 = u2 && g2?.selectionKey === u2 ? g2 : null, te2 = ee2?.options ?? null, ne2 = ee2 !== null && ee2.options === null, re2 = $p(te2, ee2?.isPlanAndBookBlocked ?? false), ie2 = Vh(l2) && f2, [ae2, oe2] = o(null), b2 = t((e3) => {
3921
+ oe2((t2) => JSON.stringify(t2) === JSON.stringify(e3) ? t2 : e3);
3922
+ }, []), [se2, ce2] = o(false), [le2, ue2] = o(1), de2 = t((e3) => {
3923
+ ue2(Rh(e3));
3924
+ }, []), [fe2, pe2] = o(false), [x2, me2] = o(null), [he2, ge2] = o(null), S2 = JSON.stringify([u2, le2]), _e2 = a({ key: S2, count: 0 });
3925
+ _e2.current.key !== S2 && (_e2.current = { key: S2, count: _e2.current.count + 1 }), r(() => {
3926
+ me2(null), ge2(null);
3927
+ }, [S2]);
3928
+ let C2 = a(false), ve2 = a(/* @__PURE__ */ new Map()), ye2 = c(), be2 = t((e3, t2 = []) => ye2(Co).callPublicApi(Ro, e3, t2), [ye2]), xe2 = t(async () => {
3929
3929
  try {
3930
- return await Ce2(`cart.hasSideCart`) ? (await Ce2(`cart.openSideCart`), true) : false;
3930
+ return await be2(`cart.hasSideCart`) ? (await be2(`cart.openSideCart`), true) : false;
3931
3931
  } catch (e3) {
3932
3932
  return ds(e3, { feature: ls.bookingCheckout, action: `openSideCart` }), false;
3933
3933
  }
3934
- }, [Ce2]), Te2 = xo(), Ee2 = Go(Uo.BOOKING_CHECKOUT), C2 = t((e3) => {
3934
+ }, [be2]), Se2 = xo(), Ce2 = Go(Uo.BOOKING_CHECKOUT), we2 = t((e3) => {
3935
3935
  try {
3936
- Ee2(e3());
3936
+ Ce2(e3());
3937
3937
  } catch {
3938
3938
  }
3939
- }, [Ee2]), { navigate: De2, navigateToHref: Oe2, getCartPagePath: ke2, getBookingFormPath: Ae2, getThankYouPagePath: je2 } = kh(), Me2 = t(async () => {
3939
+ }, [Ce2]), { navigate: Te2, navigateToHref: Ee2, getCartPagePath: De2, getBookingFormPath: Oe2, getThankYouPagePath: ke2 } = kh(), Ae2 = t(async () => {
3940
3940
  let t2 = d2.current;
3941
- if (S2.current || C2(() => Xn({})), !l2 || !t2 || !ae2 || S2.current) return null;
3942
- let { route: r2 } = ie2;
3943
- S2.current = true;
3944
- let i2 = ve2.current;
3945
- he2(null), _e2(null);
3941
+ if (C2.current || we2(() => Xn({})), !l2 || !t2 || !ie2 || C2.current) return null;
3942
+ let { route: r2 } = re2;
3943
+ C2.current = true;
3944
+ let i2 = _e2.current;
3945
+ me2(null), ge2(null);
3946
3946
  try {
3947
- if (!await t2.validate()) return S2.current = false, null;
3948
- if (me2(true), r2 === Z.PRICING_PLANS) {
3949
- C2(() => zh(t2, Bh[r2]));
3950
- let i4 = new URLSearchParams(e2).get(`referral`) ?? `bookings-form`, a3 = lm(Qp(ne2 ?? []), { href: n2, pathname: s2().slice(1), search: e2, formSectionPath: Ae2() }, i4);
3951
- return a3.page === `plan` ? await Te2.navigateToPlanPage(a3.options) : await Te2.navigateToPricingPage(a3.options), S2.current = false, me2(false), null;
3947
+ if (!await t2.validate()) return C2.current = false, null;
3948
+ if (pe2(true), r2 === Z.PRICING_PLANS) {
3949
+ we2(() => zh(t2, Bh[r2]));
3950
+ let i4 = new URLSearchParams(e2).get(`referral`) ?? `bookings-form`, a3 = lm(Qp(te2 ?? []), { href: n2, pathname: s2().slice(1), search: e2, formSectionPath: Oe2() }, i4);
3951
+ return a3.page === `plan` ? await Se2.navigateToPlanPage(a3.options) : await Se2.navigateToPricingPage(a3.options), C2.current = false, pe2(false), null;
3952
3952
  }
3953
- let i3 = await Lh(t2, l2, ue2);
3954
- fs({ message: `Create booking`, category: `ui.submit`, feature: ls.bookingCheckout, data: { services: l2.services.length } }), C2(() => zh(t2, Bh[r2]));
3955
- let a2 = await Fh(xe2.current, l2, i3, `checkout`), o2 = a2.bookingIds ?? [], c2 = Ih(a2, l2), u3 = { lines: c2, customer: a2.input.contactDetails, businessLocationId: Sp(l2) }, d3 = Zp(a2.input.payments.map(({ purchase: e3 }) => e3));
3956
- r2 === Z.DETAILS_PAGE ? a2.cartId ??= await tm(u3) : r2 === Z.INLINE_CART ? a2.cartId ??= await nm({ ...u3, purchases: d3 }) : a2.cartId ??= await Ip(u3);
3957
- let { cartId: f3 } = a2;
3958
- if (be2({ bookingIds: o2, cartId: f3 }), r2 === Z.DETAILS_PAGE) return window.location.assign(om(d3[0], f3, c2)), null;
3959
- if (r2 === Z.CHECKOUT && (a2.placesOrder ||= await Up(a2.input, Hp(l2.wantsPromoCode, oe2?.payments), () => Lp(f3)), a2.placesOrder && (a2.orderId ??= await zp(f3))), a2.orderId) {
3960
- let e3 = je2(a2.orderId);
3953
+ let i3 = await Lh(t2, l2, le2);
3954
+ fs({ message: `Create booking`, category: `ui.submit`, feature: ls.bookingCheckout, data: { services: l2.services.length } }), we2(() => zh(t2, Bh[r2]));
3955
+ let a2 = await Fh(ve2.current, l2, i3, `checkout`), o2 = Ih(a2, l2), c2 = { lines: o2, customer: a2.input.contactDetails, businessLocationId: Sp(l2) }, u3 = Zp(a2.input.payments.map(({ purchase: e3 }) => e3));
3956
+ r2 === Z.DETAILS_PAGE ? a2.cartId ??= await tm(c2) : r2 === Z.INLINE_CART ? a2.cartId ??= await nm({ ...c2, purchases: u3 }) : a2.cartId ??= await Ip(c2);
3957
+ let { cartId: d3 } = a2;
3958
+ if (r2 === Z.DETAILS_PAGE) return window.location.assign(om(u3[0], d3, o2)), null;
3959
+ if (r2 === Z.CHECKOUT && (a2.placesOrder ||= await Up(a2.input, Hp(l2.wantsPromoCode, ae2?.payments), () => Lp(d3)), a2.placesOrder && (a2.orderId ??= await zp(d3))), a2.orderId) {
3960
+ let e3 = ke2(a2.orderId);
3961
3961
  if (!e3) throw Error(`No eCom Thank You page on the site`);
3962
- await De2(e3);
3963
- } else window.location.assign(await Bp(f3));
3962
+ await Te2(e3);
3963
+ } else window.location.assign(await Bp(d3));
3964
3964
  return null;
3965
3965
  } catch (e3) {
3966
3966
  let t3 = Ph(e3);
3967
- return S2.current = false, me2(false), ds(e3, { feature: ls.bookingCheckout, action: `createBooking` }), C2(() => Qn({ errorReason: Zo(e3) })), ve2.current === i2 ? (he2(t3), { error: t3 }) : null;
3967
+ return C2.current = false, pe2(false), ds(e3, { feature: ls.bookingCheckout, action: `createBooking` }), we2(() => Qn({ errorReason: Zo(e3) })), _e2.current === i2 ? (me2(t3), { error: t3 }) : null;
3968
3968
  }
3969
- }, [l2, ae2, ie2, ne2, oe2, ue2, C2, Te2, De2, je2, e2, n2, s2, Ae2]), [Ne2, Pe2] = o(false);
3969
+ }, [l2, ie2, re2, te2, ae2, le2, we2, Se2, Te2, ke2, e2, n2, s2, Oe2]), [je2, Me2] = o(false);
3970
3970
  Ah(t(() => {
3971
- S2.current = false, me2(false), Pe2(false);
3971
+ C2.current = false, pe2(false), Me2(false);
3972
3972
  }, []));
3973
- let Fe2 = t(async (e3 = `cart`) => {
3973
+ let Ne2 = t(async (e3 = `cart`) => {
3974
3974
  let t2 = d2.current;
3975
- if (S2.current || C2(() => Xn({})), !l2 || !t2 || ie2.cta !== Wp.BOOK || t2.hasCartConflict || !ae2 || S2.current) return null;
3976
- S2.current = true;
3977
- let n3 = ve2.current;
3978
- _e2(null), he2(null);
3975
+ if (C2.current || we2(() => Xn({})), !l2 || !t2 || re2.cta !== Wp.BOOK || m2 || !ie2 || C2.current) return null;
3976
+ C2.current = true;
3977
+ let n3 = _e2.current;
3978
+ ge2(null), me2(null);
3979
3979
  try {
3980
- if (!await t2.validate()) return S2.current = false, null;
3981
- Pe2(true);
3982
- let n4 = await Lh(t2, l2, ue2);
3983
- fs({ message: `Add to cart`, category: `ui.submit`, feature: ls.bookingCheckout, data: { services: l2.services.length } }), C2(() => zh(t2, qo.ADD_TO_CART));
3980
+ if (!await t2.validate()) return C2.current = false, null;
3981
+ Me2(true);
3982
+ let n4 = await Lh(t2, l2, le2);
3983
+ fs({ message: `Add to cart`, category: `ui.submit`, feature: ls.bookingCheckout, data: { services: l2.services.length } }), we2(() => zh(t2, qo.ADD_TO_CART));
3984
3984
  let r2 = Sp(l2), i2 = r2 ? await um().catch(() => void 0) : void 0;
3985
3985
  if (i2 && i2 !== r2) throw Object.assign(Error(`The cart is at a different business location`), { details: { applicationError: { code: jh } } });
3986
- let a2 = await Fh(xe2.current, l2, n4, `cart`), o2 = a2.bookingIds ?? [];
3986
+ let a2 = await Fh(ve2.current, l2, n4, `cart`), o2 = a2.bookingIds ?? [];
3987
3987
  if (!a2.addedToCart) {
3988
3988
  let e4 = await dm(Ih(a2, l2));
3989
- a2.addedToCart = true, e4.cartId && be2({ bookingIds: o2, cartId: e4.cartId });
3989
+ a2.addedToCart = true;
3990
3990
  let t3 = r2 && !e4.locationId ? r2 : void 0, n5 = e4.bookingItemIds.length > 0 && e4.lineCount === e4.bookingItemIds.length && e4.bookingItemIds.every((e5) => o2.includes(e5)) ? a2.input.contactDetails : void 0;
3991
3991
  (t3 || n5) && (a2.cartUpdate = fm({ locationId: t3, customer: n5 }).catch((e5) => ds(e5, { feature: ls.bookingCheckout, action: `addToCart` })));
3992
3992
  }
3993
3993
  let s3 = Promise.all([a2.cartUpdate, (async () => {
3994
3994
  try {
3995
- await Ce2(`cart.reloadCart`);
3995
+ await be2(`cart.reloadCart`);
3996
3996
  } catch {
3997
3997
  }
3998
3998
  })()]);
3999
3999
  e3 !== `stay` && await s3;
4000
- let c2 = e3 === `cart` ? ke2() : void 0, u3 = true;
4001
- return c2 ? await De2(c2) : e3 === `cart` ? (u3 = false, await we2() || ds(Error(`The site has no eCom Cart page or side cart`), { feature: ls.bookingCheckout, action: `addToCart` })) : e3 === `home` ? await De2(`/`) : typeof e3 == `object` ? (await Oe2(e3), u3 = !Th(e3)) : u3 = false, u3 || (S2.current = false, Pe2(false)), { bookingIds: o2, leavesPage: u3 };
4000
+ let c2 = e3 === `cart` ? De2() : void 0, u3 = true;
4001
+ return c2 ? await Te2(c2) : e3 === `cart` ? (u3 = false, await xe2() || ds(Error(`The site has no eCom Cart page or side cart`), { feature: ls.bookingCheckout, action: `addToCart` })) : e3 === `home` ? await Te2(`/`) : typeof e3 == `object` ? (await Ee2(e3), u3 = !Th(e3)) : u3 = false, u3 || (C2.current = false, Me2(false)), { bookingIds: o2, leavesPage: u3 };
4002
4002
  } catch (e4) {
4003
4003
  let t3 = Ph(e4);
4004
- return S2.current = false, Pe2(false), ds(e4, { feature: ls.bookingCheckout, action: `addToCart` }), C2(() => Qn({ errorReason: Zo(e4) })), ve2.current === n3 ? (_e2(t3), { error: t3 }) : null;
4004
+ return C2.current = false, Me2(false), ds(e4, { feature: ls.bookingCheckout, action: `addToCart` }), we2(() => Qn({ errorReason: Zo(e4) })), _e2.current === n3 ? (ge2(t3), { error: t3 }) : null;
4005
4005
  }
4006
- }, [l2, ae2, ie2, ue2, De2, Oe2, ke2, we2, Ce2, C2]);
4007
- return i(() => ({ selection: l2, canBook: ae2, planAndBookFlow: ie2, selectedPaymentOptions: ne2, isLoadingPaymentOptions: re2, registerPaymentOptions: _2, hasCartConflict: m2, registerForm: v2, formFacts: oe2, publishFormFacts: y2, isFormEmptyState: ce2, publishFormEmptyState: le2, createBooking: Me2, isCreating: pe2, createError: b2, addToCart: Fe2, isAddingToCart: Ne2, addToCartError: ge2, participants: ue2, setParticipants: fe2, lastResult: ye2 }), [l2, ae2, ie2, ne2, re2, _2, m2, v2, oe2, y2, ce2, le2, Me2, pe2, b2, Fe2, Ne2, ge2, ue2, fe2, ye2]);
4006
+ }, [l2, ie2, re2, m2, le2, Te2, Ee2, De2, xe2, be2, we2]);
4007
+ return i(() => ({ selection: l2, canBook: ie2, planAndBookFlow: re2, selectedPaymentOptions: te2, isLoadingPaymentOptions: ne2, registerPaymentOptions: v2, hasCartConflict: m2, registerForm: y2, formFacts: ae2, publishFormFacts: b2, isFormEmptyState: se2, publishFormEmptyState: ce2, createBooking: Ae2, isCreating: fe2, createError: x2, addToCart: Ne2, isAddingToCart: je2, addToCartError: he2, participants: le2, setParticipants: de2 }), [l2, ie2, re2, te2, ne2, v2, m2, y2, ae2, b2, se2, ce2, Ae2, fe2, x2, Ne2, je2, he2, le2, de2]);
4008
4008
  }
4009
- var Uh = e(null);
4010
- var Wh = `useBookingCheckoutContext must be used within BookingCheckoutContextProvider`;
4009
+ var Uh = `useBookingCheckoutContext must be used within BookingCheckoutContextProvider`;
4010
+ var Wh = e(null);
4011
4011
  function Gh(e2 = false) {
4012
- let t2 = n(Uh);
4013
- if (!t2 && !e2) throw Error(Wh);
4012
+ let t2 = n(Wh);
4013
+ if (!t2 && !e2) throw Error(Uh);
4014
4014
  return t2;
4015
4015
  }
4016
4016
  function Kh({ children: e2 }) {
@@ -4019,14 +4019,11 @@ function Kh({ children: e2 }) {
4019
4019
  let n2 = Go(Uo.BOOKING_CHECKOUT), i2 = Vh(t2.selection), o2 = t2.selection?.services.length ?? 0, s2 = a(false);
4020
4020
  return r(() => {
4021
4021
  !s2.current && i2 && (s2.current = true, n2($n({ numberOfServices: o2 })));
4022
- }, [n2, i2, o2]), u(Uh.Provider, { value: t2, children: e2 });
4022
+ }, [n2, i2, o2]), u(Wh.Provider, { value: t2, children: e2 });
4023
4023
  }
4024
4024
  var qh = Yn(`216f9b1c-cb6d-4299-b97d-d3c0e2600b88`);
4025
4025
  export {
4026
- Wh as BOOKING_CHECKOUT_CONTEXT_MISSING_PROVIDER_ERROR,
4027
4026
  Kh as BookingCheckoutContextProvider,
4028
- Uh as bookingCheckoutContext,
4029
- Vh as canBookSelection,
4030
4027
  Kh as default,
4031
4028
  qh as injectAccessTokenGetter,
4032
4029
  Gh as useBookingCheckoutContext