@wix/bookings 1.0.1777 → 1.0.1779
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context-booking-checkout.d.ts +243 -108
- package/build/cjs/context-booking-checkout.js +176 -182
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.d.ts +16 -143
- package/build/cjs/context-categories.js +411 -411
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.d.ts +16 -287
- package/build/cjs/context-locations.js +335 -335
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.d.ts +2 -2
- package/build/cjs/context-service.d.ts +71 -33
- package/build/cjs/context-service.js +97 -95
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +10 -0
- package/build/cjs/context-time-slots.js +1 -1
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +243 -108
- package/build/es/context-booking-checkout.mjs +176 -179
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.d.mts +16 -143
- package/build/es/context-categories.mjs +411 -411
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.d.mts +16 -287
- package/build/es/context-locations.mjs +335 -335
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.d.mts +2 -2
- package/build/es/context-service.d.mts +71 -33
- package/build/es/context-service.mjs +97 -95
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +10 -0
- package/build/es/context-time-slots.mjs +1 -1
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +243 -108
- package/build/internal/cjs/context-categories.d.ts +16 -143
- package/build/internal/cjs/context-locations.d.ts +16 -287
- package/build/internal/cjs/context-service-addons.d.ts +2 -2
- package/build/internal/cjs/context-service.d.ts +71 -33
- package/build/internal/cjs/context-time-slots.d.ts +10 -0
- package/build/internal/es/context-booking-checkout.d.mts +243 -108
- package/build/internal/es/context-categories.d.mts +16 -143
- package/build/internal/es/context-locations.d.mts +16 -287
- package/build/internal/es/context-service-addons.d.mts +2 -2
- package/build/internal/es/context-service.d.mts +71 -33
- package/build/internal/es/context-time-slots.d.mts +10 -0
- package/context-runtime/context-booking-checkout/runtime.d.ts +243 -108
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-categories/runtime.d.ts +16 -143
- package/context-runtime/context-categories/runtime.js +2 -2
- package/context-runtime/context-locations/runtime.d.ts +16 -287
- package/context-runtime/context-locations/runtime.js +2 -2
- package/context-runtime/context-service/runtime.d.ts +71 -33
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-service-addons/runtime.d.ts +2 -2
- package/context-runtime/context-time-slots/runtime.d.ts +10 -0
- package/context-runtime/context-time-slots/runtime.js +2 -2
- package/package.json +7 -7
|
@@ -65,20 +65,20 @@ var b = class extends Error {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
var x = (e5, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e5, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
68
|
-
var
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
function
|
|
68
|
+
var ee = (e5) => e5?.method && [`post`, `put`, `patch`].includes(e5.method.toLocaleLowerCase()) && e5.body ? { "Content-Type": `application/json` } : {};
|
|
69
|
+
var te = (e5) => e5 && typeof e5 == `object` && !Array.isArray(e5);
|
|
70
|
+
var S = (e5) => e5.__type === `host`;
|
|
71
|
+
function C(e5, t2) {
|
|
72
72
|
return e5.create(t2);
|
|
73
73
|
}
|
|
74
|
-
var
|
|
75
|
-
function
|
|
76
|
-
return { [
|
|
74
|
+
var w = `x-wix-bi-gateway`;
|
|
75
|
+
function ne(e5, t2, n2) {
|
|
76
|
+
return { [w]: re({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e5.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e5.methodFqn, entity: e5.entityFqdn }) };
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function re(e5) {
|
|
79
79
|
return Object.entries(e5).filter(([e6, t2]) => !!t2).map(([e6, t2]) => `${e6}=${t2}`).join(`,`);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function ie(e5) {
|
|
82
82
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
83
83
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
84
84
|
try {
|
|
@@ -87,82 +87,82 @@ function re(e5) {
|
|
|
87
87
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
92
|
-
return
|
|
90
|
+
var ae = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
91
|
+
function oe(e5) {
|
|
92
|
+
return de(e5).map((e6) => e6.toLocaleUpperCase()).join(`_`);
|
|
93
93
|
}
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
function
|
|
94
|
+
var se = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
95
|
+
var ce = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
96
|
+
var le = `$1\0$2`;
|
|
97
|
+
var ue = /[^\p{L}\d]+/giu;
|
|
98
|
+
function de(e5) {
|
|
99
99
|
let t2 = e5.trim();
|
|
100
|
-
t2 = t2.replace(
|
|
100
|
+
t2 = t2.replace(se, le).replace(ce, le), t2 = t2.replace(ue, `\0`);
|
|
101
101
|
let n2 = 0, r2 = t2.length;
|
|
102
102
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
103
103
|
if (n2 === r2) return [];
|
|
104
104
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
105
105
|
return t2.slice(n2, r2).split(/\0/g);
|
|
106
106
|
}
|
|
107
|
-
var
|
|
108
|
-
var
|
|
109
|
-
var
|
|
110
|
-
function
|
|
107
|
+
var fe = (e5) => `validationError` in (e5.response?.data?.details ?? {});
|
|
108
|
+
var pe = (e5) => `applicationError` in (e5.response?.data?.details ?? {});
|
|
109
|
+
var me = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
|
|
110
|
+
function he(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
111
111
|
if (typeof e5 != `object` || !e5) throw e5;
|
|
112
|
-
if (
|
|
113
|
-
if (
|
|
114
|
-
if (
|
|
115
|
-
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
116
|
-
return
|
|
112
|
+
if (fe(e5)) return ge(e5, t2, n2);
|
|
113
|
+
if (pe(e5)) return _e(e5);
|
|
114
|
+
if (me(e5)) {
|
|
115
|
+
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: oe(n3), data: {} }, requestId: e5.requestId };
|
|
116
|
+
return T(e5, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return ve(e5);
|
|
119
119
|
}
|
|
120
|
-
var
|
|
121
|
-
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
122
|
-
return
|
|
120
|
+
var ge = (e5, t2, n2) => {
|
|
121
|
+
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 };
|
|
122
|
+
return T(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e5.response?.status, requestId: i2 } });
|
|
123
123
|
};
|
|
124
|
-
var
|
|
125
|
-
var
|
|
126
|
-
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 ??
|
|
127
|
-
return
|
|
124
|
+
var T = (e5, { message: t2, extraProperties: n2 }) => Object.assign(e5, { ...n2, message: t2 });
|
|
125
|
+
var _e = (e5) => {
|
|
126
|
+
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 ?? oe(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 };
|
|
127
|
+
return T(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e5.requestId } });
|
|
128
128
|
};
|
|
129
|
-
var
|
|
130
|
-
var
|
|
129
|
+
var ve = (e5) => T(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: oe(e5.response?.statusText ?? `UNKNOWN`), ...!e5.response && { runtimeError: e5 } } });
|
|
130
|
+
var ye = ({ spreadPathsToArguments: e5, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
131
131
|
let a2 = { ...e5, ...t2 }, o2 = Object.keys(a2);
|
|
132
132
|
return r2?.filter((e6) => !r2.some((t3) => t3.field.length > e6.field.length && t3.field.startsWith(e6.field) && o2.includes(t3.field))).map((e6) => {
|
|
133
133
|
let r3 = t2[e6.field];
|
|
134
|
-
if (r3) return { ...e6, field:
|
|
134
|
+
if (r3) return { ...e6, field: be(r3, i2) };
|
|
135
135
|
let s2 = o2?.sort((e7, t3) => t3.length - e7.length)?.find((t3) => e6.field.startsWith(t3));
|
|
136
136
|
if (s2) {
|
|
137
137
|
let t3 = a2[s2];
|
|
138
|
-
if (t3) return { ...e6, field: e6.field.replace(s2,
|
|
138
|
+
if (t3) return { ...e6, field: e6.field.replace(s2, be(t3, i2)) };
|
|
139
139
|
}
|
|
140
140
|
return n2 ? { ...e6, field: `${i2[0]}.${e6.field}` } : e6;
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
-
var
|
|
144
|
-
let n2 =
|
|
143
|
+
var be = (e5, t2) => {
|
|
144
|
+
let n2 = xe(e5);
|
|
145
145
|
return n2 == null ? e5 : e5.replace(`$[${n2}]`, t2[n2]);
|
|
146
146
|
};
|
|
147
|
-
var
|
|
147
|
+
var xe = (e5) => {
|
|
148
148
|
let t2 = e5.match(/\$\[(?<argIndex>\d+)\]/);
|
|
149
149
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
150
150
|
};
|
|
151
|
-
function
|
|
152
|
-
return
|
|
151
|
+
function Se(e5, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
152
|
+
return ie(() => e5({ request: async (e6) => {
|
|
153
153
|
let i3 = e6({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
154
154
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
155
155
|
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? y : o3}${a3.url}`;
|
|
156
156
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
157
157
|
try {
|
|
158
|
-
let e7 =
|
|
158
|
+
let e7 = ne(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e7 } }, s3 = await n2(u3, o4);
|
|
159
159
|
if (s3.status !== 200) {
|
|
160
160
|
let e8 = null;
|
|
161
161
|
try {
|
|
162
162
|
e8 = await s3.json();
|
|
163
163
|
} catch {
|
|
164
164
|
}
|
|
165
|
-
let t3 =
|
|
165
|
+
let t3 = we(s3.status, e8?.message ?? s3.statusText, e8?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e8 }), n3 = he(t3);
|
|
166
166
|
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
167
167
|
}
|
|
168
168
|
let l3 = await s3.json();
|
|
@@ -172,18 +172,18 @@ function be(e5, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
172
172
|
}
|
|
173
173
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var Ce = class extends Error {
|
|
176
176
|
response;
|
|
177
177
|
requestId;
|
|
178
178
|
constructor(e5) {
|
|
179
179
|
super(), this.response = e5.response, this.requestId = e5.requestId;
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
-
var
|
|
183
|
-
var
|
|
184
|
-
function
|
|
182
|
+
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 });
|
|
183
|
+
var Te = `.`;
|
|
184
|
+
function Ee(e5, t2, n2) {
|
|
185
185
|
if (e5 == null) throw Error(`Cannot set value on null or undefined`);
|
|
186
|
-
let r2 =
|
|
186
|
+
let r2 = De(t2), i2 = e5;
|
|
187
187
|
for (let e6 = 0; e6 < r2.length; e6++) {
|
|
188
188
|
let t3 = r2[e6];
|
|
189
189
|
if (e6 === r2.length - 1) {
|
|
@@ -195,21 +195,21 @@ function we(e5, t2, n2) {
|
|
|
195
195
|
}
|
|
196
196
|
return e5;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return Array.isArray(e5) ? e5 : e5.split(
|
|
198
|
+
function De(e5) {
|
|
199
|
+
return Array.isArray(e5) ? e5 : e5.split(Te).map((e6) => Oe(e6) ? Number(e6) : e6);
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Oe(e5) {
|
|
202
202
|
return /^\d+$/.test(e5);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ke(e5) {
|
|
205
205
|
let t2 = {};
|
|
206
|
-
for (let [n2, r2] of Object.entries(e5))
|
|
206
|
+
for (let [n2, r2] of Object.entries(e5)) Ae(n2) || Ee(t2, De(n2), r2);
|
|
207
207
|
return t2;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Ae(e5) {
|
|
210
210
|
return e5 === `__proto__` || e5 === `constructor` || e5 === `prototype`;
|
|
211
211
|
}
|
|
212
|
-
var
|
|
212
|
+
var je = class {
|
|
213
213
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
214
214
|
NUMERIC_PATTERN = /^\d+$/;
|
|
215
215
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -232,7 +232,7 @@ var ke = class {
|
|
|
232
232
|
return e5.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
233
233
|
}
|
|
234
234
|
unflatten() {
|
|
235
|
-
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e5, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e5)), t2])),
|
|
235
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e5, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e5)), t2])), ke(this.cleanedModifiedFields);
|
|
236
236
|
}
|
|
237
237
|
flatten(e5) {
|
|
238
238
|
let t2 = {};
|
|
@@ -252,12 +252,12 @@ var ke = class {
|
|
|
252
252
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
253
253
|
r2.push(`[${e6}]`), n2 = n2[parseInt(e6, 10)];
|
|
254
254
|
}, a2 = (e6, t3) => {
|
|
255
|
-
let i3 = e6 in
|
|
255
|
+
let i3 = e6 in ae ? ae[e6] : void 0;
|
|
256
256
|
if (i3 && i3 in t3) {
|
|
257
257
|
r2.push(i3), n2 = t3[i3];
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
-
let a3 =
|
|
260
|
+
let a3 = Fe(e6);
|
|
261
261
|
if (a3 && a3 in t3) {
|
|
262
262
|
r2.push(a3), n2 = t3[a3];
|
|
263
263
|
return;
|
|
@@ -288,28 +288,28 @@ var ke = class {
|
|
|
288
288
|
return e5.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e5[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
|
-
function
|
|
291
|
+
function Me(e5, t2) {
|
|
292
292
|
let n2 = e5?.modifiedFields;
|
|
293
293
|
if (!n2) return null;
|
|
294
|
-
let r2 =
|
|
294
|
+
let r2 = Ne(n2);
|
|
295
295
|
if (!r2) return null;
|
|
296
296
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
297
297
|
e5 = { ...e5, modifiedFields: i2 };
|
|
298
298
|
let o2 = t2(e5), s2 = o2?.modifiedFields;
|
|
299
299
|
if (!s2) return null;
|
|
300
|
-
let c2 =
|
|
300
|
+
let c2 = Pe(s2, a2);
|
|
301
301
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Ne(e5) {
|
|
304
304
|
if (typeof e5 == `object` && e5 && !Array.isArray(e5)) try {
|
|
305
|
-
let t2 = new
|
|
305
|
+
let t2 = new je(e5);
|
|
306
306
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
307
307
|
} catch {
|
|
308
308
|
return null;
|
|
309
309
|
}
|
|
310
310
|
return null;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Pe(e5, t2) {
|
|
313
313
|
if (typeof e5 == `object` && e5 && !Array.isArray(e5)) try {
|
|
314
314
|
return t2.flatten(e5);
|
|
315
315
|
} catch {
|
|
@@ -317,10 +317,10 @@ function Me(e5, t2) {
|
|
|
317
317
|
}
|
|
318
318
|
return null;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function Fe(e5) {
|
|
321
321
|
return e5.replace(/[-_\s]+(.)?/g, (e6, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e6) => e6.toLowerCase());
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function Ie() {
|
|
324
324
|
return { emit(e5, ...t2) {
|
|
325
325
|
for (let n2 = 0, r2 = this.events[e5] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
326
326
|
}, events: {}, on(e5, t2) {
|
|
@@ -329,8 +329,8 @@ function Pe() {
|
|
|
329
329
|
};
|
|
330
330
|
} };
|
|
331
331
|
}
|
|
332
|
-
var
|
|
333
|
-
function
|
|
332
|
+
var Le = (e5) => e5.__type === `event-definition`;
|
|
333
|
+
function Re(e5, t2, n2, r2) {
|
|
334
334
|
let i2;
|
|
335
335
|
if (e5.isDomainEvent) {
|
|
336
336
|
let { deletedEvent: e6, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -341,14 +341,14 @@ function Ie(e5, t2, n2, r2) {
|
|
|
341
341
|
let e6 = s2.modifiedFields;
|
|
342
342
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) {
|
|
343
343
|
o2 = structuredClone(i2);
|
|
344
|
-
let e7 =
|
|
344
|
+
let e7 = Me(s2, a2);
|
|
345
345
|
if (e7) return t2(e7);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
return t2(a2(o2));
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
350
|
+
function ze(e5) {
|
|
351
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ie();
|
|
352
352
|
return { initModule(e6) {
|
|
353
353
|
return (r2) => {
|
|
354
354
|
let i2 = t2.get(e6.type) ?? [];
|
|
@@ -358,7 +358,7 @@ function Le(e5) {
|
|
|
358
358
|
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 }))];
|
|
359
359
|
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(`, `)}`);
|
|
360
360
|
let l2 = t2.get(r2) ?? [];
|
|
361
|
-
return await Promise.all(l2.map(({ eventDefinition: e7, handler: t3 }) =>
|
|
361
|
+
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 };
|
|
362
362
|
}, async processRequest(e6, t3) {
|
|
363
363
|
let n3 = await e6.text();
|
|
364
364
|
return this.process(n3, t3);
|
|
@@ -377,12 +377,12 @@ function Le(e5) {
|
|
|
377
377
|
let n3 = Array.from(t2.keys()).map((e7) => ({ type: e7 }));
|
|
378
378
|
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(`, `)}`);
|
|
379
379
|
let r2 = t2.get(e6.eventType) ?? [];
|
|
380
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
380
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Re(t3, n4, e6.payload, { instanceId: e6.instanceId, identity: e6.identity })));
|
|
381
381
|
}, apps: { AppInstalled: m(`AppInstalled`)(), AppRemoved: m(`AppRemoved`)() } } };
|
|
382
382
|
}
|
|
383
|
-
var
|
|
384
|
-
function
|
|
385
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
383
|
+
var Be = (e5) => e5.__type === `service-plugin-definition`;
|
|
384
|
+
function Ve(e5) {
|
|
385
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ie();
|
|
386
386
|
return { initModule(e6) {
|
|
387
387
|
return (r2) => {
|
|
388
388
|
let i2 = t2.get(e6.componentType.toLowerCase()) ?? [];
|
|
@@ -423,43 +423,43 @@ function ze(e5) {
|
|
|
423
423
|
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e6)));
|
|
424
424
|
} } };
|
|
425
425
|
}
|
|
426
|
-
var
|
|
427
|
-
function
|
|
426
|
+
var E = `X-Wix-Consistent`;
|
|
427
|
+
function He(e5) {
|
|
428
428
|
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) => {
|
|
429
|
-
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [
|
|
429
|
+
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} }, l3 = e5.host?.getErrorHandler?.();
|
|
430
430
|
try {
|
|
431
431
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
432
432
|
let e6 = await i3(n3, { ...r3, headers: c3 });
|
|
433
433
|
l3?.handleError(e6, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
434
|
-
let a3 =
|
|
435
|
-
return a3 && (t2[
|
|
434
|
+
let a3 = D(e6);
|
|
435
|
+
return a3 && (t2[E] = a3), e6;
|
|
436
436
|
}
|
|
437
437
|
{
|
|
438
438
|
for (let [e7, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e7, t3);
|
|
439
439
|
let e6 = await i3(n3, r3);
|
|
440
440
|
l3?.handleError(e6, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
441
|
-
let a3 =
|
|
442
|
-
return a3 && (t2[
|
|
441
|
+
let a3 = D(e6);
|
|
442
|
+
return a3 && (t2[E] = a3), e6;
|
|
443
443
|
}
|
|
444
444
|
} catch (e6) {
|
|
445
445
|
throw l3?.handleError(e6, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e6;
|
|
446
446
|
}
|
|
447
|
-
}, { client: c2, initModule: l2 } =
|
|
448
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
449
|
-
return u3 && (t2[
|
|
447
|
+
}, { client: c2, initModule: l2 } = Ve(i2), { client: u2, initModule: d2 } = ze(i2), f2 = async (n3, r3) => {
|
|
448
|
+
let i3 = o2(), s3 = await a2(), c3 = ee(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} } }), u3 = D(l3);
|
|
449
|
+
return u3 && (t2[E] = u3), l3;
|
|
450
450
|
}, m2 = (t3, n3) => {
|
|
451
|
-
if (
|
|
452
|
-
if (
|
|
453
|
-
if (
|
|
451
|
+
if (Le(t3)) return d2(t3);
|
|
452
|
+
if (Be(t3)) return l2(t3);
|
|
453
|
+
if (S(t3) && e5.host) return C(t3, e5.host);
|
|
454
454
|
if (typeof t3 == `function`) {
|
|
455
455
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
456
456
|
let r3 = e5.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e5.useCDN === void 0 ? i2().shouldUseCDN : e5.useCDN;
|
|
457
|
-
return
|
|
457
|
+
return Se(ie(() => _(t3)) ? g(t3) : t3, n3 ?? {}, f2, e5.host?.getErrorHandler?.(), (e6, t4) => {
|
|
458
458
|
let n4 = new URL(e6, `https://${r3}`);
|
|
459
459
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
460
460
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e5.host?.name, o3, e5.validateRequestSchema);
|
|
461
461
|
}
|
|
462
|
-
return
|
|
462
|
+
return te(t3) ? Object.fromEntries(Object.entries(t3).map(([e6, n4]) => [e6, m2(n4, t3[v])])) : t3;
|
|
463
463
|
}, h2 = (e6) => {
|
|
464
464
|
for (let n3 in e6) t2[n3] = e6[n3];
|
|
465
465
|
};
|
|
@@ -478,19 +478,19 @@ function Be(e5) {
|
|
|
478
478
|
return { data: o3 ?? {}, errors: s3 };
|
|
479
479
|
}, webhooks: u2, servicePlugins: c2 };
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function D(e5) {
|
|
482
482
|
return e5.headers?.get(`X-Wix-Consistent`) ?? e5.headers?.get(`x-wix-consistent`);
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
function
|
|
484
|
+
var Ue = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
485
|
+
var We = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
486
|
+
function Ge(e5, t2) {
|
|
487
487
|
return e5?.split(`.`).map((e6) => t2?.[e6] ?? e6).join(`.`);
|
|
488
488
|
}
|
|
489
|
-
var
|
|
490
|
-
function
|
|
491
|
-
return (e5 ===
|
|
489
|
+
var Ke = `sort.fieldName`;
|
|
490
|
+
function qe(e5, t2, n2) {
|
|
491
|
+
return (e5 === Ke || e5.endsWith(`.${Ke}`)) && typeof t2 == `string` ? Ge(t2, n2) : t2;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Je(e5, t2, n2) {
|
|
494
494
|
let r2 = (e6) => n2.includes(e6), i2 = (e6, n3) => {
|
|
495
495
|
if (Array.isArray(e6)) e6.forEach((e7) => {
|
|
496
496
|
i2(e7, n3);
|
|
@@ -500,87 +500,87 @@ function Ke(e5, t2, n2) {
|
|
|
500
500
|
Object.keys(a2).forEach((e7) => {
|
|
501
501
|
let o2 = n3 === `` ? e7 : `${n3}.${e7}`;
|
|
502
502
|
if (r2(o2)) return;
|
|
503
|
-
let s2 =
|
|
504
|
-
s2 !== e7 && !(s2 in a2) && (a2[s2] = a2[e7], delete a2[e7]), a2[s2] =
|
|
503
|
+
let s2 = Ye(e7, t2);
|
|
504
|
+
s2 !== e7 && !(s2 in a2) && (a2[s2] = a2[e7], delete a2[e7]), a2[s2] = qe(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
};
|
|
508
508
|
return i2(e5, ``), e5;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Ye(e5, t2) {
|
|
511
511
|
let n2;
|
|
512
512
|
return n2 = e5.includes(`.`) ? e5.split(`.`).map((e6) => t2[e6] ?? e6).join(`.`) : t2[e5] ?? e5, n2;
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
return
|
|
514
|
+
function Xe(e5, t2 = []) {
|
|
515
|
+
return Je(e5, Ue, t2);
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
return
|
|
517
|
+
function Ze(e5, t2 = []) {
|
|
518
|
+
return Je(e5, We, t2);
|
|
519
519
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
520
|
+
function O(e5) {
|
|
521
|
+
return nt(e5).map((e6) => e6.toLocaleUpperCase()).join(`_`);
|
|
522
522
|
}
|
|
523
|
-
var
|
|
524
|
-
var
|
|
525
|
-
var
|
|
526
|
-
var
|
|
527
|
-
function
|
|
523
|
+
var Qe = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
524
|
+
var $e = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
525
|
+
var et = `$1\0$2`;
|
|
526
|
+
var tt = /[^\p{L}\d]+/giu;
|
|
527
|
+
function nt(e5) {
|
|
528
528
|
let t2 = e5.trim();
|
|
529
|
-
t2 = t2.replace(
|
|
529
|
+
t2 = t2.replace(Qe, et).replace($e, et), t2 = t2.replace(tt, `\0`);
|
|
530
530
|
let n2 = 0, r2 = t2.length;
|
|
531
531
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
532
532
|
if (n2 === r2) return [];
|
|
533
533
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
534
534
|
return t2.slice(n2, r2).split(/\0/g);
|
|
535
535
|
}
|
|
536
|
-
var
|
|
537
|
-
var
|
|
538
|
-
var
|
|
539
|
-
function
|
|
536
|
+
var rt = (e5) => `validationError` in (e5.response?.data?.details ?? {});
|
|
537
|
+
var it = (e5) => `applicationError` in (e5.response?.data?.details ?? {});
|
|
538
|
+
var at = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
|
|
539
|
+
function ot(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
540
540
|
if (typeof e5 != `object` || !e5) throw e5;
|
|
541
|
-
if (
|
|
542
|
-
if (
|
|
543
|
-
if (
|
|
544
|
-
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
545
|
-
return
|
|
541
|
+
if (rt(e5)) return st(e5, t2, n2);
|
|
542
|
+
if (it(e5)) return ct(e5);
|
|
543
|
+
if (at(e5)) {
|
|
544
|
+
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: O(n3), data: {} }, requestId: e5.requestId };
|
|
545
|
+
return k(e5, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
546
546
|
}
|
|
547
|
-
return
|
|
547
|
+
return lt(e5);
|
|
548
548
|
}
|
|
549
|
-
var
|
|
550
|
-
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
551
|
-
return
|
|
549
|
+
var st = (e5, t2, n2) => {
|
|
550
|
+
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ut(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 };
|
|
551
|
+
return k(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e5.response?.status, requestId: i2 } });
|
|
552
552
|
};
|
|
553
|
-
var
|
|
554
|
-
var
|
|
555
|
-
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 ??
|
|
556
|
-
return
|
|
553
|
+
var k = (e5, { message: t2, extraProperties: n2 }) => Object.assign(e5, { ...n2, message: t2 });
|
|
554
|
+
var ct = (e5) => {
|
|
555
|
+
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 ?? O(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 };
|
|
556
|
+
return k(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e5.requestId } });
|
|
557
557
|
};
|
|
558
|
-
var
|
|
559
|
-
var
|
|
558
|
+
var lt = (e5) => k(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: O(e5.response?.statusText ?? `UNKNOWN`), ...!e5.response && { runtimeError: e5 } } });
|
|
559
|
+
var ut = ({ spreadPathsToArguments: e5, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
560
560
|
let a2 = { ...e5, ...t2 }, o2 = Object.keys(a2);
|
|
561
561
|
return r2?.filter((e6) => !r2.some((t3) => t3.field.length > e6.field.length && t3.field.startsWith(e6.field) && o2.includes(t3.field))).map((e6) => {
|
|
562
562
|
let r3 = t2[e6.field];
|
|
563
|
-
if (r3) return { ...e6, field:
|
|
563
|
+
if (r3) return { ...e6, field: dt(r3, i2) };
|
|
564
564
|
let s2 = o2?.sort((e7, t3) => t3.length - e7.length)?.find((t3) => e6.field.startsWith(t3));
|
|
565
565
|
if (s2) {
|
|
566
566
|
let t3 = a2[s2];
|
|
567
|
-
if (t3) return { ...e6, field: e6.field.replace(s2,
|
|
567
|
+
if (t3) return { ...e6, field: e6.field.replace(s2, dt(t3, i2)) };
|
|
568
568
|
}
|
|
569
569
|
return n2 ? { ...e6, field: `${i2[0]}.${e6.field}` } : e6;
|
|
570
570
|
});
|
|
571
571
|
};
|
|
572
|
-
var
|
|
573
|
-
let n2 =
|
|
572
|
+
var dt = (e5, t2) => {
|
|
573
|
+
let n2 = ft(e5);
|
|
574
574
|
return n2 == null ? e5 : e5.replace(`$[${n2}]`, t2[n2]);
|
|
575
575
|
};
|
|
576
|
-
var
|
|
576
|
+
var ft = (e5) => {
|
|
577
577
|
let t2 = e5.match(/\$\[(?<argIndex>\d+)\]/);
|
|
578
578
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
579
579
|
};
|
|
580
|
-
function
|
|
580
|
+
function pt() {
|
|
581
581
|
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
582
582
|
if (e5) return { initWixModules(t3, n3) {
|
|
583
|
-
return
|
|
583
|
+
return A(() => e5(t3, n3));
|
|
584
584
|
}, fetchWithAuth() {
|
|
585
585
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
586
586
|
}, graphql() {
|
|
@@ -590,10 +590,10 @@ function ft() {
|
|
|
590
590
|
if (t2 || n2) return { initWixModules(e6, r2) {
|
|
591
591
|
if (r2) {
|
|
592
592
|
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`);
|
|
593
|
-
return
|
|
593
|
+
return A(() => n2.use(e6));
|
|
594
594
|
}
|
|
595
595
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
596
|
-
return
|
|
596
|
+
return A(() => t2.use(e6));
|
|
597
597
|
}, fetchWithAuth: (e6, n3) => {
|
|
598
598
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
599
599
|
return t2.fetchWithAuth(e6, n3);
|
|
@@ -605,7 +605,7 @@ function ft() {
|
|
|
605
605
|
return t2.graphql(e6, n3, r2);
|
|
606
606
|
} };
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function A(e5) {
|
|
609
609
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
610
610
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
611
611
|
try {
|
|
@@ -614,78 +614,78 @@ function j(e5) {
|
|
|
614
614
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function mt(e5, t2) {
|
|
618
618
|
return (...n2) => {
|
|
619
|
-
let r2 =
|
|
619
|
+
let r2 = pt();
|
|
620
620
|
return r2 ? r2.initWixModules(e5, t2).apply(void 0, n2) : e5.apply(void 0, n2);
|
|
621
621
|
};
|
|
622
622
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
625
|
-
}
|
|
626
|
-
function
|
|
627
|
-
let t2 =
|
|
628
|
-
return
|
|
629
|
-
}
|
|
630
|
-
var
|
|
631
|
-
var
|
|
632
|
-
var
|
|
633
|
-
var
|
|
634
|
-
var
|
|
635
|
-
var
|
|
636
|
-
var
|
|
637
|
-
var
|
|
638
|
-
var
|
|
639
|
-
var
|
|
640
|
-
function Et(e5) {
|
|
641
|
-
return Dt(e5).replace(yt, `._base_domain_`).replace(wt, `._api_base_domain_`).replace(Tt, `*.dev.wix-code.com`);
|
|
642
|
-
}
|
|
623
|
+
function ht(e5, t2 = false) {
|
|
624
|
+
return mt(e5, t2);
|
|
625
|
+
}
|
|
626
|
+
function gt(e5) {
|
|
627
|
+
let t2 = kt(Dt(e5.host), e5.domainToMappings);
|
|
628
|
+
return Rt(Ft(e5.protoPath, e5.data || {}), t2);
|
|
629
|
+
}
|
|
630
|
+
var _t = [`wix.com`, `editorx.com`];
|
|
631
|
+
var vt = `_`;
|
|
632
|
+
var yt = `*.`;
|
|
633
|
+
var bt = RegExp(`\\.(${_t.join(`|`)})$`);
|
|
634
|
+
var xt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
635
|
+
var St = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
636
|
+
var Ct = `dev.wix-code.com`;
|
|
637
|
+
var wt = /{(.*)}/;
|
|
638
|
+
var Tt = RegExp(`\\.(${xt.join(`|`)})$`);
|
|
639
|
+
var Et = RegExp(`.*\\.${Ct}$`);
|
|
643
640
|
function Dt(e5) {
|
|
644
|
-
return
|
|
641
|
+
return Ot(e5).replace(bt, `._base_domain_`).replace(Tt, `._api_base_domain_`).replace(Et, `*.dev.wix-code.com`);
|
|
645
642
|
}
|
|
646
|
-
function Ot(e5
|
|
643
|
+
function Ot(e5) {
|
|
644
|
+
return St[e5] ?? e5;
|
|
645
|
+
}
|
|
646
|
+
function kt(e5, t2) {
|
|
647
647
|
let n2 = t2[e5];
|
|
648
648
|
if (n2) return n2;
|
|
649
|
-
let r2 =
|
|
649
|
+
let r2 = At(e5, t2) ?? jt(e5, t2);
|
|
650
650
|
if (!r2) {
|
|
651
|
-
if (
|
|
652
|
-
let e6 = t2[
|
|
651
|
+
if (Nt(e5)) {
|
|
652
|
+
let e6 = t2[Pt];
|
|
653
653
|
if (e6) return e6;
|
|
654
654
|
}
|
|
655
|
-
let n3 = t2[
|
|
655
|
+
let n3 = t2[vt];
|
|
656
656
|
if (n3) return n3;
|
|
657
657
|
}
|
|
658
658
|
return r2 ?? [];
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function At(e5, t2) {
|
|
661
661
|
return Object.entries(t2).find(([t3]) => {
|
|
662
662
|
let [, ...n2] = e5.split(`.`);
|
|
663
663
|
return n2.join(`.`) === t3;
|
|
664
664
|
})?.[1];
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
666
|
+
function jt(e5, t2) {
|
|
667
|
+
let [n2] = Object.entries(t2).filter(([t3]) => Mt(e5, t3)).sort(([e6], [t3]) => t3.length - e6.length);
|
|
668
668
|
if (!n2) return;
|
|
669
669
|
let [, r2] = n2;
|
|
670
670
|
return r2;
|
|
671
671
|
}
|
|
672
|
-
function
|
|
673
|
-
if (!t2.startsWith(
|
|
672
|
+
function Mt(e5, t2) {
|
|
673
|
+
if (!t2.startsWith(yt)) return false;
|
|
674
674
|
let n2 = t2.slice(1);
|
|
675
675
|
return e5.length > n2.length && e5.endsWith(n2);
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function Nt(e5) {
|
|
678
678
|
return !!e5.match(/\._base_domain_$/);
|
|
679
679
|
}
|
|
680
|
-
var
|
|
681
|
-
function Pt(e5, t2) {
|
|
682
|
-
return e5.split(`/`).map((e6) => Ft(e6, t2)).join(`/`);
|
|
683
|
-
}
|
|
680
|
+
var Pt = `www._base_domain_`;
|
|
684
681
|
function Ft(e5, t2) {
|
|
685
|
-
|
|
686
|
-
|
|
682
|
+
return e5.split(`/`).map((e6) => It(e6, t2)).join(`/`);
|
|
683
|
+
}
|
|
684
|
+
function It(e5, t2) {
|
|
685
|
+
let n2 = e5.match(wt) || [], r2 = n2[1];
|
|
686
|
+
return r2 ? Lt(t2, r2, e5, e5.replace(n2[0], ``)) : e5;
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function Lt(e5, t2, n2, r2) {
|
|
689
689
|
let i2 = e5;
|
|
690
690
|
for (let e6 of t2.split(`.`)) {
|
|
691
691
|
if (!i2) return n2;
|
|
@@ -693,31 +693,31 @@ function It(e5, t2, n2, r2) {
|
|
|
693
693
|
}
|
|
694
694
|
return `${i2}${r2}`;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function Rt(e5, t2) {
|
|
697
697
|
let n2 = t2?.find((t3) => e5.startsWith(t3.destPath));
|
|
698
698
|
return n2 ? n2.srcPath + e5.slice(n2.destPath.length) : e5;
|
|
699
699
|
}
|
|
700
|
-
var
|
|
700
|
+
var j;
|
|
701
701
|
(function(e5) {
|
|
702
702
|
e5.QUERY_PARAM = `QUERY_PARAM`, e5.SUBDOMAIN = `SUBDOMAIN`, e5.SUBDIRECTORY = `SUBDIRECTORY`;
|
|
703
|
-
})(
|
|
704
|
-
var
|
|
705
|
-
var
|
|
703
|
+
})(j ||= {});
|
|
704
|
+
var zt = { 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` };
|
|
705
|
+
var Bt = (e5, t2) => {
|
|
706
706
|
e5.searchParams.set(`lang`, t2);
|
|
707
707
|
};
|
|
708
|
-
var
|
|
708
|
+
var Vt = (e5, t2) => {
|
|
709
709
|
let n2 = e5.hostname.split(`.`);
|
|
710
710
|
n2[0] === `www` && (n2 = n2.slice(1)), n2 = [t2, ...n2], e5.hostname = n2.join(`.`);
|
|
711
711
|
};
|
|
712
|
-
var
|
|
712
|
+
var Ht = (e5, t2) => {
|
|
713
713
|
e5.pathname = `/${t2}${e5.pathname}`;
|
|
714
714
|
};
|
|
715
|
-
var
|
|
715
|
+
var Ut = (e5, t2) => {
|
|
716
716
|
if (!t2.languageCode || !t2?.resolutionMethod) return e5;
|
|
717
717
|
let n2 = new URL(e5);
|
|
718
|
-
return (t2?.resolutionMethod === `QUERY_PARAM` ?
|
|
718
|
+
return (t2?.resolutionMethod === `QUERY_PARAM` ? Bt : t2?.resolutionMethod === `SUBDOMAIN` ? Vt : Ht)(n2, t2.languageCode), n2.href;
|
|
719
719
|
};
|
|
720
|
-
var
|
|
720
|
+
var Wt = (e5, t2) => {
|
|
721
721
|
if (!e5?.length) return e5;
|
|
722
722
|
let n2;
|
|
723
723
|
try {
|
|
@@ -738,91 +738,91 @@ var Ut = (e5, t2) => {
|
|
|
738
738
|
}
|
|
739
739
|
return n2.href;
|
|
740
740
|
};
|
|
741
|
-
function Wt() {
|
|
742
|
-
let e5 = Gt();
|
|
743
|
-
return e5 ? Kt(e5) : [];
|
|
744
|
-
}
|
|
745
741
|
function Gt() {
|
|
742
|
+
let e5 = Kt();
|
|
743
|
+
return e5 ? qt(e5) : [];
|
|
744
|
+
}
|
|
745
|
+
function Kt() {
|
|
746
746
|
let e5 = typeof globals < `u` ? globals?.$ns?.[`wix-window`]?.multilingual : void 0, t2 = typeof window < `u` ? window?.essentials?.multilingual : void 0;
|
|
747
747
|
return e5 ?? t2 ?? globalThis?.__wix_site_metadata__?.multilingual;
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function qt(e5) {
|
|
750
750
|
try {
|
|
751
751
|
if (e5?.supportedLanguages?.length) {
|
|
752
|
-
let t2 = e5.supportedLanguages, n2 = t2.map((e6) => e6.languageCode).filter(Boolean), r2 = e5.cleanUrl ??
|
|
753
|
-
return t2.map((e6) => ({ id: e6.languageCode, displayName:
|
|
752
|
+
let t2 = e5.supportedLanguages, n2 = t2.map((e6) => e6.languageCode).filter(Boolean), r2 = e5.cleanUrl ?? Zt(n2);
|
|
753
|
+
return t2.map((e6) => ({ id: e6.languageCode, displayName: Jt(e6), regionalFormat: [e6.locale?.languageCode, e6.locale?.country].filter(Boolean).join(`-`), url: Yt(e6, r2), primary: e6.isPrimary, resolutionMethod: e6.resolutionMethod }));
|
|
754
754
|
}
|
|
755
755
|
if (e5?.siteLanguages?.length) {
|
|
756
|
-
let t2 = e5.siteLanguages, n2 =
|
|
757
|
-
return t2.map((e6) => ({ id: e6.languageCode, displayName:
|
|
756
|
+
let t2 = e5.siteLanguages, n2 = Zt(t2.map((e6) => e6.languageCode).filter(Boolean));
|
|
757
|
+
return t2.map((e6) => ({ id: e6.languageCode, displayName: Jt(e6), regionalFormat: e6.locale, url: Yt(e6, n2), primary: e6.isPrimaryLanguage, resolutionMethod: e6.resolutionMethod ? Xt(e6.resolutionMethod) : void 0 }));
|
|
758
758
|
}
|
|
759
759
|
} catch (e6) {
|
|
760
760
|
return console.warn(`[Multilingual Manager] listSupportedLanguages failed`, e6), [];
|
|
761
761
|
}
|
|
762
762
|
return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`), [];
|
|
763
763
|
}
|
|
764
|
-
function
|
|
765
|
-
let t2 =
|
|
764
|
+
function Jt(e5) {
|
|
765
|
+
let t2 = zt[e5.languageCode];
|
|
766
766
|
if (t2) return t2;
|
|
767
767
|
let n2 = e5.name ?? e5.countryCode;
|
|
768
768
|
if (n2) return n2;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function Yt(e5, t2) {
|
|
771
771
|
if (e5.url || !t2 || !e5.resolutionMethod) return e5.url;
|
|
772
772
|
if (e5.languageCode) try {
|
|
773
|
-
return
|
|
773
|
+
return Ut(t2, { languageCode: e5.languageCode, countryCode: e5.countryCode, resolutionMethod: Xt(e5.resolutionMethod), locale: { languageCode: e5.languageCode, country: e5.countryCode } });
|
|
774
774
|
} catch (e6) {
|
|
775
775
|
console.warn(`[Multilingual Manager] buildUrlForLanguage failed`, e6);
|
|
776
776
|
return;
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function Xt(e5) {
|
|
780
780
|
switch (e5) {
|
|
781
781
|
case `QUERY_PARAM`:
|
|
782
782
|
case `QueryParam`:
|
|
783
|
-
return
|
|
783
|
+
return j.QUERY_PARAM;
|
|
784
784
|
case `SUBDOMAIN`:
|
|
785
785
|
case `Subdomain`:
|
|
786
|
-
return
|
|
786
|
+
return j.SUBDOMAIN;
|
|
787
787
|
case `SUBDIRECTORY`:
|
|
788
788
|
case `Subdirectory`:
|
|
789
|
-
return
|
|
789
|
+
return j.SUBDIRECTORY;
|
|
790
790
|
default:
|
|
791
791
|
return;
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function Zt(e5) {
|
|
795
795
|
let t2 = typeof window < `u` && window.location?.href ? window.location.href : ``;
|
|
796
796
|
try {
|
|
797
|
-
return
|
|
797
|
+
return Wt(t2, e5);
|
|
798
798
|
} catch (e6) {
|
|
799
799
|
return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`, e6), t2;
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
|
-
var
|
|
803
|
-
var
|
|
804
|
-
var
|
|
805
|
-
var
|
|
806
|
-
let e5 =
|
|
807
|
-
if (e5) return { [
|
|
802
|
+
var Qt = `x-wix-linguist`;
|
|
803
|
+
var $t = `00000000-0000-0000-0000-000000000000`;
|
|
804
|
+
var en = `false`;
|
|
805
|
+
var tn = () => {
|
|
806
|
+
let e5 = M(`language`), t2 = M(`locale`);
|
|
807
|
+
if (e5) return { [Qt]: [e5, t2 || e5, en, $t].join(`|`) };
|
|
808
808
|
};
|
|
809
|
-
function
|
|
809
|
+
function nn() {
|
|
810
810
|
let e5 = null, t2 = null;
|
|
811
811
|
return { promise: new Promise((n2, r2) => {
|
|
812
812
|
e5 = n2, t2 = r2;
|
|
813
813
|
}), resolve: e5, reject: t2 };
|
|
814
814
|
}
|
|
815
|
-
var
|
|
816
|
-
var
|
|
817
|
-
var
|
|
818
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 =
|
|
819
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
820
|
-
return
|
|
815
|
+
var rn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
816
|
+
var M = (e5) => rn()?.[e5];
|
|
817
|
+
var an = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host: (t2) => {
|
|
818
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 = sn();
|
|
819
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: M(`language`), locale: M(`locale`), get passThroughHeaders() {
|
|
820
|
+
return tn();
|
|
821
821
|
} } };
|
|
822
822
|
}, auth: (e6) => {
|
|
823
823
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
824
|
-
!e6 &&
|
|
825
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
824
|
+
!e6 && on() && (e6 = t2?.getAccessTokenFunction?.());
|
|
825
|
+
let n2 = false, { resolve: r2, promise: i2 } = nn();
|
|
826
826
|
return { getAuthHeaders: async () => {
|
|
827
827
|
if (!e6 && n2 && (e6 = await i2), !e6) throw Error(`Failed to resolve auth token`);
|
|
828
828
|
return { headers: { Authorization: await e6() } };
|
|
@@ -830,37 +830,37 @@ var rn = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host:
|
|
|
830
830
|
r2(e7);
|
|
831
831
|
}) };
|
|
832
832
|
} });
|
|
833
|
-
function
|
|
833
|
+
function on() {
|
|
834
834
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function sn() {
|
|
837
837
|
let e5 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
838
838
|
if (!e5) return;
|
|
839
839
|
let t2 = new URL(e5);
|
|
840
840
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
841
841
|
}
|
|
842
|
-
var
|
|
842
|
+
var cn = ({ clientSdk: e5, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
843
843
|
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`);
|
|
844
844
|
return e5.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
845
845
|
}, getAccessToken: () => {
|
|
846
846
|
throw Error(`Not implemented`);
|
|
847
847
|
}, observeState: () => ({ disconnect: () => {
|
|
848
848
|
} }) });
|
|
849
|
-
var
|
|
849
|
+
var ln = an({ createHost: function(e5) {
|
|
850
850
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e5?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e5 || {};
|
|
851
851
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
852
|
-
return { channel:
|
|
852
|
+
return { channel: cn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
853
853
|
} };
|
|
854
854
|
} });
|
|
855
|
-
var
|
|
856
|
-
let n2 =
|
|
857
|
-
return
|
|
855
|
+
var un = (e5, t2) => {
|
|
856
|
+
let n2 = ln.host({ applicationId: e5, componentId: t2 }), r2 = ln.auth();
|
|
857
|
+
return He({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
858
858
|
};
|
|
859
|
-
var
|
|
860
|
-
function
|
|
859
|
+
var dn = (e5) => un(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e5);
|
|
860
|
+
function fn() {
|
|
861
861
|
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
862
862
|
if (e5) return { initWixModules(t3, n3) {
|
|
863
|
-
return
|
|
863
|
+
return N(() => e5(t3, n3));
|
|
864
864
|
}, fetchWithAuth() {
|
|
865
865
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
866
866
|
}, graphql() {
|
|
@@ -870,10 +870,10 @@ function dn() {
|
|
|
870
870
|
if (t2 || n2) return { initWixModules(e6, r2) {
|
|
871
871
|
if (r2) {
|
|
872
872
|
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`);
|
|
873
|
-
return
|
|
873
|
+
return N(() => n2.use(e6));
|
|
874
874
|
}
|
|
875
875
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
876
|
-
return
|
|
876
|
+
return N(() => t2.use(e6));
|
|
877
877
|
}, fetchWithAuth: (e6, n3) => {
|
|
878
878
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
879
879
|
return t2.fetchWithAuth(e6, n3);
|
|
@@ -885,7 +885,7 @@ function dn() {
|
|
|
885
885
|
return t2.graphql(e6, n3, r2);
|
|
886
886
|
} };
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function N(e5) {
|
|
889
889
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
890
890
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
891
891
|
try {
|
|
@@ -894,71 +894,71 @@ function P(e5) {
|
|
|
894
894
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function pn(e5, t2) {
|
|
898
898
|
return { ...e5, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
899
|
-
let r2 =
|
|
899
|
+
let r2 = fn();
|
|
900
900
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
901
901
|
return r2.initWixModules(e5)[t3].apply(void 0, n2);
|
|
902
902
|
}])) };
|
|
903
903
|
}
|
|
904
|
-
function
|
|
905
|
-
return
|
|
904
|
+
function mn(e5) {
|
|
905
|
+
return pn({ __type: `host`, create: (t2) => Object.entries(e5).reduce((e6, [n2, r2]) => ({ ...e6, [n2]: r2(t2) }), {}) }, Object.keys(e5));
|
|
906
906
|
}
|
|
907
|
-
var
|
|
908
|
-
var
|
|
907
|
+
var P = (e5) => typeof e5 == `string`;
|
|
908
|
+
var F = () => {
|
|
909
909
|
let e5, t2, n2 = new Promise((n3, r2) => {
|
|
910
910
|
e5 = n3, t2 = r2;
|
|
911
911
|
});
|
|
912
912
|
return n2.resolve = e5, n2.reject = t2, n2;
|
|
913
913
|
};
|
|
914
|
-
var
|
|
915
|
-
var
|
|
914
|
+
var hn = (e5) => e5 == null ? `` : `` + e5;
|
|
915
|
+
var gn = (e5, t2, n2) => {
|
|
916
916
|
e5.forEach((e6) => {
|
|
917
917
|
t2[e6] && (n2[e6] = t2[e6]);
|
|
918
918
|
});
|
|
919
919
|
};
|
|
920
|
-
var
|
|
921
|
-
var
|
|
922
|
-
var
|
|
923
|
-
var
|
|
924
|
-
let r2 =
|
|
920
|
+
var _n = /###/g;
|
|
921
|
+
var vn = (e5) => e5 && e5.indexOf(`###`) > -1 ? e5.replace(_n, `.`) : e5;
|
|
922
|
+
var yn = (e5) => !e5 || P(e5);
|
|
923
|
+
var I = (e5, t2, n2) => {
|
|
924
|
+
let r2 = P(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
925
925
|
for (; i2 < r2.length - 1; ) {
|
|
926
|
-
if (
|
|
927
|
-
let t3 =
|
|
926
|
+
if (yn(e5)) return {};
|
|
927
|
+
let t3 = vn(r2[i2]);
|
|
928
928
|
!e5[t3] && n2 && (e5[t3] = new n2()), e5 = Object.prototype.hasOwnProperty.call(e5, t3) ? e5[t3] : {}, ++i2;
|
|
929
929
|
}
|
|
930
|
-
return
|
|
930
|
+
return yn(e5) ? {} : { obj: e5, k: vn(r2[i2]) };
|
|
931
931
|
};
|
|
932
|
-
var
|
|
933
|
-
let { obj: r2, k: i2 } =
|
|
932
|
+
var bn = (e5, t2, n2) => {
|
|
933
|
+
let { obj: r2, k: i2 } = I(e5, t2, Object);
|
|
934
934
|
if (r2 !== void 0 || t2.length === 1) {
|
|
935
935
|
r2[i2] = n2;
|
|
936
936
|
return;
|
|
937
937
|
}
|
|
938
|
-
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 =
|
|
939
|
-
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 =
|
|
938
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = I(e5, o2, Object);
|
|
939
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = I(e5, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
940
940
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
941
941
|
};
|
|
942
|
-
var
|
|
943
|
-
let { obj: i2, k: a2 } =
|
|
942
|
+
var xn = (e5, t2, n2, r2) => {
|
|
943
|
+
let { obj: i2, k: a2 } = I(e5, t2, Object);
|
|
944
944
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
945
945
|
};
|
|
946
|
-
var
|
|
947
|
-
let { obj: n2, k: r2 } =
|
|
946
|
+
var L = (e5, t2) => {
|
|
947
|
+
let { obj: n2, k: r2 } = I(e5, t2);
|
|
948
948
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
949
949
|
};
|
|
950
|
-
var xn = (e5, t2, n2) => {
|
|
951
|
-
let r2 = R(e5, n2);
|
|
952
|
-
return r2 === void 0 ? R(t2, n2) : r2;
|
|
953
|
-
};
|
|
954
950
|
var Sn = (e5, t2, n2) => {
|
|
955
|
-
|
|
951
|
+
let r2 = L(e5, n2);
|
|
952
|
+
return r2 === void 0 ? L(t2, n2) : r2;
|
|
953
|
+
};
|
|
954
|
+
var Cn = (e5, t2, n2) => {
|
|
955
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (r2 in e5 ? P(e5[r2]) || e5[r2] instanceof String || P(t2[r2]) || t2[r2] instanceof String ? n2 && (e5[r2] = t2[r2]) : Cn(e5[r2], t2[r2], n2) : e5[r2] = t2[r2]);
|
|
956
956
|
return e5;
|
|
957
957
|
};
|
|
958
|
-
var
|
|
959
|
-
var
|
|
960
|
-
var
|
|
961
|
-
var
|
|
958
|
+
var R = (e5) => e5.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
959
|
+
var wn = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
960
|
+
var Tn = (e5) => P(e5) ? e5.replace(/[&<>"'\/]/g, (e6) => wn[e6]) : e5;
|
|
961
|
+
var En = class {
|
|
962
962
|
constructor(e5) {
|
|
963
963
|
this.capacity = e5, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
964
964
|
}
|
|
@@ -969,20 +969,20 @@ var Tn = class {
|
|
|
969
969
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e5, n2), this.regExpQueue.push(e5), n2;
|
|
970
970
|
}
|
|
971
971
|
};
|
|
972
|
-
var
|
|
973
|
-
var
|
|
974
|
-
var
|
|
972
|
+
var Dn = [` `, `,`, `?`, `!`, `;`];
|
|
973
|
+
var On = new En(20);
|
|
974
|
+
var kn = (e5, t2, n2) => {
|
|
975
975
|
t2 ||= ``, n2 ||= ``;
|
|
976
|
-
let r2 =
|
|
976
|
+
let r2 = Dn.filter((e6) => t2.indexOf(e6) < 0 && n2.indexOf(e6) < 0);
|
|
977
977
|
if (r2.length === 0) return true;
|
|
978
|
-
let i2 =
|
|
978
|
+
let i2 = On.getRegExp(`(${r2.map((e6) => e6 === `?` ? `\\?` : e6).join(`|`)})`), a2 = !i2.test(e5);
|
|
979
979
|
if (!a2) {
|
|
980
980
|
let t3 = e5.indexOf(n2);
|
|
981
981
|
t3 > 0 && !i2.test(e5.substring(0, t3)) && (a2 = true);
|
|
982
982
|
}
|
|
983
983
|
return a2;
|
|
984
984
|
};
|
|
985
|
-
var
|
|
985
|
+
var z = (e5, t2, n2 = `.`) => {
|
|
986
986
|
if (!e5) return;
|
|
987
987
|
if (e5[t2]) return Object.prototype.hasOwnProperty.call(e5, t2) ? e5[t2] : void 0;
|
|
988
988
|
let r2 = t2.split(n2), i2 = e5;
|
|
@@ -998,8 +998,8 @@ var B = (e5, t2, n2 = `.`) => {
|
|
|
998
998
|
}
|
|
999
999
|
return i2;
|
|
1000
1000
|
};
|
|
1001
|
-
var
|
|
1002
|
-
var
|
|
1001
|
+
var B = (e5) => e5?.replace(/_/g, `-`);
|
|
1002
|
+
var An = { type: `logger`, log(e5) {
|
|
1003
1003
|
this.output(`log`, e5);
|
|
1004
1004
|
}, warn(e5) {
|
|
1005
1005
|
this.output(`warn`, e5);
|
|
@@ -1008,12 +1008,12 @@ var kn = { type: `logger`, log(e5) {
|
|
|
1008
1008
|
}, output(e5, t2) {
|
|
1009
1009
|
console?.[e5]?.apply?.(console, t2);
|
|
1010
1010
|
} };
|
|
1011
|
-
var
|
|
1011
|
+
var V = new class e2 {
|
|
1012
1012
|
constructor(e5, t2 = {}) {
|
|
1013
1013
|
this.init(e5, t2);
|
|
1014
1014
|
}
|
|
1015
1015
|
init(e5, t2 = {}) {
|
|
1016
|
-
this.prefix = t2.prefix || `i18next:`, this.logger = e5 ||
|
|
1016
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e5 || An, this.options = t2, this.debug = t2.debug;
|
|
1017
1017
|
}
|
|
1018
1018
|
log(...e5) {
|
|
1019
1019
|
return this.forward(e5, `log`, ``, true);
|
|
@@ -1028,7 +1028,7 @@ var H = new class e2 {
|
|
|
1028
1028
|
return this.forward(e5, `warn`, `WARNING DEPRECATED: `, true);
|
|
1029
1029
|
}
|
|
1030
1030
|
forward(e5, t2, n2, r2) {
|
|
1031
|
-
return r2 && !this.debug ? null : (
|
|
1031
|
+
return r2 && !this.debug ? null : (P(e5[0]) && (e5[0] = `${n2}${this.prefix} ${e5[0]}`), this.logger[t2](e5));
|
|
1032
1032
|
}
|
|
1033
1033
|
create(t2) {
|
|
1034
1034
|
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
@@ -1037,7 +1037,7 @@ var H = new class e2 {
|
|
|
1037
1037
|
return t2 ||= this.options, t2.prefix = t2.prefix || this.prefix, new e2(this.logger, t2);
|
|
1038
1038
|
}
|
|
1039
1039
|
}();
|
|
1040
|
-
var
|
|
1040
|
+
var H = class {
|
|
1041
1041
|
constructor() {
|
|
1042
1042
|
this.observers = {};
|
|
1043
1043
|
}
|
|
@@ -1065,7 +1065,7 @@ var U = class {
|
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
};
|
|
1068
|
-
var
|
|
1068
|
+
var jn = class extends H {
|
|
1069
1069
|
constructor(e5, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1070
1070
|
super(), this.data = e5 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1071
1071
|
}
|
|
@@ -1078,23 +1078,23 @@ var An = class extends U {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
getResource(e5, t2, n2, r2 = {}) {
|
|
1080
1080
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1081
|
-
e5.indexOf(`.`) > -1 ? o2 = e5.split(`.`) : (o2 = [e5, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) :
|
|
1082
|
-
let s2 =
|
|
1083
|
-
return !s2 && !t2 && !n2 && e5.indexOf(`.`) > -1 && (e5 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !
|
|
1081
|
+
e5.indexOf(`.`) > -1 ? o2 = e5.split(`.`) : (o2 = [e5, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : P(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1082
|
+
let s2 = L(this.data, o2);
|
|
1083
|
+
return !s2 && !t2 && !n2 && e5.indexOf(`.`) > -1 && (e5 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !P(n2) ? s2 : z(this.data?.[e5]?.[t2], n2, i2);
|
|
1084
1084
|
}
|
|
1085
1085
|
addResource(e5, t2, n2, r2, i2 = { silent: false }) {
|
|
1086
1086
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e5, t2];
|
|
1087
|
-
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2),
|
|
1087
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), bn(this.data, o2, r2), i2.silent || this.emit(`added`, e5, t2, n2, r2);
|
|
1088
1088
|
}
|
|
1089
1089
|
addResources(e5, t2, n2, r2 = { silent: false }) {
|
|
1090
|
-
for (let r3 in n2) (
|
|
1090
|
+
for (let r3 in n2) (P(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e5, t2, r3, n2[r3], { silent: true });
|
|
1091
1091
|
r2.silent || this.emit(`added`, e5, t2, n2);
|
|
1092
1092
|
}
|
|
1093
1093
|
addResourceBundle(e5, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
1094
1094
|
let o2 = [e5, t2];
|
|
1095
1095
|
e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1096
|
-
let s2 =
|
|
1097
|
-
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ?
|
|
1096
|
+
let s2 = L(this.data, o2) || {};
|
|
1097
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? Cn(s2, n2, i2) : s2 = { ...s2, ...n2 }, bn(this.data, o2, s2), a2.silent || this.emit(`added`, e5, t2, n2);
|
|
1098
1098
|
}
|
|
1099
1099
|
removeResourceBundle(e5, t2) {
|
|
1100
1100
|
this.hasResourceBundle(e5, t2) && delete this.data[e5][t2], this.removeNamespaces(t2), this.emit(`removed`, e5, t2);
|
|
@@ -1116,31 +1116,31 @@ var An = class extends U {
|
|
|
1116
1116
|
return this.data;
|
|
1117
1117
|
}
|
|
1118
1118
|
};
|
|
1119
|
-
var
|
|
1119
|
+
var Mn = { processors: {}, addPostProcessor(e5) {
|
|
1120
1120
|
this.processors[e5.name] = e5;
|
|
1121
1121
|
}, handle(e5, t2, n2, r2, i2) {
|
|
1122
1122
|
return e5.forEach((e6) => {
|
|
1123
1123
|
t2 = this.processors[e6]?.process(t2, n2, r2, i2) ?? t2;
|
|
1124
1124
|
}), t2;
|
|
1125
1125
|
} };
|
|
1126
|
-
var
|
|
1127
|
-
function
|
|
1126
|
+
var Nn = Symbol(`i18next/PATH_KEY`);
|
|
1127
|
+
function Pn() {
|
|
1128
1128
|
let e5 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1129
|
-
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 ===
|
|
1129
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === Nn ? e5 : (e5.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1132
|
-
let { [
|
|
1131
|
+
function U(e5, t2) {
|
|
1132
|
+
let { [Nn]: n2 } = e5(Pn()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`;
|
|
1133
1133
|
if (n2.length > 1 && i2) {
|
|
1134
1134
|
let e6 = t2?.ns, a2 = Array.isArray(e6) ? e6 : null;
|
|
1135
1135
|
if (a2 && a2.length > 1 && a2.slice(1).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1136
1136
|
}
|
|
1137
1137
|
return n2.join(r2);
|
|
1138
1138
|
}
|
|
1139
|
-
var
|
|
1140
|
-
var
|
|
1141
|
-
var In = class e3 extends
|
|
1139
|
+
var Fn = {};
|
|
1140
|
+
var W = (e5) => !P(e5) && typeof e5 != `boolean` && typeof e5 != `number`;
|
|
1141
|
+
var In = class e3 extends H {
|
|
1142
1142
|
constructor(e5, t2 = {}) {
|
|
1143
|
-
super(),
|
|
1143
|
+
super(), gn([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e5, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = V.create(`translator`);
|
|
1144
1144
|
}
|
|
1145
1145
|
changeLanguage(e5) {
|
|
1146
1146
|
e5 && (this.language = e5);
|
|
@@ -1150,53 +1150,53 @@ var In = class e3 extends U {
|
|
|
1150
1150
|
if (e5 == null) return false;
|
|
1151
1151
|
let r2 = this.resolve(e5, n2);
|
|
1152
1152
|
if (r2?.res === void 0) return false;
|
|
1153
|
-
let i2 =
|
|
1153
|
+
let i2 = W(r2.res);
|
|
1154
1154
|
return !(n2.returnObjects === false && i2);
|
|
1155
1155
|
}
|
|
1156
1156
|
extractFromKey(e5, t2) {
|
|
1157
1157
|
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1158
1158
|
n2 === void 0 && (n2 = `:`);
|
|
1159
|
-
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 && !
|
|
1159
|
+
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 && !kn(e5, n2, r2);
|
|
1160
1160
|
if (a2 && !o2) {
|
|
1161
1161
|
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1162
|
-
if (t3 && t3.length > 0) return { key: e5, namespaces:
|
|
1162
|
+
if (t3 && t3.length > 0) return { key: e5, namespaces: P(i2) ? [i2] : i2 };
|
|
1163
1163
|
let a3 = e5.split(n2);
|
|
1164
1164
|
(n2 !== r2 || n2 === r2 && this.options.ns.indexOf(a3[0]) > -1) && (i2 = a3.shift()), e5 = a3.join(r2);
|
|
1165
1165
|
}
|
|
1166
|
-
return { key: e5, namespaces:
|
|
1166
|
+
return { key: e5, namespaces: P(i2) ? [i2] : i2 };
|
|
1167
1167
|
}
|
|
1168
1168
|
translate(t2, n2, r2) {
|
|
1169
1169
|
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
1170
1170
|
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
1171
|
-
typeof t2 == `function` && (t2 =
|
|
1171
|
+
typeof t2 == `function` && (t2 = U(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e5) => typeof e5 == `function` ? U(e5, { ...this.options, ...i2 }) : String(e5));
|
|
1172
1172
|
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;
|
|
1173
1173
|
u2 === void 0 && (u2 = `:`);
|
|
1174
1174
|
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1175
1175
|
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;
|
|
1176
|
-
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 && !
|
|
1177
|
-
y2 && !m2 && x2 && (
|
|
1178
|
-
let
|
|
1179
|
-
if (y2 &&
|
|
1176
|
+
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 && !P(i2.count), x2 = e3.hasDefaultValue(i2), ee2 = b2 ? this.pluralResolver.getSuffix(d2, i2.count, i2) : ``, te2 = i2.ordinal && b2 ? this.pluralResolver.getSuffix(d2, i2.count, { ordinal: false }) : ``, S2 = b2 && !i2.ordinal && i2.count === 0, C2 = S2 && i2[`defaultValue${this.options.pluralSeparator}zero`] || i2[`defaultValue${ee2}`] || i2[`defaultValue${te2}`] || i2.defaultValue, w2 = m2;
|
|
1177
|
+
y2 && !m2 && x2 && (w2 = C2);
|
|
1178
|
+
let ne2 = W(w2), re2 = Object.prototype.toString.apply(w2);
|
|
1179
|
+
if (y2 && w2 && ne2 && _2.indexOf(re2) < 0 && !(P(v2) && Array.isArray(w2))) {
|
|
1180
1180
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1181
1181
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
1182
|
-
let e5 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2,
|
|
1182
|
+
let e5 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, w2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
1183
1183
|
return a2 ? (p2.res = e5, p2.usedParams = this.getUsedParamsDetails(i2), p2) : e5;
|
|
1184
1184
|
}
|
|
1185
1185
|
if (o2) {
|
|
1186
|
-
let e5 = Array.isArray(
|
|
1187
|
-
for (let e6 in
|
|
1186
|
+
let e5 = Array.isArray(w2), t3 = e5 ? [] : {}, n3 = e5 ? g2 : h2;
|
|
1187
|
+
for (let e6 in w2) if (Object.prototype.hasOwnProperty.call(w2, e6)) {
|
|
1188
1188
|
let r3 = `${n3}${o2}${e6}`;
|
|
1189
|
-
t3[e6] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue:
|
|
1189
|
+
t3[e6] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue: W(C2) ? C2[e6] : void 0, joinArrays: false, ns: c2 }) : this.translate(r3, { ...i2, joinArrays: false, ns: c2 }), t3[e6] === r3 && (t3[e6] = w2[e6]);
|
|
1190
1190
|
}
|
|
1191
1191
|
m2 = t3;
|
|
1192
1192
|
}
|
|
1193
|
-
} else if (y2 &&
|
|
1193
|
+
} else if (y2 && P(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
1194
1194
|
else {
|
|
1195
1195
|
let e5 = false, n3 = false;
|
|
1196
|
-
!this.isValidLookup(m2) && x2 && (e5 = true, m2 =
|
|
1197
|
-
let a3 = (i2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n3 ? void 0 : m2, c3 = x2 &&
|
|
1196
|
+
!this.isValidLookup(m2) && x2 && (e5 = true, m2 = C2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
1197
|
+
let a3 = (i2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n3 ? void 0 : m2, c3 = x2 && C2 !== m2 && this.options.updateMissing;
|
|
1198
1198
|
if (n3 || e5 || c3) {
|
|
1199
|
-
if (this.logger.log(c3 ? `updateKey` : `missingKey`, d2, l2, s2, c3 ?
|
|
1199
|
+
if (this.logger.log(c3 ? `updateKey` : `missingKey`, d2, l2, s2, c3 ? C2 : m2), o2) {
|
|
1200
1200
|
let e7 = this.resolve(s2, { ...i2, keySeparator: false });
|
|
1201
1201
|
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.`);
|
|
1202
1202
|
}
|
|
@@ -1209,10 +1209,10 @@ var In = class e3 extends U {
|
|
|
1209
1209
|
};
|
|
1210
1210
|
this.options.saveMissing && (this.options.saveMissingPlurals && b2 ? e6.forEach((e7) => {
|
|
1211
1211
|
let t4 = this.pluralResolver.getSuffixes(e7, i2);
|
|
1212
|
-
|
|
1213
|
-
n4([e7], s2 + t5, i2[`defaultValue${t5}`] ||
|
|
1212
|
+
S2 && i2[`defaultValue${this.options.pluralSeparator}zero`] && t4.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t4.push(`${this.options.pluralSeparator}zero`), t4.forEach((t5) => {
|
|
1213
|
+
n4([e7], s2 + t5, i2[`defaultValue${t5}`] || C2);
|
|
1214
1214
|
});
|
|
1215
|
-
}) : n4(e6, s2,
|
|
1215
|
+
}) : n4(e6, s2, C2));
|
|
1216
1216
|
}
|
|
1217
1217
|
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));
|
|
1218
1218
|
}
|
|
@@ -1222,32 +1222,32 @@ var In = class e3 extends U {
|
|
|
1222
1222
|
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 });
|
|
1223
1223
|
else if (!n2.skipInterpolation) {
|
|
1224
1224
|
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
1225
|
-
let a3 =
|
|
1225
|
+
let a3 = P(e5) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
1226
1226
|
if (a3) {
|
|
1227
1227
|
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1228
1228
|
o3 = t3 && t3.length;
|
|
1229
1229
|
}
|
|
1230
|
-
let s2 = n2.replace && !
|
|
1230
|
+
let s2 = n2.replace && !P(n2.replace) ? n2.replace : n2;
|
|
1231
1231
|
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) {
|
|
1232
1232
|
let t3 = e5.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
1233
1233
|
o3 < r3 && (n2.nest = false);
|
|
1234
1234
|
}
|
|
1235
1235
|
!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();
|
|
1236
1236
|
}
|
|
1237
|
-
let a2 = n2.postProcess || this.options.postProcess, o2 =
|
|
1238
|
-
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 =
|
|
1237
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = P(a2) ? [a2] : a2;
|
|
1238
|
+
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 = Mn.handle(o2, e5, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e5;
|
|
1239
1239
|
}
|
|
1240
1240
|
resolve(e5, t2 = {}) {
|
|
1241
1241
|
let n2, r2, i2, a2, o2;
|
|
1242
|
-
return
|
|
1242
|
+
return P(e5) && (e5 = [e5]), Array.isArray(e5) && (e5 = e5.map((e6) => typeof e6 == `function` ? U(e6, { ...this.options, ...t2 }) : e6)), e5.forEach((e6) => {
|
|
1243
1243
|
if (this.isValidLookup(n2)) return;
|
|
1244
1244
|
let s2 = this.extractFromKey(e6, t2), c2 = s2.key;
|
|
1245
1245
|
r2 = c2;
|
|
1246
1246
|
let l2 = s2.namespaces;
|
|
1247
1247
|
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1248
|
-
let u2 = t2.count !== void 0 && !
|
|
1248
|
+
let u2 = t2.count !== void 0 && !P(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (P(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1249
1249
|
l2.forEach((e7) => {
|
|
1250
|
-
this.isValidLookup(n2) || (o2 = e7, !
|
|
1250
|
+
this.isValidLookup(n2) || (o2 = e7, !Fn[`${p2[0]}-${e7}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (Fn[`${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) => {
|
|
1251
1251
|
if (this.isValidLookup(n2)) return;
|
|
1252
1252
|
a2 = r3;
|
|
1253
1253
|
let o3 = [c2];
|
|
@@ -1274,7 +1274,7 @@ var In = class e3 extends U {
|
|
|
1274
1274
|
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e5, t2, n2, r2) : this.resourceStore.getResource(e5, t2, n2, r2);
|
|
1275
1275
|
}
|
|
1276
1276
|
getUsedParamsDetails(e5 = {}) {
|
|
1277
|
-
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e5.replace && !
|
|
1277
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e5.replace && !P(e5.replace), r2 = n2 ? e5.replace : e5;
|
|
1278
1278
|
if (n2 && e5.count !== void 0 && (r2.count = e5.count), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
1279
1279
|
r2 = { ...r2 };
|
|
1280
1280
|
for (let e6 of t2) delete r2[e6];
|
|
@@ -1288,20 +1288,20 @@ var In = class e3 extends U {
|
|
|
1288
1288
|
};
|
|
1289
1289
|
var Ln = class {
|
|
1290
1290
|
constructor(e5) {
|
|
1291
|
-
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger =
|
|
1291
|
+
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger = V.create(`languageUtils`);
|
|
1292
1292
|
}
|
|
1293
1293
|
getScriptPartFromCode(e5) {
|
|
1294
|
-
if (e5 =
|
|
1294
|
+
if (e5 = B(e5), !e5 || e5.indexOf(`-`) < 0) return null;
|
|
1295
1295
|
let t2 = e5.split(`-`);
|
|
1296
1296
|
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
1297
1297
|
}
|
|
1298
1298
|
getLanguagePartFromCode(e5) {
|
|
1299
|
-
if (e5 =
|
|
1299
|
+
if (e5 = B(e5), !e5 || e5.indexOf(`-`) < 0) return e5;
|
|
1300
1300
|
let t2 = e5.split(`-`);
|
|
1301
1301
|
return this.formatLanguageCode(t2[0]);
|
|
1302
1302
|
}
|
|
1303
1303
|
formatLanguageCode(e5) {
|
|
1304
|
-
if (
|
|
1304
|
+
if (P(e5) && e5.indexOf(`-`) > -1) {
|
|
1305
1305
|
let t2;
|
|
1306
1306
|
try {
|
|
1307
1307
|
t2 = Intl.getCanonicalLocales(e5)[0];
|
|
@@ -1334,7 +1334,7 @@ var Ln = class {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
getFallbackCodes(e5, t2) {
|
|
1336
1336
|
if (!e5) return [];
|
|
1337
|
-
if (typeof e5 == `function` && (e5 = e5(t2)),
|
|
1337
|
+
if (typeof e5 == `function` && (e5 = e5(t2)), P(e5) && (e5 = [e5]), Array.isArray(e5)) return e5;
|
|
1338
1338
|
if (!t2) return e5.default || [];
|
|
1339
1339
|
let n2 = e5[t2];
|
|
1340
1340
|
return n2 ||= e5[this.getScriptPartFromCode(t2)], n2 ||= e5[this.formatLanguageCode(t2)], n2 ||= e5[this.getLanguagePartFromCode(t2)], n2 ||= e5.default, n2 || [];
|
|
@@ -1343,7 +1343,7 @@ var Ln = class {
|
|
|
1343
1343
|
let n2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e5), r2 = [], i2 = (e6) => {
|
|
1344
1344
|
e6 && (this.isSupportedCode(e6) ? r2.push(e6) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e6}`));
|
|
1345
1345
|
};
|
|
1346
|
-
return
|
|
1346
|
+
return P(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))) : P(e5) && i2(this.formatLanguageCode(e5)), n2.forEach((e6) => {
|
|
1347
1347
|
r2.indexOf(e6) < 0 && i2(this.formatLanguageCode(e6));
|
|
1348
1348
|
}), r2;
|
|
1349
1349
|
}
|
|
@@ -1352,13 +1352,13 @@ var Rn = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
|
1352
1352
|
var zn = { select: (e5) => e5 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1353
1353
|
var Bn = class {
|
|
1354
1354
|
constructor(e5, t2 = {}) {
|
|
1355
|
-
this.languageUtils = e5, this.options = t2, this.logger =
|
|
1355
|
+
this.languageUtils = e5, this.options = t2, this.logger = V.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1356
1356
|
}
|
|
1357
1357
|
clearCache() {
|
|
1358
1358
|
this.pluralRulesCache = {};
|
|
1359
1359
|
}
|
|
1360
1360
|
getRule(e5, t2 = {}) {
|
|
1361
|
-
let n2 =
|
|
1361
|
+
let n2 = B(e5 === `dev` ? `en` : e5), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
1362
1362
|
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
1363
1363
|
let a2;
|
|
1364
1364
|
try {
|
|
@@ -1388,18 +1388,18 @@ var Bn = class {
|
|
|
1388
1388
|
}
|
|
1389
1389
|
};
|
|
1390
1390
|
var Vn = (e5, t2, n2, r2 = `.`, i2 = true) => {
|
|
1391
|
-
let a2 =
|
|
1392
|
-
return !a2 && i2 &&
|
|
1391
|
+
let a2 = Sn(e5, t2, n2);
|
|
1392
|
+
return !a2 && i2 && P(n2) && (a2 = z(e5, n2, r2), a2 === void 0 && (a2 = z(t2, n2, r2))), a2;
|
|
1393
1393
|
};
|
|
1394
1394
|
var G = (e5) => e5.replace(/\$/g, `$$$$`);
|
|
1395
1395
|
var Hn = class {
|
|
1396
1396
|
constructor(e5 = {}) {
|
|
1397
|
-
this.logger =
|
|
1397
|
+
this.logger = V.create(`interpolator`), this.options = e5, this.format = e5?.interpolation?.format || ((e6) => e6), this.init(e5);
|
|
1398
1398
|
}
|
|
1399
1399
|
init(e5 = {}) {
|
|
1400
1400
|
e5.interpolation ||= { escapeValue: true };
|
|
1401
1401
|
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;
|
|
1402
|
-
this.escape = t2 === void 0 ?
|
|
1402
|
+
this.escape = t2 === void 0 ? Tn : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? R(i2) : a2 || `{{`, this.suffix = o2 ? R(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 || `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 || ``, this.nestingPrefix = d2 ? R(d2) : f2 || R(`$t(`), this.nestingSuffix = p2 ? R(p2) : m2 || R(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1403
1403
|
}
|
|
1404
1404
|
reset() {
|
|
1405
1405
|
this.options && this.init(this.options);
|
|
@@ -1425,13 +1425,13 @@ var Hn = class {
|
|
|
1425
1425
|
if (a2 = c2(n3), a2 === void 0) {
|
|
1426
1426
|
if (typeof l2 == `function`) {
|
|
1427
1427
|
let t4 = l2(e5, i2, r2);
|
|
1428
|
-
a2 =
|
|
1428
|
+
a2 = P(t4) ? t4 : ``;
|
|
1429
1429
|
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
1430
1430
|
else if (u2) {
|
|
1431
1431
|
a2 = i2[0];
|
|
1432
1432
|
continue;
|
|
1433
1433
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e5}`), a2 = ``;
|
|
1434
|
-
} else !
|
|
1434
|
+
} else !P(a2) && !this.useRawValueToEscape && (a2 = hn(a2));
|
|
1435
1435
|
let s3 = t3.safeValue(a2);
|
|
1436
1436
|
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;
|
|
1437
1437
|
}
|
|
@@ -1441,7 +1441,7 @@ var Hn = class {
|
|
|
1441
1441
|
let r2, i2, a2, o2 = (e6, t3) => {
|
|
1442
1442
|
let n3 = this.nestingOptionsSeparator;
|
|
1443
1443
|
if (e6.indexOf(n3) < 0) return e6;
|
|
1444
|
-
let r3 = e6.split(RegExp(`${
|
|
1444
|
+
let r3 = e6.split(RegExp(`${R(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
1445
1445
|
e6 = r3[0], i3 = this.interpolate(i3, a2);
|
|
1446
1446
|
let o3 = i3.match(/'/g), s2 = i3.match(/"/g);
|
|
1447
1447
|
((o3?.length ?? 0) % 2 == 0 && !s2 || (s2?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
@@ -1454,10 +1454,10 @@ var Hn = class {
|
|
|
1454
1454
|
};
|
|
1455
1455
|
for (; r2 = this.nestingRegexp.exec(e5); ) {
|
|
1456
1456
|
let s2 = [];
|
|
1457
|
-
a2 = { ...n2 }, a2 = a2.replace && !
|
|
1457
|
+
a2 = { ...n2 }, a2 = a2.replace && !P(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1458
1458
|
let c2 = /{.*}/.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1459
|
-
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 && !
|
|
1460
|
-
|
|
1459
|
+
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 && !P(i2)) return i2;
|
|
1460
|
+
P(i2) || (i2 = hn(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;
|
|
1461
1461
|
}
|
|
1462
1462
|
return e5;
|
|
1463
1463
|
}
|
|
@@ -1483,13 +1483,13 @@ var Wn = (e5) => {
|
|
|
1483
1483
|
let a2 = i2;
|
|
1484
1484
|
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
1485
1485
|
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
1486
|
-
return s2 || (s2 = e5(
|
|
1486
|
+
return s2 || (s2 = e5(B(r2), i2), t2[o2] = s2), s2(n2);
|
|
1487
1487
|
};
|
|
1488
1488
|
};
|
|
1489
|
-
var Gn = (e5) => (t2, n2, r2) => e5(
|
|
1489
|
+
var Gn = (e5) => (t2, n2, r2) => e5(B(n2), r2)(t2);
|
|
1490
1490
|
var Kn = class {
|
|
1491
1491
|
constructor(e5 = {}) {
|
|
1492
|
-
this.logger =
|
|
1492
|
+
this.logger = V.create(`formatter`), this.options = e5, this.init(e5);
|
|
1493
1493
|
}
|
|
1494
1494
|
init(e5, t2 = { interpolation: {} }) {
|
|
1495
1495
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
@@ -1542,9 +1542,9 @@ var Kn = class {
|
|
|
1542
1542
|
var qn = (e5, t2) => {
|
|
1543
1543
|
e5.pending[t2] !== void 0 && (delete e5.pending[t2], e5.pendingCount--);
|
|
1544
1544
|
};
|
|
1545
|
-
var Jn = class extends
|
|
1545
|
+
var Jn = class extends H {
|
|
1546
1546
|
constructor(e5, t2, n2, r2 = {}) {
|
|
1547
|
-
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger =
|
|
1547
|
+
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = V.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);
|
|
1548
1548
|
}
|
|
1549
1549
|
queueLoad(e5, t2, n2, r2) {
|
|
1550
1550
|
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
@@ -1561,7 +1561,7 @@ var Jn = class extends U {
|
|
|
1561
1561
|
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);
|
|
1562
1562
|
let o2 = {};
|
|
1563
1563
|
this.queue.forEach((n3) => {
|
|
1564
|
-
|
|
1564
|
+
xn(n3.loaded, [i2], a2), qn(n3, e5), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e6) => {
|
|
1565
1565
|
o2[e6] || (o2[e6] = {});
|
|
1566
1566
|
let t3 = n3.loaded[e6];
|
|
1567
1567
|
t3.length && t3.forEach((t4) => {
|
|
@@ -1603,7 +1603,7 @@ var Jn = class extends U {
|
|
|
1603
1603
|
}
|
|
1604
1604
|
prepareLoading(e5, t2, n2 = {}, r2) {
|
|
1605
1605
|
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
1606
|
-
|
|
1606
|
+
P(e5) && (e5 = this.languageUtils.toResolveHierarchy(e5)), P(t2) && (t2 = [t2]);
|
|
1607
1607
|
let i2 = this.queueLoad(e5, t2, n2, r2);
|
|
1608
1608
|
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
1609
1609
|
i2.toLoad.forEach((e6) => {
|
|
@@ -1645,7 +1645,7 @@ var Jn = class extends U {
|
|
|
1645
1645
|
};
|
|
1646
1646
|
var K = () => ({ 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) => {
|
|
1647
1647
|
let t2 = {};
|
|
1648
|
-
if (typeof e5[1] == `object` && (t2 = e5[1]),
|
|
1648
|
+
if (typeof e5[1] == `object` && (t2 = e5[1]), P(e5[1]) && (t2.defaultValue = e5[1]), P(e5[2]) && (t2.tDescription = e5[2]), typeof e5[2] == `object` || typeof e5[3] == `object`) {
|
|
1649
1649
|
let n2 = e5[3] || e5[2];
|
|
1650
1650
|
Object.keys(n2).forEach((e6) => {
|
|
1651
1651
|
t2[e6] = n2[e6];
|
|
@@ -1653,7 +1653,7 @@ var K = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
1653
1653
|
}
|
|
1654
1654
|
return t2;
|
|
1655
1655
|
}, interpolation: { escapeValue: true, format: (e5) => e5, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1656
|
-
var Yn = (e5) => (
|
|
1656
|
+
var Yn = (e5) => (P(e5.ns) && (e5.ns = [e5.ns]), P(e5.fallbackLng) && (e5.fallbackLng = [e5.fallbackLng]), P(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);
|
|
1657
1657
|
var q = () => {
|
|
1658
1658
|
};
|
|
1659
1659
|
var Xn = (e5) => {
|
|
@@ -1667,9 +1667,9 @@ var $n = () => {
|
|
|
1667
1667
|
typeof globalThis < `u` && (globalThis[Zn] = true);
|
|
1668
1668
|
};
|
|
1669
1669
|
var er = (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));
|
|
1670
|
-
var J = class e4 extends
|
|
1670
|
+
var J = class e4 extends H {
|
|
1671
1671
|
constructor(e5 = {}, t2) {
|
|
1672
|
-
if (super(), this.options = Yn(e5), this.services = {}, this.logger =
|
|
1672
|
+
if (super(), this.options = Yn(e5), this.services = {}, this.logger = V, this.modules = { external: [] }, Xn(this), t2 && !this.isInitialized && !e5.isClone) {
|
|
1673
1673
|
if (!this.options.initAsync) return this.init(e5, t2), this;
|
|
1674
1674
|
setTimeout(() => {
|
|
1675
1675
|
this.init(e5, t2);
|
|
@@ -1677,18 +1677,18 @@ var J = class e4 extends U {
|
|
|
1677
1677
|
}
|
|
1678
1678
|
}
|
|
1679
1679
|
init(e5 = {}, t2) {
|
|
1680
|
-
this.isInitializing = true, typeof e5 == `function` && (t2 = e5, e5 = {}), e5.defaultNS == null && e5.ns && (
|
|
1680
|
+
this.isInitializing = true, typeof e5 == `function` && (t2 = e5, e5 = {}), e5.defaultNS == null && e5.ns && (P(e5.ns) ? e5.defaultNS = e5.ns : e5.ns.indexOf(`translation`) < 0 && (e5.defaultNS = e5.ns[0]));
|
|
1681
1681
|
let n2 = K();
|
|
1682
1682
|
this.options = { ...n2, ...this.options, ...Yn(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 && !er(this) && !Qn() && (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}`), $n());
|
|
1683
1683
|
let r2 = (e6) => e6 ? typeof e6 == `function` ? new e6() : e6 : null;
|
|
1684
1684
|
if (!this.options.isClone) {
|
|
1685
|
-
this.modules.logger ?
|
|
1685
|
+
this.modules.logger ? V.init(r2(this.modules.logger), this.options) : V.init(null, this.options);
|
|
1686
1686
|
let e6;
|
|
1687
1687
|
e6 = this.modules.formatter ? this.modules.formatter : Kn;
|
|
1688
1688
|
let t3 = new Ln(this.options);
|
|
1689
|
-
this.store = new
|
|
1689
|
+
this.store = new jn(this.options.resources, this.options);
|
|
1690
1690
|
let i3 = this.services;
|
|
1691
|
-
i3.logger =
|
|
1691
|
+
i3.logger = V, i3.resourceStore = this.store, i3.languageUtils = t3, i3.pluralResolver = new Bn(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 Hn(this.options), i3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i3.backendConnector = new Jn(r2(this.modules.backend), i3.resourceStore, i3, this.options), i3.backendConnector.on(`*`, (e7, ...t4) => {
|
|
1692
1692
|
this.emit(e7, ...t4);
|
|
1693
1693
|
}), 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 In(this.services, this.options), this.translator.on(`*`, (e7, ...t4) => {
|
|
1694
1694
|
this.emit(e7, ...t4);
|
|
@@ -1705,7 +1705,7 @@ var J = class e4 extends U {
|
|
|
1705
1705
|
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e6) => {
|
|
1706
1706
|
this[e6] = (...t3) => (this.store[e6](...t3), this);
|
|
1707
1707
|
});
|
|
1708
|
-
let i2 =
|
|
1708
|
+
let i2 = F(), a2 = () => {
|
|
1709
1709
|
let e6 = (e7, n3) => {
|
|
1710
1710
|
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);
|
|
1711
1711
|
};
|
|
@@ -1715,7 +1715,7 @@ var J = class e4 extends U {
|
|
|
1715
1715
|
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
1716
1716
|
}
|
|
1717
1717
|
loadResources(e5, t2 = q) {
|
|
1718
|
-
let n2 = t2, r2 =
|
|
1718
|
+
let n2 = t2, r2 = P(e5) ? e5 : this.language;
|
|
1719
1719
|
if (typeof e5 == `function` && (n2 = e5), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1720
1720
|
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
1721
1721
|
let e6 = [], t3 = (t4) => {
|
|
@@ -1729,7 +1729,7 @@ var J = class e4 extends U {
|
|
|
1729
1729
|
} else n2(null);
|
|
1730
1730
|
}
|
|
1731
1731
|
reloadResources(e5, t2, n2) {
|
|
1732
|
-
let r2 =
|
|
1732
|
+
let r2 = F();
|
|
1733
1733
|
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 ||= q, this.services.backendConnector.reload(e5, t2, (e6) => {
|
|
1734
1734
|
r2.resolve(), n2(e6);
|
|
1735
1735
|
}), r2;
|
|
@@ -1737,7 +1737,7 @@ var J = class e4 extends U {
|
|
|
1737
1737
|
use(e5) {
|
|
1738
1738
|
if (!e5) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
1739
1739
|
if (!e5.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
1740
|
-
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` &&
|
|
1740
|
+
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` && Mn.addPostProcessor(e5), e5.type === `formatter` && (this.modules.formatter = e5), e5.type === `3rdParty` && this.modules.external.push(e5), this;
|
|
1741
1741
|
}
|
|
1742
1742
|
setResolvedLanguage(e5) {
|
|
1743
1743
|
if (e5 && this.languages && !([`cimode`, `dev`].indexOf(e5) > -1)) {
|
|
@@ -1753,7 +1753,7 @@ var J = class e4 extends U {
|
|
|
1753
1753
|
}
|
|
1754
1754
|
changeLanguage(e5, t2) {
|
|
1755
1755
|
this.isLanguageChangingTo = e5;
|
|
1756
|
-
let n2 =
|
|
1756
|
+
let n2 = F();
|
|
1757
1757
|
this.emit(`languageChanging`, e5);
|
|
1758
1758
|
let r2 = (e6) => {
|
|
1759
1759
|
this.language = e6, this.languages = this.services.languageUtils.toResolveHierarchy(e6), this.resolvedLanguage = void 0, this.setResolvedLanguage(e6);
|
|
@@ -1761,7 +1761,7 @@ var J = class e4 extends U {
|
|
|
1761
1761
|
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));
|
|
1762
1762
|
}, a2 = (t3) => {
|
|
1763
1763
|
!e5 && !t3 && this.services.languageDetector && (t3 = []);
|
|
1764
|
-
let n3 =
|
|
1764
|
+
let n3 = P(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(P(t3) ? [t3] : t3);
|
|
1765
1765
|
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e6) => {
|
|
1766
1766
|
i2(e6, a3);
|
|
1767
1767
|
});
|
|
@@ -1773,11 +1773,11 @@ var J = class e4 extends U {
|
|
|
1773
1773
|
let a2;
|
|
1774
1774
|
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);
|
|
1775
1775
|
let o2 = { ...this.options, ...a2 };
|
|
1776
|
-
typeof a2.keyPrefix == `function` && (a2.keyPrefix =
|
|
1776
|
+
typeof a2.keyPrefix == `function` && (a2.keyPrefix = U(a2.keyPrefix, o2));
|
|
1777
1777
|
let s2 = this.options.keySeparator || `.`, c2;
|
|
1778
|
-
return a2.keyPrefix && Array.isArray(e6) ? c2 = e6.map((e7) => (typeof e7 == `function` && (e7 =
|
|
1778
|
+
return a2.keyPrefix && Array.isArray(e6) ? c2 = e6.map((e7) => (typeof e7 == `function` && (e7 = U(e7, o2)), `${a2.keyPrefix}${s2}${e7}`)) : (typeof e6 == `function` && (e6 = U(e6, o2)), c2 = a2.keyPrefix ? `${a2.keyPrefix}${s2}${e6}` : e6), this.t(c2, a2);
|
|
1779
1779
|
};
|
|
1780
|
-
return
|
|
1780
|
+
return P(e5) ? r2.lng = e5 : r2.lngs = e5, r2.ns = t2, r2.keyPrefix = n2, r2;
|
|
1781
1781
|
}
|
|
1782
1782
|
t(...e5) {
|
|
1783
1783
|
return this.translator?.translate(...e5);
|
|
@@ -1804,16 +1804,16 @@ var J = class e4 extends U {
|
|
|
1804
1804
|
return !!(this.hasResourceBundle(n2, e5) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a2(n2, e5) && (!r2 || a2(i2, e5)));
|
|
1805
1805
|
}
|
|
1806
1806
|
loadNamespaces(e5, t2) {
|
|
1807
|
-
let n2 =
|
|
1808
|
-
return this.options.ns ? (
|
|
1807
|
+
let n2 = F();
|
|
1808
|
+
return this.options.ns ? (P(e5) && (e5 = [e5]), e5.forEach((e6) => {
|
|
1809
1809
|
this.options.ns.indexOf(e6) < 0 && this.options.ns.push(e6);
|
|
1810
1810
|
}), this.loadResources((e6) => {
|
|
1811
1811
|
n2.resolve(), t2 && t2(e6);
|
|
1812
1812
|
}), n2) : (t2 && t2(), Promise.resolve());
|
|
1813
1813
|
}
|
|
1814
1814
|
loadLanguages(e5, t2) {
|
|
1815
|
-
let n2 =
|
|
1816
|
-
|
|
1815
|
+
let n2 = F();
|
|
1816
|
+
P(e5) && (e5 = [e5]);
|
|
1817
1817
|
let r2 = this.options.preload || [], i2 = e5.filter((e6) => r2.indexOf(e6) < 0 && this.services.languageUtils.isSupportedCode(e6));
|
|
1818
1818
|
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e6) => {
|
|
1819
1819
|
n2.resolve(), t2 && t2(e6);
|
|
@@ -1842,7 +1842,7 @@ var J = class e4 extends U {
|
|
|
1842
1842
|
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
1843
1843
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e5) => {
|
|
1844
1844
|
a2[e5] = this[e5];
|
|
1845
|
-
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new
|
|
1845
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new jn(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) {
|
|
1846
1846
|
let e5 = { ...K().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e5 };
|
|
1847
1847
|
a2.services.interpolator = new Hn(n3);
|
|
1848
1848
|
}
|
|
@@ -1894,14 +1894,14 @@ function mr(e5, { value: t2, currency: n2 }, r2 = {}) {
|
|
|
1894
1894
|
return ur(t2), fr(e5, n2, r2).formatToParts(t2);
|
|
1895
1895
|
}
|
|
1896
1896
|
function hr(e5) {
|
|
1897
|
-
return
|
|
1897
|
+
return Gt().find((e6) => e6.primary)?.id ?? e5;
|
|
1898
1898
|
}
|
|
1899
1899
|
function gr(e5, t2) {
|
|
1900
1900
|
let { locale: n2, ...r2 } = t2 ?? {}, i2 = n2 ?? e5.essentials?.locale;
|
|
1901
1901
|
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.`);
|
|
1902
1902
|
return { locale: i2, formatOptions: r2 };
|
|
1903
1903
|
}
|
|
1904
|
-
var _r =
|
|
1904
|
+
var _r = mn({ getLanguage: (e5) => () => {
|
|
1905
1905
|
let t2 = e5.essentials?.language;
|
|
1906
1906
|
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.`);
|
|
1907
1907
|
return t2;
|
|
@@ -1939,7 +1939,7 @@ var vr = class {
|
|
|
1939
1939
|
}
|
|
1940
1940
|
};
|
|
1941
1941
|
var yr = (e5) => new vr(e5);
|
|
1942
|
-
var br =
|
|
1942
|
+
var br = mn({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : yr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
1943
1943
|
var xr = { 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` };
|
|
1944
1944
|
function Sr(e5) {
|
|
1945
1945
|
try {
|
|
@@ -2183,7 +2183,7 @@ function li({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2183
2183
|
}), c2;
|
|
2184
2184
|
}
|
|
2185
2185
|
function ui(e5) {
|
|
2186
|
-
return
|
|
2186
|
+
return gt(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: `` }] } }));
|
|
2187
2187
|
}
|
|
2188
2188
|
var di = `@wix/auto_sdk_bookings_services`;
|
|
2189
2189
|
function fi(e5) {
|
|
@@ -2193,27 +2193,27 @@ function fi(e5) {
|
|
|
2193
2193
|
return t2;
|
|
2194
2194
|
}
|
|
2195
2195
|
async function pi(e5) {
|
|
2196
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = fi(
|
|
2196
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = fi(Xe({ filter: e5?.filter }));
|
|
2197
2197
|
n2?.onSiteCall?.();
|
|
2198
2198
|
try {
|
|
2199
2199
|
let e6 = await t2.request(r2);
|
|
2200
|
-
return n2?.onSuccess?.(e6),
|
|
2200
|
+
return n2?.onSuccess?.(e6), Ze(e6.data);
|
|
2201
2201
|
} catch (e6) {
|
|
2202
|
-
let t3 =
|
|
2202
|
+
let t3 = ot(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
|
|
2203
2203
|
throw n2?.onError?.(e6), t3;
|
|
2204
2204
|
}
|
|
2205
2205
|
}
|
|
2206
2206
|
function mi(e5) {
|
|
2207
2207
|
return (t2) => pi(t2, { httpClient: e5 });
|
|
2208
2208
|
}
|
|
2209
|
-
var hi =
|
|
2209
|
+
var hi = ht(mi);
|
|
2210
2210
|
async function gi() {
|
|
2211
2211
|
return [...(await hi({ filter: { services: {} } })).categories ?? []].sort((e5, t2) => (e5.sortOrder ?? 0) - (t2.sortOrder ?? 0));
|
|
2212
2212
|
}
|
|
2213
2213
|
function _i({ isLoading: e5, hasError: t2, refetch: n2, children: r2 }) {
|
|
2214
|
-
let
|
|
2214
|
+
let i2 = { categoryItems: [], hasMultipleCategories: false, isLoading: e5, hasError: t2, refetch: n2, selectCategory: () => {
|
|
2215
2215
|
} };
|
|
2216
|
-
return f($.Provider, { value:
|
|
2216
|
+
return f($.Provider, { value: i2, children: r2 });
|
|
2217
2217
|
}
|
|
2218
2218
|
function vi({ refetch: e5, children: t2 }) {
|
|
2219
2219
|
return f(_i, { isLoading: true, hasError: false, refetch: e5, children: t2 });
|
|
@@ -2262,28 +2262,28 @@ function ji(e5, t2) {
|
|
|
2262
2262
|
}
|
|
2263
2263
|
var Mi = (e5) => ({ categories: e5, hasError: false });
|
|
2264
2264
|
var Ni = () => ({ categories: [], hasError: true });
|
|
2265
|
-
function Pi({ categoriesPromise: e5,
|
|
2266
|
-
let { categories:
|
|
2267
|
-
let e6 = xi(
|
|
2268
|
-
return e6 ?
|
|
2269
|
-
}, [
|
|
2270
|
-
let
|
|
2271
|
-
e6 ?
|
|
2272
|
-
let
|
|
2273
|
-
|
|
2274
|
-
}, [p2, m2,
|
|
2265
|
+
function Pi({ categoriesPromise: e5, categoryIdsKey: t2, refetch: n2, children: i2 }) {
|
|
2266
|
+
let { categories: s2, hasError: c2 } = Er(e5), l2 = o(() => {
|
|
2267
|
+
let e6 = xi(t2);
|
|
2268
|
+
return e6 ? s2.filter((t3) => t3._id && e6.includes(t3._id)) : s2;
|
|
2269
|
+
}, [s2, t2]), { pathname: u2, searchParams: d2, pushUrl: p2, getExternalBaseUrl: m2 } = Br(), h2 = d2.get(Q.category), g2 = r((e6, t3) => {
|
|
2270
|
+
let n3 = new URLSearchParams(d2);
|
|
2271
|
+
e6 ? n3.set(Q.category, e6) : n3.delete(Q.category), n3.delete(Q.page);
|
|
2272
|
+
let r2 = n3.toString(), i3 = r2 ? `${u2}?${r2}` : u2;
|
|
2273
|
+
p2(new URL(i3, `${m2()}/`), { disableScrollToTop: true, skipHistory: t3 });
|
|
2274
|
+
}, [u2, d2, p2, m2]), _2 = r((e6) => g2(e6, false), [g2]), v2 = h2 != null && !c2 && !s2.some((e6) => e6._id === h2);
|
|
2275
2275
|
a(() => {
|
|
2276
|
-
|
|
2277
|
-
}, [
|
|
2278
|
-
let
|
|
2279
|
-
return f($.Provider, { value:
|
|
2276
|
+
v2 && g2(null, true);
|
|
2277
|
+
}, [v2, g2]);
|
|
2278
|
+
let y2 = l2.filter((e6) => e6._id).length > 1, b2 = o(() => ({ categoryItems: l2.map((e6) => ji(e6, h2)), hasMultipleCategories: y2, isLoading: false, hasError: c2, refetch: n2, selectCategory: _2 }), [l2, h2, y2, c2, n2, _2]);
|
|
2279
|
+
return f($.Provider, { value: b2, children: i2 });
|
|
2280
2280
|
}
|
|
2281
|
-
function Fi({
|
|
2281
|
+
function Fi({ categoriesPicker: e5, refreshSignal: n2 = 0, children: i2 }) {
|
|
2282
2282
|
Oi(Ti.CATEGORIES);
|
|
2283
|
-
let
|
|
2284
|
-
return f(Tr, { fallback: f(yi, { refetch:
|
|
2283
|
+
let a2 = Wr(), s2 = Xr(), l2 = bi(e5?.categoryId), [u2, d2] = c(0), p2 = o(() => kr(li({ key: Qr(s2), refresh: u2 !== 0 || n2 !== 0, warmupData: a2, fetchData: () => wr(`categories-context-load`, { feature: xr.categories }, gi()) }), Mi, Ni), [u2, n2, s2]), m2 = r(() => d2((e6) => e6 + 1), []);
|
|
2284
|
+
return f(Tr, { fallback: f(yi, { refetch: m2, children: i2 }), feature: xr.categories, children: f(t, { fallback: f(vi, { refetch: m2, children: i2 }), children: f(Pi, { categoriesPromise: p2, categoryIdsKey: l2, refetch: m2, children: i2 }) }) });
|
|
2285
2285
|
}
|
|
2286
|
-
var Ii =
|
|
2286
|
+
var Ii = dn(`73a358c8-c2c8-4342-bf64-9079e92178fc`);
|
|
2287
2287
|
export {
|
|
2288
2288
|
ki as CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR,
|
|
2289
2289
|
Fi as CategoriesContextProvider,
|