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