@wix/bookings 1.0.1772 → 1.0.1773
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/_sdk-exports/context-categories/runtime.js +2 -2
- package/_sdk-exports/context-locations/runtime.js +2 -2
- package/_sdk-exports/context-service/runtime.js +3 -3
- package/_sdk-exports/context-service-addons/runtime.js +2 -2
- package/_sdk-exports/context-services/runtime.js +3 -3
- package/build/cjs/context-categories.js +1774 -632
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.js +1812 -670
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.js +1858 -716
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.js +4413 -3286
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.js +2410 -1268
- package/build/cjs/context-services.js.map +1 -1
- package/build/es/context-categories.mjs +1774 -632
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.mjs +1812 -670
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.mjs +1858 -716
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.mjs +4413 -3286
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.mjs +2411 -1269
- package/build/es/context-services.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -20,12 +20,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-services.ts
|
|
21
21
|
var context_services_exports = {};
|
|
22
22
|
__export(context_services_exports, {
|
|
23
|
-
SERVICES_CONTEXT_MISSING_PROVIDER_ERROR: () =>
|
|
24
|
-
ServicesContextProvider: () =>
|
|
25
|
-
default: () =>
|
|
26
|
-
injectAccessTokenGetter: () =>
|
|
27
|
-
servicesContext: () =>
|
|
28
|
-
useServicesContext: () =>
|
|
23
|
+
SERVICES_CONTEXT_MISSING_PROVIDER_ERROR: () => zc,
|
|
24
|
+
ServicesContextProvider: () => Gc,
|
|
25
|
+
default: () => Gc,
|
|
26
|
+
injectAccessTokenGetter: () => Kc,
|
|
27
|
+
servicesContext: () => Rc,
|
|
28
|
+
useServicesContext: () => Bc
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(context_services_exports);
|
|
31
31
|
|
|
@@ -33,12 +33,12 @@ module.exports = __toCommonJS(context_services_exports);
|
|
|
33
33
|
var import_react = require("react");
|
|
34
34
|
var import_services_manager_react = require("@wix/services-manager-react");
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
return () => ({ __type: `event-definition`, type:
|
|
36
|
+
var g = {};
|
|
37
|
+
function _(e5, t2 = false, n2 = (e6) => e6) {
|
|
38
|
+
return () => ({ __type: `event-definition`, type: e5, isDomainEvent: t2, transformations: n2 });
|
|
39
39
|
}
|
|
40
|
-
var
|
|
41
|
-
switch (
|
|
40
|
+
var v = (e5) => {
|
|
41
|
+
switch (e5) {
|
|
42
42
|
case `get`:
|
|
43
43
|
case `GET`:
|
|
44
44
|
return `GET`;
|
|
@@ -61,73 +61,73 @@ var _ = (e2) => {
|
|
|
61
61
|
case `OPTIONS`:
|
|
62
62
|
return `OPTIONS`;
|
|
63
63
|
default:
|
|
64
|
-
throw Error(`Unknown method: ${
|
|
64
|
+
throw Error(`Unknown method: ${e5}`);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
var
|
|
67
|
+
var y = (e5) => (t2) => async (n2) => {
|
|
68
68
|
let r2, i2 = (t3) => {
|
|
69
|
-
if (r2 =
|
|
69
|
+
if (r2 = e5(n2)(t3), r2.url === void 0) throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);
|
|
70
70
|
let { method: i3, url: a2, params: o2 } = r2;
|
|
71
|
-
return { ...r2, method:
|
|
71
|
+
return { ...r2, method: v(i3), url: a2, data: r2.data, params: o2 };
|
|
72
72
|
};
|
|
73
73
|
try {
|
|
74
|
-
let
|
|
74
|
+
let e6 = await t2.request(i2);
|
|
75
75
|
if (r2 === void 0) throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);
|
|
76
|
-
let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 =
|
|
76
|
+
let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 = e6.data;
|
|
77
77
|
return n3.forEach((t3) => {
|
|
78
|
-
t3 && (a2 = t3(
|
|
78
|
+
t3 && (a2 = t3(e6.data, e6.headers));
|
|
79
79
|
}), a2;
|
|
80
|
-
} catch (
|
|
81
|
-
throw typeof
|
|
80
|
+
} catch (e6) {
|
|
81
|
+
throw typeof e6 == `object` && e6 && `response` in e6 && typeof e6.response == `object` && e6.response !== null && `data` in e6.response ? e6.response.data : e6;
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
84
|
+
var b = (e5) => e5.__isAmbassador ? true : !!e5().__isAmbassador;
|
|
85
|
+
var x = `__metadata`;
|
|
86
|
+
var S = `edge.wixapis.com`;
|
|
87
|
+
var ee = class extends Error {
|
|
88
88
|
message;
|
|
89
89
|
response;
|
|
90
|
-
constructor(
|
|
91
|
-
super(
|
|
90
|
+
constructor(e5, t2) {
|
|
91
|
+
super(e5), this.message = e5, this.response = t2;
|
|
92
92
|
}
|
|
93
93
|
async details() {
|
|
94
|
-
let
|
|
95
|
-
return
|
|
94
|
+
let e5 = await this.response.json();
|
|
95
|
+
return C(this.response.status, e5?.message, e5?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e5 });
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
function
|
|
103
|
-
return
|
|
104
|
-
}
|
|
105
|
-
var
|
|
106
|
-
function
|
|
107
|
-
return { [
|
|
108
|
-
}
|
|
109
|
-
function
|
|
110
|
-
return Object.entries(
|
|
111
|
-
}
|
|
112
|
-
function
|
|
113
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
114
|
-
globalThis.__wix_context__ = void 0,
|
|
98
|
+
var C = (e5, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e5, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
99
|
+
var w = (e5) => e5?.method && [`post`, `put`, `patch`].includes(e5.method.toLocaleLowerCase()) && e5.body ? { "Content-Type": `application/json` } : {};
|
|
100
|
+
var T = (e5) => e5 && typeof e5 == `object` && !Array.isArray(e5);
|
|
101
|
+
var E = (e5) => e5.__type === `host`;
|
|
102
|
+
function D(e5, t2) {
|
|
103
|
+
return e5.create(t2);
|
|
104
|
+
}
|
|
105
|
+
var O = `x-wix-bi-gateway`;
|
|
106
|
+
function te(e5, t2, n2) {
|
|
107
|
+
return { [O]: ne({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e5.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e5.methodFqn, entity: e5.entityFqdn }) };
|
|
108
|
+
}
|
|
109
|
+
function ne(e5) {
|
|
110
|
+
return Object.entries(e5).filter(([e6, t2]) => !!t2).map(([e6, t2]) => `${e6}=${t2}`).join(`,`);
|
|
111
|
+
}
|
|
112
|
+
function re(e5) {
|
|
113
|
+
let t2 = globalThis.__wix_context__, n2 = { client: g.client, elevatedClient: g.elevatedClient }, r2;
|
|
114
|
+
globalThis.__wix_context__ = void 0, g.client = void 0, g.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
115
115
|
try {
|
|
116
|
-
return
|
|
116
|
+
return e5();
|
|
117
117
|
} finally {
|
|
118
|
-
globalThis.__wix_context__ = t2,
|
|
118
|
+
globalThis.__wix_context__ = t2, g.client = n2.client, g.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
123
|
-
return ue(
|
|
121
|
+
var ie = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
122
|
+
function ae(e5) {
|
|
123
|
+
return ue(e5).map((e6) => e6.toLocaleUpperCase()).join(`_`);
|
|
124
124
|
}
|
|
125
125
|
var oe = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
126
126
|
var se = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
127
127
|
var ce = `$1\0$2`;
|
|
128
128
|
var le = /[^\p{L}\d]+/giu;
|
|
129
|
-
function ue(
|
|
130
|
-
let t2 =
|
|
129
|
+
function ue(e5) {
|
|
130
|
+
let t2 = e5.trim();
|
|
131
131
|
t2 = t2.replace(oe, ce).replace(se, ce), t2 = t2.replace(le, `\0`);
|
|
132
132
|
let n2 = 0, r2 = t2.length;
|
|
133
133
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
@@ -135,110 +135,110 @@ function ue(e2) {
|
|
|
135
135
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
136
136
|
return t2.slice(n2, r2).split(/\0/g);
|
|
137
137
|
}
|
|
138
|
-
var de = (
|
|
139
|
-
var fe = (
|
|
140
|
-
var pe = (
|
|
141
|
-
function me(
|
|
142
|
-
if (typeof
|
|
143
|
-
if (de(
|
|
144
|
-
if (fe(
|
|
145
|
-
if (pe(
|
|
146
|
-
let t3 =
|
|
147
|
-
return ge(
|
|
148
|
-
}
|
|
149
|
-
return ve(
|
|
150
|
-
}
|
|
151
|
-
var he = (
|
|
152
|
-
let r2 =
|
|
153
|
-
return ge(
|
|
154
|
-
};
|
|
155
|
-
var ge = (
|
|
156
|
-
var _e = (
|
|
157
|
-
let t2 =
|
|
158
|
-
return ge(
|
|
159
|
-
};
|
|
160
|
-
var ve = (
|
|
161
|
-
var ye = ({ spreadPathsToArguments:
|
|
162
|
-
let a2 = { ...
|
|
163
|
-
return r2?.filter((
|
|
164
|
-
let r3 = t2[
|
|
165
|
-
if (r3) return { ...
|
|
166
|
-
let s2 = o2?.sort((
|
|
138
|
+
var de = (e5) => `validationError` in (e5.response?.data?.details ?? {});
|
|
139
|
+
var fe = (e5) => `applicationError` in (e5.response?.data?.details ?? {});
|
|
140
|
+
var pe = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
|
|
141
|
+
function me(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
142
|
+
if (typeof e5 != `object` || !e5) throw e5;
|
|
143
|
+
if (de(e5)) return he(e5, t2, n2);
|
|
144
|
+
if (fe(e5)) return _e(e5);
|
|
145
|
+
if (pe(e5)) {
|
|
146
|
+
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: ae(n3), data: {} }, requestId: e5.requestId };
|
|
147
|
+
return ge(e5, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
148
|
+
}
|
|
149
|
+
return ve(e5);
|
|
150
|
+
}
|
|
151
|
+
var he = (e5, t2, n2) => {
|
|
152
|
+
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ye(t2, a2, n2)?.sort((e6, t3) => e6.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e6, description: t3 }) => `"${e6}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
153
|
+
return ge(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e5.response?.status, requestId: i2 } });
|
|
154
|
+
};
|
|
155
|
+
var ge = (e5, { message: t2, extraProperties: n2 }) => Object.assign(e5, { ...n2, message: t2 });
|
|
156
|
+
var _e = (e5) => {
|
|
157
|
+
let t2 = e5.response?.status, n2 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n2, i2 = e5.response?.data?.details?.applicationError?.description ?? n2, a2 = e5.response?.data?.details?.applicationError?.code ?? ae(n2), o2 = e5.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e5.requestId };
|
|
158
|
+
return ge(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e5.requestId } });
|
|
159
|
+
};
|
|
160
|
+
var ve = (e5) => ge(e5, { message: e5.requestId ? `System error occurred, request-id: ${e5.requestId}` : `System error occurred: ${JSON.stringify(e5)}`, extraProperties: { requestId: e5.requestId, status: e5.response?.status, code: ae(e5.response?.statusText ?? `UNKNOWN`), ...!e5.response && { runtimeError: e5 } } });
|
|
161
|
+
var ye = ({ spreadPathsToArguments: e5, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
162
|
+
let a2 = { ...e5, ...t2 }, o2 = Object.keys(a2);
|
|
163
|
+
return r2?.filter((e6) => !r2.some((t3) => t3.field.length > e6.field.length && t3.field.startsWith(e6.field) && o2.includes(t3.field))).map((e6) => {
|
|
164
|
+
let r3 = t2[e6.field];
|
|
165
|
+
if (r3) return { ...e6, field: be(r3, i2) };
|
|
166
|
+
let s2 = o2?.sort((e7, t3) => t3.length - e7.length)?.find((t3) => e6.field.startsWith(t3));
|
|
167
167
|
if (s2) {
|
|
168
168
|
let t3 = a2[s2];
|
|
169
|
-
if (t3) return { ...
|
|
169
|
+
if (t3) return { ...e6, field: e6.field.replace(s2, be(t3, i2)) };
|
|
170
170
|
}
|
|
171
|
-
return n2 ? { ...
|
|
171
|
+
return n2 ? { ...e6, field: `${i2[0]}.${e6.field}` } : e6;
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
|
-
var be = (
|
|
175
|
-
let n2 = xe(
|
|
176
|
-
return n2 == null ?
|
|
174
|
+
var be = (e5, t2) => {
|
|
175
|
+
let n2 = xe(e5);
|
|
176
|
+
return n2 == null ? e5 : e5.replace(`$[${n2}]`, t2[n2]);
|
|
177
177
|
};
|
|
178
|
-
var xe = (
|
|
179
|
-
let t2 =
|
|
178
|
+
var xe = (e5) => {
|
|
179
|
+
let t2 = e5.match(/\$\[(?<argIndex>\d+)\]/);
|
|
180
180
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
181
181
|
};
|
|
182
|
-
function Se(
|
|
183
|
-
return
|
|
184
|
-
let i3 =
|
|
182
|
+
function Se(e5, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
183
|
+
return re(() => e5({ request: async (e6) => {
|
|
184
|
+
let i3 = e6({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
185
185
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
186
|
-
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ?
|
|
186
|
+
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? S : o3}${a3.url}`;
|
|
187
187
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
188
188
|
try {
|
|
189
|
-
let
|
|
189
|
+
let e7 = te(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e7 } }, s3 = await n2(u3, o4);
|
|
190
190
|
if (s3.status !== 200) {
|
|
191
|
-
let
|
|
191
|
+
let e8 = null;
|
|
192
192
|
try {
|
|
193
|
-
|
|
193
|
+
e8 = await s3.json();
|
|
194
194
|
} catch {
|
|
195
195
|
}
|
|
196
|
-
let t3 = we(s3.status,
|
|
196
|
+
let t3 = we(s3.status, e8?.message ?? s3.statusText, e8?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e8 }), n3 = me(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();
|
|
200
200
|
return { data: a3.migrationOptions?.optInTransformResponse && a3.transformResponse ? Array.isArray(a3.transformResponse) ? a3.transformResponse[0](l3) : a3.transformResponse(l3) : l3, headers: s3.headers, status: s3.status, statusText: s3.statusText };
|
|
201
|
-
} catch (
|
|
202
|
-
throw
|
|
201
|
+
} catch (e7) {
|
|
202
|
+
throw e7.message?.includes(`fetch is not defined`) && console.error(`Node.js v18+ is required`), e7;
|
|
203
203
|
}
|
|
204
204
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
205
205
|
}
|
|
206
206
|
var Ce = class extends Error {
|
|
207
207
|
response;
|
|
208
208
|
requestId;
|
|
209
|
-
constructor(
|
|
210
|
-
super(), this.response =
|
|
209
|
+
constructor(e5) {
|
|
210
|
+
super(), this.response = e5.response, this.requestId = e5.requestId;
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
var we = (
|
|
213
|
+
var we = (e5, t2, n2, r2) => new Ce({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e5, data: r2 } }, ...n2 }, message: t2 }, status: e5 }, requestId: r2?.requestId });
|
|
214
214
|
var Te = `.`;
|
|
215
|
-
function Ee(
|
|
216
|
-
if (
|
|
217
|
-
let r2 = De(t2), i2 =
|
|
218
|
-
for (let
|
|
219
|
-
let t3 = r2[
|
|
220
|
-
if (
|
|
215
|
+
function Ee(e5, t2, n2) {
|
|
216
|
+
if (e5 == null) throw Error(`Cannot set value on null or undefined`);
|
|
217
|
+
let r2 = De(t2), i2 = e5;
|
|
218
|
+
for (let e6 = 0; e6 < r2.length; e6++) {
|
|
219
|
+
let t3 = r2[e6];
|
|
220
|
+
if (e6 === r2.length - 1) {
|
|
221
221
|
i2[t3] = n2;
|
|
222
222
|
break;
|
|
223
223
|
}
|
|
224
|
-
let a2 = r2[
|
|
224
|
+
let a2 = r2[e6 + 1];
|
|
225
225
|
(!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
|
|
226
226
|
}
|
|
227
|
-
return
|
|
227
|
+
return e5;
|
|
228
228
|
}
|
|
229
|
-
function De(
|
|
230
|
-
return Array.isArray(
|
|
229
|
+
function De(e5) {
|
|
230
|
+
return Array.isArray(e5) ? e5 : e5.split(Te).map((e6) => Oe(e6) ? Number(e6) : e6);
|
|
231
231
|
}
|
|
232
|
-
function Oe(
|
|
233
|
-
return /^\d+$/.test(
|
|
232
|
+
function Oe(e5) {
|
|
233
|
+
return /^\d+$/.test(e5);
|
|
234
234
|
}
|
|
235
|
-
function ke(
|
|
235
|
+
function ke(e5) {
|
|
236
236
|
let t2 = {};
|
|
237
|
-
for (let [n2, r2] of Object.entries(
|
|
237
|
+
for (let [n2, r2] of Object.entries(e5)) Ae(n2) || Ee(t2, De(n2), r2);
|
|
238
238
|
return t2;
|
|
239
239
|
}
|
|
240
|
-
function Ae(
|
|
241
|
-
return
|
|
240
|
+
function Ae(e5) {
|
|
241
|
+
return e5 === `__proto__` || e5 === `constructor` || e5 === `prototype`;
|
|
242
242
|
}
|
|
243
243
|
var je = class {
|
|
244
244
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
@@ -253,376 +253,376 @@ var je = class {
|
|
|
253
253
|
ESCAPED_LEFT_BRACKET_PLACEHOLDER = `__LB__`;
|
|
254
254
|
modifiedFields;
|
|
255
255
|
cleanedModifiedFields;
|
|
256
|
-
constructor(
|
|
257
|
-
this.modifiedFields =
|
|
256
|
+
constructor(e5) {
|
|
257
|
+
this.modifiedFields = e5;
|
|
258
258
|
}
|
|
259
|
-
replaceEscapedCharacters(
|
|
260
|
-
return
|
|
259
|
+
replaceEscapedCharacters(e5) {
|
|
260
|
+
return e5.replace(this.ESCAPED_DOT_PATTERN, this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN, this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN, this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER);
|
|
261
261
|
}
|
|
262
|
-
restoreEscapedCharacters(
|
|
263
|
-
return
|
|
262
|
+
restoreEscapedCharacters(e5) {
|
|
263
|
+
return e5.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(([
|
|
266
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e5, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e5)), t2])), ke(this.cleanedModifiedFields);
|
|
267
267
|
}
|
|
268
|
-
flatten(
|
|
268
|
+
flatten(e5) {
|
|
269
269
|
let t2 = {};
|
|
270
270
|
for (let n2 of Object.keys(this.cleanedModifiedFields)) {
|
|
271
|
-
let r2 = this.splitPath(n2), i2 = this.navigatePath(
|
|
271
|
+
let r2 = this.splitPath(n2), i2 = this.navigatePath(e5, r2);
|
|
272
272
|
t2 = { ...t2, ...i2 };
|
|
273
273
|
}
|
|
274
|
-
return Object.fromEntries(Object.entries(t2).map(([
|
|
274
|
+
return Object.fromEntries(Object.entries(t2).map(([e6, t3]) => [this.restoreEscapedCharacters(e6), t3]));
|
|
275
275
|
}
|
|
276
|
-
splitPath(
|
|
277
|
-
let t2 = [], n2 = 0, r2 = Array.from(
|
|
278
|
-
for (let i2 of r2) i2.index > n2 && t2.push(
|
|
279
|
-
return n2 <
|
|
276
|
+
splitPath(e5) {
|
|
277
|
+
let t2 = [], n2 = 0, r2 = Array.from(e5.matchAll(this.SPLIT_PATTERN));
|
|
278
|
+
for (let i2 of r2) i2.index > n2 && t2.push(e5.substring(n2, i2.index)), i2[1] && t2.push(i2[1]), n2 = i2.index + i2[0].length;
|
|
279
|
+
return n2 < e5.length && t2.push(e5.substring(n2)), t2;
|
|
280
280
|
}
|
|
281
|
-
navigatePath(
|
|
282
|
-
let n2 =
|
|
281
|
+
navigatePath(e5, t2) {
|
|
282
|
+
let n2 = e5, r2 = [], i2 = (e6) => {
|
|
283
283
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
284
|
-
r2.push(`[${
|
|
285
|
-
}, a2 = (
|
|
286
|
-
let i3 =
|
|
284
|
+
r2.push(`[${e6}]`), n2 = n2[parseInt(e6, 10)];
|
|
285
|
+
}, a2 = (e6, t3) => {
|
|
286
|
+
let i3 = e6 in ie ? ie[e6] : 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 = Fe(
|
|
291
|
+
let a3 = Fe(e6);
|
|
292
292
|
if (a3 && a3 in t3) {
|
|
293
293
|
r2.push(a3), n2 = t3[a3];
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
296
|
-
throw Error(`Cannot find key '${
|
|
297
|
-
}, o2 = (
|
|
298
|
-
r2.push(
|
|
296
|
+
throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
297
|
+
}, o2 = (e6, t3) => {
|
|
298
|
+
r2.push(e6), n2 = t3[e6];
|
|
299
299
|
};
|
|
300
|
-
for (let
|
|
301
|
-
if (this.NUMERIC_PATTERN.test(
|
|
302
|
-
i2(
|
|
300
|
+
for (let e6 of t2) {
|
|
301
|
+
if (this.NUMERIC_PATTERN.test(e6)) {
|
|
302
|
+
i2(e6);
|
|
303
303
|
continue;
|
|
304
304
|
}
|
|
305
|
-
if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${
|
|
305
|
+
if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e6}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
|
|
306
306
|
let t3 = n2;
|
|
307
|
-
if (
|
|
308
|
-
o2(
|
|
307
|
+
if (e6 in n2) {
|
|
308
|
+
o2(e6, t3);
|
|
309
309
|
continue;
|
|
310
310
|
}
|
|
311
|
-
a2(
|
|
311
|
+
a2(e6, t3);
|
|
312
312
|
}
|
|
313
313
|
return { [this.buildPathString(r2)]: n2 };
|
|
314
314
|
}
|
|
315
|
-
buildPathString(
|
|
316
|
-
return
|
|
315
|
+
buildPathString(e5) {
|
|
316
|
+
return e5.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN, `[`);
|
|
317
317
|
}
|
|
318
|
-
bracketToDotNotation(
|
|
319
|
-
return
|
|
318
|
+
bracketToDotNotation(e5) {
|
|
319
|
+
return e5.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e5[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
function Me(
|
|
323
|
-
let n2 =
|
|
322
|
+
function Me(e5, t2) {
|
|
323
|
+
let n2 = e5?.modifiedFields;
|
|
324
324
|
if (!n2) return null;
|
|
325
325
|
let r2 = Ne(n2);
|
|
326
326
|
if (!r2) return null;
|
|
327
327
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
328
|
-
|
|
329
|
-
let o2 = t2(
|
|
328
|
+
e5 = { ...e5, modifiedFields: i2 };
|
|
329
|
+
let o2 = t2(e5), s2 = o2?.modifiedFields;
|
|
330
330
|
if (!s2) return null;
|
|
331
331
|
let c2 = Pe(s2, a2);
|
|
332
332
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
333
333
|
}
|
|
334
|
-
function Ne(
|
|
335
|
-
if (typeof
|
|
336
|
-
let t2 = new je(
|
|
334
|
+
function Ne(e5) {
|
|
335
|
+
if (typeof e5 == `object` && e5 && !Array.isArray(e5)) try {
|
|
336
|
+
let t2 = new je(e5);
|
|
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 Pe(
|
|
344
|
-
if (typeof
|
|
345
|
-
return t2.flatten(
|
|
343
|
+
function Pe(e5, t2) {
|
|
344
|
+
if (typeof e5 == `object` && e5 && !Array.isArray(e5)) try {
|
|
345
|
+
return t2.flatten(e5);
|
|
346
346
|
} catch {
|
|
347
347
|
return null;
|
|
348
348
|
}
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
|
-
function Fe(
|
|
352
|
-
return
|
|
351
|
+
function Fe(e5) {
|
|
352
|
+
return e5.replace(/[-_\s]+(.)?/g, (e6, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e6) => e6.toLowerCase());
|
|
353
353
|
}
|
|
354
354
|
function Ie() {
|
|
355
|
-
return { emit(
|
|
356
|
-
for (let n2 = 0, r2 = this.events[
|
|
357
|
-
}, events: {}, on(
|
|
358
|
-
return (this.events[
|
|
359
|
-
this.events[
|
|
355
|
+
return { emit(e5, ...t2) {
|
|
356
|
+
for (let n2 = 0, r2 = this.events[e5] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
357
|
+
}, events: {}, on(e5, t2) {
|
|
358
|
+
return (this.events[e5] ||= []).push(t2), () => {
|
|
359
|
+
this.events[e5] = this.events[e5]?.filter((e6) => t2 !== e6);
|
|
360
360
|
};
|
|
361
361
|
} };
|
|
362
362
|
}
|
|
363
|
-
var Le = (
|
|
364
|
-
function Re(
|
|
363
|
+
var Le = (e5) => e5.__type === `event-definition`;
|
|
364
|
+
function Re(e5, t2, n2, r2) {
|
|
365
365
|
let i2;
|
|
366
|
-
if (
|
|
367
|
-
let { deletedEvent:
|
|
368
|
-
i2 =
|
|
366
|
+
if (e5.isDomainEvent) {
|
|
367
|
+
let { deletedEvent: e6, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
368
|
+
i2 = e6 ? e6?.deletedEntity ? { entity: e6?.deletedEntity, metadata: c2 } : { metadata: c2 } : t3 ? { data: t3.body, metadata: c2 } : o3 ? { entity: o3.currentEntity, metadata: c2, ...o3.modifiedFields ? { modifiedFields: o3.modifiedFields } : {} } : { entity: a3?.entity, metadata: c2 };
|
|
369
369
|
} else i2 = { data: n2, metadata: r2 };
|
|
370
|
-
let a2 =
|
|
370
|
+
let a2 = e5.transformations ?? ((e6) => e6), o2 = i2, s2 = i2;
|
|
371
371
|
if (s2.modifiedFields) {
|
|
372
|
-
let
|
|
373
|
-
if (typeof
|
|
372
|
+
let e6 = s2.modifiedFields;
|
|
373
|
+
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) {
|
|
374
374
|
o2 = structuredClone(i2);
|
|
375
|
-
let
|
|
376
|
-
if (
|
|
375
|
+
let e7 = Me(s2, a2);
|
|
376
|
+
if (e7) return t2(e7);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
return t2(a2(o2));
|
|
380
380
|
}
|
|
381
|
-
function ze(
|
|
381
|
+
function ze(e5) {
|
|
382
382
|
let t2 = /* @__PURE__ */ new Map(), n2 = Ie();
|
|
383
|
-
return { initModule(
|
|
383
|
+
return { initModule(e6) {
|
|
384
384
|
return (r2) => {
|
|
385
|
-
let i2 = t2.get(
|
|
386
|
-
i2.push({ eventDefinition:
|
|
385
|
+
let i2 = t2.get(e6.type) ?? [];
|
|
386
|
+
i2.push({ eventDefinition: e6, handler: r2 }), t2.set(e6.type, i2), n2.emit(`registered`, e6);
|
|
387
387
|
};
|
|
388
|
-
}, client: { ...n2, getRegisteredEvents: () => t2, async process(
|
|
389
|
-
let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(
|
|
390
|
-
if (c2.length > 0 && !c2.some(({ type:
|
|
388
|
+
}, client: { ...n2, getRegisteredEvents: () => t2, async process(e6, n3 = { expectedEvents: [] }) {
|
|
389
|
+
let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e6), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e7) => ({ type: e7 }))];
|
|
390
|
+
if (c2.length > 0 && !c2.some(({ type: e7 }) => e7 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e7) => e7.type).join(`, `)}`);
|
|
391
391
|
let l2 = t2.get(r2) ?? [];
|
|
392
|
-
return await Promise.all(l2.map(({ eventDefinition:
|
|
393
|
-
}, async processRequest(
|
|
394
|
-
let n3 = await
|
|
392
|
+
return await Promise.all(l2.map(({ eventDefinition: e7, handler: t3 }) => Re(e7, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
393
|
+
}, async processRequest(e6, t3) {
|
|
394
|
+
let n3 = await e6.text();
|
|
395
395
|
return this.process(n3, t3);
|
|
396
396
|
}, async parseJWT(t3) {
|
|
397
|
-
let n3 =
|
|
397
|
+
let n3 = e5();
|
|
398
398
|
if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
|
|
399
399
|
let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3);
|
|
400
400
|
if (!i2) throw Error(`JWT is not valid`);
|
|
401
401
|
if (typeof r2.data != `string`) throw Error(`Unexpected type of JWT data: expected string, got ${typeof r2.data}`);
|
|
402
402
|
let a2 = JSON.parse(r2.data), o2 = a2.eventType, s2 = a2.accountInfo, c2 = a2.instanceId, l2 = a2.identity ? JSON.parse(a2.identity) : void 0;
|
|
403
403
|
return { instanceId: c2, eventType: o2, payload: JSON.parse(a2.data), identity: l2, accountInfo: s2 };
|
|
404
|
-
}, async parseRequest(
|
|
405
|
-
let t3 = await
|
|
404
|
+
}, async parseRequest(e6) {
|
|
405
|
+
let t3 = await e6.text();
|
|
406
406
|
return this.parseJWT(t3);
|
|
407
|
-
}, async executeHandlers(
|
|
408
|
-
let n3 = Array.from(t2.keys()).map((
|
|
409
|
-
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 ===
|
|
410
|
-
let r2 = t2.get(
|
|
411
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Re(t3, n4,
|
|
412
|
-
}, apps: { AppInstalled:
|
|
413
|
-
}
|
|
414
|
-
var Be = (
|
|
415
|
-
function Ve(
|
|
407
|
+
}, async executeHandlers(e6) {
|
|
408
|
+
let n3 = Array.from(t2.keys()).map((e7) => ({ type: e7 }));
|
|
409
|
+
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e6.eventType)) throw Error(`Unexpected event type: ${e6.eventType}. Expected one of: ${n3.map((e7) => e7.type).join(`, `)}`);
|
|
410
|
+
let r2 = t2.get(e6.eventType) ?? [];
|
|
411
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Re(t3, n4, e6.payload, { instanceId: e6.instanceId, identity: e6.identity })));
|
|
412
|
+
}, apps: { AppInstalled: _(`AppInstalled`)(), AppRemoved: _(`AppRemoved`)() } } };
|
|
413
|
+
}
|
|
414
|
+
var Be = (e5) => e5.__type === `service-plugin-definition`;
|
|
415
|
+
function Ve(e5) {
|
|
416
416
|
let t2 = /* @__PURE__ */ new Map(), n2 = Ie();
|
|
417
|
-
return { initModule(
|
|
417
|
+
return { initModule(e6) {
|
|
418
418
|
return (r2) => {
|
|
419
|
-
let i2 = t2.get(
|
|
420
|
-
i2.push({ servicePluginDefinition:
|
|
419
|
+
let i2 = t2.get(e6.componentType.toLowerCase()) ?? [];
|
|
420
|
+
i2.push({ servicePluginDefinition: e6, implementation: r2 }), t2.set(e6.componentType.toLowerCase(), i2), n2.emit(`registered`, e6);
|
|
421
421
|
};
|
|
422
422
|
}, client: { ...n2, getRegisteredServicePlugins: () => t2, async parseJWT(t3) {
|
|
423
|
-
let n3 =
|
|
423
|
+
let n3 = e5();
|
|
424
424
|
if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
|
|
425
425
|
let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3, true);
|
|
426
426
|
if (!i2) throw Error(`JWT is not valid`);
|
|
427
427
|
if (typeof r2.data != `object` || r2.data === null || !(`metadata` in r2.data) || typeof r2.data.metadata != `object` || r2.data.metadata === null || !(`appExtensionType` in r2.data.metadata) || typeof r2.data.metadata.appExtensionType != `string`) throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);
|
|
428
428
|
return r2.data;
|
|
429
|
-
}, async process(
|
|
430
|
-
let t3 = await this.parseJWT(
|
|
431
|
-
return this.executeHandler(t3,
|
|
432
|
-
}, async parseRequest(
|
|
433
|
-
let t3 = await
|
|
429
|
+
}, async process(e6) {
|
|
430
|
+
let t3 = await this.parseJWT(e6.body);
|
|
431
|
+
return this.executeHandler(t3, e6.url);
|
|
432
|
+
}, async parseRequest(e6) {
|
|
433
|
+
let t3 = await e6.text();
|
|
434
434
|
return this.parseJWT(t3);
|
|
435
|
-
}, async processRequest(
|
|
436
|
-
let t3 = await this.parseRequest(
|
|
437
|
-
return this.processParsedRequest(t3,
|
|
438
|
-
}, async processParsedRequest(
|
|
435
|
+
}, async processRequest(e6) {
|
|
436
|
+
let t3 = await this.parseRequest(e6);
|
|
437
|
+
return this.processParsedRequest(t3, e6.url);
|
|
438
|
+
}, async processParsedRequest(e6, t3) {
|
|
439
439
|
try {
|
|
440
|
-
let n3 = await this.executeHandler(
|
|
440
|
+
let n3 = await this.executeHandler(e6, t3);
|
|
441
441
|
return Response.json(n3);
|
|
442
|
-
} catch (
|
|
443
|
-
if (
|
|
444
|
-
throw
|
|
442
|
+
} catch (e7) {
|
|
443
|
+
if (e7.errorType === `SPI` && e7.applicationCode && e7.httpCode) return Response.json({ applicationError: { code: e7.applicationCode, data: e7.data } }, { status: e7.httpCode });
|
|
444
|
+
throw e7;
|
|
445
445
|
}
|
|
446
|
-
}, async executeHandler(
|
|
447
|
-
let r2 =
|
|
446
|
+
}, async executeHandler(e6, n3) {
|
|
447
|
+
let r2 = e6.metadata.appExtensionType.toLowerCase(), i2 = t2.get(r2) ?? [];
|
|
448
448
|
if (i2.length === 0) throw Error(`No service plugin implementations found for component type ${r2}`);
|
|
449
449
|
if (i2.length > 1) throw Error(`Multiple service plugin implementations found for component type ${r2}. This is currently not supported`);
|
|
450
|
-
let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((
|
|
450
|
+
let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((e7) => n3.endsWith(e7.primaryHttpMappingPath));
|
|
451
451
|
if (!s2) throw Error(`Unexpect request: request url did not match any method: ` + n3);
|
|
452
452
|
let c2 = a2[s2.name];
|
|
453
453
|
if (!c2) throw Error(`Got request for service plugin method ${s2.name} but no implementation was provided. Available methods: ${Object.keys(a2).join(`, `)}`);
|
|
454
|
-
return s2.transformations.toREST(await c2(s2.transformations.fromREST(
|
|
454
|
+
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e6)));
|
|
455
455
|
} } };
|
|
456
456
|
}
|
|
457
457
|
var k = `X-Wix-Consistent`;
|
|
458
|
-
function He(
|
|
459
|
-
let t2 =
|
|
460
|
-
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...
|
|
458
|
+
function He(e5) {
|
|
459
|
+
let t2 = e5.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e6) => Promise.resolve({ headers: {} }) }, r2 = e5.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e5.host), o2 = () => e5.fetch ?? fetch, s2 = async (n3, r3) => {
|
|
460
|
+
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [k]: t2[k] } : {} }, l3 = e5.host?.getErrorHandler?.();
|
|
461
461
|
try {
|
|
462
462
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
463
|
-
let
|
|
464
|
-
l3?.handleError(
|
|
465
|
-
let a3 = Ue(
|
|
466
|
-
return a3 && (t2[k] = a3),
|
|
463
|
+
let e6 = await i3(n3, { ...r3, headers: c3 });
|
|
464
|
+
l3?.handleError(e6, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
465
|
+
let a3 = Ue(e6);
|
|
466
|
+
return a3 && (t2[k] = a3), e6;
|
|
467
467
|
}
|
|
468
468
|
{
|
|
469
|
-
for (let [
|
|
470
|
-
let
|
|
471
|
-
l3?.handleError(
|
|
472
|
-
let a3 = Ue(
|
|
473
|
-
return a3 && (t2[k] = a3),
|
|
469
|
+
for (let [e7, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e7, t3);
|
|
470
|
+
let e6 = await i3(n3, r3);
|
|
471
|
+
l3?.handleError(e6, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
472
|
+
let a3 = Ue(e6);
|
|
473
|
+
return a3 && (t2[k] = a3), e6;
|
|
474
474
|
}
|
|
475
|
-
} catch (
|
|
476
|
-
throw l3?.handleError(
|
|
475
|
+
} catch (e6) {
|
|
476
|
+
throw l3?.handleError(e6, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e6;
|
|
477
477
|
}
|
|
478
478
|
}, { client: c2, initModule: l2 } = Ve(i2), { client: u2, initModule: d2 } = ze(i2), f2 = async (n3, r3) => {
|
|
479
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
479
|
+
let i3 = o2(), s3 = await a2(), c3 = w(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [k]: t2[k] } : {} } }), u3 = Ue(l3);
|
|
480
480
|
return u3 && (t2[k] = u3), l3;
|
|
481
481
|
}, p2 = (t3, n3) => {
|
|
482
482
|
if (Le(t3)) return d2(t3);
|
|
483
483
|
if (Be(t3)) return l2(t3);
|
|
484
|
-
if (
|
|
484
|
+
if (E(t3) && e5.host) return D(t3, e5.host);
|
|
485
485
|
if (typeof t3 == `function`) {
|
|
486
486
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
487
|
-
let r3 =
|
|
488
|
-
return Se(
|
|
489
|
-
let n4 = new URL(
|
|
487
|
+
let r3 = e5.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e5.useCDN === void 0 ? i2().shouldUseCDN : e5.useCDN;
|
|
488
|
+
return Se(re(() => b(t3)) ? y(t3) : t3, n3 ?? {}, f2, e5.host?.getErrorHandler?.(), (e6, t4) => {
|
|
489
|
+
let n4 = new URL(e6, `https://${r3}`);
|
|
490
490
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
491
|
-
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 },
|
|
491
|
+
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e5.host?.name, o3, e5.validateRequestSchema);
|
|
492
492
|
}
|
|
493
|
-
return
|
|
494
|
-
}, m2 = (
|
|
495
|
-
for (let n3 in
|
|
493
|
+
return T(t3) ? Object.fromEntries(Object.entries(t3).map(([e6, n4]) => [e6, p2(n4, t3[x])])) : t3;
|
|
494
|
+
}, m2 = (e6) => {
|
|
495
|
+
for (let n3 in e6) t2[n3] = e6[n3];
|
|
496
496
|
};
|
|
497
|
-
return { ...
|
|
497
|
+
return { ...e5.modules ? p2(e5.modules) : {}, get auth() {
|
|
498
498
|
let t3 = i2();
|
|
499
|
-
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0,
|
|
500
|
-
}, setHeaders: m2, use: p2, enableContext(
|
|
501
|
-
|
|
499
|
+
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e5.host), t3;
|
|
500
|
+
}, setHeaders: m2, use: p2, enableContext(e6, t3 = { elevated: false }) {
|
|
501
|
+
e6 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ? g.elevatedClient = this : g.client = this;
|
|
502
502
|
}, fetch: (t3, n3) => {
|
|
503
|
-
let r3 =
|
|
503
|
+
let r3 = e5.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
504
504
|
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
505
505
|
}, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
|
|
506
|
-
let i3 =
|
|
507
|
-
if (a3.status !== 200) throw new
|
|
506
|
+
let i3 = e5?.host?.apiBaseUrl ?? `www.wixapis.com`, a3 = await f2(`https://${i3}/graphql/${r3.apiVersion}`, { method: `POST`, headers: { "Content-Type": `application/json` }, body: JSON.stringify({ query: t3, variables: n3 }) });
|
|
507
|
+
if (a3.status !== 200) throw new ee(`GraphQL request failed with status ${a3.status}`, a3);
|
|
508
508
|
let { data: o3, errors: s3 } = await a3.json();
|
|
509
509
|
return { data: o3 ?? {}, errors: s3 };
|
|
510
510
|
}, webhooks: u2, servicePlugins: c2 };
|
|
511
511
|
}
|
|
512
|
-
function Ue(
|
|
513
|
-
return
|
|
512
|
+
function Ue(e5) {
|
|
513
|
+
return e5.headers?.get(`X-Wix-Consistent`) ?? e5.headers?.get(`x-wix-consistent`);
|
|
514
514
|
}
|
|
515
515
|
var We = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
516
516
|
var Ge = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
517
517
|
var Ke = `items`;
|
|
518
518
|
var qe = `pagingMetadata`;
|
|
519
519
|
var Je = We;
|
|
520
|
-
function Ye(
|
|
521
|
-
return
|
|
520
|
+
function Ye(e5, t2) {
|
|
521
|
+
return e5?.split(`.`).map((e6) => t2?.[e6] ?? e6).join(`.`);
|
|
522
522
|
}
|
|
523
|
-
function Xe(
|
|
524
|
-
return t2 ? Ye(
|
|
523
|
+
function Xe(e5, { transformSystemFields: t2 = true } = {}) {
|
|
524
|
+
return t2 ? Ye(e5, Je) : e5;
|
|
525
525
|
}
|
|
526
526
|
var Ze = `sort.fieldName`;
|
|
527
|
-
function Qe(
|
|
528
|
-
return (
|
|
527
|
+
function Qe(e5, t2, n2) {
|
|
528
|
+
return (e5 === Ze || e5.endsWith(`.${Ze}`)) && typeof t2 == `string` ? Ye(t2, n2) : t2;
|
|
529
529
|
}
|
|
530
|
-
function $e(
|
|
531
|
-
let r2 = (
|
|
532
|
-
if (Array.isArray(
|
|
533
|
-
i2(
|
|
530
|
+
function $e(e5, t2, n2) {
|
|
531
|
+
let r2 = (e6) => n2.includes(e6), i2 = (e6, n3) => {
|
|
532
|
+
if (Array.isArray(e6)) e6.forEach((e7) => {
|
|
533
|
+
i2(e7, n3);
|
|
534
534
|
});
|
|
535
|
-
else if (typeof
|
|
536
|
-
let a2 =
|
|
537
|
-
Object.keys(a2).forEach((
|
|
538
|
-
let o2 = n3 === `` ?
|
|
535
|
+
else if (typeof e6 == `object` && e6) {
|
|
536
|
+
let a2 = e6;
|
|
537
|
+
Object.keys(a2).forEach((e7) => {
|
|
538
|
+
let o2 = n3 === `` ? e7 : `${n3}.${e7}`;
|
|
539
539
|
if (r2(o2)) return;
|
|
540
|
-
let s2 = et(
|
|
541
|
-
s2 !==
|
|
540
|
+
let s2 = et(e7, t2);
|
|
541
|
+
s2 !== e7 && !(s2 in a2) && (a2[s2] = a2[e7], delete a2[e7]), a2[s2] = Qe(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
|
-
return i2(
|
|
545
|
+
return i2(e5, ``), e5;
|
|
546
546
|
}
|
|
547
|
-
function et(
|
|
547
|
+
function et(e5, t2) {
|
|
548
548
|
let n2;
|
|
549
|
-
return n2 =
|
|
549
|
+
return n2 = e5.includes(`.`) ? e5.split(`.`).map((e6) => t2[e6] ?? e6).join(`.`) : t2[e5] ?? e5, n2;
|
|
550
550
|
}
|
|
551
|
-
function A(
|
|
552
|
-
return $e(
|
|
551
|
+
function A(e5, t2 = []) {
|
|
552
|
+
return $e(e5, We, t2);
|
|
553
553
|
}
|
|
554
|
-
function j(
|
|
555
|
-
return $e(
|
|
554
|
+
function j(e5, t2 = []) {
|
|
555
|
+
return $e(e5, Ge, t2);
|
|
556
556
|
}
|
|
557
|
-
function M(
|
|
558
|
-
return
|
|
557
|
+
function M(e5) {
|
|
558
|
+
return e5 ? new Date(e5) : void 0;
|
|
559
559
|
}
|
|
560
560
|
var tt = /* @__PURE__ */ new WeakMap();
|
|
561
561
|
function nt() {
|
|
562
562
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
563
563
|
}
|
|
564
|
-
function rt(
|
|
565
|
-
let n2 =
|
|
566
|
-
return n2 || (n2 = nt(),
|
|
564
|
+
function rt(e5, t2) {
|
|
565
|
+
let n2 = e5.get(t2);
|
|
566
|
+
return n2 || (n2 = nt(), e5.set(t2, n2)), n2;
|
|
567
567
|
}
|
|
568
|
-
function it(
|
|
569
|
-
return t2 === `*` ? (
|
|
568
|
+
function it(e5, t2) {
|
|
569
|
+
return t2 === `*` ? (e5.anyField ??= nt(), e5.anyField) : t2.endsWith(`{}`) ? (e5.mapFields ??= /* @__PURE__ */ new Map(), rt(e5.mapFields, t2.slice(0, -2))) : (e5.fields ??= /* @__PURE__ */ new Map(), rt(e5.fields, t2));
|
|
570
570
|
}
|
|
571
|
-
function at(
|
|
571
|
+
function at(e5) {
|
|
572
572
|
let t2 = nt();
|
|
573
|
-
for (let n2 of
|
|
574
|
-
let
|
|
575
|
-
|
|
573
|
+
for (let n2 of e5) {
|
|
574
|
+
let e6 = n2.path.split(`.`).reduce(it, t2);
|
|
575
|
+
e6.leaves ??= [], e6.leaves.push(n2);
|
|
576
576
|
}
|
|
577
577
|
return t2;
|
|
578
578
|
}
|
|
579
|
-
function ot(
|
|
580
|
-
let t2 = tt.get(
|
|
581
|
-
return t2 || (t2 = at(
|
|
579
|
+
function ot(e5) {
|
|
580
|
+
let t2 = tt.get(e5);
|
|
581
|
+
return t2 || (t2 = at(e5), tt.set(e5, t2)), t2;
|
|
582
582
|
}
|
|
583
|
-
function st(
|
|
584
|
-
return typeof
|
|
583
|
+
function st(e5) {
|
|
584
|
+
return typeof e5 == `object` && !!e5;
|
|
585
585
|
}
|
|
586
|
-
function ct(
|
|
587
|
-
return t2 ? Array.isArray(
|
|
586
|
+
function ct(e5, { isRepeated: t2, isMap: n2 }, r2) {
|
|
587
|
+
return t2 ? Array.isArray(e5) ? e5.map(r2) : e5 : n2 ? st(e5) ? Object.fromEntries(Object.entries(e5).map(([e6, t3]) => [e6, r2(t3)])) : e5 : r2(e5);
|
|
588
588
|
}
|
|
589
|
-
function lt(
|
|
590
|
-
st(
|
|
589
|
+
function lt(e5, t2, n2) {
|
|
590
|
+
st(e5) && ft(e5, t2, n2);
|
|
591
591
|
}
|
|
592
|
-
function ut(
|
|
592
|
+
function ut(e5, t2, n2) {
|
|
593
593
|
for (let [r2, i2] of t2) {
|
|
594
|
-
if (!(r2 in
|
|
595
|
-
if (i2.leaves) for (let t4 of i2.leaves)
|
|
596
|
-
let t3 =
|
|
597
|
-
Array.isArray(t3) ? t3.forEach((
|
|
594
|
+
if (!(r2 in e5)) continue;
|
|
595
|
+
if (i2.leaves) for (let t4 of i2.leaves) e5[r2] = ct(e5[r2], t4, n2);
|
|
596
|
+
let t3 = e5[r2];
|
|
597
|
+
Array.isArray(t3) ? t3.forEach((e6) => lt(e6, i2, n2)) : lt(t3, i2, n2);
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
function dt(
|
|
600
|
+
function dt(e5, t2, n2) {
|
|
601
601
|
for (let [r2, i2] of t2) {
|
|
602
|
-
let t3 =
|
|
603
|
-
st(t3) && Object.values(t3).forEach((
|
|
602
|
+
let t3 = e5[r2];
|
|
603
|
+
st(t3) && Object.values(t3).forEach((e6) => lt(e6, i2, n2));
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
function ft(
|
|
607
|
-
t2 && ut(
|
|
606
|
+
function ft(e5, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
607
|
+
t2 && ut(e5, t2, i2), n2 && dt(e5, n2, i2), r2 && Object.values(e5).forEach((e6) => lt(e6, r2, i2));
|
|
608
608
|
}
|
|
609
|
-
function N(
|
|
610
|
-
if (!st(
|
|
611
|
-
for (let { paths: n2, transformFn: r2 } of t2) ft(
|
|
612
|
-
return
|
|
609
|
+
function N(e5, t2) {
|
|
610
|
+
if (!st(e5)) return e5;
|
|
611
|
+
for (let { paths: n2, transformFn: r2 } of t2) ft(e5, ot(n2), r2);
|
|
612
|
+
return e5;
|
|
613
613
|
}
|
|
614
|
-
function pt(
|
|
615
|
-
return Object.fromEntries(Object.entries(
|
|
614
|
+
function pt(e5) {
|
|
615
|
+
return Object.fromEntries(Object.entries(e5).filter(([, e6]) => e6 !== void 0));
|
|
616
616
|
}
|
|
617
|
-
function mt(
|
|
618
|
-
return yt(
|
|
617
|
+
function mt(e5) {
|
|
618
|
+
return yt(e5).map((e6) => e6.toLocaleUpperCase()).join(`_`);
|
|
619
619
|
}
|
|
620
620
|
var ht = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
621
621
|
var gt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
622
622
|
var _t = `$1\0$2`;
|
|
623
623
|
var vt = /[^\p{L}\d]+/giu;
|
|
624
|
-
function yt(
|
|
625
|
-
let t2 =
|
|
624
|
+
function yt(e5) {
|
|
625
|
+
let t2 = e5.trim();
|
|
626
626
|
t2 = t2.replace(ht, _t).replace(gt, _t), t2 = t2.replace(vt, `\0`);
|
|
627
627
|
let n2 = 0, r2 = t2.length;
|
|
628
628
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
@@ -630,336 +630,1389 @@ function yt(e2) {
|
|
|
630
630
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
631
631
|
return t2.slice(n2, r2).split(/\0/g);
|
|
632
632
|
}
|
|
633
|
-
var bt = (
|
|
634
|
-
var xt = (
|
|
635
|
-
var St = (
|
|
636
|
-
function P(
|
|
637
|
-
if (typeof
|
|
638
|
-
if (bt(
|
|
639
|
-
if (xt(
|
|
640
|
-
if (St(
|
|
641
|
-
let t3 =
|
|
642
|
-
return wt(
|
|
643
|
-
}
|
|
644
|
-
return Et(
|
|
645
|
-
}
|
|
646
|
-
var Ct = (
|
|
647
|
-
let r2 =
|
|
648
|
-
return wt(
|
|
649
|
-
};
|
|
650
|
-
var wt = (
|
|
651
|
-
var Tt = (
|
|
652
|
-
let t2 =
|
|
653
|
-
return wt(
|
|
654
|
-
};
|
|
655
|
-
var Et = (
|
|
656
|
-
var Dt = ({ spreadPathsToArguments:
|
|
657
|
-
let a2 = { ...
|
|
658
|
-
return r2?.filter((
|
|
659
|
-
let r3 = t2[
|
|
660
|
-
if (r3) return { ...
|
|
661
|
-
let s2 = o2?.sort((
|
|
633
|
+
var bt = (e5) => `validationError` in (e5.response?.data?.details ?? {});
|
|
634
|
+
var xt = (e5) => `applicationError` in (e5.response?.data?.details ?? {});
|
|
635
|
+
var St = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
|
|
636
|
+
function P(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
637
|
+
if (typeof e5 != `object` || !e5) throw e5;
|
|
638
|
+
if (bt(e5)) return Ct(e5, t2, n2);
|
|
639
|
+
if (xt(e5)) return Tt(e5);
|
|
640
|
+
if (St(e5)) {
|
|
641
|
+
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: mt(n3), data: {} }, requestId: e5.requestId };
|
|
642
|
+
return wt(e5, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
643
|
+
}
|
|
644
|
+
return Et(e5);
|
|
645
|
+
}
|
|
646
|
+
var Ct = (e5, t2, n2) => {
|
|
647
|
+
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Dt(t2, a2, n2)?.sort((e6, t3) => e6.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e6, description: t3 }) => `"${e6}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
648
|
+
return wt(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e5.response?.status, requestId: i2 } });
|
|
649
|
+
};
|
|
650
|
+
var wt = (e5, { message: t2, extraProperties: n2 }) => Object.assign(e5, { ...n2, message: t2 });
|
|
651
|
+
var Tt = (e5) => {
|
|
652
|
+
let t2 = e5.response?.status, n2 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n2, i2 = e5.response?.data?.details?.applicationError?.description ?? n2, a2 = e5.response?.data?.details?.applicationError?.code ?? mt(n2), o2 = e5.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e5.requestId };
|
|
653
|
+
return wt(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e5.requestId } });
|
|
654
|
+
};
|
|
655
|
+
var Et = (e5) => wt(e5, { message: e5.requestId ? `System error occurred, request-id: ${e5.requestId}` : `System error occurred: ${JSON.stringify(e5)}`, extraProperties: { requestId: e5.requestId, status: e5.response?.status, code: mt(e5.response?.statusText ?? `UNKNOWN`), ...!e5.response && { runtimeError: e5 } } });
|
|
656
|
+
var Dt = ({ spreadPathsToArguments: e5, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
657
|
+
let a2 = { ...e5, ...t2 }, o2 = Object.keys(a2);
|
|
658
|
+
return r2?.filter((e6) => !r2.some((t3) => t3.field.length > e6.field.length && t3.field.startsWith(e6.field) && o2.includes(t3.field))).map((e6) => {
|
|
659
|
+
let r3 = t2[e6.field];
|
|
660
|
+
if (r3) return { ...e6, field: Ot(r3, i2) };
|
|
661
|
+
let s2 = o2?.sort((e7, t3) => t3.length - e7.length)?.find((t3) => e6.field.startsWith(t3));
|
|
662
662
|
if (s2) {
|
|
663
663
|
let t3 = a2[s2];
|
|
664
|
-
if (t3) return { ...
|
|
664
|
+
if (t3) return { ...e6, field: e6.field.replace(s2, Ot(t3, i2)) };
|
|
665
665
|
}
|
|
666
|
-
return n2 ? { ...
|
|
666
|
+
return n2 ? { ...e6, field: `${i2[0]}.${e6.field}` } : e6;
|
|
667
667
|
});
|
|
668
668
|
};
|
|
669
|
-
var Ot = (
|
|
670
|
-
let n2 = kt(
|
|
671
|
-
return n2 == null ?
|
|
669
|
+
var Ot = (e5, t2) => {
|
|
670
|
+
let n2 = kt(e5);
|
|
671
|
+
return n2 == null ? e5 : e5.replace(`$[${n2}]`, t2[n2]);
|
|
672
672
|
};
|
|
673
|
-
var kt = (
|
|
674
|
-
let t2 =
|
|
673
|
+
var kt = (e5) => {
|
|
674
|
+
let t2 = e5.match(/\$\[(?<argIndex>\d+)\]/);
|
|
675
675
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
676
676
|
};
|
|
677
677
|
function At() {
|
|
678
|
-
let
|
|
679
|
-
if (
|
|
680
|
-
return jt(() =>
|
|
678
|
+
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
679
|
+
if (e5) return { initWixModules(t3, n3) {
|
|
680
|
+
return jt(() => e5(t3, n3));
|
|
681
681
|
}, fetchWithAuth() {
|
|
682
682
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
683
683
|
}, graphql() {
|
|
684
684
|
throw Error(`graphql is not available in this context`);
|
|
685
685
|
} };
|
|
686
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
687
|
-
if (t2 || n2) return { initWixModules(
|
|
686
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : g.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : g.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : g.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : g.elevatedClient;
|
|
687
|
+
if (t2 || n2) return { initWixModules(e6, r2) {
|
|
688
688
|
if (r2) {
|
|
689
689
|
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`);
|
|
690
|
-
return jt(() => n2.use(
|
|
690
|
+
return jt(() => n2.use(e6));
|
|
691
691
|
}
|
|
692
692
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
693
|
-
return jt(() => t2.use(
|
|
694
|
-
}, fetchWithAuth: (
|
|
693
|
+
return jt(() => t2.use(e6));
|
|
694
|
+
}, fetchWithAuth: (e6, n3) => {
|
|
695
695
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
696
|
-
return t2.fetchWithAuth(
|
|
696
|
+
return t2.fetchWithAuth(e6, n3);
|
|
697
697
|
}, getAuth() {
|
|
698
698
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
699
699
|
return t2.auth;
|
|
700
|
-
}, async graphql(
|
|
700
|
+
}, async graphql(e6, n3, r2) {
|
|
701
701
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
702
|
-
return t2.graphql(
|
|
702
|
+
return t2.graphql(e6, n3, r2);
|
|
703
703
|
} };
|
|
704
704
|
}
|
|
705
|
-
function jt(
|
|
706
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
707
|
-
globalThis.__wix_context__ = void 0,
|
|
705
|
+
function jt(e5) {
|
|
706
|
+
let t2 = globalThis.__wix_context__, n2 = { client: g.client, elevatedClient: g.elevatedClient }, r2;
|
|
707
|
+
globalThis.__wix_context__ = void 0, g.client = void 0, g.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
708
708
|
try {
|
|
709
|
-
return
|
|
709
|
+
return e5();
|
|
710
710
|
} finally {
|
|
711
|
-
globalThis.__wix_context__ = t2,
|
|
711
|
+
globalThis.__wix_context__ = t2, g.client = n2.client, g.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
|
-
function Mt(
|
|
714
|
+
function Mt(e5, t2) {
|
|
715
715
|
return (...n2) => {
|
|
716
716
|
let r2 = At();
|
|
717
|
-
return r2 ? r2.initWixModules(
|
|
717
|
+
return r2 ? r2.initWixModules(e5, t2).apply(void 0, n2) : e5.apply(void 0, n2);
|
|
718
718
|
};
|
|
719
719
|
}
|
|
720
|
-
function Nt(
|
|
720
|
+
function Nt(e5) {
|
|
721
721
|
let t2 = (...t3) => {
|
|
722
722
|
let n2 = At();
|
|
723
|
-
return n2 ? n2.initWixModules(
|
|
723
|
+
return n2 ? n2.initWixModules(e5).apply(void 0, t3) : () => ({ slug: e5.type });
|
|
724
724
|
};
|
|
725
|
-
return t2.__type =
|
|
725
|
+
return t2.__type = e5.__type, t2.type = e5.type, t2.isDomainEvent = e5.isDomainEvent, t2.transformations = e5.transformations, t2;
|
|
726
726
|
}
|
|
727
|
-
function Pt(
|
|
728
|
-
return Mt(
|
|
727
|
+
function Pt(e5, t2 = false) {
|
|
728
|
+
return Mt(e5, t2);
|
|
729
729
|
}
|
|
730
|
-
function Ft(
|
|
731
|
-
let n2 =
|
|
732
|
-
return t2 && r2 ? new URLSearchParams({ ".r":
|
|
733
|
-
r3 == null || Array.isArray(n3) && typeof r3 == `object` ||
|
|
734
|
-
}),
|
|
730
|
+
function Ft(e5, t2) {
|
|
731
|
+
let n2 = Lt(e5), r2 = Object.entries(n2).some(([e6, t3]) => e6.includes(`.`) || Array.isArray(t3) && t3.some((e7) => typeof e7 == `object`));
|
|
732
|
+
return t2 && r2 ? new URLSearchParams({ ".r": zt(JSON.stringify(e5)) }) : Object.entries(n2).reduce((e6, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
733
|
+
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e6.append(t3, r3);
|
|
734
|
+
}), e6), new URLSearchParams());
|
|
735
735
|
}
|
|
736
|
-
function
|
|
737
|
-
let t2 =
|
|
738
|
-
return
|
|
736
|
+
function It(e5) {
|
|
737
|
+
let t2 = Qt(Xt(e5.host), e5.domainToMappings);
|
|
738
|
+
return cn(an(e5.protoPath, e5.data || {}), t2);
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function Lt(e5, t2 = ``) {
|
|
741
741
|
let n2 = {};
|
|
742
|
-
return Object.entries(
|
|
743
|
-
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 =
|
|
742
|
+
return Object.entries(e5).forEach(([e6, r2]) => {
|
|
743
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Rt(t2, e6);
|
|
744
744
|
if (i2) {
|
|
745
|
-
let
|
|
746
|
-
Object.assign(n2,
|
|
745
|
+
let e7 = Lt(r2, a2);
|
|
746
|
+
Object.assign(n2, e7);
|
|
747
747
|
} else n2[a2] = r2;
|
|
748
748
|
}), n2;
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
return `${
|
|
752
|
-
}
|
|
753
|
-
var
|
|
754
|
-
let t2 = new TextEncoder().encode(
|
|
755
|
-
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(
|
|
756
|
-
};
|
|
757
|
-
var
|
|
758
|
-
var
|
|
759
|
-
var
|
|
760
|
-
var
|
|
761
|
-
var
|
|
762
|
-
var
|
|
763
|
-
var
|
|
764
|
-
var
|
|
765
|
-
var
|
|
766
|
-
var
|
|
767
|
-
function
|
|
768
|
-
return
|
|
769
|
-
}
|
|
770
|
-
function
|
|
771
|
-
return
|
|
772
|
-
}
|
|
773
|
-
function
|
|
774
|
-
let n2 = t2[
|
|
750
|
+
function Rt(e5, t2) {
|
|
751
|
+
return `${e5}${e5 ? `.` : ``}${t2}`;
|
|
752
|
+
}
|
|
753
|
+
var zt = (e5) => {
|
|
754
|
+
let t2 = new TextEncoder().encode(e5);
|
|
755
|
+
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e5, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
756
|
+
};
|
|
757
|
+
var Bt = [`wix.com`, `editorx.com`];
|
|
758
|
+
var Vt = `_`;
|
|
759
|
+
var Ht = `*.`;
|
|
760
|
+
var Ut = RegExp(`\\.(${Bt.join(`|`)})$`);
|
|
761
|
+
var Wt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
762
|
+
var Gt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
763
|
+
var Kt = `dev.wix-code.com`;
|
|
764
|
+
var qt = /{(.*)}/;
|
|
765
|
+
var Jt = RegExp(`\\.(${Wt.join(`|`)})$`);
|
|
766
|
+
var Yt = RegExp(`.*\\.${Kt}$`);
|
|
767
|
+
function Xt(e5) {
|
|
768
|
+
return Zt(e5).replace(Ut, `._base_domain_`).replace(Jt, `._api_base_domain_`).replace(Yt, `*.dev.wix-code.com`);
|
|
769
|
+
}
|
|
770
|
+
function Zt(e5) {
|
|
771
|
+
return Gt[e5] ?? e5;
|
|
772
|
+
}
|
|
773
|
+
function Qt(e5, t2) {
|
|
774
|
+
let n2 = t2[e5];
|
|
775
775
|
if (n2) return n2;
|
|
776
|
-
let r2 =
|
|
776
|
+
let r2 = $t(e5, t2) ?? en(e5, t2);
|
|
777
777
|
if (!r2) {
|
|
778
|
-
if (
|
|
779
|
-
let
|
|
780
|
-
if (
|
|
778
|
+
if (nn(e5)) {
|
|
779
|
+
let e6 = t2[rn];
|
|
780
|
+
if (e6) return e6;
|
|
781
781
|
}
|
|
782
|
-
let n3 = t2[
|
|
782
|
+
let n3 = t2[Vt];
|
|
783
783
|
if (n3) return n3;
|
|
784
784
|
}
|
|
785
785
|
return r2 ?? [];
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function $t(e5, t2) {
|
|
788
788
|
return Object.entries(t2).find(([t3]) => {
|
|
789
|
-
let [, ...n2] =
|
|
789
|
+
let [, ...n2] = e5.split(`.`);
|
|
790
790
|
return n2.join(`.`) === t3;
|
|
791
791
|
})?.[1];
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
793
|
+
function en(e5, t2) {
|
|
794
|
+
let [n2] = Object.entries(t2).filter(([t3]) => tn(e5, t3)).sort(([e6], [t3]) => t3.length - e6.length);
|
|
795
795
|
if (!n2) return;
|
|
796
796
|
let [, r2] = n2;
|
|
797
797
|
return r2;
|
|
798
798
|
}
|
|
799
|
-
function
|
|
800
|
-
if (!t2.startsWith(
|
|
799
|
+
function tn(e5, t2) {
|
|
800
|
+
if (!t2.startsWith(Ht)) return false;
|
|
801
801
|
let n2 = t2.slice(1);
|
|
802
|
-
return
|
|
802
|
+
return e5.length > n2.length && e5.endsWith(n2);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return !!
|
|
804
|
+
function nn(e5) {
|
|
805
|
+
return !!e5.match(/\._base_domain_$/);
|
|
806
806
|
}
|
|
807
|
-
var
|
|
808
|
-
function
|
|
809
|
-
return
|
|
807
|
+
var rn = `www._base_domain_`;
|
|
808
|
+
function an(e5, t2) {
|
|
809
|
+
return e5.split(`/`).map((e6) => on(e6, t2)).join(`/`);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
let n2 =
|
|
813
|
-
return r2 ?
|
|
811
|
+
function on(e5, t2) {
|
|
812
|
+
let n2 = e5.match(qt) || [], r2 = n2[1];
|
|
813
|
+
return r2 ? sn(t2, r2, e5, e5.replace(n2[0], ``)) : e5;
|
|
814
814
|
}
|
|
815
|
-
function
|
|
816
|
-
let i2 =
|
|
817
|
-
for (let
|
|
815
|
+
function sn(e5, t2, n2, r2) {
|
|
816
|
+
let i2 = e5;
|
|
817
|
+
for (let e6 of t2.split(`.`)) {
|
|
818
818
|
if (!i2) return n2;
|
|
819
|
-
i2 = i2[
|
|
819
|
+
i2 = i2[e6];
|
|
820
820
|
}
|
|
821
821
|
return `${i2}${r2}`;
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
let n2 = t2?.find((t3) =>
|
|
825
|
-
return n2 ? n2.srcPath +
|
|
823
|
+
function cn(e5, t2) {
|
|
824
|
+
let n2 = t2?.find((t3) => e5.startsWith(t3.destPath));
|
|
825
|
+
return n2 ? n2.srcPath + e5.slice(n2.destPath.length) : e5;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
828
|
-
return Nt(
|
|
827
|
+
function ln(e5) {
|
|
828
|
+
return Nt(e5);
|
|
829
829
|
}
|
|
830
|
-
function
|
|
831
|
-
return
|
|
830
|
+
function un(e5) {
|
|
831
|
+
return e5 === `NaN` ? NaN : e5 === `Infinity` ? 1 / 0 : e5 === `-Infinity` ? -1 / 0 : e5;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
return
|
|
833
|
+
function dn(e5) {
|
|
834
|
+
return e5 && pt({ formatted: e5.formattedAddress, location: e5.geocode, addressLine1: e5.addressLine, addressLine2: e5.addressLine2, streetAddress: e5.streetAddress && { name: e5.streetAddress.name, number: e5.streetAddress.number, apt: e5.streetAddress.apt, formattedAddressLine: e5.streetAddress.formattedAddressLine }, hint: e5.hint, city: e5.city, subdivision: e5.subdivision, country: e5.country, postalCode: e5.postalCode, countryFullname: e5.countryFullname, subdivisionFullname: e5.subdivisionFullname });
|
|
835
835
|
}
|
|
836
|
-
var
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
836
|
+
var fn;
|
|
837
|
+
(function(e5) {
|
|
838
|
+
e5.QUERY_PARAM = `QUERY_PARAM`, e5.SUBDOMAIN = `SUBDOMAIN`, e5.SUBDIRECTORY = `SUBDIRECTORY`;
|
|
839
|
+
})(fn ||= {});
|
|
840
|
+
var pn = { cs: `\u010Ce\u0161tina`, da: `Dansk`, de: `Deutsch`, en: `English`, es: `Espa\xF1ol`, fr: `Fran\xE7ais`, hi: `\u0939\u093F\u0928\u094D\u0926\u0940`, id: `Bahasa Indonesia`, it: `Italiano`, ja: `\u65E5\u672C\u8A9E`, ko: `\uD55C\uAD6D\uC5B4`, nl: `Nederlands`, no: `Norsk`, pl: `Polski`, pt: `Portugu\xEAs`, ru: `\u0420\u0443\u0441\u0441\u043A\u0438\u0439`, sv: `Svenska`, th: `\u0E44\u0E17\u0E22`, tr: `T\xFCrk\xE7e`, uk: `\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430`, vi: `Ti\u1EBFng Vi\u1EC7t`, zh: `\u7E41\u9AD4\u4E2D\u6587`, sq: `Shqip`, am: `\u12A0\u121B\u122D\u129B`, ar: `\u0627\u0644\u0639\u0631\u0628\u064A\u0629`, hy: `\u0540\u0561\u0575\u0565\u0580\u0565\u0576`, az: `Az\u0259rbaycan dili`, eu: `Euskara`, be: `\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F`, bn: `\u09AC\u09BE\u0982\u09B2\u09BE`, bs: `Bosanski`, bg: `\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438`, ca: `Catal\xE0`, ny: `ChiChe\u0175a`, co: `Corsu`, hr: `Hrvatski`, et: `Eesti`, fj: `Vosa Vakaviti`, fi: `Suomi`, ga: `Gaeilge`, gl: `Galego`, ka: `\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8`, el: `\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC`, gu: `\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0`, ht: `Krey\xF2l Ayisyen`, ha: `Hausa`, he: `\u05E2\u05D1\u05E8\u05D9\u05EA`, hu: `Magyar`, is: `\xCDslenska`, ig: `Igbo`, kn: `\u0C95\u0CA8\u0CCD\u0CA8\u0CA1`, kk: `\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456`, km: `\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A`, ku: `Kurd\xEE`, ky: `\u041A\u044B\u0440\u0433\u044B\u0437\u0447\u0430`, lb: `L\xEBtzebuergesch`, lo: `\u0EA5\u0EB2\u0EA7`, la: `Latina`, lv: `Latvie\u0161u`, lt: `Lietuvi\u0173`, mk: `\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438`, mg: `Malagasy`, ms: `Bahasa Melayu`, ml: `\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02`, mt: `Malti`, mn: `\u041C\u043E\u043D\u0433\u043E\u043B`, ne: `\u0928\u0947\u092A\u093E\u0932\u0940`, ps: `\u067E\u069A\u062A\u0648`, fa: `\u0641\u0627\u0631\u0633\u06CC`, ro: `Rom\xE2n\u0103`, sm: `Gagana Samoa`, sr: `\u0421\u0440\u043F\u0441\u043A\u0438`, sn: `Shona`, sd: `\u0633\u0646\u068C\u064A`, si: `\u0DC3\u0DD2\u0D82\u0DC4\u0DBD`, sk: `Sloven\u010Dina`, sl: `Sloven\u0161\u010Dina`, so: `Soomaaliga`, su: `Basa Sunda`, sw: `Kiswahili`, tl: `Filipino`, tg: `\u0422\u043E\u04B7\u0438\u043A\u04E3`, ta: `\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD`, te: `\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41`, tk: `T\xFCrkmen`, ur: `\u0627\u0631\u062F\u0648`, uz: `O'zbek`, cy: `Cymraeg`, xh: `isiXhosa`, yi: `\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9`, yo: `Yor\xF9b\xE1`, zu: `isiZulu`, kl: `Kalaallisut`, fo: `F\xF8royskt`, ln: `Ling\xE1la`, mi: `M\u0101ori`, mr: `\u092E\u0930\u093E\u0920\u0940`, my: `\u1019\u103C\u1014\u103A\u1019\u102C`, se: `S\xE1megiella`, ug: `\u0626\u06C7\u064A\u063A\u06C7\u0631\u0686\u06D5`, qu: `Runa Simi`, aa: `Afar`, ab: `\u0410\u04A7\u0441\u0443\u0430`, ae: `Avestan`, ak: `Akan`, an: `Aragon\xE9s`, as: `\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE`, av: `\u0410\u0432\u0430\u0440`, ay: `Aymar aru`, ba: `\u0411\u0430\u0448\u04A1\u043E\u0440\u0442\u0441\u0430`, bh: `\u092D\u094B\u091C\u092A\u0941\u0930\u0940`, bi: `Bislama`, bm: `Bamanankan`, bo: `\u0F56\u0F7C\u0F51\u0F0B\u0F66\u0F90\u0F51\u0F0B`, br: `Brezhoneg`, ce: `\u041D\u043E\u0445\u0447\u0438\u0439\u043D`, ch: `Chamoru`, cr: `\u14C0\u1426\u1403\u152D\u140D\u140F\u1423`, cu: `\u0426\u0440\u044C\u043A\u044A\u0432\u044C\u043D\u043E\u0441\u043B\u043E\u0432\u0463\u043D\u044C\u0441\u043A\u044A`, cv: `\u0427\u04D1\u0432\u0430\u0448\u043B\u0430`, dv: `\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0784\u07A6\u0790\u07B0`, dz: `\u0F62\u0FAB\u0F7C\u0F44\u0F0B\u0F41`, ee: `E\u028Begbe`, eo: `Esperanto`, ff: `Fulah`, fy: `Frysk`, gd: `G\xE0idhlig`, gn: `Ava\xF1e'\u1EBD`, gv: `Gaelg`, ho: `Hiri Motu`, hz: `Otjiherero`, ia: `Interlingua`, ie: `Interlingue`, ii: `\uA188\uA320\uA259`, ik: `I\xF1upiaq`, io: `Ido`, iu: `\u1403\u14C4\u1483\u144E\u1450\u1466`, jv: `Basa Jawa`, ki: `Gikuyu`, kr: `Kanuri`, ks: `\u06A9\u0672\u0634\u064F\u0631`, kw: `Kernewek`, lg: `Luganda`, li: `Limburgs`, lu: `Tshiluba`, mh: `Kajin M\u0327aje\u013C`, na: `Dorerin Naoero`, nb: `Norsk Bokm\xE5l`, nd: `isiNdebele`, ng: `Oshiwambo`, nn: `Norsk Nynorsk`, nr: `isiNdebele (South)`, nv: `Din\xE9 Bizaad`, oc: `Occitan`, oj: `Anishinaabemowin`, om: `Afaan Oromoo`, or: `\u0B13\u0B21\u0B3C\u0B3F\u0B06`, os: `\u0418\u0440\u043E\u043D`, pa: `\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40`, pi: `\u{11005}\u{1102F}\u{11022}`, rm: `Rumantsch`, rn: `Ikirundi`, rw: `Kinyarwanda`, sa: `\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D`, sc: `Sardu`, sg: `S\xE4ng\xF6`, ss: `SiSwati`, st: `Sesotho`, ti: `\u1275\u130D\u122D\u129B`, tn: `Setswana`, to: `Faka Tonga`, ts: `Xitsonga`, tt: `\u0422\u0430\u0442\u0430\u0440\u0447\u0430`, tw: `Twi`, ty: `Reo Tahiti`, ve: `Tshiven\u1E13a`, vo: `Volap\xFCk`, wa: `Walon`, wo: `Wolof`, za: `Sa\u026F cue\u014B\u0185` };
|
|
841
|
+
var mn = (e5, t2) => {
|
|
842
|
+
e5.searchParams.set(`lang`, t2);
|
|
843
|
+
};
|
|
844
|
+
var hn = (e5, t2) => {
|
|
845
|
+
let n2 = e5.hostname.split(`.`);
|
|
846
|
+
n2[0] === `www` && (n2 = n2.slice(1)), n2 = [t2, ...n2], e5.hostname = n2.join(`.`);
|
|
847
|
+
};
|
|
848
|
+
var gn = (e5, t2) => {
|
|
849
|
+
e5.pathname = `/${t2}${e5.pathname}`;
|
|
850
|
+
};
|
|
851
|
+
var _n = (e5, t2) => {
|
|
852
|
+
if (!t2.languageCode || !t2?.resolutionMethod) return e5;
|
|
853
|
+
let n2 = new URL(e5);
|
|
854
|
+
return (t2?.resolutionMethod === `QUERY_PARAM` ? mn : t2?.resolutionMethod === `SUBDOMAIN` ? hn : gn)(n2, t2.languageCode), n2.href;
|
|
842
855
|
};
|
|
843
|
-
|
|
844
|
-
|
|
856
|
+
var vn = (e5, t2) => {
|
|
857
|
+
if (!e5?.length) return e5;
|
|
858
|
+
let n2;
|
|
859
|
+
try {
|
|
860
|
+
n2 = new URL(e5);
|
|
861
|
+
} catch {
|
|
862
|
+
return e5;
|
|
863
|
+
}
|
|
864
|
+
n2.searchParams.delete(`lang`);
|
|
865
|
+
let r2 = n2.pathname.split(`/`)[1]?.toLowerCase();
|
|
866
|
+
if (t2.includes(r2 ?? ``)) {
|
|
867
|
+
let e6 = n2.pathname.split(`/`);
|
|
868
|
+
e6.splice(1, 1), n2.pathname = e6.join(`/`);
|
|
869
|
+
}
|
|
870
|
+
let i2 = n2.hostname.split(`.`)[0]?.toLowerCase();
|
|
871
|
+
if (t2.includes(i2 ?? ``)) {
|
|
872
|
+
let e6 = n2.hostname.split(`.`);
|
|
873
|
+
e6.shift(), n2.hostname = e6.join(`.`);
|
|
874
|
+
}
|
|
875
|
+
return n2.href;
|
|
876
|
+
};
|
|
877
|
+
function yn() {
|
|
878
|
+
let e5 = bn();
|
|
879
|
+
return e5 ? xn(e5) : [];
|
|
880
|
+
}
|
|
881
|
+
function bn() {
|
|
882
|
+
let e5 = typeof globals < `u` ? globals?.$ns?.[`wix-window`]?.multilingual : void 0, t2 = typeof window < `u` ? window?.essentials?.multilingual : void 0;
|
|
883
|
+
return e5 ?? t2 ?? globalThis?.__wix_site_metadata__?.multilingual;
|
|
884
|
+
}
|
|
885
|
+
function xn(e5) {
|
|
886
|
+
try {
|
|
887
|
+
if (e5?.supportedLanguages?.length) {
|
|
888
|
+
let t2 = e5.supportedLanguages, n2 = t2.map((e6) => e6.languageCode).filter(Boolean), r2 = e5.cleanUrl ?? Tn(n2);
|
|
889
|
+
return t2.map((e6) => ({ id: e6.languageCode, displayName: Sn(e6), regionalFormat: [e6.locale?.languageCode, e6.locale?.country].filter(Boolean).join(`-`), url: Cn(e6, r2), primary: e6.isPrimary, resolutionMethod: e6.resolutionMethod }));
|
|
890
|
+
}
|
|
891
|
+
if (e5?.siteLanguages?.length) {
|
|
892
|
+
let t2 = e5.siteLanguages, n2 = Tn(t2.map((e6) => e6.languageCode).filter(Boolean));
|
|
893
|
+
return t2.map((e6) => ({ id: e6.languageCode, displayName: Sn(e6), regionalFormat: e6.locale, url: Cn(e6, n2), primary: e6.isPrimaryLanguage, resolutionMethod: e6.resolutionMethod ? wn(e6.resolutionMethod) : void 0 }));
|
|
894
|
+
}
|
|
895
|
+
} catch (e6) {
|
|
896
|
+
return console.warn(`[Multilingual Manager] listSupportedLanguages failed`, e6), [];
|
|
897
|
+
}
|
|
898
|
+
return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`), [];
|
|
899
|
+
}
|
|
900
|
+
function Sn(e5) {
|
|
901
|
+
let t2 = pn[e5.languageCode];
|
|
902
|
+
if (t2) return t2;
|
|
903
|
+
let n2 = e5.name ?? e5.countryCode;
|
|
904
|
+
if (n2) return n2;
|
|
905
|
+
}
|
|
906
|
+
function Cn(e5, t2) {
|
|
907
|
+
if (e5.url || !t2 || !e5.resolutionMethod) return e5.url;
|
|
908
|
+
if (e5.languageCode) try {
|
|
909
|
+
return _n(t2, { languageCode: e5.languageCode, countryCode: e5.countryCode, resolutionMethod: wn(e5.resolutionMethod), locale: { languageCode: e5.languageCode, country: e5.countryCode } });
|
|
910
|
+
} catch (e6) {
|
|
911
|
+
console.warn(`[Multilingual Manager] buildUrlForLanguage failed`, e6);
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
function wn(e5) {
|
|
916
|
+
switch (e5) {
|
|
917
|
+
case `QUERY_PARAM`:
|
|
918
|
+
case `QueryParam`:
|
|
919
|
+
return fn.QUERY_PARAM;
|
|
920
|
+
case `SUBDOMAIN`:
|
|
921
|
+
case `Subdomain`:
|
|
922
|
+
return fn.SUBDOMAIN;
|
|
923
|
+
case `SUBDIRECTORY`:
|
|
924
|
+
case `Subdirectory`:
|
|
925
|
+
return fn.SUBDIRECTORY;
|
|
926
|
+
default:
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
function Tn(e5) {
|
|
931
|
+
let t2 = typeof window < `u` && window.location?.href ? window.location.href : ``;
|
|
932
|
+
try {
|
|
933
|
+
return vn(t2, e5);
|
|
934
|
+
} catch (e6) {
|
|
935
|
+
return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`, e6), t2;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
var En = `x-wix-linguist`;
|
|
939
|
+
var Dn = `00000000-0000-0000-0000-000000000000`;
|
|
940
|
+
var On = `false`;
|
|
941
|
+
var kn = () => {
|
|
942
|
+
let e5 = Mn(`language`), t2 = Mn(`locale`);
|
|
943
|
+
if (e5) return { [En]: [e5, t2 || e5, On, Dn].join(`|`) };
|
|
944
|
+
};
|
|
945
|
+
function An() {
|
|
946
|
+
let e5 = null, t2 = null;
|
|
845
947
|
return { promise: new Promise((n2, r2) => {
|
|
846
|
-
|
|
847
|
-
}), resolve:
|
|
848
|
-
}
|
|
849
|
-
var
|
|
850
|
-
var
|
|
851
|
-
var
|
|
852
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 =
|
|
853
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
854
|
-
return
|
|
948
|
+
e5 = n2, t2 = r2;
|
|
949
|
+
}), resolve: e5, reject: t2 };
|
|
950
|
+
}
|
|
951
|
+
var jn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
952
|
+
var Mn = (e5) => jn()?.[e5];
|
|
953
|
+
var Nn = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host: (t2) => {
|
|
954
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 = Fn();
|
|
955
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: Mn(`language`), locale: Mn(`locale`), get passThroughHeaders() {
|
|
956
|
+
return kn();
|
|
855
957
|
} } };
|
|
856
|
-
}, auth: (
|
|
958
|
+
}, auth: (e6) => {
|
|
857
959
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
858
|
-
!
|
|
859
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
960
|
+
!e6 && Pn() && (e6 = t2?.getAccessTokenFunction?.());
|
|
961
|
+
let n2 = false, { resolve: r2, promise: i2 } = An();
|
|
860
962
|
return { getAuthHeaders: async () => {
|
|
861
|
-
if (!
|
|
862
|
-
return { headers: { Authorization: await
|
|
863
|
-
}, getAccessTokenInjector: () => (n2 = true, (
|
|
864
|
-
r2(
|
|
963
|
+
if (!e6 && n2 && (e6 = await i2), !e6) throw Error(`Failed to resolve auth token`);
|
|
964
|
+
return { headers: { Authorization: await e6() } };
|
|
965
|
+
}, getAccessTokenInjector: () => (n2 = true, (e7) => {
|
|
966
|
+
r2(e7);
|
|
865
967
|
}) };
|
|
866
968
|
} });
|
|
867
|
-
function
|
|
969
|
+
function Pn() {
|
|
868
970
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
869
971
|
}
|
|
870
|
-
function
|
|
871
|
-
let
|
|
872
|
-
if (!
|
|
873
|
-
let t2 = new URL(
|
|
972
|
+
function Fn() {
|
|
973
|
+
let e5 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
974
|
+
if (!e5) return;
|
|
975
|
+
let t2 = new URL(e5);
|
|
874
976
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
875
977
|
}
|
|
876
|
-
var
|
|
877
|
-
if (!
|
|
878
|
-
return
|
|
978
|
+
var In = ({ clientSdk: e5, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
979
|
+
if (!e5) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
980
|
+
return e5.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
879
981
|
}, getAccessToken: () => {
|
|
880
982
|
throw Error(`Not implemented`);
|
|
881
983
|
}, observeState: () => ({ disconnect: () => {
|
|
882
984
|
} }) });
|
|
883
|
-
var
|
|
884
|
-
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ??
|
|
985
|
+
var Ln = Nn({ createHost: function(e5) {
|
|
986
|
+
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e5?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e5 || {};
|
|
885
987
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
886
|
-
return { channel:
|
|
988
|
+
return { channel: In({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
887
989
|
} };
|
|
888
990
|
} });
|
|
889
|
-
var
|
|
890
|
-
let n2 =
|
|
991
|
+
var Rn = (e5, t2) => {
|
|
992
|
+
let n2 = Ln.host({ applicationId: e5, componentId: t2 }), r2 = Ln.auth();
|
|
891
993
|
return He({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
892
994
|
};
|
|
893
|
-
var
|
|
894
|
-
function
|
|
895
|
-
let
|
|
896
|
-
if (
|
|
897
|
-
return
|
|
995
|
+
var zn = (e5) => Rn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e5);
|
|
996
|
+
function Bn() {
|
|
997
|
+
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
998
|
+
if (e5) return { initWixModules(t3, n3) {
|
|
999
|
+
return Vn(() => e5(t3, n3));
|
|
898
1000
|
}, fetchWithAuth() {
|
|
899
1001
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
900
1002
|
}, graphql() {
|
|
901
1003
|
throw Error(`graphql is not available in this context`);
|
|
902
1004
|
} };
|
|
903
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
904
|
-
if (t2 || n2) return { initWixModules(
|
|
1005
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : g.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : g.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : g.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : g.elevatedClient;
|
|
1006
|
+
if (t2 || n2) return { initWixModules(e6, r2) {
|
|
905
1007
|
if (r2) {
|
|
906
1008
|
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`);
|
|
907
|
-
return
|
|
1009
|
+
return Vn(() => n2.use(e6));
|
|
908
1010
|
}
|
|
909
1011
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
910
|
-
return
|
|
911
|
-
}, fetchWithAuth: (
|
|
1012
|
+
return Vn(() => t2.use(e6));
|
|
1013
|
+
}, fetchWithAuth: (e6, n3) => {
|
|
912
1014
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
913
|
-
return t2.fetchWithAuth(
|
|
1015
|
+
return t2.fetchWithAuth(e6, n3);
|
|
914
1016
|
}, getAuth() {
|
|
915
1017
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
916
1018
|
return t2.auth;
|
|
917
|
-
}, async graphql(
|
|
1019
|
+
}, async graphql(e6, n3, r2) {
|
|
918
1020
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
919
|
-
return t2.graphql(
|
|
1021
|
+
return t2.graphql(e6, n3, r2);
|
|
920
1022
|
} };
|
|
921
1023
|
}
|
|
922
|
-
function
|
|
923
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
924
|
-
globalThis.__wix_context__ = void 0,
|
|
1024
|
+
function Vn(e5) {
|
|
1025
|
+
let t2 = globalThis.__wix_context__, n2 = { client: g.client, elevatedClient: g.elevatedClient }, r2;
|
|
1026
|
+
globalThis.__wix_context__ = void 0, g.client = void 0, g.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
925
1027
|
try {
|
|
926
|
-
return
|
|
1028
|
+
return e5();
|
|
927
1029
|
} finally {
|
|
928
|
-
globalThis.__wix_context__ = t2,
|
|
1030
|
+
globalThis.__wix_context__ = t2, g.client = n2.client, g.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
929
1031
|
}
|
|
930
1032
|
}
|
|
931
|
-
function
|
|
932
|
-
return { ...
|
|
933
|
-
let r2 =
|
|
1033
|
+
function Hn(e5, t2) {
|
|
1034
|
+
return { ...e5, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
1035
|
+
let r2 = Bn();
|
|
934
1036
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
935
|
-
return r2.initWixModules(
|
|
1037
|
+
return r2.initWixModules(e5)[t3].apply(void 0, n2);
|
|
936
1038
|
}])) };
|
|
937
1039
|
}
|
|
938
|
-
function
|
|
939
|
-
return
|
|
1040
|
+
function Un(e5) {
|
|
1041
|
+
return Hn({ __type: `host`, create: (t2) => Object.entries(e5).reduce((e6, [n2, r2]) => ({ ...e6, [n2]: r2(t2) }), {}) }, Object.keys(e5));
|
|
940
1042
|
}
|
|
941
|
-
var
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
1043
|
+
var F = (e5) => typeof e5 == `string`;
|
|
1044
|
+
var Wn = () => {
|
|
1045
|
+
let e5, t2, n2 = new Promise((n3, r2) => {
|
|
1046
|
+
e5 = n3, t2 = r2;
|
|
1047
|
+
});
|
|
1048
|
+
return n2.resolve = e5, n2.reject = t2, n2;
|
|
1049
|
+
};
|
|
1050
|
+
var Gn = (e5) => e5 == null ? `` : `` + e5;
|
|
1051
|
+
var Kn = (e5, t2, n2) => {
|
|
1052
|
+
e5.forEach((e6) => {
|
|
1053
|
+
t2[e6] && (n2[e6] = t2[e6]);
|
|
1054
|
+
});
|
|
1055
|
+
};
|
|
1056
|
+
var qn = /###/g;
|
|
1057
|
+
var Jn = (e5) => e5 && e5.indexOf(`###`) > -1 ? e5.replace(qn, `.`) : e5;
|
|
1058
|
+
var Yn = (e5) => !e5 || F(e5);
|
|
1059
|
+
var Xn = (e5, t2, n2) => {
|
|
1060
|
+
let r2 = F(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1061
|
+
for (; i2 < r2.length - 1; ) {
|
|
1062
|
+
if (Yn(e5)) return {};
|
|
1063
|
+
let t3 = Jn(r2[i2]);
|
|
1064
|
+
!e5[t3] && n2 && (e5[t3] = new n2()), e5 = Object.prototype.hasOwnProperty.call(e5, t3) ? e5[t3] : {}, ++i2;
|
|
1065
|
+
}
|
|
1066
|
+
return Yn(e5) ? {} : { obj: e5, k: Jn(r2[i2]) };
|
|
1067
|
+
};
|
|
1068
|
+
var Zn = (e5, t2, n2) => {
|
|
1069
|
+
let { obj: r2, k: i2 } = Xn(e5, t2, Object);
|
|
1070
|
+
if (r2 !== void 0 || t2.length === 1) {
|
|
1071
|
+
r2[i2] = n2;
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = Xn(e5, o2, Object);
|
|
1075
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = Xn(e5, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
1076
|
+
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1077
|
+
};
|
|
1078
|
+
var Qn = (e5, t2, n2, r2) => {
|
|
1079
|
+
let { obj: i2, k: a2 } = Xn(e5, t2, Object);
|
|
1080
|
+
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1081
|
+
};
|
|
1082
|
+
var $n = (e5, t2) => {
|
|
1083
|
+
let { obj: n2, k: r2 } = Xn(e5, t2);
|
|
1084
|
+
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1085
|
+
};
|
|
1086
|
+
var er = (e5, t2, n2) => {
|
|
1087
|
+
let r2 = $n(e5, n2);
|
|
1088
|
+
return r2 === void 0 ? $n(t2, n2) : r2;
|
|
1089
|
+
};
|
|
1090
|
+
var tr = (e5, t2, n2) => {
|
|
1091
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (r2 in e5 ? F(e5[r2]) || e5[r2] instanceof String || F(t2[r2]) || t2[r2] instanceof String ? n2 && (e5[r2] = t2[r2]) : tr(e5[r2], t2[r2], n2) : e5[r2] = t2[r2]);
|
|
1092
|
+
return e5;
|
|
1093
|
+
};
|
|
1094
|
+
var I = (e5) => e5.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1095
|
+
var nr = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1096
|
+
var rr = (e5) => F(e5) ? e5.replace(/[&<>"'\/]/g, (e6) => nr[e6]) : e5;
|
|
1097
|
+
var ir = class {
|
|
1098
|
+
constructor(e5) {
|
|
1099
|
+
this.capacity = e5, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1100
|
+
}
|
|
1101
|
+
getRegExp(e5) {
|
|
1102
|
+
let t2 = this.regExpMap.get(e5);
|
|
1103
|
+
if (t2 !== void 0) return t2;
|
|
1104
|
+
let n2 = new RegExp(e5);
|
|
1105
|
+
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e5, n2), this.regExpQueue.push(e5), n2;
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
var ar = [` `, `,`, `?`, `!`, `;`];
|
|
1109
|
+
var or = new ir(20);
|
|
1110
|
+
var sr = (e5, t2, n2) => {
|
|
1111
|
+
t2 ||= ``, n2 ||= ``;
|
|
1112
|
+
let r2 = ar.filter((e6) => t2.indexOf(e6) < 0 && n2.indexOf(e6) < 0);
|
|
1113
|
+
if (r2.length === 0) return true;
|
|
1114
|
+
let i2 = or.getRegExp(`(${r2.map((e6) => e6 === `?` ? `\\?` : e6).join(`|`)})`), a2 = !i2.test(e5);
|
|
1115
|
+
if (!a2) {
|
|
1116
|
+
let t3 = e5.indexOf(n2);
|
|
1117
|
+
t3 > 0 && !i2.test(e5.substring(0, t3)) && (a2 = true);
|
|
1118
|
+
}
|
|
1119
|
+
return a2;
|
|
1120
|
+
};
|
|
1121
|
+
var cr = (e5, t2, n2 = `.`) => {
|
|
1122
|
+
if (!e5) return;
|
|
1123
|
+
if (e5[t2]) return Object.prototype.hasOwnProperty.call(e5, t2) ? e5[t2] : void 0;
|
|
1124
|
+
let r2 = t2.split(n2), i2 = e5;
|
|
1125
|
+
for (let e6 = 0; e6 < r2.length; ) {
|
|
1126
|
+
if (!i2 || typeof i2 != `object`) return;
|
|
1127
|
+
let t3, a2 = ``;
|
|
1128
|
+
for (let o2 = e6; o2 < r2.length; ++o2) if (o2 !== e6 && (a2 += n2), a2 += r2[o2], t3 = i2[a2], t3 !== void 0) {
|
|
1129
|
+
if ([`string`, `number`, `boolean`].indexOf(typeof t3) > -1 && o2 < r2.length - 1) continue;
|
|
1130
|
+
e6 += o2 - e6 + 1;
|
|
1131
|
+
break;
|
|
1132
|
+
}
|
|
1133
|
+
i2 = t3;
|
|
1134
|
+
}
|
|
1135
|
+
return i2;
|
|
1136
|
+
};
|
|
1137
|
+
var lr = (e5) => e5?.replace(/_/g, `-`);
|
|
1138
|
+
var ur = { type: `logger`, log(e5) {
|
|
1139
|
+
this.output(`log`, e5);
|
|
1140
|
+
}, warn(e5) {
|
|
1141
|
+
this.output(`warn`, e5);
|
|
1142
|
+
}, error(e5) {
|
|
1143
|
+
this.output(`error`, e5);
|
|
1144
|
+
}, output(e5, t2) {
|
|
1145
|
+
console?.[e5]?.apply?.(console, t2);
|
|
1146
|
+
} };
|
|
1147
|
+
var L = new class e2 {
|
|
1148
|
+
constructor(e5, t2 = {}) {
|
|
1149
|
+
this.init(e5, t2);
|
|
1150
|
+
}
|
|
1151
|
+
init(e5, t2 = {}) {
|
|
1152
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e5 || ur, this.options = t2, this.debug = t2.debug;
|
|
1153
|
+
}
|
|
1154
|
+
log(...e5) {
|
|
1155
|
+
return this.forward(e5, `log`, ``, true);
|
|
1156
|
+
}
|
|
1157
|
+
warn(...e5) {
|
|
1158
|
+
return this.forward(e5, `warn`, ``, true);
|
|
1159
|
+
}
|
|
1160
|
+
error(...e5) {
|
|
1161
|
+
return this.forward(e5, `error`, ``);
|
|
1162
|
+
}
|
|
1163
|
+
deprecate(...e5) {
|
|
1164
|
+
return this.forward(e5, `warn`, `WARNING DEPRECATED: `, true);
|
|
1165
|
+
}
|
|
1166
|
+
forward(e5, t2, n2, r2) {
|
|
1167
|
+
return r2 && !this.debug ? null : (F(e5[0]) && (e5[0] = `${n2}${this.prefix} ${e5[0]}`), this.logger[t2](e5));
|
|
1168
|
+
}
|
|
1169
|
+
create(t2) {
|
|
1170
|
+
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
1171
|
+
}
|
|
1172
|
+
clone(t2) {
|
|
1173
|
+
return t2 ||= this.options, t2.prefix = t2.prefix || this.prefix, new e2(this.logger, t2);
|
|
1174
|
+
}
|
|
1175
|
+
}();
|
|
1176
|
+
var dr = class {
|
|
1177
|
+
constructor() {
|
|
1178
|
+
this.observers = {};
|
|
1179
|
+
}
|
|
1180
|
+
on(e5, t2) {
|
|
1181
|
+
return e5.split(` `).forEach((e6) => {
|
|
1182
|
+
this.observers[e6] || (this.observers[e6] = /* @__PURE__ */ new Map());
|
|
1183
|
+
let n2 = this.observers[e6].get(t2) || 0;
|
|
1184
|
+
this.observers[e6].set(t2, n2 + 1);
|
|
1185
|
+
}), this;
|
|
1186
|
+
}
|
|
1187
|
+
off(e5, t2) {
|
|
1188
|
+
if (this.observers[e5]) {
|
|
1189
|
+
if (!t2) {
|
|
1190
|
+
delete this.observers[e5];
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
this.observers[e5].delete(t2);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
emit(e5, ...t2) {
|
|
1197
|
+
this.observers[e5] && Array.from(this.observers[e5].entries()).forEach(([e6, n2]) => {
|
|
1198
|
+
for (let r2 = 0; r2 < n2; r2++) e6(...t2);
|
|
1199
|
+
}), this.observers[`*`] && Array.from(this.observers[`*`].entries()).forEach(([n2, r2]) => {
|
|
1200
|
+
for (let i2 = 0; i2 < r2; i2++) n2.apply(n2, [e5, ...t2]);
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
};
|
|
1204
|
+
var fr = class extends dr {
|
|
1205
|
+
constructor(e5, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1206
|
+
super(), this.data = e5 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1207
|
+
}
|
|
1208
|
+
addNamespaces(e5) {
|
|
1209
|
+
this.options.ns.indexOf(e5) < 0 && this.options.ns.push(e5);
|
|
1210
|
+
}
|
|
1211
|
+
removeNamespaces(e5) {
|
|
1212
|
+
let t2 = this.options.ns.indexOf(e5);
|
|
1213
|
+
t2 > -1 && this.options.ns.splice(t2, 1);
|
|
1214
|
+
}
|
|
1215
|
+
getResource(e5, t2, n2, r2 = {}) {
|
|
1216
|
+
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1217
|
+
e5.indexOf(`.`) > -1 ? o2 = e5.split(`.`) : (o2 = [e5, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : F(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1218
|
+
let s2 = $n(this.data, o2);
|
|
1219
|
+
return !s2 && !t2 && !n2 && e5.indexOf(`.`) > -1 && (e5 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !F(n2) ? s2 : cr(this.data?.[e5]?.[t2], n2, i2);
|
|
1220
|
+
}
|
|
1221
|
+
addResource(e5, t2, n2, r2, i2 = { silent: false }) {
|
|
1222
|
+
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e5, t2];
|
|
1223
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), Zn(this.data, o2, r2), i2.silent || this.emit(`added`, e5, t2, n2, r2);
|
|
1224
|
+
}
|
|
1225
|
+
addResources(e5, t2, n2, r2 = { silent: false }) {
|
|
1226
|
+
for (let r3 in n2) (F(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e5, t2, r3, n2[r3], { silent: true });
|
|
1227
|
+
r2.silent || this.emit(`added`, e5, t2, n2);
|
|
1228
|
+
}
|
|
1229
|
+
addResourceBundle(e5, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
1230
|
+
let o2 = [e5, t2];
|
|
1231
|
+
e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1232
|
+
let s2 = $n(this.data, o2) || {};
|
|
1233
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? tr(s2, n2, i2) : s2 = { ...s2, ...n2 }, Zn(this.data, o2, s2), a2.silent || this.emit(`added`, e5, t2, n2);
|
|
1234
|
+
}
|
|
1235
|
+
removeResourceBundle(e5, t2) {
|
|
1236
|
+
this.hasResourceBundle(e5, t2) && delete this.data[e5][t2], this.removeNamespaces(t2), this.emit(`removed`, e5, t2);
|
|
1237
|
+
}
|
|
1238
|
+
hasResourceBundle(e5, t2) {
|
|
1239
|
+
return this.getResource(e5, t2) !== void 0;
|
|
1240
|
+
}
|
|
1241
|
+
getResourceBundle(e5, t2) {
|
|
1242
|
+
return t2 ||= this.options.defaultNS, this.getResource(e5, t2);
|
|
1243
|
+
}
|
|
1244
|
+
getDataByLanguage(e5) {
|
|
1245
|
+
return this.data[e5];
|
|
1246
|
+
}
|
|
1247
|
+
hasLanguageSomeTranslations(e5) {
|
|
1248
|
+
let t2 = this.getDataByLanguage(e5);
|
|
1249
|
+
return !!(t2 && Object.keys(t2) || []).find((e6) => t2[e6] && Object.keys(t2[e6]).length > 0);
|
|
1250
|
+
}
|
|
1251
|
+
toJSON() {
|
|
1252
|
+
return this.data;
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
var pr = { processors: {}, addPostProcessor(e5) {
|
|
1256
|
+
this.processors[e5.name] = e5;
|
|
1257
|
+
}, handle(e5, t2, n2, r2, i2) {
|
|
1258
|
+
return e5.forEach((e6) => {
|
|
1259
|
+
t2 = this.processors[e6]?.process(t2, n2, r2, i2) ?? t2;
|
|
1260
|
+
}), t2;
|
|
1261
|
+
} };
|
|
1262
|
+
var mr = Symbol(`i18next/PATH_KEY`);
|
|
1263
|
+
function hr() {
|
|
1264
|
+
let e5 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1265
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === mr ? e5 : (e5.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1266
|
+
}
|
|
1267
|
+
function R(e5, t2) {
|
|
1268
|
+
let { [mr]: n2 } = e5(hr()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`;
|
|
1269
|
+
if (n2.length > 1 && i2) {
|
|
1270
|
+
let e6 = t2?.ns, a2 = Array.isArray(e6) ? e6 : null;
|
|
1271
|
+
if (a2 && a2.length > 1 && a2.slice(1).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1272
|
+
}
|
|
1273
|
+
return n2.join(r2);
|
|
1274
|
+
}
|
|
1275
|
+
var gr = {};
|
|
1276
|
+
var _r = (e5) => !F(e5) && typeof e5 != `boolean` && typeof e5 != `number`;
|
|
1277
|
+
var vr = class e3 extends dr {
|
|
1278
|
+
constructor(e5, t2 = {}) {
|
|
1279
|
+
super(), Kn([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e5, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = L.create(`translator`);
|
|
1280
|
+
}
|
|
1281
|
+
changeLanguage(e5) {
|
|
1282
|
+
e5 && (this.language = e5);
|
|
1283
|
+
}
|
|
1284
|
+
exists(e5, t2 = { interpolation: {} }) {
|
|
1285
|
+
let n2 = { ...t2 };
|
|
1286
|
+
if (e5 == null) return false;
|
|
1287
|
+
let r2 = this.resolve(e5, n2);
|
|
1288
|
+
if (r2?.res === void 0) return false;
|
|
1289
|
+
let i2 = _r(r2.res);
|
|
1290
|
+
return !(n2.returnObjects === false && i2);
|
|
1291
|
+
}
|
|
1292
|
+
extractFromKey(e5, t2) {
|
|
1293
|
+
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1294
|
+
n2 === void 0 && (n2 = `:`);
|
|
1295
|
+
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e5.indexOf(n2) > -1, o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !sr(e5, n2, r2);
|
|
1296
|
+
if (a2 && !o2) {
|
|
1297
|
+
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1298
|
+
if (t3 && t3.length > 0) return { key: e5, namespaces: F(i2) ? [i2] : i2 };
|
|
1299
|
+
let a3 = e5.split(n2);
|
|
1300
|
+
(n2 !== r2 || n2 === r2 && this.options.ns.indexOf(a3[0]) > -1) && (i2 = a3.shift()), e5 = a3.join(r2);
|
|
1301
|
+
}
|
|
1302
|
+
return { key: e5, namespaces: F(i2) ? [i2] : i2 };
|
|
1303
|
+
}
|
|
1304
|
+
translate(t2, n2, r2) {
|
|
1305
|
+
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
1306
|
+
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
1307
|
+
typeof t2 == `function` && (t2 = R(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e5) => typeof e5 == `function` ? R(e5, { ...this.options, ...i2 }) : String(e5));
|
|
1308
|
+
let a2 = i2.returnDetails === void 0 ? this.options.returnDetails : i2.returnDetails, o2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, { key: s2, namespaces: c2 } = this.extractFromKey(t2[t2.length - 1], i2), l2 = c2[c2.length - 1], u2 = i2.nsSeparator === void 0 ? this.options.nsSeparator : i2.nsSeparator;
|
|
1309
|
+
u2 === void 0 && (u2 = `:`);
|
|
1310
|
+
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1311
|
+
if (d2?.toLowerCase() === `cimode`) return f2 ? a2 ? { res: `${l2}${u2}${s2}`, usedKey: s2, exactUsedKey: s2, usedLng: d2, usedNS: l2, usedParams: this.getUsedParamsDetails(i2) } : `${l2}${u2}${s2}` : a2 ? { res: s2, usedKey: s2, exactUsedKey: s2, usedLng: d2, usedNS: l2, usedParams: this.getUsedParamsDetails(i2) } : s2;
|
|
1312
|
+
let p2 = this.resolve(t2, i2), m2 = p2?.res, h2 = p2?.usedKey || s2, g2 = p2?.exactUsedKey || s2, _2 = [`[object Number]`, `[object Function]`, `[object RegExp]`], v2 = i2.joinArrays === void 0 ? this.options.joinArrays : i2.joinArrays, y2 = !this.i18nFormat || this.i18nFormat.handleAsObject, b2 = i2.count !== void 0 && !F(i2.count), x2 = e3.hasDefaultValue(i2), S2 = b2 ? this.pluralResolver.getSuffix(d2, i2.count, i2) : ``, ee2 = i2.ordinal && b2 ? this.pluralResolver.getSuffix(d2, i2.count, { ordinal: false }) : ``, C2 = b2 && !i2.ordinal && i2.count === 0, w2 = C2 && i2[`defaultValue${this.options.pluralSeparator}zero`] || i2[`defaultValue${S2}`] || i2[`defaultValue${ee2}`] || i2.defaultValue, T2 = m2;
|
|
1313
|
+
y2 && !m2 && x2 && (T2 = w2);
|
|
1314
|
+
let E2 = _r(T2), D2 = Object.prototype.toString.apply(T2);
|
|
1315
|
+
if (y2 && T2 && E2 && _2.indexOf(D2) < 0 && !(F(v2) && Array.isArray(T2))) {
|
|
1316
|
+
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1317
|
+
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
1318
|
+
let e5 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, T2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
1319
|
+
return a2 ? (p2.res = e5, p2.usedParams = this.getUsedParamsDetails(i2), p2) : e5;
|
|
1320
|
+
}
|
|
1321
|
+
if (o2) {
|
|
1322
|
+
let e5 = Array.isArray(T2), t3 = e5 ? [] : {}, n3 = e5 ? g2 : h2;
|
|
1323
|
+
for (let e6 in T2) if (Object.prototype.hasOwnProperty.call(T2, e6)) {
|
|
1324
|
+
let r3 = `${n3}${o2}${e6}`;
|
|
1325
|
+
t3[e6] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue: _r(w2) ? w2[e6] : void 0, joinArrays: false, ns: c2 }) : this.translate(r3, { ...i2, joinArrays: false, ns: c2 }), t3[e6] === r3 && (t3[e6] = T2[e6]);
|
|
1326
|
+
}
|
|
1327
|
+
m2 = t3;
|
|
1328
|
+
}
|
|
1329
|
+
} else if (y2 && F(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
1330
|
+
else {
|
|
1331
|
+
let e5 = false, n3 = false;
|
|
1332
|
+
!this.isValidLookup(m2) && x2 && (e5 = true, m2 = w2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
1333
|
+
let a3 = (i2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n3 ? void 0 : m2, c3 = x2 && w2 !== m2 && this.options.updateMissing;
|
|
1334
|
+
if (n3 || e5 || c3) {
|
|
1335
|
+
if (this.logger.log(c3 ? `updateKey` : `missingKey`, d2, l2, s2, c3 ? w2 : m2), o2) {
|
|
1336
|
+
let e7 = this.resolve(s2, { ...i2, keySeparator: false });
|
|
1337
|
+
e7 && e7.res && this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`);
|
|
1338
|
+
}
|
|
1339
|
+
let e6 = [], t3 = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i2.lng || this.language);
|
|
1340
|
+
if (this.options.saveMissingTo === `fallback` && t3 && t3[0]) for (let n5 = 0; n5 < t3.length; n5++) e6.push(t3[n5]);
|
|
1341
|
+
else this.options.saveMissingTo === `all` ? e6 = this.languageUtils.toResolveHierarchy(i2.lng || this.language) : e6.push(i2.lng || this.language);
|
|
1342
|
+
let n4 = (e7, t4, n5) => {
|
|
1343
|
+
let r3 = x2 && n5 !== m2 ? n5 : a3;
|
|
1344
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(e7, l2, t4, r3, c3, i2) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e7, l2, t4, r3, c3, i2), this.emit(`missingKey`, e7, l2, t4, m2);
|
|
1345
|
+
};
|
|
1346
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && b2 ? e6.forEach((e7) => {
|
|
1347
|
+
let t4 = this.pluralResolver.getSuffixes(e7, i2);
|
|
1348
|
+
C2 && i2[`defaultValue${this.options.pluralSeparator}zero`] && t4.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t4.push(`${this.options.pluralSeparator}zero`), t4.forEach((t5) => {
|
|
1349
|
+
n4([e7], s2 + t5, i2[`defaultValue${t5}`] || w2);
|
|
1350
|
+
});
|
|
1351
|
+
}) : n4(e6, s2, w2));
|
|
1352
|
+
}
|
|
1353
|
+
m2 = this.extendTranslation(m2, t2, i2, p2, r2), n3 && m2 === s2 && this.options.appendNamespaceToMissingKey && (m2 = `${l2}${u2}${s2}`), (n3 || e5) && this.options.parseMissingKeyHandler && (m2 = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l2}${u2}${s2}` : s2, e5 ? m2 : void 0, i2));
|
|
1354
|
+
}
|
|
1355
|
+
return a2 ? (p2.res = m2, p2.usedParams = this.getUsedParamsDetails(i2), p2) : m2;
|
|
1356
|
+
}
|
|
1357
|
+
extendTranslation(e5, t2, n2, r2, i2) {
|
|
1358
|
+
if (this.i18nFormat?.parse) e5 = this.i18nFormat.parse(e5, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 });
|
|
1359
|
+
else if (!n2.skipInterpolation) {
|
|
1360
|
+
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
1361
|
+
let a3 = F(e5) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
1362
|
+
if (a3) {
|
|
1363
|
+
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1364
|
+
o3 = t3 && t3.length;
|
|
1365
|
+
}
|
|
1366
|
+
let s2 = n2.replace && !F(n2.replace) ? n2.replace : n2;
|
|
1367
|
+
if (this.options.interpolation.defaultVariables && (s2 = { ...this.options.interpolation.defaultVariables, ...s2 }), e5 = this.interpolator.interpolate(e5, s2, n2.lng || this.language || r2.usedLng, n2), a3) {
|
|
1368
|
+
let t3 = e5.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
1369
|
+
o3 < r3 && (n2.nest = false);
|
|
1370
|
+
}
|
|
1371
|
+
!n2.lng && r2 && r2.res && (n2.lng = this.language || r2.usedLng), n2.nest !== false && (e5 = this.interpolator.nest(e5, (...e6) => i2?.[0] === e6[0] && !n2.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e6[0]} in key: ${t2[0]}`), null) : this.translate(...e6, t2), n2)), n2.interpolation && this.interpolator.reset();
|
|
1372
|
+
}
|
|
1373
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = F(a2) ? [a2] : a2;
|
|
1374
|
+
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 = pr.handle(o2, e5, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e5;
|
|
1375
|
+
}
|
|
1376
|
+
resolve(e5, t2 = {}) {
|
|
1377
|
+
let n2, r2, i2, a2, o2;
|
|
1378
|
+
return F(e5) && (e5 = [e5]), Array.isArray(e5) && (e5 = e5.map((e6) => typeof e6 == `function` ? R(e6, { ...this.options, ...t2 }) : e6)), e5.forEach((e6) => {
|
|
1379
|
+
if (this.isValidLookup(n2)) return;
|
|
1380
|
+
let s2 = this.extractFromKey(e6, t2), c2 = s2.key;
|
|
1381
|
+
r2 = c2;
|
|
1382
|
+
let l2 = s2.namespaces;
|
|
1383
|
+
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1384
|
+
let u2 = t2.count !== void 0 && !F(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (F(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1385
|
+
l2.forEach((e7) => {
|
|
1386
|
+
this.isValidLookup(n2) || (o2 = e7, !gr[`${p2[0]}-${e7}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (gr[`${p2[0]}-${e7}`] = true, this.logger.warn(`key "${r2}" for languages "${p2.join(`, `)}" won't get resolved as namespace "${o2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)), p2.forEach((r3) => {
|
|
1387
|
+
if (this.isValidLookup(n2)) return;
|
|
1388
|
+
a2 = r3;
|
|
1389
|
+
let o3 = [c2];
|
|
1390
|
+
if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o3, c2, r3, e7, t2);
|
|
1391
|
+
else {
|
|
1392
|
+
let e8;
|
|
1393
|
+
u2 && (e8 = this.pluralResolver.getSuffix(r3, t2.count, t2));
|
|
1394
|
+
let n3 = `${this.options.pluralSeparator}zero`, i3 = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
1395
|
+
if (u2 && (t2.ordinal && e8.indexOf(i3) === 0 && o3.push(c2 + e8.replace(i3, this.options.pluralSeparator)), o3.push(c2 + e8), d2 && o3.push(c2 + n3)), f2) {
|
|
1396
|
+
let r4 = `${c2}${this.options.contextSeparator || `_`}${t2.context}`;
|
|
1397
|
+
o3.push(r4), u2 && (t2.ordinal && e8.indexOf(i3) === 0 && o3.push(r4 + e8.replace(i3, this.options.pluralSeparator)), o3.push(r4 + e8), d2 && o3.push(r4 + n3));
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
let s3;
|
|
1401
|
+
for (; s3 = o3.pop(); ) this.isValidLookup(n2) || (i2 = s3, n2 = this.getResource(r3, e7, s3, t2));
|
|
1402
|
+
}));
|
|
1403
|
+
});
|
|
1404
|
+
}), { res: n2, usedKey: r2, exactUsedKey: i2, usedLng: a2, usedNS: o2 };
|
|
1405
|
+
}
|
|
1406
|
+
isValidLookup(e5) {
|
|
1407
|
+
return e5 !== void 0 && !(!this.options.returnNull && e5 === null) && !(!this.options.returnEmptyString && e5 === ``);
|
|
1408
|
+
}
|
|
1409
|
+
getResource(e5, t2, n2, r2 = {}) {
|
|
1410
|
+
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e5, t2, n2, r2) : this.resourceStore.getResource(e5, t2, n2, r2);
|
|
1411
|
+
}
|
|
1412
|
+
getUsedParamsDetails(e5 = {}) {
|
|
1413
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e5.replace && !F(e5.replace), r2 = n2 ? e5.replace : e5;
|
|
1414
|
+
if (n2 && e5.count !== void 0 && (r2.count = e5.count), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
1415
|
+
r2 = { ...r2 };
|
|
1416
|
+
for (let e6 of t2) delete r2[e6];
|
|
1417
|
+
}
|
|
1418
|
+
return r2;
|
|
1419
|
+
}
|
|
1420
|
+
static hasDefaultValue(e5) {
|
|
1421
|
+
for (let t2 in e5) if (Object.prototype.hasOwnProperty.call(e5, t2) && t2.substring(0, 12) === `defaultValue` && e5[t2] !== void 0) return true;
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
var yr = class {
|
|
1426
|
+
constructor(e5) {
|
|
1427
|
+
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger = L.create(`languageUtils`);
|
|
1428
|
+
}
|
|
1429
|
+
getScriptPartFromCode(e5) {
|
|
1430
|
+
if (e5 = lr(e5), !e5 || e5.indexOf(`-`) < 0) return null;
|
|
1431
|
+
let t2 = e5.split(`-`);
|
|
1432
|
+
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
1433
|
+
}
|
|
1434
|
+
getLanguagePartFromCode(e5) {
|
|
1435
|
+
if (e5 = lr(e5), !e5 || e5.indexOf(`-`) < 0) return e5;
|
|
1436
|
+
let t2 = e5.split(`-`);
|
|
1437
|
+
return this.formatLanguageCode(t2[0]);
|
|
1438
|
+
}
|
|
1439
|
+
formatLanguageCode(e5) {
|
|
1440
|
+
if (F(e5) && e5.indexOf(`-`) > -1) {
|
|
1441
|
+
let t2;
|
|
1442
|
+
try {
|
|
1443
|
+
t2 = Intl.getCanonicalLocales(e5)[0];
|
|
1444
|
+
} catch {
|
|
1445
|
+
}
|
|
1446
|
+
return t2 && this.options.lowerCaseLng && (t2 = t2.toLowerCase()), t2 || (this.options.lowerCaseLng ? e5.toLowerCase() : e5);
|
|
1447
|
+
}
|
|
1448
|
+
return this.options.cleanCode || this.options.lowerCaseLng ? e5.toLowerCase() : e5;
|
|
1449
|
+
}
|
|
1450
|
+
isSupportedCode(e5) {
|
|
1451
|
+
return (this.options.load === `languageOnly` || this.options.nonExplicitSupportedLngs) && (e5 = this.getLanguagePartFromCode(e5)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e5) > -1;
|
|
1452
|
+
}
|
|
1453
|
+
getBestMatchFromCodes(e5) {
|
|
1454
|
+
if (!e5) return null;
|
|
1455
|
+
let t2;
|
|
1456
|
+
return e5.forEach((e6) => {
|
|
1457
|
+
if (t2) return;
|
|
1458
|
+
let n2 = this.formatLanguageCode(e6);
|
|
1459
|
+
(!this.options.supportedLngs || this.isSupportedCode(n2)) && (t2 = n2);
|
|
1460
|
+
}), !t2 && this.options.supportedLngs && e5.forEach((e6) => {
|
|
1461
|
+
if (t2) return;
|
|
1462
|
+
let n2 = this.getScriptPartFromCode(e6);
|
|
1463
|
+
if (this.isSupportedCode(n2)) return t2 = n2;
|
|
1464
|
+
let r2 = this.getLanguagePartFromCode(e6);
|
|
1465
|
+
if (this.isSupportedCode(r2)) return t2 = r2;
|
|
1466
|
+
t2 = this.options.supportedLngs.find((e7) => {
|
|
1467
|
+
if (e7 === r2 || !(e7.indexOf(`-`) < 0 && r2.indexOf(`-`) < 0) && (e7.indexOf(`-`) > 0 && r2.indexOf(`-`) < 0 && e7.substring(0, e7.indexOf(`-`)) === r2 || e7.indexOf(r2) === 0 && r2.length > 1)) return e7;
|
|
1468
|
+
});
|
|
1469
|
+
}), t2 ||= this.getFallbackCodes(this.options.fallbackLng)[0], t2;
|
|
1470
|
+
}
|
|
1471
|
+
getFallbackCodes(e5, t2) {
|
|
1472
|
+
if (!e5) return [];
|
|
1473
|
+
if (typeof e5 == `function` && (e5 = e5(t2)), F(e5) && (e5 = [e5]), Array.isArray(e5)) return e5;
|
|
1474
|
+
if (!t2) return e5.default || [];
|
|
1475
|
+
let n2 = e5[t2];
|
|
1476
|
+
return n2 ||= e5[this.getScriptPartFromCode(t2)], n2 ||= e5[this.formatLanguageCode(t2)], n2 ||= e5[this.getLanguagePartFromCode(t2)], n2 ||= e5.default, n2 || [];
|
|
1477
|
+
}
|
|
1478
|
+
toResolveHierarchy(e5, t2) {
|
|
1479
|
+
let n2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e5), r2 = [], i2 = (e6) => {
|
|
1480
|
+
e6 && (this.isSupportedCode(e6) ? r2.push(e6) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e6}`));
|
|
1481
|
+
};
|
|
1482
|
+
return F(e5) && (e5.indexOf(`-`) > -1 || e5.indexOf(`_`) > -1) ? (this.options.load !== `languageOnly` && i2(this.formatLanguageCode(e5)), this.options.load !== `languageOnly` && this.options.load !== `currentOnly` && i2(this.getScriptPartFromCode(e5)), this.options.load !== `currentOnly` && i2(this.getLanguagePartFromCode(e5))) : F(e5) && i2(this.formatLanguageCode(e5)), n2.forEach((e6) => {
|
|
1483
|
+
r2.indexOf(e6) < 0 && i2(this.formatLanguageCode(e6));
|
|
1484
|
+
}), r2;
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
var br = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
1488
|
+
var xr = { select: (e5) => e5 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1489
|
+
var Sr = class {
|
|
1490
|
+
constructor(e5, t2 = {}) {
|
|
1491
|
+
this.languageUtils = e5, this.options = t2, this.logger = L.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1492
|
+
}
|
|
1493
|
+
clearCache() {
|
|
1494
|
+
this.pluralRulesCache = {};
|
|
1495
|
+
}
|
|
1496
|
+
getRule(e5, t2 = {}) {
|
|
1497
|
+
let n2 = lr(e5 === `dev` ? `en` : e5), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
1498
|
+
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
1499
|
+
let a2;
|
|
1500
|
+
try {
|
|
1501
|
+
a2 = new Intl.PluralRules(n2, { type: r2 });
|
|
1502
|
+
} catch {
|
|
1503
|
+
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`), xr;
|
|
1504
|
+
if (!e5.match(/-|_/)) return xr;
|
|
1505
|
+
let n3 = this.languageUtils.getLanguagePartFromCode(e5);
|
|
1506
|
+
a2 = this.getRule(n3, t2);
|
|
1507
|
+
}
|
|
1508
|
+
return this.pluralRulesCache[i2] = a2, a2;
|
|
1509
|
+
}
|
|
1510
|
+
needsPlural(e5, t2 = {}) {
|
|
1511
|
+
let n2 = this.getRule(e5, t2);
|
|
1512
|
+
return n2 ||= this.getRule(`dev`, t2), n2?.resolvedOptions().pluralCategories.length > 1;
|
|
1513
|
+
}
|
|
1514
|
+
getPluralFormsOfKey(e5, t2, n2 = {}) {
|
|
1515
|
+
return this.getSuffixes(e5, n2).map((e6) => `${t2}${e6}`);
|
|
1516
|
+
}
|
|
1517
|
+
getSuffixes(e5, t2 = {}) {
|
|
1518
|
+
let n2 = this.getRule(e5, t2);
|
|
1519
|
+
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e6, t3) => br[e6] - br[t3]).map((e6) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ``}${e6}`) : [];
|
|
1520
|
+
}
|
|
1521
|
+
getSuffix(e5, t2, n2 = {}) {
|
|
1522
|
+
let r2 = this.getRule(e5, n2);
|
|
1523
|
+
return r2 ? `${this.options.prepend}${n2.ordinal ? `ordinal${this.options.prepend}` : ``}${r2.select(t2)}` : (this.logger.warn(`no plural rule found for: ${e5}`), this.getSuffix(`dev`, t2, n2));
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
var Cr = (e5, t2, n2, r2 = `.`, i2 = true) => {
|
|
1527
|
+
let a2 = er(e5, t2, n2);
|
|
1528
|
+
return !a2 && i2 && F(n2) && (a2 = cr(e5, n2, r2), a2 === void 0 && (a2 = cr(t2, n2, r2))), a2;
|
|
1529
|
+
};
|
|
1530
|
+
var wr = (e5) => e5.replace(/\$/g, `$$$$`);
|
|
1531
|
+
var Tr = class {
|
|
1532
|
+
constructor(e5 = {}) {
|
|
1533
|
+
this.logger = L.create(`interpolator`), this.options = e5, this.format = e5?.interpolation?.format || ((e6) => e6), this.init(e5);
|
|
1534
|
+
}
|
|
1535
|
+
init(e5 = {}) {
|
|
1536
|
+
e5.interpolation ||= { escapeValue: true };
|
|
1537
|
+
let { escape: t2, escapeValue: n2, useRawValueToEscape: r2, prefix: i2, prefixEscaped: a2, suffix: o2, suffixEscaped: s2, formatSeparator: c2, unescapeSuffix: l2, unescapePrefix: u2, nestingPrefix: d2, nestingPrefixEscaped: f2, nestingSuffix: p2, nestingSuffixEscaped: m2, nestingOptionsSeparator: h2, maxReplaces: g2, alwaysFormat: _2 } = e5.interpolation;
|
|
1538
|
+
this.escape = t2 === void 0 ? rr : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? I(i2) : a2 || `{{`, this.suffix = o2 ? I(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 || `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 || ``, this.nestingPrefix = d2 ? I(d2) : f2 || I(`$t(`), this.nestingSuffix = p2 ? I(p2) : m2 || I(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1539
|
+
}
|
|
1540
|
+
reset() {
|
|
1541
|
+
this.options && this.init(this.options);
|
|
1542
|
+
}
|
|
1543
|
+
resetRegExp() {
|
|
1544
|
+
let e5 = (e6, t2) => e6?.source === t2 ? (e6.lastIndex = 0, e6) : new RegExp(t2, `g`);
|
|
1545
|
+
this.regexp = e5(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e5(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e5(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
|
|
1546
|
+
}
|
|
1547
|
+
interpolate(e5, t2, n2, r2) {
|
|
1548
|
+
let i2, a2, o2, s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c2 = (e6) => {
|
|
1549
|
+
if (e6.indexOf(this.formatSeparator) < 0) {
|
|
1550
|
+
let i4 = Cr(t2, s2, e6, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1551
|
+
return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e6 }) : i4;
|
|
1552
|
+
}
|
|
1553
|
+
let i3 = e6.split(this.formatSeparator), a3 = i3.shift().trim(), o3 = i3.join(this.formatSeparator).trim();
|
|
1554
|
+
return this.format(Cr(t2, s2, a3, this.options.keySeparator, this.options.ignoreJSONStructure), o3, n2, { ...r2, ...t2, interpolationkey: a3 });
|
|
1555
|
+
};
|
|
1556
|
+
this.resetRegExp();
|
|
1557
|
+
let l2 = r2?.missingInterpolationHandler || this.options.missingInterpolationHandler, u2 = r2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r2.interpolation.skipOnVariables;
|
|
1558
|
+
return [{ regex: this.regexpUnescape, safeValue: (e6) => wr(e6) }, { regex: this.regexp, safeValue: (e6) => this.escapeValue ? wr(this.escape(e6)) : wr(e6) }].forEach((t3) => {
|
|
1559
|
+
for (o2 = 0; i2 = t3.regex.exec(e5); ) {
|
|
1560
|
+
let n3 = i2[1].trim();
|
|
1561
|
+
if (a2 = c2(n3), a2 === void 0) {
|
|
1562
|
+
if (typeof l2 == `function`) {
|
|
1563
|
+
let t4 = l2(e5, i2, r2);
|
|
1564
|
+
a2 = F(t4) ? t4 : ``;
|
|
1565
|
+
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
1566
|
+
else if (u2) {
|
|
1567
|
+
a2 = i2[0];
|
|
1568
|
+
continue;
|
|
1569
|
+
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e5}`), a2 = ``;
|
|
1570
|
+
} else !F(a2) && !this.useRawValueToEscape && (a2 = Gn(a2));
|
|
1571
|
+
let s3 = t3.safeValue(a2);
|
|
1572
|
+
if (e5 = e5.replace(i2[0], s3), u2 ? (t3.regex.lastIndex += a2.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1573
|
+
}
|
|
1574
|
+
}), e5;
|
|
1575
|
+
}
|
|
1576
|
+
nest(e5, t2, n2 = {}) {
|
|
1577
|
+
let r2, i2, a2, o2 = (e6, t3) => {
|
|
1578
|
+
let n3 = this.nestingOptionsSeparator;
|
|
1579
|
+
if (e6.indexOf(n3) < 0) return e6;
|
|
1580
|
+
let r3 = e6.split(RegExp(`${I(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
1581
|
+
e6 = r3[0], i3 = this.interpolate(i3, a2);
|
|
1582
|
+
let o3 = i3.match(/'/g), s2 = i3.match(/"/g);
|
|
1583
|
+
((o3?.length ?? 0) % 2 == 0 && !s2 || (s2?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
1584
|
+
try {
|
|
1585
|
+
a2 = JSON.parse(i3), t3 && (a2 = { ...t3, ...a2 });
|
|
1586
|
+
} catch (t4) {
|
|
1587
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${e6}`, t4), `${e6}${n3}${i3}`;
|
|
1588
|
+
}
|
|
1589
|
+
return a2.defaultValue && a2.defaultValue.indexOf(this.prefix) > -1 && delete a2.defaultValue, e6;
|
|
1590
|
+
};
|
|
1591
|
+
for (; r2 = this.nestingRegexp.exec(e5); ) {
|
|
1592
|
+
let s2 = [];
|
|
1593
|
+
a2 = { ...n2 }, a2 = a2.replace && !F(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1594
|
+
let c2 = /{.*}/.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1595
|
+
if (c2 !== -1 && (s2 = r2[1].slice(c2).split(this.formatSeparator).map((e6) => e6.trim()).filter(Boolean), r2[1] = r2[1].slice(0, c2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e5 && !F(i2)) return i2;
|
|
1596
|
+
F(i2) || (i2 = Gn(i2)), i2 ||= (this.logger.warn(`missed to resolve ${r2[1]} for nesting ${e5}`), ``), s2.length && (i2 = s2.reduce((e6, t3) => this.format(e6, t3, n2.lng, { ...n2, interpolationkey: r2[1].trim() }), i2.trim())), e5 = e5.replace(r2[0], i2), this.regexp.lastIndex = 0;
|
|
1597
|
+
}
|
|
1598
|
+
return e5;
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
var Er = (e5) => {
|
|
1602
|
+
let t2 = e5.toLowerCase().trim(), n2 = {};
|
|
1603
|
+
if (e5.indexOf(`(`) > -1) {
|
|
1604
|
+
let r2 = e5.split(`(`);
|
|
1605
|
+
t2 = r2[0].toLowerCase().trim();
|
|
1606
|
+
let i2 = r2[1].substring(0, r2[1].length - 1);
|
|
1607
|
+
t2 === `currency` && i2.indexOf(`:`) < 0 ? n2.currency ||= i2.trim() : t2 === `relativetime` && i2.indexOf(`:`) < 0 ? n2.range ||= i2.trim() : i2.split(`;`).forEach((e6) => {
|
|
1608
|
+
if (e6) {
|
|
1609
|
+
let [t3, ...r3] = e6.split(`:`), i3 = r3.join(`:`).trim().replace(/^'+|'+$/g, ``), a2 = t3.trim();
|
|
1610
|
+
n2[a2] || (n2[a2] = i3), i3 === `false` && (n2[a2] = false), i3 === `true` && (n2[a2] = true), isNaN(i3) || (n2[a2] = parseInt(i3, 10));
|
|
1611
|
+
}
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
return { formatName: t2, formatOptions: n2 };
|
|
1615
|
+
};
|
|
1616
|
+
var Dr = (e5) => {
|
|
1617
|
+
let t2 = {};
|
|
1618
|
+
return (n2, r2, i2) => {
|
|
1619
|
+
let a2 = i2;
|
|
1620
|
+
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
1621
|
+
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
1622
|
+
return s2 || (s2 = e5(lr(r2), i2), t2[o2] = s2), s2(n2);
|
|
1623
|
+
};
|
|
1624
|
+
};
|
|
1625
|
+
var Or = (e5) => (t2, n2, r2) => e5(lr(n2), r2)(t2);
|
|
1626
|
+
var kr = class {
|
|
1627
|
+
constructor(e5 = {}) {
|
|
1628
|
+
this.logger = L.create(`formatter`), this.options = e5, this.init(e5);
|
|
1629
|
+
}
|
|
1630
|
+
init(e5, t2 = { interpolation: {} }) {
|
|
1631
|
+
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
1632
|
+
let n2 = t2.cacheInBuiltFormats ? Dr : Or;
|
|
1633
|
+
this.formats = { number: n2((e6, t3) => {
|
|
1634
|
+
let n3 = new Intl.NumberFormat(e6, { ...t3 });
|
|
1635
|
+
return (e7) => n3.format(e7);
|
|
1636
|
+
}), currency: n2((e6, t3) => {
|
|
1637
|
+
let n3 = new Intl.NumberFormat(e6, { ...t3, style: `currency` });
|
|
1638
|
+
return (e7) => n3.format(e7);
|
|
1639
|
+
}), datetime: n2((e6, t3) => {
|
|
1640
|
+
let n3 = new Intl.DateTimeFormat(e6, { ...t3 });
|
|
1641
|
+
return (e7) => n3.format(e7);
|
|
1642
|
+
}), relativetime: n2((e6, t3) => {
|
|
1643
|
+
let n3 = new Intl.RelativeTimeFormat(e6, { ...t3 });
|
|
1644
|
+
return (e7) => n3.format(e7, t3.range || `day`);
|
|
1645
|
+
}), list: n2((e6, t3) => {
|
|
1646
|
+
let n3 = new Intl.ListFormat(e6, { ...t3 });
|
|
1647
|
+
return (e7) => n3.format(e7);
|
|
1648
|
+
}) };
|
|
1649
|
+
}
|
|
1650
|
+
add(e5, t2) {
|
|
1651
|
+
this.formats[e5.toLowerCase().trim()] = t2;
|
|
1652
|
+
}
|
|
1653
|
+
addCached(e5, t2) {
|
|
1654
|
+
this.formats[e5.toLowerCase().trim()] = Dr(t2);
|
|
1655
|
+
}
|
|
1656
|
+
format(e5, t2, n2, r2 = {}) {
|
|
1657
|
+
let i2 = t2.split(this.formatSeparator);
|
|
1658
|
+
if (i2.length > 1 && i2[0].indexOf(`(`) > 1 && i2[0].indexOf(`)`) < 0 && i2.find((e6) => e6.indexOf(`)`) > -1)) {
|
|
1659
|
+
let e6 = i2.findIndex((e7) => e7.indexOf(`)`) > -1);
|
|
1660
|
+
i2[0] = [i2[0], ...i2.splice(1, e6)].join(this.formatSeparator);
|
|
1661
|
+
}
|
|
1662
|
+
return i2.reduce((e6, t3) => {
|
|
1663
|
+
let { formatName: i3, formatOptions: a2 } = Er(t3);
|
|
1664
|
+
if (this.formats[i3]) {
|
|
1665
|
+
let t4 = e6;
|
|
1666
|
+
try {
|
|
1667
|
+
let o2 = r2?.formatParams?.[r2.interpolationkey] || {}, s2 = o2.locale || o2.lng || r2.locale || r2.lng || n2;
|
|
1668
|
+
t4 = this.formats[i3](e6, s2, { ...a2, ...r2, ...o2 });
|
|
1669
|
+
} catch (e7) {
|
|
1670
|
+
this.logger.warn(e7);
|
|
1671
|
+
}
|
|
1672
|
+
return t4;
|
|
1673
|
+
}
|
|
1674
|
+
return this.logger.warn(`there was no format function for ${i3}`), e6;
|
|
1675
|
+
}, e5);
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
var Ar = (e5, t2) => {
|
|
1679
|
+
e5.pending[t2] !== void 0 && (delete e5.pending[t2], e5.pendingCount--);
|
|
1680
|
+
};
|
|
1681
|
+
var jr = class extends dr {
|
|
1682
|
+
constructor(e5, t2, n2, r2 = {}) {
|
|
1683
|
+
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = L.create(`backendConnector`), this.waitingReads = [], this.maxParallelReads = r2.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r2.maxRetries >= 0 ? r2.maxRetries : 5, this.retryTimeout = r2.retryTimeout >= 1 ? r2.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n2, r2.backend, r2);
|
|
1684
|
+
}
|
|
1685
|
+
queueLoad(e5, t2, n2, r2) {
|
|
1686
|
+
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
1687
|
+
return e5.forEach((e6) => {
|
|
1688
|
+
let r3 = true;
|
|
1689
|
+
t2.forEach((t3) => {
|
|
1690
|
+
let o3 = `${e6}|${t3}`;
|
|
1691
|
+
!n2.reload && this.store.hasResourceBundle(e6, t3) ? this.state[o3] = 2 : this.state[o3] < 0 || (this.state[o3] === 1 ? a2[o3] === void 0 && (a2[o3] = true) : (this.state[o3] = 1, r3 = false, a2[o3] === void 0 && (a2[o3] = true), i2[o3] === void 0 && (i2[o3] = true), s2[t3] === void 0 && (s2[t3] = true)));
|
|
1692
|
+
}), r3 || (o2[e6] = true);
|
|
1693
|
+
}), (Object.keys(i2).length || Object.keys(a2).length) && this.queue.push({ pending: a2, pendingCount: Object.keys(a2).length, loaded: {}, errors: [], callback: r2 }), { toLoad: Object.keys(i2), pending: Object.keys(a2), toLoadLanguages: Object.keys(o2), toLoadNamespaces: Object.keys(s2) };
|
|
1694
|
+
}
|
|
1695
|
+
loaded(e5, t2, n2) {
|
|
1696
|
+
let r2 = e5.split(`|`), i2 = r2[0], a2 = r2[1];
|
|
1697
|
+
t2 && this.emit(`failedLoading`, i2, a2, t2), !t2 && n2 && this.store.addResourceBundle(i2, a2, n2, void 0, void 0, { skipCopy: true }), this.state[e5] = t2 ? -1 : 2, t2 && n2 && (this.state[e5] = 0);
|
|
1698
|
+
let o2 = {};
|
|
1699
|
+
this.queue.forEach((n3) => {
|
|
1700
|
+
Qn(n3.loaded, [i2], a2), Ar(n3, e5), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e6) => {
|
|
1701
|
+
o2[e6] || (o2[e6] = {});
|
|
1702
|
+
let t3 = n3.loaded[e6];
|
|
1703
|
+
t3.length && t3.forEach((t4) => {
|
|
1704
|
+
o2[e6][t4] === void 0 && (o2[e6][t4] = true);
|
|
1705
|
+
});
|
|
1706
|
+
}), n3.done = true, n3.errors.length ? n3.callback(n3.errors) : n3.callback());
|
|
1707
|
+
}), this.emit(`loaded`, o2), this.queue = this.queue.filter((e6) => !e6.done);
|
|
1708
|
+
}
|
|
1709
|
+
read(e5, t2, n2, r2 = 0, i2 = this.retryTimeout, a2) {
|
|
1710
|
+
if (!e5.length) return a2(null, {});
|
|
1711
|
+
if (this.readingCalls >= this.maxParallelReads) {
|
|
1712
|
+
this.waitingReads.push({ lng: e5, ns: t2, fcName: n2, tried: r2, wait: i2, callback: a2 });
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
this.readingCalls++;
|
|
1716
|
+
let o2 = (o3, s3) => {
|
|
1717
|
+
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
1718
|
+
let e6 = this.waitingReads.shift();
|
|
1719
|
+
this.read(e6.lng, e6.ns, e6.fcName, e6.tried, e6.wait, e6.callback);
|
|
1720
|
+
}
|
|
1721
|
+
if (o3 && s3 && r2 < this.maxRetries) {
|
|
1722
|
+
setTimeout(() => {
|
|
1723
|
+
this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
|
|
1724
|
+
}, i2);
|
|
1725
|
+
return;
|
|
1726
|
+
}
|
|
1727
|
+
a2(o3, s3);
|
|
1728
|
+
}, s2 = this.backend[n2].bind(this.backend);
|
|
1729
|
+
if (s2.length === 2) {
|
|
1730
|
+
try {
|
|
1731
|
+
let n3 = s2(e5, t2);
|
|
1732
|
+
n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
|
|
1733
|
+
} catch (e6) {
|
|
1734
|
+
o2(e6);
|
|
1735
|
+
}
|
|
1736
|
+
return;
|
|
1737
|
+
}
|
|
1738
|
+
return s2(e5, t2, o2);
|
|
1739
|
+
}
|
|
1740
|
+
prepareLoading(e5, t2, n2 = {}, r2) {
|
|
1741
|
+
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
1742
|
+
F(e5) && (e5 = this.languageUtils.toResolveHierarchy(e5)), F(t2) && (t2 = [t2]);
|
|
1743
|
+
let i2 = this.queueLoad(e5, t2, n2, r2);
|
|
1744
|
+
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
1745
|
+
i2.toLoad.forEach((e6) => {
|
|
1746
|
+
this.loadOne(e6);
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
load(e5, t2, n2) {
|
|
1750
|
+
this.prepareLoading(e5, t2, {}, n2);
|
|
1751
|
+
}
|
|
1752
|
+
reload(e5, t2, n2) {
|
|
1753
|
+
this.prepareLoading(e5, t2, { reload: true }, n2);
|
|
1754
|
+
}
|
|
1755
|
+
loadOne(e5, t2 = ``) {
|
|
1756
|
+
let n2 = e5.split(`|`), r2 = n2[0], i2 = n2[1];
|
|
1757
|
+
this.read(r2, i2, `read`, void 0, void 0, (n3, a2) => {
|
|
1758
|
+
n3 && this.logger.warn(`${t2}loading namespace ${i2} for language ${r2} failed`, n3), !n3 && a2 && this.logger.log(`${t2}loaded namespace ${i2} for language ${r2}`, a2), this.loaded(e5, n3, a2);
|
|
1759
|
+
});
|
|
1760
|
+
}
|
|
1761
|
+
saveMissing(e5, t2, n2, r2, i2, a2 = {}, o2 = () => {
|
|
1762
|
+
}) {
|
|
1763
|
+
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) {
|
|
1764
|
+
this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
if (n2 != null && n2 !== ``) {
|
|
1768
|
+
if (this.backend?.create) {
|
|
1769
|
+
let s2 = { ...a2, isUpdate: i2 }, c2 = this.backend.create.bind(this.backend);
|
|
1770
|
+
if (c2.length < 6) try {
|
|
1771
|
+
let i3;
|
|
1772
|
+
i3 = c2.length === 5 ? c2(e5, t2, n2, r2, s2) : c2(e5, t2, n2, r2), i3 && typeof i3.then == `function` ? i3.then((e6) => o2(null, e6)).catch(o2) : o2(null, i3);
|
|
1773
|
+
} catch (e6) {
|
|
1774
|
+
o2(e6);
|
|
1775
|
+
}
|
|
1776
|
+
else c2(e5, t2, n2, r2, o2, s2);
|
|
1777
|
+
}
|
|
1778
|
+
e5 && e5[0] && this.store.addResource(e5[0], t2, n2, r2);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1782
|
+
var Mr = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS: [`translation`], fallbackLng: [`dev`], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: `all`, preload: false, simplifyPluralSuffix: true, keySeparator: `.`, nsSeparator: `:`, pluralSeparator: `_`, contextSeparator: `_`, partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: `fallback`, saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: false, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: (e5) => {
|
|
1783
|
+
let t2 = {};
|
|
1784
|
+
if (typeof e5[1] == `object` && (t2 = e5[1]), F(e5[1]) && (t2.defaultValue = e5[1]), F(e5[2]) && (t2.tDescription = e5[2]), typeof e5[2] == `object` || typeof e5[3] == `object`) {
|
|
1785
|
+
let n2 = e5[3] || e5[2];
|
|
1786
|
+
Object.keys(n2).forEach((e6) => {
|
|
1787
|
+
t2[e6] = n2[e6];
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
return t2;
|
|
1791
|
+
}, interpolation: { escapeValue: true, format: (e5) => e5, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1792
|
+
var Nr = (e5) => (F(e5.ns) && (e5.ns = [e5.ns]), F(e5.fallbackLng) && (e5.fallbackLng = [e5.fallbackLng]), F(e5.fallbackNS) && (e5.fallbackNS = [e5.fallbackNS]), e5.supportedLngs?.indexOf?.(`cimode`) < 0 && (e5.supportedLngs = e5.supportedLngs.concat([`cimode`])), typeof e5.initImmediate == `boolean` && (e5.initAsync = e5.initImmediate), e5);
|
|
1793
|
+
var Pr = () => {
|
|
946
1794
|
};
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1795
|
+
var Fr = (e5) => {
|
|
1796
|
+
Object.getOwnPropertyNames(Object.getPrototypeOf(e5)).forEach((t2) => {
|
|
1797
|
+
typeof e5[t2] == `function` && (e5[t2] = e5[t2].bind(e5));
|
|
1798
|
+
});
|
|
1799
|
+
};
|
|
1800
|
+
var Ir = `__i18next_supportNoticeShown`;
|
|
1801
|
+
var Lr = () => !!(typeof globalThis < `u` && globalThis[Ir] || typeof process < `u` && {}.I18NEXT_NO_SUPPORT_NOTICE || typeof process < `u`);
|
|
1802
|
+
var Rr = () => {
|
|
1803
|
+
typeof globalThis < `u` && (globalThis[Ir] = true);
|
|
1804
|
+
};
|
|
1805
|
+
var zr = (e5) => !!(e5?.modules?.backend?.name?.indexOf(`Locize`) > 0 || e5?.modules?.backend?.constructor?.name?.indexOf(`Locize`) > 0 || e5?.options?.backend?.backends && e5.options.backend.backends.some((e6) => e6?.name?.indexOf(`Locize`) > 0 || e6?.constructor?.name?.indexOf(`Locize`) > 0) || e5?.options?.backend?.projectId || e5?.options?.backend?.backendOptions && e5.options.backend.backendOptions.some((e6) => e6?.projectId));
|
|
1806
|
+
var z = class e4 extends dr {
|
|
1807
|
+
constructor(e5 = {}, t2) {
|
|
1808
|
+
if (super(), this.options = Nr(e5), this.services = {}, this.logger = L, this.modules = { external: [] }, Fr(this), t2 && !this.isInitialized && !e5.isClone) {
|
|
1809
|
+
if (!this.options.initAsync) return this.init(e5, t2), this;
|
|
1810
|
+
setTimeout(() => {
|
|
1811
|
+
this.init(e5, t2);
|
|
1812
|
+
}, 0);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
init(e5 = {}, t2) {
|
|
1816
|
+
this.isInitializing = true, typeof e5 == `function` && (t2 = e5, e5 = {}), e5.defaultNS == null && e5.ns && (F(e5.ns) ? e5.defaultNS = e5.ns : e5.ns.indexOf(`translation`) < 0 && (e5.defaultNS = e5.ns[0]));
|
|
1817
|
+
let n2 = Mr();
|
|
1818
|
+
this.options = { ...n2, ...this.options, ...Nr(e5) }, this.options.interpolation = { ...n2.interpolation, ...this.options.interpolation }, e5.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e5.keySeparator), e5.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e5.nsSeparator), typeof this.options.overloadTranslationOptionHandler != `function` && (this.options.overloadTranslationOptionHandler = n2.overloadTranslationOptionHandler), this.options.showSupportNotice !== false && !zr(this) && !Lr() && (typeof console < `u` && console.info !== void 0 && console.info(`\u{1F310} i18next is made possible by our own product, Locize \u2014 consider powering your project with managed localization (AI, CDN, integrations): https://locize.com \u{1F499}`), Rr());
|
|
1819
|
+
let r2 = (e6) => e6 ? typeof e6 == `function` ? new e6() : e6 : null;
|
|
1820
|
+
if (!this.options.isClone) {
|
|
1821
|
+
this.modules.logger ? L.init(r2(this.modules.logger), this.options) : L.init(null, this.options);
|
|
1822
|
+
let e6;
|
|
1823
|
+
e6 = this.modules.formatter ? this.modules.formatter : kr;
|
|
1824
|
+
let t3 = new yr(this.options);
|
|
1825
|
+
this.store = new fr(this.options.resources, this.options);
|
|
1826
|
+
let i3 = this.services;
|
|
1827
|
+
i3.logger = L, i3.resourceStore = this.store, i3.languageUtils = t3, i3.pluralResolver = new Sr(t3, { prepend: this.options.pluralSeparator, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), this.options.interpolation.format && this.options.interpolation.format !== n2.interpolation.format && this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`), e6 && (!this.options.interpolation.format || this.options.interpolation.format === n2.interpolation.format) && (i3.formatter = r2(e6), i3.formatter.init && i3.formatter.init(i3, this.options), this.options.interpolation.format = i3.formatter.format.bind(i3.formatter)), i3.interpolator = new Tr(this.options), i3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i3.backendConnector = new jr(r2(this.modules.backend), i3.resourceStore, i3, this.options), i3.backendConnector.on(`*`, (e7, ...t4) => {
|
|
1828
|
+
this.emit(e7, ...t4);
|
|
1829
|
+
}), this.modules.languageDetector && (i3.languageDetector = r2(this.modules.languageDetector), i3.languageDetector.init && i3.languageDetector.init(i3, this.options.detection, this.options)), this.modules.i18nFormat && (i3.i18nFormat = r2(this.modules.i18nFormat), i3.i18nFormat.init && i3.i18nFormat.init(this)), this.translator = new vr(this.services, this.options), this.translator.on(`*`, (e7, ...t4) => {
|
|
1830
|
+
this.emit(e7, ...t4);
|
|
1831
|
+
}), this.modules.external.forEach((e7) => {
|
|
1832
|
+
e7.init && e7.init(this);
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1835
|
+
if (this.format = this.options.interpolation.format, t2 ||= Pr, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1836
|
+
let e6 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1837
|
+
e6.length > 0 && e6[0] !== `dev` && (this.options.lng = e6[0]);
|
|
1838
|
+
}
|
|
1839
|
+
!this.services.languageDetector && !this.options.lng && this.logger.warn(`init: no languageDetector is used and no lng is defined`), [`getResource`, `hasResourceBundle`, `getResourceBundle`, `getDataByLanguage`].forEach((e6) => {
|
|
1840
|
+
this[e6] = (...t3) => this.store[e6](...t3);
|
|
1841
|
+
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e6) => {
|
|
1842
|
+
this[e6] = (...t3) => (this.store[e6](...t3), this);
|
|
1843
|
+
});
|
|
1844
|
+
let i2 = Wn(), a2 = () => {
|
|
1845
|
+
let e6 = (e7, n3) => {
|
|
1846
|
+
this.isInitializing = false, this.isInitialized && !this.initializedStoreOnce && this.logger.warn(`init: i18next is already initialized. You should call init just once!`), this.isInitialized = true, this.options.isClone || this.logger.log(`initialized`, this.options), this.emit(`initialized`, this.options), i2.resolve(n3), t2(e7, n3);
|
|
1847
|
+
};
|
|
1848
|
+
if (this.languages && !this.isInitialized) return e6(null, this.t.bind(this));
|
|
1849
|
+
this.changeLanguage(this.options.lng, e6);
|
|
1850
|
+
};
|
|
1851
|
+
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
1852
|
+
}
|
|
1853
|
+
loadResources(e5, t2 = Pr) {
|
|
1854
|
+
let n2 = t2, r2 = F(e5) ? e5 : this.language;
|
|
1855
|
+
if (typeof e5 == `function` && (n2 = e5), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1856
|
+
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
1857
|
+
let e6 = [], t3 = (t4) => {
|
|
1858
|
+
t4 && t4 !== `cimode` && this.services.languageUtils.toResolveHierarchy(t4).forEach((t5) => {
|
|
1859
|
+
t5 !== `cimode` && e6.indexOf(t5) < 0 && e6.push(t5);
|
|
1860
|
+
});
|
|
1861
|
+
};
|
|
1862
|
+
r2 ? t3(r2) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e7) => t3(e7)), this.options.preload?.forEach?.((e7) => t3(e7)), this.services.backendConnector.load(e6, this.options.ns, (e7) => {
|
|
1863
|
+
!e7 && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n2(e7);
|
|
1864
|
+
});
|
|
1865
|
+
} else n2(null);
|
|
1866
|
+
}
|
|
1867
|
+
reloadResources(e5, t2, n2) {
|
|
1868
|
+
let r2 = Wn();
|
|
1869
|
+
return typeof e5 == `function` && (n2 = e5, e5 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e5 ||= this.languages, t2 ||= this.options.ns, n2 ||= Pr, this.services.backendConnector.reload(e5, t2, (e6) => {
|
|
1870
|
+
r2.resolve(), n2(e6);
|
|
1871
|
+
}), r2;
|
|
1872
|
+
}
|
|
1873
|
+
use(e5) {
|
|
1874
|
+
if (!e5) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
1875
|
+
if (!e5.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
1876
|
+
return e5.type === `backend` && (this.modules.backend = e5), (e5.type === `logger` || e5.log && e5.warn && e5.error) && (this.modules.logger = e5), e5.type === `languageDetector` && (this.modules.languageDetector = e5), e5.type === `i18nFormat` && (this.modules.i18nFormat = e5), e5.type === `postProcessor` && pr.addPostProcessor(e5), e5.type === `formatter` && (this.modules.formatter = e5), e5.type === `3rdParty` && this.modules.external.push(e5), this;
|
|
1877
|
+
}
|
|
1878
|
+
setResolvedLanguage(e5) {
|
|
1879
|
+
if (e5 && this.languages && !([`cimode`, `dev`].indexOf(e5) > -1)) {
|
|
1880
|
+
for (let e6 = 0; e6 < this.languages.length; e6++) {
|
|
1881
|
+
let t2 = this.languages[e6];
|
|
1882
|
+
if (!([`cimode`, `dev`].indexOf(t2) > -1) && this.store.hasLanguageSomeTranslations(t2)) {
|
|
1883
|
+
this.resolvedLanguage = t2;
|
|
1884
|
+
break;
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
!this.resolvedLanguage && this.languages.indexOf(e5) < 0 && this.store.hasLanguageSomeTranslations(e5) && (this.resolvedLanguage = e5, this.languages.unshift(e5));
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
changeLanguage(e5, t2) {
|
|
1891
|
+
this.isLanguageChangingTo = e5;
|
|
1892
|
+
let n2 = Wn();
|
|
1893
|
+
this.emit(`languageChanging`, e5);
|
|
1894
|
+
let r2 = (e6) => {
|
|
1895
|
+
this.language = e6, this.languages = this.services.languageUtils.toResolveHierarchy(e6), this.resolvedLanguage = void 0, this.setResolvedLanguage(e6);
|
|
1896
|
+
}, i2 = (i3, a3) => {
|
|
1897
|
+
a3 ? this.isLanguageChangingTo === e5 && (r2(a3), this.translator.changeLanguage(a3), this.isLanguageChangingTo = void 0, this.emit(`languageChanged`, a3), this.logger.log(`languageChanged`, a3)) : this.isLanguageChangingTo = void 0, n2.resolve((...e6) => this.t(...e6)), t2 && t2(i3, (...e6) => this.t(...e6));
|
|
1898
|
+
}, a2 = (t3) => {
|
|
1899
|
+
!e5 && !t3 && this.services.languageDetector && (t3 = []);
|
|
1900
|
+
let n3 = F(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(F(t3) ? [t3] : t3);
|
|
1901
|
+
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e6) => {
|
|
1902
|
+
i2(e6, a3);
|
|
1903
|
+
});
|
|
1904
|
+
};
|
|
1905
|
+
return !e5 && this.services.languageDetector && !this.services.languageDetector.async ? a2(this.services.languageDetector.detect()) : !e5 && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a2) : this.services.languageDetector.detect(a2) : a2(e5), n2;
|
|
1906
|
+
}
|
|
1907
|
+
getFixedT(e5, t2, n2) {
|
|
1908
|
+
let r2 = (e6, t3, ...i2) => {
|
|
1909
|
+
let a2;
|
|
1910
|
+
a2 = typeof t3 == `object` ? { ...t3 } : this.options.overloadTranslationOptionHandler([e6, t3].concat(i2)), a2.lng = a2.lng || r2.lng, a2.lngs = a2.lngs || r2.lngs, a2.ns = a2.ns || r2.ns, a2.keyPrefix !== `` && (a2.keyPrefix = a2.keyPrefix || n2 || r2.keyPrefix);
|
|
1911
|
+
let o2 = { ...this.options, ...a2 };
|
|
1912
|
+
typeof a2.keyPrefix == `function` && (a2.keyPrefix = R(a2.keyPrefix, o2));
|
|
1913
|
+
let s2 = this.options.keySeparator || `.`, c2;
|
|
1914
|
+
return a2.keyPrefix && Array.isArray(e6) ? c2 = e6.map((e7) => (typeof e7 == `function` && (e7 = R(e7, o2)), `${a2.keyPrefix}${s2}${e7}`)) : (typeof e6 == `function` && (e6 = R(e6, o2)), c2 = a2.keyPrefix ? `${a2.keyPrefix}${s2}${e6}` : e6), this.t(c2, a2);
|
|
1915
|
+
};
|
|
1916
|
+
return F(e5) ? r2.lng = e5 : r2.lngs = e5, r2.ns = t2, r2.keyPrefix = n2, r2;
|
|
1917
|
+
}
|
|
1918
|
+
t(...e5) {
|
|
1919
|
+
return this.translator?.translate(...e5);
|
|
1920
|
+
}
|
|
1921
|
+
exists(...e5) {
|
|
1922
|
+
return this.translator?.exists(...e5);
|
|
1923
|
+
}
|
|
1924
|
+
setDefaultNamespace(e5) {
|
|
1925
|
+
this.options.defaultNS = e5;
|
|
1926
|
+
}
|
|
1927
|
+
hasLoadedNamespace(e5, t2 = {}) {
|
|
1928
|
+
if (!this.isInitialized) return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`, this.languages), false;
|
|
1929
|
+
if (!this.languages || !this.languages.length) return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`, this.languages), false;
|
|
1930
|
+
let n2 = t2.lng || this.resolvedLanguage || this.languages[0], r2 = this.options ? this.options.fallbackLng : false, i2 = this.languages[this.languages.length - 1];
|
|
1931
|
+
if (n2.toLowerCase() === `cimode`) return true;
|
|
1932
|
+
let a2 = (e6, t3) => {
|
|
1933
|
+
let n3 = this.services.backendConnector.state[`${e6}|${t3}`];
|
|
1934
|
+
return n3 === -1 || n3 === 0 || n3 === 2;
|
|
1935
|
+
};
|
|
1936
|
+
if (t2.precheck) {
|
|
1937
|
+
let e6 = t2.precheck(this, a2);
|
|
1938
|
+
if (e6 !== void 0) return e6;
|
|
1939
|
+
}
|
|
1940
|
+
return !!(this.hasResourceBundle(n2, e5) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a2(n2, e5) && (!r2 || a2(i2, e5)));
|
|
1941
|
+
}
|
|
1942
|
+
loadNamespaces(e5, t2) {
|
|
1943
|
+
let n2 = Wn();
|
|
1944
|
+
return this.options.ns ? (F(e5) && (e5 = [e5]), e5.forEach((e6) => {
|
|
1945
|
+
this.options.ns.indexOf(e6) < 0 && this.options.ns.push(e6);
|
|
1946
|
+
}), this.loadResources((e6) => {
|
|
1947
|
+
n2.resolve(), t2 && t2(e6);
|
|
1948
|
+
}), n2) : (t2 && t2(), Promise.resolve());
|
|
1949
|
+
}
|
|
1950
|
+
loadLanguages(e5, t2) {
|
|
1951
|
+
let n2 = Wn();
|
|
1952
|
+
F(e5) && (e5 = [e5]);
|
|
1953
|
+
let r2 = this.options.preload || [], i2 = e5.filter((e6) => r2.indexOf(e6) < 0 && this.services.languageUtils.isSupportedCode(e6));
|
|
1954
|
+
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e6) => {
|
|
1955
|
+
n2.resolve(), t2 && t2(e6);
|
|
1956
|
+
}), n2) : (t2 && t2(), Promise.resolve());
|
|
1957
|
+
}
|
|
1958
|
+
dir(e5) {
|
|
1959
|
+
if (e5 ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e5) return `rtl`;
|
|
1960
|
+
try {
|
|
1961
|
+
let t3 = new Intl.Locale(e5);
|
|
1962
|
+
if (t3 && t3.getTextInfo) {
|
|
1963
|
+
let e6 = t3.getTextInfo();
|
|
1964
|
+
if (e6 && e6.direction) return e6.direction;
|
|
1965
|
+
}
|
|
1966
|
+
} catch {
|
|
1967
|
+
}
|
|
1968
|
+
let t2 = `ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`), n2 = this.services?.languageUtils || new yr(Mr());
|
|
1969
|
+
return e5.toLowerCase().indexOf(`-latn`) > 1 ? `ltr` : t2.indexOf(n2.getLanguagePartFromCode(e5)) > -1 || e5.toLowerCase().indexOf(`-arab`) > 1 ? `rtl` : `ltr`;
|
|
1970
|
+
}
|
|
1971
|
+
static createInstance(t2 = {}, n2) {
|
|
1972
|
+
let r2 = new e4(t2, n2);
|
|
1973
|
+
return r2.createInstance = e4.createInstance, r2;
|
|
1974
|
+
}
|
|
1975
|
+
cloneInstance(t2 = {}, n2 = Pr) {
|
|
1976
|
+
let r2 = t2.forkResourceStore;
|
|
1977
|
+
r2 && delete t2.forkResourceStore;
|
|
1978
|
+
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
1979
|
+
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e5) => {
|
|
1980
|
+
a2[e5] = this[e5];
|
|
1981
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new fr(Object.keys(this.store.data).reduce((e5, t3) => (e5[t3] = { ...this.store.data[t3] }, e5[t3] = Object.keys(e5[t3]).reduce((n3, r3) => (n3[r3] = { ...e5[t3][r3] }, n3), e5[t3]), e5), {}), i2), a2.services.resourceStore = a2.store), t2.interpolation) {
|
|
1982
|
+
let e5 = { ...Mr().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e5 };
|
|
1983
|
+
a2.services.interpolator = new Tr(n3);
|
|
1984
|
+
}
|
|
1985
|
+
return a2.translator = new vr(a2.services, i2), a2.translator.on(`*`, (e5, ...t3) => {
|
|
1986
|
+
a2.emit(e5, ...t3);
|
|
1987
|
+
}), a2.init(i2, n2), a2.translator.options = i2, a2.translator.backendConnector.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, a2;
|
|
1988
|
+
}
|
|
1989
|
+
toJSON() {
|
|
1990
|
+
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
|
|
1991
|
+
}
|
|
1992
|
+
}.createInstance();
|
|
1993
|
+
z.createInstance, z.dir, z.init, z.loadResources, z.reloadResources, z.use, z.changeLanguage, z.getFixedT, z.t, z.exists, z.setDefaultNamespace, z.hasLoadedNamespace, z.loadNamespaces, z.loadLanguages;
|
|
1994
|
+
var Br = function() {
|
|
1995
|
+
return Br = Object.assign || function(e5) {
|
|
1996
|
+
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) && (e5[i2] = t2[i2]);
|
|
1997
|
+
return e5;
|
|
1998
|
+
}, Br.apply(this, arguments);
|
|
1999
|
+
};
|
|
2000
|
+
function Vr(e5) {
|
|
2001
|
+
var t2 = typeof Symbol == `function` && Symbol.iterator, n2 = t2 && e5[t2], r2 = 0;
|
|
2002
|
+
if (n2) return n2.call(e5);
|
|
2003
|
+
if (e5 && typeof e5.length == `number`) return { next: function() {
|
|
2004
|
+
return e5 && r2 >= e5.length && (e5 = void 0), { value: e5 && e5[r2++], done: !e5 };
|
|
952
2005
|
} };
|
|
953
2006
|
throw TypeError(t2 ? `Object is not iterable.` : `Symbol.iterator is not defined.`);
|
|
954
2007
|
}
|
|
955
|
-
function
|
|
956
|
-
var n2 = typeof Symbol == `function` &&
|
|
957
|
-
if (!n2) return
|
|
958
|
-
var r2 = n2.call(
|
|
2008
|
+
function B(e5, t2) {
|
|
2009
|
+
var n2 = typeof Symbol == `function` && e5[Symbol.iterator];
|
|
2010
|
+
if (!n2) return e5;
|
|
2011
|
+
var r2 = n2.call(e5), i2, a2 = [], o2;
|
|
959
2012
|
try {
|
|
960
2013
|
for (; (t2 === void 0 || t2-- > 0) && !(i2 = r2.next()).done; ) a2.push(i2.value);
|
|
961
|
-
} catch (
|
|
962
|
-
o2 = { error:
|
|
2014
|
+
} catch (e6) {
|
|
2015
|
+
o2 = { error: e6 };
|
|
963
2016
|
} finally {
|
|
964
2017
|
try {
|
|
965
2018
|
i2 && !i2.done && (n2 = r2.return) && n2.call(r2);
|
|
@@ -969,17 +2022,85 @@ function L(e2, t2) {
|
|
|
969
2022
|
}
|
|
970
2023
|
return a2;
|
|
971
2024
|
}
|
|
972
|
-
function
|
|
2025
|
+
function Hr(e5, t2, n2) {
|
|
973
2026
|
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]);
|
|
974
|
-
return
|
|
2027
|
+
return e5.concat(a2 || Array.prototype.slice.call(t2));
|
|
2028
|
+
}
|
|
2029
|
+
var Ur = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
2030
|
+
var Wr = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
2031
|
+
var Gr = (e5) => Wr[e5];
|
|
2032
|
+
var Kr = { bindI18n: `languageChanged`, bindI18nStore: ``, transEmptyNodeValue: ``, transSupportBasicHtmlNodes: true, transWrapTextNodes: ``, transKeepBasicHtmlNodesFor: [`br`, `strong`, `i`, `p`], useSuspense: true, unescape: (e5) => e5.replace(Ur, Gr), transDefaultProps: void 0 };
|
|
2033
|
+
var qr = (e5 = {}) => {
|
|
2034
|
+
Kr = { ...Kr, ...e5 };
|
|
2035
|
+
};
|
|
2036
|
+
var Jr = { type: `3rdParty`, init(e5) {
|
|
2037
|
+
qr(e5.options.react);
|
|
2038
|
+
} };
|
|
2039
|
+
var Yr = /* @__PURE__ */ new Map();
|
|
2040
|
+
var Xr = 500;
|
|
2041
|
+
var Zr;
|
|
2042
|
+
function Qr() {
|
|
2043
|
+
if (Zr === void 0) try {
|
|
2044
|
+
Zr = new Intl.NumberFormat(`en-US`, { useGrouping: false, maximumFractionDigits: 0 }).format(`9007199254740993`) === `9007199254740993`;
|
|
2045
|
+
} catch {
|
|
2046
|
+
Zr = false;
|
|
2047
|
+
}
|
|
2048
|
+
return Zr;
|
|
2049
|
+
}
|
|
2050
|
+
var $r = 15;
|
|
2051
|
+
function ei(e5) {
|
|
2052
|
+
if (!(typeof e5 != `string` || Qr()) && e5.replace(/[^0-9]/g, ``).replace(/^0+/, ``).length > $r) throw Error(`Cannot format the amount '${e5}' exactly: this runtime's Intl implementation predates ES2023 string support and would lose precision. Use a runtime with ES2023 Intl support (for example Node 20+), or pass a value within 15 significant digits.`);
|
|
2053
|
+
}
|
|
2054
|
+
function ti(e5, t2, n2) {
|
|
2055
|
+
return `${e5}|${t2}|${Object.entries(n2).filter(([, e6]) => e6 !== void 0).sort(([e6], [t3]) => e6 < t3 ? -1 : 1).map(([e6, t3]) => `${e6}=${String(t3)}`).join(`&`)}`;
|
|
2056
|
+
}
|
|
2057
|
+
function ni(e5, t2, n2) {
|
|
2058
|
+
let r2 = ti(e5, t2, n2), i2 = Yr.get(r2);
|
|
2059
|
+
return i2 || (i2 = new Intl.NumberFormat(e5, { ...n2, style: `currency`, currency: t2 }), Yr.size >= Xr && Yr.clear(), Yr.set(r2, i2)), i2;
|
|
2060
|
+
}
|
|
2061
|
+
function ri(e5, { value: t2, currency: n2 }, r2 = {}) {
|
|
2062
|
+
return ei(t2), ni(e5, n2, r2).format(t2);
|
|
975
2063
|
}
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
2064
|
+
function ii(e5, { value: t2, currency: n2 }, r2 = {}) {
|
|
2065
|
+
return ei(t2), ni(e5, n2, r2).formatToParts(t2);
|
|
2066
|
+
}
|
|
2067
|
+
function ai(e5) {
|
|
2068
|
+
return yn().find((e6) => e6.primary)?.id ?? e5;
|
|
2069
|
+
}
|
|
2070
|
+
function oi(e5, t2) {
|
|
2071
|
+
let { locale: n2, ...r2 } = t2 ?? {}, i2 = n2 ?? e5.essentials?.locale;
|
|
2072
|
+
if (!i2) throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
2073
|
+
return { locale: i2, formatOptions: r2 };
|
|
2074
|
+
}
|
|
2075
|
+
var si = Un({ getLanguage: (e5) => () => {
|
|
2076
|
+
let t2 = e5.essentials?.language;
|
|
2077
|
+
if (!t2) throw Error(`Host language is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
2078
|
+
return t2;
|
|
2079
|
+
}, getLocale: (e5) => () => {
|
|
2080
|
+
let t2 = e5.essentials?.locale;
|
|
2081
|
+
if (!t2) throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
2082
|
+
return t2;
|
|
2083
|
+
}, formatCurrency: (e5) => (t2, n2) => {
|
|
2084
|
+
let { locale: r2, formatOptions: i2 } = oi(e5, n2);
|
|
2085
|
+
return ri(r2, t2, i2);
|
|
2086
|
+
}, formatCurrencyToParts: (e5) => (t2, n2) => {
|
|
2087
|
+
let { locale: r2, formatOptions: i2 } = oi(e5, n2);
|
|
2088
|
+
return ii(r2, t2, i2);
|
|
2089
|
+
}, getTranslationFunction: (e5) => () => {
|
|
2090
|
+
let t2 = e5.translations?.();
|
|
2091
|
+
if (!t2) throw Error(`Host translation resources are not available.`);
|
|
2092
|
+
let n2 = z.createInstance(), r2 = ai(e5.essentials?.language) || `en`, i2 = { lng: e5.essentials?.language || r2, fallbackLng: r2, resources: t2 };
|
|
2093
|
+
return n2.use(Jr).init(i2, (e6) => {
|
|
2094
|
+
if (e6) throw e6;
|
|
2095
|
+
}), n2.t.bind(n2);
|
|
2096
|
+
} });
|
|
2097
|
+
var ci = class {
|
|
2098
|
+
constructor(e5) {
|
|
2099
|
+
this.message = e5, this.captureException = () => {
|
|
979
2100
|
console.error(this.message);
|
|
980
2101
|
}, this.captureMessage = () => {
|
|
981
2102
|
console.error(this.message);
|
|
982
|
-
}, this.startSpan = (
|
|
2103
|
+
}, this.startSpan = (e6, t2) => (console.error(this.message), t2(void 0)), this.startSpanManual = () => (console.error(this.message), { end: () => {
|
|
983
2104
|
}, fail: () => {
|
|
984
2105
|
} }), this.endSpanManual = () => {
|
|
985
2106
|
console.error(this.message);
|
|
@@ -988,366 +2109,366 @@ var An = class {
|
|
|
988
2109
|
};
|
|
989
2110
|
}
|
|
990
2111
|
};
|
|
991
|
-
var
|
|
992
|
-
var
|
|
993
|
-
var
|
|
994
|
-
function
|
|
2112
|
+
var li = (e5) => new ci(e5);
|
|
2113
|
+
var ui = Un({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : li(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
2114
|
+
var V = { 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` };
|
|
2115
|
+
function di(e5) {
|
|
995
2116
|
try {
|
|
996
|
-
let t2 =
|
|
997
|
-
return t2 && typeof t2[
|
|
2117
|
+
let t2 = ui.getMonitoringClient?.();
|
|
2118
|
+
return t2 && typeof t2[e5] == `function` ? t2 : null;
|
|
998
2119
|
} catch {
|
|
999
2120
|
return null;
|
|
1000
2121
|
}
|
|
1001
2122
|
}
|
|
1002
|
-
function
|
|
1003
|
-
let a2 =
|
|
2123
|
+
function H(e5, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
2124
|
+
let a2 = di(`captureException`);
|
|
1004
2125
|
if (!a2) return;
|
|
1005
|
-
let o2 =
|
|
2126
|
+
let o2 = e5 instanceof Error ? e5 : Error(String(e5));
|
|
1006
2127
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
1007
2128
|
}
|
|
1008
|
-
function
|
|
1009
|
-
let i2 =
|
|
2129
|
+
function fi(e5, { feature: t2, tags: n2 }, r2) {
|
|
2130
|
+
let i2 = di(`startSpanManual`);
|
|
1010
2131
|
if (!i2) return r2;
|
|
1011
|
-
let a2 = i2.startSpanManual({ name:
|
|
1012
|
-
return r2.then(() => a2.end(), (
|
|
2132
|
+
let a2 = i2.startSpanManual({ name: e5, tags: { feature: t2, ...n2 } });
|
|
2133
|
+
return r2.then(() => a2.end(), (e6) => a2.fail(e6)), r2;
|
|
1013
2134
|
}
|
|
1014
|
-
var
|
|
2135
|
+
var pi = class extends import_react.Component {
|
|
1015
2136
|
state = { hasError: false };
|
|
1016
2137
|
static getDerivedStateFromError() {
|
|
1017
2138
|
return { hasError: true };
|
|
1018
2139
|
}
|
|
1019
|
-
componentDidCatch(
|
|
1020
|
-
|
|
2140
|
+
componentDidCatch(e5, t2) {
|
|
2141
|
+
H(e5, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
1021
2142
|
}
|
|
1022
2143
|
render() {
|
|
1023
2144
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
1024
2145
|
}
|
|
1025
2146
|
};
|
|
1026
|
-
function
|
|
1027
|
-
let t2 =
|
|
1028
|
-
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((
|
|
1029
|
-
t2.__state = { status: `fulfilled`, value:
|
|
1030
|
-
}, (
|
|
1031
|
-
t2.__state = { status: `rejected`, reason:
|
|
2147
|
+
function mi(e5) {
|
|
2148
|
+
let t2 = e5;
|
|
2149
|
+
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e6) => {
|
|
2150
|
+
t2.__state = { status: `fulfilled`, value: e6 };
|
|
2151
|
+
}, (e6) => {
|
|
2152
|
+
t2.__state = { status: `rejected`, reason: e6 };
|
|
1032
2153
|
})), t2.__state.status === `fulfilled`) return t2.__state.value;
|
|
1033
2154
|
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
1034
2155
|
}
|
|
1035
|
-
function
|
|
1036
|
-
let t2 = Promise.resolve(
|
|
1037
|
-
return t2.__state = { status: `fulfilled`, value:
|
|
2156
|
+
function hi(e5) {
|
|
2157
|
+
let t2 = Promise.resolve(e5);
|
|
2158
|
+
return t2.__state = { status: `fulfilled`, value: e5 }, t2;
|
|
1038
2159
|
}
|
|
1039
|
-
var
|
|
1040
|
-
function
|
|
1041
|
-
let r2 =
|
|
1042
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
2160
|
+
var gi = /* @__PURE__ */ new WeakMap();
|
|
2161
|
+
function _i(e5, t2, n2) {
|
|
2162
|
+
let r2 = gi.get(e5);
|
|
2163
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), gi.set(e5, r2));
|
|
1043
2164
|
let i2 = r2.get(t2);
|
|
1044
2165
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
1045
2166
|
let a2 = i2.get(n2);
|
|
1046
2167
|
if (!a2) {
|
|
1047
|
-
let r3 =
|
|
1048
|
-
a2 = r3.__state?.status === `fulfilled` ?
|
|
2168
|
+
let r3 = e5;
|
|
2169
|
+
a2 = r3.__state?.status === `fulfilled` ? hi(t2(r3.__state.value)) : r3.__state?.status === `rejected` ? hi(n2(r3.__state.reason)) : e5.then(t2, n2), i2.set(n2, a2);
|
|
1049
2170
|
}
|
|
1050
2171
|
return a2;
|
|
1051
2172
|
}
|
|
1052
|
-
function
|
|
1053
|
-
return
|
|
1054
|
-
}
|
|
1055
|
-
var
|
|
1056
|
-
var
|
|
1057
|
-
function
|
|
1058
|
-
let t2 =
|
|
1059
|
-
if (t2 === null) return
|
|
1060
|
-
let n2 = new URL(
|
|
1061
|
-
n2.searchParams.delete(
|
|
1062
|
-
for (let [
|
|
2173
|
+
function U(e5) {
|
|
2174
|
+
return e5;
|
|
2175
|
+
}
|
|
2176
|
+
var vi = U(`@wix/site-service-url`);
|
|
2177
|
+
var yi = `appSectionParams`;
|
|
2178
|
+
function bi(e5) {
|
|
2179
|
+
let t2 = e5.searchParams.get(yi);
|
|
2180
|
+
if (t2 === null) return e5;
|
|
2181
|
+
let n2 = new URL(e5);
|
|
2182
|
+
n2.searchParams.delete(yi);
|
|
2183
|
+
for (let [e6, r2] of Object.entries(xi(t2))) typeof r2 == `string` && !n2.searchParams.has(e6) && n2.searchParams.set(e6, r2);
|
|
1063
2184
|
return n2;
|
|
1064
2185
|
}
|
|
1065
|
-
function
|
|
2186
|
+
function xi(e5) {
|
|
1066
2187
|
try {
|
|
1067
|
-
let t2 = JSON.parse(
|
|
2188
|
+
let t2 = JSON.parse(e5);
|
|
1068
2189
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
1069
2190
|
} catch {
|
|
1070
2191
|
return {};
|
|
1071
2192
|
}
|
|
1072
2193
|
}
|
|
1073
|
-
var
|
|
1074
|
-
var
|
|
1075
|
-
let t2 = new URL(
|
|
2194
|
+
var Si = `bookings-uou:url-change`;
|
|
2195
|
+
var Ci = (e5) => {
|
|
2196
|
+
let t2 = new URL(e5);
|
|
1076
2197
|
return t2.searchParams.sort(), t2.href;
|
|
1077
2198
|
};
|
|
1078
|
-
function
|
|
2199
|
+
function wi(e5, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
1079
2200
|
let r2 = globalThis.window;
|
|
1080
2201
|
if (!r2?.history) return;
|
|
1081
2202
|
let i2 = new URL(r2.location.href);
|
|
1082
|
-
if (
|
|
2203
|
+
if (Ci(i2) === Ci(e5)) return;
|
|
1083
2204
|
let a2 = { scrollY: r2.scrollY };
|
|
1084
|
-
if (n2) r2.history.replaceState(a2, ``,
|
|
2205
|
+
if (n2) r2.history.replaceState(a2, ``, e5.href);
|
|
1085
2206
|
else {
|
|
1086
2207
|
r2.history.replaceState(a2, ``, i2.href);
|
|
1087
2208
|
try {
|
|
1088
|
-
r2.history.pushState(t2 ? a2 : null, ``,
|
|
2209
|
+
r2.history.pushState(t2 ? a2 : null, ``, e5.href);
|
|
1089
2210
|
} catch {
|
|
1090
2211
|
return;
|
|
1091
2212
|
}
|
|
1092
2213
|
}
|
|
1093
|
-
r2.dispatchEvent(new Event(
|
|
2214
|
+
r2.dispatchEvent(new Event(Si));
|
|
1094
2215
|
}
|
|
1095
|
-
function
|
|
2216
|
+
function Ti(e5) {
|
|
1096
2217
|
let t2 = globalThis.window;
|
|
1097
|
-
return t2 ? (t2.addEventListener(
|
|
1098
|
-
t2.removeEventListener(
|
|
2218
|
+
return t2 ? (t2.addEventListener(Si, e5), t2.addEventListener(`popstate`, e5), () => {
|
|
2219
|
+
t2.removeEventListener(Si, e5), t2.removeEventListener(`popstate`, e5);
|
|
1099
2220
|
}) : () => {
|
|
1100
2221
|
};
|
|
1101
2222
|
}
|
|
1102
|
-
var
|
|
2223
|
+
var Ei = (e5) => {
|
|
1103
2224
|
try {
|
|
1104
|
-
return decodeURIComponent(
|
|
2225
|
+
return decodeURIComponent(e5);
|
|
1105
2226
|
} catch {
|
|
1106
|
-
return
|
|
2227
|
+
return e5;
|
|
1107
2228
|
}
|
|
1108
2229
|
};
|
|
1109
|
-
function
|
|
2230
|
+
function Di(e5, t2) {
|
|
1110
2231
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
1111
|
-
return `./${
|
|
1112
|
-
}
|
|
1113
|
-
function
|
|
1114
|
-
let
|
|
1115
|
-
return { pathname: r2.pathname, search: r2.search, searchParams: r2.searchParams, href: r2.href, getParsedUrl: () =>
|
|
1116
|
-
}
|
|
1117
|
-
var
|
|
1118
|
-
var
|
|
1119
|
-
var
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1122
|
-
var
|
|
1123
|
-
var
|
|
1124
|
-
var
|
|
1125
|
-
return
|
|
2232
|
+
return `./${Ei(new URL(e5).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
2233
|
+
}
|
|
2234
|
+
function Oi() {
|
|
2235
|
+
let e5 = (0, import_services_manager_react.useService)(vi), t2 = (0, import_react.useCallback)(() => e5.currentUrl, [e5]), n2 = (0, import_react.useSyncExternalStore)(Ti, t2, t2), r2 = (0, import_react.useMemo)(() => bi(new URL(n2)), [n2]), a2 = e5.siteUrl.replace(/\/$/, ``);
|
|
2236
|
+
return { pathname: r2.pathname, search: r2.search, searchParams: r2.searchParams, href: r2.href, getParsedUrl: () => bi(new URL(e5.currentUrl)), getRelativeUrl: () => Di(e5.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: wi };
|
|
2237
|
+
}
|
|
2238
|
+
var ki = U(`@wix/site-service-editor-context`);
|
|
2239
|
+
var Ai = U(`@wix/site-service-pages`);
|
|
2240
|
+
var ji = U(`@wix/site-service-router`);
|
|
2241
|
+
var Mi = U(`@wix/site-service-renderer-configuration`);
|
|
2242
|
+
var Ni = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
|
|
2243
|
+
var Pi = `shopping_cart`;
|
|
2244
|
+
var Fi = `thank_you_page`;
|
|
2245
|
+
var W = function(e5) {
|
|
2246
|
+
return e5.BOOK_ONLINE = `bookingsBookOnline`, e5.SERVICE_PAGE = `bookingsServicePage`, e5.CALENDAR_PAGE = `bookingsCalendar`, e5.FORM_PAGE = `bookingsForm`, e5;
|
|
1126
2247
|
}({});
|
|
1127
|
-
var
|
|
1128
|
-
var
|
|
1129
|
-
var
|
|
1130
|
-
var
|
|
1131
|
-
(function(
|
|
1132
|
-
|
|
1133
|
-
})(
|
|
1134
|
-
var W;
|
|
1135
|
-
(function(e2) {
|
|
1136
|
-
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`;
|
|
1137
|
-
})(W ||= {});
|
|
1138
|
-
var sr = {};
|
|
1139
|
-
var cr = (sr[W.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, sr);
|
|
1140
|
-
var G = `{{main-mapping}}`;
|
|
1141
|
-
var lr = {};
|
|
1142
|
-
var ur;
|
|
1143
|
-
var dr = (lr[W.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (ur = {}, ur[W.BLOG_POST_EDIT] = { defaultMapping: `${G}/edit` }, ur[W.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${G}/preview/{{instance}}` }, ur) }, lr);
|
|
1144
|
-
var fr = {};
|
|
1145
|
-
var pr = (fr[W.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, fr);
|
|
1146
|
-
var mr = {};
|
|
2248
|
+
var Ii = `{{(.*?)}}`;
|
|
2249
|
+
var Li = `[{{}}]`;
|
|
2250
|
+
var Ri = `([^/]+)`;
|
|
2251
|
+
var G;
|
|
2252
|
+
(function(e5) {
|
|
2253
|
+
e5.product_page = `product_page`, e5.blog = `blog`, e5.post = `post`, e5.forum = `forum`, e5.group = `group`, e5.bookings = `Booking Service Page`, e5.challenges = `challenge_page`;
|
|
2254
|
+
})(G ||= {});
|
|
1147
2255
|
var K;
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
var
|
|
1152
|
-
var
|
|
1153
|
-
var
|
|
1154
|
-
var
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1157
|
-
var
|
|
1158
|
-
var
|
|
1159
|
-
|
|
1160
|
-
|
|
2256
|
+
(function(e5) {
|
|
2257
|
+
e5.PRODUCT_PAGE = `wix.stores.sub_pages.product`, e5.BLOG_POST = `wix.blog.sub_pages.post`, e5.BLOG_POST_EDIT = `wix.blog.sub_pages.post.edit`, e5.BLOG_POST_PREVIEW = `wix.blog.sub_pages.post.preview`, e5.BLOG_CATEGORY = `wix.blog.sub_pages.category`, e5.FORUM_CATEGORY = `wix.forum.sub_pages.category`, e5.FORUM_CATEGORY_PAGINATION = `wix.forum.sub_pages.category.pagination`, e5.FORUM_CATEGORY_CREATE_POST = `wix.forum.sub_pages.category.create-post`, e5.FORUM_CATEGORY_CREATE_QUESTION = `wix.forum.sub_pages.category.create-question`, e5.FORUM_POST = `wix.forum.sub_pages.post`, e5.FORUM_POST_EDIT = `wix.forum.sub_pages.post.edit`, e5.FORUM_POST_PAGINATION = `wix.forum.sub_pages.post.pagination`, e5.FORUM_POST_DEEP_LINK_DATA = `wix.forum.sub_pages.post.deep-link-data`, e5.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA = `wix.forum.sub_pages.post.pagination-and-deep-link-data`, e5.GROUP = `wix.groups.sub_pages.group`, e5.GROUP_POST = `wix.groups.sub_pages.post`, e5.BOOKINGS_SERVICE = `wix.bookings.sub_pages.service_page`, e5.CHALLENGES_PAGE = `wix.online_programs.sub_pages.online_program`;
|
|
2258
|
+
})(K ||= {});
|
|
2259
|
+
var zi = {};
|
|
2260
|
+
var Bi = (zi[K.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, zi);
|
|
2261
|
+
var q = `{{main-mapping}}`;
|
|
2262
|
+
var Vi = {};
|
|
2263
|
+
var Hi;
|
|
2264
|
+
var Ui = (Vi[K.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (Hi = {}, Hi[K.BLOG_POST_EDIT] = { defaultMapping: `${q}/edit` }, Hi[K.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${q}/preview/{{instance}}` }, Hi) }, Vi);
|
|
2265
|
+
var Wi = {};
|
|
2266
|
+
var Gi = (Wi[K.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, Wi);
|
|
2267
|
+
var Ki = {};
|
|
2268
|
+
var J;
|
|
2269
|
+
var qi;
|
|
2270
|
+
var Ji = (Ki[K.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (J = {}, J[K.FORUM_POST_EDIT] = { defaultMapping: `${q}/edit` }, J[K.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${q}/p-{{page}}` }, J[K.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${q}/dl-{{deepLinkData}}` }, J[K.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${q}/p-{{page}}/dl-{{deepLinkData}}` }, J) }, Ki[K.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (qi = {}, qi[K.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${q}/create-post` }, qi[K.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${q}/create-question` }, qi[K.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${q}/p-{{page}}` }, qi) }, Ki);
|
|
2271
|
+
var Yi = {};
|
|
2272
|
+
var Xi = (Yi[K.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, Yi[K.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, Yi);
|
|
2273
|
+
var Zi = {};
|
|
2274
|
+
var Qi = (Zi[K.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, Zi);
|
|
2275
|
+
var $i = {};
|
|
2276
|
+
var ea = ($i[K.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, $i);
|
|
2277
|
+
var Y = {};
|
|
2278
|
+
var ta = (Y[G.product_page] = Bi, Y[G.post] = Ui, Y[G.blog] = Gi, Y[G.forum] = Ji, Y[G.group] = Xi, Y[G.bookings] = Qi, Y[G.challenges] = ea, Y);
|
|
2279
|
+
var na = function(e5) {
|
|
2280
|
+
return Object.values(ra()).some(function(t2) {
|
|
2281
|
+
return !!t2?.subMappings?.[e5];
|
|
1161
2282
|
});
|
|
1162
2283
|
};
|
|
1163
|
-
var
|
|
1164
|
-
return Object.values(
|
|
1165
|
-
return
|
|
2284
|
+
var ra = function() {
|
|
2285
|
+
return Object.values(ta).reduce(function(e5, t2) {
|
|
2286
|
+
return Br(Br({}, e5), t2);
|
|
1166
2287
|
}, {}) || {};
|
|
1167
2288
|
};
|
|
1168
|
-
var
|
|
1169
|
-
var t2 =
|
|
1170
|
-
return !t2 &&
|
|
2289
|
+
var ia = function(e5) {
|
|
2290
|
+
var t2 = ra()[e5];
|
|
2291
|
+
return !t2 && na(e5) && console.warn(`You cannot get variables schema for subMappings key (${e5}).`), t2;
|
|
1171
2292
|
};
|
|
1172
|
-
var
|
|
1173
|
-
return Object.entries(
|
|
1174
|
-
var n2 =
|
|
1175
|
-
return Object.keys(n2).includes(
|
|
1176
|
-
}).map(function(
|
|
1177
|
-
return
|
|
2293
|
+
var aa = function(e5) {
|
|
2294
|
+
return Object.entries(ta).filter(function(t2) {
|
|
2295
|
+
var n2 = B(t2, 2)[1];
|
|
2296
|
+
return Object.keys(n2).includes(e5);
|
|
2297
|
+
}).map(function(e6) {
|
|
2298
|
+
return B(e6, 1)[0];
|
|
1178
2299
|
})[0];
|
|
1179
2300
|
};
|
|
1180
|
-
var
|
|
1181
|
-
return Object.entries(
|
|
1182
|
-
var n2 =
|
|
1183
|
-
return n2[0], !!n2[1]?.subMappings?.[
|
|
2301
|
+
var oa = function(e5) {
|
|
2302
|
+
return Object.entries(ra()).find(function(t2) {
|
|
2303
|
+
var n2 = B(t2, 2);
|
|
2304
|
+
return n2[0], !!n2[1]?.subMappings?.[e5];
|
|
1184
2305
|
});
|
|
1185
2306
|
};
|
|
1186
|
-
var
|
|
2307
|
+
var sa = function(e5) {
|
|
1187
2308
|
var t2 = [];
|
|
1188
|
-
if (
|
|
1189
|
-
var n2 =
|
|
2309
|
+
if (na(e5)) {
|
|
2310
|
+
var n2 = B(oa(e5), 2);
|
|
1190
2311
|
n2[0];
|
|
1191
2312
|
var r2 = n2[1];
|
|
1192
|
-
t2.push.apply(t2,
|
|
1193
|
-
} else t2.push.apply(t2,
|
|
2313
|
+
t2.push.apply(t2, Hr(Hr([], B(r2?.required || []), false), B(r2?.subMappings?.[e5]?.required || []), false));
|
|
2314
|
+
} else t2.push.apply(t2, Hr([], B(ia(e5)?.required || []), false));
|
|
1194
2315
|
return t2;
|
|
1195
2316
|
};
|
|
1196
|
-
var
|
|
2317
|
+
var ca = function(e5, t2) {
|
|
1197
2318
|
var n2;
|
|
1198
|
-
return t2 === void 0 && (t2 = ``), (n2 =
|
|
1199
|
-
return
|
|
2319
|
+
return t2 === void 0 && (t2 = ``), (n2 = e5?.main)?.find?.call(n2, function(e6) {
|
|
2320
|
+
return e6.key === t2;
|
|
1200
2321
|
});
|
|
1201
2322
|
};
|
|
1202
|
-
var
|
|
1203
|
-
return Error(`Url Mappings Error - [${
|
|
2323
|
+
var la = function(e5, t2) {
|
|
2324
|
+
return Error(`Url Mappings Error - [${e5}]: ${t2}`);
|
|
1204
2325
|
};
|
|
1205
|
-
var
|
|
1206
|
-
var
|
|
1207
|
-
var
|
|
1208
|
-
if (typeof
|
|
2326
|
+
var ua = Object.values(K);
|
|
2327
|
+
var da = la(`key`, `must be one of: ${ua.toString()}`);
|
|
2328
|
+
var fa = function(e5) {
|
|
2329
|
+
if (typeof e5 != `string` || !ua.includes(e5)) return da;
|
|
1209
2330
|
};
|
|
1210
|
-
var
|
|
1211
|
-
var
|
|
1212
|
-
if (typeof
|
|
1213
|
-
return typeof
|
|
1214
|
-
}) || Array.isArray(
|
|
2331
|
+
var pa = la(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
|
|
2332
|
+
var ma = function(e5) {
|
|
2333
|
+
if (typeof e5 != `object` || !e5 || !Object.values(e5).every(function(e6) {
|
|
2334
|
+
return typeof e6 == `string`;
|
|
2335
|
+
}) || Array.isArray(e5)) return pa;
|
|
1215
2336
|
};
|
|
1216
|
-
var
|
|
1217
|
-
var
|
|
2337
|
+
var ha = la(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
|
|
2338
|
+
var ga = function(e5, t2) {
|
|
1218
2339
|
try {
|
|
1219
|
-
var n2 =
|
|
1220
|
-
if (!n2.every(function(
|
|
1221
|
-
return !!t2[
|
|
2340
|
+
var n2 = sa(e5);
|
|
2341
|
+
if (!n2.every(function(e6) {
|
|
2342
|
+
return !!t2[e6];
|
|
1222
2343
|
}) || !n2.length) throw Error();
|
|
1223
2344
|
} catch {
|
|
1224
|
-
return
|
|
2345
|
+
return ha;
|
|
1225
2346
|
}
|
|
1226
2347
|
};
|
|
1227
|
-
var
|
|
1228
|
-
var t2 =
|
|
1229
|
-
return [
|
|
2348
|
+
var _a = function(e5) {
|
|
2349
|
+
var t2 = e5.key, n2 = e5.itemData;
|
|
2350
|
+
return [fa(t2), ma(n2), ga(t2, n2)].find(Boolean);
|
|
1230
2351
|
};
|
|
1231
|
-
var
|
|
2352
|
+
var va = function(e5) {
|
|
1232
2353
|
return function(t2) {
|
|
1233
|
-
var n2 = new RegExp(
|
|
1234
|
-
return
|
|
2354
|
+
var n2 = new RegExp(Li, `g`), r2 = t2.replace(n2, ``);
|
|
2355
|
+
return e5?.[r2];
|
|
1235
2356
|
};
|
|
1236
2357
|
};
|
|
1237
|
-
var
|
|
1238
|
-
|
|
1239
|
-
var i2 =
|
|
2358
|
+
var ya = function(e5, t2, n2, r2) {
|
|
2359
|
+
e5 === void 0 && (e5 = { main: [] }), r2 === void 0 && (r2 = {});
|
|
2360
|
+
var i2 = _a({ key: t2, itemData: n2 });
|
|
1240
2361
|
if (i2) throw i2;
|
|
1241
|
-
var a2 = (
|
|
2362
|
+
var a2 = (ca(e5, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
|
|
1242
2363
|
if (o2 ??= ``, o2 = o2.endsWith(`/`) ? o2?.slice(0, -1) : o2, a2 && typeof a2 == `string`) {
|
|
1243
|
-
var s2 = new RegExp(
|
|
2364
|
+
var s2 = new RegExp(Ii, `g`), c2 = a2.replace(s2, va(n2));
|
|
1244
2365
|
return o2.concat(`/${c2}`);
|
|
1245
2366
|
}
|
|
1246
2367
|
};
|
|
1247
|
-
var
|
|
1248
|
-
var
|
|
1249
|
-
var t2 =
|
|
2368
|
+
var ba = /[.*+?^$()|]/g;
|
|
2369
|
+
var xa = function(e5) {
|
|
2370
|
+
var t2 = e5.replace(ba, `\\$&`).replace(new RegExp(Ii, `g`), Ri);
|
|
1250
2371
|
return RegExp(`^${t2}$`);
|
|
1251
2372
|
};
|
|
1252
|
-
var
|
|
1253
|
-
return
|
|
1254
|
-
return
|
|
2373
|
+
var Sa = function(e5, t2) {
|
|
2374
|
+
return e5 === void 0 && (e5 = []), e5.find(function(e6) {
|
|
2375
|
+
return xa(e6).test(t2);
|
|
1255
2376
|
});
|
|
1256
2377
|
};
|
|
1257
|
-
|
|
1258
|
-
var
|
|
2378
|
+
la(`url`, `Url must be a string`);
|
|
2379
|
+
var Ca = function(e5) {
|
|
1259
2380
|
return [` `, ` `, `
|
|
1260
2381
|
`].every(function(t2) {
|
|
1261
|
-
return !
|
|
2382
|
+
return !e5?.includes?.call(e5, t2);
|
|
1262
2383
|
});
|
|
1263
2384
|
};
|
|
1264
|
-
var
|
|
1265
|
-
return
|
|
2385
|
+
var wa = function(e5) {
|
|
2386
|
+
return e5?.length <= Ia.MAX_URL_MAPPING_LENGTH;
|
|
1266
2387
|
};
|
|
1267
|
-
var
|
|
1268
|
-
return
|
|
2388
|
+
var Ta = function(e5) {
|
|
2389
|
+
return e5?.split(`/`).every(Boolean);
|
|
1269
2390
|
};
|
|
1270
|
-
var
|
|
2391
|
+
var Ea = function(e5, t2) {
|
|
1271
2392
|
var n2 = t2.urlMappingKey;
|
|
1272
|
-
return
|
|
1273
|
-
return
|
|
2393
|
+
return sa(n2)?.every(function(t3) {
|
|
2394
|
+
return e5?.includes(`{{${t3}}}`);
|
|
1274
2395
|
});
|
|
1275
2396
|
};
|
|
1276
|
-
var
|
|
1277
|
-
return (
|
|
2397
|
+
var Da = function(e5) {
|
|
2398
|
+
return (e5.match(new RegExp(Ii, `g`))?.length || 0) <= 1;
|
|
1278
2399
|
};
|
|
1279
|
-
var
|
|
1280
|
-
return
|
|
2400
|
+
var Oa = function(e5) {
|
|
2401
|
+
return e5?.split(`/`).every(Da);
|
|
1281
2402
|
};
|
|
1282
|
-
var
|
|
1283
|
-
return [
|
|
2403
|
+
var ka = function(e5) {
|
|
2404
|
+
return [e5.publishedPrefix, e5.savedPrefix].filter(Boolean);
|
|
1284
2405
|
};
|
|
1285
|
-
var
|
|
2406
|
+
var Aa = function(e5, t2) {
|
|
1286
2407
|
return t2 === void 0 && (t2 = []), function(n2, r2) {
|
|
1287
2408
|
var i2 = n2.split(`/`), a2 = n2 === r2;
|
|
1288
2409
|
if (i2.length < 1 || a2) return true;
|
|
1289
|
-
var o2 =
|
|
1290
|
-
return t2.includes(s2) ? true :
|
|
1291
|
-
return
|
|
2410
|
+
var o2 = B(r2.split(`/`), 1)[0], s2 = B(i2, 1)[0];
|
|
2411
|
+
return t2.includes(s2) ? true : e5.every(function(e6) {
|
|
2412
|
+
return e6 === o2 || e6 !== s2;
|
|
1292
2413
|
});
|
|
1293
2414
|
};
|
|
1294
2415
|
};
|
|
1295
|
-
var
|
|
2416
|
+
var ja = function(e5, t2) {
|
|
1296
2417
|
var n2 = t2.pathPrefixes;
|
|
1297
|
-
return
|
|
1298
|
-
return
|
|
1299
|
-
}).filter(Boolean),
|
|
2418
|
+
return Aa(Object.values(n2).map(function(e6) {
|
|
2419
|
+
return e6.publishedPrefix;
|
|
2420
|
+
}).filter(Boolean), ka(t2.pathPrefix))(e5, t2.defaultMapping.defaultPublished);
|
|
1300
2421
|
};
|
|
1301
|
-
var
|
|
2422
|
+
var Ma = function(e5, t2) {
|
|
1302
2423
|
var n2 = t2.urlMappingKey, r2 = t2.urlMappings;
|
|
1303
|
-
return !
|
|
1304
|
-
return n2 !==
|
|
1305
|
-
}).map(function(
|
|
1306
|
-
return
|
|
1307
|
-
}),
|
|
1308
|
-
};
|
|
1309
|
-
var
|
|
1310
|
-
|
|
1311
|
-
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(
|
|
2424
|
+
return !Sa(r2.main?.filter(function(e6) {
|
|
2425
|
+
return n2 !== e6.key;
|
|
2426
|
+
}).map(function(e6) {
|
|
2427
|
+
return e6.mapping;
|
|
2428
|
+
}), e5);
|
|
2429
|
+
};
|
|
2430
|
+
var Na = function(e5) {
|
|
2431
|
+
e5 = e5.replace(new RegExp(Ii, `ig`), ``);
|
|
2432
|
+
var t2 = new RegExp(/[^\]_.~!*'();:@&=+$,<>\\#^%?`"]/, `g`), n2 = !/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g.test(e5), r2 = !e5.replace(t2, ``);
|
|
1312
2433
|
return n2 && r2;
|
|
1313
2434
|
};
|
|
1314
|
-
var
|
|
1315
|
-
var t2 =
|
|
2435
|
+
var Pa = function(e5) {
|
|
2436
|
+
var t2 = B(e5, 1)[0], n2 = e5.slice(-1);
|
|
1316
2437
|
return t2 !== `/` && n2 !== `/`;
|
|
1317
2438
|
};
|
|
1318
|
-
var
|
|
2439
|
+
var Fa = function(e5, t2) {
|
|
1319
2440
|
var n2 = t2.pathPrefixes;
|
|
1320
|
-
return
|
|
1321
|
-
return
|
|
1322
|
-
}).filter(Boolean),
|
|
1323
|
-
};
|
|
1324
|
-
var
|
|
1325
|
-
(function(
|
|
1326
|
-
|
|
1327
|
-
})(
|
|
1328
|
-
var
|
|
1329
|
-
function
|
|
1330
|
-
var t2 =
|
|
2441
|
+
return Aa(Object.values(n2).map(function(e6) {
|
|
2442
|
+
return e6.savedPrefix;
|
|
2443
|
+
}).filter(Boolean), ka(t2.pathPrefix))(e5, t2.defaultMapping.defaultSaved);
|
|
2444
|
+
};
|
|
2445
|
+
var X;
|
|
2446
|
+
(function(e5) {
|
|
2447
|
+
e5.MAX_LENGTH_ERROR = `MAX_LENGTH_ERROR`, e5.NO_SPACES_ERROR = `NO_SPACES_ERROR`, e5.NO_EMPTY_SEGMENT_ERROR = `NO_EMPTY_SEGMENT_ERROR`, e5.CONTAIN_MAIN_VARIABLE_ERROR = `CONTAIN_MAIN_VARIABLE_ERROR`, e5.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR = `ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR`, e5.ONLY_UNIQUE_PUBLISHED_URL_ERROR = `ONLY_UNIQUE_PUBLISHED_URL_ERROR`, e5.ONLY_UNIQUE_SAVED_URL_ERROR = `ONLY_UNIQUE_SAVED_URL_ERROR`, e5.ONLY_UNIQUE_MAPPING_ERROR = `ONLY_UNIQUE_MAPPING_ERROR`, e5.NO_INVALID_CHARACTERS_ERROR = `NO_INVALID_CHARACTERS_ERROR`, e5.NO_STARTING_OR_ENDING_SLASH_ERROR = `NO_STARTING_OR_ENDING_SLASH_ERROR`;
|
|
2448
|
+
})(X ||= {});
|
|
2449
|
+
var Ia = function() {
|
|
2450
|
+
function e5(e6) {
|
|
2451
|
+
var t2 = e6.urlMappingKey, n2 = e6.pathPrefixes, r2 = e6.urlMappings, i2 = this;
|
|
1331
2452
|
this.initValidators = function() {
|
|
1332
|
-
i2.validators = [[
|
|
1333
|
-
}, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping =
|
|
1334
|
-
}
|
|
1335
|
-
return
|
|
1336
|
-
var t2 =
|
|
1337
|
-
if (!t2) throw
|
|
1338
|
-
return this.pathPrefixes[t2] ||
|
|
1339
|
-
}, Object.defineProperty(
|
|
1340
|
-
var
|
|
1341
|
-
return { urlMappingKey:
|
|
1342
|
-
}, enumerable: false, configurable: true }),
|
|
2453
|
+
i2.validators = [[wa, X.MAX_LENGTH_ERROR], [Ca, X.NO_SPACES_ERROR], [Pa, X.NO_STARTING_OR_ENDING_SLASH_ERROR], [Ta, X.NO_EMPTY_SEGMENT_ERROR], [Na, X.NO_INVALID_CHARACTERS_ERROR], [Ea, X.CONTAIN_MAIN_VARIABLE_ERROR], [Oa, X.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [ja, X.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [Fa, X.ONLY_UNIQUE_SAVED_URL_ERROR], [Ma, X.ONLY_UNIQUE_MAPPING_ERROR]];
|
|
2454
|
+
}, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = La(t2, this.pathPrefix), this.initValidators();
|
|
2455
|
+
}
|
|
2456
|
+
return e5.prototype.getPathPrefix = function() {
|
|
2457
|
+
var t2 = aa(this.urlMappingKey);
|
|
2458
|
+
if (!t2) throw na(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})`);
|
|
2459
|
+
return this.pathPrefixes[t2] || e5.FALLBACK_PATH_PREFIX;
|
|
2460
|
+
}, Object.defineProperty(e5.prototype, "validatorProps", { get: function() {
|
|
2461
|
+
var e6 = this;
|
|
2462
|
+
return { urlMappingKey: e6.urlMappingKey, urlMappings: e6.urlMappings, pathPrefix: e6.pathPrefix, pathPrefixes: e6.pathPrefixes, defaultMapping: e6.defaultMapping };
|
|
2463
|
+
}, enumerable: false, configurable: true }), e5.prototype.validate = function(e6) {
|
|
1343
2464
|
var t2, n2;
|
|
1344
2465
|
try {
|
|
1345
|
-
for (var r2 =
|
|
1346
|
-
var a2 =
|
|
2466
|
+
for (var r2 = Vr(this.validators), i2 = r2.next(); !i2.done; i2 = r2.next()) {
|
|
2467
|
+
var a2 = B(i2.value, 2), o2 = a2[0], s2 = a2[1], c2 = !!o2(e6, this.validatorProps);
|
|
1347
2468
|
if (!c2) return { isValid: c2, error: s2 };
|
|
1348
2469
|
}
|
|
1349
|
-
} catch (
|
|
1350
|
-
t2 = { error:
|
|
2470
|
+
} catch (e7) {
|
|
2471
|
+
t2 = { error: e7 };
|
|
1351
2472
|
} finally {
|
|
1352
2473
|
try {
|
|
1353
2474
|
i2 && !i2.done && (n2 = r2.return) && n2.call(r2);
|
|
@@ -1356,50 +2477,50 @@ var ri = function() {
|
|
|
1356
2477
|
}
|
|
1357
2478
|
}
|
|
1358
2479
|
return { isValid: true };
|
|
1359
|
-
},
|
|
2480
|
+
}, e5.errorArray = Object.values(X), e5.MAX_URL_MAPPING_LENGTH = 1e3, e5.FALLBACK_PATH_PREFIX = `unknown`, e5;
|
|
1360
2481
|
}();
|
|
1361
|
-
var
|
|
1362
|
-
var n2 =
|
|
1363
|
-
return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix =
|
|
1364
|
-
return `{{${
|
|
1365
|
-
})), false).filter(Boolean).join(`/`), defaultPublished:
|
|
1366
|
-
return `{{${
|
|
2482
|
+
var La = function(e5, t2) {
|
|
2483
|
+
var n2 = ra()[e5] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
|
|
2484
|
+
return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = Ia.FALLBACK_PATH_PREFIX, a2.publishedPrefix = Ia.FALLBACK_PATH_PREFIX), { defaultSaved: Hr([a2.savedPrefix, i2], B(r2?.map(function(e6) {
|
|
2485
|
+
return `{{${e6}}}`;
|
|
2486
|
+
})), false).filter(Boolean).join(`/`), defaultPublished: Hr([a2.publishedPrefix, i2], B(r2?.map(function(e6) {
|
|
2487
|
+
return `{{${e6}}}`;
|
|
1367
2488
|
})), false).filter(Boolean).join(`/`) };
|
|
1368
2489
|
};
|
|
1369
|
-
function
|
|
1370
|
-
return t2 ?
|
|
2490
|
+
function Ra(e5, t2) {
|
|
2491
|
+
return t2 ? ya(e5, K.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
|
|
1371
2492
|
}
|
|
1372
|
-
function
|
|
1373
|
-
if (!
|
|
2493
|
+
function za(e5) {
|
|
2494
|
+
if (!e5) return;
|
|
1374
2495
|
let t2 = ``;
|
|
1375
|
-
return (
|
|
2496
|
+
return (e5.filename || e5.altText) && (t2 = `/${encodeURIComponent(e5.filename || e5.altText)}`), e5.id ? `wix:image://v1/${e5.id}${t2}#originWidth=${e5.width}&originHeight=${e5.height}` : e5.url;
|
|
1376
2497
|
}
|
|
1377
|
-
function
|
|
1378
|
-
return Object.keys(
|
|
2498
|
+
function Ba(e5) {
|
|
2499
|
+
return Object.keys(e5).length === 1 && `$and` in e5 && Array.isArray(e5.$and);
|
|
1379
2500
|
}
|
|
1380
|
-
function
|
|
1381
|
-
return Object.keys(
|
|
2501
|
+
function Va(e5) {
|
|
2502
|
+
return Object.keys(e5).length === 1 && `$or` in e5 && Array.isArray(e5.$or);
|
|
1382
2503
|
}
|
|
1383
|
-
function
|
|
1384
|
-
return Object.keys(
|
|
2504
|
+
function Ha(e5) {
|
|
2505
|
+
return Object.keys(e5).length === 1 && `$not` in e5 && typeof e5.$not == `object`;
|
|
1385
2506
|
}
|
|
1386
|
-
function
|
|
1387
|
-
return
|
|
2507
|
+
function Z(e5, t2) {
|
|
2508
|
+
return e5 === void 0 || Object.keys(e5).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e5 : { $and: [...Ba(e5) ? e5.$and : [e5], ...Ba(t2) ? t2.$and : [t2]] };
|
|
1388
2509
|
}
|
|
1389
|
-
function
|
|
1390
|
-
return
|
|
2510
|
+
function Ua(e5, t2) {
|
|
2511
|
+
return e5 === void 0 || Object.keys(e5).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e5 : { $or: [...Va(e5) ? e5.$or : [e5], ...Va(t2) ? t2.$or : [t2]] };
|
|
1391
2512
|
}
|
|
1392
|
-
function
|
|
1393
|
-
if (
|
|
2513
|
+
function Wa(e5) {
|
|
2514
|
+
if (e5 !== void 0 && Object.keys(e5).length !== 0) return Ha(e5) ? e5.$not : { $not: e5 };
|
|
1394
2515
|
}
|
|
1395
|
-
var
|
|
2516
|
+
var Ga = class {
|
|
1396
2517
|
_items;
|
|
1397
2518
|
_fetchNextPage;
|
|
1398
2519
|
_fetchPrevPage;
|
|
1399
2520
|
_originQuery;
|
|
1400
2521
|
_limit;
|
|
1401
|
-
constructor({ items:
|
|
1402
|
-
this._items =
|
|
2522
|
+
constructor({ items: e5, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }) {
|
|
2523
|
+
this._items = e5, this._fetchNextPage = n2, this._fetchPrevPage = r2, this._originQuery = t2, this._limit = i2;
|
|
1403
2524
|
}
|
|
1404
2525
|
get items() {
|
|
1405
2526
|
return this._items;
|
|
@@ -1422,12 +2543,12 @@ var fi = class {
|
|
|
1422
2543
|
return await this._fetchPrevPage();
|
|
1423
2544
|
}
|
|
1424
2545
|
};
|
|
1425
|
-
var
|
|
2546
|
+
var Ka = class extends Ga {
|
|
1426
2547
|
_nextCursor;
|
|
1427
2548
|
_prevCursor;
|
|
1428
2549
|
cursors;
|
|
1429
|
-
constructor({ items:
|
|
1430
|
-
super({ items:
|
|
2550
|
+
constructor({ items: e5, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2, nextCursor: a2, prevCursor: o2 }) {
|
|
2551
|
+
super({ items: e5, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }), this._nextCursor = a2, this._prevCursor = o2, this.cursors = { next: a2, prev: o2 };
|
|
1431
2552
|
}
|
|
1432
2553
|
hasNext() {
|
|
1433
2554
|
return !!this._nextCursor;
|
|
@@ -1436,12 +2557,12 @@ var pi = class extends fi {
|
|
|
1436
2557
|
return !!this._prevCursor;
|
|
1437
2558
|
}
|
|
1438
2559
|
};
|
|
1439
|
-
var
|
|
2560
|
+
var qa = class extends Ga {
|
|
1440
2561
|
_totalCount;
|
|
1441
2562
|
_offset;
|
|
1442
2563
|
_tooManyToCount;
|
|
1443
|
-
constructor({ items:
|
|
1444
|
-
super({ items:
|
|
2564
|
+
constructor({ items: e5, fetchNextPage: t2, fetchPrevPage: n2, offset: r2, originQuery: i2, limit: a2, totalCount: o2, tooManyToCount: s2 }) {
|
|
2565
|
+
super({ items: e5, fetchNextPage: t2, fetchPrevPage: n2, originQuery: i2, limit: a2 }), this._totalCount = o2, this._offset = r2, this._tooManyToCount = s2;
|
|
1445
2566
|
}
|
|
1446
2567
|
get currentPage() {
|
|
1447
2568
|
return this._limit === 0 ? void 0 : Math.floor(this._offset / this._limit);
|
|
@@ -1459,730 +2580,751 @@ var mi = class extends fi {
|
|
|
1459
2580
|
return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
|
|
1460
2581
|
}
|
|
1461
2582
|
};
|
|
1462
|
-
function
|
|
2583
|
+
function Ja(e5) {
|
|
1463
2584
|
let t2 = (n2) => ({ query: n2, async find() {
|
|
1464
2585
|
try {
|
|
1465
|
-
let r2 =
|
|
1466
|
-
if (
|
|
1467
|
-
let
|
|
1468
|
-
return new
|
|
2586
|
+
let r2 = e5.requestTransformer(e5.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e5.func(r2), { [Ke]: a2, [qe]: o2 } = e5.responseTransformer(i2);
|
|
2587
|
+
if (e5.pagingMethod === `OFFSET`) {
|
|
2588
|
+
let e6 = n2;
|
|
2589
|
+
return new qa({ items: a2 ?? [], fetchNextPage: () => t2({ ...e6, paging: { offset: e6.paging.offset + e6.paging.limit, limit: e6.paging.limit } }).find(), fetchPrevPage: () => t2({ ...n2, paging: { offset: Math.max(e6.paging.offset - e6.paging.limit, 0), limit: e6.paging.limit } }).find(), offset: e6.paging.offset, limit: e6.paging.limit, totalCount: o2?.total, tooManyToCount: o2?.tooManyToCount, originQuery: this });
|
|
1469
2590
|
}
|
|
1470
2591
|
let s2 = n2.cursorPaging;
|
|
1471
|
-
return new
|
|
2592
|
+
return new Ka({ items: a2 ?? [], limit: s2.limit, originQuery: this, fetchNextPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.next ?? void 0, limit: s2.limit } }).find(), fetchPrevPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.prev ?? void 0, limit: s2.limit } }).find(), prevCursor: o2?.cursors?.prev ?? void 0, nextCursor: o2?.cursors?.next ?? void 0 });
|
|
1472
2593
|
} catch (t3) {
|
|
1473
|
-
throw
|
|
2594
|
+
throw e5.errorTransformer(t3);
|
|
1474
2595
|
}
|
|
1475
|
-
}, skipTo(
|
|
1476
|
-
return t2({ ...n2, cursorPaging: { cursor:
|
|
2596
|
+
}, skipTo(e6) {
|
|
2597
|
+
return t2({ ...n2, cursorPaging: { cursor: e6, limit: n2.cursorPaging.limit } });
|
|
1477
2598
|
}, eq(r2, i2) {
|
|
1478
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
1479
|
-
return t2({ ...n2, filter:
|
|
2599
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [Q(e5.transformationPaths, r2)]: a2 };
|
|
2600
|
+
return t2({ ...n2, filter: Z(n2.filter, o2) });
|
|
1480
2601
|
}, ne(r2, i2) {
|
|
1481
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
1482
|
-
return t2({ ...n2, filter:
|
|
2602
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [Q(e5.transformationPaths, r2)]: { $ne: a2 } };
|
|
2603
|
+
return t2({ ...n2, filter: Z(n2.filter, o2) });
|
|
1483
2604
|
}, ge(r2, i2) {
|
|
1484
|
-
let a2 = { [
|
|
1485
|
-
return t2({ ...n2, filter:
|
|
2605
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $gte: i2 } };
|
|
2606
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
1486
2607
|
}, gt(r2, i2) {
|
|
1487
|
-
let a2 = { [
|
|
1488
|
-
return t2({ ...n2, filter:
|
|
2608
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $gt: i2 } };
|
|
2609
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
1489
2610
|
}, le(r2, i2) {
|
|
1490
|
-
let a2 = { [
|
|
1491
|
-
return t2({ ...n2, filter:
|
|
2611
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $lte: i2 } };
|
|
2612
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
1492
2613
|
}, lt(r2, i2) {
|
|
1493
|
-
let a2 = { [
|
|
1494
|
-
return t2({ ...n2, filter:
|
|
1495
|
-
}, isNotEmpty(
|
|
1496
|
-
return this.ne(
|
|
1497
|
-
}, isEmpty(
|
|
1498
|
-
return this.eq(
|
|
2614
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $lt: i2 } };
|
|
2615
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
2616
|
+
}, isNotEmpty(e6) {
|
|
2617
|
+
return this.ne(e6, null);
|
|
2618
|
+
}, isEmpty(e6) {
|
|
2619
|
+
return this.eq(e6, null);
|
|
1499
2620
|
}, startsWith(r2, i2) {
|
|
1500
|
-
let a2 = { [
|
|
1501
|
-
return t2({ ...n2, filter:
|
|
2621
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $startsWith: i2 } };
|
|
2622
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
1502
2623
|
}, endsWith(r2, i2) {
|
|
1503
|
-
let a2 = { [
|
|
1504
|
-
return t2({ ...n2, filter:
|
|
2624
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $endsWith: i2 } };
|
|
2625
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
1505
2626
|
}, contains(r2, i2) {
|
|
1506
|
-
let a2 = { [
|
|
1507
|
-
return t2({ ...n2, filter:
|
|
2627
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $contains: i2 } };
|
|
2628
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
1508
2629
|
}, hasSome(r2, ...i2) {
|
|
1509
|
-
let a2 = { [
|
|
1510
|
-
return t2({ ...n2, filter:
|
|
2630
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
2631
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
1511
2632
|
}, hasAll(r2, ...i2) {
|
|
1512
|
-
let a2 = { [
|
|
1513
|
-
return t2({ ...n2, filter:
|
|
1514
|
-
}, between(
|
|
1515
|
-
return this.ge(
|
|
2633
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
2634
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
2635
|
+
}, between(e6, t3, n3) {
|
|
2636
|
+
return this.ge(e6, t3).lt(e6, n3);
|
|
1516
2637
|
}, in(r2, i2) {
|
|
1517
|
-
let a2 = { [
|
|
1518
|
-
return t2({ ...n2, filter:
|
|
2638
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $in: i2 } };
|
|
2639
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
1519
2640
|
}, exists(r2, i2 = true) {
|
|
1520
|
-
let a2 = { [
|
|
1521
|
-
return t2({ ...n2, filter:
|
|
1522
|
-
}, or(
|
|
1523
|
-
return t2({ ...n2, filter:
|
|
1524
|
-
}, and(
|
|
1525
|
-
return t2({ ...n2, filter:
|
|
1526
|
-
}, not(
|
|
1527
|
-
return t2({ ...n2, filter:
|
|
2641
|
+
let a2 = { [Q(e5.transformationPaths, r2)]: { $exists: i2 } };
|
|
2642
|
+
return t2({ ...n2, filter: Z(n2.filter, a2) });
|
|
2643
|
+
}, or(e6) {
|
|
2644
|
+
return t2({ ...n2, filter: Ua(n2.filter, e6.query.filter) });
|
|
2645
|
+
}, and(e6) {
|
|
2646
|
+
return t2({ ...n2, filter: Z(n2.filter, e6.query.filter) });
|
|
2647
|
+
}, not(e6) {
|
|
2648
|
+
return t2({ ...n2, filter: Wa(e6.query.filter) });
|
|
1528
2649
|
}, ascending(...r2) {
|
|
1529
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
2650
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: Q(e5.transformationPaths, t3), order: `ASC` }))] });
|
|
1530
2651
|
}, descending(...r2) {
|
|
1531
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
1532
|
-
}, skip(
|
|
1533
|
-
return t2({ ...n2, paging: { offset:
|
|
2652
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: Q(e5.transformationPaths, t3), order: `DESC` }))] });
|
|
2653
|
+
}, skip(e6) {
|
|
2654
|
+
return t2({ ...n2, paging: { offset: e6, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
|
|
1534
2655
|
}, limit(r2) {
|
|
1535
|
-
if (
|
|
1536
|
-
let
|
|
1537
|
-
return t2({ ...n2, cursorPaging: { limit: r2, cursor: `cursor` in
|
|
2656
|
+
if (e5.pagingMethod === `CURSOR`) {
|
|
2657
|
+
let e6 = n2;
|
|
2658
|
+
return t2({ ...n2, cursorPaging: { limit: r2, cursor: `cursor` in e6.cursorPaging ? e6.cursorPaging.cursor : void 0 } });
|
|
1538
2659
|
}
|
|
1539
2660
|
let i2 = n2;
|
|
1540
2661
|
return t2({ ...n2, paging: { limit: r2, offset: `offset` in i2.paging ? i2.paging.offset : 0 } });
|
|
1541
2662
|
} });
|
|
1542
|
-
return t2({ filter: {}, ...
|
|
2663
|
+
return t2({ filter: {}, ...e5.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
|
|
1543
2664
|
}
|
|
1544
|
-
function
|
|
1545
|
-
let n2 = Object.entries(
|
|
1546
|
-
return n2 ? t2.replace(n2,
|
|
2665
|
+
function Q(e5, t2) {
|
|
2666
|
+
let n2 = Object.entries(e5).find(([e6]) => e6 === t2 || t2.startsWith(`${e6}.`))?.[0];
|
|
2667
|
+
return n2 ? t2.replace(n2, e5[n2]) : Ye(t2, { ...e5, ...Je });
|
|
1547
2668
|
}
|
|
1548
|
-
function
|
|
1549
|
-
let r2 = (r3, i3) =>
|
|
2669
|
+
function Ya(e5, t2, n2 = {}) {
|
|
2670
|
+
let r2 = (r3, i3) => Ya(e5, t2, { ...n2, [r3]: i3 }), i2 = () => Object.keys(n2).length === 0 ? {} : { [Xe(e5, t2)]: n2 };
|
|
1550
2671
|
return { get filter() {
|
|
1551
2672
|
return i2();
|
|
1552
|
-
}, eq: (
|
|
2673
|
+
}, eq: (e6) => r2(`$eq`, e6), ne: (e6) => r2(`$ne`, e6), gt: (e6) => r2(`$gt`, e6), gte: (e6) => r2(`$gte`, e6), lt: (e6) => r2(`$lt`, e6), lte: (e6) => r2(`$lte`, e6), startsWith: (e6) => r2(`$startsWith`, e6), endsWith: (e6) => r2(`$endsWith`, e6), contains: (e6) => r2(`$contains`, e6), in: (e6) => r2(`$in`, e6), nin: (e6) => r2(`$nin`, e6), hasSome: (e6) => r2(`$hasSome`, e6), hasAll: (e6) => r2(`$hasAll`, e6), exists: (e6 = true) => r2(`$exists`, e6), isEmpty: (e6 = true) => r2(`$isEmpty`, e6), isNotEmpty: () => r2(`$ne`, null) };
|
|
1553
2674
|
}
|
|
1554
|
-
function
|
|
1555
|
-
return Object.assign((t2) =>
|
|
2675
|
+
function Xa(e5) {
|
|
2676
|
+
return Object.assign((t2) => Ya(t2, e5), { and: (...e6) => ({ filter: { $and: e6.map((e7) => e7.filter) } }), or: (...e6) => ({ filter: { $or: e6.map((e7) => e7.filter) } }), not: (e6) => ({ filter: { $not: e6.filter } }) });
|
|
1556
2677
|
}
|
|
1557
|
-
function
|
|
1558
|
-
return (t2) => ({ asc: () => ({ sort: { fieldName: Xe(t2,
|
|
2678
|
+
function Za(e5) {
|
|
2679
|
+
return (t2) => ({ asc: () => ({ sort: { fieldName: Xe(t2, e5), order: `ASC` } }), desc: () => ({ sort: { fieldName: Xe(t2, e5), order: `DESC` } }) });
|
|
1559
2680
|
}
|
|
1560
|
-
function
|
|
2681
|
+
function Qa(e5) {
|
|
1561
2682
|
return () => {
|
|
1562
|
-
let t2 = {}, n2 = { withFilter(
|
|
1563
|
-
return t2 = { ...t2, filter:
|
|
2683
|
+
let t2 = {}, n2 = { withFilter(e6) {
|
|
2684
|
+
return t2 = { ...t2, filter: e6.filter }, n2;
|
|
1564
2685
|
}, withFields(...r2) {
|
|
1565
|
-
return t2 = { ...t2, fields: r2.map((t3) => Xe(t3,
|
|
1566
|
-
}, withSorting(...
|
|
1567
|
-
return t2 = { ...t2, sort:
|
|
1568
|
-
}, withPaging(
|
|
1569
|
-
return t2 = { ...t2, paging:
|
|
2686
|
+
return t2 = { ...t2, fields: r2.map((t3) => Xe(t3, e5)) }, n2;
|
|
2687
|
+
}, withSorting(...e6) {
|
|
2688
|
+
return t2 = { ...t2, sort: e6.map((e7) => e7.sort) }, n2;
|
|
2689
|
+
}, withPaging(e6) {
|
|
2690
|
+
return t2 = { ...t2, paging: e6 }, n2;
|
|
1570
2691
|
}, build() {
|
|
1571
2692
|
return t2;
|
|
1572
2693
|
} };
|
|
1573
2694
|
return n2;
|
|
1574
2695
|
};
|
|
1575
2696
|
}
|
|
1576
|
-
function
|
|
1577
|
-
return { QueryBuilder:
|
|
2697
|
+
function $a(e5) {
|
|
2698
|
+
return { QueryBuilder: Qa(e5), Filter: Xa(e5), Sort: Za(e5) };
|
|
1578
2699
|
}
|
|
1579
|
-
var
|
|
1580
|
-
var
|
|
1581
|
-
var
|
|
1582
|
-
var
|
|
1583
|
-
var
|
|
1584
|
-
var
|
|
1585
|
-
function
|
|
1586
|
-
return !
|
|
2700
|
+
var eo = `filter`;
|
|
2701
|
+
var to = `sort`;
|
|
2702
|
+
var no = `cursorPaging`;
|
|
2703
|
+
var ro = `paging`;
|
|
2704
|
+
var io = [eo, to, no];
|
|
2705
|
+
var ao = [eo, to, ro];
|
|
2706
|
+
function oo(e5, t2) {
|
|
2707
|
+
return !e5 || typeof e5 != `object` ? false : t2.some((t3) => e5.hasOwnProperty(t3));
|
|
1587
2708
|
}
|
|
1588
|
-
function
|
|
1589
|
-
return
|
|
2709
|
+
function so(e5) {
|
|
2710
|
+
return oo(e5, io);
|
|
1590
2711
|
}
|
|
1591
|
-
function
|
|
1592
|
-
return
|
|
2712
|
+
function co(e5) {
|
|
2713
|
+
return oo(e5, ao);
|
|
1593
2714
|
}
|
|
1594
|
-
function
|
|
1595
|
-
let { hasOptionsParameter: t2 } =
|
|
2715
|
+
function lo(e5) {
|
|
2716
|
+
let { hasOptionsParameter: t2 } = e5;
|
|
1596
2717
|
return function(...n2) {
|
|
1597
|
-
return t2 ?
|
|
2718
|
+
return t2 ? fo(n2, e5) : uo(n2, e5);
|
|
1598
2719
|
};
|
|
1599
2720
|
}
|
|
1600
|
-
function
|
|
1601
|
-
return
|
|
2721
|
+
function uo(e5, t2) {
|
|
2722
|
+
return e5.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e5[0]);
|
|
1602
2723
|
}
|
|
1603
|
-
function
|
|
1604
|
-
switch (
|
|
2724
|
+
function fo(e5, t2) {
|
|
2725
|
+
switch (e5.length) {
|
|
1605
2726
|
case 0:
|
|
1606
2727
|
return t2.builderQueryFunction();
|
|
1607
2728
|
case 1:
|
|
1608
|
-
return
|
|
2729
|
+
return so(e5[0]) || co(e5[0]) ? t2.typedQueryFunction(e5[0]) : t2.builderQueryFunction(e5[0]);
|
|
1609
2730
|
default:
|
|
1610
|
-
return t2.typedQueryFunction(
|
|
2731
|
+
return t2.typedQueryFunction(e5[0], e5[1]);
|
|
1611
2732
|
}
|
|
1612
2733
|
}
|
|
1613
|
-
function
|
|
1614
|
-
return
|
|
2734
|
+
function po(e5) {
|
|
2735
|
+
return It(Object.assign(e5, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }, { srcPath: `/_api/v1/serviceOptionsAndVariants`, destPath: `/v1/serviceOptionsAndVariants` }, { srcPath: `/_api/bookings/v1/service-options-and-variants`, destPath: `` }], _: [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }, { srcPath: `/_api/v1/serviceOptionsAndVariants`, destPath: `/v1/serviceOptionsAndVariants` }], "*.dev.wix-code.com": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }], "editor._base_domain_": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }, { srcPath: `/_api/bookings/v1/service-options-and-variants`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }, { srcPath: `/_api/bookings/v1/service-options-and-variants`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }, { srcPath: `/_api/bookings/v1/service-options-and-variants`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/bookings/v1/serviceOptionsAndVariants`, destPath: `/v1/serviceOptionsAndVariants` }], "bo._base_domain_": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }], "wixbo.ai": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }], "wix-bo.com": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/serviceOptionsAndVariants` }], "www._base_domain_": [{ srcPath: `/_api/v1/service-options-and-variants`, destPath: `/v1/service-options-and-variants` }] } }));
|
|
1615
2736
|
}
|
|
1616
|
-
var
|
|
1617
|
-
function
|
|
2737
|
+
var mo = `@wix/auto_sdk_bookings_service-options-and-variants`;
|
|
2738
|
+
function ho(e5) {
|
|
1618
2739
|
function t2({ host: t3 }) {
|
|
1619
|
-
return { entityFqdn: `wix.bookings.catalog.v1.service_options_and_variants`, method: `POST`, methodFqn: `wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.QueryServiceOptionsAndVariants`, packageName:
|
|
2740
|
+
return { entityFqdn: `wix.bookings.catalog.v1.service_options_and_variants`, method: `POST`, methodFqn: `wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.QueryServiceOptionsAndVariants`, packageName: mo, migrationOptions: { optInTransformResponse: true }, url: po({ protoPath: `/v1/serviceOptionsAndVariants/query`, data: e5, host: t3 }), data: e5 };
|
|
1620
2741
|
}
|
|
1621
2742
|
return t2;
|
|
1622
2743
|
}
|
|
1623
|
-
function
|
|
1624
|
-
let { httpClient:
|
|
1625
|
-
return
|
|
1626
|
-
let r2 =
|
|
2744
|
+
function go() {
|
|
2745
|
+
let { httpClient: e5, sideEffects: t2 } = arguments[0];
|
|
2746
|
+
return Ja({ func: async (n2) => {
|
|
2747
|
+
let r2 = ho(n2);
|
|
1627
2748
|
t2?.onSiteCall?.();
|
|
1628
2749
|
try {
|
|
1629
|
-
let n3 = await
|
|
2750
|
+
let n3 = await e5.request(r2);
|
|
1630
2751
|
return t2?.onSuccess?.(n3), n3;
|
|
1631
|
-
} catch (
|
|
1632
|
-
throw t2?.onError?.(
|
|
2752
|
+
} catch (e6) {
|
|
2753
|
+
throw t2?.onError?.(e6), e6;
|
|
1633
2754
|
}
|
|
1634
|
-
}, requestTransformer: (
|
|
1635
|
-
let t3 = [
|
|
2755
|
+
}, requestTransformer: (e6) => {
|
|
2756
|
+
let t3 = [e6, {}];
|
|
1636
2757
|
return A({ ...t3?.[1], query: t3?.[0] });
|
|
1637
|
-
}, responseTransformer: ({ data:
|
|
1638
|
-
let t3 = j(N(
|
|
2758
|
+
}, responseTransformer: ({ data: e6 }) => {
|
|
2759
|
+
let t3 = j(N(e6, []));
|
|
1639
2760
|
return { items: t3?.serviceOptionsAndVariantsList, pagingMetadata: t3?.pagingMetadata };
|
|
1640
|
-
}, errorTransformer: (
|
|
1641
|
-
throw P(
|
|
2761
|
+
}, errorTransformer: (e6) => {
|
|
2762
|
+
throw P(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
1642
2763
|
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
1643
2764
|
}
|
|
1644
|
-
async function
|
|
1645
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
2765
|
+
async function _o(e5) {
|
|
2766
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ho(A({ query: e5 }));
|
|
1646
2767
|
n2?.onSiteCall?.();
|
|
1647
2768
|
try {
|
|
1648
|
-
let
|
|
1649
|
-
return n2?.onSuccess?.(
|
|
1650
|
-
} catch (
|
|
1651
|
-
let t3 = P(
|
|
1652
|
-
throw n2?.onError?.(
|
|
2769
|
+
let e6 = await t2.request(r2);
|
|
2770
|
+
return n2?.onSuccess?.(e6), j(e6.data);
|
|
2771
|
+
} catch (e6) {
|
|
2772
|
+
let t3 = P(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`]);
|
|
2773
|
+
throw n2?.onError?.(e6), t3;
|
|
1653
2774
|
}
|
|
1654
2775
|
}
|
|
1655
|
-
function
|
|
1656
|
-
return () =>
|
|
2776
|
+
function vo(e5) {
|
|
2777
|
+
return () => go({ httpClient: e5 });
|
|
1657
2778
|
}
|
|
1658
|
-
function
|
|
1659
|
-
return (t2) =>
|
|
2779
|
+
function yo(e5) {
|
|
2780
|
+
return (t2) => _o(t2, { httpClient: e5 });
|
|
1660
2781
|
}
|
|
1661
|
-
function
|
|
1662
|
-
let t2 =
|
|
1663
|
-
function n2(
|
|
2782
|
+
function bo(e5) {
|
|
2783
|
+
let t2 = lo({ builderQueryFunction: () => vo(e5)(), typedQueryFunction: (t3) => yo(e5)(t3), hasOptionsParameter: false });
|
|
2784
|
+
function n2(e6) {
|
|
1664
2785
|
return t2(...arguments);
|
|
1665
2786
|
}
|
|
1666
2787
|
return n2;
|
|
1667
2788
|
}
|
|
1668
|
-
var
|
|
1669
|
-
function
|
|
1670
|
-
if (
|
|
2789
|
+
var xo = Pt(bo);
|
|
2790
|
+
function So(e5) {
|
|
2791
|
+
if (e5) return e5.url;
|
|
1671
2792
|
}
|
|
1672
|
-
var
|
|
1673
|
-
var
|
|
1674
|
-
function
|
|
1675
|
-
return
|
|
2793
|
+
var Co = [{ path: `services.createdDate` }, { path: `services.updatedDate` }, { path: `services.media.items.image.urlExpirationDate` }, { path: `services.media.mainMedia.image.urlExpirationDate` }, { path: `services.media.coverMedia.image.urlExpirationDate` }, { path: `services.payment.subscription.recurringStartDate` }, { path: `services.bookingPolicy.createdDate` }, { path: `services.bookingPolicy.updatedDate` }, { path: `services.schedule.firstSessionStart` }, { path: `services.schedule.lastSessionEnd` }, { path: `services.staffMembers.mainMedia.image.urlExpirationDate` }, { path: `services.staffMemberDetails.staffMembers.mainMedia.image.urlExpirationDate` }, { path: `services.supportedSlugs.createdDate` }, { path: `services.mainSlug.createdDate` }];
|
|
2794
|
+
var wo = [{ path: `services.locations.business.address.geocode.latitude` }, { path: `services.locations.business.address.geocode.longitude` }, { path: `services.locations.custom.address.geocode.latitude` }, { path: `services.locations.custom.address.geocode.longitude` }, { path: `services.locations.calculatedAddress.geocode.latitude` }, { path: `services.locations.calculatedAddress.geocode.longitude` }];
|
|
2795
|
+
function To(e5) {
|
|
2796
|
+
return It(Object.assign(e5, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
|
|
1676
2797
|
}
|
|
1677
|
-
var
|
|
1678
|
-
function
|
|
2798
|
+
var Eo = `@wix/auto_sdk_bookings_services`;
|
|
2799
|
+
function Do(e5) {
|
|
1679
2800
|
function t2({ host: t3 }) {
|
|
1680
|
-
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryServices`, packageName:
|
|
2801
|
+
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryServices`, packageName: Eo, migrationOptions: { optInTransformResponse: true }, url: To({ protoPath: `/v2/services/query`, data: e5, host: t3 }), data: e5, transformResponse: (e6) => N(e6, [{ transformFn: M, paths: Co }, { transformFn: un, paths: wo }]) };
|
|
1681
2802
|
}
|
|
1682
2803
|
return t2;
|
|
1683
2804
|
}
|
|
1684
|
-
var
|
|
1685
|
-
var
|
|
1686
|
-
var
|
|
1687
|
-
var
|
|
1688
|
-
var
|
|
1689
|
-
var
|
|
1690
|
-
function
|
|
2805
|
+
var Oo = [{ path: `services.media.items.image` }, { path: `services.media.mainMedia.image` }, { path: `services.media.coverMedia.image` }, { path: `services.staffMembers.mainMedia.image` }, { path: `services.staffMemberDetails.staffMembers.mainMedia.image` }];
|
|
2806
|
+
var ko = [{ path: `services.locations.calculatedAddress` }, { path: `services.locations.business.address` }, { path: `services.locations.custom.address` }];
|
|
2807
|
+
var Ao = [{ path: `services.urls.servicePage` }, { path: `services.urls.bookingPage` }, { path: `services.urls.calendarPage` }];
|
|
2808
|
+
var jo = ((e5) => (e5.APPOINTMENT = `APPOINTMENT`, e5.CLASS = `CLASS`, e5.COURSE = `COURSE`, e5))(jo || {});
|
|
2809
|
+
var Mo = ((e5) => (e5.FIXED = `FIXED`, e5.CUSTOM = `CUSTOM`, e5.VARIED = `VARIED`, e5.NO_FEE = `NO_FEE`, e5.SUBSCRIPTION = `SUBSCRIPTION`, e5))(Mo || {});
|
|
2810
|
+
var No = ((e5) => (e5.CUSTOM = `CUSTOM`, e5.BUSINESS = `BUSINESS`, e5.CUSTOMER = `CUSTOMER`, e5))(No || {});
|
|
2811
|
+
function Po(e5) {
|
|
1691
2812
|
let { httpClient: t2, sideEffects: n2 } = arguments[1];
|
|
1692
|
-
return
|
|
1693
|
-
let i2 =
|
|
2813
|
+
return Ja({ func: async (r2) => {
|
|
2814
|
+
let i2 = Do({ ...r2, ...e5 ?? {} });
|
|
1694
2815
|
n2?.onSiteCall?.();
|
|
1695
2816
|
try {
|
|
1696
|
-
let
|
|
1697
|
-
return n2?.onSuccess?.(
|
|
1698
|
-
} catch (
|
|
1699
|
-
throw n2?.onError?.(
|
|
2817
|
+
let e6 = await t2.request(i2);
|
|
2818
|
+
return n2?.onSuccess?.(e6), e6;
|
|
2819
|
+
} catch (e6) {
|
|
2820
|
+
throw n2?.onError?.(e6), e6;
|
|
1700
2821
|
}
|
|
1701
2822
|
}, requestTransformer: (t3) => {
|
|
1702
|
-
let n3 = [t3,
|
|
2823
|
+
let n3 = [t3, e5];
|
|
1703
2824
|
return A({ ...n3?.[1], query: n3?.[0] });
|
|
1704
|
-
}, responseTransformer: ({ data:
|
|
1705
|
-
let t3 = j(N(
|
|
2825
|
+
}, responseTransformer: ({ data: e6 }) => {
|
|
2826
|
+
let t3 = j(N(e6, [{ transformFn: za, paths: Oo }, { transformFn: dn, paths: ko }, { transformFn: So, paths: Ao }]));
|
|
1706
2827
|
return { items: t3?.services, pagingMetadata: t3?.pagingMetadata };
|
|
1707
|
-
}, errorTransformer: (
|
|
1708
|
-
throw P(
|
|
2828
|
+
}, errorTransformer: (e6) => {
|
|
2829
|
+
throw P(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
1709
2830
|
}, pagingMethod: `OFFSET`, transformationPaths: {} });
|
|
1710
2831
|
}
|
|
1711
|
-
async function
|
|
1712
|
-
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 =
|
|
2832
|
+
async function Fo(e5, t2) {
|
|
2833
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = Do(A({ query: e5, ...t2 }));
|
|
1713
2834
|
r2?.onSiteCall?.();
|
|
1714
2835
|
try {
|
|
1715
|
-
let
|
|
1716
|
-
return r2?.onSuccess?.(
|
|
1717
|
-
} catch (
|
|
1718
|
-
let t3 = P(
|
|
1719
|
-
throw r2?.onError?.(
|
|
2836
|
+
let e6 = await n2.request(i2);
|
|
2837
|
+
return r2?.onSuccess?.(e6), j(N(e6.data, [{ transformFn: za, paths: Oo }, { transformFn: dn, paths: ko }, { transformFn: So, paths: Ao }]));
|
|
2838
|
+
} catch (e6) {
|
|
2839
|
+
let t3 = P(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
|
|
2840
|
+
throw r2?.onError?.(e6), t3;
|
|
1720
2841
|
}
|
|
1721
2842
|
}
|
|
1722
|
-
function
|
|
1723
|
-
return (t2) =>
|
|
2843
|
+
function Io(e5) {
|
|
2844
|
+
return (t2) => Po(t2, { httpClient: e5 });
|
|
1724
2845
|
}
|
|
1725
|
-
function
|
|
1726
|
-
return (t2, n2) =>
|
|
2846
|
+
function Lo(e5) {
|
|
2847
|
+
return (t2, n2) => Fo(t2, n2, { httpClient: e5 });
|
|
1727
2848
|
}
|
|
1728
|
-
function
|
|
1729
|
-
let t2 =
|
|
1730
|
-
function n2(
|
|
2849
|
+
function Ro(e5) {
|
|
2850
|
+
let t2 = lo({ builderQueryFunction: (t3) => Io(e5)(t3), typedQueryFunction: (t3, n3) => Lo(e5)(t3, n3), hasOptionsParameter: true });
|
|
2851
|
+
function n2(e6, n3) {
|
|
1731
2852
|
return t2(...arguments);
|
|
1732
2853
|
}
|
|
1733
2854
|
return n2;
|
|
1734
2855
|
}
|
|
1735
|
-
var
|
|
1736
|
-
var
|
|
1737
|
-
var
|
|
1738
|
-
function
|
|
1739
|
-
return
|
|
2856
|
+
var zo = Pt(Ro);
|
|
2857
|
+
var Bo = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
|
|
2858
|
+
var Vo = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
|
|
2859
|
+
function Ho(e5) {
|
|
2860
|
+
return It(Object.assign(e5, { 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: `` }] } }));
|
|
1740
2861
|
}
|
|
1741
|
-
var
|
|
1742
|
-
function
|
|
2862
|
+
var Uo = `@wix/auto_sdk_bookings_bookings-settings`;
|
|
2863
|
+
function Wo(e5) {
|
|
1743
2864
|
function t2({ host: t3 }) {
|
|
1744
|
-
return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName:
|
|
2865
|
+
return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Uo, migrationOptions: { optInTransformResponse: true }, url: Ho({ protoPath: `/v2/settings`, data: e5, host: t3 }), params: Ft(e5), transformResponse: (e6) => N(e6, [{ transformFn: M, paths: Bo }, { transformFn: un, paths: Vo }]), fallback: [{ method: `GET`, url: Ho({ protoPath: `/v2/settings`, data: e5, host: t3 }), params: Ft(e5) }] };
|
|
1745
2866
|
}
|
|
1746
2867
|
return t2;
|
|
1747
2868
|
}
|
|
1748
|
-
var
|
|
1749
|
-
async function
|
|
1750
|
-
let { httpClient:
|
|
2869
|
+
var Go = ((e5) => (e5.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e5.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e5))(Go || {});
|
|
2870
|
+
async function Ko() {
|
|
2871
|
+
let { httpClient: e5, sideEffects: t2 } = arguments[0], n2 = Wo(A({}));
|
|
1751
2872
|
t2?.onSiteCall?.();
|
|
1752
2873
|
try {
|
|
1753
|
-
let r2 = await
|
|
2874
|
+
let r2 = await e5.request(n2);
|
|
1754
2875
|
return t2?.onSuccess?.(r2), j(r2.data)?.bookingsSettings;
|
|
1755
|
-
} catch (
|
|
1756
|
-
let n3 = P(
|
|
1757
|
-
throw t2?.onError?.(
|
|
2876
|
+
} catch (e6) {
|
|
2877
|
+
let n3 = P(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
|
|
2878
|
+
throw t2?.onError?.(e6), n3;
|
|
1758
2879
|
}
|
|
1759
2880
|
}
|
|
1760
|
-
function
|
|
1761
|
-
return () =>
|
|
2881
|
+
function qo(e5) {
|
|
2882
|
+
return () => Ko({ httpClient: e5 });
|
|
1762
2883
|
}
|
|
1763
|
-
var
|
|
1764
|
-
var
|
|
1765
|
-
var
|
|
1766
|
-
var
|
|
1767
|
-
function
|
|
1768
|
-
return
|
|
2884
|
+
var Jo = Pt(qo);
|
|
2885
|
+
var Yo = (e5) => e5 === jo.APPOINTMENT;
|
|
2886
|
+
var Xo = (e5) => e5.payment?.rateType === Mo.VARIED;
|
|
2887
|
+
var Zo = [`STAFF_MEMBER_DETAILS`, `STAFF_WORKING_HOURS_LOCATIONS`, `DISCOUNT_INFO_DETAILS`];
|
|
2888
|
+
function Qo() {
|
|
2889
|
+
return zo({ conditionalFields: Zo }).eq(`appId`, Ni).eq(`hidden`, false);
|
|
1769
2890
|
}
|
|
1770
|
-
async function
|
|
2891
|
+
async function $o({ limit: e5, offset: t2, categoryId: n2, locationId: r2, serviceIds: i2, categoryIds: a2 }) {
|
|
1771
2892
|
if (n2 && a2?.length && !a2.includes(n2)) return { services: [], hasMore: false, totalPages: 1 };
|
|
1772
|
-
let o2 =
|
|
1773
|
-
i2?.length && (o2 = o2.in(`_id`, i2)), n2 ? o2 = o2.eq(`category.id`, n2) : a2?.length && (o2 = o2.in(`category.id`, a2)), r2 === `OTHER_LOCATIONS` ? o2 = o2.hasSome(`locations.type`, [
|
|
2893
|
+
let o2 = Qo().limit(e5).skip(t2);
|
|
2894
|
+
i2?.length && (o2 = o2.in(`_id`, i2)), n2 ? o2 = o2.eq(`category.id`, n2) : a2?.length && (o2 = o2.in(`category.id`, a2)), r2 === `OTHER_LOCATIONS` ? o2 = o2.hasSome(`locations.type`, [No.CUSTOM, No.CUSTOMER]) : r2 && (o2 = o2.eq(`locations.business.id`, r2));
|
|
1774
2895
|
let s2 = await o2.find();
|
|
1775
2896
|
return { services: s2.items ?? [], hasMore: s2.hasNext(), totalPages: s2.totalPages ?? 1 };
|
|
1776
2897
|
}
|
|
1777
|
-
var
|
|
1778
|
-
function
|
|
1779
|
-
let n2 =
|
|
2898
|
+
var es = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
2899
|
+
function ts(e5, t2) {
|
|
2900
|
+
let n2 = e5(t2);
|
|
1780
2901
|
return n2 ? n2.replace(/\/$/, ``) || `/` : null;
|
|
1781
2902
|
}
|
|
1782
|
-
function
|
|
1783
|
-
let r2 =
|
|
2903
|
+
function ns(e5, t2, n2) {
|
|
2904
|
+
let r2 = e5(t2);
|
|
1784
2905
|
return !r2 || !n2 ? null : `${r2.replace(/\/$/, ``)}/${n2}`;
|
|
1785
2906
|
}
|
|
1786
|
-
function
|
|
1787
|
-
switch (
|
|
2907
|
+
function rs(e5, t2) {
|
|
2908
|
+
switch (e5) {
|
|
1788
2909
|
case `servicePage`:
|
|
1789
|
-
return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ??
|
|
2910
|
+
return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? ns(t2.appSectionUrl, W.SERVICE_PAGE, t2.slug);
|
|
1790
2911
|
case `bookingCalendar`:
|
|
1791
|
-
return t2.isMultiService ?
|
|
2912
|
+
return t2.isMultiService ? ts(t2.appSectionUrl, W.CALENDAR_PAGE) : ns(t2.appSectionUrl, W.CALENDAR_PAGE, t2.slug);
|
|
1792
2913
|
case `bookingForm`:
|
|
1793
|
-
return t2.serviceId ?
|
|
2914
|
+
return t2.serviceId ? ns(t2.appSectionUrl, W.FORM_PAGE, t2.slug) : null;
|
|
1794
2915
|
default:
|
|
1795
2916
|
return null;
|
|
1796
2917
|
}
|
|
1797
2918
|
}
|
|
1798
|
-
var
|
|
1799
|
-
var
|
|
1800
|
-
var
|
|
1801
|
-
var
|
|
1802
|
-
var
|
|
1803
|
-
let { previewMode:
|
|
1804
|
-
let i2 =
|
|
2919
|
+
var is = (e5) => e5.target === `_blank`;
|
|
2920
|
+
var as = (e5, t2) => t2 === `/` ? e5 : new URL(`.${t2}`, `${e5}/`).href;
|
|
2921
|
+
var os = (e5, t2, n2) => n2 ? `.${t2}` : ss(e5, t2);
|
|
2922
|
+
var ss = (e5, t2) => e5 ? as(e5, t2) : t2;
|
|
2923
|
+
var cs = () => {
|
|
2924
|
+
let { previewMode: e5 } = (0, import_services_manager_react.useService)(ki), t2 = (0, import_services_manager_react.useService)(vi), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: r2 } = (0, import_services_manager_react.useService)(ji), a2 = (0, import_services_manager_react.useService)(Mi), o2 = (0, import_services_manager_react.useGetService)(), s2 = (0, import_react.useCallback)(async (t3) => {
|
|
2925
|
+
let i2 = os(n2, t3, e5);
|
|
1805
2926
|
await r2({ href: i2 });
|
|
1806
|
-
}, [
|
|
1807
|
-
await r2(
|
|
1808
|
-
}, [r2]), l2 = (0, import_react.useCallback)((
|
|
1809
|
-
let r3 = m2(
|
|
1810
|
-
return r3 && n2 ?
|
|
1811
|
-
}, [m2, n2]),
|
|
1812
|
-
let n3 = m2(
|
|
2927
|
+
}, [e5, n2, r2]), c2 = (0, import_react.useCallback)(async (e6) => {
|
|
2928
|
+
await r2(is(e6) ? { href: e6.href, type: `ExternalLink`, target: `_blank` } : { href: e6.href });
|
|
2929
|
+
}, [r2]), l2 = (0, import_react.useCallback)((e6) => ss(n2, e6), [n2]), u2 = (0, import_react.useCallback)((e6) => t2.appSectionRelativeUrl(Ni, e6), [t2]), d2 = (0, import_react.useCallback)((e6) => Ra(a2.urlMappings, e6), [a2]), m2 = (0, import_react.useCallback)((e6, t3) => rs(e6, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: d2 }), [u2, d2]), h2 = (0, import_react.useCallback)((e6, t3) => {
|
|
2930
|
+
let r3 = m2(e6, t3);
|
|
2931
|
+
return r3 && n2 ? as(n2, r3) : null;
|
|
2932
|
+
}, [m2, n2]), g2 = (0, import_react.useCallback)((e6, t3) => {
|
|
2933
|
+
let n3 = m2(e6, t3);
|
|
1813
2934
|
n3 && s2(n3);
|
|
1814
|
-
}, [m2, s2]),
|
|
1815
|
-
return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl:
|
|
1816
|
-
let t3 =
|
|
1817
|
-
return t3 ? `${t3}/${
|
|
1818
|
-
}, [
|
|
1819
|
-
};
|
|
1820
|
-
var
|
|
1821
|
-
function
|
|
2935
|
+
}, [m2, s2]), _2 = (0, import_react.useCallback)(() => u2(W.FORM_PAGE) || void 0, [u2]), v2 = (0, import_react.useCallback)((e6) => Object.values(o2(Ai).pages).some((t3) => t3.appPageId === e6 && (!t3.appDefinitionId || t3.appDefinitionId === `1380b703-ce81-ff05-f115-39571d94dfcd`)) && t2.appSectionRelativeUrl(`1380b703-ce81-ff05-f115-39571d94dfcd`, e6) || void 0, [t2, o2]);
|
|
2936
|
+
return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: (0, import_react.useCallback)(() => v2(Pi), [v2]), getThankYouPagePath: (0, import_react.useCallback)((e6) => {
|
|
2937
|
+
let t3 = v2(Fi);
|
|
2938
|
+
return t3 ? `${t3}/${e6}?origin=bookings` : void 0;
|
|
2939
|
+
}, [v2]) };
|
|
2940
|
+
};
|
|
2941
|
+
var ls = U(`@wix/site-service-warmup-data`);
|
|
2942
|
+
function us() {
|
|
1822
2943
|
try {
|
|
1823
2944
|
return (0, import_services_manager_react.useGetService)();
|
|
1824
2945
|
} catch {
|
|
1825
2946
|
return null;
|
|
1826
2947
|
}
|
|
1827
2948
|
}
|
|
1828
|
-
function
|
|
2949
|
+
function ds(e5) {
|
|
1829
2950
|
try {
|
|
1830
|
-
return
|
|
2951
|
+
return e5 ? e5(ls) : null;
|
|
1831
2952
|
} catch {
|
|
1832
2953
|
return null;
|
|
1833
2954
|
}
|
|
1834
2955
|
}
|
|
1835
|
-
function
|
|
1836
|
-
let
|
|
1837
|
-
return { scope:
|
|
1838
|
-
if (t2 || !
|
|
2956
|
+
function fs() {
|
|
2957
|
+
let e5 = ds(us()), t2 = typeof window > `u`;
|
|
2958
|
+
return { scope: e5 ?? void 0, get: async (n2) => {
|
|
2959
|
+
if (t2 || !e5) return null;
|
|
1839
2960
|
try {
|
|
1840
|
-
return await
|
|
1841
|
-
} catch (
|
|
1842
|
-
return
|
|
2961
|
+
return await e5.get(n2);
|
|
2962
|
+
} catch (e6) {
|
|
2963
|
+
return H(e6, { feature: V.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
|
|
1843
2964
|
}
|
|
1844
2965
|
}, set: (n2, r2) => {
|
|
1845
|
-
if (t2 &&
|
|
1846
|
-
|
|
2966
|
+
if (t2 && e5) try {
|
|
2967
|
+
e5.set(n2, r2);
|
|
1847
2968
|
} catch {
|
|
1848
2969
|
}
|
|
1849
2970
|
} };
|
|
1850
2971
|
}
|
|
1851
|
-
var
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
2972
|
+
var ps = U(`@wix/site-service-locale`);
|
|
2973
|
+
var ms = U;
|
|
2974
|
+
var hs = ms(`@wix/viewer-service-multilingual`);
|
|
2975
|
+
function gs() {
|
|
2976
|
+
try {
|
|
2977
|
+
return si.getLanguage() ?? `en`;
|
|
2978
|
+
} catch {
|
|
2979
|
+
return `en`;
|
|
2980
|
+
}
|
|
1855
2981
|
}
|
|
1856
|
-
function
|
|
1857
|
-
|
|
2982
|
+
function _s(e5) {
|
|
2983
|
+
try {
|
|
2984
|
+
return (0, import_services_manager_react.useService)(e5);
|
|
2985
|
+
} catch {
|
|
2986
|
+
return null;
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
function vs() {
|
|
2990
|
+
let e5 = _s(ps), t2 = _s(hs);
|
|
2991
|
+
return t2?.multilingualEnabled && t2.currentLocale?.languageCode || e5?.language || gs();
|
|
2992
|
+
}
|
|
2993
|
+
var ys = `bookings-uou`;
|
|
2994
|
+
function bs(e5, t2, n2, r2, i2, a2 = [], o2 = []) {
|
|
2995
|
+
let s2 = a2.length ? `:ids-${encodeURIComponent(JSON.stringify([...a2].sort()))}` : ``, c2 = o2.length ? `:cats-${encodeURIComponent(JSON.stringify([...o2].sort()))}` : ``;
|
|
2996
|
+
return `${ys}:${e5}:services:${t2 ?? `all`}:${n2 ?? `all`}:page-${r2}:limit-${i2}${s2}${c2}`;
|
|
1858
2997
|
}
|
|
1859
|
-
function
|
|
1860
|
-
return `${
|
|
2998
|
+
function xs(e5, t2, n2) {
|
|
2999
|
+
return `${ys}:${e5}:services-variants:ids-${encodeURIComponent(JSON.stringify([...t2].sort()))}:refresh-${n2}`;
|
|
1861
3000
|
}
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
var
|
|
1866
|
-
|
|
3001
|
+
function Ss() {
|
|
3002
|
+
return `${ys}:bookings-settings`;
|
|
3003
|
+
}
|
|
3004
|
+
var Cs = 5e3;
|
|
3005
|
+
var ws = 100;
|
|
3006
|
+
var Ts = `wix-warmup-data`;
|
|
3007
|
+
var Es = null;
|
|
3008
|
+
function Ds(e5) {
|
|
1867
3009
|
if (typeof document < `u`) try {
|
|
1868
|
-
let t2 = document.getElementById(
|
|
1869
|
-
return t2 ? (
|
|
3010
|
+
let t2 = document.getElementById(Ts)?.textContent;
|
|
3011
|
+
return t2 ? (Es?.text !== t2 && (Es = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Es.data[e5] ?? void 0) : void 0;
|
|
1870
3012
|
} catch {
|
|
1871
3013
|
return;
|
|
1872
3014
|
}
|
|
1873
3015
|
}
|
|
1874
|
-
var
|
|
1875
|
-
var
|
|
1876
|
-
var
|
|
1877
|
-
var
|
|
1878
|
-
function
|
|
1879
|
-
if (!
|
|
1880
|
-
let t2 =
|
|
1881
|
-
return t2 || (t2 =
|
|
3016
|
+
var Os = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
3017
|
+
var ks = Os();
|
|
3018
|
+
var As = /* @__PURE__ */ new WeakMap();
|
|
3019
|
+
var js = /* @__PURE__ */ new WeakMap();
|
|
3020
|
+
function Ms(e5) {
|
|
3021
|
+
if (!e5) return ks;
|
|
3022
|
+
let t2 = As.get(e5);
|
|
3023
|
+
return t2 || (t2 = Os(), As.set(e5, t2)), t2;
|
|
1882
3024
|
}
|
|
1883
|
-
function
|
|
1884
|
-
if (
|
|
3025
|
+
function Ns({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
3026
|
+
if (e5 === null) return n2();
|
|
1885
3027
|
if (typeof window > `u`) {
|
|
1886
|
-
let r3 = () => n2().then((n3) => (t2.set(
|
|
3028
|
+
let r3 = () => n2().then((n3) => (t2.set(e5, n3), n3)), { scope: i3 } = t2;
|
|
1887
3029
|
if (!i3) return r3();
|
|
1888
|
-
let a3 =
|
|
1889
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
1890
|
-
let o3 = a3.get(
|
|
3030
|
+
let a3 = js.get(i3);
|
|
3031
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), js.set(i3, a3));
|
|
3032
|
+
let o3 = a3.get(e5);
|
|
1891
3033
|
if (o3) return o3;
|
|
1892
3034
|
let s3 = r3();
|
|
1893
|
-
return a3.set(
|
|
3035
|
+
return a3.set(e5, s3), s3.catch(() => a3.delete(e5)), s3;
|
|
1894
3036
|
}
|
|
1895
|
-
let i2 =
|
|
1896
|
-
for (let [
|
|
1897
|
-
let o2 = i2.promises.get(
|
|
3037
|
+
let i2 = Ms(t2.scope), a2 = Date.now();
|
|
3038
|
+
for (let [e6, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e6);
|
|
3039
|
+
let o2 = i2.promises.get(e5);
|
|
1898
3040
|
if (o2 && !r2) return o2.promise;
|
|
1899
|
-
r2 && i2.invalidatedWarmup.add(
|
|
1900
|
-
let s2 = !i2.invalidatedWarmup.has(
|
|
3041
|
+
r2 && i2.invalidatedWarmup.add(e5);
|
|
3042
|
+
let s2 = !i2.invalidatedWarmup.has(e5);
|
|
1901
3043
|
if (s2) {
|
|
1902
|
-
let t3 =
|
|
3044
|
+
let t3 = Ds(e5);
|
|
1903
3045
|
if (t3 !== void 0) {
|
|
1904
|
-
let n3 =
|
|
1905
|
-
return i2.promises.set(
|
|
3046
|
+
let n3 = hi(t3);
|
|
3047
|
+
return i2.promises.set(e5, { promise: n3, expiresAt: a2 + Cs }), n3;
|
|
1906
3048
|
}
|
|
1907
3049
|
}
|
|
1908
3050
|
let c2 = (async () => {
|
|
1909
3051
|
if (s2) {
|
|
1910
|
-
let n3 = await t2.get(
|
|
3052
|
+
let n3 = await t2.get(e5);
|
|
1911
3053
|
if (n3 != null) return n3;
|
|
1912
3054
|
}
|
|
1913
3055
|
return n2();
|
|
1914
3056
|
})();
|
|
1915
|
-
i2.promises.size >=
|
|
3057
|
+
i2.promises.size >= ws && i2.promises.delete(i2.promises.keys().next().value);
|
|
1916
3058
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
1917
|
-
return i2.promises.set(
|
|
1918
|
-
l2.expiresAt = Date.now() +
|
|
3059
|
+
return i2.promises.set(e5, l2), c2.then(() => {
|
|
3060
|
+
l2.expiresAt = Date.now() + Cs;
|
|
1919
3061
|
}, () => {
|
|
1920
|
-
i2.promises.get(
|
|
3062
|
+
i2.promises.get(e5) === l2 && i2.promises.delete(e5);
|
|
1921
3063
|
}), c2;
|
|
1922
3064
|
}
|
|
1923
|
-
var
|
|
1924
|
-
async function
|
|
1925
|
-
if (
|
|
3065
|
+
var Ps = 100;
|
|
3066
|
+
async function Fs(e5) {
|
|
3067
|
+
if (e5.length === 0) return {};
|
|
1926
3068
|
let t2 = [];
|
|
1927
|
-
for (let n3 = 0; n3 <
|
|
1928
|
-
let n2 = await Promise.all(t2.map((
|
|
1929
|
-
for (let
|
|
3069
|
+
for (let n3 = 0; n3 < e5.length; n3 += Ps) t2.push(e5.slice(n3, n3 + Ps));
|
|
3070
|
+
let n2 = await Promise.all(t2.map((e6) => xo().in(`serviceId`, e6).limit(Ps).find())), r2 = {};
|
|
3071
|
+
for (let e6 of n2.flatMap((e7) => e7.items ?? [])) e6.serviceId && (r2[e6.serviceId] = e6);
|
|
1930
3072
|
return r2;
|
|
1931
3073
|
}
|
|
1932
|
-
var
|
|
1933
|
-
var
|
|
1934
|
-
let { SSR:
|
|
1935
|
-
return { isSSR: () =>
|
|
3074
|
+
var Is = U(`@wix/site-service-rendering-context`);
|
|
3075
|
+
var Ls = () => {
|
|
3076
|
+
let { SSR: e5 } = (0, import_services_manager_react.useService)(Is);
|
|
3077
|
+
return { isSSR: () => e5 };
|
|
1936
3078
|
};
|
|
1937
|
-
var
|
|
1938
|
-
function
|
|
1939
|
-
return { evid: 1222, src: 16, endpoint: ``, params:
|
|
1940
|
-
}
|
|
1941
|
-
function
|
|
1942
|
-
return { evid: 32, src: 16, endpoint: ``, params:
|
|
1943
|
-
}
|
|
1944
|
-
var
|
|
1945
|
-
var
|
|
1946
|
-
var
|
|
1947
|
-
var
|
|
1948
|
-
var
|
|
1949
|
-
let { reportBi: t2 } = (0, import_services_manager_react.useService)(
|
|
3079
|
+
var Rs = ms(`@wix/site-service-business-logger`);
|
|
3080
|
+
function zs(e5) {
|
|
3081
|
+
return { evid: 1222, src: 16, endpoint: ``, params: e5 };
|
|
3082
|
+
}
|
|
3083
|
+
function Bs(e5) {
|
|
3084
|
+
return { evid: 32, src: 16, endpoint: ``, params: e5 };
|
|
3085
|
+
}
|
|
3086
|
+
var Vs = { 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` };
|
|
3087
|
+
var Hs = W.BOOK_ONLINE;
|
|
3088
|
+
var Us = `new_bookings_server`;
|
|
3089
|
+
var Ws = `load more`;
|
|
3090
|
+
var Gs = (e5) => {
|
|
3091
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(Rs);
|
|
1950
3092
|
return (0, import_react.useCallback)((n2) => {
|
|
1951
|
-
t2({ widget_name:
|
|
1952
|
-
}, [t2,
|
|
3093
|
+
t2({ widget_name: e5, bookingsPlatform: Us, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
3094
|
+
}, [t2, e5]);
|
|
1953
3095
|
};
|
|
1954
|
-
function
|
|
1955
|
-
return { evid: 540, src: 16, endpoint: `wixboost-ugc`, params:
|
|
3096
|
+
function Ks(e5) {
|
|
3097
|
+
return { evid: 540, src: 16, endpoint: `wixboost-ugc`, params: e5 };
|
|
1956
3098
|
}
|
|
1957
|
-
var
|
|
1958
|
-
function
|
|
1959
|
-
let
|
|
3099
|
+
var qs = U(`seo/seo-service`);
|
|
3100
|
+
function Js() {
|
|
3101
|
+
let e5 = (0, import_services_manager_react.useGetService)();
|
|
1960
3102
|
try {
|
|
1961
|
-
return
|
|
3103
|
+
return e5(qs);
|
|
1962
3104
|
} catch {
|
|
1963
3105
|
return null;
|
|
1964
3106
|
}
|
|
1965
3107
|
}
|
|
1966
|
-
function
|
|
1967
|
-
let
|
|
1968
|
-
return { resolved: !!
|
|
1969
|
-
if (!
|
|
1970
|
-
let n2 = (
|
|
3108
|
+
function Ys() {
|
|
3109
|
+
let e5 = Js();
|
|
3110
|
+
return { resolved: !!e5, send: (t2) => {
|
|
3111
|
+
if (!e5) return Promise.resolve(`unavailable`);
|
|
3112
|
+
let n2 = (e6) => H(e6, { feature: V.seo, action: `send-seo-entity`, level: `warning`, contexts: { seo: { itemType: t2.itemType } } });
|
|
1971
3113
|
try {
|
|
1972
|
-
return
|
|
1973
|
-
} catch (
|
|
1974
|
-
return n2(
|
|
3114
|
+
return e5.setSeoEntity(t2).then(() => `sent`).catch((e6) => (n2(e6), `failed`));
|
|
3115
|
+
} catch (e6) {
|
|
3116
|
+
return n2(e6), Promise.resolve(`failed`);
|
|
1975
3117
|
}
|
|
1976
3118
|
} };
|
|
1977
3119
|
}
|
|
1978
|
-
var
|
|
1979
|
-
var
|
|
1980
|
-
function
|
|
1981
|
-
return { itemType:
|
|
3120
|
+
var Xs = `SERVICES_COMPONENT`;
|
|
3121
|
+
var Zs = `PAGINATED_COMPONENT`;
|
|
3122
|
+
function Qs(e5, t2, n2) {
|
|
3123
|
+
return { itemType: Xs, itemData: { services: e5.map((e6) => ({ ...e6, urls: { servicePage: { url: t2(e6) ?? `` } } })), pagination: n2 } };
|
|
1982
3124
|
}
|
|
1983
|
-
function
|
|
1984
|
-
return { itemType:
|
|
3125
|
+
function $s(e5) {
|
|
3126
|
+
return { itemType: Zs, itemData: { pagination: e5 } };
|
|
1985
3127
|
}
|
|
1986
|
-
var
|
|
1987
|
-
function
|
|
1988
|
-
let { services: r2, totalPages: i2 } =
|
|
3128
|
+
var ec = /* @__PURE__ */ new WeakSet();
|
|
3129
|
+
function tc({ servicesPromise: e5, currentPage: t2, pageQueryParam: n2 }) {
|
|
3130
|
+
let { services: r2, totalPages: i2 } = mi(e5), { resolveAbsoluteUrl: a2 } = cs(), { send: o2 } = Ys();
|
|
1989
3131
|
return (0, import_react.useState)(() => {
|
|
1990
|
-
if (
|
|
1991
|
-
|
|
3132
|
+
if (ec.has(e5)) return true;
|
|
3133
|
+
ec.add(e5);
|
|
1992
3134
|
let s2 = { currentPage: t2, totalPages: i2, queryParam: n2 };
|
|
1993
|
-
return o2(
|
|
3135
|
+
return o2(Qs(r2, (e6) => a2(`servicePage`, { slug: e6.mainSlug?.name ?? null, serviceId: e6._id ?? null }), s2)), i2 > 1 && o2($s(s2)), true;
|
|
1994
3136
|
}), null;
|
|
1995
3137
|
}
|
|
1996
|
-
function
|
|
1997
|
-
return
|
|
3138
|
+
function nc(e5) {
|
|
3139
|
+
return It(Object.assign(e5, { domainToMappings: { "api._api_base_domain_": [{ srcPath: `/events-3`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/calendar/v3/events`, destPath: `/v3/events` }, { srcPath: `/_api/calendar/v3/bulk/events`, destPath: `/v3/bulk/events` }, { srcPath: `/_api/calendar/v3/ro/events`, destPath: `/v3/events` }], "www.wixapis.com": [{ srcPath: `/calendar/v3/events`, destPath: `/v3/events` }, { srcPath: `/calendar/v3/bulk/events`, destPath: `/v3/bulk/events` }], _: [{ srcPath: `/_api/calendar/v3/events`, destPath: `/v3/events` }, { srcPath: `/_api/calendar/v3/bulk/events`, destPath: `/v3/bulk/events` }], "*.dev.wix-code.com": [{ srcPath: `/_api/calendar/v3/events`, destPath: `/v3/events` }, { srcPath: `/_api/calendar/v3/bulk/events`, destPath: `/v3/bulk/events` }], "editor._base_domain_": [{ srcPath: `/_api/calendar/v3/events`, destPath: `/v3/events` }, { srcPath: `/_api/calendar/v3/bulk/events`, destPath: `/v3/bulk/events` }], "blocks._base_domain_": [{ srcPath: `/_api/calendar/v3/events`, destPath: `/v3/events` }, { srcPath: `/_api/calendar/v3/bulk/events`, destPath: `/v3/bulk/events` }], "create.editorx": [{ srcPath: `/_api/calendar/v3/events`, destPath: `/v3/events` }, { srcPath: `/_api/calendar/v3/bulk/events`, destPath: `/v3/bulk/events` }] } }));
|
|
1998
3140
|
}
|
|
1999
|
-
var
|
|
2000
|
-
function
|
|
3141
|
+
var rc = `@wix/auto_sdk_calendar_events`;
|
|
3142
|
+
function ic(e5) {
|
|
2001
3143
|
function t2({ host: t3 }) {
|
|
2002
|
-
return { entityFqdn: `wix.calendar.v3.event`, method: `POST`, methodFqn: `wix.calendar.events.v3.EventsService.QueryEvents`, packageName:
|
|
3144
|
+
return { entityFqdn: `wix.calendar.v3.event`, method: `POST`, methodFqn: `wix.calendar.events.v3.EventsService.QueryEvents`, packageName: rc, migrationOptions: { optInTransformResponse: true }, url: nc({ protoPath: `/v3/events/query`, data: e5, host: t3 }), data: e5, transformResponse: (e6) => N(e6, [{ transformFn: M, paths: [{ path: `events.createdDate` }, { path: `events.updatedDate` }, { path: `events.start.utcDate` }, { path: `events.end.utcDate` }, { path: `events.adjustedStart.utcDate` }, { path: `events.adjustedEnd.utcDate` }, { path: `events.recurrenceRule.until.utcDate` }, { path: `events.recurrenceRule.adjustedUntil.utcDate` }] }]) };
|
|
2003
3145
|
}
|
|
2004
3146
|
return t2;
|
|
2005
3147
|
}
|
|
2006
|
-
function
|
|
3148
|
+
function ac(e5) {
|
|
2007
3149
|
let { httpClient: t2, sideEffects: n2 } = arguments[1];
|
|
2008
|
-
return
|
|
2009
|
-
let i2 =
|
|
3150
|
+
return Ja({ func: async (r2) => {
|
|
3151
|
+
let i2 = ic({ ...r2, ...e5 ?? {} });
|
|
2010
3152
|
n2?.onSiteCall?.();
|
|
2011
3153
|
try {
|
|
2012
|
-
let
|
|
2013
|
-
return n2?.onSuccess?.(
|
|
2014
|
-
} catch (
|
|
2015
|
-
throw n2?.onError?.(
|
|
3154
|
+
let e6 = await t2.request(i2);
|
|
3155
|
+
return n2?.onSuccess?.(e6), e6;
|
|
3156
|
+
} catch (e6) {
|
|
3157
|
+
throw n2?.onError?.(e6), e6;
|
|
2016
3158
|
}
|
|
2017
3159
|
}, requestTransformer: (t3) => {
|
|
2018
|
-
let n3 = [t3,
|
|
3160
|
+
let n3 = [t3, e5];
|
|
2019
3161
|
return A({ ...n3?.[1], query: n3?.[0] });
|
|
2020
|
-
}, responseTransformer: ({ data:
|
|
2021
|
-
let t3 = j(N(
|
|
3162
|
+
}, responseTransformer: ({ data: e6 }) => {
|
|
3163
|
+
let t3 = j(N(e6, []));
|
|
2022
3164
|
return { items: t3?.events, pagingMetadata: t3?.pagingMetadata };
|
|
2023
|
-
}, errorTransformer: (
|
|
2024
|
-
throw P(
|
|
3165
|
+
}, errorTransformer: (e6) => {
|
|
3166
|
+
throw P(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
2025
3167
|
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
2026
3168
|
}
|
|
2027
|
-
async function
|
|
2028
|
-
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 =
|
|
3169
|
+
async function oc(e5, t2) {
|
|
3170
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = ic(A({ query: e5, ...t2 }));
|
|
2029
3171
|
r2?.onSiteCall?.();
|
|
2030
3172
|
try {
|
|
2031
|
-
let
|
|
2032
|
-
return r2?.onSuccess?.(
|
|
2033
|
-
} catch (
|
|
2034
|
-
let t3 = P(
|
|
2035
|
-
throw r2?.onError?.(
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
({
|
|
2039
|
-
function
|
|
2040
|
-
return (t2) =>
|
|
2041
|
-
}
|
|
2042
|
-
function
|
|
2043
|
-
return (t2, n2) =>
|
|
2044
|
-
}
|
|
2045
|
-
var
|
|
2046
|
-
var
|
|
2047
|
-
var
|
|
2048
|
-
var
|
|
2049
|
-
function
|
|
2050
|
-
let t2 =
|
|
2051
|
-
function n2(
|
|
3173
|
+
let e6 = await n2.request(i2);
|
|
3174
|
+
return r2?.onSuccess?.(e6), j(e6.data);
|
|
3175
|
+
} catch (e6) {
|
|
3176
|
+
let t3 = P(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
|
|
3177
|
+
throw r2?.onError?.(e6), t3;
|
|
3178
|
+
}
|
|
3179
|
+
}
|
|
3180
|
+
({ ...$a() });
|
|
3181
|
+
function sc(e5) {
|
|
3182
|
+
return (t2) => ac(t2, { httpClient: e5 });
|
|
3183
|
+
}
|
|
3184
|
+
function cc(e5) {
|
|
3185
|
+
return (t2, n2) => oc(t2, n2, { httpClient: e5 });
|
|
3186
|
+
}
|
|
3187
|
+
var lc = _(`wix.calendar.v3.event_cancelled`, true, (e5) => j(N(e5, [{ transformFn: M, paths: [{ path: `data.event.createdDate` }, { path: `data.event.updatedDate` }, { path: `data.event.start.utcDate` }, { path: `data.event.end.utcDate` }, { path: `data.event.adjustedStart.utcDate` }, { path: `data.event.adjustedEnd.utcDate` }, { path: `data.event.recurrenceRule.until.utcDate` }, { path: `data.event.recurrenceRule.adjustedUntil.utcDate` }, { path: `metadata.eventTime` }] }])))();
|
|
3188
|
+
var uc = _(`wix.calendar.v3.event_created`, true, (e5) => j(N(e5, [{ transformFn: M, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.start.utcDate` }, { path: `entity.end.utcDate` }, { path: `entity.adjustedStart.utcDate` }, { path: `entity.adjustedEnd.utcDate` }, { path: `entity.recurrenceRule.until.utcDate` }, { path: `entity.recurrenceRule.adjustedUntil.utcDate` }, { path: `metadata.eventTime` }] }])))();
|
|
3189
|
+
var dc = _(`wix.calendar.v3.event_recurring_split`, true, (e5) => j(N(e5, [{ transformFn: M, paths: [{ path: `data.updatedRecurringEventEndingBeforeSplit.createdDate` }, { path: `data.updatedRecurringEventEndingBeforeSplit.updatedDate` }, { path: `data.updatedRecurringEventEndingBeforeSplit.start.utcDate` }, { path: `data.updatedRecurringEventEndingBeforeSplit.end.utcDate` }, { path: `data.updatedRecurringEventEndingBeforeSplit.adjustedStart.utcDate` }, { path: `data.updatedRecurringEventEndingBeforeSplit.adjustedEnd.utcDate` }, { path: `data.updatedRecurringEventEndingBeforeSplit.recurrenceRule.until.utcDate` }, { path: `data.updatedRecurringEventEndingBeforeSplit.recurrenceRule.adjustedUntil.utcDate` }, { path: `data.newRecurringEventStartingFromSplit.createdDate` }, { path: `data.newRecurringEventStartingFromSplit.updatedDate` }, { path: `data.newRecurringEventStartingFromSplit.start.utcDate` }, { path: `data.newRecurringEventStartingFromSplit.end.utcDate` }, { path: `data.newRecurringEventStartingFromSplit.adjustedStart.utcDate` }, { path: `data.newRecurringEventStartingFromSplit.adjustedEnd.utcDate` }, { path: `data.newRecurringEventStartingFromSplit.recurrenceRule.until.utcDate` }, { path: `data.newRecurringEventStartingFromSplit.recurrenceRule.adjustedUntil.utcDate` }, { path: `metadata.eventTime` }] }])))();
|
|
3190
|
+
var fc = _(`wix.calendar.v3.event_updated`, true, (e5) => j(N(e5, [{ transformFn: M, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.start.utcDate` }, { path: `entity.end.utcDate` }, { path: `entity.adjustedStart.utcDate` }, { path: `entity.adjustedEnd.utcDate` }, { path: `entity.recurrenceRule.until.utcDate` }, { path: `entity.recurrenceRule.adjustedUntil.utcDate` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }, { path: `modifiedFields.start.utcDate` }, { path: `modifiedFields.end.utcDate` }, { path: `modifiedFields.adjustedStart.utcDate` }, { path: `modifiedFields.adjustedEnd.utcDate` }, { path: `modifiedFields.recurrenceRule.until.utcDate` }, { path: `modifiedFields.recurrenceRule.adjustedUntil.utcDate` }] }])))();
|
|
3191
|
+
function pc(e5) {
|
|
3192
|
+
let t2 = lo({ builderQueryFunction: (t3) => sc(e5)(t3), typedQueryFunction: (t3, n3) => cc(e5)(t3, n3), hasOptionsParameter: true });
|
|
3193
|
+
function n2(e6, n3) {
|
|
2052
3194
|
return t2(...arguments);
|
|
2053
3195
|
}
|
|
2054
3196
|
return n2;
|
|
2055
3197
|
}
|
|
2056
|
-
var
|
|
2057
|
-
|
|
2058
|
-
var
|
|
2059
|
-
let t2 = (
|
|
2060
|
-
return `${
|
|
3198
|
+
var mc = Pt(pc);
|
|
3199
|
+
ln(lc), ln(uc), ln(dc), ln(fc);
|
|
3200
|
+
var hc = (e5) => {
|
|
3201
|
+
let t2 = (e6) => e6 < 10 ? `0${e6}` : `${e6}`;
|
|
3202
|
+
return `${e5.getFullYear()}-${t2(e5.getMonth() + 1)}-${t2(e5.getDate())}`;
|
|
2061
3203
|
};
|
|
2062
|
-
var
|
|
2063
|
-
var
|
|
2064
|
-
async function
|
|
3204
|
+
var gc = (e5) => `${hc(e5)}T00:00:00`;
|
|
3205
|
+
var _c = 1e3;
|
|
3206
|
+
async function vc(e5, t2) {
|
|
2065
3207
|
let n2 = [], r2;
|
|
2066
3208
|
do {
|
|
2067
|
-
let i2 = await
|
|
3209
|
+
let i2 = await mc({ filter: e5, cursorPaging: { limit: _c, ...r2 ? { cursor: r2 } : {} } }, t2);
|
|
2068
3210
|
n2.push(...i2.events ?? []), r2 = i2.pagingMetadata?.hasNext ? i2.pagingMetadata.cursors?.next ?? void 0 : void 0;
|
|
2069
3211
|
} while (r2);
|
|
2070
3212
|
return n2;
|
|
2071
3213
|
}
|
|
2072
|
-
async function
|
|
2073
|
-
return
|
|
3214
|
+
async function yc(e5, t2) {
|
|
3215
|
+
return e5.length === 0 ? [] : vc({ appId: Ni, scheduleId: { $in: e5 } }, { recurrenceType: [`MASTER`, `NONE`], fromLocalDate: gc(/* @__PURE__ */ new Date()), ...t2 ? { timeZone: t2 } : {} });
|
|
2074
3216
|
}
|
|
2075
|
-
function
|
|
3217
|
+
function bc(e5) {
|
|
2076
3218
|
let t2 = {};
|
|
2077
|
-
for (let n2 of
|
|
3219
|
+
for (let n2 of e5) n2.scheduleId && (t2[n2.scheduleId] ??= []).push(n2);
|
|
2078
3220
|
return t2;
|
|
2079
3221
|
}
|
|
2080
|
-
var
|
|
2081
|
-
async function
|
|
3222
|
+
var xc = { displayTimeZonePolicy: { basedOn: Go.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
|
|
3223
|
+
async function Sc() {
|
|
2082
3224
|
try {
|
|
2083
|
-
let
|
|
2084
|
-
return { displayTimeZonePolicy: { basedOn:
|
|
2085
|
-
} catch (
|
|
2086
|
-
return
|
|
3225
|
+
let e5 = await Jo();
|
|
3226
|
+
return { displayTimeZonePolicy: { basedOn: e5.displayTimeZone?.basedOn ?? Go.BUSINESS_TIME_ZONE, customerCanChange: e5.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e5.multiServiceAppointments?.enabled ?? false };
|
|
3227
|
+
} catch (e5) {
|
|
3228
|
+
return H(e5, { feature: V.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), xc;
|
|
2087
3229
|
}
|
|
2088
3230
|
}
|
|
2089
3231
|
(0, import_react.createContext)(null);
|
|
2090
|
-
function
|
|
2091
|
-
return
|
|
3232
|
+
function Cc(e5) {
|
|
3233
|
+
return e5.basedOn === Go.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
|
|
2092
3234
|
}
|
|
2093
|
-
function
|
|
2094
|
-
let o2 = { serviceItems: n2, bookingsSettings: null, hasMore: false, isLoading: r2, hasError: i2, categoryId:
|
|
3235
|
+
function wc({ categoryId: e5, locationId: t2, serviceItems: n2, isLoading: r2, hasError: i2, children: a2 }) {
|
|
3236
|
+
let o2 = { serviceItems: n2, bookingsSettings: null, hasMore: false, isLoading: r2, hasError: i2, categoryId: e5, locationId: t2, loadMore: async () => {
|
|
2095
3237
|
} };
|
|
2096
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2097
|
-
}
|
|
2098
|
-
function
|
|
2099
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2100
|
-
}
|
|
2101
|
-
function
|
|
2102
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2103
|
-
}
|
|
2104
|
-
function
|
|
2105
|
-
let t2 =
|
|
2106
|
-
return [...new Set(t2.filter((
|
|
2107
|
-
}
|
|
2108
|
-
function $(
|
|
2109
|
-
return
|
|
2110
|
-
}
|
|
2111
|
-
var
|
|
2112
|
-
var
|
|
2113
|
-
var
|
|
2114
|
-
var
|
|
2115
|
-
var
|
|
2116
|
-
var
|
|
2117
|
-
function
|
|
2118
|
-
return Object.keys(t2).length === 0 ?
|
|
2119
|
-
}
|
|
2120
|
-
function
|
|
2121
|
-
let
|
|
2122
|
-
return Promise.all([
|
|
2123
|
-
}
|
|
2124
|
-
var
|
|
2125
|
-
function
|
|
2126
|
-
let t2 = Math.floor(Number(
|
|
2127
|
-
return !
|
|
2128
|
-
}
|
|
2129
|
-
var
|
|
2130
|
-
var
|
|
2131
|
-
function
|
|
2132
|
-
let
|
|
2133
|
-
if (!
|
|
2134
|
-
return
|
|
2135
|
-
}
|
|
2136
|
-
function
|
|
2137
|
-
return { firstPage:
|
|
2138
|
-
}
|
|
2139
|
-
function
|
|
2140
|
-
let { firstPagePromise: f2, safeLimit: p2, serviceIdsKey:
|
|
2141
|
-
|
|
2142
|
-
let { cursor:
|
|
2143
|
-
(0, import_react.useEffect)(() => (
|
|
2144
|
-
|
|
2145
|
-
}), [
|
|
2146
|
-
let
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
}, [
|
|
2150
|
-
let
|
|
2151
|
-
return
|
|
2152
|
-
|
|
2153
|
-
|
|
3238
|
+
return (0, import_jsx_runtime.jsx)(Rc.Provider, { value: o2, children: a2 });
|
|
3239
|
+
}
|
|
3240
|
+
function Tc({ categoryId: e5, locationId: t2, children: n2 }) {
|
|
3241
|
+
return (0, import_jsx_runtime.jsx)(wc, { categoryId: e5, locationId: t2, serviceItems: [], isLoading: true, hasError: false, children: n2 });
|
|
3242
|
+
}
|
|
3243
|
+
function Ec({ categoryId: e5, locationId: t2, children: n2 }) {
|
|
3244
|
+
return (0, import_jsx_runtime.jsx)(wc, { categoryId: e5, locationId: t2, serviceItems: [], isLoading: false, hasError: true, children: n2 });
|
|
3245
|
+
}
|
|
3246
|
+
function Dc(e5) {
|
|
3247
|
+
let t2 = e5?.$in ?? (e5?.$eq == null ? [] : [e5.$eq]);
|
|
3248
|
+
return [...new Set(t2.filter((e6) => typeof e6 == `string` && e6 !== ``))].sort().join(`,`);
|
|
3249
|
+
}
|
|
3250
|
+
function $(e5) {
|
|
3251
|
+
return e5 ? e5.split(`,`) : null;
|
|
3252
|
+
}
|
|
3253
|
+
var Oc = 20;
|
|
3254
|
+
var kc = 100;
|
|
3255
|
+
var Ac = [];
|
|
3256
|
+
var jc = [];
|
|
3257
|
+
var Mc = {};
|
|
3258
|
+
var Nc = {};
|
|
3259
|
+
function Pc(e5, t2) {
|
|
3260
|
+
return Object.keys(t2).length === 0 ? e5 : { ...e5, ...t2 };
|
|
3261
|
+
}
|
|
3262
|
+
function Fc(e5, t2, n2, r2, i2) {
|
|
3263
|
+
let a2 = [...new Set(e5.filter((e6) => !Yo(e6.type)).map((e6) => e6.schedule?._id).filter((e6) => !!e6))], o2 = e5.filter(Xo).map((e6) => e6._id).filter((e6) => !!e6);
|
|
3264
|
+
return Promise.all([a2.length === 0 ? Mc : yc(a2, t2).then(bc).catch(() => Mc), o2.length === 0 ? Nc : Ns({ key: xs(r2, o2, n2), warmupData: i2, fetchData: () => Fs(o2) }).catch((e6) => (H(e6, { feature: V.services, action: `fetch-service-variants`, level: `warning` }), null))]);
|
|
3265
|
+
}
|
|
3266
|
+
var Ic = { services: [], hasMore: false, totalPages: 1, hasError: true };
|
|
3267
|
+
function Lc(e5) {
|
|
3268
|
+
let t2 = Math.floor(Number(e5));
|
|
3269
|
+
return !e5 || !Number.isSafeInteger(t2) || t2 < 1 ? 1 : t2;
|
|
3270
|
+
}
|
|
3271
|
+
var Rc = (0, import_react.createContext)(null);
|
|
3272
|
+
var zc = `useServicesContext must be used within ServicesContextProvider`;
|
|
3273
|
+
function Bc() {
|
|
3274
|
+
let e5 = (0, import_react.useContext)(Rc);
|
|
3275
|
+
if (!e5) throw Error(zc);
|
|
3276
|
+
return e5;
|
|
3277
|
+
}
|
|
3278
|
+
function Vc(e5, t2) {
|
|
3279
|
+
return { firstPage: e5, services: e5.services, hasMore: e5.hasMore, isLoadingMore: false, cursor: { offset: (t2.paginationIndex - 1) * t2.safeLimit + e5.services.length, hasMore: e5.hasMore, pending: null, dropped: false } };
|
|
3280
|
+
}
|
|
3281
|
+
function Hc({ query: e5, isQueryPending: t2, settingsPromise: n2, categoryId: a2, locationId: o2, children: d2 }) {
|
|
3282
|
+
let { firstPagePromise: f2, safeLimit: p2, serviceIdsKey: h2, categoryIdsKey: g2, refreshSignal: _2, language: v2 } = e5, y2 = mi(f2), b2 = mi(n2), [x2, S2] = (0, import_react.useState)(() => Vc(y2, e5)), [ee2, C2] = (0, import_react.useState)({}), [w2, T2] = (0, import_react.useState)({});
|
|
3283
|
+
x2.firstPage !== y2 && (S2(Vc(y2, e5)), C2({}), T2({}));
|
|
3284
|
+
let { cursor: E2 } = x2;
|
|
3285
|
+
(0, import_react.useEffect)(() => (E2.dropped = false, () => {
|
|
3286
|
+
E2.dropped = true;
|
|
3287
|
+
}), [E2]);
|
|
3288
|
+
let D2 = Cc(b2.displayTimeZonePolicy), O2 = Gs(Vs.SERVICES), { getParsedUrl: te2 } = Oi(), ne2 = (0, import_react.useRef)(null), re2 = fs(), ie2 = (0, import_react.useRef)(re2);
|
|
3289
|
+
ie2.current = re2, (0, import_react.useEffect)(() => {
|
|
3290
|
+
ne2.current !== y2 && (ne2.current = y2, O2(Bs({ referralInfo: te2().searchParams.get(es.referral) ?? void 0 })), O2(Ks({ numOfServices: y2.services.length })));
|
|
3291
|
+
}, [O2, te2, y2]), (0, import_react.useEffect)(() => {
|
|
3292
|
+
let e6 = false;
|
|
3293
|
+
return Fc(y2.services, D2, _2, v2, ie2.current).then(([t3, n3]) => {
|
|
3294
|
+
e6 || (0, import_react.startTransition)(() => {
|
|
3295
|
+
C2((e7) => Pc(e7, t3)), n3 && T2((e7) => Pc(e7, n3));
|
|
2154
3296
|
});
|
|
2155
3297
|
}), () => {
|
|
2156
|
-
|
|
3298
|
+
e6 = true;
|
|
2157
3299
|
};
|
|
2158
|
-
}, [
|
|
3300
|
+
}, [y2.services, D2, _2, v2]);
|
|
2159
3301
|
let ae2 = (0, import_react.useCallback)(async () => {
|
|
2160
|
-
if (
|
|
2161
|
-
if (!
|
|
2162
|
-
let t3 = (
|
|
2163
|
-
return t3((
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
3302
|
+
if (O2(zs({ pageName: Hs, buttonName: Ws })), E2.pending) return E2.pending;
|
|
3303
|
+
if (!E2.hasMore) return;
|
|
3304
|
+
let t3 = (e6) => S2((t4) => t4.cursor === E2 ? e6(t4) : t4);
|
|
3305
|
+
return t3((e6) => ({ ...e6, isLoadingMore: true })), E2.pending = $o({ limit: p2, offset: E2.offset, categoryId: e5.categoryId, locationId: e5.locationId, serviceIds: $(h2), categoryIds: $(g2) }).then((e6) => {
|
|
3306
|
+
E2.dropped || (E2.hasMore = e6.hasMore, E2.offset += e6.services.length, t3((t4) => ({ ...t4, services: [...t4.services, ...e6.services], hasMore: e6.hasMore })), Fc(e6.services, D2, _2, v2, ie2.current).then(([e7, t4]) => {
|
|
3307
|
+
E2.dropped || (0, import_react.startTransition)(() => {
|
|
3308
|
+
C2((t5) => Pc(t5, e7)), t4 && T2((e8) => Pc(e8, t4));
|
|
2167
3309
|
});
|
|
2168
3310
|
}));
|
|
2169
3311
|
}).catch(() => {
|
|
2170
3312
|
}).finally(() => {
|
|
2171
|
-
|
|
2172
|
-
}),
|
|
2173
|
-
}, [
|
|
2174
|
-
let t3 =
|
|
2175
|
-
return { serviceId:
|
|
2176
|
-
}), [
|
|
2177
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2178
|
-
}
|
|
2179
|
-
var
|
|
2180
|
-
var
|
|
2181
|
-
function
|
|
2182
|
-
let l2 = Math.min(n2 ??
|
|
2183
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2184
|
-
}
|
|
2185
|
-
var
|
|
3313
|
+
E2.pending = null, t3((e6) => ({ ...e6, isLoadingMore: false }));
|
|
3314
|
+
}), E2.pending;
|
|
3315
|
+
}, [E2, p2, e5.categoryId, e5.locationId, h2, g2, O2, D2, _2, v2]), { resolvePath: oe2, toHref: se2 } = cs(), ce2 = (0, import_react.useMemo)(() => x2.services.map((e6) => {
|
|
3316
|
+
let t3 = oe2(`servicePage`, { slug: e6.mainSlug?.name ?? null, serviceId: e6._id ?? null });
|
|
3317
|
+
return { serviceId: e6._id ?? null, refreshSignal: _2, service: e6, masterEvents: ee2[e6.schedule?._id ?? ``] ?? Ac, serviceOptionsAndVariants: w2[e6._id ?? ``] ?? null, bookingsSettings: b2, servicePageLink: t3 ? { href: se2(t3), target: `_self` } : null };
|
|
3318
|
+
}), [oe2, se2, x2.services, _2, ee2, w2, b2]), le2 = (0, import_react.useMemo)(() => ({ serviceItems: t2 ? jc : ce2, bookingsSettings: b2, hasMore: !t2 && x2.hasMore, isLoading: t2 || x2.isLoadingMore, hasError: !t2 && y2.hasError, categoryId: a2, locationId: o2, loadMore: ae2 }), [t2, ce2, b2, x2.hasMore, x2.isLoadingMore, y2.hasError, a2, o2, ae2]);
|
|
3319
|
+
return (0, import_jsx_runtime.jsx)(Rc.Provider, { value: le2, children: d2 });
|
|
3320
|
+
}
|
|
3321
|
+
var Uc = (e5) => ({ ...e5, hasError: false });
|
|
3322
|
+
var Wc = () => ({ ...Ic });
|
|
3323
|
+
function Gc({ categoryData: e5, limit: n2 = Oc, servicesPicker: r2, categoriesPicker: i2, refreshSignal: a2 = 0, children: s2 }) {
|
|
3324
|
+
let l2 = Math.min(n2 ?? Oc, kc), { searchParams: d2 } = Oi(), f2 = e5?.categoryId, p2 = !!f2, g2 = f2 || d2.get(es.category), _2 = d2.get(es.location), v2 = p2 ? 1 : Lc(d2.get(es.page)), y2 = Dc(r2?.serviceId), b2 = Dc(i2?.categoryId), x2 = fs(), S2 = vs(), { isSSR: ee2 } = Ls(), [C2] = (0, import_react.useState)(() => ee2()), w2 = (0, import_react.useMemo)(() => ({ firstPagePromise: _i(Ns({ key: bs(S2, g2, _2, v2, l2, $(y2) ?? [], $(b2) ?? []), refresh: a2 !== 0, warmupData: x2, fetchData: () => fi(`services-context-load`, { feature: V.services }, $o({ limit: l2, offset: (v2 - 1) * l2, categoryId: g2, locationId: _2, serviceIds: $(y2), categoryIds: $(b2) })) }), Uc, Wc), safeLimit: l2, paginationIndex: v2, categoryId: g2, locationId: _2, serviceIdsKey: y2, categoryIdsKey: b2, refreshSignal: a2, language: S2 }), [l2, g2, _2, v2, a2, y2, b2, S2]), [T2] = (0, import_react.useState)(() => Ns({ key: Ss(), warmupData: x2, fetchData: Sc })), E2 = (0, import_react.useDeferredValue)(w2);
|
|
3325
|
+
return (0, import_jsx_runtime.jsx)(pi, { fallback: (0, import_jsx_runtime.jsx)(Ec, { categoryId: g2, locationId: _2, children: s2 }), feature: V.services, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Tc, { categoryId: g2, locationId: _2, children: s2 }), children: [C2 && !p2 && (0, import_jsx_runtime.jsx)(tc, { servicesPromise: w2.firstPagePromise, currentPage: v2, pageQueryParam: es.page }), (0, import_jsx_runtime.jsx)(Hc, { query: E2, isQueryPending: E2 !== w2, settingsPromise: T2, categoryId: g2, locationId: _2, children: s2 })] }) });
|
|
3326
|
+
}
|
|
3327
|
+
var Kc = zn(`117fa14c-cf9c-47f5-b2cb-7797094612ce`);
|
|
2186
3328
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2187
3329
|
0 && (module.exports = {
|
|
2188
3330
|
SERVICES_CONTEXT_MISSING_PROVIDER_ERROR,
|