@wix/blog 1.0.708 → 1.0.710
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_sdk-exports/context-blog-feed/runtime.js +4 -4
- package/_sdk-exports/context-post/runtime.d.ts +36 -1
- package/_sdk-exports/context-post-by-id/runtime.js +4 -4
- package/_sdk-exports/context-post-by-slug/runtime.js +4 -4
- package/_sdk-exports/context-post-list-item/runtime.js +4 -4
- package/_sdk-exports/context-related-posts/runtime.js +4 -4
- package/build/cjs/context-blog-feed.js +1422 -1366
- package/build/cjs/context-blog-feed.js.map +1 -1
- package/build/cjs/context-post-by-id.js +750 -694
- package/build/cjs/context-post-by-id.js.map +1 -1
- package/build/cjs/context-post-by-slug.js +1345 -1289
- package/build/cjs/context-post-by-slug.js.map +1 -1
- package/build/cjs/context-post-list-item.js +265 -237
- package/build/cjs/context-post-list-item.js.map +1 -1
- package/build/cjs/context-post.d.ts +36 -1
- package/build/cjs/context-related-posts.js +1075 -1019
- package/build/cjs/context-related-posts.js.map +1 -1
- package/build/es/context-blog-feed.mjs +1422 -1366
- package/build/es/context-blog-feed.mjs.map +1 -1
- package/build/es/context-post-by-id.mjs +750 -694
- package/build/es/context-post-by-id.mjs.map +1 -1
- package/build/es/context-post-by-slug.mjs +1345 -1289
- package/build/es/context-post-by-slug.mjs.map +1 -1
- package/build/es/context-post-list-item.mjs +265 -237
- package/build/es/context-post-list-item.mjs.map +1 -1
- package/build/es/context-post.d.mts +36 -1
- package/build/es/context-related-posts.mjs +1075 -1019
- package/build/es/context-related-posts.mjs.map +1 -1
- package/build/internal/cjs/context-post.d.ts +36 -1
- package/build/internal/es/context-post.d.mts +36 -1
- package/package.json +2 -2
|
@@ -30,9 +30,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// context-post-by-id.ts
|
|
31
31
|
var context_post_by_id_exports = {};
|
|
32
32
|
__export(context_post_by_id_exports, {
|
|
33
|
-
PostByIdProvider: () =>
|
|
34
|
-
default: () =>
|
|
35
|
-
injectAccessTokenGetter: () =>
|
|
33
|
+
PostByIdProvider: () => md,
|
|
34
|
+
default: () => md,
|
|
35
|
+
injectAccessTokenGetter: () => hd,
|
|
36
36
|
usePostByIdContext: () => import_post_context_provider.usePostContext
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(context_post_by_id_exports);
|
|
@@ -44,16 +44,17 @@ var import_services_manager_react = require("@wix/services-manager-react");
|
|
|
44
44
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
45
|
var import_meta = {};
|
|
46
46
|
var _ = Object.defineProperty;
|
|
47
|
-
var v = (e6, t2) => {
|
|
47
|
+
var v = (e6, t2) => () => (t2 || (e6((t2 = { exports: {} }).exports, t2, t2.exports), e6 = null), t2.exports);
|
|
48
|
+
var y = (e6, t2) => {
|
|
48
49
|
let n2 = {};
|
|
49
50
|
for (var r2 in e6) _(n2, r2, { get: e6[r2], enumerable: true });
|
|
50
51
|
return t2 || _(n2, Symbol.toStringTag, { value: `Module` }), n2;
|
|
51
52
|
};
|
|
52
|
-
var
|
|
53
|
-
function
|
|
53
|
+
var b = {};
|
|
54
|
+
function x(e6, t2 = false, n2 = (e7) => e7) {
|
|
54
55
|
return () => ({ __type: `event-definition`, type: e6, isDomainEvent: t2, transformations: n2 });
|
|
55
56
|
}
|
|
56
|
-
var
|
|
57
|
+
var S = (e6) => {
|
|
57
58
|
switch (e6) {
|
|
58
59
|
case `get`:
|
|
59
60
|
case `GET`:
|
|
@@ -80,11 +81,11 @@ var x = (e6) => {
|
|
|
80
81
|
throw Error(`Unknown method: ${e6}`);
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
|
-
var
|
|
84
|
+
var C = (e6) => (t2) => async (n2) => {
|
|
84
85
|
let r2, i2 = (t3) => {
|
|
85
86
|
if (r2 = e6(n2)(t3), r2.url === void 0) throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);
|
|
86
87
|
let { method: i3, url: a2, params: o2 } = r2;
|
|
87
|
-
return { ...r2, method:
|
|
88
|
+
return { ...r2, method: S(i3), url: a2, data: r2.data, params: o2 };
|
|
88
89
|
};
|
|
89
90
|
try {
|
|
90
91
|
let e7 = await t2.request(i2);
|
|
@@ -97,10 +98,10 @@ var S = (e6) => (t2) => async (n2) => {
|
|
|
97
98
|
throw typeof e7 == `object` && e7 && `response` in e7 && typeof e7.response == `object` && e7.response !== null && `data` in e7.response ? e7.response.data : e7;
|
|
98
99
|
}
|
|
99
100
|
};
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var
|
|
101
|
+
var ee = (e6) => e6.__isAmbassador ? true : !!e6().__isAmbassador;
|
|
102
|
+
var w = `__metadata`;
|
|
103
|
+
var T = `edge.wixapis.com`;
|
|
104
|
+
var te = class extends Error {
|
|
104
105
|
message;
|
|
105
106
|
response;
|
|
106
107
|
constructor(e6, t2) {
|
|
@@ -108,108 +109,108 @@ var T = class extends Error {
|
|
|
108
109
|
}
|
|
109
110
|
async details() {
|
|
110
111
|
let e6 = await this.response.json();
|
|
111
|
-
return
|
|
112
|
+
return ne(this.response.status, e6?.message, e6?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e6 });
|
|
112
113
|
}
|
|
113
114
|
};
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
var
|
|
118
|
-
function
|
|
115
|
+
var ne = (e6, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
116
|
+
var re = (e6) => e6?.method && [`post`, `put`, `patch`].includes(e6.method.toLocaleLowerCase()) && e6.body ? { "Content-Type": `application/json` } : {};
|
|
117
|
+
var ie = (e6) => e6 && typeof e6 == `object` && !Array.isArray(e6);
|
|
118
|
+
var ae = (e6) => e6.__type === `host`;
|
|
119
|
+
function oe(e6, t2) {
|
|
119
120
|
return e6.create(t2);
|
|
120
121
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
123
|
-
return { [
|
|
122
|
+
var se = `x-wix-bi-gateway`;
|
|
123
|
+
function ce(e6, t2, n2) {
|
|
124
|
+
return { [se]: le({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e6.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e6.methodFqn, entity: e6.entityFqdn }) };
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
+
function le(e6) {
|
|
126
127
|
return Object.entries(e6).filter(([e7, t2]) => !!t2).map(([e7, t2]) => `${e7}=${t2}`).join(`,`);
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
130
|
-
globalThis.__wix_context__ = void 0,
|
|
129
|
+
function ue(e6) {
|
|
130
|
+
let t2 = globalThis.__wix_context__, n2 = { client: b.client, elevatedClient: b.elevatedClient }, r2;
|
|
131
|
+
globalThis.__wix_context__ = void 0, b.client = void 0, b.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
131
132
|
try {
|
|
132
133
|
return e6();
|
|
133
134
|
} finally {
|
|
134
|
-
globalThis.__wix_context__ = t2,
|
|
135
|
+
globalThis.__wix_context__ = t2, b.client = n2.client, b.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
var
|
|
138
|
-
function
|
|
139
|
-
return
|
|
138
|
+
var de = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
139
|
+
function fe(e6) {
|
|
140
|
+
return _e(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
140
141
|
}
|
|
141
|
-
var
|
|
142
|
-
var
|
|
143
|
-
var
|
|
144
|
-
var
|
|
145
|
-
function
|
|
142
|
+
var pe = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
143
|
+
var me = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
144
|
+
var he = `$1\0$2`;
|
|
145
|
+
var ge = /[^\p{L}\d]+/giu;
|
|
146
|
+
function _e(e6) {
|
|
146
147
|
let t2 = e6.trim();
|
|
147
|
-
t2 = t2.replace(
|
|
148
|
+
t2 = t2.replace(pe, he).replace(me, he), t2 = t2.replace(ge, `\0`);
|
|
148
149
|
let n2 = 0, r2 = t2.length;
|
|
149
150
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
150
151
|
if (n2 === r2) return [];
|
|
151
152
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
152
153
|
return t2.slice(n2, r2).split(/\0/g);
|
|
153
154
|
}
|
|
154
|
-
var
|
|
155
|
-
var
|
|
156
|
-
var
|
|
157
|
-
function
|
|
155
|
+
var ve = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
156
|
+
var ye = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
157
|
+
var be = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
158
|
+
function xe(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
158
159
|
if (typeof e6 != `object` || !e6) throw e6;
|
|
159
|
-
if (
|
|
160
|
-
if (
|
|
161
|
-
if (
|
|
162
|
-
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
163
|
-
return
|
|
160
|
+
if (ve(e6)) return Se(e6, t2, n2);
|
|
161
|
+
if (ye(e6)) return we(e6);
|
|
162
|
+
if (be(e6)) {
|
|
163
|
+
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: fe(n3), data: {} }, requestId: e6.requestId };
|
|
164
|
+
return Ce(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
164
165
|
}
|
|
165
|
-
return
|
|
166
|
+
return Te(e6);
|
|
166
167
|
}
|
|
167
|
-
var
|
|
168
|
-
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
169
|
-
return
|
|
168
|
+
var Se = (e6, t2, n2) => {
|
|
169
|
+
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Ee(t2, a2, n2)?.sort((e7, t3) => e7.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e7, description: t3 }) => `"${e7}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
170
|
+
return Ce(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
170
171
|
};
|
|
171
|
-
var
|
|
172
|
-
var
|
|
173
|
-
let t2 = e6.response?.status, n2 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n2, i2 = e6.response?.data?.details?.applicationError?.description ?? n2, a2 = e6.response?.data?.details?.applicationError?.code ??
|
|
174
|
-
return
|
|
172
|
+
var Ce = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
173
|
+
var we = (e6) => {
|
|
174
|
+
let t2 = e6.response?.status, n2 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n2, i2 = e6.response?.data?.details?.applicationError?.description ?? n2, a2 = e6.response?.data?.details?.applicationError?.code ?? fe(n2), o2 = e6.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e6.requestId };
|
|
175
|
+
return Ce(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
175
176
|
};
|
|
176
|
-
var
|
|
177
|
-
var
|
|
177
|
+
var Te = (e6) => Ce(e6, { message: e6.requestId ? `System error occurred, request-id: ${e6.requestId}` : `System error occurred: ${JSON.stringify(e6)}`, extraProperties: { requestId: e6.requestId, status: e6.response?.status, code: fe(e6.response?.statusText ?? `UNKNOWN`), ...!e6.response && { runtimeError: e6 } } });
|
|
178
|
+
var Ee = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
178
179
|
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
179
180
|
return r2?.filter((e7) => !r2.some((t3) => t3.field.length > e7.field.length && t3.field.startsWith(e7.field) && o2.includes(t3.field))).map((e7) => {
|
|
180
181
|
let r3 = t2[e7.field];
|
|
181
|
-
if (r3) return { ...e7, field:
|
|
182
|
+
if (r3) return { ...e7, field: De(r3, i2) };
|
|
182
183
|
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
183
184
|
if (s2) {
|
|
184
185
|
let t3 = a2[s2];
|
|
185
|
-
if (t3) return { ...e7, field: e7.field.replace(s2,
|
|
186
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, De(t3, i2)) };
|
|
186
187
|
}
|
|
187
188
|
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
188
189
|
});
|
|
189
190
|
};
|
|
190
|
-
var
|
|
191
|
-
let n2 =
|
|
191
|
+
var De = (e6, t2) => {
|
|
192
|
+
let n2 = Oe(e6);
|
|
192
193
|
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
193
194
|
};
|
|
194
|
-
var
|
|
195
|
+
var Oe = (e6) => {
|
|
195
196
|
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
196
197
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
197
198
|
};
|
|
198
|
-
function
|
|
199
|
-
return
|
|
199
|
+
function ke(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
200
|
+
return ue(() => e6({ request: async (e7) => {
|
|
200
201
|
let i3 = e7({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
201
202
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
202
|
-
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ?
|
|
203
|
+
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? T : o3}${a3.url}`;
|
|
203
204
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
204
205
|
try {
|
|
205
|
-
let e8 =
|
|
206
|
+
let e8 = ce(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e8 } }, s3 = await n2(u3, o4);
|
|
206
207
|
if (s3.status !== 200) {
|
|
207
208
|
let e9 = null;
|
|
208
209
|
try {
|
|
209
210
|
e9 = await s3.json();
|
|
210
211
|
} catch {
|
|
211
212
|
}
|
|
212
|
-
let t3 =
|
|
213
|
+
let t3 = je(s3.status, e9?.message ?? s3.statusText, e9?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e9 }), n3 = xe(t3);
|
|
213
214
|
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
214
215
|
}
|
|
215
216
|
let l3 = await s3.json();
|
|
@@ -219,18 +220,18 @@ function Oe(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
219
220
|
}
|
|
220
221
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
221
222
|
}
|
|
222
|
-
var
|
|
223
|
+
var Ae = class extends Error {
|
|
223
224
|
response;
|
|
224
225
|
requestId;
|
|
225
226
|
constructor(e6) {
|
|
226
227
|
super(), this.response = e6.response, this.requestId = e6.requestId;
|
|
227
228
|
}
|
|
228
229
|
};
|
|
229
|
-
var
|
|
230
|
-
var
|
|
231
|
-
function
|
|
230
|
+
var je = (e6, t2, n2, r2) => new Ae({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2 }, status: e6 }, requestId: r2?.requestId });
|
|
231
|
+
var Me = `.`;
|
|
232
|
+
function Ne(e6, t2, n2) {
|
|
232
233
|
if (e6 == null) throw Error(`Cannot set value on null or undefined`);
|
|
233
|
-
let r2 =
|
|
234
|
+
let r2 = Pe(t2), i2 = e6;
|
|
234
235
|
for (let e7 = 0; e7 < r2.length; e7++) {
|
|
235
236
|
let t3 = r2[e7];
|
|
236
237
|
if (e7 === r2.length - 1) {
|
|
@@ -242,21 +243,21 @@ function Me(e6, t2, n2) {
|
|
|
242
243
|
}
|
|
243
244
|
return e6;
|
|
244
245
|
}
|
|
245
|
-
function Ne(e6) {
|
|
246
|
-
return Array.isArray(e6) ? e6 : e6.split(je).map((e7) => Pe(e7) ? Number(e7) : e7);
|
|
247
|
-
}
|
|
248
246
|
function Pe(e6) {
|
|
249
|
-
return
|
|
247
|
+
return Array.isArray(e6) ? e6 : e6.split(Me).map((e7) => Fe(e7) ? Number(e7) : e7);
|
|
250
248
|
}
|
|
251
249
|
function Fe(e6) {
|
|
250
|
+
return /^\d+$/.test(e6);
|
|
251
|
+
}
|
|
252
|
+
function Ie(e6) {
|
|
252
253
|
let t2 = {};
|
|
253
|
-
for (let [n2, r2] of Object.entries(e6))
|
|
254
|
+
for (let [n2, r2] of Object.entries(e6)) Le(n2) || Ne(t2, Pe(n2), r2);
|
|
254
255
|
return t2;
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
+
function Le(e6) {
|
|
257
258
|
return e6 === `__proto__` || e6 === `constructor` || e6 === `prototype`;
|
|
258
259
|
}
|
|
259
|
-
var
|
|
260
|
+
var Re = class {
|
|
260
261
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
261
262
|
NUMERIC_PATTERN = /^\d+$/;
|
|
262
263
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -279,7 +280,7 @@ var Le = class {
|
|
|
279
280
|
return e6.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
280
281
|
}
|
|
281
282
|
unflatten() {
|
|
282
|
-
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e6, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e6)), t2])),
|
|
283
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e6, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e6)), t2])), Ie(this.cleanedModifiedFields);
|
|
283
284
|
}
|
|
284
285
|
flatten(e6) {
|
|
285
286
|
let t2 = {};
|
|
@@ -299,12 +300,12 @@ var Le = class {
|
|
|
299
300
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
300
301
|
r2.push(`[${e7}]`), n2 = n2[parseInt(e7, 10)];
|
|
301
302
|
}, a2 = (e7, t3) => {
|
|
302
|
-
let i3 = e7 in
|
|
303
|
+
let i3 = e7 in de ? de[e7] : void 0;
|
|
303
304
|
if (i3 && i3 in t3) {
|
|
304
305
|
r2.push(i3), n2 = t3[i3];
|
|
305
306
|
return;
|
|
306
307
|
}
|
|
307
|
-
let a3 =
|
|
308
|
+
let a3 = He(e7);
|
|
308
309
|
if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
|
|
309
310
|
else throw Error(`Cannot find key '${e7}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
310
311
|
}, o2 = (e7, t3) => {
|
|
@@ -328,28 +329,28 @@ var Le = class {
|
|
|
328
329
|
return e6.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e6[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
329
330
|
}
|
|
330
331
|
};
|
|
331
|
-
function
|
|
332
|
+
function ze(e6, t2) {
|
|
332
333
|
let n2 = e6?.modifiedFields;
|
|
333
334
|
if (!n2) return null;
|
|
334
|
-
let r2 =
|
|
335
|
+
let r2 = Be(n2);
|
|
335
336
|
if (!r2) return null;
|
|
336
337
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
337
338
|
e6 = { ...e6, modifiedFields: i2 };
|
|
338
339
|
let o2 = t2(e6), s2 = o2?.modifiedFields;
|
|
339
340
|
if (!s2) return null;
|
|
340
|
-
let c2 =
|
|
341
|
+
let c2 = Ve(s2, a2);
|
|
341
342
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
342
343
|
}
|
|
343
|
-
function
|
|
344
|
+
function Be(e6) {
|
|
344
345
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
345
|
-
let t2 = new
|
|
346
|
+
let t2 = new Re(e6);
|
|
346
347
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
347
348
|
} catch {
|
|
348
349
|
return null;
|
|
349
350
|
}
|
|
350
351
|
return null;
|
|
351
352
|
}
|
|
352
|
-
function
|
|
353
|
+
function Ve(e6, t2) {
|
|
353
354
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
354
355
|
return t2.flatten(e6);
|
|
355
356
|
} catch {
|
|
@@ -357,10 +358,10 @@ function Be(e6, t2) {
|
|
|
357
358
|
}
|
|
358
359
|
return null;
|
|
359
360
|
}
|
|
360
|
-
function
|
|
361
|
+
function He(e6) {
|
|
361
362
|
return e6.replace(/[-_\s]+(.)?/g, (e7, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e7) => e7.toLowerCase());
|
|
362
363
|
}
|
|
363
|
-
function
|
|
364
|
+
function Ue() {
|
|
364
365
|
return { emit(e6, ...t2) {
|
|
365
366
|
for (let n2 = 0, r2 = this.events[e6] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
366
367
|
}, events: {}, on(e6, t2) {
|
|
@@ -369,8 +370,8 @@ function He() {
|
|
|
369
370
|
};
|
|
370
371
|
} };
|
|
371
372
|
}
|
|
372
|
-
var
|
|
373
|
-
function
|
|
373
|
+
var We = (e6) => e6.__type === `event-definition`;
|
|
374
|
+
function Ge(e6, t2, n2, r2) {
|
|
374
375
|
let i2;
|
|
375
376
|
if (e6.isDomainEvent) {
|
|
376
377
|
let { deletedEvent: e7, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -381,14 +382,14 @@ function We(e6, t2, n2, r2) {
|
|
|
381
382
|
let e7 = s2.modifiedFields;
|
|
382
383
|
if (typeof e7 == `object` && e7 && !Array.isArray(e7)) {
|
|
383
384
|
o2 = structuredClone(i2);
|
|
384
|
-
let e8 =
|
|
385
|
+
let e8 = ze(s2, a2);
|
|
385
386
|
if (e8) return t2(e8);
|
|
386
387
|
}
|
|
387
388
|
}
|
|
388
389
|
return t2(a2(o2));
|
|
389
390
|
}
|
|
390
|
-
function
|
|
391
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
391
|
+
function Ke(e6) {
|
|
392
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ue();
|
|
392
393
|
return { initModule(e7) {
|
|
393
394
|
return (r2) => {
|
|
394
395
|
let i2 = t2.get(e7.type) ?? [];
|
|
@@ -398,7 +399,7 @@ function Ge(e6) {
|
|
|
398
399
|
let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e7), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e8) => ({ type: e8 }))];
|
|
399
400
|
if (c2.length > 0 && !c2.some(({ type: e8 }) => e8 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e8) => e8.type).join(`, `)}`);
|
|
400
401
|
let l2 = t2.get(r2) ?? [];
|
|
401
|
-
return await Promise.all(l2.map(({ eventDefinition: e8, handler: t3 }) =>
|
|
402
|
+
return await Promise.all(l2.map(({ eventDefinition: e8, handler: t3 }) => Ge(e8, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
402
403
|
}, async processRequest(e7, t3) {
|
|
403
404
|
let n3 = await e7.text();
|
|
404
405
|
return this.process(n3, t3);
|
|
@@ -417,12 +418,12 @@ function Ge(e6) {
|
|
|
417
418
|
let n3 = Array.from(t2.keys()).map((e8) => ({ type: e8 }));
|
|
418
419
|
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e7.eventType)) throw Error(`Unexpected event type: ${e7.eventType}. Expected one of: ${n3.map((e8) => e8.type).join(`, `)}`);
|
|
419
420
|
let r2 = t2.get(e7.eventType) ?? [];
|
|
420
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
421
|
-
}, apps: { AppInstalled:
|
|
421
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Ge(t3, n4, e7.payload, { instanceId: e7.instanceId, identity: e7.identity })));
|
|
422
|
+
}, apps: { AppInstalled: x(`AppInstalled`)(), AppRemoved: x(`AppRemoved`)() } } };
|
|
422
423
|
}
|
|
423
|
-
var
|
|
424
|
-
function
|
|
425
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
424
|
+
var qe = (e6) => e6.__type === `service-plugin-definition`;
|
|
425
|
+
function Je(e6) {
|
|
426
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ue();
|
|
426
427
|
return { initModule(e7) {
|
|
427
428
|
return (r2) => {
|
|
428
429
|
let i2 = t2.get(e7.componentType.toLowerCase()) ?? [];
|
|
@@ -464,42 +465,42 @@ function qe(e6) {
|
|
|
464
465
|
} } };
|
|
465
466
|
}
|
|
466
467
|
var E = `X-Wix-Consistent`;
|
|
467
|
-
function
|
|
468
|
+
function Ye(e6) {
|
|
468
469
|
let t2 = e6.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e7) => Promise.resolve({ headers: {} }) }, r2 = e6.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e6.host), o2 = () => e6.fetch ?? fetch, s2 = async (n3, r3) => {
|
|
469
470
|
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e6.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} }, l3 = e6.host?.getErrorHandler?.();
|
|
470
471
|
try {
|
|
471
472
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
472
473
|
let e7 = await i3(n3, { ...r3, headers: c3 });
|
|
473
474
|
l3?.handleError(e7, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
474
|
-
let a3 =
|
|
475
|
+
let a3 = Xe(e7);
|
|
475
476
|
return a3 && (t2[E] = a3), e7;
|
|
476
477
|
}
|
|
477
478
|
{
|
|
478
479
|
for (let [e8, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e8, t3);
|
|
479
480
|
let e7 = await i3(n3, r3);
|
|
480
481
|
l3?.handleError(e7, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
481
|
-
let a3 =
|
|
482
|
+
let a3 = Xe(e7);
|
|
482
483
|
return a3 && (t2[E] = a3), e7;
|
|
483
484
|
}
|
|
484
485
|
} catch (e7) {
|
|
485
486
|
throw l3?.handleError(e7, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e7;
|
|
486
487
|
}
|
|
487
|
-
}, { client: c2, initModule: l2 } =
|
|
488
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
488
|
+
}, { client: c2, initModule: l2 } = Je(i2), { client: u2, initModule: d2 } = Ke(i2), f2 = async (n3, r3) => {
|
|
489
|
+
let i3 = o2(), s3 = await a2(), c3 = re(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e6.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} } }), u3 = Xe(l3);
|
|
489
490
|
return u3 && (t2[E] = u3), l3;
|
|
490
491
|
}, p2 = (t3, n3) => {
|
|
491
|
-
if (
|
|
492
|
-
if (
|
|
493
|
-
if (
|
|
492
|
+
if (We(t3)) return d2(t3);
|
|
493
|
+
if (qe(t3)) return l2(t3);
|
|
494
|
+
if (ae(t3) && e6.host) return oe(t3, e6.host);
|
|
494
495
|
if (typeof t3 == `function`) {
|
|
495
496
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
496
497
|
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e6.useCDN === void 0 ? i2().shouldUseCDN : e6.useCDN;
|
|
497
|
-
return
|
|
498
|
+
return ke(ue(() => ee(t3)) ? C(t3) : t3, n3 ?? {}, f2, e6.host?.getErrorHandler?.(), (e7, t4) => {
|
|
498
499
|
let n4 = new URL(e7, `https://${r3}`);
|
|
499
500
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
500
501
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e6.host?.name, o3, e6.validateRequestSchema);
|
|
501
502
|
}
|
|
502
|
-
return
|
|
503
|
+
return ie(t3) ? Object.fromEntries(Object.entries(t3).map(([e7, n4]) => [e7, p2(n4, t3[w])])) : t3;
|
|
503
504
|
}, m2 = (e7) => {
|
|
504
505
|
for (let n3 in e7) t2[n3] = e7[n3];
|
|
505
506
|
};
|
|
@@ -507,33 +508,33 @@ function Je(e6) {
|
|
|
507
508
|
let t3 = i2();
|
|
508
509
|
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e6.host), t3;
|
|
509
510
|
}, setHeaders: m2, use: p2, enableContext(e7, t3 = { elevated: false }) {
|
|
510
|
-
e7 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ?
|
|
511
|
+
e7 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ? b.elevatedClient = this : b.client = this;
|
|
511
512
|
}, fetch: (t3, n3) => {
|
|
512
513
|
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
513
514
|
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
514
515
|
}, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
|
|
515
516
|
let i3 = e6?.host?.apiBaseUrl ?? `www.wixapis.com`, a3 = await f2(`https://${i3}/graphql/${r3.apiVersion}`, { method: `POST`, headers: { "Content-Type": `application/json` }, body: JSON.stringify({ query: t3, variables: n3 }) });
|
|
516
|
-
if (a3.status !== 200) throw new
|
|
517
|
+
if (a3.status !== 200) throw new te(`GraphQL request failed with status ${a3.status}`, a3);
|
|
517
518
|
let { data: o3, errors: s3 } = await a3.json();
|
|
518
519
|
return { data: o3 ?? {}, errors: s3 };
|
|
519
520
|
}, webhooks: u2, servicePlugins: c2 };
|
|
520
521
|
}
|
|
521
|
-
function
|
|
522
|
+
function Xe(e6) {
|
|
522
523
|
return e6.headers?.get(`X-Wix-Consistent`) ?? e6.headers?.get(`x-wix-consistent`);
|
|
523
524
|
}
|
|
524
|
-
var
|
|
525
|
-
var
|
|
526
|
-
var
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
function
|
|
525
|
+
var Ze = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
526
|
+
var Qe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
527
|
+
var $e = `items`;
|
|
528
|
+
var et = `pagingMetadata`;
|
|
529
|
+
var tt = Ze;
|
|
530
|
+
function nt(e6, t2) {
|
|
530
531
|
return e6?.split(`.`).map((e7) => t2?.[e7] ?? e7).join(`.`);
|
|
531
532
|
}
|
|
532
|
-
var
|
|
533
|
-
function rt(e6, t2, n2) {
|
|
534
|
-
return (e6 === nt || e6.endsWith(`.${nt}`)) && typeof t2 == `string` ? tt(t2, n2) : t2;
|
|
535
|
-
}
|
|
533
|
+
var rt = `sort.fieldName`;
|
|
536
534
|
function it(e6, t2, n2) {
|
|
535
|
+
return (e6 === rt || e6.endsWith(`.${rt}`)) && typeof t2 == `string` ? nt(t2, n2) : t2;
|
|
536
|
+
}
|
|
537
|
+
function at(e6, t2, n2) {
|
|
537
538
|
let r2 = (e7) => n2.includes(e7), i2 = (e7, n3) => {
|
|
538
539
|
if (Array.isArray(e7)) e7.forEach((e8) => {
|
|
539
540
|
i2(e8, n3);
|
|
@@ -543,160 +544,160 @@ function it(e6, t2, n2) {
|
|
|
543
544
|
Object.keys(a2).forEach((e8) => {
|
|
544
545
|
let o2 = n3 === `` ? e8 : `${n3}.${e8}`;
|
|
545
546
|
if (r2(o2)) return;
|
|
546
|
-
let s2 =
|
|
547
|
-
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] =
|
|
547
|
+
let s2 = ot(e8, t2);
|
|
548
|
+
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] = it(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
548
549
|
});
|
|
549
550
|
}
|
|
550
551
|
};
|
|
551
552
|
return i2(e6, ``), e6;
|
|
552
553
|
}
|
|
553
|
-
function
|
|
554
|
+
function ot(e6, t2) {
|
|
554
555
|
let n2;
|
|
555
556
|
return n2 = e6.includes(`.`) ? e6.split(`.`).map((e7) => t2[e7] ?? e7).join(`.`) : t2[e6] ?? e6, n2;
|
|
556
557
|
}
|
|
557
558
|
function D(e6, t2 = []) {
|
|
558
|
-
return
|
|
559
|
+
return at(e6, Ze, t2);
|
|
559
560
|
}
|
|
560
561
|
function O(e6, t2 = []) {
|
|
561
|
-
return
|
|
562
|
+
return at(e6, Qe, t2);
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
+
function st(e6) {
|
|
564
565
|
return e6?.toISOString();
|
|
565
566
|
}
|
|
566
567
|
function k(e6) {
|
|
567
568
|
return e6 ? new Date(e6) : void 0;
|
|
568
569
|
}
|
|
569
|
-
var
|
|
570
|
-
function
|
|
570
|
+
var ct = /* @__PURE__ */ new WeakMap();
|
|
571
|
+
function lt() {
|
|
571
572
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
572
573
|
}
|
|
573
|
-
function
|
|
574
|
+
function ut(e6, t2) {
|
|
574
575
|
let n2 = e6.get(t2);
|
|
575
|
-
return n2 || (n2 =
|
|
576
|
+
return n2 || (n2 = lt(), e6.set(t2, n2)), n2;
|
|
576
577
|
}
|
|
577
|
-
function
|
|
578
|
-
return t2 === `*` ? (e6.anyField ??=
|
|
578
|
+
function dt(e6, t2) {
|
|
579
|
+
return t2 === `*` ? (e6.anyField ??= lt(), e6.anyField) : t2.endsWith(`{}`) ? (e6.mapFields ??= /* @__PURE__ */ new Map(), ut(e6.mapFields, t2.slice(0, -2))) : (e6.fields ??= /* @__PURE__ */ new Map(), ut(e6.fields, t2));
|
|
579
580
|
}
|
|
580
|
-
function
|
|
581
|
-
let t2 =
|
|
581
|
+
function ft(e6) {
|
|
582
|
+
let t2 = lt();
|
|
582
583
|
for (let n2 of e6) {
|
|
583
|
-
let e7 = n2.path.split(`.`).reduce(
|
|
584
|
+
let e7 = n2.path.split(`.`).reduce(dt, t2);
|
|
584
585
|
e7.leaves ??= [], e7.leaves.push(n2);
|
|
585
586
|
}
|
|
586
587
|
return t2;
|
|
587
588
|
}
|
|
588
|
-
function ft(e6) {
|
|
589
|
-
let t2 = st.get(e6);
|
|
590
|
-
return t2 || (t2 = dt(e6), st.set(e6, t2)), t2;
|
|
591
|
-
}
|
|
592
589
|
function pt(e6) {
|
|
593
|
-
|
|
590
|
+
let t2 = ct.get(e6);
|
|
591
|
+
return t2 || (t2 = ft(e6), ct.set(e6, t2)), t2;
|
|
594
592
|
}
|
|
595
|
-
function mt(e6
|
|
596
|
-
return
|
|
593
|
+
function mt(e6) {
|
|
594
|
+
return typeof e6 == `object` && !!e6;
|
|
597
595
|
}
|
|
598
|
-
function ht(e6, t2, n2) {
|
|
599
|
-
|
|
596
|
+
function ht(e6, { isRepeated: t2, isMap: n2 }, r2) {
|
|
597
|
+
return t2 ? Array.isArray(e6) ? e6.map(r2) : e6 : n2 ? mt(e6) ? Object.fromEntries(Object.entries(e6).map(([e7, t3]) => [e7, r2(t3)])) : e6 : r2(e6);
|
|
600
598
|
}
|
|
601
599
|
function gt(e6, t2, n2) {
|
|
600
|
+
mt(e6) && yt(e6, t2, n2);
|
|
601
|
+
}
|
|
602
|
+
function _t(e6, t2, n2) {
|
|
602
603
|
for (let [r2, i2] of t2) {
|
|
603
604
|
if (!(r2 in e6)) continue;
|
|
604
|
-
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] =
|
|
605
|
+
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] = ht(e6[r2], t4, n2);
|
|
605
606
|
let t3 = e6[r2];
|
|
606
|
-
Array.isArray(t3) ? t3.forEach((e7) =>
|
|
607
|
+
Array.isArray(t3) ? t3.forEach((e7) => gt(e7, i2, n2)) : gt(t3, i2, n2);
|
|
607
608
|
}
|
|
608
609
|
}
|
|
609
|
-
function
|
|
610
|
+
function vt(e6, t2, n2) {
|
|
610
611
|
for (let [r2, i2] of t2) {
|
|
611
612
|
let t3 = e6[r2];
|
|
612
|
-
|
|
613
|
+
mt(t3) && Object.values(t3).forEach((e7) => gt(e7, i2, n2));
|
|
613
614
|
}
|
|
614
615
|
}
|
|
615
|
-
function
|
|
616
|
-
t2 &&
|
|
616
|
+
function yt(e6, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
617
|
+
t2 && _t(e6, t2, i2), n2 && vt(e6, n2, i2), r2 && Object.values(e6).forEach((e7) => gt(e7, r2, i2));
|
|
617
618
|
}
|
|
618
619
|
function A(e6, t2) {
|
|
619
|
-
if (!
|
|
620
|
-
for (let { paths: n2, transformFn: r2 } of t2)
|
|
620
|
+
if (!mt(e6)) return e6;
|
|
621
|
+
for (let { paths: n2, transformFn: r2 } of t2) yt(e6, pt(n2), r2);
|
|
621
622
|
return e6;
|
|
622
623
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
624
|
+
function bt(e6) {
|
|
625
|
+
return Tt(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
625
626
|
}
|
|
626
|
-
var
|
|
627
|
-
var
|
|
628
|
-
var
|
|
629
|
-
var
|
|
630
|
-
function
|
|
627
|
+
var xt = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
628
|
+
var St = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
629
|
+
var Ct = `$1\0$2`;
|
|
630
|
+
var wt = /[^\p{L}\d]+/giu;
|
|
631
|
+
function Tt(e6) {
|
|
631
632
|
let t2 = e6.trim();
|
|
632
|
-
t2 = t2.replace(
|
|
633
|
+
t2 = t2.replace(xt, Ct).replace(St, Ct), t2 = t2.replace(wt, `\0`);
|
|
633
634
|
let n2 = 0, r2 = t2.length;
|
|
634
635
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
635
636
|
if (n2 === r2) return [];
|
|
636
637
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
637
638
|
return t2.slice(n2, r2).split(/\0/g);
|
|
638
639
|
}
|
|
639
|
-
var
|
|
640
|
-
var
|
|
641
|
-
var
|
|
640
|
+
var Et = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
641
|
+
var Dt = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
642
|
+
var Ot = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
642
643
|
function j(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
643
644
|
if (typeof e6 != `object` || !e6) throw e6;
|
|
644
|
-
if (
|
|
645
|
-
if (
|
|
646
|
-
if (
|
|
647
|
-
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
648
|
-
return
|
|
645
|
+
if (Et(e6)) return kt(e6, t2, n2);
|
|
646
|
+
if (Dt(e6)) return jt(e6);
|
|
647
|
+
if (Ot(e6)) {
|
|
648
|
+
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: bt(n3), data: {} }, requestId: e6.requestId };
|
|
649
|
+
return At(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
649
650
|
}
|
|
650
|
-
return
|
|
651
|
+
return Mt(e6);
|
|
651
652
|
}
|
|
652
|
-
var
|
|
653
|
-
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
654
|
-
return
|
|
653
|
+
var kt = (e6, t2, n2) => {
|
|
654
|
+
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Nt(t2, a2, n2)?.sort((e7, t3) => e7.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e7, description: t3 }) => `"${e7}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
655
|
+
return At(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
655
656
|
};
|
|
656
|
-
var
|
|
657
|
-
var
|
|
658
|
-
let t2 = e6.response?.status, n2 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n2, i2 = e6.response?.data?.details?.applicationError?.description ?? n2, a2 = e6.response?.data?.details?.applicationError?.code ??
|
|
659
|
-
return
|
|
657
|
+
var At = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
658
|
+
var jt = (e6) => {
|
|
659
|
+
let t2 = e6.response?.status, n2 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n2, i2 = e6.response?.data?.details?.applicationError?.description ?? n2, a2 = e6.response?.data?.details?.applicationError?.code ?? bt(n2), o2 = e6.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e6.requestId };
|
|
660
|
+
return At(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
660
661
|
};
|
|
661
|
-
var
|
|
662
|
-
var
|
|
662
|
+
var Mt = (e6) => At(e6, { message: e6.requestId ? `System error occurred, request-id: ${e6.requestId}` : `System error occurred: ${JSON.stringify(e6)}`, extraProperties: { requestId: e6.requestId, status: e6.response?.status, code: bt(e6.response?.statusText ?? `UNKNOWN`), ...!e6.response && { runtimeError: e6 } } });
|
|
663
|
+
var Nt = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
663
664
|
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
664
665
|
return r2?.filter((e7) => !r2.some((t3) => t3.field.length > e7.field.length && t3.field.startsWith(e7.field) && o2.includes(t3.field))).map((e7) => {
|
|
665
666
|
let r3 = t2[e7.field];
|
|
666
|
-
if (r3) return { ...e7, field:
|
|
667
|
+
if (r3) return { ...e7, field: Pt(r3, i2) };
|
|
667
668
|
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
668
669
|
if (s2) {
|
|
669
670
|
let t3 = a2[s2];
|
|
670
|
-
if (t3) return { ...e7, field: e7.field.replace(s2,
|
|
671
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, Pt(t3, i2)) };
|
|
671
672
|
}
|
|
672
673
|
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
673
674
|
});
|
|
674
675
|
};
|
|
675
|
-
var
|
|
676
|
-
let n2 =
|
|
676
|
+
var Pt = (e6, t2) => {
|
|
677
|
+
let n2 = Ft(e6);
|
|
677
678
|
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
678
679
|
};
|
|
679
|
-
var
|
|
680
|
+
var Ft = (e6) => {
|
|
680
681
|
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
681
682
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
682
683
|
};
|
|
683
|
-
function
|
|
684
|
+
function It() {
|
|
684
685
|
let e6 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
685
686
|
if (e6) return { initWixModules(t3, n3) {
|
|
686
|
-
return
|
|
687
|
+
return Lt(() => e6(t3, n3));
|
|
687
688
|
}, fetchWithAuth() {
|
|
688
689
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
689
690
|
}, graphql() {
|
|
690
691
|
throw Error(`graphql is not available in this context`);
|
|
691
692
|
} };
|
|
692
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
693
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : b.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : b.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : b.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : b.elevatedClient;
|
|
693
694
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
694
695
|
if (r2) {
|
|
695
696
|
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`);
|
|
696
|
-
return
|
|
697
|
+
return Lt(() => n2.use(e7));
|
|
697
698
|
}
|
|
698
699
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
699
|
-
return
|
|
700
|
+
return Lt(() => t2.use(e7));
|
|
700
701
|
}, fetchWithAuth: (e7, n3) => {
|
|
701
702
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
702
703
|
return t2.fetchWithAuth(e7, n3);
|
|
@@ -708,110 +709,110 @@ function Ft() {
|
|
|
708
709
|
return t2.graphql(e7, n3, r2);
|
|
709
710
|
} };
|
|
710
711
|
}
|
|
711
|
-
function
|
|
712
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
713
|
-
globalThis.__wix_context__ = void 0,
|
|
712
|
+
function Lt(e6) {
|
|
713
|
+
let t2 = globalThis.__wix_context__, n2 = { client: b.client, elevatedClient: b.elevatedClient }, r2;
|
|
714
|
+
globalThis.__wix_context__ = void 0, b.client = void 0, b.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
714
715
|
try {
|
|
715
716
|
return e6();
|
|
716
717
|
} finally {
|
|
717
|
-
globalThis.__wix_context__ = t2,
|
|
718
|
+
globalThis.__wix_context__ = t2, b.client = n2.client, b.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
718
719
|
}
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
+
function Rt(e6, t2) {
|
|
721
722
|
return (...n2) => {
|
|
722
|
-
let r2 =
|
|
723
|
+
let r2 = It();
|
|
723
724
|
return r2 ? r2.initWixModules(e6, t2).apply(void 0, n2) : e6.apply(void 0, n2);
|
|
724
725
|
};
|
|
725
726
|
}
|
|
726
727
|
function M(e6, t2 = false) {
|
|
727
|
-
return
|
|
728
|
+
return Rt(e6, t2);
|
|
728
729
|
}
|
|
729
730
|
function N(e6, t2) {
|
|
730
|
-
let n2 =
|
|
731
|
-
return t2 && r2 ? new URLSearchParams({ ".r":
|
|
731
|
+
let n2 = zt(e6), r2 = Object.entries(n2).some(([e7, t3]) => e7.includes(`.`) || Array.isArray(t3) && t3.some((e8) => typeof e8 == `object`));
|
|
732
|
+
return t2 && r2 ? new URLSearchParams({ ".r": Vt(JSON.stringify(e6)) }) : Object.entries(n2).reduce((e7, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
732
733
|
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e7.append(t3, r3);
|
|
733
734
|
}), e7), new URLSearchParams());
|
|
734
735
|
}
|
|
735
736
|
function P(e6) {
|
|
736
|
-
let t2 =
|
|
737
|
-
return
|
|
737
|
+
let t2 = en(Qt(e6.host), e6.domainToMappings);
|
|
738
|
+
return un(sn(e6.protoPath, e6.data || {}), t2);
|
|
738
739
|
}
|
|
739
|
-
function
|
|
740
|
+
function zt(e6, t2 = ``) {
|
|
740
741
|
let n2 = {};
|
|
741
742
|
return Object.entries(e6).forEach(([e7, r2]) => {
|
|
742
|
-
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 =
|
|
743
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Bt(t2, e7);
|
|
743
744
|
if (i2) {
|
|
744
|
-
let e8 =
|
|
745
|
+
let e8 = zt(r2, a2);
|
|
745
746
|
Object.assign(n2, e8);
|
|
746
747
|
} else n2[a2] = r2;
|
|
747
748
|
}), n2;
|
|
748
749
|
}
|
|
749
|
-
function
|
|
750
|
+
function Bt(e6, t2) {
|
|
750
751
|
return `${e6}${e6 ? `.` : ``}${t2}`;
|
|
751
752
|
}
|
|
752
|
-
var
|
|
753
|
+
var Vt = (e6) => {
|
|
753
754
|
let t2 = new TextEncoder().encode(e6);
|
|
754
755
|
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e6, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
755
756
|
};
|
|
756
|
-
var
|
|
757
|
-
var
|
|
758
|
-
var
|
|
759
|
-
var
|
|
760
|
-
var
|
|
761
|
-
var
|
|
762
|
-
var
|
|
763
|
-
var
|
|
764
|
-
var
|
|
765
|
-
var
|
|
766
|
-
function Zt(e6) {
|
|
767
|
-
return Qt(e6).replace(Wt, `._base_domain_`).replace(Yt, `._api_base_domain_`).replace(Xt, `*.dev.wix-code.com`);
|
|
768
|
-
}
|
|
757
|
+
var Ht = [`wix.com`, `editorx.com`];
|
|
758
|
+
var Ut = `_`;
|
|
759
|
+
var Wt = `*.`;
|
|
760
|
+
var Gt = RegExp(`\\.(${Ht.join(`|`)})$`);
|
|
761
|
+
var Kt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
762
|
+
var qt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
763
|
+
var Jt = `dev.wix-code.com`;
|
|
764
|
+
var Yt = /{(.*)}/;
|
|
765
|
+
var Xt = RegExp(`\\.(${Kt.join(`|`)})$`);
|
|
766
|
+
var Zt = RegExp(`.*\\.${Jt}$`);
|
|
769
767
|
function Qt(e6) {
|
|
770
|
-
return
|
|
768
|
+
return $t(e6).replace(Gt, `._base_domain_`).replace(Xt, `._api_base_domain_`).replace(Zt, `*.dev.wix-code.com`);
|
|
771
769
|
}
|
|
772
|
-
function $t(e6
|
|
770
|
+
function $t(e6) {
|
|
771
|
+
return qt[e6] ?? e6;
|
|
772
|
+
}
|
|
773
|
+
function en(e6, t2) {
|
|
773
774
|
let n2 = t2[e6];
|
|
774
775
|
if (n2) return n2;
|
|
775
|
-
let r2 =
|
|
776
|
+
let r2 = tn(e6, t2) ?? nn(e6, t2);
|
|
776
777
|
if (!r2) {
|
|
777
|
-
if (
|
|
778
|
-
let e7 = t2[
|
|
778
|
+
if (an(e6)) {
|
|
779
|
+
let e7 = t2[on];
|
|
779
780
|
if (e7) return e7;
|
|
780
781
|
}
|
|
781
|
-
let n3 = t2[
|
|
782
|
+
let n3 = t2[Ut];
|
|
782
783
|
if (n3) return n3;
|
|
783
784
|
}
|
|
784
785
|
return r2 ?? [];
|
|
785
786
|
}
|
|
786
|
-
function
|
|
787
|
+
function tn(e6, t2) {
|
|
787
788
|
return Object.entries(t2).find(([t3]) => {
|
|
788
789
|
let [, ...n2] = e6.split(`.`);
|
|
789
790
|
return n2.join(`.`) === t3;
|
|
790
791
|
})?.[1];
|
|
791
792
|
}
|
|
792
|
-
function
|
|
793
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
793
|
+
function nn(e6, t2) {
|
|
794
|
+
let [n2] = Object.entries(t2).filter(([t3]) => rn(e6, t3)).sort(([e7], [t3]) => t3.length - e7.length);
|
|
794
795
|
if (!n2) return;
|
|
795
796
|
let [, r2] = n2;
|
|
796
797
|
return r2;
|
|
797
798
|
}
|
|
798
|
-
function
|
|
799
|
-
if (!t2.startsWith(
|
|
799
|
+
function rn(e6, t2) {
|
|
800
|
+
if (!t2.startsWith(Wt)) return false;
|
|
800
801
|
let n2 = t2.slice(1);
|
|
801
802
|
return e6.length > n2.length && e6.endsWith(n2);
|
|
802
803
|
}
|
|
803
|
-
function
|
|
804
|
+
function an(e6) {
|
|
804
805
|
return !!e6.match(/\._base_domain_$/);
|
|
805
806
|
}
|
|
806
|
-
var
|
|
807
|
-
function on(e6, t2) {
|
|
808
|
-
return e6.split(`/`).map((e7) => sn(e7, t2)).join(`/`);
|
|
809
|
-
}
|
|
807
|
+
var on = `www._base_domain_`;
|
|
810
808
|
function sn(e6, t2) {
|
|
811
|
-
|
|
812
|
-
|
|
809
|
+
return e6.split(`/`).map((e7) => cn(e7, t2)).join(`/`);
|
|
810
|
+
}
|
|
811
|
+
function cn(e6, t2) {
|
|
812
|
+
let n2 = e6.match(Yt) || [], r2 = n2[1];
|
|
813
|
+
return r2 ? ln(t2, r2, e6, e6.replace(n2[0], ``)) : e6;
|
|
813
814
|
}
|
|
814
|
-
function
|
|
815
|
+
function ln(e6, t2, n2, r2) {
|
|
815
816
|
let i2 = e6;
|
|
816
817
|
for (let e7 of t2.split(`.`)) {
|
|
817
818
|
if (!i2) return n2;
|
|
@@ -819,14 +820,14 @@ function cn(e6, t2, n2, r2) {
|
|
|
819
820
|
}
|
|
820
821
|
return `${i2}${r2}`;
|
|
821
822
|
}
|
|
822
|
-
function
|
|
823
|
+
function un(e6, t2) {
|
|
823
824
|
let n2 = t2?.find((t3) => e6.startsWith(t3.destPath));
|
|
824
825
|
return n2 ? n2.srcPath + e6.slice(n2.destPath.length) : e6;
|
|
825
826
|
}
|
|
826
|
-
function
|
|
827
|
+
function dn(e6) {
|
|
827
828
|
return isFinite(e6) ? e6 : e6.toString();
|
|
828
829
|
}
|
|
829
|
-
function
|
|
830
|
+
function F(e6) {
|
|
830
831
|
return e6 === `NaN` ? NaN : e6 === `Infinity` ? 1 / 0 : e6 === `-Infinity` ? -1 / 0 : e6;
|
|
831
832
|
}
|
|
832
833
|
function fn(e6) {
|
|
@@ -948,7 +949,7 @@ var An = En({ createHost: function(e6) {
|
|
|
948
949
|
} });
|
|
949
950
|
var jn = (e6, t2) => {
|
|
950
951
|
let n2 = An.host({ applicationId: e6, componentId: t2 }), r2 = An.auth();
|
|
951
|
-
return
|
|
952
|
+
return Ye({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
952
953
|
};
|
|
953
954
|
var Mn = (e6) => jn(`14bcded7-0066-7c35-14d7-466cb3f09103`, e6);
|
|
954
955
|
function Nn() {
|
|
@@ -960,7 +961,7 @@ function Nn() {
|
|
|
960
961
|
}, graphql() {
|
|
961
962
|
throw Error(`graphql is not available in this context`);
|
|
962
963
|
} };
|
|
963
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
964
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : b.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : b.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : b.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : b.elevatedClient;
|
|
964
965
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
965
966
|
if (r2) {
|
|
966
967
|
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`);
|
|
@@ -980,12 +981,12 @@ function Nn() {
|
|
|
980
981
|
} };
|
|
981
982
|
}
|
|
982
983
|
function Pn(e6) {
|
|
983
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
984
|
-
globalThis.__wix_context__ = void 0,
|
|
984
|
+
let t2 = globalThis.__wix_context__, n2 = { client: b.client, elevatedClient: b.elevatedClient }, r2;
|
|
985
|
+
globalThis.__wix_context__ = void 0, b.client = void 0, b.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
985
986
|
try {
|
|
986
987
|
return e6();
|
|
987
988
|
} finally {
|
|
988
|
-
globalThis.__wix_context__ = t2,
|
|
989
|
+
globalThis.__wix_context__ = t2, b.client = n2.client, b.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
989
990
|
}
|
|
990
991
|
}
|
|
991
992
|
function Fn(e6, t2) {
|
|
@@ -1046,10 +1047,10 @@ function Un(e6, t2, n2) {
|
|
|
1046
1047
|
}
|
|
1047
1048
|
return a2;
|
|
1048
1049
|
}
|
|
1049
|
-
function
|
|
1050
|
+
function I(e6) {
|
|
1050
1051
|
return e6;
|
|
1051
1052
|
}
|
|
1052
|
-
var Wn =
|
|
1053
|
+
var Wn = I(`@wix/site-service-rendering-context`);
|
|
1053
1054
|
var Gn = () => {
|
|
1054
1055
|
try {
|
|
1055
1056
|
return (0, import_services_manager_react.useService)(Wn).SSR;
|
|
@@ -1066,7 +1067,7 @@ function qn(e6, t2) {
|
|
|
1066
1067
|
(0, import_react.startTransition)(() => r2({ deps: t2, value: i2 }));
|
|
1067
1068
|
}, t2), n2.value;
|
|
1068
1069
|
}
|
|
1069
|
-
var Jn =
|
|
1070
|
+
var Jn = I(`@wix/viewer-service-site-members`);
|
|
1070
1071
|
var Yn = () => {
|
|
1071
1072
|
try {
|
|
1072
1073
|
return (0, import_services_manager_react.useService)(Jn);
|
|
@@ -1093,7 +1094,7 @@ var Xn = (e6, t2) => {
|
|
|
1093
1094
|
};
|
|
1094
1095
|
}, [a2, t2, n2]), (0, import_react.useMemo)(() => a2 && r2 && r2._id === e6.post?._id ? { ...e6, post: r2, paywall: void 0 } : e6, [a2, r2, e6]);
|
|
1095
1096
|
};
|
|
1096
|
-
var Zn =
|
|
1097
|
+
var Zn = I(`@wix/site-service-url`);
|
|
1097
1098
|
var Qn = `14bcded7-0066-7c35-14d7-466cb3f09103`;
|
|
1098
1099
|
var $n = `post`;
|
|
1099
1100
|
var er = `category`;
|
|
@@ -1179,7 +1180,7 @@ var mr = (e6, t2, n2) => {
|
|
|
1179
1180
|
}
|
|
1180
1181
|
}, [e6, t2, n2]);
|
|
1181
1182
|
};
|
|
1182
|
-
var hr =
|
|
1183
|
+
var hr = I(`@wix/site-service-warmup-data`);
|
|
1183
1184
|
function gr() {
|
|
1184
1185
|
let e6 = Gn(), t2 = null;
|
|
1185
1186
|
try {
|
|
@@ -1224,8 +1225,8 @@ var yr = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
|
1224
1225
|
};
|
|
1225
1226
|
return (e7) => r2.getOrInsert(e7, () => i2(e7));
|
|
1226
1227
|
};
|
|
1227
|
-
var
|
|
1228
|
-
var
|
|
1228
|
+
var L = (e6) => typeof e6 == `string`;
|
|
1229
|
+
var R = () => {
|
|
1229
1230
|
let e6, t2, n2 = new Promise((n3, r2) => {
|
|
1230
1231
|
e6 = n3, t2 = r2;
|
|
1231
1232
|
});
|
|
@@ -1239,9 +1240,9 @@ var xr = (e6, t2, n2) => {
|
|
|
1239
1240
|
};
|
|
1240
1241
|
var Sr = /###/g;
|
|
1241
1242
|
var Cr = (e6) => e6 && e6.includes(`###`) ? e6.replace(Sr, `.`) : e6;
|
|
1242
|
-
var wr = (e6) => !e6 ||
|
|
1243
|
-
var
|
|
1244
|
-
let r2 =
|
|
1243
|
+
var wr = (e6) => !e6 || L(e6);
|
|
1244
|
+
var z = (e6, t2, n2) => {
|
|
1245
|
+
let r2 = L(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1245
1246
|
for (; i2 < r2.length - 1; ) {
|
|
1246
1247
|
if (wr(e6)) return {};
|
|
1247
1248
|
let t3 = Cr(r2[i2]);
|
|
@@ -1250,21 +1251,21 @@ var R = (e6, t2, n2) => {
|
|
|
1250
1251
|
return wr(e6) ? {} : { obj: e6, k: Cr(r2[i2]) };
|
|
1251
1252
|
};
|
|
1252
1253
|
var Tr = (e6, t2, n2) => {
|
|
1253
|
-
let { obj: r2, k: i2 } =
|
|
1254
|
+
let { obj: r2, k: i2 } = z(e6, t2, Object);
|
|
1254
1255
|
if (r2 !== void 0 || t2.length === 1) {
|
|
1255
1256
|
r2[i2] = n2;
|
|
1256
1257
|
return;
|
|
1257
1258
|
}
|
|
1258
|
-
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 =
|
|
1259
|
-
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 =
|
|
1259
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = z(e6, o2, Object);
|
|
1260
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = z(e6, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
1260
1261
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1261
1262
|
};
|
|
1262
1263
|
var Er = (e6, t2, n2, r2) => {
|
|
1263
|
-
let { obj: i2, k: a2 } =
|
|
1264
|
+
let { obj: i2, k: a2 } = z(e6, t2, Object);
|
|
1264
1265
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1265
1266
|
};
|
|
1266
1267
|
var Dr = (e6, t2) => {
|
|
1267
|
-
let { obj: n2, k: r2 } =
|
|
1268
|
+
let { obj: n2, k: r2 } = z(e6, t2);
|
|
1268
1269
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1269
1270
|
};
|
|
1270
1271
|
var Or = (e6, t2, n2) => {
|
|
@@ -1272,12 +1273,12 @@ var Or = (e6, t2, n2) => {
|
|
|
1272
1273
|
return r2 === void 0 ? Dr(t2, n2) : r2;
|
|
1273
1274
|
};
|
|
1274
1275
|
var kr = (e6, t2, n2) => {
|
|
1275
|
-
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ?
|
|
1276
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ? L(e6[r2]) || e6[r2] instanceof String || L(t2[r2]) || t2[r2] instanceof String ? n2 && (e6[r2] = t2[r2]) : kr(e6[r2], t2[r2], n2) : e6[r2] = t2[r2]);
|
|
1276
1277
|
return e6;
|
|
1277
1278
|
};
|
|
1278
|
-
var
|
|
1279
|
+
var B = (e6) => e6.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1279
1280
|
var Ar = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1280
|
-
var jr = (e6) =>
|
|
1281
|
+
var jr = (e6) => L(e6) ? e6.replace(/[&<>"'\/]/g, (e7) => Ar[e7]) : e6;
|
|
1281
1282
|
var Mr = class {
|
|
1282
1283
|
constructor(e6) {
|
|
1283
1284
|
this.capacity = e6, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
@@ -1318,7 +1319,7 @@ var Ir = (e6, t2, n2 = `.`) => {
|
|
|
1318
1319
|
}
|
|
1319
1320
|
return i2;
|
|
1320
1321
|
};
|
|
1321
|
-
var
|
|
1322
|
+
var V = (e6) => e6?.replace(/_/g, `-`);
|
|
1322
1323
|
var Lr = { type: `logger`, log(e6) {
|
|
1323
1324
|
this.output(`log`, e6);
|
|
1324
1325
|
}, warn(e6) {
|
|
@@ -1328,7 +1329,7 @@ var Lr = { type: `logger`, log(e6) {
|
|
|
1328
1329
|
}, output(e6, t2) {
|
|
1329
1330
|
console?.[e6]?.apply?.(console, t2);
|
|
1330
1331
|
} };
|
|
1331
|
-
var
|
|
1332
|
+
var H = new class e2 {
|
|
1332
1333
|
constructor(e6, t2 = {}) {
|
|
1333
1334
|
this.init(e6, t2);
|
|
1334
1335
|
}
|
|
@@ -1348,7 +1349,7 @@ var V = new class e2 {
|
|
|
1348
1349
|
return this.forward(e6, `warn`, `WARNING DEPRECATED: `, true);
|
|
1349
1350
|
}
|
|
1350
1351
|
forward(e6, t2, n2, r2) {
|
|
1351
|
-
return r2 && !this.debug ? null : (e6 = e6.map((e7) =>
|
|
1352
|
+
return r2 && !this.debug ? null : (e6 = e6.map((e7) => L(e7) ? e7.replace(/[\r\n\x00-\x1F\x7F]/g, ` `) : e7), L(e6[0]) && (e6[0] = `${n2}${this.prefix} ${e6[0]}`), this.logger[t2](e6));
|
|
1352
1353
|
}
|
|
1353
1354
|
create(t2) {
|
|
1354
1355
|
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
@@ -1399,16 +1400,16 @@ var Br = class extends Rr {
|
|
|
1399
1400
|
}
|
|
1400
1401
|
getResource(e6, t2, n2, r2 = {}) {
|
|
1401
1402
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1402
|
-
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) :
|
|
1403
|
+
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : L(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1403
1404
|
let s2 = Dr(this.data, o2);
|
|
1404
|
-
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !
|
|
1405
|
+
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !L(n2) ? s2 : Ir(this.data?.[e6]?.[t2], n2, i2);
|
|
1405
1406
|
}
|
|
1406
1407
|
addResource(e6, t2, n2, r2, i2 = { silent: false }) {
|
|
1407
1408
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e6, t2];
|
|
1408
1409
|
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), Tr(this.data, o2, r2), i2.silent || this.emit(`added`, e6, t2, n2, r2);
|
|
1409
1410
|
}
|
|
1410
1411
|
addResources(e6, t2, n2, r2 = { silent: false }) {
|
|
1411
|
-
for (let r3 in n2) (
|
|
1412
|
+
for (let r3 in n2) (L(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e6, t2, r3, n2[r3], { silent: true });
|
|
1412
1413
|
r2.silent || this.emit(`added`, e6, t2, n2);
|
|
1413
1414
|
}
|
|
1414
1415
|
addResourceBundle(e6, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
@@ -1452,7 +1453,7 @@ function Ur() {
|
|
|
1452
1453
|
let e6 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1453
1454
|
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === Hr ? e6 : (e6.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1454
1455
|
}
|
|
1455
|
-
function
|
|
1456
|
+
function U(e6, t2) {
|
|
1456
1457
|
let { [Hr]: n2 } = e6(Ur()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`, a2 = t2?.enableSelector === `strict`;
|
|
1457
1458
|
if (n2.length > 1 && i2) {
|
|
1458
1459
|
let e7 = t2?.ns, o2 = a2 ? Array.isArray(e7) ? e7 : e7 ? [e7] : null : Array.isArray(e7) ? e7 : null;
|
|
@@ -1460,10 +1461,10 @@ function H(e6, t2) {
|
|
|
1460
1461
|
}
|
|
1461
1462
|
return n2.join(r2);
|
|
1462
1463
|
}
|
|
1463
|
-
var Wr = (e6) => !
|
|
1464
|
+
var Wr = (e6) => !L(e6) && typeof e6 != `boolean` && typeof e6 != `number`;
|
|
1464
1465
|
var Gr = class e3 extends Rr {
|
|
1465
1466
|
constructor(e6, t2 = {}) {
|
|
1466
|
-
super(), xr([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e6, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger =
|
|
1467
|
+
super(), xr([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e6, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = H.create(`translator`), this.checkedLoadedFor = {};
|
|
1467
1468
|
}
|
|
1468
1469
|
changeLanguage(e6) {
|
|
1469
1470
|
e6 && (this.language = e6);
|
|
@@ -1482,24 +1483,24 @@ var Gr = class e3 extends Rr {
|
|
|
1482
1483
|
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e6.includes(n2), o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !Fr(e6, n2, r2);
|
|
1483
1484
|
if (a2 && !o2) {
|
|
1484
1485
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1485
|
-
if (t3 && t3.length > 0) return { key: e6, namespaces:
|
|
1486
|
+
if (t3 && t3.length > 0) return { key: e6, namespaces: L(i2) ? [i2] : i2 };
|
|
1486
1487
|
let a3 = e6.split(n2);
|
|
1487
1488
|
(n2 !== r2 || n2 === r2 && this.options.ns.includes(a3[0])) && (i2 = a3.shift()), e6 = a3.join(r2);
|
|
1488
1489
|
}
|
|
1489
|
-
return { key: e6, namespaces:
|
|
1490
|
+
return { key: e6, namespaces: L(i2) ? [i2] : i2 };
|
|
1490
1491
|
}
|
|
1491
1492
|
translate(t2, n2, r2) {
|
|
1492
1493
|
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
1493
1494
|
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
1494
|
-
typeof t2 == `function` && (t2 =
|
|
1495
|
+
typeof t2 == `function` && (t2 = U(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e6) => typeof e6 == `function` ? U(e6, { ...this.options, ...i2 }) : String(e6));
|
|
1495
1496
|
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;
|
|
1496
1497
|
u2 === void 0 && (u2 = `:`);
|
|
1497
1498
|
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1498
1499
|
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;
|
|
1499
|
-
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 && !
|
|
1500
|
+
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 && !L(i2.count), x2 = e3.hasDefaultValue(i2), S2 = b2 ? this.pluralResolver.getSuffix(d2, i2.count, i2) : ``, C2 = i2.ordinal && b2 ? this.pluralResolver.getSuffix(d2, i2.count, { ordinal: false }) : ``, ee2 = b2 && !i2.ordinal && i2.count === 0, w2 = ee2 && i2[`defaultValue${this.options.pluralSeparator}zero`] || i2[`defaultValue${S2}`] || i2[`defaultValue${C2}`] || i2.defaultValue, T2 = m2;
|
|
1500
1501
|
y2 && !m2 && x2 && (T2 = w2);
|
|
1501
1502
|
let te2 = Wr(T2), ne2 = Object.prototype.toString.apply(T2);
|
|
1502
|
-
if (y2 && T2 && te2 && !_2.includes(ne2) && !(
|
|
1503
|
+
if (y2 && T2 && te2 && !_2.includes(ne2) && !(L(v2) && Array.isArray(T2))) {
|
|
1503
1504
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1504
1505
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
1505
1506
|
let e6 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, T2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
@@ -1513,7 +1514,7 @@ var Gr = class e3 extends Rr {
|
|
|
1513
1514
|
}
|
|
1514
1515
|
m2 = t3;
|
|
1515
1516
|
}
|
|
1516
|
-
} else if (y2 &&
|
|
1517
|
+
} else if (y2 && L(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
1517
1518
|
else {
|
|
1518
1519
|
let e6 = false, n3 = false;
|
|
1519
1520
|
!this.isValidLookup(m2) && x2 && (e6 = true, m2 = w2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
@@ -1545,30 +1546,30 @@ var Gr = class e3 extends Rr {
|
|
|
1545
1546
|
if (this.i18nFormat?.parse) e6 = this.i18nFormat.parse(e6, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 });
|
|
1546
1547
|
else if (!n2.skipInterpolation) {
|
|
1547
1548
|
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
1548
|
-
let a3 =
|
|
1549
|
+
let a3 = L(e6) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
1549
1550
|
if (a3) {
|
|
1550
1551
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1551
1552
|
o3 = t3 && t3.length;
|
|
1552
1553
|
}
|
|
1553
|
-
let s2 = n2.replace && !
|
|
1554
|
+
let s2 = n2.replace && !L(n2.replace) ? n2.replace : n2;
|
|
1554
1555
|
if (this.options.interpolation.defaultVariables && (s2 = { ...this.options.interpolation.defaultVariables, ...s2 }), e6 = this.interpolator.interpolate(e6, s2, n2.lng || this.language || r2.usedLng, n2), a3) {
|
|
1555
1556
|
let t3 = e6.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
1556
1557
|
o3 < r3 && (n2.nest = false);
|
|
1557
1558
|
}
|
|
1558
1559
|
!n2.lng && r2 && r2.res && (n2.lng = this.language || r2.usedLng), n2.nest !== false && (e6 = this.interpolator.nest(e6, (...e7) => i2?.[0] === e7[0] && !n2.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e7[0]} in key: ${t2[0]}`), null) : this.translate(...e7, t2), n2)), n2.interpolation && this.interpolator.reset();
|
|
1559
1560
|
}
|
|
1560
|
-
let a2 = n2.postProcess || this.options.postProcess, o2 =
|
|
1561
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = L(a2) ? [a2] : a2;
|
|
1561
1562
|
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 = Vr.handle(o2, e6, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e6;
|
|
1562
1563
|
}
|
|
1563
1564
|
resolve(e6, t2 = {}) {
|
|
1564
1565
|
let n2, r2, i2, a2, o2;
|
|
1565
|
-
return
|
|
1566
|
+
return L(e6) && (e6 = [e6]), Array.isArray(e6) && (e6 = e6.map((e7) => typeof e7 == `function` ? U(e7, { ...this.options, ...t2 }) : e7)), e6.forEach((e7) => {
|
|
1566
1567
|
if (this.isValidLookup(n2)) return;
|
|
1567
1568
|
let s2 = this.extractFromKey(e7, t2), c2 = s2.key;
|
|
1568
1569
|
r2 = c2;
|
|
1569
1570
|
let l2 = s2.namespaces;
|
|
1570
1571
|
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1571
|
-
let u2 = t2.count !== void 0 && !
|
|
1572
|
+
let u2 = t2.count !== void 0 && !L(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (L(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1572
1573
|
l2.forEach((e8) => {
|
|
1573
1574
|
this.isValidLookup(n2) || (o2 = e8, !this.checkedLoadedFor[`${p2[0]}-${e8}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (this.checkedLoadedFor[`${p2[0]}-${e8}`] = 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) => {
|
|
1574
1575
|
if (this.isValidLookup(n2)) return;
|
|
@@ -1597,7 +1598,7 @@ var Gr = class e3 extends Rr {
|
|
|
1597
1598
|
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e6, t2, n2, r2) : this.resourceStore.getResource(e6, t2, n2, r2);
|
|
1598
1599
|
}
|
|
1599
1600
|
getUsedParamsDetails(e6 = {}) {
|
|
1600
|
-
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !
|
|
1601
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !L(e6.replace), r2 = n2 ? e6.replace : e6;
|
|
1601
1602
|
if (n2 && e6.count !== void 0 && (r2 = { ...r2, count: e6.count }), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
1602
1603
|
r2 = { ...r2 };
|
|
1603
1604
|
for (let e7 of t2) delete r2[e7];
|
|
@@ -1611,23 +1612,23 @@ var Gr = class e3 extends Rr {
|
|
|
1611
1612
|
};
|
|
1612
1613
|
var Kr = class {
|
|
1613
1614
|
constructor(e6) {
|
|
1614
|
-
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger =
|
|
1615
|
+
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger = H.create(`languageUtils`), this.resolveHierarchyCache = {};
|
|
1615
1616
|
}
|
|
1616
1617
|
clearCache() {
|
|
1617
1618
|
this.resolveHierarchyCache = {};
|
|
1618
1619
|
}
|
|
1619
1620
|
getScriptPartFromCode(e6) {
|
|
1620
|
-
if (e6 =
|
|
1621
|
+
if (e6 = V(e6), !e6 || !e6.includes(`-`)) return null;
|
|
1621
1622
|
let t2 = e6.split(`-`);
|
|
1622
1623
|
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
1623
1624
|
}
|
|
1624
1625
|
getLanguagePartFromCode(e6) {
|
|
1625
|
-
if (e6 =
|
|
1626
|
+
if (e6 = V(e6), !e6 || !e6.includes(`-`)) return e6;
|
|
1626
1627
|
let t2 = e6.split(`-`);
|
|
1627
1628
|
return this.formatLanguageCode(t2[0]);
|
|
1628
1629
|
}
|
|
1629
1630
|
formatLanguageCode(e6) {
|
|
1630
|
-
if (
|
|
1631
|
+
if (L(e6) && e6.includes(`-`)) {
|
|
1631
1632
|
let t2;
|
|
1632
1633
|
try {
|
|
1633
1634
|
t2 = Intl.getCanonicalLocales(e6)[0];
|
|
@@ -1658,7 +1659,7 @@ var Kr = class {
|
|
|
1658
1659
|
}
|
|
1659
1660
|
getFallbackCodes(e6, t2) {
|
|
1660
1661
|
if (!e6) return [];
|
|
1661
|
-
if (typeof e6 == `function` && (e6 = e6(t2)),
|
|
1662
|
+
if (typeof e6 == `function` && (e6 = e6(t2)), L(e6) && (e6 = [e6]), Array.isArray(e6)) return e6;
|
|
1662
1663
|
if (!t2) return e6.default || [];
|
|
1663
1664
|
let n2 = e6[t2];
|
|
1664
1665
|
return n2 ||= e6[this.getScriptPartFromCode(t2)], n2 ||= e6[this.formatLanguageCode(t2)], n2 ||= e6[this.getLanguagePartFromCode(t2)], n2 ||= e6.default, n2 || [];
|
|
@@ -1666,7 +1667,7 @@ var Kr = class {
|
|
|
1666
1667
|
toResolveHierarchy(e6, t2) {
|
|
1667
1668
|
let n2 = this.options.fallbackLng, r2 = Array.isArray(n2) ? n2.join(`|`) : n2;
|
|
1668
1669
|
r2 !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r2);
|
|
1669
|
-
let i2 = t2 === void 0 || t2 === false ||
|
|
1670
|
+
let i2 = t2 === void 0 || t2 === false || L(t2), a2 = t2 === void 0 && typeof this.options.fallbackLng == `function`, o2 = L(e6) && i2 && !a2, s2 = null;
|
|
1670
1671
|
if (o2) {
|
|
1671
1672
|
let n3;
|
|
1672
1673
|
n3 = t2 === void 0 ? `undefined` : t2 === false ? `boolean:false` : `string:${t2}`, s2 = `${e6.length}:${e6}|${n3}`;
|
|
@@ -1678,8 +1679,9 @@ var Kr = class {
|
|
|
1678
1679
|
let c2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e6), l2 = [], u2 = (e7) => {
|
|
1679
1680
|
e7 && (this.isSupportedCode(e7) ? l2.push(e7) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e7}`));
|
|
1680
1681
|
};
|
|
1681
|
-
return
|
|
1682
|
-
|
|
1682
|
+
return L(e6) && (e6.includes(`-`) || e6.includes(`_`)) ? (this.options.load !== `languageOnly` && u2(this.formatLanguageCode(e6)), this.options.load !== `languageOnly` && this.options.load !== `currentOnly` && u2(this.getScriptPartFromCode(e6)), this.options.load !== `currentOnly` && u2(this.getLanguagePartFromCode(e6))) : L(e6) && u2(this.formatLanguageCode(e6)), c2.forEach((e7) => {
|
|
1683
|
+
let t3 = this.formatLanguageCode(e7);
|
|
1684
|
+
l2.includes(t3) || u2(t3);
|
|
1683
1685
|
}), s2 === null ? l2 : (this.resolveHierarchyCache[s2] = l2, l2.slice());
|
|
1684
1686
|
}
|
|
1685
1687
|
};
|
|
@@ -1687,13 +1689,13 @@ var qr = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
|
1687
1689
|
var Jr = { select: (e6) => e6 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1688
1690
|
var Yr = class {
|
|
1689
1691
|
constructor(e6, t2 = {}) {
|
|
1690
|
-
this.languageUtils = e6, this.options = t2, this.logger =
|
|
1692
|
+
this.languageUtils = e6, this.options = t2, this.logger = H.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1691
1693
|
}
|
|
1692
1694
|
clearCache() {
|
|
1693
1695
|
this.pluralRulesCache = {};
|
|
1694
1696
|
}
|
|
1695
1697
|
getRule(e6, t2 = {}) {
|
|
1696
|
-
let n2 =
|
|
1698
|
+
let n2 = V(e6 === `dev` ? `en` : e6), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
1697
1699
|
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
1698
1700
|
let a2;
|
|
1699
1701
|
try {
|
|
@@ -1724,17 +1726,17 @@ var Yr = class {
|
|
|
1724
1726
|
};
|
|
1725
1727
|
var Xr = (e6, t2, n2, r2 = `.`, i2 = true) => {
|
|
1726
1728
|
let a2 = Or(e6, t2, n2);
|
|
1727
|
-
return !a2 && i2 &&
|
|
1729
|
+
return !a2 && i2 && L(n2) && (a2 = Ir(e6, n2, r2), a2 === void 0 && (a2 = Ir(t2, n2, r2))), a2;
|
|
1728
1730
|
};
|
|
1729
1731
|
var Zr = (e6) => e6.replace(/\$/g, `$$$$`);
|
|
1730
1732
|
var Qr = class {
|
|
1731
1733
|
constructor(e6 = {}) {
|
|
1732
|
-
this.logger =
|
|
1734
|
+
this.logger = H.create(`interpolator`), this.options = e6, this.format = e6?.interpolation?.format || ((e7) => e7), this.init(e6);
|
|
1733
1735
|
}
|
|
1734
1736
|
init(e6 = {}) {
|
|
1735
1737
|
e6.interpolation ||= { escapeValue: true };
|
|
1736
1738
|
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 } = e6.interpolation;
|
|
1737
|
-
this.escape = t2 === void 0 ? jr : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ?
|
|
1739
|
+
this.escape = t2 === void 0 ? jr : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? B(i2) : a2 || `{{`, this.suffix = o2 ? B(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 ? B(u2) : `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 ? B(l2) : ``, this.nestingPrefix = d2 ? B(d2) : f2 || B(`$t(`), this.nestingSuffix = p2 ? B(p2) : m2 || B(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1738
1740
|
}
|
|
1739
1741
|
reset() {
|
|
1740
1742
|
this.options && this.init(this.options);
|
|
@@ -1760,13 +1762,13 @@ var Qr = class {
|
|
|
1760
1762
|
if (a2 = c2(n3), a2 === void 0) {
|
|
1761
1763
|
if (typeof l2 == `function`) {
|
|
1762
1764
|
let t4 = l2(e6, i2, r2);
|
|
1763
|
-
a2 =
|
|
1765
|
+
a2 = L(t4) ? t4 : ``;
|
|
1764
1766
|
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
1765
1767
|
else if (u2) {
|
|
1766
1768
|
a2 = i2[0];
|
|
1767
1769
|
continue;
|
|
1768
1770
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e6}`), a2 = ``;
|
|
1769
|
-
} else !
|
|
1771
|
+
} else !L(a2) && !this.useRawValueToEscape && (a2 = br(a2));
|
|
1770
1772
|
let s3 = t3.safeValue(a2);
|
|
1771
1773
|
if (e6 = e6.replace(i2[0], Zr(s3)), u2 ? (t3.regex.lastIndex += s3.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1772
1774
|
}
|
|
@@ -1776,7 +1778,7 @@ var Qr = class {
|
|
|
1776
1778
|
let r2, i2, a2, o2 = (e7, t3) => {
|
|
1777
1779
|
let n3 = this.nestingOptionsSeparator;
|
|
1778
1780
|
if (!e7.includes(n3)) return e7;
|
|
1779
|
-
let r3 = e7.split(RegExp(`${
|
|
1781
|
+
let r3 = e7.split(RegExp(`${B(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
1780
1782
|
e7 = r3[0], i3 = this.interpolate(i3, a2);
|
|
1781
1783
|
let o3 = i3.match(/'/g), s3 = i3.match(/"/g);
|
|
1782
1784
|
((o3?.length ?? 0) % 2 == 0 && !s3 || (s3?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
@@ -1789,10 +1791,10 @@ var Qr = class {
|
|
|
1789
1791
|
}, s2 = new RegExp(this.nestingRegexp), c2 = ``, l2 = 0;
|
|
1790
1792
|
for (; r2 = s2.exec(e6); ) {
|
|
1791
1793
|
let u2 = [];
|
|
1792
|
-
a2 = { ...n2 }, a2 = a2.replace && !
|
|
1794
|
+
a2 = { ...n2 }, a2 = a2.replace && !L(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1793
1795
|
let d2 = /{.*}/s.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1794
|
-
if (d2 !== -1 && (u2 = r2[1].slice(d2).split(this.formatSeparator).map((e7) => e7.trim()).filter(Boolean), r2[1] = r2[1].slice(0, d2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e6 && !
|
|
1795
|
-
|
|
1796
|
+
if (d2 !== -1 && (u2 = r2[1].slice(d2).split(this.formatSeparator).map((e7) => e7.trim()).filter(Boolean), r2[1] = r2[1].slice(0, d2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e6 && !L(i2)) return i2;
|
|
1797
|
+
L(i2) || (i2 = br(i2)), i2 ||= (this.logger.warn(`missed to resolve ${r2[1]} for nesting ${e6}`), ``), u2.length && (i2 = u2.reduce((e7, t3) => this.format(e7, t3, n2.lng, { ...n2, interpolationkey: r2[1].trim() }), i2.trim())), c2 += e6.slice(l2, r2.index) + br(i2), l2 = s2.lastIndex, this.regexp.lastIndex = 0;
|
|
1796
1798
|
}
|
|
1797
1799
|
return l2 ? c2 + e6.slice(l2) : e6;
|
|
1798
1800
|
}
|
|
@@ -1818,13 +1820,13 @@ var ei = (e6) => {
|
|
|
1818
1820
|
let a2 = i2;
|
|
1819
1821
|
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
1820
1822
|
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
1821
|
-
return s2 || (s2 = e6(
|
|
1823
|
+
return s2 || (s2 = e6(V(r2), i2), t2[o2] = s2), s2(n2);
|
|
1822
1824
|
};
|
|
1823
1825
|
};
|
|
1824
|
-
var ti = (e6) => (t2, n2, r2) => e6(
|
|
1826
|
+
var ti = (e6) => (t2, n2, r2) => e6(V(n2), r2)(t2);
|
|
1825
1827
|
var ni = class {
|
|
1826
1828
|
constructor(e6 = {}) {
|
|
1827
|
-
this.logger =
|
|
1829
|
+
this.logger = H.create(`formatter`), this.options = e6, this.init(e6);
|
|
1828
1830
|
}
|
|
1829
1831
|
init(e6, t2 = { interpolation: {} }) {
|
|
1830
1832
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
@@ -1881,7 +1883,7 @@ var ri = (e6, t2) => {
|
|
|
1881
1883
|
};
|
|
1882
1884
|
var ii = class extends Rr {
|
|
1883
1885
|
constructor(e6, t2, n2, r2 = {}) {
|
|
1884
|
-
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger =
|
|
1886
|
+
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = H.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);
|
|
1885
1887
|
}
|
|
1886
1888
|
queueLoad(e6, t2, n2, r2) {
|
|
1887
1889
|
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
@@ -1933,7 +1935,7 @@ var ii = class extends Rr {
|
|
|
1933
1935
|
}
|
|
1934
1936
|
prepareLoading(e6, t2, n2 = {}, r2) {
|
|
1935
1937
|
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
1936
|
-
|
|
1938
|
+
L(e6) && (e6 = this.languageUtils.toResolveHierarchy(e6)), L(t2) && (t2 = [t2]);
|
|
1937
1939
|
let i2 = this.queueLoad(e6, t2, n2, r2);
|
|
1938
1940
|
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
1939
1941
|
i2.toLoad.forEach((e7) => {
|
|
@@ -1972,7 +1974,7 @@ var ii = class extends Rr {
|
|
|
1972
1974
|
};
|
|
1973
1975
|
var ai = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS: [`translation`], fallbackLng: [`dev`], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: `all`, preload: false, keySeparator: `.`, nsSeparator: `:`, pluralSeparator: `_`, contextSeparator: `_`, enableSelector: false, 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: (e6) => {
|
|
1974
1976
|
let t2 = {};
|
|
1975
|
-
if (typeof e6[1] == `object` && (t2 = e6[1]),
|
|
1977
|
+
if (typeof e6[1] == `object` && (t2 = e6[1]), L(e6[1]) && (t2.defaultValue = e6[1]), L(e6[2]) && (t2.tDescription = e6[2]), typeof e6[2] == `object` || typeof e6[3] == `object`) {
|
|
1976
1978
|
let n2 = e6[3] || e6[2];
|
|
1977
1979
|
Object.keys(n2).forEach((e7) => {
|
|
1978
1980
|
t2[e7] = n2[e7];
|
|
@@ -1980,7 +1982,7 @@ var ai = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
1980
1982
|
}
|
|
1981
1983
|
return t2;
|
|
1982
1984
|
}, interpolation: { escapeValue: true, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1983
|
-
var oi = (e6) => (
|
|
1985
|
+
var oi = (e6) => (L(e6.ns) && (e6.ns = [e6.ns]), L(e6.fallbackLng) && (e6.fallbackLng = [e6.fallbackLng]), L(e6.fallbackNS) && (e6.fallbackNS = [e6.fallbackNS]), e6.supportedLngs && !e6.supportedLngs.includes(`cimode`) && (e6.supportedLngs = e6.supportedLngs.concat([`cimode`])), e6);
|
|
1984
1986
|
var si = () => {
|
|
1985
1987
|
};
|
|
1986
1988
|
var ci = (e6) => {
|
|
@@ -1988,9 +1990,9 @@ var ci = (e6) => {
|
|
|
1988
1990
|
typeof e6[t2] == `function` && (e6[t2] = e6[t2].bind(e6));
|
|
1989
1991
|
});
|
|
1990
1992
|
};
|
|
1991
|
-
var
|
|
1993
|
+
var W = class e4 extends Rr {
|
|
1992
1994
|
constructor(e6 = {}, t2) {
|
|
1993
|
-
if (super(), this.options = oi(e6), this.services = {}, this.logger =
|
|
1995
|
+
if (super(), this.options = oi(e6), this.services = {}, this.logger = H, this.modules = { external: [] }, ci(this), t2 && !this.isInitialized && !e6.isClone) {
|
|
1994
1996
|
if (!this.options.initAsync) return this.init(e6, t2), this;
|
|
1995
1997
|
setTimeout(() => {
|
|
1996
1998
|
this.init(e6, t2);
|
|
@@ -1998,18 +2000,18 @@ var U = class e4 extends Rr {
|
|
|
1998
2000
|
}
|
|
1999
2001
|
}
|
|
2000
2002
|
init(e6 = {}, t2) {
|
|
2001
|
-
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (
|
|
2003
|
+
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (L(e6.ns) ? e6.defaultNS = e6.ns : e6.ns.includes(`translation`) || (e6.defaultNS = e6.ns[0]));
|
|
2002
2004
|
let n2 = ai();
|
|
2003
2005
|
this.options = { ...n2, ...this.options, ...oi(e6) }, this.options.interpolation = { ...n2.interpolation, ...this.options.interpolation }, e6.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e6.keySeparator), e6.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e6.nsSeparator), typeof this.options.overloadTranslationOptionHandler != `function` && (this.options.overloadTranslationOptionHandler = n2.overloadTranslationOptionHandler);
|
|
2004
2006
|
let r2 = (e7) => e7 ? typeof e7 == `function` ? new e7() : e7 : null;
|
|
2005
2007
|
if (!this.options.isClone) {
|
|
2006
|
-
this.modules.logger ?
|
|
2008
|
+
this.modules.logger ? H.init(r2(this.modules.logger), this.options) : H.init(null, this.options);
|
|
2007
2009
|
let e7;
|
|
2008
2010
|
e7 = this.modules.formatter ? this.modules.formatter : ni;
|
|
2009
2011
|
let t3 = new Kr(this.options);
|
|
2010
2012
|
this.store = new Br(this.options.resources, this.options);
|
|
2011
2013
|
let n3 = this.services;
|
|
2012
|
-
n3.logger =
|
|
2014
|
+
n3.logger = H, n3.resourceStore = this.store, n3.languageUtils = t3, n3.pluralResolver = new Yr(t3, { prepend: this.options.pluralSeparator }), e7 && (n3.formatter = r2(e7), n3.formatter.init && n3.formatter.init(n3, this.options), this.options.interpolation.format = n3.formatter.format.bind(n3.formatter)), n3.interpolator = new Qr(this.options), n3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n3.backendConnector = new ii(r2(this.modules.backend), n3.resourceStore, n3, this.options), n3.backendConnector.on(`*`, (e8, ...t4) => {
|
|
2013
2015
|
this.emit(e8, ...t4);
|
|
2014
2016
|
}), this.modules.languageDetector && (n3.languageDetector = r2(this.modules.languageDetector), n3.languageDetector.init && n3.languageDetector.init(n3, this.options.detection, this.options)), this.modules.i18nFormat && (n3.i18nFormat = r2(this.modules.i18nFormat), n3.i18nFormat.init && n3.i18nFormat.init(this)), this.translator = new Gr(this.services, this.options), this.translator.on(`*`, (e8, ...t4) => {
|
|
2015
2017
|
this.emit(e8, ...t4);
|
|
@@ -2026,7 +2028,7 @@ var U = class e4 extends Rr {
|
|
|
2026
2028
|
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e7) => {
|
|
2027
2029
|
this[e7] = (...t3) => (this.store[e7](...t3), this);
|
|
2028
2030
|
});
|
|
2029
|
-
let i2 =
|
|
2031
|
+
let i2 = R(), a2 = () => {
|
|
2030
2032
|
let e7 = (e8, n3) => {
|
|
2031
2033
|
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(e8, n3);
|
|
2032
2034
|
};
|
|
@@ -2036,7 +2038,7 @@ var U = class e4 extends Rr {
|
|
|
2036
2038
|
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
2037
2039
|
}
|
|
2038
2040
|
loadResources(e6, t2 = si) {
|
|
2039
|
-
let n2 = t2, r2 =
|
|
2041
|
+
let n2 = t2, r2 = L(e6) ? e6 : this.language;
|
|
2040
2042
|
if (typeof e6 == `function` && (n2 = e6), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2041
2043
|
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
2042
2044
|
let e7 = [], t3 = (t4) => {
|
|
@@ -2050,7 +2052,7 @@ var U = class e4 extends Rr {
|
|
|
2050
2052
|
} else n2(null);
|
|
2051
2053
|
}
|
|
2052
2054
|
reloadResources(e6, t2, n2) {
|
|
2053
|
-
let r2 =
|
|
2055
|
+
let r2 = R();
|
|
2054
2056
|
return typeof e6 == `function` && (n2 = e6, e6 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e6 ||= this.languages, t2 ||= this.options.ns, n2 ||= si, this.services.backendConnector.reload(e6, t2, (e7) => {
|
|
2055
2057
|
r2.resolve(), n2(e7);
|
|
2056
2058
|
}), r2;
|
|
@@ -2074,7 +2076,7 @@ var U = class e4 extends Rr {
|
|
|
2074
2076
|
}
|
|
2075
2077
|
changeLanguage(e6, t2) {
|
|
2076
2078
|
this.isLanguageChangingTo = e6;
|
|
2077
|
-
let n2 =
|
|
2079
|
+
let n2 = R();
|
|
2078
2080
|
this.emit(`languageChanging`, e6);
|
|
2079
2081
|
let r2 = (e7) => {
|
|
2080
2082
|
this.language = e7, this.languages = this.services.languageUtils.toResolveHierarchy(e7), this.resolvedLanguage = void 0, this.setResolvedLanguage(e7);
|
|
@@ -2082,7 +2084,7 @@ var U = class e4 extends Rr {
|
|
|
2082
2084
|
a3 ? this.isLanguageChangingTo === e6 && (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((...e7) => this.t(...e7)), t2 && t2(i3, (...e7) => this.t(...e7));
|
|
2083
2085
|
}, a2 = (t3) => {
|
|
2084
2086
|
!e6 && !t3 && this.services.languageDetector && (t3 = []);
|
|
2085
|
-
let n3 =
|
|
2087
|
+
let n3 = L(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(L(t3) ? [t3] : t3);
|
|
2086
2088
|
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e7) => {
|
|
2087
2089
|
i2(e7, a3);
|
|
2088
2090
|
});
|
|
@@ -2096,11 +2098,11 @@ var U = class e4 extends Rr {
|
|
|
2096
2098
|
let s2 = o2.ns !== void 0 && o2.ns !== null;
|
|
2097
2099
|
o2.ns = o2.ns || a2.ns, o2.keyPrefix !== `` && (o2.keyPrefix = o2.keyPrefix || n2 || a2.keyPrefix);
|
|
2098
2100
|
let c2 = { ...this.options, ...o2 };
|
|
2099
|
-
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix =
|
|
2101
|
+
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix = U(o2.keyPrefix, c2));
|
|
2100
2102
|
let l2 = this.options.keySeparator || `.`, u2;
|
|
2101
|
-
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 =
|
|
2103
|
+
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 = U(e8, c2)), `${o2.keyPrefix}${l2}${e8}`)) : (typeof e7 == `function` && (e7 = U(e7, c2)), u2 = o2.keyPrefix ? `${o2.keyPrefix}${l2}${e7}` : e7), this.t(u2, o2);
|
|
2102
2104
|
};
|
|
2103
|
-
return
|
|
2105
|
+
return L(e6) ? a2.lng = e6 : a2.lngs = e6, a2.ns = t2, a2.keyPrefix = n2, a2;
|
|
2104
2106
|
}
|
|
2105
2107
|
t(...e6) {
|
|
2106
2108
|
return this.translator?.translate(...e6);
|
|
@@ -2124,19 +2126,21 @@ var U = class e4 extends Rr {
|
|
|
2124
2126
|
let e7 = t2.precheck(this, a2);
|
|
2125
2127
|
if (e7 !== void 0) return e7;
|
|
2126
2128
|
}
|
|
2127
|
-
|
|
2129
|
+
if (this.hasResourceBundle(n2, e6) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
|
|
2130
|
+
let { languageUtils: o2 } = this.services, s2 = t2.lng ? o2.isSupportedCode(n2) && o2.toResolveHierarchy(n2, false)[0] : n2;
|
|
2131
|
+
return !(s2 && !a2(s2, e6) || r2 && !a2(i2, e6));
|
|
2128
2132
|
}
|
|
2129
2133
|
loadNamespaces(e6, t2) {
|
|
2130
|
-
let n2 =
|
|
2131
|
-
return this.options.ns ? (
|
|
2134
|
+
let n2 = R();
|
|
2135
|
+
return this.options.ns ? (L(e6) && (e6 = [e6]), e6.forEach((e7) => {
|
|
2132
2136
|
this.options.ns.includes(e7) || this.options.ns.push(e7);
|
|
2133
2137
|
}), this.loadResources((e7) => {
|
|
2134
2138
|
n2.resolve(), t2 && t2(e7);
|
|
2135
2139
|
}), n2) : (t2 && t2(), Promise.resolve());
|
|
2136
2140
|
}
|
|
2137
2141
|
loadLanguages(e6, t2) {
|
|
2138
|
-
let n2 =
|
|
2139
|
-
|
|
2142
|
+
let n2 = R();
|
|
2143
|
+
L(e6) && (e6 = [e6]);
|
|
2140
2144
|
let r2 = this.options.preload || [], i2 = e6.filter((e7) => !r2.includes(e7) && this.services.languageUtils.isSupportedCode(e7));
|
|
2141
2145
|
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e7) => {
|
|
2142
2146
|
n2.resolve(), t2 && t2(e7);
|
|
@@ -2162,7 +2166,7 @@ var U = class e4 extends Rr {
|
|
|
2162
2166
|
cloneInstance(t2 = {}, n2 = si) {
|
|
2163
2167
|
let r2 = t2.forkResourceStore;
|
|
2164
2168
|
r2 && delete t2.forkResourceStore;
|
|
2165
|
-
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2169
|
+
let i2 = { ...this.options, preload: false, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2166
2170
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e6) => {
|
|
2167
2171
|
a2[e6] = this[e6];
|
|
2168
2172
|
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new Br(Object.keys(this.store.data).reduce((e6, t3) => (e6[t3] = { ...this.store.data[t3] }, e6[t3] = Object.keys(e6[t3]).reduce((n3, r3) => (n3[r3] = { ...e6[t3][r3] }, n3), e6[t3]), e6), {}), i2), a2.services.resourceStore = a2.store), t2.interpolation) {
|
|
@@ -2177,9 +2181,9 @@ var U = class e4 extends Rr {
|
|
|
2177
2181
|
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
|
|
2178
2182
|
}
|
|
2179
2183
|
}.createInstance();
|
|
2180
|
-
|
|
2184
|
+
W.createInstance, W.dir, W.init, W.loadResources, W.reloadResources, W.use, W.changeLanguage, W.getFixedT, W.t, W.exists, W.setDefaultNamespace, W.hasLoadedNamespace, W.loadNamespaces, W.loadLanguages;
|
|
2181
2185
|
var li = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 = false, disableAutoInit: i2 = false, bindI18n: a2 }, { icu: o2 } = {}) => {
|
|
2182
|
-
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 =
|
|
2186
|
+
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 = W.createInstance(i2 ? s2 : void 0);
|
|
2183
2187
|
return o2 && c2.use(o2), t2 && c2.use({ type: `backend`, read: async (e7, n3, r3) => {
|
|
2184
2188
|
try {
|
|
2185
2189
|
return r3(null, await t2(e7));
|
|
@@ -2188,75 +2192,38 @@ var li = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 =
|
|
|
2188
2192
|
}
|
|
2189
2193
|
} }), n2 && (s2.resources = { [e6]: { translation: n2 } }), i2 || c2.init(s2), c2;
|
|
2190
2194
|
};
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
2195
|
-
}
|
|
2196
|
-
function i2() {
|
|
2197
|
-
return !e6 || typeof e6 == `string`;
|
|
2198
|
-
}
|
|
2199
|
-
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
2200
|
-
if (i2()) return {};
|
|
2201
|
-
var o2 = r2(a2.shift());
|
|
2202
|
-
if (ui.indexOf(o2) > -1) return {};
|
|
2203
|
-
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
2204
|
-
}
|
|
2205
|
-
if (i2()) return {};
|
|
2206
|
-
var s2 = r2(a2.shift());
|
|
2207
|
-
return ui.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
2208
|
-
}
|
|
2209
|
-
function fi(e6, t2, n2) {
|
|
2210
|
-
var r2 = di(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
2211
|
-
i2 !== void 0 && (i2[a2] = n2);
|
|
2212
|
-
}
|
|
2213
|
-
function pi(e6, t2) {
|
|
2214
|
-
var n2 = di(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
2215
|
-
if (r2) return r2[i2];
|
|
2195
|
+
function ui(e6, t2) {
|
|
2196
|
+
let n2 = t2 && t2.cache ? t2.cache : bi, r2 = t2 && t2.serializer ? t2.serializer : vi;
|
|
2197
|
+
return (t2 && t2.strategy ? t2.strategy : hi)(e6, { cache: n2, serializer: r2 });
|
|
2216
2198
|
}
|
|
2217
|
-
|
|
2218
|
-
var hi = mi.forEach;
|
|
2219
|
-
var gi = mi.slice;
|
|
2220
|
-
function _i(e6) {
|
|
2221
|
-
return hi.call(gi.call(arguments, 1), function(t2) {
|
|
2222
|
-
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
2223
|
-
var i2 = r2[n2];
|
|
2224
|
-
ui.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
2225
|
-
}
|
|
2226
|
-
}), e6;
|
|
2227
|
-
}
|
|
2228
|
-
function vi(e6, t2) {
|
|
2229
|
-
let n2 = t2 && t2.cache ? t2.cache : Oi, r2 = t2 && t2.serializer ? t2.serializer : Ei;
|
|
2230
|
-
return (t2 && t2.strategy ? t2.strategy : Ci)(e6, { cache: n2, serializer: r2 });
|
|
2231
|
-
}
|
|
2232
|
-
function yi(e6) {
|
|
2199
|
+
function di(e6) {
|
|
2233
2200
|
return e6 == null || typeof e6 == `number` || typeof e6 == `boolean`;
|
|
2234
2201
|
}
|
|
2235
|
-
function
|
|
2236
|
-
let i2 =
|
|
2202
|
+
function fi(e6, t2, n2, r2) {
|
|
2203
|
+
let i2 = di(r2) ? r2 : n2(r2), a2 = t2.get(i2);
|
|
2237
2204
|
return a2 === void 0 && (a2 = e6.call(this, r2), t2.set(i2, a2)), a2;
|
|
2238
2205
|
}
|
|
2239
|
-
function
|
|
2206
|
+
function pi(e6, t2, n2) {
|
|
2240
2207
|
let r2 = Array.prototype.slice.call(arguments, 3), i2 = n2(r2), a2 = t2.get(i2);
|
|
2241
2208
|
return a2 === void 0 && (a2 = e6.apply(this, r2), t2.set(i2, a2)), a2;
|
|
2242
2209
|
}
|
|
2243
|
-
function
|
|
2210
|
+
function mi(e6, t2, n2, r2, i2) {
|
|
2244
2211
|
return n2.bind(t2, e6, r2, i2);
|
|
2245
2212
|
}
|
|
2246
|
-
function
|
|
2247
|
-
let n2 = e6.length === 1 ?
|
|
2248
|
-
return
|
|
2213
|
+
function hi(e6, t2) {
|
|
2214
|
+
let n2 = e6.length === 1 ? fi : pi;
|
|
2215
|
+
return mi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2249
2216
|
}
|
|
2250
|
-
function
|
|
2251
|
-
return
|
|
2217
|
+
function gi(e6, t2) {
|
|
2218
|
+
return mi(e6, this, pi, t2.cache.create(), t2.serializer);
|
|
2252
2219
|
}
|
|
2253
|
-
function
|
|
2254
|
-
return
|
|
2220
|
+
function _i(e6, t2) {
|
|
2221
|
+
return mi(e6, this, fi, t2.cache.create(), t2.serializer);
|
|
2255
2222
|
}
|
|
2256
|
-
var
|
|
2223
|
+
var vi = function() {
|
|
2257
2224
|
return JSON.stringify(arguments);
|
|
2258
2225
|
};
|
|
2259
|
-
var
|
|
2226
|
+
var yi = class {
|
|
2260
2227
|
constructor() {
|
|
2261
2228
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2262
2229
|
}
|
|
@@ -2267,14 +2234,14 @@ var Di = class {
|
|
|
2267
2234
|
this.cache[e6] = t2;
|
|
2268
2235
|
}
|
|
2269
2236
|
};
|
|
2270
|
-
var
|
|
2271
|
-
return new
|
|
2237
|
+
var bi = { create: function() {
|
|
2238
|
+
return new yi();
|
|
2272
2239
|
} };
|
|
2273
|
-
var
|
|
2274
|
-
var
|
|
2275
|
-
function
|
|
2240
|
+
var xi = { variadic: gi, monadic: _i };
|
|
2241
|
+
var Si = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
2242
|
+
function Ci(e6) {
|
|
2276
2243
|
let t2 = {};
|
|
2277
|
-
return e6.replace(
|
|
2244
|
+
return e6.replace(Si, (e7) => {
|
|
2278
2245
|
let n2 = e7.length;
|
|
2279
2246
|
switch (e7[0]) {
|
|
2280
2247
|
case `G`:
|
|
@@ -2361,10 +2328,10 @@ function ji(e6) {
|
|
|
2361
2328
|
return ``;
|
|
2362
2329
|
}), t2;
|
|
2363
2330
|
}
|
|
2364
|
-
var
|
|
2365
|
-
function
|
|
2331
|
+
var wi = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
2332
|
+
function Ti(e6) {
|
|
2366
2333
|
if (e6.length === 0) throw Error(`Number skeleton cannot be empty`);
|
|
2367
|
-
let t2 = e6.split(
|
|
2334
|
+
let t2 = e6.split(wi).filter((e7) => e7.length > 0), n2 = [];
|
|
2368
2335
|
for (let e7 of t2) {
|
|
2369
2336
|
let t3 = e7.split(`/`);
|
|
2370
2337
|
if (t3.length === 0) throw Error(`Invalid number skeleton`);
|
|
@@ -2374,20 +2341,20 @@ function Ni(e6) {
|
|
|
2374
2341
|
}
|
|
2375
2342
|
return n2;
|
|
2376
2343
|
}
|
|
2377
|
-
function
|
|
2344
|
+
function Ei(e6) {
|
|
2378
2345
|
return e6.replace(/^(.*?)-/, ``);
|
|
2379
2346
|
}
|
|
2380
|
-
var
|
|
2381
|
-
var
|
|
2382
|
-
var
|
|
2383
|
-
var
|
|
2384
|
-
function
|
|
2347
|
+
var Di = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
2348
|
+
var Oi = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
2349
|
+
var ki = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
2350
|
+
var Ai = /^(0+)$/;
|
|
2351
|
+
function ji(e6) {
|
|
2385
2352
|
let t2 = {};
|
|
2386
|
-
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(
|
|
2353
|
+
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(Oi, function(e7, n2, r2) {
|
|
2387
2354
|
return typeof r2 == `string` ? r2 === `+` ? t2.minimumSignificantDigits = n2.length : n2[0] === `#` ? t2.maximumSignificantDigits = n2.length : (t2.minimumSignificantDigits = n2.length, t2.maximumSignificantDigits = n2.length + (typeof r2 == `string` ? r2.length : 0)) : (t2.minimumSignificantDigits = n2.length, t2.maximumSignificantDigits = n2.length), ``;
|
|
2388
2355
|
}), t2;
|
|
2389
2356
|
}
|
|
2390
|
-
function
|
|
2357
|
+
function Mi(e6) {
|
|
2391
2358
|
switch (e6) {
|
|
2392
2359
|
case `sign-auto`:
|
|
2393
2360
|
return { signDisplay: `auto` };
|
|
@@ -2411,19 +2378,19 @@ function Bi(e6) {
|
|
|
2411
2378
|
return { signDisplay: `never` };
|
|
2412
2379
|
}
|
|
2413
2380
|
}
|
|
2414
|
-
function
|
|
2381
|
+
function Ni(e6) {
|
|
2415
2382
|
let t2;
|
|
2416
2383
|
if (e6[0] === `E` && e6[1] === `E` ? (t2 = { notation: `engineering` }, e6 = e6.slice(2)) : e6[0] === `E` && (t2 = { notation: `scientific` }, e6 = e6.slice(1)), t2) {
|
|
2417
2384
|
let n2 = e6.slice(0, 2);
|
|
2418
|
-
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !
|
|
2385
|
+
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !Ai.test(e6)) throw Error(`Malformed concise eng/scientific notation`);
|
|
2419
2386
|
t2.minimumIntegerDigits = e6.length;
|
|
2420
2387
|
}
|
|
2421
2388
|
return t2;
|
|
2422
2389
|
}
|
|
2423
|
-
function
|
|
2424
|
-
return
|
|
2390
|
+
function Pi(e6) {
|
|
2391
|
+
return Mi(e6) || {};
|
|
2425
2392
|
}
|
|
2426
|
-
function
|
|
2393
|
+
function Fi(e6) {
|
|
2427
2394
|
let t2 = {};
|
|
2428
2395
|
for (let n2 of e6) {
|
|
2429
2396
|
switch (n2.stem) {
|
|
@@ -2447,7 +2414,7 @@ function Ui(e6) {
|
|
|
2447
2414
|
continue;
|
|
2448
2415
|
case `measure-unit`:
|
|
2449
2416
|
case `unit`:
|
|
2450
|
-
t2.style = `unit`, t2.unit =
|
|
2417
|
+
t2.style = `unit`, t2.unit = Ei(n2.options[0]);
|
|
2451
2418
|
continue;
|
|
2452
2419
|
case `compact-short`:
|
|
2453
2420
|
case `K`:
|
|
@@ -2458,10 +2425,10 @@ function Ui(e6) {
|
|
|
2458
2425
|
t2.notation = `compact`, t2.compactDisplay = `long`;
|
|
2459
2426
|
continue;
|
|
2460
2427
|
case `scientific`:
|
|
2461
|
-
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2428
|
+
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...Pi(t3) }), {}) };
|
|
2462
2429
|
continue;
|
|
2463
2430
|
case `engineering`:
|
|
2464
|
-
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2431
|
+
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...Pi(t3) }), {}) };
|
|
2465
2432
|
continue;
|
|
2466
2433
|
case `notation-simple`:
|
|
2467
2434
|
t2.notation = `standard`;
|
|
@@ -2504,7 +2471,7 @@ function Ui(e6) {
|
|
|
2504
2471
|
continue;
|
|
2505
2472
|
case `integer-width`:
|
|
2506
2473
|
if (n2.options.length > 1) throw RangeError(`integer-width stems only accept a single optional option`);
|
|
2507
|
-
n2.options[0].replace(
|
|
2474
|
+
n2.options[0].replace(ki, function(e8, n3, r3, i2, a2, o2) {
|
|
2508
2475
|
if (n3) t2.minimumIntegerDigits = r3.length;
|
|
2509
2476
|
else if (i2 && a2) throw Error(`We currently do not support maximum integer digits`);
|
|
2510
2477
|
else if (o2) throw Error(`We currently do not support exact integer digits`);
|
|
@@ -2512,83 +2479,83 @@ function Ui(e6) {
|
|
|
2512
2479
|
});
|
|
2513
2480
|
continue;
|
|
2514
2481
|
}
|
|
2515
|
-
if (
|
|
2482
|
+
if (Ai.test(n2.stem)) {
|
|
2516
2483
|
t2.minimumIntegerDigits = n2.stem.length;
|
|
2517
2484
|
continue;
|
|
2518
2485
|
}
|
|
2519
|
-
if (
|
|
2486
|
+
if (Di.test(n2.stem)) {
|
|
2520
2487
|
if (n2.options.length > 1) throw RangeError(`Fraction-precision stems only accept a single optional option`);
|
|
2521
|
-
n2.stem.replace(
|
|
2488
|
+
n2.stem.replace(Di, function(e9, n3, r3, i2, a2, o2) {
|
|
2522
2489
|
return r3 === `*` ? t2.minimumFractionDigits = n3.length : i2 && i2[0] === `#` ? t2.maximumFractionDigits = i2.length : a2 && o2 ? (t2.minimumFractionDigits = a2.length, t2.maximumFractionDigits = a2.length + o2.length) : (t2.minimumFractionDigits = n3.length, t2.maximumFractionDigits = n3.length), ``;
|
|
2523
2490
|
});
|
|
2524
2491
|
let e8 = n2.options[0];
|
|
2525
|
-
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...
|
|
2492
|
+
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...ji(e8) });
|
|
2526
2493
|
continue;
|
|
2527
2494
|
}
|
|
2528
|
-
if (
|
|
2529
|
-
t2 = { ...t2, ...
|
|
2495
|
+
if (Oi.test(n2.stem)) {
|
|
2496
|
+
t2 = { ...t2, ...ji(n2.stem) };
|
|
2530
2497
|
continue;
|
|
2531
2498
|
}
|
|
2532
|
-
let e7 =
|
|
2499
|
+
let e7 = Mi(n2.stem);
|
|
2533
2500
|
e7 && (t2 = { ...t2, ...e7 });
|
|
2534
|
-
let r2 =
|
|
2501
|
+
let r2 = Ni(n2.stem);
|
|
2535
2502
|
r2 && (t2 = { ...t2, ...r2 });
|
|
2536
2503
|
}
|
|
2537
2504
|
return t2;
|
|
2538
2505
|
}
|
|
2539
|
-
var
|
|
2506
|
+
var Ii = function(e6) {
|
|
2540
2507
|
return e6[e6.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = `EXPECT_ARGUMENT_CLOSING_BRACE`, e6[e6.EMPTY_ARGUMENT = 2] = `EMPTY_ARGUMENT`, e6[e6.MALFORMED_ARGUMENT = 3] = `MALFORMED_ARGUMENT`, e6[e6.EXPECT_ARGUMENT_TYPE = 4] = `EXPECT_ARGUMENT_TYPE`, e6[e6.INVALID_ARGUMENT_TYPE = 5] = `INVALID_ARGUMENT_TYPE`, e6[e6.EXPECT_ARGUMENT_STYLE = 6] = `EXPECT_ARGUMENT_STYLE`, e6[e6.INVALID_NUMBER_SKELETON = 7] = `INVALID_NUMBER_SKELETON`, e6[e6.INVALID_DATE_TIME_SKELETON = 8] = `INVALID_DATE_TIME_SKELETON`, e6[e6.EXPECT_NUMBER_SKELETON = 9] = `EXPECT_NUMBER_SKELETON`, e6[e6.EXPECT_DATE_TIME_SKELETON = 10] = `EXPECT_DATE_TIME_SKELETON`, e6[e6.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = `UNCLOSED_QUOTE_IN_ARGUMENT_STYLE`, e6[e6.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = `EXPECT_SELECT_ARGUMENT_OPTIONS`, e6[e6.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = `EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE`, e6[e6.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = `INVALID_PLURAL_ARGUMENT_OFFSET_VALUE`, e6[e6.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = `EXPECT_SELECT_ARGUMENT_SELECTOR`, e6[e6.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = `EXPECT_PLURAL_ARGUMENT_SELECTOR`, e6[e6.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = `EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT`, e6[e6.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = `EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT`, e6[e6.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = `INVALID_PLURAL_ARGUMENT_SELECTOR`, e6[e6.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = `DUPLICATE_PLURAL_ARGUMENT_SELECTOR`, e6[e6.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = `DUPLICATE_SELECT_ARGUMENT_SELECTOR`, e6[e6.MISSING_OTHER_CLAUSE = 22] = `MISSING_OTHER_CLAUSE`, e6[e6.INVALID_TAG = 23] = `INVALID_TAG`, e6[e6.INVALID_TAG_NAME = 25] = `INVALID_TAG_NAME`, e6[e6.UNMATCHED_CLOSING_TAG = 26] = `UNMATCHED_CLOSING_TAG`, e6[e6.UNCLOSED_TAG = 27] = `UNCLOSED_TAG`, e6;
|
|
2541
2508
|
}({});
|
|
2542
|
-
function
|
|
2509
|
+
function Li(e6) {
|
|
2543
2510
|
return e6.type === 0;
|
|
2544
2511
|
}
|
|
2545
|
-
function
|
|
2512
|
+
function Ri(e6) {
|
|
2546
2513
|
return e6.type === 1;
|
|
2547
2514
|
}
|
|
2548
|
-
function
|
|
2515
|
+
function zi(e6) {
|
|
2549
2516
|
return e6.type === 2;
|
|
2550
2517
|
}
|
|
2551
|
-
function
|
|
2518
|
+
function Bi(e6) {
|
|
2552
2519
|
return e6.type === 3;
|
|
2553
2520
|
}
|
|
2554
|
-
function
|
|
2521
|
+
function Vi(e6) {
|
|
2555
2522
|
return e6.type === 4;
|
|
2556
2523
|
}
|
|
2557
|
-
function
|
|
2524
|
+
function Hi(e6) {
|
|
2558
2525
|
return e6.type === 5;
|
|
2559
2526
|
}
|
|
2560
|
-
function
|
|
2527
|
+
function Ui(e6) {
|
|
2561
2528
|
return e6.type === 6;
|
|
2562
2529
|
}
|
|
2563
|
-
function
|
|
2530
|
+
function Wi(e6) {
|
|
2564
2531
|
return e6.type === 7;
|
|
2565
2532
|
}
|
|
2566
|
-
function
|
|
2533
|
+
function Gi(e6) {
|
|
2567
2534
|
return e6.type === 8;
|
|
2568
2535
|
}
|
|
2569
|
-
function
|
|
2536
|
+
function Ki(e6) {
|
|
2570
2537
|
return !!(e6 && typeof e6 == `object` && e6.type === 0);
|
|
2571
2538
|
}
|
|
2572
|
-
function
|
|
2539
|
+
function qi(e6) {
|
|
2573
2540
|
return !!(e6 && typeof e6 == `object` && e6.type === 1);
|
|
2574
2541
|
}
|
|
2575
|
-
var
|
|
2576
|
-
var
|
|
2577
|
-
function
|
|
2542
|
+
var Ji = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
2543
|
+
var G = { "001": [`H`, `h`], 419: [`h`, `H`, `hB`, `hb`], AC: [`H`, `h`, `hb`, `hB`], AD: [`H`, `hB`], AE: [`h`, `hB`, `hb`, `H`], AF: [`H`, `hb`, `hB`, `h`], AG: [`h`, `hb`, `H`, `hB`], AI: [`H`, `h`, `hb`, `hB`], AL: [`h`, `H`, `hB`], AM: [`H`, `hB`], AO: [`H`, `hB`], AR: [`h`, `H`, `hB`, `hb`], AS: [`h`, `H`], AT: [`H`, `hB`], AU: [`h`, `hb`, `H`, `hB`], AW: [`H`, `hB`], AX: [`H`], AZ: [`H`, `hB`, `h`], BA: [`H`, `hB`, `h`], BB: [`h`, `hb`, `H`, `hB`], BD: [`h`, `hB`, `H`], BE: [`H`, `hB`], BF: [`H`, `hB`], BG: [`H`, `hB`, `h`], BH: [`h`, `hB`, `hb`, `H`], BI: [`H`, `h`], BJ: [`H`, `hB`], BL: [`H`, `hB`], BM: [`h`, `hb`, `H`, `hB`], BN: [`hb`, `hB`, `h`, `H`], BO: [`h`, `H`, `hB`, `hb`], BQ: [`H`], BR: [`H`, `hB`], BS: [`h`, `hb`, `H`, `hB`], BT: [`h`, `H`], BW: [`H`, `h`, `hb`, `hB`], BY: [`H`, `h`], BZ: [`H`, `h`, `hb`, `hB`], CA: [`h`, `hb`, `H`, `hB`], CC: [`H`, `h`, `hb`, `hB`], CD: [`hB`, `H`], CF: [`H`, `h`, `hB`], CG: [`H`, `hB`], CH: [`H`, `hB`, `h`], CI: [`H`, `hB`], CK: [`H`, `h`, `hb`, `hB`], CL: [`h`, `H`, `hB`, `hb`], CM: [`H`, `h`, `hB`], CN: [`H`, `hB`, `hb`, `h`], CO: [`h`, `H`, `hB`, `hb`], CP: [`H`], CR: [`h`, `H`, `hB`, `hb`], CU: [`h`, `H`, `hB`, `hb`], CV: [`H`, `hB`], CW: [`H`, `hB`], CX: [`H`, `h`, `hb`, `hB`], CY: [`h`, `H`, `hb`, `hB`], CZ: [`H`], DE: [`H`, `hB`], DG: [`H`, `h`, `hb`, `hB`], DJ: [`h`, `H`], DK: [`H`], DM: [`h`, `hb`, `H`, `hB`], DO: [`h`, `H`, `hB`, `hb`], DZ: [`h`, `hB`, `hb`, `H`], EA: [`H`, `h`, `hB`, `hb`], EC: [`h`, `H`, `hB`, `hb`], EE: [`H`, `hB`], EG: [`h`, `hB`, `hb`, `H`], EH: [`h`, `hB`, `hb`, `H`], ER: [`h`, `H`], ES: [`H`, `hB`, `h`, `hb`], ET: [`hB`, `hb`, `h`, `H`], FI: [`H`], FJ: [`h`, `hb`, `H`, `hB`], FK: [`H`, `h`, `hb`, `hB`], FM: [`h`, `hb`, `H`, `hB`], FO: [`H`, `h`], FR: [`H`, `hB`], GA: [`H`, `hB`], GB: [`H`, `h`, `hb`, `hB`], GD: [`h`, `hb`, `H`, `hB`], GE: [`H`, `hB`, `h`], GF: [`H`, `hB`], GG: [`H`, `h`, `hb`, `hB`], GH: [`h`, `H`], GI: [`H`, `h`, `hb`, `hB`], GL: [`H`, `h`], GM: [`h`, `hb`, `H`, `hB`], GN: [`H`, `hB`], GP: [`H`, `hB`], GQ: [`H`, `hB`, `h`, `hb`], GR: [`h`, `H`, `hb`, `hB`], GS: [`H`, `h`, `hb`, `hB`], GT: [`h`, `H`, `hB`, `hb`], GU: [`h`, `hb`, `H`, `hB`], GW: [`H`, `hB`], GY: [`h`, `hb`, `H`, `hB`], HK: [`h`, `hB`, `hb`, `H`], HN: [`h`, `H`, `hB`, `hb`], HR: [`H`, `hB`], HU: [`H`, `h`], IC: [`H`, `h`, `hB`, `hb`], ID: [`H`], IE: [`H`, `h`, `hb`, `hB`], IL: [`H`, `hB`], IM: [`H`, `h`, `hb`, `hB`], IN: [`h`, `H`], IO: [`H`, `h`, `hb`, `hB`], IQ: [`h`, `hB`, `hb`, `H`], IR: [`hB`, `H`], IS: [`H`], IT: [`H`, `hB`], JE: [`H`, `h`, `hb`, `hB`], JM: [`h`, `hb`, `H`, `hB`], JO: [`h`, `hB`, `hb`, `H`], JP: [`H`, `K`, `h`], KE: [`hB`, `hb`, `H`, `h`], KG: [`H`, `h`, `hB`, `hb`], KH: [`hB`, `h`, `H`, `hb`], KI: [`h`, `hb`, `H`, `hB`], KM: [`H`, `h`, `hB`, `hb`], KN: [`h`, `hb`, `H`, `hB`], KP: [`h`, `H`, `hB`, `hb`], KR: [`h`, `H`, `hB`, `hb`], KW: [`h`, `hB`, `hb`, `H`], KY: [`h`, `hb`, `H`, `hB`], KZ: [`H`, `hB`], LA: [`H`, `hb`, `hB`, `h`], LB: [`h`, `hB`, `hb`, `H`], LC: [`h`, `hb`, `H`, `hB`], LI: [`H`, `hB`, `h`], LK: [`H`, `h`, `hB`, `hb`], LR: [`h`, `hb`, `H`, `hB`], LS: [`h`, `H`], LT: [`H`, `h`, `hb`, `hB`], LU: [`H`, `h`, `hB`], LV: [`H`, `hB`, `hb`, `h`], LY: [`h`, `hB`, `hb`, `H`], MA: [`H`, `h`, `hB`, `hb`], MC: [`H`, `hB`], MD: [`H`, `hB`], ME: [`H`, `hB`, `h`], MF: [`H`, `hB`], MG: [`H`, `h`], MH: [`h`, `hb`, `H`, `hB`], MK: [`H`, `h`, `hb`, `hB`], ML: [`H`], MM: [`hB`, `hb`, `H`, `h`], MN: [`H`, `h`, `hb`, `hB`], MO: [`h`, `hB`, `hb`, `H`], MP: [`h`, `hb`, `H`, `hB`], MQ: [`H`, `hB`], MR: [`h`, `hB`, `hb`, `H`], MS: [`H`, `h`, `hb`, `hB`], MT: [`H`, `h`], MU: [`H`, `h`], MV: [`H`, `h`], MW: [`h`, `hb`, `H`, `hB`], MX: [`h`, `H`, `hB`, `hb`], MY: [`hb`, `hB`, `h`, `H`], MZ: [`H`, `hB`], NA: [`h`, `H`, `hB`, `hb`], NC: [`H`, `hB`], NE: [`H`], NF: [`H`, `h`, `hb`, `hB`], NG: [`H`, `h`, `hb`, `hB`], NI: [`h`, `H`, `hB`, `hb`], NL: [`H`, `hB`], NO: [`H`, `h`], NP: [`H`, `h`, `hB`], NR: [`H`, `h`, `hb`, `hB`], NU: [`H`, `h`, `hb`, `hB`], NZ: [`h`, `hb`, `H`, `hB`], OM: [`h`, `hB`, `hb`, `H`], PA: [`h`, `H`, `hB`, `hb`], PE: [`h`, `H`, `hB`, `hb`], PF: [`H`, `h`, `hB`], PG: [`h`, `H`], PH: [`h`, `hB`, `hb`, `H`], PK: [`h`, `hB`, `H`], PL: [`H`, `h`], PM: [`H`, `hB`], PN: [`H`, `h`, `hb`, `hB`], PR: [`h`, `H`, `hB`, `hb`], PS: [`h`, `hB`, `hb`, `H`], PT: [`H`, `hB`], PW: [`h`, `H`], PY: [`h`, `H`, `hB`, `hb`], QA: [`h`, `hB`, `hb`, `H`], RE: [`H`, `hB`], RO: [`H`, `hB`], RS: [`H`, `hB`, `h`], RU: [`H`], RW: [`H`, `h`], SA: [`h`, `hB`, `hb`, `H`], SB: [`h`, `hb`, `H`, `hB`], SC: [`H`, `h`, `hB`], SD: [`h`, `hB`, `hb`, `H`], SE: [`H`], SG: [`h`, `hb`, `H`, `hB`], SH: [`H`, `h`, `hb`, `hB`], SI: [`H`, `hB`], SJ: [`H`], SK: [`H`], SL: [`h`, `hb`, `H`, `hB`], SM: [`H`, `h`, `hB`], SN: [`H`, `h`, `hB`], SO: [`h`, `H`], SR: [`H`, `hB`], SS: [`h`, `hb`, `H`, `hB`], ST: [`H`, `hB`], SV: [`h`, `H`, `hB`, `hb`], SX: [`H`, `h`, `hb`, `hB`], SY: [`h`, `hB`, `hb`, `H`], SZ: [`h`, `hb`, `H`, `hB`], TA: [`H`, `h`, `hb`, `hB`], TC: [`h`, `hb`, `H`, `hB`], TD: [`h`, `H`, `hB`], TF: [`H`, `h`, `hB`], TG: [`H`, `hB`], TH: [`H`, `h`], TJ: [`H`, `h`], TL: [`H`, `hB`, `hb`, `h`], TM: [`H`, `h`], TN: [`h`, `hB`, `hb`, `H`], TO: [`h`, `H`], TR: [`H`, `hB`], TT: [`h`, `hb`, `H`, `hB`], TW: [`hB`, `hb`, `h`, `H`], TZ: [`hB`, `hb`, `H`, `h`], UA: [`H`, `hB`, `h`], UG: [`hB`, `hb`, `H`, `h`], UM: [`h`, `hb`, `H`, `hB`], US: [`h`, `hb`, `H`, `hB`], UY: [`h`, `H`, `hB`, `hb`], UZ: [`H`, `hB`, `h`], VA: [`H`, `h`, `hB`], VC: [`h`, `hb`, `H`, `hB`], VE: [`h`, `H`, `hB`, `hb`], VG: [`h`, `hb`, `H`, `hB`], VI: [`h`, `hb`, `H`, `hB`], VN: [`H`, `h`], VU: [`h`, `H`], WF: [`H`, `hB`], WS: [`h`, `H`], XK: [`H`, `hB`, `h`], YE: [`h`, `hB`, `hb`, `H`], YT: [`H`, `hB`], ZA: [`H`, `h`, `hb`, `hB`], ZM: [`h`, `hb`, `H`, `hB`], ZW: [`H`, `h`], "af-ZA": [`H`, `h`, `hB`, `hb`], "ar-001": [`h`, `hB`, `hb`, `H`], "ca-ES": [`H`, `h`, `hB`], "en-001": [`h`, `hb`, `H`, `hB`], "en-HK": [`h`, `hb`, `H`, `hB`], "en-IL": [`H`, `h`, `hb`, `hB`], "en-MY": [`h`, `hb`, `H`, `hB`], "es-BR": [`H`, `h`, `hB`, `hb`], "es-ES": [`H`, `h`, `hB`, `hb`], "es-GQ": [`H`, `h`, `hB`, `hb`], "fr-CA": [`H`, `h`, `hB`], "gl-ES": [`H`, `h`, `hB`], "gu-IN": [`hB`, `hb`, `h`, `H`], "hi-IN": [`hB`, `h`, `H`], "it-CH": [`H`, `h`, `hB`], "it-IT": [`H`, `h`, `hB`], "kn-IN": [`hB`, `h`, `H`], "ku-SY": [`H`, `hB`], "ml-IN": [`hB`, `h`, `H`], "mr-IN": [`hB`, `hb`, `h`, `H`], "pa-IN": [`hB`, `hb`, `h`, `H`], "ta-IN": [`hB`, `h`, `hb`, `H`], "te-IN": [`hB`, `h`, `H`], "zu-ZA": [`H`, `hB`, `hb`, `h`] };
|
|
2544
|
+
function Yi(e6, t2) {
|
|
2578
2545
|
let n2 = ``;
|
|
2579
2546
|
for (let r2 = 0; r2 < e6.length; r2++) {
|
|
2580
2547
|
let i2 = e6.charAt(r2);
|
|
2581
2548
|
if (i2 === `j`) {
|
|
2582
2549
|
let a2 = 0;
|
|
2583
2550
|
for (; r2 + 1 < e6.length && e6.charAt(r2 + 1) === i2; ) a2++, r2++;
|
|
2584
|
-
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 =
|
|
2551
|
+
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 = Xi(t2);
|
|
2585
2552
|
for ((c2 == `H` || c2 == `k`) && (s2 = 0); s2-- > 0; ) n2 += `a`;
|
|
2586
2553
|
for (; o2-- > 0; ) n2 = c2 + n2;
|
|
2587
2554
|
} else n2 += i2 === `J` ? `H` : i2;
|
|
2588
2555
|
}
|
|
2589
2556
|
return n2;
|
|
2590
2557
|
}
|
|
2591
|
-
function
|
|
2558
|
+
function Xi(e6) {
|
|
2592
2559
|
let t2 = e6.hourCycle;
|
|
2593
2560
|
if (t2 === void 0) {
|
|
2594
2561
|
let n3 = e6;
|
|
@@ -2607,36 +2574,36 @@ function ia(e6) {
|
|
|
2607
2574
|
throw Error(`Invalid hourCycle`);
|
|
2608
2575
|
}
|
|
2609
2576
|
let n2 = e6.language, r2;
|
|
2610
|
-
return n2 !== `root` && (r2 = e6.maximize().region), (
|
|
2577
|
+
return n2 !== `root` && (r2 = e6.maximize().region), (G[`${n2}-${r2}`] || G[r2 || ``] || G[n2 || ``] || G[`${n2}-001`] || G[`001`])[0].charAt(0);
|
|
2611
2578
|
}
|
|
2612
|
-
var
|
|
2613
|
-
var
|
|
2614
|
-
function
|
|
2579
|
+
var Zi = RegExp(`^${Ji.source}*`);
|
|
2580
|
+
var Qi = RegExp(`${Ji.source}*$`);
|
|
2581
|
+
function K(e6, t2) {
|
|
2615
2582
|
return { start: e6, end: t2 };
|
|
2616
2583
|
}
|
|
2617
|
-
var
|
|
2618
|
-
var
|
|
2619
|
-
var
|
|
2620
|
-
var
|
|
2584
|
+
var $i = !!Object.fromEntries;
|
|
2585
|
+
var ea = !!String.prototype.trimStart;
|
|
2586
|
+
var ta = !!String.prototype.trimEnd;
|
|
2587
|
+
var na = $i ? Object.fromEntries : function(e6) {
|
|
2621
2588
|
let t2 = {};
|
|
2622
2589
|
for (let [n2, r2] of e6) t2[n2] = r2;
|
|
2623
2590
|
return t2;
|
|
2624
2591
|
};
|
|
2625
|
-
var
|
|
2592
|
+
var ra = ea ? function(e6) {
|
|
2626
2593
|
return e6.trimStart();
|
|
2627
2594
|
} : function(e6) {
|
|
2628
|
-
return e6.replace(
|
|
2595
|
+
return e6.replace(Zi, ``);
|
|
2629
2596
|
};
|
|
2630
|
-
var
|
|
2597
|
+
var ia = ta ? function(e6) {
|
|
2631
2598
|
return e6.trimEnd();
|
|
2632
2599
|
} : function(e6) {
|
|
2633
|
-
return e6.replace(
|
|
2600
|
+
return e6.replace(Qi, ``);
|
|
2634
2601
|
};
|
|
2635
|
-
var
|
|
2636
|
-
function
|
|
2637
|
-
return
|
|
2602
|
+
var aa = RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
|
|
2603
|
+
function oa(e6, t2) {
|
|
2604
|
+
return aa.lastIndex = t2, aa.exec(e6)[1] ?? ``;
|
|
2638
2605
|
}
|
|
2639
|
-
function
|
|
2606
|
+
function sa(e6) {
|
|
2640
2607
|
if (e6.length === 0) return null;
|
|
2641
2608
|
let t2 = 1, n2 = 1;
|
|
2642
2609
|
for (let r2 = 0; r2 < e6.length; ) {
|
|
@@ -2657,7 +2624,7 @@ function ha(e6) {
|
|
|
2657
2624
|
}
|
|
2658
2625
|
return { offset: e6.length, line: t2, column: n2 };
|
|
2659
2626
|
}
|
|
2660
|
-
var
|
|
2627
|
+
var ca = class {
|
|
2661
2628
|
constructor(e6, t2 = {}) {
|
|
2662
2629
|
this.message = e6, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!t2.ignoreTag, this.locale = t2.locale, this.requiresOtherClause = !!t2.requiresOtherClause, this.shouldParseSkeletons = !!t2.shouldParseSkeletons;
|
|
2663
2630
|
}
|
|
@@ -2666,10 +2633,10 @@ var ga = class {
|
|
|
2666
2633
|
if (this.message.length > 0) {
|
|
2667
2634
|
let e6 = this.message.charCodeAt(0);
|
|
2668
2635
|
if (e6 !== 35 && e6 !== 39 && e6 !== 60 && e6 !== 123 && e6 !== 125) {
|
|
2669
|
-
let e7 =
|
|
2636
|
+
let e7 = sa(this.message);
|
|
2670
2637
|
if (e7) {
|
|
2671
2638
|
let t2 = this.clonePosition();
|
|
2672
|
-
return this.position = e7, { val: [{ type: 0, value: this.message, location:
|
|
2639
|
+
return this.position = e7, { val: [{ type: 0, value: this.message, location: K(t2, this.clonePosition()) }], err: null };
|
|
2673
2640
|
}
|
|
2674
2641
|
}
|
|
2675
2642
|
}
|
|
@@ -2686,11 +2653,11 @@ var ga = class {
|
|
|
2686
2653
|
} else if (i2 === 125 && e6 > 0) break;
|
|
2687
2654
|
else if (i2 === 35 && (t2 === `plural` || t2 === `selectordinal`)) {
|
|
2688
2655
|
let e7 = this.clonePosition();
|
|
2689
|
-
this.bump(), r2.push({ type: 7, location:
|
|
2656
|
+
this.bump(), r2.push({ type: 7, location: K(e7, this.clonePosition()) });
|
|
2690
2657
|
} else if (i2 === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2691
2658
|
if (n2) break;
|
|
2692
|
-
return this.error(26,
|
|
2693
|
-
} else if (i2 === 60 && !this.ignoreTag &&
|
|
2659
|
+
return this.error(26, K(this.clonePosition(), this.clonePosition()));
|
|
2660
|
+
} else if (i2 === 60 && !this.ignoreTag && la(this.peek() || 0)) {
|
|
2694
2661
|
let n3 = this.parseTag(e6, t2);
|
|
2695
2662
|
if (n3.err) return n3;
|
|
2696
2663
|
r2.push(n3.val);
|
|
@@ -2706,23 +2673,23 @@ var ga = class {
|
|
|
2706
2673
|
let n2 = this.clonePosition();
|
|
2707
2674
|
this.bump();
|
|
2708
2675
|
let r2 = this.parseTagName();
|
|
2709
|
-
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location:
|
|
2676
|
+
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location: K(n2, this.clonePosition()) }, err: null };
|
|
2710
2677
|
if (this.bumpIf(`>`)) {
|
|
2711
2678
|
let i2 = this.parseMessage(e6 + 1, t2, true);
|
|
2712
2679
|
if (i2.err) return i2;
|
|
2713
2680
|
let a2 = i2.val, o2 = this.clonePosition();
|
|
2714
2681
|
if (this.bumpIf(`</`)) {
|
|
2715
|
-
if (this.isEOF() || !
|
|
2682
|
+
if (this.isEOF() || !la(this.char())) return this.error(23, K(o2, this.clonePosition()));
|
|
2716
2683
|
let e7 = this.clonePosition();
|
|
2717
|
-
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location:
|
|
2684
|
+
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location: K(n2, this.clonePosition()) }, err: null } : this.error(23, K(o2, this.clonePosition()))) : this.error(26, K(e7, this.clonePosition()));
|
|
2718
2685
|
}
|
|
2719
|
-
return this.error(27,
|
|
2686
|
+
return this.error(27, K(n2, this.clonePosition()));
|
|
2720
2687
|
}
|
|
2721
|
-
return this.error(23,
|
|
2688
|
+
return this.error(23, K(n2, this.clonePosition()));
|
|
2722
2689
|
}
|
|
2723
2690
|
parseTagName() {
|
|
2724
2691
|
let e6 = this.offset();
|
|
2725
|
-
for (this.bump(); !this.isEOF() &&
|
|
2692
|
+
for (this.bump(); !this.isEOF() && da(this.char()); ) this.bump();
|
|
2726
2693
|
return this.message.slice(e6, this.offset());
|
|
2727
2694
|
}
|
|
2728
2695
|
parseLiteral(e6, t2) {
|
|
@@ -2742,11 +2709,11 @@ var ga = class {
|
|
|
2742
2709
|
if (a2) r2 += a2;
|
|
2743
2710
|
else break;
|
|
2744
2711
|
}
|
|
2745
|
-
let i2 =
|
|
2712
|
+
let i2 = K(n2, this.clonePosition());
|
|
2746
2713
|
return { val: { type: 0, value: r2, location: i2 }, err: null };
|
|
2747
2714
|
}
|
|
2748
2715
|
tryParseLeftAngleBracket() {
|
|
2749
|
-
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !
|
|
2716
|
+
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !ua(this.peek() || 0)) ? (this.bump(), `<`) : null;
|
|
2750
2717
|
}
|
|
2751
2718
|
tryParseQuote(e6) {
|
|
2752
2719
|
if (this.isEOF() || this.char() !== 39) return null;
|
|
@@ -2786,29 +2753,29 @@ var ga = class {
|
|
|
2786
2753
|
}
|
|
2787
2754
|
parseArgument(e6, t2) {
|
|
2788
2755
|
let n2 = this.clonePosition();
|
|
2789
|
-
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1,
|
|
2790
|
-
if (this.char() === 125) return this.bump(), this.error(2,
|
|
2756
|
+
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1, K(n2, this.clonePosition()));
|
|
2757
|
+
if (this.char() === 125) return this.bump(), this.error(2, K(n2, this.clonePosition()));
|
|
2791
2758
|
let r2 = this.parseIdentifierIfPossible().value;
|
|
2792
|
-
if (!r2) return this.error(3,
|
|
2793
|
-
if (this.bumpSpace(), this.isEOF()) return this.error(1,
|
|
2759
|
+
if (!r2) return this.error(3, K(n2, this.clonePosition()));
|
|
2760
|
+
if (this.bumpSpace(), this.isEOF()) return this.error(1, K(n2, this.clonePosition()));
|
|
2794
2761
|
switch (this.char()) {
|
|
2795
2762
|
case 125:
|
|
2796
|
-
return this.bump(), { val: { type: 1, value: r2, location:
|
|
2763
|
+
return this.bump(), { val: { type: 1, value: r2, location: K(n2, this.clonePosition()) }, err: null };
|
|
2797
2764
|
case 44:
|
|
2798
|
-
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1,
|
|
2765
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1, K(n2, this.clonePosition())) : this.parseArgumentOptions(e6, t2, r2, n2);
|
|
2799
2766
|
default:
|
|
2800
|
-
return this.error(3,
|
|
2767
|
+
return this.error(3, K(n2, this.clonePosition()));
|
|
2801
2768
|
}
|
|
2802
2769
|
}
|
|
2803
2770
|
parseIdentifierIfPossible() {
|
|
2804
|
-
let e6 = this.clonePosition(), t2 = this.offset(), n2 =
|
|
2805
|
-
return this.bumpTo(r2), { value: n2, location:
|
|
2771
|
+
let e6 = this.clonePosition(), t2 = this.offset(), n2 = oa(this.message, t2), r2 = t2 + n2.length;
|
|
2772
|
+
return this.bumpTo(r2), { value: n2, location: K(e6, this.clonePosition()) };
|
|
2806
2773
|
}
|
|
2807
2774
|
parseArgumentOptions(e6, t2, n2, r2) {
|
|
2808
2775
|
let i2 = this.clonePosition(), a2 = this.parseIdentifierIfPossible().value, o2 = this.clonePosition();
|
|
2809
2776
|
switch (a2) {
|
|
2810
2777
|
case ``:
|
|
2811
|
-
return this.error(4,
|
|
2778
|
+
return this.error(4, K(i2, o2));
|
|
2812
2779
|
case `number`:
|
|
2813
2780
|
case `date`:
|
|
2814
2781
|
case `time`: {
|
|
@@ -2818,15 +2785,15 @@ var ga = class {
|
|
|
2818
2785
|
this.bumpSpace();
|
|
2819
2786
|
let t4 = this.clonePosition(), n3 = this.parseSimpleArgStyleIfPossible();
|
|
2820
2787
|
if (n3.err) return n3;
|
|
2821
|
-
let r3 =
|
|
2822
|
-
if (r3.length === 0) return this.error(6,
|
|
2823
|
-
e7 = { style: r3, styleLocation:
|
|
2788
|
+
let r3 = ia(n3.val);
|
|
2789
|
+
if (r3.length === 0) return this.error(6, K(this.clonePosition(), this.clonePosition()));
|
|
2790
|
+
e7 = { style: r3, styleLocation: K(t4, this.clonePosition()) };
|
|
2824
2791
|
}
|
|
2825
2792
|
let t3 = this.tryParseArgumentClose(r2);
|
|
2826
2793
|
if (t3.err) return t3;
|
|
2827
|
-
let i3 =
|
|
2794
|
+
let i3 = K(r2, this.clonePosition());
|
|
2828
2795
|
if (e7 && e7.style.startsWith(`::`)) {
|
|
2829
|
-
let t4 =
|
|
2796
|
+
let t4 = ra(e7.style.slice(2));
|
|
2830
2797
|
if (a2 === `number`) {
|
|
2831
2798
|
let r3 = this.parseNumberSkeletonFromString(t4, e7.styleLocation);
|
|
2832
2799
|
return r3.err ? r3 : { val: { type: 2, value: n2, location: i3, style: r3.val }, err: null };
|
|
@@ -2834,8 +2801,8 @@ var ga = class {
|
|
|
2834
2801
|
{
|
|
2835
2802
|
if (t4.length === 0) return this.error(10, i3);
|
|
2836
2803
|
let r3 = t4;
|
|
2837
|
-
this.locale && (r3 =
|
|
2838
|
-
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ?
|
|
2804
|
+
this.locale && (r3 = Yi(t4, this.locale));
|
|
2805
|
+
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ? Ci(r3) : {} };
|
|
2839
2806
|
return { val: { type: a2 === `date` ? 3 : 4, value: n2, location: i3, style: o3 }, err: null };
|
|
2840
2807
|
}
|
|
2841
2808
|
}
|
|
@@ -2845,11 +2812,11 @@ var ga = class {
|
|
|
2845
2812
|
case `selectordinal`:
|
|
2846
2813
|
case `select`: {
|
|
2847
2814
|
let i3 = this.clonePosition();
|
|
2848
|
-
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12,
|
|
2815
|
+
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12, K(i3, { ...i3 }));
|
|
2849
2816
|
this.bumpSpace();
|
|
2850
2817
|
let o3 = this.parseIdentifierIfPossible(), s2 = 0;
|
|
2851
2818
|
if (a2 !== `select` && o3.value === `offset`) {
|
|
2852
|
-
if (!this.bumpIf(`:`)) return this.error(13,
|
|
2819
|
+
if (!this.bumpIf(`:`)) return this.error(13, K(this.clonePosition(), this.clonePosition()));
|
|
2853
2820
|
this.bumpSpace();
|
|
2854
2821
|
let e7 = this.tryParseDecimalInteger(13, 14);
|
|
2855
2822
|
if (e7.err) return e7;
|
|
@@ -2859,15 +2826,15 @@ var ga = class {
|
|
|
2859
2826
|
if (c2.err) return c2;
|
|
2860
2827
|
let l2 = this.tryParseArgumentClose(r2);
|
|
2861
2828
|
if (l2.err) return l2;
|
|
2862
|
-
let u2 =
|
|
2863
|
-
return a2 === `select` ? { val: { type: 5, value: n2, options:
|
|
2829
|
+
let u2 = K(r2, this.clonePosition());
|
|
2830
|
+
return a2 === `select` ? { val: { type: 5, value: n2, options: na(c2.val), location: u2 }, err: null } : { val: { type: 6, value: n2, options: na(c2.val), offset: s2, pluralType: a2 === `plural` ? `cardinal` : `ordinal`, location: u2 }, err: null };
|
|
2864
2831
|
}
|
|
2865
2832
|
default:
|
|
2866
|
-
return this.error(5,
|
|
2833
|
+
return this.error(5, K(i2, o2));
|
|
2867
2834
|
}
|
|
2868
2835
|
}
|
|
2869
2836
|
tryParseArgumentClose(e6) {
|
|
2870
|
-
return this.isEOF() || this.char() !== 125 ? this.error(1,
|
|
2837
|
+
return this.isEOF() || this.char() !== 125 ? this.error(1, K(e6, this.clonePosition())) : (this.bump(), { val: true, err: null });
|
|
2871
2838
|
}
|
|
2872
2839
|
parseSimpleArgStyleIfPossible() {
|
|
2873
2840
|
let e6 = 0, t2 = this.clonePosition();
|
|
@@ -2875,7 +2842,7 @@ var ga = class {
|
|
|
2875
2842
|
case 39: {
|
|
2876
2843
|
this.bump();
|
|
2877
2844
|
let e7 = this.clonePosition();
|
|
2878
|
-
if (!this.bumpUntil(`'`)) return this.error(11,
|
|
2845
|
+
if (!this.bumpUntil(`'`)) return this.error(11, K(e7, this.clonePosition()));
|
|
2879
2846
|
this.bump();
|
|
2880
2847
|
break;
|
|
2881
2848
|
}
|
|
@@ -2894,11 +2861,11 @@ var ga = class {
|
|
|
2894
2861
|
parseNumberSkeletonFromString(e6, t2) {
|
|
2895
2862
|
let n2 = [];
|
|
2896
2863
|
try {
|
|
2897
|
-
n2 =
|
|
2864
|
+
n2 = Ti(e6);
|
|
2898
2865
|
} catch {
|
|
2899
2866
|
return this.error(7, t2);
|
|
2900
2867
|
}
|
|
2901
|
-
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ?
|
|
2868
|
+
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ? Fi(n2) : {} }, err: null };
|
|
2902
2869
|
}
|
|
2903
2870
|
tryParsePluralOrSelectOptions(e6, t2, n2, r2) {
|
|
2904
2871
|
let i2 = false, a2 = [], o2 = /* @__PURE__ */ new Set(), { value: s2, location: c2 } = r2;
|
|
@@ -2908,20 +2875,20 @@ var ga = class {
|
|
|
2908
2875
|
if (t2 !== `select` && this.bumpIf(`=`)) {
|
|
2909
2876
|
let t3 = this.tryParseDecimalInteger(16, 19);
|
|
2910
2877
|
if (t3.err) return t3;
|
|
2911
|
-
c2 =
|
|
2878
|
+
c2 = K(e7, this.clonePosition()), s2 = this.message.slice(e7.offset, this.offset());
|
|
2912
2879
|
} else break;
|
|
2913
2880
|
}
|
|
2914
2881
|
if (o2.has(s2)) return this.error(t2 === `select` ? 21 : 20, c2);
|
|
2915
2882
|
s2 === `other` && (i2 = true), this.bumpSpace();
|
|
2916
2883
|
let r3 = this.clonePosition();
|
|
2917
|
-
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18,
|
|
2884
|
+
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18, K(this.clonePosition(), this.clonePosition()));
|
|
2918
2885
|
let l2 = this.parseMessage(e6 + 1, t2, n2);
|
|
2919
2886
|
if (l2.err) return l2;
|
|
2920
2887
|
let u2 = this.tryParseArgumentClose(r3);
|
|
2921
2888
|
if (u2.err) return u2;
|
|
2922
|
-
a2.push([s2, { value: l2.val, location:
|
|
2889
|
+
a2.push([s2, { value: l2.val, location: K(r3, this.clonePosition()) }]), o2.add(s2), this.bumpSpace(), { value: s2, location: c2 } = this.parseIdentifierIfPossible();
|
|
2923
2890
|
}
|
|
2924
|
-
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16,
|
|
2891
|
+
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16, K(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !i2 ? this.error(22, K(this.clonePosition(), this.clonePosition())) : { val: a2, err: null };
|
|
2925
2892
|
}
|
|
2926
2893
|
tryParseDecimalInteger(e6, t2) {
|
|
2927
2894
|
let n2 = 1, r2 = this.clonePosition();
|
|
@@ -2932,7 +2899,7 @@ var ga = class {
|
|
|
2932
2899
|
if (e7 >= 48 && e7 <= 57) i2 = true, a2 = a2 * 10 + (e7 - 48), this.bump();
|
|
2933
2900
|
else break;
|
|
2934
2901
|
}
|
|
2935
|
-
let o2 =
|
|
2902
|
+
let o2 = K(r2, this.clonePosition());
|
|
2936
2903
|
return i2 ? (a2 *= n2, Number.isSafeInteger(a2) ? { val: a2, err: null } : this.error(t2, o2)) : this.error(e6, o2);
|
|
2937
2904
|
}
|
|
2938
2905
|
offset() {
|
|
@@ -2980,7 +2947,7 @@ var ga = class {
|
|
|
2980
2947
|
}
|
|
2981
2948
|
}
|
|
2982
2949
|
bumpSpace() {
|
|
2983
|
-
for (; !this.isEOF() &&
|
|
2950
|
+
for (; !this.isEOF() && fa(this.char()); ) this.bump();
|
|
2984
2951
|
}
|
|
2985
2952
|
peek() {
|
|
2986
2953
|
if (this.isEOF()) return null;
|
|
@@ -2988,34 +2955,34 @@ var ga = class {
|
|
|
2988
2955
|
return this.message.charCodeAt(t2 + (e6 >= 65536 ? 2 : 1)) ?? null;
|
|
2989
2956
|
}
|
|
2990
2957
|
};
|
|
2991
|
-
function
|
|
2958
|
+
function la(e6) {
|
|
2992
2959
|
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
2993
2960
|
}
|
|
2994
|
-
function
|
|
2995
|
-
return
|
|
2961
|
+
function ua(e6) {
|
|
2962
|
+
return la(e6) || e6 === 47;
|
|
2996
2963
|
}
|
|
2997
|
-
function
|
|
2964
|
+
function da(e6) {
|
|
2998
2965
|
return e6 === 45 || e6 === 46 || e6 >= 48 && e6 <= 57 || e6 === 95 || e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90 || e6 == 183 || e6 >= 192 && e6 <= 214 || e6 >= 216 && e6 <= 246 || e6 >= 248 && e6 <= 893 || e6 >= 895 && e6 <= 8191 || e6 >= 8204 && e6 <= 8205 || e6 >= 8255 && e6 <= 8256 || e6 >= 8304 && e6 <= 8591 || e6 >= 11264 && e6 <= 12271 || e6 >= 12289 && e6 <= 55295 || e6 >= 63744 && e6 <= 64975 || e6 >= 65008 && e6 <= 65533 || e6 >= 65536 && e6 <= 983039;
|
|
2999
2966
|
}
|
|
3000
|
-
function
|
|
2967
|
+
function fa(e6) {
|
|
3001
2968
|
return e6 >= 9 && e6 <= 13 || e6 === 32 || e6 === 133 || e6 >= 8206 && e6 <= 8207 || e6 === 8232 || e6 === 8233;
|
|
3002
2969
|
}
|
|
3003
|
-
function
|
|
2970
|
+
function pa(e6) {
|
|
3004
2971
|
e6.forEach((e7) => {
|
|
3005
|
-
if (delete e7.location,
|
|
3006
|
-
else
|
|
2972
|
+
if (delete e7.location, Hi(e7) || Ui(e7)) for (let t2 in e7.options) delete e7.options[t2].location, pa(e7.options[t2].value);
|
|
2973
|
+
else zi(e7) && Ki(e7.style) || (Bi(e7) || Vi(e7)) && qi(e7.style) ? delete e7.style.location : Gi(e7) && pa(e7.children);
|
|
3007
2974
|
});
|
|
3008
2975
|
}
|
|
3009
|
-
function
|
|
2976
|
+
function ma(e6, t2 = {}) {
|
|
3010
2977
|
t2 = { shouldParseSkeletons: true, requiresOtherClause: true, ...t2 };
|
|
3011
|
-
let n2 = new
|
|
2978
|
+
let n2 = new ca(e6, t2).parse();
|
|
3012
2979
|
if (n2.err) {
|
|
3013
|
-
let e7 = SyntaxError(
|
|
2980
|
+
let e7 = SyntaxError(Ii[n2.err.kind]);
|
|
3014
2981
|
throw e7.location = n2.err.location, e7.originalMessage = n2.err.message, e7;
|
|
3015
2982
|
}
|
|
3016
|
-
return t2?.captureLocation ||
|
|
2983
|
+
return t2?.captureLocation || pa(n2.val), n2.val;
|
|
3017
2984
|
}
|
|
3018
|
-
var
|
|
2985
|
+
var ha = class extends Error {
|
|
3019
2986
|
constructor(e6, t2, n2) {
|
|
3020
2987
|
super(e6), this.code = t2, this.originalMessage = n2;
|
|
3021
2988
|
}
|
|
@@ -3023,54 +2990,54 @@ var Ca = class extends Error {
|
|
|
3023
2990
|
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
3024
2991
|
}
|
|
3025
2992
|
};
|
|
3026
|
-
var
|
|
2993
|
+
var ga = class extends ha {
|
|
3027
2994
|
constructor(e6, t2, n2, r2) {
|
|
3028
2995
|
super(`Invalid values for "${e6}": "${t2}". Options are "${Object.keys(n2).join(`", "`)}"`, `INVALID_VALUE`, r2);
|
|
3029
2996
|
}
|
|
3030
2997
|
};
|
|
3031
|
-
var
|
|
2998
|
+
var _a = class extends ha {
|
|
3032
2999
|
constructor(e6, t2, n2) {
|
|
3033
3000
|
super(`Value for "${e6}" must be of type ${t2}`, `INVALID_VALUE`, n2);
|
|
3034
3001
|
}
|
|
3035
3002
|
};
|
|
3036
|
-
var
|
|
3003
|
+
var va = class extends ha {
|
|
3037
3004
|
constructor(e6, t2) {
|
|
3038
3005
|
super(`The intl string context variable "${e6}" was not provided to the string "${t2}"`, `MISSING_VALUE`, t2);
|
|
3039
3006
|
}
|
|
3040
3007
|
};
|
|
3041
|
-
function
|
|
3008
|
+
function ya(e6) {
|
|
3042
3009
|
return e6.length < 2 ? e6 : e6.reduce((e7, t2) => {
|
|
3043
3010
|
let n2 = e7[e7.length - 1];
|
|
3044
3011
|
return !n2 || n2.type !== 0 || t2.type !== 0 ? e7.push(t2) : n2.value += t2.value, e7;
|
|
3045
3012
|
}, []);
|
|
3046
3013
|
}
|
|
3047
|
-
function
|
|
3014
|
+
function ba(e6) {
|
|
3048
3015
|
return typeof e6 == `function`;
|
|
3049
3016
|
}
|
|
3050
|
-
function
|
|
3051
|
-
if (e6.length === 1 &&
|
|
3017
|
+
function xa(e6, t2, n2, r2, i2, a2, o2) {
|
|
3018
|
+
if (e6.length === 1 && Li(e6[0])) return [{ type: 0, value: e6[0].value }];
|
|
3052
3019
|
let s2 = [];
|
|
3053
3020
|
for (let c2 of e6) {
|
|
3054
|
-
if (
|
|
3021
|
+
if (Li(c2)) {
|
|
3055
3022
|
s2.push({ type: 0, value: c2.value });
|
|
3056
3023
|
continue;
|
|
3057
3024
|
}
|
|
3058
|
-
if (
|
|
3025
|
+
if (Wi(c2)) {
|
|
3059
3026
|
typeof a2 == `number` && s2.push({ type: 0, value: n2.getNumberFormat(t2).format(a2) });
|
|
3060
3027
|
continue;
|
|
3061
3028
|
}
|
|
3062
3029
|
let { value: e7 } = c2;
|
|
3063
|
-
if (!(i2 && e7 in i2)) throw new
|
|
3030
|
+
if (!(i2 && e7 in i2)) throw new va(e7, o2);
|
|
3064
3031
|
let l2 = i2[e7];
|
|
3065
|
-
if (
|
|
3066
|
-
else if (
|
|
3067
|
-
let e8 = typeof c2.style == `string` ? r2.date[c2.style] :
|
|
3032
|
+
if (Ri(c2)) (!l2 || typeof l2 == `string` || typeof l2 == `number` || typeof l2 == `bigint`) && (l2 = typeof l2 == `string` || typeof l2 == `number` || typeof l2 == `bigint` ? String(l2) : ``), s2.push({ type: typeof l2 == `string` ? 0 : 1, value: l2 });
|
|
3033
|
+
else if (Bi(c2)) {
|
|
3034
|
+
let e8 = typeof c2.style == `string` ? r2.date[c2.style] : qi(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3068
3035
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3069
|
-
} else if (
|
|
3070
|
-
let e8 = typeof c2.style == `string` ? r2.time[c2.style] :
|
|
3036
|
+
} else if (Vi(c2)) {
|
|
3037
|
+
let e8 = typeof c2.style == `string` ? r2.time[c2.style] : qi(c2.style) ? c2.style.parsedOptions : r2.time.medium;
|
|
3071
3038
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3072
|
-
} else if (
|
|
3073
|
-
let e8 = typeof c2.style == `string` ? r2.number[c2.style] :
|
|
3039
|
+
} else if (zi(c2)) {
|
|
3040
|
+
let e8 = typeof c2.style == `string` ? r2.number[c2.style] : Ki(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3074
3041
|
if (e8 && e8.scale) {
|
|
3075
3042
|
let t3 = e8.scale || 1;
|
|
3076
3043
|
if (typeof l2 == `bigint`) {
|
|
@@ -3080,40 +3047,40 @@ function ka(e6, t2, n2, r2, i2, a2, o2) {
|
|
|
3080
3047
|
}
|
|
3081
3048
|
s2.push({ type: 0, value: n2.getNumberFormat(t2, e8).format(l2) });
|
|
3082
3049
|
} else {
|
|
3083
|
-
if (
|
|
3050
|
+
if (Gi(c2)) {
|
|
3084
3051
|
let { children: e8, value: l3 } = c2, u2 = i2[l3];
|
|
3085
|
-
if (!
|
|
3086
|
-
let d2 = u2(
|
|
3052
|
+
if (!ba(u2)) throw new _a(l3, `function`, o2);
|
|
3053
|
+
let d2 = u2(xa(e8, t2, n2, r2, i2, a2).map((e9) => e9.value));
|
|
3087
3054
|
Array.isArray(d2) || (d2 = [d2]), s2.push(...d2.map((e9) => ({ type: typeof e9 == `string` ? 0 : 1, value: e9 })));
|
|
3088
3055
|
}
|
|
3089
|
-
if (
|
|
3056
|
+
if (Hi(c2)) {
|
|
3090
3057
|
let e8 = l2, a3 = (Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0) || c2.options.other;
|
|
3091
|
-
if (!a3) throw new
|
|
3092
|
-
s2.push(...
|
|
3093
|
-
} else if (
|
|
3058
|
+
if (!a3) throw new ga(c2.value, l2, Object.keys(c2.options), o2);
|
|
3059
|
+
s2.push(...xa(a3.value, t2, n2, r2, i2));
|
|
3060
|
+
} else if (Ui(c2)) {
|
|
3094
3061
|
let e8 = `=${l2}`, a3 = Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0;
|
|
3095
3062
|
if (!a3) {
|
|
3096
|
-
if (!Intl.PluralRules) throw new
|
|
3063
|
+
if (!Intl.PluralRules) throw new ha(`Intl.PluralRules is not available in this environment.
|
|
3097
3064
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3098
3065
|
`, `MISSING_INTL_API`, o2);
|
|
3099
3066
|
let e9 = typeof l2 == `bigint` ? Number(l2) : l2, r3 = n2.getPluralRules(t2, { type: c2.pluralType }).select(e9 - (c2.offset || 0));
|
|
3100
3067
|
a3 = (Object.prototype.hasOwnProperty.call(c2.options, r3) ? c2.options[r3] : void 0) || c2.options.other;
|
|
3101
3068
|
}
|
|
3102
|
-
if (!a3) throw new
|
|
3069
|
+
if (!a3) throw new ga(c2.value, l2, Object.keys(c2.options), o2);
|
|
3103
3070
|
let u2 = typeof l2 == `bigint` ? Number(l2) : l2;
|
|
3104
|
-
s2.push(...
|
|
3071
|
+
s2.push(...xa(a3.value, t2, n2, r2, i2, u2 - (c2.offset || 0)));
|
|
3105
3072
|
}
|
|
3106
3073
|
}
|
|
3107
3074
|
}
|
|
3108
|
-
return
|
|
3075
|
+
return ya(s2);
|
|
3109
3076
|
}
|
|
3110
|
-
function
|
|
3077
|
+
function Sa(e6, t2) {
|
|
3111
3078
|
return t2 ? { ...e6, ...t2, ...Object.keys(e6).reduce((n2, r2) => (n2[r2] = { ...e6[r2], ...t2[r2] }, n2), {}) } : e6;
|
|
3112
3079
|
}
|
|
3113
|
-
function
|
|
3114
|
-
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] =
|
|
3080
|
+
function Ca(e6, t2) {
|
|
3081
|
+
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] = Sa(e6[r2], t2[r2]), n2), { ...e6 }) : e6;
|
|
3115
3082
|
}
|
|
3116
|
-
function
|
|
3083
|
+
function wa(e6) {
|
|
3117
3084
|
return { create() {
|
|
3118
3085
|
return { get(t2) {
|
|
3119
3086
|
return e6[t2];
|
|
@@ -3122,23 +3089,23 @@ function Ma(e6) {
|
|
|
3122
3089
|
} };
|
|
3123
3090
|
} };
|
|
3124
3091
|
}
|
|
3125
|
-
function
|
|
3126
|
-
return { getNumberFormat:
|
|
3092
|
+
function Ta(e6 = { number: {}, dateTime: {}, pluralRules: {} }) {
|
|
3093
|
+
return { getNumberFormat: ui((...e7) => new Intl.NumberFormat(...e7), { cache: wa(e6.number), strategy: xi.variadic }), getDateTimeFormat: ui((...e7) => new Intl.DateTimeFormat(...e7), { cache: wa(e6.dateTime), strategy: xi.variadic }), getPluralRules: ui((...e7) => new Intl.PluralRules(...e7), { cache: wa(e6.pluralRules), strategy: xi.variadic }) };
|
|
3127
3094
|
}
|
|
3128
|
-
var
|
|
3095
|
+
var Ea = class e5 {
|
|
3129
3096
|
constructor(t2, n2 = e5.defaultLocale, r2, i2) {
|
|
3130
3097
|
if (this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} }, this.format = (e6) => {
|
|
3131
3098
|
let t3 = this.formatToParts(e6);
|
|
3132
3099
|
if (t3.length === 1) return t3[0].value;
|
|
3133
3100
|
let n3 = t3.reduce((e7, t4) => (!e7.length || t4.type !== 0 || typeof e7[e7.length - 1] != `string` ? e7.push(t4.value) : e7[e7.length - 1] += t4.value, e7), []);
|
|
3134
3101
|
return n3.length <= 1 ? n3[0] || `` : n3;
|
|
3135
|
-
}, this.formatToParts = (e6) =>
|
|
3102
|
+
}, this.formatToParts = (e6) => xa(this.ast, this.locales, this.formatters, this.formats, e6, void 0, this.message), this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] }), this.getAst = () => this.ast, this.locales = n2, this.resolvedLocale = e5.resolveLocale(n2), typeof t2 == `string`) {
|
|
3136
3103
|
if (this.message = t2, !e5.__parse) throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3137
3104
|
let { ...n3 } = i2 || {};
|
|
3138
3105
|
this.ast = e5.__parse(t2, { ...n3, locale: this.resolvedLocale });
|
|
3139
3106
|
} else this.ast = t2;
|
|
3140
3107
|
if (!Array.isArray(this.ast)) throw TypeError(`A message must be provided as a String or AST.`);
|
|
3141
|
-
this.formats =
|
|
3108
|
+
this.formats = Ca(e5.formats, r2), this.formatters = i2 && i2.formatters || Ta(this.formatterCache);
|
|
3142
3109
|
}
|
|
3143
3110
|
static {
|
|
3144
3111
|
this.memoizedDefaultLocale = null;
|
|
@@ -3154,32 +3121,66 @@ var Pa = class e5 {
|
|
|
3154
3121
|
};
|
|
3155
3122
|
}
|
|
3156
3123
|
static {
|
|
3157
|
-
this.__parse =
|
|
3124
|
+
this.__parse = ma;
|
|
3158
3125
|
}
|
|
3159
3126
|
static {
|
|
3160
3127
|
this.formats = { number: { integer: { maximumFractionDigits: 0 }, currency: { style: `currency` }, percent: { style: `percent` } }, date: { short: { month: `numeric`, day: `numeric`, year: `2-digit` }, medium: { month: `short`, day: `numeric`, year: `numeric` }, long: { month: `long`, day: `numeric`, year: `numeric` }, full: { weekday: `long`, month: `long`, day: `numeric`, year: `numeric` } }, time: { short: { hour: `numeric`, minute: `numeric` }, medium: { hour: `numeric`, minute: `numeric`, second: `numeric` }, long: { hour: `numeric`, minute: `numeric`, second: `numeric`, timeZoneName: `short` }, full: { hour: `numeric`, minute: `numeric`, second: `numeric`, timeZoneName: `short` } } };
|
|
3161
3128
|
}
|
|
3162
3129
|
};
|
|
3163
|
-
|
|
3164
|
-
|
|
3130
|
+
var Da = [`__proto__`, `constructor`, `prototype`];
|
|
3131
|
+
function Oa(e6, t2, n2) {
|
|
3132
|
+
function r2(e7) {
|
|
3133
|
+
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
3134
|
+
}
|
|
3135
|
+
function i2() {
|
|
3136
|
+
return !e6 || typeof e6 == `string`;
|
|
3137
|
+
}
|
|
3138
|
+
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
3139
|
+
if (i2()) return {};
|
|
3140
|
+
var o2 = r2(a2.shift());
|
|
3141
|
+
if (Da.indexOf(o2) > -1) return {};
|
|
3142
|
+
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
3143
|
+
}
|
|
3144
|
+
if (i2()) return {};
|
|
3145
|
+
var s2 = r2(a2.shift());
|
|
3146
|
+
return Da.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
3147
|
+
}
|
|
3148
|
+
function ka(e6, t2, n2) {
|
|
3149
|
+
var r2 = Oa(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
3150
|
+
i2 !== void 0 && (i2[a2] = n2);
|
|
3151
|
+
}
|
|
3152
|
+
function Aa(e6, t2) {
|
|
3153
|
+
var n2 = Oa(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
3154
|
+
if (r2) return r2[i2];
|
|
3165
3155
|
}
|
|
3166
|
-
function
|
|
3156
|
+
function ja(e6) {
|
|
3157
|
+
return [...arguments].slice(1).forEach(function(t2) {
|
|
3158
|
+
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
3159
|
+
var i2 = r2[n2];
|
|
3160
|
+
Da.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
3161
|
+
}
|
|
3162
|
+
}), e6;
|
|
3163
|
+
}
|
|
3164
|
+
function Ma(e6, t2) {
|
|
3165
|
+
return La(e6) || Ia(e6, t2) || Pa(e6, t2) || Na();
|
|
3166
|
+
}
|
|
3167
|
+
function Na() {
|
|
3167
3168
|
throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3168
3169
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
3169
3170
|
}
|
|
3170
|
-
function
|
|
3171
|
+
function Pa(e6, t2) {
|
|
3171
3172
|
if (e6) {
|
|
3172
|
-
if (typeof e6 == `string`) return
|
|
3173
|
+
if (typeof e6 == `string`) return Fa(e6, t2);
|
|
3173
3174
|
var n2 = {}.toString.call(e6).slice(8, -1);
|
|
3174
|
-
return n2 === `Object` && e6.constructor && (n2 = e6.constructor.name), n2 === `Map` || n2 === `Set` ? Array.from(e6) : n2 === `Arguments` || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ?
|
|
3175
|
+
return n2 === `Object` && e6.constructor && (n2 = e6.constructor.name), n2 === `Map` || n2 === `Set` ? Array.from(e6) : n2 === `Arguments` || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ? Fa(e6, t2) : void 0;
|
|
3175
3176
|
}
|
|
3176
3177
|
}
|
|
3177
|
-
function
|
|
3178
|
+
function Fa(e6, t2) {
|
|
3178
3179
|
(t2 == null || t2 > e6.length) && (t2 = e6.length);
|
|
3179
3180
|
for (var n2 = 0, r2 = Array(t2); n2 < t2; n2++) r2[n2] = e6[n2];
|
|
3180
3181
|
return r2;
|
|
3181
3182
|
}
|
|
3182
|
-
function
|
|
3183
|
+
function Ia(e6, t2) {
|
|
3183
3184
|
var n2 = e6 == null ? null : typeof Symbol < `u` && e6[Symbol.iterator] || e6[`@@iterator`];
|
|
3184
3185
|
if (n2 != null) {
|
|
3185
3186
|
var r2, i2, a2, o2, s2 = [], c2 = true, l2 = false;
|
|
@@ -3200,18 +3201,10 @@ function za(e6, t2) {
|
|
|
3200
3201
|
return s2;
|
|
3201
3202
|
}
|
|
3202
3203
|
}
|
|
3203
|
-
function
|
|
3204
|
+
function La(e6) {
|
|
3204
3205
|
if (Array.isArray(e6)) return e6;
|
|
3205
3206
|
}
|
|
3206
|
-
function
|
|
3207
|
-
"@babel/helpers - typeof";
|
|
3208
|
-
return K = typeof Symbol == `function` && typeof Symbol.iterator == `symbol` ? function(e7) {
|
|
3209
|
-
return typeof e7;
|
|
3210
|
-
} : function(e7) {
|
|
3211
|
-
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3212
|
-
}, K(e6);
|
|
3213
|
-
}
|
|
3214
|
-
function Va(e6, t2) {
|
|
3207
|
+
function Ra(e6, t2) {
|
|
3215
3208
|
var n2 = Object.keys(e6);
|
|
3216
3209
|
if (Object.getOwnPropertySymbols) {
|
|
3217
3210
|
var r2 = Object.getOwnPropertySymbols(e6);
|
|
@@ -3221,85 +3214,121 @@ function Va(e6, t2) {
|
|
|
3221
3214
|
}
|
|
3222
3215
|
return n2;
|
|
3223
3216
|
}
|
|
3224
|
-
function
|
|
3217
|
+
function za(e6) {
|
|
3225
3218
|
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
3226
3219
|
var n2 = arguments[t2] == null ? {} : arguments[t2];
|
|
3227
|
-
t2 % 2 ?
|
|
3228
|
-
|
|
3229
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) :
|
|
3220
|
+
t2 % 2 ? Ra(Object(n2), true).forEach(function(t3) {
|
|
3221
|
+
Ba(e6, t3, n2[t3]);
|
|
3222
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) : Ra(Object(n2)).forEach(function(t3) {
|
|
3230
3223
|
Object.defineProperty(e6, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
3231
3224
|
});
|
|
3232
3225
|
}
|
|
3233
3226
|
return e6;
|
|
3234
3227
|
}
|
|
3235
|
-
function
|
|
3236
|
-
return (t2 =
|
|
3228
|
+
function Ba(e6, t2, n2) {
|
|
3229
|
+
return (t2 = Wa(t2)) in e6 ? Object.defineProperty(e6, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e6[t2] = n2, e6;
|
|
3237
3230
|
}
|
|
3238
|
-
function
|
|
3231
|
+
function Va(e6, t2) {
|
|
3239
3232
|
if (!(e6 instanceof t2)) throw TypeError(`Cannot call a class as a function`);
|
|
3240
3233
|
}
|
|
3241
|
-
function
|
|
3234
|
+
function Ha(e6, t2) {
|
|
3242
3235
|
for (var n2 = 0; n2 < t2.length; n2++) {
|
|
3243
3236
|
var r2 = t2[n2];
|
|
3244
|
-
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6,
|
|
3237
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6, Wa(r2.key), r2);
|
|
3245
3238
|
}
|
|
3246
3239
|
}
|
|
3247
|
-
function
|
|
3248
|
-
return t2 &&
|
|
3240
|
+
function Ua(e6, t2, n2) {
|
|
3241
|
+
return t2 && Ha(e6.prototype, t2), n2 && Ha(e6, n2), Object.defineProperty(e6, "prototype", { writable: false }), e6;
|
|
3249
3242
|
}
|
|
3250
|
-
function
|
|
3251
|
-
var t2 =
|
|
3252
|
-
return
|
|
3243
|
+
function Wa(e6) {
|
|
3244
|
+
var t2 = Ga(e6, `string`);
|
|
3245
|
+
return q(t2) == `symbol` ? t2 : t2 + ``;
|
|
3253
3246
|
}
|
|
3254
|
-
function
|
|
3255
|
-
if (
|
|
3247
|
+
function Ga(e6, t2) {
|
|
3248
|
+
if (q(e6) != `object` || !e6) return e6;
|
|
3256
3249
|
var n2 = e6[Symbol.toPrimitive];
|
|
3257
3250
|
if (n2 !== void 0) {
|
|
3258
3251
|
var r2 = n2.call(e6, t2 || `default`);
|
|
3259
|
-
if (
|
|
3252
|
+
if (q(r2) != `object`) return r2;
|
|
3260
3253
|
throw TypeError(`@@toPrimitive must return a primitive value.`);
|
|
3261
3254
|
}
|
|
3262
3255
|
return (t2 === `string` ? String : Number)(e6);
|
|
3263
3256
|
}
|
|
3264
|
-
function
|
|
3257
|
+
function q(e6) {
|
|
3258
|
+
"@babel/helpers - typeof";
|
|
3259
|
+
return q = typeof Symbol == `function` && typeof Symbol.iterator == `symbol` ? function(e7) {
|
|
3260
|
+
return typeof e7;
|
|
3261
|
+
} : function(e7) {
|
|
3262
|
+
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3263
|
+
}, q(e6);
|
|
3264
|
+
}
|
|
3265
|
+
var Ka = `https://www.i18next.com/how-to/using-icu-or-mf2`;
|
|
3266
|
+
var qa = [`zero`, `one`, `two`, `few`, `many`, `other`];
|
|
3267
|
+
function Ja() {
|
|
3265
3268
|
return { memoize: true, memoizeFallback: false, bindI18n: ``, bindI18nStore: ``, parseErrorHandler: function(e6, t2, n2, r2) {
|
|
3266
3269
|
return n2;
|
|
3267
3270
|
}, parseLngForICU: function(e6) {
|
|
3268
3271
|
return e6;
|
|
3269
3272
|
}, escapeVariables: false };
|
|
3270
3273
|
}
|
|
3274
|
+
function Ya(e6, t2, n2, r2) {
|
|
3275
|
+
return n2 && t2 && q(t2) === `object` ? `${r2} resolved to an object or array, but i18next-icu does not support returnObjects or joinArrays and returns the raw value unformatted.` : n2 && typeof t2 == `string` && t2.indexOf(`{{`) > -1 ? `${r2} could not be parsed (${e6.message}). It contains "{{": i18next interpolation like {{name}} does not work with ICU, use {name}.` : `${r2} could not be ${n2 ? `parsed` : `formatted`}: ${e6.message}`;
|
|
3276
|
+
}
|
|
3271
3277
|
var Xa = function() {
|
|
3272
3278
|
function e6(t2) {
|
|
3273
|
-
|
|
3279
|
+
Va(this, e6), this.type = `i18nFormat`, this.mem = {}, this.warned = /* @__PURE__ */ new Set(), this.init(null, t2);
|
|
3274
3280
|
}
|
|
3275
|
-
return
|
|
3281
|
+
return Ua(e6, [{ key: `init`, value: function(e7, t2) {
|
|
3276
3282
|
var n2 = this, r2 = e7 && e7.options && e7.options.i18nFormat || {};
|
|
3277
|
-
if (this.options =
|
|
3283
|
+
if (this.options = ja(r2, t2, this.options || {}, Ja()), this.formats = this.options.formats, e7) {
|
|
3278
3284
|
var i2 = this.options, a2 = i2.bindI18n, o2 = i2.bindI18nStore, s2 = i2.memoize;
|
|
3279
|
-
e7.IntlMessageFormat =
|
|
3285
|
+
e7.IntlMessageFormat = Ea, e7.ICU = this, this.i18next = e7, this.debug = !!(e7.options && e7.options.debug), this.debug && e7.options.interpolation && e7.options.interpolation.escapeValue !== false && !this.options.escapeVariables && this.warn(`interpolation.escapeValue is not applied, values are inserted without HTML escaping. Set the i18next-icu option escapeVariables: true to escape them, or interpolation.escapeValue: false if your output is escaped elsewhere (e.g. by React).`), s2 && (a2 && e7.on(a2, function() {
|
|
3280
3286
|
return n2.clearCache();
|
|
3281
3287
|
}), o2 && e7.store.on(o2, function() {
|
|
3282
3288
|
return n2.clearCache();
|
|
3283
3289
|
}));
|
|
3284
3290
|
}
|
|
3285
3291
|
} }, { key: `addUserDefinedFormats`, value: function(e7) {
|
|
3286
|
-
this.formats = this.formats ?
|
|
3292
|
+
this.formats = this.formats ? za(za({}, this.formats), e7) : e7, this.clearCache();
|
|
3287
3293
|
} }, { key: `parse`, value: function(e7, t2, n2, r2, i2, a2) {
|
|
3288
|
-
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize &&
|
|
3289
|
-
this.options.memoize
|
|
3294
|
+
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize && [n2, r2, i2], c2;
|
|
3295
|
+
if (this.options.memoize) {
|
|
3296
|
+
var l2 = Aa(this.mem, s2);
|
|
3297
|
+
l2 && l2.res === e7 && (c2 = l2.fc);
|
|
3298
|
+
}
|
|
3290
3299
|
try {
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
return this.
|
|
3300
|
+
c2 || (this.debug && typeof e7 == `string` && e7.indexOf(`$t(`) > -1 && this.firstTime(`nesting ${n2} ${r2} ${i2}`) && this.warn(`key "${i2}" (${n2}/${r2}) contains "$t(", but i18next-icu does not support nesting, the text is output as is.`), c2 = new Ea(e7, this.options.parseLngForICU(n2), this.formats, { ignoreTag: true }), this.options.memoize && (this.options.memoizeFallback || !a2 || o2) && ka(this.mem, s2, { res: e7, fc: c2 }));
|
|
3301
|
+
var u2 = t2 && t2.replace && q(t2.replace) === `object` ? za(za({}, t2), t2.replace) : t2;
|
|
3302
|
+
return c2.format(this.escapeVariableValues(u2));
|
|
3303
|
+
} catch (a3) {
|
|
3304
|
+
return this.debug && this.firstTime(`error ${n2} ${r2} ${i2}`) && this.warn(Ya(a3, e7, !c2, `key "${i2}" (${n2}/${r2})`)), this.options.parseErrorHandler(a3, i2, e7, t2);
|
|
3294
3305
|
}
|
|
3295
3306
|
} }, { key: `addLookupKeys`, value: function(e7, t2, n2, r2, i2) {
|
|
3296
|
-
return e7;
|
|
3307
|
+
return this.debug && i2 && this.checkSuffixKeys(t2, n2, r2, i2), e7;
|
|
3308
|
+
} }, { key: `checkSuffixKeys`, value: function(e7, t2, n2, r2) {
|
|
3309
|
+
var i2 = r2.count, a2 = r2.context, o2 = this.i18next.options, s2 = o2.pluralSeparator, c2 = s2 === void 0 ? `_` : s2, l2 = o2.contextSeparator, u2 = l2 === void 0 ? `_` : l2, d2 = this.i18next.services.resourceStore, f2 = `key "${e7}" (${t2}/${n2})`;
|
|
3310
|
+
if (i2 !== void 0 && this.firstTime(`plural ${t2} ${n2} ${e7}`)) {
|
|
3311
|
+
var p2 = qa.concat(qa.map(function(e8) {
|
|
3312
|
+
return `ordinal${c2}${e8}`;
|
|
3313
|
+
})).map(function(t3) {
|
|
3314
|
+
return `${e7}${c2}${t3}`;
|
|
3315
|
+
}).filter(function(e8) {
|
|
3316
|
+
return d2.getResource(t2, n2, e8) !== void 0;
|
|
3317
|
+
});
|
|
3318
|
+
p2.length && this.warn(`${f2} was called with count, but i18next-icu does not look up plural suffix keys (${p2.join(`, `)}). Put the plural into the message: {count, plural, one {# item} other {# items}}.`);
|
|
3319
|
+
}
|
|
3320
|
+
var m2 = `${e7}${u2}${a2}`;
|
|
3321
|
+
a2 !== void 0 && a2 !== `` && this.firstTime(`context ${t2} ${n2} ${m2}`) && d2.getResource(t2, n2, m2) !== void 0 && this.warn(`${f2} was called with context "${a2}", but i18next-icu does not look up context keys (${m2}). Use a select in the message: {context, select, ${a2} {...} other {...}}.`);
|
|
3322
|
+
} }, { key: `firstTime`, value: function(e7) {
|
|
3323
|
+
return !this.warned.has(e7) && (this.warned.add(e7), true);
|
|
3324
|
+
} }, { key: `warn`, value: function(e7) {
|
|
3325
|
+
this.i18next.services.logger.warn(`i18next-icu: ${e7} See ${Ka}`);
|
|
3297
3326
|
} }, { key: `clearCache`, value: function() {
|
|
3298
3327
|
this.mem = {};
|
|
3299
3328
|
} }, { key: `escapeVariableValues`, value: function(e7) {
|
|
3300
|
-
if (!this.options.escapeVariables || !e7 ||
|
|
3329
|
+
if (!this.options.escapeVariables || !e7 || q(e7) !== `object`) return e7;
|
|
3301
3330
|
for (var t2 = {}, n2 = 0, r2 = Object.entries(e7); n2 < r2.length; n2++) {
|
|
3302
|
-
var i2 =
|
|
3331
|
+
var i2 = Ma(r2[n2], 2), a2 = i2[0], o2 = i2[1];
|
|
3303
3332
|
t2[a2] = typeof o2 == `string` ? o2.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`) : o2;
|
|
3304
3333
|
}
|
|
3305
3334
|
return t2;
|
|
@@ -3313,11 +3342,11 @@ function Za({ icuOptions: e6 = {}, ...t2 }) {
|
|
|
3313
3342
|
var Qa = (e6, t2, n2, r2) => {
|
|
3314
3343
|
let i2 = [n2, { code: t2, ...r2 || {} }];
|
|
3315
3344
|
if (e6?.services?.logger?.forward) return e6.services.logger.forward(i2, `warn`, `react-i18next::`, true);
|
|
3316
|
-
|
|
3345
|
+
J(i2[0]) && (i2[0] = `react-i18next:: ${i2[0]}`), e6?.services?.logger?.warn ? e6.services.logger.warn(...i2) : console?.warn && console.warn(...i2);
|
|
3317
3346
|
};
|
|
3318
3347
|
var $a = {};
|
|
3319
3348
|
var eo = (e6, t2, n2, r2) => {
|
|
3320
|
-
|
|
3349
|
+
J(n2) && $a[n2] || (J(n2) && ($a[n2] = /* @__PURE__ */ new Date()), Qa(e6, t2, n2, r2));
|
|
3321
3350
|
};
|
|
3322
3351
|
var to = (e6, t2) => () => {
|
|
3323
3352
|
if (e6.isInitialized) t2();
|
|
@@ -3334,7 +3363,7 @@ var no = (e6, t2, n2) => {
|
|
|
3334
3363
|
e6.loadNamespaces(t2, to(e6, n2));
|
|
3335
3364
|
};
|
|
3336
3365
|
var ro = (e6, t2, n2, r2) => {
|
|
3337
|
-
if (
|
|
3366
|
+
if (J(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return no(e6, n2, r2);
|
|
3338
3367
|
n2.forEach((t3) => {
|
|
3339
3368
|
e6.options.ns.indexOf(t3) < 0 && e6.options.ns.push(t3);
|
|
3340
3369
|
}), e6.loadLanguages(t2, to(e6, r2));
|
|
@@ -3342,7 +3371,7 @@ var ro = (e6, t2, n2, r2) => {
|
|
|
3342
3371
|
var io = (e6, t2, n2 = {}) => !t2.languages || !t2.languages.length ? (eo(t2, `NO_LANGUAGES`, `i18n.languages were undefined or empty`, { languages: t2.languages }), true) : t2.hasLoadedNamespace(e6, { lng: n2.lng, precheck: (t3, r2) => {
|
|
3343
3372
|
if (n2.bindI18n && n2.bindI18n.indexOf(`languageChanging`) > -1 && t3.services.backendConnector.backend && t3.isLanguageChangingTo && !r2(t3.isLanguageChangingTo, e6)) return false;
|
|
3344
3373
|
} });
|
|
3345
|
-
var
|
|
3374
|
+
var J = (e6) => typeof e6 == `string`;
|
|
3346
3375
|
var ao = (e6) => typeof e6 == `object` && !!e6;
|
|
3347
3376
|
var oo = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3348
3377
|
var so = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
@@ -3377,12 +3406,12 @@ var yo = (e6, t2 = {}) => {
|
|
|
3377
3406
|
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = (0, import_react.useContext)(mo) || {}, a2 = n2 || r2 || po();
|
|
3378
3407
|
if (a2 && !a2.reportNamespaces && (a2.reportNamespaces = new ho()), !a2) {
|
|
3379
3408
|
eo(a2, `NO_I18NEXT_INSTANCE`, `useTranslation: You will need to pass in an i18next instance by using initReactI18next`);
|
|
3380
|
-
let e7 = (e8, t4) =>
|
|
3409
|
+
let e7 = (e8, t4) => J(t4) ? t4 : ao(t4) && J(t4.defaultValue) ? t4.defaultValue : Array.isArray(e8) ? e8[e8.length - 1] : e8, t3 = [e7, {}, false];
|
|
3381
3410
|
return t3.t = e7, t3.i18n = {}, t3.ready = false, t3;
|
|
3382
3411
|
}
|
|
3383
3412
|
a2.options.react?.wait && eo(a2, `DEPRECATED_OPTION`, `useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);
|
|
3384
3413
|
let o2 = { ...uo(), ...a2.options.react, ...t2 }, { useSuspense: s2, keyPrefix: u2 } = o2, p2 = e6 || i2 || a2.options?.defaultNS;
|
|
3385
|
-
p2 =
|
|
3414
|
+
p2 = J(p2) ? [p2] : p2 || [`translation`], a2.reportNamespaces.addUsedNamespaces?.(p2);
|
|
3386
3415
|
let m2 = (a2.isInitialized || a2.initializedStoreOnce) && p2.every((e7) => io(e7, a2, o2)), h2 = vo(a2, t2.lng || null, o2.nsMode === `fallback` ? p2 : p2[0], u2), g2 = () => h2, _2 = () => _o(a2, t2.lng || null, o2.nsMode === `fallback` ? p2 : p2[0], u2), [v2, y2] = (0, import_react.useState)(g2), b2 = p2.join();
|
|
3387
3416
|
t2.lng && (b2 = `${t2.lng}${b2}`);
|
|
3388
3417
|
let x2 = go(b2), S2 = (0, import_react.useRef)(true);
|
|
@@ -3412,8 +3441,8 @@ function bo({ i18n: e6, defaultNS: t2, children: n2 }) {
|
|
|
3412
3441
|
let r2 = (0, import_react.useMemo)(() => ({ i18n: e6, defaultNS: t2 }), [e6, t2]);
|
|
3413
3442
|
return (0, import_react.createElement)(mo.Provider, { value: r2 }, n2);
|
|
3414
3443
|
}
|
|
3415
|
-
var xo =
|
|
3416
|
-
var So =
|
|
3444
|
+
var xo = I(`@wix/site-service-locale`);
|
|
3445
|
+
var So = I(`@wix/site-service-renderer-configuration`);
|
|
3417
3446
|
var Co = () => {
|
|
3418
3447
|
let e6, t2;
|
|
3419
3448
|
try {
|
|
@@ -3508,9 +3537,9 @@ function Go(e6) {
|
|
|
3508
3537
|
let t2 = Co(), n2 = Fo()?.locale ?? t2 ?? `en`;
|
|
3509
3538
|
return { i18n: Lo(n2, e6), locale: n2 };
|
|
3510
3539
|
}
|
|
3511
|
-
var Ko =
|
|
3540
|
+
var Ko = y({ default: () => qo });
|
|
3512
3541
|
var qo = { "post.time-to-read": `{count, plural, one {# min read} other {# min read}}`, "post.view-count": `{count, plural, one {{formatted} view} other {{formatted} views}}`, "post.comment-count": `{count, plural, one {{formatted} comment} other {{formatted} comments}}`, "post.like-count": `{count, plural, one {{formatted} like} other {{formatted} likes}}`, "post-list.empty-state.title": `No posts yet`, "post-list.empty-state.description": `Once posts are published, they will appear here.`, "related-posts.empty-state.title": `No related posts yet`, "related-posts.empty-state.description": `Once more posts are published, they will appear here.`, "post-actions.like": `Like post`, "post-actions.unlike": `Unlike post`, "post-actions.share": `Share post`, "post-actions.share-dialog": `Share post`, "post-actions.link-copied": `Link copied`, "post-actions.copy-manually": `Copy the link below to share this post.`, "post-actions.link-label": `Post link`, "post-actions.copy-link": `Copy link`, "post-actions.close": `Close`, "post-counters.loading-likes": `Loading likes`, "cover-media.play": `Play video`, "cover-media.placeholder-alt": `Post cover image`, "post-comments.loading": `Loading comments\u2026`, "post-comments.no-post": `No post resolved for this URL yet.`, "post-comments.unavailable": `Comments are unavailable \u2014 no app instance.`, "post-comments.demo-notice": `Sample comments are shown while editing. Visitors will see real comments.`, "canvas.post-title": `Post Title`, "canvas.author-name": `Author Name`, "canvas.excerpt": `Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.`, "canvas.content": `This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`, "canvas.category": `Category`, "canvas.category-numbered": `Category {number}`, "canvas.tag-numbered": `Tag {number}`, "canvas.author-photo-alt": `Author photo`, "category-header.all-posts": `All Posts` };
|
|
3513
|
-
var Jo =
|
|
3542
|
+
var Jo = y({ default: () => Xo, title: () => Yo });
|
|
3514
3543
|
var Yo = `My App`;
|
|
3515
3544
|
var Xo = { "canvas.category": `Category`, "post-list.empty-state.description": `Once posts are published, they will appear here.`, "canvas.tag-numbered": `Tag {number}`, "cover-media.play": `Play video`, "post-comments.unavailable": `Comments are unavailable \u2014 no app instance.`, "post-counters.loading-likes": `Loading likes`, "post-comments.loading": `Loading comments\u2026`, "post-actions.like": `Like post`, "canvas.content": `This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`, "related-posts.empty-state.title": `No related posts yet`, "post.time-to-read": `{count, plural, one {# min read} other {# min read}}`, "post-actions.link-copied": `Link copied`, "category-header.all-posts": `All Posts`, "post-actions.copy-manually": `Copy the link below to share this post.`, "post-actions.copy-link": `Copy link`, "cover-media.placeholder-alt": `Post cover image`, "post-actions.link-label": `Post link`, "post-list.empty-state.title": `No posts yet`, "post-actions.share-dialog": `Share post`, "canvas.post-title": `Post Title`, "post-actions.unlike": `Unlike post`, "post-comments.no-post": `No post resolved for this URL yet.`, "post.like-count": `{count, plural, one {{formatted} like} other {{formatted} likes}}`, "canvas.category-numbered": `Category {number}`, "post.comment-count": `{count, plural, one {{formatted} comment} other {{formatted} comments}}`, "post-actions.share": `Share post`, "post.view-count": `{count, plural, one {{formatted} view} other {{formatted} views}}`, "post-actions.close": `Close`, "canvas.category-description": `Add a short description of this category so readers know what they will find here. It shows under the category title, above the posts.`, "canvas.author-photo-alt": `Author photo`, "canvas.author-name": `Author Name`, "post-comments.demo-notice": `Sample comments are shown while editing. Visitors will see real comments.`, title: Yo, "related-posts.empty-state.description": `Once more posts are published, they will appear here.`, "canvas.excerpt": `Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.` };
|
|
3516
3545
|
var Zo = Object.assign({ "../assets/locale/messages_en.dev.json": Ko, "../assets/locale/messages_en.json": Jo });
|
|
@@ -3527,7 +3556,7 @@ function ns(e6) {
|
|
|
3527
3556
|
var rs = `@wix/auto_sdk_blog_post-paywalls`;
|
|
3528
3557
|
function is(e6) {
|
|
3529
3558
|
function t2({ host: t3 }) {
|
|
3530
|
-
return { entityFqdn: `wix.blog.blog_paywall_service.v1.post_paywall`, method: `GET`, methodFqn: `wix.blog.blog_paywall_service.v1.PostPaywallService.GetPostPaywall`, packageName: rs, migrationOptions: { optInTransformResponse: true }, url: ns({ protoPath: `/v1/post-paywalls/{postFqdn}/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn:
|
|
3559
|
+
return { entityFqdn: `wix.blog.blog_paywall_service.v1.post_paywall`, method: `GET`, methodFqn: `wix.blog.blog_paywall_service.v1.PostPaywallService.GetPostPaywall`, packageName: rs, migrationOptions: { optInTransformResponse: true }, url: ns({ protoPath: `/v1/post-paywalls/{postFqdn}/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: F, paths: es }, { transformFn: k, paths: ts }]) };
|
|
3531
3560
|
}
|
|
3532
3561
|
return t2;
|
|
3533
3562
|
}
|
|
@@ -3555,7 +3584,7 @@ function ls(e6) {
|
|
|
3555
3584
|
function us(e6) {
|
|
3556
3585
|
return Object.keys(e6).length === 1 && `$not` in e6 && typeof e6.$not == `object`;
|
|
3557
3586
|
}
|
|
3558
|
-
function
|
|
3587
|
+
function Y(e6, t2) {
|
|
3559
3588
|
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...cs(e6) ? e6.$and : [e6], ...cs(t2) ? t2.$and : [t2]] };
|
|
3560
3589
|
}
|
|
3561
3590
|
function ds(e6, t2) {
|
|
@@ -3634,7 +3663,7 @@ var hs = class extends ps {
|
|
|
3634
3663
|
function gs(e6) {
|
|
3635
3664
|
let t2 = (n2) => ({ query: n2, async find() {
|
|
3636
3665
|
try {
|
|
3637
|
-
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [
|
|
3666
|
+
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [$e]: a2, [et]: o2 } = e6.responseTransformer(i2);
|
|
3638
3667
|
if (e6.pagingMethod === `OFFSET`) {
|
|
3639
3668
|
let e7 = n2;
|
|
3640
3669
|
return new hs({ items: a2 ?? [], fetchNextPage: () => t2({ ...e7, paging: { offset: e7.paging.offset + e7.paging.limit, limit: e7.paging.limit } }).find(), fetchPrevPage: () => t2({ ...n2, paging: { offset: Math.max(e7.paging.offset - e7.paging.limit, 0), limit: e7.paging.limit } }).find(), offset: e7.paging.offset, limit: e7.paging.limit, totalCount: o2?.total, tooManyToCount: o2?.tooManyToCount, originQuery: this });
|
|
@@ -3647,60 +3676,60 @@ function gs(e6) {
|
|
|
3647
3676
|
}, skipTo(e7) {
|
|
3648
3677
|
return t2({ ...n2, cursorPaging: { cursor: e7, limit: n2.cursorPaging.limit } });
|
|
3649
3678
|
}, eq(r2, i2) {
|
|
3650
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
3651
|
-
return t2({ ...n2, filter:
|
|
3679
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [X(e6.transformationPaths, r2)]: a2 };
|
|
3680
|
+
return t2({ ...n2, filter: Y(n2.filter, o2) });
|
|
3652
3681
|
}, ne(r2, i2) {
|
|
3653
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
3654
|
-
return t2({ ...n2, filter:
|
|
3682
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [X(e6.transformationPaths, r2)]: { $ne: a2 } };
|
|
3683
|
+
return t2({ ...n2, filter: Y(n2.filter, o2) });
|
|
3655
3684
|
}, ge(r2, i2) {
|
|
3656
|
-
let a2 = { [
|
|
3657
|
-
return t2({ ...n2, filter:
|
|
3685
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $gte: i2 } };
|
|
3686
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3658
3687
|
}, gt(r2, i2) {
|
|
3659
|
-
let a2 = { [
|
|
3660
|
-
return t2({ ...n2, filter:
|
|
3688
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $gt: i2 } };
|
|
3689
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3661
3690
|
}, le(r2, i2) {
|
|
3662
|
-
let a2 = { [
|
|
3663
|
-
return t2({ ...n2, filter:
|
|
3691
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $lte: i2 } };
|
|
3692
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3664
3693
|
}, lt(r2, i2) {
|
|
3665
|
-
let a2 = { [
|
|
3666
|
-
return t2({ ...n2, filter:
|
|
3694
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $lt: i2 } };
|
|
3695
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3667
3696
|
}, isNotEmpty(e7) {
|
|
3668
3697
|
return this.ne(e7, null);
|
|
3669
3698
|
}, isEmpty(e7) {
|
|
3670
3699
|
return this.eq(e7, null);
|
|
3671
3700
|
}, startsWith(r2, i2) {
|
|
3672
|
-
let a2 = { [
|
|
3673
|
-
return t2({ ...n2, filter:
|
|
3701
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $startsWith: i2 } };
|
|
3702
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3674
3703
|
}, endsWith(r2, i2) {
|
|
3675
|
-
let a2 = { [
|
|
3676
|
-
return t2({ ...n2, filter:
|
|
3704
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $endsWith: i2 } };
|
|
3705
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3677
3706
|
}, contains(r2, i2) {
|
|
3678
|
-
let a2 = { [
|
|
3679
|
-
return t2({ ...n2, filter:
|
|
3707
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $contains: i2 } };
|
|
3708
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3680
3709
|
}, hasSome(r2, ...i2) {
|
|
3681
|
-
let a2 = { [
|
|
3682
|
-
return t2({ ...n2, filter:
|
|
3710
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
3711
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3683
3712
|
}, hasAll(r2, ...i2) {
|
|
3684
|
-
let a2 = { [
|
|
3685
|
-
return t2({ ...n2, filter:
|
|
3713
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
3714
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3686
3715
|
}, between(e7, t3, n3) {
|
|
3687
3716
|
return this.ge(e7, t3).lt(e7, n3);
|
|
3688
3717
|
}, in(r2, i2) {
|
|
3689
|
-
let a2 = { [
|
|
3690
|
-
return t2({ ...n2, filter:
|
|
3718
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $in: i2 } };
|
|
3719
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3691
3720
|
}, exists(r2, i2 = true) {
|
|
3692
|
-
let a2 = { [
|
|
3693
|
-
return t2({ ...n2, filter:
|
|
3721
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $exists: i2 } };
|
|
3722
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3694
3723
|
}, or(e7) {
|
|
3695
3724
|
return t2({ ...n2, filter: ds(n2.filter, e7.query.filter) });
|
|
3696
3725
|
}, and(e7) {
|
|
3697
|
-
return t2({ ...n2, filter:
|
|
3726
|
+
return t2({ ...n2, filter: Y(n2.filter, e7.query.filter) });
|
|
3698
3727
|
}, not(e7) {
|
|
3699
3728
|
return t2({ ...n2, filter: fs(e7.query.filter) });
|
|
3700
3729
|
}, ascending(...r2) {
|
|
3701
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
3730
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: X(e6.transformationPaths, t3), order: `ASC` }))] });
|
|
3702
3731
|
}, descending(...r2) {
|
|
3703
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
3732
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: X(e6.transformationPaths, t3), order: `DESC` }))] });
|
|
3704
3733
|
}, skip(e7) {
|
|
3705
3734
|
return t2({ ...n2, paging: { offset: e7, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
|
|
3706
3735
|
}, limit(r2) {
|
|
@@ -3713,9 +3742,9 @@ function gs(e6) {
|
|
|
3713
3742
|
} });
|
|
3714
3743
|
return t2({ filter: {}, ...e6.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
|
|
3715
3744
|
}
|
|
3716
|
-
function
|
|
3745
|
+
function X(e6, t2) {
|
|
3717
3746
|
let n2 = Object.entries(e6).find(([e7]) => e7 === t2 || t2.startsWith(`${e7}.`))?.[0];
|
|
3718
|
-
return n2 ? t2.replace(n2, e6[n2]) :
|
|
3747
|
+
return n2 ? t2.replace(n2, e6[n2]) : nt(t2, { ...e6, ...tt });
|
|
3719
3748
|
}
|
|
3720
3749
|
var _s = `filter`;
|
|
3721
3750
|
var vs = `sort`;
|
|
@@ -3759,7 +3788,7 @@ function js(e6) {
|
|
|
3759
3788
|
var Ms = `@wix/auto_sdk_blog_likes`;
|
|
3760
3789
|
function Ns(e6) {
|
|
3761
3790
|
function t2({ host: t3 }) {
|
|
3762
|
-
let n2 = A(e6, [{ transformFn:
|
|
3791
|
+
let n2 = A(e6, [{ transformFn: st, paths: ks }]);
|
|
3763
3792
|
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName: Ms, migrationOptions: { optInTransformResponse: true }, url: js({ protoPath: `/v1/likes`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: ks }]) };
|
|
3764
3793
|
}
|
|
3765
3794
|
return t2;
|
|
@@ -3868,7 +3897,7 @@ function Qs(e6) {
|
|
|
3868
3897
|
var $s = `@wix/auto_sdk_blog_categories`;
|
|
3869
3898
|
function ec(e6) {
|
|
3870
3899
|
function t2({ host: t3 }) {
|
|
3871
|
-
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: $s, migrationOptions: { optInTransformResponse: true }, url: Qs({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Xs }, { transformFn:
|
|
3900
|
+
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: $s, migrationOptions: { optInTransformResponse: true }, url: Qs({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Xs }, { transformFn: F, paths: Zs }]) };
|
|
3872
3901
|
}
|
|
3873
3902
|
return t2;
|
|
3874
3903
|
}
|
|
@@ -3904,7 +3933,7 @@ function oc(e6) {
|
|
|
3904
3933
|
}
|
|
3905
3934
|
return e6.id ? `wix:video://v1/${e6.id}${t2}${n2}` : e6.url;
|
|
3906
3935
|
}
|
|
3907
|
-
var sc = [{ path: `post.firstPublishedDate` }, { path: `post.lastPublishedDate` }, { path: `post.heroImage.urlExpirationDate` }, { path: `post.richContent.metadata.createdTimestamp` }, { path: `post.richContent.metadata.updatedTimestamp` }, { path: `post.moderationDetails.submittedDate` }, { path: `post.moderationDetails.moderationDate` }, { path: `post.media.wixMedia.image.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
3936
|
+
var sc = [{ path: `post.firstPublishedDate` }, { path: `post.lastPublishedDate` }, { path: `post.expirationDate` }, { path: `post.heroImage.urlExpirationDate` }, { path: `post.richContent.metadata.createdTimestamp` }, { path: `post.richContent.metadata.updatedTimestamp` }, { path: `post.moderationDetails.submittedDate` }, { path: `post.moderationDetails.moderationDate` }, { path: `post.media.wixMedia.image.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
3908
3937
|
var cc = [{ path: `post.richContentCompressed` }];
|
|
3909
3938
|
var lc = [{ path: `post.heroImage.focalPoint.x` }, { path: `post.heroImage.focalPoint.y` }, { path: `post.media.wixMedia.image.focalPoint.x` }, { path: `post.media.wixMedia.image.focalPoint.y` }, { path: `post.media.wixMedia.videoV2.resolutions.poster.focalPoint.x` }, { path: `post.media.wixMedia.videoV2.resolutions.poster.focalPoint.y` }, { path: `post.media.wixMedia.videoV2.posters.focalPoint.x` }, { path: `post.media.wixMedia.videoV2.posters.focalPoint.y` }, { path: `post.metrics.averageRating` }, { path: `post.richContent.nodes.buttonData.styles.background.gradient.centerX` }, { path: `post.richContent.nodes.buttonData.styles.background.gradient.centerY` }, { path: `post.richContent.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `post.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `post.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `post.richContent.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `post.richContent.nodes.galleryData.items.image.media.duration` }, { path: `post.richContent.nodes.galleryData.items.video.media.duration` }, { path: `post.richContent.nodes.galleryData.items.video.thumbnail.duration` }, { path: `post.richContent.nodes.galleryData.options.item.ratio` }, { path: `post.richContent.nodes.imageData.image.duration` }, { path: `post.richContent.nodes.imageData.crop.x` }, { path: `post.richContent.nodes.imageData.crop.y` }, { path: `post.richContent.nodes.imageData.crop.width` }, { path: `post.richContent.nodes.imageData.crop.height` }, { path: `post.richContent.nodes.mapData.mapSettings.lat` }, { path: `post.richContent.nodes.mapData.mapSettings.lng` }, { path: `post.richContent.nodes.pollData.poll.image.duration` }, { path: `post.richContent.nodes.pollData.poll.options.image.duration` }, { path: `post.richContent.nodes.pollData.design.poll.background.image.duration` }, { path: `post.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.nodes.appEmbedData.image.duration` }, { path: `post.richContent.nodes.videoData.video.duration` }, { path: `post.richContent.nodes.videoData.thumbnail.duration` }, { path: `post.richContent.nodes.audioData.audio.duration` }, { path: `post.richContent.nodes.audioData.coverImage.duration` }, { path: `post.richContent.nodes.layoutData.backgroundImage.media.duration` }, { path: `post.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `post.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `post.richContent.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `post.richContent.nodes.layoutData.backdropImage.media.duration` }, { path: `post.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `post.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `post.richContent.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `post.richContent.nodes.layoutData.background.gradient.centerX` }, { path: `post.richContent.nodes.layoutData.background.gradient.centerY` }, { path: `post.richContent.nodes.layoutData.background.gradient.stops.position` }, { path: `post.richContent.nodes.layoutData.backdrop.gradient.centerX` }, { path: `post.richContent.nodes.layoutData.backdrop.gradient.centerY` }, { path: `post.richContent.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `post.richContent.nodes.shapeData.shape.duration` }, { path: `post.richContent.nodes.cardData.background.gradient.centerX` }, { path: `post.richContent.nodes.cardData.background.gradient.centerY` }, { path: `post.richContent.nodes.cardData.background.gradient.stops.position` }, { path: `post.richContent.nodes.cardData.backgroundImage.media.duration` }, { path: `post.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `post.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `post.richContent.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `post.richContent.nodes.tocData.fontSize` }, { path: `post.richContent.nodes.tocData.itemSpacing` }, { path: `post.richContent.nodes.smartBlockCellData.shape.duration` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.stops.position` }];
|
|
3910
3939
|
var uc = [{ path: `metrics.averageRating` }];
|
|
@@ -3914,20 +3943,20 @@ function dc(e6) {
|
|
|
3914
3943
|
var fc = `@wix/auto_sdk_blog_posts`;
|
|
3915
3944
|
function pc(e6) {
|
|
3916
3945
|
function t2({ host: t3 }) {
|
|
3917
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: sc }, { transformFn: fn, paths: cc }, { transformFn:
|
|
3946
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: sc }, { transformFn: fn, paths: cc }, { transformFn: F, paths: lc }]) };
|
|
3918
3947
|
}
|
|
3919
3948
|
return t2;
|
|
3920
3949
|
}
|
|
3921
3950
|
function mc(e6) {
|
|
3922
3951
|
function t2({ host: t3 }) {
|
|
3923
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn:
|
|
3952
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: F, paths: uc }]) };
|
|
3924
3953
|
}
|
|
3925
3954
|
return t2;
|
|
3926
3955
|
}
|
|
3927
3956
|
var hc = [{ path: `post.url` }, { path: `post.translations.url` }];
|
|
3928
3957
|
var gc = [{ path: `post.heroImage` }, { path: `post.media.wixMedia.image` }];
|
|
3929
3958
|
var _c = [{ path: `post.media.wixMedia.videoV2` }];
|
|
3930
|
-
var
|
|
3959
|
+
var Z = ((e6) => (e6.UNKNOWN = `UNKNOWN`, e6.COUNTERS = `COUNTERS`, e6.URL = `URL`, e6.CONTENT_TEXT = `CONTENT_TEXT`, e6.METRICS = `METRICS`, e6.SEO = `SEO`, e6.CONTENT = `CONTENT`, e6.INTERNAL_ID = `INTERNAL_ID`, e6.CONTACT_ID = `CONTACT_ID`, e6.RICH_CONTENT = `RICH_CONTENT`, e6.RICH_CONTENT_STRING = `RICH_CONTENT_STRING`, e6.RICH_CONTENT_COMPRESSED = `RICH_CONTENT_COMPRESSED`, e6.TRANSLATIONS = `TRANSLATIONS`, e6.REFERENCE_ID = `REFERENCE_ID`, e6.EXCLUDE_PAID_CONTENT = `EXCLUDE_PAID_CONTENT`, e6.SEO_DATA = `SEO_DATA`, e6.OWNER = `OWNER`, e6.HAS_UNPUBLISHED_CHANGES = `HAS_UNPUBLISHED_CHANGES`, e6.HEADING = `HEADING`, e6.IMAGE = `IMAGE`, e6))(Z || {});
|
|
3931
3960
|
async function vc(e6, t2) {
|
|
3932
3961
|
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = pc(D({ postId: e6, fieldsets: t2?.fieldsets }, []));
|
|
3933
3962
|
r2?.onSiteCall?.();
|
|
@@ -3966,7 +3995,7 @@ function Ec(e6) {
|
|
|
3966
3995
|
var Dc = `@wix/auto_sdk_blog_tags`;
|
|
3967
3996
|
function Oc(e6) {
|
|
3968
3997
|
function t2({ host: t3 }) {
|
|
3969
|
-
let n2 = A(e6, [{ transformFn:
|
|
3998
|
+
let n2 = A(e6, [{ transformFn: dn, paths: wc }]);
|
|
3970
3999
|
return { entityFqdn: `wix.blog.v3.tag`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.TagService.QueryTags`, packageName: Dc, migrationOptions: { optInTransformResponse: true }, url: Ec({ protoPath: `/v3/tags/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Tc }]) };
|
|
3971
4000
|
}
|
|
3972
4001
|
return t2;
|
|
@@ -4085,7 +4114,7 @@ var Qc = (e6, t2, n2) => {
|
|
|
4085
4114
|
let r2 = Zc(t2.nodes.map((e7) => e7.layoutData ? { ...e7, layoutData: { ...e7.layoutData, banner: void 0 } } : e7), n2);
|
|
4086
4115
|
return { ...e6, nodes: [...e6.nodes ?? [], ...r2] };
|
|
4087
4116
|
};
|
|
4088
|
-
var $c = [{ path: `posts.firstPublishedDate` }, { path: `posts.lastPublishedDate` }, { path: `posts.heroImage.urlExpirationDate` }, { path: `posts.richContent.metadata.createdTimestamp` }, { path: `posts.richContent.metadata.updatedTimestamp` }, { path: `posts.moderationDetails.submittedDate` }, { path: `posts.moderationDetails.moderationDate` }, { path: `posts.media.wixMedia.image.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
4117
|
+
var $c = [{ path: `posts.firstPublishedDate` }, { path: `posts.lastPublishedDate` }, { path: `posts.expirationDate` }, { path: `posts.heroImage.urlExpirationDate` }, { path: `posts.richContent.metadata.createdTimestamp` }, { path: `posts.richContent.metadata.updatedTimestamp` }, { path: `posts.moderationDetails.submittedDate` }, { path: `posts.moderationDetails.moderationDate` }, { path: `posts.media.wixMedia.image.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
4089
4118
|
var el = [{ path: `posts.richContentCompressed` }];
|
|
4090
4119
|
var tl = [{ path: `posts.heroImage.focalPoint.x` }, { path: `posts.heroImage.focalPoint.y` }, { path: `posts.media.wixMedia.image.focalPoint.x` }, { path: `posts.media.wixMedia.image.focalPoint.y` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.focalPoint.x` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.focalPoint.y` }, { path: `posts.media.wixMedia.videoV2.posters.focalPoint.x` }, { path: `posts.media.wixMedia.videoV2.posters.focalPoint.y` }, { path: `posts.metrics.averageRating` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.centerX` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.centerY` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `posts.richContent.nodes.galleryData.items.image.media.duration` }, { path: `posts.richContent.nodes.galleryData.items.video.media.duration` }, { path: `posts.richContent.nodes.galleryData.items.video.thumbnail.duration` }, { path: `posts.richContent.nodes.galleryData.options.item.ratio` }, { path: `posts.richContent.nodes.imageData.image.duration` }, { path: `posts.richContent.nodes.imageData.crop.x` }, { path: `posts.richContent.nodes.imageData.crop.y` }, { path: `posts.richContent.nodes.imageData.crop.width` }, { path: `posts.richContent.nodes.imageData.crop.height` }, { path: `posts.richContent.nodes.mapData.mapSettings.lat` }, { path: `posts.richContent.nodes.mapData.mapSettings.lng` }, { path: `posts.richContent.nodes.pollData.poll.image.duration` }, { path: `posts.richContent.nodes.pollData.poll.options.image.duration` }, { path: `posts.richContent.nodes.pollData.design.poll.background.image.duration` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.nodes.appEmbedData.image.duration` }, { path: `posts.richContent.nodes.videoData.video.duration` }, { path: `posts.richContent.nodes.videoData.thumbnail.duration` }, { path: `posts.richContent.nodes.audioData.audio.duration` }, { path: `posts.richContent.nodes.audioData.coverImage.duration` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.media.duration` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.backdropImage.media.duration` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.background.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.background.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.background.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `posts.richContent.nodes.shapeData.shape.duration` }, { path: `posts.richContent.nodes.cardData.background.gradient.centerX` }, { path: `posts.richContent.nodes.cardData.background.gradient.centerY` }, { path: `posts.richContent.nodes.cardData.background.gradient.stops.position` }, { path: `posts.richContent.nodes.cardData.backgroundImage.media.duration` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.tocData.fontSize` }, { path: `posts.richContent.nodes.tocData.itemSpacing` }, { path: `posts.richContent.nodes.smartBlockCellData.shape.duration` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.stops.position` }];
|
|
4091
4120
|
var nl = [{ path: `sort.origin.latitude` }, { path: `sort.origin.longitude` }, { path: `query.sort.origin.latitude` }, { path: `query.sort.origin.longitude` }];
|
|
@@ -4095,8 +4124,8 @@ function rl(e6) {
|
|
|
4095
4124
|
var il = `@wix/auto_sdk_blog_posts`;
|
|
4096
4125
|
function al(e6) {
|
|
4097
4126
|
function t2({ host: t3 }) {
|
|
4098
|
-
let n2 = A(e6, [{ transformFn:
|
|
4099
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: il, migrationOptions: { optInTransformResponse: true }, url: rl({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: $c }, { transformFn: fn, paths: el }, { transformFn:
|
|
4127
|
+
let n2 = A(e6, [{ transformFn: dn, paths: nl }]);
|
|
4128
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: il, migrationOptions: { optInTransformResponse: true }, url: rl({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: $c }, { transformFn: fn, paths: el }, { transformFn: F, paths: tl }]) };
|
|
4100
4129
|
}
|
|
4101
4130
|
return t2;
|
|
4102
4131
|
}
|
|
@@ -4138,9 +4167,9 @@ var fl = (e6, t2, n2) => {
|
|
|
4138
4167
|
});
|
|
4139
4168
|
return Promise.race([e6, i2]).finally(() => clearTimeout(r2));
|
|
4140
4169
|
};
|
|
4141
|
-
|
|
4142
|
-
var pl = [
|
|
4143
|
-
|
|
4170
|
+
Z.RICH_CONTENT, Z.SEO, Z.URL, Z.CONTENT_TEXT;
|
|
4171
|
+
var pl = [Z.RICH_CONTENT, Z.URL];
|
|
4172
|
+
Z.URL, Z.METRICS;
|
|
4144
4173
|
var ml = (e6) => {
|
|
4145
4174
|
let { status: t2, details: n2 } = e6 ?? {};
|
|
4146
4175
|
return t2 === 404 || String(n2?.applicationError?.code ?? ``).includes(`NOT_FOUND`);
|
|
@@ -4210,6 +4239,33 @@ var kl = (e6) => {
|
|
|
4210
4239
|
let { _id: t2, categoryIds: n2, relatedPostIds: r2 } = e6 ?? {};
|
|
4211
4240
|
return { currentPostId: t2 ?? void 0, categoryIds: n2, relatedPostIds: r2 };
|
|
4212
4241
|
};
|
|
4242
|
+
v((e6, t2) => {
|
|
4243
|
+
(function() {
|
|
4244
|
+
var e7 = {}.hasOwnProperty;
|
|
4245
|
+
function n2() {
|
|
4246
|
+
for (var e8 = ``, t3 = 0; t3 < arguments.length; t3++) {
|
|
4247
|
+
var n3 = arguments[t3];
|
|
4248
|
+
n3 && (e8 = i2(e8, r2(n3)));
|
|
4249
|
+
}
|
|
4250
|
+
return e8;
|
|
4251
|
+
}
|
|
4252
|
+
function r2(t3) {
|
|
4253
|
+
if (typeof t3 == `string` || typeof t3 == `number`) return t3;
|
|
4254
|
+
if (typeof t3 != `object`) return ``;
|
|
4255
|
+
if (Array.isArray(t3)) return n2.apply(null, t3);
|
|
4256
|
+
if (t3.toString !== Object.prototype.toString && !t3.toString.toString().includes(`[native code]`)) return t3.toString();
|
|
4257
|
+
var r3 = ``;
|
|
4258
|
+
for (var a2 in t3) e7.call(t3, a2) && t3[a2] && (r3 = i2(r3, a2));
|
|
4259
|
+
return r3;
|
|
4260
|
+
}
|
|
4261
|
+
function i2(e8, t3) {
|
|
4262
|
+
return t3 ? e8 ? e8 + ` ` + t3 : e8 + t3 : e8;
|
|
4263
|
+
}
|
|
4264
|
+
t2 !== void 0 && t2.exports ? (n2.default = n2, t2.exports = n2) : typeof define == `function` && typeof define.amd == `object` && define.amd ? define(`classnames`, [], function() {
|
|
4265
|
+
return n2;
|
|
4266
|
+
}) : window.classNames = n2;
|
|
4267
|
+
})();
|
|
4268
|
+
})();
|
|
4213
4269
|
var Al = { post: `post`, feed: `feed`, relatedPosts: `related-posts`, comments: `comments`, seo: `seo`, likes: `likes` };
|
|
4214
4270
|
var jl = (e6) => {
|
|
4215
4271
|
try {
|
|
@@ -4219,11 +4275,11 @@ var jl = (e6) => {
|
|
|
4219
4275
|
}
|
|
4220
4276
|
};
|
|
4221
4277
|
var Ml = (e6, t2) => e6 && typeof e6[t2] == `function` ? e6 : null;
|
|
4222
|
-
function Nl(e6, t2, { feature: n2, action: r2, level: i2 = `error`,
|
|
4223
|
-
let
|
|
4224
|
-
if (!
|
|
4225
|
-
let
|
|
4226
|
-
|
|
4278
|
+
function Nl(e6, t2, { feature: n2, action: r2, level: i2 = `error`, tags: a2, contexts: o2 }) {
|
|
4279
|
+
let s2 = Ml(e6, `captureException`);
|
|
4280
|
+
if (!s2) return;
|
|
4281
|
+
let c2 = t2 instanceof Error ? t2 : Error(String(t2));
|
|
4282
|
+
s2.captureException(c2, { level: i2, tags: { feature: n2, action: r2, ...a2 }, ...o2 ? { contexts: o2 } : {} });
|
|
4227
4283
|
}
|
|
4228
4284
|
function Pl(e6, t2, { feature: n2, tags: r2 }, i2) {
|
|
4229
4285
|
let a2 = Ml(e6, `startSpanManual`);
|
|
@@ -4237,7 +4293,7 @@ var Fl = class extends import_react.Component {
|
|
|
4237
4293
|
return { error: e6 ?? Error(`Unknown render error`) };
|
|
4238
4294
|
}
|
|
4239
4295
|
componentDidCatch(e6, t2) {
|
|
4240
|
-
Nl(this.props.monitoringClient, e6, { feature: this.props.feature, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
4296
|
+
Nl(this.props.monitoringClient, e6, { feature: this.props.feature, action: `render`, tags: this.props.component ? { component: this.props.component } : void 0, contexts: { react: { componentStack: t2.componentStack } } });
|
|
4241
4297
|
}
|
|
4242
4298
|
render() {
|
|
4243
4299
|
if (this.state.error === void 0) return this.props.children;
|
|
@@ -4280,7 +4336,7 @@ var ql = async (e6) => {
|
|
|
4280
4336
|
let [t2, n2] = await Promise.allSettled([qs().eq(`fqdn`, Ul).eq(`entityId`, e6).limit(1).find(), Cc(e6)]), r2 = n2.status === `fulfilled` ? n2.value.metrics : void 0;
|
|
4281
4337
|
return { liked: t2.status === `fulfilled` && t2.value.items.length > 0, likeCount: Kl(r2?.likes), viewCount: Kl(r2?.views), commentCount: Kl(r2?.comments) };
|
|
4282
4338
|
};
|
|
4283
|
-
var Jl =
|
|
4339
|
+
var Jl = I(`@wix/site-service-editor-context`);
|
|
4284
4340
|
var Yl = () => {
|
|
4285
4341
|
try {
|
|
4286
4342
|
return !!(0, import_services_manager_react.useService)(Jl).previewMode;
|
|
@@ -4374,10 +4430,10 @@ var ru = () => {
|
|
|
4374
4430
|
}
|
|
4375
4431
|
};
|
|
4376
4432
|
var iu = (e6, t2, n2) => typeof e6 != `number` || !Number.isFinite(e6) || e6 < 0 ? `` : new Intl.NumberFormat(n2, t2 === `compact` ? { notation: `compact`, maximumFractionDigits: 1 } : void 0).format(e6);
|
|
4377
|
-
var
|
|
4433
|
+
var Q = { timeToRead: `post.time-to-read`, viewCount: `post.view-count`, commentCount: `post.comment-count`, likeCount: `post.like-count`, noPostsTitle: `post-list.empty-state.title`, noPostsDescription: `post-list.empty-state.description`, noRelatedPostsTitle: `related-posts.empty-state.title`, noRelatedPostsDescription: `related-posts.empty-state.description`, canvasPostTitle: `canvas.post-title`, canvasAuthorName: `canvas.author-name`, canvasExcerpt: `canvas.excerpt`, canvasContent: `canvas.content`, canvasCategory: `canvas.category`, canvasCategoryNumbered: `canvas.category-numbered`, canvasTagNumbered: `canvas.tag-numbered`, canvasCoverAlt: `cover-media.placeholder-alt`, canvasAuthorPhotoAlt: `canvas.author-photo-alt` };
|
|
4378
4434
|
var au = (e6, t2) => {
|
|
4379
4435
|
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: iu(r2, `full`, t2) });
|
|
4380
|
-
return { timeToRead: (t3) => e6(
|
|
4436
|
+
return { timeToRead: (t3) => e6(Q.timeToRead, { count: t3 }), viewCount: n2(Q.viewCount), commentCount: n2(Q.commentCount), likeCount: n2(Q.likeCount), noPostsEmptyState: () => ({ title: e6(Q.noPostsTitle), description: e6(Q.noPostsDescription) }), noRelatedPostsEmptyState: () => ({ title: e6(Q.noRelatedPostsTitle), description: e6(Q.noRelatedPostsDescription) }), canvas: { postTitle: () => e6(Q.canvasPostTitle), authorName: () => e6(Q.canvasAuthorName), excerpt: () => e6(Q.canvasExcerpt), content: () => e6(Q.canvasContent), category: () => e6(Q.canvasCategory), categoryNumbered: (t3) => e6(Q.canvasCategoryNumbered, { number: t3 }), tagNumbered: (t3) => e6(Q.canvasTagNumbered, { number: t3 }), coverAlt: () => e6(Q.canvasCoverAlt), authorPhotoAlt: () => e6(Q.canvasAuthorPhotoAlt) } };
|
|
4381
4437
|
};
|
|
4382
4438
|
var ou = (0, import_react.createContext)({ isEditor: false, isPreview: false });
|
|
4383
4439
|
var su = () => (0, import_react.useContext)(ou);
|
|
@@ -4402,7 +4458,7 @@ var fu = (e6) => {
|
|
|
4402
4458
|
};
|
|
4403
4459
|
var pu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
|
|
4404
4460
|
var mu = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
4405
|
-
var
|
|
4461
|
+
var $ = (e6) => ({ text: e6, html: `<p>${mu(e6)}</p>`, linkList: [] });
|
|
4406
4462
|
var hu = 6e4;
|
|
4407
4463
|
var gu = hu * 60;
|
|
4408
4464
|
var _u = gu * 24;
|
|
@@ -4514,59 +4570,59 @@ var Uu = (e6, t2) => {
|
|
|
4514
4570
|
var Wu = { href: `#`, target: `_self` };
|
|
4515
4571
|
var Gu = (e6, t2) => {
|
|
4516
4572
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4517
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel:
|
|
4573
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: Uu(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
|
|
4518
4574
|
};
|
|
4519
4575
|
var Ku = 2;
|
|
4520
4576
|
var qu = (e6) => Array.from({ length: Ku }, (t2, n2) => {
|
|
4521
4577
|
let r2 = e6.canvas.categoryNumbered(n2 + 1);
|
|
4522
|
-
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel:
|
|
4578
|
+
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: Wu, categoryItem: { label: r2, slug: `` } };
|
|
4523
4579
|
});
|
|
4524
4580
|
var Ju = (e6, t2) => {
|
|
4525
4581
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4526
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel:
|
|
4582
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: Uu(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
|
|
4527
4583
|
};
|
|
4528
4584
|
var Yu = 3;
|
|
4529
4585
|
var Xu = (e6) => Array.from({ length: Yu }, (t2, n2) => {
|
|
4530
4586
|
let r2 = e6.canvas.tagNumbered(n2 + 1);
|
|
4531
|
-
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel:
|
|
4587
|
+
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: Wu, tagItem: { label: r2, slug: `` } };
|
|
4532
4588
|
});
|
|
4533
4589
|
var Zu = 1;
|
|
4534
|
-
var
|
|
4535
|
-
var
|
|
4536
|
-
var
|
|
4537
|
-
var
|
|
4538
|
-
var
|
|
4539
|
-
var
|
|
4540
|
-
var
|
|
4541
|
-
var
|
|
4590
|
+
var Qu = { views: 120, comments: 4, likes: 12 };
|
|
4591
|
+
var $u = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
|
|
4592
|
+
var ed = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
|
|
4593
|
+
var td = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
|
|
4594
|
+
var nd = { nodes: [] };
|
|
4595
|
+
var rd = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: nd, authorName: $(``), authorImage: void 0, timeToRead: $(``), publishedDate: $(``), viewCount: $(``), commentCount: $(``), likeCount: $(``), postCategories: [], itemCategoryLabel: $(``), postTags: [], hasCoverImage: false, hasExcerpt: false, hasTags: false, publishedDateValue: void 0, minutesToReadValue: void 0, viewCountValue: void 0, commentCountValue: void 0 });
|
|
4596
|
+
var id = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? rd() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: Vu(e6), coverMedia: Bu(e6, a2), richContent: e6?.richContent ?? $u(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: Cu(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(Zu) : ``), publishedDate: $(bu(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: ed(n2?.views, Qu.views, c2, o2.viewCount), commentCount: ed(n2?.comments, Qu.comments, c2, o2.commentCount), likeCount: ed(n2?.likes, Qu.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? qu(o2) : r2.map((e7) => Gu(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? Xu(o2) : i2.map((e7) => Ju(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && Vu(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: fu(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: pu(e6?.minutesToRead) ?? (c2 ? Zu : void 0), viewCountValue: td(n2?.views, Qu.views, c2), commentCountValue: td(n2?.comments, Qu.comments, c2) };
|
|
4597
|
+
var ad = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
|
|
4542
4598
|
let { t: a2 } = yo(), o2 = nu(), s2 = (0, import_react.useMemo)(() => au(a2, o2), [a2, o2]), c2 = Hl(e6.fetchedAt), l2 = uu(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = tu(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Bl(er), y2 = Bl(`tag`), b2 = (0, import_react.useMemo)(() => kl(e6.post), [e6]), x2 = ru(), S2 = (0, import_react.useMemo)(() => e6.post?.richContent && e6.paywall ? Qc(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
|
|
4543
4599
|
return (0, import_react.useMemo)(() => {
|
|
4544
|
-
let n3 =
|
|
4545
|
-
return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, commentingEnabled: e6.post?.commentingEnabled ?? void 0, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, itemLink: u2, postUrl: a3?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount:
|
|
4600
|
+
let n3 = id(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : lr(e6.post, i2), u2 = a3 ?? (l2 ? du(i2) : void 0);
|
|
4601
|
+
return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, commentingEnabled: e6.post?.commentingEnabled ?? void 0, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, itemLink: u2, postUrl: a3?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount: $(s2.likeCount(f2)) } : {}, isLiked: d2, likeCountValue: f2, isLikeCountLoaded: p2, toggleLike: g2, liveLikes: _2, clockValue: c2, isLoadingPost: false, hasError: t2, isEmpty: !e6.post && !l2 };
|
|
4546
4602
|
}, [e6, t2, b2, S2, s2, o2, c2, f2, d2, p2, m2, h2, g2, _2, l2, r2, i2, v2, y2]);
|
|
4547
4603
|
};
|
|
4548
|
-
var
|
|
4549
|
-
var
|
|
4550
|
-
var
|
|
4604
|
+
var od = (e6) => ({ post: e6, hasError: false });
|
|
4605
|
+
var sd = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
|
|
4606
|
+
var cd = (e6) => {
|
|
4551
4607
|
throw e6;
|
|
4552
4608
|
};
|
|
4553
|
-
var
|
|
4609
|
+
var ld = { ...rd(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4554
4610
|
}, liveLikes: void 0, postUrl: void 0, itemLink: void 0, clockValue: 0, relatedPostsSource: { currentPostId: void 0, categoryIds: void 0, relatedPostIds: void 0 }, commentingEnabled: void 0, isLoadingPost: true, hasError: false, isEmpty: false };
|
|
4555
|
-
var
|
|
4556
|
-
var
|
|
4557
|
-
var
|
|
4558
|
-
var
|
|
4559
|
-
let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, (0, import_react.useCallback)(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 =
|
|
4611
|
+
var ud = { ...ld, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4612
|
+
var dd = 2500;
|
|
4613
|
+
var fd = Promise.resolve(od({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
|
|
4614
|
+
var pd = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
|
|
4615
|
+
let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, (0, import_react.useCallback)(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = ad({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: dr() });
|
|
4560
4616
|
return mr(fr.postByIdProvider, o2 ? `error` : c2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: l2, children: t2 });
|
|
4561
4617
|
};
|
|
4562
|
-
function
|
|
4618
|
+
function md({ children: t2, postPicker: n2 }) {
|
|
4563
4619
|
let i2 = zl(n2), a2 = Gn(), o2 = gr(), s2 = (0, import_react.useMemo)(() => jl(zn), []), { i18n: c2, locale: l2 } = Go($o), d2 = qn(() => i2 ? Un(Mo({ key: `blog-builder:post-by-id:${i2}`, warmupData: o2, fetchData: () => {
|
|
4564
4620
|
let e6 = Dl(i2, a2);
|
|
4565
|
-
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6,
|
|
4566
|
-
} }),
|
|
4567
|
-
return (0, import_jsx_runtime.jsx)(bo, { i18n: c2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value:
|
|
4621
|
+
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, dd, `post-by-id`) : e6));
|
|
4622
|
+
} }), od, a2 ? cd : sd) : fd, [i2, a2, o2, s2]);
|
|
4623
|
+
return (0, import_jsx_runtime.jsx)(bo, { i18n: c2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ld, children: t2 }), children: [(0, import_jsx_runtime.jsx)(Wo, { i18n: c2, locale: l2 }), (0, import_jsx_runtime.jsx)(Fl, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ud, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: (0, import_jsx_runtime.jsx)(pd, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
|
|
4568
4624
|
}
|
|
4569
|
-
var
|
|
4625
|
+
var hd = Mn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
|
|
4570
4626
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4571
4627
|
0 && (module.exports = {
|
|
4572
4628
|
PostByIdProvider,
|