@wix/bookings 1.0.1786 → 1.0.1787
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context-booking-checkout.d.ts +22 -6
- package/build/cjs/context-booking-checkout.js +2296 -2253
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.js +285 -275
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.js +465 -455
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.js +964 -917
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +14 -5
- package/build/cjs/context-service.js +3514 -3337
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.js +878 -832
- package/build/cjs/context-services.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +10 -0
- package/build/cjs/context-time-slots.js +1202 -1159
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +22 -6
- package/build/es/context-booking-checkout.mjs +2304 -2261
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.mjs +285 -275
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.mjs +465 -455
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.mjs +971 -924
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +14 -5
- package/build/es/context-service.mjs +3383 -3206
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.mjs +878 -832
- package/build/es/context-services.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +10 -0
- package/build/es/context-time-slots.mjs +1222 -1179
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +22 -6
- package/build/internal/cjs/context-service.d.ts +14 -5
- package/build/internal/cjs/context-time-slots.d.ts +10 -0
- package/build/internal/es/context-booking-checkout.d.mts +22 -6
- package/build/internal/es/context-service.d.mts +14 -5
- package/build/internal/es/context-time-slots.d.mts +10 -0
- package/context-runtime/context-booking-checkout/runtime.d.ts +22 -6
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-categories/runtime.js +2 -2
- package/context-runtime/context-locations/runtime.js +2 -2
- package/context-runtime/context-service/runtime.d.ts +14 -5
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-service-addons/runtime.js +2 -2
- package/context-runtime/context-services/runtime.js +3 -3
- package/context-runtime/context-time-slots/runtime.d.ts +10 -0
- package/context-runtime/context-time-slots/runtime.js +3 -3
- package/package.json +2 -2
|
@@ -20,11 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-time-slots.ts
|
|
21
21
|
var context_time_slots_exports = {};
|
|
22
22
|
__export(context_time_slots_exports, {
|
|
23
|
-
TimeSlotsContextProvider: () =>
|
|
24
|
-
default: () =>
|
|
25
|
-
injectAccessTokenGetter: () =>
|
|
26
|
-
timeSlotsContext: () =>
|
|
27
|
-
useTimeSlotsContext: () =>
|
|
23
|
+
TimeSlotsContextProvider: () => ou,
|
|
24
|
+
default: () => ou,
|
|
25
|
+
injectAccessTokenGetter: () => uu,
|
|
26
|
+
timeSlotsContext: () => tu,
|
|
27
|
+
useTimeSlotsContext: () => nu
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(context_time_slots_exports);
|
|
30
30
|
|
|
@@ -33,11 +33,11 @@ var import_react = require("react");
|
|
|
33
33
|
var import_service = require("@wix/bookings/context/service");
|
|
34
34
|
var import_services_manager_react = require("@wix/services-manager-react");
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var
|
|
37
|
-
function
|
|
36
|
+
var h = {};
|
|
37
|
+
function g(e2, t2 = false, n2 = (e3) => e3) {
|
|
38
38
|
return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var _ = (e2) => {
|
|
41
41
|
switch (e2) {
|
|
42
42
|
case `get`:
|
|
43
43
|
case `GET`:
|
|
@@ -64,11 +64,11 @@ var g = (e2) => {
|
|
|
64
64
|
throw Error(`Unknown method: ${e2}`);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
var
|
|
67
|
+
var v = (e2) => (t2) => async (n2) => {
|
|
68
68
|
let r2, i2 = (t3) => {
|
|
69
69
|
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.`);
|
|
70
70
|
let { method: i3, url: a2, params: o2 } = r2;
|
|
71
|
-
return { ...r2, method:
|
|
71
|
+
return { ...r2, method: _(i3), url: a2, data: r2.data, params: o2 };
|
|
72
72
|
};
|
|
73
73
|
try {
|
|
74
74
|
let e3 = await t2.request(i2);
|
|
@@ -81,10 +81,10 @@ var _ = (e2) => (t2) => async (n2) => {
|
|
|
81
81
|
throw typeof e3 == `object` && e3 && `response` in e3 && typeof e3.response == `object` && e3.response !== null && `data` in e3.response ? e3.response.data : e3;
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
84
|
+
var y = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
|
|
85
|
+
var b = `__metadata`;
|
|
86
|
+
var x = `edge.wixapis.com`;
|
|
87
|
+
var S = class extends Error {
|
|
88
88
|
message;
|
|
89
89
|
response;
|
|
90
90
|
constructor(e2, t2) {
|
|
@@ -92,58 +92,58 @@ var x = class extends Error {
|
|
|
92
92
|
}
|
|
93
93
|
async details() {
|
|
94
94
|
let e2 = await this.response.json();
|
|
95
|
-
return
|
|
95
|
+
return C(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
function
|
|
98
|
+
var C = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
99
|
+
var w = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
|
|
100
|
+
var T = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
|
|
101
|
+
var E = (e2) => e2.__type === `host`;
|
|
102
|
+
function D(e2, t2) {
|
|
103
103
|
return e2.create(t2);
|
|
104
104
|
}
|
|
105
|
-
var
|
|
106
|
-
function
|
|
107
|
-
return { [
|
|
105
|
+
var O = `x-wix-bi-gateway`;
|
|
106
|
+
function ee(e2, t2, n2) {
|
|
107
|
+
return { [O]: te({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
|
|
108
108
|
}
|
|
109
109
|
function te(e2) {
|
|
110
110
|
return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
114
|
-
globalThis.__wix_context__ = void 0,
|
|
112
|
+
function k(e2) {
|
|
113
|
+
let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
|
|
114
|
+
globalThis.__wix_context__ = void 0, h.client = void 0, h.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
115
115
|
try {
|
|
116
116
|
return e2();
|
|
117
117
|
} finally {
|
|
118
|
-
globalThis.__wix_context__ = t2,
|
|
118
|
+
globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
var
|
|
122
|
-
function k(e2) {
|
|
123
|
-
return j(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
124
|
-
}
|
|
125
|
-
var re = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
126
|
-
var ie = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
127
|
-
var A = `$1\0$2`;
|
|
128
|
-
var ae = /[^\p{L}\d]+/giu;
|
|
121
|
+
var A = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
129
122
|
function j(e2) {
|
|
123
|
+
return ie(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
124
|
+
}
|
|
125
|
+
var ne = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
126
|
+
var M = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
127
|
+
var re = `$1\0$2`;
|
|
128
|
+
var N = /[^\p{L}\d]+/giu;
|
|
129
|
+
function ie(e2) {
|
|
130
130
|
let t2 = e2.trim();
|
|
131
|
-
t2 = t2.replace(
|
|
131
|
+
t2 = t2.replace(ne, re).replace(M, re), t2 = t2.replace(N, `\0`);
|
|
132
132
|
let n2 = 0, r2 = t2.length;
|
|
133
133
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
134
134
|
if (n2 === r2) return [];
|
|
135
135
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
136
136
|
return t2.slice(n2, r2).split(/\0/g);
|
|
137
137
|
}
|
|
138
|
-
var
|
|
139
|
-
var
|
|
138
|
+
var ae = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
139
|
+
var oe = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
140
140
|
var se = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
141
|
-
function
|
|
141
|
+
function P(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
142
142
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
143
|
-
if (
|
|
144
|
-
if (
|
|
143
|
+
if (ae(e2)) return ce(e2, t2, n2);
|
|
144
|
+
if (oe(e2)) return ue(e2);
|
|
145
145
|
if (se(e2)) {
|
|
146
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
146
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: j(n3), data: {} }, requestId: e2.requestId };
|
|
147
147
|
return le(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
148
148
|
}
|
|
149
149
|
return de(e2);
|
|
@@ -154,10 +154,10 @@ var ce = (e2, t2, n2) => {
|
|
|
154
154
|
};
|
|
155
155
|
var le = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
156
156
|
var ue = (e2) => {
|
|
157
|
-
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 ??
|
|
157
|
+
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 ?? j(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 };
|
|
158
158
|
return le(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
159
159
|
};
|
|
160
|
-
var de = (e2) => le(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:
|
|
160
|
+
var de = (e2) => le(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: j(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
161
161
|
var fe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
162
162
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
163
163
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
@@ -172,28 +172,28 @@ var fe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgu
|
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
174
|
var pe = (e2, t2) => {
|
|
175
|
-
let n2 =
|
|
175
|
+
let n2 = F(e2);
|
|
176
176
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
177
177
|
};
|
|
178
|
-
var
|
|
178
|
+
var F = (e2) => {
|
|
179
179
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
180
180
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
181
181
|
};
|
|
182
182
|
function me(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
183
|
-
return
|
|
183
|
+
return k(() => e2({ request: async (e3) => {
|
|
184
184
|
let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
185
185
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
186
|
-
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ?
|
|
186
|
+
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? x : o3}${a3.url}`;
|
|
187
187
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
188
188
|
try {
|
|
189
|
-
let e4 =
|
|
189
|
+
let e4 = ee(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
|
|
190
190
|
if (s3.status !== 200) {
|
|
191
191
|
let e5 = null;
|
|
192
192
|
try {
|
|
193
193
|
e5 = await s3.json();
|
|
194
194
|
} catch {
|
|
195
195
|
}
|
|
196
|
-
let t3 = ge(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 =
|
|
196
|
+
let t3 = ge(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = P(t3);
|
|
197
197
|
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
198
198
|
}
|
|
199
199
|
let l3 = await s3.json();
|
|
@@ -211,8 +211,8 @@ var he = class extends Error {
|
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
213
|
var ge = (e2, t2, n2, r2) => new he({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
|
|
214
|
-
var
|
|
215
|
-
function
|
|
214
|
+
var _e = `.`;
|
|
215
|
+
function I(e2, t2, n2) {
|
|
216
216
|
if (e2 == null) throw Error(`Cannot set value on null or undefined`);
|
|
217
217
|
let r2 = ve(t2), i2 = e2;
|
|
218
218
|
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
@@ -227,14 +227,14 @@ function _e(e2, t2, n2) {
|
|
|
227
227
|
return e2;
|
|
228
228
|
}
|
|
229
229
|
function ve(e2) {
|
|
230
|
-
return Array.isArray(e2) ? e2 : e2.split(
|
|
230
|
+
return Array.isArray(e2) ? e2 : e2.split(_e).map((e3) => ye(e3) ? Number(e3) : e3);
|
|
231
231
|
}
|
|
232
232
|
function ye(e2) {
|
|
233
233
|
return /^\d+$/.test(e2);
|
|
234
234
|
}
|
|
235
235
|
function be(e2) {
|
|
236
236
|
let t2 = {};
|
|
237
|
-
for (let [n2, r2] of Object.entries(e2)) xe(n2) ||
|
|
237
|
+
for (let [n2, r2] of Object.entries(e2)) xe(n2) || I(t2, ve(n2), r2);
|
|
238
238
|
return t2;
|
|
239
239
|
}
|
|
240
240
|
function xe(e2) {
|
|
@@ -283,7 +283,7 @@ var Se = class {
|
|
|
283
283
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
284
284
|
r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
|
|
285
285
|
}, a2 = (e3, t3) => {
|
|
286
|
-
let i3 = e3 in
|
|
286
|
+
let i3 = e3 in A ? A[e3] : void 0;
|
|
287
287
|
if (i3 && i3 in t3) {
|
|
288
288
|
r2.push(i3), n2 = t3[i3];
|
|
289
289
|
return;
|
|
@@ -409,7 +409,7 @@ function Ae(e2) {
|
|
|
409
409
|
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e3.eventType)) throw Error(`Unexpected event type: ${e3.eventType}. Expected one of: ${n3.map((e4) => e4.type).join(`, `)}`);
|
|
410
410
|
let r2 = t2.get(e3.eventType) ?? [];
|
|
411
411
|
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => ke(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
|
|
412
|
-
}, apps: { AppInstalled:
|
|
412
|
+
}, apps: { AppInstalled: g(`AppInstalled`)(), AppRemoved: g(`AppRemoved`)() } } };
|
|
413
413
|
}
|
|
414
414
|
var je = (e2) => e2.__type === `service-plugin-definition`;
|
|
415
415
|
function Me(e2) {
|
|
@@ -476,35 +476,35 @@ function Pe(e2) {
|
|
|
476
476
|
throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
|
|
477
477
|
}
|
|
478
478
|
}, { client: c2, initModule: l2 } = Me(i2), { client: u2, initModule: d2 } = Ae(i2), f2 = async (n3, r3) => {
|
|
479
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
479
|
+
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`] ? { [Ne]: t2[Ne] } : {} } }), u3 = Fe(l3);
|
|
480
480
|
return u3 && (t2[Ne] = u3), l3;
|
|
481
481
|
}, p2 = (t3, n3) => {
|
|
482
482
|
if (Oe(t3)) return d2(t3);
|
|
483
483
|
if (je(t3)) return l2(t3);
|
|
484
|
-
if (
|
|
484
|
+
if (E(t3) && e2.host) return D(t3, e2.host);
|
|
485
485
|
if (typeof t3 == `function`) {
|
|
486
486
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
487
487
|
let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
|
|
488
|
-
return me(
|
|
488
|
+
return me(k(() => y(t3)) ? v(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
|
|
489
489
|
let n4 = new URL(e3, `https://${r3}`);
|
|
490
490
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
491
491
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
|
|
492
492
|
}
|
|
493
|
-
return
|
|
494
|
-
},
|
|
493
|
+
return T(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[b])])) : t3;
|
|
494
|
+
}, m2 = (e3) => {
|
|
495
495
|
for (let n3 in e3) t2[n3] = e3[n3];
|
|
496
496
|
};
|
|
497
497
|
return { ...e2.modules ? p2(e2.modules) : {}, get auth() {
|
|
498
498
|
let t3 = i2();
|
|
499
499
|
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e2.host), t3;
|
|
500
|
-
}, setHeaders:
|
|
501
|
-
e3 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ?
|
|
500
|
+
}, setHeaders: m2, use: p2, enableContext(e3, t3 = { elevated: false }) {
|
|
501
|
+
e3 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ? h.elevatedClient = this : h.client = this;
|
|
502
502
|
}, fetch: (t3, n3) => {
|
|
503
503
|
let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
504
504
|
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
505
505
|
}, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
|
|
506
506
|
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 }) });
|
|
507
|
-
if (a3.status !== 200) throw new
|
|
507
|
+
if (a3.status !== 200) throw new S(`GraphQL request failed with status ${a3.status}`, a3);
|
|
508
508
|
let { data: o3, errors: s3 } = await a3.json();
|
|
509
509
|
return { data: o3 ?? {}, errors: s3 };
|
|
510
510
|
}, webhooks: u2, servicePlugins: c2 };
|
|
@@ -531,24 +531,24 @@ function Ve(e2, t2, n2) {
|
|
|
531
531
|
Object.keys(a2).forEach((e4) => {
|
|
532
532
|
let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
|
|
533
533
|
if (r2(o2)) return;
|
|
534
|
-
let s2 =
|
|
534
|
+
let s2 = He(e4, t2);
|
|
535
535
|
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Be(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
539
|
return i2(e2, ``), e2;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function He(e2, t2) {
|
|
542
542
|
let n2;
|
|
543
543
|
return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function L(e2, t2 = []) {
|
|
546
546
|
return Ve(e2, Ie, t2);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Ue(e2, t2 = []) {
|
|
549
549
|
return Ve(e2, Le, t2);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function R(e2) {
|
|
552
552
|
return e2?.toISOString();
|
|
553
553
|
}
|
|
554
554
|
function We(e2) {
|
|
@@ -573,18 +573,18 @@ function Ye(e2) {
|
|
|
573
573
|
}
|
|
574
574
|
return t2;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Xe(e2) {
|
|
577
577
|
let t2 = Ge.get(e2);
|
|
578
578
|
return t2 || (t2 = Ye(e2), Ge.set(e2, t2)), t2;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function z(e2) {
|
|
581
581
|
return typeof e2 == `object` && !!e2;
|
|
582
582
|
}
|
|
583
583
|
function Ze(e2, { isRepeated: t2, isMap: n2 }, r2) {
|
|
584
|
-
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ?
|
|
584
|
+
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? z(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
|
|
585
585
|
}
|
|
586
586
|
function Qe(e2, t2, n2) {
|
|
587
|
-
|
|
587
|
+
z(e2) && tt(e2, t2, n2);
|
|
588
588
|
}
|
|
589
589
|
function $e(e2, t2, n2) {
|
|
590
590
|
for (let [r2, i2] of t2) {
|
|
@@ -597,94 +597,94 @@ function $e(e2, t2, n2) {
|
|
|
597
597
|
function et(e2, t2, n2) {
|
|
598
598
|
for (let [r2, i2] of t2) {
|
|
599
599
|
let t3 = e2[r2];
|
|
600
|
-
|
|
600
|
+
z(t3) && Object.values(t3).forEach((e3) => Qe(e3, i2, n2));
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
function tt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
604
604
|
t2 && $e(e2, t2, i2), n2 && et(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => Qe(e3, r2, i2));
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
if (!
|
|
608
|
-
for (let { paths: n2, transformFn: r2 } of t2) tt(e2,
|
|
606
|
+
function nt(e2, t2) {
|
|
607
|
+
if (!z(e2)) return e2;
|
|
608
|
+
for (let { paths: n2, transformFn: r2 } of t2) tt(e2, Xe(n2), r2);
|
|
609
609
|
return e2;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
return
|
|
611
|
+
function rt(e2) {
|
|
612
|
+
return ct(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
613
613
|
}
|
|
614
|
-
var
|
|
615
|
-
var
|
|
616
|
-
var
|
|
617
|
-
var
|
|
618
|
-
function
|
|
614
|
+
var it = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
615
|
+
var at = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
616
|
+
var ot = `$1\0$2`;
|
|
617
|
+
var st = /[^\p{L}\d]+/giu;
|
|
618
|
+
function ct(e2) {
|
|
619
619
|
let t2 = e2.trim();
|
|
620
|
-
t2 = t2.replace(
|
|
620
|
+
t2 = t2.replace(it, ot).replace(at, ot), t2 = t2.replace(st, `\0`);
|
|
621
621
|
let n2 = 0, r2 = t2.length;
|
|
622
622
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
623
623
|
if (n2 === r2) return [];
|
|
624
624
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
625
625
|
return t2.slice(n2, r2).split(/\0/g);
|
|
626
626
|
}
|
|
627
|
-
var
|
|
628
|
-
var
|
|
629
|
-
var
|
|
630
|
-
function
|
|
627
|
+
var lt = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
628
|
+
var ut = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
629
|
+
var B = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
630
|
+
function dt(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
631
631
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
632
|
-
if (
|
|
633
|
-
if (
|
|
634
|
-
if (
|
|
635
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
636
|
-
return
|
|
632
|
+
if (lt(e2)) return ft(e2, t2, n2);
|
|
633
|
+
if (ut(e2)) return mt(e2);
|
|
634
|
+
if (B(e2)) {
|
|
635
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: rt(n3), data: {} }, requestId: e2.requestId };
|
|
636
|
+
return pt(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
637
637
|
}
|
|
638
|
-
return
|
|
638
|
+
return ht(e2);
|
|
639
639
|
}
|
|
640
|
-
var
|
|
641
|
-
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
642
|
-
return
|
|
640
|
+
var ft = (e2, t2, n2) => {
|
|
641
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = gt(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 };
|
|
642
|
+
return pt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
643
643
|
};
|
|
644
|
-
var
|
|
645
|
-
var
|
|
646
|
-
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 ??
|
|
647
|
-
return
|
|
644
|
+
var pt = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
645
|
+
var mt = (e2) => {
|
|
646
|
+
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 ?? rt(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 };
|
|
647
|
+
return pt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
648
648
|
};
|
|
649
|
-
var
|
|
650
|
-
var
|
|
649
|
+
var ht = (e2) => pt(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: rt(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
650
|
+
var gt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
651
651
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
652
652
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
653
653
|
let r3 = t2[e3.field];
|
|
654
|
-
if (r3) return { ...e3, field:
|
|
654
|
+
if (r3) return { ...e3, field: _t(r3, i2) };
|
|
655
655
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
656
656
|
if (s2) {
|
|
657
657
|
let t3 = a2[s2];
|
|
658
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
658
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, _t(t3, i2)) };
|
|
659
659
|
}
|
|
660
660
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
661
661
|
});
|
|
662
662
|
};
|
|
663
|
-
var
|
|
664
|
-
let n2 =
|
|
663
|
+
var _t = (e2, t2) => {
|
|
664
|
+
let n2 = vt(e2);
|
|
665
665
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
666
666
|
};
|
|
667
|
-
var
|
|
667
|
+
var vt = (e2) => {
|
|
668
668
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
669
669
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
670
670
|
};
|
|
671
|
-
function
|
|
671
|
+
function yt() {
|
|
672
672
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
673
673
|
if (e2) return { initWixModules(t3, n3) {
|
|
674
|
-
return
|
|
674
|
+
return bt(() => e2(t3, n3));
|
|
675
675
|
}, fetchWithAuth() {
|
|
676
676
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
677
677
|
}, graphql() {
|
|
678
678
|
throw Error(`graphql is not available in this context`);
|
|
679
679
|
} };
|
|
680
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
680
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : h.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : h.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : h.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : h.elevatedClient;
|
|
681
681
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
682
682
|
if (r2) {
|
|
683
683
|
if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
|
|
684
|
-
return
|
|
684
|
+
return bt(() => n2.use(e3));
|
|
685
685
|
}
|
|
686
686
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
687
|
-
return
|
|
687
|
+
return bt(() => t2.use(e3));
|
|
688
688
|
}, fetchWithAuth: (e3, n3) => {
|
|
689
689
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
690
690
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -696,110 +696,110 @@ function vt() {
|
|
|
696
696
|
return t2.graphql(e3, n3, r2);
|
|
697
697
|
} };
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
701
|
-
globalThis.__wix_context__ = void 0,
|
|
699
|
+
function bt(e2) {
|
|
700
|
+
let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
|
|
701
|
+
globalThis.__wix_context__ = void 0, h.client = void 0, h.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
702
702
|
try {
|
|
703
703
|
return e2();
|
|
704
704
|
} finally {
|
|
705
|
-
globalThis.__wix_context__ = t2,
|
|
705
|
+
globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function xt(e2, t2) {
|
|
709
709
|
return (...n2) => {
|
|
710
|
-
let r2 =
|
|
710
|
+
let r2 = yt();
|
|
711
711
|
return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
return
|
|
714
|
+
function St(e2, t2 = false) {
|
|
715
|
+
return xt(e2, t2);
|
|
716
716
|
}
|
|
717
|
-
function
|
|
718
|
-
let n2 =
|
|
719
|
-
return t2 && r2 ? new URLSearchParams({ ".r":
|
|
717
|
+
function Ct(e2, t2) {
|
|
718
|
+
let n2 = V(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
|
|
719
|
+
return t2 && r2 ? new URLSearchParams({ ".r": Et(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
720
720
|
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
|
|
721
721
|
}), e3), new URLSearchParams());
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
let t2 =
|
|
725
|
-
return
|
|
723
|
+
function wt(e2) {
|
|
724
|
+
let t2 = zt(Lt(e2.host), e2.domainToMappings);
|
|
725
|
+
return Jt(Gt(e2.protoPath, e2.data || {}), t2);
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function V(e2, t2 = ``) {
|
|
728
728
|
let n2 = {};
|
|
729
729
|
return Object.entries(e2).forEach(([e3, r2]) => {
|
|
730
|
-
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 =
|
|
730
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Tt(t2, e3);
|
|
731
731
|
if (i2) {
|
|
732
|
-
let e4 =
|
|
732
|
+
let e4 = V(r2, a2);
|
|
733
733
|
Object.assign(n2, e4);
|
|
734
734
|
} else n2[a2] = r2;
|
|
735
735
|
}), n2;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function Tt(e2, t2) {
|
|
738
738
|
return `${e2}${e2 ? `.` : ``}${t2}`;
|
|
739
739
|
}
|
|
740
|
-
var
|
|
740
|
+
var Et = (e2) => {
|
|
741
741
|
let t2 = new TextEncoder().encode(e2);
|
|
742
742
|
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
743
743
|
};
|
|
744
|
-
var
|
|
745
|
-
var
|
|
746
|
-
var
|
|
747
|
-
var
|
|
748
|
-
var
|
|
749
|
-
var
|
|
750
|
-
var
|
|
751
|
-
var
|
|
752
|
-
var
|
|
753
|
-
var
|
|
754
|
-
function It(e2) {
|
|
755
|
-
return Lt(e2).replace(kt, `._base_domain_`).replace(Pt, `._api_base_domain_`).replace(Ft, `*.dev.wix-code.com`);
|
|
756
|
-
}
|
|
744
|
+
var Dt = [`wix.com`, `editorx.com`];
|
|
745
|
+
var Ot = `_`;
|
|
746
|
+
var kt = `*.`;
|
|
747
|
+
var At = RegExp(`\\.(${Dt.join(`|`)})$`);
|
|
748
|
+
var jt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
749
|
+
var Mt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
750
|
+
var Nt = `dev.wix-code.com`;
|
|
751
|
+
var Pt = /{(.*)}/;
|
|
752
|
+
var Ft = RegExp(`\\.(${jt.join(`|`)})$`);
|
|
753
|
+
var It = RegExp(`.*\\.${Nt}$`);
|
|
757
754
|
function Lt(e2) {
|
|
758
|
-
return
|
|
755
|
+
return Rt(e2).replace(At, `._base_domain_`).replace(Ft, `._api_base_domain_`).replace(It, `*.dev.wix-code.com`);
|
|
756
|
+
}
|
|
757
|
+
function Rt(e2) {
|
|
758
|
+
return Mt[e2] ?? e2;
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function zt(e2, t2) {
|
|
761
761
|
let n2 = t2[e2];
|
|
762
762
|
if (n2) return n2;
|
|
763
|
-
let r2 =
|
|
763
|
+
let r2 = Bt(e2, t2) ?? Vt(e2, t2);
|
|
764
764
|
if (!r2) {
|
|
765
|
-
if (
|
|
766
|
-
let e3 = t2[
|
|
765
|
+
if (Ut(e2)) {
|
|
766
|
+
let e3 = t2[Wt];
|
|
767
767
|
if (e3) return e3;
|
|
768
768
|
}
|
|
769
|
-
let n3 = t2[
|
|
769
|
+
let n3 = t2[Ot];
|
|
770
770
|
if (n3) return n3;
|
|
771
771
|
}
|
|
772
772
|
return r2 ?? [];
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function Bt(e2, t2) {
|
|
775
775
|
return Object.entries(t2).find(([t3]) => {
|
|
776
776
|
let [, ...n2] = e2.split(`.`);
|
|
777
777
|
return n2.join(`.`) === t3;
|
|
778
778
|
})?.[1];
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
780
|
+
function Vt(e2, t2) {
|
|
781
|
+
let [n2] = Object.entries(t2).filter(([t3]) => Ht(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
|
|
782
782
|
if (!n2) return;
|
|
783
783
|
let [, r2] = n2;
|
|
784
784
|
return r2;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
if (!t2.startsWith(
|
|
786
|
+
function Ht(e2, t2) {
|
|
787
|
+
if (!t2.startsWith(kt)) return false;
|
|
788
788
|
let n2 = t2.slice(1);
|
|
789
789
|
return e2.length > n2.length && e2.endsWith(n2);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Ut(e2) {
|
|
792
792
|
return !!e2.match(/\._base_domain_$/);
|
|
793
793
|
}
|
|
794
|
-
var
|
|
795
|
-
function Wt(e2, t2) {
|
|
796
|
-
return e2.split(`/`).map((e3) => Gt(e3, t2)).join(`/`);
|
|
797
|
-
}
|
|
794
|
+
var Wt = `www._base_domain_`;
|
|
798
795
|
function Gt(e2, t2) {
|
|
799
|
-
|
|
800
|
-
|
|
796
|
+
return e2.split(`/`).map((e3) => Kt(e3, t2)).join(`/`);
|
|
797
|
+
}
|
|
798
|
+
function Kt(e2, t2) {
|
|
799
|
+
let n2 = e2.match(Pt) || [], r2 = n2[1];
|
|
800
|
+
return r2 ? qt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function qt(e2, t2, n2, r2) {
|
|
803
803
|
let i2 = e2;
|
|
804
804
|
for (let e3 of t2.split(`.`)) {
|
|
805
805
|
if (!i2) return n2;
|
|
@@ -807,37 +807,43 @@ function Kt(e2, t2, n2, r2) {
|
|
|
807
807
|
}
|
|
808
808
|
return `${i2}${r2}`;
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function Jt(e2, t2) {
|
|
811
811
|
let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
|
|
812
812
|
return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function H(e2) {
|
|
815
815
|
return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
|
|
816
816
|
}
|
|
817
|
-
var
|
|
818
|
-
var
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
let e2 = en(`language`), t2 = en(`locale`);
|
|
822
|
-
if (e2) return { [Jt]: [e2, t2 || e2, Xt, Yt].join(`|`) };
|
|
817
|
+
var Yt = `x-wix-currency`;
|
|
818
|
+
var Xt = () => {
|
|
819
|
+
let e2 = rn(`currency`);
|
|
820
|
+
if (e2) return { [Yt]: e2 };
|
|
823
821
|
};
|
|
824
|
-
|
|
822
|
+
var Zt = `x-wix-linguist`;
|
|
823
|
+
var Qt = `00000000-0000-0000-0000-000000000000`;
|
|
824
|
+
var $t = `false`;
|
|
825
|
+
var en = () => {
|
|
826
|
+
let e2 = rn(`language`), t2 = rn(`locale`);
|
|
827
|
+
if (e2) return { [Zt]: [e2, t2 || e2, $t, Qt].join(`|`) };
|
|
828
|
+
};
|
|
829
|
+
function tn() {
|
|
825
830
|
let e2 = null, t2 = null;
|
|
826
831
|
return { promise: new Promise((n2, r2) => {
|
|
827
832
|
e2 = n2, t2 = r2;
|
|
828
833
|
}), resolve: e2, reject: t2 };
|
|
829
834
|
}
|
|
830
|
-
var
|
|
831
|
-
var
|
|
832
|
-
var
|
|
833
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 =
|
|
834
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
835
|
-
|
|
835
|
+
var nn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
836
|
+
var rn = (e2) => nn()?.[e2];
|
|
837
|
+
var an = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
|
|
838
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = U();
|
|
839
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: rn(`language`), locale: rn(`locale`), get passThroughHeaders() {
|
|
840
|
+
let e3 = { ...en(), ...Xt() };
|
|
841
|
+
return Object.keys(e3).length > 0 ? e3 : void 0;
|
|
836
842
|
} } };
|
|
837
843
|
}, auth: (e3) => {
|
|
838
844
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
839
|
-
!e3 &&
|
|
840
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
845
|
+
!e3 && on() && (e3 = t2?.getAccessTokenFunction?.());
|
|
846
|
+
let n2 = false, { resolve: r2, promise: i2 } = tn();
|
|
841
847
|
return { getAuthHeaders: async () => {
|
|
842
848
|
if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
|
|
843
849
|
return { headers: { Authorization: await e3() } };
|
|
@@ -845,65 +851,65 @@ var tn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
|
|
|
845
851
|
r2(e4);
|
|
846
852
|
}) };
|
|
847
853
|
} });
|
|
848
|
-
function
|
|
854
|
+
function on() {
|
|
849
855
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
850
856
|
}
|
|
851
|
-
function
|
|
857
|
+
function U() {
|
|
852
858
|
let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
853
859
|
if (!e2) return;
|
|
854
860
|
let t2 = new URL(e2);
|
|
855
861
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
856
862
|
}
|
|
857
|
-
var
|
|
863
|
+
var sn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
858
864
|
if (!e2) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
859
865
|
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
860
866
|
}, getAccessToken: () => {
|
|
861
867
|
throw Error(`Not implemented`);
|
|
862
868
|
}, observeState: () => ({ disconnect: () => {
|
|
863
869
|
} }) });
|
|
864
|
-
var
|
|
870
|
+
var cn = an({ createHost: function(e2) {
|
|
865
871
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
866
872
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
867
|
-
return { channel:
|
|
873
|
+
return { channel: sn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
868
874
|
} };
|
|
869
875
|
} });
|
|
870
|
-
var
|
|
871
|
-
let n2 =
|
|
876
|
+
var ln = (e2, t2) => {
|
|
877
|
+
let n2 = cn.host({ applicationId: e2, componentId: t2 }), r2 = cn.auth();
|
|
872
878
|
return Pe({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
873
879
|
};
|
|
874
|
-
var
|
|
875
|
-
var
|
|
876
|
-
var
|
|
877
|
-
var
|
|
878
|
-
var
|
|
879
|
-
var
|
|
880
|
-
var
|
|
881
|
-
var
|
|
882
|
-
var
|
|
880
|
+
var un = (e2) => ln(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
|
|
881
|
+
var dn = [`ANY_FEMALE`, `ANY_MALE`];
|
|
882
|
+
var fn = `3.7.8`;
|
|
883
|
+
var pn = fn;
|
|
884
|
+
var mn = typeof Buffer == `function`;
|
|
885
|
+
var hn = typeof TextDecoder == `function` ? new TextDecoder() : void 0;
|
|
886
|
+
var gn = typeof TextEncoder == `function` ? new TextEncoder() : void 0;
|
|
887
|
+
var _n = Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`);
|
|
888
|
+
var vn = ((e2) => {
|
|
883
889
|
let t2 = {};
|
|
884
890
|
return e2.forEach((e3, n2) => t2[e3] = n2), t2;
|
|
885
|
-
})(
|
|
886
|
-
var
|
|
891
|
+
})(_n);
|
|
892
|
+
var yn = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
887
893
|
var W = String.fromCharCode.bind(String);
|
|
888
|
-
var
|
|
889
|
-
var
|
|
890
|
-
var
|
|
891
|
-
var
|
|
894
|
+
var bn = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
|
|
895
|
+
var xn = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
|
|
896
|
+
var Sn = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
|
|
897
|
+
var Cn = (e2) => {
|
|
892
898
|
let t2, n2, r2, i2, a2 = ``, o2 = e2.length % 3;
|
|
893
899
|
for (let o3 = 0; o3 < e2.length; ) {
|
|
894
900
|
if ((n2 = e2.charCodeAt(o3++)) > 255 || (r2 = e2.charCodeAt(o3++)) > 255 || (i2 = e2.charCodeAt(o3++)) > 255) throw TypeError(`invalid character found`);
|
|
895
|
-
t2 = n2 << 16 | r2 << 8 | i2, a2 +=
|
|
901
|
+
t2 = n2 << 16 | r2 << 8 | i2, a2 += _n[t2 >> 18 & 63] + _n[t2 >> 12 & 63] + _n[t2 >> 6 & 63] + _n[t2 & 63];
|
|
896
902
|
}
|
|
897
903
|
return o2 ? a2.slice(0, o2 - 3) + `===`.substring(o2) : a2;
|
|
898
904
|
};
|
|
899
|
-
var
|
|
900
|
-
var
|
|
905
|
+
var wn = typeof btoa == `function` ? (e2) => btoa(e2) : mn ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : Cn;
|
|
906
|
+
var Tn = mn ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
|
|
901
907
|
let t2 = 4096, n2 = [];
|
|
902
908
|
for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(W.apply(null, e2.subarray(r2, r2 + t2)));
|
|
903
|
-
return
|
|
909
|
+
return wn(n2.join(``));
|
|
904
910
|
};
|
|
905
|
-
var
|
|
906
|
-
var
|
|
911
|
+
var En = (e2, t2 = false) => t2 ? xn(Tn(e2)) : Tn(e2);
|
|
912
|
+
var Dn = (e2) => {
|
|
907
913
|
if (e2.length < 2) {
|
|
908
914
|
var t2 = e2.charCodeAt(0);
|
|
909
915
|
return t2 < 128 ? e2 : t2 < 2048 ? W(192 | t2 >>> 6) + W(128 | t2 & 63) : W(224 | t2 >>> 12 & 15) + W(128 | t2 >>> 6 & 63) + W(128 | t2 & 63);
|
|
@@ -911,13 +917,13 @@ var wn = (e2) => {
|
|
|
911
917
|
var t2 = 65536 + (e2.charCodeAt(0) - 55296) * 1024 + (e2.charCodeAt(1) - 56320);
|
|
912
918
|
return W(240 | t2 >>> 18 & 7) + W(128 | t2 >>> 12 & 63) + W(128 | t2 >>> 6 & 63) + W(128 | t2 & 63);
|
|
913
919
|
};
|
|
914
|
-
var
|
|
915
|
-
var
|
|
916
|
-
var
|
|
917
|
-
var
|
|
918
|
-
var
|
|
919
|
-
var
|
|
920
|
-
var
|
|
920
|
+
var On = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
921
|
+
var kn = (e2) => e2.replace(On, Dn);
|
|
922
|
+
var An = mn ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : gn ? (e2) => Tn(gn.encode(e2)) : (e2) => wn(kn(e2));
|
|
923
|
+
var jn = (e2, t2 = false) => t2 ? xn(An(e2)) : An(e2);
|
|
924
|
+
var Mn = (e2) => jn(e2, true);
|
|
925
|
+
var G = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
926
|
+
var Nn = (e2) => {
|
|
921
927
|
switch (e2.length) {
|
|
922
928
|
case 4:
|
|
923
929
|
var t2 = ((7 & e2.charCodeAt(0)) << 18 | (63 & e2.charCodeAt(1)) << 12 | (63 & e2.charCodeAt(2)) << 6 | 63 & e2.charCodeAt(3)) - 65536;
|
|
@@ -928,129 +934,129 @@ var G = (e2) => {
|
|
|
928
934
|
return W((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
|
|
929
935
|
}
|
|
930
936
|
};
|
|
931
|
-
var
|
|
932
|
-
var
|
|
933
|
-
if (e2 = e2.replace(/\s+/g, ``), !
|
|
937
|
+
var Pn = (e2) => e2.replace(G, Nn);
|
|
938
|
+
var Fn = (e2) => {
|
|
939
|
+
if (e2 = e2.replace(/\s+/g, ``), !yn.test(e2)) throw TypeError(`malformed base64.`);
|
|
934
940
|
e2 += `==`.slice(2 - (e2.length & 3));
|
|
935
941
|
let t2, n2, r2, i2 = [];
|
|
936
|
-
for (let a2 = 0; a2 < e2.length; ) t2 =
|
|
942
|
+
for (let a2 = 0; a2 < e2.length; ) t2 = vn[e2.charAt(a2++)] << 18 | vn[e2.charAt(a2++)] << 12 | (n2 = vn[e2.charAt(a2++)]) << 6 | (r2 = vn[e2.charAt(a2++)]), n2 === 64 ? i2.push(W(t2 >> 16 & 255)) : r2 === 64 ? i2.push(W(t2 >> 16 & 255, t2 >> 8 & 255)) : i2.push(W(t2 >> 16 & 255, t2 >> 8 & 255, t2 & 255));
|
|
937
943
|
return i2.join(``);
|
|
938
944
|
};
|
|
939
|
-
var
|
|
940
|
-
var
|
|
941
|
-
var
|
|
942
|
-
var
|
|
943
|
-
var
|
|
944
|
-
var
|
|
945
|
-
var
|
|
945
|
+
var In = typeof atob == `function` ? (e2) => atob(Sn(e2)) : mn ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : Fn;
|
|
946
|
+
var Ln = mn ? (e2) => bn(Buffer.from(e2, `base64`)) : (e2) => bn(In(e2).split(``).map((e3) => e3.charCodeAt(0)));
|
|
947
|
+
var Rn = (e2) => Ln(Bn(e2));
|
|
948
|
+
var zn = mn ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : hn ? (e2) => hn.decode(Ln(e2)) : (e2) => Pn(In(e2));
|
|
949
|
+
var Bn = (e2) => Sn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
|
|
950
|
+
var Vn = (e2) => zn(Bn(e2));
|
|
951
|
+
var Hn = (e2) => {
|
|
946
952
|
if (typeof e2 != `string`) return false;
|
|
947
953
|
let t2 = e2.replace(/\s+/g, ``).replace(/={0,2}$/, ``);
|
|
948
954
|
return !/[^\s0-9a-zA-Z\+/]/.test(t2) || !/[^\s0-9a-zA-Z\-_]/.test(t2);
|
|
949
955
|
};
|
|
950
|
-
var
|
|
951
|
-
var
|
|
952
|
-
let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3,
|
|
956
|
+
var Un = (e2) => ({ value: e2, enumerable: false, writable: true, configurable: true });
|
|
957
|
+
var Wn = function() {
|
|
958
|
+
let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3, Un(t2));
|
|
953
959
|
e2(`fromBase64`, function() {
|
|
954
|
-
return
|
|
960
|
+
return Vn(this);
|
|
955
961
|
}), e2(`toBase64`, function(e3) {
|
|
956
|
-
return
|
|
962
|
+
return jn(this, e3);
|
|
957
963
|
}), e2(`toBase64URI`, function() {
|
|
958
|
-
return
|
|
964
|
+
return jn(this, true);
|
|
959
965
|
}), e2(`toBase64URL`, function() {
|
|
960
|
-
return
|
|
966
|
+
return jn(this, true);
|
|
961
967
|
}), e2(`toUint8Array`, function() {
|
|
962
|
-
return
|
|
968
|
+
return Rn(this);
|
|
963
969
|
});
|
|
964
970
|
};
|
|
965
|
-
var
|
|
966
|
-
let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3,
|
|
971
|
+
var Gn = function() {
|
|
972
|
+
let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, Un(t2));
|
|
967
973
|
e2(`toBase64`, function(e3) {
|
|
968
|
-
return
|
|
974
|
+
return En(this, e3);
|
|
969
975
|
}), e2(`toBase64URI`, function() {
|
|
970
|
-
return
|
|
976
|
+
return En(this, true);
|
|
971
977
|
}), e2(`toBase64URL`, function() {
|
|
972
|
-
return
|
|
978
|
+
return En(this, true);
|
|
973
979
|
});
|
|
974
980
|
};
|
|
975
|
-
var
|
|
976
|
-
|
|
981
|
+
var Kn = { version: fn, VERSION: pn, atob: In, atobPolyfill: Fn, btoa: wn, btoaPolyfill: Cn, fromBase64: Vn, toBase64: jn, encode: jn, encodeURI: Mn, encodeURL: Mn, utob: kn, btou: Pn, decode: Vn, isValid: Hn, fromUint8Array: En, toUint8Array: Rn, extendString: Wn, extendUint8Array: Gn, extendBuiltins: () => {
|
|
982
|
+
Wn(), Gn();
|
|
977
983
|
} };
|
|
978
984
|
var K = Uint8Array;
|
|
979
|
-
var
|
|
980
|
-
var
|
|
981
|
-
var
|
|
982
|
-
var
|
|
983
|
-
var
|
|
984
|
-
var
|
|
985
|
-
for (var n2 = new
|
|
986
|
-
for (var i2 = new
|
|
985
|
+
var qn = Uint16Array;
|
|
986
|
+
var Jn = Int32Array;
|
|
987
|
+
var Yn = new K([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
|
|
988
|
+
var Xn = new K([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
|
|
989
|
+
var Zn = new K([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
|
|
990
|
+
var Qn = function(e2, t2) {
|
|
991
|
+
for (var n2 = new qn(31), r2 = 0; r2 < 31; ++r2) n2[r2] = t2 += 1 << e2[r2 - 1];
|
|
992
|
+
for (var i2 = new Jn(n2[30]), r2 = 1; r2 < 30; ++r2) for (var a2 = n2[r2]; a2 < n2[r2 + 1]; ++a2) i2[a2] = a2 - n2[r2] << 5 | r2;
|
|
987
993
|
return { b: n2, r: i2 };
|
|
988
994
|
};
|
|
989
|
-
var
|
|
990
|
-
var Zn = Xn.b;
|
|
991
|
-
var Qn = Xn.r;
|
|
992
|
-
Zn[28] = 258, Qn[258] = 28;
|
|
993
|
-
var $n = Yn(qn, 0);
|
|
995
|
+
var $n = Qn(Yn, 2);
|
|
994
996
|
var er = $n.b;
|
|
995
|
-
$n.r;
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
997
|
+
var tr = $n.r;
|
|
998
|
+
er[28] = 258, tr[258] = 28;
|
|
999
|
+
var nr = Qn(Xn, 0);
|
|
1000
|
+
var rr = nr.b;
|
|
1001
|
+
nr.r;
|
|
1002
|
+
for (ir = new qn(32768), q = 0; q < 32768; ++q) {
|
|
1003
|
+
ar = (q & 43690) >> 1 | (q & 21845) << 1;
|
|
1004
|
+
ar = (ar & 52428) >> 2 | (ar & 13107) << 2, ar = (ar & 61680) >> 4 | (ar & 3855) << 4, ir[q] = ((ar & 65280) >> 8 | (ar & 255) << 8) >> 1;
|
|
999
1005
|
}
|
|
1000
|
-
var
|
|
1001
|
-
var
|
|
1006
|
+
var ar;
|
|
1007
|
+
var ir;
|
|
1002
1008
|
var q;
|
|
1003
|
-
for (
|
|
1004
|
-
for (var r2 = e2.length, i2 = 0, a2 = new
|
|
1005
|
-
var o2 = new
|
|
1009
|
+
for (or = function(e2, t2, n2) {
|
|
1010
|
+
for (var r2 = e2.length, i2 = 0, a2 = new qn(t2); i2 < r2; ++i2) e2[i2] && ++a2[e2[i2] - 1];
|
|
1011
|
+
var o2 = new qn(t2);
|
|
1006
1012
|
for (i2 = 1; i2 < t2; ++i2) o2[i2] = o2[i2 - 1] + a2[i2 - 1] << 1;
|
|
1007
1013
|
var s2;
|
|
1008
1014
|
if (n2) {
|
|
1009
|
-
s2 = new
|
|
1015
|
+
s2 = new qn(1 << t2);
|
|
1010
1016
|
var c2 = 15 - t2;
|
|
1011
|
-
for (i2 = 0; i2 < r2; ++i2) if (e2[i2]) for (var l2 = i2 << 4 | e2[i2], u2 = t2 - e2[i2], d2 = o2[e2[i2] - 1]++ << u2, f2 = d2 | (1 << u2) - 1; d2 <= f2; ++d2) s2[
|
|
1012
|
-
} else for (s2 = new
|
|
1017
|
+
for (i2 = 0; i2 < r2; ++i2) if (e2[i2]) for (var l2 = i2 << 4 | e2[i2], u2 = t2 - e2[i2], d2 = o2[e2[i2] - 1]++ << u2, f2 = d2 | (1 << u2) - 1; d2 <= f2; ++d2) s2[ir[d2] >> c2] = l2;
|
|
1018
|
+
} else for (s2 = new qn(r2), i2 = 0; i2 < r2; ++i2) e2[i2] && (s2[i2] = ir[o2[e2[i2] - 1]++] >> 15 - e2[i2]);
|
|
1013
1019
|
return s2;
|
|
1014
|
-
},
|
|
1015
|
-
var
|
|
1016
|
-
var
|
|
1020
|
+
}, sr = new K(288), q = 0; q < 144; ++q) sr[q] = 8;
|
|
1021
|
+
var or;
|
|
1022
|
+
var sr;
|
|
1017
1023
|
var q;
|
|
1018
|
-
for (q = 144; q < 256; ++q)
|
|
1024
|
+
for (q = 144; q < 256; ++q) sr[q] = 9;
|
|
1019
1025
|
var q;
|
|
1020
|
-
for (q = 256; q < 280; ++q)
|
|
1026
|
+
for (q = 256; q < 280; ++q) sr[q] = 7;
|
|
1021
1027
|
var q;
|
|
1022
|
-
for (q = 280; q < 288; ++q)
|
|
1028
|
+
for (q = 280; q < 288; ++q) sr[q] = 8;
|
|
1023
1029
|
var q;
|
|
1024
|
-
for (
|
|
1025
|
-
var
|
|
1030
|
+
for (cr = new K(32), q = 0; q < 32; ++q) cr[q] = 5;
|
|
1031
|
+
var cr;
|
|
1026
1032
|
var q;
|
|
1027
|
-
var
|
|
1028
|
-
var
|
|
1029
|
-
var
|
|
1033
|
+
var lr = or(sr, 9, 1);
|
|
1034
|
+
var ur = or(cr, 5, 1);
|
|
1035
|
+
var dr = function(e2) {
|
|
1030
1036
|
for (var t2 = e2[0], n2 = 1; n2 < e2.length; ++n2) e2[n2] > t2 && (t2 = e2[n2]);
|
|
1031
1037
|
return t2;
|
|
1032
1038
|
};
|
|
1033
|
-
var
|
|
1039
|
+
var fr = function(e2, t2, n2) {
|
|
1034
1040
|
var r2 = t2 / 8 | 0;
|
|
1035
1041
|
return (e2[r2] | e2[r2 + 1] << 8) >> (t2 & 7) & n2;
|
|
1036
1042
|
};
|
|
1037
|
-
var
|
|
1043
|
+
var pr = function(e2, t2) {
|
|
1038
1044
|
var n2 = t2 / 8 | 0;
|
|
1039
1045
|
return (e2[n2] | e2[n2 + 1] << 8 | e2[n2 + 2] << 16) >> (t2 & 7);
|
|
1040
1046
|
};
|
|
1041
|
-
var
|
|
1047
|
+
var mr = function(e2) {
|
|
1042
1048
|
return (e2 + 7) / 8 | 0;
|
|
1043
1049
|
};
|
|
1044
|
-
var
|
|
1050
|
+
var hr = function(e2, t2, n2) {
|
|
1045
1051
|
return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new K(e2.subarray(t2, n2));
|
|
1046
1052
|
};
|
|
1047
|
-
var
|
|
1048
|
-
var
|
|
1049
|
-
var r2 = Error(t2 ||
|
|
1050
|
-
if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2,
|
|
1053
|
+
var gr = [`unexpected EOF`, `invalid block type`, `invalid length/literal`, `invalid distance`, `stream finished`, `no stream handler`, , `no callback`, `invalid UTF-8 data`, `extra field too long`, `date not in range 1980-2099`, `filename too long`, `stream finishing`, `invalid zip data`];
|
|
1054
|
+
var _r = function(e2, t2, n2) {
|
|
1055
|
+
var r2 = Error(t2 || gr[e2]);
|
|
1056
|
+
if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2, _r), !n2) throw r2;
|
|
1051
1057
|
return r2;
|
|
1052
1058
|
};
|
|
1053
|
-
var
|
|
1059
|
+
var vr = function(e2, t2, n2, r2) {
|
|
1054
1060
|
var i2 = e2.length, a2 = r2 ? r2.length : 0;
|
|
1055
1061
|
if (!i2 || t2.f && !t2.l) return n2 || new K(0);
|
|
1056
1062
|
var o2 = !n2, s2 = o2 || t2.i != 2, c2 = t2.i;
|
|
@@ -1064,153 +1070,153 @@ var hr = function(e2, t2, n2, r2) {
|
|
|
1064
1070
|
}, 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;
|
|
1065
1071
|
do {
|
|
1066
1072
|
if (!p2) {
|
|
1067
|
-
u2 =
|
|
1068
|
-
var v2 =
|
|
1073
|
+
u2 = fr(e2, d2, 1);
|
|
1074
|
+
var v2 = fr(e2, d2 + 1, 3);
|
|
1069
1075
|
if (d2 += 3, !v2) {
|
|
1070
|
-
var y2 =
|
|
1076
|
+
var y2 = mr(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
|
|
1071
1077
|
if (x2 > i2) {
|
|
1072
|
-
c2 &&
|
|
1078
|
+
c2 && _r(0);
|
|
1073
1079
|
break;
|
|
1074
1080
|
}
|
|
1075
1081
|
s2 && l2(f2 + b2), n2.set(e2.subarray(y2, x2), f2), t2.b = f2 += b2, t2.p = d2 = x2 * 8, t2.f = u2;
|
|
1076
1082
|
continue;
|
|
1077
1083
|
}
|
|
1078
|
-
if (v2 == 1) p2 =
|
|
1084
|
+
if (v2 == 1) p2 = lr, m2 = ur, h2 = 9, g2 = 5;
|
|
1079
1085
|
else if (v2 == 2) {
|
|
1080
|
-
var S2 =
|
|
1086
|
+
var S2 = fr(e2, d2, 31) + 257, C2 = fr(e2, d2 + 10, 15) + 4, w2 = S2 + fr(e2, d2 + 5, 31) + 1;
|
|
1081
1087
|
d2 += 14;
|
|
1082
|
-
for (var T2 = new K(w2),
|
|
1088
|
+
for (var T2 = new K(w2), E2 = new K(19), D2 = 0; D2 < C2; ++D2) E2[Zn[D2]] = fr(e2, d2 + D2 * 3, 7);
|
|
1083
1089
|
d2 += C2 * 3;
|
|
1084
|
-
for (var
|
|
1085
|
-
var
|
|
1086
|
-
d2 +=
|
|
1087
|
-
var y2 =
|
|
1088
|
-
if (y2 < 16) T2[
|
|
1090
|
+
for (var O2 = dr(E2), ee2 = (1 << O2) - 1, te2 = or(E2, O2, 1), D2 = 0; D2 < w2; ) {
|
|
1091
|
+
var k2 = te2[fr(e2, d2, ee2)];
|
|
1092
|
+
d2 += k2 & 15;
|
|
1093
|
+
var y2 = k2 >> 4;
|
|
1094
|
+
if (y2 < 16) T2[D2++] = y2;
|
|
1089
1095
|
else {
|
|
1090
|
-
var
|
|
1091
|
-
for (y2 == 16 ? (
|
|
1096
|
+
var A2 = 0, j2 = 0;
|
|
1097
|
+
for (y2 == 16 ? (j2 = 3 + fr(e2, d2, 3), d2 += 2, A2 = T2[D2 - 1]) : y2 == 17 ? (j2 = 3 + fr(e2, d2, 7), d2 += 3) : y2 == 18 && (j2 = 11 + fr(e2, d2, 127), d2 += 7); j2--; ) T2[D2++] = A2;
|
|
1092
1098
|
}
|
|
1093
1099
|
}
|
|
1094
|
-
var
|
|
1095
|
-
h2 =
|
|
1096
|
-
} else
|
|
1100
|
+
var ne2 = T2.subarray(0, S2), M2 = T2.subarray(S2);
|
|
1101
|
+
h2 = dr(ne2), g2 = dr(M2), p2 = or(ne2, h2, 1), m2 = or(M2, g2, 1);
|
|
1102
|
+
} else _r(1);
|
|
1097
1103
|
if (d2 > _2) {
|
|
1098
|
-
c2 &&
|
|
1104
|
+
c2 && _r(0);
|
|
1099
1105
|
break;
|
|
1100
1106
|
}
|
|
1101
1107
|
}
|
|
1102
1108
|
s2 && l2(f2 + 131072);
|
|
1103
|
-
for (var
|
|
1104
|
-
var
|
|
1105
|
-
if (d2 +=
|
|
1106
|
-
c2 &&
|
|
1109
|
+
for (var re2 = (1 << h2) - 1, N2 = (1 << g2) - 1, ie2 = d2; ; ie2 = d2) {
|
|
1110
|
+
var A2 = p2[pr(e2, d2) & re2], ae2 = A2 >> 4;
|
|
1111
|
+
if (d2 += A2 & 15, d2 > _2) {
|
|
1112
|
+
c2 && _r(0);
|
|
1107
1113
|
break;
|
|
1108
1114
|
}
|
|
1109
|
-
if (
|
|
1110
|
-
else if (
|
|
1111
|
-
|
|
1115
|
+
if (A2 || _r(2), ae2 < 256) n2[f2++] = ae2;
|
|
1116
|
+
else if (ae2 == 256) {
|
|
1117
|
+
ie2 = d2, p2 = null;
|
|
1112
1118
|
break;
|
|
1113
1119
|
} else {
|
|
1114
|
-
var
|
|
1115
|
-
if (
|
|
1116
|
-
var
|
|
1117
|
-
|
|
1120
|
+
var oe2 = ae2 - 254;
|
|
1121
|
+
if (ae2 > 264) {
|
|
1122
|
+
var D2 = ae2 - 257, se2 = Yn[D2];
|
|
1123
|
+
oe2 = fr(e2, d2, (1 << se2) - 1) + er[D2], d2 += se2;
|
|
1118
1124
|
}
|
|
1119
|
-
var
|
|
1120
|
-
|
|
1121
|
-
var
|
|
1122
|
-
if (
|
|
1123
|
-
var
|
|
1124
|
-
|
|
1125
|
+
var P2 = m2[pr(e2, d2) & N2], ce2 = P2 >> 4;
|
|
1126
|
+
P2 || _r(3), d2 += P2 & 15;
|
|
1127
|
+
var M2 = rr[ce2];
|
|
1128
|
+
if (ce2 > 3) {
|
|
1129
|
+
var se2 = Xn[ce2];
|
|
1130
|
+
M2 += pr(e2, d2) & (1 << se2) - 1, d2 += se2;
|
|
1125
1131
|
}
|
|
1126
1132
|
if (d2 > _2) {
|
|
1127
|
-
c2 &&
|
|
1133
|
+
c2 && _r(0);
|
|
1128
1134
|
break;
|
|
1129
1135
|
}
|
|
1130
1136
|
s2 && l2(f2 + 131072);
|
|
1131
|
-
var
|
|
1132
|
-
if (f2 <
|
|
1133
|
-
var
|
|
1134
|
-
for (
|
|
1137
|
+
var le2 = f2 + oe2;
|
|
1138
|
+
if (f2 < M2) {
|
|
1139
|
+
var ue2 = a2 - M2, de2 = Math.min(M2, le2);
|
|
1140
|
+
for (ue2 + f2 < 0 && _r(3); f2 < de2; ++f2) n2[f2] = r2[ue2 + f2];
|
|
1135
1141
|
}
|
|
1136
|
-
for (; f2 <
|
|
1142
|
+
for (; f2 < le2; ++f2) n2[f2] = n2[f2 - M2];
|
|
1137
1143
|
}
|
|
1138
1144
|
}
|
|
1139
|
-
t2.l = p2, t2.p =
|
|
1145
|
+
t2.l = p2, t2.p = ie2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
|
|
1140
1146
|
} while (!u2);
|
|
1141
|
-
return f2 != n2.length && o2 ?
|
|
1147
|
+
return f2 != n2.length && o2 ? hr(n2, 0, f2) : n2.subarray(0, f2);
|
|
1142
1148
|
};
|
|
1143
|
-
var
|
|
1144
|
-
var
|
|
1145
|
-
(e2[0] != 31 || e2[1] != 139 || e2[2] != 8) &&
|
|
1149
|
+
var yr = new K(0);
|
|
1150
|
+
var br = function(e2) {
|
|
1151
|
+
(e2[0] != 31 || e2[1] != 139 || e2[2] != 8) && _r(6, `invalid gzip data`);
|
|
1146
1152
|
var t2 = e2[3], n2 = 10;
|
|
1147
1153
|
t2 & 4 && (n2 += (e2[10] | e2[11] << 8) + 2);
|
|
1148
1154
|
for (var r2 = (t2 >> 3 & 1) + (t2 >> 4 & 1); r2 > 0; r2 -= !e2[n2++]) ;
|
|
1149
1155
|
return n2 + (t2 & 2);
|
|
1150
1156
|
};
|
|
1151
|
-
var
|
|
1157
|
+
var xr = function(e2) {
|
|
1152
1158
|
var t2 = e2.length;
|
|
1153
1159
|
return (e2[t2 - 4] | e2[t2 - 3] << 8 | e2[t2 - 2] << 16 | e2[t2 - 1] << 24) >>> 0;
|
|
1154
1160
|
};
|
|
1155
|
-
function
|
|
1156
|
-
var n2 =
|
|
1157
|
-
return n2 + 8 > e2.length &&
|
|
1161
|
+
function Sr(e2, t2) {
|
|
1162
|
+
var n2 = br(e2);
|
|
1163
|
+
return n2 + 8 > e2.length && _r(6, `invalid gzip data`), vr(e2.subarray(n2, -8), { i: 2 }, t2 && t2.out || new K(xr(e2)), t2 && t2.dictionary);
|
|
1158
1164
|
}
|
|
1159
|
-
var
|
|
1165
|
+
var Cr = typeof TextDecoder < `u` && new TextDecoder();
|
|
1160
1166
|
try {
|
|
1161
|
-
|
|
1167
|
+
Cr.decode(yr, { stream: true });
|
|
1162
1168
|
} catch {
|
|
1163
1169
|
}
|
|
1164
|
-
var
|
|
1165
|
-
var
|
|
1170
|
+
var wr = /* @__PURE__ */ new Set([`APPOINTMENT`, `CLASS`, `COURSE`]);
|
|
1171
|
+
var Tr = new Set(dn);
|
|
1166
1172
|
function J(e2) {
|
|
1167
1173
|
return typeof e2 == `string` ? e2 : void 0;
|
|
1168
1174
|
}
|
|
1169
|
-
function
|
|
1175
|
+
function Er(e2) {
|
|
1170
1176
|
return typeof e2 == `number` && Number.isFinite(e2) ? e2 : void 0;
|
|
1171
1177
|
}
|
|
1172
|
-
function
|
|
1178
|
+
function Dr(e2) {
|
|
1173
1179
|
return typeof e2 == `boolean` ? e2 : void 0;
|
|
1174
1180
|
}
|
|
1175
|
-
function
|
|
1181
|
+
function Or(e2) {
|
|
1176
1182
|
if (Array.isArray(e2)) return e2.filter((e3) => typeof e3 == `string`);
|
|
1177
1183
|
}
|
|
1178
|
-
function
|
|
1184
|
+
function kr(e2) {
|
|
1179
1185
|
return typeof e2 == `object` && !!e2;
|
|
1180
1186
|
}
|
|
1181
|
-
function
|
|
1182
|
-
if (!
|
|
1187
|
+
function Ar(e2) {
|
|
1188
|
+
if (!kr(e2)) return null;
|
|
1183
1189
|
let t2 = J(e2.t);
|
|
1184
1190
|
if (t2 === void 0) return null;
|
|
1185
|
-
let n2 = { type: t2, ids:
|
|
1191
|
+
let n2 = { type: t2, ids: Or(e2.d) ?? [] }, r2 = Dr(e2.n);
|
|
1186
1192
|
return r2 !== void 0 && (n2.anyResource = r2), n2;
|
|
1187
1193
|
}
|
|
1188
|
-
function
|
|
1189
|
-
if (!
|
|
1190
|
-
let t2 =
|
|
1194
|
+
function jr(e2) {
|
|
1195
|
+
if (!kr(e2)) return null;
|
|
1196
|
+
let t2 = Er(e2.p), n2 = Or(e2.h);
|
|
1191
1197
|
if (t2 === void 0 && n2 === void 0) return null;
|
|
1192
1198
|
let r2 = {};
|
|
1193
1199
|
return t2 !== void 0 && (r2.numberOfParticipants = t2), n2 !== void 0 && (r2.choices = n2), r2;
|
|
1194
1200
|
}
|
|
1195
|
-
function
|
|
1196
|
-
if (!
|
|
1197
|
-
let t2 = J(e2.i), n2 =
|
|
1201
|
+
function Mr(e2) {
|
|
1202
|
+
if (!kr(e2)) return null;
|
|
1203
|
+
let t2 = J(e2.i), n2 = Er(e2.q);
|
|
1198
1204
|
return t2 === void 0 || n2 === void 0 ? null : { id: t2, quantity: n2 };
|
|
1199
1205
|
}
|
|
1200
|
-
function
|
|
1206
|
+
function Nr(e2, t2) {
|
|
1201
1207
|
if (!Array.isArray(e2)) return;
|
|
1202
1208
|
let n2 = e2.map(t2).filter((e3) => e3 !== null);
|
|
1203
1209
|
return n2.length ? n2 : void 0;
|
|
1204
1210
|
}
|
|
1205
|
-
function
|
|
1206
|
-
if (!
|
|
1211
|
+
function Pr(e2) {
|
|
1212
|
+
if (!kr(e2)) return null;
|
|
1207
1213
|
let t2 = J(e2.i);
|
|
1208
1214
|
if (t2 === void 0) return null;
|
|
1209
1215
|
let n2 = { serviceId: t2 }, r2 = J(e2.g);
|
|
1210
1216
|
r2 !== void 0 && (n2.slug = r2);
|
|
1211
1217
|
let i2 = function(e3) {
|
|
1212
1218
|
let t3 = J(e3);
|
|
1213
|
-
if (t3 !== void 0 &&
|
|
1219
|
+
if (t3 !== void 0 && wr.has(t3)) return t3;
|
|
1214
1220
|
}(e2.y);
|
|
1215
1221
|
i2 !== void 0 && (n2.serviceType = i2);
|
|
1216
1222
|
let a2 = J(e2.t0);
|
|
@@ -1227,95 +1233,95 @@ function jr(e2) {
|
|
|
1227
1233
|
u2 !== void 0 && (n2.locationId = u2);
|
|
1228
1234
|
let d2 = J(e2.lt);
|
|
1229
1235
|
d2 !== `BUSINESS` && d2 !== `CUSTOM` && d2 !== `CUSTOMER` || (n2.locationType = d2);
|
|
1230
|
-
let f2 =
|
|
1236
|
+
let f2 = Nr(e2.r, Ar);
|
|
1231
1237
|
f2 && (n2.resources = f2);
|
|
1232
|
-
let p2 =
|
|
1238
|
+
let p2 = Nr(e2.x, jr);
|
|
1233
1239
|
p2 && (n2.selectedVariants = p2);
|
|
1234
|
-
let m2 =
|
|
1240
|
+
let m2 = Nr(e2.a, Mr);
|
|
1235
1241
|
m2 && (n2.addOns = m2);
|
|
1236
1242
|
let h2 = J(e2.dc);
|
|
1237
1243
|
h2 && (n2.durationChoiceId = h2);
|
|
1238
|
-
let g2 =
|
|
1244
|
+
let g2 = Er(e2.dm);
|
|
1239
1245
|
g2 !== void 0 && Number.isInteger(g2) && g2 > 0 && (n2.durationInMinutes = g2);
|
|
1240
1246
|
let _2 = J(e2.rg);
|
|
1241
|
-
return _2 !== void 0 &&
|
|
1247
|
+
return _2 !== void 0 && Tr.has(_2) && (n2.requestedGender = _2), n2;
|
|
1242
1248
|
}
|
|
1243
|
-
function
|
|
1244
|
-
if (!
|
|
1249
|
+
function Fr(e2) {
|
|
1250
|
+
if (!kr(e2)) return null;
|
|
1245
1251
|
let t2 = J(e2.m);
|
|
1246
1252
|
if (t2 !== `single` && t2 !== `multi` || !Array.isArray(e2.s)) return null;
|
|
1247
|
-
let n2 = { mode: t2, services: e2.s.map(
|
|
1248
|
-
return r2 !== void 0 && (n2.timezone = r2), true ===
|
|
1253
|
+
let n2 = { mode: t2, services: e2.s.map(Pr).filter((e3) => e3 !== null) }, r2 = J(e2.z);
|
|
1254
|
+
return r2 !== void 0 && (n2.timezone = r2), true === Dr(e2.cp) && (n2.wantsPromoCode = true), n2;
|
|
1249
1255
|
}
|
|
1250
1256
|
new TextEncoder();
|
|
1251
|
-
var
|
|
1252
|
-
function
|
|
1257
|
+
var Ir = new TextDecoder();
|
|
1258
|
+
function Lr(e2) {
|
|
1253
1259
|
if (!e2 || e2.length < 2) return null;
|
|
1254
1260
|
try {
|
|
1255
|
-
let t2 = e2[0], n2 =
|
|
1261
|
+
let t2 = e2[0], n2 = Kn.toUint8Array(e2.slice(1)), r2;
|
|
1256
1262
|
if (t2 === `1`) r2 = n2;
|
|
1257
1263
|
else {
|
|
1258
1264
|
if (t2 !== `2`) return null;
|
|
1259
|
-
r2 =
|
|
1265
|
+
r2 = Sr(n2);
|
|
1260
1266
|
}
|
|
1261
|
-
return
|
|
1267
|
+
return Fr(JSON.parse(Ir.decode(r2)));
|
|
1262
1268
|
} catch {
|
|
1263
1269
|
return null;
|
|
1264
1270
|
}
|
|
1265
1271
|
}
|
|
1266
|
-
function
|
|
1272
|
+
function Rr(e2) {
|
|
1267
1273
|
return e2;
|
|
1268
1274
|
}
|
|
1269
|
-
var
|
|
1270
|
-
var
|
|
1271
|
-
var
|
|
1272
|
-
var
|
|
1273
|
-
var
|
|
1274
|
-
var
|
|
1275
|
-
var
|
|
1276
|
-
var
|
|
1277
|
-
var
|
|
1278
|
-
var
|
|
1275
|
+
var zr = Rr(`@wix/site-service-editor-context`);
|
|
1276
|
+
var Br = Rr(`@wix/site-service-pages`);
|
|
1277
|
+
var Vr = Rr(`@wix/site-service-router`);
|
|
1278
|
+
var Hr = Rr(`@wix/site-service-url`);
|
|
1279
|
+
var Ur = Rr(`@wix/site-service-renderer-configuration`);
|
|
1280
|
+
var Wr = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
|
|
1281
|
+
var Gr = `shopping_cart`;
|
|
1282
|
+
var Kr = `thank_you_page`;
|
|
1283
|
+
var qr = `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`;
|
|
1284
|
+
var Jr = function(e2) {
|
|
1279
1285
|
return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
|
|
1280
1286
|
}({});
|
|
1281
|
-
var
|
|
1282
|
-
var
|
|
1283
|
-
var
|
|
1284
|
-
var
|
|
1287
|
+
var Yr = `{{(.*?)}}`;
|
|
1288
|
+
var Xr = `[{{}}]`;
|
|
1289
|
+
var Zr = `([^/]+)`;
|
|
1290
|
+
var Qr;
|
|
1285
1291
|
(function(e2) {
|
|
1286
1292
|
e2.product_page = `product_page`, e2.blog = `blog`, e2.post = `post`, e2.forum = `forum`, e2.group = `group`, e2.bookings = `Booking Service Page`, e2.challenges = `challenge_page`;
|
|
1287
|
-
})(
|
|
1293
|
+
})(Qr ||= {});
|
|
1288
1294
|
var Y;
|
|
1289
1295
|
(function(e2) {
|
|
1290
1296
|
e2.PRODUCT_PAGE = `wix.stores.sub_pages.product`, e2.BLOG_POST = `wix.blog.sub_pages.post`, e2.BLOG_POST_EDIT = `wix.blog.sub_pages.post.edit`, e2.BLOG_POST_PREVIEW = `wix.blog.sub_pages.post.preview`, e2.BLOG_CATEGORY = `wix.blog.sub_pages.category`, e2.FORUM_CATEGORY = `wix.forum.sub_pages.category`, e2.FORUM_CATEGORY_PAGINATION = `wix.forum.sub_pages.category.pagination`, e2.FORUM_CATEGORY_CREATE_POST = `wix.forum.sub_pages.category.create-post`, e2.FORUM_CATEGORY_CREATE_QUESTION = `wix.forum.sub_pages.category.create-question`, e2.FORUM_POST = `wix.forum.sub_pages.post`, e2.FORUM_POST_EDIT = `wix.forum.sub_pages.post.edit`, e2.FORUM_POST_PAGINATION = `wix.forum.sub_pages.post.pagination`, e2.FORUM_POST_DEEP_LINK_DATA = `wix.forum.sub_pages.post.deep-link-data`, e2.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA = `wix.forum.sub_pages.post.pagination-and-deep-link-data`, e2.GROUP = `wix.groups.sub_pages.group`, e2.GROUP_POST = `wix.groups.sub_pages.post`, e2.BOOKINGS_SERVICE = `wix.bookings.sub_pages.service_page`, e2.CHALLENGES_PAGE = `wix.online_programs.sub_pages.online_program`;
|
|
1291
1297
|
})(Y ||= {});
|
|
1292
|
-
var Xr = {};
|
|
1293
|
-
var Zr = (Xr[Y.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Xr);
|
|
1294
|
-
var Qr = `{{main-mapping}}`;
|
|
1295
1298
|
var $r = {};
|
|
1296
|
-
var ei;
|
|
1297
|
-
var ti =
|
|
1299
|
+
var ei = ($r[Y.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, $r);
|
|
1300
|
+
var ti = `{{main-mapping}}`;
|
|
1298
1301
|
var ni = {};
|
|
1299
|
-
var ri
|
|
1300
|
-
var ii = {};
|
|
1301
|
-
var ai;
|
|
1302
|
-
var oi;
|
|
1303
|
-
var si =
|
|
1304
|
-
var ci
|
|
1305
|
-
var li
|
|
1306
|
-
var ui = {};
|
|
1307
|
-
var di =
|
|
1308
|
-
var fi = {};
|
|
1309
|
-
var pi =
|
|
1310
|
-
var mi = {};
|
|
1311
|
-
var hi =
|
|
1312
|
-
var gi =
|
|
1313
|
-
|
|
1302
|
+
var ri;
|
|
1303
|
+
var ii = (ni[Y.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (ri = {}, ri[Y.BLOG_POST_EDIT] = { defaultMapping: `${ti}/edit` }, ri[Y.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${ti}/preview/{{instance}}` }, ri) }, ni);
|
|
1304
|
+
var ai = {};
|
|
1305
|
+
var oi = (ai[Y.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, ai);
|
|
1306
|
+
var si = {};
|
|
1307
|
+
var ci;
|
|
1308
|
+
var li;
|
|
1309
|
+
var ui = (si[Y.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (ci = {}, ci[Y.FORUM_POST_EDIT] = { defaultMapping: `${ti}/edit` }, ci[Y.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${ti}/p-{{page}}` }, ci[Y.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${ti}/dl-{{deepLinkData}}` }, ci[Y.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${ti}/p-{{page}}/dl-{{deepLinkData}}` }, ci) }, si[Y.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (li = {}, li[Y.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${ti}/create-post` }, li[Y.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${ti}/create-question` }, li[Y.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${ti}/p-{{page}}` }, li) }, si);
|
|
1310
|
+
var di = {};
|
|
1311
|
+
var fi = (di[Y.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, di[Y.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, di);
|
|
1312
|
+
var pi = {};
|
|
1313
|
+
var mi = (pi[Y.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, pi);
|
|
1314
|
+
var hi = {};
|
|
1315
|
+
var gi = (hi[Y.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, hi);
|
|
1316
|
+
var _i = {};
|
|
1317
|
+
var vi = (_i[Qr.product_page] = ei, _i[Qr.post] = ii, _i[Qr.blog] = oi, _i[Qr.forum] = ui, _i[Qr.group] = fi, _i[Qr.bookings] = mi, _i[Qr.challenges] = gi, _i);
|
|
1318
|
+
var yi = function() {
|
|
1319
|
+
return yi = Object.assign || function(e2) {
|
|
1314
1320
|
for (var t2, n2 = 1, r2 = arguments.length; n2 < r2; n2++) for (var i2 in t2 = arguments[n2], t2) Object.prototype.hasOwnProperty.call(t2, i2) && (e2[i2] = t2[i2]);
|
|
1315
1321
|
return e2;
|
|
1316
|
-
},
|
|
1322
|
+
}, yi.apply(this, arguments);
|
|
1317
1323
|
};
|
|
1318
|
-
function
|
|
1324
|
+
function bi(e2) {
|
|
1319
1325
|
var t2 = typeof Symbol == `function` && Symbol.iterator, n2 = t2 && e2[t2], r2 = 0;
|
|
1320
1326
|
if (n2) return n2.call(e2);
|
|
1321
1327
|
if (e2 && typeof e2.length == `number`) return { next: function() {
|
|
@@ -1340,138 +1346,138 @@ function X(e2, t2) {
|
|
|
1340
1346
|
}
|
|
1341
1347
|
return a2;
|
|
1342
1348
|
}
|
|
1343
|
-
function
|
|
1349
|
+
function xi(e2, t2, n2) {
|
|
1344
1350
|
if (n2 || arguments.length === 2) for (var r2 = 0, i2 = t2.length, a2; r2 < i2; r2++) (a2 || !(r2 in t2)) && (a2 ||= Array.prototype.slice.call(t2, 0, r2), a2[r2] = t2[r2]);
|
|
1345
1351
|
return e2.concat(a2 || Array.prototype.slice.call(t2));
|
|
1346
1352
|
}
|
|
1347
|
-
var
|
|
1348
|
-
return Object.values(
|
|
1353
|
+
var Si = function(e2) {
|
|
1354
|
+
return Object.values(Ci()).some(function(t2) {
|
|
1349
1355
|
return !!t2?.subMappings?.[e2];
|
|
1350
1356
|
});
|
|
1351
1357
|
};
|
|
1352
|
-
var
|
|
1353
|
-
return Object.values(
|
|
1354
|
-
return
|
|
1358
|
+
var Ci = function() {
|
|
1359
|
+
return Object.values(vi).reduce(function(e2, t2) {
|
|
1360
|
+
return yi(yi({}, e2), t2);
|
|
1355
1361
|
}, {}) || {};
|
|
1356
1362
|
};
|
|
1357
|
-
var
|
|
1358
|
-
var t2 =
|
|
1359
|
-
return !t2 &&
|
|
1363
|
+
var wi = function(e2) {
|
|
1364
|
+
var t2 = Ci()[e2];
|
|
1365
|
+
return !t2 && Si(e2) && console.warn(`You cannot get variables schema for subMappings key (${e2}).`), t2;
|
|
1360
1366
|
};
|
|
1361
|
-
var
|
|
1362
|
-
return Object.entries(
|
|
1367
|
+
var Ti = function(e2) {
|
|
1368
|
+
return Object.entries(vi).filter(function(t2) {
|
|
1363
1369
|
var n2 = X(t2, 2)[1];
|
|
1364
1370
|
return Object.keys(n2).includes(e2);
|
|
1365
1371
|
}).map(function(e3) {
|
|
1366
1372
|
return X(e3, 1)[0];
|
|
1367
1373
|
})[0];
|
|
1368
1374
|
};
|
|
1369
|
-
var
|
|
1370
|
-
return Object.entries(
|
|
1375
|
+
var Ei = function(e2) {
|
|
1376
|
+
return Object.entries(Ci()).find(function(t2) {
|
|
1371
1377
|
var n2 = X(t2, 2);
|
|
1372
1378
|
return n2[0], !!n2[1]?.subMappings?.[e2];
|
|
1373
1379
|
});
|
|
1374
1380
|
};
|
|
1375
|
-
var
|
|
1381
|
+
var Di = function(e2) {
|
|
1376
1382
|
var t2 = [];
|
|
1377
|
-
if (
|
|
1378
|
-
var n2 = X(
|
|
1383
|
+
if (Si(e2)) {
|
|
1384
|
+
var n2 = X(Ei(e2), 2);
|
|
1379
1385
|
n2[0];
|
|
1380
1386
|
var r2 = n2[1];
|
|
1381
|
-
t2.push.apply(t2,
|
|
1382
|
-
} else t2.push.apply(t2,
|
|
1387
|
+
t2.push.apply(t2, xi(xi([], X(r2?.required || []), false), X(r2?.subMappings?.[e2]?.required || []), false));
|
|
1388
|
+
} else t2.push.apply(t2, xi([], X(wi(e2)?.required || []), false));
|
|
1383
1389
|
return t2;
|
|
1384
1390
|
};
|
|
1385
|
-
var
|
|
1391
|
+
var Oi = function(e2, t2) {
|
|
1386
1392
|
var n2;
|
|
1387
1393
|
return t2 === void 0 && (t2 = ``), (n2 = e2?.main)?.find?.call(n2, function(e3) {
|
|
1388
1394
|
return e3.key === t2;
|
|
1389
1395
|
});
|
|
1390
1396
|
};
|
|
1391
|
-
var
|
|
1397
|
+
var ki = function(e2, t2) {
|
|
1392
1398
|
return Error(`Url Mappings Error - [${e2}]: ${t2}`);
|
|
1393
1399
|
};
|
|
1394
|
-
var
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1397
|
-
if (typeof e2 != `string` || !
|
|
1400
|
+
var Ai = Object.values(Y);
|
|
1401
|
+
var ji = ki(`key`, `must be one of: ${Ai.toString()}`);
|
|
1402
|
+
var Mi = function(e2) {
|
|
1403
|
+
if (typeof e2 != `string` || !Ai.includes(e2)) return ji;
|
|
1398
1404
|
};
|
|
1399
|
-
var
|
|
1400
|
-
var
|
|
1405
|
+
var Ni = ki(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
|
|
1406
|
+
var Pi = function(e2) {
|
|
1401
1407
|
if (typeof e2 != `object` || !e2 || !Object.values(e2).every(function(e3) {
|
|
1402
1408
|
return typeof e3 == `string`;
|
|
1403
|
-
}) || Array.isArray(e2)) return
|
|
1409
|
+
}) || Array.isArray(e2)) return Ni;
|
|
1404
1410
|
};
|
|
1405
|
-
var
|
|
1406
|
-
var
|
|
1411
|
+
var Fi = ki(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
|
|
1412
|
+
var Ii = function(e2, t2) {
|
|
1407
1413
|
try {
|
|
1408
|
-
var n2 =
|
|
1414
|
+
var n2 = Di(e2);
|
|
1409
1415
|
if (!n2.every(function(e3) {
|
|
1410
1416
|
return !!t2[e3];
|
|
1411
1417
|
}) || !n2.length) throw Error();
|
|
1412
1418
|
} catch {
|
|
1413
|
-
return
|
|
1419
|
+
return Fi;
|
|
1414
1420
|
}
|
|
1415
1421
|
};
|
|
1416
|
-
var
|
|
1422
|
+
var Li = function(e2) {
|
|
1417
1423
|
var t2 = e2.key, n2 = e2.itemData;
|
|
1418
|
-
return [
|
|
1424
|
+
return [Mi(t2), Pi(n2), Ii(t2, n2)].find(Boolean);
|
|
1419
1425
|
};
|
|
1420
|
-
var
|
|
1426
|
+
var Ri = function(e2) {
|
|
1421
1427
|
return function(t2) {
|
|
1422
|
-
var n2 = new RegExp(
|
|
1428
|
+
var n2 = new RegExp(Xr, `g`), r2 = t2.replace(n2, ``);
|
|
1423
1429
|
return e2?.[r2];
|
|
1424
1430
|
};
|
|
1425
1431
|
};
|
|
1426
|
-
var
|
|
1432
|
+
var zi = function(e2, t2, n2, r2) {
|
|
1427
1433
|
e2 === void 0 && (e2 = { main: [] }), r2 === void 0 && (r2 = {});
|
|
1428
|
-
var i2 =
|
|
1434
|
+
var i2 = Li({ key: t2, itemData: n2 });
|
|
1429
1435
|
if (i2) throw i2;
|
|
1430
|
-
var a2 = (
|
|
1436
|
+
var a2 = (Oi(e2, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
|
|
1431
1437
|
if (o2 ??= ``, o2 = o2.endsWith(`/`) ? o2?.slice(0, -1) : o2, a2 && typeof a2 == `string`) {
|
|
1432
|
-
var s2 = new RegExp(
|
|
1438
|
+
var s2 = new RegExp(Yr, `g`), c2 = a2.replace(s2, Ri(n2));
|
|
1433
1439
|
return o2.concat(`/${c2}`);
|
|
1434
1440
|
}
|
|
1435
1441
|
};
|
|
1436
|
-
var
|
|
1437
|
-
var
|
|
1438
|
-
var t2 = e2.replace(
|
|
1442
|
+
var Bi = /[.*+?^$()|]/g;
|
|
1443
|
+
var Vi = function(e2) {
|
|
1444
|
+
var t2 = e2.replace(Bi, `\\$&`).replace(new RegExp(Yr, `g`), Zr);
|
|
1439
1445
|
return RegExp(`^${t2}$`);
|
|
1440
1446
|
};
|
|
1441
|
-
var
|
|
1447
|
+
var Hi = function(e2, t2) {
|
|
1442
1448
|
return e2 === void 0 && (e2 = []), e2.find(function(e3) {
|
|
1443
|
-
return
|
|
1449
|
+
return Vi(e3).test(t2);
|
|
1444
1450
|
});
|
|
1445
1451
|
};
|
|
1446
|
-
|
|
1447
|
-
var
|
|
1452
|
+
ki(`url`, `Url must be a string`);
|
|
1453
|
+
var Ui = function(e2) {
|
|
1448
1454
|
return [` `, ` `, `
|
|
1449
1455
|
`].every(function(t2) {
|
|
1450
1456
|
return !e2?.includes?.call(e2, t2);
|
|
1451
1457
|
});
|
|
1452
1458
|
};
|
|
1453
|
-
var
|
|
1454
|
-
return e2?.length <=
|
|
1459
|
+
var Wi = function(e2) {
|
|
1460
|
+
return e2?.length <= na.MAX_URL_MAPPING_LENGTH;
|
|
1455
1461
|
};
|
|
1456
|
-
var
|
|
1462
|
+
var Gi = function(e2) {
|
|
1457
1463
|
return e2?.split(`/`).every(Boolean);
|
|
1458
1464
|
};
|
|
1459
|
-
var
|
|
1465
|
+
var Ki = function(e2, t2) {
|
|
1460
1466
|
var n2 = t2.urlMappingKey;
|
|
1461
|
-
return
|
|
1467
|
+
return Di(n2)?.every(function(t3) {
|
|
1462
1468
|
return e2?.includes(`{{${t3}}}`);
|
|
1463
1469
|
});
|
|
1464
1470
|
};
|
|
1465
|
-
var
|
|
1466
|
-
return (e2.match(new RegExp(
|
|
1471
|
+
var qi = function(e2) {
|
|
1472
|
+
return (e2.match(new RegExp(Yr, `g`))?.length || 0) <= 1;
|
|
1467
1473
|
};
|
|
1468
|
-
var
|
|
1469
|
-
return e2?.split(`/`).every(
|
|
1474
|
+
var Ji = function(e2) {
|
|
1475
|
+
return e2?.split(`/`).every(qi);
|
|
1470
1476
|
};
|
|
1471
|
-
var
|
|
1477
|
+
var Yi = function(e2) {
|
|
1472
1478
|
return [e2.publishedPrefix, e2.savedPrefix].filter(Boolean);
|
|
1473
1479
|
};
|
|
1474
|
-
var
|
|
1480
|
+
var Xi = function(e2, t2) {
|
|
1475
1481
|
return t2 === void 0 && (t2 = []), function(n2, r2) {
|
|
1476
1482
|
var i2 = n2.split(`/`), a2 = n2 === r2;
|
|
1477
1483
|
if (i2.length < 1 || a2) return true;
|
|
@@ -1481,49 +1487,49 @@ var qi = function(e2, t2) {
|
|
|
1481
1487
|
});
|
|
1482
1488
|
};
|
|
1483
1489
|
};
|
|
1484
|
-
var
|
|
1490
|
+
var Zi = function(e2, t2) {
|
|
1485
1491
|
var n2 = t2.pathPrefixes;
|
|
1486
|
-
return
|
|
1492
|
+
return Xi(Object.values(n2).map(function(e3) {
|
|
1487
1493
|
return e3.publishedPrefix;
|
|
1488
|
-
}).filter(Boolean),
|
|
1494
|
+
}).filter(Boolean), Yi(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
|
|
1489
1495
|
};
|
|
1490
|
-
var
|
|
1496
|
+
var Qi = function(e2, t2) {
|
|
1491
1497
|
var n2 = t2.urlMappingKey, r2 = t2.urlMappings;
|
|
1492
|
-
return !
|
|
1498
|
+
return !Hi(r2.main?.filter(function(e3) {
|
|
1493
1499
|
return n2 !== e3.key;
|
|
1494
1500
|
}).map(function(e3) {
|
|
1495
1501
|
return e3.mapping;
|
|
1496
1502
|
}), e2);
|
|
1497
1503
|
};
|
|
1498
|
-
var
|
|
1499
|
-
e2 = e2.replace(new RegExp(
|
|
1504
|
+
var $i = function(e2) {
|
|
1505
|
+
e2 = e2.replace(new RegExp(Yr, `ig`), ``);
|
|
1500
1506
|
var t2 = new RegExp(/[^\]_.~!*'();:@&=+$,<>\\#^%?`"]/, `g`), n2 = !/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g.test(e2), r2 = !e2.replace(t2, ``);
|
|
1501
1507
|
return n2 && r2;
|
|
1502
1508
|
};
|
|
1503
|
-
var
|
|
1509
|
+
var ea = function(e2) {
|
|
1504
1510
|
var t2 = X(e2, 1)[0], n2 = e2.slice(-1);
|
|
1505
1511
|
return t2 !== `/` && n2 !== `/`;
|
|
1506
1512
|
};
|
|
1507
|
-
var
|
|
1513
|
+
var ta = function(e2, t2) {
|
|
1508
1514
|
var n2 = t2.pathPrefixes;
|
|
1509
|
-
return
|
|
1515
|
+
return Xi(Object.values(n2).map(function(e3) {
|
|
1510
1516
|
return e3.savedPrefix;
|
|
1511
|
-
}).filter(Boolean),
|
|
1517
|
+
}).filter(Boolean), Yi(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
|
|
1512
1518
|
};
|
|
1513
1519
|
var Z;
|
|
1514
1520
|
(function(e2) {
|
|
1515
1521
|
e2.MAX_LENGTH_ERROR = `MAX_LENGTH_ERROR`, e2.NO_SPACES_ERROR = `NO_SPACES_ERROR`, e2.NO_EMPTY_SEGMENT_ERROR = `NO_EMPTY_SEGMENT_ERROR`, e2.CONTAIN_MAIN_VARIABLE_ERROR = `CONTAIN_MAIN_VARIABLE_ERROR`, e2.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR = `ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR`, e2.ONLY_UNIQUE_PUBLISHED_URL_ERROR = `ONLY_UNIQUE_PUBLISHED_URL_ERROR`, e2.ONLY_UNIQUE_SAVED_URL_ERROR = `ONLY_UNIQUE_SAVED_URL_ERROR`, e2.ONLY_UNIQUE_MAPPING_ERROR = `ONLY_UNIQUE_MAPPING_ERROR`, e2.NO_INVALID_CHARACTERS_ERROR = `NO_INVALID_CHARACTERS_ERROR`, e2.NO_STARTING_OR_ENDING_SLASH_ERROR = `NO_STARTING_OR_ENDING_SLASH_ERROR`;
|
|
1516
1522
|
})(Z ||= {});
|
|
1517
|
-
var
|
|
1523
|
+
var na = function() {
|
|
1518
1524
|
function e2(e3) {
|
|
1519
1525
|
var t2 = e3.urlMappingKey, n2 = e3.pathPrefixes, r2 = e3.urlMappings, i2 = this;
|
|
1520
1526
|
this.initValidators = function() {
|
|
1521
|
-
i2.validators = [[
|
|
1522
|
-
}, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping =
|
|
1527
|
+
i2.validators = [[Wi, Z.MAX_LENGTH_ERROR], [Ui, Z.NO_SPACES_ERROR], [ea, Z.NO_STARTING_OR_ENDING_SLASH_ERROR], [Gi, Z.NO_EMPTY_SEGMENT_ERROR], [$i, Z.NO_INVALID_CHARACTERS_ERROR], [Ki, Z.CONTAIN_MAIN_VARIABLE_ERROR], [Ji, Z.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [Zi, Z.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [ta, Z.ONLY_UNIQUE_SAVED_URL_ERROR], [Qi, Z.ONLY_UNIQUE_MAPPING_ERROR]];
|
|
1528
|
+
}, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = ra(t2, this.pathPrefix), this.initValidators();
|
|
1523
1529
|
}
|
|
1524
1530
|
return e2.prototype.getPathPrefix = function() {
|
|
1525
|
-
var t2 =
|
|
1526
|
-
if (!t2) throw
|
|
1531
|
+
var t2 = Ti(this.urlMappingKey);
|
|
1532
|
+
if (!t2) throw Si(this.urlMappingKey) ? Error(`Url Mapper Validator Error: Validator does not support sub mapping, please use the main url mapping key`) : Error(`Url Mapper Validator Error: Url mapping key is not supported (${this.urlMappingKey})`);
|
|
1527
1533
|
return this.pathPrefixes[t2] || e2.FALLBACK_PATH_PREFIX;
|
|
1528
1534
|
}, Object.defineProperty(e2.prototype, "validatorProps", { get: function() {
|
|
1529
1535
|
var e3 = this;
|
|
@@ -1531,7 +1537,7 @@ var $i = function() {
|
|
|
1531
1537
|
}, enumerable: false, configurable: true }), e2.prototype.validate = function(e3) {
|
|
1532
1538
|
var t2, n2;
|
|
1533
1539
|
try {
|
|
1534
|
-
for (var r2 =
|
|
1540
|
+
for (var r2 = bi(this.validators), i2 = r2.next(); !i2.done; i2 = r2.next()) {
|
|
1535
1541
|
var a2 = X(i2.value, 2), o2 = a2[0], s2 = a2[1], c2 = !!o2(e3, this.validatorProps);
|
|
1536
1542
|
if (!c2) return { isValid: c2, error: s2 };
|
|
1537
1543
|
}
|
|
@@ -1547,265 +1553,268 @@ var $i = function() {
|
|
|
1547
1553
|
return { isValid: true };
|
|
1548
1554
|
}, e2.errorArray = Object.values(Z), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
|
|
1549
1555
|
}();
|
|
1550
|
-
var
|
|
1551
|
-
var n2 =
|
|
1552
|
-
return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix =
|
|
1556
|
+
var ra = function(e2, t2) {
|
|
1557
|
+
var n2 = Ci()[e2] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
|
|
1558
|
+
return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = na.FALLBACK_PATH_PREFIX, a2.publishedPrefix = na.FALLBACK_PATH_PREFIX), { defaultSaved: xi([a2.savedPrefix, i2], X(r2?.map(function(e3) {
|
|
1553
1559
|
return `{{${e3}}}`;
|
|
1554
|
-
})), false).filter(Boolean).join(`/`), defaultPublished:
|
|
1560
|
+
})), false).filter(Boolean).join(`/`), defaultPublished: xi([a2.publishedPrefix, i2], X(r2?.map(function(e3) {
|
|
1555
1561
|
return `{{${e3}}}`;
|
|
1556
1562
|
})), false).filter(Boolean).join(`/`) };
|
|
1557
1563
|
};
|
|
1558
|
-
function
|
|
1559
|
-
return t2 ?
|
|
1564
|
+
function ia(e2, t2) {
|
|
1565
|
+
return t2 ? zi(e2, Y.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
|
|
1560
1566
|
}
|
|
1561
|
-
var
|
|
1562
|
-
var
|
|
1563
|
-
function
|
|
1564
|
-
return
|
|
1567
|
+
var aa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
|
|
1568
|
+
var oa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
|
|
1569
|
+
function sa(e2) {
|
|
1570
|
+
return wt(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` }] } }));
|
|
1565
1571
|
}
|
|
1566
|
-
var
|
|
1567
|
-
function
|
|
1572
|
+
var ca = `@wix/auto_sdk_bookings_availability-time-slots`;
|
|
1573
|
+
function la(e2) {
|
|
1568
1574
|
function t2({ host: t3 }) {
|
|
1569
|
-
let n2 =
|
|
1570
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName:
|
|
1575
|
+
let n2 = nt(e2, [{ transformFn: R, paths: aa }]);
|
|
1576
|
+
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName: ca, migrationOptions: { optInTransformResponse: true }, url: sa({ protoPath: `/v2/time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: oa }]) };
|
|
1571
1577
|
}
|
|
1572
1578
|
return t2;
|
|
1573
1579
|
}
|
|
1574
|
-
async function
|
|
1575
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1580
|
+
async function ua(e2) {
|
|
1581
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = la(L({ 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 }));
|
|
1576
1582
|
n2?.onSiteCall?.();
|
|
1577
1583
|
try {
|
|
1578
1584
|
let e3 = await t2.request(r2);
|
|
1579
|
-
return n2?.onSuccess?.(e3),
|
|
1585
|
+
return n2?.onSuccess?.(e3), Ue(e3.data);
|
|
1580
1586
|
} catch (e3) {
|
|
1581
|
-
let t3 =
|
|
1587
|
+
let t3 = dt(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`]);
|
|
1582
1588
|
throw n2?.onError?.(e3), t3;
|
|
1583
1589
|
}
|
|
1584
1590
|
}
|
|
1585
|
-
function
|
|
1586
|
-
return (t2) =>
|
|
1591
|
+
function da(e2) {
|
|
1592
|
+
return (t2) => ua(t2, { httpClient: e2 });
|
|
1587
1593
|
}
|
|
1588
|
-
var
|
|
1589
|
-
var
|
|
1590
|
-
var
|
|
1591
|
-
function
|
|
1592
|
-
return
|
|
1594
|
+
var fa = St(da);
|
|
1595
|
+
var pa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
|
|
1596
|
+
var ma = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }, { path: `schedulesInfo.firstSessionStart` }, { path: `schedulesInfo.lastSessionEnd` }, { path: `schedulesInfo.enrollmentViolations.earliestBookingDate` }];
|
|
1597
|
+
function ha(e2) {
|
|
1598
|
+
return wt(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` }] } }));
|
|
1593
1599
|
}
|
|
1594
|
-
var
|
|
1595
|
-
function
|
|
1600
|
+
var ga = `@wix/auto_sdk_bookings_event-time-slots`;
|
|
1601
|
+
function _a(e2) {
|
|
1596
1602
|
function t2({ host: t3 }) {
|
|
1597
|
-
let n2 =
|
|
1598
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName:
|
|
1603
|
+
let n2 = nt(e2, [{ transformFn: R, paths: pa }]);
|
|
1604
|
+
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName: ga, migrationOptions: { optInTransformResponse: true }, url: ha({ protoPath: `/v2/time-slots/event`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: ma }]) };
|
|
1599
1605
|
}
|
|
1600
1606
|
return t2;
|
|
1601
1607
|
}
|
|
1602
|
-
async function
|
|
1603
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1608
|
+
async function va(e2) {
|
|
1609
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = _a(L({ 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 }));
|
|
1604
1610
|
n2?.onSiteCall?.();
|
|
1605
1611
|
try {
|
|
1606
1612
|
let e3 = await t2.request(r2);
|
|
1607
|
-
return n2?.onSuccess?.(e3),
|
|
1613
|
+
return n2?.onSuccess?.(e3), Ue(e3.data);
|
|
1608
1614
|
} catch (e3) {
|
|
1609
|
-
let t3 =
|
|
1615
|
+
let t3 = dt(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`]);
|
|
1610
1616
|
throw n2?.onError?.(e3), t3;
|
|
1611
1617
|
}
|
|
1612
1618
|
}
|
|
1613
|
-
function
|
|
1614
|
-
return (t2) =>
|
|
1619
|
+
function ya(e2) {
|
|
1620
|
+
return (t2) => va(t2, { httpClient: e2 });
|
|
1615
1621
|
}
|
|
1616
|
-
var
|
|
1617
|
-
var
|
|
1618
|
-
var
|
|
1619
|
-
function
|
|
1620
|
-
return
|
|
1622
|
+
var ba = St(ya);
|
|
1623
|
+
var xa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
|
|
1624
|
+
var Sa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
|
|
1625
|
+
function Ca(e2) {
|
|
1626
|
+
return wt(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` }] } }));
|
|
1621
1627
|
}
|
|
1622
|
-
var
|
|
1623
|
-
function
|
|
1628
|
+
var wa = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
|
|
1629
|
+
function Ta(e2) {
|
|
1624
1630
|
function t2({ host: t3 }) {
|
|
1625
|
-
let n2 =
|
|
1626
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName:
|
|
1631
|
+
let n2 = nt(e2, [{ transformFn: R, paths: xa }]);
|
|
1632
|
+
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName: wa, migrationOptions: { optInTransformResponse: true }, url: Ca({ protoPath: `/v2/multi-service-time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: Sa }]) };
|
|
1627
1633
|
}
|
|
1628
1634
|
return t2;
|
|
1629
1635
|
}
|
|
1630
|
-
async function
|
|
1631
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1636
|
+
async function Ea(e2) {
|
|
1637
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ta(L({ 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 }));
|
|
1632
1638
|
n2?.onSiteCall?.();
|
|
1633
1639
|
try {
|
|
1634
1640
|
let e3 = await t2.request(r2);
|
|
1635
|
-
return n2?.onSuccess?.(e3),
|
|
1641
|
+
return n2?.onSuccess?.(e3), Ue(e3.data);
|
|
1636
1642
|
} catch (e3) {
|
|
1637
|
-
let t3 =
|
|
1643
|
+
let t3 = dt(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`]);
|
|
1638
1644
|
throw n2?.onError?.(e3), t3;
|
|
1639
1645
|
}
|
|
1640
1646
|
}
|
|
1641
|
-
function
|
|
1642
|
-
return (t2) =>
|
|
1647
|
+
function Da(e2) {
|
|
1648
|
+
return (t2) => Ea(t2, { httpClient: e2 });
|
|
1643
1649
|
}
|
|
1644
|
-
var
|
|
1645
|
-
var
|
|
1646
|
-
var
|
|
1647
|
-
var
|
|
1648
|
-
var
|
|
1649
|
-
var
|
|
1650
|
-
function
|
|
1651
|
-
return
|
|
1650
|
+
var Oa = St(Da);
|
|
1651
|
+
var ka = ((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))(ka || {});
|
|
1652
|
+
var Aa = ((e2) => (e2.APPOINTMENT = `APPOINTMENT`, e2.CLASS = `CLASS`, e2.COURSE = `COURSE`, e2))(Aa || {});
|
|
1653
|
+
var ja = ((e2) => (e2.FIXED = `FIXED`, e2.CUSTOM = `CUSTOM`, e2.VARIED = `VARIED`, e2.NO_FEE = `NO_FEE`, e2.SUBSCRIPTION = `SUBSCRIPTION`, e2))(ja || {});
|
|
1654
|
+
var Ma = ((e2) => (e2.CUSTOM = `CUSTOM`, e2.BUSINESS = `BUSINESS`, e2.CUSTOMER = `CUSTOMER`, e2))(Ma || {});
|
|
1655
|
+
var Na = [{ path: `timeSlotsConfiguration.createdDate` }, { path: `timeSlotsConfiguration.updatedDate` }];
|
|
1656
|
+
function Pa(e2) {
|
|
1657
|
+
return wt(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: `` }] } }));
|
|
1652
1658
|
}
|
|
1653
|
-
var
|
|
1654
|
-
function
|
|
1659
|
+
var Fa = `@wix/auto_sdk_bookings_time-slots-configuration`;
|
|
1660
|
+
function Ia(e2) {
|
|
1655
1661
|
function t2({ host: t3 }) {
|
|
1656
|
-
return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName:
|
|
1662
|
+
return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName: Fa, migrationOptions: { optInTransformResponse: true }, url: Pa({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: Ct(e2), transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: Na }]) };
|
|
1657
1663
|
}
|
|
1658
1664
|
return t2;
|
|
1659
1665
|
}
|
|
1660
|
-
async function
|
|
1661
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1666
|
+
async function La(e2) {
|
|
1667
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ia(L({ appId: e2 }));
|
|
1662
1668
|
n2?.onSiteCall?.();
|
|
1663
1669
|
try {
|
|
1664
1670
|
let e3 = await t2.request(r2);
|
|
1665
|
-
return n2?.onSuccess?.(e3),
|
|
1671
|
+
return n2?.onSuccess?.(e3), Ue(e3.data);
|
|
1666
1672
|
} catch (e3) {
|
|
1667
|
-
let t3 =
|
|
1673
|
+
let t3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
|
|
1668
1674
|
throw n2?.onError?.(e3), t3;
|
|
1669
1675
|
}
|
|
1670
1676
|
}
|
|
1671
|
-
function
|
|
1672
|
-
return (t2) =>
|
|
1677
|
+
function Ra(e2) {
|
|
1678
|
+
return (t2) => La(t2, { httpClient: e2 });
|
|
1673
1679
|
}
|
|
1674
|
-
var
|
|
1675
|
-
var
|
|
1676
|
-
var
|
|
1677
|
-
function
|
|
1678
|
-
return
|
|
1680
|
+
var za = St(Ra);
|
|
1681
|
+
var Ba = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
|
|
1682
|
+
var Va = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
|
|
1683
|
+
function Ha(e2) {
|
|
1684
|
+
return wt(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: `` }] } }));
|
|
1679
1685
|
}
|
|
1680
|
-
var
|
|
1681
|
-
function
|
|
1686
|
+
var Ua = `@wix/auto_sdk_bookings_bookings-settings`;
|
|
1687
|
+
function Wa(e2) {
|
|
1682
1688
|
function t2({ host: t3 }) {
|
|
1683
|
-
return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName:
|
|
1689
|
+
return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Ua, migrationOptions: { optInTransformResponse: true }, url: Ha({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: Ct(e2), transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: Ba }, { transformFn: H, paths: Va }]), fallback: [{ method: `GET`, url: Ha({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: Ct(e2) }] };
|
|
1684
1690
|
}
|
|
1685
1691
|
return t2;
|
|
1686
1692
|
}
|
|
1687
|
-
var
|
|
1688
|
-
async function
|
|
1689
|
-
let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 =
|
|
1693
|
+
var Ga = ((e2) => (e2.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e2.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e2))(Ga || {});
|
|
1694
|
+
async function Ka() {
|
|
1695
|
+
let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = Wa(L({}));
|
|
1690
1696
|
t2?.onSiteCall?.();
|
|
1691
1697
|
try {
|
|
1692
1698
|
let r2 = await e2.request(n2);
|
|
1693
|
-
return t2?.onSuccess?.(r2),
|
|
1699
|
+
return t2?.onSuccess?.(r2), Ue(r2.data)?.bookingsSettings;
|
|
1694
1700
|
} catch (e3) {
|
|
1695
|
-
let n3 =
|
|
1701
|
+
let n3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
|
|
1696
1702
|
throw t2?.onError?.(e3), n3;
|
|
1697
1703
|
}
|
|
1698
1704
|
}
|
|
1699
|
-
function
|
|
1700
|
-
return () =>
|
|
1705
|
+
function qa(e2) {
|
|
1706
|
+
return () => Ka({ httpClient: e2 });
|
|
1701
1707
|
}
|
|
1702
|
-
var
|
|
1703
|
-
function
|
|
1708
|
+
var Ja = St(qa);
|
|
1709
|
+
function Ya(e2) {
|
|
1704
1710
|
return e2.business?._id ?? null;
|
|
1705
1711
|
}
|
|
1706
|
-
function
|
|
1712
|
+
function Xa(e2) {
|
|
1707
1713
|
return e2.business?.name ?? null;
|
|
1708
1714
|
}
|
|
1709
|
-
function
|
|
1710
|
-
return (e2?.locations ?? []).filter((e3) => e3.type ===
|
|
1715
|
+
function Za(e2) {
|
|
1716
|
+
return (e2?.locations ?? []).filter((e3) => e3.type === Ma.BUSINESS).map((e3) => ({ id: Ya(e3) ?? ``, label: Xa(e3) ?? `` })).filter((e3) => e3.id !== ``).sort((e3, t2) => e3.label.localeCompare(t2.label));
|
|
1717
|
+
}
|
|
1718
|
+
var Qa = (e2) => e2 === Aa.APPOINTMENT;
|
|
1719
|
+
var $a = (e2) => e2 === Aa.CLASS;
|
|
1720
|
+
var eo = (e2) => e2 === Aa.COURSE;
|
|
1721
|
+
var to = (e2) => e2.payment?.rateType === ja.VARIED;
|
|
1722
|
+
var no = (e2) => !!e2.addOnGroups?.some((e3) => e3.addOnIds?.length);
|
|
1723
|
+
var ro = { category: `category`, location: `location`, page: `page`, blob: `bookingSelection`, legacyBlob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
1724
|
+
function io(e2) {
|
|
1725
|
+
return e2.get(ro.blob) ?? e2.get(ro.legacyBlob);
|
|
1711
1726
|
}
|
|
1712
|
-
|
|
1713
|
-
var Xa = (e2) => e2 === Da.CLASS;
|
|
1714
|
-
var Za = (e2) => e2 === Da.COURSE;
|
|
1715
|
-
var Qa = (e2) => e2.payment?.rateType === Oa.VARIED;
|
|
1716
|
-
var $a = (e2) => !!e2.addOnGroups?.some((e3) => e3.addOnIds?.length);
|
|
1717
|
-
var eo = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
1718
|
-
function to(e2) {
|
|
1727
|
+
function ao(e2) {
|
|
1719
1728
|
if (!e2) return null;
|
|
1720
|
-
let t2 =
|
|
1729
|
+
let t2 = fo(e2).map((e3) => e3.id), n2 = { ...e2.durationChoiceId ? { durationChoiceId: e2.durationChoiceId } : {}, ...e2.durationInMinutes ? { durationInMinutes: e2.durationInMinutes } : {}, ...t2.length ? { addOnIds: t2 } : {}, ...e2.requestedGender ? { requestedGender: { gender: e2.requestedGender } } : {} };
|
|
1721
1730
|
return Object.keys(n2).length ? n2 : null;
|
|
1722
1731
|
}
|
|
1723
|
-
function
|
|
1732
|
+
function oo(e2) {
|
|
1724
1733
|
return (e2?.services.length ?? 0) > 1;
|
|
1725
1734
|
}
|
|
1726
|
-
var
|
|
1727
|
-
function
|
|
1735
|
+
var so = (e2) => ({ valid: false, reason: e2 });
|
|
1736
|
+
function co(e2) {
|
|
1728
1737
|
let t2 = e2?.services ?? [];
|
|
1729
|
-
if (!
|
|
1730
|
-
if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return
|
|
1738
|
+
if (!oo(e2) || t2.some((e3) => !e3.serviceId)) return so(`too-few-services`);
|
|
1739
|
+
if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return so(`not-appointment`);
|
|
1731
1740
|
let n2 = t2[0].locationType ?? `BUSINESS`, r2 = t2[0].locationId ?? null;
|
|
1732
|
-
if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return
|
|
1733
|
-
if (r2 && n2 !== `BUSINESS`) return
|
|
1734
|
-
let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff:
|
|
1741
|
+
if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return so(`location-mixed`);
|
|
1742
|
+
if (r2 && n2 !== `BUSINESS`) return so(`location-id-not-business`);
|
|
1743
|
+
let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff: uo(e3), customerChoices: ao(e3) }));
|
|
1735
1744
|
return { valid: true, locationId: r2, locationType: n2, services: i2, requestKey: JSON.stringify([n2, r2, i2]) };
|
|
1736
1745
|
}
|
|
1737
|
-
var
|
|
1738
|
-
function
|
|
1739
|
-
let t2 = e2.resources?.find((e3) => e3.type ===
|
|
1746
|
+
var lo = `staff`;
|
|
1747
|
+
function uo(e2) {
|
|
1748
|
+
let t2 = e2.resources?.find((e3) => e3.type === lo);
|
|
1740
1749
|
if (!t2) return null;
|
|
1741
1750
|
let n2 = t2.ids[0];
|
|
1742
1751
|
return n2 ? { anyResource: false, staffMemberId: n2 } : t2.anyResource ? { anyResource: true } : null;
|
|
1743
1752
|
}
|
|
1744
|
-
function
|
|
1753
|
+
function fo(e2) {
|
|
1745
1754
|
return e2.addOns ?? [];
|
|
1746
1755
|
}
|
|
1747
|
-
function
|
|
1756
|
+
function po(e2, t2) {
|
|
1748
1757
|
let n2 = e2(t2);
|
|
1749
1758
|
return n2 ? n2.replace(/\/$/, ``) || `/` : null;
|
|
1750
1759
|
}
|
|
1751
|
-
function
|
|
1760
|
+
function mo(e2, t2, n2) {
|
|
1752
1761
|
let r2 = e2(t2);
|
|
1753
1762
|
return !r2 || !n2 ? null : `${r2.replace(/\/$/, ``)}/${n2}`;
|
|
1754
1763
|
}
|
|
1755
|
-
function
|
|
1764
|
+
function ho(e2, t2) {
|
|
1756
1765
|
switch (e2) {
|
|
1757
1766
|
case `servicePage`:
|
|
1758
|
-
return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ??
|
|
1767
|
+
return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? mo(t2.appSectionUrl, Jr.SERVICE_PAGE, t2.slug);
|
|
1759
1768
|
case `bookingCalendar`:
|
|
1760
|
-
return t2.isMultiService ?
|
|
1769
|
+
return t2.isMultiService ? po(t2.appSectionUrl, Jr.CALENDAR_PAGE) : mo(t2.appSectionUrl, Jr.CALENDAR_PAGE, t2.slug);
|
|
1761
1770
|
case `bookingForm`:
|
|
1762
|
-
return t2.serviceId ?
|
|
1771
|
+
return t2.serviceId ? mo(t2.appSectionUrl, Jr.FORM_PAGE, t2.slug) : null;
|
|
1763
1772
|
default:
|
|
1764
1773
|
return null;
|
|
1765
1774
|
}
|
|
1766
1775
|
}
|
|
1767
|
-
var
|
|
1768
|
-
var
|
|
1769
|
-
var
|
|
1770
|
-
var
|
|
1771
|
-
var
|
|
1772
|
-
let { previewMode: e2 } = (0, import_services_manager_react.useService)(
|
|
1773
|
-
let
|
|
1774
|
-
await
|
|
1775
|
-
}, [e2, n2,
|
|
1776
|
-
await
|
|
1777
|
-
}, [
|
|
1778
|
-
let
|
|
1779
|
-
return
|
|
1776
|
+
var go = (e2) => e2.target === `_blank`;
|
|
1777
|
+
var _o = (e2, t2) => t2 === `/` ? e2 : new URL(`.${t2}`, `${e2}/`).href;
|
|
1778
|
+
var vo = (e2, t2, n2) => n2 ? `.${t2}` : yo(e2, t2);
|
|
1779
|
+
var yo = (e2, t2) => e2 ? _o(e2, t2) : t2;
|
|
1780
|
+
var bo = () => {
|
|
1781
|
+
let { previewMode: e2 } = (0, import_services_manager_react.useService)(zr), t2 = (0, import_services_manager_react.useService)(Hr), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: r2 } = (0, import_services_manager_react.useService)(Vr), a2 = (0, import_services_manager_react.useService)(Ur), o2 = (0, import_services_manager_react.useGetService)(), s2 = (0, import_react.useCallback)(async (t3) => {
|
|
1782
|
+
let i2 = vo(n2, t3, e2);
|
|
1783
|
+
await r2({ href: i2 });
|
|
1784
|
+
}, [e2, n2, r2]), c2 = (0, import_react.useCallback)(async (e3) => {
|
|
1785
|
+
await r2(go(e3) ? { href: e3.href, type: `ExternalLink`, target: `_blank` } : { href: e3.href });
|
|
1786
|
+
}, [r2]), l2 = (0, import_react.useCallback)((e3) => yo(n2, e3), [n2]), u2 = (0, import_react.useCallback)((e3) => t2.appSectionRelativeUrl(Wr, e3), [t2]), d2 = (0, import_react.useCallback)((e3) => ia(a2.urlMappings, e3), [a2]), m2 = (0, import_react.useCallback)((e3, t3) => ho(e3, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: d2 }), [u2, d2]), h2 = (0, import_react.useCallback)((e3, t3) => {
|
|
1787
|
+
let r3 = m2(e3, t3);
|
|
1788
|
+
return r3 && n2 ? _o(n2, r3) : null;
|
|
1780
1789
|
}, [m2, n2]), g2 = (0, import_react.useCallback)((e3, t3) => {
|
|
1781
1790
|
let n3 = m2(e3, t3);
|
|
1782
1791
|
n3 && s2(n3);
|
|
1783
|
-
}, [m2, s2]), _2 = (0, import_react.useCallback)(() => u2(
|
|
1784
|
-
return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: (0, import_react.useCallback)(() => v2(
|
|
1785
|
-
let t3 = v2(
|
|
1792
|
+
}, [m2, s2]), _2 = (0, import_react.useCallback)(() => u2(Jr.FORM_PAGE) || void 0, [u2]), v2 = (0, import_react.useCallback)((e3) => Object.values(o2(Br).pages).some((t3) => t3.appPageId === e3 && (!t3.appDefinitionId || t3.appDefinitionId === `1380b703-ce81-ff05-f115-39571d94dfcd`)) && t2.appSectionRelativeUrl(`1380b703-ce81-ff05-f115-39571d94dfcd`, e3) || void 0, [t2, o2]);
|
|
1793
|
+
return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: (0, import_react.useCallback)(() => v2(Gr), [v2]), getThankYouPagePath: (0, import_react.useCallback)((e3) => {
|
|
1794
|
+
let t3 = v2(Kr);
|
|
1786
1795
|
return t3 ? `${t3}/${e3}?origin=bookings` : void 0;
|
|
1787
1796
|
}, [v2]) };
|
|
1788
1797
|
};
|
|
1789
|
-
function
|
|
1798
|
+
function xo(e2) {
|
|
1790
1799
|
return e2?.details?.applicationError?.code;
|
|
1791
1800
|
}
|
|
1792
|
-
function
|
|
1801
|
+
function So() {
|
|
1793
1802
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
1794
1803
|
if (e2) return { initWixModules(t3, n3) {
|
|
1795
|
-
return
|
|
1804
|
+
return Co(() => e2(t3, n3));
|
|
1796
1805
|
}, fetchWithAuth() {
|
|
1797
1806
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
1798
1807
|
}, graphql() {
|
|
1799
1808
|
throw Error(`graphql is not available in this context`);
|
|
1800
1809
|
} };
|
|
1801
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
1810
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : h.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : h.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : h.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : h.elevatedClient;
|
|
1802
1811
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
1803
1812
|
if (r2) {
|
|
1804
1813
|
if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
|
|
1805
|
-
return
|
|
1814
|
+
return Co(() => n2.use(e3));
|
|
1806
1815
|
}
|
|
1807
1816
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1808
|
-
return
|
|
1817
|
+
return Co(() => t2.use(e3));
|
|
1809
1818
|
}, fetchWithAuth: (e3, n3) => {
|
|
1810
1819
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1811
1820
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -1817,26 +1826,26 @@ function vo() {
|
|
|
1817
1826
|
return t2.graphql(e3, n3, r2);
|
|
1818
1827
|
} };
|
|
1819
1828
|
}
|
|
1820
|
-
function
|
|
1821
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
1822
|
-
globalThis.__wix_context__ = void 0,
|
|
1829
|
+
function Co(e2) {
|
|
1830
|
+
let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
|
|
1831
|
+
globalThis.__wix_context__ = void 0, h.client = void 0, h.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
1823
1832
|
try {
|
|
1824
1833
|
return e2();
|
|
1825
1834
|
} finally {
|
|
1826
|
-
globalThis.__wix_context__ = t2,
|
|
1835
|
+
globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
1827
1836
|
}
|
|
1828
1837
|
}
|
|
1829
|
-
function
|
|
1838
|
+
function wo(e2, t2) {
|
|
1830
1839
|
return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
1831
|
-
let r2 =
|
|
1840
|
+
let r2 = So();
|
|
1832
1841
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1833
1842
|
return r2.initWixModules(e2)[t3].apply(void 0, n2);
|
|
1834
1843
|
}])) };
|
|
1835
1844
|
}
|
|
1836
|
-
function
|
|
1837
|
-
return
|
|
1845
|
+
function To(e2) {
|
|
1846
|
+
return wo({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
|
|
1838
1847
|
}
|
|
1839
|
-
var
|
|
1848
|
+
var Eo = class {
|
|
1840
1849
|
constructor(e2) {
|
|
1841
1850
|
this.message = e2, this.captureException = () => {
|
|
1842
1851
|
console.error(this.message);
|
|
@@ -1851,106 +1860,106 @@ var So = class {
|
|
|
1851
1860
|
};
|
|
1852
1861
|
}
|
|
1853
1862
|
};
|
|
1854
|
-
var
|
|
1855
|
-
var
|
|
1863
|
+
var Do = (e2) => new Eo(e2);
|
|
1864
|
+
var Oo = To({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : Do(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
1856
1865
|
var Q = { 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` };
|
|
1857
|
-
function
|
|
1866
|
+
function ko(e2) {
|
|
1858
1867
|
try {
|
|
1859
|
-
let t2 =
|
|
1868
|
+
let t2 = Oo.getMonitoringClient?.();
|
|
1860
1869
|
return t2 && typeof t2[e2] == `function` ? t2 : null;
|
|
1861
1870
|
} catch {
|
|
1862
1871
|
return null;
|
|
1863
1872
|
}
|
|
1864
1873
|
}
|
|
1865
1874
|
function $(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
1866
|
-
let a2 =
|
|
1875
|
+
let a2 = ko(`captureException`);
|
|
1867
1876
|
if (!a2) return;
|
|
1868
1877
|
let o2 = e2 instanceof Error ? e2 : Error(String(e2));
|
|
1869
1878
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
1870
1879
|
}
|
|
1871
|
-
function
|
|
1872
|
-
let a2 =
|
|
1880
|
+
function Ao(e2, { feature: t2, action: n2, level: r2 = `info`, tags: i2 }) {
|
|
1881
|
+
let a2 = ko(`captureMessage`);
|
|
1873
1882
|
a2 && a2.captureMessage(e2, { level: r2, tags: { feature: t2, action: n2, ...i2 } });
|
|
1874
1883
|
}
|
|
1875
|
-
function
|
|
1876
|
-
let i2 =
|
|
1884
|
+
function jo({ message: e2, category: t2, feature: n2, data: r2 }) {
|
|
1885
|
+
let i2 = ko(`addBreadcrumb`);
|
|
1877
1886
|
i2 && i2.addBreadcrumb({ message: e2, category: t2, level: `info`, data: { feature: n2, ...r2 } });
|
|
1878
1887
|
}
|
|
1879
|
-
var
|
|
1888
|
+
var Mo = (e2) => {
|
|
1880
1889
|
let t2 = (e3) => e3 < 10 ? `0${e3}` : `${e3}`;
|
|
1881
1890
|
return `${e2.getFullYear()}-${t2(e2.getMonth() + 1)}-${t2(e2.getDate())}`;
|
|
1882
1891
|
};
|
|
1883
|
-
var
|
|
1884
|
-
var
|
|
1885
|
-
var
|
|
1886
|
-
var
|
|
1887
|
-
function
|
|
1888
|
-
return `${
|
|
1892
|
+
var No = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
|
|
1893
|
+
var Po = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
|
|
1894
|
+
var Fo = (e2) => `${Mo(e2)}T00:00:00`;
|
|
1895
|
+
var Io = (e2) => `${Mo(e2)}T23:59:59`;
|
|
1896
|
+
function Lo(e2, t2) {
|
|
1897
|
+
return `${Po(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
|
|
1889
1898
|
}
|
|
1890
|
-
function
|
|
1891
|
-
let n2 =
|
|
1899
|
+
function Ro(e2, t2) {
|
|
1900
|
+
let n2 = Lo(new Date(Date.now()), t2);
|
|
1892
1901
|
return n2.slice(0, 10) === e2 ? n2 : `${e2}T00:00:00`;
|
|
1893
1902
|
}
|
|
1894
|
-
var
|
|
1895
|
-
var
|
|
1896
|
-
function
|
|
1897
|
-
if (typeof e2 != `string` || !
|
|
1898
|
-
let t2 =
|
|
1899
|
-
return !Number.isNaN(t2.getTime()) &&
|
|
1903
|
+
var zo = /^\d{4}-\d{2}-\d{2}$/;
|
|
1904
|
+
var Bo = 864e5;
|
|
1905
|
+
function Vo(e2) {
|
|
1906
|
+
if (typeof e2 != `string` || !zo.test(e2)) return false;
|
|
1907
|
+
let t2 = No(e2);
|
|
1908
|
+
return !Number.isNaN(t2.getTime()) && Mo(t2) === e2;
|
|
1900
1909
|
}
|
|
1901
|
-
function
|
|
1910
|
+
function Ho(e2) {
|
|
1902
1911
|
if (!e2 || typeof e2 != `object`) return false;
|
|
1903
1912
|
let { startDate: t2, endDate: n2 } = e2;
|
|
1904
|
-
return
|
|
1913
|
+
return Vo(t2) && Vo(n2) && t2 <= n2;
|
|
1905
1914
|
}
|
|
1906
|
-
function
|
|
1907
|
-
let n2 =
|
|
1908
|
-
return n2.setDate(n2.getDate() + t2),
|
|
1915
|
+
function Uo(e2, t2) {
|
|
1916
|
+
let n2 = No(e2);
|
|
1917
|
+
return n2.setDate(n2.getDate() + t2), Mo(n2);
|
|
1909
1918
|
}
|
|
1910
|
-
function
|
|
1911
|
-
let n2 =
|
|
1912
|
-
return Math.round(n2 /
|
|
1919
|
+
function Wo({ startDate: e2, endDate: t2 }) {
|
|
1920
|
+
let n2 = No(t2).getTime() - No(e2).getTime();
|
|
1921
|
+
return Math.round(n2 / Bo) + 1;
|
|
1913
1922
|
}
|
|
1914
|
-
function
|
|
1915
|
-
let t2 =
|
|
1916
|
-
return { startDate:
|
|
1923
|
+
function Go(e2) {
|
|
1924
|
+
let t2 = No(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
|
|
1925
|
+
return { startDate: Mo(n2), endDate: Mo(r2) };
|
|
1917
1926
|
}
|
|
1918
|
-
function
|
|
1927
|
+
function Ko(e2, t2) {
|
|
1919
1928
|
return e2 >= t2.startDate && e2 <= t2.endDate;
|
|
1920
1929
|
}
|
|
1921
|
-
function
|
|
1922
|
-
let t2 =
|
|
1923
|
-
return
|
|
1930
|
+
function qo(e2) {
|
|
1931
|
+
let t2 = No(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
|
|
1932
|
+
return Mo(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
|
|
1924
1933
|
}
|
|
1925
|
-
function
|
|
1934
|
+
function Jo(e2) {
|
|
1926
1935
|
let t2 = [], n2 = e2.startDate;
|
|
1927
1936
|
for (; n2 <= e2.endDate; ) {
|
|
1928
|
-
let r2 =
|
|
1929
|
-
t2.push({ startDate: n2, endDate: i2 }), n2 =
|
|
1937
|
+
let r2 = Uo(qo(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
|
|
1938
|
+
t2.push({ startDate: n2, endDate: i2 }), n2 = Uo(i2, 1);
|
|
1930
1939
|
}
|
|
1931
1940
|
return t2;
|
|
1932
1941
|
}
|
|
1933
|
-
function
|
|
1942
|
+
function Yo({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
|
|
1934
1943
|
return e2 && t2 !== `CUSTOMER_CANNOT_CHOOSE`;
|
|
1935
1944
|
}
|
|
1936
|
-
async function
|
|
1937
|
-
let e2 = await
|
|
1945
|
+
async function Xo() {
|
|
1946
|
+
let e2 = await za(Wr);
|
|
1938
1947
|
return { businessTimeZone: e2.timeSlotsConfiguration?.displayTimeZone?.timeZone || null, staffSelectionStrategy: e2.timeSlotsConfiguration?.staffSelection?.strategy ?? null, allowGenderSelection: e2.timeSlotsConfiguration?.staffSelection?.allowGenderSelection ?? false };
|
|
1939
1948
|
}
|
|
1940
|
-
function
|
|
1949
|
+
function Zo(e2) {
|
|
1941
1950
|
let t2 = e2.location?._id || (e2.location?.locationType ? `${e2.location.locationType}:${e2.location.formattedAddress ?? ``}` : ``);
|
|
1942
1951
|
return `${e2.localStartDate ?? ``}|${e2.localEndDate ?? ``}|${t2}`;
|
|
1943
1952
|
}
|
|
1944
|
-
function
|
|
1953
|
+
function Qo(e2) {
|
|
1945
1954
|
return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
|
|
1946
1955
|
}
|
|
1947
|
-
function
|
|
1948
|
-
return `${
|
|
1956
|
+
function $o(e2) {
|
|
1957
|
+
return `${Zo(e2)}|${Qo(e2) ?? ``}`;
|
|
1949
1958
|
}
|
|
1950
|
-
function
|
|
1959
|
+
function es(e2) {
|
|
1951
1960
|
let t2 = /* @__PURE__ */ new Map();
|
|
1952
1961
|
for (let n2 of e2) {
|
|
1953
|
-
let e3 =
|
|
1962
|
+
let e3 = Zo(n2), r2 = t2.get(e3);
|
|
1954
1963
|
r2 ? r2.push(n2) : t2.set(e3, [n2]);
|
|
1955
1964
|
}
|
|
1956
1965
|
return [...t2.values()].map((e3) => {
|
|
@@ -1959,161 +1968,165 @@ function Xo(e2) {
|
|
|
1959
1968
|
return { ...n2[0], availableResources: n2.flatMap((e4) => e4.availableResources ?? []) };
|
|
1960
1969
|
});
|
|
1961
1970
|
}
|
|
1962
|
-
function
|
|
1971
|
+
function ts(e2) {
|
|
1963
1972
|
return e2 ? { locations: [{ _id: e2, locationType: `BUSINESS` }] } : {};
|
|
1964
1973
|
}
|
|
1965
|
-
function
|
|
1966
|
-
return e2 ? { resourceTypes: [{ resourceTypeId:
|
|
1974
|
+
function ns(e2) {
|
|
1975
|
+
return e2 ? { resourceTypes: [{ resourceTypeId: qr, resourceIds: [e2] }] } : {};
|
|
1967
1976
|
}
|
|
1968
|
-
function
|
|
1977
|
+
function rs(e2) {
|
|
1969
1978
|
let { requestedGender: t2, ...n2 } = e2;
|
|
1970
1979
|
return Object.keys(n2).length ? n2 : void 0;
|
|
1971
1980
|
}
|
|
1972
|
-
function
|
|
1981
|
+
function is(e2, t2) {
|
|
1973
1982
|
if (!e2) return {};
|
|
1974
|
-
let n2 = t2 ?
|
|
1983
|
+
let n2 = t2 ? rs(e2) : e2;
|
|
1975
1984
|
return n2 ? { customerChoices: n2 } : {};
|
|
1976
1985
|
}
|
|
1977
|
-
var
|
|
1978
|
-
function
|
|
1979
|
-
return
|
|
1986
|
+
var as = `REQUESTED_GENDER_NOT_ALLOWED`;
|
|
1987
|
+
function os(e2) {
|
|
1988
|
+
return xo(e2) === as;
|
|
1980
1989
|
}
|
|
1981
|
-
var
|
|
1982
|
-
var
|
|
1983
|
-
function
|
|
1984
|
-
return
|
|
1990
|
+
var ss = false;
|
|
1991
|
+
var cs = /* @__PURE__ */ new Set();
|
|
1992
|
+
function ls() {
|
|
1993
|
+
return ss;
|
|
1985
1994
|
}
|
|
1986
|
-
function
|
|
1987
|
-
return
|
|
1995
|
+
function us(e2) {
|
|
1996
|
+
return cs.add(e2), () => cs.delete(e2);
|
|
1988
1997
|
}
|
|
1989
|
-
function
|
|
1990
|
-
|
|
1998
|
+
function ds() {
|
|
1999
|
+
ss || (ss = true, cs.forEach((e2) => e2()));
|
|
1991
2000
|
}
|
|
1992
|
-
async function
|
|
2001
|
+
async function fs(e2) {
|
|
1993
2002
|
let { customerChoices: t2, ...n2 } = e2, r2 = (e3) => {
|
|
1994
|
-
let t3 =
|
|
1995
|
-
return
|
|
2003
|
+
let t3 = rs(e3);
|
|
2004
|
+
return fa({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
|
|
1996
2005
|
};
|
|
1997
|
-
if (
|
|
2006
|
+
if (ss && t2?.requestedGender) return r2(t2);
|
|
1998
2007
|
try {
|
|
1999
|
-
return await
|
|
2008
|
+
return await fa(e2);
|
|
2000
2009
|
} catch (e3) {
|
|
2001
|
-
if (!t2?.requestedGender || !
|
|
2002
|
-
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }),
|
|
2010
|
+
if (!t2?.requestedGender || !os(e3)) throw e3;
|
|
2011
|
+
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ds(), r2(t2);
|
|
2003
2012
|
}
|
|
2004
2013
|
}
|
|
2005
|
-
function
|
|
2014
|
+
function ps(e2, t2, n2) {
|
|
2006
2015
|
return { ...e2 ? { "location.id": e2 } : {}, ...t2 ? { "resources.id": { $hasSome: [t2] } } : {}, ...n2 ? { remainingCapacity: { $gte: n2 } } : {} };
|
|
2007
2016
|
}
|
|
2008
|
-
async function
|
|
2009
|
-
let t2 = await
|
|
2017
|
+
async function ms(e2) {
|
|
2018
|
+
let t2 = await ba(e2);
|
|
2010
2019
|
return { timeSlots: t2.timeSlots ?? [], timeZone: t2.timeZone ?? null, nextCursor: t2.pagingMetadata?.cursors?.next || null };
|
|
2011
2020
|
}
|
|
2012
|
-
function
|
|
2013
|
-
return
|
|
2021
|
+
function hs({ 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 }) {
|
|
2022
|
+
return Qa(t2) ? gs({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : ms({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...ps(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
|
|
2014
2023
|
}
|
|
2015
|
-
async function
|
|
2016
|
-
let d2 = await
|
|
2024
|
+
async function gs({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
|
|
2025
|
+
let d2 = await fs({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...ts(i2), ...ns(a2), ...is(s2, a2), includeResourceTypeIds: [qr], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
|
|
2017
2026
|
return { timeSlots: d2.timeSlots ?? [], timeZone: d2.timeZone ?? null, nextCursor: d2.cursorPagingMetadata?.cursors?.next || null };
|
|
2018
2027
|
}
|
|
2019
|
-
var
|
|
2020
|
-
var
|
|
2021
|
-
function
|
|
2022
|
-
let t2 = e2 ?
|
|
2023
|
-
return { fromLocalDate:
|
|
2028
|
+
var _s = 6;
|
|
2029
|
+
var vs = 864e5;
|
|
2030
|
+
function ys(e2) {
|
|
2031
|
+
let t2 = e2 ? No(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + _s + 1, 1), r2 = new Date(n2.getTime() - vs);
|
|
2032
|
+
return { fromLocalDate: Fo(t2), toLocalDate: Io(r2) };
|
|
2024
2033
|
}
|
|
2025
|
-
async function
|
|
2026
|
-
let { fromLocalDate: u2, toLocalDate: d2 } =
|
|
2027
|
-
if (
|
|
2028
|
-
let a3 = { ...
|
|
2034
|
+
async function bs({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
|
|
2035
|
+
let { fromLocalDate: u2, toLocalDate: d2 } = ys(a2);
|
|
2036
|
+
if ($a(t2) || eo(t2)) {
|
|
2037
|
+
let a3 = { ...eo(t2) ? { type: `COURSE` } : {}, ...ps(o2, s2, l2) }, c3 = await ms({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
|
|
2029
2038
|
return { timeSlots: c3.timeSlots, timeZone: c3.timeZone };
|
|
2030
2039
|
}
|
|
2031
|
-
let f2 = await
|
|
2040
|
+
let f2 = await fs({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...ts(o2), ...ns(s2), ...is(c2, s2), includeResourceTypeIds: [qr], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
|
|
2032
2041
|
return { timeSlots: f2.timeSlots ?? [], timeZone: f2.timeZone ?? null };
|
|
2033
2042
|
}
|
|
2034
|
-
var
|
|
2035
|
-
async function
|
|
2036
|
-
let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 =
|
|
2043
|
+
var xs = 1e3;
|
|
2044
|
+
async function Ss({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, fromLocalDate: l2, toLocalDate: u2 }) {
|
|
2045
|
+
let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 = eo(t2) ? `COURSE` : $a(t2) ? `CLASS` : `APPOINTMENT`, m2 = [], h2 = null, g2;
|
|
2037
2046
|
do {
|
|
2038
|
-
let t3 = await
|
|
2047
|
+
let t3 = await hs({ serviceId: e2, serviceType: p2, fromLocalDate: l2 && l2 > d2 ? l2 : d2, toLocalDate: u2 && u2 < f2 ? u2 : f2, timeZone: r2, locationId: a2, staffId: o2, onlyAvailableSlots: i2, customerChoices: s2, minRemainingCapacity: c2, limit: xs, cursor: g2 });
|
|
2039
2048
|
m2.push(...t3.timeSlots), h2 = t3.timeZone ?? h2, g2 = t3.nextCursor ?? void 0;
|
|
2040
2049
|
} while (g2);
|
|
2041
2050
|
return { timeSlots: m2, timeZone: h2 };
|
|
2042
2051
|
}
|
|
2043
|
-
function
|
|
2052
|
+
function Cs(e2) {
|
|
2044
2053
|
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 };
|
|
2045
2054
|
}
|
|
2046
|
-
function
|
|
2047
|
-
return e2?.options?.values?.[0]?.type ===
|
|
2055
|
+
function ws(e2) {
|
|
2056
|
+
return e2?.options?.values?.[0]?.type === ka.STAFF_MEMBER;
|
|
2048
2057
|
}
|
|
2049
|
-
function
|
|
2058
|
+
function Ts(e2) {
|
|
2050
2059
|
return e2.staffMemberDetails?.staffMembers ?? [];
|
|
2051
2060
|
}
|
|
2052
|
-
function
|
|
2061
|
+
function Es(e2, t2) {
|
|
2053
2062
|
let n2 = e2.workingHoursLocationCoverage;
|
|
2054
2063
|
return { staffMemberId: e2.staffMemberId ?? ``, name: e2.name ?? null, image: null, isSelected: t2 === e2.staffMemberId, ...n2 ? { locationCoverage: { availableAtAllLocations: n2.availableAtAllLocations ?? false, locationIds: n2.locationIds ?? [] } } : {} };
|
|
2055
2064
|
}
|
|
2056
|
-
function
|
|
2065
|
+
function Ds(e2, t2) {
|
|
2057
2066
|
let n2 = e2.locationCoverage;
|
|
2058
2067
|
return !n2 || n2.availableAtAllLocations || n2.locationIds.includes(t2);
|
|
2059
2068
|
}
|
|
2060
|
-
function
|
|
2061
|
-
return t2 ? e2.filter((e3) =>
|
|
2069
|
+
function Os(e2, t2) {
|
|
2070
|
+
return t2 ? e2.filter((e3) => Ds(e3, t2)) : e2;
|
|
2062
2071
|
}
|
|
2063
|
-
function
|
|
2072
|
+
function ks(e2, t2) {
|
|
2064
2073
|
let n2 = new Map(t2.map((e3) => [e3.staffMemberId, e3.locationCoverage]));
|
|
2065
2074
|
return e2.choices.map((e3) => e3.choiceId).filter((e3) => e3 != null).map((e3) => ({ staffMemberId: e3, locationCoverage: n2.get(e3) }));
|
|
2066
2075
|
}
|
|
2067
|
-
function
|
|
2076
|
+
function As(e2, t2, n2) {
|
|
2068
2077
|
if (e2?.type !== `STAFF_MEMBER` || !n2) return;
|
|
2069
|
-
let r2 =
|
|
2078
|
+
let r2 = Os(ks(e2, t2), n2);
|
|
2070
2079
|
return r2.length === 1 ? r2[0].staffMemberId : void 0;
|
|
2071
2080
|
}
|
|
2072
|
-
function
|
|
2081
|
+
function js(e2, t2) {
|
|
2073
2082
|
if (t2.length === 0) return e2;
|
|
2074
|
-
let n2 = e2.filter((e3) =>
|
|
2083
|
+
let n2 = e2.filter((e3) => Os(t2, e3.id).length > 0);
|
|
2075
2084
|
return n2.length > 0 ? n2 : e2;
|
|
2076
2085
|
}
|
|
2077
|
-
function
|
|
2078
|
-
return
|
|
2086
|
+
function Ms(e2) {
|
|
2087
|
+
return Ts(e2).map((e3) => Es(e3, null));
|
|
2079
2088
|
}
|
|
2080
|
-
function
|
|
2081
|
-
let r2 =
|
|
2089
|
+
function Ns(e2, t2, n2 = false) {
|
|
2090
|
+
let r2 = Ps(e2), i2 = r2.length === 1 ? r2[0].id : void 0, a2 = n2 || !i2 || r2.some((e3) => e3.id === t2);
|
|
2082
2091
|
return t2 && a2 ? t2 : i2;
|
|
2083
2092
|
}
|
|
2084
|
-
function
|
|
2085
|
-
return
|
|
2093
|
+
function Ps(e2) {
|
|
2094
|
+
return js(Za(e2), Ms(e2));
|
|
2086
2095
|
}
|
|
2087
|
-
function
|
|
2096
|
+
function Fs(e2) {
|
|
2088
2097
|
let t2 = e2;
|
|
2089
|
-
|
|
2098
|
+
return t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
|
|
2090
2099
|
t2.__state = { status: `fulfilled`, value: e3 };
|
|
2091
2100
|
}, (e3) => {
|
|
2092
2101
|
t2.__state = { status: `rejected`, reason: e3 };
|
|
2093
|
-
})), t2.__state
|
|
2094
|
-
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
2102
|
+
})), t2.__state;
|
|
2095
2103
|
}
|
|
2096
|
-
function
|
|
2104
|
+
function Is(e2) {
|
|
2105
|
+
let t2 = Fs(e2);
|
|
2106
|
+
if (t2.status === `fulfilled`) return t2.value;
|
|
2107
|
+
throw t2.status === `rejected` ? t2.reason : e2;
|
|
2108
|
+
}
|
|
2109
|
+
function Ls(e2) {
|
|
2097
2110
|
let t2 = Promise.resolve(e2);
|
|
2098
2111
|
return t2.__state = { status: `fulfilled`, value: e2 }, t2;
|
|
2099
2112
|
}
|
|
2100
|
-
var
|
|
2101
|
-
function
|
|
2113
|
+
var Rs = Rr(`@wix/site-service-warmup-data`);
|
|
2114
|
+
function zs() {
|
|
2102
2115
|
try {
|
|
2103
2116
|
return (0, import_services_manager_react.useGetService)();
|
|
2104
2117
|
} catch {
|
|
2105
2118
|
return null;
|
|
2106
2119
|
}
|
|
2107
2120
|
}
|
|
2108
|
-
function
|
|
2121
|
+
function Bs(e2) {
|
|
2109
2122
|
try {
|
|
2110
|
-
return e2 ? e2(
|
|
2123
|
+
return e2 ? e2(Rs) : null;
|
|
2111
2124
|
} catch {
|
|
2112
2125
|
return null;
|
|
2113
2126
|
}
|
|
2114
2127
|
}
|
|
2115
|
-
function
|
|
2116
|
-
let e2 =
|
|
2128
|
+
function Vs() {
|
|
2129
|
+
let e2 = Bs(zs()), t2 = typeof window > `u`;
|
|
2117
2130
|
return { scope: e2 ?? void 0, get: async (n2) => {
|
|
2118
2131
|
if (t2 || !e2) return null;
|
|
2119
2132
|
try {
|
|
@@ -2128,57 +2141,57 @@ function Is() {
|
|
|
2128
2141
|
}
|
|
2129
2142
|
} };
|
|
2130
2143
|
}
|
|
2131
|
-
var
|
|
2132
|
-
function
|
|
2133
|
-
return `${
|
|
2144
|
+
var Hs = `bookings-uou`;
|
|
2145
|
+
function Us() {
|
|
2146
|
+
return `${Hs}:bookings-settings`;
|
|
2134
2147
|
}
|
|
2135
|
-
function
|
|
2136
|
-
return `${
|
|
2148
|
+
function Ws() {
|
|
2149
|
+
return `${Hs}:time-slots-configuration`;
|
|
2137
2150
|
}
|
|
2138
|
-
var
|
|
2139
|
-
var
|
|
2140
|
-
var
|
|
2141
|
-
var
|
|
2142
|
-
function
|
|
2151
|
+
var Gs = 5e3;
|
|
2152
|
+
var Ks = 100;
|
|
2153
|
+
var qs = `wix-warmup-data`;
|
|
2154
|
+
var Js = null;
|
|
2155
|
+
function Ys(e2) {
|
|
2143
2156
|
if (typeof document < `u`) try {
|
|
2144
|
-
let t2 = document.getElementById(
|
|
2145
|
-
return t2 ? (
|
|
2157
|
+
let t2 = document.getElementById(qs)?.textContent;
|
|
2158
|
+
return t2 ? (Js?.text !== t2 && (Js = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Js.data[e2] ?? void 0) : void 0;
|
|
2146
2159
|
} catch {
|
|
2147
2160
|
return;
|
|
2148
2161
|
}
|
|
2149
2162
|
}
|
|
2150
|
-
var
|
|
2151
|
-
var
|
|
2152
|
-
var
|
|
2153
|
-
var
|
|
2154
|
-
function
|
|
2155
|
-
if (!e2) return
|
|
2156
|
-
let t2 =
|
|
2157
|
-
return t2 || (t2 =
|
|
2163
|
+
var Xs = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
2164
|
+
var Zs = Xs();
|
|
2165
|
+
var Qs = /* @__PURE__ */ new WeakMap();
|
|
2166
|
+
var $s = /* @__PURE__ */ new WeakMap();
|
|
2167
|
+
function ec(e2) {
|
|
2168
|
+
if (!e2) return Zs;
|
|
2169
|
+
let t2 = Qs.get(e2);
|
|
2170
|
+
return t2 || (t2 = Xs(), Qs.set(e2, t2)), t2;
|
|
2158
2171
|
}
|
|
2159
|
-
function
|
|
2172
|
+
function tc({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
2160
2173
|
if (e2 === null) return n2();
|
|
2161
2174
|
if (typeof window > `u`) {
|
|
2162
2175
|
let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
|
|
2163
2176
|
if (!i3) return r3();
|
|
2164
|
-
let a3 =
|
|
2165
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
2177
|
+
let a3 = $s.get(i3);
|
|
2178
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), $s.set(i3, a3));
|
|
2166
2179
|
let o3 = a3.get(e2);
|
|
2167
2180
|
if (o3) return o3;
|
|
2168
2181
|
let s3 = r3();
|
|
2169
2182
|
return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
|
|
2170
2183
|
}
|
|
2171
|
-
let i2 =
|
|
2184
|
+
let i2 = ec(t2.scope), a2 = Date.now();
|
|
2172
2185
|
for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
|
|
2173
2186
|
let o2 = i2.promises.get(e2);
|
|
2174
2187
|
if (o2 && !r2) return o2.promise;
|
|
2175
2188
|
r2 && i2.invalidatedWarmup.add(e2);
|
|
2176
2189
|
let s2 = !i2.invalidatedWarmup.has(e2);
|
|
2177
2190
|
if (s2) {
|
|
2178
|
-
let t3 =
|
|
2191
|
+
let t3 = Ys(e2);
|
|
2179
2192
|
if (t3 !== void 0) {
|
|
2180
|
-
let n3 =
|
|
2181
|
-
return i2.promises.set(e2, { promise: n3, expiresAt: a2 +
|
|
2193
|
+
let n3 = Ls(t3);
|
|
2194
|
+
return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Gs }), n3;
|
|
2182
2195
|
}
|
|
2183
2196
|
}
|
|
2184
2197
|
let c2 = (async () => {
|
|
@@ -2188,48 +2201,48 @@ function Xs({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2188
2201
|
}
|
|
2189
2202
|
return n2();
|
|
2190
2203
|
})();
|
|
2191
|
-
i2.promises.size >=
|
|
2204
|
+
i2.promises.size >= Ks && i2.promises.delete(i2.promises.keys().next().value);
|
|
2192
2205
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
2193
2206
|
return i2.promises.set(e2, l2), c2.then(() => {
|
|
2194
|
-
l2.expiresAt = Date.now() +
|
|
2207
|
+
l2.expiresAt = Date.now() + Gs;
|
|
2195
2208
|
}, () => {
|
|
2196
2209
|
i2.promises.get(e2) === l2 && i2.promises.delete(e2);
|
|
2197
2210
|
}), c2;
|
|
2198
2211
|
}
|
|
2199
|
-
var
|
|
2200
|
-
async function
|
|
2212
|
+
var nc = { displayTimeZonePolicy: { basedOn: Ga.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
|
|
2213
|
+
async function rc() {
|
|
2201
2214
|
try {
|
|
2202
|
-
let e2 = await
|
|
2203
|
-
return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ??
|
|
2215
|
+
let e2 = await Ja();
|
|
2216
|
+
return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? Ga.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
|
|
2204
2217
|
} catch (e2) {
|
|
2205
|
-
return $(e2, { feature: Q.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }),
|
|
2218
|
+
return $(e2, { feature: Q.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), nc;
|
|
2206
2219
|
}
|
|
2207
2220
|
}
|
|
2208
|
-
var
|
|
2209
|
-
var
|
|
2210
|
-
var
|
|
2211
|
-
function
|
|
2212
|
-
let e2 = (0, import_react.useContext)(
|
|
2213
|
-
if (!e2) throw Error(
|
|
2221
|
+
var ic = { isLoading: true };
|
|
2222
|
+
var ac = (0, import_react.createContext)(null);
|
|
2223
|
+
var oc = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
|
|
2224
|
+
function sc() {
|
|
2225
|
+
let e2 = (0, import_react.useContext)(ac);
|
|
2226
|
+
if (!e2) throw Error(oc);
|
|
2214
2227
|
return e2;
|
|
2215
2228
|
}
|
|
2216
|
-
function
|
|
2217
|
-
return e2.basedOn ===
|
|
2229
|
+
function cc(e2) {
|
|
2230
|
+
return e2.basedOn === Ga.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
|
|
2218
2231
|
}
|
|
2219
|
-
function
|
|
2220
|
-
let e2 =
|
|
2221
|
-
return e2.isLoading ? void 0 :
|
|
2232
|
+
function lc() {
|
|
2233
|
+
let e2 = sc();
|
|
2234
|
+
return e2.isLoading ? void 0 : cc(e2.displayTimeZonePolicy);
|
|
2222
2235
|
}
|
|
2223
|
-
function
|
|
2224
|
-
let n2 =
|
|
2225
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2236
|
+
function uc({ settingsPromise: e2, children: t2 }) {
|
|
2237
|
+
let n2 = Is(e2), r2 = (0, import_react.useMemo)(() => ({ isLoading: false, ...n2 }), [n2]);
|
|
2238
|
+
return (0, import_jsx_runtime.jsx)(ac.Provider, { value: r2, children: t2 });
|
|
2226
2239
|
}
|
|
2227
|
-
function
|
|
2228
|
-
let r2 =
|
|
2229
|
-
return e2 ? (0, import_jsx_runtime.jsx)(
|
|
2240
|
+
function dc({ bookingsSettings: e2, children: n2 }) {
|
|
2241
|
+
let r2 = Vs(), [i2] = (0, import_react.useState)(() => e2 ? null : tc({ key: Us(), warmupData: r2, fetchData: rc }));
|
|
2242
|
+
return e2 ? (0, import_jsx_runtime.jsx)(ac.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(ac.Provider, { value: ic, children: n2 }), children: (0, import_jsx_runtime.jsx)(uc, { settingsPromise: i2, children: n2 }) });
|
|
2230
2243
|
}
|
|
2231
|
-
var
|
|
2232
|
-
var
|
|
2244
|
+
var fc = 1e3;
|
|
2245
|
+
var pc = class extends import_react.Component {
|
|
2233
2246
|
state = { hasError: false };
|
|
2234
2247
|
static getDerivedStateFromError() {
|
|
2235
2248
|
return { hasError: true };
|
|
@@ -2241,16 +2254,16 @@ var cc = class extends import_react.Component {
|
|
|
2241
2254
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
2242
2255
|
}
|
|
2243
2256
|
};
|
|
2244
|
-
var
|
|
2245
|
-
function
|
|
2246
|
-
let t2 = e2.searchParams.get(
|
|
2257
|
+
var mc = `appSectionParams`;
|
|
2258
|
+
function hc(e2) {
|
|
2259
|
+
let t2 = e2.searchParams.get(mc);
|
|
2247
2260
|
if (t2 === null) return e2;
|
|
2248
2261
|
let n2 = new URL(e2);
|
|
2249
|
-
n2.searchParams.delete(
|
|
2250
|
-
for (let [e3, r2] of Object.entries(
|
|
2262
|
+
n2.searchParams.delete(mc);
|
|
2263
|
+
for (let [e3, r2] of Object.entries(gc(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
|
|
2251
2264
|
return n2;
|
|
2252
2265
|
}
|
|
2253
|
-
function
|
|
2266
|
+
function gc(e2) {
|
|
2254
2267
|
try {
|
|
2255
2268
|
let t2 = JSON.parse(e2);
|
|
2256
2269
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
@@ -2258,16 +2271,16 @@ function dc(e2) {
|
|
|
2258
2271
|
return {};
|
|
2259
2272
|
}
|
|
2260
2273
|
}
|
|
2261
|
-
var
|
|
2262
|
-
var
|
|
2274
|
+
var _c = `bookings-uou:url-change`;
|
|
2275
|
+
var vc = (e2) => {
|
|
2263
2276
|
let t2 = new URL(e2);
|
|
2264
2277
|
return t2.searchParams.sort(), t2.href;
|
|
2265
2278
|
};
|
|
2266
|
-
function
|
|
2279
|
+
function yc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
2267
2280
|
let r2 = globalThis.window;
|
|
2268
2281
|
if (!r2?.history) return;
|
|
2269
2282
|
let i2 = new URL(r2.location.href);
|
|
2270
|
-
if (
|
|
2283
|
+
if (vc(i2) === vc(e2)) return;
|
|
2271
2284
|
let a2 = { scrollY: r2.scrollY };
|
|
2272
2285
|
if (n2) r2.history.replaceState(a2, ``, e2.href);
|
|
2273
2286
|
else {
|
|
@@ -2278,89 +2291,113 @@ function mc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
|
2278
2291
|
return;
|
|
2279
2292
|
}
|
|
2280
2293
|
}
|
|
2281
|
-
r2.dispatchEvent(new Event(
|
|
2294
|
+
r2.dispatchEvent(new Event(_c));
|
|
2282
2295
|
}
|
|
2283
|
-
function
|
|
2296
|
+
function bc(e2) {
|
|
2284
2297
|
let t2 = globalThis.window;
|
|
2285
|
-
return t2 ? (t2.addEventListener(
|
|
2286
|
-
t2.removeEventListener(
|
|
2298
|
+
return t2 ? (t2.addEventListener(_c, e2), t2.addEventListener(`popstate`, e2), () => {
|
|
2299
|
+
t2.removeEventListener(_c, e2), t2.removeEventListener(`popstate`, e2);
|
|
2287
2300
|
}) : () => {
|
|
2288
2301
|
};
|
|
2289
2302
|
}
|
|
2290
|
-
var
|
|
2303
|
+
var xc = (e2) => {
|
|
2291
2304
|
try {
|
|
2292
2305
|
return decodeURIComponent(e2);
|
|
2293
2306
|
} catch {
|
|
2294
2307
|
return e2;
|
|
2295
2308
|
}
|
|
2296
2309
|
};
|
|
2297
|
-
function
|
|
2310
|
+
function Sc(e2, t2) {
|
|
2298
2311
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
2299
|
-
return `./${
|
|
2312
|
+
return `./${xc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
2300
2313
|
}
|
|
2301
|
-
function
|
|
2302
|
-
let e2 = (0, import_services_manager_react.useService)(
|
|
2303
|
-
return { pathname:
|
|
2314
|
+
function Cc() {
|
|
2315
|
+
let e2 = (0, import_services_manager_react.useService)(Hr), t2 = (0, import_react.useCallback)(() => e2.currentUrl, [e2]), n2 = (0, import_react.useSyncExternalStore)(bc, t2, t2), r2 = (0, import_react.useMemo)(() => hc(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
|
|
2316
|
+
return { pathname: r2.pathname, search: r2.search, searchParams: r2.searchParams, href: r2.href, getParsedUrl: () => hc(new URL(e2.currentUrl)), getRelativeUrl: () => Sc(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: yc };
|
|
2304
2317
|
}
|
|
2305
|
-
var
|
|
2306
|
-
|
|
2318
|
+
var wc = () => () => {
|
|
2319
|
+
};
|
|
2320
|
+
function Tc() {
|
|
2321
|
+
let e2;
|
|
2322
|
+
return { inBrowser: () => e2 ??= false, onServer: () => e2 ??= true };
|
|
2323
|
+
}
|
|
2324
|
+
function Ec() {
|
|
2325
|
+
let [e2] = (0, import_react.useState)(Tc);
|
|
2326
|
+
return (0, import_react.useSyncExternalStore)(wc, e2.inBrowser, e2.onServer);
|
|
2327
|
+
}
|
|
2328
|
+
var Dc = Symbol(`landing pending`);
|
|
2329
|
+
function Oc() {
|
|
2330
|
+
return !Ec();
|
|
2331
|
+
}
|
|
2332
|
+
function kc() {
|
|
2333
|
+
let { searchParams: e2 } = Cc(), t2 = Oc(), [n2, i2] = (0, import_react.useState)(t2);
|
|
2334
|
+
return (0, import_react.useEffect)(() => {
|
|
2335
|
+
(0, import_react.startTransition)(() => i2(true));
|
|
2336
|
+
}, []), n2 ? io(e2) : Dc;
|
|
2337
|
+
}
|
|
2338
|
+
function Ac(e2) {
|
|
2339
|
+
let t2 = kc();
|
|
2340
|
+
return e2 || t2 === Dc ? null : t2;
|
|
2341
|
+
}
|
|
2342
|
+
var jc = Rr(`@wix/site-service-business-logger`);
|
|
2343
|
+
function Mc(e2) {
|
|
2307
2344
|
return { evid: 32, src: 16, endpoint: ``, params: e2 };
|
|
2308
2345
|
}
|
|
2309
|
-
function
|
|
2346
|
+
function Nc(e2) {
|
|
2310
2347
|
return { evid: 33, src: 16, endpoint: ``, params: e2 };
|
|
2311
2348
|
}
|
|
2312
|
-
function
|
|
2349
|
+
function Pc(e2) {
|
|
2313
2350
|
return { evid: 34, src: 16, endpoint: ``, params: e2 };
|
|
2314
2351
|
}
|
|
2315
|
-
var
|
|
2316
|
-
|
|
2317
|
-
var
|
|
2318
|
-
var
|
|
2319
|
-
var
|
|
2320
|
-
var
|
|
2321
|
-
var
|
|
2322
|
-
let { reportBi: t2 } = (0, import_services_manager_react.useService)(
|
|
2352
|
+
var Fc = { 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` };
|
|
2353
|
+
Jr.BOOK_ONLINE;
|
|
2354
|
+
var Ic = `new_bookings_server`;
|
|
2355
|
+
var Lc = { 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` };
|
|
2356
|
+
var Rc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog`, JOIN_WAITLIST_DIALOG: `join_waitlist_dialog` };
|
|
2357
|
+
var zc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
|
|
2358
|
+
var Bc = (e2) => {
|
|
2359
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(jc);
|
|
2323
2360
|
return (0, import_react.useCallback)((n2) => {
|
|
2324
|
-
t2({ widget_name: e2, bookingsPlatform:
|
|
2361
|
+
t2({ widget_name: e2, bookingsPlatform: Ic, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
2325
2362
|
}, [t2, e2]);
|
|
2326
2363
|
};
|
|
2327
|
-
var
|
|
2328
|
-
let n2 =
|
|
2364
|
+
var Vc = (e2, t2 = true) => {
|
|
2365
|
+
let n2 = Bc(e2), { getParsedUrl: r2 } = Cc(), i2 = (0, import_react.useRef)(false);
|
|
2329
2366
|
(0, import_react.useEffect)(() => {
|
|
2330
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
2367
|
+
t2 && !i2.current && (i2.current = true, n2(Mc({ referralInfo: r2().searchParams.get(ro.referral) ?? void 0 })));
|
|
2331
2368
|
}, [t2, n2, r2]);
|
|
2332
2369
|
};
|
|
2333
|
-
function
|
|
2370
|
+
function Hc(e2) {
|
|
2334
2371
|
return { evid: 1177, src: 16, endpoint: `wixboost-ugc`, params: e2 };
|
|
2335
2372
|
}
|
|
2336
|
-
function
|
|
2373
|
+
function Uc(e2) {
|
|
2337
2374
|
return { evid: 596, src: 16, endpoint: `wixboost-ugc`, params: e2 };
|
|
2338
2375
|
}
|
|
2339
|
-
function
|
|
2376
|
+
function Wc(e2, t2) {
|
|
2340
2377
|
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 = {};
|
|
2341
2378
|
for (let e3 of n2) e3.type !== `literal` && (r2[e3.type] = Number(e3.value));
|
|
2342
2379
|
return Date.UTC(r2.year, r2.month - 1, r2.day, r2.hour, r2.minute, r2.second) - e2;
|
|
2343
2380
|
}
|
|
2344
|
-
function
|
|
2381
|
+
function Gc(e2, t2) {
|
|
2345
2382
|
let n2 = e2.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?/);
|
|
2346
2383
|
if (!n2) return null;
|
|
2347
2384
|
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);
|
|
2348
2385
|
if (Number.isNaN(l2)) return null;
|
|
2349
2386
|
try {
|
|
2350
|
-
let e3 = l2 -
|
|
2351
|
-
return new Date(l2 -
|
|
2387
|
+
let e3 = l2 - Wc(l2, t2);
|
|
2388
|
+
return new Date(l2 - Wc(e3, t2));
|
|
2352
2389
|
} catch {
|
|
2353
2390
|
return null;
|
|
2354
2391
|
}
|
|
2355
2392
|
}
|
|
2356
|
-
function
|
|
2357
|
-
let i2 = (e3) => e3 && n2 ?
|
|
2358
|
-
return
|
|
2393
|
+
function Kc({ start: e2, end: t2, timeZone: n2, ...r2 }) {
|
|
2394
|
+
let i2 = (e3) => e3 && n2 ? Gc(e3, n2)?.getTime() : void 0;
|
|
2395
|
+
return Pc({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
|
|
2359
2396
|
}
|
|
2360
|
-
function
|
|
2361
|
-
let i2 = n2 ? `loadFailed` : null, a2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false, selectDate: async () => {
|
|
2397
|
+
function qc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
|
|
2398
|
+
let i2 = n2 ? `loadFailed` : null, a2 = (0, import_service.useServiceContext)(true), o2 = a2?.reschedule != null, s2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false, selectDate: async () => {
|
|
2362
2399
|
}, setDaysAvailabilityRange: async () => {
|
|
2363
|
-
}, goToNextAvailableDate: async () => `cancelled`, canChangeTimeZone: false, isMultiService: false, availabilityRequestKey: null, needsServiceChoice: false, isRescheduling:
|
|
2400
|
+
}, 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: () => {
|
|
2364
2401
|
}, setLocationFilter: () => {
|
|
2365
2402
|
}, isComplete: false, timeSlots: [], isLoading: t2, hasError: n2, errorCode: i2, businessTimeZone: null, setTimeZone: () => {
|
|
2366
2403
|
}, currentTimeSlotsPage: 1, hasNextTimeSlotsPage: false, hasPreviousTimeSlotsPage: false, nextTimeSlotsPage: async () => {
|
|
@@ -2371,265 +2408,265 @@ function Fc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children
|
|
|
2371
2408
|
}, navigateToBookingForm: () => {
|
|
2372
2409
|
}, timeSlotLimitPerDay: null, daysWithMore: /* @__PURE__ */ new Set(), loadingDate: null, loadAllTimeSlotsForDay: async () => {
|
|
2373
2410
|
} };
|
|
2374
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2411
|
+
return (0, import_jsx_runtime.jsx)(tu.Provider, { value: s2, children: r2 });
|
|
2375
2412
|
}
|
|
2376
|
-
function
|
|
2377
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2413
|
+
function Jc({ nextAvailableSlotsCount: e2, children: t2 }) {
|
|
2414
|
+
return (0, import_jsx_runtime.jsx)(qc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
|
|
2378
2415
|
}
|
|
2379
|
-
function
|
|
2380
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2416
|
+
function Yc({ nextAvailableSlotsCount: e2, children: t2 }) {
|
|
2417
|
+
return (0, import_jsx_runtime.jsx)(qc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
|
|
2381
2418
|
}
|
|
2382
|
-
var
|
|
2383
|
-
function
|
|
2419
|
+
var Xc = 1e3;
|
|
2420
|
+
function Zc(e2, t2) {
|
|
2384
2421
|
let n2 = /* @__PURE__ */ new Map();
|
|
2385
2422
|
for (let e3 of t2) {
|
|
2386
2423
|
let t3 = e3.localStartDate?.slice(0, 10);
|
|
2387
2424
|
t3 && (e3.bookable ? n2.set(t3, `available`) : n2.has(t3) || n2.set(t3, `unavailable`));
|
|
2388
2425
|
}
|
|
2389
|
-
let r2 = [], i2 =
|
|
2426
|
+
let r2 = [], i2 = Wo(e2);
|
|
2390
2427
|
for (let t3 = 0; t3 < i2; t3 += 1) {
|
|
2391
|
-
let i3 =
|
|
2428
|
+
let i3 = Uo(e2.startDate, t3);
|
|
2392
2429
|
r2.push({ date: i3, availability: n2.get(i3) ?? `none` });
|
|
2393
2430
|
}
|
|
2394
2431
|
return r2;
|
|
2395
2432
|
}
|
|
2396
|
-
function
|
|
2397
|
-
return { fromLocalDate:
|
|
2433
|
+
function Qc(e2, t2) {
|
|
2434
|
+
return { fromLocalDate: Ro(e2.startDate, t2), toLocalDate: Io(No(e2.endDate)) };
|
|
2398
2435
|
}
|
|
2399
|
-
async function
|
|
2400
|
-
return (await
|
|
2436
|
+
async function $c(e2, t2, n2, r2, i2, a2) {
|
|
2437
|
+
return (await fs({ serviceId: e2, ...Qc(n2, t2), timeZone: t2, ...ts(r2), ...ns(i2), ...is(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Wo(n2), Xc) } })).timeSlots ?? [];
|
|
2401
2438
|
}
|
|
2402
|
-
async function
|
|
2403
|
-
return (await
|
|
2439
|
+
async function el(e2, t2, n2, r2, i2, a2) {
|
|
2440
|
+
return (await ms({ serviceIds: [e2], ...Qc(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...ps(r2, i2, a2) }, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(Wo(n2), Xc) } })).timeSlots;
|
|
2404
2441
|
}
|
|
2405
|
-
async function
|
|
2406
|
-
if (
|
|
2407
|
-
let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 =
|
|
2408
|
-
return
|
|
2442
|
+
async function tl({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2 }) {
|
|
2443
|
+
if (eo(t2) || n2.endDate < r2) return Zc(n2, []);
|
|
2444
|
+
let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 = $a(t2) ? Jo(l2) : [l2];
|
|
2445
|
+
return Zc(n2, (await Promise.all(u2.map((n3) => $a(t2) ? el(e2, i2, n3, a2, o2, c2) : $c(e2, i2, n3, a2, o2, s2)))).flat());
|
|
2409
2446
|
}
|
|
2410
|
-
function
|
|
2447
|
+
function nl({ serviceId: e2, staff: t2, customerChoices: n2 }) {
|
|
2411
2448
|
let r2 = t2 && !t2.anyResource ? t2.staffMemberId : void 0;
|
|
2412
|
-
return { serviceId: e2, ...
|
|
2449
|
+
return { serviceId: e2, ...is(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [qr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: qr, resourceIds: [r2] }] } : {} };
|
|
2413
2450
|
}
|
|
2414
|
-
function
|
|
2415
|
-
return { services: e2.map(
|
|
2451
|
+
function rl({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
|
|
2452
|
+
return { services: e2.map(nl), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
|
|
2416
2453
|
}
|
|
2417
|
-
function
|
|
2418
|
-
let { customerChoices: t2, ...n2 } = e2, r2 = t2 ?
|
|
2454
|
+
function il(e2) {
|
|
2455
|
+
let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? rs(t2) : void 0;
|
|
2419
2456
|
return r2 ? { ...n2, customerChoices: r2 } : n2;
|
|
2420
2457
|
}
|
|
2421
|
-
async function
|
|
2422
|
-
let t2 = e2.services ?? [], n2 = () =>
|
|
2423
|
-
if (r2 &&
|
|
2458
|
+
async function al(e2) {
|
|
2459
|
+
let t2 = e2.services ?? [], n2 = () => Oa({ ...e2, services: t2.map(il) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
|
|
2460
|
+
if (r2 && ls()) return n2();
|
|
2424
2461
|
try {
|
|
2425
|
-
return await
|
|
2462
|
+
return await Oa(e2);
|
|
2426
2463
|
} catch (e3) {
|
|
2427
|
-
if (!r2 || !
|
|
2428
|
-
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }),
|
|
2464
|
+
if (!r2 || !os(e3)) throw e3;
|
|
2465
|
+
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ds(), n2();
|
|
2429
2466
|
}
|
|
2430
2467
|
}
|
|
2431
|
-
var
|
|
2432
|
-
async function
|
|
2433
|
-
if (e2.endDate < t2) return
|
|
2468
|
+
var ol = 1e3;
|
|
2469
|
+
async function sl({ range: e2, fromDate: t2, ...n2 }) {
|
|
2470
|
+
if (e2.endDate < t2) return Zc(e2, []);
|
|
2434
2471
|
let r2 = { startDate: e2.startDate < t2 ? t2 : e2.startDate, endDate: e2.endDate };
|
|
2435
|
-
return
|
|
2472
|
+
return Zc(e2, (await al({ ...rl(n2), fromLocalDate: Ro(r2.startDate, n2.timeZone), toLocalDate: Io(No(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Wo(r2), ol) } })).timeSlots ?? []);
|
|
2436
2473
|
}
|
|
2437
|
-
async function
|
|
2474
|
+
async function cl({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
|
|
2438
2475
|
let i2 = `${e2}T00:00:00`, a2 = [], o2 = null, s2;
|
|
2439
2476
|
do {
|
|
2440
|
-
let c2 = await
|
|
2477
|
+
let c2 = await al({ ...rl(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: ol, ...s2 ? { cursor: s2 } : {} } });
|
|
2441
2478
|
a2.push(...c2.timeSlots ?? []), o2 = c2.timeZone ?? o2, s2 = c2.cursorPagingMetadata?.cursors?.next || void 0;
|
|
2442
2479
|
} while (s2);
|
|
2443
2480
|
return { timeSlots: a2, timeZone: o2 };
|
|
2444
2481
|
}
|
|
2445
|
-
async function
|
|
2446
|
-
let n2 = await
|
|
2482
|
+
async function ll({ fromDate: e2, ...t2 }) {
|
|
2483
|
+
let n2 = await al({ ...rl(t2), ...ys(e2), bookable: true, cursorPaging: { limit: 1 } });
|
|
2447
2484
|
return { timeSlots: n2.timeSlots ?? [], timeZone: n2.timeZone ?? null };
|
|
2448
2485
|
}
|
|
2449
|
-
var
|
|
2450
|
-
function
|
|
2451
|
-
let [_2, v2] = (0, import_react.useState)(null), [y2, b2] = (0, import_react.useState)(p2), [x2, S2] = (0, import_react.useState)(
|
|
2486
|
+
var ul = [];
|
|
2487
|
+
function dl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: u2, locationId: d2, staffId: f2, loadInitially: p2, customerChoices: m2, minRemainingCapacity: h2, onlyAvailableSlots: g2 }) {
|
|
2488
|
+
let [_2, v2] = (0, import_react.useState)(null), [y2, b2] = (0, import_react.useState)(p2), [x2, S2] = (0, import_react.useState)(ul), [C2, w2] = (0, import_react.useState)(false), [T2, E2] = (0, import_react.useState)(false), D2 = (0, import_react.useRef)(0);
|
|
2452
2489
|
(0, import_react.useEffect)(() => {
|
|
2453
|
-
_2 === null && u2 && v2(
|
|
2490
|
+
_2 === null && u2 && v2(Go(u2));
|
|
2454
2491
|
}, [_2, u2]), (0, import_react.useEffect)(() => {
|
|
2455
|
-
if (!y2 || !e2 || !(t2 ||
|
|
2456
|
-
let
|
|
2457
|
-
return w2(true), (
|
|
2458
|
-
|
|
2492
|
+
if (!y2 || !e2 || !(t2 || r2) || !a2 || !u2 || !_2 || !r2 && eo(n2)) return;
|
|
2493
|
+
let i2 = ++D2.current;
|
|
2494
|
+
return w2(true), (r2 ? sl({ ...r2, range: _2, fromDate: u2, timeZone: a2 }) : tl({ serviceId: t2, serviceType: n2, range: _2, fromDate: u2, timeZone: a2, locationId: d2 ?? void 0, staffId: f2 ?? void 0, customerChoices: m2, minRemainingCapacity: h2 })).then((e3) => {
|
|
2495
|
+
i2 === D2.current && (S2(e3), E2(false), w2(false));
|
|
2459
2496
|
}).catch((e3) => {
|
|
2460
|
-
|
|
2497
|
+
i2 === D2.current && ($(e3, { feature: Q.timeSlots, action: `fetch-days-availability`, level: `warning` }), E2(true), w2(false));
|
|
2461
2498
|
}), () => {
|
|
2462
|
-
|
|
2499
|
+
i2 === D2.current && (D2.current += 1);
|
|
2463
2500
|
};
|
|
2464
|
-
}, [y2, e2, t2, n2,
|
|
2465
|
-
let
|
|
2466
|
-
|
|
2501
|
+
}, [y2, e2, t2, n2, r2, a2, u2, _2, d2, f2, m2, h2]);
|
|
2502
|
+
let O2 = (0, import_react.useCallback)(async (e3) => {
|
|
2503
|
+
Ho(e3) && (v2(e3), b2(true));
|
|
2467
2504
|
}, []);
|
|
2468
|
-
return { range: _2, daysAvailability: (0, import_react.useMemo)(() => g2 ? x2.map((e3) => e3.availability === `unavailable` ? { ...e3, availability: `none` } : e3) : x2, [x2, g2]), isLoading: C2, hasError: T2, setRange:
|
|
2505
|
+
return { range: _2, daysAvailability: (0, import_react.useMemo)(() => g2 ? x2.map((e3) => e3.availability === `unavailable` ? { ...e3, availability: `none` } : e3) : x2, [x2, g2]), isLoading: C2, hasError: T2, setRange: O2 };
|
|
2469
2506
|
}
|
|
2470
|
-
function
|
|
2471
|
-
let [g2, _2] = (0, import_react.useState)(null), [v2, y2] = (0, import_react.useState)(0), [b2, x2] = (0, import_react.useState)(null), [S2, C2] = (0, import_react.useState)(null), [w2, T2] = (0, import_react.useState)(null), [
|
|
2472
|
-
|
|
2507
|
+
function fl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: s2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
|
|
2508
|
+
let [g2, _2] = (0, import_react.useState)(null), [v2, y2] = (0, import_react.useState)(0), [b2, x2] = (0, import_react.useState)(null), [S2, C2] = (0, import_react.useState)(null), [w2, T2] = (0, import_react.useState)(null), [E2, D2] = (0, import_react.useState)(false), O2 = (0, import_react.useRef)(0), ee2 = (0, import_react.useRef)(0), te2 = (0, import_react.useRef)(0), k2 = (0, import_react.useCallback)(() => {
|
|
2509
|
+
ee2.current += 1, D2(false);
|
|
2473
2510
|
}, []);
|
|
2474
2511
|
(0, import_react.useEffect)(() => {
|
|
2475
|
-
|
|
2476
|
-
}, [e2, t2, n2,
|
|
2477
|
-
let
|
|
2512
|
+
k2();
|
|
2513
|
+
}, [e2, t2, n2, r2, a2, u2, d2, f2, p2, k2]);
|
|
2514
|
+
let A2 = e2 && !h2 && !t2 && !r2;
|
|
2478
2515
|
(0, import_react.useEffect)(() => {
|
|
2479
|
-
|
|
2480
|
-
}, [
|
|
2516
|
+
A2 && (C2(null), T2(null));
|
|
2517
|
+
}, [A2]), (0, import_react.useEffect)(() => {
|
|
2481
2518
|
if (!g2) return;
|
|
2482
|
-
if (
|
|
2519
|
+
if (A2) {
|
|
2483
2520
|
_2(null);
|
|
2484
2521
|
return;
|
|
2485
2522
|
}
|
|
2486
|
-
if (!e2 || !(t2 ||
|
|
2487
|
-
if (
|
|
2523
|
+
if (!e2 || !(t2 || r2) || !a2) return;
|
|
2524
|
+
if (s2 && g2.date < s2) {
|
|
2488
2525
|
_2(null);
|
|
2489
2526
|
return;
|
|
2490
2527
|
}
|
|
2491
|
-
if (!
|
|
2528
|
+
if (!r2 && eo(n2)) {
|
|
2492
2529
|
_2(null);
|
|
2493
2530
|
return;
|
|
2494
2531
|
}
|
|
2495
|
-
let
|
|
2532
|
+
let i2 = Lo(new Date(Date.now()), a2), o2 = ++O2.current;
|
|
2496
2533
|
x2(null), C2(null), T2(null);
|
|
2497
|
-
let
|
|
2498
|
-
return (
|
|
2499
|
-
|
|
2534
|
+
let c2 = i2.slice(0, 10) === g2.date ? i2 : void 0;
|
|
2535
|
+
return (r2 ? cl({ ...r2, date: g2.date, timeZone: a2, onlyAvailableSlots: m2, fromLocalDate: c2 }) : Ss({ serviceId: t2, serviceType: n2, date: g2.date, timeZone: a2, onlyAvailableSlots: m2, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2, fromLocalDate: c2 })).then((e3) => {
|
|
2536
|
+
o2 === O2.current && x2({ timeSlots: e3.timeSlots, timeZone: e3.timeZone ?? a2 });
|
|
2500
2537
|
}).catch((e3) => {
|
|
2501
|
-
|
|
2538
|
+
o2 === O2.current && ($(e3, { feature: Q.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), C2(`timeSlotsLoadFailed`));
|
|
2502
2539
|
}), () => {
|
|
2503
|
-
|
|
2540
|
+
o2 === O2.current && (O2.current += 1);
|
|
2504
2541
|
};
|
|
2505
|
-
}, [g2, v2, e2, t2, h2, n2,
|
|
2506
|
-
let
|
|
2507
|
-
!
|
|
2508
|
-
}, [n2,
|
|
2509
|
-
let
|
|
2510
|
-
if (!
|
|
2511
|
-
let
|
|
2512
|
-
|
|
2542
|
+
}, [g2, v2, e2, t2, h2, n2, r2, a2, s2, u2, d2, f2, p2, m2]);
|
|
2543
|
+
let j2 = (0, import_react.useCallback)(async (e3) => {
|
|
2544
|
+
!r2 && eo(n2) || !Vo(e3) || s2 && e3 < s2 || (k2(), y2((e4) => e4 + 1), _2({ kind: `day`, date: e3 }));
|
|
2545
|
+
}, [n2, r2, s2, k2]), ne2 = g2?.date ?? null, M2 = (0, import_react.useCallback)(async () => {
|
|
2546
|
+
let i2 = !!(t2 || r2);
|
|
2547
|
+
if (!r2 && eo(n2) || !e2 || !i2 || !a2) return { outcome: `none` };
|
|
2548
|
+
let o2 = O2.current, c2 = ++ee2.current, l2 = ++te2.current, m3 = () => o2 === O2.current && c2 === ee2.current;
|
|
2549
|
+
D2(true), T2(null);
|
|
2513
2550
|
try {
|
|
2514
|
-
let e3 =
|
|
2551
|
+
let e3 = ne2 ?? s2 ?? void 0, i3 = r2 ? await ll({ ...r2, timeZone: a2, fromDate: e3 }) : await bs({ serviceId: t2, serviceType: n2, timeZone: a2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
|
|
2515
2552
|
if (!m3()) return { outcome: `cancelled` };
|
|
2516
|
-
let
|
|
2517
|
-
return
|
|
2553
|
+
let o3 = i3.timeSlots[0]?.localStartDate?.slice(0, 10) ?? null;
|
|
2554
|
+
return o3 ? { outcome: `found`, date: o3 } : { outcome: `none` };
|
|
2518
2555
|
} catch (e3) {
|
|
2519
2556
|
return m3() ? ($(e3, { feature: Q.timeSlots, action: `find-next-available-date`, level: `warning` }), T2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
|
|
2520
2557
|
} finally {
|
|
2521
|
-
|
|
2558
|
+
l2 === te2.current && D2(false);
|
|
2522
2559
|
}
|
|
2523
|
-
}, [e2, t2, n2,
|
|
2524
|
-
return { query: g2, selectedDate:
|
|
2560
|
+
}, [e2, t2, n2, r2, a2, s2, u2, d2, f2, p2, ne2]), re2 = w2 ?? S2;
|
|
2561
|
+
return { query: g2, selectedDate: ne2, timeSlots: b2?.timeSlots ?? null, timeZone: b2?.timeZone ?? null, isLoading: E2 || g2 !== null && b2 === null && S2 === null, error: re2, selectDate: j2, findNextAvailableDate: M2 };
|
|
2525
2562
|
}
|
|
2526
|
-
var
|
|
2527
|
-
function
|
|
2563
|
+
var pl = (e2) => e2?.type === `DATE_TIME`;
|
|
2564
|
+
function ml(e2) {
|
|
2528
2565
|
let t2 = e2.schedule?.availabilityConstraints?.durations;
|
|
2529
|
-
if (!
|
|
2566
|
+
if (!Qa(e2.type) || !Array.isArray(t2)) return false;
|
|
2530
2567
|
let n2 = t2.map((e3) => typeof e3 == `number` ? e3 : e3?.minutes);
|
|
2531
2568
|
return new Set(n2).size > 1;
|
|
2532
2569
|
}
|
|
2533
|
-
function
|
|
2534
|
-
if (!
|
|
2535
|
-
if (t2 ||
|
|
2536
|
-
if (!
|
|
2537
|
-
let i2 =
|
|
2538
|
-
return r2 && i2 !== r2 ? true : !
|
|
2570
|
+
function hl({ service: e2, multiServiceAppointmentsEnabled: t2, variants: n2, locationId: r2 }) {
|
|
2571
|
+
if (!Qa(e2.type)) return false;
|
|
2572
|
+
if (t2 || ml(e2) || no(e2)) return true;
|
|
2573
|
+
if (!to(e2) || pl(n2)) return false;
|
|
2574
|
+
let i2 = Ns(e2, r2);
|
|
2575
|
+
return r2 && i2 !== r2 ? true : !As(n2, Ms(e2), i2);
|
|
2539
2576
|
}
|
|
2540
|
-
function
|
|
2541
|
-
return !!
|
|
2577
|
+
function gl(e2, t2) {
|
|
2578
|
+
return !!Lr(e2)?.services.some((e3) => e3.serviceId === t2);
|
|
2542
2579
|
}
|
|
2543
|
-
function
|
|
2544
|
-
return !t2.service._id ||
|
|
2580
|
+
function _l({ blobParam: e2, ...t2 }) {
|
|
2581
|
+
return !t2.service._id || gl(e2, t2.service._id) ? false : hl({ ...t2, multiServiceAppointmentsEnabled: false });
|
|
2545
2582
|
}
|
|
2546
|
-
function
|
|
2583
|
+
function vl(e2) {
|
|
2547
2584
|
return !!e2?._id;
|
|
2548
2585
|
}
|
|
2549
|
-
function
|
|
2586
|
+
function yl() {
|
|
2550
2587
|
try {
|
|
2551
2588
|
return (0, import_services_manager_react.useGetService)();
|
|
2552
2589
|
} catch {
|
|
2553
2590
|
return null;
|
|
2554
2591
|
}
|
|
2555
2592
|
}
|
|
2556
|
-
function
|
|
2557
|
-
let e2 =
|
|
2593
|
+
function bl() {
|
|
2594
|
+
let e2 = yl();
|
|
2558
2595
|
return (0, import_react.useCallback)((t2) => {
|
|
2559
2596
|
if (!e2) return false;
|
|
2560
2597
|
try {
|
|
2561
|
-
let n2 = e2(
|
|
2598
|
+
let n2 = e2(Br).currentPage;
|
|
2562
2599
|
return !n2.popup && (!n2.appDefinitionId || n2.appDefinitionId === `13d21c63-b5ec-5912-8397-c3a5ddb27a97`) && n2.appPageId === t2;
|
|
2563
2600
|
} catch {
|
|
2564
2601
|
return false;
|
|
2565
2602
|
}
|
|
2566
2603
|
}, [e2]);
|
|
2567
2604
|
}
|
|
2568
|
-
function
|
|
2569
|
-
let { service: t2, isLoading: n2, hasError: r2, bookingsSettingsLoading: i2, isLoadingServiceOptionsAndVariants:
|
|
2605
|
+
function xl(e2) {
|
|
2606
|
+
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 } = (0, import_service.useServiceContext)(), _2 = bl(), v2 = Bc(Fc.PREFERENCES), y2 = (0, import_react.useRef)(false), b2 = e2 && !m2 && !g2 && !n2 && !r2 && !i2 && !a2 && f2 == null && !u2 && vl(t2), x2 = p2.locationId ?? void 0, S2 = Ac(m2);
|
|
2570
2607
|
(0, import_react.useEffect)(() => {
|
|
2571
|
-
!y2.current && b2 && (y2.current = true, _2(
|
|
2572
|
-
}, [b2, t2, l2,
|
|
2608
|
+
!y2.current && b2 && (y2.current = true, _2(Jr.CALENDAR_PAGE) && _l({ service: t2, multiServiceAppointmentsEnabled: l2, variants: s2, locationId: x2, blobParam: S2 }) && (jo({ message: `Calendar opens the preferences modal`, category: `navigation`, feature: Q.timeSlots, data: { serviceId: t2._id ?? null, serviceType: t2.type ?? null } }), v2(Hc({ action: Lc.EDIT_BASKET_ITEM_FROM_CALENDAR, numberOfServices: 1, isMultiFlow: l2 })), h2().then(() => Ao(`Preferences modal opened`, { feature: Q.timeSlots, action: `auto-open-preferences`, tags: { serviceType: t2.type ?? `unknown` } }), (e3) => $(e3, { feature: Q.timeSlots, action: `open-preferences-lightbox` }))));
|
|
2609
|
+
}, [b2, t2, l2, s2, x2, S2, _2, v2, h2]);
|
|
2573
2610
|
}
|
|
2574
|
-
function
|
|
2611
|
+
function Sl(e2, t2) {
|
|
2575
2612
|
return t2 === void 0 ? false : !e2 || new Date(e2).getTime() <= t2;
|
|
2576
2613
|
}
|
|
2577
|
-
var
|
|
2578
|
-
function
|
|
2579
|
-
let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate:
|
|
2580
|
-
return
|
|
2614
|
+
var Cl = 864e5;
|
|
2615
|
+
function wl({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
|
|
2616
|
+
let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: Lo(new Date(i2), r2) };
|
|
2617
|
+
return $a(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : eo(t2) ? !n2 || Sl(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: Lo(new Date(new Date(n2).getTime() + Cl), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: ys().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
|
|
2581
2618
|
}
|
|
2582
|
-
function
|
|
2619
|
+
function Tl({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
|
|
2583
2620
|
return e2 && t2 > 1 && !n2 && !i2 && (a2 !== `CUSTOMER_MUST_CHOOSE` || r2);
|
|
2584
2621
|
}
|
|
2585
|
-
function
|
|
2622
|
+
function El(e2, t2) {
|
|
2586
2623
|
return e2.length ? e2.length === 1 ? { anyResource: false, staffMemberId: e2[0] } : t2 ? { anyResource: true } : null : null;
|
|
2587
2624
|
}
|
|
2588
|
-
function
|
|
2625
|
+
function Dl(e2, t2, n2) {
|
|
2589
2626
|
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 };
|
|
2590
2627
|
}
|
|
2591
|
-
var
|
|
2592
|
-
function
|
|
2593
|
-
if (!e2) return
|
|
2594
|
-
let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ?
|
|
2595
|
-
if (!l2) return { ...
|
|
2596
|
-
if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...
|
|
2628
|
+
var Ol = { staff: null, requestedGender: null, locationId: null };
|
|
2629
|
+
function kl({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
|
|
2630
|
+
if (!e2) return Ol;
|
|
2631
|
+
let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? uo(e2) : null;
|
|
2632
|
+
if (!l2) return { ...Ol, locationId: c2 };
|
|
2633
|
+
if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...Ol, locationId: c2 };
|
|
2597
2634
|
let u2 = a2 ? e2.requestedGender ?? null : null;
|
|
2598
|
-
return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...
|
|
2635
|
+
return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...Ol, locationId: c2 };
|
|
2599
2636
|
}
|
|
2600
|
-
var
|
|
2601
|
-
function
|
|
2602
|
-
let s2 =
|
|
2603
|
-
return { rows: t2 ? c2 :
|
|
2637
|
+
var Al = [];
|
|
2638
|
+
function jl({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
|
|
2639
|
+
let s2 = Bl(Vl(e2, r2)), c2 = n2 ? Vl(i2 ? es(n2) : n2, r2) : Al;
|
|
2640
|
+
return { rows: t2 ? c2 : Hl(s2, a2, o2), slotIdOf: t2 ? Zo : $o, daysWithMore: zl(s2, a2, o2) };
|
|
2604
2641
|
}
|
|
2605
|
-
function
|
|
2606
|
-
return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) =>
|
|
2642
|
+
function Ml({ rows: e2, slotIdOf: t2 }, n2) {
|
|
2643
|
+
return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => Rl(t3) - Rl(e3))[0] ?? null;
|
|
2607
2644
|
}
|
|
2608
|
-
function
|
|
2609
|
-
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:
|
|
2645
|
+
function Nl(e2, t2, n2, r2) {
|
|
2646
|
+
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: Ll(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Pl(e2) };
|
|
2610
2647
|
}
|
|
2611
|
-
function
|
|
2648
|
+
function Pl(e2) {
|
|
2612
2649
|
let t2 = /* @__PURE__ */ new Map();
|
|
2613
2650
|
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 ?? ``);
|
|
2614
2651
|
return [...t2].map(([e3, t3]) => ({ staffMemberId: e3, name: t3 }));
|
|
2615
2652
|
}
|
|
2616
|
-
function
|
|
2617
|
-
let t2 =
|
|
2653
|
+
function Fl(e2) {
|
|
2654
|
+
let t2 = Pl(e2);
|
|
2618
2655
|
if (t2.length) return t2.length === 1 ? t2[0].staffMemberId : null;
|
|
2619
2656
|
}
|
|
2620
|
-
function
|
|
2621
|
-
return
|
|
2657
|
+
function Il(e2) {
|
|
2658
|
+
return Pl(e2).map((e3) => e3.staffMemberId);
|
|
2622
2659
|
}
|
|
2623
|
-
function
|
|
2660
|
+
function Ll(e2, t2) {
|
|
2624
2661
|
if (!e2.localStartDate || !e2.localEndDate) return null;
|
|
2625
|
-
let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 =
|
|
2662
|
+
let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = Gc(e2.localStartDate, n2), i2 = Gc(e2.localEndDate, n2);
|
|
2626
2663
|
return !r2 || !i2 || i2 < r2 ? null : Math.round((i2.getTime() - r2.getTime()) / 6e4);
|
|
2627
2664
|
}
|
|
2628
|
-
function
|
|
2665
|
+
function Rl(e2) {
|
|
2629
2666
|
let t2 = e2.bookableCapacity ?? e2.remainingCapacity;
|
|
2630
2667
|
return (e2.eventInfo?.waitingList?.remainingCapacity ?? 0) > 0 && (t2 ?? 0) <= 0 ? 1 : e2.bookable ? 2 : 0;
|
|
2631
2668
|
}
|
|
2632
|
-
function
|
|
2669
|
+
function zl(e2, t2, n2) {
|
|
2633
2670
|
let r2 = /* @__PURE__ */ new Map();
|
|
2634
2671
|
for (let t3 of e2) {
|
|
2635
2672
|
let e3 = (t3.localStartDate ?? ``).slice(0, 10);
|
|
@@ -2637,16 +2674,16 @@ function Dl(e2, t2, n2) {
|
|
|
2637
2674
|
}
|
|
2638
2675
|
return new Set([...r2].filter(([e3, r3]) => r3 > t2 && !n2.has(e3)).map(([e3]) => e3));
|
|
2639
2676
|
}
|
|
2640
|
-
function
|
|
2677
|
+
function Bl(e2) {
|
|
2641
2678
|
return e2.flatMap((e3) => {
|
|
2642
|
-
let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId ===
|
|
2679
|
+
let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === qr), n2 = t2?.resources ?? [];
|
|
2643
2680
|
return n2.length <= 1 ? [e3] : n2.map((n3) => ({ ...e3, availableResources: [{ ...t2, resources: [n3] }] }));
|
|
2644
2681
|
});
|
|
2645
2682
|
}
|
|
2646
|
-
function
|
|
2683
|
+
function Vl(e2, t2) {
|
|
2647
2684
|
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;
|
|
2648
2685
|
}
|
|
2649
|
-
function
|
|
2686
|
+
function Hl(e2, t2, n2) {
|
|
2650
2687
|
let r2 = /* @__PURE__ */ new Map();
|
|
2651
2688
|
return e2.filter((e3) => {
|
|
2652
2689
|
let i2 = (e3.localStartDate ?? ``).slice(0, 10);
|
|
@@ -2655,248 +2692,254 @@ function Al(e2, t2, n2) {
|
|
|
2655
2692
|
return r2.set(i2, a2 + 1), a2 < t2;
|
|
2656
2693
|
});
|
|
2657
2694
|
}
|
|
2658
|
-
async function
|
|
2695
|
+
async function Ul() {
|
|
2659
2696
|
try {
|
|
2660
|
-
return await
|
|
2697
|
+
return await Xo();
|
|
2661
2698
|
} catch (e2) {
|
|
2662
2699
|
return $(e2, { feature: Q.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
|
|
2663
2700
|
}
|
|
2664
2701
|
}
|
|
2665
|
-
function
|
|
2666
|
-
return
|
|
2702
|
+
function Wl(e2) {
|
|
2703
|
+
return tc({ key: Ws(), warmupData: e2, fetchData: Ul });
|
|
2667
2704
|
}
|
|
2668
|
-
function
|
|
2705
|
+
function Gl(e2) {
|
|
2669
2706
|
return (e2.localStartDate ?? ``).slice(0, 10);
|
|
2670
2707
|
}
|
|
2671
|
-
var
|
|
2672
|
-
function
|
|
2673
|
-
let { serviceId: n2 = ``, serviceType: r2 = `CLASS`, fromLocalDate: i2 = ``, toLocalDate:
|
|
2708
|
+
var Kl = [];
|
|
2709
|
+
function ql(e2, t2) {
|
|
2710
|
+
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] = (0, import_react.useState)([]), [v2, y2] = (0, import_react.useState)([]), [b2, x2] = (0, import_react.useState)(1), [S2, C2] = (0, import_react.useState)(!!n2), [w2, T2] = (0, import_react.useState)(null), [E2, D2] = (0, import_react.useState)(null), [O2, ee2] = (0, import_react.useState)(/* @__PURE__ */ new Set()), [te2, k2] = (0, import_react.useState)(null), A2 = (0, import_react.useRef)(null), j2 = (0, import_react.useRef)(null);
|
|
2674
2711
|
(0, import_react.useEffect)(() => {
|
|
2675
|
-
if (_2([]), y2([]), x2(1),
|
|
2676
|
-
let t3 = false,
|
|
2712
|
+
if (_2([]), y2([]), x2(1), D2(null), T2(null), ee2(/* @__PURE__ */ new Set()), k2(null), C2(!!n2), !n2) return;
|
|
2713
|
+
let t3 = false, o2 = false, c2 = [], l2 = [];
|
|
2677
2714
|
async function g3(g4) {
|
|
2678
|
-
if (t3 ||
|
|
2679
|
-
if (
|
|
2715
|
+
if (t3 || o2) return;
|
|
2716
|
+
if (c2[g4 - 1]) {
|
|
2680
2717
|
T2(null), x2(g4);
|
|
2681
2718
|
return;
|
|
2682
2719
|
}
|
|
2683
|
-
let v4 = g4 === 1 ? void 0 :
|
|
2720
|
+
let v4 = g4 === 1 ? void 0 : l2[g4 - 2];
|
|
2684
2721
|
if (g4 === 1 || v4) {
|
|
2685
|
-
|
|
2722
|
+
o2 = true, T2(null), C2(true);
|
|
2686
2723
|
try {
|
|
2687
|
-
let
|
|
2724
|
+
let o3 = [], b3 = null, S3 = v4 ?? void 0, C3 = /* @__PURE__ */ new Set();
|
|
2688
2725
|
do {
|
|
2689
2726
|
S3 && C3.add(S3);
|
|
2690
|
-
let
|
|
2727
|
+
let c3 = await hs({ 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 });
|
|
2691
2728
|
if (t3) return;
|
|
2692
|
-
if (
|
|
2693
|
-
S3 = b3 ?? void 0,
|
|
2694
|
-
} while (
|
|
2695
|
-
|
|
2729
|
+
if (o3.push(...c3.timeSlots), b3 = c3.nextCursor, b3 && C3.has(b3)) throw Error(`The session API repeated a page cursor`);
|
|
2730
|
+
S3 = b3 ?? void 0, D2(c3.timeZone ?? s2 ?? null);
|
|
2731
|
+
} while (o3.length === 0 && b3 !== null);
|
|
2732
|
+
c2 = [...c2, o3], l2 = [...l2, b3], _2(c2), y2(l2), (g4 === 1 || o3.length > 0) && x2(g4);
|
|
2696
2733
|
} catch (e3) {
|
|
2697
2734
|
if (t3) return;
|
|
2698
2735
|
$(e3, { feature: Q.sessions, action: `fetch-page` }), T2(e3 instanceof Error ? e3.message : `Failed to load sessions`);
|
|
2699
2736
|
} finally {
|
|
2700
|
-
|
|
2737
|
+
o2 = false, t3 || C2(false);
|
|
2701
2738
|
}
|
|
2702
2739
|
}
|
|
2703
2740
|
}
|
|
2704
2741
|
async function v3(e3) {
|
|
2705
|
-
if (!(t3 ||
|
|
2742
|
+
if (!(t3 || o2)) {
|
|
2706
2743
|
if (h2 == null) {
|
|
2707
|
-
|
|
2744
|
+
ee2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
|
|
2708
2745
|
return;
|
|
2709
2746
|
}
|
|
2710
|
-
|
|
2747
|
+
o2 = true, k2(e3), T2(null);
|
|
2711
2748
|
try {
|
|
2712
|
-
let
|
|
2749
|
+
let o3 = await Ss({ serviceId: n2, serviceType: r2, date: e3, timeZone: s2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: a2 });
|
|
2713
2750
|
if (t3) return;
|
|
2714
|
-
let
|
|
2715
|
-
|
|
2716
|
-
let r3 = t4.filter((t5) =>
|
|
2717
|
-
return n3 === h3 ? [...r3, ...
|
|
2718
|
-
}), _2(
|
|
2751
|
+
let l3 = o3.timeSlots.filter((t4) => Gl(t4) === e3), h3 = Math.max(0, c2.findIndex((t4) => t4.some((t5) => Gl(t5) === e3)));
|
|
2752
|
+
c2 = c2.map((t4, n3) => {
|
|
2753
|
+
let r3 = t4.filter((t5) => Gl(t5) !== e3);
|
|
2754
|
+
return n3 === h3 ? [...r3, ...l3] : r3;
|
|
2755
|
+
}), _2(c2), ee2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
|
|
2719
2756
|
} catch (e4) {
|
|
2720
2757
|
if (t3) return;
|
|
2721
2758
|
$(e4, { feature: Q.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
|
|
2722
2759
|
} finally {
|
|
2723
|
-
|
|
2760
|
+
o2 = false, t3 || k2(null);
|
|
2724
2761
|
}
|
|
2725
2762
|
}
|
|
2726
2763
|
}
|
|
2727
|
-
return
|
|
2728
|
-
t3 = true,
|
|
2764
|
+
return A2.current = g3, j2.current = v3, g3(1), () => {
|
|
2765
|
+
t3 = true, A2.current = null, j2.current = null;
|
|
2729
2766
|
};
|
|
2730
|
-
}, [n2, r2, i2,
|
|
2731
|
-
let
|
|
2732
|
-
async function
|
|
2733
|
-
|
|
2767
|
+
}, [n2, r2, i2, a2, s2, u2, d2, f2, p2, m2, h2, e2]);
|
|
2768
|
+
let ne2 = [...g2[b2 - 1] ?? Kl].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), M2 = g2[b2], re2 = M2 ? M2.length > 0 : v2[b2 - 1] != null, N2 = b2 > 1;
|
|
2769
|
+
async function ie2() {
|
|
2770
|
+
re2 && !S2 && await A2.current?.(b2 + 1);
|
|
2734
2771
|
}
|
|
2735
|
-
function
|
|
2736
|
-
|
|
2772
|
+
function ae2() {
|
|
2773
|
+
N2 && !S2 && A2.current?.(b2 - 1);
|
|
2737
2774
|
}
|
|
2738
|
-
async function
|
|
2739
|
-
S2 ||
|
|
2775
|
+
async function oe2(e3) {
|
|
2776
|
+
S2 || te2 !== null || O2.has(e3) || await j2.current?.(e3);
|
|
2740
2777
|
}
|
|
2741
|
-
return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone:
|
|
2778
|
+
return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone: E2, sessions: ne2, pageSize: e2, currentPage: b2, hasNextPage: re2, hasPreviousPage: N2, nextPage: ie2, previousPage: ae2, expandedDates: O2, loadingDate: te2, loadAllSessionsForDay: oe2 };
|
|
2742
2779
|
}
|
|
2743
|
-
var
|
|
2744
|
-
function
|
|
2780
|
+
var Jl = (e2) => e2?.onlineBooking?.enabled === true;
|
|
2781
|
+
function Yl(e2, t2) {
|
|
2745
2782
|
return e2 ? e2.anyResource ? t2 ?? `` : e2.staffMemberId : null;
|
|
2746
2783
|
}
|
|
2747
|
-
var
|
|
2748
|
-
var
|
|
2749
|
-
var
|
|
2750
|
-
var
|
|
2784
|
+
var Xl = [];
|
|
2785
|
+
var Zl = [];
|
|
2786
|
+
var Ql = dn.map((e2) => ({ id: e2, gender: e2 }));
|
|
2787
|
+
var $l = () => {
|
|
2751
2788
|
};
|
|
2752
|
-
var
|
|
2789
|
+
var eu = async () => {
|
|
2753
2790
|
};
|
|
2754
|
-
var
|
|
2755
|
-
function
|
|
2756
|
-
let e2 = (0, import_react.useContext)(
|
|
2791
|
+
var tu = (0, import_react.createContext)(null);
|
|
2792
|
+
function nu() {
|
|
2793
|
+
let e2 = (0, import_react.useContext)(tu);
|
|
2757
2794
|
if (!e2) throw Error(`useTimeSlotsContext must be used within TimeSlotsContextProvider`);
|
|
2758
2795
|
return e2;
|
|
2759
2796
|
}
|
|
2760
|
-
function
|
|
2797
|
+
function ru(e2, t2, n2) {
|
|
2761
2798
|
e2 ? t2() : n2();
|
|
2762
2799
|
}
|
|
2763
|
-
var
|
|
2764
|
-
function
|
|
2765
|
-
return Math.min(Math.max(e2, 1),
|
|
2800
|
+
var iu = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
|
|
2801
|
+
function au(e2 = 3) {
|
|
2802
|
+
return Math.min(Math.max(e2, 1), fc);
|
|
2766
2803
|
}
|
|
2767
|
-
function
|
|
2804
|
+
function ou(e2) {
|
|
2768
2805
|
let { isLoading: n2, bookingsSettingsLoading: r2 } = (0, import_service.useServiceContext)();
|
|
2769
|
-
|
|
2770
|
-
let i2 =
|
|
2771
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2806
|
+
Vc(Fc.TIME_SLOTS, !n2 && !r2);
|
|
2807
|
+
let i2 = Vs(), [a2] = (0, import_react.useState)(() => Wl(i2));
|
|
2808
|
+
return (0, import_jsx_runtime.jsx)(dc, { children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Jc, { nextAvailableSlotsCount: au(e2.nextAvailableSlotsCount), children: e2.children }), children: (0, import_jsx_runtime.jsx)(cu, { ...e2, configurationPromise: a2 }) }) });
|
|
2772
2809
|
}
|
|
2773
|
-
function
|
|
2810
|
+
function su(e2) {
|
|
2774
2811
|
let [t2, n2] = (0, import_react.useState)({ serviceId: e2, key: 0 });
|
|
2775
2812
|
return e2 !== t2.serviceId && n2({ serviceId: e2, key: t2.serviceId ? t2.key + 1 : t2.key }), t2.key;
|
|
2776
2813
|
}
|
|
2777
|
-
function
|
|
2778
|
-
let s2 =
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
let
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
}, [
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
}, [
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2814
|
+
function cu({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: a2 }) {
|
|
2815
|
+
let s2 = sc().isLoading, { searchParams: c2 } = Cc(), { reschedule: f2, isSelectionPending: p2 } = (0, import_service.useServiceContext)(), [h2] = (0, import_react.useState)(() => ({ locationId: c2.get(ro.location), staffId: c2.get(ro.resource), timeZone: c2.get(ro.timezone) })), g2 = Ac(p2), _2 = () => (f2 ? null : Lr(g2)?.timezone) ?? null, [v2, y2] = (0, import_react.useState)(() => _2() ?? h2.timeZone), [b2, x2] = (0, import_react.useState)(p2);
|
|
2816
|
+
if (b2 && !p2) {
|
|
2817
|
+
x2(false);
|
|
2818
|
+
let e3 = _2();
|
|
2819
|
+
e3 && y2(e3);
|
|
2820
|
+
}
|
|
2821
|
+
let S2 = au(t2), [C2, w2] = (0, import_react.useState)(false);
|
|
2822
|
+
(0, import_react.useEffect)(() => w2(true), []);
|
|
2823
|
+
let T2 = C2 && !s2 && !p2;
|
|
2824
|
+
xl(T2);
|
|
2825
|
+
let E2 = Is(i2), D2 = (0, import_react.useSyncExternalStore)(us, ls, () => false), { serviceId: O2 } = (0, import_service.useServiceContext)(), ee2 = su(O2), te2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
|
|
2826
|
+
return (0, import_jsx_runtime.jsx)(pc, { fallback: (0, import_jsx_runtime.jsx)(Yc, { nextAvailableSlotsCount: S2, children: a2 }), feature: Q.timeSlots, children: (0, import_jsx_runtime.jsx)(lu, { onlyAvailableSlots: e2, selectedTimeZone: v2, setSelectedTimeZone: y2, enabled: T2, nextAvailableSlotsCount: S2, loadDaysAvailabilityInitially: n2, timeSlotLimitPerDay: te2, landingLocationId: h2.locationId, landingStaffId: h2.staffId, businessTimeZone: E2.businessTimeZone, staffSelectionStrategy: E2.staffSelectionStrategy, allowGenderSelection: E2.allowGenderSelection, requestedGenderRejected: D2, children: a2 }) }, ee2);
|
|
2827
|
+
}
|
|
2828
|
+
function lu({ 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 }) {
|
|
2829
|
+
let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: E2, clearMultiServiceSlot: D2, draftRevision: O2, navigateToMultiServiceForm: ee2, selection: te2, selectStaffMember: k2, clearSelection: A2, clearStaffMember: j2, withSelectionParam: ne2, staffMembers: M2, serviceOptionsAndVariants: re2, isLoading: N2, hasError: ie2, multiServiceAppointmentServices: ae2 = Zl, reschedule: oe2, isSelectionPending: se2 } = (0, import_service.useServiceContext)(), P2 = oe2 != null, ce2 = P2 && oe2.status !== `ready`, le2 = P2 && oe2.status === `loading`, ue2 = P2 ? iu[oe2.status] : void 0, de2 = ce2 ? null : oe2?.booking ?? null, fe2 = de2 ? oe2.validUntil : null, pe2 = vl(x2) && !Jl(x2), F2 = pe2 || ce2 ? null : S2, me2 = Ac(se2), he2 = P2 ? null : me2, ge2 = !P2 && se2, _e2 = (0, import_react.useMemo)(() => co(Lr(he2)), [he2]), I2 = !S2 && !N2 && !ie2 && (_e2.valid || _e2.reason !== `too-few-services`), ve2 = I2 && _e2.valid && ae2.some((e3) => !Jl(e3) && _e2.services.some((t3) => t3.serviceId === e3._id)), ye2 = pe2 || ve2, be2 = I2 && _e2.valid && !ve2 ? _e2.requestKey : null, xe2 = (0, import_react.useMemo)(() => be2 && _e2.valid ? { services: _e2.services, locationId: _e2.locationId, locationType: _e2.locationType } : null, [be2]), Se2 = !!F2 || xe2 !== null, Ce2 = F2 || be2, we2 = r2 && !N2 && !ie2 && !Se2 && !le2, Te2 = lc(), Ee2 = sc(), { navigate: De2, resolvePath: Oe2 } = bo(), [ke2, Ae2] = (0, import_react.useState)(null), [je2, Me2] = (0, import_react.useState)(false), Ne2 = (0, import_react.useRef)([]), Pe2 = (0, import_react.useRef)(false), Fe2 = (0, import_react.useCallback)(() => (Me2(true), Pe2.current ? Promise.resolve() : new Promise((e3) => {
|
|
2830
|
+
Ne2.current.push(e3);
|
|
2831
|
+
})), []), Ie2 = r2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Le2 = Za(x2), Re2 = (0, import_react.useRef)(null), ze2 = uo(te2), Be2 = (0, import_react.useRef)(ze2);
|
|
2832
|
+
Be2.current = ze2;
|
|
2833
|
+
let Ve2 = ze2 && !ze2.anyResource ? ze2.staffMemberId : null, He2 = te2.requestedGender ?? null, L2 = !$a(C2) && !eo(C2), Ue2 = L2 && !I2 && ws(re2), R2 = I2 || L2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, We2 = _2 !== void 0, Ge2 = Yo({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && L2 && !I2 && !Ue2, Ke2 = Ge2 && !y2, qe2 = (0, import_react.useMemo)(() => F2 ? Lr(he2)?.services.find((e3) => e3.serviceId === F2) ?? null : null, [he2, F2]), Je2 = (M2 ?? []).map((e3) => e3.staffMemberId).join(`,`), Ye2 = Le2.map((e3) => e3.id).join(`,`), Xe2 = (0, import_react.useMemo)(() => kl({ entry: qe2, appointmentLike: L2, staffChoiceHidden: R2, staffPriced: Ue2, staffSelectionStrategy: _2, genderAllowed: Ke2, staffMemberIds: Je2.split(`,`), locationIds: Ye2.split(`,`) }), [qe2, L2, R2, Ue2, _2, Ke2, Je2, Ye2]), z2 = Xe2.staff, Ze2 = Xe2.locationId, Qe2 = R2 || z2 !== null, [$e2, et2] = (0, import_react.useState)(null), [tt2, nt2] = (0, import_react.useState)(p2 !== null || P2), rt2 = (0, import_react.useMemo)(() => x2 ? Ms(x2) : [], [x2]), it2 = z2 && !z2.anyResource ? z2.staffMemberId : null, at2 = (0, import_react.useMemo)(() => {
|
|
2834
|
+
if (!it2) return rt2;
|
|
2835
|
+
let e3 = rt2.find((e4) => e4.staffMemberId === it2);
|
|
2836
|
+
return e3 ? [e3] : rt2;
|
|
2837
|
+
}, [rt2, it2]), ot2 = de2?.locationId ?? null, st2 = (0, import_react.useMemo)(() => {
|
|
2838
|
+
let e3 = js(Le2, at2);
|
|
2839
|
+
return !ot2 || e3.some((e4) => e4.id === ot2) ? e3 : Le2.filter((t3) => t3.id === ot2 || e3.some((e4) => e4.id === t3.id));
|
|
2840
|
+
}, [x2, at2, ot2]), ct2 = (e3) => !!e3 && st2.some((t3) => t3.id === e3), lt2 = $e2 ?? (tt2 ? ct2(ot2) ? ot2 : p2 : null), ut2 = Le2.length > 1 && st2.length === 1 ? st2[0].id : null, B2 = Ze2 ?? (ct2(lt2) ? lt2 : ut2), dt2 = (0, import_react.useMemo)(() => Ze2 ? [] : st2.map((e3) => ({ id: e3.id, name: e3.label })), [st2, Ze2]), ft2 = (0, import_react.useMemo)(() => new Map(rt2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [rt2]), pt2 = (0, import_react.useCallback)((e3, t3) => Os([{ staffMemberId: e3, locationCoverage: ft2.get(e3) }], t3).length === 1, [ft2]), mt2 = (0, import_react.useMemo)(() => Qe2 ? [] : (M2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [M2, Qe2]), ht2 = (0, import_react.useMemo)(() => B2 ? mt2.filter((e3) => pt2(e3.id, B2)) : mt2, [mt2, B2, pt2]), gt2 = L2 && !We2 ? Xl : ht2, _t2 = L2 && !We2 ? 0 : mt2.length, vt2 = Ke2 && _t2 > 1, yt2 = (0, import_react.useMemo)(() => vt2 ? [...Ql, ...gt2] : gt2, [vt2, gt2]), [bt2, xt2] = (0, import_react.useState)(null), [St2, Ct2] = (0, import_react.useState)(h2 !== null);
|
|
2841
|
+
St2 && h2 !== null && B2 !== null && !pt2(h2, B2) && Ct2(false);
|
|
2842
|
+
let wt2 = bt2 ?? (St2 ? h2 : null), V2 = z2 ? z2.anyResource ? null : z2.staffMemberId : wt2 !== null && ht2.some((e3) => e3.id === wt2) ? wt2 : null, Tt2 = ze2?.anyResource ? He2 : null, [Et2, Dt2] = (0, import_react.useState)(Tt2), [Ot2, kt2] = (0, import_react.useState)(Tt2);
|
|
2843
|
+
!y2 && ze2?.anyResource && He2 !== Ot2 && (kt2(He2), Dt2(He2));
|
|
2844
|
+
let At2 = z2 ? Xe2.requestedGender : Ge2 && _t2 > 1 && V2 === null ? Et2 : null, jt2 = y2 ? null : At2, Mt2 = (0, import_react.useCallback)((e3) => {
|
|
2845
|
+
Be2.current = e3, e3 ? e3.anyResource ? A2(jt2 ?? void 0) : k2(e3.staffMemberId) : j2();
|
|
2846
|
+
}, [j2, A2, k2, jt2]), Nt2 = (0, import_react.useCallback)((e3) => Mt2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [Mt2]), Pt2 = (de2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), Ft2 = de2 && $a(C2) ? de2.participants : null, It2 = L2 ? ao(te2) : null, { addOnIds: Lt2, ...Rt2 } = It2 ?? {}, zt2 = L2 && de2 ? Pt2.length ? { ...Rt2, addOnIds: Pt2 } : Rt2 : It2, Bt2 = zt2 ? rs(zt2) : void 0, Vt2 = JSON.stringify(At2 ? { ...Bt2, requestedGender: { gender: At2 } } : Bt2 ?? null), Ht2 = (0, import_react.useMemo)(() => JSON.parse(Vt2), [Vt2]), Ut2 = z2?.anyResource === true, Wt2 = (0, import_react.useCallback)((e3) => Ut2 || _2 !== void 0 && Tl({ isAppointment: L2, staffOnSlotCount: e3, hasStaffFilter: V2 !== null, hasRequestedGender: jt2 !== null, hasStaffPricedVariants: Ue2, staffSelectionStrategy: _2 }), [Ut2, L2, _2, V2, jt2, Ue2]), Gt2 = (0, import_react.useCallback)((e3) => z2 ?? (R2 ? null : e3), [z2, R2]), Kt2 = (0, import_react.useCallback)((e3) => {
|
|
2847
|
+
let t3 = e3 === null ? null : yt2.find((t4) => t4.id === e3);
|
|
2848
|
+
t3 !== void 0 && (Ct2(false), xt2(t3 && !t3.gender ? t3.id : null), Dt2(t3?.gender ?? null));
|
|
2849
|
+
}, [yt2]), qt2 = (0, import_react.useCallback)((e3) => {
|
|
2850
|
+
(e3 === null || st2.some((t3) => t3.id === e3)) && (nt2(false), et2(e3), wt2 !== null && e3 !== null && !pt2(wt2, e3) && (xt2(null), Ct2(false)));
|
|
2851
|
+
}, [st2, wt2, pt2]), Jt2 = !!(r2 && !Ee2.isLoading && Ee2.displayTimeZonePolicy.customerCanChange && g2 && Ie2 && g2 !== Ie2), H2 = r2 ? Jt2 && t2 && (t2 === g2 || t2 === Ie2) ? t2 : Te2 ?? g2 ?? Ie2 : null, Yt2 = (0, import_react.useCallback)((e3) => {
|
|
2852
|
+
Jt2 && (e3 === g2 || e3 === Ie2) && n2(e3);
|
|
2853
|
+
}, [Jt2, g2, Ie2, n2]), Xt2 = (0, import_react.useMemo)(() => r2 && !N2 && Se2 ? Date.now() : void 0, [r2, N2, F2, xe2, H2]), Zt2 = Xt2 !== void 0 && H2 ? Po(new Date(Xt2), H2) : null, { range: Qt2, daysAvailability: $t2, isLoading: en2, hasError: tn2, setRange: nn2 } = dl({ enabled: r2, serviceId: F2, serviceType: C2, multiServiceRequest: xe2, timeZone: H2, today: Zt2, locationId: B2, staffId: V2, customerChoices: Ht2, minRemainingCapacity: Ft2, loadInitially: u2, onlyAvailableSlots: e2 }), rn2 = fe2?.slice(0, 10) ?? null, an2 = (0, import_react.useMemo)(() => rn2 ? $t2.map((e3) => e3.date > rn2 ? { ...e3, availability: `none` } : e3) : $t2, [$t2, rn2]), on2 = fe2 && H2 ? Lo(new Date(fe2), H2) : null, { query: U2, selectedDate: sn2, timeSlots: cn2, isLoading: ln2, error: un2, selectDate: dn2, findNextAvailableDate: fn2 } = fl({ enabled: r2, serviceId: F2, serviceType: C2, multiServiceRequest: xe2, timeZone: H2, today: Zt2, locationId: B2, staffId: V2, customerChoices: Ht2, minRemainingCapacity: Ft2, onlyAvailableSlots: e2, serviceLoading: N2 || le2 }), pn2 = (0, import_react.useRef)(true), mn2 = (0, import_react.useRef)(null);
|
|
2811
2854
|
(0, import_react.useEffect)(() => {
|
|
2812
|
-
if (
|
|
2813
|
-
|
|
2855
|
+
if (pn2.current) {
|
|
2856
|
+
pn2.current = false;
|
|
2814
2857
|
return;
|
|
2815
2858
|
}
|
|
2816
|
-
|
|
2817
|
-
}, [U2,
|
|
2818
|
-
let
|
|
2819
|
-
let e3 = await
|
|
2820
|
-
return e3.outcome === `found` ?
|
|
2821
|
-
}, [
|
|
2822
|
-
|
|
2823
|
-
let e3 =
|
|
2824
|
-
return
|
|
2825
|
-
}, []),
|
|
2826
|
-
|
|
2827
|
-
}, [
|
|
2828
|
-
let t3 =
|
|
2829
|
-
|
|
2830
|
-
|
|
2859
|
+
Ae2(null), Re2.current && ru(F2, T2, D2), Re2.current = null, mn2.current = null;
|
|
2860
|
+
}, [U2, xe2, H2, B2, V2, Ht2, Ft2, e2, a2, f2, O2]);
|
|
2861
|
+
let hn2 = (0, import_react.useCallback)(async () => {
|
|
2862
|
+
let e3 = await fn2();
|
|
2863
|
+
return e3.outcome === `found` ? rn2 && e3.date > rn2 ? `none` : (await Promise.all([dn2(e3.date), Qt2 && Ko(e3.date, Qt2) ? Promise.resolve() : nn2(Go(e3.date))]), `found`) : e3.outcome;
|
|
2864
|
+
}, [fn2, rn2, dn2, Qt2, nn2]), gn2 = !!(r2 && !N2 && Se2 && H2 && Zt2), _n2 = r2 && !N2 && !le2 && !Se2, [vn2, yn2] = (0, import_react.useState)(false), [W2, bn2] = (0, import_react.useState)(0), xn2 = (0, import_react.useRef)(false), Sn2 = (0, import_react.useRef)([]), Cn2 = (0, import_react.useRef)(0), wn2 = (0, import_react.useCallback)(() => {
|
|
2865
|
+
yn2(false);
|
|
2866
|
+
let e3 = Sn2.current;
|
|
2867
|
+
return Sn2.current = [], e3;
|
|
2868
|
+
}, []), Tn2 = (0, import_react.useCallback)(() => {
|
|
2869
|
+
Cn2.current += 1, wn2().forEach((e3) => e3(`cancelled`));
|
|
2870
|
+
}, [wn2]), En2 = (0, import_react.useCallback)((e3) => (Tn2(), dn2(e3)), [Tn2, dn2]), Dn2 = (0, import_react.useCallback)((e3) => {
|
|
2871
|
+
let t3 = Cn2.current;
|
|
2872
|
+
xn2.current = true, hn2().then((n3) => {
|
|
2873
|
+
xn2.current = false, n3 === `cancelled` && t3 === Cn2.current ? (Sn2.current.unshift(...e3), yn2(true)) : e3.forEach((e4) => e4(n3)), bn2((e4) => e4 + 1);
|
|
2831
2874
|
});
|
|
2832
|
-
}, [
|
|
2833
|
-
if (
|
|
2834
|
-
|
|
2875
|
+
}, [hn2]), On2 = (0, import_react.useCallback)(() => _n2 ? Promise.resolve(`none`) : new Promise((e3) => {
|
|
2876
|
+
if (gn2 && !xn2.current) {
|
|
2877
|
+
Dn2([...wn2(), e3]);
|
|
2835
2878
|
return;
|
|
2836
2879
|
}
|
|
2837
|
-
|
|
2838
|
-
}), [
|
|
2880
|
+
Sn2.current.push(e3), yn2(true);
|
|
2881
|
+
}), [_n2, gn2, Dn2, wn2]);
|
|
2839
2882
|
(0, import_react.useEffect)(() => {
|
|
2840
|
-
if (
|
|
2841
|
-
if (
|
|
2842
|
-
|
|
2883
|
+
if (vn2 && !xn2.current) {
|
|
2884
|
+
if (_n2) {
|
|
2885
|
+
wn2().forEach((e3) => e3(`none`));
|
|
2843
2886
|
return;
|
|
2844
2887
|
}
|
|
2845
|
-
|
|
2888
|
+
gn2 && Dn2(wn2());
|
|
2846
2889
|
}
|
|
2847
|
-
}, [
|
|
2848
|
-
let
|
|
2849
|
-
|
|
2850
|
-
if (!
|
|
2851
|
-
let e3 =
|
|
2852
|
-
|
|
2853
|
-
}, [
|
|
2854
|
-
let
|
|
2890
|
+
}, [vn2, W2, gn2, _n2, Dn2, wn2]);
|
|
2891
|
+
let kn2 = x2?.schedule?.lastSessionEnd, An2 = L2 || $a(C2) || eo(C2) && !Sl(kn2, Xt2), jn2 = !!(je2 && r2 && !N2 && F2 && H2 && Xt2 !== void 0), Mn2 = jn2 && F2 && H2 && Xt2 !== void 0 ? wl({ serviceId: F2, serviceType: C2, lastSessionEnd: kn2, timeZone: H2, now: Xt2, onlyAvailableSlots: e2, locationId: B2, staffId: V2, timeSlotLimitPerDay: f2, customerChoices: Ht2, minRemainingCapacity: Ft2 }) : void 0, G2 = ql(a2, Mn2), Nn2 = je2 && F2 && An2 && !(je2 && F2 && An2 && (!r2 || N2)) && !H2, Pn2 = ye2 ? `onlineBookingOff` : ue2 ?? (G2.error === null ? Nn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), Fn2 = U2 !== null, In2 = (0, import_react.useMemo)(() => jl({ sessions: G2.sessions, dayQuery: Fn2, daySlots: cn2, staffFilter: V2, appointmentLike: L2, limitPerDay: f2, expandedDates: G2.expandedDates }), [G2.sessions, Fn2, cn2, V2, L2, f2, G2.expandedDates]), { slotIdOf: Ln2 } = In2, Rn2 = je2 && (Mn2 ? G2.firstPageSettled : jn2 || r2 && !N2 && !F2 || Nn2);
|
|
2892
|
+
Pe2.current = Rn2, (0, import_react.useEffect)(() => {
|
|
2893
|
+
if (!Rn2) return;
|
|
2894
|
+
let e3 = Ne2.current;
|
|
2895
|
+
Ne2.current = [], e3.forEach((e4) => e4());
|
|
2896
|
+
}, [Rn2]);
|
|
2897
|
+
let zn2 = je2 && !Rn2 || G2.isLoadingPage, Bn2 = Pn2 !== null, Vn2 = U2 ? ln2 : zn2 || ln2 || !r2 || Se2 && !H2 || vn2 || le2, Hn2 = U2 ? un2 : un2 ?? Pn2, Un2 = U2 ? un2 !== null : Bn2 || un2 !== null, Wn2 = Bc(Fc.TIME_SLOTS), Gn2 = (0, import_react.useRef)(false), Kn2 = (0, import_react.useCallback)((e3, t3) => {
|
|
2855
2898
|
if (!t3.bookable) {
|
|
2856
|
-
|
|
2899
|
+
mn2.current = null;
|
|
2857
2900
|
return;
|
|
2858
2901
|
}
|
|
2859
|
-
if (e3 ===
|
|
2860
|
-
|
|
2861
|
-
let n3 =
|
|
2862
|
-
!
|
|
2863
|
-
}, [
|
|
2902
|
+
if (e3 === mn2.current) return;
|
|
2903
|
+
mn2.current = e3;
|
|
2904
|
+
let n3 = F2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r3 = C2 ?? ae2.find((e4) => e4._id === n3)?.type ?? void 0;
|
|
2905
|
+
!Gn2.current && !P2 && Wn2(Nc({ bookingsServiceId: n3, serviceType: r3, isEligibleForFlowCompletion: true })), Gn2.current = true, Wn2(Uc({ component: Rc.TIME_PICKER, element: zc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
|
|
2906
|
+
}, [Wn2, F2, C2, ae2, P2]), K2 = (0, import_react.useCallback)((e3) => {
|
|
2864
2907
|
if (e3 === null) {
|
|
2865
|
-
let e4 =
|
|
2866
|
-
|
|
2908
|
+
let e4 = Re2.current !== null;
|
|
2909
|
+
Re2.current = null, mn2.current = null, Ae2(null), e4 && ru(F2, T2, D2);
|
|
2867
2910
|
return;
|
|
2868
2911
|
}
|
|
2869
|
-
let t3 =
|
|
2912
|
+
let t3 = Ml(In2, e3);
|
|
2870
2913
|
if (!t3) return;
|
|
2871
|
-
if (
|
|
2872
|
-
if (!
|
|
2873
|
-
|
|
2914
|
+
if (I2) {
|
|
2915
|
+
if (!E2(t3.nestedTimeSlots ?? [], H2 ?? void 0)) return;
|
|
2916
|
+
Re2.current = t3, Ae2(t3), Kn2(e3, t3);
|
|
2874
2917
|
return;
|
|
2875
2918
|
}
|
|
2876
|
-
|
|
2877
|
-
let n3 =
|
|
2878
|
-
if (w2(
|
|
2879
|
-
let
|
|
2880
|
-
|
|
2881
|
-
}, [
|
|
2882
|
-
let e3 =
|
|
2883
|
-
if (!e3 ||
|
|
2884
|
-
if (
|
|
2885
|
-
|
|
2919
|
+
Re2.current = t3, Ae2(t3), Kn2(e3, t3);
|
|
2920
|
+
let n3 = Il(t3);
|
|
2921
|
+
if (w2(Cs(t3), { staffId: L2 ? void 0 : Fl(t3), timezone: H2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: L2 && We2 && !R2 && n3.length > 1 && !Wt2(n3.length), rescheduleStaffId: L2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Wt2(n3.length)) ? n3[0] : void 0 }), !L2) return;
|
|
2922
|
+
let r3 = Be2.current, i2;
|
|
2923
|
+
i2 = z2 || (V2 && n3.includes(V2) ? { anyResource: false, staffMemberId: V2 } : jt2 !== null && Wt2(n3.length) ? { anyResource: true } : El(n3, We2 && Wt2(n3.length))), Yl(i2, jt2) !== Yl(r3, He2) && Mt2(i2);
|
|
2924
|
+
}, [I2, F2, T2, D2, E2, w2, In2, Kn2, H2, L2, We2, _2, Wt2, z2, V2, jt2, He2, Mt2]), qn2 = (0, import_react.useCallback)(() => {
|
|
2925
|
+
let e3 = Re2.current;
|
|
2926
|
+
if (!e3 || P2 || !e3.bookable) return;
|
|
2927
|
+
if (I2) {
|
|
2928
|
+
ee2(Wn2);
|
|
2886
2929
|
return;
|
|
2887
2930
|
}
|
|
2888
|
-
if (!
|
|
2931
|
+
if (!F2) return;
|
|
2889
2932
|
let t3;
|
|
2890
|
-
if (
|
|
2891
|
-
let n4 =
|
|
2892
|
-
t3 = (
|
|
2933
|
+
if (L2) {
|
|
2934
|
+
let n4 = Il(e3), r3 = Dl(n4, Gt2(Be2.current), Wt2(n4.length));
|
|
2935
|
+
t3 = (r3.isComplete ? r3.resourceId : n4[0]) ?? (n4.length ? null : void 0);
|
|
2893
2936
|
}
|
|
2894
|
-
let n3 =
|
|
2895
|
-
|
|
2896
|
-
}, [
|
|
2897
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2937
|
+
let n3 = Oe2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: F2 });
|
|
2938
|
+
Wn2(Kc({ serviceId: F2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: H2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && De2(ne2(n3, { handoff: true, staffId: t3 }));
|
|
2939
|
+
}, [Wn2, I2, ee2, H2, F2, C2, x2, L2, Gt2, Wt2, De2, Oe2, ne2, P2]), Jn2 = ke2 ? Il(ke2) : null, Yn2 = Jn2 ? I2 || !L2 || Dl(Jn2, Gt2(ze2), Wt2(Jn2.length)).isComplete : false, Xn2 = Jn2 ? Wt2(Jn2.length) : false, Zn2 = (0, import_react.useMemo)(() => !ke2 || Qe2 ? [] : Pl(ke2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === Ve2 })), [ke2, Qe2, Ve2]), Qn2 = (0, import_react.useMemo)(() => ({ isMultiService: I2, isSelectionPending: ge2, availabilityRequestKey: Ce2, needsServiceChoice: we2, isRescheduling: P2, rescheduleValidUntil: on2, businessTimeZone: g2, canChangeTimeZone: Jt2, setTimeZone: Yt2, locationFilterOptions: dt2, selectedLocationFilter: B2, setLocationFilter: qt2, staffFilterOptions: yt2, selectedStaffFilter: V2, setStaffFilter: Kt2, requestedGender: jt2, genderSelectionAllowed: Ke2, currentTimeSlotsPage: U2 ? 1 : G2.currentPage, hasNextTimeSlotsPage: !U2 && G2.hasNextPage, hasPreviousTimeSlotsPage: !U2 && G2.hasPreviousPage, nextTimeSlotsPage: U2 ? eu : G2.nextPage, loadUpcomingTimeSlots: Fe2, upcomingTimeSlotsRequested: je2, previousTimeSlotsPage: U2 ? $l : G2.previousPage, timeSlots: In2.rows.map((e3) => Nl(e3, H2, Ln2, R2)), isLoading: Vn2, hasError: Un2, errorCode: Hn2, selectedDate: sn2, daysAvailabilityRange: Qt2, daysAvailability: an2, daysAvailabilityLoading: en2, daysAvailabilityHasError: tn2, selectDate: En2, setDaysAvailabilityRange: nn2, goToNextAvailableDate: On2, nextAvailableSlotsCount: a2, timeZone: H2, staffFromSlots: Zn2, selectedResourceId: Ve2, setSelectedResource: Nt2, canAutoAssignStaff: Xn2, isComplete: Yn2, selectedTimeSlot: ke2 ? Nl(ke2, H2, Ln2, R2) : null, selectTimeSlot: K2, navigateToBookingForm: qn2, timeSlotLimitPerDay: f2, daysWithMore: In2.daysWithMore, loadingDate: G2.loadingDate, loadAllTimeSlotsForDay: G2.loadAllSessionsForDay }), [I2, ge2, Ce2, we2, P2, on2, g2, H2, Jt2, Yt2, G2, Fe2, je2, dt2, B2, qt2, yt2, V2, Kt2, jt2, Ke2, U2, Vn2, Hn2, Un2, In2, sn2, Qt2, an2, en2, tn2, En2, nn2, On2, a2, Zn2, Ve2, Nt2, Xn2, Yn2, ke2, K2, qn2, f2, Ln2, R2]);
|
|
2940
|
+
return (0, import_jsx_runtime.jsx)(tu.Provider, { value: Qn2, children: b2 });
|
|
2898
2941
|
}
|
|
2899
|
-
var
|
|
2942
|
+
var uu = un(`4936242d-905c-48bf-80ce-5f56d075de4f`);
|
|
2900
2943
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2901
2944
|
0 && (module.exports = {
|
|
2902
2945
|
TimeSlotsContextProvider,
|